/* =============================================================
   timeline.css — covfefe public timeline
   Self-contained (no milligram). 1rem = 16px browser default.
   ============================================================= */

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { margin: 0; overflow-x: hidden; }
h1, h2, h3, h4, h5, h6 { margin-top: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin-top: 0; }
strong, b { font-weight: 700; }

/* ── Variables ────────────────────────────────────────────── */
:root {
    /* Base palette — VLGR dark theme (blue-tinted) */
    --page-bg:      #0d0d17;
    --card-bg:      #13131e;
    --text-main:    #f2f2fc;
    --text-bright:  #f2f2fc;
    --text-muted:   #9898c8;
    --line:         #232334;
    --border:       #232334;
    --shadow-sm:    0 2px 8px rgba(0,0,0,.5);

    /* Accent — acid yellow */
    --accent:       #d4ff02;
    --accent-dark:  #bce002;
    --accent-soft:  rgba(212,255,2,.10);
    --accent-text:  #09090f;

    /* Type: policy (sky blue) */
    --type-policy-text:   #93c5fd;
    --type-policy-bg:     rgba(147,197,253,.08);
    --type-policy-border: rgba(147,197,253,.30);

    /* Type: vaccine (green) */
    --type-vaccine-text:   #86efac;
    --type-vaccine-bg:     rgba(134,239,172,.08);
    --type-vaccine-border: rgba(134,239,172,.30);

    /* Type: context (cool grey) */
    --type-context-text:   #cbd5e1;
    --type-context-bg:     rgba(203,213,225,.05);
    --type-context-border: rgba(203,213,225,.15);

    /* Type: trial (amber) */
    --type-trial-text:   #fbbf24;
    --type-trial-bg:     rgba(251,191,36,.08);
    --type-trial-border: rgba(251,191,36,.28);

    /* Type: approval (teal) */
    --type-approval-text:   #2dd4bf;
    --type-approval-bg:     rgba(45,212,191,.08);
    --type-approval-border: rgba(45,212,191,.28);

    /* Type: booster (rose) */
    --type-booster-text:   #fb7185;
    --type-booster-bg:     rgba(251,113,133,.08);
    --type-booster-border: rgba(251,113,133,.28);

    /* Type: other (purple) */
    --type-other-text:   #b175ff;
    --type-other-bg:     rgba(177,117,255,.08);
    --type-other-border: rgba(177,117,255,.25);

    /* Unconfirmed */
    --unconfirmed-text:   #ffc107;
    --unconfirmed-bg:     rgba(255,193,7,.08);
    --unconfirmed-border: rgba(255,193,7,.30);

    --radius: .4rem;
    --radius-lg: .5rem;
    --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SFMono-Regular', 'Fira Code', Consolas, monospace;
}

/* ── Base ─────────────────────────────────────────────────── */
body {
    background: var(--page-bg);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
}

a { color: #b175ff; text-decoration: underline; }
a:hover { color: var(--accent); }

/* ── Layout ───────────────────────────────────────────────── */
.page-wrap {
    width: 100%;
    max-width: 65rem;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ── Hero (standalone — initial load screen) ─────────────── */
header.hero {
    text-align: center;
    padding: 3.5rem 1rem 1rem;
    background: var(--page-bg);
}
header.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0 0 .5rem;
    letter-spacing: -.04em;
}
header.hero p {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
}

/* ── Hero (inside sticky filter bar) ─────────────────────── */
#filter-bar .hero {
    display: flex;
    align-items: baseline;
    gap: .9rem;
    margin: 0;
    padding: 0 0 .5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}
#filter-bar .hero h1 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--accent);
}
#filter-bar .hero p {
    margin: 0;
    font-size: .8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Timeline ─────────────────────────────────────────────── */
.timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding-left: 8.5rem;
}

.timeline::before {
    content: "";
    position: absolute;
    top: .4rem;
    bottom: .4rem;
    left: 7rem;
    width: 1px;
    background: var(--line);
}

.timeline-item { position: relative; margin: 0; }

.timeline-marker {
    position: absolute;
    top: 1rem;
    left: -1.94rem;
    width: .875rem;
    height: .875rem;
    border: 2px solid var(--accent);
    border-radius: 999rem;
    background: var(--page-bg);
    z-index: 2;
}

