:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-strong: #eef2f0;
  --text: #17221f;
  --muted: #586762;
  --faint: #78847f;
  --line: #d5ddda;
  --line-strong: #b9c6c1;
  --accent: #17675f;
  --accent-strong: #10524c;
  --accent-soft: #e6efed;
  --chart-primary: #078979;
  --chart-area: #cfe5e0;
  --canvas-grid: #e0e6e4;
  --canvas-secondary: #7b8c91;
  --radius: 6px;
  --header-height: 64px;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  font-synthesis: none;
}

:root[data-theme="teal"] { color-scheme: light; }

:root[data-theme="paper"] {
  color-scheme: light;
  --bg: #f7f5f0;
  --surface: #fffefa;
  --surface-strong: #f1eee7;
  --text: #202522;
  --muted: #626762;
  --faint: #81857f;
  --line: #ddd9d0;
  --line-strong: #c8c2b7;
  --accent-soft: #e7efec;
  --chart-primary: #0b806f;
  --chart-area: #d8e6e1;
  --canvas-grid: #e5e1d9;
  --canvas-secondary: #7c8885;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

button, select { font: inherit; }
a { color: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3, h4, h5, h6, p, li, dd, span {
  min-width: 0;
  overflow-wrap: anywhere;
  text-wrap: wrap;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 30;
  padding: 9px 14px;
  background: var(--text);
  color: var(--surface);
  text-decoration: none;
}

.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: min(100%, 1240px);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 30px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 246, 245, 0.96);
  backdrop-filter: blur(12px);
}

:root[data-theme="paper"] .site-header { background: rgba(247, 245, 240, 0.96); }

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 10px;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--accent);
  color: var(--surface);
  font-size: 15px;
  font-weight: 800;
}

.brand-copy {
  display: grid;
  gap: 2px;
  line-height: 1.05;
}

.brand-copy small {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.035em;
}

nav {
  display: flex;
  align-items: center;
  gap: 24px;
  white-space: nowrap;
}

nav a {
  position: relative;
  padding: 9px 2px 8px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 160ms ease;
}

nav a:hover { color: var(--text); }

nav a::after {
  position: absolute;
  right: 0;
  bottom: 1px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 160ms ease, transform 160ms ease;
}

nav a[aria-current="location"] {
  color: var(--text);
  font-weight: 720;
}

nav a[aria-current="location"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.theme-button,
.secondary-action,
.primary-action,
.dialog-close {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
}

.secondary-action,
.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.theme-button:hover,
.secondary-action:hover,
.dialog-close:hover {
  background: var(--surface);
  border-color: var(--accent);
}

.primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--surface);
}

.primary-action:hover { background: var(--accent-strong); }

.theme-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 6px 8px 6px 11px;
  border-color: var(--line);
  background: var(--surface);
  font-size: 12px;
}

.theme-switch-track {
  position: relative;
  width: 30px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-strong);
  transition: background 160ms ease, border-color 160ms ease;
}

.theme-switch-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.theme-button[aria-pressed="true"] .theme-switch-track {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.theme-button[aria-pressed="true"] .theme-switch-track i {
  background: var(--accent);
  transform: translateX(12px);
}

.hero,
.research-shell,
footer {
  width: min(calc(100% - 48px), 1180px);
  margin-right: auto;
  margin-left: auto;
}

.hero { padding: 40px 0 48px; }

.hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}

.instrument-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
}

.instrument-heading strong {
  color: var(--text);
  font-size: 30px;
  font-weight: 780;
  line-height: 1;
  letter-spacing: -0.035em;
}

.instrument-heading span {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 740;
  letter-spacing: 0.05em;
}

