/* OCULE — instrument surface.
   one family on a width axis: labels wide, numbers narrow.
   color comes from data. two brand colours carry the story: ultramarine is the AI's side
   (its call, its inputs, its subject, its forecasts), acid lime is the cells' answer:
   its inputs, its subject, its forecasts. */

@font-face {
  font-family: 'Martian';
  src: url(/fonts/martian-mono-latin.woff2) format('woff2-variations');
  font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Martian';
  src: url(/fonts/martian-mono-latin-ext.woff2) format('woff2-variations');
  font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face { font-family: 'Xanh'; src: url(/fonts/xanh-mono-latin.woff2) format('woff2'); font-style: normal; font-display: swap; }
@font-face { font-family: 'Xanh'; src: url(/fonts/xanh-mono-latin-italic.woff2) format('woff2'); font-style: italic; font-display: swap; }

:root {
  --bg: #0a0a09;
  --bg2: #0e0e0c;
  --bg3: #131311;
  --line: #1d1d1a;
  --line2: #2b2a26;
  --bone: #e6e1d3;
  --bone2: #a9a496;
  --bone3: #6c685d;
  --bone4: #403d36;
  --df: #dce7ff;
  --ch-e: #4f86ff;
  --ch-sig: #cefb30;
  --ch-diet: #e14bff;
  --neg: #ff3e6c;
  --chl: #c0294a;
  --hot: #6b6dff;
  --brand: #1011fb;
  --lime: #cefb30;
  --side: 420px;
  --bar: 58px;
  --con: 168px;
  --tick: 3px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--bone); }
body {
  font-family: 'Martian', ui-monospace, monospace;
  font-size: 12px; line-height: 1.55; font-stretch: 87.5%; font-weight: 400;
  font-variant-numeric: tabular-nums slashed-zero;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
::selection { background: var(--bone); color: var(--bg); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--bone4); }
a:hover { border-color: var(--bone); }

