:root {
    --primary: #c8102e;
    --primary-soft: #f4d4da;
    --secondary: #5eb3d4;
    --secondary-deep: #2e7fa3;
    --ink: #0b1f33;
    --star: var(--primary);
    --star-soft: var(--primary-soft);
    --lake: var(--secondary);
    --lake-deep: var(--secondary-deep);
    --paper: #efe8d8;
    --card: #fffaf1;
    --line: #d4cbb8;
    --muted: #5a6470;
    --good: #1f6b4a;
    --shadow: 4px 4px 0 rgba(11, 31, 51, 0.08);
    --mast: 5.1rem;
    /* Newspaper type: condensed serif headlines and big figures, a text serif, a narrow sans for labels and numbers. */
    --cond: "Noto Serif Display", Georgia, "Times New Roman", serif;
    --text: "Newsreader", Georgia, "Times New Roman", serif;
    --narrow: "Archivo Narrow", "Arial Narrow", "Roboto Condensed", sans-serif;
    --display: var(--cond);
    --sans: var(--text);
    --mono: var(--narrow);
    font-family: var(--sans);
    color-scheme: light;
}

* { box-sizing: border-box; }

html {
    margin: 0;
    /* Newsprint around the page sheet (main and footer carry the lighter sheet colour). */
    background-color: #e9e4d6;
    background-image: var(--paper-svg, url("/paper.svg"));
    background-attachment: fixed;
    color: var(--ink);
}

body {
    margin: 0;
    background: transparent;
    color: var(--ink);
    font-optical-sizing: auto;
}

::selection {
    background: var(--ink);
    color: #fff;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.help:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

main:focus,
main:focus-visible,
main[tabindex]:focus,
main[tabindex]:focus-visible {
    outline: none;
}

input[type="range"] {
    accent-color: var(--primary);
}

.chi-stars {
    display: flex;
    align-items: center;
    gap: 0.28rem;
}

.chi-star {
    display: block;
    width: 12px;
    height: 12px;
    background: var(--star);
    -webkit-mask: var(--star-svg, url("/star.svg")) center / contain no-repeat;
    mask: var(--star-svg, url("/star.svg")) center / contain no-repeat;
}

.help-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: -0.2rem 0 0.35rem;
}

.help {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.2rem;
    vertical-align: middle;
    cursor: help;
}

.help-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
    border: 1px solid var(--muted);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted);
    line-height: 1;
}

.help:hover .help-mark,
.help:focus .help-mark,
.help:focus-within .help-mark {
    color: var(--ink);
    border-color: var(--ink);
}

.help-bubble {
    display: none;
    position: absolute;
    z-index: 20;
    left: 0;
    top: calc(100% + 0.4rem);
    width: min(18rem, 70vw);
    padding: 0.55rem 0.7rem;
    background: var(--ink);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.35;
    border-radius: 2px;
    box-shadow: 3px 3px 0 var(--star);
}

.help:hover .help-bubble,
.help:focus .help-bubble,
.help:focus-within .help-bubble {
    display: block;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-width: 0;
}

.masthead-independence {
    margin: 0;
    max-width: 22rem;
    font-size: 0.68rem;
    line-height: 1.3;
    font-weight: 450;
    letter-spacing: 0.01em;
    color: rgba(215, 231, 242, 0.78);
    text-align: center;
}

@media (max-width: 520px) {
    .masthead-independence {
        font-size: 0.62rem;
        max-width: 16.5rem;
    }
}

.wordmark {
    font-family: var(--display);
    font-optical-sizing: auto;
    font-size: 1.45rem;
    letter-spacing: -0.015em;
    color: #fff;
    text-decoration: none;
    font-weight: 650;
    line-height: 1.15;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
}

h1, h2, h3, h4 {
    font-family: var(--display);
    font-optical-sizing: auto;
    font-weight: 600;
    margin: 0 0 0.4rem;
    letter-spacing: -0.02em;
}

/* .page-title: an h2 that looks like the page h1 (the Timeline heading under the page's one h1). */
h1,
.page-title {
    font-size: clamp(1.7rem, 2.6vw, 2.4rem);
    line-height: 1.12;
    margin-bottom: 0.55rem;
}

p { line-height: 1.55; }

button, select, input {
    font: inherit;
}

.lede {
    color: var(--muted);
    max-width: 62ch;
    margin: 0 0 1.25rem;
}

.toolbar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.mode-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.mode {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    min-width: 14rem;
    padding: 0.2rem;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: #e8e2d4;
    box-shadow: inset 0 1px 2px rgba(11, 31, 51, 0.08);
    gap: 0.15rem;
}

.mode button {
    font: inherit;
    font-weight: 650;
    background: transparent;
    color: var(--muted);
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 1.15rem;
    min-height: 2.5rem;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.mode button:hover {
    color: var(--ink);
    background: rgba(255, 250, 241, 0.55);
}

.mode button.on,
.mode button.on:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 0 rgba(11, 31, 51, 0.18);
    transform: none;
}

.estimate-calc {
    margin-bottom: 1.5rem;
}

.estimate-tabset {
    margin: 0 0 1.5rem;
}

.estimate-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.2rem;
    margin: 0;
    padding: 0 0.15rem;
    border-bottom: 1px solid var(--ink);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tabs are links (crawlable addresses); the click is handled in place. */
.estimate-tabs [role="tab"] {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font: inherit;
    font-weight: 650;
    font-size: 0.95rem;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    /* No negative bottom margin: the bar scrolls sideways (overflow-x: auto), so a tab pulled 1px into the bar's
       bottom border overflowed it and drew a vertical scrollbar. The 1px comes off the bottom padding instead. */
    padding: 0.65rem 1.1rem calc(0.65rem - 1px);
    margin: 0;
    min-height: calc(2.5rem - 1px);
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.estimate-tabs [role="tab"]:hover {
    color: var(--ink);
    background: rgba(255, 250, 241, 0.55);
}

.estimate-tabs [role="tab"].on,
.estimate-tabs [role="tab"].on:hover,
.estimate-tabs [role="tab"][aria-selected="true"] {
    color: var(--ink);
    background: var(--card);
    border-color: var(--ink);
    border-bottom-color: var(--card);
    box-shadow: none;
    transform: none;
}

.estimate-panel {
    background: var(--card);
    border: 1px solid var(--ink);
    border-radius: 0 3px 3px 3px;
    padding: 1.15rem 1.25rem 1.25rem;
    box-shadow: var(--shadow);
    min-width: 0;
}

.estimate-panel > .results.card,
.estimate-panel > .ledger.card {
    background: transparent;
    border: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
}


@media (max-width: 640px) {
    .estimate-tabs {
        flex-wrap: nowrap;
        width: 100%;
        /* Tabs that do not fit (very narrow screens) still scroll sideways, without a scrollbar strip under them. */
        scrollbar-width: none;
    }
    .estimate-tabs::-webkit-scrollbar {
        display: none;
    }
    .estimate-tabs [role="tab"] {
        font-size: 0.85rem;
        padding: 0.55rem 0.75rem calc(0.55rem - 1px);
        flex: 0 0 auto;
    }
    .estimate-panel {
        padding: 1rem;
    }
}

.presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.presets button:not(.text-link),
.ghost {
    background: var(--card);
    border: 1px solid var(--ink);
    border-radius: 3px;
    padding: 0.42rem 0.85rem;
    cursor: pointer;
    color: var(--ink);
    box-shadow: 2px 2px 0 rgba(11, 31, 51, 0.12);
}

.presets button:not(.text-link):hover,
.ghost:hover {
    background: #fff;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 rgba(11, 31, 51, 0.16);
}

.presets button.on,
.presets button.on:hover {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
    box-shadow: 2px 2px 0 var(--primary);
    transform: none;
}

.autofill {
    margin-bottom: 1.25rem;
}

.autofill > label.field {
    max-width: 22rem;
    margin-bottom: 0.2rem;
}


.sketch-std-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1.1rem;
    margin: 0.15rem 0 0.75rem;
}

.sketch-mfj {
    margin: 0;
    font-weight: 650;
}









.ledger-not-calc {
    margin-top: 1.25rem;
    border-top: 1px solid #d5dde5;
    padding-top: 0.75rem;
}

.ledger-not-calc > summary {
    cursor: pointer;
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.ledger-not-calc[open] > summary {
    color: var(--ink);
}

/* Two-answer questions as compact segmented toggles: I rent | I own, Yes | No */
.sketch-own {
    display: inline-flex;
    margin: 0;
}

.sketch-own button {
    font: inherit;
    font-weight: 650;
    padding: 0.3rem 0.95rem;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}

.sketch-own button:first-child {
    border-radius: 3px 0 0 3px;
}

.sketch-own button:last-child {
    border-radius: 0 3px 3px 0;
}

.sketch-own button + button {
    margin-left: -1px;
}

.sketch-own button:focus-visible {
    position: relative;
    z-index: 1;
}

.sketch-own button.on,
.sketch-own button.on:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: none;
}

.sketch-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 1rem 1.25rem;
    align-items: center;
}

@media (max-width: 900px) {
    .sketch-grid { grid-template-columns: 1fr; }
}

.spend-pie-wrap canvas {
    max-width: 100% !important;
    height: auto !important;
}

.spend-pie-wrap {
    position: relative;
    height: 16rem;
}

.pie-sliders {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.pie-row {
    display: grid;
    grid-template-columns: 8px minmax(4.5rem, 6.5rem) minmax(0, 1fr) 2.2rem 3.8rem;
    gap: 0.35rem 0.4rem;
    align-items: center;
    font-size: 0.82rem;
}

@media (max-width: 900px) {
    .pie-row {
        grid-template-columns: 8px minmax(4rem, 1fr) minmax(0, 1.4fr) 2.2rem;
        font-size: 0.78rem;
    }
    .pie-row .pie-amt { display: none; }
}

@media (max-width: 520px) {
    .pie-row {
        grid-template-columns: 8px 1fr 2.2rem;
    }
    .pie-row input[type="range"] { grid-column: 1 / -1; }
}

.pie-swatch {
    width: 8px;
    height: 1.05rem;
    border-radius: 1px;
}

.pie-row input[type="range"] {
    width: 100%;
    margin: 0;
}

.pie-pct {
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    text-align: right;
}

.pie-amt {
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    text-align: right;
}

.pie-row.leftover .pie-amt {
    color: var(--muted);
    font-weight: 500;
}

.preset-custom {
    background: var(--star-soft);
    color: var(--star);
    border: 1px solid var(--star);
    border-radius: 3px;
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 650;
}

.text-link {
    background: none;
    border: none;
    color: var(--ink);
    text-decoration: underline;
    cursor: pointer;
    padding: 0.4rem 0.2rem;
    font: inherit;
}

.home-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Legacy .layout kept unused; estimate page is stacked (.estimate-calc + .estimate-tabset). */
.layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: stretch;
}

.layout.simple {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (max-width: 900px) {
    /* Pin totals live in the bottom drawer on narrow screens */
    .results-pin > .heading-tip {
        display: none;
    }
    .results-pin .who-table {
        margin-top: 0;
    }
}

.summary-drawer {
    display: none;
}

.summary-spacer {
    display: none;
}

@media (max-width: 900px) {
    .summary-drawer {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 25;
        background: var(--card);
        border-top: 2px solid var(--ink);
        box-shadow: 0 -6px 18px rgba(11, 31, 51, 0.12);
    }

    .summary-spacer {
        display: block;
        height: 4.4rem;
    }

    .summary-drawer.open + .summary-spacer {
        height: 11rem;
    }
}

.summary-drawer-bar {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--card);
    border: 0;
    font: inherit;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}

.summary-drawer-bar strong {
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 650;
    letter-spacing: -0.03em;
    margin-left: auto;
}

.summary-rate {
    color: var(--muted);
    font-size: 0.85rem;
}

.summary-chevron {
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    transform: rotate(45deg);
    margin-left: 0.35rem;
    flex: 0 0 auto;
}

.summary-drawer.open .summary-chevron {
    transform: rotate(225deg);
    margin-top: 0.3rem;
}

