:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f9fb;
  --panel: #ffffff;
  --panel-elevated: #ffffff;
  --surface: #f2f4f6;
  --surface-strong: #e7ecf2;
  --ink: #191f28;
  --ink-strong: #0b1018;
  --muted: #6b7684;
  --muted-strong: #4e5968;
  --line: #e5e8eb;
  --line-strong: #d1d6db;
  --primary: #3182f6;
  --primary-dark: #1b64da;
  --button-primary: #1b64da;
  --primary-soft: #eaf3ff;
  --primary-soft-strong: #d8eaff;
  --success: #008768;
  --success-soft: #e5f8f2;
  --warning: #b76e00;
  --warning-soft: #fff4df;
  --danger: #e03131;
  --danger-soft: #fff0f0;
  --violet: #7c3aed;
  --violet-soft: #f1edff;
  --cyan: #0086a8;
  --cyan-soft: #e4f7fb;
  --chart-grid: #dfe5ec;
  --chart-axis: #a9b3c0;
  --chart-text: #4e5968;
  --chart-1: #3182f6;
  --chart-2: #008768;
  --chart-3: #e03131;
  --chart-4: #b76e00;
  --chart-5: #7c3aed;
  --chart-6: #0086a8;
  --shadow: 0 16px 36px rgba(25, 31, 40, .08);
  --shadow-soft: 0 8px 20px rgba(25, 31, 40, .05);
  --radius: 8px;
  --radius-sm: 6px;
  --max-width: 1320px;
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111318;
  --panel: #181d26;
  --panel-elevated: #1d2430;
  --surface: #242b38;
  --surface-strong: #2f3848;
  --ink: #f2f4f6;
  --ink-strong: #ffffff;
  --muted: #a8b2c0;
  --muted-strong: #d1d6df;
  --line: #303948;
  --line-strong: #465267;
  --primary: #5da2ff;
  --primary-dark: #8ec0ff;
  --button-primary: #1b64da;
  --primary-soft: #182b44;
  --primary-soft-strong: #203a5f;
  --success: #62d4a4;
  --success-soft: #14362b;
  --warning: #ffd166;
  --warning-soft: #3a2d14;
  --danger: #ff8a8a;
  --danger-soft: #3c1d22;
  --violet: #b69cff;
  --violet-soft: #27223f;
  --cyan: #57d2ed;
  --cyan-soft: #15343d;
  --chart-grid: #303948;
  --chart-axis: #657188;
  --chart-text: #c3ccda;
  --chart-1: #71adff;
  --chart-2: #62d4a4;
  --chart-3: #ff8a8a;
  --chart-4: #ffd166;
  --chart-5: #b69cff;
  --chart-6: #57d2ed;
  --shadow: 0 18px 44px rgba(0, 0, 0, .3);
  --shadow-soft: 0 10px 26px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: hidden; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary-dark); }
button, input { font: inherit; }
button { margin: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .56; }
::selection { color: var(--ink-strong); background: var(--primary-soft-strong); }
code {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .9em;
}
.muted { color: var(--muted); }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 58%);
  outline-offset: 3px;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(var(--max-width), calc(100% - 32px));
  margin: 14px auto 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel), transparent 8%);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}
.site-nav-brand {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  color: var(--ink-strong);
  font-weight: 900;
  white-space: nowrap;
}
.site-nav-links {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: thin;
}
.site-nav-links a, .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  color: var(--muted-strong);
  background: transparent;
  font-size: .88rem;
  font-weight: 800;
  white-space: nowrap;
}
.site-nav-links a:hover, .theme-toggle:hover { color: var(--ink-strong); background: var(--surface); }
.site-nav-brand.is-active { color: var(--primary-dark); }
.theme-toggle { gap: 8px; border-color: var(--line); background: var(--panel-elevated); }
.theme-toggle-icon {
  width: 16px;
  height: 16px;
  border: 4px solid var(--primary);
  border-radius: 50%;
  background: var(--panel);
  box-shadow: inset -3px -3px 0 var(--primary-soft-strong);
}

.hero, .section, .site-footer { width: min(var(--max-width), calc(100% - 32px)); margin-inline: auto; }
.hero {
  margin-top: 18px;
  margin-bottom: 48px;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr); gap: clamp(24px, 4vw, 48px); align-items: stretch; }
.hero-grid > *, .cockpit-grid > *, .project-grid > *, .feature-grid > * { min-width: 0; }
.hero-grid > div { display: flex; min-width: 0; flex-direction: column; justify-content: center; }
.eyebrow { margin: 0 0 8px; color: var(--primary-dark); font-size: .78rem; font-weight: 900; line-height: 1.4; letter-spacing: 0; text-transform: none; }
h1, h2, h3 { margin: 0; color: var(--ink-strong); letter-spacing: 0; }
h1 { max-width: 860px; font-size: clamp(2.45rem, 5vw, 4.4rem); line-height: 1.08; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.18; }
h3 { font-size: clamp(1.08rem, 1.8vw, 1.38rem); line-height: 1.3; }
.hero-copy { max-width: 820px; margin: 18px 0 0; color: var(--muted-strong); font-size: 1.04rem; line-height: 1.78; }
.hero-note {
  display: grid;
  align-content: center;
  min-width: 0;
  border: 1px solid var(--primary-soft-strong);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--ink);
  background: var(--primary-soft);
}
.hero-note strong { color: var(--ink-strong); font-size: 1.05rem; }
.hero-note p { margin: 10px 0 0; color: var(--muted-strong); line-height: 1.65; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  margin-top: 24px;
  padding: 2px 0;
}
.hero-actions a, .panel-link, .project-card a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--primary-soft-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: .84rem;
  font-weight: 850;
  transition: transform .16s ease, background .16s ease;
}
.hero-actions a:first-child { color: #ffffff; border-color: var(--button-primary); background: var(--button-primary); }
.hero-actions a:hover, .panel-link:hover, .project-card a:hover { color: var(--primary-dark); background: var(--primary-soft-strong); transform: translateY(-1px); }
.hero-actions a:first-child:hover { color: #ffffff; background: var(--primary-dark); }

.section { margin-bottom: 52px; scroll-margin-top: 84px; }
.section-heading { margin-bottom: 20px; }
.section-heading p:not(.eyebrow) { max-width: 880px; margin: 10px 0 0; color: var(--muted-strong); line-height: 1.72; }
.centered { text-align: center; }
.centered p:not(.eyebrow) { margin-inline: auto; }

.cockpit-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 16px; align-items: start; }
.briefing-panel { grid-column: 1; }
.watchlist-panel { grid-column: 2; }
.health-panel { grid-column: 1 / -1; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.summary-grid { display: grid; gap: 18px; }
.project-card, .feature-grid article, .panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}
.panel { padding: clamp(18px, 2.5vw, 26px); overflow: hidden; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-header.compact { margin-bottom: 14px; }
.panel-wide { min-width: 0; }
.project-card { display: flex; min-height: 238px; flex-direction: column; padding: 20px; }
.project-card .project-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: .84rem;
  font-weight: 950;
}
.project-card:nth-child(4n+2) .project-icon { color: var(--violet); background: var(--violet-soft); }
.project-card:nth-child(4n+3) .project-icon { color: var(--success); background: var(--success-soft); }
.project-card:nth-child(4n+4) .project-icon { color: var(--warning); background: var(--warning-soft); }
.project-card p { margin: 10px 0 18px; color: var(--muted-strong); line-height: 1.65; }
.project-card a { align-self: flex-start; margin-top: auto; }
.feature-grid article { border-top: 3px solid var(--primary); padding: 20px; box-shadow: none; }
.feature-grid article:nth-child(2) { border-top-color: var(--violet); }
.feature-grid article:nth-child(3) { border-top-color: var(--success); }
.feature-grid p { margin: 9px 0 0; color: var(--muted-strong); line-height: 1.65; }

.briefing-list, .watchlist-results { display: grid; gap: 9px; }
.briefing-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.health-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.briefing-item, .health-item, .watch-match {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 13px;
  background: var(--surface);
}
.briefing-item:nth-child(3n+2), .watch-match:nth-child(3n+2) { border-left-color: var(--violet); }
.briefing-item:nth-child(3n+3), .watch-match:nth-child(3n+3) { border-left-color: var(--success); }
.briefing-item.warning, .watch-match.warning, .health-item.warn { color: var(--warning); border-color: color-mix(in srgb, var(--warning), transparent 58%); border-left-color: var(--warning); background: var(--warning-soft); }
.health-item.ok { border-color: color-mix(in srgb, var(--success), transparent 62%); border-left-color: var(--success); background: var(--success-soft); }
.briefing-item span, .watch-match span, .health-item span { display: inline-flex; margin-bottom: 5px; color: var(--primary-dark); font-size: .73rem; font-weight: 900; }
.briefing-item strong, .watch-match strong, .health-item strong { display: block; color: var(--ink-strong); line-height: 1.35; overflow-wrap: anywhere; }
.briefing-item p, .watch-match p, .health-item p { margin: 6px 0 0; color: var(--muted-strong); line-height: 1.55; }
.health-item small, .watch-match small { display: block; margin-top: 7px; color: var(--muted); line-height: 1.5; }
.watch-match small { padding-top: 7px; border-top: 1px solid var(--line); }
.health-item { display: grid; align-content: start; gap: 3px; }
.health-item > div { display: flex; justify-content: space-between; gap: 8px; }
.health-link { justify-self: start; margin-top: 5px; color: var(--primary-dark); font-size: .8rem; font-weight: 900; }
.health-link:hover { text-decoration: underline; }

.watchlist-form { display: grid; gap: 8px; margin-bottom: 12px; }
.watchlist-form label { color: var(--muted-strong); font-size: .8rem; font-weight: 900; }
.watchlist-row { display: flex; gap: 8px; }
.watchlist-row input {
  min-width: 0;
  flex: 1;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--ink);
  background: var(--panel-elevated);
}
.watchlist-row button, .watchlist-results button {
  min-height: 40px;
  border: 1px solid var(--button-primary);
  border-radius: var(--radius-sm);
  padding: 8px 13px;
  color: #ffffff;
  background: var(--button-primary);
  font-weight: 900;
}
.watchlist-results button { min-height: 30px; margin: 0 3px 5px 0; border-color: var(--primary-soft-strong); padding: 5px 9px; color: var(--primary-dark); background: var(--primary-soft); font-size: .8rem; }