/* ---- type roles ---------------------------------------------------------- */
.lbl { font-size: 8.5px; font-stretch: 112.5%; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--bone3); }
.val { font-stretch: 75%; font-weight: 600; color: var(--bone); }
.big { font-stretch: 75%; font-weight: 200; font-size: 34px; line-height: 1; letter-spacing: -.01em; }
.dim { color: var(--bone2); } .faint { color: var(--bone3); } .ghost { color: var(--bone4); }
.tag { display: inline-block; background: var(--bone); color: var(--bg); padding: 0 5px; font-stretch: 112.5%; font-weight: 700; font-size: 8.5px; letter-spacing: .1em; line-height: 15px; text-transform: uppercase; }
.tag.off { background: transparent; color: var(--bone3); box-shadow: inset 0 0 0 1px var(--bone4); }
.tag.hot { background: var(--brand); color: #fff; }
.tag.red { background: var(--neg); }
.nc { text-transform: none; letter-spacing: 0; }
.tag.green { background: var(--ch-sig); }
.hash { font-stretch: 75%; color: var(--bone3); letter-spacing: .02em; }
.note { font-family: 'Xanh', serif; font-style: italic; font-size: 15px; line-height: 1.5; color: var(--bone); font-stretch: normal; }

/* ---- frame ---------------------------------------------------------------- */
#app { display: grid; grid-template-rows: 54px 30px 1fr var(--con); height: 100vh; height: 100dvh; }

/* ---- brand bar: what this is and where to go ---------------------------- */
#brand { display: flex; align-items: center; gap: 22px; padding: 0 16px 0 14px; background: var(--bg2); border-bottom: 1px solid var(--line2); white-space: nowrap; min-width: 0; position: relative; }
#brand::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; background: repeating-linear-gradient(90deg, var(--line2) 0 1px, transparent 1px 12px); pointer-events: none; }
.logo { display: flex; align-items: center; gap: 11px; color: var(--bone); border: 0; }
.logo .glyph { width: 32px; height: 32px; display: block; border-radius: 7px; }
.logo .word { font-stretch: 112.5%; font-weight: 800; font-size: 17px; letter-spacing: .34em; }
.tagline { font-family: 'Xanh', serif; font-style: italic; font-size: 14px; color: var(--bone2); font-stretch: normal; padding-left: 18px; border-left: 1px solid var(--line2); }
.nav { display: flex; gap: 2px; margin-left: 6px; }
.nav button { font-stretch: 112.5%; font-weight: 750; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: #d8d3c5; padding: 8px 11px 7px; position: relative; }
.nav button:hover, .nav button.on { color: #fff; }
.nav button.on::after, .nav button:hover::after { content: ''; position: absolute; left: 11px; right: 11px; bottom: 2px; height: 2px; background: var(--lime); }
.ca { display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; box-shadow: inset 0 0 0 1px var(--line2); font-stretch: 112.5%; font-weight: 600; font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--bone3); }
.ca b { font-weight: 700; color: var(--bone); letter-spacing: .1em; font-stretch: 87.5%; font-size: 10.5px; }
.ca:hover { box-shadow: inset 0 0 0 1px var(--bone3); }
.ca.copyable { cursor: copy; }
.xbtn { width: 28px; height: 28px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line2); color: var(--bone2); border: 0; }
.xbtn svg { width: 13px; height: 13px; }
.xbtn:hover { background: var(--bone); color: var(--bg); box-shadow: none; }

/* ---- status strip: the instrument's own readouts -------------------------- */
#strip { display: flex; align-items: stretch; background: #070706; border-bottom: 1px solid var(--line2); white-space: nowrap; overflow: hidden; font-size: 10.5px; }
#strip .grp { display: flex; align-items: center; gap: 16px; padding: 0 14px; border-right: 1px solid var(--line); }
#strip .grp.right { border-right: 0; border-left: 1px solid var(--line); }
#strip .kv .val { font-size: 11px; }
.beat { width: 6px; height: 6px; background: var(--bone4); display: inline-block; }
.beat.on { background: var(--bone); }
.kv { display: flex; align-items: baseline; gap: 7px; }
.kv .val { font-size: 12px; }
.grow { flex: 1; }
.meter { display: inline-flex; gap: 1px; align-items: flex-end; height: 9px; }
.meter i { width: 3px; height: 9px; background: var(--bone4); }
.meter i.on { background: var(--bone); }
.epbar { width: 90px; height: 3px; background: var(--line2); position: relative; align-self: center; }
.epbar b { position: absolute; inset: 0 auto 0 0; background: var(--bone); }
#epmarks i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--hot); }
#twinHud { margin-top: 6px; }

#stage { display: grid; grid-template-columns: 1fr var(--side); min-height: 0; }

/* ---- scope ---------------------------------------------------------------- */
#scope { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #000; cursor: crosshair; touch-action: none; }
.followchip { position: absolute; z-index: 5; bottom: 14px; left: 50%; transform: translateX(-50%); padding: 5px 10px; background: rgba(10,10,9,.82); box-shadow: inset 0 0 0 1px var(--bone4); font-size: 10px; color: var(--bone2); white-space: nowrap; pointer-events: auto; }
.followchip b { color: var(--bone); font-weight: 600; margin-right: 8px; }
.followchip button { color: var(--bone3); margin-left: 10px; font-size: 10px; }
.followchip button:hover { color: var(--bone); }
.followchip[hidden] { display: none; }

.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(6,6,5,.84); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 70px 24px 24px; overflow-y: auto; }
.sheet[hidden] { display: none; }
.sheet-box { width: 100%; max-width: 1040px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line2), 0 30px 80px rgba(0,0,0,.6); position: relative; }
.sheet-box::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: repeating-linear-gradient(90deg, var(--bone4) 0 1px, transparent 1px 10px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 0; border-bottom: 1px solid var(--line); }
.sheet-tabs { display: flex; flex-wrap: wrap; }
.sheet-tabs button { padding: 10px 14px 11px; font-stretch: 112.5%; font-weight: 700; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--bone2); border-bottom: 1px solid transparent; margin-bottom: -1px; }
.sheet-tabs button b { font-weight: 400; color: var(--bone3); margin-right: 8px; }
.sheet-tabs button:hover { color: var(--bone); }
.sheet-tabs button.on { color: var(--bone); border-bottom-color: var(--bone); }
.sheet-close { font-stretch: 112.5%; font-weight: 600; font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--bone2); padding: 8px 0; }
.sheet-close:hover { color: var(--bone); }
.sheet-sec { padding: 30px 34px 10px; }
.sheet-sec[hidden] { display: none; }
.kicker { font-stretch: 112.5%; font-weight: 600; font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--bone3); margin-bottom: 14px; }
.display { font-family: 'Xanh', serif; font-style: italic; font-weight: 400; font-size: 34px; line-height: 1.18; color: var(--bone); max-width: 860px; margin-bottom: 26px; font-stretch: normal; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 40px; }
.cols p { color: var(--bone2); font-size: 12px; line-height: 1.7; margin-bottom: 12px; }
.cols .kicker { margin-bottom: 10px; color: var(--bone); }
.kicker.sub { margin: 22px 0 14px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--bone); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 22px 0 18px; border-top: 1px solid var(--line); }
.facts > div { padding: 16px 16px 4px 0; display: flex; flex-direction: column; gap: 8px; }
.facts > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.facts .big { font-size: 34px; }
.facts .lbl { line-height: 1.5; }
.cycle { display: block; width: 100%; max-width: 760px; margin: 0 0 18px; color: var(--bone2); }
.cycle text { font-family: Martian, monospace; font-size: 12px; fill: var(--bone); font-stretch: 87.5%; }
.cycle text.s, .cycle .cy-note { fill: var(--bone3); font-size: 10.5px; }
.cycle rect { fill: var(--bg2); stroke: var(--bone4); }
.cycle .chl rect { stroke: var(--chl); }
.cycle .cells rect { stroke: var(--bone2); }
.cycle .cy-edge path { fill: none; stroke: var(--bone3); }
.cycle .cy-lamp line { stroke: var(--bone3); }
.cycle .cy-lamp text { fill: var(--bone3); font-size: 10.5px; }
.steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 40px; margin-bottom: 18px; }
.steps li { counter-increment: s; color: var(--bone2); line-height: 1.7; padding-left: 34px; position: relative; }
.steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 1px; font-stretch: 75%; font-weight: 300; font-size: 20px; color: var(--bone3); line-height: 1; }
.steps b { color: var(--bone); font-weight: 600; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 40px; margin-bottom: 22px; color: var(--bone2); }
.legend b { color: var(--bone); font-weight: 600; margin-right: 6px; font-stretch: 112.5%; font-size: 9px; letter-spacing: .1em; }
.sw { display: inline-block; width: 18px; height: 9px; margin-right: 10px; vertical-align: 0; }
.sw.dashed { outline: 1px dashed var(--bone2); outline-offset: -1px; }
.sw.glyph { width: auto; height: auto; color: var(--bone2); font-size: 11px; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 40px; padding-top: 16px; border-top: 1px solid var(--line); margin-bottom: 18px; color: var(--bone2); }
.sheet-foot { display: flex; align-items: center; gap: 16px; padding: 18px 34px 24px; border-top: 1px solid var(--line); margin-top: 8px; }
.btn.solid { background: var(--lime); color: var(--bg); box-shadow: none; padding: 9px 16px 8px; }
.btn.solid:hover { background: var(--brand); color: #fff; }

.zoombtns { pointer-events: auto; display: none; gap: 4px; margin-top: 6px; }
.zoombtns button { width: 30px; height: 26px; box-shadow: inset 0 0 0 1px var(--bone4); font-size: 14px; }
.nogl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--bone2); }
#scope canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#gl { z-index: 1; } #ov { z-index: 2; }
.hud { position: absolute; z-index: 3; pointer-events: none; padding: 10px 12px; font-size: 10.5px; line-height: 1.6; }
.hud.tl { top: 0; left: 0; } .hud.tr { top: 0; right: 0; text-align: right; }
.hud.bl { bottom: 0; left: 0; } .hud.br { bottom: 0; right: 0; text-align: right; }
.hud .lbl { font-size: 8.5px; }
.hud.mr { right: 0; top: 50%; transform: translateY(-38%); width: 150px; }
#scope #hist { position: static; inset: auto; width: 126px; height: 250px; display: block; margin-left: auto; }
@media (max-width: 1350px) { .hud.mr { display: none; } }
.chans { pointer-events: auto; display: flex; gap: 4px; margin-top: 6px; }
.chan { font-stretch: 112.5%; font-weight: 600; font-size: 8.5px; letter-spacing: .08em; padding: 2px 6px 1px; box-shadow: inset 0 0 0 1px var(--bone4); color: var(--bone3); }
.chan.on { color: var(--bg); }
.chan[data-ch="df"].on { background: var(--df); }
.chan[data-ch="e"].on { background: var(--ch-e); }
.chan[data-ch="sig"].on { background: var(--ch-sig); }
.chan[data-ch="diet"].on { background: var(--ch-diet); }
.chan[data-ch="twin"] { margin-left: 8px; box-shadow: none; outline: 1px dashed var(--bone4); outline-offset: -1px; }
.chan[data-ch="twin"].on { background: transparent; color: var(--bone); outline-color: var(--bone2); }
.chan[data-ch="chl"].on { background: var(--chl); color: var(--bone); }
.chan:hover { color: var(--bone); }
.acq { position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; transition: opacity .6s steps(6); }
.acq.gone { opacity: 0; }
.acq-logo { display: block; width: 72px; height: 72px; margin: 0 auto 16px; animation: acq 1.8s steps(6) infinite; }
@keyframes acq { 0%, 100% { opacity: .35; } 50% { opacity: .95; } }
.banner { position: absolute; z-index: 5; left: 50%; bottom: 50px; transform: translateX(-50%); max-width: calc(100% - 28px); padding: 7px 12px; background: var(--bg); color: var(--bone); box-shadow: inset 0 0 0 1px var(--bone2); display: none; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner.show { display: block; }
.banner .t { font-stretch: 112.5%; font-weight: 700; letter-spacing: .1em; margin-right: 10px; }
.banner .t.f { color: var(--neg); }

/* ---- side ----------------------------------------------------------------- */
#side { border-left: 1px solid var(--line2); display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); min-height: 0; min-width: 0; background: var(--bg); }
#tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line2); }
.tab { flex: 1 0 auto; padding: 7px 8px 6px; font-stretch: 112.5%; font-weight: 700; font-size: 8.5px; letter-spacing: .1em; color: var(--bone2); border-right: 1px solid var(--line); text-transform: uppercase; }
.tab:last-child { border-right: 0; }
.tab b { font-weight: 400; color: var(--bone3); margin-right: 4px; }
.tab:hover { color: var(--bone); }
.tab.on { background: var(--lime); color: var(--bg); }
.tab.on b { color: var(--bone3); }
#pane { overflow-y: auto; overflow-x: hidden; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--bone4) transparent; }
.pane { display: none; } .pane.on { display: block; }
.sec { padding: 12px 14px; border-bottom: 1px solid var(--line); position: relative; }
.pane > .sec:first-child::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 4px;
  background: repeating-linear-gradient(90deg, var(--line2) 0 1px, transparent 1px 8px); opacity: .9; }
