/* ==========================================================================
   感染症ダッシュボード（staging） — dark instrument panel, amber data accents
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #07090c;
  --bg-2: #0a0d11;
  --panel: #0e1217;
  --panel-2: #131920;
  --panel-3: #19202a;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --line-3: rgba(255, 255, 255, 0.22);
  --text: #f1ede4;
  --text-2: #bdb7aa;
  --muted: #858074;
  --amber: #ffb547;
  --amber-2: #ff7a1a;
  --gold: #ffd688;
  --grad: linear-gradient(120deg, #ff7a1a 0%, #ffb547 55%, #ffd688 100%);
  --hue-cyan: #4fc3dc;
  --hue-amber: #ffb547;
  --hue-rose: #f07a8f;
  --zero: #24405a;
  --zero-ink: #8fb6d8;
  --null-ink: #9aa1ab;
  --conflict: #8a7de6;
  --ok: #45c98a;
  --danger: #ff6b5b;
  --warn: #ffcf5a;
  --radius: 2px;
  --radius-lg: 6px;
  --side-w: 284px;
  --ctx-h: 60px;
  --font: "IBM Plex Sans JP", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 122, 26, 0.07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(79, 195, 220, 0.05), transparent 60%);
  background-attachment: fixed;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pad { padding: 12px 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--amber); color: #000; padding: 6px 10px; z-index: 100; }
.skip:focus { left: 8px; }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); padding: 1px 5px; color: var(--text-2); border-radius: var(--radius); }
.ic { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.rot90 svg { transform: rotate(90deg); }

/* ------------------------------------------------------------------ boot */
#boot { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; gap: 16px; background: var(--bg); transition: opacity 0.5s var(--ease), visibility 0.5s; }
#boot.done { opacity: 0; visibility: hidden; }
.boot-line { stroke-dasharray: 220; stroke-dashoffset: 220; animation: draw 1.6s var(--ease) infinite; }
.boot-text { color: var(--muted); font-size: 12px; text-align: center; letter-spacing: 0.08em; }
@keyframes draw { 0% { stroke-dashoffset: 220; } 60% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -220; } }

/* ------------------------------------------------------------------ layout */
#app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
#side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, #0b0f14, #080a0d);
  border-right: 1px solid var(--line);
  padding: 16px 14px 20px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin; scrollbar-color: #2a3139 transparent;
}
#main { min-width: 0; display: flex; flex-direction: column; }
#view { padding: 18px 22px 60px; outline: none; flex: 1; min-width: 0; }
.scrim { display: none; }

/* ------------------------------------------------------------------ sidebar */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark svg { display: block; }
.bm-line { stroke-dasharray: 60; stroke-dashoffset: 60; animation: bm 1.2s 0.3s var(--ease) forwards; }
@keyframes bm { to { stroke-dashoffset: 0; } }
.brand-title { font-weight: 700; font-size: 15px; letter-spacing: 0.02em; }
.brand-sub { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.icon-btn.side-close { margin-left: auto; display: none; }
.staging-flag {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  border: 1px solid rgba(255, 181, 71, 0.35);
  background: linear-gradient(90deg, rgba(255, 122, 26, 0.12), rgba(255, 181, 71, 0.03));
  font-size: 12px; line-height: 1.45;
}
.staging-flag b { display: block; color: var(--gold); font-weight: 600; }
.staging-flag span { color: var(--text-2); }
.staging-flag .dot { width: 8px; height: 8px; margin-top: 5px; flex: none; background: var(--amber); box-shadow: 0 0 0 0 rgba(255, 181, 71, 0.7); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 181, 71, 0.6); } 80%, 100% { box-shadow: 0 0 0 10px rgba(255, 181, 71, 0); } }
.home-card {
  position: relative; text-align: left; border: 1px solid var(--line-2); background: var(--panel);
  padding: 12px 36px 12px 14px; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.home-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad); }
