:root {
  --bg: #eef1ef;
  --surface: #fcfdfc;
  --surface-2: #f7faf8;
  --text: #0f2633;
  --muted: #536672;
  --line: #c8d4d8;
  --accent: #1e6b66;
  --accent-2: #0f2f3a;
  --signal: #b98928;
  --shadow: 0 16px 44px rgba(15, 47, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  background: radial-gradient(circle at 8% 12%, #e2ece8 0%, transparent 30%),
    radial-gradient(circle at 90% 10%, #e8eee3 0%, transparent 32%),
    var(--bg);
  color: var(--text);
  line-height: 1.45;
  overflow-x: hidden;
}

a {
  color: inherit;
}

.container {
  width: min(1080px, 92vw);
  margin: 0 auto;
}

.bg-orb {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  z-index: -1;
}

.orb-a {
  background: #9fc6c1;
  top: -130px;
  left: -110px;
}

.orb-b {
  background: #b3c7d3;
  right: -140px;
  bottom: -140px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in oklab, var(--line), var(--accent-2) 8%);
  background: color-mix(in oklab, var(--surface), #fff 34%);
}

.topbar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}

.brand-name {
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: var(--text);
}

.brand-suffix {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.menu a {
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
}

.menu a:hover,
.menu a[aria-current="page"] {
  border-color: color-mix(in oklab, var(--accent), #fff 55%);
  color: var(--accent-2);
  background: color-mix(in oklab, var(--accent), #fff 92%);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--accent-2);
  color: var(--accent-2);
  background: color-mix(in oklab, var(--accent), #fff 90%);
  white-space: nowrap;
  transition: background 150ms, color 150ms, border-color 150ms;
  flex-shrink: 0;
}

.nav-cta:hover {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
}

.nav-cta[aria-current="page"] {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
}

.signup-shell {
  padding: 48px 0 72px;
}

.signup-intro h1 {
  max-width: 18ch;
}

.signup-layout {
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.95fr);
  gap: 22px;
  align-items: start;
}

.signup-form-card {
  padding: 26px;
}

.signup-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.step-pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  background: color-mix(in oklab, var(--surface), var(--accent) 2%);
}

.step-pill.is-active {
  border-color: color-mix(in oklab, var(--accent), #fff 40%);
  color: var(--accent-2);
  background: color-mix(in oklab, var(--accent), #fff 88%);
}

.signup-form {
  display: grid;
  gap: 14px;
}

.signup-form h2 {
  margin: 8px 0 0;
  font-size: 1.14rem;
}

.signup-form label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: color-mix(in oklab, var(--text), #fff 18%);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.signup-form input,
.signup-form select,
.signup-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
}

.signup-form textarea {
  resize: vertical;
}

.signup-form input:focus,
.signup-form select:focus,
.signup-form textarea:focus {
  outline: 2px solid color-mix(in oklab, var(--accent), #fff 45%);
  outline-offset: 1px;
}

.field-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
}

.checkbox-row input {
  width: auto;
  margin-top: 2px;
}

.checkout-status {
  min-height: 22px;
  font-size: 0.92rem;
  color: var(--accent-2);
  font-weight: 600;
}

.checkout-status.is-error {
  color: #9f2e2a;
}

.checkout-submit {
  justify-self: start;
}

.order-summary {
  position: sticky;
  top: 98px;
  padding: 22px;
}

.order-summary h2 {
  margin: 4px 0 8px;
}

.summary-copy {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.93rem;
}

.summary-row,
.summary-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.summary-row {
  border-bottom: 1px dashed var(--line);
  font-size: 0.92rem;
  color: var(--muted);
}

.summary-total {
  margin-top: 8px;
  padding-top: 12px;
  font-weight: 700;
  color: var(--accent-2);
}

.summary-list {
  margin: 16px 0 0;
  padding-left: 16px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.hero {
  padding: 56px 0 26px;
  animation: rise 500ms ease both;
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.75fr);
  gap: 40px;
  align-items: center;
}

.hero-body {
  min-width: 0;
}

.hero-cta-panel {
  border: 1px solid color-mix(in oklab, var(--accent), #fff 55%);
  border-radius: 18px;
  background: linear-gradient(160deg, #fff, color-mix(in oklab, var(--accent), #fff 93%));
  box-shadow: 0 10px 32px rgba(30, 107, 102, 0.1);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: start;
  margin-top: 24px;
}

.hero-cta-label {
  margin: 0;
  font-size: 0.82rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}

.hero-cta-btn {
  display: block;
  text-align: center;
}

.hero-cta-sub {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

.chip {
  display: inline-block;
  margin: 0 0 14px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: color-mix(in oklab, var(--accent), #fff 93%);
  color: var(--accent-2);
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4.7vw, 4rem);
  line-height: 1.03;
  max-width: 13ch;
}

.lead {
  max-width: 52ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-pillars {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 760px;
}

.hero-pillars li {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in oklab, var(--surface), var(--accent) 2%);
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.86rem;
  color: color-mix(in oklab, var(--text), #fff 22%);
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  border: 0;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  border-radius: 12px;
  padding: 12px 18px;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 30px rgba(30, 107, 102, 0.28);
  font-weight: 700;
}

.btn-ghost {
  border: 1px solid color-mix(in oklab, var(--accent-2), #fff 70%);
  color: var(--accent-2);
  background: #fff;
  opacity: 0.92;
}

.btn-ghost:hover {
  background: color-mix(in oklab, var(--accent), #fff 90%);
}

.main-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 40px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface), color-mix(in oklab, var(--surface-2), var(--accent) 2%));
  box-shadow: var(--shadow);
  padding: 22px;
}

.main-grid .full-span {
  grid-column: 1 / -1;
}

#playground,
#results-explorer,
#difference,
#switch {
  scroll-margin-top: 88px;
}

.switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.switch-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in oklab, var(--surface), #fff 40%);
  padding: 14px;
}

.switch-card h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.switch-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

h2 {
  margin-top: 0;
  font-size: 1.28rem;
}

.endpoint-list {
  padding-left: 18px;
  margin: 0;
}

.endpoint-list li {
  margin-bottom: 8px;
}

code,
.output {
  font-family: "IBM Plex Mono", monospace;
}

.muted {
  color: var(--muted);
  margin-top: 14px;
}

.limit-row {
  display: grid;
  gap: 6px;
}

.limit-slider {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent), #fff 60%);
  outline: none;
  padding: 0;
  border: none;
}

.limit-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.limit-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.limit-badge {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  margin-left: 4px;
}

.limit-ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  margin-top: -2px;
}

.playground-note {
  margin: 12px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.play-form {
  display: grid;
  gap: 10px;
}

label {
  font-weight: 600;
  font-size: 0.92rem;
}

input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.output {
  margin: 0;
  background: #0f2a38;
  color: #e9f3f6;
  min-height: 280px;
  border-radius: 12px;
  padding: 16px;
  overflow: auto;
}

.results-explorer-section {
  position: relative;
  overflow: hidden;
}

.results-loader {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  border-radius: 18px;
  background: color-mix(in oklab, var(--surface), #fff 55%);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transition: opacity 280ms ease;
}

.results-loader.is-active {
  display: flex;
  opacity: 1;
}

.results-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.loader-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid color-mix(in oklab, var(--accent), #fff 60%);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinLoader 700ms linear infinite;
}

.loader-label {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  color: var(--accent-2);
}

.loader-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 28ch;
  text-align: center;
  line-height: 1.5;
}

@keyframes spinLoader {
  to { transform: rotate(360deg); }
}

.results-entered .insights-grid,
.results-entered .result-tabs,
.results-entered #panel-explorer,
.results-entered #panel-json {
  animation: resultsReveal 420ms ease both;
}

.results-entered .result-tabs    { animation-delay: 60ms; }
.results-entered #panel-explorer { animation-delay: 120ms; }

@keyframes resultsReveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.results-header {
  margin-bottom: 12px;
}

.result-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0 14px;
}

.tab-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 9px 12px;
  font: inherit;
  cursor: pointer;
  color: var(--muted);
}

.tab-btn.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.insight-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.insight-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.insight-value {
  margin: 8px 0 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.viz-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.viz-controls label {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.viz-controls select,
.viz-controls input[type="range"] {
  width: 100%;
}

.viz-controls input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: #d8d5d0;
  outline: none;
  padding: 0;
}

.viz-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #e8f1ef;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.viz-controls input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #e8f1ef;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.viz-controls input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #d8d5d0;
}

.filter-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  color: var(--muted);
}

.viz-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-summary {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.88rem;
  color: var(--accent-2);
  background: color-mix(in oklab, var(--accent), #fff 90%);
  border: 1px solid color-mix(in oklab, var(--accent), #fff 65%);
  border-radius: 10px;
  padding: 10px 14px;
  line-height: 1.5;
  display: none;
}

.preset-summary.is-visible {
  display: block;
  animation: fadeIn 300ms ease both;
}

.viz-actions .btn-ghost,
.selection-bar .btn-ghost {
  border-color: color-mix(in oklab, var(--accent), #fff 60%);
  color: var(--accent);
}

.viz-actions .btn-ghost:hover,
.selection-bar .btn-ghost:hover {
  background: color-mix(in oklab, var(--accent), #fff 90%);
}

.btn-sm {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
}

.viz-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 12px;
}

.viz-canvas-wrap,
.viz-detail {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.viz-canvas {
  width: 100%;
  height: 360px;
  background: linear-gradient(180deg, #fff, #fbfaf7);
  border-radius: 8px;
  border: 1px solid #ece4dc;
}

.viz-legend {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.point {
  cursor: pointer;
  opacity: 0.86;
  transition: opacity 140ms ease, stroke-width 140ms ease;
}

.point:hover {
  opacity: 1;
}

.point.is-selected {
  stroke: #17130f;
  stroke-width: 2.5;
}

.axis-label {
  font-size: 11px;
  fill: #6b645d;
  font-family: "IBM Plex Mono", monospace;
}

.axis-tick {
  font-size: 10px;
  fill: #7b746c;
  font-family: "IBM Plex Mono", monospace;
}

.grid-line {
  stroke: #efe8e0;
  stroke-width: 1;
}

.axis-line {
  stroke: #cfc6bd;
  stroke-width: 1.4;
}

.detail-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.detail-url {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--accent-2);
  word-break: break-word;
}

.detail-meta {
  margin: 0;
  padding-left: 18px;
}

.selection-bar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#selection-count {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
}

#playground .btn-primary,
#export-selected {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(30, 107, 102, 0.24);
}

.export-upsell {
  margin-top: 14px;
  background: color-mix(in oklab, var(--accent), #fff 90%);
  border: 1px solid color-mix(in oklab, var(--accent), #fff 58%);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  animation: fadeIn 220ms ease both;
}

.export-upsell.is-hidden {
  display: none;
}

.export-upsell-body {
  flex: 1 1 240px;
}

.export-upsell-title {
  margin: 0 0 3px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent-2);
}

.export-upsell-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.export-upsell-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.console-count-text {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 18px 0 28px;
  color: var(--muted);
  font-size: 0.92rem;
}

.policy-shell {
  padding: 34px 0 44px;
}

.policy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.policy-title {
  margin: 0;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
}

.policy-intro {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 72ch;
}

.policy-card h2,
.policy-card h3 {
  margin-top: 0;
}

.policy-card p,
.policy-card li {
  color: color-mix(in oklab, var(--text), #000 4%);
}

.policy-card ul {
  margin: 0;
  padding-left: 20px;
}

.policy-card li {
  margin-bottom: 8px;
}

.hero-doc-card {
  border-top: 3px solid color-mix(in oklab, var(--accent), #fff 20%);
}

.metrics-strip {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.metric-k {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-v {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.doc-layout {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 14px;
}

.doc-toc {
  position: sticky;
  top: 92px;
  height: fit-content;
  padding: 16px;
}

.toc-title {
  margin: 0 0 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.doc-toc a {
  display: block;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.doc-toc a:hover {
  border-color: color-mix(in oklab, var(--accent), #fff 55%);
  color: var(--text);
  background: color-mix(in oklab, var(--accent), #fff 92%);
}

.doc-main {
  display: grid;
  gap: 12px;
}

.doc-section {
  border-left: 3px solid color-mix(in oklab, var(--accent), #fff 36%);
}

.need-line {
  margin-top: 0;
  color: var(--text);
}

.checklist-list li {
  list-style: "\2713  ";
  padding-left: 4px;
}

.callout {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--accent), #fff 70%);
  background: color-mix(in oklab, var(--accent), #fff 92%);
}

/* ── Portal page ─────────────────────────────────── */

.is-hidden {
  display: none !important;
}

.portal-auth-wrap {
  padding: 18px 0 10px;
  margin-bottom: 10px;
}

.portal-auth {
  display: grid;
  gap: 12px;
}

.portal-auth-head {
  display: grid;
  gap: 6px;
}

.portal-auth-head h2 {
  margin: 0;
}

.auth-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-status.is-error {
  color: #aa3e2f;
}

.portal-auth-grid {
  display: grid;
  gap: 10px;
}

.auth-alt-action {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-alt-action p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.forgot-password-panel {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.reset-token-panel {
  margin-top: 14px;
}

.auth-login-actions {
  display: flex;
  align-items: end;
  height: 100%;
}

.session-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pilot-link-wrap { display:inline-flex; align-items:center; }
.pilot-link-wrap a { display:inline-flex; align-items:center; padding:4px; border-radius:10px; }
.pilot-icon { height:32px; width:auto; object-fit:contain; border-radius:6px; }

.session-left { display:flex; align-items:center; gap:10px; }
.session-right { display:flex; align-items:center; gap:8px; }

.portal-session-bar {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 14px;
}

.session-identity {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  color: var(--muted);
}

.role-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.role-badge-admin    { background: color-mix(in oklab, var(--accent), #fff 80%); color: var(--accent); border: 1px solid color-mix(in oklab, var(--accent), #fff 55%); }
.role-badge-developer{ background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.role-badge-billing  { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }

.is-role-readonly {
  position: relative;
  opacity: 0.55;
  pointer-events: none;
}

.is-role-readonly::after {
  content: "Read only";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}


.portal-shell {
  padding: 12px 0 56px;
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.portal-nav {
  position: sticky;
  top: 90px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.portal-nav-group-label {
  margin: 12px 0 4px;
  padding: 0 8px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: color-mix(in oklab, var(--muted), var(--text) 30%);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  border-top: 1px solid color-mix(in oklab, var(--line), #fff 10%);
  padding-top: 8px;
}

.portal-nav-group-label-icon {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.portal-nav-group-icon {
  height: 1em;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.portal-nav-group-label:first-of-type {
  margin-top: 8px;
  border-top: none;
  padding-top: 0;
}

.portal-nav a {
  text-decoration: none;
  color: color-mix(in oklab, var(--muted), var(--text) 18%);
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 0.92rem;
  line-height: 1.2;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 120ms ease;
}

.portal-nav-subitem {
  padding-left: 24px;
}

.ai-endpoint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.ai-endpoint-card {
  padding: 18px;
  border: 1px solid color-mix(in oklab, var(--line), #fff 24%);
}

.ai-endpoint-head {
  margin-bottom: 8px;
}

.ai-endpoint-head h3 {
  margin: 0;
}

.ai-endpoint-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--accent), #fff 45%);
  background: color-mix(in oklab, var(--accent), #fff 92%);
  color: var(--accent-2);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-endpoint-spec {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.ai-endpoint-spec strong {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.ai-endpoint-spec pre {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--accent-2), #fff 93%);
  color: var(--text);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-key-form {
  margin-top: 16px;
}

.portal-nav a:hover {
  color: var(--text);
  border-color: color-mix(in oklab, var(--accent), #fff 52%);
  background: color-mix(in oklab, var(--accent), #fff 91%);
  transform: translateX(1px);
}

.portal-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  border-color: color-mix(in oklab, var(--accent), #fff 45%);
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent), #fff 82%) 0 3px, transparent 3px),
    color-mix(in oklab, var(--accent), #fff 90%);
}

.portal-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.quota-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  flex-wrap: wrap;
}

.quota-banner-warning {
  background: #fffbeb;
  border: 1px solid #f5c842;
  color: #7a5c00;
}

.quota-banner-exceeded {
  background: #fff1f1;
  border: 1px solid #e5a0a0;
  color: #7a2020;
}

.quota-banner-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.quota-banner span:nth-child(2) {
  flex: 1;
}

.quota-banner-link {
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
  color: inherit;
}

.quota-banner-dismiss {
  margin-left: auto;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: inherit;
  opacity: 0.6;
  padding: 0 2px;
  flex-shrink: 0;
}

.quota-banner-dismiss:hover { opacity: 1; }


.portal-main > .card {
  min-width: 0;
}

.portal-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.plan-pill {
  border: 1px solid color-mix(in oklab, var(--accent), #fff 60%);
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent), #fff 91%);
  color: var(--accent-2);
  font-size: 0.8rem;
  font-family: "IBM Plex Mono", monospace;
  padding: 6px 10px;
}

.portal-metrics {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.metric-label {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-value {
  margin: 7px 0 0;
  font-weight: 700;
  font-size: 1.12rem;
}

.usage-track {
  margin-top: 12px;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.usage-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in oklab, var(--accent), #fff 35%));
  transition: width 240ms ease;
}

.usage-caption {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.overview-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.overview-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  min-width: 0;
}

.overview-card-wide {
  grid-column: 1 / -1;
}

.overview-card-double {
  grid-column: span 2;
}

.overview-card-sub {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85em;
}

/* Activity bar chart */
.overview-activity-chart {
  margin-top: 10px;
  width: 100%;
}

.overview-activity-svg {
  width: 100%;
  height: auto;
  display: block;
}

.overview-bar {
  fill: var(--accent);
  opacity: 0.85;
}

.overview-bar-zero {
  fill: var(--line);
  opacity: 1;
}

.overview-bar-count {
  font-size: 11px;
  fill: var(--muted);
  font-family: inherit;
}

.overview-bar-label {
  font-size: 11px;
  fill: var(--muted);
  font-family: inherit;
}

.overview-chart-empty {
  margin-top: 18px;
  text-align: center;
}

.overview-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.overview-card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.overview-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.overview-jump-link {
  font-size: 0.8rem;
  color: var(--accent-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.overview-jump-link:hover {
  border-bottom-color: color-mix(in oklab, var(--accent-2), #fff 35%);
}

.overview-kpi-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.overview-kpi-row {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface), #fff 62%);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
  gap: 12px;
  font-size: 0.84rem;
  color: var(--muted);
}

.overview-kpi-row span {
  min-width: 0;
}

.overview-kpi-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 0.88rem;
  text-align: right;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.trend-chart {
  width: 100%;
  height: 120px;
  margin-top: 8px;
}

.trend-axis {
  stroke: #90a3ac;
  stroke-width: 1;
}

.trend-grid {
  stroke: #d6e0e4;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.trend-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.health-layout {
  margin-top: 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.health-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 100%, #d8e2e6 0 100%);
  position: relative;
  display: grid;
  place-items: center;
}

.health-ring::after {
  content: "";
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
}

.health-ring span {
  position: relative;
  z-index: 1;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: 0.86rem;
}

.health-stats p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--muted);
}

.health-stats {
  display: grid;
  gap: 8px;
}

.health-stats strong {
  color: var(--text);
}

.forecast-message {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.forecast-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.forecast-metric {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 3px;
  background: color-mix(in oklab, var(--surface), #fff 55%);
}

.forecast-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.forecast-metric strong {
  font-size: 1.04rem;
}

.key-activity-list {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.key-activity-row {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 1fr;
  gap: 10px;
  padding: 10px;
  font-size: 0.86rem;
  border-top: 1px solid var(--line);
}

.key-activity-row:first-child {
  border-top: none;
}

.key-activity-row p {
  margin: 0;
  color: var(--muted);
}

.portal-form-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1.6fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.portal-form-grid-4 {
  grid-template-columns: 1.8fr 0.7fr 1.2fr auto;
}

.portal-form-grid-team {
  grid-template-columns: 1fr 1.6fr 1.05fr auto;
}

.portal-form-grid-3 {
  grid-template-columns: 1.6fr 1fr auto;
}

.portal-form-grid label {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.portal-form-grid input,
.portal-form-grid select,
.portal-form-grid textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.portal-form-grid select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.portal-form-grid input:focus,
.portal-form-grid select:focus,
.portal-form-grid textarea:focus {
  outline: 2px solid color-mix(in oklab, var(--accent), #fff 45%);
  outline-offset: 1px;
  border-color: color-mix(in oklab, var(--accent), #fff 55%);
}

.portal-form-grid textarea {
  min-height: 78px;
  resize: vertical;
}

.docs-key-picker {
  grid-template-columns: minmax(0, 420px);
  margin-bottom: 8px;
}

.docs-onboarding {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
}

.docs-onboarding-controls {
  max-width: 280px;
}

.docs-checklist-list {
  margin: 10px 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.docs-checklist-item,
.docs-checklist-summary {
  font-size: 0.86rem;
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface), #fff 70%);
}

.docs-checklist-item.is-done {
  color: var(--text);
  border-color: color-mix(in oklab, var(--accent), #fff 55%);
  background: color-mix(in oklab, var(--accent), #fff 93%);
}

.docs-checklist-summary {
  font-weight: 600;
}

.docs-subhead {
  margin-top: 18px;
}

.docs-explorer-toolbar {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.docs-templates-card,
.docs-builder-card,
.docs-response-card {
  margin-top: 15px;
}

.docs-templates-head,
.docs-builder-head,
.docs-response-head {
  margin-bottom: 12px;
}

.docs-templates-head h4,
.docs-builder-head h4,
.docs-response-head h4 {
  margin: 0 0 4px 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-strong);
}

.docs-templates-head .section-sub,
.docs-builder-head .section-sub,
.docs-response-head .section-sub {
  margin: 0;
}

.docs-templates-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: end;
}

.docs-presets-legend {
  margin-top: 12px;
  padding: 10px;
  background: color-mix(in oklab, var(--accent), #fff 96%);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  font-size: 0.82rem;
  line-height: 1.4;
}

.docs-presets-legend p {
  margin: 0;
  color: var(--text-muted);
}

.docs-response-meta {
  margin: 8px 0 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.docs-explorer-grid {
  grid-template-columns: 1.3fr 1.5fr 0.7fr auto;
}

.docs-explorer-request-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.docs-request-actions-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.docs-explorer-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.docs-meta-pill {
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff;
}

.docs-troubleshooting-panel {
  margin-top: 10px;
  border: 1px solid color-mix(in oklab, var(--accent), #fff 62%);
  border-radius: 10px;
  background: color-mix(in oklab, var(--accent), #fff 95%);
  padding: 10px 12px;
}

.docs-troubleshooting-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.docs-troubleshooting-head h4 {
  margin: 0;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-2);
}

.docs-recipes-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.docs-recipe-btn {
  text-align: left;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.docs-recipe-btn:hover {
  border-color: color-mix(in oklab, var(--accent), #fff 55%);
  background: color-mix(in oklab, var(--accent), #fff 93%);
}

@media (max-width: 920px) {
  .docs-explorer-toolbar {
    grid-template-columns: 1fr;
  }

  .docs-templates-grid {
    grid-template-columns: 1fr;
  }

  .docs-recipes-grid {
    grid-template-columns: 1fr;
  }
}

.key-list,
.team-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.key-usage-block {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.key-usage-table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow-x: auto;
}

.key-usage-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.key-usage-table th,
.key-usage-table td {
  text-align: left;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  font-size: 0.83rem;
}

.key-usage-table thead th {
  border-top: none;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.owner-cell {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-empty {
  color: var(--muted);
}

.table-subtle {
  color: var(--muted);
  font-size: 0.78rem;
}

.actions-col {
  width: 72px;
  text-align: right;
}

.kebab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.06em;
}

.kebab-btn:hover {
  color: var(--text);
  border-color: color-mix(in oklab, var(--accent), #fff 55%);
  background: color-mix(in oklab, var(--accent), #fff 94%);
}

.row-action-list {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(9, 18, 24, 0.14);
  padding: 6px;
}

.row-action-floater {
  position: fixed;
  min-width: 190px;
  z-index: 9999;
}

.row-action-item {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  padding: 7px 8px;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.row-action-item:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.row-action-item:hover {
  border-color: color-mix(in oklab, var(--accent), #fff 58%);
  background: color-mix(in oklab, var(--accent), #fff 94%);
}

.row-action-item.is-danger {
  color: #8f3a3a;
}

.row-action-item.is-danger:hover {
  border-color: #e4c2c2;
  background: #fdf1f1;
}

.key-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.74rem;
  font-family: "IBM Plex Mono", monospace;
}

.key-status-pill.is-active {
  background: color-mix(in oklab, var(--accent), #fff 88%);
  border-color: color-mix(in oklab, var(--accent), #fff 55%);
  color: var(--accent-2);
}

.key-status-pill.is-revoked {
  background: #f8eded;
  border-color: #e9caca;
  color: #8f3a3a;
}

.key-status-pill.is-suspended {
  background: #fff6e8;
  border-color: #f1d9a9;
  color: #8a5a00;
}

.key-card,
.team-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.key-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.key-name {
  margin: 0;
  font-weight: 700;
}

.key-scope {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: "IBM Plex Mono", monospace;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.key-scope.uc-search    { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.key-scope.uc-training  { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.key-scope.uc-rag       { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.key-scope.uc-monitoring { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.key-scope.uc-research  { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.key-scope.uc-enrichment { background: #fef9c3; color: #a16207; border-color: #fef08a; }
.key-scope.uc-other     { background: var(--surface-2); color: var(--muted); border-color: var(--border); }

@media (prefers-color-scheme: dark) {
  .key-scope.uc-search    { background: #0c4a6e; color: #7dd3fc; border-color: #0369a1; }
  .key-scope.uc-training  { background: #78350f; color: #fcd34d; border-color: #b45309; }
  .key-scope.uc-rag       { background: #4c1d95; color: #c4b5fd; border-color: #6d28d9; }
  .key-scope.uc-monitoring { background: #1e3a8a; color: #93c5fd; border-color: #1d4ed8; }
  .key-scope.uc-research  { background: #14532d; color: #86efac; border-color: #15803d; }
  .key-scope.uc-enrichment { background: #713f12; color: #fde047; border-color: #a16207; }
  .key-scope.uc-other     { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
}

.key-token {
  margin: 8px 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86rem;
  overflow-x: auto;
}

.key-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.key-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.key-policy-badges {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.key-policy-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in oklab, var(--accent), #fff 95%);
  padding: 12px;
  display: grid;
  gap: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 23, 30, 0.46);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 90;
}

.modal-dialog {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  display: grid;
  gap: 12px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.modal-head h3 {
  margin: 0;
}

.reveal-modal-dialog {
  width: min(560px, 100%);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#whitelist-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#whitelist-submit {
  margin-top: 6px;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 150ms;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--accent-2);
}

.form-error {
  font-size: 0.85rem;
  color: #e04a4a;
  padding: 6px 0;
}

.form-success {
  font-size: 0.95rem;
  color: #2aab6e;
  font-weight: 600;
  padding: 8px 0;
}

.reveal-token-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
}

.reveal-token {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  word-break: break-all;
  white-space: pre-wrap;
  color: var(--fg);
  user-select: all;
}

.reveal-actions {
  display: flex;
  gap: 8px;
}

.reveal-warning {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  border-left: 3px solid var(--warning, #f59e0b);
  padding-left: 10px;
  line-height: 1.5;
}

.key-policy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;

  .row-action-list {
    right: auto;
    left: 0;
  }
}

.policy-actions-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 48px;
}

.policy-actions-group legend {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  padding: 0 4px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.key-rotate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.audit-filter-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.console-status {
  margin: 10px 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86rem;
}

.console-endpoint {
  margin-top: -4px;
  font-size: 0.8rem;
}

.audit-endpoint-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--accent), #fff 58%);
  background: color-mix(in oklab, var(--accent), #fff 94%);
  color: var(--accent-2);
  font-size: 0.74rem;
  font-family: "IBM Plex Mono", monospace;
}

.audit-endpoint-link {
  font-size: 0.78rem;
  color: var(--accent-2);
}

/* ── Current Plan Bar ─────────────────────────────────────────────────────── */

.current-plan-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(180deg, var(--surface-2), color-mix(in oklab, var(--surface-2), #fff 14%));
  border: 1px solid color-mix(in oklab, var(--border), var(--accent) 18%);
  border-radius: 10px;
  margin-top: 8px;
}

.current-plan-bar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.current-plan-bar-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.current-plan-bar-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.plan-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 100px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

.plan-scheduled-badge {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--warning, #f59e0b);
  background: color-mix(in srgb, var(--warning, #f59e0b) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning, #f59e0b) 30%, transparent);
  border-radius: 100px;
  padding: 2px 10px;
}

.current-plan-bar-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.billing-plan-meta-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface), #fff 25%);
}

.billing-plan-meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.billing-plan-meta-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.2;
}

.plan-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.plan-feature-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in oklab, var(--surface), #fff 25%);
}

.plan-feature-list li small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 880px) {
  .current-plan-bar-meta {
    grid-template-columns: 1fr;
  }
}

/* ── Plan Change Modal ────────────────────────────────────────────────────── */

.plan-change-dialog {
  width: min(860px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.plan-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 680px) {
  .plan-cards {
    grid-template-columns: 1fr;
  }
}

.plan-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 18px 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
  user-select: none;
}

.plan-card:hover:not(.plan-card--current) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.plan-card--current {
  cursor: default;
  opacity: 0.7;
}

.plan-card--selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.plan-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-card-name {
  font-size: 1rem;
  font-weight: 700;
}

.plan-card-badge {
  font-size: 0.72rem;
  padding: 1px 8px;
  border-radius: 100px;
  font-weight: 600;
}

.plan-card-badge--current {
  background: var(--accent);
  color: #fff;
}

.plan-card-badge--scheduled {
  background: color-mix(in srgb, var(--warning, #f59e0b) 15%, transparent);
  color: var(--warning, #f59e0b);
  border: 1px solid color-mix(in srgb, var(--warning, #f59e0b) 30%, transparent);
}

.plan-card-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--fg);
}

.plan-card-period {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
}

.plan-card-quota {
  font-size: 0.82rem;
  color: var(--muted);
}

.plan-card-features {
  margin: 0;
  padding: 0 0 0 16px;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.plan-card-license {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.plan-card-select-indicator {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  padding-top: 6px;
}

.plan-card-select-btn {
  align-self: stretch;
  margin-top: auto;
}

/* ── Proration Box ────────────────────────────────────────────────────────── */

.plan-proration-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface-2);
}

.plan-proration-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fg);
}

.plan-proration-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proration-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.proration-row:last-child {
  border-bottom: none;
}

.proration-row--credit span:first-child {
  color: var(--success, #22c55e);
}

.proration-row--credit strong {
  color: var(--success, #22c55e);
}

.proration-row--charge strong {
  color: var(--accent);
}

.proration-row--total {
  font-size: 0.95rem;
  font-weight: 700;
  padding-top: 10px;
  border-top: 2px solid var(--border);
  border-bottom: none;
}

.plan-proration-policy {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.plan-proration-policy h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.plan-proration-policy p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.plan-change-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.billing-exports {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.billing-history-block {
  margin-top: 18px;
}

.billing-history-head {
  margin-bottom: 10px;
}

.billing-history-table td:last-child,
.billing-history-table th:last-child {
  width: 140px;
}

.billing-cost-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.billing-cost-table-wrap {
  overflow-x: hidden;
}

.billing-cost-table {
  min-width: 0;
  table-layout: fixed;
}

.billing-cost-table th,
.billing-cost-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

.billing-cost-table th:nth-child(1),
.billing-cost-table td:nth-child(1) {
  width: 22%;
}

.billing-cost-table th:nth-child(2),
.billing-cost-table td:nth-child(2) {
  width: 30%;
}

.billing-cost-table th:nth-child(3),
.billing-cost-table td:nth-child(3),
.billing-cost-table th:nth-child(4),
.billing-cost-table td:nth-child(4),
.billing-cost-table th:nth-child(5),
.billing-cost-table td:nth-child(5),
.billing-cost-table th:nth-child(6),
.billing-cost-table td:nth-child(6) {
  width: auto;
}

.webhook-form-grid {
  margin-top: 10px;
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.webhook-create-card {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in oklab, var(--surface), #fff 50%);
  padding: 14px;
}

.webhook-create-head {
  margin-bottom: 8px;
}

.webhook-form-grid label {
  min-width: 0;
}

.webhook-field-help {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.webhook-events-fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px 12px;
  display: grid;
  gap: 8px;
  min-width: 0;
  background: color-mix(in oklab, var(--surface), var(--accent) 2%);
  grid-column: 1 / -1;
}

.webhook-events-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.webhook-events-fieldset label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid color-mix(in oklab, var(--line), #fff 35%);
  font-size: 0.9rem;
}

.webhook-events-fieldset input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  margin: 0;
  border-radius: 4px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.data-job-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.data-job-category {
  border: 1px solid color-mix(in oklab, var(--line), #fff 20%);
  border-radius: 10px;
  background: var(--surface);
  overflow: clip;
}

.data-job-category summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}

.data-job-category[open] summary {
  border-bottom-color: color-mix(in oklab, var(--line), #fff 20%);
}

.data-job-category summary::-webkit-details-marker {
  display: none;
}

.data-job-category-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
}

.data-job-category-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.data-job-category-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.data-job-category-count {
  font-size: 0.78rem;
  color: var(--muted);
}

.data-job-category-expander {
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--line), #fff 20%);
  color: var(--muted);
}

.data-job-category-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px 12px;
}

.data-job-field-option {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "check name"
    "check type";
  gap: 2px 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid color-mix(in oklab, var(--line), #fff 15%);
  border-radius: 8px;
  background: color-mix(in oklab, var(--surface-2), #fff 15%);
}

.data-job-field-option input[type="checkbox"] {
  grid-area: check;
  margin-top: 3px;
}

.data-job-field-option span {
  grid-area: name;
  font-size: 0.86rem;
}

.data-job-field-option small {
  grid-area: type;
  font-size: 0.74rem;
  color: var(--muted);
}

#data-job-list-body tr.is-selected {
  background: color-mix(in oklab, var(--accent), var(--surface) 92%);
}

[data-theme="dark"] #data-job-list-body tr.is-selected {
  background: color-mix(in oklab, var(--accent), #0e1218 90%);
}

[data-theme="dark"] .data-job-category {
  background: #111111;
  border-color: var(--line);
}

[data-theme="dark"] .data-job-category[open] summary {
  border-bottom-color: #252525;
}

[data-theme="dark"] .data-job-field-option {
  background: #141414;
  border-color: #2a2a2a;
}

[data-theme="dark"] .data-job-category-expander {
  border-color: #2a2a2a;
  color: #a0a0a0;
}

.webhook-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.webhook-form-actions .btn {
  min-width: 150px;
}

.webhook-table-wrap {
  margin-top: 14px;
}

@media (max-width: 920px) {
  .webhook-form-grid {
    grid-template-columns: 1fr;
  }

  .data-job-fields {
    gap: 10px;
  }

  .data-job-category-fields {
    grid-template-columns: 1fr;
  }
}

.webhook-delivery-head {
  margin-top: 18px;
}

.team-row {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(280px, 1.4fr);
  align-items: center;
  gap: 10px;
}

.team-name,
.team-email,
.team-role {
  margin: 0;
}

.team-role-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.team-role-select {
  min-width: 130px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

.team-name {
  font-weight: 600;
}

.team-role {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  color: var(--muted);
}

.snippet-head {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.snippet-title {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.snippet-output {
  min-height: 110px;
  max-height: 240px;
  max-width: 100%;
  overflow: auto;
}

.portal-page .hero,
.portal-page .footer {
  display: none;
}

/* ── Pricing page ────────────────────────────────── */

.pricing-shell {
  padding: 24px 0 60px;
  display: grid;
  gap: 18px;
}

/* Value anchor strip */
.pricing-value-strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: stretch;
  gap: 24px;
  padding: 28px 32px;
}

.pvs-primary,
.pvs-compare {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pvs-primary {
  border: 1px solid color-mix(in oklab, var(--accent), #fff 60%);
  border-radius: 14px;
  background: linear-gradient(160deg, #fff, color-mix(in oklab, var(--accent), #fff 92%));
  padding: 18px;
}

.pvs-headline {
  margin: 6px 0 4px;
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
}

.pvs-detail {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 58ch;
}

.pvs-compare {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 18px;
  justify-content: center;
}

.pvs-compare-label {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.pvs-compare-line {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Tier grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

#pricing-paid-tiers {
  display: contents;
}

.tier-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  height: 100%;
}

.tier-card--featured {
  border-color: var(--accent);
  border-width: 2px;
  background: linear-gradient(160deg, color-mix(in oklab, var(--accent), #fff 92%), var(--surface));
}

.tier-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.tier-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tier-label {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.tier-price {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.tier-per {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--muted);
}

.tier-sub {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.tier-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.tier-features li {
  font-size: 0.9rem;
  padding-left: 18px;
  position: relative;
  color: var(--text);
}

.tier-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.82rem;
}

.tier-license {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: auto;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-cta {
  display: block;
  text-align: center;
  margin-top: 4px;
}

/* Enterprise row */
.pricing-enterprise {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: center;
  padding: 36px 36px;
}

.pe-title {
  margin: 8px 0 10px;
  font-size: 1.3rem;
}

.pe-desc {
  margin: 0 0 16px;
  color: var(--muted);
  max-width: 68ch;
}

.pe-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.pe-list li {
  font-size: 0.92rem;
  color: var(--text);
}

.pe-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pe-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  max-width: 22ch;
}

/* Pricing table override */
.pricing-table .col-us {
  background: color-mix(in oklab, var(--accent), #fff 90%) !important;
}

/* FAQ */
.pricing-faq {
  padding-bottom: 8px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.faq-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ── Help & Guide ────────────────────────────────────────── */
.help-search-wrap {
  margin-bottom: 18px;
}

.help-search-input {
  width: 100%;
  max-width: 480px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  font-size: 0.95rem;
}

.help-search-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Quick Start */
.help-quickstart {
  margin-bottom: 14px;
  padding: 18px 20px 20px;
}

.help-qs-head {
  margin: 0 0 12px;
  font-size: 1rem;
}

.help-qs-steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-qs-steps li {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Confirm Modal ───────────────────────────────────────── */
.confirm-modal-dialog {
  width: min(420px, 100%);
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
  font-weight: 700;
}

.btn-danger:hover {
  background: #b91c1c;
}

/* ── Toast Notification ──────────────────────────────────── */
.ui-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--fg);
  color: var(--surface);
  padding: 11px 22px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 200;
  box-shadow: 0 4px 24px rgba(0,0,0,0.22);
  transition: opacity 300ms ease, transform 300ms ease;
  white-space: nowrap;
  max-width: calc(100vw - 40px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-toast.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  pointer-events: none;
}

.help-qs-steps li strong {
  color: var(--fg);
}

/* Collapsible groups */
.help-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-group {
  padding: 0;
  overflow: hidden;
}

.help-group[hidden] {
  display: none;
}

.help-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 18px;
  background: none;
  border: none;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  gap: 10px;
}

.help-group-head:hover {
  background: var(--surface-hover, rgba(255,255,255,0.04));
}

.help-group-title {
  flex: 1;
}

.help-group-chevron {
  font-size: 0.8rem;
  color: var(--muted);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.help-group.is-open .help-group-chevron {
  transform: rotate(90deg);
}

.help-group-body {
  padding: 4px 18px 18px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

.help-group-body[hidden] {
  display: none;
}

.help-group-body p {
  margin: 0 0 10px;
}

.help-group-body ul,
.help-group-body ol {
  margin: 0 0 10px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.help-group-body li {
  line-height: 1.5;
}

.help-group-body strong {
  color: var(--fg);
}

/* "Go there" inline link */
.help-go-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.help-go-link:hover {
  text-decoration: underline;
}

/* Key Concepts definition list */
.help-concept-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

.help-concept-list dt {
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 2px;
}

.help-concept-list dd {
  margin: 0;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

/* Tables: roles + errors */
.help-table-wrap {
  overflow-x: auto;
}

.help-role-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.help-role-table th,
.help-role-table td {
  padding: 7px 10px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.help-role-table th {
  background: var(--surface-alt, rgba(255,255,255,0.04));
  font-weight: 600;
  color: var(--fg);
}

.help-role-table td {
  color: var(--muted);
}

.help-role-table tbody tr:hover td {
  background: var(--surface-hover, rgba(255,255,255,0.03));
}

@media (max-width: 900px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-nav {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ai-endpoint-grid {
    grid-template-columns: 1fr;
  }

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

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .key-activity-row {
    grid-template-columns: 1fr;
  }

  .portal-form-grid,
  .portal-form-grid-4,
  .portal-form-grid-3 {
    grid-template-columns: 1fr;
  }

  .key-policy-grid,
  .key-rotate-grid,
  .audit-filter-grid {
    grid-template-columns: 1fr;
  }

  .team-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .team-role-actions {
    justify-content: flex-start;
  }

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

  .pricing-value-strip {
    grid-template-columns: 1fr;
  }

  .pricing-enterprise {
    grid-template-columns: 1fr;
  }

  .pe-action {
    align-items: flex-start;
  }

  .pe-list {
    grid-template-columns: 1fr;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .portal-nav {
    grid-template-columns: 1fr;
  }

  .ai-endpoint-grid {
    grid-template-columns: 1fr;
  }

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

  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Why Us page ─────────────────────────────────── */

.why-section {
  padding: 48px 0 0;
}

.why-section:last-child {
  padding-bottom: 48px;
}

.section-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}

.section-title {
  margin: 0 0 24px;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
}

/* Differentiator cards */
.diff-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.diff-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.diff-card--primary {
  border-top: 3px solid var(--accent);
}

.diff-number {
  font-family: "IBM Plex Mono", monospace;
  font-size: 2rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
}

.diff-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.diff-body {
  margin: 0;
  color: var(--muted);
}

.diff-impact {
  background: color-mix(in oklab, var(--accent-2), #fff 90%);
  border: 1px solid color-mix(in oklab, var(--accent-2), #fff 70%);
  border-radius: 12px;
  padding: 14px;
}

.impact-label {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-2);
}

.diff-impact ul {
  margin: 0;
  padding-left: 18px;
}

.diff-impact li {
  margin-bottom: 6px;
  font-size: 0.94rem;
}

.diff-competitor {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  border-left: 3px solid var(--line);
  padding-left: 12px;
}

/* Signal cards */
.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.signal-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 18px;
}

.signal-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.signal-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.signal-card--highlight {
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent), #fff 88%), var(--surface));
  border-color: color-mix(in oklab, var(--accent), #fff 65%);
}

.signal-card--highlight h3,
.signal-card--highlight p {
  color: var(--text);
}

/* Scale stats */
.scale-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.scale-stat {
  text-align: center;
  padding: 28px 20px;
}

.stat-number {
  margin: 0 0 4px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
}

.stat-label {
  margin: 0 0 10px;
  font-weight: 600;
  font-size: 0.92rem;
}

.stat-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Comparison table */
.table-wrap {
  overflow-x: auto;
  padding: 0;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.compare-table th,
.compare-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.compare-table thead th {
  background: var(--surface-2);
  font-weight: 700;
  font-size: 0.85rem;
}

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

.compare-table tbody tr:hover td {
  background: color-mix(in oklab, var(--bg), #fff 30%);
}

.col-us {
  background: color-mix(in oklab, var(--accent-2), #fff 90%) !important;
  font-weight: 600;
}

.yes {
  color: var(--accent-2);
}

.no {
  color: color-mix(in oklab, var(--text), #fff 40%);
}

.partial {
  color: color-mix(in oklab, var(--signal), #fff 12%);
}

.table-note {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* CTA section */
.cta-card {
  text-align: center;
  padding: 40px 32px;
}

.cta-card h2 {
  margin: 0 0 10px;
  font-size: 1.6rem;
}

.cta-card p {
  margin: 0 0 22px;
  color: var(--muted);
}

.cta-card .hero-actions {
  justify-content: center;
}

@media (max-width: 900px) {
  .diff-grid,
  .signal-grid,
  .scale-grid {
    grid-template-columns: 1fr;
  }

  .metrics-strip,
  .doc-layout {
    grid-template-columns: 1fr;
  }

  .doc-toc {
    position: static;
  }
}

/* ── End Why Us page ─────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeIn 600ms ease forwards;
}

.delay-1 {
  animation-delay: 120ms;
}

.delay-2 {
  animation-delay: 220ms;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 840px) {
  .hero-split {
    grid-template-columns: 1fr;
  }

  .hero-cta-panel {
    margin-top: 0;
  }

  .topbar {
    position: static;
  }

  .topbar-inner {
    min-height: auto;
    padding: 12px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .menu {
    width: 100%;
  }

  .signup-layout,
  .form-grid.two-col {
    grid-template-columns: 1fr;
  }

  .order-summary {
    position: static;
  }

  .checkout-submit {
    width: 100%;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .main-grid .full-span {
    grid-column: auto;
  }

  .switch-grid {
    grid-template-columns: 1fr;
  }

  .insights-grid,
  .viz-controls,
  .viz-layout {
    grid-template-columns: 1fr;
  }

  .viz-canvas {
    height: 300px;
  }
}

/* ── Theme toggle button ─────────────────────────────────────────────────── */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--muted);
  transition: background 150ms, border-color 150ms, color 150ms;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in oklab, var(--accent), transparent 90%);
}

/* Icon: moon in light mode, sun in dark mode (set via CSS so no JS flash) */
.theme-toggle::before {
  content: "☾";
}

[data-theme="dark"] .theme-toggle::before {
  content: "☀";
}

/* ── Dark mode variables ─────────────────────────────────────────────────── */

[data-theme="dark"] {
  --bg: #000000;
  --surface: #111111;
  --surface-2: #0d0d0d;
  --text: #ffffff;
  --muted: #888888;
  --line: #252525;
  --accent: #00e5ff;
  --accent-2: #00bcd4;
  --signal: #e040fb;
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.7);
}

/* ── Dark mode overrides for hardcoded colours ───────────────────────────── */

[data-theme="dark"] body {
  background: #000000;
}

[data-theme="dark"] .orb-a { background: #001f26; }
[data-theme="dark"] .orb-b { background: #1a001f; }

[data-theme="dark"] .topbar {
  background: rgba(0, 0, 0, 0.92);
  border-bottom-color: var(--line);
}

[data-theme="dark"] .brand-name {
  color: #ffffff;
}

[data-theme="dark"] .brand-suffix {
  color: var(--accent);
}

[data-theme="dark"] .card {
  background: var(--surface);
  border-color: var(--line);
}

[data-theme="dark"] .hero-cta-panel {
  background: linear-gradient(160deg, #111111, #0d1a20);
  border-color: var(--line);
  box-shadow: 0 10px 32px rgba(0, 229, 255, 0.07);
}

[data-theme="dark"] .chip {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.2);
}

[data-theme="dark"] .hero-pillars li {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

[data-theme="dark"] .btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: #333333;
}

[data-theme="dark"] .btn-ghost:hover {
  background: rgba(0, 229, 255, 0.08);
  border-color: var(--accent);
}

[data-theme="dark"] .btn-primary {
  box-shadow: 0 12px 30px rgba(0, 229, 255, 0.22);
}

[data-theme="dark"] .switch-card {
  background: #1a1a1a;
  border-color: var(--line);
}

/* Form inputs */
[data-theme="dark"] input:not([type="range"]):not([type="checkbox"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #1a1a1a;
  color: #ffffff;
  border-color: #333333;
}

[data-theme="dark"] .signup-form input,
[data-theme="dark"] .signup-form select,
[data-theme="dark"] .signup-form textarea,
[data-theme="dark"] .portal-form-grid input,
[data-theme="dark"] .portal-form-grid select,
[data-theme="dark"] .portal-form-grid textarea {
  background: #1a1a1a;
  border-color: #333333;
}

/* Cards and surfaces with hardcoded #fff */
[data-theme="dark"] .tab-btn,
[data-theme="dark"] .insight-box,
[data-theme="dark"] .viz-canvas-wrap,
[data-theme="dark"] .viz-detail,
[data-theme="dark"] .metric-item,
[data-theme="dark"] .metric-box,
[data-theme="dark"] .portal-session-bar,
[data-theme="dark"] .viz-controls label,
[data-theme="dark"] .overview-card,
[data-theme="dark"] .key-card,
[data-theme="dark"] .team-row,
[data-theme="dark"] .key-usage-table-wrap,
[data-theme="dark"] .kebab-btn,
[data-theme="dark"] .docs-meta-pill,
[data-theme="dark"] .docs-recipe-btn,
[data-theme="dark"] .usage-track,
[data-theme="dark"] .forecast-metric,
[data-theme="dark"] .overview-kpi-row {
  background: #1a1a1a;
  border-color: var(--line);
  color: var(--text);
}

/* Pilot progress stage card styling */
.pilot-stage-card {
  background: color-mix(in oklab, var(--accent), #fff 92%);
  color: var(--accent-2);
  border: 1px solid color-mix(in oklab, var(--accent), #fff 55%);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.pilot-stage-card h4 { margin: 0 0 8px 0; color: var(--accent-2); }
.pilot-stage-card ul { margin: 0; padding-left: 18px; }
.pilot-stage-card li { margin: 6px 0; }
.pilot-stage-status { font-size: 1.6rem; font-weight: 800; color: var(--accent-2); }

/* Dark mode override: use dark surface for the cards */
[data-theme="dark"] .pilot-stage-card {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}
[data-theme="dark"] .pilot-stage-status { color: var(--accent-2); }

[data-theme="dark"] .row-action-list {
  background: #1a1a1a;
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .tab-btn.is-active {
  background: var(--accent);
  color: #000000;
  border-color: var(--accent);
}

[data-theme="dark"] .viz-canvas {
  background: #111111;
  border-color: var(--line);
}

[data-theme="dark"] .results-loader {
  background: rgba(0, 0, 0, 0.88);
}

[data-theme="dark"] .health-ring::after {
  background: #111111;
}

[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
}

[data-theme="dark"] .modal-dialog {
  background: #111111;
  border-color: var(--line);
}

/* Chart / SVG text */
[data-theme="dark"] .axis-label,
[data-theme="dark"] .axis-tick {
  fill: #666666;
}

[data-theme="dark"] .grid-line {
  stroke: #252525;
}

[data-theme="dark"] .axis-line {
  stroke: #333333;
}

[data-theme="dark"] .trend-grid {
  stroke: #252525;
}

[data-theme="dark"] .trend-axis {
  stroke: #333333;
}

/* Portal nav */
[data-theme="dark"] .portal-nav a:hover,
[data-theme="dark"] .portal-nav a[aria-current="page"] {
  background: rgba(0, 229, 255, 0.07);
  border-color: rgba(0, 229, 255, 0.22);
}

/* Key status pills */
[data-theme="dark"] .key-status-pill.is-active {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.28);
  color: var(--accent);
}

[data-theme="dark"] .key-status-pill.is-revoked {
  background: rgba(200, 50, 50, 0.12);
  border-color: rgba(200, 50, 50, 0.3);
  color: #ff6b6b;
}

[data-theme="dark"] .key-status-pill.is-suspended {
  background: rgba(200, 150, 0, 0.12);
  border-color: rgba(200, 150, 0, 0.3);
  color: #ffd54f;
}

/* Role badges */
[data-theme="dark"] .role-badge-admin {
  background: rgba(0, 229, 255, 0.12);
  color: var(--accent);
  border-color: rgba(0, 229, 255, 0.3);
}

[data-theme="dark"] .role-badge-developer {
  background: #0a2e0d;
  color: #69f0ae;
  border-color: #1b5e20;
}

[data-theme="dark"] .role-badge-billing {
  background: #2e1a00;
  color: #ffd54f;
  border-color: #bf6f00;
}

/* Quota banners */
[data-theme="dark"] .quota-banner-warning {
  background: rgba(200, 150, 0, 0.1);
  border-color: rgba(200, 150, 0, 0.3);
  color: #ffd54f;
}

[data-theme="dark"] .quota-banner-exceeded {
  background: rgba(200, 50, 50, 0.1);
  border-color: rgba(200, 50, 50, 0.3);
  color: #ff6b6b;
}

/* Callout and highlighted boxes */
[data-theme="dark"] .callout {
  background: rgba(0, 229, 255, 0.06);
  border-color: rgba(0, 229, 255, 0.2);
}

[data-theme="dark"] .export-upsell {
  background: rgba(0, 229, 255, 0.06);
  border-color: rgba(0, 229, 255, 0.18);
}

[data-theme="dark"] .key-policy-panel {
  background: rgba(0, 229, 255, 0.05);
  border-color: var(--line);
}

[data-theme="dark"] .docs-troubleshooting-panel {
  background: rgba(0, 229, 255, 0.05);
  border-color: rgba(0, 229, 255, 0.18);
}

[data-theme="dark"] .docs-presets-legend {
  background: rgba(0, 229, 255, 0.05);
}

[data-theme="dark"] .preset-summary {
  background: rgba(0, 229, 255, 0.06);
  border-color: rgba(0, 229, 255, 0.18);
  color: var(--text);
}

[data-theme="dark"] .step-pill {
  background: #1a1a1a;
}

[data-theme="dark"] .step-pill.is-active {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.25);
  color: var(--accent);
}

[data-theme="dark"] .docs-checklist-item,
[data-theme="dark"] .docs-checklist-summary {
  background: #1a1a1a;
  border-color: var(--line);
  color: var(--muted);
}

[data-theme="dark"] .ai-endpoint-badge {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.22);
  color: var(--accent);
}

[data-theme="dark"] .ai-endpoint-spec pre {
  background: #0f2a38;
  color: #e9f3f6;
  border: 1px solid #23313a;
}

[data-theme="dark"] .docs-checklist-item.is-done {
  background: rgba(0, 229, 255, 0.07);
  border-color: rgba(0, 229, 255, 0.22);
  color: var(--text);
}

/* Webhook create card — 50% white mix goes grey in dark mode */
[data-theme="dark"] .webhook-create-card {
  background: var(--surface);
  border-color: var(--line);
}

/* Webhook event checkboxes — white label rows */
[data-theme="dark"] .webhook-events-fieldset label {
  background: #1a1a1a;
  border-color: var(--line);
  color: var(--text);
}

[data-theme="dark"] .billing-plan-meta-item {
  background: #1a1a1a;
}

[data-theme="dark"] .plan-card {
  background: #111111;
}

[data-theme="dark"] .plan-card--selected {
  background: rgba(0, 229, 255, 0.06);
}

[data-theme="dark"] .nav-cta {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 229, 255, 0.08);
}

[data-theme="dark"] .nav-cta:hover,
[data-theme="dark"] .nav-cta[aria-current="page"] {
  background: var(--accent);
  color: #000000;
  border-color: var(--accent);
}

/* ── Dark mode: remaining light-background fixes ─────────────────────────── */

/* "Why this matters for you" inner callout boxes */
[data-theme="dark"] .diff-impact {
  background: rgba(0, 229, 255, 0.06);
  border-color: rgba(0, 229, 255, 0.15);
}

[data-theme="dark"] .impact-label {
  color: var(--accent);
}

/* "Pricing starts here" white-gradient panel */
[data-theme="dark"] .pvs-primary {
  background: linear-gradient(160deg, #1c1c1c, #111111);
  border-color: rgba(0, 229, 255, 0.22);
}

/* Highlighted "us" column in comparison tables */
[data-theme="dark"] .col-us,
[data-theme="dark"] .pricing-table .col-us {
  background: rgba(0, 229, 255, 0.08) !important;
}

/* "Why pre-computed matters" signal highlight card */
[data-theme="dark"] .signal-card--highlight {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.1), #111111);
  border-color: rgba(0, 229, 255, 0.22);
}

/* Featured pricing tier gradient */
[data-theme="dark"] .tier-card--featured {
  background: linear-gradient(160deg, rgba(0, 229, 255, 0.09), #111111);
}

/* btn-ghost — ensure no white background leaks through */
[data-theme="dark"] .btn,
[data-theme="dark"] .btn-ghost,
[data-theme="dark"] button.btn-ghost {
  background: transparent;
  border-color: #333333;
  color: var(--text);
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] button.btn-primary {
  background: var(--accent);
  color: #000000;
  border-color: var(--accent);
}

/* compare-table hover row */
[data-theme="dark"] .compare-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

/* .yes / .partial in dark mode tables */
[data-theme="dark"] .yes {
  color: var(--accent);
}

[data-theme="dark"] .partial {
  color: #e040fb;
}

/* Admin console */
.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;
}

/* Admin console uses a wider, fluid shell than the marketing container */
.admin-page .container {
  width: min(1760px, 95vw);
}

.admin-shell {
  padding: 18px 0 56px;
  display: grid;
  gap: 16px;
}

.admin-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
}

.admin-lead {
  max-width: 70ch;
  color: var(--muted);
  margin: 8px 0 0;
}

.admin-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.admin-summary-card {
  padding: 18px;
}

.admin-summary-label {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.admin-summary-value {
  margin: 8px 0 4px;
  font-size: 1.8rem;
  font-weight: 700;
}

.admin-summary-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-workbench {
  padding: 18px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.admin-tabs {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-tab {
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface), #fff 18%);
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 600;
  cursor: pointer;
}

.admin-tab.is-active {
  color: var(--text);
  border-color: color-mix(in oklab, var(--accent), #fff 55%);
  background: color-mix(in oklab, var(--accent), #fff 90%);
}

.admin-search-wrap input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.admin-status {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
}

.admin-workbench-grid {
  display: grid;
  grid-template-columns: minmax(460px, 1.35fr) minmax(480px, 0.92fr);
  gap: 20px;
  align-items: start;
}

.admin-list-panel,
.admin-detail-panel {
  min-width: 0;
}

.admin-list {
  display: grid;
  gap: 10px;
  max-height: 76vh;
  overflow: auto;
  padding-right: 4px;
}

.admin-list-head,
.admin-list-row {
  display: grid;
  gap: 12px;
  align-items: center;
}

.admin-org-head,
.admin-org-row {
  grid-template-columns: 1.6fr 0.8fr 0.9fr 0.8fr 0.8fr;
}

.admin-user-head,
.admin-user-row {
  grid-template-columns: 1.4fr 0.6fr 1fr 0.7fr;
}

.admin-audit-head,
.admin-audit-row {
  grid-template-columns: 1.5fr 1fr 0.6fr 0.9fr;
}

.admin-list-head {
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: "IBM Plex Mono", monospace;
}

.admin-list-row {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.admin-list-row:hover,
.admin-list-row.is-active {
  border-color: color-mix(in oklab, var(--accent), #fff 54%);
  background: color-mix(in oklab, var(--accent), #fff 94%);
}

.admin-list-main {
  display: grid;
  gap: 4px;
}

.admin-muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-detail-panel {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 92px;
}

.admin-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* Detail head stacks: title block on top, status chips as a full-width row
   beneath so they spread out instead of bunching into the right corner. */
.admin-detail-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

/* Inside the (narrower) detail panel, stack each section header so the
   title never wraps mid-phrase against its description. */
.admin-detail-panel .admin-section-head {
  flex-direction: column;
  gap: 4px;
}

.admin-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

.admin-chip.is-success {
  background: #edf8f0;
  border-color: #b7e2c0;
  color: #2e7d32;
}

.admin-chip.is-warning {
  background: #fff7e5;
  border-color: #f1d38a;
  color: #a86b00;
}

.admin-chip.is-danger {
  background: #ffecec;
  border-color: #f0b7b7;
  color: #b23b3b;
}

.admin-chip.is-neutral {
  background: color-mix(in oklab, var(--surface), #fff 20%);
  color: var(--text);
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.admin-split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  align-items: start;
}

.admin-metric-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface);
}

.admin-metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: "IBM Plex Mono", monospace;
  margin-bottom: 8px;
}

.admin-metric-card strong {
  font-size: 1.05rem;
}

.admin-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface), #fff 12%), var(--surface));
  display: grid;
  gap: 14px;
}

.admin-inline-form,
.admin-member-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.admin-field {
  display: grid;
  gap: 6px;
  min-width: 180px;
  flex: 1 1 180px;
}

.admin-field span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.admin-field input,
.admin-field select,
.admin-inline-form select,
.admin-table select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--text);
}

.admin-inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-table-wrap {
  overflow: auto;
}

.admin-feedback-toolbar {
  grid-template-columns: auto auto auto;
  width: max-content;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.admin-feedback-filter select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  min-width: 160px;
}

.admin-feedback-status-select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85em;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid color-mix(in oklab, var(--line), #fff 24%);
  vertical-align: top;
}

.admin-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-key-list,
.admin-audit-list {
  display: grid;
  gap: 10px;
}

.admin-mini-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface);
  display: grid;
  gap: 4px;
}

.admin-json {
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
}

.admin-empty {
  border: 1px dashed color-mix(in oklab, var(--line), var(--accent) 24%);
  border-radius: 16px;
  padding: 24px;
  color: var(--muted);
  background: color-mix(in oklab, var(--surface), #fff 18%);
}

.admin-empty-inline {
  padding: 16px;
}

.admin-access-denied {
  margin-top: 16px;
}

.admin-auth-card {
  padding: 22px;
  display: grid;
  gap: 16px;
}

.admin-auth-form {
  max-width: 860px;
}

.admin-create-card {
  margin-bottom: 16px;
}

.admin-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.admin-create-form .admin-field {
  min-width: 0;
}

.admin-create-form .btn {
  min-height: 44px;
}

.admin-create-status {
  margin: 12px 0 0;
}

[data-theme="dark"] .admin-summary-card,
[data-theme="dark"] .admin-section,
[data-theme="dark"] .admin-mini-card,
[data-theme="dark"] .admin-metric-card,
[data-theme="dark"] .admin-list-row,
[data-theme="dark"] .admin-list-head,
[data-theme="dark"] .admin-tab,
[data-theme="dark"] .admin-field input,
[data-theme="dark"] .admin-field select,
[data-theme="dark"] .admin-inline-form select,
[data-theme="dark"] .admin-table select,
[data-theme="dark"] .admin-search-wrap input,
[data-theme="dark"] .admin-json,
[data-theme="dark"] .admin-empty,
[data-theme="dark"] .admin-auth-card {
  background: #111111;
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .admin-summary-card,
[data-theme="dark"] .admin-metric-card,
[data-theme="dark"] .admin-mini-card,
[data-theme="dark"] .admin-section,
[data-theme="dark"] .admin-list-row,
[data-theme="dark"] .admin-auth-card,
[data-theme="dark"] .admin-empty,
[data-theme="dark"] .admin-json {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

[data-theme="dark"] .admin-tab {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .admin-tab.is-active {
  color: #000000;
  background: var(--accent);
  border-color: var(--accent);
}

[data-theme="dark"] .admin-list-head {
  color: rgba(255, 255, 255, 0.58);
}

[data-theme="dark"] .admin-list-row {
  color: var(--text);
}

[data-theme="dark"] .admin-list-row:hover,
[data-theme="dark"] .admin-list-row.is-active {
  border-color: rgba(0, 229, 255, 0.36);
  background: rgba(0, 229, 255, 0.12);
}

[data-theme="dark"] .admin-empty {
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .admin-chip.is-success {
  background: rgba(46, 125, 50, 0.18);
  border-color: rgba(46, 125, 50, 0.36);
  color: #91e59b;
}

[data-theme="dark"] .admin-chip.is-warning {
  background: rgba(168, 107, 0, 0.18);
  border-color: rgba(241, 211, 138, 0.3);
  color: #ffd37c;
}

[data-theme="dark"] .admin-chip.is-danger {
  background: rgba(178, 59, 59, 0.18);
  border-color: rgba(240, 183, 183, 0.3);
  color: #ffb5b5;
}

[data-theme="dark"] .admin-chip.is-neutral {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

[data-theme="dark"] .admin-field input::placeholder,
[data-theme="dark"] .admin-search-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .admin-table th,
[data-theme="dark"] .admin-table td {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .admin-status,
[data-theme="dark"] .admin-muted,
[data-theme="dark"] .admin-summary-label,
[data-theme="dark"] .admin-summary-subtitle,
[data-theme="dark"] .admin-list-head,
[data-theme="dark"] .admin-field span {
  color: rgba(255, 255, 255, 0.64);
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1200px) {
  .admin-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .admin-status {
    text-align: left;
  }

  .admin-workbench-grid {
    grid-template-columns: 1fr;
  }

  .admin-detail-panel {
    position: static;
  }
}

/* Portrait / tall aspect ratios: stack the workbench regardless of width */
@media (max-aspect-ratio: 3/4) {
  .admin-workbench-grid {
    grid-template-columns: 1fr;
  }

  .admin-detail-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .admin-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-create-form {
    grid-template-columns: 1fr;
  }

  .admin-summary-grid,
  .admin-metric-grid {
    grid-template-columns: 1fr;
  }

  .admin-org-head,
  .admin-user-head,
  .admin-audit-head,
  .admin-org-row,
  .admin-user-row,
  .admin-audit-row {
    grid-template-columns: 1fr;
  }

  .admin-list-head {
    display: none;
  }

  .admin-list-row {
    gap: 8px;
  }
}
