:root {
    --bg: #F2F0EB;
    --surface: #FFFFFF;
    --border: #E2DFD8;
    --text-primary: #1A1A18;
    --text-secondary: #6B6962;
    --text-muted: #9C9890;
    --accent: #2D5F2E;
    --accent-light: #EBF3EB;
    --warning: #B8860B;
    --warning-light: #FFF8E7;
    --danger: #9B2C2C;
    --danger-light: #FEF0F0;
    --tier-low: #2D5F2E;
    --tier-med: #B8860B;
    --tier-high: #9B2C2C;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* NAV */
nav {
    background: var(--text-primary);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.nav-brand span { color: #7EBF80; }
.nav-fork {
    width: 13px;
    height: 22px;
    flex-shrink: 0;
    position: relative;
    top: -1px;
}
.nav-links { display: flex; gap: 24px; }
.nav-links a {
    color: #A8A8A0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.nav-links a:hover { color: #fff; }

/* BREADCRUMB */
.breadcrumb {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 24px 0;
    font-size: 13px;
    color: var(--text-muted);
}
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; }

/* MAIN LAYOUT */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 24px 0;
}

/* HEADER CARD */
.header-card {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}
.restaurant-info h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    line-height: 1.2;
}
.restaurant-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.meta-line {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.meta-icon {
    width: 16px;
    height: 16px;
    opacity: 0.5;
}
.last-inspected {
    margin-top: 10px;
    font-size: 12px;
    font-family: 'DM Mono', monospace;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* SCORE BADGE */
.score-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
}
.score-ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--tier-low);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}
.score-ring.tier-medium { border-color: var(--tier-med); }
.score-ring.tier-high { border-color: var(--tier-high); }
.score-number {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
}
.score-label {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tier-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.tier-low { background: var(--accent-light); color: var(--tier-low); }
.tier-medium { background: var(--warning-light); color: var(--tier-med); }
.tier-high { background: var(--danger-light); color: var(--tier-high); }

/* SUMMARY */
.summary-block {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 24px 32px;
    margin-bottom: 20px;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.75;
}
.summary-block--ai {
    border-left: 3px solid var(--accent);
    padding-left: 29px;
}
.summary-block p:first-child {
    color: var(--text-primary);
    font-weight: 500;
}
.summary-block p + p {
    margin-top: 8px;
}

/* STAT CARDS */
.stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-radius: 10px;
    padding: 18px 16px;
    text-align: center;
}
.stat-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 2px;
}
.stat-value.green { color: var(--tier-low); }
.stat-value.yellow { color: var(--tier-med); }
.stat-value.red { color: var(--tier-high); }
.stat-name {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.stat-sub {
    display: block;
    font-size: 10px;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.65;
}

/* SECTION HEADERS */
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: -0.3px;
}

/* INSPECTION TIMELINE */
.timeline-section {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 20px;
}
.timeline-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-date {
    min-width: 90px;
    font-size: 13px;
    font-family: 'DM Mono', monospace;
    color: var(--text-muted);
    padding-top: 2px;
}
.timeline-content {
    flex: 1;
}
.timeline-type {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}
.timeline-detail {
    font-size: 14px;
    color: var(--text-secondary);
}
.timeline-score {
    font-weight: 600;
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    padding: 3px 10px;
    border-radius: 6px;
    flex-shrink: 0;
}
.timeline-score.low    { background: var(--accent-light); color: var(--tier-low); }
.timeline-score.medium { background: var(--warning-light); color: var(--tier-med); }
.timeline-score.high   { background: var(--danger-light); color: var(--tier-high); }