.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.metric-card { min-width: 0; min-height: 112px; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; background: var(--surface); }
.metric-card span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .77rem; font-weight: 850; }
.metric-card strong { display: block; color: var(--ink-strong); font-size: 1.14rem; line-height: 1.3; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metrics-only-panel .metric-row { margin-bottom: 0; }
.metrics-only-panel .metric-card { min-height: 96px; }
.panel-link { min-height: 36px; padding: 7px 11px; }
.status-line { margin: 13px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.status-line.warning { color: var(--warning); }
.status-line.error { color: var(--danger); }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--primary-soft-strong);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: .8rem;
  font-weight: 850;
}

.table-wrap {
  max-width: 100%;
  max-height: min(62vh, 620px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  scrollbar-gutter: stable;
}
table { width: 100%; min-width: 620px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 13px; color: var(--ink); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; z-index: 2; color: var(--muted-strong); background: var(--surface-strong); font-size: .81rem; font-weight: 900; }
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface), transparent 52%); }
tbody tr:hover { background: var(--primary-soft); }
tr:last-child td { border-bottom: 0; }

.chart-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chart-card {
  min-height: 340px;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  scrollbar-width: thin;
}
.chart-card > svg { display: block; width: 100%; min-width: 720px; height: auto; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 10px; color: var(--muted-strong); font-size: .84rem; }
.legend-key { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; }
.panel-detail { margin-top: 20px; }

.etf-detail-heading { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 13px; color: var(--ink); }
.etf-detail-heading strong { display: block; color: var(--ink-strong); font-size: 1.03rem; }
.etf-detail-heading span { display: block; margin-top: 4px; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.etf-detail-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.etf-detail-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); }
.etf-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.etf-detail-head strong, .etf-detail-head span { display: block; }
.etf-detail-head strong { color: var(--ink-strong); font-size: 1.08rem; }
.etf-detail-head span { margin-top: 5px; color: var(--muted); font-size: .86rem; }
.etf-detail-head a { flex: 0 0 auto; border-radius: var(--radius-sm); padding: 6px 9px; color: var(--primary-dark); background: var(--primary-soft); font-size: .78rem; font-weight: 900; }
.etf-mini-chart { margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--panel-elevated); }
.etf-mini-plot { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.etf-mini-chart svg { display: block; width: 100%; min-width: 960px; height: auto; }
.etf-mini-legend { margin-top: 12px; gap: 9px 16px; font-size: .84rem; line-height: 1.5; }
.etf-mini-series { transition: opacity .16s ease; }
.etf-mini-line { transition: opacity .16s ease, stroke-width .16s ease; }
.etf-mini-point { stroke: var(--panel-elevated); stroke-width: 1.6; transition: r .16s ease, opacity .16s ease; }
.etf-point-hit { cursor: crosshair; pointer-events: all; }
.etf-point-label { opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.etf-point-label rect { fill: color-mix(in srgb, var(--panel), transparent 3%); stroke: color-mix(in srgb, var(--series-color), transparent 42%); }
.etf-point-label text { fill: var(--series-color) !important; font-size: 12px; font-weight: 900; }
.etf-mini-chart svg:has(.etf-mini-series:hover) .etf-mini-series:not(:hover),
.etf-mini-chart svg:has(.etf-mini-series:focus-within) .etf-mini-series:not(:focus-within) { opacity: .18; }
.etf-mini-series:hover .etf-mini-line, .etf-mini-series:focus-within .etf-mini-line { stroke-width: 4.8; }
.etf-mini-series:hover .etf-mini-point, .etf-mini-series:focus-within .etf-mini-point { opacity: 1; }
.etf-data-point:hover .etf-mini-point, .etf-data-point:focus-visible .etf-mini-point { r: 6.8; }
.etf-data-point:hover .etf-point-label, .etf-data-point:focus-visible .etf-point-label { opacity: 1; }
.series-color-0 { --series-color: var(--chart-1); }
.series-color-1 { --series-color: var(--chart-2); }
.series-color-2 { --series-color: var(--chart-3); }
.series-color-3 { --series-color: var(--chart-4); }
.series-color-4 { --series-color: var(--chart-5); }
.series-color-5 { --series-color: var(--chart-6); }
.etf-mini-empty { display: grid; min-height: 122px; place-items: center; margin-bottom: 11px; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 12px; color: var(--muted); background: var(--panel-elevated); text-align: center; }
.etf-top10-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 0; padding: 0; list-style: none; }
.etf-top10-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; border-radius: var(--radius-sm); padding: 7px 8px; background: var(--panel-elevated); }
.etf-rank { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; color: var(--primary-dark); background: var(--primary-soft); font-size: .74rem; font-weight: 950; }
.etf-top10-list strong { min-width: 0; overflow: hidden; color: var(--ink-strong); font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.etf-top10-list em { color: var(--primary-dark); font-size: .8rem; font-style: normal; font-weight: 950; }
.etf-top10-list small { grid-column: 2 / 4; min-width: 0; overflow: hidden; color: var(--muted); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.etf-top10-empty { display: block !important; color: var(--muted); text-align: center; }

.chart-card svg text, .etf-mini-chart svg text { fill: var(--chart-text) !important; }
.chart-card svg line, .etf-mini-chart svg line { stroke: var(--chart-grid) !important; }
.chart-card svg path[stroke="#7dd3fc"], .etf-mini-chart svg path[stroke="#7dd3fc"] { stroke: var(--chart-1) !important; }
.chart-card svg path[stroke="#86efac"], .etf-mini-chart svg path[stroke="#86efac"] { stroke: var(--chart-2) !important; }
.chart-card svg path[stroke="#fb7185"], .etf-mini-chart svg path[stroke="#fb7185"] { stroke: var(--chart-3) !important; }
.chart-card svg path[stroke="#fbbf24"], .etf-mini-chart svg path[stroke="#fbbf24"] { stroke: var(--chart-4) !important; }
.chart-card svg path[stroke="#c4b5fd"], .etf-mini-chart svg path[stroke="#c4b5fd"] { stroke: var(--chart-5) !important; }
.chart-card svg path[stroke="#67e8f9"], .etf-mini-chart svg path[stroke="#67e8f9"] { stroke: var(--chart-6) !important; }
.chart-card svg circle[fill="#7dd3fc"], .etf-mini-chart svg circle[fill="#7dd3fc"] { fill: var(--chart-1) !important; }
.chart-card svg circle[fill="#86efac"], .etf-mini-chart svg circle[fill="#86efac"] { fill: var(--chart-2) !important; }
.chart-card svg circle[fill="#fb7185"], .etf-mini-chart svg circle[fill="#fb7185"] { fill: var(--chart-3) !important; }
.chart-card svg circle[fill="#fbbf24"], .etf-mini-chart svg circle[fill="#fbbf24"] { fill: var(--chart-4) !important; }
.chart-card svg circle[fill="#c4b5fd"], .etf-mini-chart svg circle[fill="#c4b5fd"] { fill: var(--chart-5) !important; }
.chart-card svg circle[fill="#67e8f9"], .etf-mini-chart svg circle[fill="#67e8f9"] { fill: var(--chart-6) !important; }
.legend-key[style*="#7dd3fc"] { background: var(--chart-1) !important; }
.legend-key[style*="#86efac"] { background: var(--chart-2) !important; }
.legend-key[style*="#fb7185"] { background: var(--chart-3) !important; }
.legend-key[style*="#fbbf24"] { background: var(--chart-4) !important; }
.legend-key[style*="#c4b5fd"] { background: var(--chart-5) !important; }
.legend-key[style*="#67e8f9"] { background: var(--chart-6) !important; }
.dram-legend-button line[stroke="#7dd3fc"] { stroke: var(--chart-1) !important; }
.dram-legend-button line[stroke="#86efac"] { stroke: var(--chart-2) !important; }
.dram-legend-button line[stroke="#fb7185"] { stroke: var(--chart-3) !important; }
.dram-legend-button line[stroke="#fbbf24"] { stroke: var(--chart-4) !important; }
.dram-legend-button line[stroke="#c4b5fd"] { stroke: var(--chart-5) !important; }
.dram-legend-button line[stroke="#67e8f9"] { stroke: var(--chart-6) !important; }

.dram-chart-collection {
  min-height: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}
.dram-source-grid { display: grid; gap: 14px; }
.dram-source-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
}
.dram-source-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.dram-source-heading h4 { margin: 0; color: var(--ink-strong); font-size: 1.16rem; line-height: 1.3; letter-spacing: 0; }
.dram-source-heading p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted-strong); font-size: .84rem; line-height: 1.45; }
.dram-source-heading > span {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--primary-soft-strong);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: .78rem;
  font-weight: 900;
}
.dram-chart-toolbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.dram-chart-toolbar .dram-chart-readout {
  min-width: 0;
  flex: 1;
  margin: 0;
}
.dram-scale-control {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  background: var(--panel-elevated);
}
.dram-scale-control button {
  min-height: 44px;
  border: 0;
  border-radius: calc(var(--radius-sm) - 3px);
  padding: 7px 10px;
  color: var(--muted-strong);
  background: transparent;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}
