/* Crash Atlas — single-crash_atlas.php
 *
 * Built on the site's own tokens rather than the prototype's approximations.
 * Two of the prototype's guesses were wrong and are not used here: the display
 * face is DM Sans, not Plus Jakarta Sans, and the page background is --mist
 * (#f6f9ff) rather than #f3f6fc.
 *
 * Light only, and deliberately so. The page is read on white news sites in
 * embeds and in screenshots, and a report that inverts itself on someone's
 * phone is a report they cannot screenshot for a story. There is no
 * prefers-color-scheme block, which is the point.
 *
 * No red anywhere. Severity runs along the brand yellow: pale #fff1c2, yellow
 * #ffc933, deep gold #b87300, with navy for deaths. Blue is reserved for
 * things you can click.
 */

.atlas {
    --atlas-pale: #fff1c2;
    --atlas-yellow: #ffc933;
    --atlas-gold: #b87300;
    --atlas-amber: #f0a500;

    background: var(--mist);
    padding-bottom: var(--space-9);
    color: var(--ink-900);
    font-family: var(--font-body);
}

.atlas-wrap {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 var(--gutter, 24px);
}

.atlas-h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(26px, 3.2vw, 36px);
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--ink-950);
}

.atlas-lede {
    max-width: 68ch;
    margin: var(--space-3) 0 0;
    font-size: var(--text-lead);
    line-height: 1.7;
    color: var(--ink-600);
}

.atlas-note {
    margin: var(--space-4) 0 0;
    font-size: var(--text-small);
    line-height: 1.6;
    color: var(--ink-500);
}

.atlas > section,
.atlas > header {
    padding-top: clamp(40px, 5vw, 72px);
}

/* Breadcrumbs ------------------------------------------------------------ */
.atlas-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding-top: var(--space-5);
    font-size: var(--text-small);
    color: var(--ink-500);
}

.atlas-crumbs a { color: var(--ink-600); text-decoration: none; }
.atlas-crumbs a:hover { color: var(--brand-600); text-decoration: underline; }

/* Headline --------------------------------------------------------------- */
.atlas-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    padding: 6px 14px 6px 10px;
    border-radius: var(--radius-pill);
    background: #fff;
    border: 1px solid var(--border);
    font-size: var(--text-caption);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-700);
}

.atlas-badge svg { width: 15px; height: 15px; color: var(--brand-600); }

.atlas-h1 {
    margin: var(--space-4) 0 0;
    max-width: 20ch;
    font-family: var(--font-display);
    font-size: clamp(34px, 5.4vw, 52px);
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: var(--ink-950);
}

.atlas-dek {
    max-width: 62ch;
    margin: var(--space-4) 0 0;
    font-size: clamp(17px, 2vw, 20px);
    line-height: 1.65;
    color: var(--ink-600);
}

.atlas-byline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-5) 0 0;
    font-size: var(--text-small);
    color: var(--ink-500);
}

/* Hero ------------------------------------------------------------------- */
.atlas-hero__map-panel {
    margin-top: var(--space-6);
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.atlas-map {
    position: relative;
    height: clamp(320px, 48vw, 520px);
    background: #f1f5f9;
}

.atlas-map--rank { height: 100%; min-height: 360px; }

.atlas-map__fallback {
    margin: 0;
    padding: var(--space-6);
    font-size: var(--text-small);
    color: var(--ink-500);
}

.atlas-map__bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
    font-size: var(--text-caption);
    color: var(--ink-500);
}

.atlas-year {
    font-family: var(--font-display);
    font-size: var(--text-h5);
    font-weight: 700;
    color: var(--ink-950);
}

.atlas-map__credit { margin-left: auto; text-align: right; }

.atlas-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--ink-700);
    font: 600 var(--text-small) var(--font-body);
    cursor: pointer;
}

.atlas-pill:hover { border-color: var(--brand-300); color: var(--brand-700); }

/* Key figures ------------------------------------------------------------ */
.atlas-figs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
    margin: var(--space-5) 0 0;
    padding: 0;
    list-style: none;
}

.atlas-fig {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
}

.atlas-fig__n {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(26px, 3.4vw, 38px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--ink-950);
}

.atlas-fig__l {
    display: block;
    margin-top: 6px;
    font-size: var(--text-small);
    color: var(--ink-600);
}