/* VIOLATIONS TABLE */
.violations-section {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 20px;
}
.violation-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.violation-rows .violation-row:last-child { border-bottom: none; }
.severity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}
.severity-dot.critical { background: var(--tier-high); }
.severity-dot.major { background: var(--tier-med); }
.severity-dot.minor { background: var(--tier-low); }
.violation-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
}
.violation-code {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.violation-legend {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    padding-top: 12px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

/* MAP LINK */
.map-cta {
    background: var(--text-primary);
    border-radius: 12px;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    text-decoration: none;
    transition: transform 0.15s ease;
}
.map-cta:hover { transform: translateY(-1px); }
.map-cta-text {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
}
.map-cta-text span {
    display: block;
    font-size: 12px;
    color: #A8A8A0;
    font-weight: 400;
    margin-top: 2px;
}
.map-cta-arrow {
    color: #7EBF80;
    font-size: 22px;
}

/* NEARBY */
.nearby-section {
    margin-bottom: 40px;
}
.nearby-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.nearby-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
}
.nearby-card:hover { border-color: var(--text-muted); }
.nearby-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}
.nearby-address {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.nearby-score {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    font-weight: 500;
}

/* FOOTER */
.page-footer {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}
.page-footer strong { color: #7EBF80; font-weight: 600; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--text-secondary); }

/* SCHEMA - hidden structured data for SEO */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
}

/* ===================== HOMEPAGE ===================== */
.hero {
    padding: 60px 24px 40px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}
.hero h1 {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 12px;
}
.hero p {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.hero-stat {
    font-size: 14px;
    color: var(--text-muted);
}
.hero-stat strong {
    color: var(--text-primary);
    font-weight: 600;
}
.search-form {
    display: flex;
    gap: 10px;
    max-width: 520px;
    margin: 0 auto;
}
.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    background: var(--surface);
    outline: none;
}
.search-input:focus { border-color: var(--accent); }
.search-btn {
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.search-btn:hover { background: #245125; }
.regions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}
.region-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
}
.region-card:hover { border-color: var(--accent); }
.region-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}
.region-card p {
    font-size: 14px;
    color: var(--text-muted);
}
.feed-list {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
}
.feed-list--warning {
    background: #FFF5F5;
    border-color: #F5C6C6;
}
.feed-list--warning .feed-item:hover { background: #FFF0F0; }
.feed-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: #ECEAE4; }
.feed-name {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
}
.feed-meta {
    font-size: 13px;
    color: var(--text-muted);
}
.feed-score {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    font-weight: 500;
}

/* ===================== REGION PAGE ===================== */
.region-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 20px;
}
.region-header h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}
.region-stats {
    display: flex;
    gap: 32px;
}
.region-stat {
    font-size: 14px;
    color: var(--text-secondary);
}
.region-stat strong {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 700;
    display: block;
}
.neighborhood-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}
.neighborhood-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
}
.neighborhood-card:hover { border-color: var(--accent); }
.neighborhood-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}
.neighborhood-card p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===================== LEADERBOARD ===================== */
.leaderboard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
}
.leaderboard-header {
    display: grid;
    grid-template-columns: 40px 1fr 120px 100px 120px;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg);
    font-size: 12px;
    font-family: 'DM Mono', monospace;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.leaderboard-row {
    display: grid;
    grid-template-columns: 40px 1fr 120px 100px 120px;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-row:hover { background: var(--bg); }
.rank-num {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: var(--text-muted);
}
.lb-name {
    font-weight: 600;
    font-size: 14px;
}
.lb-address {
    font-size: 12px;
    color: var(--text-muted);
}
.lb-mobile-meta { display: none; }
.lb-mobile-date {
    display: none;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
    margin-top: 2px;
    white-space: nowrap;
}
.lb-score {
    font-family: 'DM Mono', monospace;
    font-weight: 600;
    font-size: 15px;
}

/* ===================== RESTAURANT ROW (unified component) ===================== */
.rl-list {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
}
.rl-list--warning {
    background: #FFF5F5;
    border-color: #F5C6C6;
}
.rl-list--warning .rl-row:hover { background: #FFF0F0; }
.rl-header {
    display: grid;
    grid-template-columns: 40px 1fr 80px 120px 120px;
    gap: 12px;
    padding: 10px 20px;
    background: var(--bg);
    font-size: 11px;
    font-family: 'DM Mono', monospace;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
/* Default row: 4-column, rank hidden (used on feed/home/region lists) */
.rl-row {
    display: grid;
    grid-template-columns: 1fr 80px 120px 120px;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}
.rl-row:last-child { border-bottom: none; }
.rl-row:hover { background: var(--bg); }
.rl-list--warning .rl-row:last-child { border-bottom: none; }
.rl-rank { display: none; }
/* Ranked variant: 5-column, rank shown */
.rl-list--ranked .rl-row {
    grid-template-columns: 40px 1fr 80px 120px 120px;
}
.rl-list--ranked .rl-rank {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: var(--text-muted);
}
.rl-name-col { min-width: 0; }
.rl-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rl-address {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rl-mobile-sub { display: none; }
.rl-score {
    font-family: 'DM Mono', monospace;
    font-weight: 600;
    font-size: 15px;
}
.rl-tier { }
.rl-date {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
}
.rl-empty { color: var(--text-muted); font-size: 13px; }

/* ===================== ERROR PAGES ===================== */
.error-page {
    max-width: 900px;
    margin: 80px auto;
    padding: 0 24px;
    text-align: center;
}
.error-page h1 {
    font-size: 64px;
    font-weight: 700;
    color: var(--border);
    margin-bottom: 16px;
}
.error-page p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
}

/* ===================== SECTION SPACING ===================== */
.section-header {
    margin-bottom: 16px;
}
.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 700px) {
    .header-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .stat-row { grid-template-columns: repeat(2, 1fr); }
    .nearby-grid { grid-template-columns: 1fr; }
    .restaurant-info h1 { font-size: 22px; }
    .hero h1 { font-size: 28px; }
    .hero { padding: 32px 16px 24px; }
    .hero p { font-size: 15px; margin-bottom: 20px; }
    .hero-stats { gap: 16px; margin-top: 16px; flex-wrap: nowrap; }
    .hero-stat { font-size: 12px; }
    .section-header { margin-bottom: 10px; }
    .section-header h2 { font-size: 17px; }
    #regions { margin-top: 0; }
    .neighborhood-grid { grid-template-columns: 1fr; }
    .leaderboard-header {
        grid-template-columns: 36px 1fr 56px;
    }
    .leaderboard-header > *:nth-child(n+4) { display: none; }
    .leaderboard-row {
        grid-template-columns: 36px 1fr 56px;
    }
    .leaderboard-row > *:nth-child(n+4) { display: none; }
    .leaderboard-row .lb-score {
        font-size: 16px;
        font-weight: 700;
        text-align: right;
        align-self: center;
    }
    .lb-mobile-date { display: block; }
    .lb-mobile-meta { display: block; }
    .region-stats { flex-wrap: wrap; gap: 16px; }
    .violation-legend { flex-wrap: wrap; gap: 10px; }
    .regions-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 20px;
    }
    .region-card {
        border-radius: 8px;
        padding: 12px 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .region-card h3 { font-size: 16px; margin-bottom: 2px; }
    #regions { margin-bottom: 4px; margin-top: 0; }
    /* rl-row mobile: name+sub left, score+badge stacked right */
    .rl-header { display: none; }
    /* 0,2,0 — ties with .rl-list--ranked .rl-row; later source position wins */
    .rl-list .rl-row {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 2px 10px;
        padding: 12px 16px;
    }
    /* !important overrides .rl-list--ranked .rl-rank{display:block} (0,2,0 vs 0,1,0) */
    .rl-rank { display: none !important; }
    .rl-name-col {
        grid-column: 1;
        grid-row: 1 / 3;
        min-width: 0;
        align-self: center;
    }
    .rl-score {
        grid-column: 2;
        grid-row: 1;
        font-size: 16px;
        font-weight: 700;
        text-align: right;
        align-self: end;
    }
    .rl-tier {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        justify-content: flex-end;
        align-self: start;
    }
    .rl-date { display: none; }
    .rl-address { display: none; }
    .rl-mobile-sub {
        display: block;
        font-size: 12px;
        color: var(--text-muted);
        font-family: 'DM Mono', monospace;
        margin-top: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ===================== MOBILE: BROWSE BY TYPE — HORIZONTAL SCROLL ===================== */
/* Override the single-column grid collapse with a scrollable flex row */
@media (max-width: 700px) {
    .neighborhood-grid--types {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 10px;
        padding-bottom: 6px;
        /* undo the 1fr grid set above */
        grid-template-columns: unset;
    }
    .neighborhood-grid--types::-webkit-scrollbar { display: none; }
    .neighborhood-grid--types .neighborhood-card {
        flex: 0 0 145px;
    }
}

/* ===================== CUISINE INLINE LIST ===================== */
.cuisine-inline-list {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 24px;
    color: var(--text-secondary);
}
.cuisine-inline-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 6px;
}
.cuisine-inline-link {
    color: var(--text-secondary);
    text-decoration: none;
}
.cuisine-inline-link:hover { color: var(--accent); text-decoration: underline; }
.cuisine-inline-sep {
    margin: 0 5px;
    color: var(--text-muted);
    user-select: none;
}

/* ===================== ALL CITIES COLLAPSE (all screen sizes) ===================== */
.all-cities-toggle { display: none; }
.all-cities-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    user-select: none;
    margin-bottom: 4px;
}
.all-cities-label:hover { text-decoration: underline; }
.all-cities-label .all-cities-hide { display: none; }
.all-cities-toggle:checked ~ .all-cities-label .all-cities-show { display: none; }
.all-cities-toggle:checked ~ .all-cities-label .all-cities-hide { display: inline; }
.all-cities-content {
    display: none;
    margin-bottom: 32px;
}
.all-cities-toggle:checked ~ .all-cities-content { display: block; }

/* ===================== MOBILE: ALL CITIES — CHECKBOX COLLAPSE ===================== */
/* The input is always visually hidden; the label acts as the toggle on mobile only */
.mobile-cities-toggle { display: none; }

@media (max-width: 700px) {
    .mobile-cities-label {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px;
        margin-bottom: 12px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 8px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
        color: var(--text-secondary);
        user-select: none;
    }
    .mobile-cities-label::after {
        content: 'Show all +';
        font-size: 12px;
        color: var(--accent);
        font-weight: 600;
        white-space: nowrap;
        margin-left: 12px;
    }
    /* label is a sibling after the input, so ~ works */
    .mobile-cities-toggle:checked ~ .mobile-cities-label::after {
        content: 'Hide −';
    }
    .mobile-cities-content { display: none; }
    .mobile-cities-toggle:checked ~ .mobile-cities-content { display: block; }
}
@media (min-width: 701px) {
    .mobile-cities-label { display: none; }
    .mobile-cities-content { display: block; }
}


.internal-links {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.internal-links-header {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.internal-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s;
}
.internal-link:last-child { border-bottom: none; }
.internal-link:hover { color: var(--accent); }
.internal-link-arrow {
    font-size: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.15s, transform 0.15s;
}
.internal-link:hover .internal-link-arrow {
    color: var(--accent);
    transform: translateX(3px);
}

/* SECTION DESCRIPTION */
.section-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}
.section-sub {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 6px;
}

/* FEED TOGGLE (Restaurants | All Facilities) */
.feed-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
}
.feed-toggle-btn {
    padding: 6px 14px;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--surface);
    transition: background 0.15s, color 0.15s;
}
.feed-toggle-btn + .feed-toggle-btn {
    border-left: 1px solid var(--border);
}
.feed-toggle-btn.active {
    background: var(--text-primary);
    color: #fff;
}
.feed-toggle-btn:hover:not(.active) { background: var(--bg); }