.summary-drawer-tray {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.85rem;
    padding: 0 1rem 0.9rem;
    font-size: 0.88rem;
}

.summary-drawer-tray div {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.summary-drawer-tray span {
    color: var(--muted);
}

/* Heading with its help mark beside it, so the mark is not part of the heading text. */
.heading-tip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.3rem;
    margin: 0 0 0.4rem;
}

.heading-tip > h2 {
    margin: 0;
}

/* "Full list of taxes in this model": a 24 px tall target without moving the line. */
.ledger-link {
    display: inline-block;
    padding: 2px 0;
    margin: -2px 0;
}

.summary-drawer-tray a {
    grid-column: 1 / -1;
    font-weight: 650;
}

.custom-mix {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.85rem;
}

.chart-tip {
    position: absolute;
    top: 0.35rem;
    left: 3.4rem;
    margin: 0;
    padding: 0.28rem 0.55rem;
    background: var(--ink);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    border-radius: 2px;
    pointer-events: none;
    z-index: 2;
    box-shadow: 2px 2px 0 var(--primary);
}

.card {
    background: var(--card);
    border: 1px solid var(--ink);
    border-radius: 3px;
    padding: 1.15rem 1.25rem 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.card h2 {
    font-size: 1.15rem;
}

.card .hint {
    color: var(--muted);
    font-size: 0.88rem;
    margin: 0 0 0.9rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem 1rem;
}

label.field {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    font-size: 0.82rem;
    color: var(--muted);
}

label.field input,
label.field select {
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 0.48rem 0.55rem;
    background: #fff;
    color: var(--ink);
    box-shadow: inset 0 -2px 0 rgba(11, 31, 51, 0.06);
}

label.field input:focus,
label.field select:focus {
    border-color: var(--ink);
    box-shadow: inset 0 -2px 0 var(--star);
    outline: none;
}

label.check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.92rem;
    color: var(--ink);
    margin: 0.4rem 0 0.8rem;
}

.results {
    position: static;
}


.results-pin {
    flex: 0 0 auto;
}

.results-scroll {
    min-height: 0;
}

.results-scroll h4 {
    font-size: 0.82rem;
    margin: 0.65rem 0 0.25rem;
    color: var(--muted);
    font-weight: 650;
}

.metric-btn {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    font: inherit;
}

/* Headline: label left, big number right; "% of income" right-aligned under the number. */
.total {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    column-gap: 1rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
}

.total-sub {
    grid-column: 1 / -1;
    justify-self: end;
    text-align: right;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.35;
}

.total > strong,
.total-amt {
    font-family: var(--display);
    font-optical-sizing: auto;
    font-size: 2.15rem;
    font-weight: 650;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.35rem;
}

.passed-plus {
    font-family: var(--display);
    font-size: 1.05rem;
    letter-spacing: 0;
    font-weight: 600;
    color: #8a5a2b;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.passed-plus:hover,
.passed-plus.on,
.embedded-plus:hover,
.embedded-plus.on {
    text-decoration: underline;
}

.embedded-plus {
    font-family: var(--display);
    font-size: 1.05rem;
    letter-spacing: 0;
    font-weight: 600;
    color: #4a3f72;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.metric.embedded {
    background: #ece8f4;
    box-shadow: inset 3px 0 0 #4a3f72;
}

.passed-toggle {
    margin: -0.35rem 0 0.85rem;
}

.metric-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.who-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
    margin: 0.35rem 0 0.75rem;
    font-size: 0.88rem;
}

.who-table th,
.who-table td {
    padding: 0.4rem 0.45rem;
    text-align: right;
    border-bottom: 1px solid #eee6d8;
    vertical-align: top;
}

.who-table thead th {
    text-align: right;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.who-table tbody th {
    text-align: left;
    font-weight: 650;
}

.who-table .who-sub {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
}

.who-table button,
.table-who {
    font: inherit;
    font-weight: 650;
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    cursor: pointer;
    text-align: inherit;
}

.table-who {
    color: var(--ink);
}

.who-table tbody th button {
    color: var(--ink);
}

.who-table tr.on th,
.who-table tr.on td {
    background: #f7f3ea;
}

.who-table tbody tr:hover th,
.who-table tbody tr:hover td {
    background: #f3eee3;
}

.now-since {
    padding: 0 1.15rem 1.1rem;
}

.now-since h3 {
    margin: 0 0 0.65rem;
}

.now-chart-wrap {
    height: 14rem;
    margin-bottom: 0.85rem;
}

.expand-block {
    margin-top: 0.85rem;
}

.expand-block > summary {
    cursor: pointer;
    font-weight: 650;
}

#ledger {
    scroll-margin-top: 5rem;
}

details.ledger > summary {
    cursor: pointer;
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 650;
    margin-bottom: 0.75rem;
}

.metric {
    background: #f7f3ea;
    border-radius: 2px;
    padding: 0.55rem 0.7rem;
    font-variant-numeric: tabular-nums;
}

.metric span {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
}

.metric b { font-size: 1.02rem; }

.metric.federal {
    background: #e8eef4;
    box-shadow: inset 3px 0 0 var(--secondary-deep);
}

.metric.illinois {
    background: #f4edd8;
    box-shadow: inset 3px 0 0 #c4a035;
}

.metric.chicago {
    background: #f8e9ec;
    box-shadow: inset 3px 0 0 var(--primary);
}

.metric.other {
    background: #eeeae2;
    box-shadow: inset 3px 0 0 #6b6254;
}

.metric.passed {
    background: #f3ece4;
    box-shadow: inset 3px 0 0 #8a5a2b;
}

.metric.burden {
    background: #e8e4f4;
    box-shadow: inset 3px 0 0 #4a3f72;
}

.rate-line {
    margin: -0.35rem 0 0.85rem;
}

/* Short incidence tag on a row; the explanation lives once, in the legend / popup above the table. */
.tag {
    display: inline-block;
    margin: 0 0.3rem 0 0;
    padding: 0.05rem 0.4rem;
    border: 1px solid #c9b79c;
    border-radius: 2px;
    background: #f6efe3;
    color: #8a5a2b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    vertical-align: 0.08em;
}

.row-tags {
    margin: 0.2rem 0 0;
}

.ledger-legend .tag {
    margin-left: 0.35rem;
}

/* Every tax name links to its /rates row. */
a.tax-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--muted, #6b7c8f);
    text-underline-offset: 0.18em;
}

a.tax-link:hover,
a.tax-link:focus-visible {
    color: var(--primary);
    text-decoration-style: solid;
}

.rates-table tr:target td,
.rates-table tr.row-target td {
    background: #fff4c7;
}

/* Timeline filter: All taxes | New taxes only. */
.tax-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.presets.segmented {
    gap: 0;
}

.presets.segmented button:not(.text-link) {
    border-radius: 0;
    box-shadow: none;
}

.presets.segmented button:first-child {
    border-radius: 3px 0 0 3px;
}

.presets.segmented button:last-child {
    border-radius: 0 3px 3px 0;
    margin-left: -1px;
}

.metric.since-rahm {
    background: #eef4e8;
    box-shadow: inset 3px 0 0 var(--good);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.compare-table th,
.compare-table td {
    text-align: right;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--line);
}

.compare-table th:first-child,
.compare-table td:first-child {
    text-align: left;
}

.compare-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 600;
}

.compare-table .total-row {
    font-weight: 700;
    background: #f4eee4;
}

.compare-table .federal td:first-child { box-shadow: inset 3px 0 0 #1b4f72; }
.compare-table .illinois td:first-child { box-shadow: inset 3px 0 0 #c4a035; }
.compare-table .chicago td:first-child { box-shadow: inset 3px 0 0 var(--star); }
.compare-table .other td:first-child { box-shadow: inset 3px 0 0 #6b6254; }
.compare-table .passed td:first-child { box-shadow: inset 3px 0 0 #8a5a2b; }
.compare-table .embedded td:first-child { box-shadow: inset 3px 0 0 #5a6b8a; }

.year-compare {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.year-pickers {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 1rem;
}

.year-pickers .field {
    min-width: 8.5rem;
    flex: 0 1 11rem;
    margin: 0;
}

.year-pickers select {
    font-size: 1.05rem;
    font-weight: 600;
    min-height: 2.4rem;
}

.year-vs {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--muted);
    padding: 0 0.15rem 0.5rem;
    line-height: 1;
}

.year-toggles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1.35rem;
}

.year-compare .presets {
    margin: 0;
}

/* Legacy scrub layout kept for any leftover markup */
.scrub {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1.25rem;
    align-items: end;
    margin-bottom: 1rem;
}

.scrub .presets,
.scrub .check {
    grid-column: 1 / -1;
}

.year-chart {
    position: relative;
}

.year-chart svg {
    width: 100%;
    height: auto;
    display: block;
}

.chart-grid {
    stroke: #ece6d8;
    stroke-width: 1;
}

.chart-axis,
.chart-year {
    font-size: 11px;
    fill: var(--muted);
    font-family: inherit;
}

.bar {
    cursor: pointer;
}

.bar.mark { stroke: var(--ink); stroke-width: 1.5; }

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.1rem;
    list-style: none;
    padding: 0.6rem 0 0;
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.chart-legend .swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 0.3rem;
    vertical-align: middle;
}

/* Delta text colors; never the plate banners (white text on a colored plate). */
.ledger-table .up:not(.did-banner) { color: var(--star); }
.ledger-table .down:not(.did-banner) { color: var(--good); }

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 3px solid var(--line);
}

.timeline li {
    padding: 0 0 1.15rem 1.1rem;
    position: relative;
}

.timeline li::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ink);
    position: absolute;
    left: -6.5px;
    top: 0.35rem;
}

.timeline li.new::before { background: var(--star); }
.timeline li.increase::before { background: var(--star); }
.timeline li.coming::before { background: var(--lake); }
.timeline li.proposed::before { background: var(--muted); border: 2px solid var(--ink); box-sizing: border-box; }
.timeline li.cut::before, .timeline li.repealed::before { background: var(--good); }
.timeline li.era::before { background: var(--lake); }

.outlook-h {
    font-size: 1.05rem;
    margin: 1.1rem 0 0.55rem;
}

.outlook-h:first-of-type { margin-top: 0.35rem; }

.tl-when {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.tl-who {
    font-size: 0.82rem;
    color: var(--muted);
}

.tl-title {
    font-family: var(--display);
    font-size: 1.05rem;
    margin: 0.1rem 0 0.2rem;
}

.fill-star,
.fill-chicago {
    background: linear-gradient(90deg, var(--star), #e36b7d);
}

.fill-federal {
    background: linear-gradient(90deg, #1b4f72, #5eb3d4);
}

.fill-illinois {
    background: linear-gradient(90deg, #c4a035, #e6d08a);
}

.fill-other {
    background: linear-gradient(90deg, #6b6254, #b8b09f);
}

.chicago-lines,
.bucket-lines {
    max-height: none;
    overflow: visible;
    margin-bottom: 0.5rem;
}

.bars { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1rem; }

.bar-row { display: grid; grid-template-columns: 110px 1fr 72px; gap: 0.5rem; align-items: center; font-size: 0.82rem; }

.track {
    background: #ece6d8;
    border-radius: 2px;
    height: 8px;
    overflow: hidden;
}

.fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ink), var(--lake));
    border-radius: 2px;
}

.lines {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lines li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.5rem;
    padding: 0.45rem 0;
    border-top: 1px solid #eee6d8;
    font-size: 0.88rem;
    align-items: baseline;
}

.line-pct {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    font-size: 0.8rem;
}

.line-amt {
    font: inherit;
    font-variant-numeric: tabular-nums;
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    cursor: pointer;
    text-align: right;
}

.calc-row {
    position: relative;
}

.results,
.results-scroll {
    overflow: visible;
}

.calc-tip {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 0.2rem);
    z-index: 8;
    max-width: 24rem;
    padding: 0.35rem 0.55rem;
    background: var(--ink);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    border-radius: 2px;
    box-shadow: 2px 2px 0 var(--primary);
    pointer-events: none;
    white-space: nowrap;
}

.calc-row:hover .calc-tip,
.calc-row:focus-within .calc-tip,
.calc-row.open .calc-tip {
    display: block;
}

@media (max-width: 900px) {
    .calc-row.open .calc-tip,
    .calc-row:focus-within .calc-tip {
        position: static;
        grid-column: 1 / -1;
        white-space: normal;
        margin-top: 0.2rem;
        max-width: none;
        box-shadow: none;
    }
}

.lines .who {
    color: var(--muted);
    font-size: 0.75rem;
}

.note {
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0.15rem 0 0;
}

.rates-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.rates-table th,
.rates-table td {
    text-align: left;
    padding: 0.55rem 0.4rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.rates-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: var(--card);
}

.not-found {
    max-width: 36rem;
    margin: 4rem auto;
    text-align: center;
}

.primary-btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    padding: 0.5rem 1rem;
    box-shadow: 3px 3px 0 var(--ink);
}

