/* ═══════════════════════════════════════════════════════════════════════════
   LIXIAN · EMERGENCY COMMAND — English edition
   Visual system: "Night Watch" — the instrument room after dark.

   The Chinese build is daylight: paper, stamp ink, serif headings.
   This one is its night shift: graphite glass, hairline rules, amber phosphor
   for live telemetry, muted teal for water, cinnabar kept for one thing only —
   an alarm that a human must answer. No glow, no rounded cards, no gradients
   beyond a single radar sweep.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --void:      #0A0C0E;
  --void-2:    #0E1114;
  --panel:     #101417;
  --panel-2:   #141A1E;
  --rule:      #1C242A;
  --rule-2:    #273238;

  --ink:       #E7EDEF;
  --ink-2:     #93A3A9;
  --ink-3:     #5C6B71;
  --ink-4:     #3C484D;

  --amber:     #E8A33D;   /* live telemetry, primary accent */
  --amber-d:   #B87B22;
  --teal:      #4FB3A6;   /* water data */
  --red:       #D8453C;   /* alarm — reserved */
  --blue:      #4A83B8;
  --violet:    #8C7BB0;

  --f-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-num: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;

  --h-top: 58px;
  --h-foot: 54px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font: 13px/1.55 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body::after { /* faint instrument grain + vignette, never interactive */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(232,163,61,.035), transparent 60%),
    radial-gradient(100% 100% at 50% 120%, rgba(0,0,0,.5), transparent 55%);
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(232,163,61,.28); }
[hidden] { display: none !important; }

/* scrollbars kept thin and dark */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-2); }
::-webkit-scrollbar-thumb:hover { background: #33424A; }

/* ══════════════════════════ WALL SHELL ══════════════════════════ */
.wall {
  position: fixed; inset: 0; z-index: 2;
  display: grid; grid-template-rows: var(--h-top) 1fr var(--h-foot);
  background:
    linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 100% 148px,
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 148px 100%,
    var(--void);
  background-blend-mode: normal;
  opacity: 1;
}
.wall::before { /* keep the lattice from competing with content */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 70% at 50% 45%, transparent, rgba(10,12,14,.92) 78%);
}

/* ── top bar ── */
.wall-top {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 20px; border-bottom: 1px solid var(--rule);
  background: rgba(10,12,14,.72); backdrop-filter: blur(6px);
}
.wt-brand { display: flex; align-items: center; gap: 11px; }
.wt-mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--rule-2); color: var(--amber);
}
.wt-mark svg { width: 17px; height: 17px; }
.wt-names b { display: block; font-size: 13px; letter-spacing: .26em; font-weight: 600; }
.wt-names span { display: block; font-size: 9.5px; letter-spacing: .3em; color: var(--ink-3); margin-top: 2px; }

