/* ============================================================
   CountyTaxTools.com — Main Stylesheet
   Production shared stylesheet. No page-level CSS permitted.
   All components defined here are locked per DESIGN_DECISION_LOCK.md
   once established. Do not edit in non-design sessions.
   ============================================================ */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */

:root {
    /* Primary navy — aligned with homepage gov-style palette */
    --ctt-primary:        #1B3A6B;
    --ctt-primary-dark:   #0D2040;
    --ctt-primary-light:  #DBEAFE;
    --ctt-primary-50:     #EFF6FF;

    /* Accent red — aligned with homepage */
    --ctt-accent:         #C8102E;
    --ctt-accent-light:   #FEE2E2;
    --ctt-accent-dark:    #A30D25;

    /* Success */
    --ctt-success:        #059669;
    --ctt-success-light:  #D1FAE5;

    /* Danger */
    --ctt-danger:         #DC2626;
    --ctt-danger-light:   #FEE2E2;

    /* Neutral scale */
    --ctt-gray-50:  #F8FAFC;
    --ctt-gray-100: #F1F5F9;
    --ctt-gray-200: #E2E8F0;
    --ctt-gray-300: #CBD5E1;
    --ctt-gray-400: #94A3B8;
    --ctt-gray-500: #64748B;
    --ctt-gray-600: #475569;
    --ctt-gray-700: #334155;
    --ctt-gray-800: #1E293B;
    --ctt-gray-900: #0F172A;

    /* Surfaces */
    --ctt-bg:         #FFFFFF;
    --ctt-bg-alt:     var(--ctt-gray-50);
    --ctt-surface:    #FFFFFF;
    --ctt-border:     var(--ctt-gray-200);
    --ctt-text:       var(--ctt-gray-900);
    --ctt-text-muted: var(--ctt-gray-500);

    /* Typography */
    --ctt-font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ctt-font-mono: 'JetBrains Mono', 'SF Mono', 'Courier New', monospace;

    /* Radii */
    --ctt-radius-sm: 6px;
    --ctt-radius-md: 10px;
    --ctt-radius-lg: 16px;

    /* Shadows */
    --ctt-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --ctt-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --ctt-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
}

/* ============================================================
   DARK MODE — TOKEN OVERRIDES
   ============================================================ */

body.dark {
    --ctt-bg:         #0F1E2E;
    --ctt-bg-alt:     #0A1628;
    --ctt-surface:    #162434;
    --ctt-border:     #1E3A5A;
    --ctt-text:       #E2E8F0;
    --ctt-text-muted: #64748B;

    --ctt-gray-50:  #0F1E2E;
    --ctt-gray-100: #162434;
    --ctt-gray-200: #1E3A5A;
    --ctt-gray-300: #1A3050;
    --ctt-gray-400: #475569;
    --ctt-gray-500: #64748B;
    --ctt-gray-600: #94A3B8;
    --ctt-gray-700: #CBD5E1;
    --ctt-gray-800: #E2E8F0;
    --ctt-gray-900: #F1F5F9;

    --ctt-primary:       #60A5FA;
    --ctt-primary-dark:  #93C5FD;
    --ctt-primary-light: #1E3A5A;
    --ctt-primary-50:    #162434;

    --ctt-accent:       #F87171;
    --ctt-accent-light: #7F1D1D;
    --ctt-accent-dark:  #FCA5A5;

    --ctt-success:       #34D399;
    --ctt-success-light: #064E3B;

    --ctt-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --ctt-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --ctt-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   RESET
   ============================================================ */

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

/* ============================================================
   BASE
   ============================================================ */

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--ctt-font-body);
    background: var(--ctt-bg);
    color: var(--ctt-text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s, color 0.3s;
}

body.dark a {
    color: #60A5FA;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.25;
    font-weight: 700;
    color: var(--ctt-gray-900);
}

