:root {
  --bg: #050a09;
  --panel: #0a1210;
  --panel-2: #0c1613;
  --line: rgba(160, 222, 197, 0.14);
  --line-strong: rgba(160, 222, 197, 0.25);
  --text: #e5f4ed;
  --muted: #82968d;
  --green: #3df39a;
  --blue: #51cfff;
  --amber: #f2ba5a;
  --red: #ff6679;
  color-scheme: dark;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 88% 0, rgba(61, 243, 154, 0.1), transparent 30rem),
    linear-gradient(rgba(61, 243, 154, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 243, 154, 0.016) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 28px 28px, 28px 28px, auto;
  color: var(--text);
  font-size: 13px;
}

a { color: inherit; }

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 50;
  padding: 0.7rem 1rem;
  background: var(--green);
  color: #03100b;
  font-weight: 900;
}

.skip-link:focus { top: 1rem; }

.demo-disclosure {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid rgba(242, 186, 90, 0.24);
  background: rgba(242, 186, 90, 0.07);
  color: #bca983;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.demo-disclosure strong { color: var(--amber); }

.demo-disclosure a {
  margin-left: auto;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.terminal-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(300px, 1fr);
  gap: 1.4rem;
  align-items: center;
  min-height: 72px;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(5, 10, 9, 0.92);
  backdrop-filter: blur(15px);
}

.demo-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.demo-brand__mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(61, 243, 154, 0.42);
  border-radius: 8px;
  background: rgba(61, 243, 154, 0.08);
  color: var(--green);
  font-weight: 900;
}

.demo-brand strong,
.demo-brand small { display: block; }
.demo-brand strong { font-size: 12px; }
.demo-brand small { margin-top: 2px; color: var(--muted); font-size: 8px; letter-spacing: 0.1em; }

.demo-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.32rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.demo-tab {
  min-height: 34px;
  padding: 0.5rem 0.8rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.demo-tab:hover,
.demo-tab:focus-visible { color: var(--text); }
.demo-tab.is-active { background: rgba(61, 243, 154, 0.1); color: var(--green); }

.terminal-status {
  display: flex;
  gap: 1.4rem;
  align-items: center;
  justify-content: flex-end;
}

.terminal-status > span:not(.mode-chip) small,
.terminal-status > span:not(.mode-chip) strong { display: block; }
.terminal-status small { color: var(--muted); font-size: 8px; }
.terminal-status strong { margin-top: 2px; font-size: 10px; }

.mode-chip,
.panel-chip {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.38rem 0.55rem;
  border: 1px solid rgba(61, 243, 154, 0.22);
  border-radius: 999px;
  background: rgba(61, 243, 154, 0.05);
  color: var(--green);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.mode-chip i,
.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(61, 243, 154, 0.8);
}

main { padding: 0.9rem; }

.demo-view[hidden] { display: none; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-bottom: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.012);
  overflow: hidden;
}

.metric-grid article {
  min-height: 84px;
  padding: 0.85rem;
  border-right: 1px solid var(--line);
}
.metric-grid article:last-child { border-right: 0; }
.metric-grid small,
.metric-grid strong,
.metric-grid span { display: block; }
.metric-grid small { color: var(--muted); font-size: 8px; }
.metric-grid strong { margin: 0.35rem 0 0.15rem; font-size: 18px; }
.metric-grid span { color: #647970; font-size: 8px; }

.operations-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(280px, 0.7fr);
  gap: 0.8rem;
}

.terminal-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(12, 22, 19, 0.96), rgba(7, 13, 11, 0.96));
}

.terminal-panel > header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  min-height: 57px;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}

.terminal-panel > header small,
.terminal-panel > header h1,
.terminal-panel > header h2 { display: block; margin: 0; }
.terminal-panel > header small { color: var(--green); font-size: 8px; letter-spacing: 0.08em; }
.terminal-panel > header h1,
.terminal-panel > header h2 { margin-top: 0.14rem; font-size: 12px; }

.panel-chip { border-color: var(--line); background: transparent; color: var(--muted); }
.panel-chip--blue { border-color: rgba(81, 207, 255, 0.24); color: var(--blue); }

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  text-align: left;
}