.kicker {
    color: var(--primary);
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    margin: 0 0 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.kicker::before {
    content: "";
    width: 0.7em;
    height: 0.7em;
    background: var(--star);
    -webkit-mask: var(--star-svg, url("/star.svg")) center / contain no-repeat;
    mask: var(--star-svg, url("/star.svg")) center / contain no-repeat;
    flex: 0 0 auto;
}

.ledger {
    margin-top: 1.5rem;
    scroll-margin-top: calc(var(--mast) + 0.5rem);
}

.callout {
    background: var(--star-soft);
    border-left: 4px solid var(--star);
    padding: 0.55rem 0.75rem;
    border-radius: 2px;
    font-size: 0.92rem;
}

.ledger-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    align-items: center;
    margin: 0.75rem 0;
}

.ledger-toolbar button {
    background: var(--card);
    border: 1px solid var(--ink);
    border-radius: 3px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
}

.ledger-toolbar button.on,
.ledger-toolbar button.on:hover {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
    box-shadow: 2px 2px 0 var(--star);
}

.check.tight {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.jump {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    margin: 0 0 0.85rem;
    font-size: 0.85rem;
}

.jump a {
    color: var(--ink);
}

.group-row {
    scroll-margin-top: calc(var(--mast) + 1.2rem);
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.ledger-table th {
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 0.45rem 0.4rem;
    border-bottom: 1px solid var(--line);
    background: var(--card);
    white-space: nowrap;
}

.ledger-table td {
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid #eee6d8;
    vertical-align: top;
}

.ledger-table .group-row td {
    font-family: var(--display);
    font-size: 0.95rem;
    padding-top: 1.1rem;
    border-bottom: 1px solid var(--ink);
    color: var(--ink);
}

.ledger-table tr.idle td {
    color: var(--muted);
}

.ledger-table .amt,
.compare-table td,
.compare-table th,
.metric b,
.bar-row {
    font-variant-numeric: tabular-nums;
}

.ledger-table td {
    overflow: visible;
}

.ledger-table .amt {
    text-align: right;
    white-space: nowrap;
}

.tax-id {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
    max-width: 14rem;
}

.tax-id a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}

.tax-id a:hover {
    border-bottom-color: var(--star);
}

.ledger-table .na,
.ledger-table .zero {
    color: var(--muted);
}

.tax-name {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.did-wrap {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.did-that {
    position: relative;
    display: block;
    width: 40px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    text-decoration: none;
    border-bottom: none;
    overflow: visible;
}

.did-that img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 2px solid var(--star);
    background: #ddd;
    display: block;
}

.did-banner {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    /* Base is muted; state classes set color. Never leave a bare red plate. */
    background: var(--muted, #6b7c8f);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 0.12rem 0.34rem;
    border-radius: 2px;
    line-height: 1.1;
    z-index: 2;
}

.did-banner.up { background: var(--star); }
.did-banner.cut,
.did-banner.down { background: var(--good); }
.did-banner.new {
    background: var(--lake-deep, #2e7fa3);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.did-banner.repealed { background: var(--ink); }
.did-banner.set { background: var(--muted, #6b7c8f); }
/* Fallback plate: labeled, neutral, never blank. */
.did-banner.neutral {
    background: var(--paper, #fff);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--muted, #6b7c8f);
    text-transform: none;
    letter-spacing: 0;
}

/* Initials (no free portrait) and the neutral fallback icon share the portrait circle. */
.did-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--star);
    background: var(--ink);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-sizing: border-box;
}

/* Badge initials are drawn by CSS, not text in the button, so the button's accessible name (the person and the
   banner) still holds all of its visible text. */
.did-avatar[data-initials]::before {
    content: attr(data-initials);
}

.did-avatar.did-neutral {
    background: #e9edf1;
    color: var(--muted, #6b7c8f);
    border-color: var(--muted, #6b7c8f);
}

.who-portrait .did-avatar {
    width: 96px;
    height: 96px;
    font-size: 2rem;
}
.did-banner.renewed {
    background: rgba(46, 127, 163, 0.55);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
    box-shadow: inset 0 0 0 1.5px var(--lake, #4a9bc7);
}

.did-bubble {
    display: none;
    position: absolute;
    z-index: 30;
    left: calc(100% + 0.55rem);
    top: -0.2rem;
    width: 14.5rem;
    padding: 0.55rem 0.7rem;
    background: var(--ink);
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.35;
    border-radius: 2px;
    box-shadow: 3px 3px 0 var(--star);
}

.did-bubble strong,
.did-bubble span,
.did-bubble a {
    display: block;
}

.did-bubble a {
    color: #cfe8f4;
    margin-top: 0.25rem;
}

.did-wrap:hover .did-bubble,
.did-wrap:focus-within .did-bubble,
.did-wrap.open .did-bubble {
    display: block;
}

@media (max-width: 900px) {
    .did-bubble {
        left: 0;
        right: auto;
        top: calc(100% + 0.4rem);
        width: min(16rem, calc(100vw - 3rem));
    }
}

.who-hero {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    margin: 0 0 1.2rem;
}

.who-portrait {
    width: 96px;
    height: 96px;
}

.who-portrait img {
    width: 96px;
    height: 96px;
}

.who-portrait .did-banner {
    font-size: 0.7rem;
    bottom: -6px;
    padding: 0.15rem 0.4rem;
}

.who-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.1rem;
}

.who-photo-credit {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--muted, #5a6570);
}

.who-photo-credit a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.who-quote {
    margin: 1rem 0 0;
    padding: 0.65rem 0.9rem 0.7rem 1rem;
    border-left: 4px solid var(--star);
    background: var(--star-soft);
    max-width: 46rem;
}

.who-quote p {
    margin: 0 0 0.4rem;
    font-family: var(--display);
    font-size: 1.12rem;
    line-height: 1.35;
}

.who-quote footer {
    font-size: 0.82rem;
    color: var(--muted);
    border: none;
    padding: 0;
    max-width: none;
}

.who-quote footer a {
    color: var(--muted);
}

.donate-list {
    margin: 0.4rem 0 0.9rem;
    padding-left: 1.15rem;
    line-height: 1.5;
}

#limits,
#revenue {
    scroll-margin-top: calc(var(--mast) + 0.5rem);
}

.rev-chart-wrap {
    position: relative;
    height: 22rem;
    margin: 0.6rem 0 0.75rem;
}

.donate-amounts {
    display: flex;
    gap: 0.5rem;
    margin: 0.4rem 0 1rem;
}

.donate-amounts span {
    border: 1px solid var(--ink);
    border-radius: 3px;
    padding: 0.35rem 0.75rem;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.primary-btn.is-disabled {
    opacity: 0.45;
    box-shadow: none;
    pointer-events: none;
}

.tl-who {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

/* Complex mode accordion */
details.complex-section {
    padding-top: 0.85rem;
}
details.complex-section > summary {
    list-style: none;
    cursor: pointer;
    margin: 0 0 0.65rem;
}
details.complex-section > summary::-webkit-details-marker { display: none; }
.complex-summary {
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 650;
}
details.complex-section > summary::after {
    content: "\25B8";
    display: inline-block;
    margin-left: 0.45rem;
    color: var(--muted);
    font-size: 0.85rem;
    transition: transform 0.12s ease;
}
details.complex-section[open] > summary::after {
    transform: rotate(90deg);
}

/* Home since block as details */
details.now-since {
    padding: 0 1.15rem 1.1rem;
}
details.now-since > summary {
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 650;
    cursor: pointer;
    list-style: none;
    margin: 0 0 0.65rem;
}
details.now-since > summary::-webkit-details-marker { display: none; }

/* Rates bucket collapse */
details.rates-bucket {
    margin-bottom: 1rem;
}
details.rates-bucket > summary {
    cursor: pointer;
    list-style: none;
}
details.rates-bucket > summary::-webkit-details-marker { display: none; }
.rates-bucket-title {
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 650;
}
details.rates-bucket > summary::after {
    content: "\25B8";
    margin-left: 0.45rem;
    color: var(--muted);
    font-size: 0.85rem;
    display: inline-block;
}
details.rates-bucket[open] > summary::after {
    transform: rotate(90deg);
}

/* Toolbar: mode + presets on one row when wide */
@media (min-width: 901px) {
    .toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }
}

.now-since-more {
    margin: -0.35rem 0 0.75rem;
}

@media (max-width: 900px) {
    .sketch-grid { grid-template-columns: 1fr; }
    .autofill, .card { min-width: 0; }
    .toolbar { flex-direction: column; align-items: stretch; }
}

/* "The breakdown": the section label under the Summary table, small capitals between a heavy and a thin rule. */
.breakdown-heading {
    font-family: var(--narrow);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.3;
    text-transform: uppercase;
    margin: 22px 0 0;
    padding: 4px 0;
    border-top: 3px solid var(--ink);
    border-bottom: 1px solid var(--ink);
}

/* Federal / Illinois / Local: the story heads under "The breakdown", in red condensed type; the same on desktop
   and phone. */
.results-scroll h4.breakdown-group {
    font-family: var(--cond);
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: none;
    color: var(--primary);
    margin: 12px 0 2px;
    padding: 0;
    border-left: 0;
    line-height: 1.05;
}

.breakdown-heading + h4.breakdown-group {
    margin-top: 10px;
}

/* Phone / narrow: no horizontal overflow */
@media (max-width: 900px) {
    .sketch-grid {
        grid-template-columns: 1fr;
    }
    .spend-pie-wrap {
        height: 12.5rem;
        max-width: 16rem;
        margin: 0 auto;
    }
    .presets {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        width: 100%;
    }
    .presets > button,
    .presets > .text-link {
        flex: 1 1 auto;
        min-width: 0;
    }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .mode-row {
        flex-wrap: wrap;
    }
    .home-stack,
    .layout,
    .layout.simple,
    .estimate-calc,
    .estimate-tabset,
    .estimate-panel,
    main,
    .card,
    .autofill,
    .results {
        min-width: 0;
        max-width: 100%;
    }
    .pie-row {
        grid-template-columns: 8px minmax(0, 1fr) minmax(0, 1.2fr) 2.2rem;
        font-size: 0.78rem;
    }
    .pie-row .pie-amt { display: none; }
}

@media (max-width: 520px) {
    h1,
    .page-title {
        font-size: 1.55rem;
        line-height: 1.2;
    }
    .lede {
        font-size: 0.95rem;
    }
    .spend-pie-wrap {
        height: 11rem;
        max-width: 14rem;
    }
    .pie-row {
        grid-template-columns: 8px minmax(0, 1fr) 2rem;
    }
    .pie-row input[type="range"] {
        grid-column: 1 / -1;
    }
    .who-table {
        font-size: 0.78rem;
    }
    .who-table th,
    .who-table td {
        padding: 0.35rem 0.25rem;
    }
}

/* Feedback page paths */
.feedback-paths {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

@media (max-width: 700px) {
    .feedback-paths { grid-template-columns: 1fr; }
}

.feedback-path {
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.85rem 1rem;
    background: #fff;
}

.feedback-path h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.feedback-template {
    background: #f7f3ea;
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 0.65rem 0.75rem;
    font-size: 0.82rem;
    white-space: pre-wrap;
    overflow-x: auto;
}

.estimate-disclaimer {
    margin: 0.35rem 0 0.75rem;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
}

.estimate-do-not-file {
    margin: 0.25rem 0 0.35rem;
    font-size: 0.9rem;
    color: var(--text, #0b1f33);
}
.omissions-list {
    margin: 0.35rem 0 0.75rem 1.1rem;
    padding: 0;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.4;
}
.omissions-list li { margin: 0.15rem 0; }
.info-body .omissions-list {
    font-size: 0.9rem;
    color: inherit;
}

/* Summary table: Total column on the right; the table scrolls inside its own box if a phone is too narrow. */
.who-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Match the Federal / Illinois / Local header buttons (title case, ink). */
.who-table thead .row-total {
    text-transform: none;
    color: var(--ink);
}

.who-table .row-total {
    font-weight: 700;
    border-left: 1px solid var(--line);
    padding-left: 0.6rem;
}

@media (max-width: 600px) {
    .who-table .row-total {
        padding-left: 0.35rem;
    }
}

/* All-in taxes: bold sum row under Employer pays; its "% of income" (of wages plus the employer's share, with an info
   mark) sits small under the Total cell. */
.who-table tr.all-in th,
.who-table tr.all-in td {
    font-weight: 700;
    color: var(--ink);
    border-top: 2px solid var(--ink);
}

.who-table .all-in-share {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
}

/* Its info mark sits at the table's right edge: no negative right margin, and the 44px tap area grows leftward, so
   neither reaches past the table and adds a sideways scrollbar. */
.who-table .all-in-share .info-btn {
    margin-right: 0;
}

.who-table .all-in-share .info-btn::after {
    left: auto;
    right: 0;
    transform: translateY(-50%);
}

/* Phone: let "40% of income" wrap under the Total so the table fits a 360px screen without sideways scroll. */
@media (max-width: 600px) {
    .who-table .all-in-share {
        white-space: normal;
    }
}

/* Vs Indiana: a comparison, not part of the sum, set apart below All-in taxes. */
.who-table tr.vs-row th,
.who-table tr.vs-row td {
    border-top: 1px solid var(--line);
    padding-top: 0.9rem;
}
.estimate-disclaimer-more { margin-top: 0.35rem; }
.estimate-disclaimer-more summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.8rem;
}

/* Passed-on explainer: tap-to-open card (bottom sheet on phones). */
.toggle-info {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem; /* same as .check.tight, so the icon is 0.75em of the label */
}

/* Small raised "i" beside its label; the 44px tap target comes from an invisible ::after so layout does not move. */
.info-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* At least 24 x 24 px to tap (WCAG 2.5.8 target size). The negative margins give the extra space back, so the
       1.3em mark and the text around it stay where they were; ::after keeps the larger 44 px touch area. */
    min-width: 24px;
    min-height: 24px;
    margin: min(0px, (1.3em - 24px) / 2);
    margin-left: calc(0.2em + min(0px, (1.3em - 24px) / 2));
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    opacity: 0.85;
    font: inherit;
    font-size: 0.75em;
    line-height: 1;
    vertical-align: super;
    align-self: flex-start;
    cursor: pointer;
}

.info-btn::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
}

.info-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3em;
    height: 1.3em;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-family: var(--display);
    font-weight: 700;
    font-style: italic;
    line-height: 1;
}

.info-btn:hover,
.info-btn:focus-visible,
.info-btn[aria-expanded="true"] {
    color: var(--ink);
    opacity: 1;
}

/* The summary table resets its buttons; keep the icon muted there and the dialog in normal text. */
.who-table .info-btn {
    color: var(--muted);
    font-size: 0.75em;
    font-weight: 700;
}

.who-table .info-btn:hover,
.who-table .info-btn[aria-expanded="true"] {
    color: var(--ink);
}

.info-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(11, 31, 51, 0.45);
}

.info-sheet {
    width: 100%;
    max-width: 28rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 0.9rem 1.1rem 1.1rem;
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 3px;
    box-shadow: 4px 4px 0 var(--star);
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
}

.info-sheet:focus {
    outline: none;
}

.info-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.info-head h3 {
    margin: 0.55rem 0 0;
    font-family: var(--display);
    font-size: 1.15rem;
    line-height: 1.3;
}

.info-sheet .info-close {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0 0.9rem;
    border: 1px solid var(--ink);
    border-radius: 3px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
    font-weight: 650;
    cursor: pointer;
}

.info-sheet .info-close:hover {
    background: var(--paper);
}

.info-body p {
    margin: 0.65rem 0 0;
    font-size: 1rem;
}

/* StaticInfoPopup (pages without a Blazor circuit): the same card built from spans, so it can sit in a line of text;
   hidden until site.js opens it. */
.info-overlay[hidden] {
    display: none;
}

.static-info .info-sheet,
.static-info .info-head,
.static-info .info-body,
.static-info .info-p {
    display: block;
}

.static-info .info-head {
    display: flex;
}

.static-info .info-title {
    display: block;
    margin: 0.55rem 0 0;
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

.static-info .info-p {
    margin: 0.65rem 0 0;
    font-size: 1rem;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.focus-sentinel {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 520px) {
    .info-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .info-sheet {
        max-width: none;
        max-height: 85vh;
        border-width: 2px 0 0;
        border-radius: 10px 10px 0 0;
        box-shadow: 0 -6px 18px rgba(11, 31, 51, 0.18);
        padding-bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
    }
}

/* Phones: wide tables scroll inside their card instead of widening the page. The plate bubble becomes a bottom
   sheet so the scrolling table cannot clip it. */
@media (max-width: 640px) {
    .ledger-table,
    .rates-table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .did-bubble {
        position: fixed;
        left: 0.75rem;
        right: 0.75rem;
        top: auto;
        bottom: 0.75rem;
        width: auto;
        z-index: 1000;
    }
}

/* Yes / no questions (rent or own, car) and spending category popups */
.choice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    margin: 0.5rem 0 0.85rem;
}

.choice-q {
    font-weight: 650;
}

/* Simple: both questions on one row; they stack on narrow screens */
.choice-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 2.5rem;
    margin: 0.4rem 0 0.85rem;
}

.choice-row > .choice {
    margin: 0;
}

@media (max-width: 600px) {
    .choice-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .sketch-own button {
        min-height: 44px;
    }
}

.pie-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.slice-h {
    margin: 0.75rem 0 0.3rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.slice-lines {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
}

.slice-lines li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid var(--line);
}

.slice-share {
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.slice-taxes {
    font-size: 0.92em;
}

/* Analytics choice bar (consent.js): one line at the bottom until the visitor picks OK or No thanks. The page and the
   phone totals drawer move up by its height (--consent-h) so nothing sits under it. */
body {
    padding-bottom: var(--consent-h, 0px);
}

@media (max-width: 900px) {
    .summary-drawer {
        bottom: var(--consent-h, 0px);
    }
}

.consent-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: var(--card);
    border-top: 2px solid var(--ink);
    box-shadow: 0 -6px 18px rgba(11, 31, 51, 0.12);
    padding: 0.35rem 1rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
}

.consent-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.15rem 1rem;
}

.consent-bar p {
    margin: 0;
    color: var(--ink);
    font-size: 0.95rem;
}

.consent-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.consent-actions a,
.consent-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    font: inherit;
    font-weight: 650;
}

.consent-actions a {
    padding: 0 0.5rem;
    color: var(--ink);
}

.consent-actions button {
    padding: 0 1rem;
    border: 1px solid var(--ink);
    border-radius: 3px;
    cursor: pointer;
}

.consent-actions .consent-ok {
    background: var(--ink);
    color: #fff;
    box-shadow: 2px 2px 0 var(--primary);
}

.consent-actions .consent-no {
    background: var(--card);
    color: var(--ink);
    box-shadow: 2px 2px 0 rgba(11, 31, 51, 0.12);
}

.consent-actions .consent-no:hover {
    background: #fff;
}

.consent-actions a:focus-visible,
.consent-actions button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (max-width: 520px) {
    .consent-actions {
        width: 100%;
    }
    .consent-actions a {
        margin-right: auto;
        padding-left: 0;
    }
}

.privacy-choice {
    min-height: 44px;
    font: inherit;
    font-weight: 650;
}

/* ==================================================================================================================
   Newspaper design (2026-10). Newsprint, black ink, one red accent, thin and double rules, square corners; condensed
   serif headlines and big figures, a text serif for reading, a narrow sans for labels, tables and numbers.
   The colour tokens are reset on the page body only (main, footer, consent bar), so the comic header keeps its own.
   ================================================================================================================== */
main,
footer,
.consent-bar,
#blazor-error-ui {
    --primary: #b5121b;
    --primary-soft: #f6e3e1;
    --star: #b5121b;
    --star-soft: #f6e3e1;
    --secondary: #141414;
    --secondary-deep: #141414;
    --lake: #4a4a4a;
    --lake-deep: #141414;
    --ink: #141414;
    --paper: #f3efe4;
    --card: #fbf9f3;
    --line: #9a9486;
    --hair: #9a9486;
    --muted: #4a4a4a;
    --good: #141414;
    --shadow: none;
    --notice-shadow: 4px 4px 0 rgba(0, 0, 0, 0.18);
    /* Chart colours: Chart.js's built-in palette (its Colors plugin, Chart.js 4.4.7); ChartPalette.cs holds the same
       values for the pie. The Timeline bars, legend and table keys use these; everything else stays newspaper ink. */
    --chart-blue: rgb(54, 162, 235);
    --chart-red: rgb(255, 99, 132);
    --chart-orange: rgb(255, 159, 64);
    --chart-yellow: rgb(255, 205, 86);
    --chart-teal: rgb(75, 192, 192);
    --chart-purple: rgb(153, 102, 255);
    --chart-grey: rgb(201, 203, 207);
    --chart-grey-light: rgba(201, 203, 207, 0.5);
    /* Hatched marker for coming/era rows in the tax history list (not a chart). */
    --pat-hatch: repeating-linear-gradient(45deg, #141414 0 1.4px, #f3efe4 1.4px 3.6px);
    color: var(--ink);
    font-family: var(--text);
}

main {
    font-size: 1.0625rem;
}

main a {
    color: var(--ink);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
}

main a:hover {
    color: var(--primary);
}

main p {
    line-height: 1.5;
}

/* Headlines */
main h1,
main h2,
main h3 {
    font-family: var(--cond);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.02;
}

main h4 {
    font-family: var(--narrow);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* The page headline: centred over a heavy and a thin rule, like a front page. */
main > h1 {
    margin: 0.35rem 0 0;
    padding-bottom: 0.55rem;
    text-align: center;
    font-size: clamp(2.5rem, 6.4vw, 4.9rem);
    line-height: 0.95;
    border-bottom: 4px solid var(--ink);
    box-shadow: 0 3px 0 0 var(--paper), 0 4px 0 0 var(--ink);
}

main .page-title {
    font-size: clamp(1.8rem, 3.4vw, 2.4rem);
    margin: 0.25rem 0 0.4rem;
}

main .kicker {
    color: var(--primary);
    font-family: var(--narrow);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

main .who-hero h1 {
    font-size: clamp(2.1rem, 4.4vw, 3.2rem);
    margin: 0 0 0.35rem;
}

main > .kicker:has(+ h1) {
    justify-content: center;
    margin: 0;
}

main > h1 + .lede {
    max-width: 60ch;
    margin: 1rem auto 1.75rem;
    text-align: center;
    font-size: 1.15rem;
    font-style: italic;
    color: var(--ink);
}

main .lede {
    color: var(--ink);
    font-size: 1.08rem;
}

main .hint,
main .card .hint {
    color: #2f2f2f;
    font-size: 0.95rem;
    line-height: 1.42;
}

/* Sections: a heavy rule on top instead of a rounded card. */
main .card {
    background: transparent;
    border: 0;
    border-top: 3px solid var(--ink);
    border-radius: 0;
    box-shadow: none;
    padding: 0.7rem 0 0;
    margin: 0 0 2.2rem;
}

main .card h2 {
    font-size: clamp(1.55rem, 2.6vw, 2rem);
    margin: 0 0 0.5rem;
}

main .card h3:not(.breakdown-heading) {
    font-size: 1.35rem;
}

main .callout {
    background: var(--card);
    border: 1px solid var(--ink);
    border-left: 4px solid var(--primary);
    border-radius: 0;
}

/* Buttons: square, narrow capitals; the chosen one is solid black. */
main .ghost,
main .presets button:not(.text-link),
main .ledger-toolbar button,
main .mode button,
main .sketch-own button,
.consent-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 0.9rem;
    border: 1.5px solid var(--ink);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    transform: none;
    font-family: var(--narrow);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

main .ghost:hover,
main .presets button:not(.text-link):hover,
main .ledger-toolbar button:hover,
main .mode button:hover,
main .sketch-own button:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--ink);
    transform: none;
    box-shadow: none;
}

main .presets button.on,
main .presets button.on:hover,
main .ledger-toolbar button.on,
main .ledger-toolbar button.on:hover,
main .mode button.on,
main .mode button.on:hover {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
    box-shadow: none;
}

main .presets.segmented button:not(.text-link),
main .presets.segmented button:first-child,
main .presets.segmented button:last-child {
    border-radius: 0;
}

main .mode {
    display: inline-flex;
    min-width: 0;
    padding: 0;
    gap: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

main .mode button + button {
    border-left: 0;
}

/* Two-answer questions: ballot boxes. */
main .sketch-own {
    gap: 8px;
}

main .sketch-own button,
main .sketch-own button:first-child,
main .sketch-own button:last-child {
    gap: 8px;
    padding: 0 16px 0 10px;
    margin: 0;
    border-radius: 0;
}

main .sketch-own button::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid var(--ink);
    background: #fff;
    flex: none;
}

main .sketch-own button.on,
main .sketch-own button.on:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--ink);
}

main .sketch-own button.on::before {
    background: var(--ink);
    box-shadow: inset 0 0 0 2px #fff;
}

main .text-link {
    color: var(--ink);
    font-family: var(--text);
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

main .primary-btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 1.1rem;
    border-radius: 0;
    background: var(--ink);
    color: #fff;
    box-shadow: 3px 3px 0 var(--primary);
    font-family: var(--narrow);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
}

main .primary-btn:hover {
    color: #fff;
    background: #000;
}

/* Inputs: figures on an underline. */
main label.field {
    color: var(--ink);
    font-size: 1rem;
}

main label.field input,
main label.field select {
    min-height: 44px;
    padding: 2px 4px 0;
    border: 0;
    border-bottom: 2px solid var(--ink);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--ink);
    font-family: var(--narrow);
    font-size: 1.15rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

main label.field input:focus,
main label.field select:focus {
    border-color: var(--ink);
    box-shadow: none;
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

main label.check {
    gap: 10px;
    min-height: 44px;
    margin: 0.2rem 0 0.4rem;
    color: var(--ink);
    font-size: 1.02rem;
    cursor: pointer;
}

main label.check.tight {
    margin: 0;
    color: var(--ink);
    font-size: 0.98rem;
}

main input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 2px solid var(--ink);
    border-radius: 0;
    background: #fff;
    cursor: pointer;
}

main input[type="checkbox"]:checked::after {
    content: "\2715";
    color: var(--ink);
    font: 900 14px/1 var(--narrow);
}

main input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 32px;
    background: transparent;
    cursor: pointer;
}

