:root {
    --ink: #0f1b2d;
    --slate: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #ffffff;
    --subtle: #f6f8fb;
    --primary: #0b5cad;
    --primary-dark: #084a8c;
    --accent: #c47f00;
    --success: #1f7a4d;
    --warn: #a15c00;
    --radius: 0.75rem;
    --shadow: 0 8px 30px rgb(15 27 45 / 7%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    overflow-wrap: break-word;
}

img,
svg {
    max-width: 100%;
    height: auto;
}

img {
    display: block;
}

a {
    color: var(--primary-dark);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--ink);
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
input[type="submit"] {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

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

.wide-wrap {
    width: min(100% - 2rem, 70rem);
    margin-inline: auto;
}

.content-wrap {
    width: min(100% - 2rem, 47.5rem);
    margin: 2rem auto 5rem;
}

.skip-link {
    position: absolute;
    top: -5rem;
    left: 1rem;
    z-index: 100;
    padding: 0.75rem 1rem;
    background: var(--ink);
    color: white;
}

.skip-link:focus {
    top: 1rem;
}

.site-header {
    border-bottom: 1px solid var(--line);
    background: white;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
}

.brand:hover {
    color: var(--primary-dark);
}

.brand-mark {
    width: 2.65rem;
    flex: none;
}

.desktop-nav {
    display: none;
}

.cornerstone-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cornerstone-links a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    font-weight: 600;
}

.mobile-nav {
    position: relative;
}

.mobile-nav summary {
    display: grid;
    place-items: center;
    min-width: 3.5rem;
    min-height: 2.75rem;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    color: var(--primary-dark);
    font-weight: 700;
    cursor: pointer;
}

.mobile-nav nav {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 20;
    width: min(17rem, calc(100vw - 2rem));
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
}

.mobile-nav .cornerstone-links {
    display: grid;
    gap: 0;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding-block: 0.8rem;
    color: var(--muted);
    font-size: 0.86rem;
}

.breadcrumbs [aria-current="page"] {
    color: var(--slate);
}

h1,
h2,
h3,
h4 {
    margin-block: 1.8em 0.55em;
    color: var(--ink);
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.18;
}

h1 {
    margin-top: 0.4em;
    font-size: clamp(2.1rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.55rem, 3vw, 2.2rem);
}

h3 {
    font-size: 1.25rem;
}

p,
ul,
ol,
blockquote {
    margin-block: 0 1.2em;
}

.prose p,
.prose li {
    color: var(--slate);
}

.prose > *:first-child {
    margin-top: 0;
}

.prose a {
    font-weight: 600;
}

.prose blockquote {
    margin-inline: 0;
    padding: 0.5rem 1.4rem;
    border-left: 4px solid var(--primary);
    background: var(--subtle);
}

.prose code {
    padding: 0.12rem 0.3rem;
    border-radius: 0.2rem;
    background: var(--subtle);
    font-size: 0.9em;
}

.page-meta {
    margin: 0 0 2rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.page-meta a {
    color: var(--slate);
}

.table-scroll {
    max-width: 100%;
    margin-block: 1.5rem 2rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overscroll-behavior-inline: contain;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
    text-align: left;
}

th,
td {
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #eaf1f8;
    color: var(--ink);
    font-size: 0.83rem;
    font-weight: 750;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

tbody tr:nth-child(even) {
    background: var(--subtle);
}

.table-group th {
    position: static;
    background: #dfeaf5;
    color: var(--primary-dark);
    text-align: left;
}

tbody tr:last-child td {
    border-bottom: 0;
}

td.numeric,
th.numeric {
    text-align: right;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.3;
    white-space: nowrap;
}

.badge-official-fee {
    background: #dcecfb;
    color: #064b8c;
}

.badge-your-input {
    background: #f8e9bf;
    color: #6d4500;
}

.badge-national-estimate {
    background: #e4e8ef;
    color: #26384e;
}

.badge-calculated {
    background: #d9f2e5;
    color: #145737;
}

.badge-warning {
    background: #fff0ce;
    color: #754000;
}

.results-table td:first-child .badge {
    display: table;
    margin-top: 0.35rem;
}

.basis-cell {
    min-width: 13rem;
    color: var(--slate);
    font-size: 0.87rem;
}

.basis-cell a {
    display: inline-block;
    margin-left: 0.3rem;
    white-space: nowrap;
}

.note,
.warning,
.source {
    padding: 0.95rem 1.1rem;
    border-left: 4px solid;
    border-radius: 0.3rem;
    font-size: 0.95rem;
}

.note {
    border-color: var(--primary);
    background: #eef6fe;
    color: #173e65;
}

.warning {
    border-color: var(--warn);
    background: #fff8eb;
    color: #653b00;
}

.source {
    border-color: var(--success);
    background: #eef8f2;
    color: #195b3c;
}

.ucg-calculator {
    margin-block: 2rem;
    padding: clamp(1rem, 3vw, 2rem);
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: white;
    box-shadow: var(--shadow);
}

.ucg-calculator h2 {
    margin-top: 0;
}

.ucg-calc-form {
    display: grid;
    gap: 1.1rem;
}

.ucg-calc-form fieldset {
    min-width: 0;
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfe;
}

.ucg-calc-form legend {
    padding-inline: 0.3rem;
    color: var(--ink);
    font-size: 1.04rem;
    font-weight: 750;
}

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

.ucg-calc-form label,
.inline-override {
    display: grid;
    align-content: start;
    gap: 0.35rem;
    min-width: 0;
    color: var(--slate);
    font-size: 0.92rem;
    font-weight: 650;
}

.ucg-calc-form input:not([type="checkbox"]),
.ucg-calc-form select,
.inline-override input,
.search-form input[type="search"] {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid #9aaac0;
    border-radius: 0.45rem;
    background: white;
    color: var(--ink);
}

.ucg-calc-form select {
    padding-right: 1.7rem;
}

.ucg-calc-form .check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.75rem;
    cursor: pointer;
}

.ucg-calc-form input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    accent-color: var(--primary);
    flex: none;
}

.field-hint {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.ucg-calc-form button,
.secondary-button,
.search-submit {
    min-height: 2.75rem;
    padding: 0.7rem 1.3rem;
    border: 2px solid var(--primary);
    border-radius: 0.48rem;
    background: var(--primary);
    color: white;
    font-weight: 750;
    line-height: 1.2;
}

.ucg-calc-form button:hover,
.search-submit:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
}

.secondary-button {
    background: white;
    color: var(--primary-dark);
}

.secondary-button:hover {
    background: #eef6fe;
}

.ucg-results {
    margin-top: 1.4rem;
}

.ucg-results:empty {
    margin-top: 0;
}

.ucg-results h3 {
    margin-top: 2rem;
}

.totals-card {
    margin: 1.25rem 0;
    padding: 1.1rem 1.3rem;
    border: 1px solid #bfd8ec;
    border-radius: var(--radius);
    background: #eef6fe;
}

.totals-card h3 {
    margin: 0 0 0.35rem;
}

.totals-card p:last-child {
    margin-bottom: 0;
}

.inline-override {
    margin-top: 0.6rem;
}

.hero {
    padding-block: clamp(2rem, 6vw, 5rem) 2rem;
}

.hero h1 {
    max-width: 17ch;
    margin-block: 0.2em;
}

.hero > p:last-child {
    max-width: 46rem;
    color: var(--slate);
    font-size: clamp(1.1rem, 2vw, 1.3rem);
}

.eyebrow {
    color: var(--primary-dark);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.home-calculator .ucg-calculator {
    margin-top: 0;
}

.home-section {
    margin-block: 4rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 1rem;
}

.card,
.article-card {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
}

.card {
    display: block;
    color: var(--ink);
    text-decoration: none;
}

.card:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.card h3 {
    margin-top: 0;
}

.card span {
    color: var(--primary-dark);
    font-weight: 700;
}

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

.stats-grid > div {
    display: grid;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--subtle);
}

.stats-grid strong {
    color: var(--primary-dark);
    font-size: 2rem;
    line-height: 1.1;
}

.stats-grid span {
    color: var(--slate);
    font-size: 0.9rem;
}

.faq {
    margin-block: 2rem;
    border-top: 1px solid var(--line);
}

.faq-item {
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--line);
}