.dram-scale-control button[aria-pressed="true"] {
  color: var(--primary-dark);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary-soft-strong);
}
.dram-legend {
  gap: 6px;
  margin: 0 0 10px;
}
.dram-legend-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted-strong);
  background: transparent;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.3;
}
.dram-legend-button:hover,
.dram-legend-button:focus-visible {
  color: var(--ink-strong);
  border-color: var(--line-strong);
  background: var(--panel-elevated);
}
.dram-legend-button[aria-pressed="true"] {
  color: var(--primary-dark);
  border-color: var(--primary-soft-strong);
  background: var(--primary-soft);
}
.dram-legend-button svg { width: 30px; height: 10px; flex: 0 0 auto; overflow: visible; }
.dram-chart-frame {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-elevated);
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}
.dram-chart-frame svg { display: block; width: 100%; min-width: 920px; height: auto; }
.dram-series { outline: none; opacity: 1; transition: opacity .14s ease, filter .14s ease; }
.dram-chart-frame svg:has(.dram-series:hover) .dram-series:not(:hover) { opacity: .18; }
.dram-series:hover,
.dram-series.is-keyboard-active { opacity: 1; filter: drop-shadow(0 5px 10px rgba(25, 31, 40, .13)); }
.dram-series-hit {
  stroke: transparent !important;
  stroke-width: 18;
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: crosshair;
  pointer-events: stroke;
}
.dram-series-line { stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: stroke-width .14s ease; }
.dram-series:hover .dram-series-line,
.dram-series.is-keyboard-active .dram-series-line { stroke-width: 4; }
.dram-data-point { cursor: crosshair; stroke: var(--panel-elevated); stroke-width: 1.7; transition: r .14s ease, stroke-width .14s ease; }
.dram-series:hover .dram-data-point { r: 4.8; stroke-width: 2.2; }
.dram-selection-guide {
  stroke: var(--chart-axis) !important;
  stroke-width: 1.4;
  stroke-dasharray: 4 4;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}
.dram-selection-guide[hidden] { display: none; }
.dram-chart-help { margin: 8px 2px 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }

.skeleton-line { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--muted); background: var(--surface); }
.site-footer { margin-top: 48px; margin-bottom: 76px; color: var(--muted); line-height: 1.7; text-align: center; }
.page-jump-nav { position: fixed; right: clamp(12px, 2vw, 24px); bottom: clamp(14px, 2vw, 24px); z-index: 1000; display: grid; gap: 8px; pointer-events: none; }
.page-jump-nav a { pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--muted-strong); background: color-mix(in srgb, var(--panel), transparent 6%); box-shadow: var(--shadow-soft); font-size: 1rem; font-weight: 900; backdrop-filter: blur(14px); }
.page-jump-nav a:hover { color: var(--primary-dark); border-color: var(--primary-soft-strong); background: var(--primary-soft); transform: translateY(-1px); }
#page-bottom { scroll-margin-top: 24px; }

@media (max-width: 1120px) {
  .site-nav { grid-template-columns: 1fr; align-items: stretch; }
  .site-nav-brand { justify-content: center; }
  .theme-toggle { width: 100%; }
  .hero-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .etf-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 840px) {
  .cockpit-grid { grid-template-columns: 1fr; }
  .briefing-panel, .watchlist-panel, .health-panel { grid-column: 1; }
  .feature-grid { grid-template-columns: 1fr; }
  .panel-header { flex-direction: column; }
}

@media (max-width: 640px) {
  body { font-size: 15px; word-break: normal; overflow-wrap: anywhere; }
  .site-nav, .hero, .section, .site-footer { width: calc(100% - 24px); }
  .site-nav { margin-top: 10px; padding: 8px; }
  .site-nav-links { padding-bottom: 5px; }
  .hero { margin-top: 12px; margin-bottom: 36px; padding: 22px 16px; }
  h1 { max-width: 100%; font-size: 2.08rem; line-height: 1.16; word-break: break-word; }
  h2 { font-size: 1.58rem; }
  .hero-copy, .hero-note, .section-heading p, .project-card p, .briefing-item, .health-item, .watch-match { max-width: 100%; word-break: break-word; }
  .hero-actions { margin-top: 20px; }
  .section { margin-bottom: 40px; }
  .briefing-list, .health-list, .project-grid, .metric-row { grid-template-columns: 1fr; }
  .panel, .project-card, .feature-grid article { padding: 16px; }
  .project-card { min-height: 0; }
  .watchlist-row { flex-direction: column; }
  .watchlist-row button { width: 100%; }
  .etf-detail-heading { flex-direction: column; }
  .etf-detail-card { padding: 14px; }
  .etf-mini-chart { padding: 8px; }
  .etf-mini-chart svg { min-width: 900px; }
  .etf-top10-list { grid-template-columns: 1fr; }
  .dram-source-heading { flex-direction: column; }
  table { min-width: 580px; }
  .table-wrap { max-height: min(60vh, 540px); }
  .chart-card { min-height: 300px; }
  .page-jump-nav { right: 10px; bottom: 10px; gap: 6px; }
  .page-jump-nav a { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Quant Research common design v2.4 — compact results-first shell */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 1000;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--button-primary);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform .16s ease;
}
.skip-link:focus { color: #fff; transform: translateY(0); }

body {
  font-size: 15px;
  line-height: 1.55;
}

.site-nav {
  display: block;
  width: 100%;
  min-height: 58px;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: color-mix(in srgb, var(--panel), transparent 4%);
  box-shadow: none;
  backdrop-filter: blur(16px);
}
.site-nav-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  width: min(var(--max-width), calc(100% - 32px));
  min-height: 58px;
  margin-inline: auto;
}
.site-nav-brand {
  min-height: 44px;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
}
.site-nav-links {
  gap: 2px;
  padding: 0;
  overscroll-behavior-x: contain;
}
.site-nav-links a {
  min-height: 44px;
  padding: 8px 9px;
  font-size: 12px;
  font-weight: 650;
}
.theme-toggle {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  gap: 0;
  padding: 0;
  border-color: var(--line);
  font-weight: 650;
}

.page-header,
.section {
  width: min(var(--max-width), calc(100% - 32px));
  margin-inline: auto;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px 0 20px;
}
.eyebrow {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
}
h1,
h2,
h3 {
  font-weight: 700;
}
h1 {
  max-width: none;
  font-size: clamp(1.75rem, 3vw, 2.2rem);
  line-height: 1.12;
}
h2 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.2;
}
h3 {
  font-size: clamp(1.04rem, 1.5vw, 1.24rem);
  line-height: 1.32;
}

