:root {
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  color: #222d2a;
  background: #f7f9f7;
  font-size: 16px;
  --paper: #fff;
  --ink: #182d25;
  --subtle: #536661;
  --line: #dce6df;
  --green: #27634f;
  --mint: #edf5ee;
  --shadow: 0 10px 28px #24362b08;
  font-feature-settings: "tnum";
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select { font: inherit; }
button, select, a, summary { -webkit-tap-highlight-color: transparent; }
a { color: var(--green); }
:focus { outline: none; }
.skip-link { position: absolute; top: -5rem; padding: .7rem 1rem; background: #fff; z-index: 10; }
.skip-link:focus { top: .5rem; left: .5rem; }
.shell { width: min(1136px, calc(100% - 3rem)); margin-inline: auto; }
.masthead { background: #fff; border-bottom: 1px solid var(--line); }
.heading { padding: 2.65rem 0 1.95rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.25rem, 5vw, 3.35rem); line-height: 1.02; letter-spacing: -.067em; color: var(--ink); font-weight: 650; }
.heading p { margin-top: .75rem; color: var(--subtle); font-size: .95rem; }
.tabs { overflow-x: auto; }
.tabs [role=tablist] { display: flex; gap: clamp(.95rem, 3vw, 2.15rem); min-width: max-content; }
.tabs a { padding: .85rem .08rem .92rem; color: var(--subtle); font-size: .9rem; font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-selected=true] { color: var(--green); border-bottom-color: var(--green); }
main { min-height: 63vh; padding: 1.65rem 0 2.5rem; }
.status { padding: 1rem 0; color: var(--subtle); }
.section-head, .card-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.section-head { margin-bottom: 1.15rem; align-items: center; }
.section-head p, .card-head p, .help { color: var(--subtle); font-size: .88rem; line-height: 1.55; }
h2 { font-weight: 650; color: var(--ink); font-size: 1.55rem; letter-spacing: -.035em; }
h3 { font-weight: 650; color: var(--ink); font-size: 1.10rem; letter-spacing: -.022em; }
.section-head p, .card-head p { margin-top: .28rem; }
.card { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 1.25rem 1.35rem; }
.stack { display: grid; gap: 1.05rem; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.05rem; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .95rem 1.05rem; min-width: 0; }
.metric.accent { background: var(--mint); border-color: #d5e4d8; }
.metric .label { display: block; color: var(--subtle); font-size: .85rem; }
.metric strong { display: block; color: var(--ink); font-size: clamp(1.17rem, 2.5vw, 1.72rem); letter-spacing: -.045em; margin-top: .26rem; overflow-wrap: anywhere; }
.metric small { color: var(--subtle); font-size: .8rem; margin-top: .24rem; display: block; }
.control, .segmented { background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.control { color: var(--ink); min-height: 38px; padding: .47rem .70rem; font-size: .88rem; cursor: pointer; }
.control:hover, .segmented button:hover { background: var(--mint); }
.quarter-scroll { overflow-x: auto; margin-bottom: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.quarter-timeline { position: relative; display: flex; min-width: max-content; padding: .55rem .3rem; }
.quarter-timeline::before { content: ''; position: absolute; inset: 26px 32px auto; height: 2px; background: var(--line); }
.quarter-timeline button { flex: 1 0 54px; display: grid; justify-items: center; gap: .45rem; min-height: 52px; padding: .75rem .18rem .35rem; border: 0; background: none; cursor: pointer; color: var(--subtle); font-size: .73rem; white-space: nowrap; }
.quarter-timeline button::before { z-index: 1; content: ''; width: 12px; height: 12px; border: 2px solid #779787; border-radius: 50%; background: var(--paper); }
.quarter-timeline button:hover::before { background: var(--mint); }
.quarter-timeline button[aria-checked=true] { color: var(--green); font-weight: 700; }
.quarter-timeline button[aria-checked=true]::before { background: var(--green); border-color: var(--green); box-shadow: 0 0 0 3px #dcece0; }
.segmented { padding: 3px; display: inline-flex; flex-shrink: 0; }
.segmented button { border: 0; background: transparent; border-radius: 5px; cursor: pointer; padding: .36rem .65rem; color: var(--subtle); font-size: .85rem; }
.segmented button[aria-pressed=true] { background: var(--mint); color: var(--green); font-weight: 650; }
.controls { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.transaction-divider { border: 0; border-top: 1px solid var(--line); margin: 1.35rem 0 1rem; }
.transaction-list-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem 1rem; }
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; text-align: left; }
th, td { padding: .74rem .9rem; border-bottom: 1px solid #e9eeea; vertical-align: top; }
th { background: #f4f7f4; color: #43534d; font-size: .80rem; font-weight: 650; white-space: nowrap; }
.holdings-table th { padding: 0; }
.sort-heading { display: flex; align-items: center; gap: .35rem; width: 100%; padding: .74rem .9rem; border: 0; background: transparent; color: inherit; text-align: inherit; white-space: inherit; cursor: pointer; }
.holdings-table .number .sort-heading { justify-content: flex-end; }
.holdings-table th[aria-sort] { color: var(--green); background: var(--mint); }
.sort-heading:hover { background: var(--mint); }
.sort-direction { display: inline-block; width: .7rem; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f9fbf9; }
td.number, th.number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.date { white-space: nowrap; }
td.note { color: var(--subtle); min-width: 12rem; }
td.instrument { min-width: 15rem; }
.instrument code { font-family: inherit; white-space: nowrap; color: var(--subtle); font-size: .81rem; }
.label-pill { display: inline-block; background: #f0f4f1; color: #445851; border-radius: 6px; padding: .16rem .42rem; white-space: nowrap; font-size: .81rem; }
.label-pill.deposit, .label-pill.income { background: #eaf5ec; color: #265e49; }
.label-pill.sell { background: #f4eef0; color: #813d55; }
.year-block { display: grid; gap: .46rem; margin: 1.12rem 0 1.42rem; }
.year-block h4 { margin: .15rem 0 .2rem; color: var(--ink); font-size: 1rem; font-weight: 650; }
details.month { background: var(--paper); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
details.month[open] { box-shadow: var(--shadow); }
summary { cursor: pointer; }
.month summary { display: flex; align-items: center; gap: .73rem; padding: .7rem .87rem; list-style: none; }
.month summary::-webkit-details-marker { display: none; }
.month summary::before { content: ''; border: solid var(--subtle); border-width: 0 1.5px 1.5px 0; padding: 3px; transform: rotate(-45deg); margin: 0 .15rem 0 .10rem; }
.month[open] summary::before { transform: rotate(45deg); translate: 0 -2px; }
.month[open] summary { border-bottom: 1px solid var(--line); }
.month-count { margin-left: auto; color: var(--subtle); font-size: .83rem; }
.month-name { font-size: .95rem; font-weight: 620; }
.chart-wrap { position: relative; min-width: 0; margin-top: .86rem; }
.chart-wrap canvas { display: block; width: 100%; height: 245px; }
.chart-wrap.large canvas { height: 310px; }
.chart-tooltip { position: absolute; inset: 0 auto auto 0; display: grid; gap: .24rem; z-index: 1; pointer-events: none; background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); padding: .52rem .65rem; border-radius: 8px; font-size: .82rem; max-width: calc(100% - .5rem); }
.chart-tooltip[hidden] { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: .45rem 1.15rem; margin-top: .8rem; color: var(--subtle); font-size: .83rem; }
.legend span { display: inline-flex; align-items: center; gap: .40rem; }
.legend i { display: inline-block; width: .68rem; height: .68rem; border-radius: 3px; }
.legend .legend-control { cursor: pointer; }
.legend input { margin: 0; margin-right: .22rem; accent-color: var(--green); }
.chart-data { margin-top: .8rem; color: var(--subtle); font-size: .85rem; }
.chart-data summary { width: max-content; }
.chart-data table, .methodology .table-scroll { margin-top: .6rem; }
.help { margin-top: .65rem; }
.badge { border-radius: 4px; background: var(--mint); color: var(--green); padding: .15rem .4rem; white-space: nowrap; font-size: .80rem; }
.benchmark-table td:first-child { min-width: 15rem; }
.benchmark-table p { margin-top: .22rem; color: var(--subtle); font-size: .8rem; }
.cost-figure { display: inline-flex; align-items: center; gap: .35rem; }
.cost-help, .cost-close { display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; width: 1.35rem; height: 1.35rem; padding: 0; background: var(--paper); color: var(--green); cursor: pointer; font-size: .78rem; font-weight: 650; }
.cost-help:hover, .cost-close:hover { background: var(--mint); }
.cost-popover { width: min(24rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); overflow: auto; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: 0 10px 36px #24362b38; text-align: left; white-space: normal; }
@supports (position-area: block-end) {
  .cost-popover { position-area: block-end span-inline-start; position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline; inset: auto; margin: .35rem 0; }
}
.cost-popover-head { display: flex; align-items: start; justify-content: space-between; gap: .5rem; }
.cost-popover h4 { margin: .8rem 0 .3rem; font-size: .84rem; }
.cost-popover dl { display: grid; grid-template-columns: 1fr auto; gap: .35rem .7rem; margin: 0; }
.cost-popover dd { margin: 0; text-align: right; white-space: nowrap; }
.cost-popover .cost-popover-total { border-top: 1px solid var(--line); margin-top: .75rem; padding-top: .65rem; font-weight: 700; }
.rebalance-table .scenario-heading th { background: var(--mint); color: var(--ink); }
.cost-popover .cost-footnote { margin: 0 0 .5rem; }
.cost-popover .execution-note { margin-top: .6rem; }
.actual-scenario { background: var(--mint); }
.positive { color: #27634f; }
.negative { color: #8d3e56; }
.methodology { padding-top: .3rem; }
.methodology > summary { font-weight: 650; color: var(--ink); }
.methodology p, .methodology li { font-size: .9rem; color: var(--subtle); line-height: 1.55; }
.methodology p { margin-top: .6rem; }
.methodology ul { margin-bottom: .2rem; padding-left: 1.25rem; }
.methodology li + li { margin-top: .58rem; }
.notes .card p, .notes .card ul { max-width: 78ch; line-height: 1.65; }
.notes .card p { margin-top: .65rem; }
.notes .card ul { padding-left: 1.3rem; margin: .65rem 0 0; }
.notes .card li + li { margin-top: .6rem; }
.notes-standalone { font-size: .9rem; }
#notes-content .notes-standalone { display: none; }
@media (max-width: 640px) {
  .shell { width: calc(100% - 1.6rem); }
  .heading { padding: 1.85rem 0 1.3rem; }
  main { padding-top: 1.15rem; }
  .section-head { align-items: start; flex-wrap: wrap; }
  .card { padding: 1rem .85rem; border-radius: 11px; }
  .card.table-card { padding: 0; }
  .metric-grid { gap: .45rem; }
  .metric { padding: .63rem .48rem; }
  .metric .label, .metric small { font-size: .75rem; }
  .metric strong { font-size: clamp(.94rem, 4.2vw, 1.2rem); }
  .chart-wrap.large canvas { height: 260px; }
  th, td { padding: .58rem .68rem; }
  .sort-heading { padding: .58rem .68rem; }
}
@media print {
  .tabs, .controls, .skip-link { display: none; }
  .card, .metric { box-shadow: none; break-inside: avoid; }
}