/* WORST-IN SECTION */
.worst-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}
.region-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.region-pill {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--surface);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    cursor: pointer;
}
.region-pill:hover { border-color: var(--accent); color: var(--accent); }
.region-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* FEED CITY LINK (inline city link in meta) */
.feed-city-link {
    color: var(--text-muted);
    text-decoration: none;
}
.feed-city-link:hover { text-decoration: underline; }

/* SORT BAR */
.sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}
.sort-label {
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
}
.sort-btn {
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--surface);
    transition: border-color 0.15s, color 0.15s;
}
.sort-btn.active {
    background: var(--text-primary);
    color: #fff;
    border-color: var(--text-primary);
}
.sort-btn:hover:not(.active) { border-color: var(--text-muted); }

/* PAGINATION */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}
.page-btn {
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--surface);
    font-size: 13px;
    transition: border-color 0.15s, color 0.15s;
}
.page-btn.active {
    background: var(--text-primary);
    color: #fff;
    border-color: var(--text-primary);
}
.page-btn:hover:not(.active) { border-color: var(--text-muted); }
.page-ellipsis {
    padding: 7px 4px;
    font-size: 13px;
    color: var(--text-muted);
    user-select: none;
}

/* FEATURED CITY CARDS */
.neighborhood-grid--types {
    margin-bottom: 16px;
}
.neighborhood-grid--featured {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    margin-bottom: 24px;
}
.neighborhood-card--top-city {
    border-left: 3px solid var(--accent);
    background: #f6fbf6;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding-left: 13px;
}
.neighborhood-card--top-city h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}
.neighborhood-card--top-city p { color: var(--text-secondary); }
.neighborhood-card--top-city:hover {
    border-left-color: var(--accent);
    background: #eef7ee;
    box-shadow: 0 2px 8px rgba(45,95,46,0.12);
}