.hub-status-strip {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 8px;
  margin-top: 0;
}
.hub-status-strip article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  background: var(--panel);
}
.hub-status-strip span,
.hub-status-strip strong {
  display: block;
}
.hub-status-strip span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.hub-status-strip strong {
  color: var(--ink-strong);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.hub-status-strip article:last-child {
  border-color: color-mix(in srgb, var(--warning), transparent 68%);
  background: color-mix(in srgb, var(--warning-soft), transparent 30%);
}

.section {
  margin-bottom: 28px;
  scroll-margin-top: 72px;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.cockpit-grid {
  grid-template-columns: minmax(0, 2.15fr) minmax(280px, 1fr);
  gap: 12px;
}
.cockpit-grid > * {
  min-width: 0;
}

.panel {
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: none;
}
.panel-header {
  flex-direction: row;
  gap: 14px;
  margin-bottom: 12px;
}
.panel-header.compact {
  margin-bottom: 12px;
}
.panel-link,
.watchlist-row button {
  min-height: 44px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
}
.panel-link {
  border: 1px solid var(--primary-soft-strong);
  border-radius: var(--radius-sm);
  color: var(--primary-dark);
  background: var(--primary-soft);
}
.panel-link:hover {
  color: var(--primary-dark);
  background: var(--primary-soft-strong);
  transform: none;
}
.status-line {
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.metrics-only-panel .status-line {
  margin-bottom: 12px;
}

.briefing-list,
.watchlist-results {
  gap: 7px;
}
.briefing-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.briefing-item,
.health-item,
.watch-match {
  padding: 11px 12px;
  border-left-width: 2px;
}
.briefing-item span,
.watch-match span,
.health-item span {
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: 700;
}
.briefing-item strong,
.watch-match strong,
.health-item strong {
  font-weight: 700;
}
.briefing-item p,
.watch-match p,
.health-item p {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.48;
}
.health-item small,
.watch-match small {
  margin-top: 5px;
  font-size: 12px;
}
.health-link,
.watchlist-form label {
  font-weight: 700;
}
.watchlist-row input {
  min-height: 44px;
}
.watchlist-results button {
  min-height: 36px;
  font-weight: 700;
}

.summary-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}
.summary-grid > .panel {
  grid-column: 1 / -1;
}
.metric-row {
  gap: 8px;
  margin-bottom: 12px;
}
.metric-card {
  min-height: 82px;
  padding: 12px;
  border-radius: var(--radius);
}
.metric-card span {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 650;
}
.metric-card strong {
  font-size: 1.15rem;
  font-weight: 700;
}
.metrics-only-panel .metric-card {
  min-height: 86px;
}
.badge {
  font-weight: 700;
}

.table-wrap {
  border-radius: var(--radius);
}
table {
  font-size: 13px;
}
th,
td {
  padding: 10px 11px;
}
th {
  font-size: 12px;
  font-weight: 700;
}
.panel--momentum :is(th, td):nth-child(1),
.panel--momentum :is(th, td):nth-child(3),
.panel--momentum :is(th, td):nth-child(4),
.panel--etf :is(th, td):nth-child(n+3),
.panel--sox :is(th, td):nth-child(1),
.panel--sox :is(th, td):nth-child(3),
.panel--sox :is(th, td):nth-child(4),
.panel--sox :is(th, td):nth-child(5) {
  text-align: right;
}
.panel--momentum :is(th, td):nth-child(2),
.panel--etf :is(th, td):nth-child(1),
.panel--etf :is(th, td):nth-child(2),
.panel--sox :is(th, td):nth-child(2),
.panel--sox :is(th, td):nth-child(6) {
  text-align: left;
}

.chart-card {
  min-height: 320px;
}
.chart-legend {
  font-size: 12px;
}
.chart-keyboard-readout {
  min-height: 38px;
  margin: 8px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--ink-strong);
  background: var(--panel-elevated);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.chart-keyboard-readout span {
  color: var(--muted);
}
.dram-source-card {
  padding: 14px;
}
.dram-source-heading h4,
.dram-source-heading > span,
.etf-point-label text {
  font-weight: 700;
}
.dram-chart-frame.is-keyboard-active .dram-series:not(.is-keyboard-active) {
  opacity: .16;
}
.dram-series.is-keyboard-active .dram-series-line {
  stroke-width: 4;
}
.dram-series.is-keyboard-active .dram-data-point.is-keyboard-active {
  r: 6.2;
  stroke-width: 2.8;
  filter: drop-shadow(0 0 5px var(--series-color));
}

.panel-detail {
  margin-top: 16px;
}
.etf-detail-heading {
  margin-bottom: 9px;
}
.etf-detail-heading strong {
  font-size: 1rem;
}
.etf-detail-grid {
  gap: 8px;
}
.etf-detail-card {
  padding: 0;
  background: var(--surface);
}
.etf-detail-card > summary {
  list-style: none;
}
.etf-detail-card > summary::-webkit-details-marker {
  display: none;
}
.etf-detail-head {
  position: relative;
  align-items: center;
  min-height: 58px;
  margin: 0;
  padding: 10px 42px 10px 13px;
  cursor: pointer;
}
.etf-detail-head::after {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--muted);
  content: "⌄";
  transform: translateY(-50%);
  transition: transform .16s ease;
}
.etf-detail-card[open] .etf-detail-head::after {
  transform: translateY(-50%) rotate(180deg);
}
.etf-detail-head strong {
  font-size: 14px;
  font-weight: 700;
}
.etf-detail-head span {
  margin-top: 2px;
  font-size: 12px;
}
.etf-detail-head .etf-detail-summary-value {
  flex: 0 0 auto;
  margin: 0;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.etf-detail-body {
  position: relative;
  border-top: 1px solid var(--line);
  padding: 14px;
}
.etf-detail-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  margin-bottom: 10px;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 700;
}
.etf-mini-chart {
  padding: 12px;
}
.etf-mini-plot.is-keyboard-active .etf-mini-series:not(.is-keyboard-active) {
  opacity: .18;
}
.etf-mini-series.is-keyboard-active .etf-mini-line {
  stroke-width: 4.8;
}
.etf-data-point.is-keyboard-active .etf-mini-point {
  r: 6.8;
}
.etf-data-point.is-keyboard-active .etf-point-label {
  opacity: 1;
}
.etf-rank,
.etf-top10-list em {
  font-weight: 700;
}

.panel--link {
  align-self: stretch;
}
.project-link-card {
  display: grid;
  min-height: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: start;
}
.project-link-identity {
  display: flex;
  gap: 10px;
  align-items: center;
}
.project-monogram {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 700;
}
.project-link-card > p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted-strong);
}
.project-link-card > .panel-link {
  grid-column: 2;
  grid-row: 1;
}

.operations-section {
  padding-bottom: 72px;
}
.operations-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.operations-panel > summary {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
}
.operations-panel > summary::-webkit-details-marker {
  display: none;
}
.operations-panel > summary small,
.operations-panel > summary strong {
  display: block;
}
.operations-panel > summary small {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.operations-panel > summary strong {
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: 700;
}
#operations-summary {
  color: var(--muted-strong);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.operations-body {
  border-top: 1px solid var(--line);
  padding: 16px;
}
.operations-lead,
.research-disclaimer {
  color: var(--muted-strong);
  font-size: 13px;
}
.operations-lead {
  margin: 0 0 12px;
}
.research-disclaimer {
  margin: 12px 0 0;
}
.health-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.page-jump-nav a {
  width: 44px;
  height: 44px;
  font-weight: 700;
}

@media (max-width: 1120px) {
  .summary-grid > .panel {
    grid-column: 1 / -1;
  }
  .health-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .cockpit-grid {
    grid-template-columns: 1fr;
  }
  .briefing-panel,
  .watchlist-panel {
    grid-column: 1;
  }
}

@media (max-width: 760px) {
  .site-nav-inner {
    grid-template-columns: minmax(0, 1fr) 44px;
    grid-template-rows: 50px 44px;
    gap: 0 8px;
    width: calc(100% - 24px);
    padding-bottom: 6px;
  }
  .site-nav-brand {
    justify-content: flex-start;
  }
  .site-nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-bottom: 2px;
  }
  .theme-toggle {
    grid-column: 2;
    grid-row: 1;
  }
  .page-header,
  .section {
    width: calc(100% - 24px);
  }
  .page-header {
    display: block;
    padding: 20px 0 16px;
  }
  h1 {
    font-size: 1.75rem;
  }
  h2 {
    font-size: 1.45rem;
  }
  .hub-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
  }
  .hub-status-strip article:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .section {
    margin-bottom: 32px;
  }
  .panel {
    padding: 16px;
  }
  .panel-header {
    flex-direction: row;
  }
  .briefing-list,
  .health-list,
  .metric-row {
    grid-template-columns: 1fr;
  }
  .watchlist-row {
    flex-direction: row;
  }
  .watchlist-row button {
    width: auto;
  }
  .project-link-card {
    grid-template-columns: 1fr;
  }
  .project-link-card > .panel-link {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }
  .etf-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .etf-detail-head .etf-detail-summary-value {
    margin-top: 4px;
  }
  .etf-top10-list {
    grid-template-columns: 1fr;
  }
  .dram-source-heading {
    flex-direction: column;
  }
  .dram-chart-toolbar {
    flex-direction: column;
  }
  .dram-scale-control {
    width: 100%;
  }
  .dram-scale-control button {
    min-width: 0;
    flex: 1;
    white-space: normal;
  }
  .dram-legend {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .dram-legend-button {
    flex: 0 0 auto;
    max-width: 290px;
    text-align: left;
  }
  .operations-panel > summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .page-jump-nav {
    display: none;
  }
}

@media (max-width: 420px) {
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }
  .panel-link {
    align-self: flex-start;
  }
}

