:root {
    color-scheme: dark;
    --bg: #040910;
    --surface: #07111d;
    --surface-raised: #0b1725;
    --surface-soft: #0e1b2b;
    --line: rgb(137 164 194 / 0.18);
    --line-strong: rgb(165 191 221 / 0.34);
    --white-line: rgb(245 249 255 / 0.72);
    --text: #f2f6fb;
    --muted: #98aabd;
    --soft: #6e8196;
    --blue: #6f98ff;
    --blue-strong: #4777ed;
    --blue-soft: rgb(82 126 230 / 0.13);
    --orange: #f3a36d;
    --red: #ec756f;
    --shadow: 0 22px 60px rgb(0 0 0 / 0.42);
    --shadow-soft: 0 12px 32px rgb(0 0 0 / 0.28);
    --header-height: 60px;
    --footer-height: 24px;
    --explorer-width: 304px;
    --explorer-rail: 52px;
    --inspector-width: 344px;
    --ease-out: cubic-bezier(.2, .72, .22, 1);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-width: 320px;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--bg);
}

html {
    scroll-behavior: smooth;
}

body {
    color: var(--text);
    font-family: Inter, "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
[role="slider"]:focus-visible {
    outline: 2px solid rgb(121 159 255 / 0.9);
    outline-offset: 2px;
}

.sr-only,
.sr-only:not(:focus):not(:active) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.app-shell {
    display: grid;
    grid-template-rows: var(--header-height) minmax(0, 1fr) var(--footer-height);
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
}

.app-header {
    position: relative;
    z-index: 100;
    display: grid;
    grid-template-columns: minmax(260px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    min-width: 0;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: rgb(4 10 17 / 0.94);
    box-shadow: 0 8px 28px rgb(0 0 0 / 0.24);
    backdrop-filter: blur(18px) saturate(125%);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    margin-right: 10px;
    color: #6291ff;
}

.brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.08;
}

.brand-copy strong {
    overflow: hidden;
    font-size: 15px;
    letter-spacing: -0.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy strong span {
    color: #91b0ff;
}

.brand-copy small {
    margin-top: 4px;
    color: var(--soft);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.event-heading {
    min-width: 0;
    text-align: center;
}

.event-heading strong,
.event-heading span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-heading strong {
    font-size: 13px;
    font-weight: 720;
    letter-spacing: -0.01em;
}

.event-heading span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-button {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #d8e1eb;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out);
}

.header-button svg,
.rail-button svg,
.map-options-toggle svg,
.view-button-row svg,
.timeline-icon,
#timeline-toggle svg,
#inspector-close svg,
.inspector-edge-toggle svg,
.compare-handle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.header-button:hover {
    border-color: var(--line);
    background: rgb(255 255 255 / 0.045);
    color: #fff;
    transform: translateY(-1px);
}

.language-toggle {
    min-width: 58px;
    border-color: rgb(130 157 188 / 0.25);
    background: rgb(255 255 255 / 0.035);
}

.language-toggle span {
    min-width: 20px;
    color: #a9c8ff;
    font: 850 10px/1 "SFMono-Regular", Consolas, monospace;
    letter-spacing: 0.04em;
    text-align: center;
}

.viewer-main {
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) 112px;
    overflow: hidden;
    transition: grid-template-rows 260ms var(--ease-out);
}

.app-shell.is-timeline-collapsed .viewer-main {
    grid-template-rows: minmax(0, 1fr) 48px;
}

.map-stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #102030;
    isolation: isolate;
}

.map-canvas,
.after-clip,
.after-map {
    position: absolute;
    inset: 0;
}

.after-clip {
    z-index: 2;
    overflow: hidden;
    clip-path: inset(0 0 0 50%);
    pointer-events: none;
}

.after-map {
    width: 100%;
    height: 100%;
}

.coverage-status[hidden] {
    display: none;
}

.coverage-status {
    position: absolute;
    z-index: 10;
    right: 14px;
    bottom: 14px;
    padding: 6px 9px;
    border: 1px solid rgb(126 165 255 / .28);
    border-radius: 5px;
    background: rgb(5 14 23 / .78);
    color: rgb(199 216 255 / .74);
    font: 800 9px/1.1 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .09em;
    pointer-events: none;
    backdrop-filter: blur(8px);
}

.maplibregl-map {
    font-family: inherit;
}

.maplibregl-ctrl-group {
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: rgb(6 14 23 / 0.86);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.maplibregl-ctrl-group button {
    background-color: rgb(6 14 23 / 0.88);
    filter: invert(1) brightness(1.5);
}

.maplibregl-ctrl-attrib {
    background: rgb(5 12 20 / 0.7) !important;
    color: #c2cfdd;
    backdrop-filter: blur(8px);
}

.maplibregl-ctrl-attrib a {
    color: #c9d8fb;
}

.explorer-drawer {
    position: absolute;
    z-index: 30;
    top: 0;
    bottom: 0;
    left: 0;
    display: grid;
    width: var(--explorer-width);
    grid-template-columns: var(--explorer-rail) minmax(0, 1fr);
    overflow: hidden;
    border-right: 1px solid var(--line-strong);
    background: rgb(5 14 24 / 0.9);
    box-shadow: 14px 0 48px rgb(0 0 0 / 0.24);
    backdrop-filter: blur(18px) saturate(118%);
    transition: width 260ms var(--ease-out), box-shadow 260ms ease;
}

.explorer-drawer.is-collapsed {
    width: var(--explorer-rail);
    box-shadow: 8px 0 24px rgb(0 0 0 / 0.2);
}

.explorer-rail {
    position: relative;
    z-index: 2;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    border-right: 1px solid var(--line);
    background: rgb(4 11 19 / 0.88);
}

.rail-button {
    position: relative;
    display: flex;
    min-height: 58px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 2px;
    border: 0;
    border-bottom: 1px solid rgb(142 171 202 / 0.11);
    background: transparent;
    color: #7f93a9;
    cursor: pointer;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: 0.04em;
    transition: color 160ms ease, background 160ms ease;
}

.rail-button::before {
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 0;
    width: 2px;
    border-radius: 0 2px 2px 0;
    background: transparent;
    content: "";
    transition: background 160ms ease, box-shadow 160ms ease;
}

.rail-button:hover {
    background: rgb(255 255 255 / 0.035);
    color: #d8e3ef;
}

.rail-button.is-active {
    background: linear-gradient(90deg, rgb(79 119 215 / 0.12), transparent);
    color: #dfe9f7;
}

.rail-button.is-active::before {
    background: #7fa3ff;
    box-shadow: 0 0 14px rgb(104 150 255 / 0.52);
}

.rail-toggle {
    min-height: 52px;
    color: #b3c1d0;
}

.explorer-drawer.is-collapsed .rail-toggle svg {
    transform: rotate(90deg);
}

.explorer-content {
    min-width: 252px;
    min-height: 0;
    overflow: hidden;
    opacity: 1;
    transition: opacity 150ms ease, transform 260ms var(--ease-out);
}

.explorer-drawer.is-collapsed .explorer-content {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-12px);
}

.explorer-panel {
    height: 100%;
    padding: 18px 12px 20px;
    overflow-y: auto;
    scrollbar-color: rgb(116 144 176 / 0.35) transparent;
}

.explorer-panel[hidden] {
    display: none;
}

.panel-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 0 6px;
}

.eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #7890aa;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.panel-heading h2,
.timeline-heading h2 {
    margin: 0;
    font-size: 15px;
    letter-spacing: -0.015em;
}

.timeline-heading h2 {
    white-space: nowrap;
}

.count-badge {
    display: inline-grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.panel-lead {
    margin: 10px 6px 14px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
}

.places-list {
    display: grid;
    gap: 6px;
}

.place-button {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 62px;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgb(10 22 36 / 0.76);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: border-color 170ms ease, background 170ms ease, transform 170ms var(--ease-out), box-shadow 170ms ease;
}

.place-button::before {
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 2px;
    border-radius: 2px;
    background: transparent;
    content: "";
    transition: background 170ms ease, box-shadow 170ms ease;
}

.place-button:hover {
    border-color: rgb(144 176 211 / 0.38);
    background: rgb(14 29 46 / 0.88);
    transform: translateX(2px);
}

.place-button.is-active {
    border-color: rgb(118 157 250 / 0.58);
    background: linear-gradient(100deg, rgb(68 106 197 / 0.2), rgb(13 28 46 / 0.82));
    box-shadow: 0 8px 22px rgb(0 0 0 / 0.16), inset 0 0 0 1px rgb(136 167 244 / 0.06);
}

.place-button.is-active::before {
    background: #7fa3ff;
    box-shadow: 0 0 13px rgb(91 139 255 / 0.5);
}

.place-button.is-reacting {
    animation: item-response 380ms var(--ease-out);
}

@keyframes item-response {
    0% { transform: translateX(0); }
    42% { transform: translateX(3px); }
    100% { transform: translateX(0); }
}

.place-number {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border: 1px solid rgb(128 158 190 / 0.34);
    border-radius: 50%;
    background: rgb(17 35 55 / 0.78);
    color: #a8bdd3;
    font-size: 10px;
    font-weight: 800;
    transition: border-color 170ms ease, background 170ms ease, color 170ms ease, box-shadow 170ms ease;
}

.place-button.is-active .place-number {
    border-color: rgb(190 209 255 / 0.74);
    background: rgb(79 120 220 / 0.36);
    color: #fff;
    box-shadow: 0 0 0 3px rgb(80 126 232 / 0.1);
}

.place-copy {
    min-width: 0;
}

.place-copy strong,
.place-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.place-copy strong {
    font-size: 11px;
    font-weight: 720;
}

.place-copy span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 8px;
}

.imagery-availability {
    color: var(--soft);
    font-size: 8px;
    font-weight: 700;
}

.imagery-availability.has-imagery {
    color: #9eb8f7;
}

.acquisition-marker {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 6px 10px;
    color: #d5a17d;
    font-size: 8px;
}

.acquisition-marker::before,
.acquisition-marker::after {
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, transparent, rgb(239 164 109 / 0.48));
    content: "";
}

.acquisition-marker::after {
    background: linear-gradient(90deg, rgb(239 164 109 / 0.48), transparent);
}

.acquisition-marker span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 0 3px rgb(243 163 109 / 0.12);
}

.imagery-list {
    display: grid;
    gap: 8px;
}

.imagery-button {
    position: relative;
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgb(9 21 34 / 0.78);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: border-color 170ms ease, background 170ms ease, transform 170ms var(--ease-out), box-shadow 170ms ease;
}

.imagery-button:hover {
    border-color: rgb(144 176 211 / 0.38);
    transform: translateY(-1px);
}

.imagery-button.is-active {
    border-color: rgb(118 157 250 / 0.58);
    background: rgb(58 93 170 / 0.16);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.18), inset 0 0 0 1px rgb(118 157 250 / 0.08);
}

.imagery-button.is-active::after {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    border: 1px solid #dfe8ff;
    border-radius: 50%;
    background: #759cff;
    box-shadow: 0 0 8px rgb(89 137 255 / 0.6);
    content: "";
}

.imagery-button.is-reacting {
    animation: imagery-response 420ms var(--ease-out);
}

@keyframes imagery-response {
    0% { transform: scale(1); }
    45% { transform: scale(1.012); }
    100% { transform: scale(1); }
}

.imagery-thumb {
    width: 70px;
    height: 58px;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 0.1);
    border-radius: 5px;
    background: #192a3c center / cover no-repeat;
    filter: saturate(0.88) contrast(1.03);
}

.imagery-copy {
    min-width: 0;
}

.imagery-copy strong,
.imagery-copy span,
.imagery-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.imagery-copy strong {
    padding-right: 10px;
    font-size: 10px;
    white-space: nowrap;
}

.imagery-copy span {
    margin-top: 4px;
    color: #a9bcd1;
    font-size: 8px;
    white-space: nowrap;
}

.imagery-copy small {
    display: -webkit-box;
    margin-top: 5px;
    color: #738da9;
    font-size: 8px;
    font-weight: 700;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.map-topbar {
    position: absolute;
    z-index: 12;
    top: 12px;
    left: calc(var(--explorer-width) + 14px);
    right: 14px;
    display: grid;
    grid-template-columns: 146px minmax(160px, 1fr) 146px;
    align-items: start;
    gap: 11px;
    pointer-events: none;
    transition: left 260ms var(--ease-out), right 260ms var(--ease-out);
}

.app-shell.is-explorer-collapsed .map-topbar {
    left: calc(var(--explorer-rail) + 14px);
}

.capture-label,
.location-label {
    width: fit-content;
    max-width: 100%;
    padding: 7px 10px;
    border: 1px solid rgb(188 208 231 / 0.24);
    border-radius: 7px;
    background: rgb(5 13 22 / 0.8);
    color: var(--text);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.26);
    backdrop-filter: blur(12px) saturate(120%);
}

.capture-label span,
.capture-label strong,
.capture-label small,
.location-label strong,
.location-label span {
    display: block;
}

.capture-label span {
    color: #9bb3d0;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.capture-label strong {
    margin-top: 2px;
    font-size: 11px;
}

.capture-label small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 8px;
}

.after-label {
    justify-self: end;
    text-align: right;
}

.location-label {
    justify-self: center;
    border-color: rgb(201 218 238 / 0.28);
    cursor: pointer;
    text-align: center;
    pointer-events: auto;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms var(--ease-out);
}

.location-label:hover {
    border-color: rgb(211 227 247 / 0.46);
    background: rgb(8 18 30 / 0.9);
    transform: translateY(-1px);
}

.location-label strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-label span {
    margin-top: 3px;
    color: #b4c3d3;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 8px;
}

.map-control-cluster {
    position: absolute;
    z-index: 35;
    top: 112px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: right 260ms var(--ease-out);
}

.maplibregl-ctrl-top-right {
    top: 10px;
    right: 12px;
}

#before-map .maplibregl-control-container {
    position: relative;
    z-index: 24;
}

.maplibregl-ctrl-top-right .maplibregl-ctrl {
    margin: 0;
}

.app-shell.is-comparison-available .maplibregl-ctrl-top-right {
    top: 88px;
}

.app-shell.is-comparison-available .map-control-cluster {
    top: 194px;
}