.timeline-content {
    position: relative;
    display: grid;
    grid-template-columns: 10.5rem 1fr;
    gap: .875rem;
    padding: .875rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.timeline-date {
    align-self: start;
    display: inline-flex;
    width: fit-content;
    padding: .2rem .5rem;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999rem;
    font-weight: 700;
    font-size: .85rem;
    line-height: 1.4;
}

.timeline-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.timeline-body h2 {
    margin: 0 0 .3rem;
    font-size: 1.05rem;
    line-height: 1.25;
    color: var(--text-bright);
}

.timeline-body p {
    margin: 0 0 .15rem;
    color: var(--text-muted);
    font-size: .95rem;
    line-height: 1.6;
}

/* ── Type: policy ─────────────────────────────────────────── */
.policy .timeline-marker { border-color: var(--type-policy-text); }
.policy .timeline-date   { background: var(--type-policy-bg); color: var(--type-policy-text); }
.policy .timeline-content { border-left: 3px solid var(--type-policy-border); }

/* ── Type: vaccine ────────────────────────────────────────── */
.vaccine .timeline-marker { border-color: var(--type-vaccine-text); }
.vaccine .timeline-date   { background: var(--type-vaccine-bg); color: var(--type-vaccine-text); }
.vaccine .timeline-content { border-left: 3px solid var(--type-vaccine-border); }

/* ── Type: trial ──────────────────────────────────────────── */
.trial .timeline-marker { border-color: var(--type-trial-text); }
.trial .timeline-date   { background: var(--type-trial-bg); color: var(--type-trial-text); }
.trial .timeline-content { border-left: 3px solid var(--type-trial-border); }

/* ── Type: approval ───────────────────────────────────────── */
.approval .timeline-marker { border-color: var(--type-approval-text); }
.approval .timeline-date   { background: var(--type-approval-bg); color: var(--type-approval-text); }
.approval .timeline-content { border-left: 3px solid var(--type-approval-border); }

/* ── Type: booster ────────────────────────────────────────── */
.booster .timeline-marker { border-color: var(--type-booster-text); }
.booster .timeline-date   { background: var(--type-booster-bg); color: var(--type-booster-text); }
.booster .timeline-content { border-left: 3px solid var(--type-booster-border); }

/* ── Type: context ────────────────────────────────────────── */
.context-item .timeline-marker { border-color: var(--type-context-border); }
.context-item .timeline-date   { background: var(--type-context-bg); color: var(--type-context-text); }

/* ── Type: other ──────────────────────────────────────────── */
.other .timeline-marker { border-color: var(--type-other-text); }
.other .timeline-date   { background: var(--type-other-bg); color: var(--type-other-text); }
.other .timeline-content { border-left: 3px solid var(--type-other-border); }

/* ── Entity + unconfirmed badges ──────────────────────────── */
.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-bottom: .4rem;
}

.tag {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 999rem;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    line-height: 1.5;
}

.tag-entity {
    background: rgba(177,117,255,.08);
    border: 1px solid rgba(177,117,255,.22);
    color: rgba(177,117,255,.75);
}

.tag-unconfirmed {
    background: var(--unconfirmed-bg);
    border: 1px solid var(--unconfirmed-border);
    color: var(--unconfirmed-text);
}