h1 { font-size: 2rem; margin-bottom: 0.75rem; }
h2 { font-size: 1.4rem; margin-bottom: 0.6rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
    color: var(--ctt-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
a:hover {
    color: var(--ctt-primary-dark);
}

ul, ol {
    padding-left: 1.5rem;
}

strong {
    font-weight: 600;
}

/* ============================================================
   LAYOUT — CONTAINER
   ============================================================ */

.container {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.wrap {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   SITE HEADER
   ============================================================ */

.site-header {
    background: var(--ctt-surface);
    border-bottom: 1px solid var(--ctt-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--ctt-shadow-sm);
}

.site-header-inner {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.site-logo {
    font-weight: 700;
    font-size: 1rem;
    color: var(--ctt-primary);
    text-decoration: none;
    line-height: 1.2;
    flex-shrink: 0;
}

.site-logo:hover {
    color: var(--ctt-primary-dark);
    text-decoration: none;
}

.site-logo-tagline {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--ctt-text-muted);
    letter-spacing: 0.01em;
}

.site-nav {
    display: flex;
    align-items: center;
}

.site-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.site-nav-item {
    display: flex;
    align-items: center;
}

.site-nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ctt-gray-600);
    text-decoration: none;
    padding: 0.35rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.site-nav-link:hover {
    color: var(--ctt-primary);
    text-decoration: none;
}

.site-nav-link.is-active {
    color: var(--ctt-primary);
    border-bottom-color: var(--ctt-primary);
}

/* ============================================================
   SITE FOOTER
   ============================================================ */

.site-footer {
    background: var(--ctt-gray-900);
    color: var(--ctt-gray-300);
    margin-top: 4rem;
}

.site-footer-inner {
    max-width: 1060px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 2rem;
}

.site-footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--ctt-gray-700);
}

.site-footer-brand {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.site-footer-brand:hover {
    color: var(--ctt-primary-light);
    text-decoration: none;
}

.site-footer-brand-desc {
    font-size: 0.8rem;
    color: var(--ctt-gray-500);
    margin-top: 0.35rem;
    max-width: 280px;
    line-height: 1.5;
}

.site-footer-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.site-footer-nav-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--ctt-gray-500);
    margin-bottom: 0.25rem;
}

.site-footer-nav-link {
    font-size: 0.85rem;
    color: var(--ctt-gray-400);
    text-decoration: none;
}

.site-footer-nav-link:hover {
    color: var(--ctt-primary-light);
    text-decoration: none;
}

.site-footer-legal {
    font-size: 0.75rem;
    color: var(--ctt-gray-600);
    line-height: 1.6;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */

.breadcrumb {
    background: var(--ctt-bg-alt);
    border-bottom: 1px solid var(--ctt-border);
    padding: 0.6rem 0;
}

.breadcrumb-list {
    list-style: none;
    padding: 0 1.25rem;
    margin: 0 auto;
    max-width: 1060px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.82rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    color: var(--ctt-text-muted);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    margin-right: 0.35rem;
    color: var(--ctt-gray-300);
}

.breadcrumb-item a {
    color: var(--ctt-primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-current {
    color: var(--ctt-gray-700);
    font-weight: 500;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main-content {
    min-height: 60vh;
}

/* ============================================================
   PAGE HERO
   ============================================================ */

.page-hero {
    background: linear-gradient(160deg, #1B3A6B 0%, #0D2040 100%);
    padding: 2.5rem 0 2rem;
    border-bottom: 4px solid #C8102E;
}
body.dark .page-hero {
    background: linear-gradient(160deg, #0D2040 0%, #060F1A 100%);
}

.page-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 0.75rem;
}

.page-intro {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.70);
    max-width: 720px;
    line-height: 1.7;
    margin-bottom: 0;
}

/* ============================================================
   KEY TAKEAWAYS
   ============================================================ */

.key-takeaways {
    background: var(--ctt-bg-alt);
    padding: 2rem 0;
    border-bottom: 1px solid var(--ctt-border);
}

.key-takeaways h2 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ctt-gray-500);
    font-weight: 600;
    margin-bottom: 0.85rem;
}

.takeaways-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.takeaways-list li {
    font-size: 0.95rem;
    color: var(--ctt-gray-700);
    padding-left: 1.25rem;
    position: relative;
    line-height: 1.55;
}

.takeaways-list li::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--ctt-primary);
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 0.5em;
}

/* ============================================================
   CONTENT SECTIONS — STATE TAX CONTEXT / GENERAL
   ============================================================ */

.state-tax-context,
.featured-jurisdictions,
.browse-counties,
.browse-cities,
.official-sources,
.faq,
.state-tools {
    padding: 2.25rem 0;
    border-bottom: 1px solid var(--ctt-border);
}

.state-tax-context h2,
.featured-jurisdictions h2,
.browse-counties h2,
.browse-cities h2,
.official-sources h2,
.faq h2,
.state-tools h2 {
    font-size: 1.3rem;
    margin-bottom: 0.85rem;
    color: var(--ctt-gray-900);
}

.state-tax-context h3 {
    font-size: 1.05rem;
    color: var(--ctt-gray-800);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.state-tax-context h3:first-of-type {
    margin-top: 1rem;
}

.state-tax-context p {
    font-size: 0.95rem;
    color: var(--ctt-gray-700);
    line-height: 1.7;
    max-width: 800px;
}

/* ============================================================
   TABLE — SALES TAX / DATA TABLES
   ============================================================ */

.sales-tax-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    border: 1px solid var(--ctt-border);
    border-radius: var(--ctt-radius-md);
    overflow: hidden;
    margin-top: 1rem;
    box-shadow: var(--ctt-shadow-sm);
}

