@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PlexMono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PlexMono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #04060a;
  --panel: #0b1018;
  --panel-2: #0f1622;
  --line: rgba(150, 178, 214, 0.14);
  --line-2: rgba(150, 178, 214, 0.26);
  --text: #e7edf6;
  --muted: #8d9aae;
  --faint: #5d6a7e;
  --on: #46d9c9;          /* oracle7-deepspace */
  --on-dim: rgba(70, 217, 201, 0.14);
  --cl: #f2a93b;          /* classic */
  --cl-dim: rgba(242, 169, 59, 0.14);
  --bad: #ff5f5f;
  --bad-dim: rgba(255, 95, 95, 0.14);
  --good: #45d98c;
  --good-dim: rgba(69, 217, 140, 0.14);
  --radius: 10px;
  --mono: "PlexMono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Plex", -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); }
body { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.top { position: fixed; inset: 0 0 auto 0; height: 56px; display: flex; align-items: center; gap: 22px; padding: 0 18px;
  background: linear-gradient(180deg, rgba(4, 6, 10, 0.96), rgba(4, 6, 10, 0.82)); border-bottom: 1px solid var(--line); z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.mark { width: 26px; height: 26px; fill: var(--on); flex: none; }
.mark .ring { fill: none; stroke: var(--on); stroke-width: 1.4; opacity: .55; }
.mark .dot { fill: #fff; }
.brand .name { font-weight: 500; font-size: 17px; letter-spacing: .01em; white-space: nowrap; }
.brand .name b { font-weight: 600; color: var(--on); }
.brand .tag { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; white-space: nowrap; }
.clock, .speed { display: flex; flex-direction: column; gap: 1px; }
.lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
#clock { font-size: 15px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 4px 10px; cursor: pointer; color: var(--muted); font-size: 12.5px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--on-dim); color: var(--on); }
.seg button:hover { color: var(--text); }
.links { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.chip { border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 5px 12px; font-size: 12.5px;
  text-decoration: none; cursor: pointer; color: var(--text); white-space: nowrap; }
.chip:hover { border-color: var(--on); }
.chip.strong { background: var(--on); color: #03211e; border-color: var(--on); font-weight: 600; }
#demoBtn.on { border-color: var(--on); color: var(--on); }
#demoBtn:not(.on) { color: var(--faint); }

/* ---------- layout ---------- */
.layout { position: fixed; inset: 56px 0 0 0; display: grid; grid-template-columns: 1fr 440px; }
.stage { position: relative; overflow: hidden; min-height: 0; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
.labels { position: absolute; inset: 0; pointer-events: none; }
.panel { overflow-y: auto; overflow-x: hidden; border-left: 1px solid var(--line); background: var(--panel); padding: 14px 14px 30px;
  scrollbar-width: thin; scrollbar-color: #243044 transparent; }

/* ---------- 3D overlays ---------- */
.viewtoggle { position: absolute; top: 14px; left: 14px; background: rgba(6, 9, 14, 0.78); backdrop-filter: blur(6px); }
.scalenote { position: absolute; left: 14px; bottom: 124px; max-width: 460px; font-size: 11.5px; color: var(--faint); }
.hud { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; }
.hudpill { font: 500 11.5px var(--mono); letter-spacing: .06em; padding: 4px 9px; border-radius: 6px; background: rgba(6, 9, 14, .78);
  border: 1px solid var(--line-2); }
.hudpill.on { color: var(--on); border-color: rgba(70, 217, 201, .45); }
.hudpill.cl { color: var(--cl); border-color: rgba(242, 169, 59, .45); }
.hudpill.bad { color: var(--bad); border-color: rgba(255, 95, 95, .5); animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .45; } }
.fleet { position: absolute; left: 12px; right: 12px; bottom: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fcard { text-align: left; background: rgba(8, 12, 19, 0.84); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 12px 10px; cursor: pointer; color: var(--text); position: relative; transition: border-color .2s, transform .2s; }
.fcard:hover { border-color: var(--line-2); transform: translateY(-1px); }
.fcard.sel { border-color: var(--on); box-shadow: 0 0 0 1px rgba(70, 217, 201, .25), 0 8px 30px rgba(0, 0, 0, .35); }
.fcard .t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fcard .nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard .lt { font: 11.5px var(--mono); color: var(--muted); white-space: nowrap; }
.fcard .st { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.pill { font: 500 10.5px var(--mono); letter-spacing: .05em; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.pill.on { color: var(--on); border-color: rgba(70, 217, 201, .4); background: var(--on-dim); }
.pill.cl { color: var(--cl); border-color: rgba(242, 169, 59, .4); background: var(--cl-dim); }
.pill.bad { color: var(--bad); border-color: rgba(255, 95, 95, .45); background: var(--bad-dim); }
.pill.good { color: var(--good); border-color: rgba(69, 217, 140, .4); background: var(--good-dim); }
.fcard .flash { position: absolute; inset: -1px; border-radius: var(--radius); pointer-events: none; opacity: 0; }
.fcard.fault .flash { box-shadow: inset 0 0 0 1px var(--bad); opacity: 1; animation: blink 1.1s steps(2) infinite; }

.lab { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; cursor: pointer; white-space: nowrap; padding-bottom: 12px; }
.lab .l { font: 500 12px var(--sans); color: #fff; background: rgba(6, 9, 14, .72); border: 1px solid rgba(70, 217, 201, .5); border-radius: 6px; padding: 2px 7px; display: inline-block; }
.lab.sel .l { background: var(--on); color: #03211e; border-color: var(--on); }
.lab .s { display: block; font: 10.5px var(--mono); color: var(--muted); text-align: center; margin-top: 2px; }
.lab.planet { pointer-events: none; padding-bottom: 6px; }
.lab.planet .l { background: none; border: 0; color: #9fb0c6; font-size: 11px; padding: 0; }
.lab.dir .l { background: none; border: 1px dashed rgba(150, 178, 214, .35); color: #b8c6d8; font-size: 11px; }
.lab.fault .l { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(255, 95, 95, .18); }

.toast { position: absolute; top: 60px; left: 50%; transform: translate(-50%, -8px); background: rgba(8, 12, 19, .92); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 8px 14px; font-size: 13px; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; max-width: 90%; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- panel ---------- */
.crafthead h2 { margin: 2px 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.crafthead .sub { color: var(--muted); font-size: 12.5px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 12px; }
.fact { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; min-width: 0; }
.fact .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.fact .v { font: 500 14px var(--mono); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.inject .row { display: flex; gap: 8px; }
.inject select { flex: 1; min-width: 0; background: #0a0f17; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; }
.why { color: var(--muted); font-size: 12.5px; margin: 8px 0 6px; min-height: 18px; }
.row.small { justify-content: space-between; }
.btn { background: var(--on); color: #03211e; border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn.danger { background: #ff6b5c; color: #2b0703; }
.btn.big { padding: 12px 22px; font-size: 15px; }
.btn.ghost { background: transparent; color: var(--cl); border: 1px solid rgba(242, 169, 59, .5); font-weight: 500; padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 0; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.link:hover { color: var(--text); }

.duel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.side { border-radius: var(--radius); padding: 11px 11px 10px; border: 1px solid var(--line); background: var(--panel-2); min-width: 0; }
.side.on { border-top: 2px solid var(--on); }
.side.cl { border-top: 2px solid var(--cl); }
.side h3 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.side.on h3 { color: var(--on); }
.side.cl h3 { color: var(--cl); }
.side .desc { font-size: 11.5px; color: var(--faint); margin: 1px 0 8px; min-height: 30px; }
.mode { font: 600 13px var(--mono); letter-spacing: .06em; padding: 5px 8px; border-radius: 6px; text-align: center; margin-bottom: 8px; }
.mode.SCIENCE { background: var(--good-dim); color: var(--good); }
.mode.SAFE { background: var(--bad-dim); color: var(--bad); }
.mode.LOADS { background: var(--cl-dim); color: var(--cl); }
.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.kv span:first-child { color: var(--muted); }
.kv .num { white-space: nowrap; }
.kv.bad .num { color: var(--bad); }
.eta { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-2); font-size: 12px; color: var(--cl); }
.bar { height: 5px; background: rgba(242, 169, 59, .15); border-radius: 3px; overflow: hidden; margin: 5px 0 6px; }
.bar i { display: block; height: 100%; background: var(--cl); width: 0; transition: width .4s linear; }

.fault-card { border-left: 3px solid var(--bad); }
.fault-card.closed { border-left-color: var(--line-2); opacity: .8; }
.fault-card .fh { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.fault-card .fh b { font-size: 13.5px; }
.fault-card .fw { font: 11.5px var(--mono); color: var(--muted); white-space: nowrap; }
.verdicts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.verdict { font-size: 12px; padding: 6px 8px; border-radius: 7px; background: #0a0f17; border: 1px solid var(--line); }
.verdict .who { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.verdict .what { font-weight: 600; margin-top: 2px; }
.verdict.correct .what { color: var(--good); }
.verdict.harmful .what, .verdict.damage .what { color: var(--bad); }
.verdict.waiting .what { color: var(--cl); }
.verdict.pending .what { color: var(--muted); }
.fine { color: var(--faint); font-size: 11.5px; margin: 8px 0 0; }

.charts .chart { width: 100%; height: 90px; display: block; margin-top: 6px; }
.charthead { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.legend { text-transform: none; letter-spacing: 0; display: flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.legend i.on { background: var(--on); }
.legend i.cl { background: var(--cl); margin-left: 6px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 4px 0 10px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 8px 10px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 13px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--on); }
.tab { display: none; margin-bottom: 12px; }
.tab.on { display: block; }

.decisions .empty, .chat .empty { color: var(--faint); font-size: 12.5px; padding: 8px 2px; }
.rc { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 11px; margin-bottom: 8px; }
.rc .rh { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.rc .act { font-weight: 600; font-size: 13.5px; margin: 3px 0 7px; }
.rc.evidence .act { color: var(--muted); font-weight: 500; }
.stage-row { display: grid; grid-template-columns: 86px 1fr; gap: 8px; font-size: 12px; padding: 3px 0; border-top: 1px dashed var(--line); }
.stage-row .k { color: var(--faint); text-transform: uppercase; font-size: 10.5px; letter-spacing: .09em; padding-top: 1px; }
.opt { display: grid; grid-template-columns: 1fr 58px; gap: 8px; align-items: center; margin: 3px 0; }
.opt .ob { position: relative; height: 18px; background: #0a0f17; border-radius: 4px; overflow: hidden; }
.opt .ob i { position: absolute; inset: 0 auto 0 0; background: rgba(150, 178, 214, .18); }
.opt .ob span { position: relative; padding: 0 6px; font-size: 11.5px; line-height: 18px; white-space: nowrap; }
.opt.best .ob i { background: rgba(70, 217, 201, .35); }
.opt.best .ob span { color: #dffcf8; font-weight: 600; }
.opt .sc { font: 11.5px var(--mono); color: var(--muted); text-align: right; }

.chat { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.msg { padding: 8px 10px; border-radius: 9px; font-size: 13px; max-width: 94%; }
.msg.q { align-self: flex-end; background: #16202f; }
.msg.a { align-self: flex-start; background: var(--on-dim); border: 1px solid rgba(70, 217, 201, .25); }
.msg.a .cite { display: block; margin-top: 4px; font: 11px var(--mono); color: var(--muted); }
.msg.a.decline { background: #121822; border-color: var(--line-2); color: var(--muted); }
.qchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.qchips button { border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--muted); }
.qchips button:hover { color: var(--text); border-color: var(--on); }
.askrow { display: flex; gap: 8px; }
.askrow input { flex: 1; min-width: 0; background: #0a0f17; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; }
.askrow input:focus, .inject select:focus { outline: 1px solid var(--on); }

.rule { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 12.5px; }
.rule .vd { font: 600 11px var(--mono); padding: 2px 6px; border-radius: 5px; align-self: start; }
.rule .vd.ADMIT { color: var(--good); background: var(--good-dim); }
.rule .vd.REJECT { color: var(--bad); background: var(--bad-dim); }
.rule .rn { font-family: var(--mono); font-size: 12px; word-break: break-word; }
.rule .rr { grid-column: 2; color: var(--muted); font-size: 12px; }
.rule label { grid-column: 2; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; cursor: pointer; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.switch p { margin: 0; font-size: 12.5px; color: var(--muted); }

.metric { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.metric b { font: 500 14px var(--mono); color: var(--on); white-space: nowrap; }

.loglist { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow-y: auto; font-size: 12px; }
.loglist li { display: grid; grid-template-columns: 70px 12px 1fr; gap: 6px; padding: 4px 0; border-top: 1px dashed var(--line); }
.loglist .tt { font-family: var(--mono); color: var(--faint); }
.loglist .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--faint); }
.loglist .on .dot { background: var(--on); }
.loglist .cl .dot { background: var(--cl); }
.loglist .both .dot, .loglist .damage .dot { background: var(--bad); }
.loglist .damage .tx { color: var(--bad); }

.disclaimer { color: var(--faint); font-size: 11px; line-height: 1.5; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- intro ---------- */
.intro { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(ellipse at 30% 20%, rgba(10, 30, 40, .55), rgba(2, 3, 6, .88)); padding: 16px; }
.intro.hide { display: none; }
.introcard { max-width: 640px; background: rgba(9, 13, 20, .96); border: 1px solid var(--line-2); border-radius: 14px; padding: 28px 30px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.eyebrow { color: var(--on); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; margin: 0 0 8px; }
.introcard h1 { font-size: 28px; line-height: 1.15; margin: 0 0 16px; font-weight: 600; letter-spacing: -.015em; }
.steps { margin: 0 0 20px; padding-left: 20px; color: #c9d4e3; }
.steps li { margin-bottom: 10px; }
.steps b { color: var(--text); }
.steps em { color: var(--on); font-style: normal; font-weight: 500; }
.nojs { position: fixed; inset: 40% 0 auto; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr 390px; } .brand .tag { display: none; } }
@media (max-width: 860px) {
  body { overflow: auto; }
  .top { height: auto; flex-wrap: wrap; gap: 8px 14px; padding: 8px 12px; position: sticky; }
  .brand .name { font-size: 15px; }
  .links { margin-left: 0; width: 100%; }
  .clock { order: 2; }
  .speed { order: 3; }
  .layout { position: static; display: block; }
  .stage { height: 56vh; min-height: 340px; }
  .panel { border-left: 0; border-top: 1px solid var(--line); overflow: visible; padding: 12px 12px 30px; }
  .fleet { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; left: 8px; right: 8px; bottom: 8px; gap: 8px; scrollbar-width: none; }
  .fcard { flex: 0 0 62%; scroll-snap-align: start; }
  .scalenote { display: none; }
  .viewtoggle { top: 8px; left: 8px; }
  .hud { top: 8px; right: 8px; }
  .introcard { padding: 22px 18px; }
  .introcard h1 { font-size: 23px; }
}
@media (max-width: 420px) { .duel { grid-template-columns: 1fr; } .facts { grid-template-columns: 1fr 1fr; } }
.tsel { width: 100%; margin-top: 8px; background: #0a0f17; border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 6px; font-size: 11.5px; color: var(--muted); }
@media (max-width: 860px) {
  .hud { top: 46px; left: 8px; right: auto; align-items: flex-start; gap: 4px; }
  .hudpill { font-size: 10.5px; padding: 3px 7px; }
  .hudpill.name { display: none; }
}
.lab.high { padding-bottom: 40px; }
.metric b.sha { font-size: 12px; }
.steps em.cl { color: var(--cl); }
.seg button, #clock { white-space: nowrap; }
@media (max-width: 1320px) { .brand .tag { display: none; } .top { gap: 16px; } }
@media (min-width: 861px) and (max-width: 1100px) { .links .chip[href="evidence#reproduce"] { display: none; } }
.introbtns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn.ghostbig { background: transparent; color: var(--on); border: 1px solid rgba(70, 217, 201, .55); text-decoration: none; font-weight: 500; }
.disclaimer a, .intro .fine a { color: var(--on); }
/* seven craft: one scrolling row on every screen size */
.fleet { display: flex; overflow-x: auto; gap: 10px; scrollbar-width: thin; scrollbar-color: #243044 transparent; }
.fleet .fcard { flex: 0 0 196px; }
@media (max-width: 860px) { .fleet .fcard { flex: 0 0 62%; } }