th { color: #647970; font-size: 8px; font-weight: 700; text-transform: uppercase; }
td { color: #a8bab2; }
td code { color: var(--blue); }
td b { color: var(--text); }
.hf { color: var(--green); font-size: 12px; font-weight: 900; }

.terminal-panel > footer {
  padding: 0.6rem 0.8rem;
  color: #647970;
  font-size: 8px;
}

.health-list,
.service-list,
.buyer-connect-panel ol,
.readiness-product ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.health-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.6rem;
  padding: 0.78rem 0.85rem;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
}

.health-list li:last-child { border-bottom: 0; }
.health-list li > span { display: flex; gap: 0.5rem; align-items: center; color: var(--text); }
.health-list i,
.service-list i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(61, 243, 154, 0.7);
}
.health-list strong { color: var(--green); font-size: 9px; }
.health-list small { grid-column: 1 / -1; padding-left: 1.05rem; color: #647970; font-size: 8px; }
.health-list .lock-dot,
.service-list .lock-dot { background: var(--amber); box-shadow: 0 0 8px rgba(242, 186, 90, 0.6); }

.feed-panel,
.boundary-panel { margin-top: 0; }

.event-feed article {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.event-feed article:last-child { border-bottom: 0; }
.event-icon { color: var(--blue); font-size: 16px; }
.event-feed strong,
.event-feed p,
.event-feed small { display: block; margin: 0; }
.event-feed strong { font-size: 9px; }
.event-feed p { margin: 0.15rem 0; color: var(--muted); font-size: 8px; }
.event-feed small { color: #647970; font-size: 8px; }
.event-feed b { color: var(--amber); font-size: 10px; }

.boundary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.boundary-grid > div { padding: 1rem; border-right: 1px solid var(--line); }
.boundary-grid > div:last-child { border-right: 0; }
.boundary-grid small,
.boundary-grid strong { display: block; }
.boundary-grid small { color: #647970; font-size: 8px; }
.boundary-grid strong { margin-top: 0.35rem; color: var(--blue); font-size: 10px; }

.positions-panel { grid-column: 1; }
.system-panel { grid-column: 2; }
.feed-panel { grid-column: 1; }
.boundary-panel { grid-column: 2; }
.boundary-panel .boundary-grid { grid-template-columns: repeat(2, 1fr); }
.boundary-panel .boundary-grid > div:nth-child(2) { border-right: 0; }
.boundary-panel .boundary-grid > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }

.readiness-hero {
  display: flex;
  gap: 2rem;
  align-items: flex-end;
  justify-content: space-between;
  padding: 2rem 1rem;
}
.readiness-hero small { color: var(--green); font-size: 8px; letter-spacing: 0.1em; }
.readiness-hero h1 { margin: 0.4rem 0 0.55rem; font-size: clamp(24px, 4vw, 42px); letter-spacing: -0.04em; }
.readiness-hero p { max-width: 75ch; margin: 0; color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; }
.readiness-hero > span { color: var(--amber); font-size: 9px; }

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

.readiness-product {
  overflow: hidden;
  border: 1px solid rgba(61, 243, 154, 0.24);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(12, 27, 21, 0.95), rgba(7, 13, 11, 0.96));
}
.readiness-product--blue { border-color: rgba(81, 207, 255, 0.24); }
.readiness-product > header { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; padding: 1rem; border-bottom: 1px solid var(--line); }
.readiness-product > header > span { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid rgba(61, 243, 154, 0.32); border-radius: 9px; color: var(--green); font-size: 16px; font-weight: 900; }
.readiness-product--blue > header > span { border-color: rgba(81, 207, 255, 0.32); color: var(--blue); }
.readiness-product header small { color: var(--green); font-size: 8px; }
.readiness-product--blue header small { color: var(--blue); }
.readiness-product header h2 { max-width: 42ch; margin: 0.28rem 0 0; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 16px; }

.counter { display: grid; grid-template-columns: auto auto 1fr; gap: 0.35rem; align-items: baseline; padding: 1rem; border-bottom: 1px solid var(--line); }
.counter strong { color: var(--green); font-size: 36px; }
.readiness-product--blue .counter strong { color: var(--blue); }
.counter > span { color: var(--muted); font-size: 16px; }
.counter small { justify-self: end; color: #647970; font-size: 8px; }

.readiness-product li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}
.readiness-product li:last-child { border-bottom: 0; }
.readiness-product li > span { color: var(--green); font-size: 9px; }
.readiness-product--blue li > span { color: var(--blue); }
.readiness-product li p,
.readiness-product li strong,
.readiness-product li small { display: block; margin: 0; }
.readiness-product li strong { font-size: 10px; }
.readiness-product li small { margin-top: 0.18rem; color: var(--muted); font-size: 8px; }
.readiness-product li.is-pending { background: rgba(242, 186, 90, 0.035); }
.readiness-product li.is-pending > span { color: var(--amber); }

.route-panel { margin-top: 0.8rem; }
.route-grid,
.rpc-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.route-grid article,
.rpc-grid article { padding: 1rem; border-right: 1px solid var(--line); }
.route-grid article:last-child,
.rpc-grid article:last-child { border-right: 0; }
.route-grid span,
.route-grid strong,
.route-grid small,
.route-grid p,
.rpc-grid span,
.rpc-grid strong,
.rpc-grid small,
.rpc-grid b { display: block; margin: 0; }
.route-grid span,
.rpc-grid span { color: #647970; font-size: 8px; }
.route-grid strong,
.rpc-grid strong { margin: 0.35rem 0; font-size: 11px; }
.route-grid small,
.rpc-grid b { font-size: 8px; }
.route-grid p,
.rpc-grid small { margin-top: 0.5rem; color: var(--muted); font-size: 8px; }

.metric-grid--infra { grid-template-columns: repeat(4, 1fr); }

.infra-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.5fr);
  gap: 0.8rem;
}
.service-matrix { grid-column: 1; }
.buyer-connect-panel { grid-column: 2; grid-row: 1 / span 2; }
.rpc-panel { grid-column: 1; }

.service-list article {
  display: grid;
  grid-template-columns: auto 1fr auto 100px;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.service-list article:last-child { border-bottom: 0; }
.service-list strong,
.service-list small { display: block; }
.service-list strong { font-size: 10px; }
.service-list small { margin-top: 0.15rem; color: var(--muted); font-size: 8px; }
.service-list span { color: var(--green); font-size: 8px; font-weight: 900; }
.service-list code { color: var(--blue); font-size: 8px; text-align: right; }

.buyer-connect-panel li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.7rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}
.buyer-connect-panel li:last-child { border-bottom: 0; }
.buyer-connect-panel li > span { color: var(--green); font-size: 9px; }
.buyer-connect-panel p,
.buyer-connect-panel strong,
.buyer-connect-panel small { display: block; margin: 0; }
.buyer-connect-panel strong { font-size: 10px; }
.buyer-connect-panel small { margin-top: 0.2rem; color: var(--muted); font-size: 8px; }

.rpc-grid { grid-template-columns: repeat(4, 1fr); }

.demo-footer {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 0 0.9rem 0.9rem;
  padding: 1rem;
  border: 1px solid rgba(242, 186, 90, 0.18);
  border-radius: 10px;
  background: rgba(242, 186, 90, 0.035);
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
}
.demo-footer p { margin: 0; }
.demo-footer strong { color: var(--amber); }

.green { color: var(--green) !important; }
.blue { color: var(--blue) !important; }
.amber { color: var(--amber) !important; }
.red { color: var(--red) !important; }

/* Operations mirror: this follows the transferred terminal's three-column
   information architecture while deliberately removing every control surface. */
.real-metrics article:nth-child(3) strong { color: var(--muted); }

.real-ops-grid {
  display: grid;
  grid-template-columns: minmax(185px, .62fr) minmax(480px, 2.05fr) minmax(185px, .72fr);
  gap: .8rem;
  align-items: start;
}

.real-ops-side,
.real-ops-center { display: grid; gap: .8rem; min-width: 0; }

.compact-panel > header {
  min-height: 49px;
  padding: .65rem .75rem;
}

.compact-panel > header h2 { font-size: 10px; }
.compact-panel > header > .green,
.compact-panel > header > .amber {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
}

.capital-summary {
  padding: .9rem .8rem .7rem;
  border-bottom: 1px solid var(--line);
}
.capital-summary small,
.capital-summary strong,
.capital-summary p { display: block; }
.capital-summary small { color: #647970; font-size: 8px; }
.capital-summary strong { margin-top: .35rem; color: var(--blue); font-size: 14px; }
.capital-summary p,
.panel-copy { margin: .55rem 0 0; color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 9px; line-height: 1.45; }
.panel-copy { padding: .75rem; margin: 0; }

.compact-kv {
  display: flex;
  gap: .6rem;
  align-items: baseline;
  justify-content: space-between;
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--line);
  font-size: 8px;
}
.compact-kv:last-child { border-bottom: 0; }
.compact-kv span { color: var(--muted); }
.compact-kv b { color: #c8dad1; font-size: 8px; text-align: right; }

.rank-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: .35rem;
  align-items: center;
  padding: .65rem .75rem;
  border-bottom: 1px solid var(--line);
  font-size: 8px;
}
.rank-row span { color: #647970; }
.rank-row code { color: var(--blue); font-size: 8px; }
.rank-row b { color: var(--green); font-size: 8px; }
.compact-panel > footer { padding: .55rem .75rem; color: #647970; font-size: 8px; line-height: 1.4; }

.ticker-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.ticker-row article { padding: .75rem .65rem; border-right: 1px solid var(--line); }
.ticker-row article:last-child { border-right: 0; }
.ticker-row b,
.ticker-row strong,
.ticker-row small { display: block; }
.ticker-row b { color: var(--text); font-size: 9px; }
.ticker-row strong { margin: .35rem 0 .15rem; color: var(--blue); font-size: 10px; }
.ticker-row small { font-size: 8px; }

.real-positions-panel { grid-column: auto; }
.inline-tabs { display: flex; gap: .25rem; align-items: center; }
.inline-tabs span {
  padding: .32rem .42rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 8px;
}
.inline-tabs .is-active { border-color: rgba(61,243,154,.24); color: var(--green); background: rgba(61,243,154,.05); }
.threshold-note { padding: .55rem .75rem; border-bottom: 1px solid var(--line); color: #647970; font-size: 8px; }
.real-positions-panel td { padding: .62rem .58rem; font-size: 8px; }
.real-positions-panel th { padding: .55rem .58rem; }
.real-positions-panel .hf { font-size: 10px; }

.real-feed-panel .event-feed article { padding: .67rem .75rem; }
.real-feed-panel em { color: var(--blue); font-size: 8px; font-style: normal; }

.decision-empty { padding: 1rem .8rem; color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 10px; line-height: 1.55; }

.regime-row {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) minmax(45px, 1.3fr) 15px;
  gap: .35rem;
  align-items: center;
  padding: .58rem .75rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
}
.regime-row i { display: block; height: 4px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.05); }
.regime-row i b { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.regime-row strong { color: var(--text); font-size: 8px; text-align: right; }

@media (max-width: 1080px) {
  .terminal-bar { grid-template-columns: 1fr auto; }
  .demo-tabs { grid-row: 2; grid-column: 1 / -1; justify-content: center; margin-bottom: 0.7rem; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .metric-grid article:nth-child(3n) { border-right: 0; }
  .metric-grid article:nth-child(-n + 3) { border-bottom: 1px solid var(--line); }
  .operations-layout,
  .infra-layout,
  .real-ops-grid { grid-template-columns: 1fr; }
  .positions-panel,
  .system-panel,
  .feed-panel,
  .boundary-panel,
  .service-matrix,
  .buyer-connect-panel,
  .rpc-panel { grid-column: 1; grid-row: auto; }
  .real-ops-side,
  .real-ops-center { grid-column: 1; }
  .readiness-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .demo-disclosure { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .demo-disclosure a { margin-left: 0; }
  .terminal-bar { grid-template-columns: 1fr; padding: 0.8rem; }
  .terminal-status { justify-content: flex-start; }
  .demo-tabs { grid-row: auto; grid-column: auto; overflow-x: auto; justify-content: flex-start; margin: 0; }
  main { padding: 0.55rem; }
  .metric-grid,
  .metric-grid--infra { grid-template-columns: repeat(2, 1fr); }
  .metric-grid article { border-bottom: 1px solid var(--line); }
  .metric-grid article:nth-child(odd) { border-right: 1px solid var(--line); }
  .metric-grid article:nth-child(even) { border-right: 0; }
  .metric-grid article:nth-last-child(-n + 2) { border-bottom: 0; }
  .boundary-grid,
  .boundary-panel .boundary-grid { grid-template-columns: repeat(2, 1fr); }
  .route-grid,
  .rpc-grid { grid-template-columns: 1fr; }
  .route-grid article,
  .rpc-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .route-grid article:last-child,
  .rpc-grid article:last-child { border-bottom: 0; }
  .readiness-hero { align-items: flex-start; flex-direction: column; }
  .service-list article { grid-template-columns: auto 1fr auto; }
  .service-list code { grid-column: 2 / -1; text-align: left; }
  .counter { grid-template-columns: auto auto; }
  .counter small { grid-column: 1 / -1; justify-self: start; }
  .demo-footer { grid-template-columns: 1fr; margin: 0 0.55rem 0.55rem; }
}

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