/* Retirement backtest — on the site tokens, see /DESIGN.md. Cream page, white cards with the
   warm shadow, hairline, ink, the brown accent. Charts are ink and accent on white. */
:root {
    --bt-bg: #FAF7F3;
    --bt-panel: #FFFFFF;
    --bt-line: #E8E1D9;
    --bt-text: #1C1714;
    --bt-muted: #6E6159;
    --bt-accent: #7A4E00;
    --bt-accent-rgb: 122, 78, 0;
    --bt-tint: #FFF6E5;
    --bt-shadow: 0 1px 2px rgba(122, 78, 0, 0.07), 0 10px 24px -8px rgba(122, 78, 0, 0.16);
    --bt-shadow-float: 0 2px 4px rgba(122, 78, 0, 0.08), 0 24px 48px -12px rgba(122, 78, 0, 0.28);
    --bt-r: 12px;
    --bt-rc: 4px;
    --t-1: 14px; --t0: 18px; --t1: 22px; --t2: 28px; --t3: 35px;
}

.bt { max-width: 1180px; margin: 0 auto; padding: 48px 24px 64px; box-sizing: border-box; font-size: var(--t0); line-height: 1.6; color: var(--bt-text); font-variant-numeric: tabular-nums; }
.bt h1, .bt h2, .bt h3 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
.bt h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 600; max-width: 20ch; }
.bt .lede { margin: 12px 0 0; max-width: 46rem; color: var(--bt-muted); font-size: var(--t1); line-height: 1.4; }
.bt p { margin: 0; }
.bt a { color: var(--bt-accent); }

.bt .section { margin-top: 44px; padding-top: 36px; border-top: 1px solid var(--bt-line); }
.bt .section h2 { font-size: clamp(24px, 2.6vw, 30px); font-weight: 600; }
.bt .section .sub { margin: 8px 0 0; color: var(--bt-muted); font-size: var(--t-1); line-height: 1.5; max-width: 46rem; }