.map-options-toggle {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: rgb(5 14 23 / 0.86);
    color: #d1dce8;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    font-size: 9px;
    font-weight: 800;
    backdrop-filter: blur(12px);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms var(--ease-out);
}

.map-options-toggle:hover,
.map-options-toggle[aria-expanded="true"] {
    border-color: rgb(154 183 218 / 0.5);
    background: rgb(10 25 40 / 0.93);
    transform: translateY(-1px);
}

.map-options-popover {
    position: absolute;
    top: 45px;
    right: 0;
    width: 260px;
    padding: 13px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: rgb(6 15 25 / 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px) saturate(130%);
    animation: popover-in 180ms var(--ease-out);
}

.map-options-popover[hidden] {
    display: none;
}

@keyframes popover-in {
    from { opacity: 0; transform: translateY(-5px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.map-options-popover section + section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.option-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.option-heading strong {
    font-size: 10px;
}

.option-heading span {
    color: #9eb5ce;
    font-size: 8px;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.theme-option {
    display: grid;
    min-width: 0;
    grid-template-columns: 31px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgb(255 255 255 / 0.025);
    color: #c5d2df;
    cursor: pointer;
    text-align: left;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms var(--ease-out);
}

.theme-option:hover {
    border-color: rgb(159 188 220 / 0.4);
    transform: translateY(-1px);
}

.theme-option.is-active {
    border-color: rgb(119 157 244 / 0.58);
    background: rgb(73 111 201 / 0.14);
}

.theme-swatch {
    position: relative;
    display: block;
    width: 31px;
    height: 25px;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 4px;
    background: var(--swatch-land);
}

.theme-swatch::before {
    position: absolute;
    right: -4px;
    bottom: -7px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--swatch-water);
    content: "";
}

.theme-swatch::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 2px;
    background: var(--swatch-road);
    box-shadow: 0 7px var(--swatch-road);
    content: "";
    transform: rotate(-16deg);
}

.theme-option-copy strong,
.theme-option-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-option-copy strong {
    font-size: 8px;
}

.theme-option-copy small {
    margin-top: 2px;
    color: var(--soft);
    font-size: 7px;
}

.view-button-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.view-button-row button {
    display: inline-flex;
    min-height: 33px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgb(255 255 255 / 0.025);
    color: #b7c6d5;
    cursor: pointer;
    font-size: 9px;
    font-weight: 750;
    transition: border-color 150ms ease, color 150ms ease, background 150ms ease, transform 150ms var(--ease-out);
}

.view-button-row button:hover {
    color: #fff;
    transform: translateY(-1px);
}

.view-button-row button[aria-pressed="true"] {
    border-color: rgb(119 157 244 / 0.58);
    background: rgb(73 111 201 / 0.16);
    color: #e4ebff;
}

.view-options p {
    margin: 7px 0 0;
    color: var(--soft);
    font-size: 7px;
    line-height: 1.45;
}

.layer-options {
    display: grid;
    gap: 7px;
}

.layer-options .option-heading {
    margin-bottom: 1px;
}

.layer-options label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #bdcad8;
    cursor: pointer;
    font-size: 8px;
}

.layer-options input {
    width: 13px;
    height: 13px;
    margin: 0;
    accent-color: var(--blue-strong);
}

.compare-divider {
    position: absolute;
    z-index: 11;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    cursor: ew-resize;
    background: rgb(255 255 255 / 0.86);
    box-shadow: 0 0 0 1px rgb(2 7 13 / 0.32), 0 0 14px rgb(0 0 0 / 0.38);
    touch-action: none;
    opacity: 0;
    transform: translateX(-.5px) scaleY(.97);
    transition: opacity 260ms ease, transform 420ms var(--ease-out);
}

.compare-divider.is-available {
    opacity: 1;
    transform: translateX(-.5px) scaleY(1);
}

.compare-divider[hidden] {
    display: none;
}

.compare-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1.5px solid rgb(255 255 255 / 0.95);
    border-radius: 50%;
    background: rgb(5 13 23 / 0.94);
    color: #fff;
    box-shadow: 0 7px 24px rgb(0 0 0 / 0.48), 0 0 0 4px rgb(0 0 0 / 0.08);
    transform: translate(-50%, -50%);
    transition: transform 150ms var(--ease-out), box-shadow 150ms ease;
}

.compare-divider:hover .compare-handle,
.compare-divider:focus-visible .compare-handle {
    box-shadow: 0 9px 28px rgb(0 0 0 / 0.52), 0 0 0 5px rgb(95 139 242 / 0.15);
    transform: translate(-50%, -50%) scale(1.04);
}

.compare-handle svg {
    width: 17px;
    height: 17px;
}

.selection-beacon {
    --beacon-rgb: 99 145 255;
    position: absolute;
    z-index: 10;
    width: 18px;
    height: 18px;
    border: 1px solid rgb(var(--beacon-rgb) / 0.95);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(.55);
}

.selection-beacon.is-visible {
    animation: beacon-response 1000ms var(--ease-out);
}

.selection-beacon[data-tone="monitoring"] {
    --beacon-rgb: 75 179 214;
}

.selection-beacon[data-tone="alert"] {
    --beacon-rgb: 255 132 54;
}

.selection-beacon::after {
    position: absolute;
    inset: -1px;
    border: 1px solid rgb(var(--beacon-rgb) / 0.72);
    border-radius: inherit;
    content: "";
    opacity: 0;
}

.selection-beacon.is-visible::after {
    animation: beacon-ripple 1000ms 150ms var(--ease-out);
}

@keyframes beacon-response {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.55); box-shadow: 0 0 0 0 rgb(var(--beacon-rgb) / .48); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(2.15); box-shadow: 0 0 0 9px rgb(var(--beacon-rgb) / 0); }
}

@keyframes beacon-ripple {
    0% { opacity: .72; transform: scale(.7); }
    100% { opacity: 0; transform: scale(3); }
}

.preview-notice {
    position: absolute;
    z-index: 13;
    left: calc(var(--explorer-width) + 14px);
    bottom: 13px;
    display: flex;
    max-width: min(380px, calc(100% - var(--explorer-width) - 180px));
    flex-direction: column;
    gap: 2px;
    padding: 7px 10px;
    border: 1px solid rgb(237 163 110 / 0.45);
    border-radius: 6px;
    background: rgb(30 20 13 / 0.82);
    color: #efd4c0;
    font-size: 8px;
    line-height: 1.45;
    backdrop-filter: blur(10px);
    transition: left 260ms var(--ease-out);
}

.preview-notice[hidden] {
    display: none;
}

.app-shell.is-explorer-collapsed .preview-notice {
    left: calc(var(--explorer-rail) + 14px);
}

.preview-notice strong {
    color: #efad7e;
    font-size: 9px;
}

.map-status {
    position: absolute;
    z-index: 14;
    bottom: 13px;
    left: 50%;
    max-width: calc(100% - 80px);
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgb(5 13 22 / 0.84);
    color: #c2cfdd;
    font-size: 8px;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 220ms ease;
    backdrop-filter: blur(9px);
}

.map-status.is-ready {
    opacity: 0;
}

