/* Tokens live in css/tokens.css (loaded first). This file keeps the base and component rules. */

/* ─── Base ───────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 400 var(--fs-body)/var(--lh-body) var(--font-ui);
  font-feature-settings: "ss02";
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-head); font-weight: 600; text-wrap: balance; letter-spacing: -0.005em; }
.mono { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.num, td.amount, .money { font-variant-numeric: tabular-nums lining-nums; }
html:lang(hi) body { font-size: calc(var(--fs-body) + 1px); line-height: 1.58; } /* Devanagari: +1 px, +0.15 line-height (spec 15) */
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 11px; }
.xs { font-size: 10.5px; }
.cap { text-transform: uppercase; letter-spacing: .06em; font-size: 10px; font-weight: 600; color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 6px; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ─── Shell ──────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 212px 1fr;
  grid-template-rows: 44px 1fr;
  height: 100vh;
  overflow: hidden;
}
.sidebar {
  grid-row: 1 / span 2;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.brand {
  min-height: 44px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 2px; padding: 8px 12px 7px;
  border-bottom: 1px solid var(--line);
}
.brand-logo { height: 40px; width: auto; display: block; }
.brand-icon { display: none; width: 22px; height: 22px; object-fit: contain; }
.brand-sub { font-size: 9.5px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo,
  :root:not([data-theme="light"]) .brand-icon { filter: invert(1); }
}
:root[data-theme="dark"] .brand-logo,
:root[data-theme="dark"] .brand-icon { filter: invert(1); }
.nav { overflow-y: auto; padding: 6px 6px 10px; flex: 1; }
.nav-group { padding: 10px 8px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border: 0; background: transparent;
  border-radius: 5px; cursor: pointer; text-align: left; color: var(--ink-2); font-size: 12.5px; position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item svg { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item .badge { margin-left: auto; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 8px 12px; font-size: 10.5px; color: var(--muted); }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 15px; }
.topbar .crumbs { color: var(--muted); font-size: 11.5px; }
.topbar .spacer { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line-2); font-size: 11px; color: var(--ink-2); background: var(--surface);
  white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.search {
  display: flex; align-items: center; gap: 6px; padding: 0 9px; height: 28px; width: 260px;
  border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 11.5px;
}
.search kbd { margin-left: auto; font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--line-2); border-radius: 3px; padding: 0 4px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 6px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 11.5px; font-weight: 500;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.sm { height: 24px; padding: 0 8px; font-size: 11px; }
.btn.xs { height: 20px; padding: 0 6px; font-size: 10.5px; }
.btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.main { overflow: auto; padding: 12px 14px 28px; position: relative; }

/* ─── Grid & cards ───────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; } .span-9 { grid-column: span 9; } .span-12 { grid-column: span 12; }
@media (max-width: 1100px) {
  .span-2, .span-3 { grid-column: span 4; }
  .span-4, .span-5, .span-6, .span-7, .span-8, .span-9 { grid-column: span 12; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 56px 1fr; }
  .sidebar .brand { align-items: center; padding: 10px 0; }
  .sidebar .brand-logo, .sidebar .brand-sub, .nav-item span, .nav-group, .sidebar-foot, .nav-item .badge { display: none; }
  .sidebar .brand-icon { display: block; }
  .nav-item { justify-content: center; padding: 8px; }
  .search { display: none; }
  .span-2, .span-3 { grid-column: span 6; }
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-width: 0;
}
.card-h {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-bottom: 1px solid var(--line);
}
.card-h h3 { font-size: 12.5px; font-weight: 600; font-family: var(--font-ui); }
.card-h .sub { color: var(--muted); font-size: 10.5px; }
.card-h .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 10px 11px; flex: 1; min-width: 0; }
.card-b.tight { padding: 0; }
.card-f { padding: 6px 11px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }

/* ─── KPI tiles ──────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 8px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px 7px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi .l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.kpi .v { font-family: var(--font-head); font-size: 22px; font-weight: 600; line-height: 1.1; margin-top: 2px; }
.kpi .v small { font-size: 12px; color: var(--muted); font-weight: 500; font-family: var(--font-ui); margin-left: 3px; }
.kpi .d { font-size: 10.5px; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.kpi .spark { position: absolute; right: 8px; bottom: 6px; opacity: .9; }
.up { color: var(--good-text); } .down { color: var(--crit-text); } .flat { color: var(--muted); }
.kpi.crit { border-left: 3px solid var(--crit); }
.kpi.warn { border-left: 3px solid var(--warn); }
.kpi.good { border-left: 3px solid var(--good); }
/* a clickable KPI (core/ui.js kpi href / act): opens or filters the records it counts */
.kpi-link { display: block; color: inherit; text-decoration: none; cursor: pointer; }
.kpi-link:hover { border-color: var(--accent); text-decoration: none; }
.kpi-link:hover .l { color: var(--accent-text); }
.kpi-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kpi-link.kpi-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow); }

/* ─── Pills / badges ─────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.good { background: var(--good-soft); color: var(--good-text); }
.pill.warn { background: var(--warn-soft); color: var(--warn-text); }
.pill.serious { background: var(--serious-soft); color: var(--serious-text); }
.pill.crit { background: var(--crit-soft); color: var(--crit-text); }
.pill.neutral { background: var(--surface-2); color: var(--ink-2); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.plain::before { display: none; }
.badge { display: inline-flex; min-width: 17px; height: 16px; padding: 0 5px; align-items: center; justify-content: center; border-radius: 999px; font-size: 10px; font-weight: 600; background: var(--crit); color: #fff; }
.badge.soft { background: var(--surface-3); color: var(--ink-2); }
.tag { display: inline-block; padding: 0 5px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); font-size: 10.5px; color: var(--ink-2); }

/* ─── Tables ─────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.tbl th { text-align: left; font-weight: 600; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 5px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .mono { font-size: 11px; }
.tbl-scroll { max-height: 420px; overflow: auto; }
.row-sel td { background: var(--accent-soft) !important; }

/* ─── Forms ──────────────────────────────────────────────── */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 3px 9px; font-size: 11px; cursor: pointer; color: var(--ink-2); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
select.sel, input.inp { height: 26px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: 5px; padding: 0 7px; font: inherit; font-size: 11.5px; }
input[type=range] { accent-color: var(--accent); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }

/* ─── Progress / bars ────────────────────────────────────── */
.bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.bar.good > i { background: var(--good); } .bar.warn > i { background: var(--warn); } .bar.crit > i { background: var(--crit); }
.bar.s1 > i { background: var(--s1); } .bar.s2 > i { background: var(--s2); } .bar.s3 > i { background: var(--s3); }
.meter { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; font-size: 11.5px; }
.meter .bar { grid-column: 1 / -1; margin-bottom: 5px; }
.stack { display: flex; height: 8px; border-radius: 3px; overflow: hidden; gap: 2px; background: var(--surface); }
.stack > i { display: block; height: 100%; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--ink-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ─── Lists & feeds ──────────────────────────────────────── */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 8px 1fr auto; gap: 9px; padding: 7px 11px; border-bottom: 1px solid var(--line); align-items: start; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .sev { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; }
.sev.crit { background: var(--crit); } .sev.serious { background: var(--serious); } .sev.warn { background: var(--warn); } .sev.good { background: var(--good); } .sev.info { background: var(--s1); }
.feed-item .t { font-weight: 500; }
.feed-item .m { color: var(--muted); font-size: 11px; }
.feed-item .when { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 11.5px; }
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; font-weight: 500; }
.insight { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 6px; padding: 8px 10px; font-size: 11.5px; }
.insight .h { font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.insight .h svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.insights { display: flex; flex-direction: column; gap: 8px; }
.insights-clip { max-height: 340px; overflow: auto; padding-right: 2px; }
.card.d3cmd-card, .card.insights-card { align-self: start; }
.card.d3cmd-card .card-b { padding: 8px 10px 6px; }
.d3cmd { height: 340px; }
.d3cmd svg { display: block; width: 100%; height: 100%; }
.d3cmd-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 10.5px; color: var(--muted); margin-top: 4px; line-height: 1.3; }
.d3cmd-brush .selection { fill: var(--accent); fill-opacity: .12; stroke: var(--accent); }

/* ─── Charts ─────────────────────────────────────────────── */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font-ui); font-size: 10px; fill: var(--muted); }
.chart .grid-l { stroke: var(--grid); stroke-width: 1; }
.chart .axis-l { stroke: var(--axis); stroke-width: 1; }
.chart .lbl { fill: var(--ink-2); font-size: 10.5px; }
.tooltip { position: fixed; pointer-events: none; z-index: 50; background: var(--ink); color: var(--bg); padding: 5px 8px; border-radius: 5px; font-size: 11px; box-shadow: var(--shadow); opacity: 0; transition: opacity .08s; white-space: nowrap; }
.tooltip.on { opacity: 1; }

/* ─── Heatmap / calendar ─────────────────────────────────── */
.heat { display: grid; gap: 2px; }
.heat i { display: block; aspect-ratio: 1; border-radius: 2px; background: var(--surface-3); }

