/* FinPlan layout and components.
   © In-Transit LLC. All rights reserved. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01"; }
.num, td, .kp b { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

/* ---------- App frame: sidebar + main ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; padding: 2px 8px; }
.mark { width: 34px; height: 34px; border-radius: 10px; display: block; flex-shrink: 0; box-shadow: 0 4px 12px -4px rgba(99, 102, 241, .6); }
.brand b { font-size: 16px; font-weight: 700; letter-spacing: -.02em; display: block; line-height: 1.2; }
.brand small { display: block; font-size: 11.5px; color: var(--ink-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.bar { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 32px; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.brand-m { display: none; padding: 0; }
.brand-m .mark { width: 30px; height: 30px; border-radius: 9px; }
.bar-nav { display: flex; gap: 4px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; min-width: 0; }
.bar-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.bar-nav a svg { width: 16px; height: 16px; flex: none; }
.bar-nav a:hover { color: var(--ink); background: var(--surface-3); }
.bar-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); font-weight: 600; }
.bar-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 640px) { .bar-nav a { padding: 6px 9px; } .bar-nav a span { display: none; } }
[data-check] { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
[data-check] p { margin: 0; color: var(--ink-2); }
.bar-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ibtn { height: 36px; min-width: 36px; padding: 0 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 10px; cursor: pointer; display: inline-grid; place-items: center; transition: color .15s, border-color .15s; }
.ibtn:hover { color: var(--ink); border-color: var(--line-2); }
.ibtn svg { width: 17px; height: 17px; }

/* ---------- Page ---------- */
.page { width: 100%; max-width: 1440px; margin: 0 auto; padding: 32px 32px 48px; flex: 1; }
.head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.head h1 { font: 700 30px/1.15 var(--font-display); margin: 0; letter-spacing: -.03em; }
.head p { margin: 8px 0 0; color: var(--ink-2); max-width: 62ch; font-size: 14.5px; }
.head .actions { margin-left: auto; display: flex; gap: 8px; }
.btn { height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; box-shadow: var(--shadow); transition: border-color .15s, transform .1s, filter .15s; }
.btn:hover { border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { filter: brightness(1.15); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; box-shadow: none; }

.grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; }
.grid > *, .row > *, label.f, .in { min-width: 0; }

/* ---------- Inputs panel ---------- */
.rail { position: sticky; z-index: 5; top: 84px; max-height: calc(100vh - 108px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overscroll-behavior: contain; scrollbar-width: thin; }
.rtabs { position: sticky; top: 0; z-index: 3; display: flex; gap: 2px; margin: 0; padding: 10px; background: var(--surface); overflow-x: auto; scrollbar-width: none; }
.rtabs::-webkit-scrollbar { display: none; }
.rtabs::before { content: ""; position: absolute; inset: 10px; background: var(--surface-2); border-radius: 12px; z-index: -1; }
.rtabs { isolation: isolate; }
.rtabs [role="tab"] { flex: 1 0 auto; border: 0; background: none; margin: 4px 0; padding: 7px 7px; font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; border-radius: 9px; transition: background .15s, color .15s, box-shadow .15s; }
.rtabs [role="tab"]:first-child { margin-left: 4px; }
.rtabs [role="tab"]:last-child { margin-right: 4px; }
.rtabs [role="tab"]:hover { color: var(--ink); }
.rtabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }
.sec { padding: 4px 20px 20px; display: grid; gap: 14px; }
.sec-head { display: flex; align-items: baseline; gap: 12px; padding-top: 6px; }
.sec-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.sec-head .sum { margin-left: auto; color: var(--ink-3); font-size: 12.5px; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec p.lead { margin: -4px 0 0; color: var(--ink-2); font-size: 13px; }
.sec-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 6px; border-top: 1px dashed var(--line); margin-top: 2px; padding-top: 14px; }
.sec-nav .btn { margin-left: auto; }
.rail-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--surface-2); }
.linkbtn { border: 0; background: none; color: var(--ink-2); font-size: 12.5px; font-weight: 500; cursor: pointer; padding: 4px 0; }
.linkbtn:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.row { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 12px; align-items: start; }
label.f, .f { display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; align-content: start; }
.in { display: flex; align-items: center; border: 1px solid transparent; border-radius: var(--r-sm); background: var(--surface-2); height: 40px; padding: 0 12px; gap: 6px; transition: border-color .15s, background .15s, box-shadow .15s; }
.in:hover { border-color: var(--line-2); }
.in:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.in input, .in select { border: 0; outline: 0; background: none; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); width: 100%; min-width: 0; height: 100%; padding: 0; font-variant-numeric: tabular-nums; }
.in select { cursor: pointer; }
.in select option { background: var(--surface); color: var(--ink); }
.in input::placeholder { color: var(--ink-3); font-weight: 400; }
.in input[type="number"] { -moz-appearance: textfield; }
.in input::-webkit-outer-spin-button, .in input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.in > span { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; flex-shrink: 0; }
.in.dis { opacity: .45; }
.in .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.hint { color: var(--ink-3); font-size: 12px; font-weight: 400; line-height: 1.5; }
.subhead { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; margin-bottom: -6px; }

/* Slider under a number box */
.rng { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; margin: -2px 0 -4px; background: none; cursor: pointer; --pct: 50%; }
.rng:disabled { opacity: .4; cursor: default; }
.rng::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--pct), var(--surface-3) var(--pct)); }
.rng::-moz-range-track { height: 4px; border-radius: 4px; background: var(--surface-3); }
.rng::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
.rng::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); transition: transform .1s; }
.rng::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.rng:active::-webkit-slider-thumb { transform: scale(1.15); }

/* Segmented radio */
.segf { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 0; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.segf label { position: relative; text-align: center; padding: 7px 8px; border-radius: 9px; cursor: pointer; font-size: 13px; color: var(--ink-2); font-weight: 500; transition: background .15s, color .15s; }
.segf input { position: absolute; opacity: 0; pointer-events: none; }
.segf label:has(input:checked) { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }
.segf label:has(input:focus-visible) { outline: 2px solid var(--accent); }

/* Toggle switch */
.sw { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 13.5px; color: var(--ink); font-weight: 500; cursor: pointer; }
.sw .txt { display: grid; gap: 2px; }
.sw .txt small { color: var(--ink-3); font-size: 12px; font-weight: 400; }
.tg { position: relative; width: 40px; height: 24px; flex-shrink: 0; }
.tg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.tg i { position: absolute; inset: 0; border-radius: 12px; background: var(--surface-3); transition: background .2s; pointer-events: none; }
.tg i::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: transform .2s cubic-bezier(.3, .7, .4, 1.2); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.tg input:checked + i { background: var(--accent); }
.tg input:checked + i::after { transform: translateX(16px); }
.tg input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Checkbox chips (crash targets) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px 5px 10px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); font-weight: 500; transition: all .15s; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check i { width: 9px; height: 9px; border-radius: 50%; opacity: .45; }
.chip-check:has(input:checked) { border-color: transparent; color: var(--ink); background: var(--surface-3); }
.chip-check:has(input:checked) i { opacity: 1; }
.chip-check:has(input:focus-visible) { outline: 2px solid var(--accent); }

/* Crash rows */
.crash { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 10px; transition: background .15s, border-color .15s; }
.crash.off { background: var(--surface-2); border-color: transparent; }
.crash.off .crash-body { opacity: .5; }
.crash:not(.off) { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-bg); }
.crash .note { font-size: 12px; color: var(--ink-3); }
.crash:not(.off) .note { color: var(--bad); }
.crash-body { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 10px; }
.crash:not(.off) .in { background: var(--surface); }

