:root {
  color-scheme: light;
  --blue: #005bac;
  --blue-2: #1f78c1;
  --deep: #003d73;
  --navy: #0a2742;
  --ink: #17293c;
  --muted: #5a6c7d;
  --muted-2: #8495a6;
  --surface: #ffffff;
  --canvas: #edf2f7;
  --line: rgba(23, 41, 60, .12);
  --line-strong: rgba(23, 41, 60, .2);
  --green: #0f9d76;
  --amber: #c56b12;
  --danger: #c2185b;
  --red: #dc2626;
  --shadow: 0 14px 38px rgba(15, 39, 64, .16);
  --shadow-soft: 0 8px 24px rgba(15, 39, 64, .1);
  font-family: "Noto Sans JP", Inter, "Hiragino Sans", "Yu Gothic UI", sans-serif;
}

* { box-sizing: border-box; }
html, body, #bosai-root { width: 100%; min-width: 320px; min-height: 100%; margin: 0; }
html, body { background: var(--canvas); color: var(--ink); }
body { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: progress; opacity: .48; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(0, 91, 172, .34);
  outline-offset: 2px;
}
img { display: block; max-width: 100%; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.adaptive-app { width: 100vw; height: 100dvh; background: var(--canvas); }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.card-heading { display: flex; align-items: center; gap: 7px; color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.card-heading em { margin-left: auto; padding: 2px 6px; border-radius: 999px; background: #eef4fa; color: var(--muted); font-size: 8px; font-style: normal; letter-spacing: 0; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 5px rgba(239, 68, 68, .13); animation: live-pulse 1.4s ease-out infinite; }

/* Header */
.app-header { position: relative; z-index: 40; display: flex; align-items: center; gap: 14px; height: 68px; padding: 9px 16px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .96); box-shadow: 0 2px 12px rgba(15, 39, 64, .06); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 228px; }
.brand__badge { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #1688d4, var(--deep)); font-size: 11px; font-weight: 950; box-shadow: 0 8px 17px rgba(0, 61, 115, .25); }
.brand__copy { min-width: 0; }
.brand__copy strong { font-size: 17px; letter-spacing: -.03em; }
.brand__copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.prototype-chip { margin-left: 6px; padding: 2px 6px; border-radius: 5px; color: #8a3d08; background: #fef3c7; font-size: 8px; font-weight: 900; vertical-align: 2px; }
.quick-spots { display: flex; align-items: center; gap: 6px; }
.quick-spots button { min-height: 38px; padding: 8px 13px; border: 1px solid #dbe4ef; border-radius: 999px; background: #fff; color: var(--muted); font-size: 10px; font-weight: 850; }
.quick-spots button:hover { color: var(--blue); border-color: #7ab7e8; background: #f3f9ff; }
.header-status { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.status-pill { display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 7px 11px; border-radius: 999px; font-size: 9.5px; font-weight: 850; }
.status-pill--quiet { border: 1px solid #dbe4ef; background: #fff; color: var(--muted); }
.status-pill--alert { border: 1px solid #f1b8b8; background: #fff4f4; color: #a21a1a; }
.status-pill--alert b { padding-left: 6px; border-left: 1px solid rgba(162, 26, 26, .18); font-size: 8px; font-weight: 800; }

/* Map */
.map-surface { position: relative; width: 100%; height: 100%; min-width: 0; overflow: hidden; background: #dfe8ef; }
.digital-twin-map { position: absolute; inset: 0; }
.digital-twin-map canvas { transition: filter .42s ease; }
.map-surface.is-analyzing .digital-twin-map canvas { filter: saturate(1.12) contrast(1.03) brightness(.93); }
.map-surface.is-quake .digital-twin-map canvas { filter: saturate(.94) contrast(1.04) brightness(.96); }
.map-surface.is-quake .map-legend { display: none; }
.map-surface::after { content: "浸水想定 × 避難場所を照合中"; position: absolute; z-index: 7; left: 50%; bottom: 24px; transform: translate(-50%, 16px); padding: 9px 14px; border-radius: 999px; background: rgba(0, 61, 115, .9); color: #fff; font-size: 10px; font-weight: 900; opacity: 0; pointer-events: none; transition: opacity .22s ease, transform .22s ease; }
.map-surface.is-analyzing::after { opacity: 1; transform: translate(-50%, 0); }
.map-loading, .map-error { position: absolute; z-index: 8; top: 16px; left: 50%; display: flex; align-items: center; gap: 8px; transform: translateX(-50%); max-width: calc(100% - 36px); padding: 9px 14px; border-radius: 999px; box-shadow: var(--shadow-soft); font-size: 10px; font-weight: 850; white-space: nowrap; }
.map-loading { color: #fff; background: rgba(0, 61, 115, .9); }
.map-loading svg { animation: spin 1s linear infinite; }
.map-error { color: #8a3d08; background: #fff8e8; border: 1px solid #f0d0a1; }
.map-attribution { position: absolute; z-index: 4; right: 12px; bottom: 6px; color: rgba(36, 53, 70, .72); font-size: 8px; text-shadow: 0 1px 3px rgba(255, 255, 255, .95); }
.map-legend { position: absolute; z-index: 8; left: 14px; bottom: 14px; width: 146px; border: 1px solid rgba(255, 255, 255, .75); border-radius: 12px; background: rgba(255, 255, 255, .94); box-shadow: var(--shadow-soft); overflow: hidden; }
.map-legend > button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 40px; padding: 8px 11px; border: 0; background: transparent; color: var(--ink); font-size: 9.5px; font-weight: 900; }
.map-legend > button svg { transition: transform .2s ease; }
.map-legend.is-open > button svg { transform: rotate(180deg); }
.map-legend__items { display: flex; flex-direction: column; gap: 4px; max-height: 0; padding: 0 11px; overflow: hidden; color: var(--muted); font-size: 8.5px; transition: max-height .25s ease, padding .25s ease; }
.map-legend.is-open .map-legend__items { max-height: 190px; padding: 0 11px 10px; }
.map-legend__items span { display: flex; align-items: center; gap: 6px; }
.map-legend__items i { width: 17px; height: 8px; border: 1px solid rgba(23, 41, 60, .14); border-radius: 2px; }
.map-legend__items u { width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 1px rgba(23, 41, 60, .22); text-decoration: none; }
.current-location { position: absolute; z-index: 8; right: 10px; bottom: 24px; display: flex; align-items: center; gap: 6px; min-height: 42px; padding: 8px 11px; border: 1px solid rgba(255, 255, 255, .72); border-radius: 999px; background: rgba(255, 255, 255, .95); color: var(--deep); box-shadow: var(--shadow-soft); font-size: 9.5px; font-weight: 900; }

/* Seismic scenario */
.seismic-overview-backdrop { position: fixed; z-index: 84; inset: 0; border: 0; background: rgba(5, 19, 32, .68); backdrop-filter: blur(4px); }
.seismic-overview-inset { position: absolute; z-index: 18; top: 14px; right: 14px; width: 300px; height: 202px; overflow: hidden; border: 2px solid rgba(255, 255, 255, .92); border-radius: 15px; background: #0a1d2d; color: #fff; box-shadow: 0 18px 42px rgba(2, 15, 28, .34); transition: width .28s ease, height .28s ease, inset .28s ease, transform .28s ease; }
.seismic-overview-inset.is-expanded { position: fixed; z-index: 85; top: 50%; right: auto; left: 50%; width: min(900px, calc(100vw - 56px)); height: min(72dvh, 680px); transform: translate(-50%, -50%); border-radius: 18px; }
.seismic-overview-inset__map { position: absolute; inset: 0; }
.seismic-overview-inset__map canvas { pointer-events: none; }
.seismic-overview-inset:not(.is-expanded) .maplibregl-ctrl-attrib { display: none; }
.seismic-overview-inset__head { position: absolute; z-index: 3; top: 8px; right: 8px; left: 8px; display: flex; align-items: center; gap: 7px; min-height: 30px; padding: 5px 7px; border-radius: 9px; background: rgba(6, 27, 47, .9); backdrop-filter: blur(8px); }
.seismic-overview-inset__head > span { display: flex; align-items: center; gap: 6px; font-size: 9px; font-weight: 900; }
.seismic-overview-inset__head > span i { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 5px rgba(239, 68, 68, .16); animation: live-pulse 1.4s ease-out infinite; }
.seismic-overview-inset__head em { padding: 2px 5px; border-radius: 999px; background: #fef3c7; color: #8a3d08; font-size: 7px; font-style: normal; font-weight: 900; }
.seismic-overview-inset__head button { display: grid; place-items: center; width: 36px; height: 36px; margin: -3px -3px -3px auto; border: 1px solid rgba(255, 255, 255, .2); border-radius: 9px; background: rgba(255, 255, 255, .1); color: #fff; }
.seismic-overview-inset__status { position: absolute; z-index: 3; bottom: 36px; left: 9px; display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 9px; background: rgba(6, 27, 47, .9); backdrop-filter: blur(8px); }
.seismic-overview-inset__status strong { font: 900 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.seismic-overview-inset__status span { color: #d9e7f2; font-size: 7.5px; font-weight: 850; }
.seismic-overview-inset__legend { position: absolute; z-index: 3; bottom: 10px; left: 10px; display: flex; gap: 8px; padding: 5px 7px; border-radius: 7px; background: rgba(255, 255, 255, .9); color: var(--deep); }
.seismic-overview-inset__legend span { display: flex; align-items: center; gap: 4px; font-size: 7px; font-weight: 850; }
.seismic-overview-inset__legend i { display: block; width: 15px; border-top: 3px solid #1688d4; }
.seismic-overview-inset__legend .wave-s i { border-top-width: 4px; border-top-color: #e24343; }
.seismic-overview-inset__expand { position: absolute; z-index: 5; right: 9px; bottom: 9px; display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 64px; min-height: 44px; border: 1px solid rgba(255, 255, 255, .42); border-radius: 10px; background: rgba(6, 27, 47, .92); color: #fff; font-size: 8px; font-weight: 900; }
.seismic-overview-inset__expand[hidden] { display: none; }
.seismic-overview-inset__note { position: absolute; z-index: 3; right: 14px; bottom: 12px; max-width: 460px; margin: 0; padding: 7px 9px; border-radius: 8px; background: rgba(6, 27, 47, .9); color: #d9e7f2; font-size: 8px; line-height: 1.45; }
.seismic-location-hint { position: absolute; z-index: 16; bottom: 30px; left: 14px; display: flex; align-items: center; gap: 6px; padding: 8px 11px; border: 1px solid rgba(0, 91, 172, .2); border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--chubu-blue); box-shadow: 0 8px 20px rgba(8, 31, 55, .14); font-size: 10px; font-weight: 900; pointer-events: none; }

.seismic-scenario-panel { grid-area: layers; display: flex; flex-direction: column; min-height: 0; padding: 17px 14px 13px; overflow-y: auto; border-right: 1px solid var(--line); background: #f9fbfd; }
.seismic-scenario-panel__head { display: flex; align-items: center; justify-content: space-between; }
.seismic-scenario-panel__head > span { padding: 3px 7px; border-radius: 999px; background: #fef3c7; color: #8a3d08; font-size: 8px; font-weight: 900; }
.seismic-scenario-panel h2 { margin: 6px 0 14px; font-size: 17px; line-height: 1.25; }
.scenario-stepper { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.scenario-stepper li { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 9px; min-height: 54px; color: var(--muted-2); }
.scenario-stepper li:not(:last-child)::after { content: ""; position: absolute; top: 28px; bottom: -2px; left: 14px; width: 2px; background: #d7e1ea; }
.scenario-stepper li > i { z-index: 1; display: grid; place-items: center; width: 29px; height: 29px; border: 2px solid #cfdbe6; border-radius: 50%; background: #fff; font-size: 9px; font-style: normal; font-weight: 900; }
.scenario-stepper b, .scenario-stepper small { display: block; }
.scenario-stepper b { font-size: 10px; }
.scenario-stepper small { margin-top: 2px; font-size: 8px; line-height: 1.35; }
.scenario-stepper li.is-done, .scenario-stepper li.is-active { color: var(--deep); }
.scenario-stepper li.is-done > i { border-color: var(--blue); background: var(--blue); color: #fff; }
.scenario-stepper li.is-active > i { border-color: #ef4444; color: #b91c1c; box-shadow: 0 0 0 5px rgba(239, 68, 68, .1); }
.scenario-target { margin-top: 5px; padding: 11px; border: 1px solid #d7e5f0; border-left: 4px solid var(--blue); border-radius: 11px; background: #fff; }
.scenario-target span, .scenario-target strong, .scenario-target small { display: block; }
.scenario-target span { color: var(--muted-2); font-size: 8px; font-weight: 800; }
.scenario-target strong { margin-top: 3px; font-size: 13px; }
.scenario-target small { margin-top: 4px; color: var(--blue); font-size: 8.5px; font-weight: 800; }
.scenario-view-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 9px; }
.scenario-view-buttons button, .scenario-restart { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; border: 1px solid #d7e2ec; border-radius: 9px; background: #fff; color: var(--deep); font-size: 8.5px; font-weight: 850; }
.scenario-restart { width: 100%; margin-top: 6px; }
.scenario-model-note { margin: 11px 0 8px; color: var(--muted); font-size: 7.8px; line-height: 1.55; }
.scenario-stop { min-height: 42px; margin-top: auto; border: 1px solid #efc0c0; border-radius: 9px; background: #fff; color: #a21a1a; font-size: 9px; font-weight: 850; }

.current-action-card, .arrival-board, .earthquake-shelter-card { border: 1px solid #dce6ef; border-radius: 14px; background: #fff; box-shadow: 0 5px 16px rgba(15, 39, 64, .06); }
.current-action-card { padding: 13px; }
.current-action-card__location { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; color: var(--muted-2); font-size: 8px; }
.current-action-card__location button { min-height: 30px; padding: 5px 8px; border: 0; border-radius: 999px; background: #edf6fd; color: var(--blue); font-size: 9px; font-weight: 900; }
.current-action-card__status { margin-top: 8px; padding: 11px; border-left: 5px solid var(--blue); border-radius: 11px; background: #edf6fd; }
.current-action-card__status strong, .current-action-card__status b, .current-action-card__status small { display: block; }
.current-action-card__status strong { color: var(--deep); font-size: 11px; }
.current-action-card__status b { margin-top: 2px; color: var(--blue); font-size: 24px; line-height: 1.15; letter-spacing: -.04em; }
.current-action-card__status small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.current-action-card.phase-early-warning .current-action-card__status { border-left-color: #f59e0b; background: #fff8e8; }
.current-action-card.phase-early-warning .current-action-card__status b { color: #a14b08; }
.current-action-card.phase-strong-motion .current-action-card__status { border-left-color: #dc2626; background: #fff0f0; }
.current-action-card.phase-strong-motion .current-action-card__status b { color: #b91c1c; }
.current-action-card > p { margin: 9px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.55; }
.current-action-card__confirm { width: 100%; min-height: 42px; margin-top: 9px; border: 0; border-radius: 9px; background: #b91c1c; color: #fff; font-size: 9px; font-weight: 900; }
.arrival-board { min-height: 0; padding: 12px; overflow: hidden; }
.arrival-board ol { display: grid; gap: 5px; max-height: 326px; margin: 9px 0 0; padding: 0; overflow-y: auto; list-style: none; }
.arrival-board li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; min-height: 40px; padding: 6px 7px; border: 1px solid #e2e9f0; border-radius: 8px; background: #f9fbfd; }
.arrival-board li > i { width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: #64748b; box-shadow: 0 0 0 1px #a7b4c0; }
.arrival-board li.status-p > i { background: #1688d4; box-shadow: 0 0 0 4px rgba(22, 136, 212, .13); }
.arrival-board li.status-s > i { background: #e24343; box-shadow: 0 0 0 4px rgba(226, 67, 67, .13); }
.arrival-board li.is-target { border-color: #8cc0e8; background: #edf6fd; }
.arrival-board b, .arrival-board small { display: block; }
.arrival-board b { font-size: 9px; }
.arrival-board small { margin-top: 2px; color: var(--muted); font-size: 7.5px; }
.arrival-board time { color: var(--muted-2); font: 800 7.5px/1 ui-monospace, SFMono-Regular, monospace; }
.earthquake-shelter-card { padding: 12px; }
.earthquake-shelter-card__lead { margin-top: 9px; padding: 10px; border-left: 4px solid var(--blue); border-radius: 10px; background: #edf6fd; }
.earthquake-shelter-card__lead strong { display: block; color: var(--deep); font-size: 11px; }
.earthquake-shelter-card__lead p { margin: 4px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.45; }
.earthquake-shelter-card ol { display: grid; gap: 5px; margin: 8px 0 0; padding: 0; list-style: none; }
.earthquake-shelter-card li button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 7px 9px; border: 1px solid #dce6ef; border-radius: 9px; background: #f9fbfd; text-align: left; }
.earthquake-shelter-card li button.is-selected { border-color: var(--blue); background: #edf6fd; color: var(--deep); }
.earthquake-shelter-card li button:disabled { cursor: not-allowed; }
.earthquake-shelter-card li b, .earthquake-shelter-card li small { display: block; }
.earthquake-shelter-card li b { font-size: 9px; }
.earthquake-shelter-card li small { margin-top: 2px; color: var(--muted); font-size: 7.5px; }
.earthquake-shelter-card li svg { flex: 0 0 auto; color: var(--blue); }
.earthquake-shelter-card__loading { display: flex; align-items: center; gap: 7px; min-height: 48px; margin-top: 8px; color: var(--blue); font-size: 9px; font-weight: 850; }
.earthquake-shelter-card__loading svg { animation: spin 1s linear infinite; }
.earthquake-shelter-card__empty { margin: 9px 0 0; color: var(--muted); font-size: 9px; }
.earthquake-shelter-card__note { display: block; margin-top: 8px; color: var(--muted-2); font-size: 7.5px; line-height: 1.45; }

.seismic-playback { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto auto; align-items: center; gap: 12px; width: 100%; height: 100%; padding: 11px 14px; background: #fff; }
.seismic-playback__primary { display: flex; align-items: center; gap: 7px; }
.playback-main-button, .playback-icon-button { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 0; border-radius: 11px; }
.playback-main-button { gap: 7px; min-width: 104px; padding: 8px 12px; background: var(--blue); color: #fff; font-size: 9px; font-weight: 900; }
.playback-icon-button { width: 44px; background: #eef4fa; color: var(--deep); }
.seismic-playback__primary > strong { min-width: 67px; color: var(--deep); font: 900 15px/1 ui-monospace, SFMono-Regular, monospace; }
.seismic-playback__range { display: block; min-width: 0; }
.seismic-playback__range input { width: 100%; height: 28px; accent-color: #e24343; }
.seismic-playback__range small { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 7px; font-weight: 800; }
.seismic-playback__speed { display: flex; gap: 4px; }
.seismic-playback__speed button { min-width: 38px; min-height: 38px; border: 1px solid #d8e2eb; border-radius: 9px; background: #fff; color: var(--muted); font-size: 8.5px; font-weight: 900; }
.seismic-playback__speed button.is-active { border-color: var(--blue); background: #edf6fd; color: var(--blue); }
.seismic-playback__stop { min-width: 54px; min-height: 38px; border: 1px solid #efc0c0; border-radius: 9px; background: #fff; color: #a21a1a; font-size: 8.5px; font-weight: 900; }

/* Markers */
.here-pin { position: relative; display: grid; place-items: center; width: 26px; height: 26px; }
.here-pin::before { content: ""; position: absolute; inset: -10px; border: 2px solid rgba(0, 91, 172, .58); border-radius: 50%; animation: here-pulse 1.25s ease-out 2; }
.here-pin i { width: 19px; height: 19px; border: 3px solid #fff; border-radius: 50% 50% 50% 0; background: var(--blue); box-shadow: 0 5px 16px rgba(0, 61, 115, .52); transform: rotate(-45deg); }
.here-pin span { position: absolute; bottom: 31px; left: 50%; transform: translateX(-50%); padding: 5px 9px; border-radius: 7px; color: #fff; background: var(--deep); box-shadow: 0 5px 14px rgba(0, 61, 115, .28); font-size: 9px; font-weight: 900; white-space: nowrap; }
.shelter-pin { position: relative; display: grid; place-items: center; width: 20px; height: 20px; border: 3px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 5px 16px rgba(0, 61, 115, .42); }
.shelter-pin span { position: absolute; bottom: 27px; left: 50%; transform: translateX(-50%); max-width: 180px; padding: 4px 8px; overflow: hidden; border-radius: 7px; background: var(--deep); color: #fff; box-shadow: 0 5px 14px rgba(0, 61, 115, .24); font-size: 9px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.route-label { padding: 4px 8px; border: 1px solid rgba(0, 91, 172, .24); border-radius: 999px; background: rgba(255, 255, 255, .95); color: var(--deep); box-shadow: 0 5px 14px rgba(23, 41, 60, .14); font-size: 8.5px; font-weight: 900; white-space: nowrap; }

/* Desktop layout */
.desktop-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr) 354px; grid-template-rows: 68px minmax(0, 1fr) 134px; grid-template-areas: "header header header" "layers map ai" "layers timeline ai"; }
.desktop-layout .app-header { grid-area: header; }
.layer-controls { grid-area: layers; display: flex; flex-direction: column; gap: 16px; min-height: 0; padding: 17px 14px 13px; overflow-y: auto; border-right: 1px solid var(--line); background: #f9fbfd; }
.layer-controls section { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.rail-eyebrow { margin: 0 0 4px; color: var(--blue); font-size: 8px; font-weight: 950; letter-spacing: .14em; }
.layer-controls h2 { margin: 0 0 10px; font-size: 14px; }
.layer-toggle, .rail-action, .spot-button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 42px; margin-bottom: 6px; padding: 8px 10px; border: 1px solid #dce5ee; border-radius: 10px; background: #fff; color: var(--muted); font-size: 10px; font-weight: 800; text-align: left; }
.layer-toggle { justify-content: space-between; color: var(--ink); }
.layer-toggle span { display: flex; align-items: center; gap: 8px; }
.layer-toggle input { width: 34px; height: 19px; accent-color: var(--blue); }
.rail-action:hover, .spot-button:hover { color: var(--blue); border-color: #7ab7e8; background: #f2f8fd; }
.spot-button svg { flex: 0 0 auto; color: var(--blue); }
.rail-meta { margin-top: auto; border: 0 !important; color: var(--muted); font-size: 9px; }
.rail-meta .live-dot { margin-right: 7px; }
.rail-meta small { display: block; margin: 7px 0 0 16px; color: var(--muted-2); }
.desktop-map-zone { grid-area: map; min-width: 0; min-height: 0; }
.ai-rail { grid-area: ai; display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 12px; overflow-y: auto; border-left: 1px solid var(--line); background: #f6f9fc; }
.desktop-timeline { grid-area: timeline; min-width: 0; border-top: 1px solid var(--line); background: #fff; }

/* Decision cards */
.decision-card, .ai-advice, .river-status, .metric-card, .camera-viewer, .event-timeline { border: 1px solid #dce6ef; border-radius: 14px; background: #fff; box-shadow: 0 5px 16px rgba(15, 39, 64, .06); }
.decision-card { padding: 13px; }
.decision-card--idle h2 { margin: 10px 0 7px; font-size: 21px; line-height: 1.12; letter-spacing: -.04em; }
.decision-card--idle > p { margin: 0 0 11px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.scenario-list { display: grid; gap: 6px; }
.scenario-list button { min-height: 38px; padding: 7px 9px; border: 1px solid #dce6ef; border-radius: 9px; background: #f9fbfd; color: var(--blue); font-size: 9.5px; font-weight: 850; text-align: left; }
.scenario-list button:hover { border-color: #7ab7e8; background: #eef7ff; }
.decision-card--analyzing { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 18px; text-align: center; }
.decision-card--analyzing small { color: var(--muted); font-size: 9px; }
.analysis-spinner { width: 34px; height: 34px; border: 3px solid #dbe8f3; border-top-color: var(--blue); border-radius: 50%; animation: spin .85s linear infinite; }
.decision-card__topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; color: var(--muted-2); font-size: 8px; font-weight: 800; }
.decision-card__topline button { padding: 4px 7px; border: 0; border-radius: 999px; background: #eaf3fb; color: var(--deep); font-size: 8px; font-weight: 850; }
.depth-card { padding: 12px 13px; border-left: 5px solid var(--blue); border-radius: 12px; background: #edf6fd; }
.depth-card span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; }
.depth-card strong { display: block; margin-top: 3px; color: var(--deep); font-size: 29px; line-height: 1.05; letter-spacing: -.04em; }
.depth-card b { display: block; margin-top: 6px; color: var(--deep); font-size: 11px; }
.depth-card.rank-0 { border-left-color: var(--green); background: #ecfdf7; }
.depth-card.rank-0 strong, .depth-card.rank-0 b { color: #08745a; }
.depth-card.rank-1, .depth-card.rank-2 { border-left-color: #e48b20; background: #fff8e8; }
.depth-card.rank-1 strong, .depth-card.rank-2 strong { color: #a14b08; }
.depth-card.rank-3, .depth-card.rank-4, .depth-card.rank-5, .depth-card.rank-6 { border-left-color: var(--danger); background: #fff0f6; }
.depth-card.rank-3 strong, .depth-card.rank-4 strong, .depth-card.rank-5 strong, .depth-card.rank-6 strong { color: var(--danger); }
.decision-advice { margin: 8px 0; padding: 8px 9px; border-radius: 8px; background: #f4f7fa; font-size: 9.5px; line-height: 1.55; }
.prototype-warning { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 9px; padding: 7px 8px; border: 1px solid #f1d5aa; border-radius: 8px; background: #fff8e8; color: #8a3d08; font-size: 8px; font-weight: 800; line-height: 1.4; }
.prototype-warning svg { flex: 0 0 auto; }
.shelter-heading { display: flex; justify-content: space-between; margin: 9px 0 6px; font-size: 9.5px; }
.shelter-heading span { color: var(--muted-2); font-size: 8px; }
.shelter-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.shelter-list button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 47px; padding: 8px 9px; border: 1px solid #dfe7ef; border-radius: 9px; background: #fff; text-align: left; }
.shelter-list button:hover, .shelter-list button.is-selected { border-color: var(--blue); background: #edf6fd; box-shadow: 0 0 0 2px rgba(0, 91, 172, .1); }
.shelter-list b { display: block; font-size: 10.5px; }
.shelter-list small { display: block; margin-top: 3px; color: var(--muted); font-size: 8.5px; }
.shelter-list svg { flex: 0 0 auto; color: var(--blue); }
.route-disclaimer { display: block; margin-top: 8px; color: var(--muted-2); font-size: 7.8px; line-height: 1.45; }

/* AI, river, prediction */
.ai-advice { padding: 12px; }
.ai-advice > strong { display: block; margin: 8px 0 4px; font-size: 12px; }
.ai-advice > p { margin: 0; font-size: 9.5px; line-height: 1.55; }
.ai-advice--emergency { border-color: #f0aaaa; background: #fff7f7; box-shadow: 0 0 0 2px rgba(220, 38, 38, .07); }
.ai-advice--emergency .card-heading { color: var(--red); }
.ai-confidence { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 8px; }
.ai-confidence span { color: var(--muted-2); }
.ai-confidence b { color: var(--muted); }
.prediction-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric-card { min-width: 0; padding: 10px; }
.metric-card > strong { display: block; margin: 7px 0 3px; overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.metric-card > p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.4; }
.river-status { padding: 11px; }
.river-value { display: flex; align-items: baseline; gap: 4px; margin: 7px 0 4px; }
.river-value strong { font-size: 23px; letter-spacing: -.04em; }
.river-value span { color: var(--muted); font-size: 10px; }
.river-value b { margin-left: auto; color: var(--amber); font-size: 8px; }
.river-gauge { height: 6px; overflow: hidden; border-radius: 999px; background: #e6edf4; }
.river-gauge i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #22c55e, #eab308, #ef4444); }
.river-status > small { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; }
.river-status--compact { border: 0; border-radius: 0; box-shadow: none; padding: 0 0 15px !important; }

/* Camera */
.camera-pip { position: absolute; z-index: 10; right: 16px; bottom: 16px; width: 230px; padding: 0; overflow: hidden; border: 2px solid rgba(255, 255, 255, .88); border-radius: 14px; background: #081828; box-shadow: 0 16px 36px rgba(2, 15, 28, .3); text-align: left; transition: transform .2s ease, border-color .2s ease; }
.camera-pip:hover { transform: translateY(-2px); }
.camera-pip.is-alert { border-color: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .18), 0 16px 36px rgba(2, 15, 28, .34); }
.camera-pip__media { width: 100%; height: 128px; overflow: hidden; background: #081828; }
.camera-pip__media iframe { display: block; width: 100%; height: 100%; border: 0; pointer-events: none; }
.camera-pip::after { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(180deg, rgba(4, 17, 29, .48), transparent 45%, rgba(4, 17, 29, .74)); pointer-events: none; }
.camera-pip__top, .camera-pip__bottom { position: absolute; z-index: 4; right: 9px; left: 9px; display: flex; align-items: center; justify-content: space-between; color: #fff; pointer-events: none; }
.camera-pip__top { top: 8px; }
.camera-pip__bottom { bottom: 8px; }
.camera-pip__top b { display: flex; align-items: center; gap: 6px; font-size: 9px; letter-spacing: .08em; }
.camera-pip__top b i { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .17); }
.camera-pip__top em { padding: 2px 5px; border-radius: 4px; background: rgba(3, 16, 28, .62); font-size: 7px; font-style: normal; }
.camera-pip__bottom b { font-size: 11px; }
.camera-pip__bottom small { color: #fbbf24; font-size: 8px; font-weight: 800; }
.camera-pip__open { position: absolute; z-index: 3; inset: 0; width: 100%; border: 0; background: transparent; cursor: pointer; }
.camera-pip__open:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.camera-viewer { padding: 11px; overflow: hidden; }
.camera-viewer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.camera-viewer__head > div { display: flex; align-items: center; gap: 7px; font-size: 9.5px; }
.camera-viewer__head small { margin-left: 3px; padding: 2px 5px; border-radius: 4px; background: #f1f5f9; color: var(--muted); font-size: 7px; }
.camera-frame { position: relative; overflow: hidden; border-radius: 10px; background: #0b1d2d; }
.camera-frame iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #0b1d2d; }
.camera-source { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px 0; color: var(--muted); font-size: 7px; line-height: 1.35; }
.camera-source__links { display: flex; gap: 8px; white-space: nowrap; }
.camera-source a { color: var(--blue); font-weight: 800; text-decoration: none; }
.camera-source a:hover { text-decoration: underline; }
.camera-analysis { padding: 9px 2px 2px; }
.camera-analysis > p { margin: 5px 0 0; color: var(--muted); font-size: 7.5px; line-height: 1.45; }
.camera-analysis ul { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 0; padding: 0; list-style: none; }
.camera-analysis li { padding: 4px 7px; border-radius: 999px; background: #ecfdf7; color: #08745a; font-size: 8px; font-weight: 800; }
.camera-analysis li.is-warn { background: #fff4e8; color: #a14b08; }
.camera-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.camera-tabs button { min-width: 0; min-height: 32px; padding: 5px 3px; overflow: hidden; border: 1px solid #dce5ee; border-radius: 7px; background: #fff; color: var(--muted); font-size: 7.5px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.camera-tabs button[aria-selected="true"] { border-color: var(--blue); background: #edf6fd; color: var(--blue); }
.camera-viewer--expanded { width: min(920px, 90vw); padding: 15px; }
.camera-viewer--expanded .camera-analysis { padding: 12px 2px 3px; }
.camera-viewer--expanded .camera-analysis li { font-size: 10px; }

/* Timeline */
.event-timeline { height: 100%; padding: 10px 13px; border: 0; border-radius: 0; box-shadow: none; }
.timeline-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.timeline-heading span { display: flex; align-items: center; gap: 7px; color: var(--blue); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.timeline-heading em { color: var(--muted-2); font-size: 8px; font-style: normal; }
.event-timeline ol { display: flex; gap: 10px; margin: 0; padding: 0; overflow-x: auto; list-style: none; scrollbar-width: thin; }
.event-timeline li { display: grid; grid-template-columns: auto 7px minmax(120px, 1fr); align-items: start; gap: 6px; min-width: 180px; padding: 8px; border: 1px solid #e1e8ef; border-radius: 9px; background: #f9fbfd; }
.event-timeline time { color: var(--muted-2); font: 700 8px/1.3 ui-monospace, SFMono-Regular, monospace; }
.event-timeline li > i { width: 7px; height: 7px; margin-top: 1px; border-radius: 50%; background: #10b981; }
.event-timeline .event-alert > i { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .12); }
.event-timeline .event-warn > i { background: #f59e0b; }
.event-timeline b, .event-timeline small { display: block; }
.event-timeline b { font-size: 8.5px; }
.event-timeline small { margin-top: 3px; color: var(--muted); font-size: 7.5px; line-height: 1.35; }

/* Chat */
.floating-chat-button { position: fixed; z-index: 70; display: flex; align-items: center; justify-content: center; gap: 4px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: linear-gradient(145deg, var(--blue-2), var(--deep)); color: #fff; box-shadow: 0 12px 28px rgba(0, 61, 115, .32); }
.floating-chat-button span { font-size: 8px; font-weight: 900; }
.floating-chat-button--desktop { left: 242px; bottom: 151px; }
.floating-chat-button--tablet { right: 18px; bottom: 18px; }
.floating-chat-button--mobile { right: 16px; bottom: 78px; }
.chat-panel { position: fixed; z-index: 70; display: flex; flex-direction: column; overflow: hidden; border: 1px solid #cfdae5; border-radius: 14px; background: #fff; box-shadow: 0 18px 45px rgba(15, 39, 64, .24); }
.chat-panel--desktop { left: 238px; bottom: 150px; width: 310px; height: 285px; }
.chat-panel--tablet { right: 14px; bottom: 14px; width: 330px; height: 330px; }
.chat-panel--mobile { right: 10px; bottom: 72px; left: 10px; height: min(430px, 62vh); }
.chat-panel header { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 7px 9px 7px 12px; border-bottom: 1px solid var(--line); }
.chat-panel header > span { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 900; }
.chat-panel header em { padding: 2px 5px; border-radius: 4px; background: #eef4fa; color: var(--muted); font-size: 7px; font-style: normal; }
.chat-messages { flex: 1; padding: 10px; overflow-y: auto; background: #f7f9fc; }
.chat-messages p { max-width: 86%; margin: 0 0 7px; padding: 8px 9px; border-radius: 10px; font-size: 9px; line-height: 1.45; }
.chat-assistant { background: #fff; border: 1px solid #e1e8ef; }
.chat-user { margin-left: auto !important; background: #e8f3fc; color: var(--deep); }
.chat-panel form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.chat-panel input { min-width: 0; flex: 1; min-height: 38px; padding: 8px 10px; border: 1px solid #d9e3ec; border-radius: 9px; font-size: 9px; }
.chat-panel form button { display: grid; place-items: center; width: 38px; border: 0; border-radius: 9px; background: var(--blue); color: #fff; }

/* Emergency */
.emergency-alert { position: fixed; z-index: 100; border: 1px solid #efaaaa; background: rgba(255, 248, 248, .97); box-shadow: 0 18px 45px rgba(101, 10, 10, .25); }
.emergency-alert--desktop { top: 78px; right: 369px; display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; width: min(720px, calc(100vw - 620px)); padding: 12px 14px; border-radius: 14px; }
.emergency-alert--tablet { top: 76px; right: 14px; left: 14px; display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 13px; }
.emergency-alert__symbol { position: relative; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; color: #fff; background: #dc2626; box-shadow: 0 0 0 9px rgba(220, 38, 38, .1); animation: alert-pulse 1s ease-in-out infinite; }
.emergency-alert__symbol span { position: absolute; bottom: 3px; font-size: 10px; font-weight: 950; }
.emergency-alert__copy small { color: #b91c1c; font-size: 8px; font-weight: 950; letter-spacing: .06em; }
.emergency-alert__copy strong { display: block; margin-top: 2px; font-size: 14px; }
.emergency-alert__copy p { margin: 3px 0 0; color: #5e3131; font-size: 8.5px; line-height: 1.45; }
.emergency-alert__actions { display: flex; gap: 5px; }
.emergency-alert__actions button { min-height: 36px; padding: 6px 9px; border: 1px solid #efc0c0; border-radius: 8px; background: #fff; color: #a21a1a; font-size: 8px; font-weight: 850; }
.emergency-alert__actions button:first-child { border-color: #b91c1c; background: #b91c1c; color: #fff; }
.modal-backdrop { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(5, 19, 32, .72); backdrop-filter: blur(5px); }
.camera-modal { max-height: 92vh; overflow-y: auto; border-radius: 15px; }

/* Tablet */
.tablet-layout { display: grid; grid-template-rows: 68px minmax(310px, 50dvh) minmax(0, 1fr) 88px; }
.tablet-map-zone { min-height: 0; }
.tablet-cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, .85fr); gap: 10px; min-height: 0; padding: 10px; overflow: auto; }
.tablet-ai-stack { display: grid; align-content: start; gap: 10px; min-width: 0; }
.tablet-cards .camera-viewer { align-self: start; }
.tablet-cards .camera-frame img { height: 94px; min-height: 0; aspect-ratio: auto; }
.tablet-cards .camera-analysis { padding-top: 7px; }
.tablet-cards .camera-analysis ul { margin-top: 5px; }
.tablet-cards .camera-tabs { margin-top: 6px; }
.tablet-layout > .event-timeline { border-top: 1px solid var(--line); border-radius: 0; }
.tablet-layout > .seismic-playback { border-top: 1px solid var(--line); }
.seismic-playback--tablet { grid-template-columns: auto minmax(130px, 1fr) auto auto; gap: 8px; padding: 8px 10px; }
.seismic-playback--tablet .playback-main-button { min-width: 86px; }
.seismic-playback--tablet .seismic-playback__primary > strong { display: none; }
.tablet-drawer-backdrop { position: fixed; z-index: 110; inset: 0; background: rgba(6, 23, 39, .42); }
.tablet-drawer { width: min(330px, 86vw); height: 100%; overflow-y: auto; background: #f9fbfd; box-shadow: 18px 0 40px rgba(6, 23, 39, .2); }
.tablet-drawer > header { display: flex; align-items: center; justify-content: space-between; height: 62px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.tablet-drawer .layer-controls { display: flex; width: auto; height: auto; border: 0; }
.app-header--tablet .brand { min-width: 190px; }
.app-header--tablet .quick-spots { overflow-x: auto; scrollbar-width: none; }

/* Mobile */
.mobile-layout { height: auto; min-height: 100dvh; padding-bottom: 64px; overflow-x: hidden; background: #eef3f8; }
.mobile-layout .app-header { position: sticky; top: 0; z-index: 60; height: 60px; padding: 7px 9px; }
.app-header--mobile .brand { min-width: 0; flex: 1; }
.app-header--mobile .brand__badge { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; }
.app-header--mobile .brand__copy strong { font-size: 14px; }
.app-header--mobile .status-pill--alert { width: 42px; height: 42px; min-height: 42px; padding: 0; justify-content: center; border-radius: 12px; }
.app-header--mobile .status-pill--alert span, .app-header--mobile .status-pill--alert b { display: none; }
.compact-alert-banner { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 54px; padding: 8px 12px; border: 0; border-bottom: 1px solid #d5e2ed; background: #f7fbff; color: var(--deep); text-align: left; }
.compact-alert-banner.is-active { background: #fff0f0; color: #a21a1a; animation: alert-strip 1.15s ease-in-out infinite; }
.compact-alert-banner span { min-width: 0; }
.compact-alert-banner small, .compact-alert-banner b { display: block; }
.compact-alert-banner small { font-size: 7.5px; font-weight: 900; letter-spacing: .06em; }
.compact-alert-banner b { margin-top: 2px; font-size: 10px; }
.mobile-map-zone { height: 43dvh; min-height: 320px; max-height: 470px; }
.mobile-map-zone.is-seismic { height: 38dvh; min-height: 300px; max-height: 390px; }
.mobile-map-zone .map-legend { left: 9px; bottom: 24px; width: 128px; }
.mobile-map-zone .map-attribution { right: 6px; bottom: 4px; font-size: 7px; }
.mobile-content { display: grid; gap: 10px; padding: 10px 10px 24px; }
.mobile-priority-card { padding: 9px 10px 0; background: #eef3f8; }
.mobile-priority-card .current-action-card { box-shadow: none; }
.mobile-content .ai-advice { order: 0; }
.ai-advice--compact { padding: 12px; }
.ai-advice--compact > strong { font-size: 13px; }
.ai-advice--compact > p { font-size: 10px; }
.decision-card--mobile { box-shadow: none; }
.decision-card--mobile.decision-card--idle h2 { font-size: 19px; }
.decision-card--mobile .depth-card strong { font-size: 30px; }
.mobile-content .camera-viewer { box-shadow: none; }
.mobile-content .event-timeline { height: auto; min-height: 150px; border-radius: 14px; }
.mobile-content .event-timeline ol { display: grid; overflow: visible; }
.mobile-content .event-timeline li { min-width: 0; }
.seismic-playback--mobile { position: relative; z-index: 45; grid-template-columns: auto auto auto; grid-template-areas: "primary speed stop" "range range range"; justify-content: space-between; gap: 5px 7px; height: auto; padding: 8px 10px 7px; border-top: 1px solid #d9e3ec; border-bottom: 1px solid #d9e3ec; box-shadow: 0 8px 20px rgba(15, 39, 64, .08); }
.seismic-playback--mobile .seismic-playback__primary { grid-area: primary; }
.seismic-playback--mobile .seismic-playback__range { grid-area: range; }
.seismic-playback--mobile .seismic-playback__speed { grid-area: speed; }
.seismic-playback--mobile .seismic-playback__stop { grid-area: stop; min-width: 46px; min-height: 44px; }
.seismic-playback--mobile .playback-main-button { min-width: 48px; width: 48px; padding: 0; }
.seismic-playback--mobile .playback-main-button span { display: none; }
.seismic-playback--mobile .seismic-playback__primary > strong { font-size: 13px; }
.mobile-content .current-action-card,
.mobile-content .arrival-board,
.mobile-content .earthquake-shelter-card { box-shadow: none; }
.current-action-card--compact .current-action-card__status b { font-size: 22px; }
.arrival-board--compact ol { max-height: 250px; }
.bottom-navigation { position: fixed; z-index: 80; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); height: 62px; padding: 5px 6px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid #d7e0e9; background: rgba(255, 255, 255, .96); box-shadow: 0 -8px 28px rgba(15, 39, 64, .11); backdrop-filter: blur(14px); }
.bottom-navigation button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 9px; background: transparent; color: #6c7e8e; font-size: 7.5px; font-weight: 800; }
.bottom-navigation button.is-active { background: #edf6fd; color: var(--blue); }
.settings-sheet, .mobile-location-menu { position: fixed; z-index: 95; right: 8px; bottom: 68px; left: 8px; padding: 10px; border: 1px solid #d8e2eb; border-radius: 15px; background: #fff; box-shadow: 0 18px 45px rgba(15, 39, 64, .22); }
.settings-sheet header, .mobile-location-menu header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.settings-sheet > button, .mobile-location-menu > button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 46px; margin-top: 6px; padding: 8px 10px; border: 1px solid #dce5ee; border-radius: 9px; background: #fff; text-align: left; }
.settings-sheet > button span { flex: 1; }
.settings-sheet > button b { color: var(--blue); font-size: 9px; }
.settings-sheet p { margin: 9px 3px 2px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.mobile-location-menu { top: 68px; bottom: auto; }
.mobile-location-menu > button { color: var(--blue); font-size: 10px; font-weight: 850; }
.emergency-alert--mobile { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; border: 0; border-radius: 0; text-align: center; background: radial-gradient(circle at 50% 34%, #fff 0, #fff3f3 46%, #ffdede 100%); }
.emergency-alert--mobile .emergency-alert__symbol { width: 100px; height: 100px; margin-bottom: 26px; }
.emergency-alert--mobile .emergency-alert__symbol span { bottom: 9px; font-size: 18px; }
.emergency-alert--mobile .emergency-alert__copy small { font-size: 10px; }
.emergency-alert--mobile .emergency-alert__copy strong { margin-top: 8px; font-size: clamp(24px, 8vw, 38px); line-height: 1.2; }
.emergency-alert--mobile .emergency-alert__copy p { margin-top: 14px; font-size: 13px; line-height: 1.7; }
.emergency-alert--mobile .emergency-alert__actions { display: grid; width: 100%; max-width: 360px; margin-top: 24px; }
.emergency-alert--mobile .emergency-alert__actions button { min-height: 50px; font-size: 11px; }

.emergency-alert--mobile .emergency-alert__symbol span { bottom: 11px; font-size: 10px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes here-pulse { 0% { opacity: .9; transform: scale(.55); } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .35); } 100% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } }
@keyframes alert-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes alert-strip { 0%, 100% { background: #fff0f0; } 50% { background: #ffe0e0; } }

@media (max-width: 1599px) and (min-width: 768px) {
  body { overflow: hidden; }
  .app-header--tablet { gap: 9px; }
  .app-header--tablet .header-status .status-pill--alert { padding: 7px 10px; }
  .app-header--tablet .header-status .status-pill--alert b { display: none; }
  .tablet-layout .decision-card--tablet { max-height: 330px; overflow-y: auto; }
}

@media (max-width: 980px) and (min-width: 768px) {
  .app-header--tablet .brand { min-width: 172px; }
  .app-header--tablet .brand__copy small { display: none; }
  .app-header--tablet .quick-spots button { padding: 7px 10px; font-size: 9px; }
  .tablet-cards { grid-template-columns: 1fr 1fr; }
  .seismic-overview-inset { width: 250px; height: 168px; }
  .seismic-playback--tablet .seismic-playback__speed button { min-width: 34px; }
}

@media (max-width: 767px) {
  body { overflow-x: hidden; overflow-y: auto; }
  .map-surface::after { bottom: 75px; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .map-loading, .map-error { top: 10px; font-size: 8.5px; }
  .camera-tabs button { min-height: 38px; font-size: 8px; }
  .camera-frame iframe { min-height: 180px; }
  .camera-source { align-items: flex-start; flex-direction: column; gap: 4px; font-size: 8px; }
  .camera-source__links { width: 100%; justify-content: space-between; }
  .camera-analysis > p { font-size: 8.5px; }
  .seismic-overview-inset { top: 9px; right: 9px; width: 150px; height: 112px; border-radius: 12px; }
  .seismic-overview-inset.is-expanded { top: auto; right: 8px; bottom: 8px; left: 8px; width: auto; height: min(70dvh, 620px); transform: none; border-radius: 18px; }
  .seismic-overview-inset__head { top: 5px; right: 5px; left: 5px; min-height: 25px; padding: 3px 5px; }
  .seismic-overview-inset__head > span { font-size: 7px; }
  .seismic-overview-inset__head em { font-size: 6px; }
  .seismic-overview-inset:not(.is-expanded) .seismic-overview-inset__status { bottom: 29px; left: 5px; gap: 4px; padding: 4px 5px; }
  .seismic-overview-inset:not(.is-expanded) .seismic-overview-inset__status strong { font-size: 10px; }
  .seismic-overview-inset:not(.is-expanded) .seismic-overview-inset__status span { display: none; }
  .seismic-overview-inset:not(.is-expanded) .seismic-overview-inset__legend { bottom: 4px; left: 5px; gap: 4px; padding: 3px 4px; }
  .seismic-overview-inset:not(.is-expanded) .seismic-overview-inset__legend span { font-size: 5.8px; }
  .seismic-overview-inset:not(.is-expanded) .seismic-overview-inset__legend i { width: 10px; }
  .seismic-overview-inset__expand { right: 5px; bottom: 5px; min-width: 44px; width: 44px; min-height: 44px; padding: 0; }
  .seismic-overview-inset__expand span { display: none; }
  .seismic-overview-inset.is-expanded .seismic-overview-inset__status { bottom: 48px; }
  .seismic-overview-inset.is-expanded .seismic-overview-inset__note { right: 10px; bottom: 10px; left: 10px; max-width: none; }
  .map-surface.is-quake .map-attribution { max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 380px) {
  .app-header--mobile .brand__copy strong { font-size: 12px; }
  .prototype-chip { display: none; }
  .mobile-map-zone { min-height: 290px; }
  .mobile-map-zone.is-seismic { min-height: 290px; }
  .current-location { right: 8px; font-size: 8px; }
}

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