:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-soft: #edf2f9;
  --panel: #ffffff;
  --panel-alt: #f8fafd;
  --header-bg: rgba(255, 255, 255, 0.94);
  --notice-bg: #eef4ff;
  --notice-line: #d4e2fc;
  --notice-text: #1e3a6e;
  --line: #dde6f2;
  --line-strong: #c6d4e7;
  --text: #0f1f38;
  --text-2: #334766;
  --muted: #607491;
  --cyan: #0d9488;
  --cyan-bg: #ecfdf5;
  --cyan-border: #a7f3d0;
  --blue: #2563eb;
  --blue-bg: #eff6ff;
  --blue-border: #bfdbfe;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --red: #e11d48;
  --red-bg: #fff1f2;
  --red-border: #fecdd3;
  --purple: #7c3aed;
  --grid-stroke: #e5ecf5;
  --zero-stroke: #94a7c0;
  --axis-text: #5b708f;
  --shadow: 0 2px 10px rgba(15, 31, 56, 0.045);
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1422;
  --bg-soft: #101d2f;
  --panel: #122033;
  --panel-alt: #0e1a2b;
  --header-bg: rgba(12, 23, 38, 0.94);
  --notice-bg: #112238;
  --notice-line: #233b59;
  --notice-text: #bfd6f6;
  --line: #23354c;
  --line-strong: #344d6c;
  --text: #e8eff8;
  --text-2: #c2d2e6;
  --muted: #8ea3be;
  --cyan: #38cbb8;
  --cyan-bg: #132f31;
  --cyan-border: #2a6c65;
  --blue: #5894ff;
  --blue-bg: #152847;
  --blue-border: #2d538e;
  --amber: #f0b25c;
  --amber-bg: #2e2618;
  --amber-border: #765c2e;
  --red: #f27b88;
  --red-bg: #351c24;
  --red-border: #823948;
  --purple: #a792f6;
  --grid-stroke: #22354d;
  --zero-stroke: #5b7594;
  --axis-text: #839ab5;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