/* ---------- Results ---------- */
.results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.verdict { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 26px 28px; background: var(--glow), var(--surface); position: relative; overflow: hidden; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 99px; background: var(--good-bg); color: var(--good); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--surface-3); color: var(--ink-2); }
.verdict .say { font: 500 20px/1.45 var(--font-display); letter-spacing: -.015em; margin: 14px 0 0; max-width: 64ch; color: var(--ink); text-wrap: pretty; }
.verdict .more { margin: 10px 0 0; color: var(--ink-2); font-size: 13px; max-width: 80ch; }
.kp { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kp > div { background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; backdrop-filter: blur(4px); }
.kp > div:first-child { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.kp small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp b { display: block; font: 700 24px/1.25 var(--font-display); letter-spacing: -.03em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp em { display: block; font-style: normal; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.phase-line { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); }
.phase-line i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.phase-line .err { color: var(--bad); font-weight: 600; }

.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-left: auto; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
.legend i.ln { width: 14px; height: 0; border-top: 2px dashed var(--ink); border-radius: 0; vertical-align: 3px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: none; font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 9px; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); font-weight: 600; }

.track { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.track b { display: block; height: 100%; border-radius: 99px; transition: width .4s cubic-bezier(.2, .8, .2, 1); }

/* Charts */
.chart { position: relative; height: 300px; touch-action: pan-y; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.chart text, .pdf-stage text { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart text.mark-label, .pdf-stage text.mark-label { fill: var(--ink-2); font-weight: 600; }
.tip { position: absolute; top: 0; left: 0; pointer-events: none; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; min-width: 200px; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .12s; z-index: 2; }
.tip.show { opacity: 1; }
.tip .t-head { font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.tip .t-row { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-2); padding: 1px 0; }
.tip .t-row b { color: var(--ink); font-weight: 600; }
.tip .t-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.tip .t-row.bad, .tip .t-row.bad b { color: var(--bad); }
.tip i.sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.pdf-stage { position: fixed; left: -10000px; top: 0; width: 760px; height: 300px; }

/* Table */
.table-scroll { overflow: auto; max-height: 560px; margin: 0 -24px -22px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: right; color: var(--ink-3); font-weight: 600; font-size: 11.5px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { text-align: right; padding: 9px 14px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: var(--surface-2); }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); font-weight: 600; }
th:first-child { z-index: 2; background: var(--surface-2); }
td.l, th.l { text-align: left; }
td.muted { color: var(--ink-3); }
td.neg { color: var(--bad); }
tr.short td { background: var(--bad-bg); }
tr.short td:first-child { background: color-mix(in srgb, var(--bad) 9%, var(--surface)); }
tr.start td { box-shadow: inset 0 1px 0 var(--accent); }
.tag { display: inline-block; margin-left: 7px; font-size: 10.5px; font-weight: 700; color: color-mix(in srgb, var(--accent) 78%, var(--ink)); background: var(--accent-soft); padding: 1px 7px; border-radius: 99px; }
th .sw, td .sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

/* ---------- Overview ---------- */

/* ---------- Footer, dock, toast ---------- */
.foot { width: 100%; max-width: 1440px; margin: 0 auto; padding: 20px 32px 28px; color: var(--ink-3); font-size: 12px; display: flex; gap: 6px 16px; flex-wrap: wrap; }
.foot > span:last-child { margin-left: auto; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1280px) {
  .kp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 350px minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: 76px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .brand-m { display: flex; }
  .bar { padding: 0 20px; }
  .page { padding: 24px 20px 110px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; max-height: none; overflow: visible; }
  .rtabs { top: 60px; border-radius: var(--r) var(--r) 0 0; }
  .foot { padding: 16px 20px 110px; }
  .toast { bottom: 96px; }
}
@media (max-width: 640px) {
  .bar { padding: 0 16px; height: 56px; }
  .rtabs { top: 56px; padding: 8px; }
  .rtabs::before { inset: 8px; }
  .rtabs [role="tab"] { padding: 7px 6px; font-size: 12.5px; }
  .page { padding: 20px 14px 110px; }
  .head h1 { font-size: 25px; }
  .head .actions { margin-left: 0; width: 100%; }
  .head .actions .btn { flex: 1; }
  .card { padding: 18px; }
  .sec { padding: 4px 16px 18px; }
  .table-scroll { margin: 0 -18px -18px; }
  .verdict { padding: 20px 18px; gap: 18px; }
  .verdict .say { font-size: 17.5px; }
  .kp { gap: 8px; }
  .kp > div { padding: 12px; }
  .kp b { font-size: 19px; }
  .chart { height: 240px; }
  .foot > span:last-child { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
@media print {
  .side, .bar, .dock, .rail, .head .actions, .foot { display: none !important; }
  .app, .grid { grid-template-columns: 1fr; }
  .table-scroll { max-height: none; overflow: visible; }
}

/* Month picker */
.mp { position: relative; }
.mp-btn { width: 100%; cursor: pointer; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); text-align: left; justify-content: space-between; }
.mp-btn svg { width: 16px; height: 16px; color: var(--ink-3); flex-shrink: 0; }
.mp-btn[aria-expanded="true"] { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.mp-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-val.empty { color: var(--ink-3); font-weight: 400; }
.mp-pop { position: fixed; top: 0; left: 0; z-index: 60; width: 252px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); animation: mp-in .14s ease-out; }
@keyframes mp-in { from { opacity: 0; transform: translateY(-4px); } }
.mp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mp-head b { font-size: 14px; font-weight: 700; color: var(--ink); }
.mp-nav { width: 32px; height: 32px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--ink-2); cursor: pointer; font-size: 18px; line-height: 1; }
.mp-nav:hover { background: var(--surface-3); color: var(--ink); }
.mp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.mp-grid button { height: 38px; border: 0; border-radius: 9px; background: none; color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; }
.mp-grid button:hover { background: var(--surface-2); }
.mp-grid button.now { box-shadow: inset 0 0 0 1px var(--line-2); }
.mp-grid button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: none; }
.mp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .mp-pop { width: min(300px, calc(100vw - 48px)); }
  .mp-grid button { height: 44px; }
}

/* Portfolio: investments table (cards on narrow widths, via a container query) */
/* On, but no crash switched on yet: neutral. On while crashes run: red. */

/* In-Transit LLC company logo: the PNG is used as a mask, so it takes the text colour in
   light and dark themes. Only shown at sizes where its detail still reads (36px and up). */
.it-logo { display: inline-block; flex-shrink: 0; width: 40px; height: 38px; background: currentColor; -webkit-mask: url(../assets/in-transit-logo.png) center / contain no-repeat; mask: url(../assets/in-transit-logo.png) center / contain no-repeat; }

/* Investments table with Tax (Portfolio) or Gains + Tax (My Plan): always the card layout */

/* Portfolio (tax, no gains column): one compact line per investment when there is room */

/* My Plan (tax + gains): one tight line per investment when there is room */
/* Compact rows: no ₹ sign inside each amount box (the summary line above says rupees) */

/* Investments table placed across the page above the inputs and results */

/* Hide charts (top-bar toggle): the whole card that holds a chart goes away */
.no-charts .card:has(> .chart), .no-charts .card:has(.chart) { display: none; }
#chartsBtn.off { color: var(--ink-2); position: relative; }
#chartsBtn.off::after { content: ""; position: absolute; left: 9px; right: 9px; top: 50%; height: 2px; border-radius: 1px; background: currentColor; transform: rotate(-45deg); box-shadow: 0 0 0 1.5px var(--surface); }

/* Currency picker in the top bar */
.cur select { appearance: none; -webkit-appearance: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; height: 36px; padding: 0 26px 0 12px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 12px; }
.cur select:hover { border-color: var(--line-2); }
.cur .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Monte Carlo card */
.mc-card .mc-intro { margin: 0 0 12px; }
.mc-controls { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.mc-controls label, .mc-vol-grid label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.mc-controls select, .mc-vol-grid input { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; height: 36px; padding: 0 10px; }
.mc-vols { margin: 0 0 14px; }
.mc-vols summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.mc-vol-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.mc-vol-grid .in { display: flex; align-items: center; gap: 6px; }
.mc-vol-grid .in input { width: 100%; min-width: 0; }
.mc-out { margin-top: 6px; }
.mc-head { margin-bottom: 12px; }
.mc-head .say { margin: 8px 0 0; }
.mc-kp { margin-bottom: 12px; }
.mc-legend { margin-bottom: 8px; }

/* Settings page, gear button, personalised sidebar line */
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.settings .card { display: grid; gap: 12px; align-content: start; }
.settings h3 { margin: 0; }
.settings .hint { margin: 0; }
.settings .seg { justify-self: start; }
a.ibtn { text-decoration: none; }
a.ibtn[aria-current="page"] { color: var(--ink); border-color: var(--line-2); }
.brand .for { display: block; color: var(--accent, var(--ink-2)); font-weight: 600; }

/* Overview fits one screen on a desktop-sized window; smaller windows scroll as usual */

/* ---------- Minimal look: quiet surfaces, one accent, no decoration ---------- */
.card, .btn { box-shadow: none; }

/* Narrow phones: nine dock items are icons only (names stay as titles and screen-reader labels) */

.verdict { background: var(--surface); }

.mc-solve { display: grid; gap: 6px; justify-items: start; }
.mc-solve .hint { margin: 0; }

/* Saved scenarios */
.scen-card { display: grid; gap: 12px; margin-bottom: 16px; }
.scen-card .card-head { margin: 0; }
.scen-save { display: flex; gap: 8px; flex-wrap: wrap; }
.scen-save input { flex: 1 1 200px; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.scen-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.scen-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.scen-list small { color: var(--ink-3); margin-left: 6px; }
.scen-btns { display: flex; gap: 6px; }
.scen-out h4 { margin: 14px 0 6px; font-size: 14px; }
table.cmp small { color: var(--ink-3); display: block; }

/* Legal page */
.legal { max-width: 70ch; }
.legal h2 { font-size: 15px; margin: 20px 0 4px; }
.legal h2:first-child { margin-top: 0; }
.legal p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.legal p.hint { margin-top: 22px; }
.foot a { color: inherit; }

.scen-card > * { min-width: 0; }
.scen-out { overflow-x: auto; }
.scen-out .table-scroll { margin: 0; }
table.cmp { width: 100%; min-width: 0; table-layout: fixed; }
table.cmp th, table.cmp td { white-space: normal; overflow-wrap: anywhere; padding: 8px 6px; font-size: 12.5px; text-align: right; }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; width: 34%; }

/* Statements */
.drop { border-style: dashed; display: grid; gap: 8px; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop h3 { margin: 0; }
.drop p { margin: 0; }
.pick { cursor: pointer; }
.cols summary { cursor: pointer; font-weight: 600; }
.finds { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.finds li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.finds li i { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; background: var(--ink-3); }
.finds li.good i { background: var(--good); }
.finds li.warn i { background: var(--bad); }
[data-sec] + [data-sec] { margin-top: 16px; }
.share { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.share .pc { min-width: 3ch; text-align: right; }
/* In the Statements cards a table can be followed by a note or another table, so it only runs to the card's edge when it is last */
[data-sec] .table-scroll { margin-bottom: 14px; }
[data-sec] .table-scroll:last-child { margin-bottom: -22px; }
[data-sec] .hint:last-child { margin-bottom: 0; }
@media (max-width: 640px) { [data-sec] .table-scroll:last-child { margin-bottom: -18px; } }
/* Descriptions can be long, so they sit last and are read left to right */
[data-tx] table th:last-child, [data-tx] table td:last-child { text-align: left; white-space: normal; min-width: 260px; }
[data-odd] table th:last-child, [data-odd] table td:last-child { text-align: left; white-space: normal; min-width: 240px; }
.pw { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.pw label { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pw input { height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; padding: 0 10px; }
/* Phone: let the group name wrap so the amount stays on screen without scrolling sideways */
@media (max-width: 560px) {
  [data-tx] table th:nth-child(2), [data-tx] table td:nth-child(2) { text-align: left; white-space: normal; min-width: 96px; max-width: 120px; }
  [data-tx] table th, [data-tx] table td, [data-odd] table th, [data-odd] table td { padding-left: 8px; padding-right: 8px; }
}
/* Lifestyle cards (Early Retirement) */
.life-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.life-card { text-align: left; font: inherit; color: inherit; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; display: grid; gap: 4px; align-content: start; transition: border-color .15s, background .15s; }
.life-card:hover { border-color: var(--ink-3); }
.life-card.sel { border-color: var(--accent); background: var(--accent-soft); }
.life-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.life-card .nm { font-weight: 600; }
.life-card .ln { font-size: 12.5px; color: var(--ink-3); min-height: 3.1em; }
.life-card b { font-size: 19px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.life-card b small { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.life-card .rs { font-size: 12.5px; }
.life-card .rs.pos { color: var(--good); } .life-card .rs.neg { color: var(--bad); }
@media (max-width: 900px) { .life-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .life-grid { grid-template-columns: 1fr; } .life-card .ln { min-height: 0; } }
/* Five-way segmented choices (the lifestyles) wrap to two rows in the narrow input panel */
.segf[style*="--cols: 5"] { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }

/* ---------- Dashboard layout (Settings > Layout; Early Retirement) ----------
   Results first: four tiles, the lifestyles, the chart, then the tables. The inputs fold into one list. */
.dash .grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.dash .results { order: 3; gap: 14px; }
.dash .dash-inputs { order: 1; }
.dash .rail { order: 2; position: static; max-height: none; overflow: visible; }
.dash .results > * { order: 10; }
.dash .results > .scen-card { order: 0; }
.dash .results > .verdict { order: 1; }
.dash .results > .ls-card { order: 2; }
.dash .results > .chart-card { order: 3; }
.dash .results > .draws-card { order: 4; }
.dash .verdict { display: flex; flex-direction: column-reverse; gap: 12px; padding: 0; background: none; border: 0; box-shadow: none; overflow: visible; }
.dash .verdict > div:first-child { padding: 0 2px; }
.dash .verdict .say { font-size: 14.5px; font-weight: 400; color: var(--ink-2); margin: 8px 0 0; max-width: none; }
.dash .kp > div { background: var(--surface); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.dash .kp b { font-size: 22px; }
.dash .life-grid { gap: 10px; }
.dash .card:not(.verdict) { padding: 18px 20px; }
.dash-inputs { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; cursor: pointer; box-shadow: var(--shadow); }
.dash-inputs:hover { border-color: var(--ink-3); }
.dash-inputs em { display: block; font-style: normal; font-weight: 400; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.dash-inputs .tog { color: var(--accent); font-size: 13px; font-weight: 600; white-space: nowrap; }
.dash-inputs[aria-expanded="true"] { border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: -16px; border-bottom-color: transparent; }
.dash .rail[hidden] { display: none; }
@media (max-width: 900px) { .dash .kp { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
}

/* Touch: text buttons and slider handles get a finger-sized target (the investment table's boxes already are) */
@media (max-width: 900px), (pointer: coarse) {
  .linkbtn { min-height: 40px; padding: 10px 8px; }
  .rng { height: 28px; margin: -6px 0 -8px; }
  .rng::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -10px; }
  .rng::-moz-range-thumb { width: 20px; height: 20px; }
}

/* Investments: custom split panel and move up/down */

/* Statement Review: UPI wallet files */
[data-wallet] td input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand, currentColor); }
.dash .dash-live { position: sticky; z-index: 4; top: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; padding: 10px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
.dash .dash-live > div { min-width: 0; }
.dash .dash-live small { display: block; font-size: 11px; color: var(--ink-3); line-height: 1.2; }
.dash .dash-live b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.dash .dash-inputs { order: 0; }
@media (max-width: 900px) { .dash .dash-live { top: 56px; gap: 6px 14px; padding: 8px 12px; } .dash .dash-live b { font-size: 14px; } }

/* ---------- v4: one page. No side menu or bottom bar; the toolbar sits in the top bar; Settings and Legal are popups ---------- */
.app { display: flex; flex-direction: column; grid-template-columns: none; min-height: 100vh; }
.app > .page { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; }
.brand-m { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-m > span { display: grid; line-height: 1.2; }
.brand-m small { font-size: 11px; color: var(--ink-3); }
.bar { padding: 0 32px; }
.foot { width: 100%; max-width: 1440px; align-items: center; }
.foot .company { display: flex; align-items: center; gap: 10px; }
.foot .it-logo { width: 28px; height: 26px; color: var(--ink-2); }
@media (max-width: 640px) { .bar { padding: 0 16px; } .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }   /* clear of the bottom bar: with 20px the end of the footer, the Legal link included, sat under it */

.modal { border: 1px solid var(--line); border-radius: 20px; padding: 0; background: var(--bg); color: var(--ink); width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(9, 9, 11, .55); backdrop-filter: blur(3px); }
.modal-body { padding: 28px 28px 24px; }
.modal-x { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; z-index: 2; }
@media (max-width: 640px) { .modal { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; } .modal-body { padding: 20px 16px; } }

/* v4: a one-page reading width; the top bar and footer line up with it */
.app > .page { max-width: 1120px; }
.bar { padding: 0 max(32px, calc((100% - 1120px) / 2 + 32px)); }
.foot { max-width: 1120px; }
@media (min-width: 901px) { .dash .kp { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Legal popup: plain reading column, no card inside the popup */
.modal.is-legal { width: min(680px, calc(100vw - 24px)); }
.modal-body .legal.card { border: 0; box-shadow: none; background: none; padding: 0; max-width: none; }
.modal-body .head { margin: 0 0 16px; padding-right: 48px; }
.modal-body .head h1 { font-size: 26px; }
.modal-body .head p { margin: 4px 0 0; }
.modal-x { position: absolute; top: 14px; right: 14px; float: none; margin: 0; }
.modal { overflow-y: auto; }

/* v4: use the full width of the browser on desktop */
.app > .page, .foot { max-width: none; }
.bar { padding: 0 32px; }
@media (min-width: 1500px) { .app > .page, .foot { padding-left: 48px; padding-right: 48px; } .bar { padding: 0 48px; } }

.bar-name input { height: 36px; width: 170px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; }
.bar-name input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 640px) { .bar-name input { width: 110px; } }

.local-note { display: flex; align-items: center; gap: 8px; margin: 14px 32px 0; font-size: 13px; color: var(--ink-3); }
.local-note svg { flex-shrink: 0; color: var(--accent); }
@media (min-width: 1500px) { .local-note { margin-left: 48px; } }
@media (max-width: 640px) { .local-note { margin: 10px 16px 0; font-size: 12.5px; } }
.mc-stale { margin: 0; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink-2); font-size: 13px; border: 1px dashed var(--line); }
.mc-out.is-stale { opacity: .45; }
.mc-tag { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--accent); }

/* v4: text uses the whole width of its card or column instead of a narrow reading measure */
.head p, .verdict .say, .verdict .more, .dash .verdict .say { max-width: none; }
.head > div:first-child { flex: 1 1 auto; min-width: 0; }
.hint, .mc-intro, .say, .more { max-width: none; }
.dash .results > .mc-card { order: 9; }

/* Hiding charts keeps the Monte Carlo card: only its fan chart and legend go */
.no-charts .card.mc-card { display: block; }
.no-charts .mc-card [data-chart], .no-charts .mc-card .mc-legend { display: none; }

/* Monte Carlo card folds to its header */
.mc-toggle { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.mc-toggle h3 { margin: 0; }
.mc-toggle svg { flex-shrink: 0; color: var(--ink-3); transition: transform .15s; }
.mc-folded .mc-toggle svg { transform: rotate(-90deg); }
.mc-card.mc-folded > :not(.card-head) { display: none !important; }

/* v4: the input column fits its content: tabs wrap onto a second line instead of scrolling sideways, and it is wider on large screens */
.rtabs { flex-wrap: wrap; overflow: visible; }
.rtabs [role="tab"] { flex: 1 1 auto; }
@media (min-width: 901px) { .grid:not(.dash .grid) { grid-template-columns: clamp(380px, 32vw, 520px) minmax(0, 1fr); } }

/* Monte Carlo fold: a minus when open, a plus when folded, at the right of the card header */
.mc-card .card-head { align-items: center; }
.mc-card .card-head h3 { margin: 0; margin-right: auto; }
.mc-toggle { width: 34px; height: 34px; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2); flex-shrink: 0; }
.mc-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
.mc-toggle svg { transform: none !important; }
.mc-toggle .v { transition: opacity .15s; }
.mc-card:not(.mc-folded) .mc-toggle .v { opacity: 0; }

/* Foldable cards (the year-by-year table): same plus/minus as the Monte Carlo card */
.foldable .card-head { align-items: center; }
.foldable .card-head > .legend { margin-left: auto; }
.foldable .mc-toggle { margin-left: 8px; }
.foldable:not(.is-folded) .mc-toggle .v { opacity: 0; }
.foldable.is-folded > :not(.card-head) { display: none !important; }
.foldable.is-folded .card-head { margin-bottom: 0; }

/* Settings: a small panel anchored under the gear button */
.popover { position: fixed; z-index: 40; top: 64px; right: 32px; width: min(400px, calc(100vw - 24px)); max-height: calc(100vh - 80px); overflow-y: auto; padding: 16px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.popover[hidden] { display: none; }
.popover .head { margin: 0 0 12px; }
.popover .head h1 { font-size: 20px; }
.popover .head p { font-size: 12.5px; margin-top: 4px; }
.popover .settings { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.popover .settings .card { padding: 14px; box-shadow: none; }
@media (min-width: 1500px) { .popover { right: 48px; } }
@media (max-width: 640px) { .popover { right: 12px; left: 12px; width: auto; top: 58px; } }

/* Settings panel: one compact list of label and control rows, no scrolling */
.popover { padding: 14px 16px; }
.set-title { font-weight: 650; font-size: 15px; margin-bottom: 8px; }
.set-title small { font-weight: 400; font-size: 12px; color: var(--ink-3); margin-left: 8px; }
.set-rows { display: grid; gap: 10px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.srow .lb { flex-shrink: 0; min-width: 78px; }
.srow .seg { flex: 1; justify-content: flex-end; }
.srow .in { flex: 1; }
.srow.chk { align-items: flex-start; }
.srow.chk small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.set-rows .hint { margin: -4px 0 0; font-size: 12px; }

/* One-line entries */
.f-inline { display: grid; grid-template-columns: minmax(0, 1.5fr) 84px minmax(0, 1fr); align-items: center; column-gap: 10px; }
.f-inline > label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-inline .rng { margin: 0; }
.f-inline > small { grid-column: 1 / -1; }
.crash.inline { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: end; gap: 8px; }
.crash.inline > .sw .note { display: none; }
.crash.inline .crash-body { margin: 0; padding: 0; border: 0; gap: 8px; }
.crash.inline .crash-body .f label { font-size: 11px; }
.crash.inline { padding: 8px 10px; }
.crash.inline:not(.off) { border-color: var(--line); background: var(--surface-2); }
.crash.inline { grid-template-columns: 96px minmax(0, 1fr); padding: 8px; gap: 6px; }
.crash.inline > .sw { min-width: 0; }
.crash.inline > .sw .txt { font-size: 12.5px; }
.crash.inline .crash-body { grid-template-columns: minmax(0, 1.1fr) 56px minmax(0, 1.2fr); }
.crash.inline .crash-body select, .crash.inline .crash-body input { text-overflow: ellipsis; }
.crash.inline .crash-body select { padding-right: 4px; font-size: 13px; }
.crash.inline[style*="--cols: 2"] .crash-body, .crash.inline .crash-body[style*="--cols: 2"] { grid-template-columns: minmax(0, 1.3fr) minmax(60px, .7fr); }

/* Five key figures (the fifth is the sweet spot draw) */
.kp5 > :last-child { grid-column: 1 / -1; }
@media (min-width: 901px) { .dash .kp5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .dash .kp5 > :last-child { grid-column: auto; } }

/* The five key figures sit on one line when there is room, and wrap evenly when there is not */
.kp.kp5, .dash .kp.kp5 { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.kp5 > :last-child, .dash .kp5 > :last-child { grid-column: auto; }
.kp5 b { font-size: 20px; }
@media (max-width: 900px) { .kp.kp5, .dash .kp.kp5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kp5 > :last-child { grid-column: 1 / -1; } }
.kp5 > div { padding-left: 12px; padding-right: 12px; }
.kp5 em { font-size: 11.5px; }
.kp5 small { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }

/* Narrow windows: numbers in the comparison tables stay whole; the row labels give way */
table.cmp td { white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 560px) {
  table.cmp th, table.cmp td { padding: 8px 4px; font-size: 11.5px; }
  table.cmp th:first-child, table.cmp td:first-child { width: 24%; white-space: normal; }
}

/* Tabs layout: classic underlined Inputs / Results tabs; the verdict and two key figures sit at the right of the tab bar */

/* Tighter inputs: shorter boxes and smaller gaps so a section reads as one block, not scattered fields */
.sec { padding: 2px 16px 14px; gap: 10px; }
.row { gap: 10px; }
label.f, .f { gap: 4px; font-size: 12px; }
.in { height: 34px; padding: 0 10px; }
.in input, .in select { font-size: 13.5px; }
.sec-head { padding-top: 2px; }
.sec-nav { padding-top: 10px; }
.subhead { margin-top: 4px; }
.f-inline { column-gap: 8px; }
.rtabs { padding: 8px; }

/* Collapsible inputs panel (Classic layout) */
.rail-tab { grid-column: 1; grid-row: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 14px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); cursor: pointer; margin-bottom: -12px; }
.rail-tab:hover { border-color: var(--ink-3); }
.rail-tab .tog { order: 2; font-size: 18px; line-height: 1; color: var(--accent); }
.grid > .rail { grid-column: 1; grid-row: 2; }
.grid > .results { grid-column: 2; grid-row: 1 / span 2; }
.grid.rail-off { grid-template-columns: 46px minmax(0, 1fr) !important; }
.grid.rail-off > .rail-tab { grid-row: 1 / span 2; height: 150px; flex-direction: column; justify-content: flex-start; padding: 12px 0; margin: 0; position: sticky; top: 92px; }
.grid.rail-off > .rail-tab .tog { order: 0; }
.grid.rail-off > .rail-tab .lbl { writing-mode: vertical-rl; letter-spacing: .04em; color: var(--ink-2); }
.dash .rail-tab { display: none; }
@media (max-width: 900px) {
  .grid > .results, .grid > .rail { grid-column: 1; grid-row: auto; }
  .grid.rail-off { grid-template-columns: minmax(0, 1fr) !important; }
  .grid.rail-off > .rail-tab { grid-row: auto; height: auto; flex-direction: row; justify-content: space-between; padding: 9px 14px; position: static; margin-bottom: -12px; }
  .grid.rail-off > .rail-tab .tog { order: 2; }
  .grid.rail-off > .rail-tab .lbl { writing-mode: horizontal-tb; }
}
.grid:not(.dash .grid) { grid-template-rows: auto 1fr; }
@media (max-width: 900px) { .grid:not(.dash .grid) { grid-template-rows: none; } }

/* Classic side menu: the sections are listed down the left of the inputs panel (wide screens) */
.rail[hidden] { display: none; }
@media (min-width: 901px) {
  .grid:not(.rail-off):not(.dash .grid) { grid-template-columns: clamp(500px, 40vw, 620px) minmax(0, 1fr) !important; }
  #view:not(.dash) .rail { display: grid; grid-template-columns: 124px minmax(0, 1fr); grid-template-rows: 1fr auto; }
  #view:not(.dash) .rail > .rtabs { grid-row: 1 / span 1; grid-column: 1; position: static; display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; overflow: visible; background: var(--surface-2); border-right: 1px solid var(--line); border-radius: var(--r) 0 0 0; }
  #view:not(.dash) .rail > .rtabs::before { display: none; }
  #view:not(.dash) .rail > .rtabs [role="tab"] { flex: none; text-align: left; margin: 0 !important; padding: 9px 10px; border-radius: 8px; font-size: 13px; }
  #view:not(.dash) .rail > .rtabs [role="tab"][aria-selected="true"] { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
  #view:not(.dash) .rail > div:not(.rtabs):not(.rail-foot) { grid-column: 2; grid-row: 1; min-width: 0; }
  #view:not(.dash) .rail > .rail-foot { grid-column: 1 / -1; grid-row: 2; }
}

/* Dashboard layout: results first, the inputs list below; undo the side-panel placement */
.dash .grid { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: none; }
.dash .grid > .rail, .dash .grid > .results { grid-column: 1; grid-row: auto; }

/* Clearer selected tab */
.rtabs [role="tab"][aria-selected="true"], #view:not(.dash) .rail > .rtabs [role="tab"][aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); font-weight: 700;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
@media (min-width: 901px) {
  #view:not(.dash) .rail > .rtabs [role="tab"][aria-selected="true"] { box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
}
.rtabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Dashboard, rebuilt: pinned live banner, then each section's fields in columns across the full width */
.dash .rail { border-radius: 16px; }
.dash .dash-live { top: 60px; padding: 12px 20px; gap: 6px 28px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); border-radius: 16px 16px 0 0; backdrop-filter: blur(8px); }
.dash .dash-live b { font-size: 18px; }
@media (min-width: 901px) {
  .dash .rtabs { justify-content: flex-start; gap: 4px; }
  .dash .rtabs [role="tab"] { flex: 0 0 auto; padding: 8px 18px; }
  .dash .sec { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); column-gap: 28px; row-gap: 14px; align-items: start; padding: 8px 24px 20px; }
  .dash .sec > .sec-head, .dash .sec > .sec-nav, .dash .sec > .note, .dash .sec > .lead, .dash .sec > .subhead, .dash .sec > .hint { grid-column: 1 / -1; }
}

/* Well-defined fields: a visible outline, a white well, a clear focus ring */
.in { border-color: var(--line-2); background: var(--surface); box-shadow: inset 0 1px 0 rgba(0, 0, 0, .03); }
.in:hover { border-color: var(--ink-3); }
.in input, .in select { text-overflow: ellipsis; }
label.f > span:first-child, .f > label { font-weight: 600; color: var(--ink-2); }
.crash.inline:not(.off) { background: var(--surface-2); border-color: var(--line-2); }
/* Dashboard: wide items take a whole row so nothing is squeezed or cut off */
.dash .sec > .crash, .dash .sec > .f-inline, .dash .sec > .table-scroll { grid-column: 1 / -1; }
@media (min-width: 901px) { .dash .sec { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); } }
.crash.inline { grid-template-columns: 112px minmax(0, 1fr); }

/* Headline as a short bullet list */
.say-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.say-list li { position: relative; padding-left: 22px; font-size: 17px; line-height: 1.35; font-weight: 500; }
.say-list li::before { content: ""; position: absolute; left: 4px; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.say-list li b { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.say-list li:last-child b { color: var(--accent); }
.say-note { display: block; margin-top: 8px; font-size: 14px; font-weight: 400; color: var(--ink-2); }
.dash .say-list li { font-size: 14.5px; font-weight: 400; }

/* Settings: the currency is fixed to rupees for now */
.srow .in:has(select:disabled) { opacity: .55; cursor: not-allowed; background: var(--surface-2); }
.srow .in select:disabled { cursor: not-allowed; }

/* Clearer selected option in the choice rows (Lifestyle, Counted in, Settings) */
.segf label:has(input:checked) { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }

/* Lifestyle: the budget total sits beside the "Monthly budget" heading */
.subhead.budget-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: -4px; }
.subhead.budget-head b { font-size: 17px; color: var(--ink); text-transform: none; letter-spacing: -.01em; font-weight: 700; font-variant-numeric: tabular-nums; }
.subhead.budget-head b small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }

/* Add/remove lists (income sources, budget lines, injections, medical expenses, crashes) */
.listf { display: grid; gap: 8px; }
.lrows { display: grid; gap: 8px; }
.lrow { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-2); }
.lgrp { display: grid; gap: 8px; align-items: end; min-width: 0; }
.lcell { min-width: 0; }
.lcell label { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.lx { height: 34px; width: 32px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-3); font-size: 18px; line-height: 1; cursor: pointer; }
.lx:hover { color: var(--bad); border-color: var(--bad); }
.ladd { justify-self: start; border-style: dashed; color: var(--accent); background: transparent; }
.ladd:hover:not(:disabled) { background: var(--accent-soft); }
.ladd:disabled { opacity: .45; cursor: not-allowed; }
.lfoot { font-size: 13px; color: var(--ink-2); }
.lfoot b { color: var(--ink); font-variant-numeric: tabular-nums; }
.lempty { margin: 0; padding: 4px 2px; }
.dash .sec > .listf { grid-column: 1 / -1; }

/* Compact lists: one line per row, labels only above the first */
.listf.compact .lrows { gap: 6px; }
.listf.compact .lrow { padding: 0; border: 0; background: none; }
.listf.compact .lrow:not(:first-child) .lcell label { display: none; }
/* ... and a row of two lines (the name on its own line) is a unit: a hairline between them */
.listf.compact .lrow:has(> .lgrp + .lgrp) { gap: 4px; padding: 0 0 6px; border-bottom: 1px dashed var(--line-2); }
.listf.compact .lrow:has(> .lgrp + .lgrp) .lgrp { gap: 6px; }
/* dated lists (payouts, goals): each entry is its own box with every field labelled: name and year, then the amount and where it goes */
.listf.compact.dated-rows .lrows > .lrow.lrow:has(> .lgrp + .lgrp) { gap: 5px; padding: 6px 6px 8px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-2); }
.listf.compact.dated-rows .lrow .lcell label { display: block; }
.listf.compact.dated-rows .lcell { gap: 2px; }
.listf.compact.dated-rows .in { padding-left: 8px; padding-right: 6px; }
.listf.compact.dated-rows .in select { padding-left: 2px; padding-right: 0; text-overflow: ellipsis; }
.listf.compact .lrow:has(> .lgrp + .lgrp):last-child { padding-bottom: 0; border-bottom: 0; }
.life-grid { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
.life-card { min-width: 0; overflow-wrap: anywhere; }

/* Income Target: the invoice-total panel */
.inc-total { display: grid; gap: 12px; padding: 22px 24px; align-content: start; }
@media (min-width: 901px) { #view .grid:not(.rail-off) .results > .inc-total { position: sticky; top: 76px; } }
.inc-total .pill { justify-self: start; }
.inc-eyebrow { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: -6px; }
.inc-big { font-family: var(--font-display); font-weight: 700; font-size: clamp(36px, 5vw, 52px); line-height: 1.02; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.inc-big small { font-size: .35em; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.inc-total .say { margin: 0; font: 400 14px/1.45 var(--font-body, inherit); color: var(--ink-2); }
.inc-floor { font-size: 13px; color: var(--ink-3); }
.inc-floor b { color: var(--ink); font-variant-numeric: tabular-nums; }
.inc-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.inc-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 44px; gap: 8px; align-items: center; }
.inc-legend i { width: 10px; height: 10px; border-radius: 2px; }
.inc-legend b { font-weight: 500; font-variant-numeric: tabular-nums; }
.inc-legend em { font-style: normal; font-size: 12px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.inc-rates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.inc-rates > div { padding: 10px 12px; border-right: 1px solid var(--line); min-width: 0; }
.inc-rates > div:last-child { border-right: 0; }
.inc-rates small { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.inc-rates b { display: block; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.inc-check { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.inc-check label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.inc-verdict { font-size: 13px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); line-height: 1.5; }
.inc-verdict .pill { margin-right: 6px; }
.inc-bycur { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.inc-bycur b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Saved scenarios: which one is current */
.btn.has-scen { max-width: 260px; display: inline-flex; align-items: center; gap: 8px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.btn.has-scen::before { content: "●"; color: var(--accent); font-size: 9px; }
.scen-now { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.scen-mod { font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 99px; padding: 1px 7px; flex: none; }
.scen-list li.active { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; border-radius: 6px; }
.scen-badge { font-style: normal; font-size: 11px; font-weight: 700; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 99px; padding: 1px 8px; margin-left: 6px; }
.scen-cur { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: inset 3px 0 0 var(--accent); font-size: 13px; }
.scen-cur[hidden] { display: none; }
.scen-cur em { font-style: normal; color: var(--ink-3); margin-left: 4px; }
.scen-cur .btn:disabled { opacity: .5; cursor: default; }

/* Phones: the top bar wraps (brand and tools on one row, the tool tabs below) instead of running off the screen */
@media (max-width: 720px) {
  .bar { height: auto; flex-wrap: wrap; row-gap: 8px; padding: 8px 16px; }
  .bar-nav { order: 3; width: 100%; }
  .bar-tools { flex: 1 1 auto; min-width: 0; flex-shrink: 1; }
  .bar-name { flex: 1 1 70px; min-width: 0; }
  .bar-name input { width: 100%; }
}

/* Donut charts: parts of one whole */
.donut { width: 100%; max-width: 190px; height: auto; display: block; }
.donut-v { font-weight: 700; fill: var(--ink); font-family: var(--font-display, inherit); font-variant-numeric: tabular-nums; }
.donut-l { fill: var(--ink-3); }
.donut circle { transition: stroke-width .15s; }
.donut circle:hover { stroke-width: 28; }
.donut-wrap { display: grid; grid-template-columns: minmax(130px, 190px) minmax(0, 1fr); gap: 20px; align-items: center; }
@media (max-width: 560px) { .donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; } .donut-wrap .donut-leg { width: 100%; } }
.donut-leg { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.donut-leg li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 44px; gap: 8px; align-items: center; }
.donut-leg i { width: 10px; height: 10px; border-radius: 3px; }
.donut-leg b { font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-leg em { font-style: normal; font-size: 12px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.inc-donut { display: grid; justify-items: center; margin: 4px 0; }
.inc-donut .donut { max-width: 180px; }

/* Income Target: the text block and the donut sit side by side, and wrap when there is no room */
.inc-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.inc-text { flex: 1 1 250px; min-width: 0; display: grid; gap: 12px; }
.inc-top .inc-donut { flex: 0 0 170px; margin: 0 auto; }
.inc-top .inc-donut .donut { max-width: 170px; }

/* Retirement: two donuts, when saving ends and when retirement starts, side by side when there is room */
.kp.kp5.kp-now > :last-child { grid-column: auto; }   /* one figure fewer: the four sit two by two on a narrow page */
.card[hidden] { display: none; }
.split-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; }
.split-pair .split-card { margin: 0; }
.split-pair .donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; }
.split-pair .donut-wrap .donut-leg { width: 100%; }
.split-foot { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); min-height: 1em; }

/* Landing page */
.lp { display: grid; gap: 40px; max-width: 1080px; margin: 0 auto; padding: 12px 0 24px; }
.lp h1 { font-family: var(--font-display); font-size: clamp(30px, 5vw, 46px); line-height: 1.1; letter-spacing: -.02em; margin: 14px 0 12px; }
.lp h2 { font-family: var(--font-display); font-size: 22px; letter-spacing: -.01em; margin: 0 0 16px; }
.lp-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; align-items: center; padding-top: 16px; }
.lp-hero-text p { font-size: 17px; line-height: 1.6; color: var(--ink-2); margin: 0 0 20px; max-width: 52ch; }
.lp-badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--good-bg); color: var(--good); }
.lp-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.lp-btn { height: 44px; padding: 0 22px; font-size: 15px; text-decoration: none; display: inline-flex; align-items: center; }
.lp-fine { display: block; margin-top: 14px; color: var(--ink-3); font-size: 13px; }
.lp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; display: grid; gap: 14px; }
.lp-card-top { display: flex; align-items: center; justify-content: space-between; }
.lp-card-top small { color: var(--ink-3); font-size: 12px; }
.lp-card-body { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.lp-card-body .donut { width: 130px; flex: none; }
.lp-card dl { margin: 0; display: grid; gap: 8px; font-size: 14px; flex: 1 1 160px; }
.lp-card dl > div { display: flex; justify-content: space-between; gap: 12px; }
.lp-card dt { color: var(--ink-3); }
.lp-card dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.lp-note { margin: 0; font-size: 12px; color: var(--ink-3); }
.lp-trust { list-style: none; margin: 0; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: center; font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); }
.lp-trust li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 7px; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.lp-tool { display: grid; gap: 8px; align-content: start; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.lp-tool:hover { border-color: var(--accent); transform: translateY(-2px); }
.lp-tool svg { color: var(--accent); }
.lp-tool b { font-size: 16px; }
.lp-tool span { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.lp-steps li { display: flex; gap: 12px; align-items: flex-start; }
.lp-steps li > span { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--accent-soft); color: var(--accent); }
.lp-steps b { display: block; }
.lp-steps small { color: var(--ink-3); font-size: 13px; }
.lp-band { text-align: center; padding: 32px 20px; border-radius: var(--r); background: var(--accent-soft); display: grid; gap: 6px; justify-items: center; }
.lp-band h2 { margin: 0; }
.lp-band p { margin: 0 0 12px; color: var(--ink-2); }
@media (max-width: 560px) { .lp { gap: 28px; } .lp-btn { flex: 1 1 100%; justify-content: center; } }
.on-home .local-note { display: none; }
.lp [id] { scroll-margin-top: 84px; }

/* Quick start and the rule-of-thumb check */
.lp-link { display: block; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }
.lp-link:hover { text-decoration: underline; }
.qs { max-width: 1080px; margin: 0 auto; }
.qs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 20px; align-items: start; }
.qs-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.qs-f { min-width: 0; }
.qs-wide { grid-column: 1 / -1; }
@media (max-width: 420px) { .qs-fields { grid-template-columns: minmax(0, 1fr); } }
.qs-rows { display: grid; }
.qs-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qs-row span { display: block; font-size: 13.5px; color: var(--ink-2); }
.qs-row small { display: block; font-size: 12px; color: var(--ink-3); }
.qs-row b { font-size: 16px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qs-bars { display: grid; gap: 8px; margin: 14px 0 4px; }
.qs-bar { display: grid; grid-template-columns: 96px minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: 13px; }
.qs-bar i { display: block; height: 12px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.qs-bar s { display: block; height: 100%; border-radius: 6px; text-decoration: none; }
.qs-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.qs-verdict, .rule-line { margin: 12px 0 0; line-height: 1.6; font-size: 14px; }
.qs-verdict .pill, .rule-line .pill { margin-right: 6px; }
.qs-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.qs-actions .btn { text-decoration: none; display: inline-flex; align-items: center; }
.qs-fine { margin: 14px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.rule-sec { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 16px; }
.rule-sec .card-head { margin: 0 0 6px; }

/* Retirement headline: the Rule-of-Thumb Check sits beside the verdict when the results column is wide, with the key figures full width below */
.results { container-type: inline-size; }
@container (min-width: 760px) {
  .verdict.vsplit { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 32px; row-gap: 22px; }
  .verdict.vsplit > .kp { grid-column: 1 / -1; grid-row: 2; }
  .verdict.vsplit > .rule-sec { grid-column: 2; grid-row: 1; border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 32px; align-self: start; }
  .verdict.vsplit > div:first-child { grid-column: 1; grid-row: 1; }
}

/* The 'What is different' table: long entries wrap instead of running off the card */
table.cmp-diff td, table.cmp-diff th { white-space: normal; overflow-wrap: anywhere; text-align: left; }
table.cmp-diff th:first-child, table.cmp-diff td:first-child { width: 28%; }
table.cmp-diff td small { display: block; color: var(--ink-3); }
table.cmp-diff td:first-child { font-weight: 600; }

/* =====================================================================================
   v5: the Savings v3 look, calm. HUD cards with corner brackets, cyan and violet, mono figures,
   a still tick gauge. Nothing moves or blinks; the aurora is fixed and the glow is soft.
   Night and Day come from tokens.css. [data-theme="light"] (PDF export) stays plain: no bracket layer.
   ===================================================================================== */
body { background: var(--bg); font-variant-numeric: tabular-nums; position: relative; }
body::before { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; background: var(--glow); }
html::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 62%); mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 62%); opacity: .6; }
:root[data-theme="light"] body::before, :root[data-theme="light"] html::before { display: none; }
@media print { body::before, html::before { display: none; } }

/* Cards: brackets in the four corners (cyan on top, violet below) and a faint line along the top */
.card, .rail, .popover, .modal { border-radius: 10px; border-color: var(--line); }
.card { position: relative; background: var(--surface); box-shadow: var(--shadow); }
.card::before { content: ""; position: absolute; inset: -1px; pointer-events: none; border-radius: inherit; opacity: .9;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 18px 2px no-repeat, linear-gradient(var(--accent), var(--accent)) 0 0 / 2px 18px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 0 / 18px 2px no-repeat, linear-gradient(var(--accent), var(--accent)) 100% 0 / 2px 18px no-repeat,
    linear-gradient(var(--accent-2), var(--accent-2)) 0 100% / 18px 2px no-repeat, linear-gradient(var(--accent-2), var(--accent-2)) 0 100% / 2px 18px no-repeat,
    linear-gradient(var(--accent-2), var(--accent-2)) 100% 100% / 18px 2px no-repeat, linear-gradient(var(--accent-2), var(--accent-2)) 100% 100% / 2px 18px no-repeat; }
.card::after { content: ""; position: absolute; left: 14%; right: 14%; top: -1px; height: 1px; pointer-events: none; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .35; }
:root[data-theme="light"] .card::before, :root[data-theme="light"] .card::after { display: none; }
.verdict { background: var(--surface); overflow: hidden; }
.card h3, .card-head h3 { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.card-head h3::before { content: "// "; color: var(--accent); }
.legend, .hint, .split-foot { font-family: var(--mono); font-size: 11.5px; }

/* Top bar and tabs */
.bar { background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom-color: var(--line); }
.bar-nav { background: var(--surface); border-radius: 8px; border-color: var(--line); }
.bar-nav a { border-radius: 6px; }
.bar-nav a:hover { background: var(--surface-2); }
.bar-nav a[aria-current="page"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--accent); }
.ibtn { border-radius: 6px; background: var(--surface); border-color: var(--line); }
.ibtn:hover { border-color: var(--accent); color: var(--ink); }
.mark { box-shadow: none; }
.local-note { font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; }

/* Buttons: primary is the cyan-to-violet gradient, the rest are quiet outlines */
.btn { border-radius: 6px; background: transparent; border-color: var(--edge); box-shadow: none; font-weight: 600; }
.btn:hover { border-color: var(--ink); background: var(--surface); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--btn-end, var(--accent-2))); border-color: transparent; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .07em; font-size: 12.5px; font-weight: 700; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn.primary:hover { filter: brightness(1.08); }

/* Fields: square-ish wells with a clear edge, cyan focus ring, mono figures */
.in { border-radius: 6px; border-color: var(--edge); background: var(--surface); box-shadow: none; }
.in:hover { border-color: var(--ink); }
.in:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent); }
.in input { font-family: var(--mono); font-size: 13.5px; }
.in select { font-family: var(--font); }
.in select option { background: var(--sticky); color: var(--ink); }
label.f > span:first-child, .f > label { font-weight: 500; color: var(--ink-2); font-size: 12.5px; }
.seg { border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.seg button { border-radius: 6px; }
.seg button[aria-pressed="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--accent); }

/* Inputs panel and its section menu */
.rail { background: var(--surface); box-shadow: var(--shadow); }
.rtabs [role="tab"] { border-radius: 6px; }
.rtabs [role="tab"][aria-selected="true"], #view:not(.dash) .rail > .rtabs [role="tab"][aria-selected="true"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
@media (min-width: 901px) { #view:not(.dash) .rail > .rtabs [role="tab"][aria-selected="true"] { box-shadow: inset 2px 0 0 var(--accent); } }
#view:not(.dash) .rail > .rtabs { background: transparent; border-right-color: var(--line); }
.rail-foot { font-family: var(--mono); font-size: 11.5px; }

/* The headline: gauge, the four bullets, and the rule-of-thumb check, with five figure tiles below */
.gauge { display: grid; place-items: center; }
.gauge-svg { width: min(236px, 100%); height: auto; display: block; overflow: visible; }
.tick { stroke: var(--track); stroke-width: 2.2; stroke-linecap: round; }
.tick.lit { stroke: var(--accent); } .tick.hot { stroke: var(--accent-2); } .tick.lit.short { stroke: var(--bad); }
.gauge-arc.short { stroke: var(--bad); }
.gauge-v { font-family: var(--mono); font-size: 56px; font-weight: 700; letter-spacing: -.04em; fill: var(--ink); }
.gauge-s { font-family: var(--mono); font-size: 10px; letter-spacing: .22em; fill: var(--ink-3); }
.gauge-c { font-family: var(--mono); font-size: 9px; letter-spacing: .2em; fill: var(--accent); }
.say-list b { font-family: var(--mono); }
.verdict .more { font-size: 12.5px; }
.pill { border-radius: 4px; text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; font-family: var(--mono); border: 1px solid currentColor; background: color-mix(in srgb, currentColor 12%, transparent); }
.pill::before { box-shadow: none; }
.pill.info { color: var(--ink-2); background: transparent; }
.rule-sec { border-top-color: var(--line); }
.rule-line b, .rule-sec b { font-family: var(--mono); }
.qs-bar { font-family: var(--mono); font-size: 12px; }
.qs-bar i { border-radius: 2px; background: var(--track); } .qs-bar s { border-radius: 2px; }
.kp > div { border-radius: 6px; background: var(--surface); border-color: var(--line); backdrop-filter: none; }
.kp > div:first-child { border-color: var(--line); }
.kp small { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.kp b { font-family: var(--mono); font-weight: 700; letter-spacing: -.02em; }
.kp em { font-size: 11.5px; }

/* Donuts, charts, lifestyles and tables */
.donut-v { font-family: var(--mono); fill: var(--ink); }
.donut-l { font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.donut-leg i { border-radius: 50%; }
.donut-leg b, .donut-leg em { font-family: var(--mono); }
.donut circle { transition: none; }
[data-chart] text { font-family: var(--mono); letter-spacing: .04em; }
.tip { background: var(--sticky); border-color: var(--line); border-radius: 8px; font-family: var(--mono); box-shadow: var(--shadow-lg); }
.life-card { border-radius: 8px; background: var(--surface); border-width: 1px; border-color: var(--line); }
.life-card:hover { border-color: var(--accent); }
.life-card.sel { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 0 0 0 1px var(--accent); }
.life-card b, .life-card .rs { font-family: var(--mono); }
.rs.pos { color: var(--good); } .rs.neg { color: var(--bad); }
table { font-family: var(--mono); font-size: 12.5px; }
th { background: var(--sticky); color: var(--ink-2); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
th:first-child, td:first-child { background: var(--sticky); }
td, th { border-bottom-color: var(--line); }
td.neg { color: var(--bad); }
.table-scroll { border-radius: 6px; }
.track { background: var(--track); border-radius: 2px; } .track b { border-radius: 2px; }

/* Popups and toast */
.popover, .modal { background: var(--sticky); box-shadow: var(--shadow-lg); }
.toast { background: var(--sticky); color: var(--ink); border: 1px solid var(--accent); border-radius: 6px; font-family: var(--mono); font-size: 13px; }
.foot { font-family: var(--mono); font-size: 11.5px; }

/* Verdict layout with the gauge: gauge | bullets | rule check on a wide column; gauge | bullets with the rule below on a medium one; stacked on a phone */
@container (min-width: 560px) {
  .verdict.vsplit { grid-template-columns: auto minmax(0, 1fr); column-gap: 28px; row-gap: 22px; align-items: center; }
  .verdict.vsplit > .gauge { grid-column: 1; grid-row: 1; }
  .verdict.vsplit > div:not(.gauge):not(.kp):not(.rule-sec) { grid-column: 2; grid-row: 1; }
  .verdict.vsplit > .rule-sec { grid-column: 1 / -1; grid-row: 2; border-left: 0; padding: 16px 0 0; border-top: 1px solid var(--line); }
  .verdict.vsplit > .kp { grid-column: 1 / -1; grid-row: 3; }
}
@container (min-width: 1000px) {
  .verdict.vsplit { grid-template-columns: auto minmax(0, 1.1fr) minmax(0, 1fr); }
  .verdict.vsplit > .rule-sec { grid-column: 3; grid-row: 1; border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 26px; align-self: start; }
  .verdict.vsplit > div:not(.gauge):not(.kp):not(.rule-sec) { align-self: start; }
  .verdict.vsplit > .kp { grid-row: 2; }
}
.dash .verdict .gauge { display: none; }
@container (max-width: 699px) { .kp.kp5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kp5 > :last-child { grid-column: 1 / -1; } }
@container (min-width: 700px) { .kp.kp5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .kp5 > :last-child { grid-column: auto; } .kp5 b { font-size: 16px; } }
@container (min-width: 1100px) { .kp5 b { font-size: 20px; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.verdict .say { font: 400 15px/1.5 var(--font); letter-spacing: 0; color: var(--ink-2); }
.say-list li { font-size: 15px; font-weight: 400; }
.say-list li::before { width: auto; height: auto; top: 0; left: 4px; background: none; content: "\203A"; color: var(--accent); font-family: var(--mono); border-radius: 0; }
.say-list li b { color: var(--ink); }

/* Income Target: the headline figure and breakdown in the same mono figures */
.inc-big { font-family: var(--mono); letter-spacing: -.03em; }
.inc-eyebrow, .inc-rates small { font-family: var(--mono); letter-spacing: .1em; }
.inc-rates { border-radius: 6px; background: var(--surface); }
.inc-rates b, .inc-legend b, .inc-legend em, .inc-floor b, .inc-bycur b { font-family: var(--mono); }
.inc-legend i { border-radius: 50%; }
.inc-verdict { border-radius: 6px; background: var(--surface-2); }

/* Phone dock: a floating bar at the bottom, below 861px wide */
.dock { display: none; }
@media (max-width: 860px) {
  .dock { display: flex; align-items: stretch; justify-content: space-around; gap: 2px; position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 40; padding: 6px; border-radius: 14px; background: var(--sticky); border: 1px solid var(--accent); box-shadow: var(--shadow-lg); }
  .dock a, .dock button { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px; min-height: 44px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: 600 10.5px/1.2 var(--font); text-decoration: none; cursor: pointer; }
  .dock svg { width: 20px; height: 20px; }
  .dock a[aria-current="page"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
  .dock a:focus-visible, .dock button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .bar-nav { display: none; }
  .toast { bottom: 84px; }
}
.head .actions { flex-wrap: wrap; }
@media (max-width: 640px) { .head .actions .btn { flex: 1 1 auto; padding: 0 10px; } .btn.primary { letter-spacing: .04em; } }

/* ---------- Inputs panel, round 2: key figures, menu summaries, steppers, presets, tooltips ---------- */
.keys { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.keys > div { padding: 10px 14px; border-right: 1px solid var(--line); min-width: 0; }
.keys > div:last-child { border-right: 0; }
.keys span { display: block; font: 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.keys b { display: block; margin-top: 2px; font: 600 17px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 901px) {
  #view:not(.dash) .rail > div.keys:not(.rtabs):not(.rail-foot) { grid-column: 1 / -1; grid-row: 1; }
  #view:not(.dash) .rail:has(> .keys) { grid-template-rows: auto 1fr auto; }
  #view:not(.dash) .rail:has(> .keys) > .rtabs { grid-row: 2; }
  #view:not(.dash) .rail:has(> .keys) > div:not(.rtabs):not(.rail-foot):not(.keys) { grid-row: 2; }
  #view:not(.dash) .rail:has(> .keys) > .rail-foot { grid-row: 3; }
  #view:not(.dash) .rail { grid-template-columns: 150px minmax(0, 1fr); }
  #view:not(.dash) .rail > .rtabs [role="tab"] { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .rtabs [role="tab"]::after { content: attr(data-sum); display: block; margin-top: 1px; font: 400 10.5px var(--mono); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.rtabs [role="tab"].chg::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.f > label { display: flex; align-items: center; gap: 6px; }
.f.changed > label::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.reset { margin-left: auto; border: 0; background: none; padding: 0; font: 11px var(--mono); color: var(--accent); cursor: pointer; }
.reset[hidden] { display: none; }
.htip { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; width: 16px; height: 16px; border: 1px solid var(--line-2); border-radius: 50%; font: 500 10.5px var(--font); color: var(--ink-3); cursor: help; }
.htip::before { content: "?"; }
.htip:hover, .htip:focus { color: var(--ink); border-color: var(--accent); outline: 0; }
.htip:hover::after, .htip:focus::after { content: attr(data-t); position: absolute; left: -8px; top: 22px; z-index: 20; width: 240px; max-width: 70vw; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--sticky); box-shadow: var(--shadow-lg); font: 400 12px/1.45 var(--font); color: var(--ink-2); text-align: left; white-space: normal; }
.stp { display: flex; align-self: stretch; margin: 0 -10px 0 2px; border-left: 1px solid var(--line); }
.stp button { width: 30px; border: 0; background: none; color: var(--ink-2); font-size: 16px; line-height: 1; cursor: pointer; }
.stp button:hover { background: var(--surface-3); color: var(--ink); }
.stp button:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.chips[hidden] { display: none; }
.chip { border: 1px solid var(--line-2); border-radius: 99px; background: none; padding: 2px 10px; font: 12px var(--mono); color: var(--ink-2); cursor: pointer; }
.chip:hover { background: var(--accent-soft); color: var(--ink); }
.impact { margin-top: 2px; padding: 5px 10px; border: 1px dashed var(--line-2); border-radius: 8px; font: 12px var(--mono); color: var(--ink-2); }
.impact b.g { color: var(--good); } .impact b.b { color: var(--bad); }
.row .stp { display: none; }   /* two fields side by side are too narrow for steppers */

/* ---------- Income sources: compact rows with a total strip ---------- */
.lstrip { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.lt-label { font: 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.lt-big { font: 600 20px var(--mono); }
.lt-big small { font: 400 12px var(--mono); color: var(--ink-3); }
.lt-bar { display: flex; height: 8px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: var(--track); }
.lt-bar i { display: block; height: 100%; }
.lt-leg { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font: 11px var(--mono); color: var(--ink-2); }
.lt-leg span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--c); }
.lrow.lsrc { gap: 6px; padding: 8px 10px; border-left: 3px solid var(--c); }
.lsrc-top { display: flex; align-items: center; gap: 8px; }
.lsrc-nm { flex: 1; min-width: 0; }
.lsrc-nm .in { background: none; border-color: transparent; padding-left: 0; }
.lsrc-nm .in:hover, .lsrc-nm .in:focus-within { border-color: var(--line-2); padding-left: 10px; }
.lsrc-nm input { font-weight: 600; }
.lsrc .lx { width: 26px; height: 26px; font-size: 16px; }
.lsrc-kind { flex: 0 0 46%; min-width: 0; }
.lsrc-kind select { font-size: 12.5px; padding-left: 6px; padding-right: 18px; }
.lsrc-nm { min-width: 7em; }
.lsrc-mid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lsrc-mid .in { padding-right: 0; }
.lsrc-mid input { text-align: right; }
.lsrc-mid .lcur { width: auto; flex: none; height: 100%; border-left: 1px solid var(--line); background: var(--surface-3); padding: 0 4px; font: 500 12.5px var(--mono); }
.lsrc-mid .ltag { flex: none; align-self: stretch; display: grid; place-items: center; padding: 0 8px; border-left: 1px solid var(--line); background: var(--surface-3); font: 500 12.5px var(--mono); color: var(--ink-3); }
.lsrc-eq { font: 11.5px var(--mono); color: var(--ink-3); }

/* ---------- small two-way switch in a card head ---------- */
.seg-mini { display: inline-flex; margin-left: auto; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg-mini button { border: 0; background: none; padding: 4px 10px; font: 11.5px var(--mono); color: var(--ink-2); cursor: pointer; }
.seg-mini button + button { border-left: 1px solid var(--line-2); }
.seg-mini button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------- Buckets: four cards under a live bar ---------- */
.bkts { display: grid; gap: 8px; }
.bk-strip { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.bk-lab { font: 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.bk-bar { display: flex; height: 22px; margin-top: 6px; overflow: hidden; border-radius: 6px; background: var(--track); }
.bk-bar i { display: grid; place-items: center; min-width: 0; overflow: hidden; font: 600 11px var(--mono); color: var(--accent-ink); transition: width .15s; }
.bk-chk { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font: 11.5px var(--mono); color: var(--ink-3); }
.bk-chk b.ok { color: var(--good); } .bk-chk b.no { color: var(--warn); }
.bk-ord { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 8px; font: 11.5px var(--mono); color: var(--ink-2); }
.bk-ord span { padding: 1px 9px; border: 1px solid var(--line-2); border-radius: 99px; }
.bk-ord span.dashed { border-style: dashed; }
.bk-ord em { font-style: normal; color: var(--ink-3); }
.bk-card { padding: 8px 10px; border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: var(--r-sm); background: var(--surface-2); }
.bk-top { display: flex; align-items: center; gap: 8px; }
.bk-who { flex: 1; min-width: 0; display: grid; }
.bk-nm .in { background: none; border-color: transparent; padding-left: 0; }
.bk-nm .in:hover, .bk-nm .in:focus-within { border-color: var(--line-2); padding-left: 10px; }
.bk-nm input { font-weight: 600; }
.bk-tag { margin-top: -2px; font: 10.5px var(--mono); color: var(--ink-3); white-space: nowrap; }
.bk-val { flex: none; width: 104px; }
.bk-val input { text-align: right; }
.bk-val.bk-amt { width: 158px; }   /* a full amount such as ₹3,00,00,000 needs room */
.bk-val[hidden], .bk-row[hidden] { display: none; }
.bk-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 6px; font: 12px var(--mono); color: var(--ink-2); }
.bk-row b { grid-column: 2 / -1; color: var(--ink); font-weight: 600; }
.bk-row .in { width: 78px; height: 30px; }
.bk-row .in input { text-align: right; }
.bk-row .rng { margin: 0; }
.bk-more { margin-top: 6px; padding: 0; border: 0; background: none; font: 11.5px var(--mono); color: var(--accent); cursor: pointer; }
.bk-rates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.bk-rates[hidden] { display: none; }
.bk-rates label { font-size: 10.5px; }

/* ---------- Settings: shared exchange rates and the Savings Tracker rows ---------- */
.set-rates { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 10px; background: var(--surface-2); }
.set-rates summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.rate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; margin: 8px 0; }
.rate { display: flex; align-items: center; gap: 6px; font: 12px var(--mono); color: var(--ink-2); }
.rate .in { flex: 1; height: 30px; }
.rate.typed .in { border-color: var(--accent); }
.rate-act { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.rate-act [hidden] { display: none; }
.set-sub { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.srow.wrap { flex-wrap: wrap; justify-content: flex-start; }
.btn.danger { color: var(--bad); border-color: var(--bad); }

/* Savings Tracker rows in Settings: a quiet block with room between its parts */
.set-block { display: grid; gap: 12px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.set-block .set-sub { margin: 0; padding: 0; border: 0; }
.sv-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-btns .btn { justify-content: center; white-space: nowrap; line-height: 1.2; padding: 8px 14px; }
.set-block .hint { margin: -4px 0 0; }
.sv-del { justify-self: start; color: var(--ink-3); font-size: 12px; }
.sv-del:hover { color: var(--bad); }
.f-inline > label:has(.htip) { overflow: visible; }   /* so the tooltip is not clipped */
.f-inline > label:has(.htip) > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A single setting that stands apart from the fields around it */
.fcard { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.fcard.f-inline { grid-template-columns: auto 84px minmax(40px, 1fr); }
.fcard.f-inline > label:has(.htip) > span:first-child { overflow: visible; }

/* Inputs panel (side by side): the key figures, the menu and the Reset row stay put and only the section scrolls.
   When it reaches its end the page takes over, so the scroll never gets stuck. */
@media (min-width: 901px) {
  #view:not(.dash) .rail { overflow: hidden; overscroll-behavior: auto; grid-template-rows: minmax(0, 1fr) auto; }
  #view:not(.dash) .rail:has(> .keys) { grid-template-rows: auto minmax(0, 1fr) auto; }
  #view:not(.dash) .rail > .rtabs { overflow-y: auto; min-height: 0; }
  #view:not(.dash) .rail > div:not(.rtabs):not(.rail-foot):not(.keys) { overflow-y: auto; min-height: 0; overscroll-behavior: auto; scrollbar-width: thin; }
}
/* ... without the scrollbar: it is hidden, and the bottom edge fades instead (the padding keeps the last line clear of the fade) */
@media (min-width: 901px) {
  #view:not(.dash) .rail > div:not(.rtabs):not(.rail-foot):not(.keys), #view:not(.dash) .rail > .rtabs { scrollbar-width: none; }
  #view:not(.dash) .rail > div:not(.rtabs):not(.rail-foot):not(.keys)::-webkit-scrollbar, #view:not(.dash) .rail > .rtabs::-webkit-scrollbar { display: none; }
  #view:not(.dash) .rail > div:not(.rtabs):not(.rail-foot):not(.keys) { padding-bottom: 22px; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); }
}
.dash .rail > .keys { display: none; }   /* the dashboard already shows the key results above the inputs */
.dash .sec > .bkts { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash .bkts > .bk-strip, .dash .bkts > .segf { grid-column: 1 / -1; }

/* ---------- Income Target: compare and year views ---------- */
.inc-cmp-t th:first-child, .inc-year-t th:first-child { text-align: left; white-space: nowrap; }
.inc-cmp-t tr.tot td, .inc-cmp-t tr.tot th, .inc-year-t tr.tot td, .inc-year-t tr.tot th { border-top: 1px solid var(--line-2); }
.inc-year-t { min-width: 940px; font-size: 12.5px; }
.inc-year-t th, .inc-year-t td { padding: 5px 8px; white-space: nowrap; }
.inc-year-t tr.grp th { padding-top: 10px; font: 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); background: none; }
.inc-year-t th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; font-weight: 500; }
.inc-cmp-t td.pos { color: var(--good); } .inc-cmp-t td.neg, .inc-year-t td.neg { color: var(--bad); }
[data-cmp-card][hidden] { display: none; }
/* The target card used to stay on screen while you scrolled; with more cards below it, it would sit on top of them */
@media (min-width: 901px) { #view .grid:not(.rail-off) .results > .inc-total { position: relative; top: auto; } }   /* not sticky, but still the anchor of its corner brackets: with `static` they were sized to the whole page, which made the page 1px too wide (a sideways scrollbar) */

/* ---------- Income Target: saved-scenario compare and the budget tracker ---------- */
.cmp-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cmp-pick .hint { margin: 0; }
.cmp-pick .chip { border: 1px solid var(--line-2); border-radius: 99px; background: none; padding: 3px 12px; font: 12px var(--mono); color: var(--ink-2); cursor: pointer; }
.cmp-pick .chip.on { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------- Budget Tracker (its own tool) ---------- */
.bgt { display: grid; gap: 14px; max-width: 1040px; margin: 0 auto; }
.bgt-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bgt h1 { margin: 0 0 4px; font-size: 24px; }
.bgt-lede { margin: 0; max-width: 640px; color: var(--ink-2); }
.bgt-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.bgt-mnav { display: flex; align-items: center; gap: 8px; }
.bgt-mnav b { min-width: 150px; text-align: center; font-size: 16px; }
.bgt-mnav .linkbtn { margin-left: 4px; }
.bgt-bar .seg-mini { margin-left: auto; }
.bgt-strip { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; margin-bottom: 14px; }
.bgt-strip .bm { border: 1px solid var(--line); border-radius: 6px; background: none; padding: 6px 0; font: 11px var(--mono); color: var(--ink-3); cursor: pointer; }
.bgt-strip .bm.ok { color: var(--ink); border-color: var(--good); }
.bgt-strip .bm.over { color: var(--ink); border-color: var(--bad); }
.bgt-strip .bm.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); color: var(--ink); }
.bgt-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { padding: 12px 14px; }
.kpi b { display: block; margin-top: 2px; font: 600 20px var(--mono); }
.kpi small { color: var(--ink-3); }
.kpi .meter { height: 6px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: var(--track); }
.kpi .meter i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.kpi .meter i.over { background: var(--bad); }
.bgt .pos { color: var(--good); } .bgt .neg { color: var(--bad); }
.bgt-t, .bgt-y { width: 100%; border-collapse: collapse; }
.bgt-t th, .bgt-t td, .bgt-y th, .bgt-y td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bgt-t th:first-child, .bgt-t td:first-child, .bgt-y th:first-child { text-align: left; }
.bgt-t th:first-child, .bgt-y tbody th { font-weight: 500; }
.bgt-t thead th, .bgt-y thead th { font: 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.bgt-t tr.grp th, .bgt-y tr.grp th { padding-top: 14px; border: 0; text-align: left; font: 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.bgt-t th small, .bgt-y th small { color: var(--ink-3); font-weight: 400; }
.bgt-in { width: 112px; height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink); font: 600 13px var(--mono); text-align: right; }
.bgt-in:focus, .bgt-nm:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bgt-nm { width: 100%; min-width: 120px; height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink); font: 500 13px var(--font); }
.bgt-src { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 8px; color: var(--ink-2); font-size: 13px; }
.bgt-src a { color: var(--accent); }
.bgt-src .btn { margin-left: auto; }
.bgt-grid { max-width: 100%; }
.bgt-y { min-width: 980px; font-size: 12.5px; }
.bgt-y th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.bgt-y .mcol { cursor: pointer; }
.bgt-y td { cursor: pointer; }
.bgt-y td.cur { background: var(--accent-soft); }
.bgt-y td.na { color: var(--ink-3); }
.bgt-y tr.tot th, .bgt-y tr.tot td { border-top: 2px solid var(--line-2); font-weight: 700; }
.bgt-note { margin: 10px 0 0; color: var(--ink-3); font-size: 12px; }
@media (max-width: 760px) { .bgt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bgt-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.bgt .table-scroll { max-height: none; overflow-y: visible; }
.bgt-t tbody th, .bgt-y tbody th { text-transform: none; letter-spacing: 0; font: 500 13.5px var(--font); color: var(--ink); background: none; }
.bgt-y tbody th { background: var(--surface); }
.bgt-t tr.grp th, .bgt-y tr.grp th { background: none; }

/* ---------- Quiet colour that means something: a hue per tool, status on goals, budget rows ---------- */
[data-tool="scenario"] { --h: var(--c-2); } [data-tool="income"] { --h: var(--c-4); } [data-tool="savings"] { --h: var(--c-3); } [data-tool="budget"] { --h: var(--c-1); }
.lp-tool[data-tool] { background: linear-gradient(180deg, color-mix(in srgb, var(--h) 9%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--h) 28%, var(--line)); border-top: 3px solid color-mix(in srgb, var(--h) 70%, transparent); }
.lp-tool[data-tool] svg { color: var(--ink); background: color-mix(in srgb, var(--h) 18%, transparent); width: 34px; height: 34px; padding: 6px; border-radius: 9px; box-sizing: border-box; }
.lp-tool[data-tool]:hover { border-color: var(--h); border-top-color: var(--h); }
.bar-nav a[data-tool][aria-current="page"] { background: color-mix(in srgb, var(--h) 10%, var(--surface-2)); box-shadow: inset 0 0 0 1px var(--h); }
.dock a[data-tool][aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--h) 14%, transparent); }
.dock a[data-tool][aria-current="page"] svg { color: var(--h); }
.bgt-t tbody tr:has([data-diff] .pos) > * { background: color-mix(in srgb, var(--good) 8%, transparent); }
.bgt-t tbody tr:has([data-diff] .neg) > * { background: color-mix(in srgb, var(--bad) 9%, transparent); }
.bgt-t tr.grp th, .bgt-y tr.grp th { border-left: 3px solid var(--c-2); padding-left: 8px; }

/* The rule-of-thumb check is a tinted panel, so a shortfall is noticed: amber-red when short, green when ahead */
.verdict .rule-sec.rs-short, .verdict .rule-sec.rs-ok { --rs: var(--bad); border: 1px solid color-mix(in srgb, var(--rs) 22%, var(--line)); border-left: 3px solid color-mix(in srgb, var(--rs) 70%, transparent); border-radius: 10px; padding: 14px 16px; background: color-mix(in srgb, var(--rs) 4.5%, var(--surface)); }
.verdict .rule-sec.rs-ok { --rs: var(--good); }
.rule-more { margin: 8px 0 0; font-size: 14px; line-height: 1.6; }

/* ---------- FIRE numbers card ---------- */
.fire-rate { display: inline-flex; margin-left: 10px; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.fire-rate button { border: 0; background: none; padding: 4px 10px; font: 11.5px var(--mono); color: var(--ink-2); cursor: pointer; }
.fire-rate button + button { border-left: 1px solid var(--line-2); }
.fire-rate button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
.fire-card .card-head .legend { display: flex; align-items: center; gap: 4px; }
.fire-big { font: 650 38px/1.1 var(--font); letter-spacing: -.02em; } .fire-big small { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.fire-sub { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.fbar { position: relative; height: 10px; border-radius: 5px; background: var(--surface-3); margin: 40px 10px 46px; }
.fbar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.fbar .mk { position: absolute; top: -8px; height: 26px; border-left: 2px solid var(--line-2); } .fbar .mk.on { border-color: var(--accent); }
.fbar .mk span { position: absolute; top: -22px; left: 0; transform: translateX(-50%); font: 600 11px var(--font); white-space: nowrap; }
.fbar .mk em { position: absolute; top: 30px; left: 0; transform: translateX(-50%); font: normal 10.5px var(--mono); color: var(--ink-3); white-space: nowrap; }
.fbar .mk.last span, .fbar .mk.last em { transform: translateX(-100%); }
.fbar .you { position: absolute; top: -5px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg-2); border: 3px solid var(--accent); transform: translateX(-50%); }
.fire-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.fire-stats > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fire-stats span { display: block; font: 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.fire-stats b { display: block; font-size: 19px; margin-top: 2px; } .fire-stats small { display: block; color: var(--ink-2); font-size: 12px; margin-top: 1px; }
.fire-note { margin: 0 0 12px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--warn) 9%, transparent); font-size: 13.5px; }
.fire-note.ok { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); background: color-mix(in srgb, var(--good) 8%, transparent); }
.fire-t { width: 100%; border-collapse: collapse; font-size: 13.5px; } .fire-t th, .fire-t td { padding: 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; } .fire-t th:first-child, .fire-t td:first-child { text-align: left; }
.fire-t thead th { font: 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.fire-t tbody th { font: 500 13.5px var(--font); letter-spacing: 0; text-transform: none; color: var(--ink); background: none; }
.fire-t tr.mine > * { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.fire-fine { margin: 10px 0 0; color: var(--ink-3); font-size: 12.5px; }
@media (max-width: 760px) { .fire-stats { grid-template-columns: 1fr 1fr; } .fire-big { font-size: 30px; } }
.fire-card .table-scroll { max-height: none; overflow-y: visible; }
@media (max-width: 760px) { .fire-t th:nth-child(2), .fire-t td:nth-child(2) { display: none; } .fire-t th, .fire-t td { padding: 8px 6px; } }
.phase-line .pl { flex: 0 0 100%; }
.bgt-exp { display: flex; gap: 8px; flex-wrap: wrap; }
/* The style table fits the card whatever its width: the draw column goes when it is narrow, and there is no sideways scroll line under it */
.fire-card { container-type: inline-size; }
.fire-card .table-scroll { overflow: visible; }
@container (max-width: 560px) { .fire-t th:nth-child(2), .fire-t td:nth-child(2) { display: none; } .fire-t th, .fire-t td { padding: 8px 6px; } .fire-stats { grid-template-columns: 1fr 1fr; } }
.fire-card .table-scroll { margin: 0 0 12px; border-top: 0; }

/* Home (dashboard): one line from each tool, and what needs a look first */
.hm { display: grid; gap: 14px; max-width: 1120px; margin: 0 auto; padding: 4px 0 24px; }
.hm h1 { font-family: var(--font-display); font-size: 26px; letter-spacing: -.01em; margin: 0 0 4px; }
.hm-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.hm-sub { color: var(--ink-2); font-size: 13px; margin: 0; }
.hm-mono { font: 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.hm a.card { color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 10px; }
.hm-hero { flex-direction: row !important; align-items: center; gap: 18px !important; border-left: 3px solid var(--c-2) !important; }
.hm-hero > div:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 4px; }
.hm-ring { flex: 0 0 auto; width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(var(--good) calc(var(--p) * 1%), var(--track) 0); display: grid; place-items: center; }
.hm-ring span { width: 64px; height: 64px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; font: 650 18px var(--font); }
.hm-big { font: 650 28px/1.15 var(--font); letter-spacing: -.02em; }
.hm-big small { font-size: 14px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.hm-none { color: var(--ink-3); font-size: 20px; }
.hm-sec { margin: 10px 0 -4px; font: 11.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.hm-sec::before { content: "// "; color: var(--accent); }
.hm-attn { display: grid; gap: 8px; }
.hm-attn a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-left: 3px solid var(--c-3); border-radius: 10px; background: color-mix(in srgb, var(--c-3) 6%, var(--surface)); color: inherit; text-decoration: none; }
.hm-attn a.good { border-left-color: var(--good); background: color-mix(in srgb, var(--good) 5%, var(--surface)); }
.hm-attn .pill { flex: 0 0 auto; }
.hm-to { margin-left: auto; padding-left: 8px; color: var(--ink-3); font: 11px var(--mono); white-space: nowrap; }
.hm-clear { padding: 2px 0; }
.hm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hm-tile { border-left: 3px solid var(--h, var(--accent)) !important; }
.hm-tile:hover { border-color: var(--h, var(--accent)) !important; }
.hm-h { display: flex; justify-content: space-between; font: 11.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.hm-h b { color: var(--h, var(--accent)); font-weight: 600; }
.hm-h b::before { content: "// "; }
.hm-bar { height: 8px; border-radius: 4px; background: var(--surface-3); position: relative; overflow: hidden; }
.hm-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--h, var(--accent)); }
.hm-bar.two i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.hm-bar.over i { background: var(--bad); }
.hm-mini { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hm-mini li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.hm-mini li span:last-child { color: var(--ink-2); }
.hm-go { margin-top: auto; font: 600 12px var(--mono); color: var(--h, var(--accent)); }
.hm-fine { color: var(--ink-3); font-size: 12px; margin: 4px 0 0; }
@media (max-width: 980px) { .hm-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .hm-grid { grid-template-columns: 1fr; } .hm-hero { flex-wrap: wrap; } .hm-big { font-size: 24px; } }
.hm .pill.warn { background: color-mix(in srgb, var(--c-3) 14%, transparent); color: var(--c-3); }
@media (max-width: 640px) { .hm-hero { flex-direction: column !important; align-items: flex-start !important; } .hm-hero > div:nth-child(2) { width: 100%; } .hm-attn a { flex-wrap: wrap; } .hm-attn a > span:nth-child(2) { flex: 1 1 60%; } }

/* Seven dock items on a small phone: a touch smaller so "Retirement" fits its slot */
@media (max-width: 420px) { .dock a, .dock button { font-size: 9px; letter-spacing: -.01em; padding: 6px 0; } .dock { left: 6px; right: 6px; padding: 5px 3px; } }

/* Stacked layout (phones and tablets): the pinned tab strip must be solid, or the card text shows through it as it scrolls underneath */
@media (max-width: 900px) { #view:not(.dash) .rail > .rtabs { background: var(--sticky); top: var(--bar-h, 56px); } }

.toast.show:has(.toast-undo) { pointer-events: auto; }
.toast-undo { font: inherit; font-weight: 700; margin-left: 10px; padding: 2px 10px; border-radius: 8px; border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; }
.toast-undo:hover { background: color-mix(in srgb, currentColor 15%, transparent); }

.hm-backup { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: 0 0 14px; padding: 10px 14px; border-radius: var(--r-sm, 10px); border: 1px solid var(--line-2); border-left: 4px solid var(--warn); background: var(--surface); font-size: 13.5px; }
.hm-backup-act { display: flex; gap: 8px; flex-wrap: wrap; }
.scen-io { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---- Canvas: a second view of the Retirement plan (js/ui/canvas-india.js). The inputs rail becomes its drawer. ---- */
.canvas { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
.mode-sw { margin-right: 6px; }
.cv-on .grid > .results { display: none; }
.cv-on .grid.grid.grid.grid { grid-template-columns: minmax(0, 1fr) !important; }
.cv-on .grid > .rail-tab { display: none !important; }
.cv-on .grid > .canvas { grid-column: 1; grid-row: 1; }
.cv-on:not(.cv-drawer) .grid > .rail { display: none !important; }
.cv-on.cv-drawer .grid.grid.grid.grid { grid-template-columns: minmax(0, 1fr) clamp(360px, 34vw, 460px) !important; }
.cv-on.cv-drawer .grid > .rail { display: block !important; grid-column: 2; grid-row: 1; }
@media (max-width: 900px) {
  .cv-on.cv-drawer .grid.grid.grid.grid { grid-template-columns: minmax(0, 1fr) !important; }
  .cv-on.cv-drawer .grid > .rail { grid-column: 1; grid-row: 2; }
}
.cv { display: grid; gap: 14px; }
.cv-view { align-items: center; }
.cv-sent { margin: 0; font-size: 19px; line-height: 2.1; }
.cv-f { display: inline-flex; align-items: baseline; border-bottom: 2px solid var(--line-2); padding: 0 5px; margin: 0 1px; font-weight: 600; background: var(--surface-3); border-radius: 6px 6px 0 0; }
.cv-f:focus-within { border-bottom-color: var(--accent); }
.cv-f input { border: 0; background: transparent; padding: 0; font: inherit; text-align: center; height: auto; min-height: 0; width: auto; outline: none; box-shadow: none; color: inherit; }
.cv-f .u { font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 0 1px; }
.cv-verdict { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; }
.cv-big { font: 750 clamp(30px, 5vw, 46px)/1.1 var(--font-display); letter-spacing: -.02em; }
.cv-big.good { color: var(--good); } .cv-big.warn { color: var(--warn); } .cv-big.bad { color: var(--bad); }
.cv-why { margin: 0; flex: 1 1 280px; color: var(--ink-2); font-size: 14px; }
.cv-svg { width: 100%; height: auto; display: block; touch-action: none; }
.cv-svg .t { fill: var(--ink-3); font: 10.5px var(--mono); }
.cv-svg .g { stroke: var(--grid); stroke-width: 1; }
.cv-svg .cv-save { fill: var(--surface-3); opacity: .55; }
.cv-svg .cv-line { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.cv-svg .cv-crash { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 1 3; opacity: .85; }
.cv-svg .cv-crashtxt { fill: var(--bad); }
.cv-svg .cv-flag { cursor: ew-resize; outline: none; }
.cv-svg .cv-flag:focus-visible rect:first-of-type { stroke: var(--ink); stroke-width: 2; }
.cv-svg .cv-flagtxt { fill: #fff; font: 600 11px var(--mono); }
.cv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.cv-tiles > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; }
.cv-tiles small { display: block; color: var(--ink-3); font-size: 11px; }
.cv-tiles b { font-size: 17px; font-weight: 600; }
.cv-bar { display: flex; height: 28px; border-radius: 8px; overflow: hidden; gap: 2px; }
.cv-bar span { display: flex; align-items: center; justify-content: center; color: #fff; font: 600 11.5px var(--mono); min-width: 0; overflow: hidden; }
.cv-bkl { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.cv-bkl i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.cv-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cv-chart .us-fine .us-chip { padding: 2px 9px; font-size: 11.5px; }
@media (max-width: 560px) { .cv-sent { font-size: 17px; } .cv-svg .t { font-size: 11px; } }

/* ---- Canvas, compact on a wide canvas: the sentence beside the verdict, the chart beside the fixes, figures and buckets ---- */
.canvas { container-type: inline-size; }
.cv { gap: 10px; }
.cv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cv-head, .cv-body, .cv-main, .cv-side { display: grid; gap: 10px; min-width: 0; align-content: start; }
.cv-sent { font-size: 17px; line-height: 2; }
.cv-big { font-size: clamp(28px, 4vw, 38px); }
.cv-why { font-size: 13px; }
.cv-chart .card-head { flex-wrap: wrap; gap: 6px; }
.cv-chart .card-head .us-chips { gap: 6px; }
.cv-buckets { padding: 12px 14px; }
.cv-buckets .card-head { margin-bottom: 8px; }
.cv-bar { height: 24px; }
.cv-bkl { margin-top: 6px; font-size: 12px; gap: 2px 12px; }
.cv-side .us-fix { padding: 12px 14px; }
.cv-side .us-fixgrid { grid-template-columns: 1fr; gap: 6px; }
.cv-side .us-fixcard { grid-template-columns: 1fr auto; align-items: center; gap: 0 10px; padding: 7px 10px; }
.cv-side .us-fixcard p { display: none; }
.cv-side .us-fixcard .btn { grid-row: 1 / span 2; grid-column: 2; }
.cv-side .us-fix .us-fine { margin-top: 6px; }
@container (min-width: 780px) {
  .cv-head { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: center; gap: 20px; }
  .cv-verdict { flex-direction: column; align-items: flex-start; gap: 2px; }
  .cv-why { flex: 0 0 auto; }
  .cv-body { grid-template-columns: minmax(0, 1.65fr) minmax(250px, 1fr); align-items: start; }
  .cv-tiles { grid-template-columns: 1fr; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px 12px; }
  .cv-tiles > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 6px 0; }
  .cv-tiles > div:last-child { border-bottom: 0; }
  .cv-tiles small { display: inline; font-size: 12.5px; }
  .cv-tiles b { font-size: 15px; }
}
@container (max-width: 779px) { .cv-tiles { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); } }
.cv-chart .card-head .us-chips, .cv-chart .card-head [data-cv-lines] { align-items: center; }

/* ---- Canvas polish: a verdict panel, softer fields, the headroom meter and the hover figures ---- */
.cv-head { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--r, 14px); padding: 12px 16px; }
.cv-head.good { border-left-color: var(--good); } .cv-head.warn { border-left-color: var(--warn); } .cv-head.bad { border-left-color: var(--bad); }
.cv-big::before { content: ''; display: inline-flex; align-items: center; justify-content: center; width: .8em; height: .8em; margin-right: .3em; border-radius: 50%; font: 700 .52em/1 var(--font); color: #fff; vertical-align: .14em; }
.cv-big.good::before { content: '\2713'; background: var(--good); } .cv-big.warn::before { content: '!'; background: var(--warn); } .cv-big.bad::before { content: '\00D7'; background: var(--bad); }
.cv-f { background: var(--accent-soft); border-bottom-color: color-mix(in srgb, var(--accent) 35%, var(--line-2)); transition: border-color .15s, background .15s; }
.cv-f:hover { border-bottom-color: var(--accent); }
.cv-f:focus-within { background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.cv-plot { position: relative; }
.cv-svg .cv-area { stroke: none; }
.cv-svg .cv-end { stroke: var(--surface); stroke-width: 2; }
.cv-svg .cv-endlab { fill: var(--ink); font-weight: 600; }
.cv-svg .cv-hline { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.cv-svg .cv-hdot { stroke: var(--surface); stroke-width: 2; }
.cv-tip { position: absolute; top: 6px; z-index: 2; pointer-events: none; min-width: 128px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 10px; font-size: 12px; box-shadow: 0 8px 22px rgba(0, 0, 0, .18); }
.cv-tip.left { transform: translateX(-100%); }
.cv-tip b { display: block; margin-bottom: 2px; font-weight: 600; }
.cv-tip div { display: flex; justify-content: space-between; gap: 14px; color: var(--ink-2); line-height: 1.5; }
.cv-tip div b { display: inline; margin: 0; color: var(--ink); font-family: var(--mono); font-weight: 600; }
.cv-tip i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.cv-meter { padding: 12px 14px; }
.cv-meter .card-head { margin-bottom: 18px; }
.cv-mbar { position: relative; display: flex; height: 12px; border-radius: 6px; margin: 0 0 6px; gap: 2px; }
.cv-mbar i { display: block; height: 100%; opacity: .85; }
.cv-mbar .z1 { background: var(--good); border-radius: 6px 0 0 6px; } .cv-mbar .z2 { background: var(--warn); } .cv-mbar .z3 { background: var(--bad); border-radius: 0 6px 6px 0; }
.cv-mbar i:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.cv-mbar .mk { position: absolute; top: -5px; height: 22px; width: 0; border-left: 2px solid var(--ink); }
.cv-mbar .mk em { position: absolute; bottom: calc(100% + 2px); left: 0; transform: translateX(-50%); font: 600 11px var(--mono); font-style: normal; background: var(--ink); color: var(--bg); padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
.cv-mscale { position: relative; height: 26px; font: 10.5px var(--mono); color: var(--ink-3); }
.cv-mscale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.cv-meter .us-fine { margin: 0; }

.cv-nw { white-space: nowrap; }
.cv-f { padding: 0 8px; }
.cv-f input { min-width: 0; text-align: center; }

/* ---- Canvas has its own look: one calm stage, no card chrome, sentence-case type, a quiet side column ---- */
@keyframes cv-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.cv-on .canvas { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: clamp(18px, 3vw, 34px); animation: cv-in .3s ease both; overflow: hidden; }
.cv-on .canvas::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(820px 240px at 10% -8%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%); }
.canvas > * { position: relative; }
@media (prefers-reduced-motion: reduce) { .cv-on .canvas { animation: none; } }
.canvas .card { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; }
.canvas .card::before, .canvas .card::after { display: none; }
.canvas .card h3, .canvas .card-head h3 { font: 650 14.5px/1.3 var(--font); letter-spacing: 0; text-transform: none; color: var(--ink); }
.canvas .card-head h3::before { content: none; }
.canvas .card-head { margin-bottom: 10px; }
.canvas .us-fine { color: var(--ink-3); }
.cv { gap: 22px; }
.cv-head { background: none; border: 0; padding: 0; gap: 8px 28px; }
.cv-sent { font: 450 clamp(20px, 2.1vw, 26px)/2.05 var(--font-display); letter-spacing: -.01em; }
.cv-f .u { font-size: .62em; }
.cv-big { font-size: clamp(34px, 4.6vw, 54px); }
.cv-why { font-size: 14.5px; line-height: 1.5; max-width: 52ch; }
.cv-view .us-chip-label { letter-spacing: .08em; }
.cv-svg .g { opacity: .55; }
.cv-body { gap: 26px; }
.cv-side { gap: 18px; border-left: 1px solid var(--line); padding-left: clamp(14px, 2vw, 26px); }
.cv-tiles { background: none; border: 0; padding: 0; }
.cv-tiles > div { background: none; border-radius: 0; }
.cv-side .us-fixcard { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 0; }
.cv-side .us-fixcard:last-child { border-bottom: 0; }
.cv-meter, .cv-buckets { padding: 0; }
@container (max-width: 779px) { .cv-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 18px; } }

/* ======== Canvas looks (js/lib/looks.js): Friendly and Editorial. The Canvas carries data-look and data-tone (day | night). ======== */
.cv-kick, .cv-hello, .cv-note { display: none; }
.canvas[data-look="friendly"] {
  --cv-bg: #EEF3FF; --cv-card: #FFFFFF; --cv-ink: #17233B; --cv-ink2: #4A5B7C; --cv-mute: #7487AD; --cv-rule: #DCE5FA; --cv-accent: #2B4DD8; --cv-on: #FFFFFF;
  --cv-fbg: #FFFFFF; --cv-fline: #C9D7FF; --cv-fink: #2B4DD8; --cv-good: #0F5A37; --cv-goodbg: #D9F6E6; --cv-warn: #7A4D00; --cv-warnbg: #FCEFD3; --cv-bad: #8A2020; --cv-badbg: #FBE0E0;
  --cv-l-mine: #2B4DD8; --cv-l-a: #7F77DD; --cv-l-sweet: #2BA86B; --cv-l-d: #E0A02B; --cv-flag: #2B4DD8; --cv-flag2: #6B7A99; --cv-z1: #5CD08F; --cv-z2: #F6C453; --cv-z3: #F68A8A; --cv-t1: #FFE9D6; --cv-t2: #E8E1FF; --cv-t3: #D9F1FF;
}
.canvas[data-look="friendly"][data-tone="night"] {
  --cv-bg: #111A30; --cv-card: #1A2543; --cv-ink: #E8EEFF; --cv-ink2: #AAB8DB; --cv-mute: #7F90BA; --cv-rule: #2A3860; --cv-accent: #8FA8FF; --cv-on: #0E1630;
  --cv-fbg: #222F54; --cv-fline: #3A4C80; --cv-fink: #B4C4FF; --cv-good: #7FE0AB; --cv-goodbg: #163A2A; --cv-warn: #F2C46B; --cv-warnbg: #3A2E12; --cv-bad: #FF9A9A; --cv-badbg: #3E1C1F;
  --cv-l-mine: #8FA8FF; --cv-l-a: #A99CF5; --cv-l-sweet: #55D6A0; --cv-l-d: #EDB75A; --cv-flag: #8FA8FF; --cv-flag2: #8C9BBE; --cv-z1: #3CB87A; --cv-z2: #D9A93A; --cv-z3: #E06A6A; --cv-t1: #3A2D24; --cv-t2: #2E2A4D; --cv-t3: #1F3550;
}
.canvas[data-look="editorial"] {
  --cv-bg: #FAF8F3; --cv-card: transparent; --cv-ink: #1D1B17; --cv-ink2: #5B554A; --cv-mute: #8C8575; --cv-rule: #D9D3C5; --cv-accent: #1F5F4A; --cv-on: #FFFFFF;
  --cv-fbg: transparent; --cv-fline: #1F5F4A; --cv-fink: #1F5F4A; --cv-good: #1F5F4A; --cv-goodbg: transparent; --cv-warn: #8A5A00; --cv-warnbg: transparent; --cv-bad: #A23B2A; --cv-badbg: transparent;
  --cv-l-mine: #1D1B17; --cv-l-a: #8C8575; --cv-l-sweet: #1F5F4A; --cv-l-d: #B07A3A; --cv-flag: #1F5F4A; --cv-flag2: #8C8575; --cv-z1: #1F5F4A; --cv-z2: #C7A24A; --cv-z3: #A23B2A; --cv-serif: Georgia, "Times New Roman", serif;
}
.canvas[data-look="editorial"][data-tone="night"] {
  --cv-bg: #181613; --cv-ink: #EFEBE2; --cv-ink2: #B7B0A2; --cv-mute: #8C8575; --cv-rule: #3A352C; --cv-accent: #7DCBA8; --cv-on: #10231B; --cv-fline: #7DCBA8; --cv-fink: #7DCBA8;
  --cv-good: #7DCBA8; --cv-warn: #E0B45A; --cv-bad: #E58A78; --cv-l-mine: #EFEBE2; --cv-l-a: #8C8575; --cv-l-sweet: #7DCBA8; --cv-l-d: #E0B45A; --cv-flag: #7DCBA8; --cv-flag2: #8C8575; --cv-z1: #5DAE8A; --cv-z2: #C7A24A; --cv-z3: #D07060;
}
/* shared by both looks */
.canvas[data-look] { background: var(--cv-bg); color: var(--cv-ink); border-color: var(--cv-rule); }
.canvas[data-look]::before { display: none; }
.canvas[data-look] .cv-why, .canvas[data-look] .cv-bkl { color: var(--cv-ink2); }
.canvas[data-look] .us-fine { color: var(--cv-mute); }
.canvas[data-look] .card h3, .canvas[data-look] .card-head h3 { color: var(--cv-ink); }
.canvas[data-look] .us-chip { border-color: var(--cv-rule); color: var(--cv-ink); background: transparent; }
.canvas[data-look] .us-chip.on { border-color: var(--cv-accent); background: var(--cv-card); }
.canvas[data-look] .us-chip:hover { border-color: var(--cv-accent); }
.canvas[data-look] .us-chip-label { color: var(--cv-mute); }
.canvas[data-look] .btn { background: transparent; color: var(--cv-ink); border: 1px solid var(--cv-rule); box-shadow: none; text-shadow: none; }
.canvas[data-look] .btn:hover { border-color: var(--cv-accent); }
.canvas[data-look] .cv-top { gap: 8px 14px; }
.canvas[data-look] .cv-top .cv-view { margin-right: auto; }
.canvas[data-look] .cv-f { background: var(--cv-fbg); border-color: var(--cv-fline); color: var(--cv-fink); }
.canvas[data-look] .cv-f input { color: inherit; }
.canvas[data-look] .cv-f .u { color: var(--cv-ink2); }
.canvas[data-look] .cv-f:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--cv-accent) 22%, transparent); background: var(--cv-card); }
.canvas[data-look] .cv-big.good { color: var(--cv-good); } .canvas[data-look] .cv-big.warn { color: var(--cv-warn); } .canvas[data-look] .cv-big.bad { color: var(--cv-bad); }
.canvas[data-look] .cv-svg .t { fill: var(--cv-mute); }
.canvas[data-look] .cv-svg .g { stroke: var(--cv-rule); opacity: 1; }
.canvas[data-look] .cv-svg .cv-save { fill: var(--cv-accent); opacity: .06; }
.canvas[data-look] .cv-svg .cv-endlab { fill: var(--cv-ink); }
.canvas[data-look] .cv-svg .cv-end, .canvas[data-look] .cv-svg .cv-hdot { stroke: var(--cv-bg); }
.canvas[data-look] .cv-svg .cv-hline { stroke: var(--cv-mute); }
.canvas[data-look] .cv-svg .cv-crash { stroke: var(--cv-bad); } .canvas[data-look] .cv-svg .cv-crashtxt { fill: var(--cv-bad); }
.canvas[data-look] .cv-svg .cv-flagtxt { fill: var(--cv-on); }
.canvas[data-look] .cv-tip { background: var(--cv-card); border-color: var(--cv-rule); color: var(--cv-ink); }
.canvas[data-look="editorial"] .cv-tip { background: var(--cv-bg); }
.canvas[data-look] .cv-tip div { color: var(--cv-ink2); } .canvas[data-look] .cv-tip div b { color: var(--cv-ink); }
.canvas[data-look] .cv-tiles small { color: var(--cv-ink2); } .canvas[data-look] .cv-tiles b { color: var(--cv-ink); }
.canvas[data-look] .cv-mbar .z1 { background: var(--cv-z1); } .canvas[data-look] .cv-mbar .z2 { background: var(--cv-z2); } .canvas[data-look] .cv-mbar .z3 { background: var(--cv-z3); }
.canvas[data-look] .cv-mbar .mk { border-color: var(--cv-ink); }
.canvas[data-look] .cv-mbar .mk em { background: var(--cv-ink); color: var(--cv-bg); }
.canvas[data-look] .cv-mscale { color: var(--cv-mute); }
.canvas[data-look] .cv-side { border-left-color: var(--cv-rule); }
.canvas[data-look] .us-fixcard { border-bottom-color: var(--cv-rule); }
.canvas[data-look] .us-fixcard b { color: var(--cv-ink); } .canvas[data-look] .us-fixcard small { color: var(--cv-mute); }
.canvas[data-look] .us-issues { background: var(--cv-warnbg); color: var(--cv-ink); }

/* Friendly: soft colour blocks, chunky pill inputs, big plain answers */
.canvas[data-look="friendly"] { border: 0; border-radius: 28px; }
.canvas[data-look="friendly"] .cv-hello { display: block; grid-column: 1 / -1; margin: 0; color: var(--cv-ink2); font-size: 15px; }
.canvas[data-look="friendly"] .cv-sent { font: 500 clamp(19px, 2vw, 23px)/2.3 var(--font); letter-spacing: 0; }
.canvas[data-look="friendly"] .cv-f { border: 2px solid var(--cv-fline); border-radius: 999px; padding: 1px 14px; font-weight: 700; box-shadow: 0 2px 0 var(--cv-fline); }
.canvas[data-look="friendly"] .cv-head { gap: 8px 20px; }
.canvas[data-look="friendly"] .cv-verdict { background: var(--cv-goodbg); color: var(--cv-good); border-radius: 22px; padding: 16px 20px; align-self: stretch; justify-content: center; }
.canvas[data-look="friendly"] .cv-head.warn .cv-verdict { background: var(--cv-warnbg); color: var(--cv-warn); }
.canvas[data-look="friendly"] .cv-head.bad .cv-verdict { background: var(--cv-badbg); color: var(--cv-bad); }
.canvas[data-look="friendly"] .cv-big { font: 750 clamp(34px, 4vw, 46px)/1.05 var(--font-display); color: inherit !important; }
.canvas[data-look="friendly"] .cv-big::before { display: none; }
.canvas[data-look="friendly"] .cv-lab { display: block; font: 650 13px/1.2 var(--font); letter-spacing: 0; opacity: .85; margin-bottom: 4px; }
.canvas[data-look="friendly"] .cv-why { color: inherit; opacity: .9; font-size: 14px; }
.canvas[data-look="friendly"] .card { background: var(--cv-card); border-radius: 22px; padding: 16px 18px; }
.canvas[data-look="friendly"] .card h3, .canvas[data-look="friendly"] .card-head h3 { font: 700 15px/1.3 var(--font); }
.canvas[data-look="friendly"] .cv-side { border-left: 0; padding-left: 0; gap: 12px; }
.canvas[data-look="friendly"] .cv-tiles { gap: 8px; }
.canvas[data-look="friendly"] .cv-tiles > div { border-radius: 16px; padding: 10px 14px; border: 0; }
.canvas[data-look="friendly"] .cv-tiles > div:nth-child(1) { background: var(--cv-t1); }
.canvas[data-look="friendly"] .cv-tiles > div:nth-child(2) { background: var(--cv-t2); }
.canvas[data-look="friendly"] .cv-tiles > div:nth-child(3) { background: var(--cv-t3); }
.canvas[data-look="friendly"] .cv-mbar { height: 16px; border-radius: 999px; }
.canvas[data-look="friendly"] .cv-mbar i { opacity: 1; }
.canvas[data-look="friendly"] .cv-mbar .z1 { border-radius: 999px 0 0 999px; } .canvas[data-look="friendly"] .cv-mbar .z3 { border-radius: 0 999px 999px 0; }
.canvas[data-look="friendly"] .cv-mbar .mk em { background: var(--cv-accent); color: var(--cv-on); border-radius: 999px; padding: 1px 10px; }
.canvas[data-look="friendly"] .cv-mbar .mk { border-color: var(--cv-accent); }
.canvas[data-look="friendly"] .us-fixcard { background: var(--cv-bg); border: 0; border-radius: 14px; padding: 9px 12px; }
.canvas[data-look="friendly"] .us-fixgrid { gap: 8px; }
.canvas[data-look="friendly"] .us-fixcard .btn { background: var(--cv-accent); color: var(--cv-on); border: 0; border-radius: 999px; font-weight: 650; }
.canvas[data-look="friendly"] .cv-bar { height: 26px; border-radius: 999px; }
.canvas[data-look="friendly"] .cv-svg .cv-save { opacity: .05; }

/* Editorial: serif type, thin rules, almost no colour */
.canvas[data-look="editorial"] { border: 0; border-radius: 20px; }
.canvas[data-look="editorial"] .cv-kick { display: block; margin-right: auto; font: 600 12px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--cv-mute); }
.canvas[data-look="editorial"] .cv-top .cv-view { margin-right: 0; }
.canvas[data-look="editorial"] .cv-sent { font: 400 clamp(21px, 2.3vw, 27px)/2.05 var(--cv-serif); letter-spacing: 0; }
.canvas[data-look="editorial"] .cv-f { background: none; border: 0; border-bottom: 1.5px solid var(--cv-accent); border-radius: 0; font-style: italic; font-weight: 500; padding: 0 3px; box-shadow: none; }
.canvas[data-look="editorial"] .cv-f .u { font-style: normal; }
.canvas[data-look="editorial"] .cv-f:focus-within { background: none; box-shadow: none; border-bottom-width: 2.5px; }
.canvas[data-look="editorial"] .cv-big { font: 400 clamp(38px, 5vw, 58px)/1.05 var(--cv-serif); letter-spacing: -.02em; color: var(--cv-ink) !important; }
.canvas[data-look="editorial"] .cv-big::before { display: none; }
.canvas[data-look="editorial"] .cv-big em { font-style: italic; color: var(--cv-accent); }
.canvas[data-look="editorial"] .cv-big.warn em { color: var(--cv-warn); } .canvas[data-look="editorial"] .cv-big.bad em { color: var(--cv-bad); }
.canvas[data-look="editorial"] .cv-why { font: 15px/1.5 var(--font); }
.canvas[data-look="editorial"] .cv-head { border-bottom: 1px solid var(--cv-rule); padding-bottom: 18px; }
.canvas[data-look="editorial"] .card h3, .canvas[data-look="editorial"] .card-head h3 { font: 600 12px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--cv-mute); }
.canvas[data-look="editorial"] .cv-tiles > div { display: flex; align-items: baseline; gap: 8px; border-bottom: 0; padding: 5px 0; }
.canvas[data-look="editorial"] .cv-tiles small { flex: 1; display: flex; align-items: baseline; font-size: 14px; }
.canvas[data-look="editorial"] .cv-tiles small::after { content: ""; flex: 1; margin: 0 8px; border-bottom: 1px dotted var(--cv-mute); transform: translateY(-3px); }
.canvas[data-look="editorial"] .cv-note { display: block; margin: 0; font: 13px/1.5 var(--font); color: var(--cv-ink2); border-left: 2px solid var(--cv-accent); padding-left: 10px; }
.canvas[data-look="editorial"] .cv-mbar { height: 6px; border-radius: 3px; }
.canvas[data-look="editorial"] .cv-mbar i { opacity: .8; }
.canvas[data-look="editorial"] .cv-mbar .mk em { font-family: var(--font); }
.canvas[data-look="editorial"] .cv-bar { height: 16px; border-radius: 3px; }
.canvas[data-look="editorial"] .cv-bar span { font-size: 11px; }
.canvas[data-look="editorial"] .us-fixcard .btn { border-color: var(--cv-accent); color: var(--cv-accent); }

.canvas .cv-meter .card-head { margin-bottom: 28px; }

.canvas[data-look="editorial"] .cv-big em { white-space: nowrap; }

.canvas[data-look="friendly"] .cv-verdict { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; }
.canvas[data-look="friendly"] .cv-why { flex: 0 0 auto; }

/* ---- Canvas: less whitespace ---- */
.canvas .cv { gap: 12px; }
.canvas .cv [data-cv-issues]:empty { display: none; }
.canvas[data-look] .cv-body { gap: 16px; }
.canvas[data-look] .cv-head { gap: 4px 18px; }
.canvas[data-look] .cv-side { gap: 10px; }
.canvas[data-look] .cv-sent { line-height: 2; }
.canvas[data-look="friendly"] .cv-hello { font-size: 14px; margin: 2px 0 0; }
.canvas[data-look="friendly"] .cv-sent { line-height: 2.1; }
.canvas[data-look="friendly"] .cv-verdict { padding: 12px 18px; align-self: center; }
.canvas[data-look="friendly"] .cv-why { max-width: none; }
.canvas[data-look="editorial"] .cv-head { padding-bottom: 12px; }
.canvas[data-look] .card-head { margin-bottom: 8px; }
.canvas .cv-meter .card-head { margin-bottom: 26px; }
.canvas[data-look="friendly"] .card { padding: 14px 16px; }
.cv-on .canvas { padding: clamp(14px, 2.2vw, 24px); }

/* ======== Console look (the default): instrument-panel feel, monospaced figures. Day = blueprint, Night = phosphor on dark ======== */
.canvas[data-look="console"] {
  --cv-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, Menlo, monospace;
  --cv-bg: #E9F0F6; --cv-card: #F7FAFD; --cv-ink: #0F2A43; --cv-ink2: #3E5C78; --cv-mute: #6F8CA6; --cv-rule: #BCD0E0; --cv-accent: #0B6FB8; --cv-on: #FFFFFF;
  --cv-fbg: #F7FAFD; --cv-fline: #9DBBD4; --cv-fink: #0B5A94; --cv-good: #0B6B45; --cv-goodbg: #DDF1E8; --cv-warn: #8A5200; --cv-warnbg: #FBEFD5; --cv-bad: #A32626; --cv-badbg: #FBE3E3;
  --cv-l-mine: #0B6FB8; --cv-l-a: #7A6FD0; --cv-l-sweet: #0E9A6A; --cv-l-d: #C9811E; --cv-flag: #0B6FB8; --cv-flag2: #6F8CA6; --cv-z1: #3FB584; --cv-z2: #E5B84A; --cv-z3: #E4776F;
}
.canvas[data-look="console"][data-tone="night"] {
  --cv-bg: #0B1218; --cv-card: #111C25; --cv-ink: #D6E6F0; --cv-ink2: #9DB4C4; --cv-mute: #6C8496; --cv-rule: #223340; --cv-accent: #5FD3FF; --cv-on: #06222F;
  --cv-fbg: #0E1820; --cv-fline: #2D4658; --cv-fink: #7FE0FF; --cv-good: #5BE3A4; --cv-goodbg: #0F2A21; --cv-warn: #FFC561; --cv-warnbg: #2D2410; --cv-bad: #FF8F86; --cv-badbg: #321616;
  --cv-l-mine: #5FD3FF; --cv-l-a: #A99CF5; --cv-l-sweet: #5BE3A4; --cv-l-d: #FFC561; --cv-flag: #5FD3FF; --cv-flag2: #6C8496; --cv-z1: #2FA574; --cv-z2: #C79A30; --cv-z3: #D45F58;
}
.canvas[data-look="console"] { border: 1px solid var(--cv-rule); border-radius: 10px; font-family: var(--cv-mono); }
.canvas[data-look="console"][data-tone="day"] { background-image: linear-gradient(var(--cv-rule) 1px, transparent 1px), linear-gradient(90deg, var(--cv-rule) 1px, transparent 1px); background-size: 28px 28px; background-position: -1px -1px; background-color: var(--cv-bg); }
.canvas[data-look="console"] .cv-kick { display: block; margin-right: auto; font: 600 11px var(--cv-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cv-accent); }
.canvas[data-look="console"] .cv-top .cv-view { margin-right: 0; }
.canvas[data-look="console"] .cv-sent { font: 500 clamp(15px, 1.5vw, 18px)/2.2 var(--cv-mono); letter-spacing: 0; }
.canvas[data-look="console"] .cv-f { background: var(--cv-fbg); border: 1px solid var(--cv-fline); border-bottom: 2px solid var(--cv-accent); border-radius: 3px; padding: 0 8px; font-weight: 700; box-shadow: none; }
.canvas[data-look="console"] .cv-f input { font-family: var(--cv-mono); }
.canvas[data-look="console"] .cv-big { font: 700 clamp(28px, 3.4vw, 40px)/1.05 var(--cv-mono); letter-spacing: -.03em; color: inherit !important; }
.canvas[data-look="console"] .cv-big::before { display: none; }
.canvas[data-look="console"] .cv-lab { display: block; font: 600 11px/1.2 var(--cv-mono); letter-spacing: .16em; text-transform: uppercase; opacity: .9; margin-bottom: 6px; }
.canvas[data-look="console"] .cv-verdict { background: var(--cv-goodbg); color: var(--cv-good); border: 1px solid currentColor; border-left-width: 5px; border-radius: 4px; padding: 12px 16px; align-self: center; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; }
.canvas[data-look="console"] .cv-head.warn .cv-verdict { background: var(--cv-warnbg); color: var(--cv-warn); }
.canvas[data-look="console"] .cv-head.bad .cv-verdict { background: var(--cv-badbg); color: var(--cv-bad); }
.canvas[data-look="console"] .cv-why { color: inherit; opacity: .92; font: 13px/1.5 var(--cv-mono); max-width: none; flex: 0 0 auto; }
.canvas[data-look="console"] .card { background: var(--cv-card); border: 1px solid var(--cv-rule); border-radius: 6px; padding: 12px 14px; }
.canvas[data-look="console"] .card h3, .canvas[data-look="console"] .card-head h3 { font: 600 11px var(--cv-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cv-accent); }
.canvas[data-look="console"] .cv-side { border-left: 0; padding-left: 0; gap: 10px; }
.canvas[data-look="console"] .cv-tiles { gap: 8px; }
.canvas[data-look="console"] .cv-tiles > div { background: var(--cv-card); border: 1px solid var(--cv-rule); border-left: 3px solid var(--cv-accent); border-radius: 4px; padding: 8px 12px; }
.canvas[data-look="console"] .cv-tiles small { font: 600 10.5px var(--cv-mono); letter-spacing: .1em; text-transform: uppercase; }
.canvas[data-look="console"] .cv-tiles b { font-family: var(--cv-mono); }
.canvas[data-look="console"] .cv-note { display: block; margin: 0; font: 12.5px/1.5 var(--cv-mono); color: var(--cv-ink2); border-left: 2px solid var(--cv-accent); padding-left: 10px; }
.canvas[data-look="console"] .cv-mbar { height: 12px; border-radius: 2px; }
.canvas[data-look="console"] .cv-mbar .mk em { background: var(--cv-accent); color: var(--cv-on); border-radius: 2px; font-family: var(--cv-mono); }
.canvas[data-look="console"] .cv-mbar .mk { border-color: var(--cv-accent); }
.canvas[data-look="console"] .cv-bar { height: 20px; border-radius: 2px; }
.canvas[data-look="console"] .cv-bar span { font: 11px var(--cv-mono); }
.canvas[data-look="console"] .us-fixcard { background: var(--cv-bg); border: 1px solid var(--cv-rule); border-radius: 4px; padding: 8px 12px; }
.canvas[data-look="console"] .us-fixcard .btn { border-color: var(--cv-accent); color: var(--cv-accent); border-radius: 3px; }
.canvas[data-look="console"] .us-chip { border-radius: 3px; font-family: var(--cv-mono); font-size: 12px; }
.canvas[data-look="console"] .btn { border-radius: 3px; font-family: var(--cv-mono); }
.canvas[data-look="console"] .cv-svg .t { font-family: var(--cv-mono); }
.canvas[data-look="console"] .cv-svg .g { stroke-dasharray: 2 4; }
.canvas[data-look="console"] .cv-tip { font-family: var(--cv-mono); border-radius: 3px; }
.canvas[data-look="console"][data-tone="night"] .cv-big { text-shadow: 0 0 14px color-mix(in srgb, currentColor 40%, transparent); }

/* ---- Goals and payouts card (India results) and the markers on the Canvas chart ---- */
.dated { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.dated li { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.dated li:first-child { border-top: 0; }
.dated .dt { font-weight: 700; font-variant-numeric: tabular-nums; }
.dated small { display: block; color: var(--muted, var(--ink-2)); font-weight: 400; font-size: .82em; }
.dated li > b:not(.us-fate) { font-variant-numeric: tabular-nums; }
.dated li.d-out > b:not(.us-fate) { color: var(--warn, #B07A3A); } .dated li.d-in > b:not(.us-fate) { color: var(--good, #1D9E75); }   /* not .in / .out: .in is the input box */
.dated .us-fate { justify-self: end; white-space: nowrap; }
@media (max-width: 520px) { .dated li { grid-template-columns: 64px minmax(0, 1fr) auto; } .dated .us-fate { grid-column: 2 / -1; justify-self: start; } }
.cv-ev { cursor: default; }

/* Home dashboard: calmer notices, key figures in the hero, icons on the tiles */
.hm-notices { max-width: 1120px; margin: 0 auto 10px; display: grid; gap: 6px; }
.hm-notices .rg-banner, .hm-notices .hm-backup { margin: 0; padding: 7px 12px; gap: 6px 12px; font-size: 12.5px; border-radius: 10px; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); }
.hm-notices .hm-backup { border-left-color: var(--warn); }
.hm-notices .btn { height: 28px; padding: 0 11px; font-size: 12px; text-decoration: none; }
.hm-notices .rg-act, .hm-notices .hm-backup-act { display: flex; gap: 6px; }
.hm-ringw { flex: 0 0 auto; display: grid; justify-items: center; gap: 6px; }
.hm-ringw small { font: 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); text-align: center; max-width: 92px; line-height: 1.25; }
.hm-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 6px 0 2px; }
.hm-stats > div { min-width: 0; }
.hm-stats small { display: block; font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.hm-stats b { display: block; font: 650 16px var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hm-clear { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; color: var(--ink-2); }
.hm-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 7px; vertical-align: middle; color: var(--h, var(--accent)); background: color-mix(in srgb, var(--h, var(--accent)) 14%, transparent); }
.hm-ic svg { width: 14px; height: 14px; }
.hm-h b::before { content: none; }
.hm-tile { transition: transform .15s, box-shadow .15s, border-color .15s; }
.hm-tile:hover, .hm-hero:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.hm-tile.hm-empty { border-style: dashed; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.hm-tile.hm-empty .hm-go { align-self: flex-start; padding: 3px 10px; border: 1px solid color-mix(in srgb, var(--h, var(--accent)) 50%, transparent); border-radius: 99px; }
@media (prefers-reduced-motion: reduce) { .hm-tile, .hm-tile:hover, .hm-hero:hover { transition: none; transform: none; } }
@media (max-width: 640px) { .hm-hero { align-items: flex-start; } .hm-ringw { display: flex; flex-direction: row; align-items: center; gap: 12px; } .hm-ringw small { max-width: none; text-align: left; } .hm-stats { gap: 8px 18px; } }

/* Cost lists (Income Target): one tight line per cost, the name takes what is left */
.listf.costs.compact .lrows { gap: 4px; }
.listf.costs .lgrp { gap: 6px; }
.listf.costs .in { padding: 0 8px; }
.listf.costs .in input, .listf.costs .in select { font-size: 13px; text-overflow: ellipsis; }
.listf.costs .lcell:nth-child(3) .in { padding: 0 3px 0 6px; }
.listf.costs .in select { padding: 0; text-overflow: clip; }

/* Home dashboard, tighter: less padding and smaller type; the status is the heading's own colour (no second pill) */
.hm { gap: 10px; padding-top: 0; }
.hm h1 { font-size: 22px; margin-bottom: 2px; }
.hm a.card { padding: 12px 16px; gap: 8px; }
.hm-hero { padding: 12px 16px !important; gap: 14px !important; }
.hm-hero > div:nth-child(2) { gap: 1px; }
.hm-ring { width: 60px; height: 60px; }
.hm-ring span { width: 46px; height: 46px; font-size: 14.5px; }
.hm-ringw { gap: 4px; } .hm-ringw small { font-size: 9px; max-width: 70px; }
.hm .hm-big { font-size: 21px; }
.hm .hm-big small { font-size: 12.5px; }
.hm-hero .hm-big::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: currentColor; vertical-align: middle; position: relative; top: -2px; }
.hm-big.hm-ok { color: var(--good); } .hm-big.hm-bad { color: var(--bad); }
.hm-stats { gap: 2px 18px; margin: 3px 0 1px; } .hm-stats b { font-size: 14.5px; } .hm-stats small { font-size: 9.5px; }
.hm-hero .hm-sub { font-size: 12.5px; line-height: 1.4; }
.hm-sec { margin: 4px 0 -4px; font-size: 10.5px; }
.hm-grid { gap: 10px; }
.hm-tile .hm-sub { font-size: 12.5px; }
.hm-mini { gap: 3px; } .hm-mini li { font-size: 12.5px; }
.hm-clear { font-size: 12.5px; }
@media (max-width: 640px) { .hm-hero { padding: 12px 14px !important; } .hm .hm-big { font-size: 20px; } }

/* Income Year view: one column for "each month" by default, so there is no sideways scrollbar; the chip shows all twelve */
.inc-year-t .m-one { display: none; }
.inc-year-t.short { min-width: 0; width: 100%; }
.inc-year-t.short .m-all { display: none; } .inc-year-t.short .m-one { display: inline; }
.inc-year-t.short :is(th, td):nth-child(n+3):nth-child(-n+13) { display: none; }
.inc-year .card-head .us-chip { margin-left: auto; }
.inc-year:has(.inc-year-t.short) .table-scroll { overflow-x: hidden; }

/* No stray sideways scrollbars: the side-by-side draws table is fixed-width (a few pixels of rounding made it scroll), and the tab list of the Inputs panel is a vertical list */
.draws-card .table-scroll { overflow-x: hidden; }
@media (min-width: 901px) {
  /* one column, always: with wrapping on, a list taller than the panel made a second column off to the side, and hiding the sideways scroll then hid the last tabs */
  #view:not(.dash) .rail > .rtabs { flex-wrap: nowrap; overflow-x: hidden; overflow-y: auto; }
  #view:not(.dash) .rail > .rtabs { padding-top: 8px; padding-bottom: 8px; }
  /* The tabs share the height there is: full size when there is room, a little closer when there is not, so the last one is never cut off */
  #view:not(.dash) .rail > .rtabs [role="tab"] { flex: 0 1 43px; min-height: 31px; display: flex; flex-direction: column; justify-content: center; padding-top: 0; padding-bottom: 0; line-height: 1.2; }
}
/* A short window: the second line (the figure under each name) goes, so every name still fits */
@media (min-width: 901px) and (max-height: 640px) {
  #view:not(.dash) .rail > .rtabs [role="tab"] { flex-basis: 30px; min-height: 22px; }
  #view:not(.dash) .rail > .rtabs [role="tab"]::after { display: none; }
}
@media (min-width: 901px) and (max-height: 520px) {
  #view:not(.dash) .rail > .rtabs { padding-top: 4px; padding-bottom: 4px; gap: 1px; }
  #view:not(.dash) .rail > .rtabs [role="tab"] { min-height: 20px; font-size: 12px; }
}

/* Year-by-year tables: tighter side padding so they fit their card instead of scrolling sideways */
table.yr:not(.inc-year-t) th, table.yr:not(.inc-year-t) td { padding-left: 5px; padding-right: 5px; }
table.yr:not(.inc-year-t) th { letter-spacing: .04em; }

/* Chart end labels: a halo in the card colour keeps them readable where they cross a line (most visible on a phone) */
.chart text.end-label { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }

/* Phones: the cost rows give the name a little more of the line */
@media (max-width: 520px) { .listf.costs .lgrp { grid-template-columns: minmax(0, 1fr) 66px 54px 28px !important; gap: 5px; } .listf.costs .lx { width: 28px; } .listf.costs .in input { font-size: 12.5px; } }

/* Phones: the Budget month table fits the screen (the Actual box is the main thing to type into, so it must not sit off to the side) */
@media (max-width: 520px) {
  .bgt-t { table-layout: fixed; }
  .bgt-t th, .bgt-t td { padding: 6px 3px; font-size: 12.5px; }
  .bgt-t th:first-child, .bgt-t td:first-child { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; padding-left: 8px; }
  .bgt-t th:nth-child(2), .bgt-t td:nth-child(2) { width: 62px; }
  .bgt-t th:nth-child(3), .bgt-t td:nth-child(3) { width: 90px; }
  .bgt-t th:nth-child(4), .bgt-t td:nth-child(4) { width: 70px; }
  .bgt-t th:nth-child(5), .bgt-t td:nth-child(5) { width: 22px; padding-left: 0; padding-right: 2px; }
  .bgt-t .bgt-in { width: 100%; min-width: 0; padding: 0 5px; font-size: 12.5px; }
  .bgt-t thead th { letter-spacing: .02em; font-size: 9.5px; white-space: normal; }
}

/* FIRE numbers on a narrow card: tighter table that wraps its first column; if it still does not fit it scrolls inside the card instead of widening the page */
.fire-card .table-scroll { overflow-x: auto; overflow-y: visible; }
@container (max-width: 420px) { .fire-t { font-size: 12.5px; } .fire-t th, .fire-t td { padding: 7px 4px; } .fire-t th:first-child, .fire-t td:first-child { white-space: normal; line-height: 1.25; } .fire-t thead th { white-space: normal; font-size: 9.5px; letter-spacing: .03em; } }

/* Phones: small buttons and chips are a thumb-sized target (taller, not wider) */
@media (max-width: 520px) { .linkbtn, .us-chip, .btn.sm { min-height: 36px; } .linkbtn { display: inline-flex; align-items: center; } }

/* Income hourly / weekly / yearly boxes on a phone: numbers stay on one line (smaller type; stacked rows on the smallest screens) */
@media (max-width: 520px) { .inc-rates > div { padding: 8px 8px; } .inc-rates b { font-size: 13.5px; white-space: nowrap; overflow-wrap: normal; letter-spacing: -.02em; } .inc-rates small { font-size: 9.5px; letter-spacing: .04em; } }
@media (max-width: 380px) { .inc-rates { grid-template-columns: 1fr; } .inc-rates > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); } .inc-rates > div:last-child { border-bottom: 0; } .inc-rates b { font-size: 14.5px; } }

/* Settings: each choice hugs its buttons (the box no longer stretches across the row), and the panel is tighter so it fits a laptop screen */
.srow .seg { flex: 0 0 auto; margin-left: auto; justify-content: flex-start; padding: 2px; }
.set-rows { gap: 7px; }
.set-rows .seg button { padding: 4px 11px; }
.set-rows .srow .in { height: 30px; }
.set-block { gap: 8px; margin-top: 2px; padding-top: 10px; }
.set-block .hint { font-size: 11.5px; line-height: 1.4; }
.set-rates .srow.chk { margin-top: 8px; }

/* Day mode, readable text: the tool colours are bright, so text in them is mixed towards the ink */
.hm-h b, .hm-tile .hm-go { color: color-mix(in srgb, var(--h, var(--accent)) 66%, var(--ink)); }
.us-chip.add { color: var(--ink-2); }

/* The five key figures: three to a row (the last spans two) until the column is wide enough for five labels without stacking */
@container (min-width: 540px) and (max-width: 819px) { .kp.kp5, .dash .kp.kp5 { grid-template-columns: repeat(6, minmax(0, 1fr)); } .kp5 > div, .dash .kp5 > div { grid-column: span 2; } .kp5 > :nth-child(4), .kp5 > :nth-child(5), .dash .kp5 > :nth-child(4), .dash .kp5 > :nth-child(5) { grid-column: span 3; } .kp5 b { font-size: 19px; } }

/* Loading placeholder */
.skel { display: grid; gap: 14px; padding: 8px 0; }
.skel i { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--accent) 10%, var(--surface-2)) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: skel 1.2s linear infinite; }
.skel .skel-h { height: 30px; width: min(320px, 70%); } .skel .skel-s { height: 14px; width: min(560px, 90%); }
.skel-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 20px; margin-top: 8px; } .skel-grid i { height: 320px; }
@media (max-width: 900px) { .skel-grid { grid-template-columns: 1fr; } .skel-grid i { height: 180px; } }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel i { animation: none; } }

/* Budget month table: stripes and a row highlight carry the eye from an item to its Actual box; boxes are easier to see; "=" copies the budget */
.bgt-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; margin: 0 0 8px; font-size: 12.5px; color: var(--ink-2); }
.bgt-t tbody tr:not(.grp):nth-child(even) > * { background: color-mix(in srgb, var(--accent) 3.5%, transparent); }
.bgt-t tbody tr:not(.grp):hover > *, .bgt-t tbody tr:not(.grp):focus-within > * { background: color-mix(in srgb, var(--accent) 11%, transparent); }
.bgt-t th, .bgt-t td { padding-top: 4px; padding-bottom: 4px; }
.bgt-t .bgt-in { border-color: var(--edge); }
.bgt-act { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; }
.bgt-same { flex: none; width: 28px; height: 32px; display: inline-grid; place-items: center; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--accent); font: 700 14px var(--mono); cursor: pointer; font-style: normal; }
.bgt-same:hover { border-color: var(--accent); background: var(--accent-soft); }
.bgt-same.ghost { visibility: hidden; }
@media (max-width: 520px) {
  .bgt-t th:nth-child(3), .bgt-t td:nth-child(3) { width: 102px; }
  .bgt-t th:nth-child(4), .bgt-t td:nth-child(4) { width: 62px; }
  .bgt-act { display: flex; gap: 3px; } .bgt-same { width: 24px; }
}

/* Jump links over a long results column: stays under the top bar; one line (on a phone it slides under a thumb, with no bar showing) */
.jumps { position: sticky; top: calc(var(--bar-h, 56px) - 1px); z-index: 4; order: -10; display: flex; gap: 4px; padding: 5px; margin-bottom: -6px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--sticky); box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; }
.jumps[hidden] { display: none; }
.jumps::-webkit-scrollbar { display: none; }
.jump { flex: 1 0 auto; min-height: 28px; padding: 3px 9px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--ink-2); font: 600 12px var(--font); white-space: nowrap; cursor: pointer; }
.jump:hover { color: var(--ink); background: var(--surface-2); }
.jump[aria-current="true"] { color: var(--ink); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
@media (max-width: 520px) { .jump { min-height: 34px; flex: 0 0 auto; } }
@media print { .jumps { display: none; } }
.hm .pill.warn { color: color-mix(in srgb, var(--c-3) 78%, var(--ink)); }
.segf label:has(input:checked) { color: color-mix(in srgb, var(--accent) 82%, var(--ink)); }

/* Editorial look on a phone: the italic part of the headline may wrap (held on one line it was wider than a small phone and its end was cut off) */
@media (max-width: 520px) { .canvas[data-look="editorial"] .cv-big em { white-space: normal; } .canvas[data-look="editorial"] .cv-head { grid-template-columns: minmax(0, 1fr); } .canvas[data-look="editorial"] .cv-big { font-size: 34px; } }

/* Canvas on a phone: an odd figure at the end takes the whole line instead of sitting beside a gap */
@media (max-width: 520px) { .cv-tiles > div:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (max-width: 520px) { .set-rows .seg button { min-height: 34px; } }   /* Settings choices are thumb-sized on a phone */

/* A scrolling table only reaches into the card's bottom padding when it is the last thing in the card. With anything after it, the pull-up printed that text over the table's last row. */
.table-scroll:not(:last-child) { margin-bottom: 0; }
.table-scroll:not(:last-child) + * { margin-top: 10px; }

/* flush under the top bar: with a gap, slivers of the page scrolled past between the two */
.jumps { border-radius: 0 0 10px 10px; }

/* ---------- "I already have a retirement corpus": the strip above the India Retirement page and its short form (js/ui/corpus-start.js) ---------- */
.corpus { margin: 0 0 14px; scroll-margin-top: calc(var(--bar-h, 56px) + 8px); }
.corpus-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 14px; }
.corpus-strip > span { margin-right: auto; }
.corpus-form { display: grid; gap: 10px; max-width: 640px; margin: 0; }
.corpus-form .card-head, .corpus-form p { margin: 0; }
.corpus-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.corpus-two .f { gap: 3px; align-content: start; }
.corpus-buckets { display: grid; gap: 5px; }
.corpus-bk { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, .8fr); gap: 8px; align-items: center; font-size: 14px; }
.corpus-bk > span { overflow-wrap: anywhere; }
.corpus-bkh { font-size: 12px; font-weight: 600; color: var(--ink-2); align-items: end; }
.corpus-bk b { font-variant-numeric: tabular-nums; }
.corpus-err { color: var(--bad); font-size: 12.5px; }
.corpus-err[hidden] { display: none; }
.corpus-go { display: flex; flex-wrap: wrap; gap: 8px; }
/* on a wide page the money sits beside the buckets, so the whole form fits a laptop screen */
@media (min-width: 900px) { .corpus-form { max-width: 1080px; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; align-items: start; } .corpus-form > .card-head, .corpus-form > .corpus-go, .corpus-form > .hint:last-of-type { grid-column: 1 / -1; } .corpus-two { grid-row: span 2; } }
@media (max-width: 340px) { .corpus-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .corpus-two label { font-size: 12px; } .corpus-two { align-items: end; } .corpus-bk { gap: 5px; font-size: 13px; } .corpus-bk .in { padding-left: 6px; padding-right: 4px; } }
@media print { .corpus { display: none; } }

/* the US form: an account, what it holds, and its share in stocks; then the yearly returns */
.corpus-us { gap: 8px; }
.corpus-us .corpus-buckets { gap: 3px; }
.corpus-us .corpus-bk .in input, .corpus-us .corpus-rets .in input { padding-top: 5px; padding-bottom: 5px; }
@media (min-width: 900px) { .corpus-form.corpus-us > .hint { grid-column: 1 / -1; } .corpus-us .corpus-two { grid-row: auto; } }
.corpus-bk.corpus-acc { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, .7fr); }
.corpus-acc label { font-size: 13px; line-height: 1.25; }
.corpus-none { color: var(--ink-3); text-align: center; }
.corpus-rets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.corpus-rets label { display: grid; gap: 3px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
@media (max-width: 340px) { .corpus-rets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 340px) { .corpus-bk.corpus-acc { grid-template-columns: minmax(0, 1fr) 116px 46px; } .corpus-acc label { font-size: 12px; } }
