:root {
  --paper:#f5f3ee; --surface:#fff; --ink:#172b2a; --muted:#52625e; --border:#d6ded8;
  --control:#71817a; --accent:#146356; --accent-soft:#e6f1ec; --positive:#146356;
  --negative:#a23232; --caution:#79500b; --caution-bg:#fff3d6; --focus:#225fc6;
  --radius:12px; --shadow:0 8px 24px rgba(23,43,42,.05); font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink); background:var(--paper); font-size:16px; line-height:1.5;
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; background:var(--paper); min-width:0; }
button,input,select { font:inherit; }
button { cursor:pointer; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible { outline:3px solid var(--focus); outline-offset:3px; }
.shell { max-width:1180px; margin-inline:auto; padding-inline:40px; }
.skip-link { position:absolute; left:16px; top:-100px; background:var(--ink); color:#fff; padding:10px 16px; border-radius:8px; z-index:20; }
.skip-link:focus { top:12px; }
.site-header { border-bottom:1px solid var(--border); background:rgba(245,243,238,.96); }
.header-inner { height:82px; display:flex; align-items:center; justify-content:space-between; }
.wordmark { color:var(--ink); text-decoration:none; font-family:Georgia,serif; font-size:25px; letter-spacing:-.04em; }
.wordmark b { font-weight:400; color:var(--accent); padding-inline:5px; }
.header-context { color:var(--muted); font-size:14px; display:flex; align-items:center; gap:14px; }
.status-pill,.source-badge { display:inline-flex; align-items:center; white-space:nowrap; border:1px solid #a9cabc; border-radius:99px; color:var(--accent); background:var(--accent-soft); font-size:12px; font-weight:700; letter-spacing:.03em; padding:5px 10px; }
.hero { display:grid; grid-template-columns:minmax(0,1fr) 350px; gap:60px; padding-top:68px; padding-bottom:58px; }
.eyebrow { margin:0 0 9px; color:var(--muted); font-size:12px; font-weight:750; letter-spacing:.1em; text-transform:uppercase; }
.hero h1 { font-family:Georgia,"Times New Roman",serif; font-size:clamp(36px,4.3vw,54px); line-height:1.05; letter-spacing:-.045em; font-weight:500; margin:0 0 22px; }
.hero h1 em { font-style:normal; color:var(--accent); }
.hero-lede { max-width:660px; color:var(--muted); font-size:17px; line-height:1.65; margin:0 0 25px; }
.notice { max-width:660px; color:var(--caution); background:var(--caution-bg); border:1px solid #ead8a6; border-radius:9px; padding:12px 15px; display:flex; gap:10px; font-size:14px; line-height:1.45; }
.notice-mark { width:19px; height:19px; border-radius:50%; background:#d7a632; color:#fff; display:inline-grid; place-items:center; font-size:13px; font-weight:700; flex:none; margin-top:1px; }
.hero-facts { align-self:end; margin:0; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.hero-facts div { padding:19px 0; border-bottom:1px solid var(--border); }
.hero-facts div:last-child { border:0; }
.hero-facts dt { font-size:22px; font-weight:720; letter-spacing:-.02em; }
.hero-facts dd { margin:2px 0 0; color:var(--muted); font-size:13px; }
.toolbar-wrap { margin-bottom:10px; }
.toolbar { min-height:82px; border-block:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; gap:20px; }
.toolbar-status { display:flex; align-items:center; gap:12px; flex-wrap:wrap; min-width:0; }
.toolbar-status .eyebrow { margin:0; }
.toolbar-status strong { font-size:14px; }
.muted { font-size:13px; color:var(--muted); }
.saved-context,.saved-time { display:inline; }
.toolbar-actions,.button-row,.form-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.button { border:1px solid var(--control); min-height:44px; border-radius:8px; padding:9px 15px; font-weight:700; font-size:14px; transition:background .15s,border-color .15s; }
.button-primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.button-primary:hover { background:#0d4b41; }
.button-secondary { background:var(--surface); color:var(--ink); }
.button-secondary:hover { background:var(--accent-soft); border-color:var(--accent); }
.button-quiet { background:transparent; color:var(--muted); border-color:transparent; }
.button-danger { background:var(--surface); color:var(--negative); border-color:#c99191; }
.inline-warning { background:var(--caution-bg); color:var(--caution); padding:10px 13px; border-radius:8px; margin:12px 0 0; font-size:14px; }
.app-status { color:var(--muted); font-size:14px; margin:12px 0 0; }
.import-hint { color:var(--muted); font-size:12px; margin:9px 0 0; }
#status:not(:empty) { margin-top:12px; padding:12px 14px; border:1px solid var(--control); border-radius:8px; overflow-wrap:anywhere; }
#status.status-error { color:var(--negative); background:#fff0f0; border-color:#deb3b3; }
.section { padding-top:55px; }
.section-heading { display:flex; align-items:end; justify-content:space-between; gap:24px; margin-bottom:20px; }
.section-heading h2 { font-family:Georgia,"Times New Roman",serif; font-weight:500; letter-spacing:-.035em; font-size:30px; line-height:1.15; margin:0; }
.section-note { text-align:right; color:var(--muted); font-size:13px; margin:0; }
.section-note span { color:var(--ink); }
.leaderboard { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.leader-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:22px 22px 19px; min-width:0; }
.leader-card.selected { border:2px solid var(--accent); padding:21px 21px 18px; }
.rank-line { display:flex; justify-content:space-between; gap:12px; align-items:center; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.08em; font-weight:750; }
.rank-line .selected-label { color:var(--accent); text-transform:none; letter-spacing:0; }
.investor-mark { display:inline-grid; place-items:center; width:25px; height:25px; border-radius:50%; color:var(--accent); background:var(--accent-soft); font-size:11px; margin-right:7px; }
.select-investor { display:block; width:100%; text-align:left; border:0; background:transparent; color:var(--ink); padding:13px 0 8px; font-size:22px; font-weight:750; min-height:44px; }
.select-investor:hover { color:var(--accent); }
.card-value { font-size:32px; font-weight:760; letter-spacing:-.04em; line-height:1.15; font-variant-numeric:tabular-nums; margin:9px 0 3px; overflow-wrap:anywhere; }
.return-line { font-size:14px; margin:0; color:var(--muted); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.positive { color:var(--positive)!important; }
.negative { color:var(--negative)!important; }
.card-split { display:grid; grid-template-columns:1fr 1fr; border-top:1px solid var(--border); margin-top:20px; padding-top:14px; gap:12px; }
.meta-label { display:block; color:var(--muted); font-size:12px; margin-bottom:3px; }
.meta-value { font-size:15px; font-weight:650; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.investor-selector { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
.investor-tab { min-height:46px; padding:10px 16px; border:1px solid var(--control); background:var(--surface); border-radius:8px; color:var(--ink); font-weight:700; }
.investor-tab[aria-pressed="true"] { background:var(--accent-soft); border:2px solid var(--accent); padding:9px 15px; color:var(--accent); }
.detail-panel { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:25px; }
.detail-top { display:flex; justify-content:space-between; gap:24px; align-items:flex-start; margin-bottom:26px; }
.detail-top h3 { font-size:23px; margin:0 0 3px; }
.detail-top p { margin:0; color:var(--muted); font-size:14px; }
.metrics { display:grid; grid-template-columns:1.5fr 1fr 1fr; gap:18px; border-bottom:1px solid var(--border); padding-bottom:22px; margin-bottom:23px; }
.metric { min-width:0; }
.metrics .metric:last-child { grid-column:1/-1; }
.metric-label { display:block; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.07em; margin-bottom:4px; }
.metric-value { font-size:23px; font-weight:730; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.table-scroll { overflow-x:auto; border:1px solid var(--border); border-radius:8px; }
.table-scroll:focus-visible { outline:3px solid var(--focus); outline-offset:3px; }
.positions-table { width:100%; min-width:590px; border-collapse:collapse; font-size:14px; }
.positions-table caption { text-align:left; padding:0 0 10px; border:0; font-weight:700; font-size:16px; }
.positions-table caption,.positions-table thead,.positions-table tbody { background:var(--surface); }
.positions-table th { text-align:left; color:var(--muted); font-size:12px; font-weight:700; letter-spacing:.04em; padding:12px 14px; border-bottom:1px solid var(--border); }
.positions-table td { padding:14px; border-bottom:1px solid var(--border); font-variant-numeric:tabular-nums; }
.positions-table tr:last-child td { border-bottom:0; }
.positions-table .number { text-align:right; }
.empty-state { padding:14px 0 0; color:var(--muted); font-style:italic; margin:0; }
.scroll-help { color:var(--muted); font-size:12px; margin:8px 0 0; }
.source-line { color:var(--muted); font-size:13px; margin:16px 0 0; overflow-wrap:anywhere; }
.source-line strong { color:var(--ink); }
.editor[hidden] { display:none; }
.editor { scroll-margin-top:20px; }
.editor form,.control-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:24px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; max-width:750px; }
.field { display:flex; flex-direction:column; gap:6px; min-width:0; }
.field label,.positions-editor legend { font-size:14px; font-weight:720; }
.field input,.field select,.position-row input { border:1px solid var(--control); background:#fff; border-radius:8px; min-height:46px; padding:9px 11px; color:var(--ink); min-width:0; width:100%; }
.field small,.field-help { font-size:12px; color:var(--muted); margin:0; }
.positions-editor { border:0; border-top:1px solid var(--border); margin:25px 0 0; padding:21px 0 0; }
.positions-editor legend { padding:0; }
.editor-row-head { display:none; }
.editor-row-head,.position-row { grid-template-columns:1.2fr 1fr 1fr 44px; gap:10px; align-items:end; }
.position-row { display:grid; margin-bottom:10px; }
.position-row > div { min-width:0; }
.position-row label { display:block; color:var(--muted); font-size:13px; margin-bottom:4px; }
.remove-position { height:46px; width:44px; background:transparent; color:var(--negative); border:1px solid #c99191; border-radius:8px; font-size:20px; }
.add-position { margin-top:5px; }
.form-error { color:var(--negative); background:#fff0f0; border:1px solid #deb3b3; border-radius:8px; padding:10px 13px; font-size:14px; }
.form-actions { border-top:1px solid var(--border); padding-top:20px; margin-top:24px; }
.data-help { padding-bottom:65px; }
.controls-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.control-card { display:flex; gap:14px; padding:20px; min-width:0; }
.control-icon { width:32px; height:32px; display:grid; place-items:center; flex:none; border-radius:50%; background:var(--accent-soft); color:var(--accent); font-size:18px; }
.control-card h3 { font-size:16px; margin:0 0 5px; }
.control-card p { font-size:14px; color:var(--muted); margin:0 0 13px; }
.text-button { border:0; background:none; color:var(--accent); font-weight:750; padding:0; text-decoration:underline; text-underline-offset:3px; min-height:44px; display:inline-flex; align-items:center; }
.import-help-link { font-size:12px; }
.control-card pre { white-space:pre-wrap; overflow:auto; background:#f3f5f1; border:1px solid var(--border); border-radius:7px; padding:12px; font-size:11px; line-height:1.45; margin:13px 0 0; }
.site-footer { background:var(--ink); color:#edf3ef; }
.footer-inner { min-height:92px; display:flex; justify-content:space-between; align-items:center; gap:16px; }
.footer-inner p { margin:0; font-size:13px; }
.footer-inner p:last-child { font-weight:700; }

@media(max-width:1099px) {
  .shell { padding-inline:24px; }
  .hero { gap:35px; }
  .leader-card { padding-inline:17px; }
  .leader-card.selected { padding-inline:16px; }
  .controls-grid { grid-template-columns:1fr 1fr; }
  .control-card:last-child { grid-column:1/-1; }
}
@media(max-width:699px) {
  .shell { padding-inline:16px; }
  .header-inner { height:70px; }
  .header-context { font-size:13px; gap:7px; }
  .wordmark { font-size:23px; }
  .saved-context,.saved-time { display:block; }
  .hero { display:block; padding-top:43px; padding-bottom:40px; }
  .hero h1 { font-size:36px; }
  .hero-lede { font-size:16px; }
  .hero-facts { margin-top:35px; }
  .hero-facts div { padding:13px 0; }
  .hero-facts dt { font-size:19px; }
  .toolbar { align-items:stretch; flex-direction:column; padding-block:16px; }
  .toolbar-status { display:block; }
  .toolbar-status .eyebrow { margin-bottom:6px; }
  .toolbar-status strong,.toolbar-status .muted,.toolbar-status .text-button { display:block; margin-top:5px; }
  .toolbar-actions { display:grid; grid-template-columns:1fr 1fr; }
  .toolbar-actions .button { width:100%; }
  .section { padding-top:43px; }
  .section-heading { align-items:flex-start; display:block; }
  .section-heading h2 { font-size:28px; }
  .section-note { text-align:left; margin-top:10px; }
  .leaderboard { display:block; }
  .leader-card { margin-bottom:12px; padding:18px; }
  .leader-card.selected { padding:17px; }
  .card-value { font-size:29px; }
  .detail-panel { padding:18px 14px; }
  .detail-top { display:block; margin-bottom:22px; }
  .detail-top .source-badge { margin-top:13px; }
  .metrics { grid-template-columns:1fr 1fr; gap:16px; }
  .metrics .metric:first-child { grid-column:1/-1; }
  .metric-value { font-size:21px; }
  .investor-selector { display:grid; grid-template-columns:repeat(3,1fr); }
  .investor-tab { padding-inline:5px; font-size:13px; }
  .investor-tab[aria-pressed="true"] { padding-inline:4px; }
  .form-grid,.controls-grid { grid-template-columns:1fr; }
  .control-card:last-child { grid-column:auto; }
  .editor form { padding:18px 14px; }
  .position-row { grid-template-columns:1fr 1fr 44px; gap:8px; margin-top:15px; }
  .position-row .symbol-field { grid-column:1/-1; }
  .data-help { padding-bottom:45px; }
  .button-row { align-items:stretch; flex-direction:column; }
  .button-row .button { width:100%; }
  .footer-inner { min-height:110px; display:block; padding-block:25px; }
  .footer-inner p+p { margin-top:8px; }
}
@media(max-width:380px) {
  .header-inner { height:auto; min-height:76px; gap:12px; padding-block:12px; }
  .header-context { flex-direction:column; align-items:flex-end; gap:4px; }
  .metrics { grid-template-columns:1fr; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  .button { transition:none; }
}