.inspector-edge-toggle {
    position: absolute;
    z-index: 44;
    top: 50%;
    right: 0;
    display: grid;
    width: 34px;
    height: 64px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-right: 0;
    border-radius: 9px 0 0 9px;
    background: rgb(5 14 23 / 0.88);
    color: #b8c8d8;
    box-shadow: -8px 8px 24px rgb(0 0 0 / 0.23);
    cursor: pointer;
    transform: translateY(-50%);
    transition: right 260ms var(--ease-out), color 160ms ease, background 160ms ease;
    backdrop-filter: blur(12px);
}

.inspector-edge-toggle:hover {
    background: rgb(10 25 40 / 0.94);
    color: #fff;
}

.app-shell.is-inspector-open .inspector-edge-toggle {
    right: var(--inspector-width);
}

.app-shell.is-inspector-open .inspector-edge-toggle svg {
    transform: rotate(180deg);
}

.inspector-drawer {
    position: absolute;
    z-index: 43;
    top: 0;
    right: 0;
    bottom: 0;
    display: grid;
    width: var(--inspector-width);
    grid-template-rows: 56px minmax(0, 1fr);
    border-left: 1px solid var(--line-strong);
    background: rgb(5 14 24 / 0.94);
    box-shadow: -20px 0 60px rgb(0 0 0 / 0.32);
    transform: translateX(100%);
    transition: transform 260ms var(--ease-out);
    backdrop-filter: blur(20px) saturate(120%);
}

.app-shell.is-inspector-open .inspector-drawer {
    transform: translateX(0);
}

.inspector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px 0 15px;
    border-bottom: 1px solid var(--line);
}

.inspector-header .eyebrow {
    margin-bottom: 2px;
}

.inspector-header strong {
    font-size: 12px;
}

#inspector-close,
#timeline-toggle {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #aebdcd;
    cursor: pointer;
    transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

#inspector-close:hover,
#timeline-toggle:hover {
    border-color: var(--line);
    background: rgb(255 255 255 / 0.035);
    color: #fff;
}

.inspector-scroll {
    display: grid;
    min-height: 0;
    align-content: start;
    gap: 10px;
    padding: 11px;
    overflow-y: auto;
    scrollbar-color: rgb(116 144 176 / 0.35) transparent;
}

.event-card,
.place-card,
.sources-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: linear-gradient(145deg, rgb(13 28 45 / 0.9), rgb(7 19 31 / 0.92));
    box-shadow: 0 10px 28px rgb(0 0 0 / 0.12);
}

.status-chip {
    display: inline-flex;
    min-height: 21px;
    align-items: center;
    padding: 0 7px;
    border: 1px solid rgb(232 159 106 / 0.43);
    border-radius: 999px;
    background: rgb(238 157 99 / 0.08);
    color: #e8ae83;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.event-card h2,
.place-card h3,
.sources-card h3 {
    margin: 10px 0 0;
    letter-spacing: -0.02em;
}

.event-card h2 {
    font-size: 17px;
    line-height: 1.35;
}

.place-card h3,
.sources-card h3 {
    font-size: 14px;
}

.place-subtitle {
    display: block;
    margin-top: 3px;
    color: #7891ad;
    font-size: 8px;
}

.event-description,
.place-card p {
    margin: 9px 0 0;
    color: #b2c1d0;
    font-size: 9px;
    line-height: 1.7;
}

.event-facts {
    display: grid;
    margin: 12px 0 0;
}

.event-facts div {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 8px;
    padding: 7px 0;
    border-top: 1px solid var(--line);
}

.event-facts dt,
.event-facts dd {
    margin: 0;
    font-size: 8px;
    line-height: 1.45;
}

.event-facts dt {
    color: var(--soft);
}

.event-facts dd {
    color: #d7e1eb;
    font-weight: 700;
}

.place-evidence {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.evidence-chip {
    padding: 4px 7px;
    border: 1px solid rgb(112 145 181 / 0.27);
    border-radius: 5px;
    background: rgb(15 31 49 / 0.7);
    color: #9db2c9;
    font-size: 7px;
}

.sources-list {
    display: grid;
    gap: 7px;
    margin-top: 11px;
}

.source-link {
    display: block;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgb(7 18 30 / 0.7);
    color: #dce6f0;
    text-decoration: none;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms var(--ease-out);
}

.source-link:hover {
    border-color: rgb(127 163 204 / 0.44);
    background: rgb(10 25 41 / 0.8);
    transform: translateY(-1px);
}

.source-link strong,
.source-link span {
    display: block;
}

.source-link strong {
    color: #aec5f7;
    font-size: 8px;
}

.source-link span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 7px;
    line-height: 1.5;
}

.disclaimer {
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    color: #8498ad;
    font-size: 7px;
    line-height: 1.55;
}

.timeline-panel {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-columns: 202px minmax(0, 1fr);
    overflow: hidden;
    border-top: 1px solid var(--line-strong);
    background: linear-gradient(180deg, rgb(8 19 32 / 0.98), rgb(5 14 24 / 0.99));
    box-shadow: 0 -12px 40px rgb(0 0 0 / 0.18);
}

.timeline-heading {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 28px;
    align-items: start;
    gap: 8px;
    padding: 16px 10px 12px 14px;
    border-right: 1px solid var(--line);
}

.timeline-icon {
    width: 18px;
    height: 18px;
    color: #a6bbd3;
}

.timeline-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 8px;
    line-height: 1.4;
}

#timeline-toggle {
    width: 27px;
    height: 27px;
}

.app-shell.is-timeline-collapsed #timeline-toggle svg {
    transform: rotate(180deg);
}

.event-timeline {
    position: relative;
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(5, minmax(116px, 1fr));
    align-items: start;
    padding: 14px 12px 8px;
    overflow-x: auto;
    scrollbar-color: rgb(116 144 176 / 0.3) transparent;
}

.event-timeline::before {
    position: absolute;
    top: 23px;
    left: calc(10% + 12px);
    right: calc(10% + 12px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--white-line) 7%, var(--white-line) 93%, transparent);
    box-shadow: 0 0 8px rgb(255 255 255 / 0.08);
    content: "";
}

.timeline-event {
    position: relative;
    z-index: 1;
    display: grid;
    min-width: 112px;
    justify-items: center;
    padding: 0 6px 5px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-align: center;
    transition: background 170ms ease, transform 170ms var(--ease-out), color 170ms ease;
}

.timeline-event:hover {
    background: linear-gradient(180deg, rgb(255 255 255 / 0.035), transparent);
    transform: translateY(-1px);
}

.timeline-event.is-active {
    background: linear-gradient(180deg, rgb(86 127 223 / 0.1), transparent 82%);
}

.timeline-event.is-reacting {
    animation: timeline-response 440ms var(--ease-out);
}

@keyframes timeline-response {
    0% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    100% { transform: translateY(0); }
}

.timeline-dot {
    position: relative;
    display: grid;
    width: 14px;
    height: 14px;
    margin: 2px 0 4px;
    place-items: center;
    border: 2px solid rgb(244 248 253 / 0.92);
    border-radius: 50%;
    background: #192534;
    box-shadow: 0 0 0 2px rgb(255 255 255 / 0.06);
    transition: transform 180ms var(--ease-out), box-shadow 180ms ease, background 180ms ease;
}

.timeline-dot::after {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--orange);
    content: "";
}

.timeline-event:first-child .timeline-dot::after {
    background: var(--red);
}