.sec h3 { font-size: 8.5px; font-stretch: 112.5%; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--bone2); margin-bottom: 9px; display: flex; justify-content: space-between; gap: 8px; }
.sec h3 span { color: var(--bone4); font-weight: 400; }
.pane > .sec:first-child > h3 { font-size: 22px; font-weight: 250; font-stretch: 75%; letter-spacing: .01em; text-transform: lowercase; color: var(--bone); align-items: baseline; margin-bottom: 12px; }
.pane > .sec:first-child > h3 span { font-size: 9px; font-stretch: 112.5%; letter-spacing: .12em; text-transform: uppercase; }
.pane > .sec:first-child > h3 .tag { font-size: 9px; }
#p-specimen > .sec:first-child > h3 { text-transform: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.cell > .lbl { display: block; }
.cell .val { display: block; font-size: 15px; font-weight: 300; }
.cell .big { font-size: 22px; }
.lede { color: var(--bone); font-size: 12px; line-height: 1.6; }
.lede b { font-weight: 600; }
.gloss { display: block; color: var(--bone3); font-size: 8.5px; line-height: 1.35; margin-top: 2px; }
.p { color: var(--bone2); margin-bottom: 8px; }
.p:last-child { margin-bottom: 0; }
.list .it { padding: 8px 0; border-top: 1px solid var(--line); }
.list .it:first-child { border-top: 0; }
.row2 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.bar { height: 4px; background: var(--line2); position: relative; margin-top: 5px; }
.bar b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bone2); }
.bar i { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--bone); }
.bar.done b { background: var(--bone); }
canvas.chart { display: block; width: 100%; height: 46px; }
canvas.chart.mini { height: 38px; margin: 6px 0 3px; }
canvas.reliab { display: block; width: 100%; margin-top: 12px; }
.chk { text-decoration-line: underline; text-underline-offset: 3px; cursor: help; }
.chk.ok { text-decoration-color: var(--bone2); }
.chk.no { text-decoration-style: dotted; text-decoration-color: var(--bone4); }
.chartrow { display: grid; grid-template-columns: 108px 1fr; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.chartrow:first-of-type { border-top: 0; }
.chartrow .tv { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chartrow .big { font-size: 21px; white-space: nowrap; }
.chartrow .big small { font-size: 9.5px; font-weight: 400; font-stretch: 87.5%; color: var(--bone3); margin-left: 4px; letter-spacing: 0; }
.hash { overflow-wrap: anywhere; }
#treeCanvas, #morph { display: block; width: 100%; }
#morph { height: 330px; }
#treeCanvas { height: 380px; }
.mono-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.mono-table td, .mono-table th { padding: 4px 6px 4px 0; text-align: left; border-top: 1px solid var(--line); font-weight: 400; vertical-align: top; }
.mono-table th { color: var(--bone3); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; font-stretch: 112.5%; }
.btn { box-shadow: inset 0 0 0 1px var(--bone3); padding: 5px 10px 4px; font-stretch: 112.5%; font-weight: 600; font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; }
.btn:hover { background: var(--bone); color: var(--bg); }
.btn:disabled { opacity: .4; pointer-events: none; }
.heat { display: block; width: 100%; image-rendering: pixelated; }
.genebar { display: grid; grid-template-columns: 74px 1fr 64px; gap: 8px; align-items: center; padding: 2px 0; }
.genebar .bar { margin: 0; }
.genebar .val { text-align: right; font-size: 10.5px; }
.genebar.mut .lbl { color: var(--bone); text-decoration: underline; text-underline-offset: 3px; }

/* ---- console -------------------------------------------------------------- */
#console { border-top: 1px solid var(--line2); display: grid; grid-template-rows: auto 1fr auto; min-height: 0; background: #080807; }
.con-head { display: flex; align-items: center; gap: 14px; padding: 0 14px; height: 28px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.con-title { font-stretch: 112.5%; font-weight: 700; font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--bone2); }
.con-filters { display: flex; gap: 2px; }
.con-filters button, .con-btn { font-stretch: 112.5%; font-weight: 700; font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--bone2); padding: 3px 8px 2px; }
.con-filters button:hover, .con-btn:hover { color: var(--bone); }
.con-filters button.on { background: var(--lime); color: var(--bg); }
.con-hint { color: var(--bone4); font-size: 10px; }
kbd { font-family: inherit; font-size: 9.5px; color: var(--bone2); box-shadow: inset 0 0 0 1px var(--bone4); padding: 0 4px; margin: 0 1px; }
#log[data-filter="observer"] .ln:not([data-g="observer"]),
#log[data-filter="culture"] .ln:not([data-g="culture"]),
#log[data-filter="system"] .ln:not([data-g="system"]) { display: none; }
#log { overflow-y: auto; padding: 6px 14px 2px; font-size: 10.5px; line-height: 1.6; scrollbar-width: thin; scrollbar-color: var(--bone4) transparent; }
#log .ln { white-space: pre-wrap; word-break: break-word; color: var(--bone2); }
#log .ln .t { color: var(--bone4); margin-right: 10px; }
#log .ln .k { display: inline-block; min-width: 76px; color: var(--bone3); font-stretch: 112.5%; font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; }
#log .ln.birth .k { color: var(--bone3); }
#log .ln.death .k { color: var(--neg); }
#log .ln.prey .k { color: var(--ch-diet); }
#log .ln.obs { color: var(--bone); }
#log .ln.obs .k { color: var(--bone); }
#log .ln.hot .k { color: var(--hot); }
#log .ln.cmd { color: var(--bone); }
#log .ln.out { color: var(--bone2); padding-left: 18px; }
#prompt { display: flex; align-items: center; gap: 12px; padding: 0 14px 0 0; height: 32px; border-top: 1px solid var(--line); background: var(--bg); }
#prompt .ps { align-self: stretch; display: flex; align-items: center; padding: 0 12px; background: var(--brand); color: #fff; font-stretch: 112.5%; font-weight: 800; letter-spacing: .16em; font-size: 9px; text-transform: uppercase; }
#prompt .ps::after { content: '›'; margin-left: 6px; font-weight: 400; }
#cmd { flex: 1; background: transparent; border: 0; outline: 0; color: var(--bone); font: inherit; font-size: 12px; caret-color: var(--bone); }
#cmd::placeholder { color: var(--bone4); }
#prompt .hint { color: var(--bone3); font-size: 10px; }
#prompt .hint b { color: var(--hot); font-weight: 600; }

@media (max-width: 1500px) { .h1 { display: none !important; } }
@media (max-width: 1250px) { .h2 { display: none !important; } :root { --side: 380px; } .tagline { display: none; } }
@media (max-width: 1060px) { .nav button[data-pane-link] { display: none; } }

/* ---- small screens --------------------------------------------------------- */
@media (max-width: 960px) {
  body { overflow: auto; }
  #app { display: block; height: auto; }
  #brand { flex-wrap: wrap; gap: 10px 14px; padding: 10px 12px 0; }
  .tagline { display: none; }
  .nav { order: 3; width: 100%; margin: 0 -12px; padding: 0 2px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  #strip { overflow-x: auto; scrollbar-width: none; }
  #strip::-webkit-scrollbar { display: none; }
  #strip .grp { padding: 7px 12px; }
  .sheet { padding: 0; }
  .sheet-sec { padding: 22px 18px 6px; }
  .display { font-size: 24px; }
  .cols, .steps, .legend, .keys { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .sheet-foot { padding: 16px 18px 22px; flex-wrap: wrap; }
  .con-head { overflow-x: auto; }
  #stage { display: block; }
  #scope { height: 100vw; max-height: 78vh; }
  #side { border-left: 0; border-top: 1px solid var(--line2); }
  #tabs { position: sticky; top: 0; z-index: 6; background: var(--bg); }
  .tab { flex: 1 0 25%; border-bottom: 1px solid var(--line); }
  #pane { overflow: visible; }
  #console { height: 260px; }
  .hud { font-size: 9.5px; padding: 8px; }
  .hud.br { display: none; }
  .hud.tl > div:first-child { display: none; }
  .hud.tr > div:nth-child(n+3) { display: none; }
  .chans { flex-wrap: wrap; max-width: 220px; }
  .zoombtns { display: flex; }
}


/* ---- the call and the contact readout ------------------------------------ */
.bits { display: inline-flex; gap: 2px; align-items: center; align-self: center; }
.bits i { width: 7px; height: 7px; box-shadow: inset 0 0 0 1px var(--bone3); }
.bits i.on { background: var(--bone2); box-shadow: none; }
.bits i.now { background: #3436ff; box-shadow: 0 0 6px 1px rgba(52,54,255,.8); }
.bits i.now:not(.on) { background: transparent; box-shadow: inset 0 0 0 1px #3436ff; }
.big-bits { margin-top: 5px; gap: 3px; }
.big-bits i { width: 13px; height: 13px; }
.cbar { width: 64px; height: 4px; background: var(--line2); position: relative; align-self: center; }
.cbar b { position: absolute; inset: 0 auto 0 0; background: var(--ch-sig); opacity: .75; }
.cbar b.over { opacity: 1; box-shadow: 0 0 6px rgba(206,251,48,.6); }
.cbar::after { content: ''; position: absolute; right: -1px; top: -3px; bottom: -3px; width: 1px; background: var(--hot); }
.hud.tc { top: 0; left: 50%; transform: translateX(-50%); text-align: center; white-space: nowrap; padding-top: 12px; }
#callHud .ch-row { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 17px; }
#callHud .ch-row + .ch-row { color: var(--bone3); }
#callHud .bits i { width: 8px; height: 8px; }
.val.sm { font-size: 11px; font-weight: 500; line-height: 1.5; margin-top: 3px; }

/* ---- the signal pane ------------------------------------------------------ */
.meter-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: end; }
.meter-num { display: flex; flex-direction: column; gap: 6px; }
.meter-num .big { font-size: 34px; }
.meter-wrap { padding-bottom: 4px; }
.cmeter { height: 10px; background: repeating-linear-gradient(90deg, var(--line2) 0 1px, transparent 1px 6px), var(--bg3); position: relative; box-shadow: inset 0 0 0 1px var(--line2); }
.cmeter b { position: absolute; left: 0; top: 2px; bottom: 2px; background: var(--ch-sig); opacity: .8; transition: width .6s steps(8); }
.cmeter b.over { opacity: 1; box-shadow: 0 0 10px rgba(206,251,48,.55); }
.cmeter b.neg { background: var(--neg); opacity: .7; }
.cmeter i { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--bone3); }
.cmeter i.th { background: var(--hot); width: 2px; }
.meter-scale { position: relative; height: 14px; margin-top: 6px; font-size: 8.5px; color: var(--bone3); font-stretch: 75%; }
.meter-scale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.meter-scale span:first-child { transform: none; }
.meter-scale span:last-child { transform: none; }
.meter-scale span.th { color: var(--hot); }
.stack { position: relative; margin: 2px -14px 0; background: var(--bg); overflow: hidden; }
.stack canvas { display: block; width: 100%; cursor: grab; touch-action: pan-y; }
.stack canvas:active { cursor: grabbing; }
.stack .ax { position: absolute; inset: 0; pointer-events: none; }
.stack .ax span { position: absolute; transform: translateX(-50%); font-size: 8.5px; color: var(--bone3); font-stretch: 75%; white-space: nowrap; }
.stack .ax span[data-s="0"] { color: var(--hot); font-stretch: 112.5%; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: 8px; }
.stack .ax span.old { color: var(--bone3); transform: translate(-100%, -50%); }
canvas.chart.tall { height: 92px; }
canvas.osc { display: block; width: 100%; height: 112px; background: repeating-linear-gradient(0deg, transparent 0 27px, rgba(230,225,211,.025) 27px 28px); }
.osc-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 9.5px; color: var(--bone3); }
.osc-legend i { display: inline-block; width: 12px; height: 2px; vertical-align: middle; margin-right: 6px; }
.osc-legend i.hot { background: var(--hot); } .osc-legend i.glow { background: var(--ch-sig); }
.osc-legend i.win { height: 8px; background: rgba(230,225,211,.12); }

/* ---- guide: the organism and the contact loop ----------------------------- */
b.code { font-weight: 600; letter-spacing: .12em; color: var(--bone); white-space: nowrap; }
.organism { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 6px 34px; padding: 18px 20px; box-shadow: inset 0 0 0 1px var(--line2); position: relative; margin-bottom: 6px; }
.organism::before { content: 'SPECIMEN · MODEL ORGANISM'; position: absolute; top: -6px; left: 14px; padding: 0 6px; background: var(--bg); font-size: 8px; letter-spacing: .16em; font-stretch: 112.5%; color: var(--bone3); }
.org-name { display: flex; flex-direction: column; gap: 8px; }
.binomial { font-family: 'Xanh', serif; font-style: italic; font-size: 30px; line-height: 1.05; color: var(--bone); font-stretch: normal; }
.org-name .faint { font-size: 10.5px; }
.org-facts { display: flex; flex-direction: column; }
.org-facts > div { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); color: var(--bone2); line-height: 1.55; }
.org-facts > div:first-child { border-top: 0; padding-top: 0; }
.yr { font-stretch: 75%; font-weight: 300; font-size: 19px; line-height: 1.1; color: var(--bone); }
.org-note { grid-column: 1 / -1; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line2); color: var(--bone3); font-size: 11px; line-height: 1.6; }
.loop { display: block; width: 100%; max-width: 760px; margin: 0 0 18px; color: var(--bone3); }
.loop text { font-family: Martian, monospace; font-size: 12px; fill: var(--bone); font-stretch: 87.5%; }
.loop text.s { fill: var(--bone3); font-size: 10.5px; }
.loop rect { fill: var(--bg2); stroke: var(--bone4); }
.loop .hot rect { stroke: var(--hot); }
.loop .glow rect { stroke: var(--ch-sig); }
.loop .chl rect { stroke: var(--chl); }
.loop .lp-edge path { fill: none; stroke: var(--bone3); }
.loop .lp-edge path.faint { stroke-dasharray: 3 4; }
.loop .lp-note { fill: var(--bone3); font-size: 10.5px; font-family: 'Xanh', serif; font-style: italic; font-size: 13px; }