/* Hub overview: presentation only; source data and chart scales are unchanged. */
.page-heading { flex: 0 0 auto; }
.page-heading .eyebrow { color: var(--muted-strong); font-size: 11px; letter-spacing: .1em; }
.hub-status-strip { min-width: 0; }
.hub-status-strip article { border: 0; border-left: 1px solid var(--line-strong); border-radius: 0; padding: 4px 18px; background: transparent; }
.hub-status-strip article:last-child { border-color: var(--line-strong); background: transparent; }
#hub-status-attention[data-state="warning"] { color: var(--warning); }
.hub-status-strip strong { font-size: 14px; }
.section-index { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: 6px; margin-bottom: 22px; }
.section-index a { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: var(--radius-sm); color: var(--muted-strong); font-size: 13px; font-weight: 650; }
.section-index a:hover { color: var(--primary-dark); background: var(--primary-soft); }
.section-index a:last-child { margin-left: auto; }
.section-meta { color: var(--muted-strong); font-size: 12px; }
.research-sidebar { display: grid; gap: 12px; align-content: start; min-width: 0; }
.research-sidebar .watchlist-panel { grid-column: auto; }
.watchlist-results > p { margin: 4px 0 0; }
.news-headlines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; }
.news-headlines li { min-width: 0; border-top: 1px solid var(--line); padding-top: 14px; }
.news-headlines a { display: block; color: var(--ink-strong); font-size: 16px; font-weight: 650; line-height: 1.55; }
.news-headlines a:hover { color: var(--primary-dark); }
.news-headlines a span { color: var(--primary-dark); }
.news-headlines p { margin: 8px 0 0; color: var(--muted-strong); font-size: 13px; line-height: 1.65; }
#news-health { margin-top: 12px; }
.briefing-list { gap: 0 18px; }
.briefing-item,
.briefing-item:nth-child(3n+2),
.briefing-item:nth-child(3n+3),
.briefing-item.warning { display: block; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.briefing-item:hover strong { color: var(--primary-dark); }
.briefing-item .briefing-kicker { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--muted-strong); font-size: 12px; }
.briefing-item .briefing-state { flex-shrink: 0; color: var(--muted); font-size: 11px; font-weight: 500; }
.briefing-item.warning .briefing-state { color: var(--warning); }
.briefing-item strong { font-size: 14px; font-weight: 600; line-height: 1.5; }
.briefing-item:last-child { border-bottom: 0; }
.summary-group-heading { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; padding-top: 12px; scroll-margin-top: calc(var(--quant-shared-nav-height) + 16px); }
.summary-group-heading h3 { margin: 0; color: var(--ink-strong); font-size: 16px; }
.summary-group-heading span { font-size: 12px; color: var(--muted-strong); }
.summary-grid > .panel { scroll-margin-top: calc(var(--quant-shared-nav-height) + 16px); }
.summary-grid > :is(.panel--fearngreed, .panel--regime, .panel--momentum) { grid-column: span 6; }
.panel-header h4 { margin: 0; color: var(--ink-strong); font-size: 17px; line-height: 1.4; font-weight: 700; }
.panel-header .eyebrow { color: var(--muted-strong); font-size: 11px; font-weight: 600; }
.panel-link { flex: 0 0 auto; }
.summary-grid .metric-row { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
:is(.panel--momentum, .panel--fearngreed, .panel--regime) .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric-card { border: 0; border-radius: var(--radius-sm); }
.metric-card strong { white-space: pre-line; }
.status-line { font-variant-numeric: tabular-nums; }
.status-line.warning, .status-line.error { padding: 0; border: 0; background: transparent; }
.watchlist-results { max-height: 420px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.watch-match, .watch-match:nth-child(3n+2), .watch-match:nth-child(3n+3) { border-left-color: var(--line-strong); }
.source-notes { margin: 10px 0 0; padding-left: 18px; color: var(--muted-strong); font-size: 12px; }
.source-notes li + li { margin-top: 6px; }
.source-links { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; font-size: 12px; color: var(--primary-dark); }
.source-links a:hover { text-decoration: underline; }
.operations-panel { scroll-margin-top: calc(var(--quant-shared-nav-height) + 16px); }
#news-title { scroll-margin-top: calc(var(--quant-shared-nav-height) + 32px); }
.table-wrap { scrollbar-width: thin; }
summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
@media (max-width: 1100px) {
  .page-header { align-items: flex-start; flex-direction: column; gap: 16px; }
  .hub-status-strip { width: 100%; grid-template-columns: 1fr 1.4fr 1fr; }
  .hub-status-strip article:first-child { border-left: 0; padding-left: 0; }
  .summary-grid > :is(.panel--momentum) { grid-column: 1 / -1; }
  .cockpit-grid { grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr); }
  .briefing-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hub-status-strip { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
  .hub-status-strip article { padding: 0; border: 0; }
  .hub-status-strip article:last-child { text-align: right; }
  .hub-status-strip article:nth-child(2) { display: flex; align-items: baseline; gap: 12px; }
  .section-index { gap: 0; padding-block: 4px; }
  .section-index a { padding: 8px 12px; min-height: 44px; }
  .section-index a:last-child { margin-left: 0; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .cockpit-grid { grid-template-columns: 1fr; }
  .summary-grid > :is(.panel--fearngreed, .panel--regime) { grid-column: 1 / -1; }
  .summary-grid .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-group-heading { flex-wrap: wrap; gap: 4px 12px; }
  .metric-card { min-height: 78px; padding: 10px; }
  .metric-card strong { font-size: 1.05rem; }
  .panel-header { align-items: flex-start; flex-direction: row; gap: 8px; }
  .panel-header h4 { font-size: 16px; }
  .panel-link { padding-inline: 9px; font-size: 11px; }
  .briefing-item strong { font-size: 14px; }
  .news-headlines { grid-template-columns: 1fr; gap: 18px; }
  .panel--momentum table { min-width: 0; width: 100%; }
  .panel--momentum :is(th, td) { padding: 10px 6px; font-size: 12px; white-space: nowrap; }
}
@media (max-width: 359px) {
  .panel-header { flex-wrap: wrap; }
  .summary-grid .metric-row { grid-template-columns: 1fr; }
  .hub-status-strip article:nth-child(2) { display: block; }
}

/* News leads the reading order; market scatter uses the publisher's raw units. */
.news-section { scroll-margin-top: calc(var(--quant-shared-nav-height) + 16px); }
.news-section .panel-header { align-items: center; margin-bottom: 6px; }
.news-section .panel-header h2 { margin: 0; font-size: 21px; }
.news-section .status-line { margin-bottom: 16px; }
.news-headlines a { font-size: 17px; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
.news-headlines p { font-size: 14px; line-height: 1.75; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.news-headlines li { padding-top: 16px; }
.panel--fearngreed { min-width: 0; }
.fear-scatter { --fear: #c4415a; --greed: #14815f; margin: 0; }
html[data-theme="dark"] .fear-scatter { --fear: #f38b9e; --greed: #65d3af; }
.fear-scatter-mount { min-width: 0; min-height: 360px; }
.scatter-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-bottom: 10px; font-size: 12px; color: var(--muted-strong); }
.scatter-legend span { display: inline-flex; align-items: center; gap: 7px; }
.scatter-legend span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #7892ad; }
.scatter-legend .current::before { width: 9px; height: 9px; background: var(--panel); border: 2px solid var(--primary-dark); }
.scatter-legend .fit::before { width: 18px; height: 0; border-top: 2px dashed var(--ink-strong); background: none; }
.scatter-frame { border-radius: 6px; }
.scatter-frame:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.scatter-frame svg { display: block; width: 100%; height: auto; overflow: visible; }
.scatter-frame text { fill: var(--muted-strong); font-family: inherit; font-size: 12px; font-variant-numeric: tabular-nums; }
.scatter-frame .scatter-axis-title { fill: var(--ink-strong); font-size: 12px; font-weight: 600; }
.scatter-grid { stroke: var(--line); stroke-width: 1; }
.scatter-zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; }
.scatter-fit { stroke: var(--ink-strong); stroke-width: 1.8; stroke-dasharray: 7 4; opacity: .8; }
.fear-point { fill: #8091a5; stroke: var(--panel); stroke-width: .6; }
.fear-point.fear, .fear-point.extreme_fear { fill: var(--fear); }
.fear-point.greed, .fear-point.extreme_greed { fill: var(--greed); }
.fear-point.fear, .fear-point.greed { fill: var(--panel); stroke-width: 1.5; }
.fear-point.fear { stroke: var(--fear); }
.fear-point.greed { stroke: var(--greed); }
.fear-point.is-current { stroke: var(--primary-dark); stroke-width: 2.5; }
.scatter-selected, .price-selected { fill: none; stroke: var(--ink-strong); stroke-width: 1.5; pointer-events: none; }
.fear-price-line { fill: none; stroke: var(--muted); stroke-width: 1.8; opacity: .65; stroke-linejoin: round; }
.fear-price-cursor { stroke: var(--ink-strong); stroke-width: 1; stroke-dasharray: 3 3; opacity: .6; pointer-events: none; }
.price-observation.neutral:not(.is-current) { fill: var(--muted); stroke: none; }
.fear-price-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 4px; }
.fear-price-heading h4 { margin: 0; font-size: 13px; font-weight: 650; }
.fear-price-heading span { font-size: 11px; color: var(--muted-strong); }
.fear-price-empty { margin-top: 18px; }
.fear-state { display: inline-block; margin-left: 8px; font-style: normal; font-weight: 650; color: var(--muted-strong); }
.fear-state.fear, .fear-state.extreme_fear { color: var(--fear); }
.fear-state.greed, .fear-state.extreme_greed { color: var(--greed); }
.scatter-frame .scatter-current-label { fill: var(--primary-dark); font-weight: 750; stroke: var(--panel); stroke-width: 4px; paint-order: stroke; }
.scatter-fear { fill: #dc596a; fill-opacity: .06; }
.scatter-fear-extreme { fill: #dc596a; fill-opacity: .13; }
.scatter-greed { fill: #249d77; fill-opacity: .06; }
.scatter-greed-extreme { fill: #249d77; fill-opacity: .13; }
.scatter-readout { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); color: var(--muted-strong); font-size: 13px; font-variant-numeric: tabular-nums; }
.scatter-readout strong { flex-basis: 100%; color: var(--ink-strong); font-size: 12px; }
.scatter-readout b { color: var(--ink-strong); font-size: 16px; font-weight: 650; }
.scatter-zones { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; margin-top: 8px; color: var(--muted-strong); font-size: 10px; }
.scatter-zones span { display: inline-flex; align-items: center; gap: 5px; }
.scatter-zones span::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--line); }
.scatter-zones .fear::before, .scatter-zones .fear-extreme::before { border-radius: 50%; border: 1.5px solid var(--fear); background: var(--panel); }
.scatter-zones .fear-extreme::before { background: var(--fear); }
.scatter-zones .greed::before, .scatter-zones .greed-extreme::before { border-radius: 0; transform: rotate(45deg); border: 1.5px solid var(--greed); background: var(--panel); width: 6px; height: 6px; }
.scatter-zones .greed-extreme::before { background: var(--greed); }
.scatter-zones small { flex-basis: 100%; text-align: right; font-size: 10px; }
@media (max-width: 760px) {
  .news-headlines a { font-size: 16px; }
  .news-headlines p { font-size: 14px; }
  .news-section .panel-header h2 { font-size: 20px; }
  .fear-scatter-mount { min-height: 320px; }
  .scatter-legend { gap: 8px 14px; font-size: 11px; }
  .scatter-readout { padding: 10px 12px; gap: 6px 14px; }
  .scatter-readout b { font-size: 15px; }
}

/* Matching factor card tracks keep headers, metrics and holdings aligned. */
:is(.panel--momentum) .metric-row { grid-template-rows: repeat(2, minmax(88px, 1fr)); }
:is(.panel--momentum) .metric-card:first-child strong { font-size: 15px; line-height: 1.5; }
:is(.panel--momentum) .metric-card { display: flex; flex-direction: column; justify-content: flex-start; }
:is(.panel--momentum) .metric-card strong { line-height: 1.5; }
@media (min-width: 1101px) {
  .summary-grid > :is(.panel--momentum) { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; }
  :is(.panel--momentum) .table-wrap { align-self: start; }
}
@media (max-width: 359px) {
  :is(.panel--momentum) .metric-row { grid-template-rows: none; }
}

.regime-trend { --regime-on: #2764d8; --regime-transition: #ad6b05; --regime-off: #bd466b; margin: 0; min-width: 0; }
html[data-theme="dark"] .regime-trend { --regime-on: #82afff; --regime-transition: #e6b34e; --regime-off: #ee90ad; }
.regime-trend-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; color: var(--muted-strong); font-size: 12px; }
.regime-trend-toolbar label { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.regime-trend-window { min-height: 36px; width: auto; padding: 5px 25px 5px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink); font: inherit; }
.regime-trend-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; color: var(--muted-strong); font-size: 12px; }
.regime-trend-legend span { display: inline-flex; align-items: center; gap: 6px; }
.regime-trend-legend i { width: 18px; border-top: 3px solid var(--regime-on); }
.regime-trend-legend .transition i { border-color: var(--regime-transition); border-top-style: dashed; }
.regime-trend-legend .risk_off i { border-color: var(--regime-off); border-top-style: dotted; }
.regime-trend-legend small { font-size: 10px; }
.regime-trend-readout { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12px; font-variant-numeric: tabular-nums; }
.regime-trend-date { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; color: var(--muted-strong); }
.regime-trend-date strong { color: var(--ink-strong); font-size: 14px; }
.regime-trend-vectors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.regime-trend-vectors > div > span { color: var(--muted-strong); font-size: 11px; font-weight: 600; }
.regime-trend-vectors > div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.regime-trend-vectors dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 6px 0 0; }
.regime-trend-vectors dt { color: var(--muted-strong); font-size: 10px; white-space: nowrap; }
.regime-trend-vectors dd { margin: 2px 0 0; color: var(--ink-strong); font-size: 14px; font-weight: 650; }
.regime-trend-result { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 8px; margin-top: 10px; border-top: 1px solid var(--line); color: var(--muted-strong); font-size: 11px; }
.regime-trend-result b { margin-left: 4px; color: var(--ink-strong); font-weight: 600; }
.regime-trend-frame { margin-top: 14px; border-radius: 4px; }
.regime-trend-frame:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.regime-trend-frame svg { display: block; width: 100%; height: auto; overflow: visible; }
.regime-trend-frame text { font-family: inherit; font-size: 11px; fill: var(--muted-strong); font-variant-numeric: tabular-nums; }
.regime-trend-frame .regime-trend-title { fill: var(--ink-strong); font-size: 12px; font-weight: 650; }
.regime-trend-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.regime-trend-band { fill-opacity: .07; pointer-events: none; }
.regime-trend-band.risk_on { fill: var(--regime-on); }
.regime-trend-band.transition { fill: var(--regime-transition); }
.regime-trend-band.risk_off { fill: var(--regime-off); }
.regime-trend-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.regime-trend-line.forecast { stroke-width: 2.3; }
.regime-trend-line.risk_on, .regime-trend-leader.risk_on, .regime-trend-end.risk_on, .regime-trend-focus.risk_on { stroke: var(--regime-on); }
.regime-trend-line.transition, .regime-trend-leader.transition, .regime-trend-end.transition, .regime-trend-focus.transition { stroke: var(--regime-transition); }
.regime-trend-line.risk_off, .regime-trend-leader.risk_off, .regime-trend-end.risk_off, .regime-trend-focus.risk_off { stroke: var(--regime-off); }
.regime-trend-line.transition { stroke-dasharray: 7 5; }
.regime-trend-line.risk_off { stroke-dasharray: 2 5; }
.regime-trend-leader { fill: none; stroke-width: 1; opacity: .8; }
.regime-trend-end, .regime-trend-focus { fill: var(--panel); stroke-width: 2; }
.regime-trend-end-label { font-weight: 650 !important; }
.regime-trend-frame .regime-trend-end-label.risk_on { fill: var(--regime-on); }
.regime-trend-frame .regime-trend-end-label.transition { fill: var(--regime-transition); }
.regime-trend-frame .regime-trend-end-label.risk_off { fill: var(--regime-off); }
.regime-trend-outcome { stroke: var(--panel); stroke-width: .5; }
.regime-trend-outcome.risk_on { fill: var(--regime-on); }
.regime-trend-outcome.transition { fill: var(--regime-transition); }
.regime-trend-outcome.risk_off { fill: var(--regime-off); }
.regime-trend-outcome.pending { fill: var(--panel); stroke: var(--muted); stroke-dasharray: 2 2; }
.regime-trend-outcome.is-active { stroke: var(--ink-strong); stroke-width: 2; }
.regime-trend-frame .regime-trend-outcome-title { font-size: 10px; font-weight: 600; }
.regime-trend-cursor { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; pointer-events: none; }
@media (max-width: 760px) {
  .regime-trend-vectors { grid-template-columns: 1fr; gap: 10px; }
  .regime-trend-vectors > div + div { border-left: 0; padding-left: 0; padding-top: 8px; border-top: 1px solid var(--line); }
  .regime-trend-vectors > div { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 6px; align-items: center; }
  .regime-trend-vectors dl { margin: 0; }
  .regime-trend-vectors dd { font-size: 14px; }
  .regime-trend-toolbar { font-size: 11px; }
  .regime-trend-legend { gap: 7px 12px; font-size: 11px; }
  .regime-trend-result { gap: 6px 12px; }
}
.panel--momentum table { min-width: 0; }

/* Factor preview: identity, exposure, ranked weights, then exact source detail. */
:is(.panel--momentum) { --factor-color: #3269c7; --factor-soft: #edf3fc; }
html[data-theme="dark"] :is(.panel--momentum) { --factor-color: #8bb4fa; --factor-soft: #222f45; }
.factor-overview { min-width: 0; }
.factor-identity { min-height: 84px; padding: 10px 14px; border-radius: 8px; background: var(--factor-soft); border-left: 3px solid var(--factor-color); display: flex; flex-direction: column; gap: 3px; }
.factor-identity > span { color: var(--muted-strong); font-size: 11px; font-weight: 600; }
.factor-identity > strong { color: var(--ink-strong); font-size: 19px; line-height: 1.5; overflow-wrap: anywhere; }
.factor-identity > small { font-size: 12px; line-height: 1.5; color: var(--muted-strong); }
.factor-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.factor-stats > div { min-width: 0; }
.factor-stats span { display: block; color: var(--muted-strong); font-size: 12px; }
.factor-stats strong { display: block; margin-top: 3px; color: var(--ink-strong); font-variant-numeric: tabular-nums; font-size: 27px; line-height: 1.3; letter-spacing: -.5px; }
.factor-composite { padding-left: 24px; border-left: 1px solid var(--line); }
.factor-composite strong { font-size: 22px; font-weight: 600; padding-top: 4px; }
.factor-total-track { height: 4px; border-radius: 3px; margin-top: 9px; background: var(--line); overflow: hidden; }
.factor-total-track i { display: block; height: 100%; border-radius: inherit; background: var(--factor-color); }
.factor-holdings-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 16px 0 10px; }
.factor-holdings-heading h5 { font-size: 14px; font-weight: 700; margin: 0; }
.factor-holdings-heading > span { color: var(--muted-strong); font-size: 11px; white-space: nowrap; }
.factor-allocation { --factor-columns: 24px 56px minmax(0, 1fr) 62px 74px; min-width: 0; }
.factor-columns, .factor-axis, .factor-holdings li { display: grid; grid-template-columns: var(--factor-columns); gap: 10px; align-items: center; }
.factor-columns { color: var(--muted-strong); font-size: 11px; }
.factor-columns > :last-child { text-align: right; }
.factor-axis { padding: 7px 0 2px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.factor-axis > div { grid-column: 3; display: flex; justify-content: space-between; }
.factor-holdings { margin: 0; padding: 0; list-style: none; }
.factor-holdings li { min-height: 46px; padding: 7px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.factor-holdings li:last-child { border-bottom: 0; }
.factor-holdings li:hover { background: var(--surface); }
.factor-rank { color: var(--muted); text-align: center; font-size: 12px; }
.factor-symbol { color: var(--ink-strong); font-size: 14px; letter-spacing: .15px; }
.factor-bar-track { height: 24px; display: flex; align-items: center; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background-image: linear-gradient(to right, transparent calc(50% - .5px), var(--line) calc(50% - .5px), var(--line) calc(50% + .5px), transparent calc(50% + .5px)); }
.factor-bar-track > i { display: block; height: 9px; border-radius: 0 3px 3px 0; background: var(--factor-color); }
.factor-weight { color: var(--ink-strong); font-size: 14px; text-align: right; white-space: nowrap; }
.factor-signal { color: var(--muted-strong); font-size: 12px; text-align: right; white-space: nowrap; }
.factor-details { align-self: start; min-width: 0; margin-top: 16px; border-top: 1px solid var(--line); }
.factor-details > summary { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; color: var(--muted-strong); font-size: 12px; font-weight: 600; list-style: none; }
.factor-details > summary::-webkit-details-marker { display: none; }
.factor-details > summary::after { content: '+'; font-size: 18px; font-weight: 400; }
.factor-details[open] > summary::after { content: '−'; }
.factor-details > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 3px; }
.factor-source-meta { display: grid; gap: 8px; margin: 8px 0 16px; font-size: 12px; }
.factor-source-meta > div { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
.factor-source-meta dt { color: var(--muted-strong); }
.factor-source-meta dd { margin: 0; color: var(--ink-strong); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.factor-details .table-wrap { margin-bottom: 12px; }
@media (max-width: 760px) {
  .factor-identity { min-height: 0; padding: 12px; }
  .factor-identity > strong { font-size: 18px; }
  .factor-stats { gap: 14px; padding: 16px 0; }
  .factor-composite { padding-left: 14px; }
  .factor-allocation { --factor-columns: 18px 46px minmax(0, 1fr) 58px 64px; }
  .factor-columns, .factor-axis, .factor-holdings li { column-gap: 7px; }
  .factor-holdings-heading { flex-wrap: wrap; gap: 4px 12px; }
  .factor-holdings-heading > span { font-size: 10px; }
  .factor-signal { font-size: 11px; }
  .factor-weight { font-size: 13px; }
}
@media (max-width: 359px) {
  .factor-allocation { --factor-columns: 16px 39px minmax(0, 1fr) 56px 56px; }
  .factor-columns, .factor-axis, .factor-holdings li { column-gap: 5px; }
  .factor-columns { font-size: 10px; }
  .factor-symbol { font-size: 12px; }
  .factor-stats strong { font-size: 24px; }
  .factor-composite strong { font-size: 20px; }
}

/* Market preview: compact product labels and comparable source-backed charts. */
.market-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin: 20px 0 16px; }
.market-summary strong { color: var(--ink-strong); font-size: 16px; font-weight: 650; }
.market-summary > span { color: var(--muted); font-size: 13px; }
.market-visual { min-width: 0; }
.market-details, .etf-holdings-details { border-top: 1px solid var(--line); margin-top: 20px; }
.market-details > summary, .etf-holdings-details > summary { min-height: 44px; padding: 12px 0; color: var(--muted-strong); font-size: 13px; font-weight: 550; cursor: pointer; }
.market-details .table-wrap { margin-top: 0; }

#dram-metrics { margin-bottom: 12px; }
.dram-source-card { padding: 16px; }
.dram-source-heading { align-items: center; margin-bottom: 16px; }
.dram-source-heading > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; }
.dram-source-heading h4 { margin: 0; font-size: 16px; }
.dram-source-heading p { margin: 0; font-size: 12px; }
.dram-chart-toolbar { align-items: center; gap: 12px; margin-bottom: 12px; }
.dram-chart-readout { padding: 0; margin: 0; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.dram-chart-readout > span { display: none; }
.dram-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; overflow: visible; margin: 0 0 16px; }
.dram-legend-button { display: flex; min-width: 0; gap: 10px; padding: 12px; border-radius: 8px; background: var(--surface); text-align: left; }
.dram-legend-button svg { width: 20px; flex: 0 0 20px; }
.dram-product-name { display: grid; gap: 4px; min-width: 0; }
.dram-product-name strong { color: var(--ink-strong); font-size: 14px; font-weight: 650; line-height: 1.3; }
.dram-product-name small { color: var(--muted-strong); font-size: 12px; font-weight: 400; }
.dram-product-price { margin-left: auto; color: var(--ink-strong); font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dram-product-price small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; text-align: right; }
.dram-chart-frame svg { display: block; width: 100%; min-width: 0; height: auto; }

.etf-detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.etf-detail-card { min-width: 0; padding: 20px 18px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.etf-card-heading { min-height: 52px; }
.etf-card-heading h4 { color: var(--ink-strong); margin: 0; font-size: 17px; line-height: 1.45; font-weight: 600; word-break: keep-all; overflow-wrap: anywhere; }
.etf-card-heading p { color: var(--muted); margin: 6px 0 0; font-size: 12px; }
.etf-exposure { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 16px 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.etf-exposure span { color: var(--muted-strong); font-size: 13px; }
.etf-exposure strong { color: var(--ink-strong); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.etf-plot-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.etf-plot-heading > span { font-size: 13px; font-weight: 600; }
.etf-series-control { display: inline-flex; flex: 0 0 auto; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.etf-series-control button { min-height: 36px; min-width: 56px; padding: 6px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--muted-strong); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.etf-series-control button[aria-pressed="true"] { background: var(--panel); color: var(--primary-dark); box-shadow: 0 1px 3px #00000014; font-weight: 600; }
.etf-mini-chart { padding: 0; border: 0; background: transparent; }
.etf-mini-plot { overflow: hidden; }
.etf-mini-plot svg { display: block; min-width: 0; width: 100%; height: auto; }
.etf-mini-plot svg text { font-family: inherit; font-weight: 500; }
.etf-chart-readout { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 12px; padding: 14px; min-height: 76px; background: var(--surface); border-radius: 8px; color: var(--ink-strong); font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.etf-selected-asset { display: grid; gap: 5px; min-width: 0; }
.etf-selected-asset strong { color: var(--primary-dark); font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.etf-selected-asset time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.etf-selected-weight { display: grid; gap: 2px; flex-shrink: 0; text-align: right; }
.etf-selected-weight span { color: var(--muted); font-size: 11px; }
.etf-selected-weight strong { font-size: 22px; font-weight: 600; letter-spacing: -.025em; }
.etf-mini-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin-top: 8px; }
.etf-legend-button { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 38px; border: 0; padding: 5px 4px; background: transparent; border-radius: 4px; color: var(--muted-strong); text-align: left; font: inherit; font-size: 12px; cursor: pointer; }
.etf-legend-button .legend-key { width: 8px; height: 8px; flex: 0 0 8px; }
.etf-legend-button > span { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.etf-legend-button strong { margin-left: auto; font-weight: 550; font-variant-numeric: tabular-nums; white-space: nowrap; }
.etf-legend-button[aria-pressed="true"], .etf-legend-button:hover { background: var(--primary-soft); color: var(--primary-dark); }
.etf-mini-plot.is-keyboard-active .etf-mini-series { opacity: .18; }
.etf-mini-plot.is-keyboard-active .etf-mini-series.is-keyboard-active { opacity: 1; }
.etf-mini-series.is-keyboard-active .etf-mini-line { stroke-width: 3.5; }
.etf-selection-guide { stroke: var(--chart-axis) !important; stroke-dasharray: 4 4; pointer-events: none; }
.etf-data-point .etf-point-label { display: none !important; }
.etf-holdings-details { margin-top: 14px; }
.etf-holdings-details .etf-top10-list { grid-template-columns: 1fr; margin-bottom: 16px; }
@media (max-width: 1279px) {
  .etf-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .dram-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dram-legend-button { flex-shrink: 1; padding: 10px 8px; gap: 6px; }
  .dram-legend-button svg { display: none; }
  .dram-product-name strong { font-size: 13px; }
  .dram-product-name small { font-size: 11px; }
  .dram-product-price { font-size: 15px; }
  .dram-chart-toolbar { align-items: stretch; }
  .dram-scale-control { align-self: flex-start; }
  .dram-source-card { padding: 12px; }
  .etf-detail-grid { grid-template-columns: 1fr; }
  .etf-detail-card { padding: 18px 14px 0; }
  .etf-card-heading { min-height: 0; }
  .etf-exposure { margin: 16px 0; }
  .etf-series-control button, .etf-legend-button { min-height: 44px; }
}
@media (max-width: 380px) {
  .dram-legend { grid-template-columns: 1fr; }
  .dram-legend-button svg { display: block; }
}
@media (min-width: 381px) and (max-width: 760px) {
  .dram-legend-button { display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: start; gap: 6px; }
  .dram-legend-button svg { display: block; width: 16px; margin-top: 4px; }
  .dram-product-name strong { white-space: nowrap; font-size: 12px; }
  .dram-product-price { grid-column: 2; margin: 2px 0 0; font-size: 17px; }
  .dram-product-price small { display: inline; margin-left: 4px; font-size: 10px; }
}
@media (min-width: 761px) and (max-width: 1400px) {
  .page-jump-nav { position: static; display: flex; justify-content: flex-end; margin: 16px; }
}

/* SOX quadrant: coordinates stay at source scores; only labels move. */
.sox-quadrant-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.sox-leaders { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sox-leaders > span { color: var(--muted); font-size: 12px; margin-right: 8px; }
.sox-leader-button { min-width: 54px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--primary-dark); font-size: 13px; font-weight: 600; cursor: pointer; }
.sox-leader-button[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary-dark); }
.sox-stock-control { display: flex; align-items: center; gap: 10px; color: var(--muted-strong); font-size: 12px; }
.sox-stock-control select { min-width: 120px; min-height: 44px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 8px 12px; font: inherit; font-size: 14px; }
.sox-quadrant-readout { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr); gap: 24px; align-items: center; padding: 16px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; min-height: 90px; }
.sox-selection-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.sox-selection-name strong { color: var(--primary-dark); font-size: 23px; font-weight: 650; }
.sox-selection-name > span { color: var(--muted-strong); font-size: 13px; overflow-wrap: anywhere; }
.sox-selection-name > small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.sox-selection-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.sox-selection-values dt { font-size: 12px; color: var(--muted-strong); margin-bottom: 6px; }
.sox-selection-values dd { font-size: 20px; color: var(--ink-strong); font-weight: 600; margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sox-quadrant-frame { width: 100%; min-width: 0; border-radius: 8px; outline-offset: 4px; touch-action: pan-y; }
.sox-quadrant-frame:focus-visible { outline: 2px solid var(--primary); }
.sox-quadrant-svg { width: 100%; display: block; height: auto; overflow: visible; }
.sox-quadrant-surface { fill: var(--surface); stroke: var(--line); }
.sox-midline { stroke: var(--chart-axis); opacity: .45; stroke-width: 1.5; }
.sox-axis-title { fill: var(--muted-strong); font-size: 13px; font-weight: 600; }
.sox-axis-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.sox-quadrant-point { cursor: pointer; }
.sox-point-hit { fill: transparent; }
.sox-point-halo { fill: transparent; pointer-events: none; }
.sox-point-dot { fill: var(--panel); stroke: var(--chart-axis); stroke-width: 1.7; pointer-events: none; }
.sox-quadrant-point.is-leader .sox-point-dot { fill: var(--chart-1); stroke: var(--surface); stroke-width: 2; }
.sox-quadrant-point.is-selected .sox-point-halo { fill: var(--primary-soft-strong); }
.sox-quadrant-point.is-selected .sox-point-dot { fill: var(--primary-dark); stroke: var(--surface); stroke-width: 2.5; }
.sox-ticker-label { cursor: pointer; }
.sox-ticker-label line { stroke: var(--chart-axis); stroke-width: 1; opacity: .65; pointer-events: none; }
.sox-ticker-label rect { fill: var(--panel); stroke: var(--line); }
.sox-ticker-label text { fill: var(--muted-strong); font-size: 14px; font-weight: 550; }
.sox-ticker-label.is-leader rect { fill: var(--primary-soft); stroke: var(--primary-soft-strong); }
.sox-ticker-label.is-leader text { fill: var(--primary-dark); font-weight: 650; }
.sox-ticker-label.is-selected rect { fill: var(--primary-dark); stroke: var(--primary-dark); }
.sox-ticker-label.is-selected text { fill: var(--surface); font-weight: 650; }
.sox-quadrant-empty { padding: 24px 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted-strong); font-size: 14px; }
@media (max-width: 760px) {
  .sox-quadrant-controls { align-items: stretch; }
  .sox-leaders { gap: 5px; }
  .sox-leaders > span { flex-basis: 100%; margin: 0 0 3px; }
  .sox-leader-button { min-width: 45px; padding: 8px; font-size: 12px; }
  .sox-stock-control { flex: 1; justify-content: space-between; }
  .sox-quadrant-readout { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; }
  .sox-selection-name strong { font-size: 21px; }
  .sox-selection-values { gap: 8px; }
  .sox-selection-values dt { font-size: 11px; }
  .sox-selection-values dd { font-size: 15px; }
}
@media (max-width: 359px) {
  .sox-selection-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 660px) { .sox-ticker-label text { font-size: 12px; } }

.factor-allocation.integrated-allocation{--factor-columns:24px 72px minmax(0,1fr) 62px}
.integrated-allocation .factor-symbol{white-space:nowrap;overflow-wrap:normal;word-break:normal}
@media(max-width:600px){.factor-allocation.integrated-allocation{--factor-columns:18px 64px minmax(0,1fr) 58px}}

/* The integrated strategy pairs current allocation with its actual return path. */
.summary-grid > .panel--momentum { grid-column: 1 / -1; }
.integrated-factor-overview { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
.factor-summary-column, .factor-performance-column { min-width: 0; }
.factor-performance-column { padding-left: 26px; border-left: 1px solid var(--line); }
.factor-performance { margin: 0; }
.factor-performance-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.factor-performance-heading h5 { margin: 0; font-size: 14px; }
.factor-performance-heading > span, .factor-performance-period { color: var(--muted-strong); font-size: 11px; }
.factor-performance-legend { display: flex; flex-wrap: wrap; gap: 18px; margin: 14px 0; font-size: 12px; }
.factor-performance-legend span { display: inline-flex; align-items: center; gap: 7px; }
.factor-performance-legend i { width: 18px; border-top: 2px solid var(--factor-color); }
.factor-performance-legend .benchmark i { border-color: var(--muted-strong); border-top-style: dashed; }
.factor-performance-readout { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 16px; min-height: 85px; font-size: 12px; color: var(--muted-strong); font-variant-numeric: tabular-nums; }
.factor-performance-readout time { grid-column: 1 / -1; font-size: 12px; }
.factor-performance-readout b { font-size: 17px; color: var(--factor-color); margin-left: 5px; }
.factor-performance-readout .benchmark b { color: var(--ink-strong); }
.factor-performance-readout small { display: block; margin-top: 4px; font-size: 11px; }
.factor-performance-frame { outline: none; touch-action: pan-y; }
.factor-performance-frame:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 4px; }
.factor-performance-frame svg { display: block; width: 100%; height: auto; overflow: visible; }
.factor-performance-frame text { fill: var(--muted-strong); font-size: 11px; font-variant-numeric: tabular-nums; }
.factor-performance-grid { stroke: var(--line); stroke-width: 1; }
.factor-performance-line { fill: none; stroke: var(--factor-color); stroke-width: 1.8; stroke-linejoin: round; }
.factor-performance-line.benchmark { stroke: var(--muted-strong); stroke-dasharray: 5 3; }
.factor-performance-point { fill: var(--panel); stroke: var(--factor-color); stroke-width: 1.8; }
.factor-performance-point.benchmark { stroke: var(--muted-strong); }
.factor-performance-cursor { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; pointer-events: none; }
.factor-performance-period { margin: 8px 0 0; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .integrated-factor-overview { grid-template-columns: 1fr; gap: 24px; }
  .factor-performance-column { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 0; }
}