.sales-tax-table caption {
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ctt-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.sales-tax-table thead th {
    background: var(--ctt-primary);
    color: #fff;
    padding: 0.65rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sales-tax-table tbody td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--ctt-border);
    background: var(--ctt-surface);
    font-size: 0.9rem;
    vertical-align: top;
}

.sales-tax-table tbody tr:nth-child(even) td {
    background: var(--ctt-bg-alt);
}

.sales-tax-table tbody tr:last-child td {
    border-bottom: none;
}

.table-note {
    font-size: 0.78rem;
    color: var(--ctt-text-muted);
    margin-top: 0.6rem;
    line-height: 1.55;
    max-width: 760px;
}

/* ============================================================
   TOOL CARDS
   ============================================================ */

.tool-card-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.tool-card {
    background: var(--ctt-surface);
    border: 1px solid var(--ctt-border);
    border-radius: var(--ctt-radius-md);
    padding: 1.25rem;
    box-shadow: var(--ctt-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.tool-card:hover {
    box-shadow: var(--ctt-shadow-md);
    border-color: var(--ctt-primary-light);
    text-decoration: none;
}

.tool-card--pending {
    background: var(--ctt-bg-alt);
    opacity: 0.85;
}

.tool-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ctt-gray-800);
    margin: 0;
}

.tool-card-desc {
    font-size: 0.875rem;
    color: var(--ctt-gray-600);
    line-height: 1.55;
    margin: 0;
    flex: 1;
}

/* ============================================================
   STATUS BADGES
   ============================================================ */

.status-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    align-self: flex-start;
}

.status-badge--pending {
    background: var(--ctt-accent-light);
    color: var(--ctt-accent-dark);
}

.status-badge--live {
    background: var(--ctt-success-light);
    color: var(--ctt-success);
}

/* ============================================================
   JURISDICTION LISTS
   ============================================================ */

.jurisdiction-list {
    list-style: none;
    padding: 0;
    margin: 0.85rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.jurisdiction-list li {
    font-size: 0.9rem;
    color: var(--ctt-gray-700);
    background: var(--ctt-bg-alt);
    border: 1px solid var(--ctt-border);
    border-radius: var(--ctt-radius-sm);
    padding: 0.3rem 0.75rem;
}

.jurisdiction-list li a {
    color: var(--ctt-primary);
    text-decoration: none;
    font-weight: 500;
}

.jurisdiction-list li a:hover {
    text-decoration: underline;
}

.jurisdiction-list--featured li {
    font-weight: 500;
}

.jurisdiction-browse-list {
    list-style: none;
    padding: 0;
    margin: 0.85rem 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.35rem;
}

.jurisdiction-browse-list li {
    font-size: 0.875rem;
    color: var(--ctt-gray-700);
    padding: 0.2rem 0;
}

.jurisdiction-browse-list li a {
    color: var(--ctt-primary);
    text-decoration: none;
}

.jurisdiction-browse-list li a:hover {
    text-decoration: underline;
}

/* ============================================================
   OFFICIAL SOURCES
   ============================================================ */

.sources-list {
    list-style: none;
    padding: 0;
    margin: 0.85rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.source-item {
    font-size: 0.875rem;
    color: var(--ctt-gray-700);
    line-height: 1.6;
    padding-left: 1rem;
    border-left: 3px solid var(--ctt-primary-light);
}

.source-item strong {
    display: block;
    color: var(--ctt-gray-800);
    margin-bottom: 0.15rem;
}

.source-item a {
    font-size: 0.85rem;
    word-break: break-word;
}

.sources-note {
    font-size: 0.8rem;
    color: var(--ctt-text-muted);
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ctt-border);
    line-height: 1.6;
    max-width: 720px;
}

/* ============================================================
   FAQ
   ============================================================ */

.faq-item {
    border: 1px solid var(--ctt-border);
    border-radius: var(--ctt-radius-md);
    margin-bottom: 0.6rem;
    overflow: hidden;
    background: var(--ctt-surface);
}

.faq-item[open] {
    border-color: var(--ctt-primary-light);
    box-shadow: var(--ctt-shadow-sm);
}

.faq-question {
    padding: 0.9rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ctt-gray-800);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    line-height: 1.4;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--ctt-primary);
    flex-shrink: 0;
    margin-left: 1rem;
    line-height: 1;
}

.faq-item[open] .faq-question::after {
    content: '−';
}

.faq-question:hover {
    color: var(--ctt-primary);
    background: var(--ctt-primary-50);
}

.faq-answer {
    padding: 0 1.1rem 1rem;
    font-size: 0.9rem;
    color: var(--ctt-gray-700);
    line-height: 1.7;
    border-top: 1px solid var(--ctt-border);
}

.faq-answer p {
    margin-top: 0.75rem;
}

