:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #fff;
  --surface-dark: #111417;
  --text: #161a1d;
  --muted: #667078;
  --line: #dce1e5;
  --accent: #5aa7d9;
  --accent-soft: #eaf5fb;
  --positive: #b83232;
  --negative: #15906a;
  --healthy: #15906a;
  --warning: #d99a2b;
  --stage-accent: #5aa7d9;
  --stage-soft: #eaf5fb;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

[hidden] { display: none !important; }

button, a { font: inherit; }

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

.topbar {
  min-height: 112px;
  padding: 24px max(32px, calc((100vw - 1440px) / 2 + 40px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fff;
  background: var(--surface-dark);
  border-bottom: 1px solid #2c3237;
  position: relative;
  z-index: 10;
}

.brand-block, .brand-line, .topbar-actions, .source-summary {
  display: flex;
  align-items: center;
}

.brand-block { gap: 12px; }
.brand-line { gap: 10px; }
.brand-line strong { font-size: 24px; letter-spacing: -.02em; }

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #0a0a0a;
  background: var(--accent);
  font: 700 18px/1 "Geist Mono", monospace;
}

.task-badge {
  padding: 5px 8px;
  color: #9ed8fa;
  background: #25333c;
  border: 1px solid #436071;
  font: 600 10px/1 "Geist Mono", monospace;
  letter-spacing: .08em;
}

.run-meta, .source-summary small, .last-updated,
.panel-heading small, .metric-label {
  font-family: "Geist Mono", monospace;
}

.run-meta { margin-top: 8px; color: #a7b0b6; font-size: 12px; }
.topbar-actions { gap: 24px; }
.source-popover { position: relative; }

.source-summary {
  gap: 9px;
  padding: 8px 10px;
  color: #e9eef1;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.source-summary strong { display: block; font-size: 12px; }
.source-summary small { display: block; margin-top: 4px; color: #7f8a91; font-size: 9px; }

.health-dot, .status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--healthy);
}

.is-degraded { background: var(--warning); }
.is-missing { background: #d94b4b; }

.source-tooltip {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: 420px;
  overflow: auto;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 12px 36px #0a0a0a29;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  z-index: 20;
}

.source-popover:hover .source-tooltip,
.source-popover:focus-within .source-tooltip,
.source-popover.is-open .source-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tooltip-title, .source-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.tooltip-title span, .source-detail-row small {
  color: var(--muted);
  font: 600 10px/1.4 "Geist Mono", monospace;
}

.source-detail-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.source-detail-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.archive-button {
  padding: 10px 14px;
  color: #f3f5f6;
  border: 1px solid #4b555c;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.system-navigation {
  max-width: 1440px;
  margin: 0 auto;
  min-height: 68px;
  padding: 8px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.workspace-tabs,
.stage-tabs {
  display: flex;
  align-items: center;
}

.workspace-tabs {
  min-height: 52px;
  padding: 4px;
  gap: 4px;
  background: #f2f4f5;
  border-radius: 10px;
}

.stage-tabs {
  min-height: 44px;
  padding: 4px;
  gap: 4px;
  background: #f7f8f9;
  border: 1px solid #e1e5e8;
  border-radius: 10px;
}

.workspace-tabs button,
.workspace-tabs a,
.stage-tabs a {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #515b62;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  font-size: 11px;
  font-weight: 650;
}

.workspace-tabs button[aria-pressed="true"] {
  color: #fff;
  background: var(--surface-dark);
  border-color: var(--surface-dark);
}

.workspace-tabs a:hover,
.stage-tabs a:hover {
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.stage-tabs > span {
  margin: 0 4px 0 3px;
  color: var(--muted);
  font: 650 9px/1 "Geist Mono", monospace;
}

.stage-tabs a {
  min-height: 36px;
  padding: 0 11px;
  gap: 7px;
  color: #30383e;
  background: #fff;
  border-color: #e1e5e8;
  font: 650 9px/1 "Geist Mono", monospace;
}

.stage-tabs a[data-stage-link]::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  content: "";
  border-radius: 50%;
  background: var(--stage-accent);
}

.stage-tabs a[data-stage-link="premarket"]::before { background: #d28b1f; }
.stage-tabs a[data-stage-link="midday"]::before { background: #2f9e6f; }
.stage-tabs a[data-stage-link="postmarket"]::before { background: #5a67d8; }
.stage-tabs .home-link {
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.stage-tabs a[aria-current="page"] {
  color: #fff;
  background: var(--surface-dark);
  border-color: var(--surface-dark);
}

.workspace-tabs span {
  min-width: 20px;
  padding: 3px 5px;
  color: #276f9b;
  background: var(--accent-soft);
  text-align: center;
  font: 650 9px/1 "Geist Mono", monospace;
}

.stage-workspace {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 40px 34px;
}

body[data-stage="midday"] {
  --stage-accent: #d99a2b;
  --stage-soft: #fff5df;
}

body[data-stage="postmarket"] {
  --stage-accent: #7563a8;
  --stage-soft: #f1eff9;
}

.stage-hero {
  min-height: 250px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
  color: #fff;
  background: var(--surface-dark);
  border-top: 6px solid var(--stage-accent);
}

.stage-hero > div {
  padding: 34px 38px;
}

.stage-hero > div:first-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stage-hero small,
.stage-metrics span,
.stage-metrics small,
.stage-panel-heading small,
.stage-item small {
  font-family: "Geist Mono", monospace;
}

.stage-hero > div:first-child > small {
  color: var(--stage-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.stage-hero h1 {
  max-width: 760px;
  margin: 16px 0 12px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.06;
  letter-spacing: -.035em;
}

.stage-hero p {
  max-width: 820px;
  margin: 0;
  color: #b8c0c5;
  font-size: 13px;
  line-height: 1.65;
}

.stage-focus {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--stage-soft);
  border-left: 1px solid #2c3237;
}

.stage-focus span {
  color: var(--muted);
  font: 700 9px/1 "Geist Mono", monospace;
  letter-spacing: .08em;
}

.stage-focus strong {
  margin: 12px 0 10px;
  color: var(--stage-accent);
  font-size: 27px;
  line-height: 1.15;
}

.stage-focus small {
  color: #4c5860;
  font-size: 9px;
}

.stage-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
}

.stage-metrics article {
  min-height: 116px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.stage-metrics article:last-child { border-right: 0; }
.stage-metrics span, .stage-metrics small { color: var(--muted); font-size: 9px; }
.stage-metrics strong {
  margin: 10px 0 7px;
  color: var(--stage-accent);
  font: 700 25px/1 "Geist Mono", monospace;
}

.stage-action-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.stage-action-panel {
  background: var(--surface);
  border: 1px solid var(--line);
}

.stage-action-panel.is-secondary {
  background: #f8fafb;
  border-color: var(--line);
}

.stage-panel-heading {
  min-height: 68px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.stage-panel-heading small {
  color: var(--stage-accent);
  font-size: 8px;
  font-weight: 700;
}

.stage-panel-heading h2 {
  margin: 7px 0 0;
  font-size: 17px;
}

.stage-item {
  min-height: 72px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.stage-item:last-child { border-bottom: 0; }
.stage-item strong, .stage-item small { display: block; }
.stage-item strong { font-size: 12px; }
.stage-item small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.stage-item > span {
  color: var(--stage-accent);
  font-size: 10px;
  font-weight: 700;
  text-align: right;
}
.stage-item.is-warning > span { color: #a56818; }
.stage-item.is-positive > span { color: var(--negative); }

.stage-alert {
  min-height: 76px;
  margin-top: 18px;
  padding: 15px 18px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  background: var(--stage-soft);
  border: 1px solid var(--stage-accent);
}

.stage-alert > span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--stage-accent);
  font: 700 12px/1 "Geist Mono", monospace;
}

.stage-alert p { margin: 0; color: #4c5860; font-size: 11px; line-height: 1.5; }
.stage-alert button {
  min-height: 40px;
  padding: 0 14px;
  color: #fff;
  background: var(--stage-accent);
  border: 0;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

main { max-width: 1440px; margin: 0 auto; padding: 28px 40px 36px; }

.candidate-intro {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.candidate-intro small { color: #276f9b; font: 650 9px/1 "Geist Mono", monospace; }
.candidate-intro h1 { margin-top: 6px; }
.candidate-intro p { margin-top: 7px; color: var(--muted); font-size: 12px; }
.candidate-intro > span { color: var(--muted); font: 650 10px/1 "Geist Mono", monospace; }

.intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 22px;
}

h1, h2, p { margin: 0; }
h1 { font-size: 29px; letter-spacing: -.025em; }
.intro p { margin-top: 7px; color: var(--muted); font-size: 13px; }
.last-updated { color: var(--muted); font-size: 10px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.midday-status-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 16px;
  border: 1px solid #d99a2b;
  background: #fff5df;
}

.midday-status-band article {
  min-height: 84px;
  padding: 13px 16px;
  border-right: 1px solid #e7d3a7;
}

.midday-status-band article:last-child { border-right: 0; }
.midday-status-band span,
.midday-status-band small { display: block; color: var(--muted); }
.midday-status-band span { font: 600 9px/1 "Geist Mono", monospace; }
.midday-status-band strong {
  display: block;
  margin: 7px 0 6px;
  font: 650 18px/1 "Geist Mono", monospace;
}
.midday-status-band small { font-size: 10px; line-height: 1.35; }
.midday-status-band .is-warning-text { color: #a56818; }

.midday-review-badge,
.midday-holding-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  font: 650 8px/1 "Geist Mono", monospace;
  white-space: nowrap;
}

.midday-review-badge { margin-top: 5px; color: #276f9b; background: #eaf5fb; }
.midday-review-badge.is-wait { color: #8a5d0a; background: #fff5df; }
.midday-review-badge.is-avoid,
.midday-holding-tag.is-unavailable { color: #a56818; background: #fff0d1; }
.midday-holding-tag { margin-left: 6px; color: #276f9b; background: #eaf5fb; }

.metrics article {
  min-width: 0;
  min-height: 108px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  border-right: 1px solid var(--line);
}

.metrics article:last-child { border-right: 0; }
.metrics span, .metrics small { color: var(--muted); }
.metrics span { font: 600 10px/1 "Geist Mono", monospace; }
.metrics strong { font: 650 26px/1 "Geist Mono", monospace; }
.metrics small { font-size: 11px; }
.accent-text { color: #276f9b !important; }
.warning-text { color: #8a5a0b !important; }

.ai-brief {
  min-height: 104px;
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: 150px 1fr;
  color: #fff;
  background: var(--surface-dark);
  border: 1px solid #2c3237;
}

.ai-brief-label {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  background: #192127;
  border-right: 1px solid #2c3237;
}

.ai-brief-label strong { color: #dff3ff; font: 650 11px/1 "Geist Mono", monospace; }
.ai-brief-label small { color: #7e8a91; font: 10px/1 "Geist Mono", monospace; }
.ai-brief > div:last-child { padding: 18px 24px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.ai-brief h2 { font-size: 15px; }
.ai-brief p { max-width: 1050px; color: #aab4ba; font-size: 12px; line-height: 1.55; }

.etf-heat-board {
  margin-bottom: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.etf-heat-heading {
  min-height: 58px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.etf-heat-heading small { color: #3f7d68; font: 650 9px/1 "Geist Mono", monospace; }
.etf-heat-heading h2 { margin-top: 5px; font-size: 16px; }
.etf-heat-heading > span { color: var(--muted); font: 650 9px/1 "Geist Mono", monospace; }
.etf-heat-list {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.etf-heat-card { min-width: 0; border: 1px solid var(--line); border-top: 3px solid #7f8a91; }
.etf-heat-card.is-trend { border-top-color: #3f7d68; }
.etf-heat-card.is-rebound { border-top-color: #a85d3a; }
.etf-heat-card.is-cooling { border-top-color: #8a721f; }
.etf-heat-card > div {
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.etf-heat-card > div span strong, .etf-heat-card > div span small { display: block; }
.etf-heat-card > div span strong { font-size: 11px; }
.etf-heat-card > div span small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.etf-heat-card > div b { color: #3f7d68; font: 650 12px/1 "Geist Mono", monospace; }
.etf-heat-card.is-rebound > div b { color: #8e4e30; }
.etf-heat-card dl {
  margin: 0;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #f6f8f9;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.etf-heat-card dl div { text-align: center; }
.etf-heat-card dt { color: var(--muted); font: 8px/1 "Geist Mono", monospace; }
.etf-heat-card dd { margin: 5px 0 0; font: 650 9px/1 "Geist Mono", monospace; }
.etf-heat-card > p { padding: 9px 12px; color: var(--muted); font-size: 8px; }
.etf-heat-empty { padding: 14px; color: var(--muted); font-size: 10px; }

.board-market {
  margin-bottom: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.board-market-heading {
  min-height: 78px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  background: var(--surface-dark);
  border-bottom: 1px solid var(--line-dark);
}
.board-market-heading small, .board-panel header small, .board-rotation header small {
  color: var(--accent);
  font: 650 8px/1 "Geist Mono", monospace;
  letter-spacing: .08em;
}
.board-market-heading h2 { margin-top: 6px; font-size: 19px; }
.board-market-heading p { margin-top: 5px; color: #aab4ba; font-size: 10px; }
.board-market-summary { display: flex; align-items: center; gap: 8px; }
.board-market-summary span, .board-market-summary strong {
  padding: 7px 9px;
  border: 1px solid #4b555c;
  font: 650 8px/1 "Geist Mono", monospace;
}
.board-market-summary span:first-child { color: var(--positive); }
.board-market-summary span:nth-child(2) { color: var(--accent); }
.board-market-summary strong { color: var(--warning); }

.board-leaders {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  background: #f6f8f9;
  border-bottom: 1px solid var(--line);
}
.board-leader {
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.board-leader small, .board-leader strong, .board-leader span { display: block; }
.board-leader small { color: var(--muted); font-size: 8px; }
.board-leader strong { margin-top: 8px; font: 700 17px/1 "Geist Mono", monospace; }
.board-leader span { margin-top: 7px; font: 650 9px/1 "Geist Mono", monospace; }
.board-leader.is-positive strong, .board-leader.is-positive span { color: var(--positive); }
.board-leader.is-negative strong, .board-leader.is-negative span { color: var(--negative); }

.board-heat-grid, .board-flow-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  border-bottom: 1px solid var(--line);
}
.board-flow-grid { border-bottom: 0; }
.board-panel { min-width: 0; border: 1px solid var(--line); background: var(--surface); }
.board-panel > header {
  min-height: 54px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.board-panel header h3 { margin-top: 5px; font-size: 14px; }
.board-panel header > span {
  padding: 5px 7px;
  color: #276f9b;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  font: 650 8px/1 "Geist Mono", monospace;
}
.board-panel-note { padding: 8px 12px 0; color: var(--muted); font-size: 8px; }
.board-heatmap {
  min-height: 235px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 66px;
  gap: 4px;
}
.board-heat-cell {
  min-width: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid transparent;
}
.board-heat-cell strong { max-width: 100%; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-heat-cell span { margin-top: 5px; font: 700 11px/1 "Geist Mono", monospace; }
.board-heat-cell.is-positive { color: #922f2f; background: #fce9e7; border-color: #eab9b4; }
.board-heat-cell.is-negative { color: #176a50; background: #e7f4ee; border-color: #afdccb; }
.board-heat-cell.is-neutral { color: var(--muted); background: #eef1f3; border-color: var(--line); }

.board-rotation { margin: 0 14px; border: 1px solid var(--line); }
.board-rotation > header {
  min-height: 60px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.board-rotation header h3 { margin-top: 5px; font-size: 14px; }
.board-rotation header p { margin-top: 4px; color: var(--muted); font-size: 9px; }
.board-rotation header > strong { color: var(--positive); font: 650 9px/1 "Geist Mono", monospace; }
.board-rotation-body { display: grid; grid-template-columns: 44% minmax(0, 1fr); }
.board-rotation-ranking { border-right: 1px solid var(--line); }
.board-rank-row {
  min-height: 38px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 92px 62px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
}
.board-rank-row:last-child { border-bottom: 0; }
.board-rank-row b, .board-rank-row span:nth-last-child(-n+2) { font-family: "Geist Mono", monospace; }
.board-rank-row b, .board-rank-row span:nth-last-child(-n+2) { color: var(--positive); }
.board-rank-row span:nth-last-child(-n+2) { text-align: right; }
.board-rank-trend { min-height: 190px; padding: 14px; overflow-x: auto; }
.board-trend-heading { display: flex; justify-content: space-between; gap: 12px; }
.board-trend-heading strong { font-size: 11px; }
.board-trend-heading span { color: var(--muted); font: 650 8px/1 "Geist Mono", monospace; }
.board-trend-points {
  min-width: 460px;
  height: 120px;
  margin-top: 16px;
  padding: 12px 6px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  border: 1px solid var(--line);
  background: #f8fafb;
}
.board-trend-point {
  min-width: 24px;
  height: 100%;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
}
.board-trend-point i {
  width: 8px;
  min-height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.board-trend-point b { color: var(--text); font: 650 8px/1 "Geist Mono", monospace; }
.board-trend-point small { color: var(--muted); font: 7px/1 "Geist Mono", monospace; }

.board-periods { padding: 8px 12px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; border-bottom: 1px solid var(--line); }
.board-periods button { min-height: 28px; color: var(--muted); background: #f5f7f8; border: 1px solid var(--line); font: 650 8px/1 "Geist Mono", monospace; }
.board-periods button[aria-pressed="true"] { color: #fff; background: var(--surface-dark); border-color: var(--surface-dark); }
.board-flow-list { min-height: 224px; padding: 10px 12px; }
.board-flow-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: 30px 90px minmax(90px, 1fr) 72px 54px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
.board-flow-row:last-child { border-bottom: 0; }
.board-flow-row > b { color: var(--muted); font: 650 8px/1 "Geist Mono", monospace; }
.board-flow-row > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.board-flow-bar { height: 11px; background: #eef1f3; }
.board-flow-bar span { display: block; height: 100%; }
.board-flow-row.is-positive .board-flow-bar span { background: var(--positive); }
.board-flow-row.is-negative .board-flow-bar span { background: var(--negative); }
.board-flow-row > span:nth-last-child(-n+2) { text-align: right; font: 650 8px/1 "Geist Mono", monospace; }
.board-flow-row.is-positive > span:nth-last-child(-n+2) { color: var(--positive); }
.board-flow-row.is-negative > span:nth-last-child(-n+2) { color: var(--negative); }
.board-empty { padding: 24px 12px; color: var(--muted); text-align: center; font-size: 10px; }
.board-data-status {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 10px;
}
.board-data-status.is-degraded {
  border-color: #d8b77a;
  background: #fff8e8;
  color: #815f1d;
}

.candidate-comparison {
  margin-bottom: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.comparison-heading {
  min-height: 58px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.comparison-heading h2 { font-size: 16px; }
.comparison-heading small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font: 9px/1.3 "Geist Mono", monospace;
}

.comparison-periods {
  display: flex;
  border: 1px solid var(--line);
}

.comparison-periods button {
  min-width: 64px;
  min-height: 34px;
  padding: 0 13px;
  color: var(--muted);
  background: var(--surface);
  border: 0;
  cursor: pointer;
  font: 650 10px/1 "Geist Mono", monospace;
}

.comparison-periods button + button { border-left: 1px solid var(--line); }
.comparison-periods button[aria-pressed="true"] { color: #fff; background: var(--surface-dark); }

.comparison-content { display: grid; grid-template-columns: 320px minmax(0, 1fr); }
.comparison-summary {
  padding: 18px;
  background: #f8fafb;
  border-right: 1px solid var(--line);
}

.comparison-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 10px;
}

.comparison-metrics button, .comparison-metrics > div {
  min-width: 0;
  padding: 0;
  text-align: left;
  background: transparent;
  border: 0;
}

.comparison-metrics button { cursor: pointer; }
.comparison-metrics button[aria-pressed="true"] span { color: var(--text); font-weight: 650; }
.comparison-metrics strong, .comparison-metrics span { display: block; }
.comparison-metrics strong { font: 650 23px/1 "Geist Mono", monospace; }
.comparison-metrics span { margin-top: 6px; color: var(--muted); font: 9px/1 "Geist Mono", monospace; }

.comparison-net {
  margin-top: 16px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #276f9b;
  background: var(--accent-soft);
}

.comparison-net span { font-size: 10px; font-weight: 650; }
.comparison-net strong { font: 650 12px/1 "Geist Mono", monospace; }
.comparison-lists { min-width: 0; display: grid; grid-template-columns: 1fr 1fr; }
.comparison-list { min-width: 0; }
.comparison-list + .comparison-list { border-left: 1px solid var(--line); }

.comparison-list-heading {
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  text-align: left;
}

.comparison-list-heading h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.comparison-list-heading h3::before {
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: var(--accent);
}

.comparison-list.is-exited .comparison-list-heading h3::before { background: var(--warning); }
.comparison-list-heading span { color: var(--muted); font: 9px/1 "Geist Mono", monospace; }
.comparison-stock-list { min-height: 132px; max-height: 168px; overflow: auto; }

.comparison-stock-row {
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid #eef1f3;
  text-align: left;
}

button.comparison-stock-row { cursor: pointer; }
button.comparison-stock-row:hover, button.comparison-stock-row:focus-visible { background: var(--accent-soft); }
.comparison-stock-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.comparison-stock-row small { flex: 0 0 auto; color: var(--muted); font: 9px/1 "Geist Mono", monospace; }
.comparison-stock-empty { padding: 16px; color: var(--muted); font-size: 10px; }

.comparison-empty {
  padding: 18px;
  color: var(--muted);
  font-size: 11px;
}

.strategy-lane-board {
  margin-bottom: 22px;
  background: #e8edf0;
  border: 1px solid var(--line);
}

.lane-board-heading {
  min-height: 86px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.lane-board-heading small { color: #276f9b; font: 650 9px/1 "Geist Mono", monospace; }
.lane-board-heading h2 { margin-top: 6px; font-size: 20px; }
.lane-board-heading p { margin-top: 6px; color: #515b62; font-size: 11px; }
.lane-board-summary { display: flex; align-items: center; gap: 8px; }
.lane-board-summary span, .lane-board-summary strong {
  padding: 8px 10px;
  font: 650 9px/1 "Geist Mono", monospace;
}
.lane-board-summary span { color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
.lane-board-summary strong { color: #fff; background: var(--surface-dark); }

.strategy-lanes {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.strategy-lane {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--lane-color);
}

.strategy-lane > header {
  min-height: 126px;
  padding: 15px 15px 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.strategy-lane > header > div:first-child { min-width: 0; }
.strategy-lane > header small { color: var(--lane-color); font: 650 8px/1 "Geist Mono", monospace; }
.strategy-lane h3 { margin-top: 8px; font-size: 17px; }
.strategy-lane header p { margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.lane-coverage { flex: 0 0 auto; text-align: right; }
.lane-coverage strong, .lane-coverage span { display: block; }
.lane-coverage strong { color: var(--lane-color); font: 650 23px/1 "Geist Mono", monospace; }
.lane-coverage span { margin-top: 6px; color: var(--muted); font: 650 7px/1 "Geist Mono", monospace; }

.lane-strategies {
  min-height: 50px;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 5px;
  background: #f6f8f9;
  border-bottom: 1px solid var(--line);
}
.lane-strategies span {
  padding: 5px 6px;
  color: #4d5960;
  background: #fff;
  border: 1px solid #dce1e4;
  font-size: 8px;
  font-weight: 650;
}

.lane-candidates { min-height: 454px; }
.lane-candidate {
  width: 100%;
  min-height: 54px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  cursor: pointer;
  text-align: left;
}
.lane-candidate:hover, .lane-candidate:focus-visible { background: #f3f7f9; }
.lane-candidate.is-selected { background: #eaf2f6; box-shadow: inset 3px 0 var(--lane-color); }
.lane-candidate > b { color: var(--lane-color); font: 650 9px/1 "Geist Mono", monospace; }
.lane-candidate > span:nth-child(2) { min-width: 0; }
.lane-candidate > span:nth-child(2) strong,
.lane-candidate > span:nth-child(2) small,
.lane-score strong,
.lane-score small { display: block; }
.lane-candidate > span:nth-child(2) strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.lane-candidate > span:nth-child(2) small { margin-top: 4px; color: #4f5960; font: 7px/1 "Geist Mono", monospace; }
.lane-score { text-align: right; }
.lane-score strong { color: var(--lane-color); font: 650 11px/1 "Geist Mono", monospace; }
.lane-score small { margin-top: 4px; color: #4f5960; font: 7px/1 "Geist Mono", monospace; }
.lane-candidate.is-selected > b,
.lane-candidate.is-selected .lane-score strong { color: #254f63; }
.lane-more {
  width: calc(100% - 20px);
  min-height: 36px;
  margin: 10px;
  color: var(--lane-color);
  background: transparent;
  border: 1px solid var(--lane-color);
  cursor: pointer;
  font-size: 9px;
  font-weight: 650;
}
.lane-more:hover, .lane-more:focus-visible { color: #fff; background: var(--lane-color); }
.lane-empty { padding: 20px 12px; color: var(--muted); font-size: 10px; }

.strategy-observer {
  margin-bottom: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.strategy-observer-heading {
  min-height: 46px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.strategy-observer-heading > div:first-child { min-width: 0; display: flex; align-items: center; gap: 10px; }
.strategy-observer-heading h2 { font-size: 15px; }
.strategy-observer-heading small {
  color: #276f9b;
  font: 650 9px/1.4 "Geist Mono", monospace;
}
.strategy-total { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.strategy-total span { color: var(--muted); font: 600 9px/1 "Geist Mono", monospace; }
.strategy-total strong { padding: 6px 9px; color: #fff; background: var(--surface-dark); font: 650 11px/1 "Geist Mono", monospace; }
.strategy-heading-actions, .history-heading-actions { display: flex; align-items: center; gap: 8px; }
.mobile-section-toggle {
  display: none;
  padding: 7px 9px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  font: 600 9px/1 "Geist Mono", monospace;
}

.observer-filter-band {
  min-height: 54px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.observer-filter-band + .observer-filter-band { border-top: 1px solid #eef1f3; }
.observer-filter-label { flex: 0 0 auto; color: var(--muted); font: 600 9px/1 "Geist Mono", monospace; }

.strategy-filters {
  min-height: 38px;
  max-height: 164px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 9px;
  overflow: auto;
}

.rule-filters { overflow: visible; }

.strategy-filter {
  min-height: 44px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  background: #f7f8f9;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 650;
}

.strategy-filter:hover { border-color: #aeb7bd; }
.strategy-filter[aria-pressed="true"] {
  color: #fff;
  background: #276f9b;
  border-color: #276f9b;
}
.strategy-filter-count { color: var(--muted); font: 650 10px/1 "Geist Mono", monospace; }
.strategy-filter[aria-pressed="true"] .strategy-filter-count { color: #ddf1fc; }

.research-workspace { display: grid; grid-template-columns: 430px minmax(0, 1fr); gap: 18px; margin-bottom: 22px; }
.candidate-panel, .stock-panel, .opinion-panel, .source-panel, .history-panel { background: var(--surface); border: 1px solid var(--line); }
.candidate-panel { min-width: 0; height: 850px; display: flex; flex-direction: column; }

.panel-heading, .section-heading {
  min-height: 62px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2, .section-heading h2 { font-size: 16px; }
.panel-heading small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }

.sort-button {
  padding: 8px 10px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}

.sort-button:hover { color: var(--text); border-color: #aeb7bd; }

.candidate-columns {
  min-height: 34px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1.35fr 1.1fr 54px;
  align-items: center;
  color: var(--muted);
  background: #f7f8f9;
  border-bottom: 1px solid var(--line);
  font: 600 9px/1 "Geist Mono", monospace;
}

.candidate-columns span:last-child { text-align: right; }
.candidate-list { min-height: 0; overflow: auto; }
.candidate-empty { padding: 16px; }
.candidate-more {
  width: calc(100% - 32px);
  min-height: 42px;
  margin: 12px 16px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}
.candidate-more:hover, .candidate-more:focus-visible { color: var(--text); border-color: var(--accent); }

.candidate-row {
  width: 100%;
  min-height: 82px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1.35fr 1.1fr 54px;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
}

.candidate-row:hover { background: #f7fafc; }
.candidate-row.is-selected { padding-left: 13px; background: var(--accent-soft); border-left: 3px solid var(--accent); }
.candidate-stock strong, .candidate-stock small, .candidate-signal strong, .candidate-signal small { display: block; }
.candidate-stock strong { font-size: 13px; }
.candidate-stock small, .candidate-signal small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.candidate-stock small { font-family: "Geist Mono", monospace; }
.candidate-signal strong { font-size: 11px; }
.candidate-score { text-align: right; color: #276f9b; font: 650 13px/1 "Geist Mono", monospace; }

.stock-panel { min-width: 0; height: 850px; display: flex; flex-direction: column; }
.stock-overview { min-height: 92px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.stock-identity > div { display: flex; align-items: center; gap: 10px; }
.stock-identity h2 { font-size: 20px; }
.stock-identity span { color: var(--muted); font: 11px/1 "Geist Mono", monospace; }
.stock-identity p { max-width: 420px; max-height: 48px; margin-top: 8px; overflow: auto; color: var(--muted); font-size: 11px; line-height: 1.45; }

.quote-summary { margin: 0; display: flex; gap: 24px; }
.quote-summary div { text-align: right; }
.quote-summary dt { color: var(--muted); font: 9px/1 "Geist Mono", monospace; }
.quote-summary dd { margin: 6px 0 0; font: 650 14px/1 "Geist Mono", monospace; }
.is-positive-text { color: var(--positive); }
.is-negative-text { color: var(--negative); }

.chart-toolbar { min-height: 58px; padding: 8px 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #fafbfb; border-bottom: 1px solid var(--line); }
.period-badge { flex: 0 0 auto; padding: 7px 10px; color: #fff; background: var(--surface-dark); white-space: nowrap; font: 600 10px/1 "Geist Mono", monospace; }
#chart-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px 14px; }
#chart-filters fieldset { margin: 0; padding: 0; display: flex; gap: 10px; border: 0; }
#chart-filters legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#chart-filters label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); white-space: nowrap; font: 10px/1 "Geist Mono", monospace; }
#chart-filters input { accent-color: var(--accent); }
#subchart-filters { padding-left: 12px !important; border-left: 1px solid var(--line) !important; }
#indicator-filters label:has(input:checked), #subchart-filters label:has(input:checked) { color: var(--text); font-weight: 650; }
.event-note { padding: 7px 9px; color: var(--muted); background: #f1f3f4; font: 9px/1.3 "Geist Mono", monospace; }
.event-menu { position: relative; }
.event-menu summary { padding: 7px 9px; color: var(--text); background: var(--surface); border: 1px solid var(--line); cursor: pointer; list-style: none; font: 600 9px/1 "Geist Mono", monospace; }
.event-menu summary::-webkit-details-marker { display: none; }
.event-menu summary::after { content: " ▾"; color: var(--muted); }
.event-menu[open] summary::after { content: " ▴"; }
.event-menu #event-filters { position: absolute; top: calc(100% + 8px); right: 0; width: 320px; max-height: 280px; padding: 12px !important; display: grid; grid-template-columns: 1fr 1fr; gap: 11px !important; overflow: auto; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 28px #0a0a0a24; z-index: 8; }
.chart-stage { position: relative; min-height: 660px; flex: 1; }
#chart { min-height: 660px; height: 100%; }
.chart-status { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; color: var(--muted); background: rgba(255, 255, 255, .86); font: 12px/1.5 "Geist Mono", monospace; z-index: 2; }
.chart-status[hidden] { display: none; }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 18px; margin-bottom: 22px; }
.opinion-panel { min-height: 230px; display: grid; grid-template-columns: 226px 1fr; }
.opinion-lead { padding: 24px 20px; display: flex; flex-direction: column; justify-content: center; gap: 11px; color: #0d151a; background: var(--accent); }
.opinion-lead small, .opinion-lead span { font: 650 9px/1 "Geist Mono", monospace; }
.opinion-lead h2 { font-size: 20px; line-height: 1.25; }
.opinion-panel > p { padding: 28px 26px; align-self: center; color: var(--muted); font-size: 13px; line-height: 1.7; white-space: pre-wrap; }

.source-panel { min-width: 0; }
.section-heading { min-height: 54px; }
.section-heading span { color: var(--muted); font: 650 9px/1 "Geist Mono", monospace; }
.source-status { max-height: 176px; overflow: auto; }
.source-group { min-height: 43px; padding: 9px 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.source-group:last-child { border-bottom: 0; }
.source-group-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.source-group-name strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.source-group-meta { text-align: right; }
.source-group-meta strong, .source-group-meta small { display: block; font-family: "Geist Mono", monospace; }
.source-group-meta strong { font-size: 10px; }
.source-group-meta small { margin-top: 3px; color: var(--muted); font-size: 8px; }

.history-panel { scroll-margin-top: 20px; }
.history-heading-text { display: flex; flex-direction: column; gap: 3px; }
.history-heading-text small { color: var(--muted); font-size: 11px; }
.history-days { padding: 12px 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.history-group { border: 1px solid var(--line); background: #f7f8f9; }
.history-group-header { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: none; border: none; cursor: pointer; color: var(--text); font: inherit; text-align: left; }
.history-group-header:hover { background: var(--accent-soft, #eaf5fb); }
.history-group-left { display: flex; align-items: center; gap: 8px; }
.history-group-left strong { font: 600 13px/1.2 "Geist Mono", monospace; }
.history-caret { display: inline-block; color: var(--muted); font-size: 10px; transition: transform .15s ease; }
.history-group.is-open .history-caret { transform: rotate(90deg); }
.history-group-count { color: var(--muted); font-size: 11px; }
.history-run-list { display: none; flex-direction: column; border-top: 1px solid var(--line); }
.history-group.is-open .history-run-list { display: flex; }
.history-run { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px 9px 16px; text-decoration: none; color: var(--text); border-top: 1px solid var(--line); }
.history-run:first-child { border-top: none; }
.history-run:hover { background: var(--accent-soft, #eaf5fb); }
.history-run-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.history-run-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.history-run-dot.is-premarket { background: #5aa7d9; }
.history-run-dot.is-midday { background: #d99a2b; }
.history-run-dot.is-postmarket { background: #7563a8; }
.history-run-dot.is-weekly { background: var(--accent); }
.history-run-time { font: 12px/1.2 "Geist Mono", monospace; }
.history-run-note { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-run-open { color: var(--accent); font-size: 11px; white-space: nowrap; }
.empty-state { color: var(--muted); font-size: 11px; }

.portfolio-workspace { padding-top: 22px; }

.portfolio-intro {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.portfolio-intro small,
.portfolio-section-heading small,
.portfolio-freshness,
.portfolio-metrics span,
.portfolio-metrics small,
.holdings-table-head,
.holding-cell small,
.holding-identity small {
  font-family: "Geist Mono", monospace;
}

.portfolio-intro > div:first-child > small,
.portfolio-section-heading small {
  color: #276f9b;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .05em;
}

.portfolio-intro h1 { margin-top: 6px; }
.portfolio-intro p { margin-top: 7px; color: var(--muted); font-size: 12px; }
.portfolio-freshness { text-align: right; }
.portfolio-freshness span, .portfolio-freshness small { display: block; }
.portfolio-freshness span { font-size: 10px; font-weight: 650; }
.portfolio-freshness small { margin-top: 5px; color: var(--muted); font-size: 9px; }

.portfolio-metrics {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
}

.portfolio-metrics article {
  min-height: 108px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  border-right: 1px solid var(--line);
}

.portfolio-metrics article:last-child { border-right: 0; }
.portfolio-metrics span, .portfolio-metrics small { color: var(--muted); }
.portfolio-metrics span { font-size: 9px; font-weight: 650; }
.portfolio-metrics strong { font: 650 25px/1 "Geist Mono", monospace; }
.portfolio-metrics small { font-size: 9px; }

.portfolio-main-grid {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) minmax(330px, 1fr);
  gap: 18px;
}

.holdings-panel,
.replacement-panel,
.portfolio-gaps {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
}

.portfolio-section-heading {
  min-height: 62px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.portfolio-section-heading h2 { margin-top: 5px; font-size: 16px; }
.portfolio-section-heading > span { color: var(--muted); font: 650 9px/1 "Geist Mono", monospace; }
.portfolio-section-heading.inverse { color: #fff; border-color: #2c3237; }
.portfolio-section-heading.inverse small { color: #9ed8fa; }
.portfolio-section-heading.inverse > span { color: var(--warning); }

.portfolio-sort { display: flex; border: 1px solid var(--line); }
.portfolio-sort button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface);
  border: 0;
  cursor: pointer;
  font-size: 9px;
  font-weight: 650;
}
.portfolio-sort button + button { border-left: 1px solid var(--line); }
.portfolio-sort button[aria-pressed="true"] { color: #fff; background: var(--surface-dark); }
.portfolio-sort button { min-width: 84px; }
.portfolio-sort button:disabled {
  color: #8b949b;
  background: #f1f3f4;
  cursor: not-allowed;
}

.holdings-table-head,
.holding-row {
  display: grid;
  grid-template-columns: 1.45fr .92fr 1fr .62fr .98fr .88fr 1.25fr;
  align-items: center;
}

.holdings-table-head {
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  background: #f5f7f8;
  border-bottom: 1px solid var(--line);
  font-size: 8px;
  font-weight: 650;
}

.holdings-table-head span:not(:first-child) { text-align: right; }
.holding-row {
  min-height: 84px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.holding-row:last-child { border-bottom: 0; }
.holding-row:has(.holding-tag.is-warning) { background: #fff9ec; }
.holding-row:hover { background: var(--accent-soft); }
.holding-row.is-chart-selected {
  padding-left: 11px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}
.holding-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.holding-identity { min-width: 0; }
.holding-identity > div { display: flex; align-items: center; gap: 7px; }
.holding-identity button {
  max-width: 130px;
  overflow: hidden;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
}
.holding-identity button:hover { color: #276f9b; }
.holding-identity > small { display: block; margin-top: 7px; color: var(--muted); font-size: 8px; }

.holding-tag {
  padding: 4px 6px;
  white-space: nowrap;
  font-size: 8px;
  font-weight: 650;
}
.holding-tag.is-positive { color: var(--positive); background: #fdecec; }
.holding-tag.is-negative { color: var(--negative); background: #edf7f3; }
.holding-tag.is-warning { color: #9a650b; background: #ffebc4; }
.holding-tag.is-muted { color: var(--muted); background: #edf0f2; }

.holding-cell { min-width: 0; text-align: right; }
.holding-cell small { display: none; color: var(--muted); font-size: 7px; }
.holding-cell strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 10px/1.45 "Geist Mono", monospace;
}
.holding-plan strong { white-space: normal; font-family: Inter, "PingFang SC", sans-serif; font-size: 9px; }

.portfolio-side { display: flex; flex-direction: column; gap: 18px; }
.replacement-list { min-height: 196px; }
.watchlist-search {
  padding: 10px 14px;
  display: block;
  border-bottom: 1px solid var(--line);
}
.watchlist-search > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.watchlist-search input {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  color: var(--text);
  background: #f7f9fa;
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 10px;
}
.watchlist-search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
#watchlist-list {
  height: 320px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.replacement-row {
  width: 100%;
  min-height: 51px;
  padding: 9px 14px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 9px;
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
}
.replacement-row:hover { background: var(--accent-soft); }
.replacement-row > small { color: var(--accent); font: 650 9px/1 "Geist Mono", monospace; }
.replacement-row span { min-width: 0; }
.replacement-row span strong, .replacement-row span small { display: block; }
.replacement-row span strong { font-size: 11px; }
.replacement-row span small { margin-top: 4px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.replacement-row b { text-align: right; font: 650 13px/1 "Geist Mono", monospace; }

.portfolio-review-grid {
  margin-bottom: 18px;
  display: block;
}

.portfolio-gap-list { padding: 4px 18px 14px; }

.portfolio-gap-row {
  min-height: 54px;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}
.portfolio-gap-row:last-child { border-bottom: 0; }
.portfolio-gap-row strong, .portfolio-gap-row small { display: block; }
.portfolio-gap-row strong { font-size: 11px; }
.portfolio-gap-row small { margin-top: 4px; color: var(--muted); font: 8px/1 "Geist Mono", monospace; }
.portfolio-gap-row > span { max-width: 58%; color: #9a650b; text-align: right; font-size: 9px; line-height: 1.45; }

.portfolio-chart-panel {
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.portfolio-chart-overview {
  min-height: 88px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.portfolio-chart-overview > div > small {
  color: #276f9b;
  font: 650 9px/1 "Geist Mono", monospace;
}
.portfolio-chart-overview h2 { margin-top: 6px; font-size: 18px; }
.portfolio-chart-overview p { margin-top: 7px; color: var(--muted); font-size: 10px; }
.portfolio-chart-overview dl { margin: 0; display: flex; gap: 28px; }
.portfolio-chart-overview dl div { text-align: right; }
.portfolio-chart-overview dt { color: var(--muted); font: 9px/1 "Geist Mono", monospace; }
.portfolio-chart-overview dd { margin: 7px 0 0; font: 650 13px/1 "Geist Mono", monospace; }

.portfolio-chart-toolbar {
  min-height: 58px;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  background: #fafbfb;
  border-bottom: 1px solid var(--line);
}
.portfolio-chart-toolbar > span {
  margin-right: auto;
  padding: 7px 9px;
  color: #fff;
  background: var(--surface-dark);
  white-space: nowrap;
  font: 650 9px/1 "Geist Mono", monospace;
}
.portfolio-range-filters {
  display: flex;
  border: 1px solid var(--line);
}
.portfolio-range-filters button {
  min-height: 27px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--surface);
  border: 0;
  cursor: pointer;
  font-size: 9px;
  font-weight: 650;
}
.portfolio-range-filters button + button { border-left: 1px solid var(--line); }
.portfolio-range-filters button[aria-pressed="true"] {
  color: #fff;
  background: var(--surface-dark);
}
.portfolio-chart-toolbar fieldset {
  margin: 0;
  padding: 0;
  display: flex;
  gap: 10px;
  border: 0;
}
.portfolio-chart-toolbar legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.portfolio-chart-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  white-space: nowrap;
  font: 9px/1 "Geist Mono", monospace;
}
.portfolio-chart-toolbar input { accent-color: var(--accent); }
#portfolio-sub-indicators { padding-left: 13px; border-left: 1px solid var(--line); }
#portfolio-event-menu { position: relative; }
#portfolio-event-menu summary {
  padding: 7px 9px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  list-style: none;
  font: 600 9px/1 "Geist Mono", monospace;
}
#portfolio-event-menu summary::-webkit-details-marker { display: none; }
#portfolio-event-menu summary::after { content: " ▾"; color: var(--muted); }
#portfolio-event-menu[open] summary::after { content: " ▴"; }
#portfolio-event-filters {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-height: 260px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px #0a0a0a24;
  z-index: 8;
}
.portfolio-chart-stage { position: relative; height: 720px; }
#portfolio-chart { width: 100%; height: 100%; }
#portfolio-chart-status {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, .86);
  font: 11px/1.5 "Geist Mono", monospace;
  z-index: 2;
}
#portfolio-chart-status[hidden] { display: none; }
.portfolio-chart-note {
  padding: 11px 16px;
  color: var(--muted);
  background: #f7f9fa;
  border-top: 1px solid var(--line);
  font-size: 9px;
  line-height: 1.5;
}

.portfolio-empty { padding: 18px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.portfolio-empty.inverse { color: #8f9aa1; }
.portfolio-disclaimer {
  padding: 14px 16px;
  color: var(--muted);
  background: #e8edf0;
  font-size: 9px;
  line-height: 1.55;
}

footer { max-width: 1440px; margin: 0 auto; padding: 0 40px 36px; color: var(--muted); font-size: 10px; }

@media (max-width: 900px) {
  .topbar { min-height: 72px; padding: 12px 16px; gap: 0; }
  .brand-block, .brand-line, .topbar-actions, .source-summary { gap: 0; }
  .brand-mark { width: 27px; height: 27px; margin-right: 12px; }
  .brand-line strong { font-size: 16px; }
  .task-badge { display: none; }
  .run-meta { margin-top: 3px; max-width: 180px; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions > * + * { margin-left: 8px; }
  .source-summary { padding: 8px; border: 1px solid #414b52; }
  .source-summary .health-dot { margin-right: 9px; }
  .source-summary strong { display: none; }
  .source-summary small { margin: 0; color: #dde3e6; font-size: 9px; }
  .archive-button { width: 36px; overflow: hidden; padding: 9px; color: transparent; white-space: nowrap; }
  .archive-button::before { content: "↗"; color: #fff; }
  .source-tooltip { position: fixed; top: 76px; right: 16px; left: 16px; width: auto; max-height: min(60vh, 420px); }

  .system-navigation { min-height: 112px; padding: 8px 14px; display: block; }
  .workspace-tabs, .stage-tabs { width: 100%; }
  .workspace-tabs {
    min-height: 44px;
    padding: 3px;
    border-radius: 9px;
  }
  .workspace-tabs > *, .stage-tabs > a {
    flex: 1;
    min-width: 0;
    min-height: 38px;
    padding: 0 5px;
    font-size: 9px;
    text-align: center;
  }
  #portfolio-nav-count { display: none; }
  .stage-tabs {
    min-height: 44px;
    margin-top: 8px;
    padding: 0;
    gap: 5px;
    background: transparent;
    border: 0;
  }
  .stage-tabs > a {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .stage-tabs .home-link {
    flex: 0 0 44px;
    padding: 0 4px;
    color: var(--muted);
    background: transparent;
    border-color: transparent;
  }
  .stage-tabs > span { display: none; }
  .stage-workspace { padding: 16px 16px 24px; }
  .stage-hero { min-height: 0; display: block; }
  .stage-hero > div { padding: 24px 20px; }
  .stage-hero h1 { margin-top: 12px; font-size: 30px; }
  .stage-hero p { font-size: 10px; }
  .stage-focus {
    min-height: 124px;
    border-top: 1px solid #2c3237;
    border-left: 0;
  }
  .stage-focus strong { font-size: 23px; }
  .stage-metrics { grid-template-columns: 1fr 1fr; }
  .stage-metrics article {
    min-height: 92px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }
  .stage-metrics article:nth-child(2n) { border-right: 0; }
  .stage-metrics strong { font-size: 20px; }
  .stage-action-grid { grid-template-columns: 1fr; gap: 14px; }
  .stage-item { min-height: 66px; padding: 12px 14px; }
  .stage-alert { grid-template-columns: 24px 1fr; }
  .stage-alert button { grid-column: 1 / -1; width: 100%; }
  .candidate-intro { display: block; margin-bottom: 14px; }
  .candidate-intro h1 { font-size: 23px; }
  .candidate-intro p { font-size: 10px; line-height: 1.5; }
  .candidate-intro > span { display: block; margin-top: 8px; }

  main { padding: 20px 16px 28px; }
  .intro { display: block; margin-bottom: 16px; }
  h1 { font-size: 23px; }
  .intro p { font-size: 11px; }
  .last-updated { display: block; margin-top: 7px; }

  .metrics { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; background: transparent; border: 0; }
  .metrics article { min-height: 82px; padding: 13px 14px; background: var(--surface); border: 1px solid var(--line); }
  .metrics article:last-child { border-right: 1px solid var(--line); }
  .metrics strong { font-size: 21px; }
  .metrics small { display: none; }
  .midday-status-band {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px;
    border: 1px solid #d99a2b;
  }
  .midday-status-band article {
    min-height: 78px;
    padding: 11px 12px;
    border: 1px solid #e7d3a7;
    background: rgba(255, 255, 255, .45);
  }
  .midday-status-band strong { font-size: 15px; }
  .midday-status-band small { font-size: 9px; }

  .ai-brief { display: block; min-height: 0; margin-bottom: 16px; }
  .ai-brief-label { padding: 14px 16px 0; display: block; background: transparent; border: 0; }
  .ai-brief-label small { margin-left: 8px; }
  .ai-brief > div:last-child { padding: 10px 16px 16px; }
  .ai-brief h2 { font-size: 15px; }
  .ai-brief p { font-size: 10px; }

  .etf-heat-board { margin-bottom: 16px; }
  .etf-heat-heading { padding: 10px 12px; align-items: flex-start; flex-direction: column; }
  .etf-heat-heading > * + * { margin-top: 5px; }
  .etf-heat-list {
    grid-template-columns: repeat(8, minmax(210px, 72vw));
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .etf-heat-card { scroll-snap-align: start; }

  .board-market { margin-bottom: 16px; }
  .board-market-heading { padding: 14px; align-items: flex-start; flex-direction: column; }
  .board-market-heading h2 { font-size: 17px; }
  .board-market-summary { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .board-market-summary span, .board-market-summary strong { text-align: center; }
  .board-leaders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .board-leader strong { font-size: 14px; }
  .board-heat-grid, .board-flow-grid { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .board-heatmap { min-height: 230px; grid-auto-rows: 62px; }
  .board-heat-cell { padding: 6px; }
  .board-heat-cell strong { font-size: 9px; }
  .board-rotation { margin: 0 10px; }
  .board-rotation > header { align-items: flex-start; flex-direction: column; }
  .board-rotation-body { display: block; }
  .board-rotation-ranking { border-right: 0; border-bottom: 1px solid var(--line); }
  .board-rank-row { grid-template-columns: 28px minmax(0, 1fr) 70px 52px; padding: 0 9px; gap: 6px; }
  .board-rank-trend { min-height: 170px; padding: 10px; }
  .board-trend-points { min-width: 420px; }
  .board-flow-list { min-height: 232px; padding: 8px 9px; }
  .board-flow-row {
    min-height: 52px;
    grid-template-columns: 24px 72px minmax(70px, 1fr) 62px;
    gap: 6px;
  }
  .board-flow-row > span:last-child {
    grid-column: 2 / -1;
    text-align: left;
  }

  .candidate-comparison { margin-bottom: 16px; }
  .comparison-heading { min-height: 58px; padding: 8px 12px; }
  .comparison-heading h2 { font-size: 15px; }
  .comparison-heading small { max-width: 185px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .comparison-periods button { min-width: 52px; min-height: 32px; padding: 0 10px; font-size: 9px; }
  .comparison-content { display: block; }
  .comparison-summary { padding: 13px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .comparison-metrics { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .comparison-metrics button, .comparison-metrics > div { text-align: center; }
  .comparison-metrics strong { font-size: 18px; }
  .comparison-metrics span { font-size: 8px; }
  .comparison-net { margin-top: 12px; }
  .comparison-lists { display: block; }
  .comparison-list + .comparison-list { border-left: 0; border-top: 1px solid var(--line); }
  .comparison-list-heading { min-height: 44px; cursor: pointer; }
  .comparison-list-heading::after { margin-left: 6px; color: var(--muted); content: "▾"; }
  .comparison-list.is-mobile-open .comparison-list-heading::after { content: "▴"; }
  .comparison-stock-list { display: block; min-height: 0; max-height: none; overflow: hidden; }
  .comparison-stock-list .comparison-stock-row:nth-child(n+3) { display: none; }
  .comparison-list.is-mobile-open .comparison-stock-list {
    max-height: 224px;
    overflow: auto;
  }
  .comparison-list.is-mobile-open .comparison-stock-row:nth-child(n+3) { display: flex; }
  .comparison-stock-row { min-height: 38px; padding: 0 14px; }

  .strategy-lane-board { margin-bottom: 16px; }
  .lane-board-heading { min-height: 0; padding: 14px; display: block; }
  .lane-board-heading h2 { font-size: 18px; }
  .lane-board-heading p { font-size: 9px; line-height: 1.45; }
  .lane-board-summary { margin-top: 12px; }
  .strategy-lanes {
    padding: 10px;
    grid-template-columns: repeat(4, minmax(278px, 82vw));
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .strategy-lane { scroll-snap-align: start; }
  .strategy-lane > header { min-height: 112px; }
  .lane-candidates { min-height: 0; }

  .strategy-observer { margin-bottom: 16px; }
  .strategy-observer-heading { min-height: 44px; padding: 8px 12px; }
  .strategy-observer-heading > div:first-child { display: block; }
  .strategy-observer-heading h2 { font-size: 16px; }
  .strategy-observer-heading small { display: block; margin-top: 4px; }
  #strategy-mobile-toggle { display: none; }
  #strategy-filter-content { display: block; }
  .observer-filter-band { min-height: 52px; padding: 8px 12px; align-items: flex-start; flex-direction: column; gap: 0; }
  .observer-filter-band > * + * { margin-top: 5px; }
  .observer-filter-label { font-size: 8px; }
  .strategy-filters {
    width: 100%;
    min-height: 0;
    max-height: 240px;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    align-content: start;
  }
  .rule-filters { overflow-x: hidden; overflow-y: auto; }
  .strategy-filter {
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 8px 12px;
    justify-content: space-between;
    white-space: normal;
    text-align: left;
    font-size: 9px;
    line-height: 1.35;
  }

  .research-workspace { display: flex; flex-direction: column; gap: 0; margin-bottom: 16px; }
  .research-workspace > * + * { margin-top: 16px; }
  .candidate-panel, .stock-panel { height: auto; }
  .candidate-columns { display: none; }
  .candidate-list { max-height: none; overflow: visible; }
  .candidate-row { min-height: 84px; grid-template-columns: 1.35fr 1fr 50px; }
  .panel-heading { min-height: 52px; padding: 0 14px; }
  .panel-heading h2 { font-size: 16px; }

  .stock-overview { min-height: 0; padding: 14px; display: block; }
  .stock-identity p { white-space: normal; line-height: 1.45; }
  .quote-summary { margin-top: 14px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .quote-summary div { padding-top: 9px; text-align: left; border-top: 1px solid var(--line); }
  .chart-toolbar { padding: 10px 12px; align-items: flex-start; flex-direction: column; }
  #chart-filters { width: 100%; margin: 0; display: grid; grid-template-columns: 1fr; gap: 10px; overflow: visible; }
  #chart-filters > * { margin: 4px; }
  #chart-filters fieldset { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  #chart-filters fieldset label + label { margin-left: 8px; }
  #chart-filters label { font-size: 8px; }
  #subchart-filters { padding: 10px 0 0 !important; border-left: 0 !important; border-top: 1px solid var(--line) !important; }
  .event-note { width: 100%; text-align: right; }
  .event-menu #event-filters { position: fixed; right: 16px; left: 16px; width: auto; }
  .chart-stage, #chart { height: 360px; min-height: 360px; flex: none; }

  .lower-grid { display: flex; flex-direction: column; gap: 0; margin-bottom: 16px; }
  .lower-grid > * + * { margin-top: 16px; }
  .opinion-panel { min-height: 0; display: block; }
  .opinion-lead { padding: 16px; }
  .opinion-lead h2 { font-size: 16px; }
  .opinion-panel > p { padding: 16px; font-size: 11px; }
  .source-status { max-height: none; }
  .history-days { display: none; max-height: 320px; overflow: auto; }
  .history-panel.is-mobile-open .history-days { display: flex; }

  .portfolio-workspace { padding-top: 16px; }
  .portfolio-intro { display: block; margin-bottom: 14px; }
  .portfolio-intro h1 { font-size: 23px; }
  .portfolio-intro p { font-size: 10px; line-height: 1.5; }
  .portfolio-freshness { margin-top: 10px; text-align: left; }

  .portfolio-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
    background: transparent;
    border: 0;
  }
  .portfolio-metrics article { min-height: 84px; padding: 13px; background: var(--surface); border: 1px solid var(--line); }
  .portfolio-metrics article:last-child { border-right: 1px solid var(--line); }
  .portfolio-metrics strong { font-size: 19px; }

  .portfolio-main-grid, .portfolio-review-grid { display: block; margin-bottom: 14px; }
  .portfolio-main-grid > * + *, .portfolio-review-grid > * + * { margin-top: 14px; }
  .portfolio-section-heading { min-height: 56px; padding: 9px 13px; align-items: flex-start; flex-direction: column; }
  .portfolio-section-heading > * + * { margin-top: 8px; }
  .portfolio-sort { width: 100%; }
  .portfolio-sort button { width: 33.333%; min-width: 0; padding-right: 5px; padding-left: 5px; }

  .holdings-table-head { display: none; }
  .holdings-list { padding: 10px; }
  .holding-row {
    min-height: 0;
    margin-bottom: 10px;
    padding: 13px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 8px;
    border: 1px solid var(--line);
  }
  .holding-row:last-child { margin-bottom: 0; border-bottom: 1px solid var(--line); }
  .holding-identity { grid-column: 1 / -1; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
  .holding-identity button { max-width: 210px; font-size: 13px; }
  .holding-cell { text-align: left; }
  .holding-cell small { display: block; }
  .holding-cell strong { margin-top: 4px; font-size: 9px; }
  .holding-plan { grid-column: 1 / -1; }

  .replacement-list { min-height: 0; }
  .portfolio-review-grid, .portfolio-gaps { display: none; }

  .portfolio-chart-panel { margin-bottom: 14px; }
  .portfolio-chart-overview { min-height: 0; padding: 14px; display: block; }
  .portfolio-chart-overview h2 { font-size: 16px; }
  .portfolio-chart-overview dl {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .portfolio-chart-overview dl div {
    padding-top: 9px;
    text-align: left;
    border-top: 1px solid var(--line);
  }
  .portfolio-chart-toolbar {
    padding: 10px 12px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .portfolio-chart-toolbar > span { margin-right: 0; }
  .portfolio-range-filters { width: 100%; }
  .portfolio-range-filters button { width: 33.333%; min-height: 38px; }
  .portfolio-chart-toolbar fieldset {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  #portfolio-sub-indicators {
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  #portfolio-event-menu { width: 100%; text-align: right; }
  #portfolio-event-filters { position: fixed; right: 16px; left: 16px; width: auto; }
  .portfolio-chart-stage { height: 430px; }
  .portfolio-chart-note { font-size: 8px; }

  footer { padding: 0 16px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .source-tooltip { transition: none; }
}
