/* ═══════════════════════════════════════════════════════════
   JANVAYU REDESIGN — EDITORIAL SCROLL LAYOUT
   ═══════════════════════════════════════════════════════════ */

/* Headline face — Fraunces, self-hosted (latin subset) so it loads fast with
   no third-party dependency. Non-latin headlines fall through to Newsreader /
   the system serif automatically. */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/fraunces-400.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/fraunces-600.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/fraunces-700.woff2') format('woff2'); }
/* Hand-drawn label font for the Excalidraw-style diagrams. */
@font-face { font-family: 'Kalam'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/kalam-400.woff2') format('woff2'); }
@font-face { font-family: 'Kalam'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/kalam-700.woff2') format('woff2'); }

:root {
    --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
    --serif: 'Fraunces', 'Newsreader', 'Georgia', serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;

    --green-900: #0f2b1c;
    --green-800: #14532D;
    --green-700: #146c33; /* darkened from #15803D so green text meets AA 4.5:1 on tinted card backgrounds, not just white */
    --green-600: #157f3c; /* darkened from #16A34A so green text meets AA 4.5:1 on white */
    --green-500: #22C55E;
    --green-400: #4ADE80;
    --green-100: #DCFCE7;
    --green-50: #F0FDF4;

    --cream: #FAFAF5;
    --warm-white: #F7F6F3;
    --paper: #FFFEF9;

    --ink: #1a1a18;
    --ink-secondary: #4a4a46;
    --ink-tertiary: #6f6f68; /* darkened from #7a7a74 to meet WCAG AA 4.5:1 on white */
    --ink-faint: #5a5a54;

    --red: #c0392b;
    --amber: #8a5300; /* darkened so amber text meets AA 4.5:1 on tinted backgrounds, not just white */
    --blue: #2563EB;
    --purple: #6D28D9;
    --sky: #0284c7; /* accessible sky-blue for stat text on white */
    --pink: #be185d; /* accessible pink for text on white */
    --on-accent: #ffffff; /* text colour that sits on an --accent background */

    --bg: var(--paper);
    --bg-section: var(--warm-white);
    --bg-card: #FFFFFF;
    --text: var(--ink);
    --text-2: var(--ink-secondary);
    --text-3: var(--ink-tertiary);
    --text-4: var(--ink-faint);
    --accent: var(--green-700);
    --accent-hover: var(--green-600);
    --border: #e5e5dc;
    --border-light: #eeeeea;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
    --shadow-card: 0 1px 4px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03);

    --radius: 8px;
    --radius-lg: 12px;
    --max-w: 1200px;
    --header-h: 56px;
}

/* Dark mode */
[data-theme="dark"] {
    --bg: #0e0e0c;
    --bg-section: #151513;
    --bg-card: #1c1c1a;
    --text: #e8e8e2;
    --text-2: #a8a8a0;
    --text-3: #9a9a91; /* lightened from #6e6e68 (a copy of the light-theme value) to meet WCAG AA 4.5:1 on dark surfaces */
    --text-4: #8a8a82;
    --accent: #4ADE80;
    --accent-hover: #86EFAC;
    /* Semantic colour tokens brightened for legible text on dark surfaces
       (WCAG 1.4.3). Elements that use these via var() or the mapped hexes
       become theme-aware automatically. */
    --red: #f87171;
    --amber: #fbbf24;
    --blue: #60a5fa;
    --purple: #a78bfa;
    --sky: #38bdf8;
    --green-700: #4ade80;
    --green-600: #6ee7a0;
    --pink: #f472b6;
    --on-accent: #0e0e0c; /* dark text on the bright dark-theme --accent */
    --ink: #e8e8e2;
    --border: #2a2a28;
    --border-light: #222220;
    --shadow-sm: none;
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
    --shadow-card: 0 0 0 1px rgba(255,255,255,0.05);
    --green-50: rgba(74,222,128,0.06);
    --green-100: rgba(74,222,128,0.1);
    --cream: #151513;
    --warm-white: #121210;
    --paper: #0e0e0c;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }
/* WCAG 1.4.1 (link-in-text-block): inline links inside prose must be
   distinguishable by more than colour, so underline links within paragraphs,
   list items and definitions. Button/nav/card link classes (.btn, .footer-link,
   etc.) have higher specificity and keep their own no-underline styling. */
p a, li a, dd a { text-decoration: underline; text-underline-offset: 0.14em; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .container { padding: 0 40px; } }

/* ── Ticker ──────────────────────────────── */
.ticker {
    background: var(--green-900);
    color: var(--green-400);
    font-size: 0.7rem;
    font-family: var(--mono);
    letter-spacing: 0.02em;
    height: 30px;
    overflow: hidden;
    display: flex;
    align-items: center;
}
[data-theme="dark"] .ticker { background: #060806; }
.ticker-track {
    display: flex;
    white-space: nowrap;
    animation: tickerScroll 120s linear infinite;
}
.ticker-item { padding: 0 24px; display: inline-flex; align-items: center; gap: 8px; }
.ticker-city { color: rgba(255,255,255,0.5); }
.who-multiple { color: rgba(255,255,255,0.3); font-size: 0.65rem; }
@keyframes tickerScroll { to { transform: translateX(-50%); } }

/* ── Header ──────────────────────────────── */
.header {
    height: var(--header-h);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.logo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logo-icon { display: flex; align-items: center; flex-shrink: 0; }
.logo-icon svg { border-radius: 6px; }
.logo-mark {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.03em;
}
.logo-scripts {
    display: inline-flex;
    gap: 5px;
    align-items: baseline;
}
.logo-script {
    font-size: 1.4rem;
    font-weight: 700;
    -webkit-text-stroke: 0.3px currentColor;
    color: var(--accent);
    opacity: 0.5;
    transition: opacity 0.2s;
}
.logo-script.active { opacity: 1; -webkit-text-stroke: 0.5px currentColor; }
@media (max-width: 768px) {
    .logo-script { display: none; }
    .logo-script.active { display: inline; }
    .logo-scripts { gap: 0; }
}
.logo-tag {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-4);
    display: none;
}
@media (min-width: 640px) { .logo-tag { display: inline; } }

.header-actions { display: flex; gap: 3px; align-items: center; flex-shrink: 1; min-width: 0; }
.icon-btn {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.15s;
}
.icon-btn:hover { background: var(--bg-section); color: var(--text); }

/* ── Section Nav (dropdown groups) ─── */
.section-nav {
    position: sticky;
    top: var(--header-h);
    z-index: 90;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    width: 100%;
}
.section-nav .container {
    display: flex;
    gap: 0;
    height: 42px;
    align-items: stretch;
    justify-content: flex-start;
}
/* Right-corner actions in the section nav (replaces floating buttons). */
.nav-actions-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 14px;
}
.nav-cta-btn {
    font-family: var(--sans); font-size: 0.78rem; font-weight: 600;
    background: var(--accent); color: var(--on-accent, #fff);
    border: none; border-radius: 6px; padding: 5px 12px; cursor: pointer;
    white-space: nowrap; transition: opacity 0.15s;
}
.nav-cta-btn:hover { opacity: 0.88; }
.nav-icon-btn {
    background: transparent; border: 1px solid var(--border); border-radius: 6px;
    width: 30px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-2); transition: border-color 0.15s, color 0.15s;
}
.nav-icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-icon-btn svg { width: 15px; height: 15px; }
.nav-install-btn { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.nav-install-btn:hover { background: var(--accent); color: var(--on-accent, #fff); opacity: 1; }
.widget-close {
    margin-left: auto; background: none; border: none; cursor: pointer;
    font-size: 1.3rem; line-height: 1; color: var(--text-3); padding: 0 6px;
}
.widget-close:hover { color: var(--ink); }
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}
.nav-link {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
    padding: 0 14px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
    transition: all 0.15s;
    cursor: pointer;
    text-decoration: none;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.nav-link:hover { color: var(--accent); text-decoration: none; }
.nav-link.active, .nav-item.has-active > .nav-link { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.nav-caret {
    display: inline-block;
    width: 0; height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 2px;
    opacity: 0.5;
    transition: transform 0.15s;
}
.nav-item:hover .nav-caret { transform: rotate(180deg); opacity: 1; }
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding: 6px 0;
    z-index: 100;
}
.nav-item:hover .nav-dropdown { display: block; }
.nav-dropdown-link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-2);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.1s;
    white-space: nowrap;
}
.nav-dropdown-link:hover { background: var(--green-50); color: var(--accent); }
.nav-dropdown-link.active { color: var(--accent); font-weight: 600; }
.nav-link:hover { color: var(--accent); text-decoration: none; }
.nav-link.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }


/* ── Icon size constraints ── */
.card-title svg, .card-header svg {
    width: 16px; height: 16px; min-width: 16px;
    vertical-align: -2px; margin-right: 4px;
    fill: none; stroke: currentColor; stroke-width: 2;
}
.tool-header svg { width: 18px; height: 18px; min-width: 18px; }
.tool-header h3 svg { width: 18px; height: 18px; }
.info-box h4 svg, .info-box h5 svg { width: 14px; height: 14px; vertical-align: -1px; }
.section-intro svg { width: 20px; height: 20px; }


/* ── Section layout variety ── */
.panel.active > .card:first-of-type { border-top: 3px solid var(--accent); }
.panel.active > .grid-2:nth-child(even) { direction: rtl; }
.panel.active > .grid-2:nth-child(even) > * { direction: ltr; }

/* Alternating info-box accent for variety */
.grid-2 > .info-box:nth-child(even) { background: var(--warm-white); }

/* Full-bleed stat rows */
.stat-row-full {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 1.5rem 0;
}
.stat-row-full .stat-cell {
    background: var(--bg-card);
    padding: 1.25rem;
    text-align: center;
}
.stat-row-full .stat-cell .stat-value {
    font-family: var(--mono);
    font-size: 1.75rem;
    font-weight: 700;
}
.stat-row-full .stat-cell .stat-label {
    font-size: 0.78rem;
    color: var(--text-3);
    margin-top: 4px;
}

/* Pull-quote for editorial variety */
.pull-quote {
    font-family: var(--serif);
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--ink);
    border-left: 4px solid var(--accent);
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    background: var(--warm-white);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.pull-quote cite {
    display: block;
    font-size: 0.85rem;
    font-style: normal;
    color: var(--text-3);
    margin-top: 0.75rem;
    font-family: var(--sans);
}

/* Sidebar layout for variety */
.layout-sidebar {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 768px) { .layout-sidebar { grid-template-columns: 1fr; } }

/* Dense grid for resource cards */
.grid-dense {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

/* Accent strip on top of certain cards */
.card-accent-top { border-top: 3px solid var(--accent); }
.card-accent-purple { border-top: 3px solid #7C3AED; }
.card-accent-blue { border-top: 3px solid #3B82F6; }
.card-accent-amber { border-top: 3px solid #D97706; }
.card-accent-red { border-top: 3px solid #EF4444; }




/* ═══ Layout Variety System ═══ */
/* Pull-quote for editorial breaks */
.pull-quote {
    font-family: var(--serif);
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    line-height: 1.65;
    color: var(--ink);
    border-left: 4px solid var(--accent);
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    background: var(--warm-white);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.pull-quote cite {
    display: block; font-size: 0.85rem; font-style: normal;
    color: var(--text-3); margin-top: 0.75rem; font-family: var(--sans);
}

/* Full-bleed stat strip */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1px; background: var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    margin: 1.5rem 0;
}
.stat-strip .stat-cell {
    background: var(--bg-card); padding: 1.25rem; text-align: center;
}
.stat-strip .stat-cell .stat-value {
    font-family: var(--mono); font-size: 1.5rem; font-weight: 700;
}
.stat-strip .stat-cell .stat-label {
    font-size: 0.75rem; color: var(--text-3); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em;
}

/* Sidebar layout for variety */
.layout-sidebar {
    display: grid; grid-template-columns: 5fr 2fr; gap: 1.5rem; align-items: start;
}
@media (max-width: 768px) { .layout-sidebar { grid-template-columns: 1fr; } }

/* Card accent strips */
.card-accent-green { border-top: 3px solid var(--accent); }
.card-accent-purple { border-top: 3px solid #7C3AED; }
.card-accent-blue { border-top: 3px solid #3B82F6; }
.card-accent-amber { border-top: 3px solid #D97706; }
.card-accent-red { border-top: 3px solid #EF4444; }

/* Dense resource grid */
.grid-dense {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

/* Alternating card backgrounds for visual rhythm */
.card.alt-bg { background: var(--warm-white); }

/* Number callout for big stats */
.number-callout {
    font-family: var(--mono); font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1;
    color: var(--accent); margin-bottom: 0.5rem;
}
.number-callout-label {
    font-size: 0.8125rem; color: var(--text-2);
    text-transform: uppercase; letter-spacing: 0.06em;
    font-family: var(--sans);
}

/* ═══ Icon Size Constraints ═══ */
.card-title svg, .card-header svg,
.card-title .si, .card-header .si {
    width: 16px; height: 16px; min-width: 16px;
    vertical-align: -2px;
}
.card-title svg { fill: none; stroke: currentColor; stroke-width: 2; }
.tool-header svg, .tool-header .si { width: 18px; height: 18px; min-width: 18px; }
.tool-header h3 svg { width: 18px; height: 18px; }
.info-box h4 svg, .info-box h5 svg,
.info-box h4 .si, .info-box h5 .si { width: 14px; height: 14px; }
h3 svg, h4 svg { max-width: 20px; max-height: 20px; }

/* ═══ Sargam Icons System ═══ */
.si {
    display: inline-block;
    width: 1em; height: 1em;
    background: currentColor;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    vertical-align: -0.125em;
    flex-shrink: 0;
}
.si-sm { width: 14px; height: 14px; }
.si-md { width: 18px; height: 18px; }
.si-lg { width: 22px; height: 22px; }
.si-hospital { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Hospital.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Hospital.svg); }
.si-activity { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Activity.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Activity.svg); }
.si-shield-health { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Shield_health_safety.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Shield_health_safety.svg); }
.si-rupee { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Rupee.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Rupee.svg); }
.si-bar-chart { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Bar_chart.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Bar_chart.svg); }
.si-briefcase { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Briefcase.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Briefcase.svg); }
.si-clipboard-check { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Clipboard_check.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Clipboard_check.svg); }
.si-assignment { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Assignment.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Assignment.svg); }
.si-ballot { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Ballot.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Ballot.svg); }
.si-wallet { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Wallet.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Wallet.svg); }
.si-credit-card { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Credit_card.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Credit_card.svg); }
.si-shield { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Shield.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Shield.svg); }
.si-fact-check { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Fact_check.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Fact_check.svg); }
.si-target { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Target.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Target.svg); }
.si-globe { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Globe_detailed.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Globe_detailed.svg); }
.si-insights { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Insights.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Insights.svg); }
.si-map { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Map.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Map.svg); }
.si-pin { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Pin.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Pin.svg); }
.si-chat { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Chat.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Chat.svg); }
.si-quote { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Quote.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Quote.svg); }
.si-lightning { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Lightning.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Lightning.svg); }
.si-rocket { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Rocket.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Rocket.svg); }
.si-flag { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Flag.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Flag.svg); }
.si-checklist { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Checklist.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Checklist.svg); }
.si-clipboard { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Clipboard.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Clipboard.svg); }
.si-shield-police { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Shield_police.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Shield_police.svg); }
.si-settings { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Settings.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Settings.svg); }
.si-wrench { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Wrench.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Wrench.svg); }
.si-code { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Code.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Code.svg); }
.si-library { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Library_books.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Library_books.svg); }
.si-book { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Book.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Book.svg); }
.si-article { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Article.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Article.svg); }
.si-download { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_File_download.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_File_download.svg); }
.si-upload { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_File_upload.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_File_upload.svg); }
.si-info { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Info.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Info.svg); }
.si-home { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Home.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Home.svg); }
.si-building { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Building.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Building.svg); }
.si-bus { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Bus.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Bus.svg); }
.si-train { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Train.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Train.svg); }
.si-alert { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Alert.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Alert.svg); }
.si-warning { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Warning.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Warning.svg); }
.si-heart { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Heart.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Heart.svg); }
.si-user { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_User.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_User.svg); }
.si-search { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Search.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Search.svg); }
.si-pie-chart { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Pie_chart.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Pie_chart.svg); }
.si-clock { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Clock.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Clock.svg); }
.si-eye { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Eye.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Eye.svg); }
.si-copy { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Copy.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Copy.svg); }
.si-link { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Link.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Link.svg); }
.si-flare { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Flare.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Flare.svg); }
.si-sun { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Sun.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Sun.svg); }
.si-dangerous { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Dangerous.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Dangerous.svg); }
.si-dollar { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Dollar.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Dollar.svg); }
.si-money { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Money.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Money.svg); }
.si-meter { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Meter.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Meter.svg); }
.si-spark { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Spark.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Spark.svg); }
.si-check { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Check.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Check.svg); }
.si-check-circle { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Check_circle.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Check_circle.svg); }
.si-error { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Error.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Error.svg); }
.si-city { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_City.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_City.svg); }
.si-umbrella { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Umbrella.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Umbrella.svg); }
.si-verified { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Verified.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Verified.svg); }
.si-ai { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_AI.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_AI.svg); }
.si-notifications { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Notifications.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Notifications.svg); }
.si-hammer { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Hammer.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Hammer.svg); }
.si-share { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Link.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Link.svg); }
.si-image { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Crop.svg); mask-image: url(https://cdn.jsdelivr.net/npm/sargam-icons@1.6.7/Icons/Line/si_Crop.svg); }

/* ── Share AQI Card ────────────────────── */
.share-aqi-btn {
    width: 24px; height: 24px; min-width: 24px;
    border: none; border-radius: 50%; cursor: pointer;
    background: var(--bg-section); color: var(--text-3);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.15s; padding: 0; flex-shrink: 0;
}
.share-aqi-btn:hover { background: var(--accent); color: #fff; }
.share-aqi-btn .si { width: 12px; height: 12px; }
.share-card-section {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px; text-align: center;
}
.share-card-section select {
    font-family: var(--sans); font-size: 0.8rem; padding: 6px 10px;
    border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg-section); color: var(--text); cursor: pointer;
}
.share-card-preview {
    margin: 16px auto; max-width: 400px;
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-md);
}
.share-card-preview img { width: 100%; display: block; }
.share-card-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }

/* ── AI Features ────────────────────────── */
.ai-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; padding: 2px 8px; border-radius: 4px;
    background: rgba(74,222,128,0.1); color: var(--accent);
}
.ai-response-area {
    min-height: 60px; padding: 16px 20px;
    background: var(--bg-section); border: 1px solid var(--border-light);
    border-radius: var(--radius); font-size: 0.9rem; line-height: 1.7;
    color: var(--text); white-space: pre-wrap;
}
.ai-response-area:empty::before {
    content: 'Response will appear here...';
    color: var(--text-3); font-style: italic;
}
.ai-response-area.loading {
    background: linear-gradient(90deg, var(--bg-section) 25%, var(--border-light) 50%, var(--bg-section) 75%);
    background-size: 200% 100%;
    animation: aiShimmer 1.5s infinite;
}
@keyframes aiShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.ai-data-used {
    margin-top: 10px; padding: 10px 14px;
    background: var(--bg-section); border: 1px solid var(--border-light);
    border-radius: var(--radius); font-size: 0.78rem; color: var(--text-3);
    font-family: var(--mono);
}
.advisory-card {
    padding: 20px; border-radius: var(--radius-lg);
    border: 1px solid var(--border); font-size: 0.9rem; line-height: 1.7;
}
.advisory-card.risk-low { background: rgba(34,197,94,0.06); border-color: rgba(34,197,94,0.2); }
.advisory-card.risk-moderate { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.2); }
.advisory-card.risk-high { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.2); }
.advisory-card.risk-severe { background: rgba(127,29,29,0.08); border-color: rgba(127,29,29,0.25); }
.risk-badge {
    display: inline-block; padding: 3px 10px; border-radius: 4px;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; margin-bottom: 10px;
}
.risk-badge.risk-low { background: #22C55E; color: white; }
.risk-badge.risk-moderate { background: #F59E0B; color: white; }
.risk-badge.risk-high { background: #EF4444; color: white; }
.risk-badge.risk-severe { background: #7F1D1D; color: white; }
.brief-output {
    padding: 24px; background: var(--bg-section);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    font-family: var(--mono); font-size: 0.82rem; line-height: 1.8;
    white-space: pre-wrap; color: var(--text);
}
.brief-output:empty::before {
    content: 'Your accountability brief will appear here...';
    color: var(--text-3); font-style: italic; font-family: var(--sans);
}
.anomaly-banner-container {
    display: none; margin-bottom: 0;
}
.anomaly-banner-container.visible { display: block; }
.anomaly-banner {
    padding: 12px 20px;
    background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25);
    border-radius: var(--radius); font-size: 0.88rem; line-height: 1.6;
    display: flex; align-items: flex-start; gap: 10px;
    color: var(--text);
}
.anomaly-banner .anomaly-dismiss {
    margin-left: auto; background: none; border: none;
    color: var(--text-3); cursor: pointer; font-size: 1.1rem;
    padding: 0 4px; flex-shrink: 0;
}
.anomaly-banner .anomaly-dismiss:hover { color: var(--text); }
.anomaly-expand-link {
    color: var(--accent); cursor: pointer; font-size: 0.82rem;
    font-weight: 500; text-decoration: underline;
    background: none; border: none; font-family: var(--sans);
}
.brief-actions {
    display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}
.checkbox-group {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.checkbox-group label {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.85rem; color: var(--text-2); cursor: pointer;
    padding: 6px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--bg);
    transition: all 0.15s;
}
.checkbox-group label:hover { border-color: var(--accent); }
.checkbox-group input[type="checkbox"]:checked + span {
    color: var(--accent); font-weight: 600;
}
.slider-group {
    display: flex; align-items: center; gap: 12px;
}
.slider-group input[type="range"] {
    flex: 1; accent-color: var(--accent);
}
.slider-group .slider-value {
    font-family: var(--mono); font-size: 0.88rem; font-weight: 600;
    min-width: 28px; text-align: center; color: var(--accent);
}
.demo-badge {
    display: none; position: fixed; top: 8px; right: 8px; z-index: 999;
    padding: 4px 12px; background: var(--amber);
    color: white; font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    border-radius: 4px; font-family: var(--mono);
}
.demo-badge.visible { display: block; }

/* ── Hero ────────────────────────────────── */
.hero {
    padding: 56px 0 48px;
    background: linear-gradient(180deg, var(--green-50) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border-light);
}
[data-theme="dark"] .hero {
    background: linear-gradient(180deg, rgba(74,222,128,0.03) 0%, var(--bg) 100%);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}
@media (max-width: 768px) {
    .hero-grid { grid-template-columns: 1fr; gap: 32px; }
    .hero { padding: 36px 0 32px; }
}
.hero-headline {
    font-family: var(--serif);
    font-size: clamp(2.1rem, 4.4vw, 3.6rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
    text-wrap: balance;
}
.hero-headline em {
    color: var(--accent);
    font-style: normal;
}
.hero-sub {
    font-size: 1.05rem;
    color: var(--text-2);
    margin-top: 16px;
    line-height: 1.65;
    max-width: 520px;
}
.hero-live-alert {
    margin-top: 20px;
    padding: 12px 16px;
    background: rgba(192,57,43,0.06);
    border-left: 3px solid var(--red);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-2);
}
.hero-live-alert strong { color: var(--red); }
/* Collapse the dense "what's happening now" blurb to a short excerpt on load
   so the landing leads with the live data, not a wall of context text. */
.hero-live-alert.clamped { max-height: 7.2em; overflow: hidden; }
.hero-live-toggle {
    margin-top: 8px; padding: 4px 0;
    background: none; border: none; cursor: pointer;
    color: var(--red); font-family: var(--sans);
    font-size: 0.82rem; font-weight: 600;
}
.hero-live-toggle:hover { text-decoration: underline; }
/* Hero CTA cards — fill the left column and give first-time visitors a way in. */
.hero-cta-row { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.hero-cta-card {
    display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 14px; cursor: pointer; text-decoration: none; color: inherit;
    font-family: var(--sans); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.hero-cta-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.hero-cta-icon { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent, #fff); }
.hero-cta-alt .hero-cta-icon { background: rgba(22,163,74,0.12); color: var(--accent); }
.hero-cta-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-cta-title { font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.hero-cta-sub { font-size: 0.76rem; color: var(--text-3); line-height: 1.35; }
.hero-cta-arrow { margin-left: auto; color: var(--accent); font-size: 1.15rem; flex: none; }

/* Hero data panel */
.hero-data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.hero-pm25-card {
    grid-column: 1 / -1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}
.hero-pm25-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent);
}
.hero-pm25-number {
    font-family: var(--mono);
    font-size: 4rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
}
.hero-pm25-unit {
    font-size: 0.78rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 4px;
}
.hero-pm25-who {
    font-family: var(--mono);
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 8px;
}
.hero-pm25-label {
    font-size: 0.72rem;
    color: var(--text-4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}
.hero-pm25-aqi {
    font-size: 0.78rem;
    color: var(--text-3);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}
.hero-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.hero-stat-value {
    font-family: var(--mono);
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.1;
}
.hero-stat-value.danger { color: var(--red); }
.hero-stat-value.warning { color: var(--amber); }
.hero-stat-label {
    font-size: 0.68rem;
    color: var(--text-4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 6px;
}
.hero-stat-note {
    font-size: 0.72rem;
    color: var(--text-3);
    margin-top: 4px;
}

/* Live status bar */
.live-bar {
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.82rem;
    color: var(--text-2);
    margin-top: 16px;
    grid-column: 1 / -1;
}
.pulse {
    display: inline-block;
    width: 7px; height: 7px;
    background: var(--green-500);
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sections ──────────────────────────── */
.page-section {
    padding: 56px 0;
    border-bottom: 1px solid var(--border-light);
}
.page-section:last-of-type { border-bottom: none; }
.page-section.alt-bg { background: var(--bg-section); }

.section-header {
    margin-bottom: 32px;
}
.section-overline {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}
.section-title {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--text);
}
.section-desc {
    font-size: 1rem;
    color: var(--text-2);
    margin-top: 10px;
    max-width: 640px;
    line-height: 1.65;
}

/* ── Cards ──────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
}
.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}
.card-body { padding: 20px; font-size: 0.95rem; line-height: 1.7; }
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    font-size: 0.75rem;
    color: var(--text-3);
}

/* Feature card (for research highlights) */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-card);
    position: relative;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    border-radius: 4px 0 0 4px;
}
.feature-card.blue::before { background: var(--blue); }
.feature-card.purple::before { background: var(--purple); }
.feature-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
}
.feature-label.green { background: var(--green-100); color: var(--green-800); }
.feature-label.blue { background: rgba(37,99,235,0.08); color: var(--blue); }
.feature-label.new { background: rgba(192,57,43,0.08); color: var(--red); }

/* ── Grids ──────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
/* Ward air-quality map layout */
.ward-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.ward-canvas { height: 520px; width: 100%; background: var(--warm-white); }
.ward-toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.ward-layer-btn { font-size: 0.78rem; font-weight: 600; padding: 0.32rem 0.72rem; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-2); cursor: pointer; transition: all .12s; }
.ward-layer-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
.ward-layer-btn.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.ward-legend-item { font-size: 0.72rem; color: var(--text-2); display: inline-flex; align-items: center; }
.ward-legend-sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: middle; margin-right: 3px; }
@media (max-width: 860px) {
    .ward-grid { grid-template-columns: 1fr; }
    .ward-canvas { height: 62vh; min-height: 320px; max-height: 460px; }
    .ward-toolbar { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .ward-toolbar #ward-layer-toggle { justify-content: flex-start; }
}

/* Stat cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.stat-value {
    font-family: var(--mono);
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.1;
}
.stat-value.danger { color: var(--red); }
.stat-value.warning { color: var(--amber); }
.stat-label {
    font-size: 0.68rem;
    color: var(--text-4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 6px;
}
.stat-change { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }

/* PM2.5 colors */
.pm25-value { font-family: var(--mono); font-size: 2.2rem; font-weight: 700; line-height: 1.1; }
.pm25-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-family: var(--mono); font-size: 0.78rem; font-weight: 600; }
.pm25-good { color: #16A34A; } .pm25-moderate { color: #65A30D; }
.pm25-sensitive { color: #CA8A04; } .pm25-unhealthy { color: #EA580C; }
.pm25-very-unhealthy { color: #DC2626; } .pm25-hazardous { color: #7C3AED; }

/* ── Collapsible sections ─────────────── */
.collapsible { overflow: hidden; }
.collapsible-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    transition: all 0.15s;
    text-align: left;
}
.collapsible-toggle:hover { box-shadow: var(--shadow-sm); }
.collapsible-toggle .arrow {
    font-size: 0.75rem;
    transition: transform 0.2s;
    color: var(--text-3);
    margin-left: auto;
}
.collapsible-toggle.open .arrow { transform: rotate(180deg); }
.collapsible-content {
    display: none;
    padding-top: 16px;
}
.collapsible-content.open { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Tables ─────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
    background: var(--bg-section);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--green-50); }

/* ── Buttons ────────────────────────────── */
.btn {
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { box-shadow: var(--shadow-sm); text-decoration: none; }
.btn-sm { font-size: 0.75rem; padding: 5px 12px; }
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
/* In dark theme --accent is a bright green; white text on it fails contrast,
   so use dark text on primary buttons there. */
[data-theme="dark"] .btn-primary { color: #0e0e0c; }
[data-theme="dark"] .panel-action-box .action-btn { color: #0e0e0c; }

/* ── Badges ─────────────────────────────── */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
}
/* Badge text darkened to meet WCAG AA 4.5:1 against the pale tint background
   in light theme; brightened for dark theme (dark-on-dark would fail). */
.badge-success { background: rgba(22,163,74,0.12); color: #166534; }
.badge-warning { background: rgba(245,158,11,0.12); color: #92400E; }
.badge-danger { background: rgba(192,57,43,0.12); color: #991B1B; }
.badge-info { background: rgba(37,99,235,0.12); color: #1E40AF; }
[data-theme="dark"] .badge-success { background: rgba(22,163,74,0.18); color: #6EE7B7; }
[data-theme="dark"] .badge-warning { background: rgba(245,158,11,0.18); color: #FCD34D; }
[data-theme="dark"] .badge-danger { background: rgba(220,80,60,0.20); color: #FCA5A5; }
[data-theme="dark"] .badge-info { background: rgba(59,130,246,0.20); color: #93C5FD; }

/* ── Forms ──────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 0.78rem; font-weight: 500; color: var(--text-2); margin-bottom: 4px; }
.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--sans);
    font-size: 0.88rem;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(21,128,61,0.08);
}
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
/* Stronger focus ring on dark backgrounds (game tiles, accent buttons)
   so the green outline never gets lost against deep-green or near-black. */
.btn-primary:focus-visible,
[data-theme="dark"] :focus-visible {
    outline: 3px solid #FFD86B;
    outline-offset: 3px;
}

/* ── Alerts ─────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    line-height: 1.65;
    border: 1px solid var(--border);
}
.alert-danger { background: rgba(192,57,43,0.04); border-color: rgba(192,57,43,0.15); }
.alert-warning { background: rgba(212,133,10,0.04); border-color: rgba(212,133,10,0.15); }
.alert-info { background: rgba(37,99,235,0.04); border-color: rgba(37,99,235,0.15); }
.alert-success { background: var(--green-50); border-color: rgba(34,197,94,0.15); }

/* ── Chart ──────────────────────────────── */
.chart-container { position: relative; height: 280px; width: 100%; }

/* ── Info Box ──────────────────────────── */
.info-box {
    padding: 20px;
    background: var(--bg-section);
    border-radius: var(--radius);
    font-size: 0.88rem;
    border: 1px solid var(--border-light);
    line-height: 1.7;
}
.info-box h4 { font-size: 0.95rem; margin-bottom: 10px; }
.info-box ul { padding-left: 18px; }
.info-box li { margin-bottom: 6px; }

/* ── Voice Cards ──────────────────────── */
.voice-card {
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    margin-bottom: 12px;
}
.voice-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.voice-avatar {
    width: 36px; height: 36px; min-width: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; color: white; font-weight: 600;
}
.voice-name { font-weight: 600; font-size: 0.88rem; }
.voice-handle { font-size: 0.75rem; color: var(--text-3); }
.voice-source { font-size: 0.65rem; color: var(--text-4); margin-left: auto; text-transform: uppercase; letter-spacing: 0.05em; }
.voice-content { font-size: 0.88rem; line-height: 1.65; color: var(--text-2); }
.voice-meta { font-size: 0.72rem; color: var(--text-4); margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border-light); }

/* ── Citizen Testimony panel ── */
.testimony-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 1.25rem; }
.testimony-lang-btn {
    font-family: var(--sans); font-size: 0.78rem; padding: 5px 12px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text-2);
    cursor: pointer; transition: all 0.15s; line-height: 1.4;
}
.testimony-lang-btn:hover { border-color: var(--green-700); color: var(--green-700); }
.testimony-lang-btn.active { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.testimony-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.testimony-card { margin-bottom: 0; display: flex; flex-direction: column; }
.testimony-quote { font-size: 0.95rem; line-height: 1.7; color: var(--ink); font-family: var(--serif); }
.testimony-card[lang] .testimony-quote { font-family: inherit; }
.testimony-en {
    font-size: 0.8rem; line-height: 1.6; color: var(--text-3); margin-top: 8px;
    padding-left: 10px; border-left: 2px solid var(--border-light); font-style: italic;
}
.testimony-langbadge {
    display: inline-block; font-size: 0.62rem; font-weight: 600; padding: 1px 7px;
    border-radius: 999px; margin-left: 6px; letter-spacing: 0.02em; vertical-align: middle;
}

/* ── Voice Bubbles (Pretext-powered shrinkwrap) ── */
.voice-bubble {
    border-radius: 16px 16px 16px 4px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    margin-bottom: 10px;
    display: inline-block;
    max-width: 85%;
    word-wrap: break-word;
    transition: width 0.15s ease;
}
.voice-bubble.voice-right {
    border-radius: 16px 16px 4px 16px;
    margin-left: auto;
    background: var(--green-50, #f0fdf4);
}
[data-theme="dark"] .voice-bubble.voice-right { background: #1a2e1a; }
.voice-bubble .voice-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.voice-bubble .voice-name { font-weight: 600; font-size: 0.82rem; }
.voice-bubble .voice-handle { font-size: 0.7rem; color: var(--text-3); }
.voice-bubble .voice-source { font-size: 0.6rem; color: var(--text-4); margin-left: auto; text-transform: uppercase; letter-spacing: 0.05em; }
.voice-bubble .voice-content, .voice-bubble .voice-body {
    font-size: 0.85rem; line-height: 1.6; color: var(--text-2);
}
.voice-bubble .voice-meta {
    font-size: 0.68rem; color: var(--text-4); margin-top: 6px; padding-top: 6px;
    border-top: 1px solid var(--border-light);
}
.voice-bubble-row { display: flex; flex-direction: column; margin-bottom: 4px; }

/* ── Editorial Story Panel ── */
.editorial-container {
    position: relative;
    min-height: 600px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    line-height: 28px;
    color: var(--text);
}
.editorial-line {
    position: absolute;
    white-space: nowrap;
    overflow: hidden;
}
.editorial-obstacle {
    position: absolute;
    border-radius: var(--radius);
    background: var(--bg-section);
    border: 1px solid var(--border);
    padding: 1rem;
    z-index: 2;
}
@media (max-width: 600px) {
    .voice-bubble { max-width: 95%; }
    .editorial-container { font-size: 16px; line-height: 24px; min-height: 500px; }
}

/* ── Resource Cards ───────────────────── */
.resource-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: all 0.15s;
    margin-bottom: 10px;
}
.resource-card:hover { box-shadow: var(--shadow-sm); }
.resource-type { font-size: 0.68rem; color: var(--text-3); margin-bottom: 4px; }
.resource-title { font-weight: 600; font-size: 0.88rem; margin-bottom: 4px; }
.resource-desc { font-size: 0.82rem; color: var(--text-2); line-height: 1.55; }

/* City cards */
.aqi-city-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.aqi-city-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
}
.aqi-city-name { font-size: 0.78rem; font-weight: 600; margin-bottom: 4px; }
.city-rank { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 0.82rem; }
.rank-num { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-section); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 600; }
.rank-num.top { background: var(--red); color: white; }
.city-rank-name { flex: 1; }
.city-rank-aqi { padding: 2px 8px; border-radius: 4px; color: white; font-family: var(--mono); font-size: 0.75rem; }

/* ── GRAP ──────────────────────────────── */
.grap-status { display: flex; gap: 6px; }
.grap-stage {
    /* Inactive stages were dimmed to opacity 0.3, which failed WCAG contrast.
       Raised to 0.8 (still visibly de-emphasised vs. the active stage, which
       also gets full opacity + a ring) so the text stays legible. */
    flex: 1; padding: 10px; text-align: center; border-radius: var(--radius);
    font-size: 0.72rem; font-weight: 600; opacity: 1;
}
.grap-stage:not(.active) { filter: saturate(0.7); }
.grap-stage.active { box-shadow: 0 0 0 2px var(--accent), 0 0 12px rgba(0,0,0,0.15); }
.grap-1 { background: #D1FAE5; color: #065F46; }
.grap-2 { background: #FEF3C7; color: #92400E; }
.grap-3 { background: #FED7AA; color: #9A3412; }
.grap-4 { background: #FEE2E2; color: #991B1B; }

/* Quick links */
.quick-link {
    display: flex; align-items: center; gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none !important;
}
.quick-link:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.quick-link-icon {
    width: 40px; height: 40px; min-width: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}
.quick-link-icon.health { background: rgba(192,57,43,0.08); }
.quick-link-icon.economic { background: rgba(212,133,10,0.08); }
.quick-link-icon.policy { background: rgba(37,99,235,0.08); }
.quick-link-icon.tools { background: var(--green-50); }
.quick-link h4 { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.quick-link p { font-size: 0.75rem; color: var(--text-3); margin: 0; }
/* Mobile: in the 2-up tablet/large-phone range the cards get narrow. Top-align
   the icon (so it doesn't float in the vertical centre of a tall card) and let
   the heading wrap between words rather than break mid-word — the global
   body{word-break:break-word} was splitting labels like "Accountability". */
@media (max-width: 1024px) {
    .quick-link { align-items: flex-start; gap: 12px; }
    .quick-link h3, .quick-link h4, .quick-link p { word-break: normal; overflow-wrap: break-word; hyphens: none; }
}

/* Result boxes */
.result-box {
    padding: 16px;
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.result-title { font-size: 0.78rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.result-value { font-family: var(--mono); font-size: 2rem; font-weight: 700; margin: 8px 0; }
.result-value.warning { color: var(--amber); }
.result-value.danger { color: var(--red); }
.result-detail { font-size: 0.82rem; color: var(--text-2); }

/* Search */
.search-box { display: flex; gap: 8px; }
.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--sans);
    font-size: 0.88rem;
    background: var(--bg-card);
    color: var(--text);
}
.search-btn { padding: 10px 20px; background: var(--accent); color: white; border: none; border-radius: var(--radius); cursor: pointer; font-family: var(--sans); font-size: 0.85rem; }

/* Tool cards */
.tool-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.tool-header { padding: 20px; border-bottom: 1px solid var(--border-light); }
.tool-header h3 { font-size: 0.95rem; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tool-header p { font-size: 0.82rem; color: var(--text-2); }
.tool-body { padding: 20px; }
.tool-meta { display: flex; gap: 12px; margin-top: 8px; }
.tool-meta-item { font-size: 0.72rem; color: var(--text-3); padding: 2px 8px; background: var(--bg-section); border-radius: 4px; }

/* Code box */
.code-box {
    padding: 12px;
    background: var(--green-900);
    color: var(--green-400);
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 0.75rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Resource list grid */
.resource-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }

/* Timeline */
.timeline-item { display: flex; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: none; }
.timeline-date { min-width: 80px; font-family: var(--mono); font-size: 0.8125rem; color: var(--green-700); font-weight: 600; }
.timeline-content { flex: 1; }
.timeline-title { font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.25rem; }
.timeline-desc { font-size: 0.875rem; color: var(--text-2); line-height: 1.5; }

/* Form range */
.form-range { width: 100%; accent-color: var(--accent); cursor: pointer; }

/* Share */
.share-bar { display: flex; gap: 8px; margin-top: 14px; }
.share-btn {
    font-size: 0.72rem; padding: 4px 12px; border: 1px solid var(--border);
    border-radius: 6px; background: var(--bg-card); color: var(--text-3);
    cursor: pointer; text-decoration: none; transition: all 0.12s;
}
.share-btn:hover { background: var(--bg-section); color: var(--text-2); text-decoration: none; }

/* ── Map ───────────────────────────────── */
#india-map { height: 450px; border-radius: var(--radius-lg); border: 1px solid var(--border); }

/* ── Historical Time-Slider ────────────── */
#map-time-slider-bar {
    position: absolute; bottom: 12px; left: 12px; right: 12px; z-index: 1000;
    background: var(--bg-section, #fff); border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px; padding: 8px 14px; display: none; align-items: center; gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); font-family: var(--sans, system-ui);
}
#map-time-slider-bar.visible { display: flex; }
#map-time-slider-bar .ts-label {
    font-size: 0.82rem; font-weight: 700; color: var(--ink, #0F172A);
    min-width: 90px; text-align: center; white-space: nowrap;
}
#map-time-slider-bar input[type="range"] {
    flex: 1; min-width: 0; accent-color: var(--accent, #1B6B4A); cursor: pointer;
}
#map-time-slider-bar .ts-live-btn {
    font-family: var(--sans, system-ui); font-size: 0.75rem; font-weight: 600;
    padding: 5px 12px; border: 0; border-radius: 7px; cursor: pointer;
    background: var(--accent, #1B6B4A); color: #fff; white-space: nowrap;
    transition: background 0.15s, transform 0.05s;
}
#map-time-slider-bar .ts-live-btn:hover { filter: brightness(1.1); }
#map-time-slider-bar .ts-live-btn:active { transform: scale(0.97); }
#map-time-slider-bar .ts-live-btn.active {
    background: #22C55E; box-shadow: 0 0 0 2px rgba(34,197,94,0.3);
}
#map-time-slider-loading {
    position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); z-index: 1001;
    background: var(--bg-section, #fff); border: 1px solid var(--border); border-radius: 8px;
    padding: 6px 16px; font-size: 0.78rem; color: var(--text-2); display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
@media (max-width: 600px) {
    #map-time-slider-bar { flex-wrap: wrap; gap: 6px; padding: 6px 10px; }
    #map-time-slider-bar .ts-label { min-width: 80px; font-size: 0.75rem; }
}

/* ── Footer ────────────────────────────── */
.site-footer {
    background: var(--green-900);
    color: rgba(255,255,255,0.5);
    padding: 48px 0 0;
    margin-top: 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr;
    gap: 40px;
}
/* Footer columns collapse in ONE place: 5 → 2 → 1 as the viewport narrows.
   (This used to be redefined in five scattered @media blocks that fought each
   other — one even labelled "single column" while setting two.) The brand cell
   spans the full width once the grid drops to two columns. */
@media (max-width: 1000px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px)  { .footer-grid { gap: 20px 16px; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 600px)  { .footer-grid { grid-template-columns: 1fr; } }
.footer-title { font-weight: 600; font-size: 0.85rem; margin-bottom: 14px; color: rgba(255,255,255,0.8); }
.footer-link { color: rgba(255,255,255,0.62); display: block; padding: 3px 0; font-size: 0.82rem; text-decoration: none; transition: color 0.12s; }
.footer-link:hover { color: rgba(255,255,255,0.85); text-decoration: none; }
.footer-desc { font-size: 0.85rem; line-height: 1.65; max-width: 440px; }
.footer-credits { font-size: 0.75rem; margin-top: 12px; color: rgba(255,255,255,0.6); }
.footer-credits a { color: rgba(255,255,255,0.85); text-decoration: underline; }
.footer-legal {
    margin-top: 32px;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.72rem;
    line-height: 1.7;
}
.footer-legal p { margin-bottom: 8px; max-width: 900px; }
.footer-legal strong { color: rgba(255,255,255,0.5); }
.footer-bottom {
    margin-top: 20px;
    padding: 16px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.72rem;
    text-align: center;
}

/* ── Utility ───────────────────────────── */
.mb-1 { margin-bottom: 12px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 32px; }
.mt-1 { margin-top: 12px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 32px; }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }

/* ── Panels (for tab content) ──────────── */
.panel { display: none; }
.panel.active { display: block; animation: panelIn 0.15s ease; }
@keyframes panelIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Print ─────────────────────────────── */

/* ═══ Enhanced Mobile Responsiveness ═══ */
@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .logo-mark { font-size: 1.1rem; }
    .logo-script { font-size: 1.1rem; }
    .logo-scripts { gap: 4px; }
    .hero { padding: 32px 0 28px; }
    .hero h1 { font-size: 1.6rem; }
    .section-intro h2 { font-size: 1.35rem !important; }
    .section-intro p { font-size: 0.9375rem !important; }
    .card-body { padding: 1rem; }
    .card-header { padding: 0.75rem 1rem; }
    .stat-value { font-size: 1.5rem; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stat-strip { grid-template-columns: repeat(2, 1fr); }
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { min-width: 500px; }
    .pull-quote { font-size: 1rem; padding: 1rem; }
    .tool-card { margin-bottom: 1rem; }
    .info-box { padding: 1rem; }
    .result-value { font-size: 1.5rem; }
    .alert { padding: 0.75rem; font-size: 0.8125rem; }
    .code-box { font-size: 0.7rem; }
    .pm25-hero { padding: 1.5rem; }
    .pm25-value { font-size: 1.75rem; }

    /* Mobile tap-target floor: any clickable .btn / .quick-link / .voice-card
       hits ≥44px high so it meets WCAG 2.5.5 / Android touch-target guidance. */
    .btn { min-height: 44px; padding-block: 10px; }
    .btn-sm { min-height: 40px; padding-block: 8px; }
    .quick-link { min-height: 64px; }
    a.footer-link { padding-block: 8px; }

    /* Long URLs / unhyphenated tokens (CAAQMS-IDs, IDoc-style refs) should
       break instead of forcing horizontal scroll. */
    p, li, dd, .voice-body, .resource-desc { overflow-wrap: anywhere; }
}

/* Reduce huge inline word-tokens at all widths — defensive wrap for the few
   places we render long URLs or column-data without spaces. */
.code-box, code { overflow-wrap: anywhere; }

@media (max-width: 768px) {
    .chart-container { height: 220px !important; min-height: 200px; }
    .grid-2 { grid-template-columns: 1fr; }
    .section-intro { margin-bottom: 1.5rem !important; padding-bottom: 1rem !important; }
    .card { margin-bottom: 0.75rem; }
    #india-map { height: 350px !important; }
    .voice-card { padding: 1rem; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}


/* ═══ Mobile Hamburger Menu ═══ */
.mobile-menu-btn { display: none; }
/* The horizontal section nav carries nine dropdowns now (About was split out);
   below ~1180px they no longer fit on one row, so hand over to the mobile menu
   there rather than let the last item overflow. */
@media (max-width: 1180px) {
    .mobile-menu-btn { display: flex; }
    .section-nav { display: none; }
    .section-nav.show-desktop { display: block; }
}
.mobile-nav-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 998; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.mobile-nav-overlay.open { display: block; }
.mobile-nav {
    display: none; position: fixed; top: 0; right: 0; bottom: 0;
    width: min(320px, 85vw); background: var(--bg-card); z-index: 999;
    overflow-y: auto; box-shadow: -4px 0 24px rgba(0,0,0,0.2);
    transform: translateX(100%); transition: transform 0.25s ease;
}
.mobile-nav.open { display: block; transform: translateX(0); }
.mobile-nav-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.mobile-nav-body { padding: 12px 0; }
.mobile-nav-group { padding: 8px 0; }
.mobile-nav-group-label {
    font-family: var(--sans); font-size: 0.625rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3);
    padding: 4px 20px 6px;
}
.mobile-nav-item {
    display: block; width: 100%; text-align: left; padding: 10px 20px;
    font-family: var(--sans); font-size: 0.875rem; font-weight: 500;
    color: var(--text-2); background: none; border: none; cursor: pointer;
    transition: background 0.1s;
}
.mobile-nav-item:hover, .mobile-nav-item:active { background: var(--green-50); color: var(--accent); }
.mobile-nav-item.active { color: var(--accent); font-weight: 600; background: var(--green-50); }


/* ═══ Language Switcher ═══ */
.lang-switcher { position: relative; }
.lang-dropdown {
    display: none; position: absolute; top: calc(100% + 4px); right: 0;
    min-width: 150px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: var(--shadow-md); padding: 4px 0; z-index: 200;
}
.lang-dropdown.open { display: block; }
.lang-option {
    display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
    padding: 8px 14px; font-family: var(--sans); font-size: 0.8rem; font-weight: 500;
    color: var(--text-2); background: none; border: none; cursor: pointer; transition: all 0.1s;
}
.lang-option:hover { background: var(--green-50); color: var(--accent); }
.lang-option.active { color: var(--accent); font-weight: 600; }
.lang-code {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 4px; font-size: 0.65rem; font-weight: 700;
    background: var(--green-50); color: var(--accent);
}

/* ═══ Floating Search & Feedback Widget ═══ */
.fab-btn {
    position: fixed; bottom: 24px; right: 24px; z-index: 500;
    width: 52px; height: 52px; border-radius: 50%; border: none;
    background: var(--accent); color: #fff; cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.fab-btn:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(0,0,0,0.25); }
.fab-btn svg { width: 22px; height: 22px; }
.fab-btn.open svg.icon-open { display: none; }
.fab-btn:not(.open) svg.icon-close { display: none; }

/* ═══ Back-to-home button (returns to dashboard hero & scrolls to top) ═══ */
.back-home-btn {
    position: fixed; bottom: 24px; left: 24px; z-index: 600;
    width: 52px; height: 52px; border-radius: 50%; border: 2px solid #fff;
    background: var(--accent); color: #fff; cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.06);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transform: translateY(8px) scale(0.92);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s, box-shadow 0.2s;
}
.back-home-btn.visible {
    opacity: 1; pointer-events: auto; transform: translateY(0) scale(1);
    animation: backHomePulse 1.4s ease-out 0.1s 1;
}
.back-home-btn:hover { background: #15803d; transform: translateY(0) scale(1.08); box-shadow: 0 8px 26px rgba(0,0,0,0.3); }
.back-home-btn:focus-visible { outline: 3px solid #FFD86B; outline-offset: 2px; }
.back-home-btn svg { width: 22px; height: 22px; }
/* One-time gentle pulse to draw attention when the button first appears */
@keyframes backHomePulse {
    0%   { box-shadow: 0 6px 20px rgba(0,0,0,0.25), 0 0 0 0    rgba(22,163,74,0.55); }
    60%  { box-shadow: 0 6px 20px rgba(0,0,0,0.25), 0 0 0 16px rgba(22,163,74,0);    }
    100% { box-shadow: 0 6px 20px rgba(0,0,0,0.25), 0 0 0 0    rgba(22,163,74,0);    }
}
@media (prefers-reduced-motion: reduce) {
    .back-home-btn.visible { animation: none; }
}

.widget-modal {
    display: none; position: fixed; bottom: 88px; right: 24px; z-index: 499;
    width: min(400px, calc(100vw - 32px)); max-height: min(520px, calc(100vh - 120px));
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: 0 12px 48px rgba(0,0,0,0.18);
    overflow: hidden; flex-direction: column;
}
.widget-modal.open { display: flex; animation: widgetSlideUp 0.2s ease; }
@keyframes widgetSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.widget-tabs {
    display: flex; border-bottom: 1px solid var(--border); background: var(--bg-body);
}
.widget-tab {
    flex: 1; padding: 10px 0; text-align: center; font-family: var(--sans);
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--text-3); background: none; border: none; cursor: pointer;
    border-bottom: 2px solid transparent; transition: all 0.15s;
}
.widget-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.widget-tab:hover { color: var(--accent); }

.widget-panel { display: none; flex: 1; overflow-y: auto; }
.widget-panel.active { display: flex; flex-direction: column; }

/* Search tab */
.widget-search-wrap { padding: 14px 16px 8px; }
.widget-search-input {
    width: 100%; padding: 10px 14px; font-family: var(--sans); font-size: 0.875rem;
    border: 1px solid var(--border); border-radius: 8px; background: var(--bg-body);
    color: var(--ink); outline: none; transition: border-color 0.15s;
}
.widget-search-input:focus { border-color: var(--accent); }
.widget-search-input::placeholder { color: var(--text-4); }
.widget-results { padding: 0 16px 16px; flex: 1; overflow-y: auto; }
.widget-result {
    display: block; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 4px;
    font-family: var(--sans); font-size: 0.8125rem; color: var(--text-2);
    background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer;
    transition: all 0.1s;
}
.widget-result:hover { background: var(--green-50); border-color: var(--border); color: var(--accent); }
.widget-result-title { font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.widget-result-desc { font-size: 0.75rem; color: var(--text-3); }
.widget-no-results { padding: 24px 16px; text-align: center; font-size: 0.8125rem; color: var(--text-3); }

/* Feedback tab */
.widget-feedback { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.widget-feedback label {
    font-family: var(--sans); font-size: 0.75rem; font-weight: 600;
    color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em;
}
.widget-feedback input, .widget-feedback textarea, .widget-feedback select {
    width: 100%; padding: 10px 12px; font-family: var(--sans); font-size: 0.875rem;
    border: 1px solid var(--border); border-radius: 8px; background: var(--bg-body);
    color: var(--ink); outline: none; resize: vertical;
}
.widget-feedback input:focus, .widget-feedback textarea:focus, .widget-feedback select:focus {
    border-color: var(--accent);
}
.widget-feedback textarea { min-height: 80px; }
.widget-submit-btn {
    padding: 10px 20px; font-family: var(--sans); font-size: 0.8125rem; font-weight: 600;
    background: var(--accent); color: #fff; border: none; border-radius: 8px; cursor: pointer;
    transition: opacity 0.15s; align-self: flex-start;
}
.widget-submit-btn:hover { opacity: 0.9; }
/* Ask AI tab */
.widget-ai { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.widget-ai-city { padding: 8px 10px; font-family: var(--sans); font-size: 0.8rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-body); color: var(--ink); }
.widget-ai-input { width: 100%; padding: 10px 14px; font-family: var(--sans); font-size: 0.875rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-body); color: var(--ink); outline: none; resize: none; min-height: 60px; }
.widget-ai-input:focus { border-color: var(--accent); }
.widget-ai-input::placeholder { color: var(--text-4); }
.widget-ai-response { flex: 1; overflow-y: auto; font-family: var(--sans); font-size: 0.85rem; line-height: 1.6; color: var(--text-2); padding: 10px; background: var(--bg-body); border-radius: 8px; border: 1px solid var(--border-light); min-height: 80px; }
.widget-ai-response.loading { color: var(--text-4); }
.widget-ai-meta { font-size: 0.7rem; color: var(--text-4); }
.widget-ai-actions { display: flex; gap: 8px; align-items: center; }

.widget-success {
    display: none; padding: 24px 16px; text-align: center;
    font-family: var(--sans); font-size: 0.9375rem; color: var(--accent);
}

@media (max-width: 480px) {
    .fab-btn { bottom: 16px; right: 16px; width: 48px; height: 48px; }
    .back-home-btn { bottom: 16px; left: 16px; width: 48px; height: 48px; }
    .back-home-btn svg { width: 20px; height: 20px; }
    .widget-modal { bottom: 76px; right: 12px; left: 12px; width: auto; max-height: calc(100vh - 100px); }
}

@media print {
    .ticker, .header, .section-nav, .site-footer { display: none; }
    .page-section { break-inside: avoid; }
}

/* ═══════════════════════════════════════════════════════════
   ROLE-BASED LANDING — Overlay, Cards, Dashboard, Switcher
   ═══════════════════════════════════════════════════════════ */

.role-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: var(--bg);
    display: flex; align-items: flex-start; justify-content: center;
    opacity: 1; transition: opacity 0.4s ease, transform 0.4s ease;
    overflow-y: auto; padding: 2rem 1rem;
}
.role-overlay.hiding {
    opacity: 0; transform: scale(1.02);
    pointer-events: none;
}
.role-overlay-inner {
    max-width: 900px; width: 100%; text-align: center;
}
.role-overlay-logo-icon {
    margin-bottom: 0.75rem;
}
.role-overlay-logo-icon svg { border-radius: 18px; filter: drop-shadow(0 6px 20px rgba(22,163,74,0.35)); }
.role-overlay-logo {
    font-family: var(--serif); font-size: 1.8rem; font-weight: 700;
    color: var(--accent); margin-bottom: 0.25rem;
}
.role-overlay-logo-sub {
    font-family: var(--sans); font-size: 0.75rem; font-weight: 500;
    color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 1.5rem;
}
.role-overlay h2 {
    font-family: var(--serif); font-size: 1.6rem; font-weight: 600;
    color: var(--text); margin-bottom: 0.5rem; line-height: 1.3;
}
.role-overlay .role-subtitle {
    font-size: 0.95rem; color: var(--text-2); margin-bottom: 2rem;
    max-width: 520px; margin-left: auto; margin-right: auto;
}

.role-grid {
    display: grid;
    /* 12 roles: pin to divisors of 12 (4 / 3 / 2) so every row is full and
       there are never awkward trailing empty slots. */
    grid-template-columns: repeat(4, 1fr);
    gap: 12px; margin-bottom: 2rem;
}
.role-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.25rem 1rem;
    cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    text-align: center; position: relative;
    /* Soft staggered "tile" entrance when the overlay opens. */
    animation: roleTileIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.role-card:hover {
    border-color: var(--accent); box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    background: rgba(22,163,74,0.06);
}
.role-card:hover .role-card-icon { transform: scale(1.08); }
.role-card:active { transform: translateY(-1px); }
.role-card-icon { transition: transform 0.18s ease; }
@keyframes roleTileIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.role-card:nth-child(1)  { animation-delay: 0.02s; }
.role-card:nth-child(2)  { animation-delay: 0.06s; }
.role-card:nth-child(3)  { animation-delay: 0.10s; }
.role-card:nth-child(4)  { animation-delay: 0.14s; }
.role-card:nth-child(5)  { animation-delay: 0.18s; }
.role-card:nth-child(6)  { animation-delay: 0.22s; }
.role-card:nth-child(7)  { animation-delay: 0.26s; }
.role-card:nth-child(8)  { animation-delay: 0.30s; }
.role-card:nth-child(9)  { animation-delay: 0.34s; }
.role-card:nth-child(10) { animation-delay: 0.38s; }
.role-card:nth-child(11) { animation-delay: 0.42s; }
.role-card:nth-child(12) { animation-delay: 0.46s; }
@media (prefers-reduced-motion: reduce) {
    .role-card { animation: none; }
    .role-card:hover { transform: none; }
    .role-card:hover .role-card-icon { transform: none; }
}

/* ══ Classy motion ═══════════════════════════════════════════════════════
   Gentle entrance + scroll-reveal. Progressive enhancement: elements are
   only hidden once JS adds .reveal-on to <html>, a failsafe reveals any
   stragglers, and everything is disabled for prefers-reduced-motion — so
   content can never end up permanently hidden. */
.hero-headline { animation: heroRise 0.7s cubic-bezier(.22,1,.36,1) both; }
.hero-sub      { animation: heroRise 0.7s cubic-bezier(.22,1,.36,1) 0.08s both; }
.hero-data     { animation: heroRise 0.8s cubic-bezier(.22,1,.36,1) 0.10s both; }
.hero-live-alert  { animation: heroRise 0.7s cubic-bezier(.22,1,.36,1) 0.16s both; }
.hero-live-toggle { animation: heroRise 0.7s cubic-bezier(.22,1,.36,1) 0.20s both; }
@keyframes heroRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

html.reveal-on [data-reveal] {
    opacity: 0; transform: translateY(22px);
    transition: opacity 0.7s ease, transform 0.75s cubic-bezier(.22,1,.36,1);
    will-change: opacity, transform;
}
html.reveal-on [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .hero-headline, .hero-sub, .hero-data, .hero-live-alert, .hero-live-toggle { animation: none; }
    html.reveal-on [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Panel-switch fade: each navigation injects a fresh .panel node into
   #panel-container, so this entrance animation replays on every switch —
   no JS needed. Disabled for reduced motion. */
#panel-container .panel {
    animation: panelFadeIn 0.34s cubic-bezier(.22,1,.36,1) both;
}
@keyframes panelFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    #panel-container .panel { animation: none; }
}

/* ══ "How JanVayu works" system diagram ══════════════════════════════════ */
/* Dashboard section headers — turn the long scroll into a labelled outline.
   An eyebrow (short kicker) + serif title marks each major block so the page
   reads as ordered sections rather than one continuous list of cards. */
.dash-section {
    display: flex; flex-direction: column; gap: 3px;
    margin: 40px 0 14px; padding-top: 22px;
    border-top: 1px solid var(--border, #e7e4dc);
}
.dash-section:first-of-type { border-top: none; padding-top: 0; margin-top: 26px; }
.dash-section-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.09em;
    text-transform: uppercase; color: var(--text-3);
}
.dash-section-eyebrow::before {
    content: ''; width: 18px; height: 2px;
    background: var(--accent); border-radius: 2px;
}
.dash-section-title {
    font-family: var(--serif); font-size: 1.4rem; font-weight: 600;
    line-height: 1.15; letter-spacing: -0.015em; color: var(--ink); margin: 0;
    text-wrap: balance;
}
.dash-section-sub {
    font-size: 0.82rem; color: var(--text-2); margin: 2px 0 0;
    max-width: 62ch; line-height: 1.45;
}
@media (max-width: 640px) {
    .dash-section { margin-top: 30px; }
    .dash-section-title { font-size: 1.2rem; }
}

.how-flow { padding: 0; background: none; border: none; }
/* The hand-drawn diagram sits on its own light "paper" so the sketch reads the
   same in light and dark site themes (like a drawing pinned to the page). */
.how-flow-svg {
    background: #fbfaf7; border: 1px solid #e7e4dc; border-radius: 14px;
    padding: 8px 14px; overflow-x: auto;
}
.how-flow-svg svg { display: block; width: 100%; height: auto; min-width: 560px; }
/* Two hand-drawn variants of the same diagram: a wide horizontal flow on
   desktop, and a portrait top-to-bottom stack on phones so the labels stay
   readable without a squished horizontal scroll. */
.how-flow-v { display: none; }
.how-flow-v svg { min-width: 0; max-width: 380px; margin: 0 auto; }
@media (max-width: 680px) {
    .how-flow-h { display: none; }
    .how-flow-v { display: block; overflow-x: visible; }
}

/* Generic on-site hand-drawn diagrams (AQI explainer, economic cost, the body,
   blog heroes). Same light "paper" as the system diagram. A wide variant shows
   on desktop and a portrait variant on phones; "solo" is a single portrait
   diagram centred at every width (the body). */
.jv-dgm { background: #fbfaf7; border: 1px solid #e7e4dc; border-radius: 14px; padding: 10px 14px; overflow-x: auto; margin: 1.75rem 0; }
.jv-dgm svg { display: block; width: 100%; height: auto; }
.jv-dgm-wide svg { min-width: 560px; }
.jv-dgm-tall { display: none; }
.jv-dgm-tall svg { min-width: 0; max-width: 400px; margin: 0 auto; }
.jv-dgm-solo svg { min-width: 0; max-width: 460px; margin: 0 auto; }
@media (max-width: 680px) {
    .jv-dgm-wide { display: none; }
    .jv-dgm-tall { display: block; overflow-x: visible; }
}

/* FAQ panel — accessible native <details> accordion + live search */
.faq-search {
    width: 100%; max-width: 34rem; padding: 11px 14px; font-size: 0.95rem;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg-card); color: var(--text); font-family: inherit;
}
.faq-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.faq-groups { display: flex; flex-direction: column; gap: 2rem; }
.faq-group-title {
    font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--ink);
    margin: 0 0 0.6rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border);
}
.faq-item {
    border: 1px solid var(--border); border-radius: 10px; margin-bottom: 0.6rem;
    background: var(--bg-card); overflow: hidden;
}
.faq-item > summary {
    list-style: none; cursor: pointer; padding: 14px 44px 14px 16px; position: relative;
    font-weight: 600; font-size: 0.95rem; color: var(--ink); line-height: 1.4;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
    content: '+'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    font-size: 1.3rem; font-weight: 400; color: var(--text-3); line-height: 1;
}
.faq-item[open] > summary::after { content: '\2212'; }
.faq-item > summary:hover { color: var(--accent); }
.faq-item > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.faq-a { padding: 0 16px 16px; font-size: 0.9rem; line-height: 1.65; color: var(--text-2); }
.faq-a a { color: var(--accent); }

/* Team page — responsive people cards */
.team-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem; margin-bottom: 2rem;
}
.team-card {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: 0.35rem; padding: 1.75rem 1.25rem;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
}
.team-avatar {
    width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif); font-size: 2rem; font-weight: 600;
    color: var(--on-accent, #fff);
    background: linear-gradient(135deg, var(--green-700), var(--green-900));
    margin-bottom: 0.5rem;
}
.team-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--ink); }
.team-role {
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--accent);
}
.team-bio { font-size: 0.88rem; line-height: 1.6; color: var(--text-2); margin: 0.35rem 0 0.6rem; }
.team-links { display: flex; gap: 0.9rem; flex-wrap: wrap; justify-content: center; }
.team-links a { font-size: 0.8rem; font-weight: 600; color: var(--accent); }
.team-links a[aria-disabled="true"] { color: var(--text-3); cursor: default; }
.team-join {
    background: var(--bg-section); border: 1px solid var(--border); border-radius: 14px;
    padding: 1.5rem;
}
.team-join-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--ink); margin: 0 0 0.5rem; }
.team-join-text { font-size: 0.9rem; line-height: 1.65; color: var(--text-2); margin: 0; max-width: 60ch; }
.team-join-text a { color: var(--accent); }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.how-flow-head { text-align: center; margin-bottom: 1.5rem; }
.how-flow-title {
    font-family: var(--serif); font-weight: 700;
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    letter-spacing: -0.01em; margin: 0 0 0.4rem; color: var(--ink);
}
.how-flow-sub {
    color: var(--text-2); font-size: 0.92rem; line-height: 1.5;
    max-width: 44rem; margin: 0 auto; text-wrap: balance;
}
.how-flow-grid { display: flex; align-items: stretch; gap: 0.75rem; }
.how-stage {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 12px; padding: 1rem 0.85rem;
}
.how-engine {
    border-color: var(--accent);
    background: rgba(22,163,74,0.05);
}
.how-stage-label {
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--accent);
    text-align: center; margin-bottom: 0.8rem;
}
.how-nodes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; justify-content: center; }
.how-nodes li {
    font-size: 0.82rem; font-weight: 600; color: var(--ink);
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; padding: 0.5rem 0.65rem; line-height: 1.3;
}
.how-engine .how-nodes li { border-color: rgba(22,163,74,0.28); }
.how-nodes li span {
    display: block; font-weight: 400; font-size: 0.7rem;
    color: var(--text-3); margin-top: 2px;
}
.how-arrow {
    align-self: center; flex: none;
    color: var(--accent); font-size: 1.5rem; font-weight: 700; line-height: 1;
}
.how-flow-foot {
    text-align: center; color: var(--text-3);
    font-size: 0.78rem; margin: 1.25rem 0 0; letter-spacing: 0.01em;
}

/* ══ Photo gallery ══════════════════════════════════════════════════════ */
.gal-grid { columns: 3 260px; column-gap: 14px; }
.gal-item {
    break-inside: avoid; margin: 0 0 14px; cursor: pointer; position: relative;
    border-radius: 10px; overflow: hidden; background: var(--bg-card); border: 1px solid var(--border);
}
.gal-item img { display: block; width: 100%; height: auto; transition: transform 0.4s ease; }
.gal-item:hover img { transform: scale(1.04); }
.gal-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gal-item figcaption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 12px 10px;
    font-size: 0.8rem; color: #fff; line-height: 1.3;
    background: linear-gradient(transparent, rgba(0,0,0,0.78));
    opacity: 0; transition: opacity 0.25s ease;
}
.gal-item:hover figcaption, .gal-item:focus-visible figcaption { opacity: 1; }
@media (max-width: 640px) { .gal-grid { columns: 2 150px; column-gap: 10px; } .gal-item { margin-bottom: 10px; } }
.gal-lightbox {
    position: fixed; inset: 0; z-index: 10000; display: none;
    background: rgba(10,10,8,0.94); align-items: center; justify-content: center; padding: 3vh 4vw;
}
.gal-lightbox.open { display: flex; }
.gal-lb-figure { margin: 0; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; }
#galLbImg { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
#galLbCap { margin-top: 12px; text-align: center; color: #fff; max-width: 60ch; display: flex; flex-direction: column; gap: 3px; }
.gal-cap-text { font-size: 0.95rem; }
.gal-cap-credit { font-size: 0.78rem; color: rgba(255,255,255,0.72); }
.gal-cap-credit a { color: rgba(255,255,255,0.92); }
.gal-lb-btn {
    position: absolute; background: rgba(255,255,255,0.12); color: #fff; border: none;
    width: 46px; height: 46px; border-radius: 50%; font-size: 1.5rem; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}
.gal-lb-btn:hover { background: rgba(255,255,255,0.25); }
.gal-lb-close { top: 3vh; right: 4vw; }
.gal-lb-prev { left: 2vw; top: 50%; transform: translateY(-50%); }
.gal-lb-next { right: 2vw; top: 50%; transform: translateY(-50%); }
@media (prefers-reduced-motion: reduce) { .gal-item img { transition: none; } }
@media (max-width: 720px) {
    .how-flow-grid { flex-direction: column; }
    .how-arrow { transform: rotate(90deg); margin: 0.1rem 0; }
}
.role-card-icon {
    font-size: 2rem; margin-bottom: 0.5rem; display: block;
    line-height: 1; color: var(--accent);
}
.role-card-title {
    font-family: var(--sans); font-size: 0.85rem; font-weight: 600;
    color: var(--text); margin-bottom: 0.25rem;
}
.role-card-desc {
    font-size: 0.72rem; color: var(--text-3); line-height: 1.4;
}
.role-skip {
    font-size: 0.85rem; color: var(--text-3);
    cursor: pointer; text-decoration: underline;
    text-underline-offset: 3px; background: none; border: none;
    font-family: var(--sans); padding: 0.5rem;
}
.role-skip:hover { color: var(--accent); }
/* Prominent "lead with data" skip, placed above the role grid so the live air
   quality is one click away without scrolling past all twelve role cards. */
.role-skip-top {
    display: inline-block;
    margin: 0.25rem auto 1.5rem;
    font-size: 0.95rem; font-weight: 600;
    color: var(--accent); text-decoration: none;
    border: 1.5px solid var(--accent);
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    transition: background 0.15s, color 0.15s;
}
.role-skip-top:hover {
    background: var(--accent); color: var(--on-accent, #fff);
}

/* Role Dashboard */
.role-dashboard-hero {
    text-align: center; padding: 1.5rem 0 1rem; margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}
.role-dashboard-hero h2 {
    font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
    color: var(--text); margin-bottom: 0.5rem;
}
.role-dashboard-hero p {
    font-size: 0.9rem; color: var(--text-2); max-width: 600px;
    margin: 0 auto;
}

.role-action-section {
    margin-bottom: 2rem;
}
.role-action-section h3 {
    font-family: var(--sans); font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-3); margin-bottom: 1rem;
}

.role-action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.role-action-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.25rem;
    cursor: pointer; transition: all 0.2s ease;
    display: flex; align-items: flex-start; gap: 1rem;
    text-align: left;
}
.role-action-card:hover {
    border-color: var(--accent); box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.role-action-card-icon {
    font-size: 1.5rem; flex-shrink: 0; width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--green-50); border-radius: 10px;
}
[data-theme="dark"] .role-action-card-icon {
    background: rgba(22, 163, 74, 0.12);
}
.role-action-card h3, .role-action-card h4 {
    font-family: var(--sans); font-size: 0.9rem; font-weight: 600;
    color: var(--text); margin-bottom: 0.25rem;
}
.role-action-card p {
    font-size: 0.78rem; color: var(--text-2); line-height: 1.4; margin: 0;
}
.role-action-card .action-cta {
    font-size: 0.72rem; font-weight: 600; color: var(--accent);
    margin-top: 0.5rem; display: inline-block;
}
.role-dash-logo {
    margin-bottom: 1rem;
}
.role-dash-logo svg { border-radius: 12px; filter: drop-shadow(0 3px 10px rgba(22,163,74,0.25)); }

.role-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.role-panel-link {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 1rem;
    cursor: pointer; transition: all 0.15s ease;
    text-align: left;
}
.role-panel-link:hover {
    border-color: var(--accent); background: var(--bg-section);
}
.role-panel-link h4 {
    font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 0.2rem;
}
.role-panel-link p {
    font-size: 0.72rem; color: var(--text-3); margin: 0; line-height: 1.4;
}

.role-explore-all {
    text-align: center; margin-top: 2rem; padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}
.role-explore-all button {
    font-family: var(--sans); font-size: 0.85rem; font-weight: 500;
    color: var(--text-2); background: none; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 0.6rem 1.5rem; cursor: pointer;
    transition: all 0.15s ease;
}
.role-explore-all button:hover {
    border-color: var(--accent); color: var(--accent);
}

/* Role Switcher in Header */
.role-switcher {
    position: relative; display: flex; align-items: center;
}
#roleSwitcherBtn .si { background: currentColor; }
#roleSwitcherBtn[data-active] { color: var(--accent); }
@keyframes role-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
}
#roleSwitcherBtn.pulse {
    animation: role-pulse 0.6s ease 2;
}
#simpleModeToggle.active { color: var(--accent); background: var(--green-50); }

/* Simple language mode indicator */
body.simple-language [data-simple] {
    position: relative;
}
body.simple-language .section-intro [data-simple]::after {
    content: '✓ Simple language';
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--green-50);
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.03em;
}

/* ═══ Glossary Overlay (Cmd+K) ═══ */
.glossary-overlay {
    display: none; position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    align-items: flex-start; justify-content: center; padding-top: 10vh;
}
.glossary-overlay.open { display: flex; animation: fadeIn 0.15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.glossary-box {
    width: min(640px, calc(100vw - 32px)); max-height: 70vh;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 16px 64px rgba(0,0,0,0.25);
    display: flex; flex-direction: column; overflow: hidden;
}
.glossary-search {
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px;
}
.glossary-search input {
    flex: 1; border: none; outline: none; background: transparent;
    font-family: var(--sans); font-size: 0.95rem; color: var(--ink);
}
.glossary-search input::placeholder { color: var(--text-3); }
.glossary-search kbd {
    font-family: var(--mono); font-size: 0.65rem; padding: 2px 6px;
    border: 1px solid var(--border); border-radius: 4px; color: var(--text-3);
}
.glossary-results {
    overflow-y: auto; padding: 8px 0; flex: 1;
}
.glossary-item {
    padding: 10px 16px; cursor: default;
}
.glossary-item:hover { background: var(--green-50); }
.glossary-item-term {
    font-weight: 700; color: var(--accent); font-size: 0.85rem;
    margin-bottom: 2px;
}
.glossary-item-def {
    font-size: 0.8rem; color: var(--text-2); line-height: 1.5;
}
.glossary-item.hidden { display: none; }
.glossary-empty {
    padding: 24px 16px; text-align: center; color: var(--text-3);
    font-size: 0.85rem;
}

/* ═══ Intro Tour ═══ */
.tour-tooltip {
    position: absolute; z-index: 3000;
    background: var(--ink); color: var(--bg); font-size: 0.75rem;
    padding: 8px 12px; border-radius: 8px; max-width: 200px;
    line-height: 1.5; pointer-events: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.tour-tooltip::after {
    content: ''; position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
    border-left: 6px solid transparent; border-right: 6px solid transparent;
    border-bottom: 6px solid var(--ink);
}
.tour-overlay {
    position: fixed; inset: 0; z-index: 2999;
    background: rgba(0,0,0,0.3); display: none;
}
.tour-overlay.active { display: block; }
.tour-tooltip button {
    margin-top: 6px; font-size: 0.7rem; padding: 3px 10px;
    border: 1px solid rgba(255,255,255,0.3); border-radius: 4px;
    background: transparent; color: var(--bg); cursor: pointer;
}
.tour-tooltip button:hover { background: rgba(255,255,255,0.15); }
.role-hint {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--ink); color: var(--bg); font-size: 0.7rem;
    padding: 6px 10px; border-radius: 6px; white-space: nowrap;
    pointer-events: none; opacity: 0; transition: opacity 0.3s;
    z-index: 1001;
}
.role-hint::before {
    content: ''; position: absolute; top: -4px; right: 12px;
    border-left: 5px solid transparent; border-right: 5px solid transparent;
    border-bottom: 5px solid var(--ink);
}
.role-hint.show { opacity: 1; }
.role-switcher-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.25);
    min-width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 10001;
    display: none;
    padding: 8px 0 env(safe-area-inset-bottom, 16px);
}
.role-switcher-dropdown::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 4px auto 8px;
}
.role-switcher-dropdown.open { display: block; }
@media (min-width: 769px) {
    .role-switcher-dropdown {
        position: fixed;
        top: 56px;
        bottom: auto;
        left: auto;
        right: 24px;
        min-width: 200px;
        max-width: 240px;
        max-height: 80vh;
        border-radius: var(--radius);
        box-shadow: var(--shadow-lg);
        padding: 4px 0;
    }
    .role-switcher-dropdown::before { display: none; }
}
/* Backdrop for mobile role switcher */
.role-switcher-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 10000;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.role-switcher-backdrop.open { display: block; }
.role-switcher-option {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 14px 20px; border: none;
    background: none; cursor: pointer; font-family: var(--sans);
    font-size: 0.9rem; color: var(--text); text-align: left;
    transition: background 0.1s ease;
}
@media (min-width: 769px) {
    .role-switcher-option { padding: 8px 12px; font-size: 0.78rem; gap: 8px; }
}
.role-switcher-option:hover {
    background: var(--bg-section);
}
.role-switcher-option.active {
    color: var(--accent); font-weight: 600;
}