.faq-answer ul {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.faq-answer li {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============================================================
   HOMEPAGE — HERO
   ============================================================ */

.home-hero {
    background: linear-gradient(135deg, var(--ctt-primary-50) 0%, var(--ctt-bg) 70%);
    padding: 3.5rem 0 3rem;
    border-bottom: 1px solid var(--ctt-border);
}

.home-hero h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--ctt-gray-900);
    max-width: 680px;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.home-hero-desc {
    font-size: 1.05rem;
    color: var(--ctt-gray-600);
    max-width: 620px;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.home-hero-note {
    font-size: 0.82rem;
    color: var(--ctt-text-muted);
    padding: 0.5rem 0.85rem;
    background: var(--ctt-gray-100);
    border-radius: var(--ctt-radius-sm);
    display: inline-block;
    border-left: 3px solid var(--ctt-primary-light);
}

/* ============================================================
   HOMEPAGE — STATES SECTION
   ============================================================ */

.home-states {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--ctt-border);
}

.home-states h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.home-states-desc {
    font-size: 0.9rem;
    color: var(--ctt-gray-600);
    margin-bottom: 1.25rem;
}

.state-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.state-card {
    display: block;
    background: var(--ctt-surface);
    border: 1px solid var(--ctt-border);
    border-radius: var(--ctt-radius-md);
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--ctt-shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}

.state-card:hover {
    box-shadow: var(--ctt-shadow-md);
    border-color: var(--ctt-primary);
    transform: translateY(-1px);
    text-decoration: none;
}

.state-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ctt-primary);
    display: block;
    margin-bottom: 0.3rem;
}

.state-card-meta {
    font-size: 0.8rem;
    color: var(--ctt-text-muted);
    line-height: 1.4;
}

/* ============================================================
   HOMEPAGE — HOW IT WORKS
   ============================================================ */

.home-explainer {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--ctt-border);
    background: var(--ctt-bg-alt);
}

.home-explainer h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.explainer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.explainer-item {
    background: var(--ctt-surface);
    border: 1px solid var(--ctt-border);
    border-radius: var(--ctt-radius-md);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--ctt-shadow-sm);
}

.explainer-item h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ctt-gray-800);
    margin-bottom: 0.35rem;
}

.explainer-item p {
    font-size: 0.85rem;
    color: var(--ctt-gray-600);
    margin: 0;
    line-height: 1.55;
}

/* ============================================================
   JURISDICTION FILTER BAR
   ============================================================ */

[hidden] { display: none !important; }

.jurisdiction-filter-bar {
    background: linear-gradient(160deg, #1B3A6B 0%, #0D2040 100%);
    padding: 1.75rem 0;
    border-bottom: 4px solid #C8102E;
}
body.dark .jurisdiction-filter-bar {
    background: linear-gradient(160deg, #0D2040 0%, #060F1A 100%);
}

.jurisdiction-filter-wrap {
    max-width: 540px;
}

.jurisdiction-filter-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.70);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.jurisdiction-filter-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.jurisdiction-filter-input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: var(--ctt-font-body);
    color: #1B2A4A;
    background: #FFFFFF;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--ctt-radius-sm);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
body.dark .jurisdiction-filter-input {
    color: #E2E8F0;
    background: #0F1E2E;
    border-color: rgba(255, 255, 255, 0.20);
}

.jurisdiction-filter-input:focus {
    border-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}
body.dark .jurisdiction-filter-input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.jurisdiction-filter-input::placeholder {
    color: #94A3B8;
}

.jurisdiction-filter-clear {
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--ctt-font-body);
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--ctt-radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.jurisdiction-filter-clear:hover {
    background: rgba(255, 255, 255, 0.20);
    color: #FFFFFF;
}

.jurisdiction-filter-hint {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.45rem;
    line-height: 1.4;
}

.jurisdiction-empty-state {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.50);
    padding: 0.85rem 0;
    font-style: italic;
}

.is-filtered-hidden {
    display: none !important;
}

/* ============================================================
   JURISDICTION FILTER — RESULTS PANEL
   ============================================================ */

.filter-results-panel {
    margin-top: 0.75rem;
    border: 1px solid var(--ctt-border);
    border-radius: var(--ctt-radius-md);
    background: var(--ctt-surface);
    box-shadow: var(--ctt-shadow-md);
    max-height: 340px;
    overflow-y: auto;
    max-width: 540px;
}

.filter-results-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ctt-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.6rem 1rem 0.35rem;
    border-bottom: 1px solid var(--ctt-border);
}

.filter-results-list {
    list-style: none;
    padding: 0.25rem 0;
    margin: 0;
}

.filter-results-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    gap: 0.75rem;
    transition: background 0.1s;
}

.filter-results-item:hover {
    background: var(--ctt-primary-50);
}

.filter-results-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ctt-gray-800);
}