button, input, select { font: inherit; }
button, .button, .inline-btn {
  cursor: pointer;
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  background: var(--panel);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background .14s, border-color .14s, color .14s;
}
button:hover, .button:hover, .inline-btn:hover {
  background: var(--bg-soft);
  border-color: var(--blue);
  color: var(--blue);
  text-decoration: none;
}
.primary-btn {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.primary-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
.quiet-btn, .quiet {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}
.inline-btn { padding: 4px 10px; font-size: 11px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
button:disabled { opacity: .55; cursor: wait; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
h2 { font-size: 16px; font-weight: 650; color: var(--text); }
h3 { font-size: 13px; font-weight: 600; margin: 4px 0 12px; color: var(--text-2); }
h3 small { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 6px; }
small { font-size: 11px; }
strong { font-weight: 650; }

.skip { position: absolute; left: 10px; top: -50px; z-index: 50; background: var(--blue); color: #fff; padding: 6px 12px; border-radius: 6px; }
.skip:focus { top: 8px; }

/* Top Notice & Header */
.top-notice {
  background: var(--notice-bg);
  border-bottom: 1px solid var(--notice-line);
  color: var(--notice-text);
  font-size: 12px;
  padding: 8px 20px;
}
.notice-inner, .header-inner, .ribbon-inner, main, .footer-inner {
  max-width: 1340px;
  margin: 0 auto;
}
.notice-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 18px; line-height: 1.5; }
.notice-sub { opacity: .86; font-size: 11.5px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 20px;
  flex-wrap: wrap;
}
.brand-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none !important;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: .5px;
  margin-top: 3px;
}
.brand-mark { display: flex; align-items: flex-end; gap: 3px; width: 22px; height: 26px; transform: skew(-10deg); }
.brand-mark i { display: block; width: 5px; border-radius: 2px; background: var(--cyan); height: 11px; }
.brand-mark i:nth-child(2) { height: 19px; background: #0ea5e9; }
.brand-mark i:nth-child(3) { height: 26px; background: var(--blue); }

.regime-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  color: var(--blue);
  font-size: 11.5px;
}
.regime-pill b { font-weight: 600; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); flex-shrink: 0; }
.dot.warn { background: var(--amber); }

.top-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.top-nav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 550;
  text-decoration: none;
  transition: all .14s;
}
.top-nav a span { font-family: var(--mono); font-size: 10px; opacity: .62; }
.top-nav a:hover { border-color: var(--blue); color: var(--blue); }
.top-nav a[aria-current="page"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22);
}
.top-nav a[aria-current="page"] span { opacity: .88; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.status-ribbon {
  background: var(--panel-alt);
  border-top: 1px solid var(--line);
  padding: 5px 20px;
  font-size: 11px;
  color: var(--muted);
}
.ribbon-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.edition b { font-family: var(--mono); color: var(--cyan); }

main { padding: 22px 20px 44px; outline: none; }

/* Overview Hero & Sections */
.hero-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.hero-eyebrow { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.tag-live { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); }
.tag-ok { background: var(--cyan-bg); color: var(--cyan); border: 1px solid var(--cyan-border); }
.tag-warn { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.tag-bad { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }

.hero-main h1 { font-size: 21px; line-height: 1.45; margin-bottom: 8px; }
.hero-main p { color: var(--text-2); font-size: 13px; line-height: 1.65; }
.hero-side {
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}
.hero-kv { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); gap: 8px; }
.hero-kv:last-child { border-bottom: 0; }
.hero-kv span { color: var(--muted); }
.hero-kv b { font-family: var(--mono); font-size: 13.5px; color: var(--text); }

.section-block { margin-bottom: 28px; }
.sec-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.sec-title > div { flex: 1; min-width: 220px; }
.sec-title p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sec-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: 700 14px/28px var(--mono);
  text-align: center;
  flex-shrink: 0;
}

/* Big 4 Overview Cards */
.hero-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.big-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--c, var(--blue));
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.big-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.big-card-badge {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-2);
  white-space: nowrap;
}
.big-num {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--c, var(--text));
  margin: 8px 0 4px;
}
.big-num small {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 5px;
  letter-spacing: 0;
}
.big-sub { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.spark-wrap { height: 42px; margin: 4px 0 6px; }
.spark-wrap svg { width: 100%; height: 42px; display: block; overflow: visible; }
.big-verdict {
  font-size: 11.5px;
  color: var(--muted);
  padding-top: 8px;
  border-top: 1px solid var(--line);
  line-height: 1.5;
}

/* 5-Condition Checklist */
.checklist-panel { padding: 20px 22px; }
.checklist-summary {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.progress-box b { font-size: 18px; display: block; margin-bottom: 6px; }
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
  display: flex;
  border: 1px solid var(--line);
}
.progress-track span { height: 100%; transition: width .25s; }
.progress-legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.bottleneck-box {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 12.5px;
  line-height: 1.6;
}
.bottleneck-box strong { color: var(--amber); }

.checklist-rows { display: grid; gap: 10px; }
.check-row {
  display: grid;
  grid-template-columns: 110px minmax(180px, 1.3fr) minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-alt);
}
.check-title b { display: block; font-size: 13.5px; color: var(--text); }
.check-title small { color: var(--muted); font-size: 11.5px; display: block; margin-top: 2px; }
.check-reading b { font-family: var(--mono); font-size: 15px; color: var(--text); display: block; }
.check-reading small { color: var(--muted); font-size: 11px; }
.check-target { font-size: 12px; color: var(--text-2); }
.check-target small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