.tag-success   { background: rgba(76,175,114,.10);  border: 1px solid rgba(76,175,114,.30);  color: #4caf72; }
.tag-primary   { background: rgba(110,181,255,.08); border: 1px solid rgba(110,181,255,.25); color: #6eb5ff; }
.tag-danger    { background: rgba(224,108,117,.10); border: 1px solid rgba(224,108,117,.30); color: #e06c75; }
.tag-warning   { background: rgba(255,193,7,.08);   border: 1px solid rgba(255,193,7,.25);   color: #ffc107; }
.tag-secondary { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); color: #888; }

/* ── Source links ─────────────────────────────────────────── */
.timeline-sources {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .6rem;
    margin-top: .5rem;
}
.timeline-source-link {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(255,255,255,.3);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.12);
    transition: color .15s, border-color .15s;
}
.timeline-source-link:hover {
    color: rgba(255,255,255,.7);
    border-color: rgba(255,255,255,.4);
    text-decoration: none;
}

/* ── Deaths note ──────────────────────────────────────────── */
.timeline-deaths {
    margin-top: .35rem;
    font-size: .75rem;
    color: rgba(224,108,117,.65);
    font-weight: 600;
}

/* ── Media attachments ────────────────────────────────────── */
.timeline-media {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .5rem;
}
.media-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 6px;
    overflow: hidden;
    font-size: .72rem;
    font-weight: 600;
}
.media-chip__view {
    background: rgba(255,255,255,.05);
    border: none;
    color: rgba(255,255,255,.55);
    cursor: pointer;
    padding: .25rem .55rem;
    font-size: .72rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .3rem;
    transition: background .15s, color .15s;
    max-width: 22rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.media-chip__view:hover { background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); }
.media-chip__dl {
    background: rgba(255,255,255,.04);
    border: none;
    border-left: 1px solid rgba(255,255,255,.1);
    color: rgba(255,255,255,.3);
    cursor: pointer;
    padding: .25rem .45rem;
    font-size: .8rem;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.media-chip__dl:hover { background: rgba(255,255,255,.09); color: rgba(255,255,255,.7); }

/* ── Media modal (PDF + image) ────────────────────────────── */
.media-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.88);
    z-index: 500;
    align-items: center;
    justify-content: center;
}
.media-modal--open { display: flex; }
.media-modal__box {
    display: flex;
    flex-direction: column;
    width: min(92vw, 1000px);
    height: min(88vh, 800px);
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    overflow: hidden;
}
.media-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    flex-shrink: 0;
}
.media-modal__title {
    font-size: .85rem;
    font-weight: 600;
    color: rgba(255,255,255,.6);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.media-modal__actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.media-modal__btn {
    font-size: .75rem;
    font-weight: 600;
    color: rgba(255,255,255,.45);
    text-decoration: none;
    padding: .25rem .6rem;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 5px;
    transition: color .15s, border-color .15s;
}
.media-modal__btn:hover { color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.3); }
.media-modal__close {
    background: none;
    border: none;
    color: rgba(255,255,255,.4);
    font-size: 1.1rem;
    cursor: pointer;
    padding: .2rem .4rem;
    border-radius: 4px;
    transition: color .15s, background .15s;
}
.media-modal__close:hover { color: #fff; background: rgba(255,255,255,.08); }
.media-modal__body { flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.media-modal__frame { width: 100%; height: 100%; border: none; display: block; }
.media-modal__img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* ── Aid badge ────────────────────────────────────────────── */
.aid-badge {
    position: absolute;
    top: .875rem;
    right: calc(100% + 2rem);
    width: max-content;
    max-width: 11rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .2rem .35rem;
    padding: .25rem .5rem;
    background: rgba(212,170,0,.08);
    border: 1px solid rgba(212,170,0,.25);
    border-radius: .4rem;
    line-height: 1.4;
    cursor: default;
}

.aid-badge--dose {
    background: rgba(134,239,172,.06);
    border-color: rgba(134,239,172,.22);
}

.aid-badge__icon { font-size: .85rem; }

.aid-badge__amount {
    font-size: .875rem;
    font-weight: 700;
    color: #f5c842;
    letter-spacing: .01em;
}

.aid-badge--dose .aid-badge__amount { color: #86efac; }

.aid-badge__by {
    font-size: .72rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: .03em;
}

.aid-badge__sep {
    color: var(--text-muted);
    opacity: .5;
    font-size: .8rem;
}

/* ── Chunk selector ───────────────────────────────────────── */
.chunk-selector {
    max-width: 52rem;
    margin: 3rem auto;
    padding: 0 1rem;
    text-align: center;
}
.chunk-selector__hint {
    color: var(--text-muted);
    font-size: .95rem;
    margin-bottom: 1.5rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: .75rem;
}
.chunk-selector__tiles {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.8rem;
}
.chunk-tile {
    cursor: pointer;
    flex: 1;
    min-width: 11rem;
    max-width: 16rem;
}
.chunk-tile__cb { display: none; }
.chunk-tile__body {
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1rem 1.2rem;
    transition: border-color .2s, background .2s;
    background: var(--surface);
}
.chunk-tile:has(.chunk-tile__cb:checked) .chunk-tile__body {
    border-color: var(--accent);
    background: rgba(99,102,241,.08);
}
.chunk-tile__icon  { font-size: 2rem; margin-bottom: .5rem; }
.chunk-tile__label { font-weight: 600; font-size: 1rem; margin-bottom: .4rem; }
.chunk-tile__count { font-size: .8rem; color: var(--text-muted); }
.chunk-tile__size  { font-size: .75rem; color: var(--text-muted); opacity: .6; margin-top: .2rem; }
.chunk-selector__btn {
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: var(--radius-lg);
    padding: .75rem 2.2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}
.chunk-selector__btn:hover { opacity: .85; }
.chunk-selector__selected-count {
    margin-top: .9rem;
    font-size: .9rem;
    color: var(--text-muted);
    min-height: 1.4em;
    transition: color .2s;
}
.chunk-selector__selected-count--active {
    color: var(--accent);
    font-weight: 600;
}

/* ── Load-more pills ──────────────────────────────────────── */
.chunk-pill {
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 2rem;
    padding: .3rem .9rem;
    font-size: .8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color .2s, color .2s;
    margin: .2rem;
}
.chunk-pill:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}
.chunk-pill--loaded,
.chunk-pill:disabled {
    opacity: .4;
    cursor: default;
    border-style: dashed;
}

/* ── Country picker ───────────────────────────────────────── */
.country-picker {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1rem .8rem;
    margin-bottom: 1.5rem;
    text-align: left;
    background: var(--surface);
}
.country-picker__header {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .8rem;
    flex-wrap: wrap;
}
.country-picker__title {
    font-weight: 600;
    font-size: .95rem;
    flex: 1;
}
.country-picker__search {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: .3rem .7rem;
    font-size: .8rem;
    width: 10rem;
}
.country-picker__all {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    padding: .2rem .6rem;
    font-size: .75rem;
    cursor: pointer;
}
.country-picker__all:hover { border-color: var(--accent); color: var(--accent); }
.country-picker__pills {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    max-height: 12rem;
    overflow-y: auto;
}
.country-picker__pills--inline {
    max-height: 10rem;
    margin-bottom: .6rem;
}
.cpill {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 2rem;
    padding: .25rem .7rem;
    font-size: .78rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}
.cpill:hover:not([disabled]) {
    border-color: var(--accent);
    color: var(--text);
}
.cpill--selected {
    border-color: var(--accent);
    background: rgba(99,102,241,.12);
    color: var(--text);
}
.cpill--loaded,
.cpill[disabled] {
    opacity: .35;
    cursor: default;
    border-style: dashed;
}
.cpill__count {
    font-size: .68rem;
    opacity: .6;
    background: rgba(255,255,255,.08);
    border-radius: 1rem;
    padding: 0 .35rem;
}

/* Inline picker (in filter bar) */
.inline-country-picker {
    width: 100%;
    margin-top: .6rem;
    padding: .8rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
}
.chunk-selector__btn--sm {
    padding: .45rem 1.2rem;
    font-size: .85rem;
    margin-top: .6rem;
}

/* ── Loading spinner ──────────────────────────────────────── */
.timeline-loading {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-muted, #888);
}
.timeline-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(255,255,255,.12);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: tl-spin .75s linear infinite;
    margin: 0 auto 1.25rem;
}
@keyframes tl-spin { to { transform: rotate(360deg); } }

/* ── Source note ──────────────────────────────────────────── */
.source-note {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: .9rem;
}

/* ── Suggest button ───────────────────────────────────────── */
.submit-link-wrap {
    text-align: center;
    margin: 2rem 0 3rem;
}
.submit-link-btn {
    display: inline-block;
    padding: .65rem 1.4rem;
    background: transparent;
    border: 1.5px dashed rgba(255,255,255,.2);
    border-radius: var(--radius-lg);
    font-size: .9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color .2s, color .2s;
    text-decoration: none;
}
.submit-link-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 2rem 1rem 3rem;
    font-size: .8rem;
    color: var(--text-muted);
}
.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    opacity: .7;
}
.site-footer a:hover {
    opacity: 1;
    color: var(--accent);
}