/* Action Box for panels */
.panel-action-box {
    background: var(--green-50); border: 1px solid var(--green-100);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius); padding: 1rem 1.25rem;
    margin-bottom: 1.5rem; display: flex; align-items: center;
    gap: 1rem; flex-wrap: wrap;
}
[data-theme="dark"] .panel-action-box {
    background: rgba(22, 163, 74, 0.06);
    border-color: rgba(22, 163, 74, 0.15);
    border-left-color: var(--accent);
}
.panel-action-box-text {
    flex: 1; min-width: 200px;
}
.panel-action-box-text strong {
    font-size: 0.85rem; color: var(--text); display: block;
    margin-bottom: 0.2rem;
}
.panel-action-box-text span {
    font-size: 0.78rem; color: var(--text-2);
}
.panel-action-box .action-btn {
    font-family: var(--sans); font-size: 0.78rem; font-weight: 600;
    background: var(--accent); color: white; border: none;
    border-radius: 6px; padding: 0.5rem 1.25rem; cursor: pointer;
    white-space: nowrap; transition: background 0.15s ease;
}
.panel-action-box .action-btn:hover {
    background: var(--accent-hover);
}

/* Tablet: 3 columns (12 → 4 full rows), still no trailing gaps. */
@media (max-width: 820px) {
    .role-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .role-overlay { padding: 1rem 0.75rem; align-items: flex-start; }
    .role-overlay-inner { padding-top: 0.5rem; }
    .role-overlay-logo-icon svg { width: 56px; height: 56px; }
    .role-overlay-logo { font-size: 1.4rem; margin-bottom: 0.15rem; }
    .role-overlay-logo-sub { font-size: 0.65rem; margin-bottom: 0.75rem; }
    .role-overlay h2 { font-size: 1.15rem; margin-bottom: 0.3rem; }
    .role-overlay .role-subtitle { font-size: 0.82rem; margin-bottom: 1rem; }
    .role-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .role-card { padding: 0.75rem 0.5rem; }
    .role-card-icon { font-size: 1.25rem; color: var(--accent); }
    .role-card-title { font-size: 0.78rem; }
    .role-card-desc { font-size: 0.68rem; }
    .role-action-cards { grid-template-columns: 1fr; }
    .role-panel-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 375px) {
    .role-overlay-logo-icon svg { width: 44px; height: 44px; }
    .role-overlay-logo { font-size: 1.2rem; }
    .role-overlay h2 { font-size: 1.05rem; }
    .role-grid { gap: 6px; }
    .role-card { padding: 0.6rem 0.4rem; }
}

