/* Tax calculators (calculators.js): inputs on the left, the live result in a dark, lit panel on the right. */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.calc-panel { padding: clamp(22px, 3vw, 32px); border-radius: 18px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 28px; }
.calc-panel h2, .calc-result h2 { font: 500 .75rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.field { display: grid; gap: 12px; }
.field-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field label, .field legend { font-weight: 600; font-size: 1rem; padding: 0; }
.field small { color: var(--muted); font-size: .86rem; line-height: 1.5; }
.field fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; }
.money-box { display: flex; align-items: center; gap: 2px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font: 500 1rem/1 var(--f-mono); color: var(--muted); min-width: 0; }
.money-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--spot); }
.money-box input { width: 100%; min-width: 0; padding: 12px 0; border: 0; background: none; color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; outline: none; }
.field-top .money-box { width: 9.5rem; flex: none; }
.field select { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; }

/* Range sliders: a filled track up to the thumb. */
.field .range { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; padding: 0; border: 0; border-radius: 0; background: none; cursor: pointer; outline: none; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--brand) var(--fill, 50%), var(--line) var(--fill, 50%)); }
.range::-moz-range-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--brand) var(--fill, 50%), var(--line) var(--fill, 50%)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #FFFFFF; border: 0; box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 30%, transparent), 0 2px 6px rgba(0, 0, 0, .35); transition: box-shadow .2s; }
.range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; border: 0; box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 30%, transparent), 0 2px 6px rgba(0, 0, 0, .35); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 7px color-mix(in srgb, var(--brand) 45%, transparent), 0 2px 6px rgba(0, 0, 0, .35); }

/* Two-way choice as a segmented control. */
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); flex-wrap: wrap; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 9px 14px; border-radius: 9px; font-size: .9rem; font-weight: 500; color: var(--muted); transition: background .2s, color .2s; }
.seg input:checked + span { background: var(--btn); color: #FFFFFF; }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.warn { padding: 12px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--brass) 55%, transparent); background: color-mix(in srgb, var(--brass) 10%, transparent); font-size: .88rem; line-height: 1.5; }

/* Result panel */
.calc-result { position: sticky; top: 96px; padding: clamp(22px, 3vw, 32px); border-radius: 18px; display: grid; gap: 22px; overflow: hidden;
  background: radial-gradient(70% 60% at 100% 0%, rgba(30, 110, 173, .35), transparent 70%), var(--hero); color: var(--hero-ink); border: 1px solid var(--hero-line);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .6); }
.calc-result h2 { color: var(--hero-muted); }
.big { display: grid; gap: 6px; }
.big output { font: 600 clamp(2.6rem, 1.6rem + 3vw, 3.7rem)/1 var(--f-sans); font-stretch: 110%; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: #FFFFFF; }
.big.neg output { color: var(--hero-muted); }
.big p { color: var(--hero-muted); font-size: .95rem; max-width: 34em; }
.compare { display: grid; gap: 14px; }
.compare div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; font-size: .9rem; }
.compare b { font: 500 .95rem/1 var(--f-mono); font-variant-numeric: tabular-nums; }
.compare .bar-track { grid-column: 1 / -1; display: flex; height: 10px; border-radius: 99px; background: rgba(237, 244, 246, .08); overflow: hidden; }
.compare .bar-track i { width: var(--w, 0%); height: 100%; transition: width .6s var(--ease); }
.compare .llc { background: #93A9BC; }
.compare .s { background: var(--cyan); }
.compare .cost { background: var(--brass); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 400 .75rem/1.4 var(--f-mono); color: var(--hero-muted); text-transform: uppercase; letter-spacing: .05em; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.breakdown { width: 100%; border-collapse: collapse; font-size: .86rem; }
.breakdown th, .breakdown td { padding: 9px 0; border-top: 1px solid var(--hero-line); text-align: right; font-weight: 400; }
.breakdown th { text-align: left; color: var(--hero-muted); }
.breakdown thead th { font: 500 .75rem/1.2 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; border-top: 0; }
.breakdown td { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.breakdown .total th, .breakdown .total td { color: var(--hero-ink); font-weight: 600; }
.chart-box { display: grid; gap: 8px; }
.chart-box svg { width: 100%; height: auto; overflow: visible; }
.chart-box .zero { stroke: rgba(237, 244, 246, .25); stroke-dasharray: 3 4; }
.chart-box .area { fill: rgba(95, 176, 240, .14); }
.chart-box .line { fill: none; stroke: var(--cyan); stroke-width: 2.2; stroke-linejoin: round; }
.chart-box .even { stroke: var(--brass); stroke-dasharray: 2 3; }
.chart-box .dot { fill: #FFFFFF; stroke: var(--cyan); stroke-width: 3; }
.chart-box p { color: var(--hero-muted); font-size: .84rem; }
.calc-result .btn { justify-self: start; max-width: 100%; white-space: normal; }

/* Quarterly payments as a row of four dated cards. */
.dates { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dates li { padding: 14px; border-radius: 12px; border: 1px solid var(--hero-line); background: rgba(237, 244, 246, .04); display: grid; gap: 4px; }
.dates span { font: 500 .75rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--brass); }
.dates time { color: var(--hero-muted); font-size: .88rem; }
.dates b { font: 600 1.25rem/1.2 var(--f-mono); font-variant-numeric: tabular-nums; }
.dates em { font-style: normal; font-size: .75rem; color: var(--hero-muted); }
.dates .past { opacity: .5; }
.notes p { padding: 10px 12px; border-radius: 10px; background: rgba(95, 176, 240, .1); font-size: .86rem; line-height: 1.5; }
.notes:empty { display: none; }

/* Depreciation calculator: one colour per method across bars, legend and chart. */
.calc-result .d179 { background: var(--brass); fill: var(--brass); }
.calc-result .dbonus { background: var(--cyan); fill: var(--cyan); }
.calc-result .dreg { background: #93A9BC; fill: #93A9BC; }
.chart-box .yr { fill: var(--hero-muted); font: 500 11px var(--f-mono); }

@media (max-width: 900px) { .calc { grid-template-columns: minmax(0, 1fr); } .calc-result { position: static; } }
/* The inputs stay in view while the longer results column scrolls past. */
@media (min-width: 901px) and (min-height: 860px) { .calc-panel { position: sticky; top: 96px; } }
.opt { font-weight: 400; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .compare .bar-track i { transition: none; } }