/* ─── Map (Kepler-style) ─────────────────────────────────── */
.map-wrap { position: relative; background: var(--map-bg); border-radius: 6px; overflow: hidden; }
.map-wrap svg { display: block; width: 100%; height: min(78vh, 720px); }
.map-land { fill: var(--map-land); stroke: var(--map-line); stroke-width: 1; }
.map-label { fill: #8fa1c7; font-size: 9px; font-family: var(--font-ui); }
.map-panel { position: absolute; top: 10px; left: 10px; width: 210px; background: rgba(15, 20, 36, .92); color: #dfe6f7; border: 1px solid #2a3654; border-radius: 6px; font-size: 11px; backdrop-filter: blur(4px); }
.map-panel h4 { font-family: var(--font-ui); font-size: 11px; font-weight: 600; padding: 7px 10px; border-bottom: 1px solid #2a3654; color: #fff; }
.map-panel > p { padding: 8px 10px 0; line-height: 1.45; }
.map-layer { display: flex; align-items: center; gap: 8px; padding: 5px 10px; cursor: pointer; }
.map-layer:hover { background: rgba(255, 255, 255, .05); }
.map-layer .sw { width: 10px; height: 10px; border-radius: 2px; }
.map-layer input { margin: 0; accent-color: #7aa2ff; }
.map-legend { position: absolute; right: 10px; bottom: 52px; background: rgba(15, 20, 36, .92); border: 1px solid #2a3654; color: #dfe6f7; border-radius: 6px; padding: 7px 10px; font-size: 10.5px; }
.map-time { position: absolute; left: 10px; right: 10px; bottom: 10px; background: rgba(15, 20, 36, .92); border: 1px solid #2a3654; color: #dfe6f7; border-radius: 6px; padding: 6px 10px; font-size: 11px; display: flex; align-items: center; gap: 10px; }
.map-time input[type=range] { flex: 1; accent-color: #7aa2ff; }
.map-stats { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.map-stat { background: rgba(15, 20, 36, .92); border: 1px solid #2a3654; color: #dfe6f7; border-radius: 6px; padding: 5px 9px; font-size: 10.5px; }
.map-stat b { display: block; font-family: var(--font-head); font-size: 16px; color: #fff; line-height: 1.1; }
.map-tip { position: absolute; pointer-events: none; background: #0b1020; color: #e8edf9; border: 1px solid #3a4a75; padding: 5px 8px; border-radius: 5px; font-size: 11px; opacity: 0; white-space: nowrap; }
.map-tip.on { opacity: 1; }
.live-geo-wrap { height: min(78vh, 720px); min-height: 520px; background: #080d18; }
.nestle-sat-wrap { height: min(84vh, 820px); min-height: 580px; background: #080d18; }
.kepler-wrap { height: min(86vh, 860px); min-height: 620px; background: #0b1020; }
.kepler-wrap .live-geo-map { z-index: 5; }
.kepler-wrap .map-legend,
.kepler-wrap .map-time { display: none; }
.kepler-wrap .map-panel { display: block; z-index: 8; pointer-events: auto; }
.kepler-wrap .map-stats { display: flex; z-index: 8; }
.kepler-boot { display: flex; align-items: center; justify-content: center; height: 100%; color: #9fb0cc; font-size: 13px; letter-spacing: .02em; }
.kepler-frame { display: block; width: 100%; height: 100%; border: 0; background: #0b1020; }
.map-fly { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 8px; }
.map-fly-btn { border: 1px solid var(--line); background: var(--surface); color: inherit; border-radius: 7px; padding: 5px 8px; cursor: pointer; font: inherit; text-align: left; line-height: 1.2; min-width: 108px; }
.map-fly-btn:hover, .map-fly-btn.cmd { border-color: #e8611a; }
.map-fly-btn.cmd { background: rgba(232, 97, 26, .08); }
.map-fly-btn.hq { background: #e8611a; color: #fff; border-color: #e8611a; }
.map-fly-btn.plan { opacity: .7; border-style: dashed; }
.map-fly-btn b { display: block; font-size: 11.5px; }
.map-fly-btn i, .map-fly-btn em { display: block; font-style: normal; font-size: 9.5px; color: var(--muted); }
.map-fly-btn em { font-size: 9px; margin-top: 1px; }
.map-fly-btn.hq i, .map-fly-btn.hq b, .map-fly-btn.hq em { color: #fff; }
.map-panel.kepler-note { width: 268px; max-height: calc(100% - 20px); overflow: auto; }
.map-panel .map-kv { margin: 8px 10px 4px; }
.map-panel .map-kv dt { color: #9fb0d0; }
.map-panel .map-kv dd { color: #edf3ff; }
.map-insights { max-height: 420px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.map-base { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.map-base button { border: 0; background: var(--surface); color: inherit; padding: 5px 10px; font: inherit; cursor: pointer; }
.map-base button.on { background: #e8611a; color: #fff; }
.live-geo-map { position: absolute; inset: 0; }
.live-geo-wrap .map-panel, .live-geo-wrap .map-stats, .live-geo-wrap .map-legend, .live-geo-wrap .map-time { z-index: 5; }
.live-geo-wrap .maplibregl-control-container { position: relative; z-index: 4; }
.live-geo-wrap .map-panel { box-shadow: 0 12px 34px rgba(0, 0, 0, .38); }
.map-source { margin-top: 4px; padding: 7px 10px; border-top: 1px solid #2a3654; color: #71809f; font-family: var(--font-mono); font-size: 9.5px; line-height: 1.45; }
.legend-cube { display: inline-block; width: 9px; height: 9px; margin-right: 6px; transform: skewY(-20deg); background: #4a7dff; border: 1px solid #b9d2ff; box-shadow: 2px -2px 0 #274fa8; }
.legend-cube.plant { background: #ff5360; border-color: #ffc1c6; box-shadow: 2px -2px 0 #9b2732; }

/* ─── D3 network (globe / force / sankey / chord) ─────────── */
.d3viz-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.d3viz-bar .seg { flex-shrink: 0; }
.d3viz-bar #d3viz-cap { flex: 1 1 280px; line-height: 1.4; }
.d3viz { position: relative; min-height: 520px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.d3viz svg { display: block; width: 100%; height: auto; }
.d3viz .d3-sphere { fill: #0a1a2e; stroke: #3d6a94; stroke-width: 1.4; }
.d3viz .d3-grat { fill: none; stroke: rgba(180, 210, 240, .22); stroke-width: .6; }
.d3viz .d3-india { fill: #2f6a44; stroke: #b8ffd2; stroke-width: 1.2; }
.d3viz .d3-night { fill: rgba(4, 10, 22, .22); pointer-events: none; }
.d3viz-tip { position: absolute; pointer-events: none; z-index: 6; max-width: 240px; padding: 6px 8px; border-radius: 5px; background: rgba(9, 14, 27, .96); color: #edf3ff; border: 1px solid #40537d; font-size: 11px; line-height: 1.45; opacity: 0; transform: translateY(4px); }
.d3viz-tip.on { opacity: 1; transform: none; }
[data-theme="light"] .d3viz .d3-sphere { fill: #9ec5e8; stroke: #6a93b8; }
[data-theme="light"] .d3viz .d3-grat { stroke: rgba(20, 40, 70, .16); }
[data-theme="light"] .d3viz .d3-india { fill: #cfe8c4; stroke: #2d6b3a; }
[data-theme="light"] .d3viz .d3-night { fill: rgba(20, 40, 80, .12); }
.live-geo-wrap .maplibregl-ctrl-attrib { background: rgba(9, 14, 27, .82); color: #9aa6bd; }
.live-geo-wrap .maplibregl-ctrl-attrib a { color: #b7c8ec; }
.live-geo-wrap .mapboxgl-map, .live-geo-wrap .maplibregl-map { font-family: var(--font-ui); }
.live-geo-wrap .deck-tooltip { background: rgba(9, 14, 27, .96) !important; color: #edf3ff !important; border: 1px solid #40537d; border-radius: 5px; font-family: var(--font-ui); font-size: 11px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }

/* ─── Copilot drawer ─────────────────────────────────────── */
.drawer {
  position: fixed; top: 44px; right: 0; bottom: 0; width: 360px; background: var(--surface); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .18s ease; z-index: 40; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.drawer.open { transform: none; }
.drawer-h { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.drawer-h h3 { font-size: 13px; font-family: var(--font-ui); white-space: nowrap; }
.drawer-b { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.drawer-f { border-top: 1px solid var(--line); padding: 10px 12px; }
.msg { max-width: 95%; padding: 8px 10px; border-radius: 8px; font-size: 11.5px; line-height: 1.5; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); }
.msg.ai b { color: var(--ink); }
.msg .ev { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.msg .ev span { font-size: 10px; padding: 1px 6px; border-radius: 3px; background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2); font-family: var(--font-mono); }
.sugg { display: flex; flex-wrap: wrap; gap: 5px; }
.sugg button { font-size: 10.5px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent); cursor: pointer; }
.ask { display: flex; gap: 6px; }
.ask input { flex: 1; height: 30px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface-2); color: var(--ink); padding: 0 9px; font: inherit; font-size: 11.5px; }

/* ─── Digital twin ───────────────────────────────────────── */
.twin svg { width: 100%; height: auto; display: block; }
.twin .zone { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1; }
.twin .zone-l { fill: var(--muted); font-size: 9px; font-family: var(--font-ui); text-transform: uppercase; letter-spacing: .05em; }
.twin .slot { stroke: var(--surface); stroke-width: .6; }
.twin .road { fill: var(--surface-3); }
.twin .truck { fill: var(--s1); stroke: none; }
.twin .truck.vendor { fill: var(--s2); }
.twin .truck.empty { fill: var(--muted); }
.twin .gate { fill: var(--accent); }
.twin text.t { fill: var(--ink-2); font-size: 9.5px; font-family: var(--font-ui); }
.twin text.tm { fill: var(--ink); font-size: 9.5px; font-family: var(--font-mono); }
.scen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.scen button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 6px; padding: 6px 8px; text-align: left; cursor: pointer; font-size: 11px; }
.scen button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ─── Blueprint ──────────────────────────────────────────── */
.arch { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.arch-col { border: 1px dashed var(--line-2); border-radius: 6px; padding: 8px; }
.arch-col h4 { font-family: var(--font-ui); font-size: 11px; color: var(--accent); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.arch-col div { font-size: 11px; padding: 4px 6px; margin-bottom: 4px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.steps { display: flex; gap: 0; align-items: stretch; overflow-x: auto; }
.step { flex: 1; min-width: 120px; padding: 8px 10px; border: 1px solid var(--line); background: var(--surface-2); position: relative; font-size: 11px; }
.step:first-child { border-radius: 6px 0 0 6px; } .step:last-child { border-radius: 0 6px 6px 0; }
.step b { display: block; font-size: 11.5px; }
.step .n { font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--accent); }
.proof { width: 44px; height: 32px; border-radius: 3px; background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); border: 1px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 9px; position: relative; }
.proof.ok::after { content: "✓"; position: absolute; right: 2px; bottom: 0; color: var(--good-text); font-weight: 700; font-size: 11px; }
.proof.bad::after { content: "!"; position: absolute; right: 3px; bottom: 0; color: var(--crit-text); font-weight: 700; font-size: 11px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.check { border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; font-size: 11px; display: flex; gap: 8px; align-items: center; }
.check.fail { border-color: var(--crit); background: var(--crit-soft); }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl { display: grid; grid-template-columns: 64px 14px 1fr; gap: 8px; align-items: start; }
.tl .time { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); padding-top: 1px; }
.tl .node { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent); background: var(--surface); margin: 3px 0 0 2px; position: relative; }
.tl .node.done { background: var(--accent); }
.tl .node::after { content: ""; position: absolute; left: 2px; top: 10px; width: 2px; height: 22px; background: var(--line-2); }
.tl:last-child .node::after { display: none; }
.tl .body { padding-bottom: 10px; font-size: 11.5px; }
.tl .body small { color: var(--muted); display: block; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 6px; font-size: 12px; opacity: 0; transition: .2s; z-index: 60; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.radar text { font-size: 9.5px; fill: var(--muted); }
.radar .web { fill: none; stroke: var(--grid); }
.radar .shape { fill: var(--s1); fill-opacity: .22; stroke: var(--s1); stroke-width: 1.8; }
.radar .shape.v { fill: var(--s2); fill-opacity: .16; stroke: var(--s2); }
.page-h { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.page-h h2 { font-size: 18px; }
.page-h p { margin: 0; color: var(--muted); font-size: 11.5px; max-width: 70ch; }
.page-h .actions { margin-left: auto; display: flex; gap: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ─── 3D scenes (CSS transforms) ─────────────────────────── */
.scene { position: relative; perspective: 1700px; overflow: hidden; border-radius: 6px; border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 80%, var(--surface-3), var(--surface-2) 70%); cursor: grab; user-select: none; }
.scene:active { cursor: grabbing; }
.world { position: absolute; left: 50%; top: 58%; width: 0; height: 0; transform-style: preserve-3d; transform: translate3d(var(--px, 0px), var(--py, 0px), 0) rotateX(var(--rx, -24deg)) rotateY(var(--ry, -38deg)) scale3d(var(--sc, 1), var(--sc, 1), var(--sc, 1)); }
.obj { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d; }
.face { position: absolute; backface-visibility: hidden; transform-origin: center; }
.lbl3 { backface-visibility: visible; background: transparent !important; color: var(--ink-2); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; text-align: center; white-space: nowrap; }
.scene-hint { position: absolute; right: 8px; bottom: 6px; font-size: 10px; color: var(--muted); }
.inv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 1100px) { .inv-grid { grid-template-columns: repeat(2, 1fr); } }
.inv { border: 1px solid var(--line); border-radius: 6px; padding: 8px; font-size: 11.5px; }
.inv-scene { margin-bottom: 6px; }
.inv-scene .scene { cursor: default; }
.inv-scene .scene-hint { display: none; }
pre.sql { margin: 0 0 6px; padding: 7px 9px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 5px; font-family: var(--font-mono); font-size: 11px; white-space: pre-wrap; color: var(--accent); }
.map-wrap[style*="--mh"] svg { height: var(--mh); }

/* ═══ Polish pass ═══════════════════════════════════════════ */
.main { background: var(--bg); }
.card { transition: box-shadow .15s ease, border-color .15s ease; }
.card:hover { box-shadow: 0 2px 4px rgba(16,24,40,.07), 0 10px 26px rgba(16,24,40,.09); border-color: var(--line-2); }
.card-h h3 { letter-spacing: .01em; }

.kpi { transition: box-shadow .15s ease, transform .15s ease; }
.kpi:hover { box-shadow: 0 2px 4px rgba(16,24,40,.08), 0 8px 20px rgba(16,24,40,.10); transform: translateY(-1px); }


.nav-item { transition: background .12s ease, color .12s ease; }
.nav-item.active::before { content: ""; position: absolute; left: -6px; top: 5px; bottom: 5px; width: 3px; border-radius: 2px; background: var(--accent); }
.btn { transition: background .12s ease, box-shadow .12s ease, transform .1s ease; }

.btn:active { transform: translateY(1px); }
.page-h h2 { font-size: 20px; letter-spacing: -.01em; }
.page-h { padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl-scroll::-webkit-scrollbar, .main::-webkit-scrollbar, .drawer-b::-webkit-scrollbar, .nav::-webkit-scrollbar, .tbl-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.tbl-scroll::-webkit-scrollbar-thumb, .main::-webkit-scrollbar-thumb, .drawer-b::-webkit-scrollbar-thumb, .nav::-webkit-scrollbar-thumb, .tbl-wrap::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.tbl-scroll::-webkit-scrollbar-track, .main::-webkit-scrollbar-track { background: transparent; }
.pill, .tag, .badge { letter-spacing: .01em; }
.insight { box-shadow: inset 0 0 0 1px transparent; }
.topbar { backdrop-filter: blur(6px); }
.chip .dot { box-shadow: 0 0 0 3px var(--good-soft); }
.steps .step { transition: background .12s ease; }
.steps .step:hover { background: var(--surface-3); }
.drawer { box-shadow: -8px 0 30px rgba(16,24,40,.12); }
.msg.ai { box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { .kpi:hover { transform: none; } }
.live-geo-map.svg-fallback { display: block; }
.live-geo-map.svg-fallback svg { display: block; width: 100%; height: 100%; }

/* ═══ Card hover explanations ═══ */
.card-h[data-explain] { cursor: help; }
.ex-i {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 700; font-style: italic; font-family: var(--font-head);
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--line-2);
  opacity: 0; transition: opacity .14s ease, background .14s ease, color .14s ease;
}
.card-h:hover .ex-i { opacity: 1; }
.card-h[data-explain]:hover .ex-i { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.explainer {
  position: fixed; z-index: 70; max-width: 380px; pointer-events: none;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 8px;
  box-shadow: 0 4px 10px rgba(16,24,40,.10), 0 16px 40px rgba(16,24,40,.18);
  padding: 10px 12px; opacity: 0; transform: translateY(-3px);
  transition: opacity .13s ease, transform .13s ease;
}
.explainer.on { opacity: 1; transform: none; }
.explainer .xt {
  font-family: var(--font-head); font-weight: 600; font-size: 12px; color: var(--accent);
  display: flex; align-items: center; gap: 6px; margin-bottom: 5px;
}
.explainer .xt::before {
  content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--accent); flex: none;
}
.explainer .xb { font-size: 11.5px; line-height: 1.55; color: var(--ink-2); }
@media (max-width: 760px) { .explainer { max-width: 260px; } }
.kpi[data-explain] { cursor: help; }
.kpi[data-explain]::after {
  content: "i"; position: absolute; top: 6px; right: 7px;
  width: 12px; height: 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 700; font-style: italic; font-family: var(--font-head);
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--line-2);
  opacity: 0; transition: opacity .14s ease; pointer-events: none;
}
.kpi[data-explain]:hover::after { opacity: 1; background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

/* ═══ Nestlé module chrome ═══ */

.jump-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.jump { display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; cursor: pointer; box-shadow: var(--shadow); }
.jump:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.jump svg { width: 16px; height: 16px; stroke: var(--brand-red); fill: none; stroke-width: 1.8; flex: none; }
.jump b { display: block; font-size: 11.5px; }
.jump i { font-style: normal; font-size: 10.5px; color: var(--muted); }
@media (max-width: 1100px) { .jump-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .jump-row { grid-template-columns: repeat(2, 1fr); } }

.pain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1100px) { .pain-grid { grid-template-columns: 1fr; } }
.pain-tile { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 11px 12px; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; min-height: 168px; }
.pain-tile:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.pain-tile.crit { border-left: 3px solid var(--crit); }
.pain-tile.serious { border-left: 3px solid var(--serious); }
.pain-tile.warn { border-left: 3px solid var(--warn); }
.pain-tile.info { border-left: 3px solid var(--s1); }
.pain-tile .pt-top { display: flex; justify-content: space-between; align-items: center; }
.pain-tile b { font-size: 13px; letter-spacing: -.01em; }
.pain-tile .pt-m { font-family: var(--font-head); font-size: 15px; color: var(--accent); }
.pain-tile .pt-w { font-size: 10.5px; color: var(--muted); }
.pain-tile p { margin: 4px 0 0; font-size: 11.5px; color: var(--ink-2); line-height: 1.45; }
.pain-tile .pt-n { margin-top: auto; padding-top: 8px; font-size: 11px; color: var(--ink); border-top: 1px dashed var(--line); }

.pain-mini { display: flex; flex-direction: column; }
.pain-mini-row { display: grid; grid-template-columns: 8px 1fr; gap: 9px; align-items: start; padding: 8px 11px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; width: 100%; }
.pain-mini-row:hover { background: var(--surface-2); }
.pain-mini-row .m { color: var(--muted); font-size: 11px; }

.fac-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.fac-tile { border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; background: var(--surface-2); }
.fac-tile.cmd { border-color: var(--brand-red); background: color-mix(in srgb, var(--brand-red) 10%, var(--surface)); }
.fac-tile.plan { opacity: .7; border-style: dashed; }
.fac-tile b { display: block; font-size: 12px; }

.chan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 1100px) { .chan-grid { grid-template-columns: repeat(2, 1fr); } }
.chan-tile { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--surface-2); }
.chan-tile .v { font-family: var(--font-head); font-size: 26px; line-height: 1; margin: 4px 0; }
.chan-tile .v small { font-size: 13px; color: var(--muted); }
.chan-tile p { margin: 6px 0 8px; font-size: 11px; color: var(--ink-2); min-height: 44px; }
.chan-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chan-inline b { font-family: var(--font-head); font-size: 20px; display: block; }

.sla-rules { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
@media (max-width: 1100px) { .sla-rules { grid-template-columns: repeat(3, 1fr); } }
.sla-rule { border: 1px solid var(--line); border-radius: 7px; padding: 8px 9px; background: var(--surface-2); }
.sla-rule b { display: block; font-size: 13px; margin: 2px 0; }
.sla-rule.ok { border-left: 3px solid var(--good); }
.sla-rule.bad { border-left: 3px solid var(--crit); }
.sla-clocks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.sla-clock { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--surface-2); }
.sla-clock b { display: block; font-size: 14px; }
.sla-clock.ok { border-left: 3px solid var(--good); }
.sla-clock.bad { border-left: 3px solid var(--crit); }
.veh-detail { font-size: 11.5px; }

.cost-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cost-col { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.cost-col b { display: block; font-family: var(--font-head); font-size: 22px; line-height: 1.1; margin: 4px 0 2px; }
.cost-col.good { border-left: 3px solid var(--good); }
.cost-col.bad { border-left: 3px solid var(--crit); }
.cost-col ul { margin: 8px 0 0; padding-left: 16px; font-size: 11.5px; color: var(--ink-2); }
.loop-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.loop-steps li { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; background: var(--surface-2); }
.loop-steps b { display: block; margin-bottom: 2px; }
.loop-steps span { font-size: 11.5px; color: var(--ink-2); }
.fact-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .fact-grid { grid-template-columns: repeat(2, 1fr); } .cost-split { grid-template-columns: 1fr; } }
.fact { border: 1px solid var(--line); border-radius: 7px; padding: 8px 9px; background: var(--surface-2); }
.fact b { display: block; font-family: var(--font-head); font-size: 18px; margin: 2px 0; }
.fact i, .fact em { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); }
.int-cell { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.int-cell.good { background: color-mix(in srgb, var(--good) 18%, var(--surface)); color: var(--good); }
.int-cell.warn { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }
.int-cell.crit { background: color-mix(in srgb, var(--crit) 16%, var(--surface)); color: var(--crit); }
.int-pills { display: grid; gap: 6px; margin-top: 8px; }
.int-pills span { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; }
.int-tbl th { white-space: nowrap; }

.plan-shell { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .plan-shell { grid-template-columns: 1fr; } }
.plan-rail { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.plan-nav { text-align: left; border: 0; background: transparent; color: var(--ink-2); font-size: 12px; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.plan-nav:hover { background: var(--surface-2); color: var(--ink); }
.plan-nav.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.plan-body .card { margin-bottom: 10px; }
.plan-body .lead { font-size: 13px; line-height: 1.5; color: var(--ink-2); margin: 0; }
.dev-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1100px) { .dev-grid { grid-template-columns: 1fr; } }
.dev-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.dev-card h4 { margin: 2px 0 8px; font-size: 15px; }
.dev-card.offline { border-top: 3px solid var(--warn); }
.dev-card.online { border-top: 3px solid var(--s1); }
.dev-card.fixed { border-top: 3px solid var(--good); }
.dev-card p { margin: 0 0 6px; }
.phase-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1100px) { .phase-grid { grid-template-columns: 1fr; } }
.phase { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.phase ul { margin: 8px 0 0; padding-left: 16px; font-size: 11.5px; color: var(--ink-2); }
.join-grid { display: grid; gap: 7px; }
.join-step { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; background: var(--surface-2); }
.join-step b { display: block; margin-bottom: 2px; }
.join-step span { font-size: 11.5px; color: var(--ink-2); }
.best-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .best-grid { grid-template-columns: 1fr; } }
.best-tile { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.best-tile .num { font-family: var(--font-head); font-size: 11px; color: var(--accent); }
.best-tile b { display: block; margin: 2px 0 4px; }
.best-tile p { margin: 0; font-size: 11.5px; color: var(--ink-2); }

.sim-page { display: grid; gap: 10px; }
.sim-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .sim-inputs { grid-template-columns: 1fr; } }
.sim-in { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); box-shadow: var(--shadow); }
.sim-in.off { border-top: 3px solid #e8a317; }
.sim-in.on { border-top: 3px solid #4a7dff; }
.sim-in.fix { border-top: 3px solid #3ecf8e; }
.sim-in-h { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; }
.sim-in-h i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sim-in-row { display: flex; align-items: baseline; gap: 6px; }
.sim-in-row input { width: 100%; font-family: var(--font-head); font-size: 36px; font-weight: 600; border: 0; background: transparent; color: var(--ink); padding: 0; }
.sim-in-row b { font-size: 20px; color: var(--muted); }
.sim-mix { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.sim-mix input { width: 52px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--ink); padding: 3px 6px; font-size: 12px; }
.sim-stepper { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sim-pill { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; cursor: pointer; min-width: 72px; text-align: left; }
.sim-pill span { display: block; font-size: 10px; color: var(--muted); }
.sim-pill b { display: block; font-family: var(--font-head); font-size: 16px; }
.sim-pill i { font-style: normal; font-size: 10px; color: var(--muted); }
.sim-pill.on { border-color: var(--accent-line); background: var(--accent-soft); }
.sim-pill.done { opacity: .7; }
.sim-nav { display: flex; gap: 6px; margin-left: auto; }
.sim-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 900px) { .sim-kpis { grid-template-columns: 1fr 1fr; } .sim-nav { margin-left: 0; width: 100%; } }
.sim-kpi { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); }
.sim-kpi span { font-size: 11px; color: var(--muted); }
.sim-kpi b { display: block; font-family: var(--font-head); font-size: 26px; line-height: 1.1; }
.sim-kpi b small { font-size: 14px; color: var(--muted); }
.sim-kpi i { font-style: normal; font-size: 11px; color: var(--ink-2); }
.sim-kpi.net { border-left: 3px solid var(--brand-red); }
.sim-charts { display: grid; grid-template-columns: 1.4fr .8fr; gap: 10px; }
@media (max-width: 1100px) { .sim-charts { grid-template-columns: 1fr; } }
.sim-chart-card, .sim-flow-card, .sim-story { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); box-shadow: var(--shadow); }
#sim-lines, #sim-bars, #sim-flow { width: 100%; min-height: 118px; }
.sim-story p { margin: 8px 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.sim-story ul { margin: 0; padding-left: 18px; font-size: 12px; color: var(--ink-2); }
.sim-story-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ═══ 3D plants + Nestlé container chrome ═══ */
.plant-pick { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.plant-pick.tight { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.plant-chip { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 7px; cursor: pointer; box-shadow: var(--shadow); min-width: 0; font: inherit; color: inherit; }
.plant-chip:hover, .plant-chip.on { border-color: var(--accent-line); background: var(--accent-soft); }
.plant-chip.plan { opacity: .72; border-style: dashed; }
.plant-chip b { display: block; font-size: 12px; }
.plant-chip i { display: block; font-style: normal; font-size: 10px; color: var(--muted); }
.plant-chip span { display: none; }
@media (max-width: 1100px) { .plant-pick, .plant-pick.tight { grid-template-columns: repeat(3, 1fr); } .plant-chip span { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; } }

.sku-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; padding: 1px 6px 1px 5px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.sku-chip::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--c, #9aa3b2); }
.sku-chip.mini { font-size: 10px; padding: 0 5px 0 4px; }
.sku-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sku-card { border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; background: var(--surface-2); }
.sku-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sku-plants { display: flex; flex-wrap: wrap; gap: 4px; }
.sku-plants .tag.on { border-color: var(--brand-red); color: var(--brand-red); }
@media (max-width: 900px) { .sku-grid { grid-template-columns: 1fr; } }

.plant-lbl, .plant-sign, .plant-sub { pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.65); backface-visibility: visible; background: rgba(12,16,24,.72) !important; color: #fff !important; text-align: center; border-radius: 3px; }
.plant-sign { font-size: 10px; font-weight: 700; letter-spacing: .02em; text-transform: none; }
.plant-sub { font-size: 8px; color: #d7deea !important; text-transform: none; font-weight: 500; }
.rm-list { margin: 0; padding-left: 16px; font-size: 12px; color: var(--ink-2); }
.rm-list li { margin: 3px 0; }
.linkish { border: 0; background: none; padding: 0; color: inherit; cursor: pointer; font: inherit; text-align: left; }
.linkish:hover { color: var(--accent); }
button.fac-tile { cursor: pointer; width: 100%; text-align: left; font: inherit; color: inherit; }

/* ═══ Live map · deck.gl engine chrome ═══ */
.deck-wrap { height: min(82vh, 820px); min-height: 600px; background: #080d18; }
.map-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; font-size: 11.5px; }
.map-toolbar .seg button.on { background: color-mix(in srgb, var(--brand-red) 14%, var(--surface)); color: var(--brand-red); }
.map-chips-card .card-b { padding: 8px 10px; }
.map-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 1100px) { .map-chips { grid-template-columns: repeat(2, 1fr); } }
.map-chip { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 9px; cursor: pointer; font: inherit; color: inherit; border-left-width: 3px; transition: transform .1s ease, border-color .12s ease; }
.map-chip:hover { transform: translateY(-1px); border-color: var(--accent-line); }
.map-chip.on { background: var(--accent-soft); border-color: var(--accent); }
.map-chip.crit { border-left-color: var(--crit); } .map-chip.warn { border-left-color: var(--warn); } .map-chip.good { border-left-color: var(--good); } .map-chip.info { border-left-color: var(--s1); }
.map-chip b { display: block; font-size: 12px; letter-spacing: -.01em; }
.map-chip i { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-fly-btn.on { border-color: #e8611a; box-shadow: inset 0 0 0 1px #e8611a; }
.map-layers { width: 236px; max-height: calc(100% - 20px); display: flex; flex-direction: column; z-index: 8; }
.map-layers h4 { display: flex; align-items: center; gap: 8px; }
.map-layers h4 span:first-child { flex: 1; }
.map-layers .btn { border-color: #3a4a75; background: transparent; color: #dfe6f7; }
.map-layer-list { overflow: auto; flex: 1; padding: 4px 0; }
.map-layer-g { padding: 7px 10px 2px; color: #7f90b3; }
.map-layer { font-size: 10.5px; padding: 3px 10px; }
.map-layers.closed .map-layer-list, .map-layers.closed .map-source { display: none; }
.map-layers.closed { width: auto; }
.map-stats { z-index: 8; }
.map-stat b { font-size: 15px; }
.map-insp { position: absolute; top: 52px; right: 10px; width: 292px; max-height: calc(100% - 118px); overflow: auto; background: rgba(15, 20, 36, .94); border: 1px solid #2a3654; border-radius: 8px; color: #dfe6f7; font-size: 11px; padding: 9px 11px 10px; display: none; z-index: 9; backdrop-filter: blur(5px); box-shadow: 0 14px 38px rgba(0, 0, 0, .45); }
.map-insp.on { display: block; }
.map-insp .mi-h { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.map-insp .mi-h > div { flex: 1; min-width: 0; }
.map-insp .mi-h b { font-size: 12.5px; color: #fff; }
.map-insp .mi-h .xs { color: #9fb0d0; }
.map-insp .btn { border-color: #3a4a75; background: transparent; color: #dfe6f7; }
.map-insp .btn.primary { background: #e8611a; border-color: #e8611a; color: #fff; }
.map-insp .mi-pills { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.map-insp .mi-kv { grid-template-columns: 74px 1fr; gap: 3px 8px; font-size: 10.5px; }
.map-insp .mi-kv dt { color: #9fb0d0; } .map-insp .mi-kv dd { color: #edf3ff; }
.map-insp .mi-kv .bar { background: #253052; } .map-insp .mi-kv .bar > i { background: #4fd1c5; }
.map-insp .mi-sub { margin: 6px 0 2px; font-size: 10.5px; color: #dfe6f7; }
.map-insp .mi-spark, .map-insp .mi-bars, .map-insp .mi-gauge { margin: 4px 0 2px; }
.map-insp .mi-list { display: grid; gap: 2px; margin-top: 6px; }
.map-insp .mi-row { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 6px; align-items: center; width: 100%; text-align: left; border: 1px solid #253052; background: rgba(255, 255, 255, .03); color: inherit; font: inherit; font-size: 10.5px; padding: 3px 6px; border-radius: 5px; cursor: pointer; }
.map-insp .mi-row:hover { background: rgba(255, 255, 255, .08); }
.map-insp .mi-acts { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.map-insp .tag { background: #253052; border-color: #3a4a75; color: #dfe6f7; }
.map-insp .sku-chip { background: #1b2340; border-color: #3a4a75; color: #edf3ff; }
.map-legend-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; bottom: 52px; left: 10px; right: auto; max-width: 420px; z-index: 7; }
.lg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.lg-col { display: inline-block; width: 7px; height: 12px; background: linear-gradient(180deg, #3ecf8e, #ff5b5b); margin-right: 7px; vertical-align: -2px; border-radius: 1px; }
.lg-line { display: inline-block; width: 14px; height: 3px; margin-right: 6px; vertical-align: 2px; border-radius: 2px; }
.lg-ring { display: inline-block; width: 9px; height: 9px; border: 2px solid; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.deck-wrap .map-time { left: 10px; right: 10px; z-index: 7; }
.deck-wrap .map-time .btn { border-color: #3a4a75; background: transparent; color: #dfe6f7; min-width: 28px; justify-content: center; }
.kepler-wrap .map-layers, .kepler-wrap .map-legend, .kepler-wrap .map-time, .kepler-wrap .map-insp { display: none !important; }
@media (max-width: 1100px) { .map-legend-2 { display: none; } .map-layers { width: 200px; } .map-insp { width: 250px; } }

/* ═══ 3D yard v2 ═══ */
#scene-yard { background: radial-gradient(ellipse at 50% 70%, #6b7482, #3b424c 72%); border-color: #2b3440; }
#scene-yard .face { transition: opacity .18s ease; }
#scene-yard [data-dim] { opacity: .22; }
.y3-flat, .y3-sign { backface-visibility: visible; font-family: var(--font-mono); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: center; white-space: nowrap; overflow: hidden; pointer-events: none; }
.y3-flat { font-size: 9px; color: #1b2230; background: transparent !important; }
.y3-flat.road { color: #f2e6b8; font-size: 8px; }
.y3-flat.dock { color: #fff8e0; font-size: 8px; }
.y3-flat.zone { font-size: 9.5px; color: #10161f; }
.y3-flat.zone.on { color: #0F62D0; }
.y3-flat.zone.sub { font-size: 7px; color: #3a4452; letter-spacing: .04em; }
.y3-sign { font-size: 8.5px; color: #fff; background: rgba(16, 22, 32, .86) !important; border: 1px solid rgba(255, 255, 255, .22); border-radius: 3px; line-height: 1.15; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.y3-sign.title { font-size: 9.5px; letter-spacing: .12em; background: rgba(218, 41, 28, .92) !important; border-color: rgba(255, 255, 255, .35); }
.y3-sign.band { font-size: 7.5px; letter-spacing: .08em; background: rgba(12, 42, 58, .92) !important; border-color: #4fd1c5; color: #cffcf6; }
.y3-sign.band.dry { background: rgba(40, 44, 52, .9) !important; border-color: #8a93a8; color: #e2e6ee; }
.y3-sign.temp { text-transform: none; letter-spacing: 0; }
.y3-sign.temp b { font-size: 11px; line-height: 1.1; }
.y3-sign.temp small { font-size: 6.5px; opacity: .85; text-transform: uppercase; letter-spacing: .05em; }
.y3-sign.temp.good { border-color: #3ecf8e; } .y3-sign.temp.warn { border-color: #ffc24a; background: rgba(90, 60, 10, .92) !important; } .y3-sign.temp.crit { border-color: #ff5b5b; background: rgba(110, 30, 30, .92) !important; }
.y3-sign.cold { font-size: 8px; background: rgba(20, 40, 90, .92) !important; border-color: #7ab4ff; color: #dbeaff; text-transform: none; }
.y3-sign.id { font-size: 7px; letter-spacing: .08em; background: rgba(16, 22, 32, .78) !important; }
.yard-cams { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.y3-legend { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 8px; font-size: 10.5px; color: var(--ink-2); }
.y3-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ═══ Per-module D3 rows ═══ */
.d3mod-row { margin: 0 0 10px; }
.d3mod-card { align-self: stretch; }
.d3mod-card .card-b { padding: 6px 8px 8px; position: relative; }
.d3mod { position: relative; min-height: 260px; }
.d3mod svg.d3m-svg { display: block; }
.d3mod-cap { font-size: 10.5px; color: var(--muted); line-height: 1.4; margin-top: 4px; padding: 0 2px; }
.d3mod-tip { position: absolute; pointer-events: none; z-index: 6; max-width: 240px; padding: 6px 8px; border-radius: 5px; background: rgba(9, 14, 27, .96); color: #edf3ff; border: 1px solid #40537d; font-size: 11px; line-height: 1.45; opacity: 0; transform: translateY(4px); transition: opacity .1s ease, transform .1s ease; white-space: normal; }
.d3mod-tip.on { opacity: 1; transform: none; }
.card.d3mod-card .card-h .sub { font-family: var(--font-mono); font-size: 10px; }

/* ─── Eshaan additions ───────────────────────────────────── */
.jump-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1300px) { .jump-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.route-map { height: min(74vh, 700px); min-height: 480px; background: #080d18; border-radius: 6px; overflow: hidden; position: relative; }
.route-map .maplibregl-popup-content { background: #0f1424; color: #e8edf9; border: 1px solid #2a3654; font: 11px var(--font-ui); border-radius: 6px; padding: 8px 10px; }
.route-map .maplibregl-popup-tip { border-top-color: #0f1424 !important; }
.route-map .maplibregl-ctrl-group { background: #0f1424; border: 1px solid #2a3654; }
.route-map .maplibregl-ctrl-group button { filter: invert(1); }
.map-panel.rm-panel { width: 190px; }
.map-legend.rm-legend { bottom: 12px; }
.decision { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.decision > div { border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; background: var(--surface-2); font-size: 11.5px; }
.decision > div.rec { border-color: var(--good); background: var(--good-soft); }
.decision b.h { display: block; font-size: 12px; margin-bottom: 3px; }
.decision .amt { font-family: var(--font-head); font-size: 20px; font-weight: 600; margin: 3px 0; }
.decision ul { margin: 4px 0 0; padding-left: 14px; color: var(--ink-2); }
.loss-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.loss-col { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.loss-col h4 { font-family: var(--font-ui); font-size: 11.5px; padding: 7px 10px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.loss-col.c h4 { background: var(--crit-soft); color: var(--crit-text); }
.loss-col.u h4 { background: var(--surface-2); color: var(--ink-2); }
.loss-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 11.5px; align-items: center; }
.loss-row:last-child { border-bottom: 0; }
.loss-row .m { color: var(--muted); font-size: 10.5px; grid-column: 1 / -1; }
.sim-grid { display: grid; grid-template-columns: 300px 1fr; gap: 10px; }
@media (max-width: 1100px) { .sim-grid { grid-template-columns: 1fr; } }
.sim-ctl { display: grid; grid-template-columns: 1fr; gap: 9px; }
.sim-ctl label { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 11px; color: var(--ink-2); }
.sim-ctl label b { font-family: var(--font-mono); color: var(--ink); font-weight: 500; }
.sim-ctl input[type=range] { grid-column: 1 / -1; width: 100%; }
.var-tbl td.pos { color: var(--crit-text); font-weight: 600; } .var-tbl td.neg { color: var(--good-text); font-weight: 600; }
.bay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 8px; }
.bay { border: 1px solid var(--line); border-radius: 7px; padding: 8px 9px; background: var(--surface-2); font-size: 11px; cursor: pointer; text-align: left; }
.bay.sel { border-color: var(--accent); background: var(--accent-soft); }
.bay .bh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.bay .bh b { font-family: var(--font-head); font-size: 13px; }
.bay .bar { margin-top: 5px; }
.vin { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .02em; }
.face { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--surface-3), var(--accent-soft)); border: 1px solid var(--line-2); align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: var(--ink-2); flex: none; }
.profile-h { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.profile-h .face { width: 40px; height: 40px; font-size: 14px; }
.tyre-map { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.tyre-map i { display: block; aspect-ratio: 1 / 1.6; border-radius: 4px; background: var(--surface-3); position: relative; }
.tyre-map i.n { background: var(--s1); } .tyre-map i.r1 { background: var(--s3); } .tyre-map i.r2 { background: var(--s4); } .tyre-map i.low { background: var(--crit); }
.contract { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.contract h4 { font-family: var(--font-head); font-size: 15px; margin-bottom: 4px; }
.tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tile { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; background: var(--surface); }
.tile .cap { display: block; margin-bottom: 2px; }
.tile b { font-family: var(--font-head); font-size: 18px; }

/* ─── Clocks · wall · registers ─────────────────────────────── */
.clk { font-family: var(--font-mono); font-size: 11px; white-space: nowrap; }
.clk.ok { color: var(--good-text); } .clk.soon { color: var(--warn-text); } .clk.over { color: var(--crit-text); font-weight: 600; }
@keyframes blink { 50% { opacity: .25; } }
tr.blink .clk.over, .pane-row.blink .clk.over { animation: blink 1s step-end infinite; }
tr.blink td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.wall { background: #05070c; color: #dfe6f7; border-radius: 8px; padding: 10px; }
.wall-h { display: flex; align-items: center; gap: 14px; padding: 4px 6px 10px; font-family: var(--font-head); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: #9fb0d0; }
.wall-h b { color: #fff; font-size: 15px; } .wall-h .spacer { flex: 1; } .wall-h .red { color: #ff6b6b; }
.wall-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1400px) { .wall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pane { background: #0b1020; border: 1px solid #1f2a44; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; min-height: 300px; }
.pane-h { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid #1f2a44; font-size: 12px; font-weight: 600; color: #fff; }
.pane-h .ic { font-size: 15px; } .pane-h .sub { color: #7d8db0; font-weight: 400; font-size: 10.5px; } .pane-h .n { margin-left: auto; font-family: var(--font-head); font-size: 20px; color: #ffd166; }
.pane table { width: 100%; border-collapse: collapse; font-size: 11px; }
.pane th { text-align: left; color: #7d8db0; font-weight: 600; font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; padding: 4px 8px; border-bottom: 1px solid #1f2a44; }
.pane td { padding: 4px 8px; border-bottom: 1px solid #141c30; white-space: nowrap; color: #dfe6f7; vertical-align: middle; }
.pane td.rem { color: #9fb0d0; white-space: normal; max-width: 220px; font-size: 10.5px; }
.pane tr.blink td:first-child { box-shadow: inset 3px 0 0 #ff4d4d; }
.pane .clk.ok { color: #4ade80; } .pane .clk.soon { color: #ffd166; } .pane .clk.over { color: #ff6b6b; }
.pane-f { margin-top: auto; padding: 5px 10px; border-top: 1px solid #1f2a44; font-size: 10.5px; color: #7d8db0; }
.wall-note { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.wall-note > div { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 11px; background: var(--surface-2); }
.wall-note b { display: block; margin-bottom: 3px; }
.stage-row { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; margin-bottom: 10px; }
.stage-cell { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--surface); text-align: center; font-size: 10.5px; color: var(--muted); }
.stage-cell b { display: block; font-family: var(--font-head); font-size: 18px; color: var(--ink); } .stage-cell .ov { color: var(--crit-text); font-weight: 600; }
.card-dark { background: #0b1020 !important; color: #dfe6f7; border-color: #1f2a44 !important; }
.daily { background: #e7f6e3; color: #1b2a12; border-radius: 10px; padding: 12px 14px; font-size: 12px; max-width: 420px; line-height: 1.55; box-shadow: var(--shadow); }
.daily b.h { display: block; font-size: 13px; margin-bottom: 4px; } .daily ol { margin: 4px 0 0; padding-left: 18px; } .daily .q { background: #dcf8c6; border-radius: 8px; padding: 6px 9px; margin-top: 8px; display: inline-block; } .daily .a { background: #fff; border-radius: 8px; padding: 6px 9px; margin-top: 6px; }
:root:not([data-theme="light"]) .daily, :root[data-theme="dark"] .daily { background: #1f2a1a; color: #e6f2dd; } :root[data-theme="dark"] .daily .q { background: #2c4a25; } :root[data-theme="dark"] .daily .a { background: #263043; }
.chat { display: flex; flex-direction: column; gap: 8px; }
.chat .u, .chat .a { max-width: 92%; padding: 8px 10px; border-radius: 9px; font-size: 11.5px; line-height: 1.5; }
.chat .u { align-self: flex-end; background: var(--accent); color: var(--accent-ink); } .chat .a { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); }
.chat .meta { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 4px; }
.wave-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.wave { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: var(--surface-2); font-size: 11px; }
.wave.live { border-color: var(--good); background: var(--good-soft); } .wave.build { border-color: var(--accent-line); background: var(--accent-soft); }
.wave b { display: block; font-size: 13px; } .wave ul { margin: 5px 0 0; padding-left: 14px; color: var(--ink-2); }
.mx { display: grid; gap: 3px; } .mx-row { display: grid; gap: 3px; align-items: center; } .mx-cell { height: 22px; border-radius: 3px; font-size: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; }
.mx-cell.earn { background: var(--s3); } .mx-cell.loss { background: var(--crit); } .mx-cell.thin { background: var(--axis); color: var(--ink); }
.spread { display: flex; gap: 2px; align-items: flex-end; height: 40px; }
.spread i { flex: 1; background: var(--s1); border-radius: 2px 2px 0 0; min-width: 2px; }
.lf-tile { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; background: var(--surface); }