@media (max-width: 960px) {
  .hud.tc { top: auto; bottom: 40px; left: auto; right: 0; transform: none; text-align: right; padding: 6px 10px; }
  #callHud .ch-row { justify-content: flex-end; }
  #callHud .ch-row + .ch-row { display: none; }
  .organism { grid-template-columns: 1fr; padding: 16px 14px; }
  .binomial { font-size: 24px; }
  .meter-num .big { font-size: 30px; }
  .stack { margin: 2px -12px 0; }
}

/* ---- side tabs: a 3 × 3 keypad, keys 1–9 ---------------------------------- */
#tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
#tabs .tab { text-align: left; padding: 5px 10px 4px; line-height: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#tabs .tab:nth-child(3n) { border-right: 0; }
#tabs .tab:nth-last-child(-n+3) { border-bottom: 0; }
#tabs .tab b { display: inline-block; width: 14px; }

/* ---- ZOOID brand accents ------------------------------------------------- */
#brand { border-bottom: 2px solid var(--brand); }
#brand::after { display: none; }
.logo .word { color: var(--lime); }
#liveTag:not(.off) { background: var(--lime); }
.ca { box-shadow: inset 0 0 0 1px var(--brand); }
.ca b { color: var(--lime); }
.xbtn:hover { background: var(--lime); }
.acq-logo { border-radius: 16px; }
.sheet-box::before { background: repeating-linear-gradient(90deg, var(--brand) 0 2px, transparent 2px 10px); }
.kicker:not(.sub) { color: var(--hot); }