.atlas-fig--serious .atlas-fig__n { color: var(--atlas-gold); }
.atlas-fig--fatal .atlas-fig__n { color: var(--brand-950, #172554); }

/* The data desk's notes -------------------------------------------------- */
.atlas-findings {
    display: grid;
    gap: var(--space-3);
    margin: var(--space-5) 0 0;
    padding: var(--space-5);
    list-style: none;
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--atlas-yellow);
}

.atlas-findings li {
    font-size: var(--text-lead);
    line-height: 1.6;
    color: var(--ink-900);
}

/* Ranking explorer -------------------------------------------------------- */
.atlas-explorer {
    display: grid;
    grid-template-columns: 58% 1fr;
    gap: var(--space-5);
    margin-top: var(--space-6);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.atlas-explorer__map {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    min-height: 420px;
}

/* Controls float on the map rather than sitting under the card, so the
   panel keeps one height and nothing is bolted on below it. */
.atlas-float {
    position: absolute;
    left: var(--space-4);
    bottom: var(--space-4);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: var(--radius-pill);
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.atlas-float__btn {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-700);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.atlas-float__btn:hover { background: var(--mist); color: var(--brand-700); }

.atlas-float__play {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--mist);
    color: var(--ink-900);
    font: 600 var(--text-small) var(--font-body);
    cursor: pointer;
    overflow: hidden;
}

.atlas-float__play:hover { background: var(--brand-50); color: var(--brand-700); }

/* The countdown's progress lives inside the pill. */
.atlas-float__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0;
    background: var(--brand-600);
}

.atlas-float__icon { font-size: 11px; }

/* The ranked list, which expands in place -------------------------------- */
.atlas-list {
    position: relative;
    max-height: 560px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-y: auto;
    /* No visible scrollbar: the panel fades at both edges instead. */
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}

.atlas-list::-webkit-scrollbar { width: 0; height: 0; }

.atlas-row + .atlas-row { margin-top: 4px; }

.atlas-row__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    min-height: 56px;
    padding: var(--space-3);
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.atlas-row__head:hover { background: var(--mist); }

.atlas-row.is-open .atlas-row__head {
    background: #fff;
    box-shadow: inset 3px 0 0 var(--brand-600), var(--shadow-xs);
}

.atlas-row__badge {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--atlas-yellow);
    color: var(--ink-950);
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
}

.atlas-row__text { min-width: 0; flex: 1; }

.atlas-row__name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink-950);
}

.atlas-row__sub {
    display: block;
    margin-top: 2px;
    font-size: var(--text-caption);
    color: var(--ink-500);
}

.atlas-row__bar {
    display: block;
    height: 4px;
    margin-top: 7px;
    border-radius: 2px;
    background: var(--border);
    overflow: hidden;
}

.atlas-row__bar span { display: block; height: 100%; background: var(--brand-600); }

.atlas-row__body { padding: var(--space-2) var(--space-3) var(--space-5); }

.atlas-row__h3 {
    margin: 0 0 var(--space-4);
    font-family: var(--font-display);
    font-size: var(--text-h5);
    line-height: 1.25;
    color: var(--ink-950);
}

.atlas-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
    margin: 0 0 var(--space-5);
    padding: 0;
    list-style: none;
}

.atlas-tiles li {
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--mist);
    text-align: center;
}

.atlas-tiles li span:first-child {
    display: block;
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    color: var(--ink-950);
}

.atlas-tiles li span:last-child {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.atlas-tiles .is-serious span:first-child { color: var(--atlas-gold); }
.atlas-tiles .is-fatal span:first-child { color: var(--brand-950, #172554); }

.atlas-clock h4,
.atlas-who h4 {
    margin: 0 0 var(--space-3);
    font-size: var(--text-caption);
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.atlas-clock { display: grid; grid-template-columns: 136px 1fr; gap: var(--space-4); align-items: center; }
.atlas-clock h4 { grid-column: 1 / -1; }
.atlas-clock__svg { width: 136px; height: 136px; }
.atlas-clock__t { font: 600 9px var(--font-body); fill: var(--ink-400); letter-spacing: .08em; text-transform: uppercase; }
.atlas-clock__v { font: 700 15px var(--font-display); fill: var(--ink-950); }

.atlas-clock__note {
    margin: 0;
    font-size: var(--text-small);
    line-height: 1.6;
    color: var(--ink-600);
}

.atlas-who { margin-top: var(--space-5); }
.atlas-who ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }

.atlas-who li {
    display: grid;
    grid-template-columns: 11ch 1fr 5ch;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-small);
}

.atlas-who__l { color: var(--ink-600); }
.atlas-who__bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.atlas-who__bar span { display: block; height: 100%; background: var(--brand-600); }
.atlas-who li:first-child .atlas-who__bar span { background: var(--atlas-yellow); }
.atlas-who__v { text-align: right; font-weight: 600; color: var(--ink-900); }

.atlas-row__cta { margin: var(--space-5) 0 0; font-size: var(--text-small); }
.atlas-row__cta a { color: var(--brand-700); font-weight: 600; }

/* Heat map ---------------------------------------------------------------- */
.atlas-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-5); }

