/* ==========================================================================
   What's My Tax Rate — whatsmytaxrate.com
   Dependency-free stylesheet. No build step, no external fonts.
   ========================================================================== */

:root {
  /* Brand */
  --brand-950: #1F0B2E;
  --brand-900: #2E1140;
  --brand-800: #3D1C56;
  --brand-700: #4E2470;
  --brand-600: #6D3A9E;
  --brand-500: #8B5CF6;
  --brand-300: #C4B5FD;
  --brand-100: #EDE6F7;
  --brand-50:  #F6F2FB;

  /* Neutrals */
  --bg:        #FAFAF7;
  --bg-alt:    #F2F1EC;
  --card:      #FFFFFF;
  --ink:       #1A1523;
  --ink-2:     #4B4458;
  --ink-3:     #6E6880;
  --line:      #E4E1EC;
  --line-2:    #D3CFDE;

  /* Semantic */
  --take:      #0F7A57;
  --take-bg:   #E4F5EE;
  --danger:    #C0342B;
  --warn:      #B45309;

  /* Tax-type colors — used consistently across every chart, bar and table */
  --c-federal: #6D3A9E;
  --c-fica:    #2563A8;
  --c-state:   #0E7C86;
  --c-total:   #1A1523;

  /* Bracket ramp — light→dark, all pass AA with the paired text color */
  --br-10: #E9DFF7;
  --br-12: #D2BEF0;
  --br-22: #B292E4;
  --br-24: #8759CC;
  --br-32: #6D3A9E;
  --br-35: #4E2470;
  --br-37: #2E1140;

  --radius:    16px;
  --radius-lg: 26px;
  --shadow:    0 1px 2px rgba(26,21,35,.05), 0 8px 24px -12px rgba(26,21,35,.18);
  --shadow-lg: 0 2px 4px rgba(26,21,35,.05), 0 24px 56px -24px rgba(26,21,35,.30);

  --maxw: 1120px;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.021em; font-weight: 800; }
p { margin: 0; }
a { color: var(--brand-600); }

/* FIX #14 — every figure on the page uses lining tabular numerals with tight
   tracking, so digits align in columns and never look letter-spaced. */
.num {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: -0.02em;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:where(a, button, select, input, summary):focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 6px;
}

.eyebrow {
  font-size: 12px; font-weight: 800; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   Top bar + jump nav  (FIX #8)
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 20px; min-height: 60px;
}

/* FIX #5 — one name everywhere: What's My Tax Rate */
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); flex: none; }
.brand__mark { width: 26px; height: 26px; flex: none; }
.brand__name { font-weight: 800; font-size: 16.5px; letter-spacing: -0.028em; white-space: nowrap; }
.brand__name em { font-style: normal; color: var(--brand-600); }

.jump { display: flex; gap: 2px; margin-left: auto; }
.jump a {
  font-size: 13.5px; font-weight: 650; color: var(--ink-2); text-decoration: none;
  padding: 7px 11px; border-radius: 9px; white-space: nowrap;
}
.jump a:hover { background: var(--brand-50); color: var(--brand-700); }

@media (max-width: 900px) { .jump { display: none; } }

/* Sticky mini-result (FIX #6) — slides in once the hero result scrolls away */
/* Fixed, not sticky — a sticky element still reserves its height in the flow,
   which left a white band under the header while the bar was hidden. */