/* ── Filter bar ───────────────────────────────────────────── */
#filter-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    width: 100%;
    padding: .75rem 1.5rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0,0,0,.5);
}

.filter-bar__inner {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    width: 100%;
}

/* Rows collapsed by default on all screen sizes; toggle via hamburger */
.filter-bar__rows {
    display: none;
    flex-direction: column;
    gap: .6rem;
    padding-top: .5rem;
}
.filter-bar__rows--open { display: flex; }

.filter-bar__row {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}
.filter-bar__row + .filter-bar__row { padding-top: .4rem; }

.filter-bar__label {
    flex-shrink: 0;
    padding-top: .3rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    width: 4rem;
}

.filter-bar__types,
.filter-bar__countries {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
}

.filter-btn {
    padding: 0 .75rem;
    border-radius: 999rem;
    font-size: .875rem;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    line-height: 1.5;
    transition: filter .12s;
}
.filter-btn:hover  { filter: brightness(1.25); }
.filter-btn:active { filter: brightness(1.4); }

.filter-bar__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.filter-bar__count {
    font-size: .825rem;
    color: var(--text-muted);
}

.aid-total {
    font-size: .825rem;
    color: var(--text-muted);
}

.aid-total strong {
    color: #f5c842;
    font-weight: 700;
}