.atlas-chip {
    min-height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--ink-700);
    font: 600 var(--text-small) var(--font-body);
    cursor: pointer;
}

.atlas-chip:hover { border-color: var(--brand-300); color: var(--brand-700); }
.atlas-chip.is-on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

.atlas-heat {
    margin-top: var(--space-5);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}

.atlas-heat::-webkit-scrollbar { height: 0; }

.atlas-heat__hours {
    display: grid;
    grid-template-columns: 42px repeat(8, 1fr);
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--ink-400);
}

.atlas-heat__hours span { grid-column: span 1; }
.atlas-heat__hours span:first-child { grid-column: 2; }

.atlas-heat__row {
    display: grid;
    grid-template-columns: 42px repeat(24, minmax(10px, 1fr));
    gap: 3px;
    align-items: center;
    margin-bottom: 3px;
}

.atlas-heat__day { font-size: 11px; color: var(--ink-500); }

.atlas-heat__cell {
    height: 20px;
    border-radius: 4px;
    /* Pale yellow -> yellow -> deep gold, by --t. */
    background: color-mix(in srgb, var(--atlas-pale) calc((1 - var(--t)) * 100%), var(--atlas-gold));
}

.atlas-heat__cell[data-v="0"] { background: #f1f5f9; }

.atlas-heat__legend {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-4) 0 0;
    font-size: var(--text-caption);
    color: var(--ink-500);
}

.atlas-heat__legend i {
    flex: 1;
    max-width: 180px;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--atlas-pale), var(--atlas-yellow), var(--atlas-gold));
}

/* Table -------------------------------------------------------------------- */
.atlas-table__scroll { margin-top: var(--space-5); overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: #fff; }

.atlas-table { width: 100%; border-collapse: collapse; font-size: var(--text-small); }

.atlas-table th,
.atlas-table td { padding: 11px var(--space-4); text-align: right; white-space: nowrap; }

.atlas-table thead th {
    position: sticky;
    top: 0;
    background: var(--mist);
    font-size: var(--text-caption);
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.atlas-table th[scope="row"],
.atlas-table thead th:nth-child(2) { text-align: left; white-space: normal; font-weight: 600; color: var(--ink-900); }

.atlas-table tbody tr { border-top: 1px solid var(--border); }
.atlas-table tbody tr.is-top { background: #fffdf5; }
.atlas-table tbody tr:hover { background: var(--mist); }

/* State law ---------------------------------------------------------------- */
.atlas-law__cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-5);
}

.atlas-law__card {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
}

.atlas-law__card h3 {
    margin: 0;
    font-size: var(--text-caption);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.atlas-law__v {
    margin: var(--space-3) 0 0;
    font-family: var(--font-display);
    font-size: var(--text-h5);
    line-height: 1.3;
    color: var(--ink-950);
}

.atlas-law__d { margin: var(--space-3) 0 0; font-size: var(--text-small); line-height: 1.6; color: var(--ink-600); }
.atlas-law__c { margin: var(--space-2) 0 0; font-size: var(--text-caption); color: var(--ink-400); }
.atlas-law__card p:last-child { margin: var(--space-4) 0 0; font-size: var(--text-small); }
.atlas-law__card a { color: var(--brand-700); font-weight: 600; }

.atlas-steps {
    max-width: 68ch;
    margin: var(--space-6) 0 0;
    padding-left: 1.3em;
    font-size: var(--text-base);
    line-height: 1.75;
    color: var(--ink-700);
}

.atlas-steps li { margin-bottom: var(--space-2); }
.atlas-law__cta { margin: var(--space-6) 0 0; }

.atlas-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 26px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--brand-600);
    color: #fff;
    font: 600 var(--text-base) var(--font-body);
    text-decoration: none;
    cursor: pointer;
}

.atlas-btn:hover { background: var(--brand-700); color: #fff; }

.atlas-btn--quiet {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--ink-900);
    min-height: 42px;
    font-size: var(--text-small);
}

.atlas-btn--quiet:hover { background: var(--mist); border-color: var(--brand-300); color: var(--brand-700); }

/* Press -------------------------------------------------------------------- */
.atlas-press__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-5);
}

.atlas-copy {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
}