.filter-results-type {
    font-size: 0.72rem;
    color: var(--ctt-text-muted);
    background: var(--ctt-gray-100);
    border: 1px solid var(--ctt-gray-200);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-results-empty {
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    color: var(--ctt-text-muted);
    font-style: italic;
}

/* Clickable filter result links */
.filter-results-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.filter-results-link:hover {
    color: inherit;
}

.filter-results-link .filter-results-name {
    color: var(--ctt-primary);
}

.filter-results-type--live {
    background: var(--ctt-success-light);
    border-color: var(--ctt-success);
    color: var(--ctt-success);
}

/* ============================================================
   LIVE JURISDICTION SIGNALING — BROWSE LISTS
   ============================================================ */

.jurisdiction-browse-list li a {
    font-weight: 600;
    position: relative;
    padding-left: 0.9rem;
}

.jurisdiction-browse-list li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--ctt-success);
    border-radius: 50%;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    h1, .page-hero h1, .home-hero h1 { font-size: 1.6rem; }
    h2, .state-tax-context h2, .faq h2 { font-size: 1.2rem; }

    .site-header-inner { height: 48px; }

    .site-nav-list { gap: 1rem; }
    .site-nav-link { font-size: 0.8rem; }

    .tool-card-group { grid-template-columns: 1fr; }

    .state-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

    .jurisdiction-browse-list { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

    .site-footer-top { flex-direction: column; gap: 1.25rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 1rem; }
    .breadcrumb-list { padding: 0 1rem; }
    .site-header-inner { padding: 0 1rem; }
    .site-footer-inner { padding: 1.75rem 1rem 1.5rem; }

    .jurisdiction-browse-list { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   CTA BUTTONS
   ============================================================ */

.ctt-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 1.35rem;
    background: var(--ctt-primary);
    color: #fff;
    border-radius: var(--ctt-radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: var(--ctt-shadow-sm);
    border: 1.5px solid transparent;
    line-height: 1.4;
}

.ctt-btn:hover {
    background: var(--ctt-primary-dark);
    color: #fff;
    text-decoration: none;
    box-shadow: var(--ctt-shadow-md);
}

.ctt-btn--outline {
    background: transparent;
    color: var(--ctt-primary);
    border-color: var(--ctt-primary);
    box-shadow: none;
}

.ctt-btn--outline:hover {
    background: var(--ctt-primary-50);
    color: var(--ctt-primary-dark);
    border-color: var(--ctt-primary-dark);
    box-shadow: none;
}

/* ============================================================
   HOMEPAGE — HERO STATS + CTA ROW
   ============================================================ */

.home-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    margin-bottom: 0;
    align-items: center;
}

.home-hero-stat {
    font-size: 0.875rem;
    color: var(--ctt-gray-600);
}

.home-hero-stat strong {
    color: var(--ctt-primary);
    font-weight: 700;
}

.home-hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    margin-bottom: 1.25rem;
}

/* ============================================================
   PAGE HEADER (support/guide pages)
   ============================================================ */

.page-header {
    background: linear-gradient(160deg, #1B3A6B 0%, #0D2040 100%);
    padding: 2.5rem 0 2rem;
    border-bottom: 4px solid #C8102E;
}
body.dark .page-header {
    background: linear-gradient(160deg, #0D2040 0%, #060F1A 100%);
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 0.5rem;
}

.page-header-desc {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.70);
    max-width: 720px;
    line-height: 1.65;
    margin-bottom: 0;
}

/* ============================================================
   CONTENT SECTIONS & BLOCKS (support/guide pages)
   ============================================================ */

.content-section {
    padding: 2rem 0 3rem;
}

.content-block {
    margin-bottom: 2rem;
}

.content-block:last-child {
    margin-bottom: 0;
}

.content-block h2 {
    font-size: 1.35rem;
    color: var(--ctt-gray-900);
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--ctt-primary-50);
}

.content-block p {
    color: var(--ctt-gray-700);
    line-height: 1.7;
}

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

.feature-list li {
    padding: 0.5rem 0 0.5rem 1.5rem;
    position: relative;
    color: var(--ctt-gray-700);
    line-height: 1.6;
}

.feature-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.85rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ctt-accent);
}

.feature-list li + li {
    border-top: 1px solid var(--ctt-gray-100);
}

/* ============================================================
   GUIDE PAGE SPECIFIC
   ============================================================ */

.direct-answer {
    background: var(--ctt-primary-50);
    border-left: 4px solid var(--ctt-primary);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0 var(--ctt-radius-sm) var(--ctt-radius-sm) 0;
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--ctt-gray-800);
}

.direct-answer-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ctt-primary);
    margin-bottom: 0.35rem;
}

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

.key-takeaways-list li {
    padding: 0.5rem 0 0.5rem 1.75rem;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ctt-gray-800);
}

.key-takeaways-list li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--ctt-accent);
    font-weight: 700;
}