/* the plan, written as a sentence you fill in */
.bt .sheet { margin-top: 28px; background: var(--bt-panel); border-radius: var(--bt-r); box-shadow: var(--bt-shadow); padding: 28px 32px 30px; }
.bt .story { font-size: clamp(22px, 2.6vw, 30px); font-weight: 500; line-height: 1.7; letter-spacing: -0.01em; max-width: 44ch; }
.bt .story.then { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--bt-line); }
.bt .fixed { font-weight: 600; border-bottom: 2px solid var(--bt-line); padding: 0 2px; white-space: nowrap; }
.bt .inline { display: inline-flex; align-items: baseline; border-bottom: 2px solid var(--bt-accent); padding: 0 2px; margin: 0 2px; white-space: nowrap; }
.bt .inline .cur { color: var(--bt-muted); font-weight: 500; }
.bt .inline input { border: 0; background: transparent; font: inherit; color: var(--bt-text); font-weight: 600; padding: 0 2px; min-width: 3ch; width: 9ch; text-align: left; -moz-appearance: textfield; }
.bt .inline.small input { font-weight: 600; color: var(--bt-text); }
.bt .inline input::-webkit-outer-spin-button, .bt .inline input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bt .inline input:focus { outline: none; }
.bt .inline:focus-within { background: var(--bt-tint); }
.bt .chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.bt .chip { border: 1px solid var(--bt-line); background: #fff; color: var(--bt-muted); border-radius: var(--bt-rc); padding: 6px 12px; font: inherit; font-size: var(--t-1); font-weight: 600; cursor: pointer; transition: border-color .18s ease-out, color .18s ease-out, background-color .18s ease-out; }
.bt .chip:hover { border-color: rgba(var(--bt-accent-rgb), .5); color: var(--bt-text); background: var(--bt-tint); }
.bt .chip:focus-visible, .bt .year:focus-visible, .bt .go:focus-visible, .bt .check:focus-within { outline: 2px solid var(--bt-accent); outline-offset: 2px; }
.bt .chips .note { font-size: var(--t-1); color: var(--bt-muted); }
/* The market switch, India or the US: the two chips, the one in use filled in the accent. */
.bt .market { margin-top: 22px; }
.bt .chip[aria-pressed="true"], .bt .chip[aria-pressed="true"]:hover { background: var(--bt-accent); border-color: var(--bt-accent); color: #fff; }
/* the year picker: a button in the sentence, a grid in a panel below it */
.bt .ypick-wrap { position: relative; display: inline-block; vertical-align: baseline; }
.bt .ypick { display: inline-flex; align-items: center; gap: 4px; border: 0; border-bottom: 2px solid var(--bt-accent); background: var(--bt-tint); color: var(--bt-text); padding: 0 6px 0 8px; margin: 0 2px; font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--bt-rc) var(--bt-rc) 0 0; line-height: 1.45; }
.bt .ypick svg { color: var(--bt-accent); transition: transform .18s ease-out; }
.bt .ypick[aria-expanded="true"] svg { transform: rotate(180deg); }
.bt .ypick:hover { background: #FFEFD2; }
.bt .ypop:not([hidden]) { display: block; }
.bt .ypop { position: absolute; top: calc(100% + 10px); left: 0; z-index: 20; text-align: left; width: 340px; max-width: calc(100vw - 32px); background: var(--bt-panel); border-radius: var(--bt-r); box-shadow: var(--bt-shadow-float); padding: 14px 14px 16px; font-size: var(--t-1); font-weight: 400; letter-spacing: 0; line-height: 1.4; }
.bt .ypop-head { display: flex; align-items: center; justify-content: space-between; color: var(--bt-muted); margin-bottom: 10px; padding-left: 4px; }
.bt .ypop-close { border: 0; background: transparent; color: var(--bt-muted); font: inherit; font-size: 15px; cursor: pointer; padding: 4px 8px; border-radius: var(--bt-rc); }
.bt .ypop-close:hover { background: var(--bt-tint); color: var(--bt-text); }
.bt .years { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-height: 320px; overflow-y: auto; } /* the US has 96 start years */
.bt .year { border: 0; background: transparent; color: var(--bt-text); border-radius: var(--bt-rc); padding: 10px 0; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background-color .18s ease-out, color .18s ease-out; font-variant-numeric: tabular-nums; }
.bt .year:hover { background: var(--bt-tint); }
.bt .year.active { background: var(--bt-accent); color: #fff; }
.bt .tnote { margin-top: 12px; font-size: var(--t-1); color: var(--bt-muted); }
.bt .check { display: flex; align-items: flex-start; gap: 10px; font-size: var(--t-1); line-height: 1.4; margin-top: 18px; color: var(--bt-text); }
.bt .check input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--bt-accent); flex: none; }
.bt .check span { color: var(--bt-muted); font-size: var(--t-1); display: block; }
.bt .check .title { color: var(--bt-text); }
.bt .check[hidden] { display: none; } /* India only: the US counts no tax and no fees */
.bt .go-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.bt .go { height: 52px; padding: 0 26px; border: 0; border-radius: var(--bt-r); background: var(--bt-accent); color: #fff; font: inherit; font-size: var(--t0); font-weight: 600; cursor: pointer; }
.bt .go:hover { background: #6A4300; }
.bt .go-row .note { font-size: var(--t-1); color: var(--bt-muted); max-width: 36rem; line-height: 1.4; }
.bt .assume { margin-top: 18px; font-size: var(--t-1); color: var(--bt-muted); line-height: 1.5; max-width: 52rem; }

/* results */
.bt #results, .bt .empty { scroll-margin-top: calc(var(--header-h, 84px) + 12px); } /* the site header is sticky; land below it */
.bt .empty { margin-top: 28px; padding: 24px 0; }
.bt .empty strong { display: block; font-size: var(--t2); font-weight: 500; line-height: 1.2; }
.bt .empty p { margin-top: 8px; color: var(--bt-muted); }
.bt .big { font-size: clamp(32px, 4vw, 44px); font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; }
.bt .context { margin-top: 12px; font-size: var(--t1); line-height: 1.4; max-width: 46rem; }
.bt .verdict { margin-top: 12px; font-size: var(--t1); font-weight: 600; line-height: 1.4; max-width: 46rem; }
.bt .fwd { margin-top: 12px; max-width: 46rem; }
.bt .chart { margin-top: 22px; background: var(--bt-panel); border-radius: var(--bt-r); box-shadow: var(--bt-shadow); padding: 20px 20px 14px; }
.bt .chart canvas { display: block; width: 100%; }
.bt .legend { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; font-size: var(--t-1); color: var(--bt-muted); }
.bt .legend .sw { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }
.bt .sw-ink { background: var(--bt-text); }
.bt .sw-accent { background: var(--bt-accent); }
.bt .sw-faint { opacity: .3; } /* a US start that has not had its years yet */
.bt .sw-dash { background: none; height: 0; border-top: 2px dashed var(--bt-text); opacity: .6; }
.bt .chart-note { margin-top: 10px; font-size: var(--t-1); color: var(--bt-text); min-height: 1.5em; }
.bt .bars-hint { margin-top: 2px; font-size: var(--t-1); color: var(--bt-muted); }

/* table */
.bt .table-wrap { margin-top: 20px; overflow-x: auto; background: var(--bt-panel); border-radius: var(--bt-r); box-shadow: var(--bt-shadow); }
.bt table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: var(--t-1); }
.bt th, .bt td { padding: 10px 14px; border-bottom: 1px solid var(--bt-line); text-align: left; white-space: nowrap; }
.bt th { color: var(--bt-muted); font-weight: 600; }
.bt td.n, .bt th.n { text-align: right; }
.bt tr.end td { font-weight: 600; border-bottom: 0; }
.bt tr.out td { color: var(--bt-accent); font-weight: 600; }
.bt .foot { margin-top: 10px; font-size: var(--t-1); color: var(--bt-muted); }

/* the two asks after the results */
.bt .asks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.bt .ask { background: var(--bt-panel); border-radius: var(--bt-r); box-shadow: var(--bt-shadow); padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.bt .ask p { max-width: 30rem; flex: 1; } /* the text takes the slack, so both buttons sit on the same line */
.bt .linkbtn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: var(--bt-r); background: var(--bt-accent); color: #fff; text-decoration: none; font-weight: 600; font-size: var(--t0); }
.bt .linkbtn:hover { background: #6A4300; }
.bt .linkbtn.ghost { background: #fff; color: var(--bt-text); border: 1px solid var(--bt-line); }
.bt .linkbtn.ghost:hover { background: var(--bt-tint); border-color: rgba(var(--bt-accent-rgb), .5); }

/* prose sections */
.bt .prose p { max-width: 46rem; margin-top: 12px; }
.bt .planner-way p { max-width: 46rem; margin: 12px 0 20px; }
.bt .prose ul { margin: 12px 0 0; padding-left: 20px; max-width: 46rem; }
.bt .prose li { margin-top: 6px; }
/* How to read this page (19 Nov 2026): collapsed questions, the home page's FAQ list on this page's
   tokens. One hairline above the list and one under each question, the only separation. The plus turns
   to a cross when a question is open: the one motion, and it says open or closed. */
.bt .faqs { margin-top: 16px; border-top: 1px solid var(--bt-line); max-width: 46rem; }
.bt .faqs details { border-bottom: 1px solid var(--bt-line); padding: 14px 0; }
.bt .faqs summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; font-weight: 600; line-height: 1.4; }
.bt .faqs summary::-webkit-details-marker { display: none; }
.bt .faqs summary .plus { flex: none; color: var(--bt-accent); font-weight: 400; transition: transform .15s ease; }
.bt .faqs details[open] summary .plus { transform: rotate(45deg); }
.bt .faqs details p { margin: 10px 0 0; }
/* The answer grows from its question (19 Nov 2026): backtest.js animates its height, 240ms open and 200ms
   shut, so the hidden overflow keeps the text inside while it moves. */
.bt .faqs .ans { overflow: hidden; }

@media (max-width: 720px) {
    .bt { padding: 32px 16px 48px; }
    .bt .sheet { padding: 20px 18px 22px; }
    .bt .story { font-size: 21px; line-height: 1.65; }
    .bt .asks { grid-template-columns: 1fr; }
    .bt .go { width: 100%; }
    .bt .section { margin-top: 36px; padding-top: 28px; }
    .bt .chart { padding: 14px 12px 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .bt .chip { transition: none; }
}