.atlas-copy label {
    display: block;
    margin-bottom: var(--space-3);
    font-size: var(--text-caption);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.atlas-copy textarea {
    width: 100%;
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--mist);
    font: 400 12px var(--font-mono, ui-monospace, monospace);
    color: var(--ink-700);
    resize: vertical;
}

/* Methodology --------------------------------------------------------------- */
.atlas-method__list {
    display: grid;
    gap: var(--space-5);
    margin: var(--space-5) 0 0;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
}

.atlas-method__list dt {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--ink-950);
}

.atlas-method__list dd {
    max-width: 78ch;
    margin: var(--space-2) 0 0;
    font-size: var(--text-small);
    line-height: 1.7;
    color: var(--ink-600);
}

.atlas-method__list a { color: var(--brand-700); }

/* FAQ ----------------------------------------------------------------------- */
.atlas-faq__item {
    margin-top: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    background: #fff;
    border: 1px solid var(--border);
}

.atlas-faq__item summary {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--ink-950);
    cursor: pointer;
}

.atlas-faq__item p { margin: var(--space-3) 0 0; font-size: var(--text-small); line-height: 1.7; color: var(--ink-600); }

/* Other cities --------------------------------------------------------------- */
.atlas-others__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-5) 0 0;
    padding: 0;
    list-style: none;
}

.atlas-others__list a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-pill);
    background: #fff;
    border: 1px solid var(--border);
    color: var(--ink-700);
    font-size: var(--text-small);
    font-weight: 500;
    text-decoration: none;
}

.atlas-others__list a:hover { border-color: var(--brand-600); color: var(--brand-700); }

/* Focus ----------------------------------------------------------------------- */
.atlas :focus-visible {
    outline: 2px solid var(--brand-600);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Responsive -------------------------------------------------------------------- */
@media (max-width: 900px) {
    .atlas-explorer { grid-template-columns: 1fr; padding: var(--space-4); }
    .atlas-explorer__map { min-height: 320px; height: 320px; }
    .atlas-list { max-height: none; overflow: visible; -webkit-mask-image: none; mask-image: none; }
    .atlas-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .atlas-law__cards,
    .atlas-press__grid { grid-template-columns: 1fr; }
    .atlas-clock { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

@media (max-width: 560px) {
    .atlas-figs { grid-template-columns: 1fr; }
    .atlas-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .atlas-heat__row { grid-template-columns: 34px repeat(24, 12px); }
    .atlas-map__credit { display: none; }
}

/* Motion ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .atlas-float__progress { transition: none; }
    .atlas * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Map markers ------------------------------------------------------------------
   Rendered by MapLibre into the map pane, so they sit outside .atlas and need
   their own rules. Navy number on brand yellow with a navy outline: readable on
   a pale basemap, and never white text on yellow. */
.atlas-pin {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1.5px solid #172554;
    border-radius: 50%;
    background: #ffc933;
    color: #0b1220;
    font: 700 14px "DM Sans", system-ui, sans-serif;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.atlas-pin:hover { transform: scale(1.12); }

.atlas-pin.is-on {
    transform: scale(1.3);
    box-shadow: 0 0 0 5px rgba(37, 99, 235, .35);
    z-index: 3;
}

.maplibregl-ctrl-attrib { font-size: 11px; }

/* Hub -------------------------------------------------------------------------- */
.atlas-hub__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
    margin: var(--space-6) 0 0;
    padding: 0;
    list-style: none;
}

.atlas-hub__card {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
}

.atlas-hub__card h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-h5);
    line-height: 1.25;
}

.atlas-hub__card h2 a { color: var(--ink-950); text-decoration: none; }
.atlas-hub__card h2 a:hover { color: var(--brand-700); }

.atlas-hub__n { margin: var(--space-2) 0 0; font-size: var(--text-small); color: var(--ink-500); }
.atlas-hub__top { margin: var(--space-3) 0 0; font-size: var(--text-small); line-height: 1.6; color: var(--ink-600); }

/* Seasonality ------------------------------------------------------------------
   Two charts, each with its own scale. Crashes run in the thousands and deaths
   in the dozens; a shared axis would either flatten the deaths into the
   baseline or inflate them a hundredfold. */
.atlas-season__panel {
    display: grid;
    gap: var(--space-6);
    margin-top: var(--space-5);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
}

.atlas-season__h {
    margin: 0 0 var(--space-4);
    font-size: var(--text-caption);
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.atlas-season__h span { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-400); }

.atlas-bars {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--space-2);
    align-items: end;
    margin: 0;
    padding: 0;
    list-style: none;
    height: 190px;
}

.atlas-bars--slim { height: 96px; }

.atlas-bars li {
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: end;
    height: 100%;
    gap: 4px;
    text-align: center;
}