.quick-facts-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.92rem;
}

.quick-facts-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    background: var(--ctt-gray-50);
    color: var(--ctt-gray-600);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--ctt-border);
}

.quick-facts-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--ctt-gray-100);
    color: var(--ctt-gray-800);
}

.quick-facts-table tr:last-child td {
    border-bottom: none;
}

.real-world-scenario {
    background: var(--ctt-gray-50);
    border: 1px solid var(--ctt-border);
    border-radius: var(--ctt-radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.real-world-scenario h3 {
    font-size: 1rem;
    color: var(--ctt-gray-800);
    margin-bottom: 0.75rem;
}

.limitations-list {
    list-style: none;
    padding: 0;
}

.limitations-list li {
    padding: 0.4rem 0 0.4rem 1.5rem;
    position: relative;
    color: var(--ctt-gray-700);
    line-height: 1.6;
}

.limitations-list li::before {
    content: '\26A0';
    position: absolute;
    left: 0;
    font-size: 0.85rem;
}

.next-steps {
    background: var(--ctt-primary-50);
    border-radius: var(--ctt-radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.next-steps h2 {
    border-bottom: none;
    margin-bottom: 0.75rem;
}

.attribution {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ctt-border);
    font-size: 0.88rem;
    color: var(--ctt-gray-600);
    line-height: 1.6;
}

.attribution strong {
    color: var(--ctt-gray-800);
}

/* ============================================================
   PERSON CARDS (About page)
   ============================================================ */

.person-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin-bottom: 1.75rem;
}

.person-card-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--ctt-border);
}

.person-card-body {
    flex: 1;
    min-width: 0;
}

.person-card-body p {
    margin: 0;
}

.person-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ctt-gray-900);
    margin-bottom: 0.15rem;
}

.person-card-role {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ctt-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.person-card-role a {
    color: var(--ctt-primary);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
}

.person-card-role a:hover {
    color: var(--ctt-primary-dark);
    text-decoration-thickness: 2px;
}

body.dark .person-card-role a {
    color: #93C5FD;
}

body.dark .person-card-role a:hover {
    color: #DBEAFE;
}

/* Person card sits on navy page-header gradient — needs light text
   and a high-contrast link color in both light and dark mode. */
.page-header .person-card-name {
    color: #FFFFFF;
}

.page-header .person-card-role {
    color: rgba(255, 255, 255, 0.78);
}

.page-header .person-card-role a {
    color: #BFDBFE;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
}

.page-header .person-card-role a:hover {
    color: #FFFFFF;
    text-decoration-thickness: 2px;
}

body.dark .page-header .person-card-role a {
    color: #93C5FD;
}

body.dark .page-header .person-card-role a:hover {
    color: #FFFFFF;
}

/* ============================================================
   ATTRIBUTION — WITH HEADSHOTS (guide/comparison pages)
   ============================================================ */

.attribution-byline {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
}

.attribution-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid var(--ctt-border);
}

/* ============================================================
   JURISDICTION CLUSTER LABELS
   ============================================================ */

.jurisdiction-cluster-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ctt-gray-500);
    margin: 1.25rem 0 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--ctt-border);
}

.jurisdiction-cluster-label:first-of-type {
    margin-top: 0.85rem;
}

/* ============================================================
   GOV-STYLE HEADER (homepage-aligned)
   ============================================================ */