/* ═══ ACCESSIBILITY: Skip link ═══ */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10000;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

/* ═══ ACCESSIBILITY: Reduced motion ═══ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .ticker-strip { animation: none; }
}

/* ═══ MOBILE: Prevent horizontal overflow ══��� */
body {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ═══ MOBILE: Comprehensive phone layout fixes ═══ */
@media (max-width: 768px) {
    /* Header: shrink buttons to fit */
    .header-actions { gap: 2px; }
    .header-actions .icon-btn {
        width: 38px; height: 38px;
        font-size: 0.85rem;
        border-radius: 6px;
    }
    /* Hide Blog text button on mobile — accessible via footer & hamburger */
    .header-actions > a[href="/blog/"] { display: none; }
    .hide-mobile { display: none !important; }

    /* More breathing room for content */
    .container { padding: 0 16px; }

    /* Hero section: less cramped */
    .hero { padding: 28px 0 24px; }
    .hero-headline { font-size: clamp(1.5rem, 5vw, 2rem); line-height: 1.2; }
    .hero-sub { font-size: 0.9rem; line-height: 1.6; }

    /* Stat strips: readable on narrow screens */
    .stat-strip { gap: 8px; }
    .stat-strip-item { padding: 12px 8px; }
    .number-callout { font-size: clamp(1.5rem, 4vw, 2rem); }

    /* Cards: reduce padding for more content room */
    .card { border-radius: 10px; }
    .card-body { padding: 12px; }
    .card-header { padding: 10px 12px; }
    .card-footer { padding: 8px 12px; font-size: 0.7rem; }

    /* Info boxes: tighter */
    .info-box { padding: 12px; font-size: 0.875rem; }

    /* Tables: scrollable with full-bleed */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
    table { font-size: 0.8rem; }
    table th, table td { padding: 8px 10px; }

    /* Collapsibles: more compact */
    .collapsible-toggle { padding: 12px 14px; font-size: 0.95rem; }

    /* Forms: full width inputs */
    .form-input, .form-select, .form-textarea { width: 100%; box-sizing: border-box; }

    /* Footer: tighter link spacing (column count is handled in the footer
       section's own @media blocks, not here). */
    .footer { padding: 24px 0; }
    .footer-link { padding: 6px 0; font-size: 0.8rem; }

    /* Section intros: readable */
    .section-intro { padding-bottom: 1rem; }
    .section-intro h2 { font-size: 1.3rem !important; }
    .section-intro p { font-size: 0.9rem !important; line-height: 1.6; }

    /* Pull quotes */
    .pull-quote { font-size: 0.95rem; padding: 12px 16px; }

    /* Buttons: 44px min touch targets */
    .btn { padding: 10px 18px; font-size: 0.85rem; }
    .btn-sm { padding: 8px 14px; font-size: 0.8rem; min-height: 44px; }
}

@media (max-width: 375px) {
    /* iPhone SE and very small phones */
    .container { padding: 0 12px; }
    .header-actions .icon-btn { width: 34px; height: 34px; }
    .hero-headline { font-size: 1.35rem; }
    .number-callout { font-size: 1.3rem; }
    .stat-strip { grid-template-columns: 1fr; }
    .grid-5 { grid-template-columns: 1fr; }
}

/* ── Source apportionment ring ─────────────────────────────────────────── */
.apportion-controls { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.apportion-label { font-size: 0.8125rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.apportion-select { font: inherit; font-size: 0.95rem; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--bg-card); color: var(--ink); min-width: 11rem; }
.apportion-basis { font-size: 0.8125rem; color: var(--text-3); font-style: italic; }
.apportion-layout { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 1.75rem; align-items: center; }
.apportion-ringwrap { position: relative; min-height: 260px; }
.apportion-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.apportion-center-pct { font-family: var(--serif, Georgia, serif); font-size: 2rem; font-weight: 700; line-height: 1; color: var(--ink); }
.apportion-center-lbl { font-size: 0.8125rem; color: var(--text-3); margin-top: 0.25rem; max-width: 8rem; }
.apportion-legend { display: flex; flex-direction: column; gap: 0.6rem; }
.apportion-row { display: grid; grid-template-columns: 0.85rem minmax(6rem, auto) 1fr 2.75rem; align-items: center; gap: 0.6rem; }
.apportion-swatch { width: 0.85rem; height: 0.85rem; border-radius: 0.2rem; flex-shrink: 0; }
.apportion-rowlabel { font-size: 0.9rem; color: var(--ink); }
.apportion-rowbar { height: 0.5rem; background: var(--bg-section); border-radius: 999px; overflow: hidden; }
.apportion-rowbar-fill { display: block; height: 100%; border-radius: 999px; }
.apportion-rowval { font-size: 0.9rem; font-weight: 600; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.apportion-source { margin-top: 1.5rem; padding: 1rem 1.1rem; background: var(--bg-section); border: 1px solid var(--border); border-radius: 0.6rem; }
.apportion-src-line { font-size: 0.85rem; color: var(--text-2); margin: 0 0 0.4rem; }
.apportion-caveat { font-size: 0.8125rem; color: var(--text-3); margin: 0; line-height: 1.55; }
.apportion-method { margin-top: 1.25rem; }
.apportion-method > summary { cursor: pointer; font-weight: 600; color: var(--green-700); font-size: 0.95rem; padding: 0.4rem 0; }
.apportion-method-body { font-size: 0.9rem; color: var(--text-2); line-height: 1.65; padding-top: 0.5rem; }
.apportion-method-body ul { margin: 0.5rem 0 0.75rem 1.1rem; }
.apportion-method-body li { margin-bottom: 0.4rem; }
@media (max-width: 640px) {
    .apportion-layout { grid-template-columns: 1fr; gap: 1.25rem; }
    .apportion-ringwrap { max-width: 300px; margin: 0 auto; }
}

/* ── Story of the week (dashboard) ─────────────────────────────────────── */
.story-week-card { display: block; text-decoration: none; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 0.7rem; padding: 1.1rem 1.25rem; background: var(--bg-card); transition: box-shadow 0.15s, transform 0.15s; }
.story-week-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.07); transform: translateY(-1px); }
.story-week-tag { display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--green-700); background: var(--bg-section); padding: 0.15rem 0.5rem; border-radius: 999px; margin-bottom: 0.55rem; }
.story-week-title { display: block; font-family: var(--serif, Georgia, serif); font-size: 1.2rem; line-height: 1.3; color: var(--ink); margin-bottom: 0.4rem; }
.story-week-blurb { display: block; font-size: 0.95rem; line-height: 1.6; color: var(--text-2); margin-bottom: 0.6rem; }
.story-week-cta { display: inline-block; font-size: 0.9rem; font-weight: 600; color: var(--green-700); }