.timeline-event.is-active .timeline-dot {
    background: rgb(44 73 134 / 0.84);
    box-shadow: 0 0 0 4px rgb(91 139 255 / 0.13), 0 0 16px rgb(83 132 248 / 0.28);
    transform: scale(1.08);
}

.timeline-event.is-active .timeline-dot::after {
    background: #9db8ff;
}

.timeline-event time {
    color: #d9a17b;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: -0.01em;
    transition: color 170ms ease;
}

.timeline-event.is-active time {
    color: #a9c0ff;
}

.timeline-item-title {
    display: flex;
    max-width: 100%;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 3px;
}

.timeline-item-icon {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    fill: none;
    stroke: #9aabbc;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
    transition: stroke 170ms ease;
}

.timeline-event.is-active .timeline-item-icon {
    stroke: #c5d3ff;
}

.timeline-event strong {
    overflow: hidden;
    color: #e7eef6;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-event small {
    display: -webkit-box;
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 7px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.app-shell.is-timeline-collapsed .timeline-heading {
    align-items: center;
    padding-top: 8px;
    padding-bottom: 8px;
}

.app-shell.is-timeline-collapsed .timeline-heading p,
.app-shell.is-timeline-collapsed .timeline-icon {
    display: none;
}

.app-shell.is-timeline-collapsed .timeline-heading {
    grid-template-columns: minmax(0, 1fr) 28px;
}

.app-shell.is-timeline-collapsed .timeline-heading h2 {
    font-size: 11px;
}

.app-shell.is-timeline-collapsed .event-timeline {
    align-items: center;
    padding-top: 7px;
    padding-bottom: 4px;
}

.app-shell.is-timeline-collapsed .event-timeline::before {
    top: 15px;
}

.app-shell.is-timeline-collapsed .timeline-event {
    grid-template-columns: 14px auto;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding-bottom: 0;
}

.app-shell.is-timeline-collapsed .timeline-dot {
    margin: 0;
}

.app-shell.is-timeline-collapsed .timeline-item-title,
.app-shell.is-timeline-collapsed .timeline-event small {
    display: none;
}

.app-footer {
    position: relative;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    border-top: 1px solid var(--line);
    background: #040a12;
    color: #687b8f;
    font-size: 7px;
    letter-spacing: 0.02em;
}

.loading-overlay {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgb(3 8 14 / 0.78);
    backdrop-filter: blur(9px);
    transition: opacity 260ms ease, visibility 260ms ease;
}

.loading-overlay.is-hidden {
    visibility: hidden;
    opacity: 0;
}

.loading-card {
    display: flex;
    min-width: min(330px, calc(100vw - 40px));
    flex-direction: column;
    align-items: center;
    padding: 27px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: #081522;
    box-shadow: var(--shadow);
}

.loading-card strong {
    margin-top: 14px;
    font-size: 12px;
}

.loading-card span:last-child {
    margin-top: 6px;
    color: var(--muted);
    font-size: 9px;
}

.loading-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid #263a51;
    border-top-color: #779fff;
    border-radius: 50%;
    animation: spin 850ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.toast {
    position: fixed;
    z-index: 1100;
    right: 16px;
    bottom: 36px;
    max-width: min(350px, calc(100vw - 32px));
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: rgb(13 31 50 / 0.96);
    color: #e6edf5;
    font-size: 9px;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(7px);
    transition: opacity 170ms ease, transform 170ms var(--ease-out);
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.fatal-error {
    position: fixed;
    z-index: 1200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #07111e;
}

.fatal-error article {
    max-width: 560px;
    padding: 24px;
    border: 1px solid #754046;
    border-radius: 10px;
    background: #1b1117;
}

.fatal-error h1 {
    margin: 0;
    color: #ff9d98;
    font-size: 18px;
}

.fatal-error p {
    margin: 10px 0 0;
    color: #e4c6c8;
    font-size: 12px;
    line-height: 1.7;
}

/* v0.2: larger evidence UI, safer comparison travel, and timeline-led playback */
:root {
    --header-height: 64px;
    --footer-height: 26px;
    --explorer-width: 328px;
    --explorer-rail: 56px;
    --inspector-width: 392px;
}

.viewer-main {
    grid-template-rows: minmax(0, 1fr) 128px;
}

.app-shell.is-timeline-collapsed .viewer-main {
    grid-template-rows: minmax(0, 1fr) 52px;
}

.brand-copy strong { font-size: 16px; }
.brand-copy small { font-size: 9px; }
.event-heading strong { font-size: 14px; }
.event-heading span { font-size: 11px; }
.header-button { min-height: 38px; font-size: 12px; }

.rail-button {
    min-height: 64px;
    font-size: 9px;
}

.explorer-content { min-width: 272px; }
.explorer-panel { padding: 20px 14px 24px; }
.eyebrow { font-size: 9px; }
.panel-heading h2,
.timeline-heading h2 { font-size: 17px; }
.panel-lead { font-size: 11px; }
.count-badge { min-width: 28px; height: 28px; font-size: 11px; }

.places-list { gap: 8px; }
.place-button {
    min-height: 70px;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px;
}
.place-number { width: 31px; height: 31px; font-size: 11px; }
.place-copy strong { font-size: 13px; }
.place-copy span { font-size: 9px; }
.imagery-availability { font-size: 9px; }
.acquisition-marker { font-size: 9px; }
.imagery-copy strong { font-size: 12px; }
.imagery-copy span,
.imagery-copy small { font-size: 9px; }

.map-topbar {
    grid-template-columns: 174px minmax(180px, 1fr) 174px;
    gap: 13px;
}

.capture-label,
.location-label {
    padding: 10px 12px;
    border-radius: 8px;
}

.capture-label {
    transition: opacity 180ms ease, transform 180ms var(--ease-out), border-color 180ms ease;
}

.capture-label.is-deemphasized {
    opacity: .58;
    transform: scale(.975);
}

.capture-label span { font-size: 9px; letter-spacing: .16em; }
.capture-label strong { margin-top: 3px; font-size: 15px; letter-spacing: .01em; }
.capture-label small { margin-top: 3px; font-size: 10px; }
.location-label strong { font-size: 15px; }
.location-label span { font-size: 10px; }

.map-control-cluster { top: 112px; }
.map-options-toggle { min-height: 40px; padding: 0 12px; font-size: 11px; }
.map-options-popover { width: 320px; padding: 15px; }
.option-heading strong { font-size: 12px; }
.option-heading span { font-size: 10px; }
.theme-option-copy strong { font-size: 10px; }
.theme-option-copy small { font-size: 8px; }
.view-button-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.view-button-row button { min-height: 38px; padding: 0 7px; font-size: 10px; }
.view-options p { font-size: 9px; line-height: 1.55; }
.layer-options label { font-size: 10px; }

.compare-handle {
    width: 42px;
    height: 42px;
    box-shadow: 0 8px 28px rgb(0 0 0 / 0.54), 0 0 0 4px rgb(0 0 0 / 0.1);
}

.inspector-edge-toggle { width: 39px; height: 70px; }
.inspector-edge-toggle svg { transform: rotate(180deg); }
.app-shell.is-inspector-open .inspector-edge-toggle svg { transform: rotate(0); }
.inspector-drawer { grid-template-rows: 62px minmax(0, 1fr); }
.inspector-header { padding-right: 15px; padding-left: 18px; }
.inspector-header strong { font-size: 14px; }
.inspector-scroll { gap: 12px; padding: 13px; }
.event-card,
.place-card,
.sources-card { padding: 17px; }
.status-chip { min-height: 24px; font-size: 8px; }
.event-card h2 { font-size: 19px; }
.place-card h3,
.sources-card h3 { font-size: 17px; }
.place-subtitle { font-size: 10px; }
.event-description,
.place-card p { font-size: 11px; line-height: 1.75; }
.event-facts div { grid-template-columns: 82px minmax(0, 1fr); padding: 9px 0; }
.event-facts dt,
.event-facts dd { font-size: 10px; }
.evidence-chip { padding: 5px 8px; font-size: 9px; }
.source-link { padding: 11px; }
.source-link strong { font-size: 10px; }
.source-link span { font-size: 9px; }
.disclaimer { font-size: 9px; }

.timeline-panel { grid-template-columns: 328px minmax(0, 1fr); }
.timeline-heading {
    grid-template-columns: 21px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 17px 12px 13px 16px;
}
.timeline-heading p { font-size: 9px; }
.timeline-actions { display: flex; align-items: center; gap: 5px; }
#story-button {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 5px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgb(255 255 255 / .025);
    color: #b9c8d8;
    cursor: pointer;
    font-size: 9px;
    font-weight: 800;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}
#story-button:hover,
#story-button.is-running {
    border-color: rgb(119 157 244 / .58);
    background: rgb(73 111 201 / .16);
    color: #eef3ff;
    transform: translateY(-1px);
}
#story-button svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    stroke: currentColor;
    stroke-linejoin: round;
    stroke-width: 1.6;
}
#timeline-toggle svg { transform: rotate(180deg); }
.app-shell.is-timeline-collapsed #timeline-toggle svg { transform: rotate(0); }
.app-shell.is-timeline-collapsed .timeline-heading { grid-template-columns: minmax(0, 1fr) auto; }
.event-timeline { grid-template-columns: repeat(5, minmax(138px, 1fr)); padding-top: 16px; }
.event-timeline::before { top: 26px; }
.timeline-event { min-width: 134px; }
.timeline-dot { width: 16px; height: 16px; }
.timeline-event time { font-size: 12px; }
.timeline-item-icon { width: 14px; height: 14px; }
.timeline-event strong { font-size: 10px; }
.timeline-event small { font-size: 9px; line-height: 1.35; }
.app-footer { font-size: 8px; }