.ministrip {
  position: fixed; top: 60px; left: 0; right: 0; z-index: 55;
  background: var(--brand-900); color: #fff;
  border-bottom: 1px solid var(--brand-700);
  transform: translateY(-102%);
  transition: transform .22s ease;
  visibility: hidden;
}
.ministrip[data-show="1"] { visibility: visible; }
.ministrip[data-show="1"] { transform: translateY(0); }
.ministrip__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 9px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.ministrip__ctx { font-size: 13px; color: var(--brand-300); font-weight: 600; }
.ministrip__stat { display: flex; align-items: baseline; gap: 7px; }
.ministrip__stat b { font-size: 19px; font-weight: 800; }
.ministrip__stat span { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-300); font-weight: 700; }
.ministrip .btn-share { margin-left: auto; }
@media (max-width: 700px) {
  .ministrip__ctx { display: none; }
  .ministrip__inner { gap: 12px; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  background:
    radial-gradient(1100px 480px at 78% -8%, var(--brand-700) 0%, transparent 62%),
    linear-gradient(178deg, var(--brand-900), var(--brand-950));
  color: #fff;
  padding: 60px 0 0;
}
.hero__head { max-width: 720px; }
.hero h1 { font-size: clamp(38px, 6.4vw, 62px); letter-spacing: -0.035em; }
.hero h1 em { font-style: normal; color: var(--brand-300); }
.hero__sub { margin-top: 16px; font-size: clamp(17px, 2vw, 19.5px); color: #D9CFE8; max-width: 62ch; }
.hero__stamp {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.20);
  padding: 5px 13px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: #E5DAF2;
}
.hero__stamp .dot { width: 6px; height: 6px; border-radius: 50%; background: #4ADE80; }

/* --------------------------------------------------------------------------
   Calculator card — inputs AND the answer, side by side (FIX #6)
   -------------------------------------------------------------------------- */

/* The card lives inside the white-on-purple hero, so it must reset the
   inherited colour — otherwise any element without an explicit colour renders
   white on white. */
.calc {
  margin-top: 38px;
  color: var(--ink);
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(28px);
}
/* Both tracks are minmax(0,…) so a wide min-content child (the state <select>,
   the big rate figures) can never blow the grid out past the viewport. The
   collapsed single-column rule needs it just as much as the two-column one. */
.calc__grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.05fr); }
@media (max-width: 940px) { .calc__grid { grid-template-columns: minmax(0,1fr); } }

.calc__inputs { padding: 30px 30px 26px; min-width: 0; }
.calc__result { padding: 30px; background: var(--brand-50); border-left: 1px solid var(--line); min-width: 0; }
@media (max-width: 940px) { .calc__result { border-left: 0; border-top: 1px solid var(--line); } }

.field + .field { margin-top: 22px; }
.field > label, .field > .field__legend {
  display: block; margin-bottom: 9px;
  font-size: 12px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}

/* Income input */
.income {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg-alt);
  border: 2px solid transparent; border-radius: 14px;
  padding: 14px 16px; min-height: 60px;
  transition: border-color .15s, background .15s;
}
.income:focus-within { border-color: var(--brand-500); background: #fff; }
.income__sym { font-size: 27px; font-weight: 700; color: var(--ink-3); }
.income input {
  flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; outline: none;
  font-family: var(--sans); font-size: 32px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums lining-nums;
  padding: 0;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* FIX #10 — 44px minimum touch target on every control */
.chip {
  min-height: 44px; padding: 0 15px;
  border: 1.5px solid var(--line-2); background: #fff; color: var(--ink-2);
  border-radius: 12px; cursor: pointer;
  font-family: var(--sans); font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
  transition: .13s;
}
.chip:hover { border-color: var(--brand-500); color: var(--brand-700); }
.chip[aria-pressed="true"] { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

/* Filing status */
.segs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg {
  min-height: 44px; padding: 0 12px;
  border: 1.5px solid var(--line-2); background: #fff; color: var(--ink-2);
  border-radius: 12px; cursor: pointer;
  font-family: var(--sans); font-size: 14.5px; font-weight: 650;
  transition: .13s;
}
.seg:hover { border-color: var(--brand-500); color: var(--brand-700); }
.seg[aria-checked="true"] { background: var(--brand-600); border-color: var(--brand-600); color: #fff; font-weight: 750; }
fieldset.field { border: 0; padding: 0; margin: 22px 0 0; }

/* State select */
.selectwrap { position: relative; }
.selectwrap svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink-3); }
.selectwrap select {
  width: 100%; min-width: 0; min-height: 48px; appearance: none;
  background: var(--bg-alt); border: 2px solid transparent; border-radius: 14px;
  padding: 0 40px 0 15px;
  font-family: var(--sans); font-size: 16px; font-weight: 650; color: var(--ink);
  cursor: pointer; transition: .15s;
}
.selectwrap select:focus { border-color: var(--brand-500); background: #fff; outline: none; }

.localnote {
  margin-top: 9px; font-size: 12.5px; line-height: 1.45; color: var(--warn);
  display: flex; gap: 6px; align-items: flex-start;
}
.localnote svg { flex: none; margin-top: 2px; }

/* ---- The headline pairing (FIX #1) ------------------------------------- */

.pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.pair__cell { text-align: center; }
.pair__label {
  font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); display: block; min-height: 28px;
}
.pair__val {
  display: block; font-size: clamp(38px, 6vw, 52px); font-weight: 800;
  letter-spacing: -0.04em; line-height: 1; color: var(--brand-700);
}
.pair__val--eff { color: var(--take); }
.pair__arrow { color: var(--brand-300); }
.pair__foot { margin-top: 5px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }

.gapnote {
  margin-top: 18px; padding: 13px 15px;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand-600);
  border-radius: 12px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2);
}
.gapnote b { color: var(--ink); }