.faq-item h3 {
    margin-bottom: 0.45rem;
}

.faq-item div {
    color: var(--slate);
}

.article-list {
    display: grid;
    gap: 1rem;
}

.article-card h2 {
    margin-top: 0;
    font-size: 1.35rem;
}

.article-card p:last-child {
    margin-bottom: 0;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1.5rem 0;
}

.search-form label {
    flex: 1 1 15rem;
}

.site-footer {
    margin-top: 5rem;
    padding-block: 2.5rem;
    border-top: 1px solid var(--line);
    background: var(--subtle);
    color: var(--slate);
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.2rem;
    margin-bottom: 1.5rem;
}

.site-footer a {
    font-size: 0.92rem;
    font-weight: 600;
}

.footer-brand {
    color: var(--ink);
    font-size: 1.15rem;
    font-weight: 800;
}

.site-footer p:last-child {
    margin-bottom: 0;
    font-size: 0.85rem;
}

@media (min-width: 42rem) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-wrap {
        margin-top: 3rem;
    }
}

@media (min-width: 64rem) {
    .desktop-nav {
        display: block;
    }

    .desktop-nav .cornerstone-links {
        gap: 0.95rem;
    }

    .desktop-nav a {
        font-size: 0.88rem;
        text-decoration: none;
    }

    .mobile-nav {
        display: none;
    }
}

@media print {
    :root {
        --ink: #000;
        --slate: #222;
    }

    body {
        font-size: 10pt;
    }

    .site-header,
    .site-footer,
    .breadcrumbs,
    .ucg-calc-form,
    .secondary-button,
    .skip-link {
        display: none !important;
    }

    .wide-wrap,
    .content-wrap {
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .ucg-calculator,
    .card,
    .totals-card {
        border-color: #777;
        box-shadow: none;
    }

    .table-scroll {
        overflow: visible;
    }

    table {
        font-size: 8pt;
    }

    th,
    td {
        padding: 0.3rem;
    }

    a {
        color: #000;
    }

    .results-table a::after {
        content: " (" attr(href) ")";
        font-size: 7pt;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
/* Calculator alternatives and published figures that need confirmation. */
.badge-needs-review { background: #fff2bd; color: #684b00; }
.variant-select { display: block; max-width: 100%; margin-top: .4rem; }
.results-table .field-hint { display: block; margin-top: .3rem; color: #59636c; }

/* Front page city list and card blurbs */
.card p {
    margin: 0.35rem 0 0;
    color: var(--muted, #64748b);
    font-size: 0.95rem;
}

.city-links {
    columns: 3 16rem;
    column-gap: 2rem;
    padding-left: 1.1rem;
    margin: 1rem 0 0;
}

.city-links li {
    break-inside: avoid;
    margin-bottom: 0.4rem;
}
