:root {
    --ink: #17211d;
    --muted: #68736d;
    --paper: #f6f3ec;
    --panel: #fcfaf5;
    --line: #dcd8cf;
    --fire: #f05a35;
    --fire-dark: #b9341f;
    --smoke: #6d6f66;
    --sage: #899b80;
    --shadow: 0 18px 50px rgba(31, 42, 36, .14);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow: hidden;
}
button, input { font: inherit; }

.topbar {
    align-items: center;
    background: rgba(252, 250, 245, .96);
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 338px 1fr auto;
    height: 66px;
    padding: 0 24px;
    position: relative;
    z-index: 20;
}
.brand { align-items: center; color: var(--ink); display: flex; font-family: Georgia, serif; font-size: 24px; font-weight: 700; gap: 9px; text-decoration: none; }
.brand small { background: var(--ink); border-radius: 3px; color: #fff; font-family: inherit; font-size: 10px; letter-spacing: .13em; padding: 3px 5px; }
.brand-mark { display: grid; height: 29px; place-items: end center; position: relative; width: 24px; }
.brand-mark i { background: var(--fire); border-radius: 70% 20% 65% 45%; display: block; position: absolute; transform: rotate(42deg); }
.brand-mark i:nth-child(1) { height: 23px; width: 14px; }
.brand-mark i:nth-child(2) { background: #ffb35a; bottom: 1px; height: 14px; width: 9px; }
.brand-mark i:nth-child(3) { background: #fff1cc; bottom: 1px; height: 7px; width: 5px; }
.topbar-title { border-left: 1px solid var(--line); line-height: 1.15; padding-left: 24px; }
.topbar-title p { font-size: 13px; font-weight: 750; letter-spacing: .02em; margin: 0; }
.topbar-title span { color: var(--muted); font-size: 11px; }
.freshness { align-items: center; display: flex; gap: 9px; }
.freshness div { display: flex; flex-direction: column; }
.freshness strong { font-size: 11px; }
.freshness small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.pulse { background: #56a371; border: 3px solid #dbeadc; border-radius: 50%; height: 13px; width: 13px; }

.mode-banner { align-items: center; background: #302d29; color: #fff; display: flex; gap: 12px; height: 34px; padding: 0 24px; position: relative; z-index: 18; }
.mode-banner strong { color: #ffc986; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.mode-banner span { color: #ddd8cf; font-size: 11px; }

.app-shell { display: grid; grid-template-columns: 362px 1fr; height: calc(100vh - 66px); }
.app-shell.with-banner { height: calc(100vh - 100px); }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 26px 24px 30px; position: relative; z-index: 10; }
.eyebrow { color: var(--fire-dark); font-size: 10px; font-weight: 800; letter-spacing: .15em; margin: 0 0 8px; text-transform: uppercase; }
.intro h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 2.6vw, 38px); font-weight: 500; letter-spacing: -.035em; line-height: 1.02; margin: 0; max-width: 290px; }
.intro > p:last-child { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 13px 0 0; max-width: 300px; }
.summary-strip { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0 20px; padding: 14px 0; }
.summary-strip div { display: flex; flex-direction: column; }
.summary-strip div + div { border-left: 1px solid var(--line); padding-left: 13px; }
.summary-strip strong { font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.summary-strip span { color: var(--muted); font-size: 9px; line-height: 1.2; margin-top: 3px; }
.section-heading { align-items: end; display: flex; justify-content: space-between; margin-bottom: 10px; }
.section-heading h2 { font-size: 11px; letter-spacing: .08em; margin: 0; text-transform: uppercase; }
.section-heading span { color: var(--muted); font-size: 9px; }
.incident-list { display: grid; gap: 8px; }
.incident-card { background: transparent; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); cursor: pointer; display: grid; gap: 10px; padding: 13px 14px; text-align: left; transition: background .2s, border-color .2s, transform .2s; width: 100%; }
.incident-card:hover, .incident-card:focus-visible { border-color: #ada79c; outline: none; transform: translateY(-1px); }
.incident-card.active { background: #fff; border-color: #b5aea1; box-shadow: 0 7px 22px rgba(35, 43, 38, .08); }
.incident-top { align-items: start; display: grid; grid-template-columns: 12px 1fr auto; gap: 9px; }
.fire-dot { background: var(--fire); border: 3px solid #ffd4c8; border-radius: 50%; height: 12px; margin-top: 3px; width: 12px; }
.incident-name { display: flex; flex-direction: column; min-width: 0; }
.incident-name strong { font-family: Georgia, serif; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.incident-name span, .incident-age { color: var(--muted); font-size: 9px; margin-top: 3px; }
.confidence { border-radius: 20px; font-size: 8px; font-weight: 800; letter-spacing: .07em; padding: 3px 6px; text-transform: uppercase; }
.confidence.higher { background: #fbd9cb; color: #982e1d; }
.confidence.medium { background: #eee3c7; color: #6d5718; }
.confidence.lower { background: #e6e5df; color: #676960; }
.incident-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.incident-meta div { border-top: 1px solid #e7e3da; display: flex; flex-direction: column; padding-top: 8px; }
.incident-meta small { color: var(--muted); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.incident-meta b { font-size: 10px; margin-top: 3px; }
.empty-state { border: 1px dashed #bbb5a9; color: var(--muted); font-size: 11px; line-height: 1.5; padding: 20px; text-align: center; }
.caveat { align-items: start; background: #eeebe2; border-radius: 4px; display: grid; gap: 10px; grid-template-columns: 20px 1fr; margin-top: 18px; padding: 12px; }
.caveat > span { border: 1px solid #9c9a92; border-radius: 50%; display: grid; font-family: Georgia, serif; font-size: 11px; height: 18px; place-items: center; width: 18px; }
.caveat p { color: var(--muted); font-size: 9px; line-height: 1.5; margin: 0; }
.caveat strong { color: var(--ink); }

.map-panel { min-width: 0; overflow: hidden; position: relative; }
#map { height: 100%; width: 100%; }
.maplibregl-map { font-family: inherit; }
.maplibregl-ctrl-bottom-right { bottom: 31px; }
.maplibregl-ctrl-attrib { display: none; }
.map-heading { background: rgba(252, 250, 245, .92); border: 1px solid rgba(105, 102, 94, .18); border-radius: 4px; box-shadow: var(--shadow); left: 22px; padding: 10px 13px; position: absolute; top: 20px; }
.map-heading p { font-family: Georgia, serif; font-size: 15px; margin: 0 0 3px; }
.map-heading span { color: var(--muted); font-size: 9px; }
.legend { align-items: center; background: rgba(252, 250, 245, .92); bottom: 98px; display: flex; font-size: 9px; gap: 14px; left: 22px; padding: 8px 10px; position: absolute; }
.legend span { align-items: center; display: flex; gap: 5px; }
.legend i { display: inline-block; }
.legend-fire { background: var(--fire); border: 2px solid #ffd2c6; border-radius: 50%; height: 10px; width: 10px; }
.legend-plume { background: rgba(108, 112, 102, .42); border-left: 2px solid #6d7168; height: 9px; transform: skew(-22deg); width: 18px; }
.legend-direction { border-top: 3px solid #354e43; height: 0; position: relative; width: 20px; }
.legend-direction::after { border-bottom: 4px solid transparent; border-left: 7px solid #354e43; border-top: 4px solid transparent; content: ""; position: absolute; right: -1px; top: -5px; }
.layer-panel { background: rgba(252, 250, 245, .94); border: 1px solid rgba(105, 102, 94, .18); border-radius: 4px; box-shadow: var(--shadow); display: grid; gap: 8px; padding: 12px; position: absolute; right: 16px; top: 18px; }
.layer-panel p { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .12em; margin: 0 0 2px; text-transform: uppercase; }
.layer-panel label { align-items: center; cursor: pointer; display: flex; font-size: 9px; gap: 7px; }
.layer-panel input { accent-color: var(--fire-dark); margin: 0; }
.timeline { align-items: center; background: rgba(252, 250, 245, .96); border: 1px solid rgba(105, 102, 94, .2); border-radius: 5px; bottom: 31px; box-shadow: var(--shadow); display: grid; gap: 20px; grid-template-columns: auto minmax(320px, 520px); left: 50%; padding: 11px 14px; position: absolute; transform: translateX(-50%); }
.timeline-copy p { font-size: 10px; font-weight: 800; letter-spacing: .08em; margin: 0; text-transform: uppercase; }
.timeline-copy p strong { color: var(--fire-dark); margin-left: 5px; }
.timeline-copy span { color: var(--muted); font-size: 8px; white-space: nowrap; }
.time-buttons { align-items: center; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.time-buttons::before { background: #c7c2b8; content: ""; height: 1px; left: 10%; position: absolute; right: 10%; top: 8px; }
.time-buttons button { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 9px; padding: 21px 8px 0; position: relative; }
.time-buttons button::before { background: #f9f7f1; border: 2px solid #aaa59b; border-radius: 50%; content: ""; height: 11px; left: 50%; position: absolute; top: 3px; transform: translateX(-50%); width: 11px; z-index: 1; }
.time-buttons button.active { color: var(--ink); font-weight: 800; }
.time-buttons button.active::before { background: var(--fire); border-color: #fff; box-shadow: 0 0 0 2px var(--fire); }
.time-slider { min-width: 340px; }
.time-slider input { accent-color: var(--fire); cursor: ew-resize; margin: 0; width: 100%; }
.time-slider div { color: var(--muted); display: flex; font-size: 8px; justify-content: space-between; margin-top: 2px; }
.map-credit { background: rgba(32, 38, 34, .82); bottom: 0; color: #e6e5df; font-size: 8px; height: 22px; left: 0; letter-spacing: .02em; padding: 6px 12px; position: absolute; right: 0; text-align: right; }
.map-popup { min-width: 190px; }
.map-popup h3 { font-family: Georgia, serif; font-size: 14px; margin: 0 0 5px; }
.map-popup p { color: #68736d; font-size: 10px; line-height: 1.45; margin: 0; }
.map-popup strong { color: #17211d; }

@media (max-width: 850px) {
    body { overflow: auto; }
    .topbar { grid-template-columns: 1fr auto; padding: 0 15px; position: sticky; top: 0; }
    .topbar-title { display: none; }
    .freshness small { display: none; }
    .mode-banner { height: auto; line-height: 1.35; padding: 7px 15px; }
    .app-shell, .app-shell.with-banner { display: flex; flex-direction: column-reverse; height: auto; min-height: calc(100vh - 66px); }
    .sidebar { border-right: 0; overflow: visible; padding: 22px 18px; }
    .map-panel { height: 58vh; min-height: 450px; }
    .timeline { bottom: 31px; gap: 6px; grid-template-columns: 1fr; padding: 9px 10px; width: calc(100% - 28px); }
    .timeline-copy span { display: none; }
    .timeline-copy { display: none; }
    .time-slider { min-width: 0; }
    .legend { bottom: 87px; left: 14px; }
    .layer-panel { right: 10px; top: 68px; }
    .map-heading { left: 14px; top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