.result-date {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.result-date small {
  color: var(--faint);
  font-size: 11px;
}

.result-date strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.section-kicker {
  margin: 0;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.1em;
}

.hero-positioning {
  max-width: 64em;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.sample-state {
  color: var(--accent-strong);
  font-weight: 720;
}

.hero-result {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, 0.72fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(23, 103, 95, 0.06);
}

.hero-main {
  min-height: 246px;
  padding: 34px 38px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-question {
  margin: 0 0 9px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 760;
}

.hero-verdict {
  display: block;
}

.hero-answer {
  max-width: 20em;
  margin: 0;
  font-size: clamp(30px, 3.15vw, 42px);
  font-weight: 750;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.hero-intro {
  max-width: 50em;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-signals {
  margin: 0;
  display: grid;
  align-content: center;
  padding: 16px 28px 14px;
  border-left: 1px solid var(--line);
  background: var(--surface-strong);
}

.hero-signals div {
  min-width: 0;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.hero-signals div:last-child { border-bottom: 0; }
.hero-signals dt { color: var(--muted); font-size: 11px; }

.hero-signals dd {
  margin: 2px 0 1px;
  font-size: 23px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hero-signals small {
  display: block;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.45;
}

.hero-signal-primary dd { font-size: 18px; }

.hero-boundary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 14px;
  padding: 12px 36px;
  border-top: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
}

.hero-boundary strong { color: var(--text); }

.research-toolbar {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 280px);
  align-items: end;
  gap: 40px;
  margin-bottom: 20px;
}

.research-toolbar .section-kicker { margin-bottom: 8px; }

.research-toolbar h2 {
  margin: 0;
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.date-control { display: grid; gap: 7px; }
.date-control label { color: var(--muted); font-size: 12px; font-weight: 680; }

.date-control select {
  width: 100%;
  min-height: 42px;
  padding: 8px 40px 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.app-status {
  min-height: 22px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.app-status.ready {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.research-results {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.research-results > * + * { border-top: 1px solid var(--line); }

.result-group { min-width: 0; }

.result-lead,
.trend-section,
.chart-section,
.evidence-section,
.draft-section {
  margin: 0;
  padding: 38px 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.draft-section {
  margin-top: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.chart-section { border-top: 1px solid var(--line); }

.result-number {
  margin: 0 0 7px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.08em;
}

.result-lead h3,
.trend-section h3,
.evidence-section h3,
.draft-section h3,
.chart-section h3 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.result-summary {
  max-width: 66em;
  margin: 10px 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.metric { min-width: 0; }
.metric span, .metric small { display: block; }

.metric-grid > .metric {
  grid-column: span 3;
  min-height: 96px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.metric-grid > .metric:nth-child(4) { border-right: 0; }
.metric span { color: var(--muted); font-size: 11px; }

.metric strong {
  display: block;
  margin: 6px 0 4px;
  font-size: clamp(20px, 2vw, 25px);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.metric small { color: var(--faint); font-size: 11px; line-height: 1.4; }

.metric-grid > .agent-metric {
  grid-column: span 6;
  min-height: 98px;
  padding: 16px 18px 14px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--surface-strong);
}

.metric-grid > .agent-metric:last-child { border-right: 0; }
.agent-metric span { color: var(--accent-strong); font-weight: 720; }
.agent-metric strong { font-size: clamp(19px, 2vw, 24px); }

.trend-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.trend-heading > div > p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.trend-model {
  flex: 0 0 auto;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
}

.trend-model:hover { color: var(--accent-strong); text-decoration: underline; }

.trend-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 32px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.trend-primary > span {
  color: var(--muted);
  font-size: 11px;
}

.trend-primary > strong {
  display: block;
  margin: 3px 0 7px;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.trend-primary > p {
  max-width: 46em;
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.trend-scale {
  position: relative;
  height: 6px;
  margin-top: 24px;
  background: linear-gradient(90deg, #6d8291 0%, var(--line) 48%, var(--line) 52%, var(--accent) 100%);
}

.trend-zero {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 50%;
  width: 1px;
  background: var(--text);
}

.trend-scale i {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--text);
  transform: translate(-50%, -50%);
}

.trend-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--faint);
  font-size: 10px;
}

.trend-facts {
  margin: 0;
  border-top: 1px solid var(--line);
}

.trend-facts div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.trend-facts dt {
  color: var(--muted);
  font-size: 11px;
}

.trend-facts dd {
  margin: 0;
  font-size: 13px;
  font-weight: 680;
  text-align: right;
}

.trend-signals {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.trend-signals > div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.trend-signals > div:last-child { border-right: 0; }
.trend-signals span, .trend-signals small { display: block; }
.trend-signals span { color: var(--muted); font-size: 10px; }
.trend-signals strong { display: block; margin: 4px 0 1px; font-size: 14px; }
.trend-signals small { color: var(--faint); font-size: 10px; }
.trend-reading.positive { color: var(--accent-strong); }
.trend-reading.negative { color: #536977; }
.trend-reading.neutral { color: var(--muted); }

.chart-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.chart-heading p {
  max-width: 62em;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.chart-window {
  flex: 0 0 auto;
  margin-top: 3px;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: 12px;
}

.chart-snapshot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.chart-snapshot .metric { padding: 12px 16px; border-right: 1px solid var(--line); }
.chart-snapshot .metric:last-child { border-right: 0; }
.chart-snapshot .metric strong { font-size: 20px; }

.chart-wrap {
  width: 100%;
  min-width: 0;
  min-height: 420px;
  margin-top: 16px;
  overflow: hidden;
}

#price-chart {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 420px;
}

.chart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 11px;
}

.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; }

.legend-line {
  display: inline-block;
  width: 22px;
  height: 3px;
  margin-right: 7px;
  vertical-align: middle;
  background: var(--chart-primary, #078979);
}

.legend-area {
  display: inline-block;
  width: 22px;
  height: 10px;
  margin-right: 7px;
  vertical-align: -1px;
  border-top: 2px solid var(--canvas-secondary, #7b8c91);
  background: linear-gradient(180deg, var(--chart-area, #cfe5e0), transparent);
}

.evidence-intro > p:last-child { max-width: 44em; margin: 10px 0 0; color: var(--muted); font-size: 13px; }

.evidence-layout {
  margin-top: 28px;
}

.evidence-primary { display: grid; gap: 30px; }
.evidence-section h4 { margin: 0 0 10px; font-size: 14px; }

#confirmed-evidence,
#constraint-evidence {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 22px;
  border-bottom: 1px solid var(--line);
}

.evidence-button {
  width: 100%;
  margin: 0;
  padding: 12px 2px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.evidence-button:hover { color: var(--accent-strong); }
.evidence-button strong, .evidence-button span { display: block; }
.evidence-button strong { margin-bottom: 2px; font-size: 13px; }
.evidence-button span { color: var(--muted); font-size: 11px; }

.draft-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 28px;
}

.draft-heading-note { margin: 7px 0 0; color: var(--muted); font-size: 13px; }

.draft-controls { display: grid; justify-items: end; padding-top: 2px; }

.draft-actions { display: flex; gap: 8px; }

.draft-paper {
  max-width: 1024px;
  margin: 36px auto 0;
  padding: clamp(40px, 5.3vw, 72px);
  border: 1px solid var(--line-strong);
  background: #ffffff;
}

.draft-paper.agent-report { border-top: 3px solid var(--accent); }

.draft-status {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.draft-paper h4 {
  margin: 0 0 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.16;
  letter-spacing: -0.03em;
}

.draft-paper h5 { margin: 34px 0 10px; font-size: 18px; }
.draft-paper h6 { margin: 0 0 9px; font-size: 14px; }

.draft-paper p,
.draft-paper li,
.draft-paper dd {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.78;
}

.draft-paper ul, .draft-paper ol { padding-left: 1.25em; }
.draft-paper li { margin-bottom: 5px; }

.report-deck {
  margin: -10px 0 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px !important;
}

.report-lead {
  color: var(--text) !important;
  font-size: 18px !important;
  font-weight: 650;
  line-height: 1.75;
}

.report-data-grid { margin: 12px 0 0; border-top: 1px solid var(--line); }

.report-data-grid div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.report-data-grid dt { color: var(--text); font-size: 13px; font-weight: 700; }
.report-data-grid dd { margin: 0; }
.report-review { margin: 20px 0 0; }

.report-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 12px;
}

.report-columns section { padding-top: 12px; border-top: 2px solid var(--line-strong); }

.report-boundary { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px !important; }

footer {
  margin-top: 64px;
  padding: 32px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

footer p { margin: 3px 0 0; }

dialog {
  width: min(540px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

dialog::backdrop { background: rgba(23, 34, 31, 0.48); }
.dialog-close { float: right; }
.dialog-label { margin: 0 0 5px; color: var(--accent-strong); font-size: 12px; font-weight: 750; }
dialog h2 { margin: 0 72px 24px 0; font-size: 24px; }
dialog dl { display: grid; grid-template-columns: 90px 1fr; gap: 10px 16px; margin: 0; }
dialog dt { color: var(--muted); font-size: 12px; }
dialog dd { margin: 0; overflow-wrap: anywhere; }
dialog dd a { color: var(--accent-strong); }

.noscript-message {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 30;
  padding: 16px;
  background: var(--text);
  color: var(--surface);
  text-align: center;
}

.not-found-shell {
  width: min(720px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 18px;
}

.not-found-shell h1, .not-found-shell p { margin: 0; }
.not-found-shell h1 { max-width: 12ch; font-size: clamp(2.75rem, 8vw, 5.5rem); line-height: 0.98; letter-spacing: -0.05em; }
.not-found-shell p:not(.section-kicker) { color: var(--muted); }

@media (max-width: 900px) {
  .hero-result { grid-template-columns: 1fr; }
  .hero-main { min-height: 0; }

  .hero-signals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0 24px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .hero-signals div {
    padding: 14px 12px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .hero-signals div:last-child { border-right: 0; }
  .trend-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  :root { --header-height: 92px; }

  .site-header {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    min-height: var(--header-height);
    padding: 8px 14px 0;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 40px 40px;
    gap: 0 12px;
  }

  .site-header.is-condensed {
    height: 41px;
    min-height: 41px;
    padding-top: 0;
    grid-template-rows: 0 40px;
  }

  .site-header.is-condensed .brand,
  .site-header.is-condensed .theme-button {
    display: none;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .theme-button {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  nav {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 0;
    border-top: 1px solid var(--line);
  }

  nav a {
    padding: 8px 2px 9px;
    font-size: 12px;
    text-align: center;
  }

  .hero,
  .research-shell,
  footer { width: min(calc(100% - 24px), 1180px); }

  .hero { padding: 28px 0 36px; }
  .hero-topline { align-items: start; }
  .instrument-heading strong { font-size: 27px; }
  .hero-positioning { margin-bottom: 14px; font-size: 13px; }
  .result-meta { display: grid; justify-items: end; gap: 0; }
  .hero-main { padding: 24px 20px 22px; }
  .hero-answer {
    max-width: 100%;
    font-size: clamp(25px, 7.5vw, 31px);
    line-height: 1.22;
    word-break: normal;
  }
  .hero-intro { margin-top: 12px; font-size: 13px; }

  .hero-signals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 12px;
  }

  .hero-signals div {
    padding: 13px 10px;
    border-right: 0;
    border-bottom: 0;
  }

  .hero-signals div:nth-child(2) { border-right: 1px solid var(--line); }
  .hero-signals .hero-signal-primary {
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--line);
  }
  .hero-signals dd { font-size: 19px; }
  .hero-signal-primary dd { font-size: 17px; }
  .hero-signals small { font-size: 10px; }

  .hero-boundary {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 12px 20px;
  }
  .research-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(154px, 168px);
    align-items: end;
    gap: 12px;
  }
  .research-toolbar h2 { font-size: clamp(24px, 7vw, 30px); }
  .date-control { gap: 4px; }
  .date-control select { min-height: 42px; padding-right: 32px; }
  .draft-heading { grid-template-columns: 1fr; align-items: start; gap: 20px; }

  .result-lead,
  .trend-section,
  .chart-section,
  .evidence-section,
  .draft-section { padding: 24px 20px; }

  .metric-grid > .metric { grid-column: span 6; border-bottom: 1px solid var(--line); }
  .metric-grid > .metric:nth-child(2) { border-right: 0; }
  .metric-grid > .metric:nth-child(3),
  .metric-grid > .metric:nth-child(4) { border-bottom: 0; }

  .metric-grid > .agent-metric {
    grid-column: span 12;
    border-right: 0;
    border-bottom: 0;
  }

  .trend-heading { display: grid; gap: 8px; }
  .trend-model { width: max-content; }
  .trend-layout { gap: 22px; }
  .trend-primary > p { min-height: 0; }
  .trend-signals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trend-signals > div { border-bottom: 1px solid var(--line); }
  .trend-signals > div:nth-child(2n) { border-right: 0; }
  .trend-signals > div:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }
  .trend-facts div { grid-template-columns: 94px minmax(0, 1fr); }
  .trend-facts dd { font-size: 12px; overflow-wrap: anywhere; }

  .chart-heading { display: grid; }
  .chart-window { width: max-content; }
  .chart-snapshot { grid-template-columns: 1fr; }

  .chart-snapshot .metric {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 6px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chart-snapshot .metric:last-child { border-bottom: 0; }
  .chart-snapshot .metric strong { margin: 0; }
  .chart-snapshot .metric small { grid-column: 2; }
  .chart-wrap { min-height: 380px; margin-top: 10px; }
  #price-chart { height: 380px; }
  .chart-footer { align-items: start; flex-direction: column; }
  .report-columns { grid-template-columns: 1fr; }
  #confirmed-evidence,
  #constraint-evidence { grid-template-columns: 1fr; }
  .draft-controls { width: 100%; justify-items: stretch; }
  .report-switch { justify-content: space-between; }
  .draft-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .draft-actions button { width: 100%; }
  .draft-paper { margin-top: 26px; padding: 26px 20px; }
  .report-data-grid div { grid-template-columns: 1fr; gap: 2px; }
  dialog { padding: 22px; }
}

@media (max-width: 400px) {
  .hero-topline { display: grid; gap: 5px; }
  .result-meta { justify-items: start; }
  .metric-grid > .metric { grid-column: span 12; border-right: 0; }
  .metric-grid > .metric:nth-child(3) { border-bottom: 1px solid var(--line); }
  .draft-actions { grid-template-columns: 1fr; }
}

@media (max-width: 370px) {
  .research-toolbar { grid-template-columns: 1fr; }
  .date-control { grid-template-columns: auto minmax(154px, 1fr); align-items: center; }
  .date-control label { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

@media print {
  :root,
  :root[data-theme] {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-strong: #f2f3f2;
    --text: #111714;
    --muted: #39443e;
    --line: #b8c0ba;
    --line-strong: #9ca8a1;
    --accent: #245d49;
    --accent-strong: #1c4c3c;
  }

  .site-header,
  .hero,
  .research-toolbar,
  .app-status,
  .result-lead,
  .trend-section,
  .chart-section,
  .evidence-section,
  footer,
  dialog,
  .draft-heading,
  .draft-actions { display: none !important; }

  body,
  .research-shell,
  .draft-section,
  .draft-paper {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #ffffff;
  }

  .draft-section { display: block; }
  .draft-paper.agent-report { border: 0; }
}
