/* AstraTrader clarity revamp. Shared shell + scoped components from the October prototype. */
:root {
  --bg: #0b0e12; --nav: #0b0e12; --surface: #12161c; --surface-2: #171c23;
  --surface-3: #1e242d; --line: #242b35; --line-strong: #323b47;
  --text: #e8edf3; --muted: #9aa6b5; --quiet: #7f8c9b;
  --accent: #8fd6b5; --accent-bg: #173328; --accent-ink: #062016;
  --pos: #5fd39a; --pos-bg: #13301f; --neg: #ff7f7f; --neg-bg: #3a1a1d;
  --positive: var(--pos); --negative: var(--neg); --warn: #f0b35a; --warn-bg: #36290f;
  --ai: #b794f6; --ai-bg: #241b38; --ai-line: #4b3a73;
  --orb: #7c8cff; --rotation: #2dd4bf; --reversion: #f5b14c; --trend: #f472b6;
  --chart-grid: #1f262f; --radius: 14px; --sidebar-w: 232px;
}
html[data-theme=light] {
  --bg: #f4f6f5; --nav: #f4f6f5; --surface: #fff; --surface-2: #f7f9f8;
  --surface-3: #edf1ef; --line: #e1e7e3; --line-strong: #cfd8d3;
  --text: #16201c; --muted: #56655f; --quiet: #65766e;
  --accent: #1f6b4f; --accent-bg: #e3f2ea; --accent-ink: #fff;
  --pos: #18845a; --pos-bg: #e3f4ec; --neg: #c23a46; --neg-bg: #fbe9eb;
  --positive: var(--pos); --negative: var(--neg); --warn: #96600f; --warn-bg: #fcf0d9;
  --ai: #6d42d6; --ai-bg: #f1ebfd; --ai-line: #d6c8f6;
  --orb: #4a5ae8; --rotation: #0f9c8c; --reversion: #c27c0e; --trend: #d23f8f;
  --chart-grid: #e8ede9;
}
.app-shell .sidebar { padding: 18px 14px 12px; background: var(--bg); }
.sidebar .brand { font-size: 17px; letter-spacing: -.2px; margin: 2px 8px 24px; }
.sidebar .brand-mark { width: 30px; height: 30px; }
.sidebar .nav-item { border-radius: 10px; padding: 9px 10px; min-height: 39px; font-size: 14px; gap: 11px; }
.sidebar .nav-item.active { background: var(--surface-3); }
.sidebar .nav-item.active .icon { color: var(--text); }
.sidebar .nav-item[href="/autopilot/"] .icon { color: var(--ai); }
.sidebar .secondary-label { margin: 22px 10px 6px; font-size: 10px; }
.sidebar nav[aria-label=Research] .nav-item, .sidebar nav[aria-label=Settings] .nav-item { font-size: 12px; min-height: 32px; padding-block: 6px; }
.sidebar .appearance-tools { flex-wrap: wrap; gap: 5px 12px; padding-inline: 0; }
.sidebar .appearance-tools .text-button { font-size: 12px; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 57px; padding: 10px 28px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); }
.topbar .breadcrumb { display: none; }
.topbar .account-tools { width: 100%; min-width: 0; }
.topbar .topbar-spacer { flex: 1; }
.topbar .account-picker select { font-weight: 650; font-size: 13px; max-width: 210px; }
.topbar .stop-button { padding: 7px 11px; min-height: 34px; border: 1px solid color-mix(in srgb, var(--neg) 48%, var(--line)); color: var(--neg); background: transparent; border-radius: 10px; font-size: 13px; }
.rv-ask-button { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid var(--ai-line); background: var(--ai-bg); border-radius: 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.rv-ask-button .icon { color: var(--ai); width: 18px; height: 18px; }
.rv-ask-button kbd { color: var(--muted); border: 1px solid var(--ai-line); border-radius: 4px; padding: 0 4px; font: 11px ui-monospace, monospace; }
.rv-preview-banner { display: flex; flex-wrap: wrap; gap: 5px 14px; padding: 8px 28px; background: var(--warn-bg); color: var(--warn); font-size: 11px; border-bottom: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.app-shell > .workspace > main { width: 100%; max-width: 1240px; padding: 28px 28px 56px; }
.rv-page, .rv-story { min-width: 0; }
.rv-page h1 { font-size: 28px; line-height: 1.25; font-weight: 680; letter-spacing: -.65px; margin: 0; }
.rv-page h2, .rv-story h2 { font-size: 19px; font-weight: 650; line-height: 1.4; letter-spacing: -.2px; margin: 0; }
.rv-page h3, .rv-story h3 { font-size: 16px; font-weight: 630; margin: 0; }
.rv-page p, .rv-story p { margin: 0; line-height: 1.65; }
.rv-page .icon, .rv-story .icon { width: 17px; height: 17px; }
.rv-page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.rv-page-head > div:first-child { flex: 1; min-width: 200px; }
.rv-page-head p:not(.rv-eyebrow) { color: var(--muted); margin-top: 9px; max-width: 77ch; }
.rv-page-head h1 .rv-dot { width: 14px; height: 14px; }
.rv-page-head .rv-actions + h1 { margin-top: 12px; }
.rv-page .rv-eyebrow, .rv-story .rv-eyebrow, .rv-drawer-body > .rv-eyebrow { color: var(--quiet); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 650; margin: 0 0 10px; }
.rv-muted { color: var(--muted); }
.rv-caption, .rv-page .rv-caption, .rv-story .rv-caption { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.6; }
.rv-caption .icon { width: 15px; height: 15px; margin-right: 5px; }
.rv-card > .rv-caption, .rv-card > p + p { margin-top: 12px; }
.rv-card h2 + p, .rv-card h3 + p { margin-top: 10px; }
.rv-link, .rv-back { color: var(--accent); display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; }
.rv-link:hover, .rv-back:hover { text-decoration: underline; }
.rv-back { color: var(--muted); margin-bottom: 16px; font-weight: 400; }
.rv-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.rv-card.rv-flush { padding: 0; overflow: hidden; }
.rv-card-head, .rv-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rv-card-head h2, .rv-card-head h3 { font-size: 16px; }
.rv-padded { padding: 18px 18px 0; }
.rv-section { margin-top: 28px; }
.rv-section[id], .rv-detail-grid[id] { scroll-margin-top: 84px; }
.rv-section-head p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.rv-stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.rv-home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.rv-grid-2, .rv-strategy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rv-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.rv-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rv-actions form { margin: 0; }
.rv-page .button, .rv-story .button { border-radius: 10px; font-size: 13px; padding: 8px 13px; min-height: 36px; }
.rv-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-size: 11px; line-height: 1.5; font-weight: 600; }
.rv-chip.pos { color: var(--pos); background: var(--pos-bg); }
.rv-chip.neg { color: var(--neg); background: var(--neg-bg); }
.rv-chip.accent { color: var(--accent); background: var(--accent-bg); }
.rv-chip.ai { color: var(--ai); background: var(--ai-bg); }
.rv-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--quiet); flex: none; }
.orb { --strategy-color: var(--orb); } .rotation { --strategy-color: var(--rotation); }
.reversion { --strategy-color: var(--reversion); } .trend { --strategy-color: var(--trend); }
.manual { --strategy-color: var(--quiet); } .rv-dot { background: var(--strategy-color, var(--quiet)); }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.rv-missing, .rv-page .rv-missing { color: var(--warn); font-size: 12px; margin-top: 10px; }
.rv-big-number { font-size: clamp(34px, 3.5vw, 46px); line-height: 1.25; font-weight: 680; letter-spacing: -1.2px; margin: 8px 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rv-hero h2 { font-size: 13px; color: var(--muted); }
.rv-hero h2 .rv-chip { margin-left: 6px; }
.rv-hero-top { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.rv-hero-split { display: flex; flex-wrap: wrap; gap: 5px 16px; font-size: 13px; color: var(--muted); }
.rv-hero-split b { font-weight: 600; }
.rv-hero-split b:not(.pos):not(.neg) { color: var(--text); }
.rv-period-summary { display: grid; gap: 8px; font-size: 12px; margin: 4px 0 8px; min-width: 190px; }
.rv-period-summary > div { display: flex; justify-content: space-between; gap: 12px; }
.rv-period-summary dt { color: var(--muted); }
.rv-period-summary dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.rv-chart { min-height: 230px; margin: 20px 0 5px; position: relative; color: var(--accent); }
.rv-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.rv-chart .rv-grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.rv-chart .rv-zero { stroke: var(--line-strong); stroke-dasharray: 4 4; }
.rv-chart text { fill: var(--muted); font: 11px Inter, -apple-system, sans-serif; font-variant-numeric: tabular-nums; }
.rv-chart .rv-series { stroke: var(--strategy-color, var(--accent)); stroke-width: 2; fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.rv-chart .rv-chart-point { fill: var(--bg); stroke: var(--strategy-color, var(--accent)); stroke-width: 2; }
.rv-chart .rv-chart-reference { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.rv-chart-fallback { color: var(--muted); font-size: 13px; padding: 50px 15px; text-align: center; }
.rv-chart-note { color: var(--muted); font-size: 11px; margin: 4px 0; }
.rv-chart-detail { position: absolute; left: 8px; top: 5px; font-size: 12px; background: var(--surface-2); color: var(--text); border-radius: 6px; padding: 5px 8px; pointer-events: none; }
.rv-strategy-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; }
.rv-mini-strategy { position: relative; display: grid; gap: 9px; padding: 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 13px; overflow: hidden; }
.rv-mini-strategy::before, .rv-strategy-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--strategy-color, var(--quiet)); }
.rv-mini-strategy > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: start; justify-content: space-between; font-size: 13px; }
.rv-mini-strategy .rv-chip { font-size: 10px; padding: 2px 6px; }
.rv-mini-strategy small { color: var(--muted); font-size: 11px; }
.rv-strategy-number { font-size: 22px; font-variant-numeric: tabular-nums; }
.rv-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.rv-table th { background: transparent; text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--muted); font-weight: 500; padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.rv-table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; line-height: 1.6; }
.rv-table tr:last-child td { border-bottom: 0; }
.rv-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rv-table .rv-ticker { font-size: 13px; font-weight: 650; }
.rv-table small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 3px; }
.rv-table .rv-chip { white-space: normal; max-width: 260px; }
.rv-table tr[data-story-url] { cursor: pointer; }
.rv-table tr[data-story-url]:hover, .rv-table tr[data-story-url]:focus-visible { background: var(--surface-2); outline-offset: -2px; }
.rv-holdings th:nth-child(3) { min-width: 140px; }
.rv-holdings td:first-child { min-width: 130px; }
.rv-holdings .rv-wide-column { width: 29%; }
.rv-table .rv-holding-group td { padding: 8px 14px; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.rv-next { color: var(--muted); font-size: 12px; }
.rv-note-preview { max-width: 220px; overflow-wrap: anywhere; }
.rv-price-rail { height: 28px; margin: 5px 10px; position: relative; background: linear-gradient(var(--line-strong), var(--line-strong)) center / 100% 3px no-repeat; }
.rv-price-rail .rail-stop, .rv-price-rail .rail-entry, .rv-price-rail .rail-mark { position: absolute; top: 7px; width: 2px; height: 14px; background: var(--muted); transform: translateX(-50%); }
.rv-price-rail .rail-stop { background: var(--neg); }
.rv-price-rail .rail-mark { top: 8px; width: 11px; height: 11px; border: 2px solid var(--surface); border-radius: 50%; background: var(--text); box-shadow: 0 0 0 1px var(--line-strong); }
.rv-decision-preview { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; }
.rv-decision-preview > div { flex: 1; min-width: 0; }
.rv-decision-preview strong { font-size: 13px; }
.rv-decision-preview small { display: block; color: var(--muted); font-size: 11px; }
.rv-decision-icon { color: var(--warn); background: var(--warn-bg); border-radius: 10px; padding: 8px; }
.rv-clear { text-align: center; padding: 23px 10px; }
.rv-clear > .icon { color: var(--accent); display: block; margin: 0 auto 12px; width: 24px; height: 24px; }
.rv-clear p { color: var(--muted); font-size: 12px; margin-top: 6px; }
.rv-ai-card { background: linear-gradient(140deg, var(--ai-bg), var(--surface) 90%); border-color: var(--ai-line); }
.rv-ai-card h2 .icon, .rv-ai-card .rv-eyebrow { color: var(--ai); }
.rv-ai-card > p:not(.rv-caption) { font-size: 13px; line-height: 1.8; }
.rv-prompts { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0 10px; }
.rv-prompts button { font-size: 11px; font-weight: 600; border: 1px solid var(--ai-line); background: var(--surface); padding: 6px 9px; border-radius: 99px; }
.rv-rhythm { display: grid; gap: 14px; }
.rv-rhythm > a { display: flex; gap: 5px; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.rv-rhythm > a:last-child { border: 0; padding-bottom: 0; }
.rv-rhythm strong { font-size: 12px; }
.rv-rhythm small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.rv-health-link { display: flex; align-items: center; gap: 8px; padding: 5px 8px; color: var(--muted); font-size: 12px; }
.rv-health-link span { flex: 1; }
.rv-attention { padding: 0; margin: 0 0 20px; list-style: none; }
.rv-attention li { border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 9px; margin-top: 8px; padding: 10px 13px; background: var(--surface); font-size: 13px; }
.rv-attention .attention-danger { border-left-color: var(--neg); }
.rv-alert { border: 1px solid var(--warn); background: var(--warn-bg); color: var(--warn); padding: 15px 18px; border-radius: 12px; margin: 16px 0; font-size: 13px; }
.rv-disclosure { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rv-disclosure > summary { padding: 14px 16px; cursor: pointer; font-size: 12px; color: var(--muted); }
.rv-disclosure > summary > span { margin-left: 8px; }
.rv-disclosure-body { padding: 0 16px 18px; }
.rv-disclosure-body > .rv-actions { margin-top: 12px; }
.rv-disclosure + .rv-disclosure { margin-top: 12px; }
.rv-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 16px 0; }
.rv-segments { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); flex-shrink: 0; }
.rv-segments a { padding: 5px 11px; font-size: 12px; font-weight: 600; border-radius: 7px; color: var(--muted); }
.rv-segments a[aria-current] { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 #0003; }
.rv-summary-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; border-block: 1px solid var(--line); padding: 20px 0; margin: 18px 0; }
.rv-summary-row > div { min-width: 0; }
.rv-summary-row small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.rv-summary-row strong { display: block; font-size: 23px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rv-strategy-card { position: relative; overflow: hidden; padding: 22px; }
.rv-strategy-card h2 > a { display: flex; align-items: center; gap: 3px; }
.rv-strategy-card h2 .icon { margin-left: auto; color: var(--quiet); }
.rv-strategy-description { color: var(--muted); font-size: 13px; margin-top: 10px !important; min-height: 44px; }
.rv-strategy-result { margin: 22px 0 18px; }
.rv-strategy-result > strong { font-size: 34px; line-height: 1.2; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.rv-strategy-result small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.rv-inline-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.rv-inline-stats dt { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.rv-inline-stats dd { font-size: 14px; font-weight: 600; margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rv-card-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 20px 0 12px; }
.rv-card-links .text-button { font-size: 12px; }
.rv-anchor-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.rv-anchor-nav a { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 6px 10px; background: var(--surface); }
.rv-anchor-nav a:hover { color: var(--accent); border-color: var(--accent); }
.rv-metric-grid, .rv-story-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.rv-metric-grid > div, .rv-story-facts > div { padding: 13px; min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rv-metric-grid small, .rv-story-facts dt, .rv-story-facts small { font-size: 11px; display: block; color: var(--muted); margin-bottom: 5px; }
.rv-metric-grid strong, .rv-story-facts dd { display: block; font-size: 16px; font-weight: 650; margin: 0; overflow-wrap: anywhere; }
.rv-steps, .rv-trust-ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rv-steps article > span, .rv-trust-ladder article > span:first-child { color: var(--accent); font-size: 12px; font-weight: 600; }
.rv-steps h3, .rv-trust-ladder h3 { margin: 14px 0 9px; }
.rv-steps p, .rv-trust-ladder p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.rv-trust-ladder .rv-chip { margin-top: 16px; }
.rv-outcomes { display: grid; gap: 3px; }
.rv-outcomes a { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.rv-outcomes a > span { flex: 1; }
.rv-outcomes a small { display: block; color: var(--muted); font-size: 11px; }
.rv-outcomes a:last-child { border: 0; }
.rv-histogram { display: grid; gap: 13px; padding: 8px 0; }
.rv-histogram > div { display: grid; grid-template-columns: 82px 1fr 25px; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); }
.rv-histogram > div > div { height: 19px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.rv-histogram i { display: block; height: 100%; background: var(--strategy-color, var(--accent)); opacity: .7; min-width: 0; }
.rv-tabs { display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--line); }
.rv-tabs a { border-bottom: 2px solid transparent; padding: 12px 0; font-size: 13px; color: var(--muted); }
.rv-tabs a[aria-current] { color: var(--text); border-color: var(--accent); }
.rv-contributions { display: grid; gap: 18px; }
.rv-contributions a > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.rv-contribution-track { display: block; background: var(--surface-3); height: 8px; border-radius: 4px; overflow: hidden; }
.rv-contribution-track i { display: block; height: 100%; background: var(--muted); border-radius: 4px; }
.rv-contribution-track i.pos { background: var(--pos); }
.rv-contribution-track i.neg { background: var(--neg); }
.rv-rank-list { display: grid; gap: 10px; margin: 12px 0 22px; }
.rv-rank-list a { display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); padding-bottom: 10px; font-size: 14px; }
.rv-calendar-head, .rv-calendar-week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, .88fr); gap: 5px; }
.rv-calendar-head { font-size: 11px; text-align: center; color: var(--muted); margin-bottom: 8px; }
.rv-calendar-week { margin-top: 5px; }
.rv-calendar-day, .rv-calendar-total { display: flex; flex-direction: column; min-width: 0; min-height: 79px; padding: 7px; border-radius: 8px; border: 1px solid transparent; background: var(--surface-2); }
.rv-calendar-day > span, .rv-calendar-total > span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.rv-calendar-day i { font-style: normal; font-size: 9px; }
.rv-calendar-day strong, .rv-calendar-total strong { font-size: 12px; font-variant-numeric: tabular-nums; margin-top: 5px; overflow-wrap: anywhere; }
.rv-calendar-day small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.rv-calendar-day.gain { background: color-mix(in srgb, var(--pos) 18%, var(--surface)); }
.rv-calendar-day.loss { background: color-mix(in srgb, var(--neg) 18%, var(--surface)); }
.rv-calendar-day.missing { border: 1px dashed var(--warn); }
.rv-calendar-day.inactive { background: transparent; opacity: .55; }
.rv-calendar-day.outside { visibility: hidden; }
.rv-calendar-total { background: transparent; border: 1px dashed var(--line-strong); }
.rv-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 22px 0; }
.rv-filters label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--muted); min-width: 0; }
.rv-filters select, .rv-filters input[type=search] { border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 10px; background: var(--surface); color: var(--text); font-size: 12px; min-height: 37px; width: 100%; max-width: 250px; }
.rv-filters .rv-search-label { flex: 1; min-width: 130px; }
.rv-filters .rv-check-label { flex-direction: row; align-items: center; padding-bottom: 10px; }
.rv-filters .text-button { padding-bottom: 9px; font-size: 12px; }
.rv-filter-note { padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; margin-top: 8px; }
.rv-filter-note a { margin-left: 10px; font-size: 12px; }
.rv-load-more { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 24px 0; }
.rv-empty { padding: 38px 18px; text-align: center; color: var(--muted); }
.rv-empty h2, .rv-empty strong { color: var(--text); }
.rv-empty p, .rv-empty .button { margin-top: 12px; }
.rv-empty small { display: block; margin-top: 8px; }
.rv-term { padding: 0; border: 0; border-bottom: 1px dotted var(--quiet); border-radius: 0; background: transparent; color: inherit; font: inherit; cursor: help; }
.rv-tooltip { position: fixed; z-index: 110; max-width: min(300px, calc(100vw - 24px)); padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-3); color: var(--text); box-shadow: var(--shadow); font-size: 12px; line-height: 1.65; pointer-events: none; }
.rv-modal-open, .rv-menu-open { overflow: hidden; }
.rv-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(760px, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 0; background: var(--bg); box-shadow: var(--shadow); }
.rv-drawer::backdrop { background: #0009; backdrop-filter: blur(2px); }
.rv-copilot { width: min(460px, 100%); }
.rv-drawer-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); background: var(--bg); }
.rv-drawer-head h2 { display: flex; align-items: center; gap: 9px; font-size: 16px; margin: 0; }
.rv-drawer-head h2 > .icon { color: var(--ai); }
.rv-drawer-body { padding: 22px; }
.rv-drawer-body > h3 { font-size: 22px; line-height: 1.4; margin: 12px 0; }
.rv-drawer-body > p { font-size: 13px; line-height: 1.7; }
.rv-story-page { max-width: 850px; margin: 0 auto; }
.rv-story { display: grid; gap: 20px; }
.rv-story-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rv-story-heading h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.rv-story-result { text-align: right; margin-left: auto; }
.rv-story-result strong { font-size: 32px; font-weight: 680; letter-spacing: -.8px; display: block; }
.rv-story-result small { display: block; color: var(--muted); font-size: 12px; }
.rv-story-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.rv-story-facts dd { font-size: 14px; }
.rv-story-facts small { font-size: 10px; margin-top: 5px; }
.rv-evidence-gap { border-style: dashed; }
.rv-evidence-gap p { font-size: 13px; color: var(--muted); }
.rv-timeline { list-style: none; padding: 0; margin: 18px 0 0; }
.rv-timeline li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.rv-timeline li:last-child { border: 0; }
.rv-timeline time { font-size: 11px; color: var(--muted); }
.rv-timeline strong { font-size: 13px; }
.rv-timeline p { font-size: 12px; color: var(--muted); }
.rv-note-form, #rv-ask-form { display: grid; gap: 12px; margin-top: 16px; }
.rv-note-form textarea, #rv-ask-form textarea { width: 100%; resize: vertical; min-height: 100px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); border-radius: 10px; padding: 12px; font-size: 13px; }
.rv-note-form .button { justify-self: start; }
#rv-ask-form > label { font-size: 13px; }
#rv-ask-form .rv-ai-consent { display: flex; align-items: start; gap: 8px; font-size: 12px; }
.rv-ai-consent input { margin: 2px 0 0; accent-color: var(--ai); }
.rv-answers { display: grid; gap: 14px; }
.rv-answer { border: 1px solid var(--ai-line); background: var(--surface); padding: 15px; border-radius: 12px; }
.rv-answer p { white-space: pre-wrap; font-size: 13px; line-height: 1.75; margin: 10px 0; }
.rv-answer .rv-question { color: var(--ai); font-weight: 600; }
.rv-answer .rv-caption { font-size: 11px; color: var(--muted); }
.rv-answer a { display: inline-flex; border: 1px solid var(--ai-line); border-radius: 6px; padding: 3px 7px; color: var(--ai); font-size: 11px; }
.rv-checklist { padding: 0; list-style: none; display: grid; gap: 15px; margin: 18px 0; font-size: 13px; }
.rv-checklist li { display: flex; gap: 10px; align-items: baseline; }
.rv-checklist li span { color: var(--quiet); }
.rv-checklist li span.pos { color: var(--pos); }
.rv-checklist li span.neg { color: var(--neg); }
.rv-shadow-control { margin-top: 8px; }
.rv-shadow-control .text-button { font-size: 11px; }
.rv-shadow-cohort { flex: 1; }
.rv-filters .rv-shadow-cohort select { max-width: 520px; }
.rv-shadow-range { display: grid; gap: 7px; padding-top: 13px; border-top: 1px solid var(--line); }
.rv-shadow-range > span { font-size: 11px; color: var(--muted); }
.rv-shadow-range strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.rv-shadow-provenance { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.rv-shadow-provenance p { margin-top: 8px; }
.rv-shadow-provenance code { font-size: 11px; }
.rv-decision-note { display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface); margin-bottom: 24px; }
.rv-decision-note > .icon { color: var(--accent); flex: none; }
.rv-decision-note > div { flex: 1; }
.rv-decision-note strong { display: block; font-size: 13px; }
.rv-decision-note span { font-size: 12px; color: var(--muted); }
.signals-linear .signal-workspace .signal-row { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-top: 10px; }
.signals-linear .signal-workspace .signal-row > summary { padding: 18px; }
.signals-linear .signal-workspace .signal-body { padding: 0 18px 18px; }
.signals-linear .signal-workspace .signal-group-heading { margin-bottom: 10px; }
.signals-linear .signal-workspace .rv-eyebrow { font-size: 11px; }
@media (min-width: 1500px) { .rv-home-grid { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (max-width: 1250px) {
  .rv-home-grid { grid-template-columns: minmax(0, 1fr) 290px; }
  .rv-hero-top { flex-wrap: wrap; }
  .rv-period-summary { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
  .rv-period-summary > div { flex-direction: column; gap: 2px; }
  .rv-holdings .rv-wide-column { display: none; }
  .rv-detail-grid { grid-template-columns: minmax(0, 1fr) 260px; }
  .rv-calendar-layout { grid-template-columns: 1fr; }
  .rv-calendar-day { min-height: 90px; }
}
@media (max-width: 1080px) {
  .rv-home-grid { grid-template-columns: 1fr; }
  .rv-home-grid > aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rv-home-grid > aside > .rv-health-link { grid-column: 1 / -1; }
  .rv-detail-grid { grid-template-columns: 1fr; }
  .rv-detail-grid > aside { grid-template-columns: 1fr 1fr; }
  .rv-steps, .rv-trust-ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rv-result-card .rv-chart { min-height: 200px; }
}
@media (max-width: 960px) {
  .app-shell { display: block; }
  .app-shell .sidebar { display: none; }
  .app-shell .sidebar.open { display: flex; position: fixed; inset: 0 auto 0 0; width: min(290px, calc(100vw - 40px)); z-index: 55; height: 100dvh; padding-top: 28px; box-shadow: var(--shadow); }
  .sidebar .sidebar-close { display: grid; position: absolute; top: 5px; right: 6px; }
  .topbar .mobile-menu { display: grid; order: 3; flex: none; }
  .topbar .account-tools { order: 1; }
  .mobile-bottom { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; inset: auto 0 0; z-index: 25; margin: 0; padding: 8px 4px max(9px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
  .mobile-bottom .nav-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 3px; margin: 0; gap: 5px; font-size: 11px; background: none; }
  .mobile-bottom .nav-item.active { color: var(--text); }
  .mobile-bottom .nav-item .icon { width: 21px; height: 21px; color: inherit; }
  .mobile-bottom .nav-item .count { position: absolute; top: -4px; left: calc(50% + 5px); margin: 0; background: var(--warn-bg); color: var(--warn); border-radius: 10px; font-size: 10px; padding: 1px 5px; }
  .app-shell > .workspace { padding-bottom: 70px; }
  .app-shell > .workspace > main { padding: 24px 20px 40px; }
}
@media (max-width: 640px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar .account-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0 8px; }
  .topbar .account-picker { grid-column: 1; grid-row: 1; min-width: 0; }
  .topbar .account-picker select { width: 100%; max-width: 100%; padding-block: 1px; text-overflow: ellipsis; font-size: 13px; }
  .topbar .account-picker > .icon, .topbar-spacer, .topbar .account-controls-link, .rv-ask-button kbd, .topbar .routing-status { display: none; }
  .topbar .mode-badge { display: inline-flex; grid-column: 1; grid-row: 2; justify-self: start; padding: 0 5px; font-size: 9px; line-height: 1.6; }
  .topbar .account-tools > form:not(.account-picker) { grid-column: 2; grid-row: 1 / 3; }
  .topbar .stop-button { min-height: 36px; width: 36px; padding: 8px; }
  .topbar .stop-button span { display: none; }
  .topbar .stop-button .icon { display: block; width: 17px; height: 17px; }
  .topbar .rv-ask-button { grid-column: 3; grid-row: 1 / 3; padding: 8px; font-size: 12px; gap: 5px; }
  .topbar .mobile-menu { width: 32px; height: 36px; }
  .app-shell > .workspace > main { padding: 24px 16px 40px; }
  .rv-preview-banner { padding: 9px 16px; }
  .rv-page h1 { font-size: 25px; }
  .rv-page-head p:not(.rv-eyebrow) { font-size: 14px; }
  .rv-page-head > .text-button { font-size: 12px; }
  .rv-card { padding: 16px; }
  .rv-hero .rv-big-number { font-size: 40px; }
  .rv-period-summary { grid-template-columns: 1fr; gap: 6px; order: 2; }
  .rv-period-summary > div { flex-direction: row; }
  .rv-hero-top { display: contents; }
  .rv-hero-split { font-size: 12px; margin: 8px 0 15px; }
  .rv-chart { min-height: 180px; margin-top: 20px; }
  .rv-chart text { font-size: 12px; }
  .rv-home-grid > aside, .rv-grid-2, .rv-strategy-grid, .rv-detail-grid > aside { grid-template-columns: 1fr; }
  .rv-home-grid > aside .rv-ai-card { order: -1; }
  .rv-strategy-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rv-mini-strategy { padding: 12px; }
  .rv-mini-strategy > div { font-size: 12px; }
  .rv-mini-strategy small { font-size: 10px; }
  .rv-table { table-layout: fixed; font-size: 11px; }
  .rv-table td, .rv-table th { padding: 11px 9px; min-width: 0; overflow-wrap: anywhere; }
  .rv-table .rv-ticker { font-size: 12px; }
  .rv-table .num { white-space: normal; }
  .rv-table .rv-chip { font-size: 10px; }
  .rv-holdings th:nth-child(3), .rv-holdings td:nth-child(3) { display: none; }
  .rv-holdings td:first-child { min-width: 0; width: 62%; }
  .rv-holdings td:nth-child(2) { width: 38%; }
  .rv-trade-table th:nth-child(n+4), .rv-trade-table td:nth-child(n+4) { display: none; }
  .rv-trade-table th:first-child { width: 32%; }
  .rv-trade-table th:nth-child(2) { width: 39%; }
  .rv-trade-table th:nth-child(3) { width: 29%; }
  .rv-summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .rv-summary-row strong { font-size: 24px; }
  .rv-summary-row small { font-size: 11px; }
  .rv-inline-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rv-strategy-card { padding: 18px; }
  .rv-steps { grid-template-columns: 1fr; }
  .rv-steps article { padding: 16px; }
  .rv-steps h3 { display: inline; margin-left: 8px; font-size: 15px; }
  .rv-steps p { margin-top: 10px; }
  .rv-trust-ladder { grid-template-columns: 1fr; }
  .rv-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rv-calendar-layout > .rv-card:first-child { padding: 12px 9px; }
  .rv-calendar-head, .rv-calendar-week { gap: 3px; }
  .rv-calendar-day, .rv-calendar-total { padding: 5px 3px; min-height: 69px; border-radius: 6px; }
  .rv-calendar-day strong, .rv-calendar-total strong { font-size: 10px; letter-spacing: -.3px; }
  .rv-calendar-day > span, .rv-calendar-day small, .rv-calendar-total > span { font-size: 9px; }
  .rv-calendar-day i { display: none; }
  .rv-calendar-head { font-size: 10px; }
  .rv-calendar-layout .rv-card-head { padding-inline: 3px; }
  .rv-calendar-layout .rv-caption { font-size: 10px; }
  .rv-filters { gap: 10px; }
  .rv-filters > label:not(.rv-check-label) { flex: 1 1 calc(50% - 10px); }
  .rv-filters input[type=search], .rv-filters select { max-width: 100%; }
  .rv-filters .rv-search-label { flex-basis: 100% !important; }
  .rv-drawer-head { padding: 13px 16px; }
  .rv-drawer-body { padding: 18px 14px 34px; }
  .rv-story-heading .rv-eyebrow { font-size: 10px; }
  .rv-story-result strong { font-size: 28px; }
  .rv-story-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rv-timeline li { grid-template-columns: 85px minmax(0, 1fr); gap: 10px; }
  .rv-ai-matrix, .rv-ai-matrix tbody, .rv-ai-matrix tr, .rv-ai-matrix td { display: block; }
  .rv-ai-matrix thead { display: none; }
  .rv-ai-matrix tbody tr { display: grid; grid-template-columns: 1fr 1fr; padding: 10px; border-bottom: 1px solid var(--line); }
  .rv-ai-matrix td { border: 0; }
  .rv-ai-matrix td:first-child { grid-column: 1 / -1; }
  .rv-ai-matrix td:not(:first-child)::before { display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
  .rv-ai-matrix td:nth-child(2)::before { content: "Rules"; }
  .rv-ai-matrix td:nth-child(3)::before { content: "Signal review"; }
  .rv-ai-matrix td:nth-child(4)::before { content: "Stop manager"; }
  .rv-ai-matrix td:nth-child(5)::before { content: "Early exit"; }
  .rv-ai-matrix td:nth-child(6)::before { content: "Overnight"; }
  .rv-shadow-history th:first-child, .rv-shadow-history td:first-child { display: none; }
  .rv-shadow-history td, .rv-shadow-history th { font-size: 11px; }
  .rv-shadow-history td:nth-child(3) { width: 34%; }
  .rv-shadow-replays, .rv-shadow-replays tbody, .rv-shadow-replays tr, .rv-shadow-replays td { display: block; }
  .rv-shadow-replays thead { display: none; }
  .rv-shadow-replays tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px; border-bottom: 1px solid var(--line); }
  .rv-shadow-replays td { border: 0; text-align: left; }
  .rv-shadow-replays td:first-child { grid-column: 1 / -1; }
  .rv-shadow-replays td:not(:first-child)::before { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
  .rv-shadow-replays td:nth-child(2)::before { content: "Original 1R"; }
  .rv-shadow-replays td:nth-child(3)::before { content: "Fixed stop"; }
  .rv-shadow-replays td:nth-child(4)::before { content: "Breakeven"; }
  .rv-shadow-replays td:nth-child(5)::before { content: "Shadow"; }
  .rv-shadow-replays td:nth-child(6)::before { content: "Difference vs fixed"; }
  .rv-decision-note { align-items: flex-start; flex-wrap: wrap; }
  .rv-decision-note > div { min-width: 180px; }
  .rv-decision-note > a { margin-left: 30px; font-size: 11px; }
  .signals-linear .signal-workspace .signal-row > summary { padding: 14px; }
  .signals-linear .signal-workspace .signal-body { padding: 0 14px 14px; }
}
@media (prefers-reduced-motion: no-preference) {
  .rv-card, .rv-mini-strategy, .rv-segments a { transition: border-color .15s, background-color .15s; }
  .rv-mini-strategy:hover { border-color: var(--strategy-color, var(--line-strong)); }
}
@media print { .rv-ask-button, .rv-drawer, .rv-controls, .mobile-bottom { display: none !important; } }

/* ---------------------------------------------------------------------------
   Nov 2026 redesign: entry-state chips, controls, session window, attention.
   --------------------------------------------------------------------------- */
.rv-chip.warn { color: var(--warn); background: var(--warn-bg); }
.working-entries { margin: 6px 0 12px; padding-left: 18px; display: grid; gap: 4px; }
.subtle-heading { font-size: 13px; margin: 14px 0 4px; color: var(--muted); font-weight: 600; }

/* Home: market status, session window, week bars, risk events. */
.rv-status-line { display: block; }
.rv-led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--quiet); margin-right: 7px; vertical-align: 1px; }
.rv-led.open { background: var(--pos); }
.rv-led.pre, .rv-led.after { background: var(--warn); }
.rv-week { list-style: none; margin: 14px 0 4px; padding: 0; display: grid; gap: 6px; }
.rv-week li > a, .rv-week li { display: grid; grid-template-columns: 112px minmax(0, 1fr) 128px; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.rv-week li > a { grid-column: 1 / -1; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; }
.rv-week li > a:hover, .rv-week li > a:focus-visible { background: var(--surface-3); }
.rv-week-day { font-size: 13px; color: var(--muted); }
.rv-week-track { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; display: block; }
.rv-week-bar { display: block; height: 100%; border-radius: 5px; background: var(--quiet); min-width: 2px; }
.rv-week-bar.positive, .rv-week-bar.pos { background: var(--pos); }
.rv-week-bar.negative, .rv-week-bar.neg { background: var(--neg); }
.rv-week-value { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.rv-week-value small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.rv-week-nav { display: inline-flex; gap: 14px; }
.rv-event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rv-event-list li { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.rv-event-list li:first-child { border-top: 0; padding-top: 0; }
.rv-event-list time { font-size: 12px; color: var(--muted); }
.rv-event-list p { margin: 0; }
.rv-phone-only { display: none; }

/* Light theme: quiet text, gains and secondary text at 4.5:1 or better. */
html[data-theme=light] { --muted: #4d5b55; --quiet: #5c6c65; --pos: #137a52; }

/* Phones: a labelled pause control, readable text, essential columns stacked. */
@media (max-width: 640px) {
  .topbar .stop-button { width: auto; min-width: 44px; min-height: 44px; padding: 8px 10px; gap: 6px; }
  .topbar .stop-button span { display: inline; font-size: 12px; }
  .topbar .mode-badge { font-size: 11px; }
  .rv-table { font-size: 13px; }
  .rv-table .rv-ticker { font-size: 14px; }
  .rv-table .rv-chip { font-size: 11px; }
  .rv-mini-strategy small, .rv-summary-row small { font-size: 12px; }
  .rv-calendar-day strong, .rv-calendar-total strong { font-size: 12px; letter-spacing: 0; }
  .rv-calendar-day > span, .rv-calendar-day small, .rv-calendar-total > span, .rv-calendar-head { font-size: 11px; }
  .rv-calendar-layout .rv-caption { font-size: 12px; }
  .rv-week li > a, .rv-week li { grid-template-columns: 84px minmax(0, 1fr) 96px; gap: 8px; }
  .rv-phone-only { display: block; }
  .rv-holdings thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rv-holdings, .rv-holdings tbody { display: block; }
  .rv-holdings tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--line); }
  .rv-holdings tr.rv-holding-group { display: block; }
  .rv-holdings td { border: 0; }
  .rv-holdings td:first-child, .rv-holdings td:nth-child(2) { width: auto; }
  .rv-holdings th:nth-child(3), .rv-holdings td:nth-child(3) { display: block; grid-column: 1 / -1; padding-top: 0; }
  .rv-holdings td:nth-child(4) { display: none; }
}

/* Strategies: one scannable row per strategy, and a same-window comparison. */
.rv-strategy-rows { display: grid; gap: 12px; }
.rv-strategy-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 18px 22px; align-items: start; border-left: 3px solid var(--strategy-color, var(--line-strong)); }
.rv-strategy-row.orb { --strategy-color: var(--orb); } .rv-strategy-row.rotation { --strategy-color: var(--rotation); }
.rv-strategy-row.reversion { --strategy-color: var(--reversion); } .rv-strategy-row.trend { --strategy-color: var(--trend); }
.rv-strategy-ident h2 { font-size: 17px; margin: 0 0 8px; }
.rv-strategy-ident h2 a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.rv-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rv-health.ok { color: var(--pos); background: var(--pos-bg); }
.rv-health.held, .rv-health.overdue, .rv-health.running { color: var(--warn); background: var(--warn-bg); }
.rv-health.failed { color: var(--neg); background: var(--neg-bg); }
.rv-health-line { margin: 0 0 4px; font-size: 13px; }
.rv-spark { width: 100%; max-width: 220px; height: 40px; display: block; margin-bottom: 8px; }
.rv-spark line { stroke: var(--line-strong); stroke-dasharray: 3 3; stroke-width: 1; }
.rv-spark path { fill: none; stroke: var(--strategy-color, var(--accent)); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rv-spark-empty { height: 40px; display: flex; align-items: center; margin-bottom: 8px; }
.rv-strategy-figs .rv-inline-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rv-strategy-recent { display: grid; gap: 6px; min-width: 0; }
.rv-strategy-recent h3 { margin: 0 0 2px; }
.rv-recent-trade { display: grid; grid-template-columns: auto auto; justify-content: space-between; gap: 2px 10px; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; color: inherit; text-decoration: none; font-variant-numeric: tabular-nums; }
.rv-recent-trade small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.rv-recent-trade:hover, .rv-recent-trade:focus-visible { background: var(--surface-3); }
.rv-strategy-actions { display: grid; gap: 8px; justify-items: stretch; min-width: 150px; }
.rv-strategy-actions .rv-disclosure summary { font-size: 13px; }
.rv-compare-plot { margin: 10px 0 6px; }
.rv-compare-chart { width: 100%; height: 220px; display: block; }
.rv-compare-zero { stroke: var(--line-strong); stroke-dasharray: 4 4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.rv-compare-line { fill: none; stroke: var(--quiet); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rv-compare-line.orb { stroke: var(--orb); } .rv-compare-line.rotation { stroke: var(--rotation); }
.rv-compare-line.reversion { stroke: var(--reversion); } .rv-compare-line.trend { stroke: var(--trend); }
.rv-compare-scale { display: block; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rv-compare-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.rv-legend { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 18px; }
.rv-legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.rv-legend li span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-legend strong { font-variant-numeric: tabular-nums; font-weight: 650; }
.rv-swatch { width: 14px; height: 3px; border-radius: 2px; background: var(--strategy-color, var(--quiet)); flex: none; }
@media (max-width: 1080px) { .rv-strategy-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 640px) {
  .rv-strategy-row { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .rv-strategy-actions { grid-template-columns: 1fr 1fr; }
  .rv-strategy-actions .rv-disclosure { grid-column: 1 / -1; }
}

/* P&L calendar: strategy picker and the "opens on last month" note */
.rv-inline-form { display: inline-flex; align-items: center; gap: 8px; }
.rv-inline-form select { border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 10px; background: var(--surface); color: var(--text); font-size: 13px; min-height: 37px; max-width: 220px; }
.rv-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 13px; margin: 12px 0 4px; }
.rv-note .icon { width: 15px; height: 15px; }
@media (max-width: 720px) {
  .rv-month-toolbar .rv-actions { flex-wrap: wrap; }
  .rv-inline-form, .rv-inline-form label, .rv-inline-form select { width: 100%; max-width: 100%; }
  .rv-inline-form select { min-height: 44px; }
}
/* The day you came back from (`sel`) keeps a visible ring. */
.rv-calendar-day.selected { border: 2px solid var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.rv-back-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text); font-size: 13px; font-weight: 600; background: var(--surface); }
.rv-back-chip:hover { border-color: var(--accent); color: var(--accent); }
/* Strategy detail tabs */
.rv-strategy-tabs { margin-top: 18px; }
.rv-summary-tight { margin: 4px 0 8px; }
.rv-day-links { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.rv-day-links li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.rv-day-links li span { color: var(--muted); font-size: 12px; }
.rv-day-links li strong { font-variant-numeric: tabular-nums; min-width: 84px; text-align: right; }
.rv-strategy-detail .rv-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rv-strategy-detail .rv-metric-grid strong { overflow-wrap: normal; }
.rv-strategy-tabs { overflow-x: auto; scrollbar-width: none; }
.rv-strategy-tabs a { flex: none; white-space: nowrap; }
.rv-calendar-total.future strong { visibility: hidden; }

/* Attention bell (top bar) */
.rv-bell { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface); }
.rv-bell .icon { width: 18px; height: 18px; }
.rv-bell:hover { color: var(--text); border-color: var(--accent); }
.rv-bell.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line-strong)); }
.rv-bell.danger { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 55%, var(--line-strong)); }
.rv-bell-count { position: absolute; top: -7px; right: -7px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; border: 1px solid var(--warn); background: var(--warn-bg); color: var(--warn); font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }
.rv-bell.danger .rv-bell-count { border-color: var(--neg); background: var(--neg); color: var(--surface); }

/* Attention page */
.rv-attention-heading { display: flex; align-items: baseline; gap: 10px; font-size: 17px; margin: 0 0 10px; }
.rv-attention-heading.blocker { color: var(--neg); }
.rv-attention-list, .rv-activity, .rv-checked { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rv-attention-item { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; border-left: 3px solid var(--warn); }
.rv-attention-item.blocker { border-left-color: var(--neg); }
.rv-attention-item.info { border-left-color: var(--line-strong); }
.rv-attention-item.decision { border-left-color: var(--accent); }
.rv-attention-main { min-width: 0; flex: 1 1 360px; }
.rv-attention-main strong { font-size: 15px; }
.rv-attention-main p { margin: 4px 0 0; }
.rv-attention-clear .rv-checked { margin: 8px 0 12px; gap: 4px; }
.rv-attention-clear .rv-checked li::before { content: "✓ "; color: var(--accent); }
.rv-attention .attention-more { border-left-color: var(--line-strong); }

/* Activity */
.rv-activity { margin-top: 14px; }
.rv-activity-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.rv-activity-head time { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rv-activity-item.risk { border-left: 3px solid var(--warn); }
.rv-activity-item p { margin: 8px 0 0; font-size: 13px; }
.rv-chain { list-style: none; margin: 10px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line-strong); display: grid; gap: 6px; }
.rv-chain li { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 14px; align-items: baseline; font-size: 13px; }
.rv-chain li small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.rv-chain li time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rv-chain li strong { font-variant-numeric: tabular-nums; }
.rv-chain li.warn > span { color: var(--warn); }
@media (max-width: 720px) {
  .rv-chain li { grid-template-columns: 1fr auto; }
  .rv-chain li time { grid-column: 1 / -1; }
  .rv-activity-head time { margin-left: 0; width: 100%; }
}
.rv-attention li strong { font-weight: 650; }
.rv-filters input[type=date] { border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 10px; background: var(--surface); color: var(--text); font-size: 12px; min-height: 37px; width: 100%; max-width: 250px; color-scheme: dark; }
html[data-theme=light] .rv-filters input[type=date] { color-scheme: light; }
/* On phones the Home tab carries the attention count; the top bar has no room. */
@media (max-width: 720px) { .topbar .rv-bell { display: none; } }

/* Drawers: research, related records, legs */
.rv-research ul, .rv-related, .rv-legs { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.rv-research li { display: flex; gap: 10px; align-items: baseline; }
.rv-research li a { color: var(--accent); font-weight: 600; font-size: 13px; }
.rv-research li small { color: var(--muted); font-size: 12px; }
.rv-related li, .rv-legs li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.rv-related li a, .rv-legs li a { color: var(--accent); }
.rv-legs li time { color: var(--muted); font-size: 12px; }
.rv-legs li[aria-current] { font-weight: 600; }
.rv-story-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.rv-entry-facts { margin-top: 10px; }
.rv-warn-text { color: var(--warn); }
.rv-lazy-chart { min-height: 60px; }
.rv-lazy-chart .trade-chart-result svg { max-width: 100%; height: auto; }
.rv-headlines-disclosure { margin-top: 10px; }
.rv-ask-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 13px; }
.rv-ask-scope[hidden] { display: none; }
.rv-answer-control { display: inline-flex; margin-top: 6px; }
.review-acknowledge { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 13px; }
.review-acknowledge input { margin-top: 3px; }
/* The controls disclosure in a strategy row opens as a panel across the row
   instead of squeezing its text into the narrow actions column. */
.rv-strategy-row { position: relative; }
@media (min-width: 721px) {
  .rv-strategy-actions details[open] > .rv-disclosure-body { position: absolute; right: 16px; top: calc(100% - 12px); z-index: 6; width: min(560px, calc(100% - 32px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 14px 16px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
  .rv-strategy-actions details[open] > .rv-disclosure-body .rv-actions { flex-wrap: wrap; }
}

/* Home, v4 "Orient": a quiet line when nothing needs you, what moved the
   number, what changed by strategy, and the session before. */
.rv-all-clear { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.rv-all-clear > .icon { width: 18px; height: 18px; flex: none; color: var(--pos); }
.rv-all-clear.waiting > .icon { color: var(--warn); }
.rv-all-clear.waiting { color: var(--text); }
.rv-movers { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.rv-movers h3.rv-eyebrow { margin-bottom: 6px; }
.rv-mover-list, .rv-change-list, .rv-recap-list { list-style: none; margin: 0; padding: 0; }
.rv-mover-list a { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 120px) minmax(84px, auto); align-items: center; gap: 4px 14px; padding: 9px 8px; margin: 0 -8px; border-radius: 9px; color: inherit; text-decoration: none; font-size: 13px; }
.rv-mover-list a:hover, .rv-mover-list a:focus-visible, .rv-change-list a:hover, .rv-change-list a:focus-visible { background: var(--surface-3); }
.rv-mover-name { min-width: 0; }
.rv-mover-name small, .rv-change-text small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.rv-mover-name .rv-dot, .rv-recap-list .rv-dot { margin-right: 6px; }
.rv-mover-track { display: block; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.rv-mover-track i { display: block; height: 100%; background: var(--muted); border-radius: 3px; }
.rv-mover-track i.pos { background: var(--pos); }
.rv-mover-track i.neg { background: var(--neg); }
.rv-mover-list b, .rv-change-list b { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-change-list li + li { border-top: 1px solid var(--line); }
.rv-change-list a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 10px; padding: 11px 8px; margin: 0 -8px; border-radius: 9px; color: inherit; text-decoration: none; font-size: 13px; line-height: 1.55; }
.rv-change-list .rv-dot { align-self: start; margin-top: 7px; }
.rv-change-text .rv-chip { vertical-align: 1px; }
.rv-changes-sub { margin: 18px 0 8px; }
.rv-changes .rv-event-list a { display: grid; gap: 3px; color: inherit; text-decoration: none; font-size: 13px; }
.rv-changes .rv-event-list small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.rv-ask-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--ai-line); background: var(--ai-bg); color: var(--text); border-radius: 99px; font-size: 12px; font-weight: 600; cursor: pointer; }
.rv-ask-chip .icon { width: 14px; height: 14px; color: var(--ai); }
.rv-recap-total { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.rv-recap-total b { font-size: 18px; font-weight: 650; margin-right: 4px; font-variant-numeric: tabular-nums; }
.rv-recap-list { display: grid; gap: 10px; margin-bottom: 4px; }
.rv-recap-list li { display: flex; gap: 6px; align-items: baseline; font-size: 13px; }
.rv-recap-list small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.rv-recap-list small a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.rv-group-rule { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 400; }
.rv-table .rv-holding-group strong { color: var(--text); font-weight: 650; }
.rv-stale { color: var(--warn); }
.rv-holdings-note { padding: 10px 18px 16px; margin: 0; }
.rv-decision-card { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.rv-change-what { display: block; }
@media (max-width: 640px) {
  .rv-mover-list a { grid-template-columns: minmax(0, 1fr) auto; }
  .rv-mover-track { grid-column: 1 / -1; grid-row: 2; }
  .rv-change-list a { gap: 8px; }
  .rv-changes .rv-card-head { align-items: center; }
  .rv-holdings tr.rv-holding-group td { display: block; width: auto; }
}