.atlas-bars__v {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-500);
    font-variant-numeric: tabular-nums;
}

.atlas-bars__bar {
    display: block;
    align-self: end;
    width: 100%;
    height: var(--h);
    min-height: 3px;
    border-radius: 5px 5px 0 0;
    background: color-mix(in srgb, var(--atlas-pale) calc((1 - var(--t, .6)) * 100%), var(--atlas-gold));
}

.atlas-bars--slim .atlas-bars__bar { background: var(--brand-950, #172554); border-radius: 4px 4px 0 0; }

.atlas-bars__m { font-size: 11px; color: var(--ink-400); }

.atlas-season__avg {
    margin: var(--space-4) 0 0;
    font-size: var(--text-small);
    color: var(--ink-500);
}

@media (max-width: 700px) {
    .atlas-bars { gap: 3px; height: 150px; }
    .atlas-bars__v { font-size: 9px; }
    .atlas-bars__m { font-size: 9px; }
}

/* Ranking list: make it obvious it opens and it scrolls -------------------------
   The fade mask alone was too quiet - people could not tell the rows were
   accordions or that there were more below the fold. A chevron on every row
   and a visible (if slim) scrollbar say both out loud. */
.atlas-hint {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    max-width: 62ch;
    margin: var(--space-4) 0 0;
    font-size: var(--text-small);
    line-height: 1.6;
    color: var(--ink-500);
}

.atlas-hint span { color: var(--brand-600); }

.atlas-row__chev {
    flex: none;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    color: var(--ink-400);
    transition: transform .2s ease, color .2s ease;
}

.atlas-row__chev svg { width: 17px; height: 17px; }
.atlas-row__head:hover .atlas-row__chev { color: var(--brand-600); }
.atlas-row.is-open .atlas-row__chev { transform: rotate(180deg); color: var(--brand-600); }

/* A real scrollbar, slim and in brand, instead of none at all. */
.atlas-list {
    scrollbar-width: thin;
    scrollbar-color: var(--ink-300) transparent;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 10px, #000 calc(100% - 22px), transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 10px, #000 calc(100% - 22px), transparent 100%);
}

.atlas-list::-webkit-scrollbar { width: 8px; }
.atlas-list::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 4px; }
.atlas-list::-webkit-scrollbar-thumb:hover { background: var(--ink-400); }
.atlas-list::-webkit-scrollbar-track { background: transparent; }

/* What the data shows ----------------------------------------------------------- */
.atlas-notes__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-4);
    margin: var(--space-5) 0 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.atlas-note-card {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: var(--space-3);
    align-items: start;
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
}

.atlas-note-card__n {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--mist);
    color: var(--ink-500);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
}

/* (the per-element rule that used to live here outranked the stat and
   label classes below, and is gone; each part sets its own type) */

.atlas-fig__l small { font-size: 11px; color: var(--ink-400); }

/* State-law cards --------------------------------------------------------------
   These were three bordered boxes of grey text: they read as one block and
   gave no clue which was which. Each now carries a mark, a gold top edge tying
   it to the scale the rest of the page uses, and its value set as the largest
   thing in the card, because the filing deadline is what a reader came for. */
.atlas-law__card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: var(--space-6) var(--space-5) var(--space-5);
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.atlas-law__card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--atlas-yellow), var(--atlas-gold));
}

.atlas-law__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--brand-50, #eef4ff);
    color: var(--brand-700);
}

.atlas-law__icon svg { width: 21px; height: 21px; }

.atlas-law__v {
    margin: var(--space-2) 0 0;
    font-size: clamp(20px, 2.4vw, 26px);
    letter-spacing: -0.015em;
}

.atlas-law__c {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 11px;
    line-height: 1.5;
    color: var(--ink-400);
}

/* Pinned down, so three cards of different lengths still line up. */
.atlas-law__link {
    margin: auto 0 0;
    padding-top: var(--space-4);
}

.atlas-law__link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--brand-700);
    font-size: var(--text-small);
    font-weight: 600;
    text-decoration: none;
}

.atlas-law__link svg { width: 15px; height: 15px; transition: transform .18s ease; }
.atlas-law__link a:hover svg { transform: translateX(3px); }

/* Ranking list, second pass ----------------------------------------------------
   The chevron and the scrollbar said the rows open and the list scrolls, but
   with No. 1 expanded you still saw exactly one row, so it did not read as a
   list of ten at all. The detail panel is tighter now and the column taller,
   which leaves three or four collapsed rows visible under the open one. That
   is what makes it obvious there is a list here and that it does something. */