/* Market Thermometer Mini Cards & Nowcast Panel */
.market-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.nowcast-panel { padding: 18px 20px; }
.nowcast-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.nowcast-chart-box {
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  min-width: 0;
}
.nowcast-chart-box h2 { font-size: 14.5px; }
.nowcast-table th, .nowcast-table td { padding: 9px 11px; }
.nowcast-table tr.is-anchor td { background: var(--panel-alt); font-weight: 550; }
.nowcast-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  margin-left: 6px;
  font-family: sans-serif;
}
.nowcast-pill.real { background: var(--cyan-bg); color: var(--cyan); border: 1px solid var(--cyan-border); }
.nowcast-pill.est { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); }
.nowcast-pill.mtd { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.nowcast-toggle.active {
  background: var(--blue-bg);
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}
.nowcast-toggle.disabled-note {
  opacity: .72;
  cursor: default;
}
.mini-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.mini-card > span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-card > b { display: block; font: 700 20px/1.35 var(--mono); color: var(--text); margin: 4px 0 2px; }
.mini-card > b small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.mini-meta { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); gap: 4px; }
.mini-spark { height: 28px; margin: 6px 0 4px; }
.mini-spark svg { width: 100%; height: 28px; display: block; overflow: visible; }

/* Pool Structure Bars */
.pool-item { margin-bottom: 14px; }
.pool-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; gap: 8px; }
.pool-head b { font-family: var(--mono); }
.pool-bar { height: 12px; border-radius: 6px; background: var(--bg-soft); overflow: hidden; display: flex; border: 1px solid var(--line); }
.pool-bar span { height: 100%; }
.pool-note { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* 4 Scenario Cards on Overview */
.scenario-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.scen-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.scen-card h3 { font-size: 15px; margin: 4px 0; color: var(--text); }
.scen-card p { font-size: 12px; color: var(--muted); line-height: 1.55; }
.scen-kpis {
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  display: grid;
  gap: 6px;
}
.scen-kpis div { display: flex; justify-content: space-between; gap: 8px; }
.scen-kpis span { color: var(--muted); }
.scen-kpis b { font-family: var(--mono); color: var(--text); }
.scen-jump { width: 100%; text-align: center; }

/* Executive Briefing Page (#page-brief) */
.brief-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.brief-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.brief-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.brief-card h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 16px; }
.brief-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.brief-kpi { background: var(--panel-alt); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.brief-kpi span { display: block; font-size: 11px; color: var(--muted); }
.brief-kpi b { display: block; font: 700 20px/1.35 var(--mono); margin-top: 3px; color: var(--text); }
.brief-kpi small { font-size: 10.5px; color: var(--muted); }

/* Existing Workbench, Observed & Method Pages (Upgraded for Light + Dark) */
.data-strip {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  padding: 12px 16px;
  gap: 18px;
  box-shadow: var(--shadow);
}
.strip-label { min-width: 110px; font-size: 12px; }
.strip-label small { display: block; color: var(--muted); font-family: var(--mono); font-size: 10.5px; }
.ticker { display: grid; grid-template-columns: repeat(4, 1fr); flex: 1; gap: 16px; min-width: 0; }
.tick { border-left: 1px solid var(--line); padding-left: 14px; min-width: 0; }
.tick span { display: block; color: var(--muted); font-size: 11px; }
.tick b { font-size: 17px; font-family: var(--mono); font-weight: 650; color: var(--text); }
.tick small { margin-left: 4px; color: var(--muted); font-size: 10px; }

.page-heading { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 18px; gap: 14px; flex-wrap: wrap; }
.eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 1.6px; color: var(--blue); display: block; margin-bottom: 4px; }
.page-heading p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.mode-chip {
  border: 1px solid var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.mode-chip span { font-size: 8px; margin: 0 6px; }

.scenario-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.scenarios { display: flex; gap: 8px; flex-wrap: wrap; }
.scenarios button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.scenario-caption { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin: 10px 0 16px; gap: 10px; flex-wrap: wrap; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric {
  border: 1px solid var(--line);
  border-top: 3px solid var(--c, var(--blue));
  border-radius: 10px;
  background: var(--panel);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.metric .label { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.metric .symbol { font-family: var(--mono); color: var(--c); font-weight: 650; font-size: 11px; }
.metric .value { font-family: var(--mono); font-size: 27px; font-weight: 700; line-height: 1.4; letter-spacing: -.5px; margin: 4px 0 3px; color: var(--text); }
.metric .value small { font-family: inherit; color: var(--muted); font-size: 11.5px; font-weight: 500; letter-spacing: 0; margin-left: 5px; }
.metric .foot { font-size: 11px; color: var(--muted); }
.metric.state .value { font-family: inherit; font-size: 18px; letter-spacing: 0; line-height: 2.0; }

.work-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
.analysis-stack { display: grid; gap: 18px; min-width: 0; }
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.segmented {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 2px;
  flex-shrink: 0;
  gap: 2px;
}
.segmented button { background: transparent; border: 0; color: var(--muted); padding: 4px 10px; font-size: 11px; border-radius: 6px; }
.segmented button.active { background: var(--panel); color: var(--blue); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-empty { color: var(--muted); padding: 44px 12px; font-size: 12px; text-align: center; }
.chart-caption { font-size: 11.5px; color: var(--text-2); min-height: 22px; margin-top: 6px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-2); font-size: 11.5px; margin-top: 6px; }
.legend span:before, .chart-caption span:before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: var(--c);
  margin-right: 6px;
  vertical-align: middle;
}

.time-control { display: flex; align-items: center; gap: 10px; margin: 12px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.time-control button { width: 32px; height: 28px; padding: 2px 8px; }
.time-control label { font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.time-control input { flex: 1; min-width: 50px; }
.time-control output { font: 600 11.5px var(--mono); min-width: 78px; text-align: right; color: var(--blue); }

input[type=range] { accent-color: var(--blue); height: 14px; cursor: pointer; width: 100%; margin: 6px 0; }
.micro { font-size: 11px; color: var(--muted); line-height: 1.65; }
.sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.allocation-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin: 7px 0; gap: 8px; }
.allocation-row .amount { font-family: var(--mono); font-weight: 600; color: var(--text); }
.allocation-row i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--c); margin-right: 7px; }
.allocation-bar { display: flex; height: 11px; border-radius: 5px; overflow: hidden; margin: 10px 0 14px; border: 1px solid var(--line); }
.allocation-bar span { height: 100%; }

.event-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.event-grid.four { grid-template-columns: repeat(4, 1fr); }
.event { border-left: 3px solid var(--c); padding: 2px 12px; min-width: 0; background: var(--panel-alt); border-radius: 0 8px 8px 0; padding-top: 8px; padding-bottom: 8px; }
.event small { font-size: 11px; color: var(--muted); }
.event b { display: block; margin: 4px 0; font-size: 19px; color: var(--text); }
.event p { font-size: 11px; color: var(--muted); }

.window-detail { font-size: 12px; color: var(--text-2); margin: 16px 0 4px; line-height: 1.75; }
.sensitivity { font-size: 11.5px; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line); margin-top: 12px; }
.sensitivity b { font: 600 12px var(--mono); color: var(--blue); }
.badge { font-size: 10.5px; color: var(--text-2); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; white-space: nowrap; }

.parameter-panel { align-self: start; position: sticky; top: 96px; padding: 18px 16px; }
.control { margin: 15px 0 16px; }
.control label { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 550; color: var(--text); align-items: baseline; }
.control output { font-family: var(--mono); font-size: 11.5px; color: var(--blue); font-weight: 600; white-space: nowrap; }
.control .ends { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.control p { font-size: 10.5px; line-height: 1.55; color: var(--muted); margin-top: 3px; }
details summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--blue); padding: 10px 0; border-top: 1px solid var(--line); }