/* REGION HEADER SHADOW */
.region-header {
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* LEADERBOARD SHADOW */
.leaderboard {
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* NEIGHBORHOOD CARD HOVER */
.neighborhood-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(45,95,46,0.1);
}

/* INSPECTION TIMELINE COLLAPSE */
.timeline-toggle { display: none; }
.timeline-overflow { display: none; }
.timeline-toggle:checked ~ .timeline-overflow { display: block; }
.timeline-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--surface);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s, color 0.15s;
}
.timeline-toggle-label:hover { border-color: var(--text-muted); color: var(--text-primary); }
.timeline-toggle-label .tl-hide { display: none; }
.timeline-toggle:checked ~ .timeline-toggle-label .tl-show { display: none; }
.timeline-toggle:checked ~ .timeline-toggle-label .tl-hide { display: inline; }

/* NYC GRADE BADGE */
.nyc-grade-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: #f0f0f0;
    color: var(--text-secondary);
}
.nyc-grade-A { background: #e6f4e6; color: #2d5f2e; }
.nyc-grade-B { background: #fef9e6; color: #7a5c00; }
.nyc-grade-C { background: #fdecea; color: #8b2a2a; }
.nyc-grade-Z, .nyc-grade-N, .nyc-grade-P { background: #f0f0f0; color: var(--text-muted); }