.hdr { background: #1B3A6B; padding: 0; transition: background 0.3s; }
body.dark .hdr { background: #0D2040; }

.hdr-top { background: #0D2040; padding: 6px 0; font-size: 11px; color: rgba(255,255,255,0.50); text-align: center; letter-spacing: 0.03em; transition: background 0.3s; }
body.dark .hdr-top { background: #060F1A; }

.hdr-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 0; }

.hdr-logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; text-decoration: none; color: inherit; }
.hdr-logo:hover { text-decoration: none; }

.hdr-logo-seal { width: 40px; height: 40px; background: #C8102E; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 900; color: #FFFFFF; flex-shrink: 0; }

.hdr-logo-text strong { display: block; font-size: 16px; font-weight: 700; color: #FFFFFF; letter-spacing: -0.01em; }
.hdr-logo-text small { font-size: 10px; color: rgba(255,255,255,0.55); letter-spacing: 0.04em; text-transform: uppercase; }

.hdr-nav { display: flex; gap: 0; }
.hdr-nav a { padding: 8px 14px; font-size: 13px; color: rgba(255,255,255,0.75); font-weight: 500; border-left: 1px solid rgba(255,255,255,0.1); transition: all 0.15s; text-decoration: none; }
.hdr-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.hdr-nav a:last-child { border-right: 1px solid rgba(255,255,255,0.1); }

.hdr-toggle-wrap { border-left: 1px solid rgba(255,255,255,0.1); padding-left: 14px; margin-left: 14px; flex-shrink: 0; }

/* ============================================================
   DARK MODE TOGGLE
   ============================================================ */

.mode-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: transparent; color: rgba(255,255,255,0.80); border: 1px solid rgba(255,255,255,0.30); border-radius: 3px; font-family: 'Public Sans', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.mode-toggle:hover { background: rgba(255,255,255,0.10); }
.mode-toggle:focus-visible { outline: 2px solid rgba(255,255,255,0.55); outline-offset: 2px; }
.toggle-icon { font-size: 13px; }

body.dark .mode-toggle { background: rgba(255,255,255,0.08); color: #E2E8F0; border-color: rgba(255,255,255,0.15); }
body.dark .mode-toggle:hover { background: rgba(255,255,255,0.12); }

/* ============================================================
   GOV-STYLE FOOTER (homepage-aligned)
   ============================================================ */

.footer { background: #0D2040; padding: 48px 0 0; transition: background 0.3s; }
body.dark .footer { background: #060F1A; }

.footer-inner { display: grid; grid-template-columns: 1fr repeat(4, auto); gap: 36px; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,0.08); }

.footer-brand strong { display: block; font-size: 15px; font-weight: 700; color: #FFFFFF; margin-bottom: 8px; }
.footer-brand p { font-size: 12px; color: rgba(255,255,255,0.40); line-height: 1.6; max-width: 240px; margin: 0; }

.footer-col h5 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.10em; color: rgba(255,255,255,0.35); margin-bottom: 12px; }
.footer-col a { display: block; font-size: 13px; color: rgba(255,255,255,0.55); margin-bottom: 6px; text-decoration: none; }
.footer-col a:hover { color: #fff; text-decoration: none; }

.footer-bottom { padding: 16px 0; text-align: center; font-size: 11px; color: rgba(255,255,255,0.25); }

/* ============================================================
   DARK MODE — COMPONENT OVERRIDES
   ============================================================ */

/* Table headers use primary as bg — too bright in dark mode */
body.dark .sales-tax-table thead th {
    background: #1E3A5A;
}

/* FAQ hover */
body.dark .faq-question:hover {
    background: #1A2D40;
}

/* Breadcrumb */
body.dark .breadcrumb {
    background: #0A1628;
    border-color: #1E3A5A;
}

/* ============================================================
   RESPONSIVE — GOV-STYLE HEADER
   ============================================================ */

@media (max-width: 640px) {
    .hdr-inner { flex-wrap: wrap; padding: 12px 0 0; }
    .hdr-logo { flex: 1; }
    .hdr-toggle-wrap { border-left: none; padding-left: 0; margin-left: 8px; display: flex; align-items: center; }
    .hdr-nav { order: 3; width: 100%; border-top: 1px solid rgba(255,255,255,0.12); margin-top: 10px; padding: 8px 0; flex-wrap: wrap; display: flex; }
    .hdr-nav a { font-size: 12px; padding: 6px 12px; border-left: none; border-right: 1px solid rgba(255,255,255,0.1); }
    .hdr-nav a:last-child { border-right: none; }
    .toggle-label-text { display: none; }
}

/* ============================================================
   RESPONSIVE — GOV-STYLE FOOTER
   ============================================================ */

@media (max-width: 768px) {
    .footer-inner { grid-template-columns: 1fr; }
}

/* ============================================================
   MOBILE-FIRST ANTI-OVERFLOW PATCH (2026-04-20)
   Standard: no table, card, or panel may spill past the mobile
   viewport. Horizontal scroll, when used, must feel controlled.
   Desktop behavior is unchanged — all rules below are scoped
   to narrow viewports.
   ============================================================ */

/* Hard guard against any descendant forcing the document wider
   than the viewport. Does not clip fixed/absolute positioned
   overlays because they are not descendants of html/body layout
   flow when positioned off-flow. */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Prevent long unbroken strings in links/URLs from forcing
   horizontal overflow on narrow screens. */
@media (max-width: 520px) {
    .source-item a,
    .sources-note a,
    .attribution a,
    .table-note a {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

/* ---- Shared horizontal-scroll wrapper (for explicit use) ---- */
.table-wrap {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    border-radius: var(--ctt-radius-md);
    border: 1px solid var(--ctt-border);
    background: var(--ctt-surface);
    margin: 1rem 0;
}

.table-wrap > .sales-tax-table,
.table-wrap > .quick-facts-table {
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* ---- Responsive containment fallback for unwrapped tables ----
   At sub-tablet widths, force tables into a scrollable block so
   6-column comparison tables never overflow the page itself. */
@media (max-width: 720px) {
    .sales-tax-table,
    .quick-facts-table,
    .calc-breakdown {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .sales-tax-table thead th,
    .sales-tax-table tbody td,
    .quick-facts-table th,
    .quick-facts-table td {
        padding: 0.55rem 0.7rem;
        white-space: nowrap;
    }

    /* First column (Jurisdiction / Tax Type) may wrap to keep
       long names readable without forcing extreme scroll. */
    .sales-tax-table tbody td:first-child,
    .sales-tax-table thead th:first-child,
    .quick-facts-table tbody td:first-child,
    .quick-facts-table thead th:first-child {
        white-space: normal;
        min-width: 9rem;
    }

    .table-note {
        font-size: 0.78rem;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    .sales-tax-table,
    .quick-facts-table {
        font-size: 0.82rem;
    }

    .sales-tax-table thead th {
        font-size: 0.72rem;
        padding: 0.5rem 0.6rem;
    }

    .sales-tax-table tbody td,
    .quick-facts-table td {
        padding: 0.5rem 0.6rem;
    }
}

/* ---- Grid / card density on narrow viewports ---- */
@media (max-width: 480px) {
    /* Single-column card grids below the phablet breakpoint so
       cards never get squeezed below a readable width. */
    .tool-card-group,
    .explainer-list,
    .state-grid {
        grid-template-columns: 1fr;
    }

    /* Browse lists collapse to single column to avoid cramped
       two-up rendering on very narrow phones. */
    .jurisdiction-browse-list {
        grid-template-columns: 1fr;
    }

    /* Person cards (about/trust pages) stack their headshot
       above the body so the text column has breathing room. */
    .person-card {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .person-card-img {
        width: 56px;
        height: 56px;
    }

    /* Homepage hero CTA row goes full-width so buttons do not
       wrap awkwardly or sit off-center. */
    .home-hero-cta .ctt-btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    /* Reduce shared container padding so cards fill usable width
       without clipping at the edges. */
    .wrap { padding: 0 16px; }
    .container { padding: 0 16px; }
    .site-header-inner { padding: 0 16px; }
    .site-footer-inner { padding: 1.75rem 16px 1.5rem; }
    .breadcrumb-list { padding: 0 16px; }

    /* Page hero typography tightens so the eyebrow doesn't
       force overflow. */
    .page-hero h1,
    .page-header h1 { font-size: 1.5rem; }
    .page-intro,
    .page-header-desc { font-size: 0.95rem; }
}

/* ---- Jurisdiction filter (VA hub search) ---- */
@media (max-width: 720px) {
    .filter-results-panel { max-width: 100%; }
    .jurisdiction-filter-wrap { max-width: 100%; }
    .jurisdiction-filter-controls { flex-wrap: wrap; }
    .jurisdiction-filter-clear { width: 100%; }
}

/* ---- Content block guard: never allow a single inline-styled
   child to force its parent past the viewport. Images, iframes,
   and pre/code default to shrinking. ---- */
img, svg, video, iframe {
    max-width: 100%;
    height: auto;
}

pre, code {
    max-width: 100%;
    overflow-x: auto;
}

/* ---- Homepage rates-band 4-up grid (inline-styled on /
   index.html) — catch the "Virginia Tax Rates at a Glance"
   block by selecting any 4-column grid inside a .section.
   Scoped tightly to avoid hitting unrelated grids. ---- */
@media (max-width: 640px) {
    .section > .wrap > div[style*="grid-template-columns:repeat(4"],
    .section > .wrap > div[style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .section > .wrap > div[style*="grid-template-columns:repeat(4"] > div,
    .section > .wrap > div[style*="grid-template-columns: repeat(4"] > div {
        border-right: none !important;
        border-bottom: 1px solid var(--border, var(--ctt-border)) !important;
    }
    .section > .wrap > div[style*="grid-template-columns:repeat(4"] > div:nth-child(odd),
    .section > .wrap > div[style*="grid-template-columns: repeat(4"] > div:nth-child(odd) {
        border-right: 1px solid var(--border, var(--ctt-border)) !important;
    }
    .section > .wrap > div[style*="grid-template-columns:repeat(4"] > div:nth-last-child(-n+2),
    .section > .wrap > div[style*="grid-template-columns: repeat(4"] > div:nth-last-child(-n+2) {
        border-bottom: none !important;
    }
}

@media (max-width: 420px) {
    .section > .wrap > div[style*="grid-template-columns:repeat(4"],
    .section > .wrap > div[style*="grid-template-columns: repeat(4"] {
        grid-template-columns: 1fr !important;
    }
    .section > .wrap > div[style*="grid-template-columns:repeat(4"] > div,
    .section > .wrap > div[style*="grid-template-columns: repeat(4"] > div {
        border-right: none !important;
    }
    .section > .wrap > div[style*="grid-template-columns:repeat(4"] > div:nth-child(odd),
    .section > .wrap > div[style*="grid-template-columns: repeat(4"] > div:nth-child(odd) {
        border-right: none !important;
    }
}