.parameter-note { font-size: 11.5px; background: var(--panel-alt); border: 1px solid var(--line); padding: 12px; border-radius: 8px; margin: 14px 0; color: var(--text-2); }
.parameter-note strong { color: var(--text); }
.parameter-note p { margin: 6px 0 8px; }
.exports { display: grid; gap: 8px; }
.exports button, .exports a { text-align: left; font-size: 11.5px; padding: 8px 11px; border-radius: 7px; border: 1px solid var(--line-strong); color: var(--text-2); background: var(--panel); }
.exports button:hover, .exports a:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }

.drivers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.edge { display: flex; justify-content: space-between; font-size: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); gap: 9px; color: var(--text-2); }
.edge strong { font-family: var(--mono); color: var(--text); }
.edge span em { font-style: normal; color: var(--muted); padding: 0 5px; }
.driver { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-2); padding: 7px 0; border-bottom: 1px solid var(--line); }
.driver b { font-family: var(--mono); font-weight: 600; color: var(--text); }
.driver.total { font-weight: 650; color: var(--text); background: var(--panel-alt); padding: 7px 8px; border-radius: 6px; margin-top: 4px; }

.positive { color: var(--cyan) !important; }
.negative { color: var(--red) !important; }

.verdict {
  border-left: 4px solid var(--cyan);
  background: var(--cyan-bg);
  border-top: 1px solid var(--cyan-border);
  border-right: 1px solid var(--cyan-border);
  border-bottom: 1px solid var(--cyan-border);
  border-radius: 10px;
  padding: 15px 20px;
  margin-bottom: 20px;
  color: var(--text);
  font-size: 13.5px;
}
.verdict p { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.observed-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
select { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 7px; color: var(--text); padding: 7px 10px; max-width: 100%; }
#page-observed > .panel, #page-observed > .sub-grid { margin-bottom: 18px; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; white-space: nowrap; }
th { font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--line); padding: 10px 12px; background: var(--panel-alt); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text-2); }
td:not(:first-child) { font-family: var(--mono); }
.brief-card table { white-space: normal; font-size: 11.5px; }
.brief-card th, .brief-card td { padding: 8px 7px; line-height: 1.45; }
.brief-card td:nth-child(2), .brief-card td:last-child, .brief-card th:last-child { white-space: nowrap; }