.pharma-total {
    font-size: .825rem;
    color: var(--text-muted);
}

.pharma-total strong {
    color: #86efac;
    font-weight: 700;
}

.filter-bar__reset {
    padding: .2rem .65rem;
    border: 1px solid var(--border);
    border-radius: 999rem;
    background: transparent;
    color: var(--text-muted);
    font-size: .825rem;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.5;
    display: none;
    transition: border-color .12s, color .12s;
}
.filter-bar__reset:hover { border-color: var(--accent); color: var(--accent); }
.filter-bar__reset--visible { display: inline-block; }

.timeline-item[hidden] { display: none; }

/* ── Search row ───────────────────────────────────────────── */
.filter-bar__search-row {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.filter-bar__search {
    flex: 1;
    min-width: 0;
    background: var(--page-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-main);
    font-family: inherit;
    font-size: .875rem;
    padding: .3rem .65rem;
    outline: none;
    transition: border-color .15s;
}
.filter-bar__search::placeholder { color: var(--text-muted); }
.filter-bar__search:focus { border-color: var(--accent); }
.filter-bar__search::-webkit-search-cancel-button { cursor: pointer; }

/* ── Sort toggle ──────────────────────────────────────────── */
.filter-bar__sort-toggle {
    display: flex;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.filter-bar__sort-btn {
    flex: 1;
    background: var(--card-bg);
    border: none;
    border-right: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: .8rem;
    padding: .3rem .7rem;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.filter-bar__sort-btn:last-child { border-right: none; }
.filter-bar__sort-btn:hover { color: var(--text-bright); }
.filter-bar__sort-btn--active { background: var(--accent); color: #000; font-weight: 600; }

/* ── Hamburger / filter toggle ────────────────────────────── */
@keyframes ham-shake {
    0%,100% { transform: translate(0,0) rotate(0deg); }
    10%     { transform: translate(-3px,-2px) rotate(-6deg); }
    20%     { transform: translate(3px,0px) rotate(5deg); }
    30%     { transform: translate(-3px,1px) rotate(-4deg); }
    40%     { transform: translate(2px,-1px) rotate(4deg); }
    50%     { transform: translate(-2px,2px) rotate(-3deg); }
    60%     { transform: translate(3px,0px) rotate(3deg); }
    70%     { transform: translate(-1px,-1px) rotate(-2deg); }
    80%     { transform: translate(2px,1px) rotate(2deg); }
    90%     { transform: translate(-1px,0px) rotate(-1deg); }
}
.filter-bar__hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: 1.5px solid var(--accent);
    border-radius: var(--radius);
    padding: .4rem .55rem;
    cursor: pointer;
    animation: ham-shake .7s ease-in-out 0.6s 4;
}
.filter-bar__hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}
.filter-bar__hamburger--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.filter-bar__hamburger--open span:nth-child(2) { opacity: 0; }
.filter-bar__hamburger--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.filter-bar__hamburger--open {
    border-color: var(--accent);
    animation: none;
}
.filter-bar__hamburger--open span { background: var(--accent); }

/* ── Search highlight ─────────────────────────────────────── */
mark.search-hl {
    background: rgba(212,255,2,.28);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .page-wrap { padding: 1rem 0; }

    .timeline { padding-left: 1.75rem; gap: .5rem; }
    .timeline::before { left: .4rem; }

    .timeline-marker { left: -1.35rem; top: .85rem; width: .75rem; height: .75rem; }

    .timeline-content {
        grid-template-columns: 1fr;
        gap: .5rem;
        padding: .75rem;
    }

    .timeline-body { width: 100%; }

    .aid-badge {
        position: static;
        width: auto;
        max-width: none;
        justify-content: flex-start;
        margin-top: .4rem;
    }

    /* Keep filter bar compact on mobile — hide hero, show only search + hamburger */
    #filter-bar { padding: .5rem .75rem; }
    #filter-bar .hero { display: none; }
    .filter-bar__row { flex-direction: column; gap: .4rem; }
    .filter-bar__label { padding-top: 0; width: auto; }
}

@media print {
    body { background: #fff; color: #000; }
    .page-wrap { width: 100%; padding: 0; }
    #filter-bar { display: none; }
    .timeline-content { box-shadow: none; break-inside: avoid; }
    .timeline { gap: .5rem; }
    .timeline-item[hidden] { display: none; }
}