/* Featured treatment — the near-top dashboard slot gets more presence:
   an eyebrow, a larger serif headline, a thicker rail, and a faint accent wash. */
.story-week-eyebrow { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 0.6rem; }
.story-week-card.featured { border-left-width: 4px; padding: 1.5rem 1.75rem; background: linear-gradient(180deg, var(--green-50, rgba(21,128,61,0.04)) 0%, var(--bg-card) 60%); }
.story-week-card.featured .story-week-title { font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.22; margin-bottom: 0.55rem; }
.story-week-card.featured .story-week-blurb { font-size: 1rem; max-width: 62ch; }
.story-week-card.featured .story-week-cta { font-size: 0.95rem; }
@media (prefers-color-scheme: dark) { .story-week-card.featured { background: var(--bg-card); } }
@media (max-width: 600px) { .story-week-card.featured { padding: 1.2rem 1.15rem; } }

/* ── Searchable city combobox ───────────────────────────────────────────── */
.city-combo { position: relative; flex: 1; min-width: 0; }
.city-combo-input {
    width: 100%; box-sizing: border-box;
    font-family: var(--sans); font-size: 0.72rem; font-weight: 600;
    background: var(--bg-section); color: var(--ink);
    border: 1px solid var(--border); border-radius: 6px;
    padding: 5px 8px 5px 26px; cursor: text;
}
.city-combo-icon {
    position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
    width: 13px; height: 13px; color: var(--text-3); pointer-events: none;
    display: flex; align-items: center; justify-content: center;
}
.city-combo-icon svg { width: 100%; height: 100%; }
.city-combo-input::placeholder { color: var(--text-3); font-weight: 500; text-transform: none; letter-spacing: 0; }
.city-combo-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.city-combo-list {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
    margin: 0; padding: 4px; list-style: none;
    max-height: 15rem; overflow-y: auto;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}