main input[type="range"]::-webkit-slider-runnable-track {
    height: 2px;
    background: var(--ink);
}

main input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 20px;
    margin-top: -9px;
    border: 2px solid var(--paper);
    border-radius: 0;
    background: var(--ink);
    box-shadow: 0 0 0 1px var(--ink);
}

main input[type="range"]::-moz-range-track {
    height: 2px;
    background: var(--ink);
}

main input[type="range"]::-moz-range-thumb {
    width: 10px;
    height: 18px;
    border: 2px solid var(--paper);
    border-radius: 0;
    background: var(--ink);
}

main input[type="range"]:focus-visible::-webkit-slider-thumb {
    background: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

/* Tabs: section links under a heavy rule; the open one is red and underlined. */
main .estimate-tabs {
    gap: 0;
    padding: 0;
    align-items: stretch;
    border-top: 3px solid var(--ink);
    border-bottom: 1px solid var(--ink);
}

main .estimate-tabs [role="tab"],
main .estimate-tabs [role="tab"]:hover {
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-left: 1px solid var(--hair);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--narrow);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

main .estimate-tabs [role="tab"]:first-child {
    border-left: 0;
    padding-left: 0;
}

main .estimate-tabs [role="tab"]:hover {
    color: var(--primary);
}

main .estimate-tabs [role="tab"].on,
main .estimate-tabs [role="tab"][aria-selected="true"] {
    color: var(--primary);
    background: transparent;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}

main .estimate-panel {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* Tables: narrow-sans heads over a heavy rule, dotted hairlines between rows. */
main .rates-table,
main .ledger-table,
main .compare-table {
    font-size: 0.98rem;
}

main .rates-table th,
main .ledger-table th,
main .compare-table thead th {
    background: transparent;
    color: var(--ink);
    border-bottom: 2px solid var(--ink);
    font-family: var(--narrow);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

main .rates-table td,
main .ledger-table td,
main .compare-table td,
main .compare-table th {
    border-bottom: 1px dotted var(--hair);
}

main .ledger-table .amt,
main .compare-table td,
main .rates-table td:not(:first-child) {
    font-family: var(--narrow);
    font-variant-numeric: tabular-nums;
}

main .ledger-table .group-row td,
main .compare-table .group-row td {
    font-family: var(--cond);
    font-weight: 900;
    font-size: 1.25rem;
    color: var(--primary);
    border-bottom: 1px solid var(--ink);
}

main .compare-table .total-row {
    background: transparent;
    font-weight: 700;
}

main .compare-table .total-row td {
    border-top: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
}

main .rates-table tr:target td,
main .rates-table tr.row-target td {
    background: #f6e3e1;
}

main .tag {
    border: 1px solid var(--ink);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--narrow);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

main .tax-id {
    font-family: var(--narrow);
}

main .jump a[href] {
    padding: 0.35rem 0;
    border-radius: 0;
    background: none;
    color: var(--ink);
    text-decoration: underline;
}

main .jump a[href]:hover {
    color: var(--primary);
    background: none;
}

main a.tax-link {
    text-decoration-color: var(--hair);
}

main details.rates-bucket > summary::after,
main details.complex-section > summary::after {
    color: var(--ink);
}

main .rates-bucket-title,
main .complex-summary,
main details.ledger > summary,
main .ledger-not-calc > summary {
    font-family: var(--cond);
    font-weight: 900;
}

/* Portraits: black and white, square, with a red banner. */
main .did-that {
    width: 44px;
    height: 54px;
}

main .did-that img,
main .did-avatar {
    width: 44px;
    height: 50px;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: #ddd8ca;
}

main .did-that img {
    filter: grayscale(1) contrast(1.25);
}

main .did-avatar {
    color: var(--ink);
    font-family: var(--cond);
    font-size: 1.15rem;
    font-weight: 900;
}

main .did-avatar.did-neutral {
    background: #ece7da;
    color: var(--ink);
    border-color: var(--ink);
}

main .did-banner {
    bottom: 0;
    min-width: calc(100% + 6px);
    padding: 0 3px;
    border-radius: 0;
    background: var(--muted);
    color: #fff;
    font-family: var(--narrow);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    box-shadow: none;
}

main .did-banner.up,
main .did-banner.new,
main .did-banner.renewed {
    background: var(--primary);
    color: #fff;
    text-shadow: none;
    box-shadow: none;
}

main .did-banner.cut,
main .did-banner.down,
main .did-banner.repealed {
    background: var(--ink);
}

main .did-banner.set {
    background: var(--muted);
}

main .did-banner.neutral {
    background: var(--card);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--ink);
}

main .who-portrait,
main .who-portrait img,
main .who-portrait .did-avatar {
    width: 96px;
    height: 110px;
}

main .who-portrait .did-banner {
    bottom: -6px;
    font-size: 0.7rem;
}

/* Pop-ups and tips: a boxed notice on newsprint. */
main .info-sheet {
    background: var(--card);
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 0;
    box-shadow: var(--notice-shadow);
    font-family: var(--text);
}

main .info-head {
    align-items: baseline;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--ink);
}

main .info-head h3,
main .static-info .info-title {
    margin: 0.35rem 0 0;
    font-size: 1.4rem;
}

main .info-sheet .info-close {
    border: 1px solid var(--ink);
    border-radius: 0;
    background: transparent;
    font-family: var(--narrow);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

main .info-sheet .info-close:hover {
    background: rgba(0, 0, 0, 0.06);
}

main .info-overlay {
    background: rgba(20, 20, 20, 0.45);
}

main .info-mark {
    font-family: var(--text);
}

@media (max-width: 520px) {
    main .info-sheet {
        border-width: 3px 0 0;
        border-radius: 0;
        box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.08);
    }
}

main .help-mark {
    border-color: currentColor;
    font-family: var(--narrow);
}

main .help-bubble,
main .did-bubble,
main .calc-tip,
main .chart-tip {
    background: var(--card);
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 0;
    box-shadow: var(--notice-shadow);
}

main .help-bubble,
main .did-bubble {
    font-family: var(--text);
    font-size: 0.92rem;
}

main .did-bubble a {
    color: var(--ink);
    text-decoration: underline;
}

main .calc-tip,
main .chart-tip {
    font-family: var(--narrow);
    font-weight: 600;
}

/* Dated lists (Timeline, New taxes). */
main .timeline {
    border-left: 2px solid var(--ink);
}

main .timeline li::before {
    border-radius: 0;
    background: var(--ink);
}

main .timeline li.new::before,
main .timeline li.increase::before {
    background: var(--primary);
}

main .timeline li.cut::before,
main .timeline li.repealed::before {
    background: #fff;
    border: 2px solid var(--ink);
    box-sizing: border-box;
}

main .timeline li.coming::before,
main .timeline li.era::before {
    background: var(--pat-hatch);
}

main .tl-when {
    color: var(--primary);
    font-family: var(--narrow);
    font-weight: 700;
}

main .tl-who {
    font-family: var(--narrow);
}

main .outlook-h {
    font-family: var(--cond);
    font-weight: 900;
}

main .tl-title {
    font-family: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Who page, Feedback, Donate */
main .who-quote {
    background: transparent;
    border-left: 4px solid var(--primary);
}

main .who-quote p {
    font-family: var(--text);
    font-style: italic;
    font-size: 1.2rem;
}

main .feedback-path {
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--card);
}

main .feedback-template {
    border-radius: 0;
    background: var(--card);
    border: 1px solid var(--ink);
}

main .donate-amounts span {
    border-radius: 0;
    font-family: var(--narrow);
}

/* Analytics choice bar */
.consent-bar {
    background: var(--paper);
    border-top: 4px double var(--ink);
    box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.consent-actions .consent-ok {
    background: var(--ink);
    color: var(--paper);
    box-shadow: none;
}

.consent-actions .consent-no {
    background: transparent;
    box-shadow: none;
}

.consent-actions .consent-no:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* ---- Estimate page: dateline, the household box on the left, the results column on the right ---------------- */
main .dateline {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 12px;
    padding: 6px 0;
    border-top: 1px solid var(--ink);
    border-bottom: 3px double var(--ink);
    font-family: var(--narrow);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
}

main .dateline .lede {
    margin: 0;
    max-width: none;
    color: var(--ink);
    font-size: inherit;
    line-height: inherit;
}

main .dateline + h1 {
    margin-top: 0.75rem;
    margin-bottom: 1.1rem;
}

.news-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.news-grid > * {
    min-width: 0;
}

.phone-lead {
    display: none;
}

/* Featured box: a heavy black frame, a black band with the title in white and a thin red rule under it. */
main .feature {
    border: 3px solid var(--ink);
    background: var(--card);
}

main .feature > .band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin: 0;
    padding: 12px 18px 11px;
    background: var(--ink);
    color: #fff;
    border-bottom: 3px solid var(--primary);
}

main .feature .c-title {
    margin: 0;
    color: #fff;
    font-family: var(--cond);
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
}

main .feature .c-body {
    padding: 16px 18px 20px;
}

/* The household line: once, in small caps under the heading, on every screen. */
.household .c-sum {
    order: 3;
    flex: 1 1 100%;
    color: var(--ink);
    font-family: var(--narrow);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.1;
    font-variant-caps: all-small-caps;
}

.household .c-fold {
    display: none;
}

.household {
    margin: 0 0 1.5rem;
}

/* A newspaper section heading, not a black box: the serif headline on the paper, a heavy rule above it and a thin
   rule under the household line, like the results column beside it. No frame around the inputs. */
main .household.feature {
    border: 0;
    background: transparent;
}

main .household > .band {
    padding: 8px 0;
    background: transparent;
    color: var(--ink);
    border-top: 3px solid var(--ink);
    border-bottom: 1px solid var(--ink);
}

main .household .c-title {
    color: var(--ink);
}

main .household .c-body {
    padding: 14px 0 0;
}

/* Inside the box: mode and presets first, then the inputs on dotted leaders. */
.household .toolbar,
.household .toolbar .mode-row,
.household .presets {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.household .toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin: 0 0 6px;
}

.household .presets {
    gap: 8px;
}

.household .presets > button:not(.text-link) {
    flex: 0 0 auto;
}

.household .presets > .text-link {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 4px;
    font-family: var(--narrow);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}


/* Three toggles side by side (Detail, Home, Income), each a labeled segmented control in the .mode style. */
.household .toggles {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 16px;
}

.household .toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.household .toggle-label {
    font-family: var(--narrow);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.household .toggle-head {
    display: inline-flex;
    align-items: flex-start;
    font-size: 0.85rem;
}

.household .income-custom {
    font-family: var(--narrow);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary);
}

.household .autofill,
.household .estimate-calc {
    margin: 0;
}

.household .grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.household label.field {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    margin: 4px 0 10px;
    font-size: 1.06rem;
    line-height: 1.25;
}

.household label.field::after {
    content: "";
    order: 1;
    flex: 1 1 12px;
    min-width: 12px;
    margin-bottom: 8px;
    border-bottom: 1px dotted #777;
}

.household label.field input,
.household label.field select {
    order: 2;
    flex: 0 0 auto;
    width: 118px;
    text-align: right;
    font-size: 1.4rem;
}

.household label.field select {
    width: auto;
    max-width: 62%;
    text-align: left;
    font-size: 1.05rem;
}

.household .hint {
    margin: 6px 0 10px;
}

.household .sketch-std-row {
    margin: 0 0 4px;
}

.household .choice-row {
    display: grid;
    gap: 12px;
    margin: 12px 0 8px;
    padding-top: 12px;
    border-top: 1px solid var(--ink);
}

.household .choice {
    display: block;
    margin: 0;
}

.household .choice-q {
    display: block;
    margin-bottom: 6px;
    font-weight: 400;
    font-size: 1.05rem;
}

.household .callout {
    margin: 0 0 12px;
}

/* Spending pie above its sliders. */
.household .sketch-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--ink);
}

