:root {
  color-scheme: dark;
  --ink: #f7f8fc;
  --ink-soft: #c8cddb;
  --ink-muted: #929bad;
  --canvas: #090b12;
  --canvas-glow: #10152a;
  --rail: #0d1019;
  --surface: #131722;
  --surface-raised: #191e2c;
  --surface-soft: #202638;
  --line: #30384c;
  --line-strong: #45516b;
  --mint: #72e6bf;
  --mint-ink: #06261c;
  --sky: #8ec8ff;
  --violet: #b4a5ff;
  --amber: #ffd17a;
  --coral: #ff9b91;
  --focus: #f6dd72;
  --rail-width: 17.5rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  background: var(--canvas);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  min-height: 100%;
  overflow-x: clip;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 72% -12%, rgba(88, 109, 220, 0.16), transparent 31rem),
    linear-gradient(150deg, var(--canvas) 0%, #0b0e17 62%, #0d1019 100%);
  color: var(--ink);
}

button,
select,
input,
a {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button,
select,
input {
  color: inherit;
}

button,
a,
select,
input {
  min-height: 2.75rem;
}

a {
  color: var(--sky);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  padding: 0 1rem;
  border-radius: 0.55rem;
  background: var(--focus);
  color: #171203;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.product-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: 100vh;
}

.product-rail {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--rail-width);
  height: 100vh;
  padding: 1.25rem 1rem;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(13, 16, 25, 0.98);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 4rem;
  padding: 0.35rem 0.35rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.brand-glyph {
  display: grid;
  flex: 0 0 auto;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  border-radius: 0.8rem;
  background: linear-gradient(145deg, var(--mint), #a5f0dc);
  box-shadow: 0 0.8rem 2.8rem rgba(114, 230, 191, 0.13);
  color: var(--mint-ink);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.brand-copy {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.brand-copy strong {
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.brand-copy span {
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.rail-close {
  display: none;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: transparent;
  cursor: pointer;
}

.primary-navigation {
  display: grid;
  gap: 0.4rem;
  padding: 1.4rem 0;
}

.navigation-label,
.context-label,
.route-kicker {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.navigation-label {
  padding: 0 0.65rem 0.35rem;
}

.navigation-link {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  min-height: 3.8rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.navigation-link:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.navigation-link[aria-current="page"] {
  border-color: rgba(114, 230, 191, 0.34);
  background: rgba(114, 230, 191, 0.09);
  color: var(--ink);
}

.navigation-number {
  color: var(--ink-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.64rem;
}

.navigation-link[aria-current="page"] .navigation-number {
  color: var(--mint);
}

.navigation-link > span:last-child {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.navigation-link strong {
  font-size: 0.82rem;
}

.navigation-link small {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 0.66rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.7rem;
  margin-top: auto;
  padding: 1rem 0.65rem 0.35rem;
  border-top: 1px solid var(--line);
}

.rail-state > span:last-child {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.rail-state strong {
  font-size: 0.72rem;
  line-height: 1.35;
}

.rail-state small {
  color: var(--ink-muted);
  font-size: 0.65rem;
  line-height: 1.45;
}

.state-signal {
  width: 0.65rem;
  height: 0.65rem;
  margin-top: 0.2rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--amber);
}

.state-signal.is-ready {
  color: var(--mint);
  background: currentColor;
}

.state-signal.is-forbidden,
.state-signal.is-unavailable {
  color: var(--coral);
}

.state-signal.is-authentication,
.state-signal.is-rate,
.state-signal.is-offline {
  color: var(--amber);
}

.navigation-scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(2, 4, 9, 0.72);
}

.product-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 100vh;
}

.product-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 5.2rem;
  padding: 0.9rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid rgba(48, 56, 76, 0.75);
  background: rgba(9, 11, 18, 0.94);
}

.navigation-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.65rem;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
}

.header-context {
  display: grid;
  gap: 0.24rem;
  min-width: 0;
}

.header-context strong {
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-area {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  margin-left: auto;
}

.tenant-form {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.tenant-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tenant-form select {
  max-width: 14rem;
  padding: 0 2.2rem 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--surface);
}

.tenant-form select:disabled {
  opacity: 0.8;
}

.account-summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.account-summary > span {
  max-width: 12rem;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiet-button,
.diagnostics-button,
.migration-notice button {
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 750;
}

.quiet-button:hover,
.diagnostics-button:hover,
.migration-notice button:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.quiet-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.product-main {
  width: min(72rem, 100%);
  padding: clamp(2rem, 6vw, 5.2rem) clamp(1rem, 5vw, 4rem);
}

.route-introduction {
  max-width: 52rem;
  margin-bottom: clamp(1.5rem, 4vw, 2.6rem);
}

.route-kicker {
  margin-bottom: 0.7rem;
  color: var(--mint);
}

h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.1rem);
  font-weight: 760;
  line-height: 0.99;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.route-purpose {
  max-width: 46rem;
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(0.92rem, 2vw, 1.08rem);
  line-height: 1.65;
}

.migration-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 1.2rem;
  padding: 0.8rem;
  border: 1px solid rgba(142, 200, 255, 0.3);
  border-radius: 0.7rem;
  background: rgba(142, 200, 255, 0.07);
  color: var(--ink-soft);
}

.migration-notice > span {
  color: var(--sky);
  font-weight: 900;
}

.migration-notice p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.5;
}

.route-content {
  max-width: 100%;
}

.state-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  min-height: 12rem;
  padding: clamp(1.2rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background:
    linear-gradient(145deg, rgba(25, 30, 44, 0.94), rgba(19, 23, 34, 0.96));
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.14);
}

.state-card.is-gated {
  border-color: rgba(114, 230, 191, 0.32);
}

.state-card.is-forbidden,
.state-card.is-unavailable {
  border-color: rgba(255, 155, 145, 0.34);
}

.state-card.is-authentication,
.state-card.is-rate,
.state-card.is-offline {
  border-color: rgba(255, 209, 122, 0.34);
}

.state-icon {
  display: grid;
  min-width: 3rem;
  height: 3rem;
  padding: 0 0.4rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 0.78rem;
  background: var(--surface-soft);
  color: var(--violet);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  font-weight: 850;
}

.is-gated .state-icon {
  color: var(--mint);
}

.is-forbidden .state-icon,
.is-unavailable .state-icon {
  color: var(--coral);
}

.is-authentication .state-icon,
.is-rate .state-icon,
.is-offline .state-icon {
  color: var(--amber);
}

.state-copy {
  min-width: 0;
}

.state-copy h2 {
  margin: 0;
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.state-copy > p {
  max-width: 46rem;
  margin: 0.7rem 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.65;
}

.state-details {
  display: grid;
  gap: 0;
  margin: 1.25rem 0 0;
}

.state-details div {
  display: grid;
  grid-template-columns: minmax(7rem, 0.35fr) minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.72rem 0;
  border-top: 1px solid var(--line);
}

.state-details dt,
.state-details dd {
  font-size: 0.7rem;
  line-height: 1.45;
}

.state-details dt {
  color: var(--ink-muted);
}

.state-details dd {
  margin: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.state-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8rem;
  padding: 0 1rem;
  border: 1px solid var(--mint);
  border-radius: 0.65rem;
  background: var(--mint);
  color: var(--mint-ink);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
}

.state-action:hover {
  background: #9cebd2;
}

.documentation-summary,
.documentation-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(19, 23, 34, 0.84);
}

.documentation-summary {
  padding: 0.5rem clamp(1rem, 3vw, 1.5rem);
}

.documentation-section {
  margin-top: 1.2rem;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.documentation-section > h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  letter-spacing: -0.025em;
}

.documentation-help,
.operation-count,
.empty-filter {
  color: var(--ink-muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.download-card,
.operation-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface-raised);
}

.download-card {
  display: flex;
  flex-direction: column;
}

.download-card h3,
.operation-card h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
}

.download-card .state-details {
  margin-bottom: 1rem;
}

.documentation-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-width: 9rem;
  padding: 0 0.9rem;
  border: 1px solid var(--mint);
  border-radius: 0.6rem;
  background: transparent;
  color: var(--mint);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 850;
  text-decoration: none;
}

.documentation-button:hover {
  background: rgba(114, 230, 191, 0.09);
}

.documentation-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.documentation-toolbar {
  display: grid;
  grid-template-columns: minmax(12rem, 2fr) minmax(9rem, 1fr);
  gap: 0.8rem;
  margin-top: 1rem;
}

.documentation-filter,
.try-field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.documentation-filter input,
.documentation-filter select,
.try-field input,
.try-field select {
  width: 100%;
  min-width: 0;
  padding: 0 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.55rem;
  background: var(--surface-soft);
  color: var(--ink);
}

.operation-list {
  display: grid;
  gap: 0.85rem;
}

.operation-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  margin-bottom: 0.8rem;
}

.method-badge {
  flex: 0 0 auto;
  padding: 0.26rem 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.63rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.method-badge.is-get,
.method-badge.is-head {
  border-color: var(--mint);
  color: var(--mint);
}

.method-badge.is-post,
.method-badge.is-put,
.method-badge.is-patch,
.method-badge.is-delete {
  border-color: var(--amber);
  color: var(--amber);
}

.operation-path {
  min-width: 0;
  color: var(--sky);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.operation-card > p {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.55;
}

.try-disabled {
  margin: 1rem 0 0;
  padding: 0.75rem;
  border-left: 3px solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink-muted) !important;
}

.try-form {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.try-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.7rem;
}

.try-output {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.try-result-label {
  color: var(--mint);
  font-weight: 750;
}

.try-response {
  max-height: 28rem;
  margin: 0;
  padding: 0.9rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--canvas);
  color: var(--ink-soft);
  font-size: 0.68rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.product-footer {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 4.6rem;
  padding: 0.8rem clamp(1rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.product-footer > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.product-footer code {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.diagnostics-button {
  margin-left: auto;
}

.diagnostics-status {
  max-width: 15rem;
  color: var(--ink-soft);
}

.noscript-notice {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 1rem;
  border: 2px solid #191003;
  border-radius: 0.7rem;
  background: var(--amber);
  color: #191003;
  font-weight: 800;
  line-height: 1.45;
}

.credentials-portal {
  display: grid;
  gap: 1.25rem;
  width: 100%;
}

.portal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.portal-header h2,
.portal-header p {
  margin: 0;
}

.portal-header h2 {
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  letter-spacing: -0.03em;
}

.portal-header p {
  max-width: 44rem;
  margin-top: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.55;
}

.portal-button,
.portal-tab,
.dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.58rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.65rem;
  background: var(--surface-raised);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.portal-button:hover,
.portal-tab:hover,
.dialog-close:hover {
  border-color: var(--sky);
  background: var(--surface-soft);
}

.portal-button:disabled,
.portal-tab:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.portal-button.is-primary {
  border-color: var(--mint);
  background: var(--mint);
  color: var(--mint-ink);
}

.portal-button.is-primary:hover {
  background: #9cebd2;
}

.portal-button.is-danger {
  border-color: rgba(255, 155, 145, 0.75);
  color: #ffd4cf;
}

.portal-button.is-danger:hover {
  background: rgba(255, 155, 145, 0.12);
}

.portal-tabs {
  display: flex;
  gap: 0.35rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.portal-tab {
  position: relative;
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}

.portal-tab[aria-selected="true"] {
  color: var(--mint);
}

.portal-tab[aria-selected="true"]::after {
  position: absolute;
  right: 0.6rem;
  bottom: -0.62rem;
  left: 0.6rem;
  height: 2px;
  background: var(--mint);
  content: "";
}

.portal-announcement {
  min-height: 1.1rem;
  margin: -0.55rem 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.5;
}

.portal-panel {
  display: grid;
  gap: 1.15rem;
  min-width: 0;
}

.portal-state {
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface);
}

.portal-state h3,
.portal-state p {
  margin: 0;
}

.portal-state h3 {
  font-size: 0.9rem;
}

.portal-state p {
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.55;
}

.portal-state.is-error,
.dialog-error,
.mutation-error {
  border-color: rgba(255, 155, 145, 0.42);
}

.portal-state.is-warning {
  border-color: rgba(255, 209, 122, 0.42);
  background: rgba(255, 209, 122, 0.06);
}

.portal-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(19, 23, 34, 0.7);
}

.audit-filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-field {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  min-width: 0;
}

.portal-field label,
.scope-picker legend {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.portal-field input,
.portal-field select,
.portal-field textarea,
.credential-form input,
.credential-form select,
.credential-form textarea,
.credential-dialog input,
.credential-dialog select,
.credential-dialog textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.72rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.58rem;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
}

.portal-field textarea,
.credential-form textarea,
.credential-dialog textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.portal-field input::placeholder,
.credential-dialog input::placeholder,
.credential-dialog textarea::placeholder {
  color: var(--ink-muted);
}

.field-hint,
.scope-dependency {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.65rem;
  line-height: 1.45;
}

.filter-actions {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.credential-results,
.audit-results {
  min-width: 0;
}

.credential-grid,
.audit-list {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.credential-card,
.audit-card {
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.35rem);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: linear-gradient(145deg, rgba(25, 30, 44, 0.92), rgba(19, 23, 34, 0.95));
}

.credential-card-heading,
.audit-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.credential-card-heading h3,
.audit-card-heading h3,
.credential-type {
  margin: 0;
}

.credential-card-heading h3,
.audit-card-heading h3 {
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.35;
}

.credential-type {
  margin-bottom: 0.22rem;
  color: var(--violet);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.safe-prefix,
.reveal-material,
.dialog-error code,
.portal-error-details code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--sky);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.safe-prefix {
  margin-top: 0.4rem;
}

.status-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.62rem;
  font-weight: 850;
}

.status-badge.is-active,
.status-badge.is-success {
  border-color: rgba(114, 230, 191, 0.5);
  color: var(--mint);
}

.status-badge.is-rotating,
.status-badge.is-pending {
  border-color: rgba(255, 209, 122, 0.5);
  color: var(--amber);
}

.status-badge.is-revoked,
.status-badge.is-expired,
.status-badge.is-failure,
.status-badge.is-unavailable {
  border-color: rgba(255, 155, 145, 0.5);
  color: var(--coral);
}

.credential-details,
.portal-error-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 1rem 0 0;
}

.credential-details > div,
.portal-error-details > div {
  min-width: 0;
  padding: 0.65rem 0.65rem 0.65rem 0;
  border-top: 1px solid var(--line);
}

.credential-details dt,
.portal-error-details dt {
  color: var(--ink-muted);
  font-size: 0.62rem;
  font-weight: 750;
}

.credential-details dd,
.portal-error-details dd {
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.4;
}

.credential-scope-region {
  margin-top: 0.9rem;
}

.credential-scope-region h4 {
  margin: 0 0 0.45rem;
  color: var(--ink-muted);
  font-size: 0.65rem;
}

.scope-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scope-chip {
  max-width: 100%;
  padding: 0.3rem 0.5rem;
  overflow-wrap: anywhere;
  border: 1px solid rgba(180, 165, 255, 0.35);
  border-radius: 999px;
  color: var(--violet);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.62rem;
}

.credential-actions,
.reveal-actions,
.dialog-actions,
.portal-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.credential-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.muted-value,
.copy-status,
.reveal-expiry {
  color: var(--ink-muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.portal-pagination {
  justify-content: space-between;
  padding-top: 0.25rem;
}

.portal-pagination span {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.audit-card-heading {
  align-items: center;
}

.credential-dialog {
  width: min(42rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 1rem;
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 2rem 8rem rgba(0, 0, 0, 0.62);
}

.credential-dialog::backdrop {
  background: rgba(2, 4, 9, 0.82);
  backdrop-filter: blur(4px);
}

.dialog-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 2rem);
}

.dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.2rem 1rem;
  border-bottom: 1px solid var(--line);
}

.dialog-heading h2,
.dialog-heading p {
  margin: 0;
}

.dialog-heading h2 {
  font-size: 1.2rem;
  line-height: 1.3;
}

.dialog-heading p {
  margin-top: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.5;
}

.dialog-close {
  flex: 0 0 auto;
  min-height: 2.5rem;
  padding: 0.45rem 0.7rem;
}

.dialog-body {
  display: grid;
  gap: 1rem;
  min-width: 0;
  padding: 1.2rem;
  overflow-y: auto;
}

.dialog-body > h3 {
  margin: 0;
  font-size: 0.95rem;
}

.dialog-actions {
  justify-content: flex-end;
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.dialog-error,
.mutation-error {
  display: grid;
  gap: 0.4rem;
  padding: 0.85rem;
  border: 1px solid rgba(255, 155, 145, 0.42);
  border-radius: 0.7rem;
  background: rgba(255, 155, 145, 0.06);
}

.dialog-error h3,
.dialog-error p,
.mutation-error h3,
.mutation-error p {
  margin: 0;
}

.dialog-error p,
.mutation-error p {
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.5;
}

.credential-form,
.credential-type-fields {
  display: grid;
  gap: 1rem;
}

.scope-picker {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  margin: 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}

.scope-picker legend {
  padding: 0 0.25rem;
}

.scope-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.65rem;
  min-height: 2.75rem;
  padding: 0.55rem;
  border-radius: 0.55rem;
  cursor: pointer;
}

.scope-option:hover {
  background: var(--surface-soft);
}

.scope-option input,
.reveal-acknowledgment input {
  width: 1.2rem;
  min-height: 1.2rem;
  margin: 0.1rem 0 0;
}

.scope-option span {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.scope-option strong {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.scope-option small {
  color: var(--ink-soft);
  font-size: 0.67rem;
  line-height: 1.4;
}

.reveal-region {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid rgba(255, 209, 122, 0.42);
  border-radius: 0.75rem;
  background: var(--canvas);
}

.reveal-label {
  margin: 0;
  color: var(--amber);
  font-size: 0.68rem;
  font-weight: 850;
}

.reveal-material {
  display: block;
  min-height: 3.5rem;
  padding: 0.9rem;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.55;
  user-select: all;
}

.copy-status {
  flex: 1 1 12rem;
}

.reveal-expiry {
  margin: 0;
}

.reveal-acknowledgment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.7rem;
  min-height: 2.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.74rem;
  line-height: 1.45;
}

@media (max-width: 52rem) {
  .portal-filters,
  .audit-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 38rem) {
  .portal-header,
  .credential-card-heading,
  .audit-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-header .portal-button,
  .credential-actions .portal-button,
  .dialog-actions .portal-button {
    width: 100%;
  }

  .portal-filters,
  .audit-filters,
  .credential-details,
  .portal-error-details {
    grid-template-columns: 1fr;
  }

  .portal-pagination {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .portal-pagination span {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }

  .credential-dialog,
  .dialog-frame {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .dialog-heading,
  .dialog-body,
  .dialog-actions {
    padding-right: 1rem;
    padding-left: 1rem;
  }
}

@media (max-width: 64rem) {
  .account-summary > span {
    display: none;
  }

  .tenant-form select {
    max-width: 10rem;
  }
}

@media (max-width: 52rem) {
  .product-shell {
    display: block;
  }

  .product-rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    transform: translateX(-105%);
    transition: transform 170ms ease;
    box-shadow: 1.5rem 0 5rem rgba(0, 0, 0, 0.45);
  }

  .product-rail.is-open {
    transform: translateX(0);
  }

  .rail-close,
  .navigation-toggle {
    display: inline-flex;
    justify-content: center;
  }

  .product-header {
    min-height: 4.7rem;
  }

  .header-context {
    margin-right: auto;
  }

  .account-area {
    margin-left: 0;
  }

  .tenant-form {
    display: none;
  }
}

@media (max-width: 38rem) {
  .product-header {
    flex-wrap: wrap;
    gap: 0.55rem;
  }

  .account-area {
    width: 100%;
    justify-content: flex-end;
    padding-top: 0.55rem;
    border-top: 1px solid var(--line);
  }

  .account-summary {
    padding-left: 0;
    border-left: 0;
  }

  .state-card {
    grid-template-columns: 1fr;
  }

  .state-icon {
    width: 3rem;
  }

  .state-action {
    width: 100%;
  }

  .state-details div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .documentation-toolbar {
    grid-template-columns: 1fr;
  }

  .documentation-button {
    width: 100%;
  }

  .operation-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .migration-notice {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .migration-notice button {
    grid-column: 1 / -1;
  }

  .product-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .diagnostics-button {
    width: 100%;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .state-signal.is-ready {
    background: CanvasText;
  }

  .state-card,
  .navigation-link,
  .state-action,
  .download-card,
  .operation-card,
  .documentation-button,
  .quiet-button,
  .diagnostics-button,
  .credential-card,
  .audit-card,
  .portal-button,
  .credential-dialog {
    forced-color-adjust: auto;
  }
}

.live-workspace {
  display: grid;
  gap: 1rem;
}

.live-summary {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(12rem, 2fr) auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 1rem;
  background: var(--surface, #111827);
  border: 1px solid var(--border, #334155);
  border-radius: 0.8rem;
}

.live-eyebrow {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted, #94a3b8);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.live-connection {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  width: fit-content;
  font-weight: 750;
}

.live-connection::before {
  width: 0.58rem;
  height: 0.58rem;
  content: "";
  background: #f4bf68;
  border-radius: 999px;
  box-shadow: 0 0 0.65rem rgba(244, 191, 104, 0.45);
}

.live-connection.is-ready::before {
  background: #65d6a6;
  box-shadow: 0 0 0.65rem rgba(101, 214, 166, 0.45);
}

.live-connection.is-stale::before,
.live-connection.is-gated::before {
  background: #f4bf68;
}

.live-connection.is-forbidden::before,
.live-connection.is-unavailable::before {
  background: #ff7f8e;
  box-shadow: 0 0 0.65rem rgba(255, 127, 142, 0.45);
}

.live-connection.is-authentication::before {
  background: #9b87f5;
  box-shadow: 0 0 0.65rem rgba(155, 135, 245, 0.45);
}

.live-freshness,
.live-count-label {
  color: var(--muted, #94a3b8);
  font-size: 0.75rem;
}

.live-count {
  font-size: 1.8rem;
  font-variant-numeric: tabular-nums;
}

.live-controls {
  grid-row: 2 / span 2;
  grid-column: 3;
}

.live-notice {
  padding: 1rem;
  background: rgba(155, 135, 245, 0.08);
  border: 1px solid rgba(155, 135, 245, 0.25);
  border-radius: 0.8rem;
}

.live-notice:empty {
  display: none;
}

.live-notice h2,
.live-notice p {
  margin: 0 0 0.6rem;
}

.live-notice p {
  color: var(--muted, #94a3b8);
  line-height: 1.6;
}

.live-table-region {
  overflow-x: auto;
  background: var(--surface, #111827);
  border: 1px solid var(--border, #334155);
  border-radius: 0.8rem;
}

.live-empty {
  margin: 0;
  padding: 2rem 1rem;
  color: var(--muted, #94a3b8);
  text-align: center;
}

.live-table {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.live-table caption {
  padding: 0.85rem 1rem;
  color: var(--muted, #94a3b8);
  text-align: left;
}

.live-table th,
.live-table td {
  padding: 0.75rem;
  text-align: left;
  border-top: 1px solid var(--border, #334155);
}

.live-table th {
  color: var(--muted, #94a3b8);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 44rem) {
  .live-summary {
    grid-template-columns: 1fr;
  }

  .live-controls {
    grid-row: auto;
    grid-column: auto;
  }
}

@media (forced-colors: active) {
  .live-summary,
  .live-notice,
  .live-table-region,
  .live-connection {
    forced-color-adjust: auto;
  }
}

/* A03 historical explorer */

.historical-explorer {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.historical-toolbar,
.historical-results-header,
.historical-filter-actions,
.historical-pagination {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.historical-toolbar {
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: linear-gradient(145deg, rgba(25, 30, 44, 0.94), rgba(19, 23, 34, 0.96));
}

.historical-toolbar h2,
.historical-toolbar p,
.historical-results-header h3,
.historical-results-header p,
.historical-summary h3,
.historical-facets h3,
.historical-facet-group h4,
.historical-empty h4,
.historical-empty p {
  margin: 0;
}

.historical-toolbar h2 {
  font-size: 1.08rem;
}

.historical-toolbar p {
  margin-top: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.5;
}

.historical-export-gate {
  display: grid;
  flex: 0 1 23rem;
  justify-items: end;
  gap: 0.35rem;
}

.historical-export-help {
  max-width: 32rem;
  color: var(--ink-muted);
  font-size: 0.64rem;
  line-height: 1.45;
  text-align: right;
}

.historical-filters {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(19, 23, 34, 0.76);
}

.historical-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 0.65rem;
}

.historical-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.historical-field {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  min-width: 0;
}

.historical-field-label {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.historical-field input,
.historical-field select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.72rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.58rem;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
}

.historical-field input::placeholder {
  color: var(--ink-muted);
}

.historical-field input[aria-invalid="true"],
.historical-field select[aria-invalid="true"] {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px var(--coral);
}

.historical-field input:disabled,
.historical-field select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.historical-field-help {
  color: var(--ink-muted);
  font-size: 0.63rem;
  line-height: 1.4;
}

.historical-advanced,
.historical-unsupported {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: rgba(9, 11, 18, 0.42);
}

.historical-advanced summary,
.historical-unsupported summary {
  min-height: 2.75rem;
  padding: 0.75rem;
  color: var(--sky);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
}

.historical-advanced > .historical-filter-grid,
.historical-unsupported > .historical-filter-grid,
.historical-unsupported > p {
  margin: 0;
  padding: 0 0.75rem 0.75rem;
}

.historical-unsupported > p {
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.5;
}

.historical-filter-actions {
  align-items: end;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.historical-filter-actions .historical-field {
  min-width: 9rem;
  margin-left: auto;
}

.historical-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.58rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.58rem;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.historical-button.is-primary {
  border-color: var(--mint);
  background: var(--mint);
  color: var(--mint-ink);
}

.historical-button.is-secondary,
.historical-button.is-quiet {
  background: transparent;
}

.historical-button:hover:not(:disabled) {
  border-color: var(--sky);
  background: var(--surface-raised);
  color: var(--ink);
}

.historical-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.historical-local-state {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.2rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--surface);
}

.historical-message {
  display: grid;
  flex: 1;
  gap: 0.2rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

.historical-message.is-error {
  color: var(--coral);
}

.historical-message.is-success {
  color: var(--mint);
}

.historical-request-id {
  overflow-wrap: anywhere;
  color: var(--ink-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.65rem;
}

.historical-applied-scope {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--sky);
  background: rgba(142, 200, 255, 0.07);
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.historical-data-grid {
  display: grid;
  grid-template-columns: minmax(12rem, 0.28fr) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  min-width: 0;
}

.historical-facets,
.historical-summary {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface);
}

.historical-facets {
  display: grid;
  gap: 0.8rem;
  max-height: 54rem;
  overflow: auto;
}

.historical-facets h3,
.historical-summary h3,
.historical-results-header h3 {
  font-size: 0.95rem;
}

.historical-facet-group {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.historical-facet-group h4 {
  color: var(--ink-soft);
  font-size: 0.68rem;
  text-transform: capitalize;
}

.historical-facet-group ul {
  display: grid;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.historical-facet-group li {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  color: var(--ink-soft);
  font-size: 0.65rem;
}

.historical-facet-group strong {
  color: var(--ink-muted);
  font-size: 0.61rem;
  white-space: nowrap;
}

.historical-results {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
}

.historical-summary {
  display: grid;
  gap: 0.75rem;
}

.historical-summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0;
}

.historical-summary-metrics div {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--canvas);
}

.historical-summary-metrics dt {
  color: var(--ink-muted);
  font-size: 0.62rem;
}

.historical-summary-metrics dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 750;
}

.historical-identity-note {
  margin: 0;
  color: var(--amber);
  font-size: 0.68rem;
  line-height: 1.5;
}

.historical-results-header {
  align-items: end;
  padding: 0.3rem 0;
}

.historical-sort-state {
  color: var(--ink-muted);
  font-size: 0.67rem;
}

.historical-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface);
}

.historical-table {
  width: 100%;
  min-width: 66rem;
  border-collapse: collapse;
  table-layout: fixed;
}

.historical-table th,
.historical-table td {
  padding: 0.72rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.historical-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-raised);
  color: var(--ink-soft);
  font-size: 0.63rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.historical-table th[aria-sort="ascending"]::after {
  content: " ↑";
  color: var(--mint);
}

.historical-table td {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.68rem;
  line-height: 1.45;
}

.historical-table td > span,
.historical-table td > a {
  display: block;
}

.historical-table tbody tr:last-child td {
  border-bottom: 0;
}

.historical-table tbody tr:hover {
  background: rgba(142, 200, 255, 0.035);
}

.historical-cell-note {
  margin-top: 0.22rem;
  color: var(--ink-muted);
  font-size: 0.62rem;
}

.historical-event-link {
  min-height: 0;
  font-weight: 800;
}

.historical-empty {
  padding: 1.2rem;
  border: 1px dashed var(--line-strong);
  border-radius: 0.8rem;
  background: var(--surface);
}

.historical-empty p {
  margin-top: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.5;
}

.historical-empty .historical-button {
  margin-top: 0.8rem;
}

.historical-pagination {
  align-items: center;
}

.historical-pagination span {
  color: var(--ink-muted);
  font-size: 0.66rem;
  text-align: center;
}

.event-workspace {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.event-workspace h2,
.event-workspace h3,
.event-workspace p,
.event-chart-figure {
  margin: 0;
}

.event-back-link {
  display: inline-flex;
  width: max-content;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
}

.event-back-link::before {
  content: "←";
  color: var(--mint);
}

.event-back-link:hover {
  color: var(--ink);
}

.event-gate-card,
.event-loading-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.45rem 0.9rem;
  padding: 1.25rem;
  border: 1px solid rgba(255, 209, 122, 0.42);
  border-radius: 0.9rem;
  background: linear-gradient(145deg, rgba(255, 209, 122, 0.08), var(--surface));
}

.event-gate-card h2,
.event-gate-card h3,
.event-loading-state h2 {
  align-self: center;
  font-size: 1rem;
}

.event-gate-card > p,
.event-loading-state > p {
  grid-column: 2;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.6;
}

.event-gate-symbol,
.event-loading-symbol {
  display: grid;
  grid-row: 1 / span 2;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--amber);
  font-size: 1rem;
  font-weight: 900;
}

.event-loading-symbol {
  color: var(--sky);
  letter-spacing: 0.1em;
}

.event-gate-details {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.5rem 0 0;
}

.event-gate-details > div,
.event-header-metadata > div,
.event-series-metadata > div {
  display: grid;
  align-content: start;
  gap: 0.22rem;
  min-width: 0;
}

.event-gate-details dt,
.event-header-metadata dt,
.event-series-metadata dt {
  color: var(--ink-muted);
  font-size: 0.61rem;
}

.event-gate-details dd,
.event-header-metadata dd,
.event-series-metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.69rem;
  font-weight: 750;
  line-height: 1.45;
}

.event-source-boundary-list {
  grid-column: 1 / -1;
  margin: 0.55rem 0 0;
  padding-left: 1.4rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.7;
}

.event-identity-header,
.event-analysis-controls,
.event-chart-region,
.event-series-metadata-panel,
.event-table-region {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--surface);
}

.event-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.event-heading-row h2 {
  margin-top: 0.25rem;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  letter-spacing: -0.025em;
}

.event-eyebrow {
  color: var(--mint);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.event-event-label {
  margin-top: 0.35rem !important;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.event-heading-actions {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
}

.event-copy-status {
  min-height: 1rem;
  color: var(--ink-muted);
  font-size: 0.61rem;
  text-align: right;
}

.event-header-metadata {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.event-metadata-note {
  color: var(--ink-muted);
  font-size: 0.6rem;
  line-height: 1.4;
}

.event-identity-notice {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--sky);
  border-radius: 0.35rem 0.7rem 0.7rem 0.35rem;
  background: rgba(142, 200, 255, 0.07);
}

.event-identity-notice[role="alert"] {
  border-left-color: var(--amber);
  background: rgba(255, 209, 122, 0.07);
}

.event-identity-notice strong {
  font-size: 0.72rem;
}

.event-identity-notice p {
  color: var(--ink-soft);
  font-size: 0.68rem;
  line-height: 1.55;
}

.event-analysis-controls {
  display: grid;
  gap: 0.85rem;
}

.event-analysis-controls > h3,
.event-table-region > h3,
.event-series-metadata-panel > h3,
.event-chart-heading {
  font-size: 0.82rem;
}

.event-control-grid {
  display: grid;
  grid-template-columns: minmax(12rem, 2fr) repeat(2, minmax(8rem, 1fr));
  gap: 0.75rem;
}

.event-control-field {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  min-width: 0;
}

.event-control-label {
  color: var(--ink-soft);
  font-size: 0.64rem;
  font-weight: 800;
}

.event-control-field select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0 2.2rem 0 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.5rem;
  background: var(--canvas);
  color: var(--ink);
  font-size: 0.67rem;
}

.event-control-field.is-unavailable select:disabled {
  border-style: dashed;
  color: var(--ink-muted);
  opacity: 1;
}

.event-control-help,
.event-action-help {
  color: var(--ink-muted);
  font-size: 0.6rem;
  line-height: 1.45;
}

.event-source-selector {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 0.55rem;
  min-width: 0;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}

.event-source-selector legend {
  padding: 0 0.3rem;
}

.event-source-selector > .event-control-help {
  flex-basis: 100%;
}

.event-source-selector:disabled {
  border-style: dashed;
  opacity: 0.72;
}

.event-source-option {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 750;
}

.event-source-option:has(input:checked) {
  border-color: var(--mint);
  background: rgba(114, 230, 191, 0.08);
  color: var(--ink);
}

.event-source-option.is-unavailable {
  border-style: dashed;
  cursor: not-allowed;
  opacity: 0.65;
}

.event-source-option input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--mint);
}

.event-window-scope {
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.61rem;
  line-height: 1.5;
}

.event-local-state {
  min-height: 2.75rem;
}

.event-local-message {
  display: grid;
  min-height: 2.75rem;
  align-content: center;
  gap: 0.2rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.67rem;
}

.event-local-message.is-success {
  border-color: rgba(114, 230, 191, 0.35);
}

.event-local-message.is-error {
  border-color: rgba(255, 155, 145, 0.45);
}

.event-local-message.is-warning {
  border-color: rgba(255, 209, 122, 0.45);
}

.event-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(15rem, 0.85fr);
  gap: 1rem;
  min-width: 0;
}

.event-chart-figure {
  display: grid;
  gap: 0.7rem;
}

.event-chart-summary,
.event-chart-caption,
.event-table-intro {
  color: var(--ink-muted);
  font-size: 0.64rem;
  line-height: 1.5;
}

.event-odds-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 15rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--canvas);
  color: var(--ink);
}

.event-chart-grid line {
  stroke: var(--line);
  stroke-width: 1;
}

.event-chart-grid text {
  fill: var(--ink-muted);
  font-size: 10px;
}

.event-chart-grid .event-chart-axis {
  stroke: var(--line-strong);
  stroke-width: 1.5;
}

.event-chart-grid .event-chart-axis-label {
  fill: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.event-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.62rem;
}

.event-chart-unavailable-annotations {
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem;
  border: 1px dashed var(--line-strong);
  border-radius: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.61rem;
  line-height: 1.5;
}

.event-chart-unavailable-annotations ul,
.event-chart-unavailable-annotations p {
  margin: 0;
}

.event-chart-unavailable-annotations ul {
  padding-left: 1.2rem;
}

.event-chart-swatch {
  display: inline-block;
  width: 1.7rem;
  height: 0.65rem;
  border-top: 3px solid currentColor;
}

.event-chart-swatch.is-square,
.event-chart-swatch.is-diamond {
  border-top-style: dashed;
}

.event-chart-swatch.is-triangle,
.event-chart-swatch.is-cross,
.event-chart-swatch.is-plus {
  border-top-style: dotted;
}

.event-chart-swatch.is-source-0 { color: #40c9a2; }
.event-chart-swatch.is-source-1 { color: #f5a65b; }
.event-chart-swatch.is-source-2 { color: #8fa8ff; }
.event-chart-swatch.is-source-3 { color: #f17ca8; }
.event-chart-swatch.is-source-4 { color: #d8c45d; }
.event-chart-swatch.is-source-5 { color: #8ed16f; }
.event-chart-swatch.is-source-6 { color: #c49bea; }
.event-chart-swatch.is-source-7 { color: #79c6e3; }

.event-series-metadata {
  display: grid;
  gap: 0.7rem;
  margin: 0.8rem 0 0;
}

.event-series-metadata > div {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.event-series-metadata > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.event-table-region {
  display: grid;
  gap: 0.6rem;
}

.event-table-scroller {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}

.event-observation-table {
  width: 100%;
  min-width: 70rem;
  border-collapse: collapse;
  table-layout: fixed;
}

.event-observation-table caption {
  padding: 0.6rem;
  color: var(--ink-muted);
  font-size: 0.61rem;
  text-align: left;
}

.event-observation-table th,
.event-observation-table td {
  padding: 0.7rem;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
}

.event-observation-table th {
  background: var(--surface-raised);
  color: var(--ink-soft);
  font-size: 0.61rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.event-observation-table td {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.62rem;
  line-height: 1.5;
}

.event-empty-state {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: 0.7rem;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.event-analysis-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.event-action-group {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--surface);
}

.event-button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.event-button.is-primary {
  border-color: var(--mint);
  background: var(--mint);
  color: var(--mint-ink);
}

.event-button.is-secondary {
  background: var(--surface-soft);
}

.event-button:hover:not(:disabled) {
  border-color: var(--sky);
}

.event-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.event-export-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.66rem;
}

.event-export-status.is-ready {
  border-color: rgba(114, 230, 191, 0.4);
}

.event-export-status.is-failed {
  border-color: rgba(255, 155, 145, 0.45);
}

.event-export-status .event-button {
  margin-left: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 68rem) {
  .historical-data-grid {
    grid-template-columns: 1fr;
  }

  .historical-facets {
    max-height: 22rem;
  }

  .historical-summary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 52rem) {
  .historical-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 38rem) {
  .historical-toolbar,
  .historical-results-header,
  .historical-local-state {
    align-items: stretch;
    flex-direction: column;
  }

  .historical-export-gate {
    justify-items: stretch;
  }

  .historical-export-help {
    text-align: left;
  }

  .historical-search-row,
  .historical-filter-grid,
  .historical-summary-metrics {
    grid-template-columns: 1fr;
  }

  .historical-search-row .historical-button,
  .historical-filter-actions .historical-button,
  .historical-export-gate .historical-button {
    width: 100%;
  }

  .historical-filter-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .historical-filter-actions .historical-field {
    width: 100%;
    margin-left: 0;
  }

  .historical-pagination {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .historical-pagination span {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media (forced-colors: active) {
  .historical-toolbar,
  .historical-filters,
  .historical-button,
  .historical-table-scroll,
  .historical-facets,
  .historical-summary {
    forced-color-adjust: auto;
  }
}

@media (max-width: 72rem) {
  .event-analysis-grid {
    grid-template-columns: 1fr;
  }

  .event-series-metadata {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-series-metadata > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 58rem) {
  .event-header-metadata,
  .event-gate-details,
  .event-control-grid,
  .event-analysis-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-source-selector {
    grid-column: 1 / -1;
  }
}

@media (max-width: 38rem) {
  .event-heading-row,
  .event-export-status {
    align-items: stretch;
    flex-direction: column;
  }

  .event-heading-actions {
    justify-items: stretch;
  }

  .event-copy-status {
    text-align: left;
  }

  .event-header-metadata,
  .event-gate-details,
  .event-control-grid,
  .event-analysis-actions,
  .event-series-metadata {
    grid-template-columns: 1fr;
  }

  .event-action-group {
    grid-template-columns: 1fr;
  }

  .event-action-group .event-button,
  .event-export-status .event-button {
    width: 100%;
    margin-left: 0;
  }

  .event-gate-card,
  .event-loading-state {
    grid-template-columns: 1fr;
  }

  .event-gate-symbol,
  .event-loading-symbol {
    grid-row: auto;
  }

  .event-gate-card > p,
  .event-loading-state > p {
    grid-column: 1;
  }
}

@media (forced-colors: active) {
  .event-gate-card,
  .event-identity-header,
  .event-analysis-controls,
  .event-chart-region,
  .event-series-metadata-panel,
  .event-table-region,
  .event-button,
  .event-odds-chart,
  .event-source-option {
    forced-color-adjust: auto;
  }
}