.atlas-explorer__map { min-height: 620px; }
.atlas-list { max-height: 620px; }

.atlas-row__body { padding: var(--space-2) var(--space-3) var(--space-4); }

.atlas-row__h3 {
    margin: 0 0 var(--space-3);
    font-size: var(--text-base);
}

.atlas-tiles {
    gap: 6px;
    margin-bottom: var(--space-4);
}

.atlas-tiles li { padding: var(--space-2) 6px; }
.atlas-tiles li span:first-child { font-size: 17px; }
.atlas-tiles li span:last-child { font-size: 10px; }

.atlas-clock {
    grid-template-columns: 104px 1fr;
    gap: var(--space-3);
}

.atlas-clock h4,
.atlas-who h4 { margin-bottom: var(--space-2); }
.atlas-clock__svg { width: 104px; height: 104px; }
.atlas-clock__note { font-size: var(--text-caption); }

.atlas-who { margin-top: var(--space-4); }
.atlas-who ul { gap: 5px; }
.atlas-who li { grid-template-columns: 10ch 1fr 4ch; font-size: var(--text-caption); }
.atlas-who__bar { height: 7px; }

.atlas-row__cta { margin-top: var(--space-4); font-size: var(--text-caption); }

@media (max-width: 900px) {
    .atlas-explorer__map { min-height: 320px; }
    .atlas-list { max-height: none; }
}

/* What the data shows ----------------------------------------------------------
   The figure leads, the sentence explains it. A card carrying one long
   sentence is a paragraph in a box; the number is the thing worth looking at,
   so it is set at the size of the key figures in the hero.

   Both the figure and its label are generated with the sentence, in the same
   function that works them out - nothing here is written per city. A finding
   that arrives without one still renders, as the sentence alone. */
.atlas-note-card {
    display: block;
    position: relative;
    padding: var(--space-5);
    padding-left: calc(var(--space-5) + 4px);
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.atlas-note-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--atlas-yellow), var(--atlas-gold));
}

p.atlas-note-card__stat {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(30px, 3.6vw, 40px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--ink-950);
    font-variant-numeric: tabular-nums;
}

p.atlas-note-card__label {
    margin: var(--space-2) 0 0;
    font-size: var(--text-caption);
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--atlas-gold);
}

p.atlas-note-card__text {
    margin: var(--space-3) 0 0;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    font-size: var(--text-small);
    line-height: 1.65;
    color: var(--ink-600);
}

/* A card with no figure is still a card, just quieter. */
p.atlas-note-card__text:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    font-size: var(--text-base);
    color: var(--ink-900);
}

/* Hub, grouped by state --------------------------------------------------------
   One alphabetical run of eighty-six cards is a wall. By state it stays a list
   someone can find their own city in, and each state heading is a link to that
   state's own hub. */
.atlas-hub__state + .atlas-hub__state { margin-top: var(--space-7); }

.atlas-hub__state-h {
    margin: 0 0 var(--space-4);
    font-family: var(--font-display);
    font-size: var(--text-h5);
    line-height: 1.2;
}

.atlas-hub__state-h a { color: var(--ink-950); text-decoration: none; }
.atlas-hub__state-h a:hover { color: var(--brand-700); }

.atlas-hub__card h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-h5);
    line-height: 1.25;
}

.atlas-hub__card h3 a { color: var(--ink-950); text-decoration: none; }
.atlas-hub__card h3 a:hover { color: var(--brand-700); }

/* ---------------------------------------------------------------------------
   The link from a city's attorney listing to its crash report.
   Lives here rather than in the listing styles because it is the atlas
   speaking, and it should look like the atlas wherever it appears.
   --------------------------------------------------------------------------- */