.household .spend-pie-wrap {
    width: 220px;
    max-width: 100%;
    height: 220px;
    margin: 0 auto;
}

.household .pie-sliders {
    gap: 2px;
}

.household .pie-row {
    grid-template-columns: 16px minmax(0, 1fr) auto auto;
    grid-template-areas: "sw label pct amt" "range range range range";
    gap: 0 8px;
    padding-top: 4px;
    border-bottom: 1px dotted var(--hair);
    font-size: 1.02rem;
}

.household .pie-swatch {
    grid-area: sw;
    width: 16px;
    height: 16px;
    border: 1px solid var(--ink);
    border-radius: 0;
}

.household .pie-label {
    grid-area: label;
}

.household .pie-row input[type="range"] {
    grid-area: range;
    grid-column: 1 / -1;
    width: 100%;
}

.household .pie-pct {
    grid-area: pct;
    min-width: 2.6em;
    color: var(--ink);
    font-family: var(--narrow);
    font-weight: 700;
}

.household .pie-row .pie-amt {
    display: block;
    grid-area: amt;
    font-family: var(--narrow);
    font-weight: 500;
}

/* Complex mode: the same box, each group under a rule. */
.household details.complex-section {
    margin: 0;
    padding: 10px 0 6px;
    border: 0;
    border-top: 1px solid var(--ink);
    background: transparent;
}