.explorer-panel,
.inspector-scroll,
.event-timeline {
    scrollbar-width: thin;
    scrollbar-color: rgb(126 153 184 / .42) transparent;
}

.explorer-panel::-webkit-scrollbar,
.inspector-scroll::-webkit-scrollbar,
.event-timeline::-webkit-scrollbar { width: 6px; height: 6px; }
.explorer-panel::-webkit-scrollbar-thumb,
.inspector-scroll::-webkit-scrollbar-thumb,
.event-timeline::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgb(126 153 184 / .4);
}

@media (max-width: 960px) {
    :root {
        --header-height: 58px;
        --footer-height: 22px;
        --inspector-width: min(380px, 100vw);
    }

    .app-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .event-heading {
        display: none;
    }

    .viewer-main {
        grid-template-rows: minmax(0, 1fr) 124px;
    }

    .explorer-drawer {
        top: auto;
        right: 8px;
        bottom: 8px;
        left: 8px;
        width: auto;
        height: min(52vh, 430px);
        grid-template-columns: 1fr;
        grid-template-rows: 46px minmax(0, 1fr);
        border: 1px solid var(--line-strong);
        border-radius: 10px;
        box-shadow: var(--shadow);
        transition: height 260ms var(--ease-out), box-shadow 260ms ease;
    }

    .explorer-drawer.is-collapsed {
        width: auto;
        height: 46px;
    }

    .explorer-rail {
        flex-direction: row;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .rail-button {
        min-width: 72px;
        min-height: 45px;
        flex-direction: row;
        gap: 6px;
        padding: 0 11px;
        border-right: 1px solid rgb(142 171 202 / 0.11);
        border-bottom: 0;
        font-size: 8px;
    }

    .rail-button::before {
        top: auto;
        right: 14px;
        bottom: 0;
        left: 14px;
        width: auto;
        height: 2px;
    }

    .rail-toggle {
        min-width: 46px;
        padding: 0;
    }

    .explorer-content {
        min-width: 0;
        min-height: 0;
    }

    .explorer-drawer.is-collapsed .explorer-content {
        transform: translateY(8px);
    }

    .explorer-panel {
        padding-top: 14px;
    }

    .map-topbar,
    .app-shell.is-explorer-collapsed .map-topbar {
        left: 10px;
        right: 10px;
    }

    .preview-notice,
    .app-shell.is-explorer-collapsed .preview-notice {
        left: 10px;
        bottom: 62px;
        max-width: min(370px, calc(100% - 20px));
    }

    .map-control-cluster {
        top: 76px;
        right: 9px;
    }

    .inspector-edge-toggle {
        display: none;
    }

    .inspector-drawer {
        width: var(--inspector-width);
    }

    .timeline-panel {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .timeline-heading {
        padding-left: 11px;
    }

    .event-timeline {
        grid-template-columns: repeat(5, minmax(124px, 1fr));
    }
}

@media (max-width: 640px) {
    :root {
        --header-height: 56px;
    }

    .app-header {
        gap: 8px;
        padding: 0 9px;
    }

    .brand-mark {
        width: 29px;
        height: 29px;
        margin-right: 8px;
    }

    .brand-copy strong {
        font-size: 12px;
    }

    .brand-copy small,
    .header-button span {
        display: none;
    }

    .header-button {
        width: 34px;
        justify-content: center;
        padding: 0;
    }

    .language-toggle {
        width: auto;
        min-width: 48px;
        padding: 0 7px;
    }

    .language-toggle span {
        display: inline;
    }

    .viewer-main {
        grid-template-rows: minmax(0, 1fr) 128px;
    }

    .map-topbar,
    .app-shell.is-explorer-collapsed .map-topbar {
        top: 8px;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }

    .capture-label {
        padding: 6px 8px;
    }

    .location-label {
        position: absolute;
        top: 61px;
        left: 50%;
        max-width: calc(100vw - 140px);
        transform: translateX(-50%);
    }

    .location-label:hover {
        transform: translateX(-50%) translateY(-1px);
    }

    .map-control-cluster {
        top: 119px;
        right: 8px;
        max-width: calc(100% - 16px);
    }

    .map-options-toggle {
        width: 34px;
        justify-content: center;
        padding: 0;
    }

    .map-options-toggle span {
        display: none;
    }

    .map-options-popover {
        width: min(260px, calc(100vw - 16px));
    }

    .maplibregl-ctrl-bottom-right {
        bottom: 48px;
    }

    .preview-notice,
    .app-shell.is-explorer-collapsed .preview-notice {
        bottom: 61px;
        max-width: calc(100% - 20px);
    }

    .map-status {
        bottom: 63px;
    }

    .timeline-panel {
        grid-template-columns: 1fr;
        grid-template-rows: 46px minmax(0, 1fr);
    }

    .timeline-heading {
        grid-template-columns: 17px minmax(0, 1fr) auto;
        align-items: center;
        padding: 6px 8px 5px 10px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .timeline-heading h2 {
        font-size: 12px;
    }

    .timeline-heading p {
        display: none;
    }

    .timeline-icon {
        width: 15px;
        height: 15px;
    }

    .event-timeline {
        grid-template-columns: repeat(5, 126px);
        padding-top: 10px;
    }

    .event-timeline::before {
        top: 19px;
    }

    .timeline-event small {
        -webkit-line-clamp: 1;
    }

    .app-shell.is-timeline-collapsed .timeline-panel {
        grid-template-rows: 48px 0;
    }

    .app-shell.is-timeline-collapsed .event-timeline {
        display: none;
    }

    .app-shell.is-timeline-collapsed .timeline-heading {
        grid-template-columns: minmax(0, 1fr) auto;
        border-bottom: 0;
    }

    #story-button {
        width: 29px;
        min-height: 29px;
        justify-content: center;
        padding: 0;
    }

    #story-button span { display: none; }

    .explorer-drawer {
        right: 6px;
        bottom: 6px;
        left: 6px;
    }

    .rail-button {
        min-width: 68px;
    }

    .place-button {
        min-height: 58px;
    }

    .inspector-drawer {
        width: 100vw;
    }

    .app-footer {
        justify-content: center;
        padding: 0 8px;
    }

    .app-footer span:first-child,
    .app-footer span:last-child {
        display: none;
    }
}

/* v0.3: satellite acquisition rail directly below the situation timeline */
.timeline-content {
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) 70px;
    overflow: hidden;
}

.timeline-imagery-list {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px;
    padding: 7px 12px 8px;
    overflow-x: auto;
    border-top: 1px solid rgb(142 171 202 / .13);
    background: rgb(3 11 19 / .52);
    scrollbar-width: thin;
    scrollbar-color: rgb(126 153 184 / .34) transparent;
}

.timeline-imagery-list .imagery-button {
    min-width: 210px;
    min-height: 54px;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 8px;
    padding: 4px 7px 4px 4px;
}

.timeline-imagery-list .imagery-observation .imagery-thumb {
    box-shadow: inset 0 0 0 1px rgb(86 198 226 / .22);
}

.timeline-imagery-list .imagery-thumb {
    width: 62px;
    height: 46px;
}

.timeline-imagery-list .imagery-phase {
    margin-bottom: 2px !important;
}

.timeline-imagery-list .imagery-copy strong {
    font-size: 10px;
}

.timeline-imagery-list .imagery-copy span,
.timeline-imagery-list .imagery-copy small {
    font-size: 8px;
    white-space: nowrap;
}

@media (min-width: 961px) {
    .viewer-main {
        grid-template-rows: minmax(0, 1fr) 198px;
    }

    .app-shell.is-timeline-collapsed .viewer-main {
        grid-template-rows: minmax(0, 1fr) 52px;
    }
}

.app-shell.is-timeline-collapsed .timeline-content {
    grid-template-rows: minmax(0, 1fr) 0;
}

.app-shell.is-timeline-collapsed .timeline-imagery-list {
    display: none;
}

@media (max-width: 960px) {
    .timeline-content {
        display: block;
    }

    .timeline-imagery-list {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* v0.3: active-risk monitoring and multi-date observation */
.situation-banner {
    position: absolute;
    z-index: 13;
    top: 92px;
    left: calc(var(--explorer-width) + 14px);
    display: grid;
    min-width: 238px;
    grid-template-columns: auto 1fr;
    gap: 2px 10px;
    padding: 9px 11px;
    border: 1px solid rgb(244 166 66 / .48);
    border-radius: 8px;
    background: linear-gradient(110deg, rgb(38 25 12 / .9), rgb(12 22 32 / .88));
    color: #f6d9af;
    box-shadow: 0 10px 28px rgb(0 0 0 / .24), inset 2px 0 0 #e89129;
    cursor: pointer;
    text-align: left;
    backdrop-filter: blur(12px);
    transition: left 260ms var(--ease-out), border-color 170ms ease, transform 170ms var(--ease-out);
}

.app-shell.is-explorer-collapsed .situation-banner {
    left: calc(var(--explorer-rail) + 14px);
}

.situation-banner:hover {
    border-color: rgb(255 193 102 / .72);
    transform: translateY(-1px);
}

.situation-banner span {
    grid-column: 1;
    color: #f2a13f;
    font: 900 8px/1.2 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .13em;
}

.situation-banner strong {
    grid-column: 1 / -1;
    font-size: 11px;
}

.situation-banner small {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    color: #b89b78;
    font: 800 8px/1.2 "SFMono-Regular", Consolas, monospace;
}

.place-group-label {
    margin: 6px 3px 0;
    color: #7189a3;
    font: 900 8px/1.3 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .13em;
}

.place-group-label.is-active-risk {
    color: #d99a4d;
}

.place-button.is-risk {
    border-color: rgb(209 143 58 / .24);
    background: linear-gradient(100deg, rgb(104 61 18 / .13), rgb(10 22 36 / .76));
}

.place-button.is-risk:hover,
.place-button.is-risk.is-active {
    border-color: rgb(237 166 73 / .58);
    background: linear-gradient(100deg, rgb(134 77 18 / .25), rgb(13 28 43 / .84));
}

.place-button.is-risk::before,
.place-button.is-risk.is-active::before {
    background: #e99833;
    box-shadow: 0 0 13px rgb(232 145 44 / .38);
}

.place-button.is-risk .place-number,
.place-button.is-risk.is-active .place-number {
    border-color: rgb(246 190 114 / .58);
    background: rgb(126 74 22 / .36);
    color: #ffe5c0;
}

.place-button.is-risk .imagery-availability {
    color: #e5a95d;
}

.imagery-phase {
    width: fit-content;
    margin: 0 0 5px !important;
    padding: 2px 5px;
    border: 1px solid rgb(226 157 69 / .3);
    border-radius: 999px;
    color: #d99a4d !important;
    font: 900 7px/1.2 "SFMono-Regular", Consolas, monospace !important;
    letter-spacing: .08em;
}

.imagery-observation .imagery-phase {
    border-color: rgb(77 183 214 / .38);
    color: #70c7df !important;
}

.imagery-observation.is-active {
    border-color: rgb(77 183 214 / .58);
    background: rgb(30 104 125 / .18);
}

.situation-card {
    padding: 17px;
    border: 1px solid rgb(220 150 60 / .31);
    border-radius: 9px;
    background: linear-gradient(145deg, rgb(42 29 15 / .88), rgb(8 20 31 / .94) 58%);
    box-shadow: 0 10px 28px rgb(0 0 0 / .15);
}

.situation-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 13px;
}

.situation-card-heading time {
    color: #9e8568;
    font: 800 9px/1.2 "SFMono-Regular", Consolas, monospace;
}

.status-chip.is-alert {
    border-color: rgb(244 164 65 / .52);
    background: rgb(188 103 17 / .13);
    color: #f0ad5a;
}

.situation-card h2 {
    margin: 8px 0 0;
    color: #f5eadc;
    font-size: 18px;
    line-height: 1.35;
}

.situation-card > p {
    margin: 9px 0 0;
    color: #cbbba8;
    font-size: 11px;
    line-height: 1.7;
}

.lake-metrics {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.lake-metric {
    padding: 11px;
    border: 1px solid rgb(230 170 90 / .22);
    border-radius: 7px;
    background: rgb(7 17 27 / .64);
}

.lake-metric-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.lake-metric-heading strong {
    color: #e8aa5a;
    font: 900 9px/1.2 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .1em;
}

.lake-state {
    color: #b5c6d6;
    font: 900 7px/1.2 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .08em;
}

.lake-state.is-draining { color: #75d0be; }
.lake-state.is-watch { color: #f0a64e; }

.lake-place {
    display: block;
    margin-top: 5px;
    color: #8296aa;
    font-size: 8px;
}

.lake-value {
    margin-top: 7px;
    color: #fff2df;
    font: 900 18px/1.15 "SFMono-Regular", Consolas, monospace;
    letter-spacing: -.03em;
}

.lake-bar {
    height: 3px;
    margin: 8px 0 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgb(255 255 255 / .08);
}

.lake-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #d77e23, #ffc364);
}

.lake-metric small {
    display: block;
    color: #a99a88;
    font-size: 8px;
    line-height: 1.45;
}

.lake-metric .lake-quality {
    margin-top: 2px;
    color: #73879c;
}

.situation-card .situation-disclaimer {
    padding-top: 9px;
    border-top: 1px solid rgb(231 173 94 / .18);
    color: #877a6b;
    font-size: 8px;
}

.event-timeline {
    grid-template-columns: repeat(8, minmax(138px, 1fr));
}

.timeline-event.is-update .timeline-dot,
.timeline-event.is-alert .timeline-dot {
    border-color: rgb(255 226 185 / .9);
    background: #302318;
}

.timeline-event.is-update time,
.timeline-event.is-alert time {
    color: #e9a44d;
}

.timeline-event.is-alert .timeline-dot::after {
    background: #ff743d;
}

@media (max-width: 960px) {
    .situation-banner,
    .app-shell.is-explorer-collapsed .situation-banner {
        top: 76px;
        left: 10px;
    }

    .event-timeline {
        grid-template-columns: repeat(8, minmax(124px, 1fr));
    }
}

@media (max-width: 640px) {
    .situation-banner,
    .app-shell.is-explorer-collapsed .situation-banner {
        top: 155px;
        left: 8px;
        min-width: 0;
        max-width: calc(100% - 58px);
        padding: 7px 9px;
    }

    .situation-banner strong { font-size: 9px; }
    .event-timeline { grid-template-columns: repeat(8, 126px); }
}

/* v0.4: contextual HUD, direct map controls, and in-map storytelling */
.app-shell:not(.is-comparison-available) .capture-label {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-5px);
}

.map-quick-toggle {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: rgb(5 14 23 / .88);
    color: #d1dce8;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    font-size: 10px;
    font-weight: 850;
    backdrop-filter: blur(12px);
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}

.map-control-cluster {
    flex-direction: column;
    align-items: stretch;
}

.map-quick-toggle,
.map-options-toggle {
    width: 98px;
    justify-content: flex-start;
    white-space: nowrap;
}

.map-quick-toggle:hover,
.map-quick-toggle[aria-pressed="true"] {
    border-color: rgb(119 157 244 / .65);
    background: rgb(31 58 105 / .9);
    color: #f1f5ff;
    transform: translateY(-1px);
}

.map-quick-toggle svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.map-options-popover {
    top: 0;
    right: calc(100% + 8px);
    width: 250px;
}

.story-card {
    position: absolute;
    z-index: 32;
    right: 62px;
    bottom: 16px;
    width: min(340px, calc(100% - 92px));
    padding: 15px 16px;
    border: 1px solid rgb(176 202 230 / .3);
    border-radius: 11px;
    background: linear-gradient(145deg, rgb(7 18 29 / .88), rgb(9 24 38 / .76));
    color: #edf3f9;
    box-shadow: 0 16px 42px rgb(0 0 0 / .34);
    backdrop-filter: blur(18px) saturate(125%);
    transition: right 260ms var(--ease-out), opacity 180ms ease, transform 180ms var(--ease-out);
}

.story-card[hidden],
.app-shell.is-comparison-available:not(.is-story-mode) .story-card {
    display: none;
}

.app-shell.is-inspector-open .story-card {
    right: calc(var(--inspector-width) + 18px);
}

.story-card.is-story-step {
    border-color: rgb(237 169 83 / .48);
    background: linear-gradient(145deg, rgb(37 25 14 / .86), rgb(7 20 33 / .82) 60%);
}

.story-card-heading,
.story-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.story-kicker,
.story-card time {
    color: #91a8c0;
    font: 850 8px/1.3 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .12em;
}

.story-card.is-story-step .story-kicker,
.story-card.is-story-step time {
    color: #e7a652;
}

.story-card h2 {
    margin: 9px 0 0;
    font-size: 18px;
    line-height: 1.3;
}

.story-card p {
    margin: 8px 0 0;
    color: #c4d0dc;
    font-size: 10px;
    line-height: 1.65;
}

.story-card-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgb(186 207 230 / .15);
}

.story-card-footer span {
    overflow: hidden;
    color: #8197ad;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.story-card-footer button {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 1px solid rgb(142 175 213 / .34);
    border-radius: 6px;
    background: rgb(255 255 255 / .04);
    color: #d7e3ee;
    cursor: pointer;
    font-size: 9px;
    font-weight: 800;
}

.timeline-clock {
    display: grid;
    min-height: 30px;
    place-items: center;
    line-height: 1.1;
}

.timeline-clock .timeline-date {
    display: block;
    color: #8194a9;
    font: 850 8px/1.1 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .08em;
}

.timeline-clock .timeline-time {
    display: block;
    margin-top: 3px;
    color: #d9a17b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: -.01em;
    overflow: visible;
}

.timeline-event.is-active .timeline-clock .timeline-date,
.timeline-event.is-active .timeline-clock .timeline-time {
    color: #a9c0ff;
}

.timeline-event.is-update .timeline-clock .timeline-date,
.timeline-event.is-update .timeline-clock .timeline-time,
.timeline-event.is-alert .timeline-clock .timeline-date,
.timeline-event.is-alert .timeline-clock .timeline-time {
    color: #e9a44d;
}

@media (max-width: 960px) {
    .story-card {
        right: 56px;
        bottom: 12px;
        width: min(320px, calc(100% - 78px));
    }
}

@media (max-width: 640px) {
    .map-control-cluster {
        top: 112px;
    }

    .map-quick-toggle,
    .map-options-toggle {
        width: 38px;
        justify-content: center;
        padding: 0;
    }

    .map-quick-toggle span,
    .map-options-toggle span {
        display: none;
    }

    .story-card {
        right: 8px;
        bottom: 8px;
        left: 8px;
        width: auto;
        padding: 11px 12px;
    }

    .app-shell.is-inspector-open .story-card {
        display: none;
    }

    .story-card h2 { font-size: 14px; }
    .story-card p {
        display: -webkit-box;
        overflow: hidden;
        font-size: 9px;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .story-card-footer { margin-top: 8px; padding-top: 7px; }
    .timeline-clock .timeline-time { font-size: 10px; }
}