.home-card:hover { border-color: var(--line-3); background: var(--panel-2); }
.hc-label { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.hc-name { font-size: 20px; font-weight: 700; line-height: 1.2; margin: 2px 0; }
.hc-meta { font-size: 12px; color: var(--text-2); font-family: var(--mono); }
.hc-chev { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 10px; text-decoration: none; color: var(--text-2);
  border: 1px solid transparent; transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }
.nav-item.on { background: linear-gradient(90deg, rgba(255, 181, 71, 0.12), transparent); color: var(--text); border-color: var(--line); }
.nav-item.on::before { content: ""; position: absolute; left: -1px; top: 6px; bottom: 6px; width: 2px; background: var(--amber); }
.nav-item.on .ic { color: var(--amber); }
.ni-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ni-label { font-weight: 500; font-size: 13.5px; }
.ni-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-count { margin-left: auto; font-family: var(--mono); font-size: 11px; padding: 1px 7px; background: var(--amber); color: #1a1003; font-weight: 600; }
.side-section { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.side-h { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.08em; color: var(--muted); }
.side-note { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.side-note.warn { color: var(--warn); }
.ls-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); }
.ls-row.small { font-size: 11.5px; }
.ls-row.err { color: var(--danger); }
.ls-row.ok { color: var(--ok); }
.spin::before { content: ""; display: inline-block; width: 8px; height: 8px; border: 1.5px solid var(--amber); border-right-color: transparent; border-radius: 50%; margin-right: 6px; animation: spin 0.8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pbar { height: 3px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--grad); transition: width 0.5s var(--ease); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.kv span:last-child { color: var(--text-2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-hint { margin-top: 8px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line-2); color: var(--text-2); cursor: pointer; font-size: 12.5px; }
.cmd-hint kbd { margin-left: auto; }
.cmd-hint:hover { border-color: var(--line-3); color: var(--text); }

/* ------------------------------------------------------------------ context bar */
#ctxbar {
  position: sticky; top: 0; z-index: 20; min-height: var(--ctx-h);
  display: flex; align-items: center; gap: 12px; padding: 10px 22px;
  background: rgba(7, 9, 12, 0.78); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.icon-btn.menu-btn { display: none; }
.ctx-title { display: flex; align-items: baseline; gap: 10px; flex: none; }
.ctx-view { font-weight: 700; font-size: 16px; letter-spacing: 0.02em; }
.layer-tag { font-family: var(--mono); font-size: 11px; color: var(--warn); border: 1px solid rgba(255, 207, 90, 0.4); padding: 1px 6px; }
.ctx-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; min-width: 0; justify-content: flex-end; }
.search-btn { flex: none; }
.ctl {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px;
  background: var(--panel); border: 1px solid var(--line-2); cursor: pointer; white-space: nowrap; max-width: 100%;
  transition: border-color 0.18s, background 0.18s;
}
.ctl:hover { border-color: var(--line-3); background: var(--panel-2); }
.ctl.warn { border-color: rgba(255, 207, 90, 0.55); }
.ctl-k { font-size: 11px; color: var(--muted); }
.ctl-v { max-width: 260px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.ctl-pref .ic { color: var(--amber); }
.ctl-time { padding: 0 2px; gap: 0; cursor: default; }
.ctl-time .icon-btn { width: 30px; height: 30px; border: 0; background: transparent; }
.ctl-tv { background: none; border: 0; cursor: pointer; font-family: var(--mono); font-size: 12.5px; padding: 0 6px; display: inline-flex; align-items: center; gap: 6px; }
.latest-dot { width: 6px; height: 6px; background: var(--ok); border-radius: 50%; box-shadow: 0 0 8px var(--ok); }
.mini-link { background: none; border: 0; color: var(--gold); cursor: pointer; font-size: 12px; padding: 0 6px; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ controls */
.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; background: var(--panel); border: 1px solid var(--line-2);
  color: var(--text-2); cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s; flex: none;
}
.icon-btn:hover:not(:disabled) { color: var(--text); border-color: var(--line-3); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--line-2);
  background: var(--panel-2); cursor: pointer; white-space: nowrap; transition: all 0.18s var(--ease);
}
.btn:hover:not(:disabled) { border-color: var(--line-3); background: var(--panel-3); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--grad); color: #1b1004; border: 0; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 4px 0; color: var(--gold); cursor: pointer; font-size: 12.5px; }
.link-btn:hover span { text-decoration: underline; text-underline-offset: 3px; }
.link-btn .ic { transition: transform 0.2s var(--ease); }
.link-btn:hover .ic { transform: translateX(3px); }
.seg { display: inline-flex; border: 1px solid var(--line-2); background: var(--bg-2); padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg-btn {
  position: relative; border: 0; background: transparent; padding: 0 12px; height: 28px; cursor: pointer; color: var(--text-2); white-space: nowrap;
  transition: color 0.15s, background 0.2s;
}
.seg.sm .seg-btn { height: 28px; padding: 0 10px; font-size: 12.5px; }
.seg.xs .seg-btn { height: 22px; padding: 0 8px; font-size: 11.5px; }
.seg-btn:hover:not(:disabled) { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.seg-btn.on { background: var(--panel-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--amber); }
.seg-btn:disabled { color: #4c4b47; cursor: not-allowed; text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.18); }
.select, .input {
  height: 34px; background: var(--bg-2); border: 1px solid var(--line-2); padding: 0 10px; min-width: 0;
}
.select.small { height: 28px; font-size: 12.5px; }
.input:focus, .select:focus { border-color: var(--amber); outline: none; }
.inline-select { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.chip { height: 28px; padding: 0 12px; border: 1px solid var(--line-2); background: rgba(7, 9, 12, 0.72); color: var(--text-2); cursor: pointer; white-space: nowrap; backdrop-filter: blur(6px); transition: all 0.2s var(--ease); }
.chip:hover { color: var(--text); border-color: var(--line-3); }
.chip.on { color: #1b1004; background: var(--grad); border-color: transparent; font-weight: 600; }
.chip small { color: inherit; opacity: 0.7; font-family: var(--mono); font-size: 10.5px; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border: 1px solid var(--line-2); font-size: 11px; color: var(--text-2); white-space: nowrap; }
.tag.amber { border-color: rgba(255, 181, 71, 0.5); color: var(--gold); background: rgba(255, 181, 71, 0.08); }
.tag.ghost { border-style: dashed; }
.tag.link { cursor: pointer; background: none; color: var(--gold); }
.raw-chip { display: inline-block; font-size: 11.5px; padding: 1px 6px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-2); color: var(--text-2); white-space: pre-wrap; word-break: break-all; font-family: var(--font); cursor: default; }
button.raw-chip { cursor: pointer; }
.raw-chip.big { font-size: 14px; color: var(--text); padding: 2px 8px; }

/* states */
.st { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; font-size: 11.5px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.st-n { border-color: #525862; color: var(--null-ink); background: repeating-linear-gradient(135deg, rgba(100, 107, 118, 0.25) 0 3px, transparent 3px 6px); }
.st-m { border-style: dashed; color: var(--muted); }
.st-c { border-color: rgba(138, 125, 230, 0.6); color: #b8afff; background: rgba(138, 125, 230, 0.12); }
.st-u { border-style: dotted; color: var(--muted); }
.st-l { color: var(--muted); }
.st-z, .val.zero, .zero-tag, b.zero, .big.zero { color: var(--zero-ink); }
.zero-tag { font-family: var(--mono); border: 1px solid var(--zero); padding: 0 6px; }
.val { font-family: var(--mono); }

/* ------------------------------------------------------------------ panels */
.panel {
  position: relative; background: linear-gradient(180deg, var(--panel), #0c1015); border: 1px solid var(--line);
  display: flex; flex-direction: column; min-width: 0;
  transition: border-color 0.25s var(--ease);
}
.panel::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 1px; background: var(--accent-line, linear-gradient(90deg, rgba(255, 181, 71, 0.55), rgba(255, 181, 71, 0) 55%)); opacity: 0.8; }
.panel:hover { border-color: var(--line-2); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px 8px; flex-wrap: wrap; }
.panel-titles { min-width: 0; flex: 1 1 220px; }
.panel-title { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.02em; }
.panel-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.panel-sub b { color: var(--text-2); font-weight: 500; }
.panel-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.panel-body { padding: 4px 14px 14px; min-width: 0; flex: 1; }
.panel .icon-btn { width: 28px; height: 28px; }
.expand-layer { position: fixed; inset: 0; z-index: 60; background: rgba(3, 4, 6, 0.72); backdrop-filter: blur(6px); display: none; padding: 24px; }
.expand-layer.on { display: grid; animation: fade 0.25s var(--ease); }
.panel.expanded { width: 100%; height: 100%; overflow: auto; box-shadow: var(--shadow); animation: zoomIn 0.32s var(--ease); }
.panel.expanded .map-stage { height: calc(100vh - 200px) !important; }
@keyframes zoomIn { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }

.page-title { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: 0.01em; }
.lead { margin: 0; color: var(--text-2); max-width: 820px; }
.hint { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); padding: 10px 12px; border: 1px dashed var(--line-2); background: rgba(255, 214, 136, 0.03); }
.hint .ic { color: var(--gold); margin-top: 2px; }
.warn-line { display: flex; gap: 6px; align-items: flex-start; color: var(--warn); margin: 8px 0 0; }
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 30px 16px; color: var(--text-2); }
.empty-ic { color: var(--muted); }
.empty-title { font-weight: 600; color: var(--text); }
.empty p { margin: 0; max-width: 520px; font-size: 13px; }
.empty-actions { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.skeleton { color: var(--muted); padding: 16px 4px; font-size: 12.5px; }
.loading-hero { position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--panel); height: 220px; display: grid; place-content: center; color: var(--text-2); }
.loading-hero.small { height: 140px; }
.loading-hero p { margin: 0; position: relative; }
.scanline { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 181, 71, 0.12), transparent); transform: translateX(-100%); animation: scan 1.6s var(--ease) infinite; }
@keyframes scan { to { transform: translateX(100%); } }
.next-links { display: flex; gap: 18px; flex-wrap: wrap; padding: 4px 2px; }

/* ------------------------------------------------------------------ overview */
.ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hero {
  grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px;
  padding: 20px 22px; border: 1px solid var(--line); position: relative; overflow: hidden;
  background: radial-gradient(600px 240px at 0% 0%, rgba(255, 122, 26, 0.13), transparent 70%), linear-gradient(180deg, #0f141a, #0b0f13);
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--grad); opacity: 0.55; }
.hero-kicker { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); letter-spacing: 0.1em; }
.pulse-dot { width: 7px; height: 7px; background: var(--amber); border-radius: 50%; animation: ping 2s infinite; }
.hero-title { margin: 4px 0 2px; font-size: clamp(30px, 4vw, 46px); font-weight: 700; line-height: 1.1; letter-spacing: 0.02em; }
.hero-period { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: var(--mono); font-size: 15px; color: var(--gold); }
.hero-fresh { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.hero-fresh .ic { color: var(--muted); }
.focus-pick { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.focus-pick .select { max-width: 320px; }
.hero-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.frame-card { border: 1px dashed var(--line-2); padding: 12px; background: rgba(0, 0, 0, 0.18); display: flex; flex-direction: column; gap: 6px; }
.frame-card p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.fc-k { font-size: 12px; color: var(--text-2); }
.pinned { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pin-card {
  --hue: var(--hue-amber);
  position: relative; overflow: hidden; cursor: pointer; min-height: 238px; padding: 14px 16px 12px;
  border: 1px solid var(--line); background: linear-gradient(180deg, #10151b, #0b0f13);
  display: flex; flex-direction: column; gap: 4px;
  transition: transform 0.35s var(--ease), border-color 0.25s, box-shadow 0.35s;
  animation: rise 0.6s var(--ease) both;
}
.pin-card:nth-child(2) { animation-delay: 80ms; }
.pin-card:nth-child(3) { animation-delay: 160ms; }
.pin-card.hue-cyan { --hue: var(--hue-cyan); }
.pin-card.hue-rose { --hue: var(--hue-rose); }
.pin-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--hue), transparent 80%); }
.pin-card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); }
.pin-card.missing { cursor: default; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pc-bg { position: absolute; left: 0; right: 0; bottom: 56px; height: 96px; pointer-events: none; opacity: 0.55; -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%); mask-image: linear-gradient(90deg, transparent, #000 30%); }
.pc-bg svg { width: 100%; height: 100%; }
.pc-bg .spark { width: 100%; height: 100%; }
.pc-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pc-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.pc-label { position: relative; font-size: 11.5px; }
.pc-main { position: relative; display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.pc-num { font-size: clamp(40px, 4.2vw, 58px); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; text-shadow: 0 0 30px color-mix(in srgb, var(--hue) 35%, transparent); }
.pc-unit { color: var(--muted); font-size: 12px; }
.pc-where { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.pc-where b { color: var(--text); font-weight: 600; }
.delta { font-family: var(--mono); font-size: 12px; }
.delta.up { color: #ffa36b; }
.delta.down { color: #8fd3a9; }
.pc-dist { position: relative; margin-top: auto; }
.pc-counts { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--text-2); font-family: var(--mono); }
.c-zero { color: var(--zero-ink); }
.c-null { color: var(--null-ink); }
.c-conf { color: #b8afff; }
.pc-missing { color: var(--text-2); font-size: 12.5px; margin: 8px 0; }
.dotstrip { display: block; margin: 4px 0; }
.ds-axis { stroke: rgba(255, 255, 255, 0.12); }
.att-teaser .att-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.att-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.att-h .ic { color: var(--amber); }
.em-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; border: 1px solid var(--line); border-left: 2px solid var(--amber); background: rgba(255, 181, 71, 0.04); padding: 7px 10px; margin-bottom: 6px; cursor: pointer; transition: background 0.2s; }
.em-chip:hover { background: rgba(255, 181, 71, 0.09); }
.em-chip.warm { border-left-color: var(--amber-2); }
.em-chip span { font-size: 12px; color: var(--text-2); }
.scope-card .yr-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; height: 26px; }
.yr { background: rgba(255, 255, 255, 0.05); }
.yr.on { background: var(--grad); animation: grow 0.6s var(--ease) both; transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
.yr-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin: 3px 0 8px; }
.mini-dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0 0 8px; font-size: 12.5px; }
.mini-dl dt { color: var(--muted); }
.mini-dl dd { margin: 0; }
.strip-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 8px; }
.board-headrow, .board-row { display: grid; grid-template-columns: minmax(140px, 2.2fr) 120px 1.2fr 70px minmax(90px, 1fr) 76px; gap: 12px; align-items: center; }
.board-headrow { font-size: 11px; color: var(--muted); padding: 0 10px 6px; border-bottom: 1px solid var(--line); }
.board-list { max-height: 520px; overflow-y: auto; scrollbar-width: thin; }
.board-row { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 7px 10px; cursor: pointer; animation: rise 0.45s var(--ease) both; transition: background 0.18s; }
.board-row:hover { background: rgba(255, 255, 255, 0.03); }
.br-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-bar { height: 6px; background: rgba(255, 255, 255, 0.04); }
.br-bar i { display: block; height: 100%; background: var(--grad); }
.br-val { font-family: var(--mono); text-align: right; }
.br-area { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-trend { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.br-trend.up { color: #ffa36b; }
.br-trend.down { color: #8fd3a9; }
.tips-rotator { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); background: linear-gradient(90deg, rgba(255, 214, 136, 0.06), transparent); color: var(--text-2); font-size: 13px; overflow: hidden; }
.tips-rotator .ic { color: var(--gold); }

/* ------------------------------------------------------------------ charts */
.chart { width: 100%; min-width: 0; }
.lc-svg { display: block; overflow: visible; }
.grid line { stroke: rgba(255, 255, 255, 0.06); }
.grid line.base { stroke: rgba(255, 255, 255, 0.2); }
.grid .yearline { stroke: rgba(255, 255, 255, 0.1); stroke-dasharray: 2 3; }
.tick { fill: var(--muted); font-size: 10.5px; font-family: var(--mono); }
.markline { stroke: var(--gold); stroke-dasharray: 3 3; opacity: 0.7; }
.annot-line { stroke: #b8afff; stroke-dasharray: 5 4; opacity: 0.6; }
.annot-text { fill: #b8afff; font-size: 10.5px; }
.crosshair { stroke: rgba(255, 255, 255, 0.35); }
.series path.dim { opacity: 0.35; }
.rug-bg { fill: rgba(255, 255, 255, 0.025); }
.rug .r-val { opacity: 0.85; }
.rug .r-zero { fill: var(--zero); }
.rug .r-null { fill: #3d434c; }
.rug .r-conf { fill: var(--conflict); }
.rug .r-miss { fill: transparent; }
.empty-text { fill: var(--muted); font-size: 13px; }
.spark { display: block; }
.hs-label { fill: var(--text-2); font-size: 11px; }
.hs-label.hl { fill: var(--gold); font-weight: 600; }
.hs-cell { transition: opacity 0.2s; cursor: pointer; }
.hs-cell.miss { fill: transparent; stroke: rgba(255, 255, 255, 0.05); }
.hs-cell:hover { stroke: #fff; stroke-width: 1; }
.hs-mark { fill: none; stroke: var(--gold); stroke-width: 1.2; }
.legend { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; font-size: 11px; color: var(--text-2); }
.legend-ramp { position: relative; width: 220px; padding-bottom: 16px; }
.legend.compact .legend-ramp { width: 170px; }
.legend-bar { height: 8px; }
.legend-ticks span { position: absolute; top: 11px; transform: translateX(-50%); font-family: var(--mono); font-size: 10px; color: var(--muted); white-space: nowrap; }
.legend-ticks span:first-child { transform: none; }
.legend-ticks span:last-child { transform: translateX(-100%); }
.legend-states { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 14px; }
.lchip { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.lchip b { font-family: var(--mono); font-weight: 500; color: var(--muted); }
.sw { display: inline-block; width: 14px; height: 10px; border: 1px solid rgba(255, 255, 255, 0.15); }
.sw-zero { background: var(--zero); }
.sw-null { background: repeating-linear-gradient(135deg, #646b76 0 1.5px, #171b21 1.5px 4px); }
.sw-missing { background: #1e232b; border: 1px dashed rgba(160, 170, 185, 0.55); }
.sw-conflict { background: repeating-linear-gradient(135deg, #8a7de6 0 1.5px, #1f1a3a 1.5px 4px); }
.sw-unmatched { background: #171b21; border: 1px dotted rgba(160, 170, 185, 0.55); }

/* tooltip */
.tip {
  position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none; max-width: 340px;
  background: rgba(12, 15, 20, 0.96); border: 1px solid var(--line-2); padding: 9px 11px; font-size: 12px;
  box-shadow: var(--shadow); opacity: 0; transition: opacity 0.12s; backdrop-filter: blur(8px);
}
.tip.on { opacity: 1; }
.tip-title { font-weight: 600; font-size: 13px; }
.tip-sub { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.tip-row i { width: 8px; height: 8px; flex: none; }
.tip-row .nm { color: var(--text-2); flex: 1; min-width: 90px; }
.tip-row b { font-family: var(--mono); }
.tip-row b.big { font-size: 20px; }
.tip .unit { color: var(--muted); font-size: 11px; }
.tip .raw, .raw { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.tip-note { color: var(--text-2); margin-top: 6px; font-size: 11.5px; }
.tip-foot { color: var(--muted); margin-top: 6px; font-size: 11px; border-top: 1px solid var(--line); padding-top: 5px; }

/* rank bars */
.rank-list { display: flex; flex-direction: column; }
.rb-row { display: grid; grid-template-columns: 30px minmax(110px, 1.3fr) 2fr 70px; gap: 10px; align-items: center; padding: 5px 4px; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; }
.rb-row:hover { background: rgba(255, 255, 255, 0.03); }
.rb-row.hl .rb-name { color: var(--gold); }
.rb-rank { font-family: var(--mono); color: var(--muted); font-size: 11px; text-align: right; }
.rb-label { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.rb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-sub { font-size: 10.5px; color: var(--muted); }
.rb-track { height: 12px; background: rgba(255, 255, 255, 0.03); position: relative; }
.rb-bar { display: block; height: 100%; transition: width 0.8s var(--ease); }
.rb-val { font-family: var(--mono); text-align: right; }

/* ------------------------------------------------------------------ popover / combo / modal */
.popover { position: fixed; z-index: 70; background: #0f1419; border: 1px solid var(--line-2); box-shadow: var(--shadow); opacity: 0; transform: translateY(-4px); transition: opacity 0.16s, transform 0.16s var(--ease); max-width: calc(100vw - 16px); }
.popover.on { opacity: 1; transform: none; }
.pop-tips { padding: 12px 14px; max-width: 360px; font-size: 12.5px; color: var(--text-2); }
.pop-tips p { margin: 0 0 8px; }
.pop-tips p:last-child { margin: 0; }
.combo { display: flex; flex-direction: column; max-height: min(520px, 70vh); }
.combo-input { border: 0; border-bottom: 1px solid var(--line-2); background: transparent; height: 42px; padding: 0 14px; outline: none; }
.combo-list { overflow-y: auto; padding: 4px 0; scrollbar-width: thin; }
.combo-group { font-size: 10.5px; color: var(--muted); letter-spacing: 0.08em; padding: 8px 14px 4px; position: sticky; top: -4px; background: #0f1419; }
.combo-item { display: flex; width: 100%; text-align: left; gap: 10px; align-items: center; background: none; border: 0; padding: 7px 14px; cursor: pointer; }
.combo-item:hover, .combo-item.act { background: rgba(255, 255, 255, 0.05); }
.combo-item.sel { box-shadow: inset 2px 0 0 var(--amber); }
.combo-item.dis { opacity: 0.45; cursor: not-allowed; }
.ci-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ci-label { white-space: pre-wrap; word-break: break-all; }
.ci-sub { font-size: 11px; color: var(--muted); }
.ci-reason { font-size: 11px; color: var(--warn); }
.ci-right { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.combo-empty { padding: 16px; color: var(--muted); font-size: 12.5px; }
.modal-layer { position: fixed; inset: 0; z-index: 75; background: rgba(3, 4, 6, 0.74); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity 0.25s; }
.modal-layer.on { opacity: 1; }
.modal { background: #0d1116; border: 1px solid var(--line-2); box-shadow: var(--shadow); width: min(980px, 100%); max-height: calc(100vh - 40px); overflow: auto; animation: zoomIn 0.35s var(--ease); }
.modal-head { display: flex; justify-content: space-between; gap: 16px; padding: 18px 20px 10px; }
.modal-head h2 { margin: 0 0 4px; font-size: 20px; }
.modal-head p { margin: 0; color: var(--text-2); font-size: 13px; max-width: 640px; }
.pref-body { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; padding: 10px 20px 20px; }
.tilemap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(10, minmax(0, 1fr)); gap: 4px; aspect-ratio: 12 / 10; }
.tile { display: flex; flex-direction: column; justify-content: center; align-items: center; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; padding: 2px; font-size: 12px; line-height: 1.15; animation: pop 0.45s var(--ease) both; transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease); min-width: 0; }
.tile:hover { background: var(--panel-3); border-color: var(--amber); transform: scale(1.06); z-index: 1; }
.tile.on { background: var(--grad); color: #1a1003; border-color: transparent; }
.tile.deep { box-shadow: inset 0 -2px 0 rgba(255, 181, 71, 0.6); }
.t-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.t-years { font-family: var(--mono); font-size: 9.5px; opacity: 0.7; }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
.pref-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pref-list { max-height: 440px; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: thin; }
.pref-li { display: flex; justify-content: space-between; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 7px 6px; cursor: pointer; text-align: left; }
.pref-li:hover { background: rgba(255, 255, 255, 0.04); }
.pref-li span { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.cmd-layer { place-items: start center; padding-top: 12vh; }
.cmd { width: min(680px, 100%); }
.cmd-top { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line-2); }
.cmd-input { flex: 1; height: 54px; border: 0; background: transparent; font-size: 16px; outline: none; }
.cmd-list { max-height: 50vh; overflow-y: auto; padding: 6px 0; }
.cmd-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; background: none; border: 0; padding: 8px 16px; cursor: pointer; text-align: left; }
.cmd-item.act, .cmd-item:hover { background: rgba(255, 181, 71, 0.08); }
.cmd-kind { font-size: 10.5px; color: var(--amber); border: 1px solid rgba(255, 181, 71, 0.35); text-align: center; padding: 1px 0; }
.cmd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.cmd-foot { padding: 8px 16px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }

/* drawer */
#drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 72; width: min(480px, 100vw);
  background: #0c1015; border-left: 1px solid var(--line-2); box-shadow: var(--shadow);
  transform: translateX(105%); transition: transform 0.38s var(--ease); display: flex; flex-direction: column;
}
#drawer.on { transform: none; }
.drawer-scrim { position: fixed; inset: 0; z-index: 71; background: rgba(0, 0, 0, 0.4); }
body.drawer-open .drawer-scrim { display: block; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 16px; }
.drawer-body { padding: 14px 16px 30px; overflow-y: auto; }
.prov-note { font-size: 12.5px; color: var(--text-2); margin: 0 0 10px; }
.prov-note.warn { color: var(--warn); }
.prov-card { border: 1px solid var(--line); padding: 12px; margin-bottom: 12px; background: var(--panel); animation: rise 0.35s var(--ease) both; }
.prov-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.prov-val .big { font-family: var(--mono); font-size: 34px; font-weight: 500; }
.prov-unit { display: block; font-size: 11.5px; color: var(--muted); }
.prov-raw { text-align: right; font-size: 11px; color: var(--muted); }
.prov-raw code { display: block; font-size: 18px; color: var(--gold); font-family: var(--mono); }
.prov-state { font-size: 12px; color: var(--text-2); margin: 8px 0; }
.prov-dl { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 5px 10px; margin: 0; font-size: 12px; }
.prov-dl dt { color: var(--muted); overflow-wrap: anywhere; word-break: break-all; min-width: 0; font-size: 11px; }
.prov-dl dd { margin: 0; word-break: break-all; }
.prov-dl a { display: inline-flex; gap: 4px; align-items: center; }
code.wrap { font-family: var(--mono); font-size: 11px; word-break: break-all; }
.prov-empty { display: grid; gap: 8px; justify-items: start; }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 85; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #151b22; border: 1px solid var(--line-2); border-left: 2px solid var(--amber); padding: 9px 14px; font-size: 12.5px; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: all 0.3s var(--ease); max-width: min(560px, 92vw); }
.toast.on { opacity: 1; transform: none; }
.fatal { max-width: 640px; margin: 10vh auto; text-align: center; display: grid; gap: 10px; justify-items: center; color: var(--text-2); }
.fatal h1 { color: var(--text); margin: 0; }
.fatal pre { background: var(--panel); border: 1px solid var(--line-2); padding: 10px 14px; color: var(--gold); font-family: var(--mono); }

/* ------------------------------------------------------------------ attention */
.att-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.rule-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.rule { border: 1px solid var(--line); padding: 12px 14px; background: var(--panel); font-size: 12.5px; }
.rule p { margin: 6px 0 0; color: var(--text-2); }
.rule-k { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.rule-k .ic { color: var(--amber); }
.att-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.em-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.em-card { border: 1px solid var(--line); border-top: 2px solid var(--amber); background: linear-gradient(180deg, rgba(255, 181, 71, 0.06), transparent 60%), var(--panel); padding: 12px; display: flex; flex-direction: column; gap: 6px; animation: rise 0.5s var(--ease) both; }
.em-top { display: flex; justify-content: space-between; font-size: 11px; }
.em-card h3 { margin: 0; font-size: 15px; }
.em-where { font-size: 12px; color: var(--text-2); }
.em-val { display: flex; align-items: baseline; gap: 6px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.em-val b { font-family: var(--mono); font-size: 30px; font-weight: 500; }
.em-val span { font-size: 11px; color: var(--muted); }
.em-foot { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.zero-run { display: inline-grid; grid-auto-flow: column; gap: 1px; }
.zero-run i { width: 3px; height: 10px; background: var(--zero); }
.reason-bars { display: grid; gap: 12px; }
.reason-top { display: flex; justify-content: space-between; font-size: 13px; }
.reason-top b { font-family: var(--mono); }
.reason-track { height: 8px; background: rgba(255, 255, 255, 0.04); margin: 4px 0; }
.reason-track i { display: block; height: 100%; animation: growx 0.8s var(--ease) both; transform-origin: left; }
@keyframes growx { from { transform: scaleX(0); } to { transform: none; } }
.r-missing { background: repeating-linear-gradient(90deg, rgba(160, 170, 185, 0.5) 0 3px, transparent 3px 6px); }
.r-nulls { background: repeating-linear-gradient(135deg, #7c838e 0 2px, #2a2f36 2px 5px); }
.r-rawNotZero { background: var(--zero); }
.r-conflict { background: var(--conflict); }
.reason-sub { font-size: 11.5px; color: var(--muted); }
.ex-list { margin-top: 12px; }
.ex-list summary { cursor: pointer; color: var(--gold); font-size: 12.5px; }
.surge-row { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 2px; cursor: pointer; }
.surge-row:hover { background: rgba(255, 255, 255, 0.03); }
.sr-top { display: flex; justify-content: space-between; gap: 8px; }
.sr-sub { font-size: 11.5px; color: var(--muted); margin: 2px 0 4px; }
.z { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.z.hot { color: var(--amber); }
.band-axis { stroke: rgba(255, 255, 255, 0.12); }
.band-sd { fill: rgba(143, 182, 216, 0.18); }
.band-mean { stroke: var(--zero-ink); stroke-width: 1.5; }
.band-now { stroke: var(--text-2); stroke-width: 2.5; }
.band-now.hot { stroke: var(--amber); }

/* ------------------------------------------------------------------ tables */
.tbl-wrap { overflow: auto; max-height: 420px; border: 1px solid var(--line); scrollbar-width: thin; }
.tbl-wrap.tall { max-height: 560px; }
.tbl { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.tbl th, .tbl td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.tbl th { position: sticky; top: 0; background: #11161c; color: var(--muted); font-weight: 500; font-size: 11.5px; z-index: 1; }
.tbl .num { text-align: right; font-family: var(--mono); }
.tbl tr.hl td { color: var(--gold); }
.tbl td .ok { color: var(--ok); }
.tbl.compact th, .tbl.compact td { padding: 3px 6px; }
.data-tbl td { cursor: pointer; }
.data-tbl td:hover { background: rgba(255, 255, 255, 0.04); }
.th-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; }

/* ------------------------------------------------------------------ map */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.map-panel .panel-body { padding: 0; }
.map-stage { position: relative; height: max(480px, calc(100vh - 250px)); background: radial-gradient(800px 500px at 60% 40%, #0d1620, #070a0e 75%); overflow: hidden; }
.map-box { position: absolute; inset: 0; }
.map-canvas { display: block; touch-action: none; cursor: grab; outline: none; }
.map-canvas.grabbing { cursor: grabbing; }
.map-presets { position: absolute; left: 12px; top: 12px; right: 60px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.map-presets .chip { pointer-events: auto; height: 26px; padding: 0 10px; font-size: 12px; }
.map-zoom { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 4px; }
.map-zoom .icon-btn { width: 32px; height: 32px; background: rgba(12, 15, 20, 0.8); backdrop-filter: blur(6px); }
.map-legend { position: absolute; right: 12px; bottom: 12px; padding: 10px 12px 2px; background: rgba(9, 12, 16, 0.82); border: 1px solid var(--line); backdrop-filter: blur(8px); max-width: calc(100% - 24px); }
.legend-note { font-size: 10.5px; color: var(--muted); padding-bottom: 8px; max-width: 480px; }
.map-load { position: absolute; left: 12px; top: 84px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.time-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(9, 12, 16, 0.88); border: 1px solid rgba(255, 207, 90, 0.45); font-size: 12px; color: var(--text-2); max-width: 420px; }
.time-hint button { background: none; border: 0; color: var(--gold); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.ml-inner { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; background: rgba(9, 12, 16, 0.85); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); min-width: 220px; }
.ml-inner > span:first-child { display: none; }
.spin-ring { width: 12px; height: 12px; border: 2px solid var(--amber); border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
.map-scrub { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); }
.map-scrub .play { width: 34px; height: 34px; }
.map-scrub .play.on { background: var(--grad); color: #1a1003; border-color: transparent; }
.sc-track { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; height: 40px; min-width: 0; }
.sc-cell { position: relative; background: rgba(255, 255, 255, 0.025); border: 0; padding: 0; cursor: pointer; display: flex; align-items: flex-end; transition: background 0.15s; }
.sc-cell:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.sc-cell:disabled { cursor: not-allowed; opacity: 0.35; }
.sc-cell.on { background: rgba(255, 181, 71, 0.16); box-shadow: inset 0 0 0 1px var(--amber); }
.sc-max { display: block; width: 100%; background: linear-gradient(0deg, #8d4d10, var(--amber)); transition: height 0.4s var(--ease); }
.sc-cell.empty .sc-max { background: transparent; }
.sc-cov { position: absolute; left: 0; bottom: -4px; height: 2px; background: var(--zero-ink); opacity: 0.7; }
.sc-meta { display: flex; flex-direction: column; font-family: var(--mono); font-size: 11px; line-height: 1.3; min-width: 92px; }
.sc-meta b { font-size: 18px; color: var(--gold); }
.map-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.md-head { display: flex; justify-content: space-between; gap: 10px; }
.md-name { font-size: 22px; font-weight: 700; line-height: 1.2; }
.md-pref { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.md-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 10px 0 4px; }
.md-big { background: none; border: 0; padding: 0; cursor: pointer; display: flex; align-items: baseline; gap: 6px; }
.md-big b { font-family: var(--mono); font-size: 38px; font-weight: 500; line-height: 1; }
.md-big span { color: var(--muted); font-size: 12px; }
.md-state { font-size: 12px; color: var(--text-2); margin: 0 0 8px; }
.md-spark { margin: 6px 0 10px; }
.md-spark .spark { width: 100%; }
.md-spark-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.md-sec { border-top: 1px solid var(--line); padding: 8px 0; }
.md-k { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; margin-bottom: 4px; }
.md-area { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.md-munis { font-size: 12.5px; margin: 0; color: var(--text-2); }
.md-sec p { margin: 2px 0; }
.join-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.join-kpis div { border: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; }
.join-kpis b { font-family: var(--mono); font-size: 20px; font-weight: 500; }
.join-kpis span { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.join-list { max-height: 420px; overflow-y: auto; scrollbar-width: thin; }
.join-pref { border-bottom: 1px solid var(--line); }
.join-pref summary { display: flex; justify-content: space-between; gap: 8px; padding: 7px 2px; cursor: pointer; font-size: 12.5px; }
.jp-sec { padding: 4px 0 8px 8px; }
.jp-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; padding: 2px 0; }
.cand { background: none; border: 1px dashed rgba(255, 214, 136, 0.45); color: var(--gold); font-size: 11px; padding: 1px 6px; cursor: pointer; }

/* ------------------------------------------------------------------ trend */
.trend-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.series-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.s-chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 4px 0 10px; border: 1px solid var(--line-2); background: var(--panel); animation: pop 0.35s var(--ease) both; }
.s-chip > i { width: 10px; height: 10px; background: var(--c); box-shadow: 0 0 10px var(--c); }
.s-chip small { color: var(--muted); font-size: 11px; }
.sc-dis { font-size: 11px; color: var(--gold); border-left: 1px solid var(--line-2); padding-left: 8px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-chip button { background: none; border: 0; color: var(--muted); cursor: pointer; width: 24px; height: 24px; display: grid; place-items: center; }
.s-chip button:hover { color: var(--text); }
.series-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ss { border: 1px solid var(--line); border-left: 2px solid var(--c); padding: 10px 12px; background: var(--panel); }
.ss-name { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.ss-name i { width: 8px; height: 8px; background: var(--c); }
.ss-last { display: flex; align-items: baseline; gap: 8px; margin: 4px 0; }
.ss-last b { font-family: var(--mono); font-size: 24px; font-weight: 500; }
.ss-last span { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ss-counts { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.year-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--text-2); margin-top: 6px; }
.year-legend i { display: inline-block; width: 14px; height: 3px; margin-right: 5px; vertical-align: middle; }
.cell-n { color: var(--null-ink); }
.cell-m { color: var(--muted); }

/* ------------------------------------------------------------------ compare */
.cmp-head, .cat-head, .cov-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.type-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.cmp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ex-group { border-bottom: 1px solid var(--line); padding: 8px 0; }
.ex-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.ex-h b { margin-left: auto; font-family: var(--mono); }
.ex-items { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ex-item { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); font-size: 11.5px; padding: 2px 6px; cursor: pointer; }
.ex-item small { color: var(--muted); font-family: var(--mono); }
.sm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.sm-card { text-align: left; background: var(--panel-2); border: 1px solid var(--line); padding: 8px 10px; cursor: pointer; animation: rise 0.45s var(--ease) both; transition: border-color 0.2s, transform 0.2s var(--ease); min-width: 0; }
.sm-card:hover { border-color: var(--amber); transform: translateY(-1px); }
.sm-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.sm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.sm-top b { font-family: var(--mono); font-weight: 500; }
.sm-sub { font-size: 10.5px; color: var(--muted); }
.sm-card .spark { width: 100%; margin-top: 4px; }

/* ------------------------------------------------------------------ catalog */
.cat-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.cat-tools .input { flex: 1 1 280px; height: 38px; }
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; border: 1px solid var(--line); background: var(--panel); padding: 12px 14px; animation: rise 0.4s var(--ease) both; }
.cat-card.pinned { border-left: 2px solid var(--amber); }
.cc-label { margin: 0 0 6px; font-size: 14px; font-weight: 500; }
.cc-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cc-prefs { display: grid; grid-template-columns: repeat(47, minmax(0, 1fr)); gap: 1px; margin-top: 8px; max-width: 520px; }
.cc-prefs i { height: 6px; background: rgba(255, 255, 255, 0.05); }
.cc-prefs i.on { background: var(--amber); }
.cc-sim { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); }
.cc-actions { display: flex; gap: 14px; align-items: center; }

/* ------------------------------------------------------------------ coverage */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 6px; }
.kpi { border: 1px solid var(--line); padding: 12px; background: var(--panel); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--grad); transform-origin: left; animation: growx 1s var(--ease) both; }
.kpi-k { font-size: 11.5px; color: var(--muted); }
.kpi-v { font-family: var(--mono); font-size: 24px; }
.kpi-sub { font-size: 10.5px; color: var(--muted); }
.cov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 12px; align-items: start; }
.cov-grid .span-1 .panel-body { max-height: 560px; overflow-y: auto; }
.cov-scroll { overflow-x: auto; scrollbar-width: thin; }
.cov-matrix { display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(14px, 1fr)); gap: 2px; min-width: 560px; }
.cm-year { font-family: var(--mono); font-size: 10px; color: var(--muted); text-align: center; height: 14px; }
.cm-pref { font-size: 11px; color: var(--text-2); white-space: nowrap; height: 14px; line-height: 14px; }
.cm-pref.hl { color: var(--gold); font-weight: 600; }
.cm-cell { height: 14px; border: 0; padding: 0; background: rgba(255, 255, 255, 0.035); animation: pop 0.4s var(--ease) both; cursor: default; }
.cm-cell.on { background: color-mix(in srgb, var(--amber) calc(var(--k) * 100%), #3a2410); cursor: pointer; }
.cm-cell.on:hover { outline: 1px solid #fff; }
.cm-cell.loaded { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.85); }
.cm-cell.cohort-only { background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 214, 136, 0.5); }
.cov-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 11.5px; color: var(--text-2); }
.sw-cov { display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: -2px; background: rgba(255, 255, 255, 0.05); }
.sw-cov.on { background: var(--amber); }
.sw-cov.cohort { background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 214, 136, 0.5); }
.sw-cov.loaded { background: var(--amber); box-shadow: inset 0 0 0 1.5px #fff; }
.cohort-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; max-height: 420px; overflow-y: auto; }
.cohort-item { text-align: left; background: var(--panel-2); border: 1px solid var(--line); padding: 7px 10px; cursor: pointer; display: flex; flex-direction: column; min-width: 0; }
.cohort-item:hover { border-color: var(--line-3); }
.cohort-item.on { border-color: var(--warn); }
.ci-n { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ about */
.about-hero { margin-bottom: 14px; }
.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.state-table { display: grid; gap: 10px; }
.state-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.state-row p { margin: 2px 0 0; color: var(--text-2); font-size: 12.5px; }
.sr-sw .val { font-size: 20px; }
.bul { padding-left: 18px; margin: 6px 0; color: var(--text-2); font-size: 12.5px; }
.bul li { margin: 4px 0; }
.todo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.todo { border: 1px dashed var(--line-2); padding: 10px; }
.todo p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ mobile tabs */
#tabs { display: none; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1360px) {
  .map-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .board-headrow, .board-row { grid-template-columns: minmax(130px, 2fr) 110px 1fr 64px minmax(80px, 1fr) 70px; }
}
@media (max-width: 1180px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  #side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 65; width: min(320px, 88vw); transform: translateX(-102%); transition: transform 0.35s var(--ease); box-shadow: var(--shadow); }
  body.side-open #side { transform: none; }
  body.side-open #sideScrim { display: block; position: fixed; inset: 0; z-index: 64; background: rgba(0, 0, 0, 0.5); }
  .icon-btn.side-close { display: inline-grid; }
  .icon-btn.menu-btn { display: inline-grid; }
  .map-layout { grid-template-columns: minmax(0, 1fr); }
  .map-side { display: grid; grid-template-columns: 1fr 1fr; }
  .ov-grid, .trend-grid, .cmp-grid, .att-body, .cov-grid, .about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3 { grid-column: 1 / -1; }
  .span-2 { grid-column: 1 / -1; }
  .hero { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .todo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .pinned { grid-template-columns: 1fr; }
  .pin-card { min-height: 210px; }
  .rule-cards { grid-template-columns: 1fr; }
  .pref-body { grid-template-columns: 1fr; }
  .pref-list { max-height: 200px; }
  .board-headrow { display: none; }
  .board-row { grid-template-columns: minmax(0, 1fr) 90px 60px; grid-template-areas: "n s v" "a a t"; row-gap: 2px; }
  .br-name { grid-area: n; }
  .br-spark { grid-area: s; }
  .br-val { grid-area: v; }
  .br-area { grid-area: a; }
  .br-trend { grid-area: t; text-align: right; }
  .br-bar { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  #view { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); }
  #ctxbar { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .ctx-title { flex: 1; }
  .ctx-controls { order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .ctx-controls::-webkit-scrollbar { display: none; }
  .ctl-v { max-width: 150px; }
  .ctx-controls > * { flex: none; }
  .ctx-controls .seg { flex-wrap: nowrap; }
  .hero-compare { grid-template-columns: 1fr 1fr !important; }
  .frame-card p { font-size: 11px; }
  #tabs {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(8, 10, 13, 0.92); backdrop-filter: blur(14px); border-top: 1px solid var(--line-2);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; background: none; border: 0; color: var(--muted); font-size: 10.5px; cursor: pointer; position: relative; }
  .tab.on { color: var(--text); }
  .tab.on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; background: var(--grad); }
  .tab.on .ic { color: var(--amber); }
  .ov-grid, .trend-grid, .cmp-grid, .att-body, .cov-grid, .about-grid { grid-template-columns: minmax(0, 1fr); }
  .span-1, .span-2, .span-3 { grid-column: 1 / -1; }
  .hero { padding: 16px; }
  .att-teaser .att-row { grid-template-columns: 1fr; }
  .map-stage { height: 64vh; min-height: 380px; }
  .map-side { grid-template-columns: 1fr; }
  .map-presets { right: 52px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; pointer-events: auto; }
  .map-presets::-webkit-scrollbar { display: none; }
  .map-legend { left: 8px; right: 8px; bottom: 8px; padding: 8px 10px 0; }
  .legend-ramp { width: 150px; }
  .legend-note { display: none; }
  .map-load { top: 46px; left: 8px; right: 50px; bottom: auto; }
  .time-hint { font-size: 11px; padding: 4px 8px; }
  .sc-meta { display: none; }
  .map-scrub { gap: 8px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-title { font-size: 22px; }
  .cat-card { grid-template-columns: 1fr; }
  .cc-actions { flex-direction: row; gap: 14px; align-items: center; }
  .todo-grid { grid-template-columns: 1fr; }
  .rb-row { grid-template-columns: 24px minmax(90px, 1.2fr) 1.2fr 58px; gap: 6px; }
  .modal-layer { padding: 10px; }
  .panel-head { padding: 10px 12px 6px; }
  .panel-body { padding: 4px 12px 12px; }
  .state-row { grid-template-columns: 70px minmax(0, 1fr); }
  .cmd-sub { display: none; }
  .cmd-item { grid-template-columns: 56px minmax(0, 1fr); }
  .expand-layer { padding: 0; }
  #drawer { width: 100vw; }
  .prov-dl { grid-template-columns: 96px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
@media (forced-colors: active) {
  .sw-null, .st-n { forced-color-adjust: none; }
}

/* ------------------------------------------------------------------ v4 data: layers, editions, programs */
.layer-list { display: flex; flex-direction: column; gap: 4px; }
.layer-item { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 7px 10px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; position: relative; transition: border-color 0.2s, background 0.2s; }
.layer-item:hover { border-color: var(--line-3); }
.layer-item.on { border-color: rgba(255, 181, 71, 0.6); background: linear-gradient(90deg, rgba(255, 181, 71, 0.1), transparent); }
.layer-item.on::before { content: ""; position: absolute; left: -1px; top: 6px; bottom: 6px; width: 2px; background: var(--amber); }
.li-name { font-size: 13px; font-weight: 600; font-family: var(--mono); }
.li-sub { font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.layer-tag { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); padding: 1px 6px; color: var(--text-2); white-space: nowrap; }
.layer-tag.layer-recent { color: var(--gold); border-color: rgba(255, 214, 136, 0.45); }
.layer-tag.layer-recent_without_receipt { color: #ffcf5a; border-color: rgba(255, 207, 90, 0.6); border-style: dashed; }
.layer-tag.layer-union, .layer-tag.layer-cohorts { color: #9fc3e6; border-color: rgba(143, 182, 216, 0.5); }
.prog-chip { display: inline-block; margin-left: 6px; font-size: 10.5px; padding: 0 5px; border: 1px solid rgba(79, 195, 220, 0.45); color: #8fd6e8; white-space: nowrap; font-weight: 400; vertical-align: 1px; }
.ctl-policy .ic { color: var(--muted); }
.ctl-policy.on { border-color: rgba(138, 125, 230, 0.7); }
.ctl-policy.on .ic { color: #b8afff; }
.load-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px dashed rgba(255, 181, 71, 0.45); background: rgba(255, 181, 71, 0.04); margin: 8px 0; }
.load-card .ic { color: var(--amber); }
.load-card p { margin: 2px 0 0; font-size: 12px; color: var(--text-2); }
.prov-eds { margin-bottom: 12px; }
.prov-eds td small { display: block; }
.prov-eds .tbl td { white-space: normal; }
.prov-sec { border-top: 1px solid var(--line); padding: 6px 0; }
.prov-sec summary { cursor: pointer; font-size: 12px; color: var(--gold); padding: 2px 0; }
.prov-sec .prov-dl { margin-top: 6px; }
.prov-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.prov-dl dt { font-family: var(--mono); font-size: 11px; }
@media (max-width: 760px) { .load-card { grid-template-columns: 1fr; } }
.map-legend .seg { margin-bottom: 8px; }

.sw-focus { background: transparent; border: 1.5px solid rgba(125, 211, 252, 0.85); }
.alt-prefs { padding: 4px 4px 10px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