.city-combo-input { text-align: left; }
.city-combo-opt {
    padding: 7px 10px; border-radius: 6px; font-size: 0.85rem; color: var(--ink); cursor: pointer; text-align: left;
}
.city-combo-opt:hover, .city-combo-opt.active { background: var(--bg-section); }
.city-combo-opt.active { outline: 1px solid var(--accent); }
.city-combo-empty { padding: 7px 10px; font-size: 0.85rem; color: var(--text-3); }

/* ── Responsive tables → stacked labeled cards on small screens ─────────── */
@media (max-width: 640px) {
    .responsive-cards, .responsive-cards tbody, .responsive-cards tr, .responsive-cards td {
        display: block; width: 100%; box-sizing: border-box;
    }
    .responsive-cards { min-width: 0 !important; }
    /* Keep the header row in the DOM for assistive tech, hidden visually. */
    .responsive-cards thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
    .responsive-cards tr { margin-bottom: 0.75rem; border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.85rem; background: var(--bg-card); }
    /* Label above value, each on its own line — wraps naturally, never overflows. */
    .responsive-cards td {
        text-align: left; padding: 0.4rem 0; border: none; border-bottom: 1px solid var(--border);
        font-size: 0.85rem; overflow-wrap: anywhere;
    }
    .responsive-cards td:last-child { border-bottom: none; }
    .responsive-cards td::before {
        content: attr(data-label); display: block;
        font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
        color: var(--text-3); margin-bottom: 0.15rem;
    }
    .responsive-cards td[data-label=""]::before { content: ""; margin: 0; }
}