.atlas-backlink {
	background: var(--mist, #f6f9ff);
	border-top: 1px solid rgba(37, 99, 235, 0.12);
	padding: clamp(2rem, 5vw, 3.25rem) 16px;
}

.atlas-backlink__inner {
	max-width: 760px;
	margin: 0 auto;
}

.atlas-backlink__kicker {
	margin: 0 0 0.5rem;
	font-family: var(--font-display, inherit);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--brand-600, #2563eb);
}

.atlas-backlink__h {
	margin: 0 0 0.6rem;
	font-family: var(--font-display, inherit);
	font-size: clamp(1.35rem, 3.2vw, 1.85rem);
	line-height: 1.2;
}

.atlas-backlink__t {
	margin: 0 0 1rem;
	max-width: 62ch;
	line-height: 1.6;
}

.atlas-backlink__cta {
	margin: 0;
}

.atlas-backlink__cta a {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.7rem 1.15rem;
	border-radius: 999px;
	background: var(--brand-600, #2563eb);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}

.atlas-backlink__cta a::after {
	content: "\2192";
}

.atlas-backlink__cta a:hover,
.atlas-backlink__cta a:focus-visible {
	background: #1d4ed8;
}

/* ---------------------------------------------------------------------------
   Deadliest-roads pages.

   Three things on a road card and each needs its own weight, or they fight.
   The first version set the rank, the road name and every statistic in the
   same bold display face stacked on top of each other, so the name - the
   thing a reader is scanning for - was the least findable item on the card.

   Now: the rank is a large quiet numeral, the road name is the only thing
   in the display face, the death count sits on the right as the single
   figure that decides the order, and the supporting counts are a plain
   sentence underneath. A proportional bar makes the gap between first and
   tenth visible without reading any numbers at all.
   --------------------------------------------------------------------------- */

.atlas-roads {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.7rem;
	counter-reset: road;
}

.atlas-road {
	display: grid;
	grid-template-columns: 3rem 1fr auto;
	gap: 0 1.1rem;
	align-items: center;
	padding: 1.1rem 1.35rem;
	background: #fff;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 14px;
}

.atlas-road:nth-child(-n + 3) {
	border-color: rgba(185, 28, 28, 0.28);
	background: linear-gradient(180deg, rgba(185, 28, 28, 0.035), #fff 60%);
}

/* Big, light, and out of the way of the name. */
.atlas-road__rank {
	margin: 0;
	font-family: var(--font-display, inherit);
	font-size: 2rem;
	font-weight: 700;
	line-height: 1;
	text-align: center;
	color: rgba(15, 23, 42, 0.22);
	font-variant-numeric: tabular-nums;
}

.atlas-road:nth-child(-n + 3) .atlas-road__rank { color: rgba(185, 28, 28, 0.55); }

.atlas-road__body { min-width: 0; }

/* The only display-face text on the card. */
.atlas-road__name {
	margin: 0 0 0.2rem;
	font-family: var(--font-display, inherit);
	font-size: clamp(1.1rem, 2.6vw, 1.35rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.atlas-road__sub {
	margin: 0 0 0.5rem;
	font-size: 0.86rem;
	color: #475569;
}

.atlas-road__scale {
	margin: 0 0 0.45rem;
	height: 4px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.07);
	overflow: hidden;
	max-width: 320px;
}

.atlas-road__scale span {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: #b91c1c;
	opacity: 0.75;
}

.atlas-road__note {
	margin: 0;
	font-size: 0.82rem;
	line-height: 1.5;
	color: #64748b;
}

/* The number the ranking is actually made of. */
.atlas-road__toll {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	line-height: 1.05;
}

.atlas-road__toll-n {
	font-family: var(--font-display, inherit);
	font-size: clamp(1.6rem, 4vw, 2.1rem);
	font-weight: 700;
	color: #b91c1c;
	font-variant-numeric: tabular-nums;
}

.atlas-road__toll-l {
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #64748b;
}

@media (max-width: 560px) {
	.atlas-road {
		grid-template-columns: 2.1rem 1fr auto;
		gap: 0 0.8rem;
		padding: 0.95rem 1rem;
	}

	.atlas-road__rank { font-size: 1.5rem; }
	.atlas-road__scale { max-width: none; }
}

/* Which kind of ranking a hub card leads to. */
.atlas-hub__kind {
	margin: 0.4rem 0 0;
	font-size: 0.74rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #64748b;
}

@media (max-width: 520px) {
	.atlas-road {
		grid-template-columns: 2.5rem 1fr;
		padding: 0.95rem 1rem;
	}

	.atlas-road__stats {
		gap: 0.4rem 1.1rem;
	}
}

/* ---------------------------------------------------------------------------
   Hub, reorganised.

   Forty-four cards under twenty state headings answered the wrong question.
   Somebody arriving here wants to know whether their city is covered, and
   they know its name rather than which state heading it hides under, so the
   alphabetical index comes first and the state cards are for browsing.

   The cards themselves looked sporadic because they were: each was only as
   tall as its contents, and a long corner name like "East Broadway Boulevard
   & North Wilmot Road" wrapped to three lines while "Thomas Road" took one.
   Rows are equal height now and the long line is clamped.
   --------------------------------------------------------------------------- */

.atlas-hub__tally {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.75rem;
	margin: 0 0 var(--space-5);
	font-size: var(--text-small);
	color: var(--ink-500);
}

.atlas-hub__tally strong {
	font-family: var(--font-display);
	font-size: 1.15rem;
	color: var(--ink-950);
	margin-right: 0.3rem;
}

.atlas-find__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 0.3rem 1rem;
	margin: 0 0 var(--space-4);
	padding: 0;
	list-style: none;
}

.atlas-find__list a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.42rem 0.6rem;
	border-radius: 8px;
	color: var(--ink-800);
	text-decoration: none;
	font-size: 0.92rem;
	border: 1px solid transparent;
}

.atlas-find__list a:hover,
.atlas-find__list a:focus-visible {
	background: #fff;
	border-color: var(--border);
	color: var(--brand-700);
}

.atlas-find__list a span {
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	color: var(--ink-400);
}

/* The states, as a single line of links rather than twenty headings. */
.atlas-hub__states {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.5rem;
	margin: 0 0 var(--space-6);
}

.atlas-hub__states a {
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	background: #fff;
	border: 1px solid var(--border);
	font-size: 0.85rem;
	color: var(--ink-700);
	text-decoration: none;
}

.atlas-hub__states a:hover,
.atlas-hub__states a:focus-visible {
	border-color: var(--brand-600);
	color: var(--brand-700);
}

/* Equal-height cards, with the kind as a tag rather than a trailing line. */
.atlas-hub__grid { align-items: stretch; }

.atlas-hub__card {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	position: relative;
}

.atlas-hub__tag {
	margin: 0;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--ink-400);
}

.atlas-hub__card.is-road .atlas-hub__tag { color: #b45309; }

.atlas-hub__card h4 {
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--text-h5);
	line-height: 1.2;
}

.atlas-hub__card h4 a { color: var(--ink-950); text-decoration: none; }
.atlas-hub__card h4 a:hover { color: var(--brand-700); }

.atlas-hub__card .atlas-hub__n { margin: 0; }

/* Pushed to the bottom so every card's last line sits on the same baseline,
   and clamped so a long corner name cannot set the height of its row. */
.atlas-hub__card .atlas-hub__top {
	margin: auto 0 0;
	padding-top: 0.55rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.atlas-hub__card .atlas-hub__top span {
	display: block;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ink-400);
}

/* ---------------------------------------------------------------------------
   Hub: rules and a type scale.

   Everything on this page sat at one size. A state name was set the same as
   a city name inside a card beneath it, so "California" read as another
   label rather than as the break it is, and with no rules anywhere the
   sections simply butted together.

   Three levels now, and each is doing a different job: an eyebrow in small
   caps, a section heading in the display face, and a state name on a rule
   with its city count aligned right. The cards keep the smallest type so
   the hierarchy runs downward instead of flat.
   --------------------------------------------------------------------------- */

.atlas-eyebrow {
	margin: 0 0 0.3rem;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--brand-600, #2563eb);
}

/* A hairline above each major section, so they read as separate things. */
.atlas-ruled {
	position: relative;
	margin-top: var(--space-7);
	padding-top: var(--space-6);
}

.atlas-ruled::before {
	content: "";
	position: absolute;
	top: 0;
	left: 16px;
	right: 16px;
	height: 1px;
	background: linear-gradient(90deg,
		rgba(37, 99, 235, 0.35),
		var(--border) 22%,
		var(--border) 78%,
		transparent);
}

.atlas-ruled > .atlas-h2 {
	font-size: clamp(1.5rem, 4vw, 2rem);
	letter-spacing: -0.015em;
}

/* The state name is the divider: a rule running out from it to the count. */
.atlas-hub__state-h {
	display: flex;
	align-items: baseline;
	gap: 1rem;
	margin: 0 0 var(--space-4);
	font-size: clamp(1.15rem, 3vw, 1.45rem);
	letter-spacing: -0.01em;
}

.atlas-hub__state-h::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border);
}

.atlas-hub__state-n {
	order: 3;
	flex: 0 0 auto;
	font-family: var(--font-body, inherit);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ink-400);
}

.atlas-hub__state + .atlas-hub__state { margin-top: var(--space-8); }

/* Card type: smaller than the state above it, with the number carrying the
   weight rather than the label. */
.atlas-hub__card h4 { font-size: 1.12rem; letter-spacing: -0.005em; }

.atlas-hub__card .atlas-hub__n {
	font-size: 0.84rem;
	color: var(--ink-500);
}

.atlas-hub__card .atlas-hub__n strong {
	font-family: var(--font-display);
	font-size: 1.05rem;
	color: var(--ink-900, #0f172a);
	margin-right: 0.15rem;
}

.atlas-hub__card .atlas-hub__top { font-size: 0.82rem; }

.atlas-hub__tally strong { font-size: 1.3rem; }