.wt-strip { display: flex; align-items: center; gap: 12px; font-family: var(--f-num); font-size: 10.5px; letter-spacing: .18em; color: var(--ink-2); }
.wt-live { display: inline-flex; align-items: center; gap: 7px; color: var(--amber); }
.wt-live i { width: 6px; height: 6px; background: var(--amber); border-radius: 50%; animation: beat 1.6s var(--ease) infinite; }
@keyframes beat { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
.wt-sep { width: 1px; height: 11px; background: var(--rule-2); }

.wt-clock { justify-self: end; text-align: right; }
.wt-time { font-family: var(--f-num); font-size: 17px; letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.wt-date { font-size: 9.5px; letter-spacing: .2em; color: var(--ink-3); margin-top: 1px; }

/* ── body grid ── */
.wall-body {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: 268px minmax(0,1fr) 286px;
  min-height: 0;
}
.rail { display: flex; flex-direction: column; min-height: 0; padding: 14px 16px 0; gap: 16px; overflow: hidden; }
.rail-l { border-right: 1px solid var(--rule); }
.rail-r { border-left: 1px solid var(--rule); }

.blk { min-height: 0; }
.blk-grow { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.blk-h {
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 9px;
  font-size: 9.5px; letter-spacing: .24em; color: var(--ink-3); font-weight: 600;
}
.blk-h::before { content: ""; width: 12px; height: 1px; background: var(--amber); flex: none; transform: translateY(-2px); }
.blk-h em { margin-left: auto; font-style: normal; letter-spacing: .12em; font-size: 9px; color: var(--ink-4); }

/* ── metric row ── */
.metric-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.metric-row .m { background: var(--panel); padding: 9px 10px 8px; }
.metric-row b {
  display: block; font-family: var(--f-num); font-size: 25px; font-weight: 500;
  line-height: 1.05; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.metric-row span { display: block; font-size: 8px; letter-spacing: .14em; color: var(--ink-4); margin-top: 5px; line-height: 1.35; }

/* ── water bars ── */
.bars { list-style: none; margin: 0; padding: 0; overflow: auto; }
.bars { display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
.bars li { padding: 8px 0 9px; border-bottom: 1px solid var(--rule); }
.bar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
/* English station names run long — let them wrap to a second line instead of
   truncating, and keep the reading on the right from being pushed out. */
.bar-name { flex: 1 1 auto; min-width: 0; font-size: 11px; line-height: 1.3; color: var(--ink-2); overflow-wrap: anywhere; }
.bar-val { flex: 0 0 auto; font-family: var(--f-num); font-size: 11.5px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-track { position: relative; height: 3px; background: var(--rule); }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--teal); transition: width .9s var(--ease); }
.bar-mark { position: absolute; top: -2px; width: 1px; height: 7px; background: var(--ink-4); }
.bar-fill.over { background: var(--red); }
.bars li.over .bar-val { color: var(--red); }

/* ── active signals ── */
.sigs li { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 10.5px; }
.sigs li:last-child { border-bottom: 0; }
.sigs .sg-lv { flex: 0 0 auto; width: 4px; height: 4px; margin-top: 5px; border-radius: 50%; background: var(--ink-4); }
.sigs li.warn .sg-lv { background: var(--amber); }
.sigs li.crit .sg-lv { background: var(--red); }
.sigs .sg-n { flex: 1 1 auto; min-width: 0; color: var(--ink-2); line-height: 1.3; overflow-wrap: anywhere; }
.sigs .sg-v { flex: 0 0 auto; font-family: var(--f-num); font-size: 10.5px; color: var(--ink); white-space: nowrap; padding-top: 1px; }
.sigs li.warn .sg-v { color: var(--amber); }
.sigs li.crit .sg-v { color: var(--red); }
.sigs .sg-empty { color: var(--ink-4); font-size: 10px; letter-spacing: .1em; padding: 6px 0; }

/* ── sparkline ── */
.spark-canvas { display: block; width: 100%; height: 96px; }
.spark-foot { display: flex; gap: 6px; align-items: baseline; font-size: 8.5px; letter-spacing: .14em; color: var(--ink-4); margin-top: 6px; }
.spark-foot span:nth-child(2), .spark-foot span:nth-child(4) { margin-right: 10px; }
.spark-foot span:nth-child(1), .spark-foot span:nth-child(3) { font-family: var(--f-num); color: var(--amber); letter-spacing: .04em; font-size: 11px; }

/* ══════════════ STAGE ══════════════ */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px 18px 0; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 9px; }
.sh-left b { font-size: 11px; letter-spacing: .24em; font-weight: 600; }
.sh-left span { display: block; font-size: 9.5px; letter-spacing: .1em; color: var(--ink-4); margin-top: 2px; }
.layers { display: flex; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.layers button {
  padding: 5px 11px; font-size: 9px; letter-spacing: .16em; color: var(--ink-3);
  background: var(--void-2); transition: color .15s, background .15s;
}
.layers button:hover { color: var(--ink-2); }
.layers button.on { color: var(--void); background: var(--amber); font-weight: 600; }

.stage-map { position: relative; flex: 1; min-height: 0; }
#map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.disc-legend {
  position: absolute; left: 4px; bottom: 8px; display: flex; gap: 14px;
  font-size: 8.5px; letter-spacing: .16em; color: var(--ink-4);
}
.lg-dot { display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.c-crit { background: var(--red); } .c-warn { background: var(--amber); } .c-ok { background: var(--teal); }

.crosshair { position: absolute; inset: 0; pointer-events: none; }
.crosshair .cx-v { position: absolute; top: 0; bottom: 0; width: 1px; background: linear-gradient(transparent, rgba(232,163,61,.5), transparent); }
.crosshair .cx-h { position: absolute; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(232,163,61,.5), transparent); }

.tip {
  position: absolute; z-index: 4; pointer-events: none; transform: translate(12px, -50%);
  background: rgba(16,20,23,.96); border: 1px solid var(--rule-2); border-left: 2px solid var(--amber);
  padding: 7px 10px; min-width: 120px;
}
.tip b { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; }
.tip span { display: block; font-size: 9.5px; letter-spacing: .12em; color: var(--ink-3); margin-top: 3px; }

/* ── response ladder ── */
.ladder { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.ladder .r {
  display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 8px;
  padding: 6px 9px; background: var(--void-2); font-size: 10px; letter-spacing: .1em; color: var(--ink-4);
  transition: background .3s, color .3s;
}
.ladder .r i { width: 4px; height: 4px; background: var(--rule-2); border-radius: 50%; }
.ladder .r b { font-family: var(--f-num); font-weight: 500; font-size: 10px; }
.ladder .r.on { color: var(--ink); background: var(--panel-2); }
.ladder .r.on i { background: var(--amber); box-shadow: 0 0 0 3px rgba(232,163,61,.14); }
.ladder .r.crit.on i { background: var(--red); box-shadow: 0 0 0 3px rgba(216,69,60,.16); }

/* ── dial ── */
.dial-wrap { position: relative; display: grid; place-items: center; }
.dial-txt { position: absolute; text-align: center; }
.dial-txt b { display: block; font-family: var(--f-num); font-size: 25px; font-weight: 500; line-height: 1; }
.dial-txt span { display: block; font-size: 8.5px; letter-spacing: .14em; color: var(--ink-4); margin-top: 4px; }

/* ── case stream ── */
.stream { list-style: none; margin: 0; padding: 0; overflow: auto; }
.stream li { padding: 8px 0 9px; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.stream .s-t { font-size: 11.2px; color: var(--ink); line-height: 1.45; }
.stream .s-m { font-size: 8.5px; letter-spacing: .12em; color: var(--ink-4); margin-top: 4px; }
.stream .s-q { font-family: var(--f-num); font-size: 10px; color: var(--amber); align-self: start; }

/* ── ticker ── */
.wall-foot {
  position: relative; z-index: 3; display: grid; grid-template-columns: 1fr auto;
  border-top: 1px solid var(--rule); background: rgba(10,12,14,.82); backdrop-filter: blur(6px);
}
.ticker { overflow: hidden; display: flex; align-items: center; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-run {
  display: flex; gap: 42px; white-space: nowrap; padding-left: 20px;
  font-size: 10.5px; letter-spacing: .1em; color: var(--ink-2);
  animation: slide 64s linear infinite;
}
.ticker:hover .ticker-run { animation-play-state: paused; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-run b { color: var(--amber); font-weight: 500; }
.ticker-run i { color: var(--ink-4); font-style: normal; }

.enter { display: flex; align-items: center; padding: 0 18px; border-left: 1px solid var(--rule); }
.btn-enter {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px;
  border: 1px solid var(--amber); color: var(--amber); font-size: 10px; letter-spacing: .22em; font-weight: 600;
  transition: background .18s, color .18s;
}
.btn-enter span { transition: transform .18s var(--ease); }
.btn-enter:hover { background: var(--amber); color: var(--void); }
.btn-enter:hover span { transform: translateX(3px); }

.wall-error {
  position: absolute; z-index: 8; left: 50%; bottom: 70px; transform: translateX(-50%);
  display: grid; gap: 3px; padding: 10px 16px; text-align: center;
  border: 1px solid var(--red); background: rgba(20,10,10,.92);
}
.wall-error b { font-size: 10px; letter-spacing: .22em; color: var(--red); }
.wall-error span { font-size: 10.5px; color: var(--ink-3); letter-spacing: .04em; }

/* ══════════════════════════ CONSOLE ══════════════════════════ */
.console { position: fixed; inset: 0; z-index: 2; display: grid; grid-template-columns: 208px 1fr; background: var(--void); }
.side {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--rule); background: var(--void-2);
}
.side-brand { padding: 18px 18px 14px; border-bottom: 1px solid var(--rule); }
.side-brand b { display: block; font-size: 14px; letter-spacing: .3em; font-weight: 600; }
.side-brand span { display: block; font-size: 8.5px; letter-spacing: .24em; color: var(--ink-4); margin-top: 4px; }
.nav { flex: 1; overflow: auto; padding: 10px 0; }
.nav-group { padding: 12px 18px 5px; font-size: 8.5px; letter-spacing: .22em; color: var(--ink-4); }
.nav a {
  display: flex; align-items: center; gap: 9px; padding: 7px 18px;
  font-size: 12px; color: var(--ink-2); text-decoration: none; border-left: 2px solid transparent;
  transition: color .14s, background .14s, border-color .14s;
}
.nav a:hover { color: var(--ink); background: rgba(255,255,255,.025); }
.nav a.on { color: var(--ink); border-left-color: var(--amber); background: rgba(232,163,61,.06); }
.nav a svg { width: 14px; height: 14px; flex: none; opacity: .8; }
.side-foot { border-top: 1px solid var(--rule); padding: 10px 12px 12px; }
.side-link { font-size: 9.5px; letter-spacing: .18em; color: var(--ink-3); padding: 6px 6px; }
.side-link:hover { color: var(--amber); }
.side-user { font-size: 10.5px; color: var(--ink-3); padding: 8px 6px 0; line-height: 1.5; }
.side-user b { display: block; color: var(--ink-2); font-size: 11.5px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 16px 22px 13px; border-bottom: 1px solid var(--rule);
}
.top h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.top p { margin: 3px 0 0; font-size: 11.5px; color: var(--ink-3); }
.top-r { display: flex; align-items: center; gap: 14px; }
.clock-sm { font-family: var(--f-num); font-size: 11px; color: var(--ink-3); letter-spacing: .1em; }
.view { flex: 1; overflow: auto; padding: 18px 22px 40px; }

/* ── sheets & grid ── */
.sheet { background: var(--panel); border: 1px solid var(--rule); }
.sheet + .sheet { margin-top: 14px; }
.sheet-h {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
}
.sheet-h h2 { margin: 0; font-size: 10px; letter-spacing: .2em; color: var(--ink-3); font-weight: 600; }
.sheet-h .sub { font-size: 10.5px; color: var(--ink-4); }
.sheet-h .sp { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.sheet-b { padding: 14px; }
.sheet-b.flush { padding: 0; }

.grid-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; align-items: start; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.split { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 14px; align-items: start; }
.split > *, .grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }

/* ── kpi ── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.kpi { background: var(--panel); padding: 12px 13px; }
.kpi b { display: block; font-family: var(--f-num); font-size: 26px; font-weight: 500; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi span { display: block; font-size: 8.5px; letter-spacing: .16em; color: var(--ink-4); margin-top: 6px; }
.kpi.hot b { color: var(--red); }
.kpi.cool b { color: var(--teal); }
.kpi.amber b { color: var(--amber); }

/* ── tables ── */
.tb-wrap { overflow: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 12px; }
table.tb th {
  text-align: left; font-size: 8.5px; letter-spacing: .16em; color: var(--ink-4); font-weight: 600;
  padding: 8px 12px; border-bottom: 1px solid var(--rule-2); white-space: nowrap; background: var(--void-2);
  position: sticky; top: 0; z-index: 1;
}
table.tb td { padding: 8px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.tb tbody tr:hover { background: rgba(255,255,255,.02); }
table.tb .num { font-family: var(--f-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tb .right { text-align: right; }
table.tb .mono { font-family: var(--f-num); font-size: 11px; color: var(--ink-2); }

/* ── tags ── */
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px;
  font-size: 9.5px; letter-spacing: .06em; border: 1px solid var(--rule-2); color: var(--ink-2);
  white-space: nowrap;
}
.tag::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.tag.red { color: var(--red); border-color: rgba(216,69,60,.4); background: rgba(216,69,60,.08); }
.tag.amber { color: var(--amber); border-color: rgba(232,163,61,.4); background: rgba(232,163,61,.08); }
.tag.teal { color: var(--teal); border-color: rgba(79,179,166,.4); background: rgba(79,179,166,.08); }
.tag.blue { color: var(--blue); border-color: rgba(74,131,184,.4); background: rgba(74,131,184,.08); }
.tag.gray { color: var(--ink-3); }
.tag.plain::before { display: none; }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 13px; border: 1px solid var(--rule-2); color: var(--ink-2);
  font-size: 11.5px; letter-spacing: .02em; background: var(--panel-2);
  transition: border-color .15s, color .15s, background .15s;
}
.btn:hover { border-color: var(--ink-4); color: var(--ink); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #17140E; font-weight: 600; }
.btn.primary:hover { background: #F2B254; border-color: #F2B254; }
.btn.danger { border-color: rgba(216,69,60,.55); color: var(--red); }
.btn.danger:hover { background: rgba(216,69,60,.12); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 10.5px; }
.btn.xs { padding: 2px 7px; font-size: 9.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.on { border-color: var(--amber); color: var(--amber); }

/* ── forms ── */
.field { display: grid; gap: 5px; }
.field > label { font-size: 8.5px; letter-spacing: .18em; color: var(--ink-4); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  background: var(--void-2); border: 1px solid var(--rule-2); color: var(--ink);
  padding: 7px 10px; font-size: 12px; width: 100%; outline: none;
  transition: border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--amber); background: #0B0E10; }
input::placeholder, textarea::placeholder { color: var(--ink-4); }
/* Chrome paints autofilled fields near-white; keep them on the instrument panel. */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--void-2) inset;
  caret-color: var(--ink);
}
textarea { min-height: 78px; resize: vertical; line-height: 1.6; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-4) 50%), linear-gradient(135deg, var(--ink-4) 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 26px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.filters .field { min-width: 130px; }
.filters .field.grow { flex: 1; min-width: 200px; }
.act-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }
.act-row .hint { margin: 0; }

/* ── notes ── */
.note {
  border: 1px solid var(--rule); border-left: 2px solid var(--rule-2);
  background: var(--void-2); padding: 10px 13px; color: var(--ink-2);
  font-size: 11.5px; line-height: 1.7;
}
.note b { color: var(--ink); font-weight: 600; }
.note.amber { border-left-color: var(--amber); }
.note.red { border-left-color: var(--red); }

/* ── list rows ── */
.rowlist { display: grid; }
.rowlist .row {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 12px; align-items: center;
  padding: 9px 14px; border-bottom: 1px solid var(--rule); cursor: pointer;
  transition: background .14s;
}
.rowlist .row:last-child { border-bottom: 0; }
.rowlist .row:hover { background: rgba(255,255,255,.022); }
.row-b { min-width: 0; }
.row-b b { display: block; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-b span { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-n { display: flex; gap: 14px; text-align: right; }
.row-n > div { font-size: 8.5px; letter-spacing: .14em; color: var(--ink-4); }
.row-n i { display: block; font-family: var(--f-num); font-style: normal; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.25; }
.row-n i.hot { color: var(--red); }

.empty { padding: 26px 14px; text-align: center; font-size: 11.5px; color: var(--ink-4); letter-spacing: .04em; }

/* ── tabs ── */
.tabs { display: flex; gap: 1px; background: var(--rule); border-bottom: 1px solid var(--rule); }
.tabs button { padding: 8px 14px; font-size: 11px; color: var(--ink-3); background: var(--void-2); }
.tabs button.on { color: var(--ink); background: var(--panel); box-shadow: inset 0 -2px 0 var(--amber); }

/* ── drawer / modal ── */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(4,6,7,.66); backdrop-filter: blur(2px); }
.drawer {
  position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(560px, 94vw);
  background: var(--panel); border-left: 1px solid var(--rule-2);
  display: flex; flex-direction: column; animation: slidein .22s var(--ease);
}
@keyframes slidein { from { transform: translateX(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-h { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.drawer-h h3 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; }
.drawer-h .x { margin-left: auto; color: var(--ink-3); font-size: 15px; padding: 2px 6px; }
.drawer-h .x:hover { color: var(--ink); }
.drawer-b { flex: 1; overflow: auto; padding: 16px; }

.modal {
  position: fixed; z-index: 41; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: min(520px, 94vw); max-height: 86vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--rule-2);
}
.modal-h { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--rule); }
.modal-h h3 { margin: 0; font-size: 13px; font-weight: 600; }
.modal-h .x { margin-left: auto; color: var(--ink-3); }
.modal-b { padding: 15px; overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 15px; border-top: 1px solid var(--rule); }

/* ── toast ── */
.toasts { position: fixed; z-index: 60; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast {
  min-width: 220px; max-width: 380px; padding: 9px 13px; font-size: 11.5px;
  background: var(--panel-2); border: 1px solid var(--rule-2); border-left: 2px solid var(--teal);
  color: var(--ink); animation: risein .2s var(--ease);
}
.toast.err { border-left-color: var(--red); }
@keyframes risein { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── charts ── */
.chart-box { position: relative; }
.chart-box canvas { display: block; width: 100%; }

/* ── misc ── */
.mono { font-family: var(--f-num); }
.dim { color: var(--ink-3); }
.small { font-size: 10.5px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt14 { margin-top: 14px; }
.flex { display: flex; align-items: center; gap: 8px; }
.right { margin-left: auto; }
.sep { height: 1px; background: var(--rule); margin: 12px 0; }

/* ══════════════ SIGN IN ══════════════ */
.signin { position: fixed; inset: 0; z-index: 3; display: grid; grid-template-columns: 1.15fr .85fr; }
.si-graphic { position: relative; overflow: hidden; border-right: 1px solid var(--rule); display: flex; align-items: flex-end; }
#si-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.si-words { position: relative; z-index: 2; padding: 0 52px 58px; max-width: 620px; }
.si-eyebrow { font-size: 9.5px; letter-spacing: .34em; color: var(--amber); margin: 0 0 16px; }
.si-words h1 { margin: 0; font-size: clamp(34px, 4.4vw, 60px); line-height: 1.02; font-weight: 300; letter-spacing: -.015em; }
.si-lede { margin: 20px 0 0; max-width: 44ch; font-size: 13px; line-height: 1.75; color: var(--ink-2); }

.si-form { display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 0 56px; background: var(--void-2); }
.si-form form { display: grid; gap: 9px; }
.si-form label { font-size: 8.5px; letter-spacing: .2em; color: var(--ink-4); margin-top: 6px; }
.si-form input { padding: 10px 12px; font-size: 13px; }
.si-form .btn { margin-top: 14px; padding: 11px; font-size: 11.5px; letter-spacing: .12em; }
.si-hint { margin: 10px 0 0; font-size: 10.5px; color: var(--ink-4); line-height: 1.6; }
.si-hint.err { color: var(--red); }

/* ══════════════ RESPONSIVE ══════════════ */
@media (max-width: 1280px) {
  .wall-body { grid-template-columns: 238px minmax(0,1fr) 250px; }
  .rail { padding: 12px 13px 0; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
  .wall-body { grid-template-columns: minmax(0,1fr); }
  .rail { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .signin { grid-template-columns: 1fr; }
  .si-graphic { display: none; }
  .si-form { padding: 0 28px; }
}
@media (max-width: 820px) {
  .console { grid-template-columns: 1fr; }
  .side { display: none; }
  .grid-2, .grid-3, .grid-4, .form-2, .form-3, .form-4 { grid-template-columns: 1fr; }
  .view { padding: 14px; }
  .top { padding: 12px 14px; }
  .wall-top { grid-template-columns: 1fr auto; padding: 0 14px; }
  .wt-strip { display: none; }
  .stage { padding: 8px 10px 0; }
  .stage-head .sh-left span { display: none; }
  .layers button { padding: 5px 8px; font-size: 8px; }
  .ticker { display: none; }
  .wall-foot { grid-template-columns: 1fr; }
  .enter { justify-content: center; border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .ticker-run { animation: none; }
}