.household details.complex-section:first-child {
    border-top: 0;
    padding-top: 4px;
}

.household details.complex-section > summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin: 0;
}

.household .complex-summary {
    font-size: 1.5rem;
}

/* Results column: section links, the main figure, the three figure columns, the box score, the breakdown. */
main .estimate-tabset {
    margin: 0;
}

main .estimate-panel > .card:first-child {
    border-top: 0;
    padding-top: 14px;
}

main .estimate-panel > .kicker:first-child {
    margin-top: 14px;
}

main .results-pin {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 20px;
}

main .results-pin > * {
    grid-column: 1 / -1;
    min-width: 0;
}

main .results-pin > .heading-tip {
    grid-column: 1;
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--ink);
}

main .results-pin > .heading-tip > h2 {
    font-size: 2rem;
    line-height: 1;
}

main .results-pin > .total {
    grid-column: 2;
    border-bottom: 1px solid var(--ink);
}

main .total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin: 0;
    padding: 12px 0;
    border-bottom: 0;
    text-align: right;
}

main .total > span:first-child {
    font-size: 1rem;
}

main .total > strong,
main .total-amt {
    font-family: var(--cond);
    font-size: 5.6rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 0.9;
}

main .total-sub {
    font-family: var(--narrow);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink);
}

main .figs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    margin: 0 0 16px;
    border-bottom: 1px solid var(--ink);
}

main .fig {
    display: flex;
    flex-direction: column;
    padding: 10px 14px 12px;
    border-left: 1px solid var(--hair);
}

main .fig:first-child {
    padding-left: 0;
    border-left: 0;
}

main .fig-kick {
    color: var(--primary);
    font-family: var(--narrow);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-transform: uppercase;
}