/* All-in secondary row */
.allin {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2);
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.allin__l { font-size: 13.5px; color: var(--ink-2); font-weight: 650; }
.allin__v { font-size: 23px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }

/* Take-home split bar */
.splitbar { margin-top: 16px; }
.splitbar__track { display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: var(--bg-alt); }
.splitbar__seg { transition: width .35s ease; }
.splitbar__key { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 9px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.splitbar__key i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 5px; }

/* ---- "What if I earn $1,000 more?" (FIX #13) --------------------------- */

.raise {
  border-top: 1px solid var(--line); background: var(--card);
  padding: 22px 30px 26px;
}
.raise__top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.raise__q { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.raise__amts { display: flex; gap: 6px; margin-left: auto; }
.raise__amt {
  min-height: 44px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--line-2); background: #fff; color: var(--ink-2);
  font-family: var(--sans); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.raise__amt[aria-pressed="true"] { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.raise__flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 10px; align-items: center; }
@media (max-width: 760px) { .raise__flow { grid-template-columns: 1fr; } .raise__flow .raise__op { display: none; } }
.raise__box { text-align: center; padding: 13px 10px; border-radius: 12px; background: var(--bg-alt); }
.raise__box--keep { background: var(--take-bg); }
.raise__box b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.raise__box--keep b { color: var(--take); }
.raise__box span { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); font-weight: 650; }
.raise__op { font-size: 20px; color: var(--ink-3); font-weight: 700; }
.raise__verdict { margin-top: 13px; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.raise__verdict b { color: var(--ink); }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

/* FIX (rhythm) — alternating tints so sections don't read as one slab */
.section { padding: 76px 0; }
.section--tint { background: var(--bg-alt); }
.section--ink { background: var(--brand-950); color: #fff; }
.section--ink .section__lead { color: #C9BCD9; }
.section--ink h2 { color: #fff; }

.section__head { max-width: 68ch; margin-bottom: 34px; }
.section__head h2 { font-size: clamp(26px, 3.6vw, 36px); letter-spacing: -0.03em; }
.section__lead { margin-top: 12px; font-size: 17.5px; color: var(--ink-2); line-height: 1.6; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px;
}
.section--ink .card { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.13); box-shadow: none; }

/* Breakdown row (FIX #18 — stacks cleanly) */
.breakdown { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 1000px) { .breakdown { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .breakdown { grid-template-columns: 1fr; } }

.bd {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; border-top: 3px solid var(--line);
}
.bd--federal { border-top-color: var(--c-federal); }
.bd--fica    { border-top-color: var(--c-fica); }
.bd--state   { border-top-color: var(--c-state); }
.bd--total   { border-top-color: var(--c-total); background: var(--ink); color: #fff; border-color: var(--ink); }
.bd--take    { border-top-color: var(--take); background: var(--take-bg); border-color: #BFE6D6; }
.bd__name { font-size: 13.5px; font-weight: 750; letter-spacing: -0.01em; }
.bd--total .bd__name { color: #fff; }
.bd__sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.bd--total .bd__sub { color: #B9B2C6; }
.bd__amt { margin-top: 14px; font-size: 27px; font-weight: 800; letter-spacing: -0.035em; }
.bd--take .bd__amt { color: var(--take); }
.bd__pct { margin-top: 3px; font-size: 12.5px; color: var(--ink-3); font-weight: 650; }
.bd--total .bd__pct { color: #B9B2C6; }

/* Bracket table + proportional fill bar (FIX #15) */
.fill { margin-bottom: 24px; }
.fill__track { display: flex; height: 46px; border-radius: 11px; overflow: hidden; border: 1px solid var(--line-2); }
.fill__seg {
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums;
  transition: width .35s ease; min-width: 0; overflow: hidden; white-space: nowrap;
}
.fill__scale { display: flex; justify-content: space-between; margin-top: 7px; font-size: 12px; color: var(--ink-3); font-weight: 650; font-variant-numeric: tabular-nums; }
.fill__cap { margin-top: 9px; font-size: 13.5px; color: var(--ink-2); }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.brk { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
table.brk th {
  text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--line-2);
  font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3);
}
table.brk td { padding: 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums lining-nums; }
table.brk th.r, table.brk td.r { text-align: right; }
table.brk tr.is-empty td { color: var(--ink-3); }
table.brk tfoot td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--ink); font-size: 16px; }
.swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: 8px; vertical-align: baseline; }
.brk__here {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  background: var(--brand-100); color: var(--brand-700);
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Charts
   -------------------------------------------------------------------------- */

.chartgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 940px) { .chartgrid { grid-template-columns: 1fr; } }

.chart { width: 100%; height: auto; display: block; overflow: visible; }

/* FIX #3 — every chart carries an explicit legend and a cited source */
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 4px 0 16px; }
.legend__item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.section--ink .legend__item { color: #D3C8E0; }
.legend__key { width: 22px; height: 3px; border-radius: 2px; flex: none; }
.legend__key--dash {
  height: 0; border-top: 3px dashed currentColor; border-radius: 0;
}
.source { margin-top: 14px; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.section--ink .source { color: #9C90AC; }
.source a { color: inherit; }

/* --------------------------------------------------------------------------
   Withholding + bonus explainers
   -------------------------------------------------------------------------- */

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 820px) { .compare { grid-template-columns: 1fr; } }

.cmp { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.cmp--myth { background: #FDF3F2; border-color: #F3D6D2; }
.cmp--real { background: var(--take-bg); border-color: #BFE6D6; }
.cmp__tag {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
  font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.cmp--myth .cmp__tag { color: var(--danger); }
.cmp--real .cmp__tag { color: var(--take); }
.cmp__big { font-size: 40px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.cmp--myth .cmp__big { color: var(--danger); }
.cmp--real .cmp__big { color: var(--take); }
.cmp__cap { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }

/* Bonus: two withholding methods against the truth */
.bonusbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.bonusbar__label { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.bonusbar .chips { margin-top: 0; }

.bonus__intro { font-size: 15.5px; color: var(--ink-2); line-height: 1.6; margin-bottom: 22px; }

.bonus3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 900px) { .bonus3 { grid-template-columns: 1fr; gap: 26px; } }

.bonus3__col { padding: 18px; border-radius: var(--radius); background: var(--bg-alt); border: 1px solid var(--line); }
/* The truth column is the one to land on, so it gets the affirmative colour. */
.bonus3__col--truth { background: var(--take-bg); border-color: #BFE6D6; }
.bonus3__col .eyebrow { display: block; margin-bottom: 8px; }
.bonus3__col--truth .eyebrow { color: var(--take); }
.bonus3__desc { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); min-height: 60px; }
@media (max-width: 900px) { .bonus3__desc { min-height: 0; } }
.bonus3 .ledger { margin-top: 12px; }
.bonus3 .ledger__row { font-size: 13.5px; }

.ledger { margin-top: 18px; border-top: 1px solid rgba(0,0,0,.09); }
.ledger__row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14.5px; border-bottom: 1px solid rgba(0,0,0,.06); }
.ledger__row b { font-variant-numeric: tabular-nums; }
.ledger__row--sum { font-weight: 800; border-bottom: 0; }

.callout {
  margin-top: 24px; padding: 20px 22px; border-radius: var(--radius);
  background: var(--brand-50); border: 1px solid var(--brand-100); border-left: 4px solid var(--brand-600);
}
.callout h4 { font-size: 16px; margin-bottom: 7px; }
.callout p { font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.section--ink .callout { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); border-left-color: var(--brand-300); }
.section--ink .callout p { color: #C9BCD9; }

/* Deduction vs credit visual (FIX #12) */
.dcbars { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 6px; }
@media (max-width: 700px) { .dcbars { grid-template-columns: 1fr; } }
.dcbar { padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.dcbar__h { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.dcbar__s { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }
.dcbar__track { height: 34px; border-radius: 9px; background: var(--bg-alt); overflow: hidden; }
.dcbar__f { height: 100%; display: flex; align-items: center; padding-left: 12px; color: #fff; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; transition: width .35s ease; }
.dcbar__f--ded { background: var(--brand-600); }
.dcbar__f--cred { background: var(--take); }
.dcbar__note { margin-top: 11px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }

/* --------------------------------------------------------------------------
   Interactive shelter panel
   -------------------------------------------------------------------------- */

.shelter { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 940px) { .shelter { grid-template-columns: minmax(0, 1fr); } }

.shelter__controls {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 24px 20px;
}

.sh { padding: 18px 0; border-bottom: 1px solid var(--line); }
.sh:last-child { border-bottom: 0; }
.sh__top { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.sh__name { font-size: 15.5px; font-weight: 750; letter-spacing: -0.015em; }
.sh__val {
  margin-left: auto; font-size: 19px; font-weight: 800; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums lining-nums; color: var(--brand-700);
}
.sh__fica {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: var(--take-bg); color: var(--take);
}
.sh__blurb { font-size: 13px; color: var(--ink-3); line-height: 1.5; margin-bottom: 12px; }

/* Range input — styled consistently across engines, 44px hit area */
.sh__slider { width: 100%; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; display: block; }
.sh__slider:focus { outline: none; }
.sh__slider:focus-visible { outline: 3px solid var(--brand-500); outline-offset: 4px; border-radius: 8px; }
.sh__slider::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: var(--bg-alt); }
.sh__slider::-moz-range-track { height: 8px; border-radius: 999px; background: var(--bg-alt); }
.sh__slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin-top: -8px;
  border-radius: 50%; background: var(--brand-600); border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(26,21,35,.3);
}
.sh__slider::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%; background: var(--brand-600);
  border: 3px solid #fff; box-shadow: 0 1px 4px rgba(26,21,35,.3);
}
.sh__scale {
  display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3);
  font-weight: 650; font-variant-numeric: tabular-nums; margin-top: -2px;
}
.sh__saves { font-size: 12.5px; color: var(--take); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Result panel — sticks alongside the sliders on wide screens */
.shelter__result {
  background: var(--brand-950); color: #fff;
  border-radius: var(--radius); padding: 26px;
  position: sticky; top: 84px;
}
@media (max-width: 940px) { .shelter__result { position: static; } }

.shelter__headline { text-align: center; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.14); }
.shelter__headline .eyebrow { color: #9C90AC; display: block; margin-bottom: 6px; }
.shelter__big { font-size: 44px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; display: block; }

.shelter__flow { padding: 16px 0 4px; }
.shelter__row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 8px 0; font-size: 14.5px; color: #C9BCD9; }
.shelter__row b { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; color: #fff; }
.shelter__row--rule { margin-top: 8px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.14); }
.shelter__good { color: #4ADE80 !important; }

.shelter__verdict {
  margin-top: 14px; padding: 13px 15px; border-radius: 12px;
  background: rgba(255,255,255,.07); border-left: 3px solid var(--brand-300);
  font-size: 14px; line-height: 1.55; color: #D9CFE8;
}
.shelter__verdict b { color: #fff; }

.shelter__compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-top: 18px; }
.shelter__col { text-align: center; }
.shelter__col .eyebrow { color: #9C90AC; display: block; margin-bottom: 4px; }
.shelter__col b { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; display: block; }
.shelter__col--after b { color: #4ADE80; }
.shelter__sub { font-size: 11.5px; color: #9C90AC; }
.shelter__arrow { color: var(--brand-300); font-size: 20px; }

.shelter__actions { display: flex; gap: 9px; margin-top: 20px; flex-wrap: wrap; }
.shelter__actions .btn { flex: 1; min-width: 140px; }
.shelter__actions .btn--outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.shelter__actions .btn--outline:hover { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.5); }

.shelter__fine { margin-top: 16px; font-size: 12.5px; line-height: 1.55; color: #9C90AC; }

/* --------------------------------------------------------------------------
   Deduction / credit cards
   -------------------------------------------------------------------------- */

.lever { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 1000px) { .lever { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 660px)  { .lever { grid-template-columns: 1fr; } }

.lv { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.lv__h { font-size: 16.5px; font-weight: 800; letter-spacing: -0.02em; }
.lv__cap { margin-top: 5px; font-size: 13px; font-weight: 700; color: var(--brand-700); font-variant-numeric: tabular-nums; }
.lv__body { margin-top: 12px; font-size: 14.5px; color: var(--ink-2); line-height: 1.6; }
.lv__save {
  margin-top: 14px; padding-top: 13px; border-top: 1px dashed var(--line-2);
  font-size: 13.5px; color: var(--ink-2);
}
.lv__save b { color: var(--take); font-variant-numeric: tabular-nums; }
.lv__badge {
  display: inline-block; margin-top: 8px; padding: 3px 9px; border-radius: 999px;
  background: var(--take-bg); color: var(--take);
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid transparent;
  font-family: var(--sans); font-size: 14.5px; font-weight: 750; text-decoration: none;
  transition: .14s;
}
.btn--primary { background: var(--brand-600); color: #fff; }
.btn--primary:hover { background: var(--brand-700); }
.btn--ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.28); }
.btn--ghost:hover { background: rgba(255,255,255,.2); }
.btn--outline { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn--outline:hover { border-color: var(--brand-500); color: var(--brand-700); }
/* Compact only inside the dense sticky strip; full 44px target everywhere else. */
.btn-share { min-height: 44px; padding: 0 15px; font-size: 13.5px; border-radius: 10px; }
.ministrip .btn-share { min-height: 38px; padding: 0 13px; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 650; z-index: 200;
  opacity: 0; pointer-events: none; transition: .2s;
}
.toast[data-show="1"] { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer { background: var(--brand-950); color: #A79BB6; padding: 54px 0 40px; font-size: 14px; }
.footer h4 { color: #fff; font-size: 14px; margin-bottom: 11px; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 34px; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; gap: 26px; } }
.footer a { color: #C9BCD9; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 7px; line-height: 1.5; }
.footer__legal { margin-top: 34px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); line-height: 1.65; font-size: 13px; }
.footer__legal strong { color: #E5DAF2; }

/* --------------------------------------------------------------------------
   Print (FIX #9 — a clean printable / save-as-PDF result)
   -------------------------------------------------------------------------- */

@media print {
  .topbar, .ministrip, .jump, .btn, .toast, .chips, .raise__amts { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .hero { background: #fff !important; color: var(--ink) !important; padding-top: 0; }
  .hero h1 { color: var(--ink) !important; font-size: 26pt; }
  .hero h1 em, .hero__sub { color: var(--ink-2) !important; }
  .hero__stamp { border-color: var(--line-2); color: var(--ink-2); background: none; }
  .calc { transform: none; box-shadow: none; border: 1px solid var(--line-2); margin-top: 20px; }
  .section { padding: 22px 0; page-break-inside: avoid; }
  .section--ink { background: #fff !important; color: var(--ink) !important; }
  .section--ink h2, .section--ink .section__lead { color: var(--ink) !important; }
  .footer { background: #fff; color: var(--ink-2); }
  .footer h4, .footer a { color: var(--ink) !important; }
  a[href]::after { content: ""; }
}