.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.source { border: 1px solid var(--line); border-radius: 10px; padding: 15px; background: var(--panel); font-size: 11.5px; color: var(--muted); box-shadow: var(--shadow); }
.source b { display: block; color: var(--text); font-size: 13px; margin: 6px 0 8px; }
.source code { font: 9.5px var(--mono); overflow-wrap: anywhere; display: block; margin-top: 8px; color: var(--muted); }
.source a { display: inline-block; margin-top: 8px; font-weight: 500; }

.prose { font-size: 13px; line-height: 1.85; margin-bottom: 18px; }
.prose h2 { font-size: 18px; margin-bottom: 12px; }
.prose p { color: var(--text-2); margin: 10px 0; }
.prose > .badge { display: inline-block; margin-bottom: 10px; }
.mechanism { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 18px 0; }
.mechanism span { border: 1px solid var(--cyan-border); padding: 7px 13px; background: var(--cyan-bg); color: var(--cyan); border-radius: 7px; font-size: 12px; font-weight: 550; }
.mechanism b { color: var(--muted); font-weight: 500; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 26px; }
.compare-grid b { font-size: 13.5px; color: var(--text); }
.compare-grid p { margin: 5px 0; font-size: 12.5px; }
.equation { padding: 13px 16px; border: 1px solid var(--line); background: var(--panel-alt); margin: 10px 0; border-radius: 8px; font: 13px/1.85 var(--mono); overflow-x: auto; color: var(--text); }
.equation small { display: block; font: 600 11px/1.5 sans-serif; color: var(--blue); margin-bottom: 6px; }
.technical { margin-top: 16px; }
.technical pre { white-space: pre-wrap; color: var(--muted); font: 11px/1.65 var(--mono); overflow-wrap: anywhere; background: var(--panel-alt); padding: 12px; border-radius: 8px; border: 1px solid var(--line); }