main .fig-num {
    margin: 4px 0 2px;
    font-family: var(--cond);
    font-size: 2.9rem;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

main .fig-dek {
    font-style: italic;
}

/* Box score */
main .who-table {
    margin: 0;
    border-top: 3px solid var(--ink);
    font-family: var(--narrow);
    font-size: 1rem;
    line-height: 1.2;
}

main .who-table th,
main .who-table td {
    padding: 7px 8px;
    border-bottom: 1px dotted var(--hair);
}

main .who-table thead th {
    padding: 6px 8px;
    border-bottom: 2px solid var(--ink);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

main .who-table thead th:first-child,
main .who-table tbody th {
    padding-left: 0;
}

main .who-table .table-who,
main .who-table tbody th button {
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

main .who-table .table-who,
main .who-table thead .row-total {
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

main .who-table tbody th {
    font-weight: 700;
}

main .who-table .who-sub {
    color: var(--muted);
    font-family: var(--text);
    font-size: 0.82rem;
    font-style: italic;
    font-weight: 400;
}

main .who-table .row-total {
    border-left: 1px solid var(--ink);
    font-weight: 700;
}

main .who-table tbody tr:hover th,
main .who-table tbody tr:hover td {
    background: rgba(0, 0, 0, 0.035);
}

main .who-table tr.on th,
main .who-table tr.on td {
    background: rgba(0, 0, 0, 0.05);
}

main .who-table tr.on th {
    padding-left: 8px;
    box-shadow: inset 3px 0 0 var(--primary);
}

main .who-table tr.all-in th,
main .who-table tr.all-in td {
    border-top: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    font-size: 1.08rem;
    font-weight: 800;
}

main .who-table .all-in-share {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
}

main .who-table tr.vs-row th,
main .who-table tr.vs-row td {
    border-top: 1px solid var(--ink);
    color: #333;
    font-style: italic;
}

main .results-scroll .lines li {
    gap: 12px;
    padding: 9px 0;
    border-top: 1px dotted var(--hair);
    align-items: start;
}

/* Portrait in its own column beside the tax name and its line (grid placement keeps the reading order). */
main .results-scroll .lines li > div:first-child {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
}

main .results-scroll .lines .tax-name {
    display: contents;
}

main .results-scroll .lines .tax-name > .did-wrap {
    grid-column: 1;
    grid-row: 1 / span 2;
}

main .results-scroll .lines .tax-name > :not(.did-wrap),
main .results-scroll .lines .who {
    grid-column: 2;
}

main .results-scroll .lines a.tax-link {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration-line: underline;
    text-decoration-style: solid;
}

main .results-scroll .lines .who {
    margin-top: 2px;
    color: #555;
    font-family: var(--narrow);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

main .line-amt {
    min-height: 36px;
    padding: 0 2px;
    font-family: var(--narrow);
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: underline dotted;
    text-underline-offset: 4px;
}

main .calc-row.open .line-amt {
    color: var(--primary);
}

main .line-pct {
    font-family: var(--narrow);
}

main .results-scroll .ledger-link {
    display: inline-block;
}

main .results-scroll > .hint:last-child,
main .results-scroll > .hint:has(+ .pay-flow) {
    margin-top: 10px;
    padding-top: 6px;
    border-top: 1px solid var(--ink);
}

/* Desktop and tablet landscape: the household box beside the results. */
@media (min-width: 901px) {
    .news-grid {
        grid-template-columns: 410px minmax(0, 1fr);
        align-items: start;
    }

    .news-grid > .household {
        grid-column: 1;
        grid-row: 1;
        margin: 0 26px 0 0;
    }

    .news-grid > .estimate-tabset {
        grid-column: 2;
        grid-row: 1;
        align-self: stretch;
        padding-left: 24px;
        border-left: 1px solid var(--hair);
    }
}

@media (min-width: 901px) and (max-width: 1100px) {
    .news-grid {
        grid-template-columns: 360px minmax(0, 1fr);
    }

    main .total > strong,
    main .total-amt {
        font-size: 4.4rem;
    }

    main .fig-num {
        font-size: 2.2rem;
    }
}

/* Phones and tablets: main figure, then the household box (folded behind the red button), then the results. */
@media (max-width: 900px) {
    main .dateline {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* The date line would push the main figure down; phones skip it. */
    main .dateline .dateline-date {
        display: none;
    }

    .phone-lead {
        display: block;
        border-bottom: 1px solid var(--ink);
        margin-bottom: 14px;
    }

    .phone-lead .total {
        align-items: flex-start;
        text-align: left;
        padding-top: 0;
    }

    main .results-pin {
        grid-template-columns: minmax(0, 1fr);
    }

    main .results-pin > .total {
        display: none;
    }

    main .household > .band {
        padding: 8px 0;
    }

    main .household .c-title {
        font-size: 2.1rem;
    }

    .household .c-sum {
        display: block;
    }

    .household .c-fold {
        display: grid;
        place-items: center;
        width: 46px;
        height: 46px;
        margin-left: auto;
        padding: 0;
        border: 2px solid var(--ink);
        border-radius: 0;
        background: var(--primary);
        cursor: pointer;
    }

    .household .c-fold:hover {
        background: #8f0e15;
    }

    .household .c-fold:focus-visible {
        outline: 3px solid var(--ink);
        outline-offset: 2px;
    }

    .household .c-chev {
        width: 12px;
        height: 12px;
        margin-top: -6px;
        border-right: 3px solid #fff;
        border-bottom: 3px solid #fff;
        transform: rotate(45deg);
    }

    .household.is-open .c-chev {
        margin-top: 6px;
        transform: rotate(-135deg);
    }

    .household:not(.is-open) .c-body {
        display: none;
    }

    main .household .c-body {
        padding: 14px 0 18px;
    }

    main .figs {
        margin-top: 4px;
    }

    /* Pinned totals bar. It sits over the bottom of the page, so the footer (now on the sheet under the page) leaves
       room for it instead of a gap above the footer. */
    main .summary-spacer {
        display: none;
    }

    body:has(main .summary-drawer) footer {
        padding-bottom: 4.6rem;
    }

    body:has(main .summary-drawer.open) footer {
        padding-bottom: 11.2rem;
    }

    main .summary-drawer {
        background: var(--paper);
        border-top: 4px double var(--ink);
        box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.08);
    }

    main .summary-drawer-bar {
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
        min-height: 56px;
        padding: 6px 14px;
        background: transparent;
    }

    main .summary-drawer-bar > span:first-child {
        flex: 1;
        font-family: var(--narrow);
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        line-height: 1.15;
        text-transform: uppercase;
    }

    main .summary-drawer-bar strong {
        margin: 0;
        font-family: var(--cond);
        font-size: 1.9rem;
        font-weight: 900;
        letter-spacing: 0;
        line-height: 1;
    }

    main .summary-rate {
        width: 4.6em;
        color: var(--primary);
        font-family: var(--narrow);
        font-size: 0.8rem;
        font-weight: 600;
        line-height: 1.1;
        text-transform: uppercase;
    }

    main .summary-drawer-tray {
        font-family: var(--narrow);
    }

    main .summary-drawer-tray span {
        color: var(--ink);
    }
}

@media (max-width: 520px) {
    main .total > strong,
    main .total-amt {
        font-size: 4.4rem;
    }

    main .results-pin > .heading-tip > h2 {
        font-size: 1.6rem;
    }

    main .fig {
        padding: 8px 6px 10px;
    }

    main .fig:last-child {
        padding-right: 0;
    }

    main .fig-num {
        font-size: 1.7rem;
    }

    main .fig-kick {
        font-size: 0.68rem;
        letter-spacing: 0.06em;
    }

    main .fig-dek {
        font-size: 0.85rem;
        line-height: 1.25;
    }

    main .who-table {
        font-size: 0.88rem;
    }

    main .who-table th,
    main .who-table td,
    main .who-table thead th {
        padding: 6px 4px;
    }

    main .who-table thead th:first-child,
    main .who-table tbody th {
        padding-left: 0;
    }

    main .who-table .table-who,
    main .who-table thead .row-total {
        font-size: 0.68rem;
        letter-spacing: 0.03em;
    }

    main .who-table tr.all-in th,
    main .who-table tr.all-in td {
        font-size: 0.95rem;
    }

    main .results-scroll .lines li > div:first-child {
        grid-template-columns: 44px minmax(0, 1fr);
        column-gap: 10px;
    }

    .household .presets {
        gap: 6px;
    }

    .household .presets > button:not(.text-link),
    .household .mode button {
        padding: 0 9px;
        font-size: 0.8rem;
        letter-spacing: 0.04em;
    }
}

/* ---- Charts in Chart.js's palette (2026-10): solid colours, ink outlines; the page around them stays newspaper ---- */

/* Timeline: "Compare years" is a featured box; the chart sits under it. */
main .timeline-chart {
    border-top: 0;
    padding-top: 0;
}

main .compare-box {
    margin: 0 0 1.25rem;
}

main .compare-box .c-title {
    font-size: 2.1rem;
}

main .compare-box .year-compare {
    margin: 0;
}

main .compare-box .year-pickers {
    display: grid;
    grid-template-columns: minmax(0, 11rem) max-content minmax(0, 11rem);
    justify-content: start;
}

/* "All taxes | New taxes only" keeps its info button beside it. */
main .compare-box .tax-filter {
    flex-wrap: nowrap;
}

main .compare-box .tax-filter .segmented {
    width: auto;
    flex: 0 1 auto;
    min-width: 0;
}

main .compare-box .year-pickers .field {
    min-width: 0;
}

main .year-chart svg {
    border-bottom: 2px solid var(--ink);
}

main .year-chart .hint {
    margin-top: 0.6rem;
}

main .year-chart .chart-grid {
    stroke: var(--hair);
    stroke-dasharray: 2 3;
}

main .year-chart .chart-axis,
main .year-chart .chart-year {
    font-family: var(--narrow);
    font-weight: 500;
    fill: #444;
}

main .year-chart .chart-year.sel {
    font-weight: 700;
    fill: var(--primary);
}

main .year-chart .bar {
    stroke: var(--ink);
    stroke-width: 0.8;
}

/* One fixed colour per series, ordered so stacked neighbours stay apart; Vs Indiana is the light one on top. */
main .year-chart .bar.federal { fill: var(--chart-yellow); }
main .year-chart .bar.illinois { fill: var(--chart-purple); }
main .year-chart .bar.chicago { fill: var(--chart-red); }
main .year-chart .bar.other { fill: var(--chart-blue); }
main .year-chart .bar.passed { fill: var(--chart-orange); }
main .year-chart .bar.embedded { fill: var(--chart-grey-light); }
main .year-chart .bar.mark { stroke-width: 1.6; }

main .chart-legend {
    gap: 6px 18px;
    font-family: var(--narrow);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
}

main .chart-legend .swatch,
main .compare-table :is(.federal, .illinois, .chicago, .other, .passed, .embedded) td:first-child::before {
    display: inline-block;
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    border: 1px solid var(--ink);
    border-radius: 0;
    vertical-align: -3px;
}

main .chart-legend .swatch {
    margin-right: 6px;
}

main .compare-table :is(.federal, .illinois, .chicago, .other, .passed, .embedded) td:first-child {
    box-shadow: none;
}

main .compare-table :is(.federal, .illinois, .chicago, .other, .passed, .embedded) td:first-child::before {
    content: "";
    width: 12px;
    height: 12px;
    margin-right: 8px;
    vertical-align: -1px;
}

main .swatch.federal,
main .compare-table .federal td:first-child::before { background: var(--chart-yellow); }
main .swatch.illinois,
main .compare-table .illinois td:first-child::before { background: var(--chart-purple); }
main .swatch.chicago,
main .compare-table .chicago td:first-child::before { background: var(--chart-red); }
main .swatch.other,
main .compare-table .other td:first-child::before { background: var(--chart-blue); }
main .swatch.passed,
main .compare-table .passed td:first-child::before { background: var(--chart-orange); }
main .swatch.embedded,
main .compare-table .embedded td:first-child::before { background: var(--chart-grey-light); }

@media (max-width: 520px) {
    main .compare-box .c-title {
        font-size: 1.8rem;
    }

    main .compare-box .c-body {
        padding: 14px 12px 16px;
    }

    main .compare-box .tax-filter .segmented button {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* ---- Page touches (2026-10) ---- */
/* Rate tables: every cell centred on the row, so short cells line up with a name and its portrait. */
main .rates-table td {
    vertical-align: middle;
}

/* 404: one centred column, no section rule, two buttons of one height. */
main .not-found {
    border-top: 0;
}

main .not-found .kicker {
    justify-content: center;
}

main .nf-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

main .nf-actions .ghost {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

/* ---- Timeline chart: phone drawing, tap note (2026-10) ---- */
/* Two drawings of the same bars (EstimateTimeline.razor): wide by default, the taller phone one below 641px. */
main .chart-plot {
    position: relative;
}

main .year-chart .chart-phone {
    display: none;
}

/* Tap or hover a bar: a boxed note at the top of that bar with the year's total. Kept inside the chart's edges. */
main .chart-callout {
    position: absolute;
    top: var(--y-wide);
    left: clamp(5.75rem, var(--x-wide), calc(100% - 5.75rem));
    transform: translate(-50%, calc(-100% - 8px));
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: max-content;
    max-width: 11.5rem;
    margin: 0;
    padding: 5px 9px;
    font-size: 0.82rem;
    line-height: 1.25;
    white-space: normal;
    pointer-events: none;
    z-index: 3;
}

main .chart-callout.below {
    transform: translate(-50%, 8px);
}

main .chart-callout strong {
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 640px) {
    /* Key first, in one row, then the chart. */
    main .year-chart {
        display: flex;
        flex-direction: column;
    }

    main .year-chart .chart-legend {
        order: -1;
        justify-content: space-between;
        gap: 4px 6px;
        margin: 0 0 10px;
        padding: 0;
        font-size: 0.68rem;
        letter-spacing: 0;
    }

    main .year-chart .chart-legend li {
        white-space: nowrap;
    }

    main .year-chart .chart-legend .swatch {
        width: 10px;
        height: 10px;
        margin-right: 3px;
        vertical-align: -1px;
    }

    main .chart-plot {
        width: 100%;
        max-width: 440px;
        margin: 0 auto;
    }

    main .year-chart .chart-wide {
        display: none;
    }

    main .year-chart .chart-phone {
        display: block;
    }

    main .year-chart .chart-phone .chart-year {
        font-size: 13px;
    }

    main .year-chart .chart-phone .chart-axis {
        font-size: 12px;
    }

    main .chart-callout {
        top: var(--y-phone);
        left: clamp(5.75rem, var(--x-phone), calc(100% - 5.75rem));
    }
}

/* ==================================================================================================================
   Desktop polish (2026-10-19)
   ================================================================================================================== */

/* The All-in card's caption and its info icon on one line on desktop (the cards are 205px inside from 1280px). */
@media (min-width: 1280px) {
    main .fig .fig-dek-allin {
        white-space: nowrap;
        font-size: 15px;
    }
}

/* Who pages: the three tables share fixed column widths, so "What happened" starts at the same place in each. */
main .rates-table.who-steps {
    table-layout: fixed;
}

main .who-steps .who-col-when {
    width: 8.5rem;
}

main .who-steps .who-col-tax {
    width: 30%;
}

@media (max-width: 640px) {
    main .who-steps .who-col-when {
        width: 3.6rem;
    }

    main .who-steps .who-col-tax {
        width: 8rem;
    }
}

/* Timeline "Where the difference comes from", from 641px: one line per tax (name, a smaller plate, then its kind), with
   the amounts centred on that line. Phones keep the two-line rows. */
@media (min-width: 641px) {
    main .diff-table td {
        vertical-align: middle;
        padding-top: 0.3rem;
        padding-bottom: 0.3rem;
    }

    main .diff-table td > .tax-name {
        display: inline-flex;
        vertical-align: middle;
        gap: 0.45rem;
    }

    main .diff-table td > .who {
        display: inline;
        margin-left: 0.6rem;
        color: var(--muted);
        font-size: 0.85em;
        white-space: nowrap;
    }

    main .diff-table td > .who .tag {
        margin: 0 0 0 0.35rem;
    }

    main .diff-table td > .who .tag-dup {
        display: none;
    }

    main .diff-table .did-that {
        width: 28px;
        height: 33px;
    }

    main .diff-table .did-that img,
    main .diff-table .did-avatar {
        width: 28px;
        height: 30px;
    }

    main .diff-table .did-avatar svg {
        width: 16px;
        height: 16px;
    }

    main .diff-table .did-banner {
        min-width: calc(100% + 4px);
        font-size: 0.5rem;
        line-height: 1.3;
    }
}

/* ---- Who index (/who): officials grouped by office, one compact row each ---- */
.wi-note { margin: 0.2rem 0 1.2rem; max-width: 46rem; font: 400 0.95rem/1.4 var(--narrow); color: var(--muted); }
.wi-group { margin: 1.6rem 0 0; }
.wi-group h2 { margin: 0 0 0.7rem; padding-bottom: 0.35rem; border-bottom: 3px solid var(--ink); font-size: 1.6rem; line-height: 1.1; }
.wi-sub { display: block; margin-top: 0.2rem; font: 700 0.78rem/1.2 var(--narrow); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.wi-now { display: inline-block; margin-left: 0.35rem; padding: 0 0.35rem; font: 700 0.7rem/1.5 var(--narrow); letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: var(--primary); }
.wi-name { font-family: var(--cond); font-weight: 900; color: var(--ink); }
.wi-go { font: 700 1.6rem/1 var(--narrow); color: var(--primary); }
.wi-face-s { display: block; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: center top; border: 2px solid var(--star); background: #ddd; flex: 0 0 auto; box-sizing: border-box; }
.wi-mono { display: flex; align-items: center; justify-content: center; font: 700 0.75rem/1 var(--narrow); color: var(--ink); }
.wi-list { border-top: 1px solid var(--line); }
.wi-list ul { list-style: none; margin: 0; padding: 0; }
.wi-lh, a.wi-li { display: grid; grid-template-columns: 40px minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(0, 1fr) 1.2rem; align-items: center; gap: 0.8rem; padding: 0 0.4rem; }
.wi-lh { min-height: 34px; font: 700 0.72rem/1.2 var(--narrow); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); }
.wi-lh .r, .wi-num { text-align: right; }
a.wi-li { min-height: 56px; color: var(--ink); text-decoration: none; background: transparent; border: 0; border-bottom: 1px solid var(--line); box-shadow: none; transform: none; }
a.wi-li:hover, a.wi-li.is-now { background: var(--primary-soft); }
a.wi-li:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
a.wi-li .wi-name { font-size: 1.1rem; line-height: 1.15; }
.wi-li .wi-years { font: 400 0.95rem/1.2 var(--narrow); color: var(--muted); }
.wi-num b { font: 900 1.25rem/1 var(--cond); }
.wi-prop, .wi-none { font: 400 0.85rem/1.2 var(--narrow); color: var(--muted); }
.wi-head .kicker, .wi-head h1, .wi-head .lede { text-align: left; }
.wi-head .lede { margin-left: 0; }
@media (max-width: 700px) {
    .wi-group h2 { font-size: 1.35rem; }
    .wi-lh { display: none; }
    a.wi-li { grid-template-columns: 40px minmax(0, 1fr) auto 1rem; grid-template-areas: "face name num go" "face years num go"; row-gap: 0; min-height: 56px; padding: 0.4rem 0.2rem; }
    a.wi-li > :nth-child(1) { grid-area: face; }
    a.wi-li > :nth-child(2) { grid-area: name; }
    a.wi-li > :nth-child(3) { grid-area: years; }
    a.wi-li > :nth-child(4) { grid-area: num; }
    a.wi-li > :nth-child(5) { grid-area: go; }
}
/* ==================================================================================================================
   Home polish: small captions, bigger tap areas, a quieter phone totals bar and a one-row analytics bar.
   ================================================================================================================== */

/* The caption under each small figure wraps evenly instead of leaving one word on its own line. */
.fig-dek {
    text-wrap: balance;
}

@media (max-width: 700px) {
    .fig .fig-dek {
        font-size: 0.92rem;
        line-height: 1.2;
    }

    .phone-total .total-amt {
        margin-bottom: 0.15rem;
    }

    .phone-total .total-sub {
        margin-top: 0.35rem;
    }
}

/* Tap areas of at least 44 x 44 px for small links and buttons on phones and touch screens. Each one gets an invisible
   ::after centred on it, so nothing moves and no row grows. (The "i" buttons already have theirs, see .info-btn.) */
@media (max-width: 900px), (pointer: coarse) {
    main .who-table .table-who,
    main .who-table tbody th button,
    main .line-amt,
    main a.tax-link,
    main .text-link,
    main .ledger-link,
    .footer-nav a {
        position: relative;
    }

    main .who-table .table-who::after,
    main .who-table tbody th button::after,
    main .line-amt::after,
    main a.tax-link::after,
    main .text-link::after,
    main .ledger-link::after,
    .footer-nav a::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: max(calc(100% + 12px), 44px);
        height: 44px;
        transform: translate(-50%, -50%);
    }
}

/* Phones: the totals bar at the bottom only shows once the main figure at the top has scrolled out of view (site.js sets
   the class; with no script the bar stays visible). */
html.lead-in-view .summary-drawer {
    visibility: hidden;
}

/* Phones: the analytics bar is one row (text and Privacy on the left, OK and No thanks on the right). The buttons look
   smaller but keep a 44 px tap area. */
@media (max-width: 520px) {
    .consent-bar {
        padding-top: 0.3rem;
        padding-bottom: calc(0.3rem + env(safe-area-inset-bottom, 0px));
    }

    .consent-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 0 0.5rem;
    }

    .consent-bar p {
        grid-column: 1;
        grid-row: 1;
        font-size: 0.8rem;
        line-height: 1.25;
    }

    .consent-actions {
        display: contents;
    }

    .consent-bar .consent-actions a {
        position: relative;
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
        min-height: 0;
        min-width: 0;
        margin: 0;
        padding: 0;
        font-size: 0.8rem;
        line-height: 1.25;
        text-decoration: underline;
    }

    .consent-bar .consent-actions button {
        position: relative;
        grid-row: 1 / 3;
        min-height: 36px;
        min-width: 0;
        padding: 0 0.7rem;
        font-size: 0.85rem;
    }

    .consent-bar .consent-actions .consent-ok {
        grid-column: 2;
    }

    .consent-bar .consent-actions .consent-no {
        grid-column: 3;
    }

    .consent-bar .consent-actions a::after,
    .consent-bar .consent-actions button::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: max(100%, 44px);
        height: 44px;
        transform: translate(-50%, -50%);
    }
}
/* ==================================================================================================================
   Timeline refinements: a plain "Choose the years" box (no black band), a year slider, totals above the end bars.
   ================================================================================================================== */

main .year-box {
    margin: 0 0 1.25rem;
    padding: 14px 16px 16px;
    background: var(--card);
    border: 1px solid var(--line);
}

main .year-box .c-title {
    margin: 0 0 0.7rem;
    font-size: 1.7rem;
    line-height: 1.1;
}

main .year-box .c-body {
    padding: 0;
}

.tl-figs {
    margin-top: 0.4rem;
}

/* The chart gridlines are plain hairlines. */
main .year-chart .chart-grid {
    stroke-dasharray: none;
}

main .year-chart .chart-total {
    font-family: var(--narrow);
    font-size: 12px;
    font-weight: 700;
    fill: var(--ink);
}

main .year-chart .chart-phone .chart-total {
    font-size: 14px;
}

/* Year slider: two native range inputs on one track. Each thumb is a 44 px touch target with a 24 px circle in it. */
.year-slider {
    position: relative;
    height: 44px;
    margin: 1.2rem 0 0;
}

.ys-track {
    position: absolute;
    left: 22px;
    right: 22px;
    top: 20px;
    height: 4px;
    background: var(--line);
}

.ys-fill {
    position: absolute;
    top: -2px;
    height: 8px;
    left: calc(var(--a) * 1%);
    width: calc((var(--b) - var(--a)) * 1%);
    background: var(--primary);
}

main input[type="range"].ys-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
}

main input[type="range"].ys-input::-webkit-slider-runnable-track {
    height: 44px;
    background: transparent;
    border: 0;
}

main input[type="range"].ys-input::-moz-range-track {
    height: 44px;
    background: transparent;
    border: 0;
}

main input[type="range"].ys-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    margin-top: 0;
    appearance: none;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    border: 10px solid transparent;
    border-radius: 50%;
    background: var(--card);
    background-clip: padding-box;
    box-shadow: inset 0 0 0 2px var(--ink);
    pointer-events: auto;
    cursor: grab;
}

main input[type="range"].ys-input::-moz-range-thumb {
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    border: 10px solid transparent;
    border-radius: 50%;
    background: var(--card);
    background-clip: padding-box;
    box-shadow: inset 0 0 0 2px var(--ink);
    pointer-events: auto;
    cursor: grab;
}

main input[type="range"].ys-input:focus {
    z-index: 3;
}

main input[type="range"].ys-input:focus-visible::-webkit-slider-thumb {
    background: var(--card);
    box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 3px var(--primary);
}

main input[type="range"].ys-input:focus-visible::-moz-range-thumb {
    background: var(--card);
    box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 3px var(--primary);
}

.ys-tag {
    position: absolute;
    top: -1.15rem;
    font-family: var(--narrow);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
    pointer-events: none;
}

.ys-tag-from {
    left: max(34px, calc(22px + (100% - 44px) * var(--a) / 100));
    transform: translateX(-100%);
}

.ys-tag-to {
    left: min(calc(22px + (100% - 44px) * var(--b) / 100), calc(100% - 34px));
}

.ys-ends {
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
    margin: 0 0 0.6rem;
    font-family: var(--narrow);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
}
/* Who pages: each dated row shows the step's rate, then its short note and source (one shared source with the Timeline and New taxes). */
.who-step .who-rate {
    display: block;
}

.who-step .who-note {
    display: block;
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.9em;
    line-height: 1.35;
}
/* ==================================================================================================================
   Deep-review fixes (2026-10-19)
   ================================================================================================================== */

/* Timeline "Where the difference comes from": amounts line up on the right; the last row is the total. */
main .diff-table .total-row td {
    border-top: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    font-weight: 700;
}

main .diff-table tr.idle td {
    color: var(--muted);
}

/* Phones: tables fit the screen where they can. A tax name and its portraits wrap onto two lines instead of
   setting a wide first column (the portraits go under the name), long words break with a hyphen, and the money
   columns are a little tighter. A table that still cannot fit scrolls sideways, with a shadow on its right edge while
   there is more to see (where the browser supports scroll-driven animation). */
@media (max-width: 640px) {
    .ledger-table .tax-name,
    .rates-table .tax-name {
        flex-wrap: wrap;
        gap: 0.2rem 0.45rem;
    }

    .ledger-table .tax-name > a.tax-link,
    .ledger-table .tax-name > span,
    .rates-table .tax-name > span,
    .rates-table td {
        hyphens: auto;
        -webkit-hyphens: auto;
        overflow-wrap: break-word;
    }

    main .ledger-table th,
    main .ledger-table td,
    main .rates-table th,
    main .rates-table td {
        padding-left: 0.3rem;
        padding-right: 0.3rem;
    }

    main .ledger-table th:first-child,
    main .ledger-table td:first-child,
    main .rates-table th:first-child,
    main .rates-table td:first-child {
        padding-left: 0;
    }

    main .diff-table .amt {
        font-size: 0.92rem;
    }
}

@property --table-shade {
    syntax: "<number>";
    inherits: false;
    initial-value: 0;
}

@keyframes table-shade {
    from { --table-shade: 1; }
    90% { --table-shade: 1; }
    to { --table-shade: 0; }
}

/* A soft shadow on the right edge says "more this way" until the table is scrolled to its end. Only a background, so
   the plate and info popups inside the table are never clipped. */
@media (max-width: 640px) {
    @supports (animation-timeline: scroll()) {
        .ledger-table,
        .rates-table {
            animation: table-shade linear both;
            animation-timeline: scroll(self inline);
            background-image: radial-gradient(farthest-side at 100% 50%, rgba(11, 31, 51, calc(0.28 * var(--table-shade))), rgba(11, 31, 51, 0));
            background-position: right center;
            background-size: 14px 100%;
            background-repeat: no-repeat;
        }
    }
}

/* Tap targets of at least 24px (WCAG 2.5.8) with a 44px touch area: the analytics bar's Privacy link, the Source
   links on the Who pages and the citation links on /rates. */
.who-note .who-source,
.tax-id a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    vertical-align: middle;
}

.who-note .who-source,
.who-note .info-btn {
    margin-left: .4em;
}

.who-note .who-source::after,
.tax-id a::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(calc(100% + 12px), 44px);
    height: 44px;
    transform: translate(-50%, -50%);
}

.who-note .info-btn {
    vertical-align: middle;
}

/* Who notes: the short note and its popup on phones and tablets; the full note inline from 1024px, where there is room. */
.who-note .who-note-full {
    display: none;
}

@media (min-width: 1024px) {
    .who-note .who-note-brief,
    .who-note .info-btn,
    .who-note .info-overlay {
        display: none;
    }

    .who-note .who-note-full {
        display: inline;
    }
}

@media (max-width: 520px) {
    .consent-bar .consent-actions a {
        min-height: 24px;
        display: inline-flex;
        align-items: center;
    }
}

/* Where your pay goes (Summary card): the switches and total. pay-flow.js brings the chart's own styles. */
.pay-flow-head { display: flex; align-items: center; gap: 0.3rem; }
main .card .pay-flow-head h3 { font: inherit; letter-spacing: inherit; text-transform: inherit; margin: 0; padding: 0; border: 0; color: inherit; }
.pay-flow-chart { min-height: 320px; margin-top: 0.6rem; }
.pay-flow-total { margin: 0.5rem 0 0; padding-top: 0.45rem; border-top: 1px solid var(--line); font: 500 0.92rem/1.35 var(--narrow); color: var(--muted); }
.pay-flow-total b { color: var(--ink); font-weight: 700; }