.preset-mini { display: flex; gap: 6px; flex-wrap: wrap; }
.preset-mini button { padding: 5px 10px; font-size: 11px; }
.id-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 22px; align-items: start; }
.id-controls .control { margin: 10px 0 13px; }
.id-result { background: var(--panel-alt); border: 1px solid var(--line); border-radius: 10px; padding: 16px; font-size: 12px; color: var(--text-2); }
.id-status { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); margin-bottom: 10px; }
.id-status.pos { background: var(--cyan-bg); border-color: var(--cyan-border); color: var(--cyan); }
.id-status.neg { background: var(--red-bg); border-color: var(--red-border); color: var(--red); }
.id-status.unk { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber); }
.id-bounds { font: 700 22px/1.4 var(--mono); color: var(--text); margin: 4px 0 10px; }
.id-witness { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.id-witness code { display: block; font: 11px/1.6 var(--mono); color: var(--text); margin-top: 4px; }

.anchor-strip { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.anchor-strip b { font-family: var(--mono); color: var(--text); }

.site-footer { border-top: 1px solid var(--line); background: var(--panel); padding: 18px 20px; font-size: 11.5px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #0f1f38;
  border: 1px solid var(--blue);
  color: #fff;
  border-radius: 8px;
  padding: 11px 18px;
  z-index: 60;
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  max-width: calc(100vw - 40px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
#toast.visible { opacity: 1; }
[hidden] { display: none !important; }

/* Responsive Breakpoints */
@media (max-width: 1180px) {
  .hero-cards, .scenario-cards, .market-grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid { grid-template-columns: minmax(0, 1fr) 270px; }
  .source-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero-banner, .checklist-summary, .brief-grid, .sub-grid, .nowcast-grid, .drivers-grid, .id-grid, .work-grid {
    grid-template-columns: 1fr;
  }
  .parameter-panel { position: static; }
  .check-row { grid-template-columns: 1fr 1fr; }
  .event-grid.four { grid-template-columns: repeat(2, 1fr); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .ticker { grid-template-columns: repeat(2, 1fr); row-gap: 10px; }
}

@media (max-width: 600px) {
  .top-notice { padding: 7px 12px; font-size: 11px; }
  .notice-sub { display: none; }
  .header-inner { padding: 10px 12px; gap: 10px; }
  .top-nav { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .top-nav a { justify-content: center; padding: 6px 6px; font-size: 11.5px; }
  .top-nav a span { display: none; }
  .header-actions { width: 100%; justify-content: space-between; }
  .header-actions button { flex: 1; padding: 6px 8px; font-size: 11px; }
  main { padding: 14px 12px 32px; }
  .hero-banner { padding: 16px; }
  .hero-main h1 { font-size: 18px; }
  .hero-cards, .scenario-cards, .source-grid, .compare-grid, .id-witness { grid-template-columns: 1fr; }
  .market-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .check-row { grid-template-columns: 1fr; gap: 6px; }
  .brief-kpis { grid-template-columns: 1fr; }
  .brief-card { padding: 14px; }
  .driver { flex-wrap: wrap; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric .value { font-size: 22px; }
  .big-num { font-size: 25px; }
  .panel { padding: 14px; }
  .data-strip { flex-direction: column; align-items: flex-start; gap: 10px; }
  .ticker { width: 100%; gap: 10px 8px; }
  .tick { padding-left: 8px; }
  .tick b { font-size: 14px; }
}

@media print {
  .top-notice, .top-nav, .header-actions, .brief-actions, #toast { display: none !important; }
  .site-header { position: static; }
  body { background: #fff; color: #000; }
  .panel, .brief-card, .big-card { box-shadow: none; break-inside: avoid; }
}
