:root {
  --brand: #0b4a66; --brand2: #0f6187;
  --safe: #1a9e8c; --warn: #f2a600; --evac: #c0182d; --nodata: #7a8691;
  --bg: #f3f6f8; --card: #ffffff; --ink: #14212b; --muted: #55636e; --line: #d9e1e7;
  --radius: 16px;
  font-size: 18px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e171d; --card: #17242d; --ink: #eef3f6; --muted: #a6b4bd; --line: #2a3a45; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom); -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; color: inherit; }
svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top)); background: var(--brand); color: #fff; }
.top img { border-radius: 9px; }
.brand { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.brand b { font-size: 1.05rem; }
.brand span { font-size: .72rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { position: relative; background: transparent; border: 0; color: #fff; width: 44px; height: 44px; border-radius: 22px; display: grid; place-items: center; cursor: pointer; }
.iconbtn:focus-visible, .btn:focus-visible, select:focus-visible, .seg button:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
.iconbtn.dark { color: var(--ink); font-size: 1.2rem; }
.badge { position: absolute; top: 4px; right: 2px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--evac); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
#lang { background: var(--brand2); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 10px; padding: 6px 4px; font-size: .8rem; }

main { max-width: 560px; margin: 0 auto; padding: 12px 16px 32px; display: flex; flex-direction: column; gap: 14px; }
h2 { font-size: 1.05rem; margin: 0 0 8px; }
h3 { font-size: .95rem; margin: 12px 0 6px; }

.banner { position: fixed; left: 0; right: 0; top: var(--hdr, 66px); z-index: 40; margin: 0; box-shadow: 0 6px 18px rgba(0,0,0,.25); padding: 12px 16px; color: #fff; font-weight: 600; display: flex; gap: 10px; align-items: center; cursor: pointer; animation: drop .3s ease-out; }
@keyframes drop { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
.offline { position: sticky; top: var(--hdr, 66px); z-index: 18; background: #44525c; color: #fff; padding: 8px 16px; font-size: .85rem; text-align: center; }

.timebar { display: flex; flex-direction: column; gap: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.seg button { border: 0; background: transparent; padding: 10px 6px; border-radius: 10px; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--brand); color: #fff; }
.replay { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.play { width: 52px; height: 52px; border-radius: 26px; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.play svg { width: 28px; height: 28px; }
.chipwrap { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chip { align-self: flex-start; background: #e6f0f5; color: var(--brand); font-weight: 700; padding: 4px 12px; border-radius: 999px; font-size: .9rem; }
@media (prefers-color-scheme: dark) { .chip { background: #1f3a4a; color: #cfe7f3; } }
#scrub { width: 100%; accent-color: var(--brand); }

.find { display: flex; flex-direction: column; gap: 8px; position: relative; }
.searchbox { display: flex; align-items: center; gap: 8px; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 0 12px; }
.searchbox:focus-within { border-color: var(--brand2); }
.searchbox svg { color: var(--muted); }
.searchbox input { flex: 1; border: 0; background: transparent; padding: 14px 0; outline: none; min-width: 0; font-size: 1rem; }
.results { list-style: none; margin: 0; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.results li { padding: 12px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.results li:hover, .results li[aria-selected="true"] { background: #e6f0f5; }
@media (prefers-color-scheme: dark) { .results li:hover { background: #1f3a4a; } }
.results small { color: var(--muted); }
.tag { font-size: .7rem; font-weight: 700; background: var(--safe); color: #fff; border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--brand); background: var(--card); color: var(--brand); font-weight: 700; cursor: pointer; min-height: 52px; }
@media (prefers-color-scheme: dark) { .btn { color: #cfe7f3; border-color: #3f7d9c; } }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.on { background: var(--safe); border-color: var(--safe); color: #fff; }
.btn.ghost { border-color: var(--line); color: var(--muted); font-weight: 600; }
.msg { margin: 0; min-height: 1.2em; color: var(--muted); font-size: .9rem; }

.card { scroll-margin-top: calc(var(--hdr, 66px) + 8px); background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.band { display: flex; align-items: center; gap: 14px; padding: 16px; color: #fff; transition: background-color .4s; }
.band.l0 { background: var(--safe); } .band.l1 { background: var(--warn); color: #241a00; } .band.l2 { background: var(--evac); } .band.lx { background: var(--nodata); }
.lvicon { width: 56px; height: 56px; border-radius: 28px; background: rgba(255,255,255,.22); display: grid; place-items: center; flex: none; }
.band.l1 .lvicon { background: rgba(0,0,0,.1); }
.lvicon svg { width: 36px; height: 36px; }
.lvword { font-size: 1.9rem; font-weight: 800; line-height: 1.1; letter-spacing: .01em; }
.place { font-size: 1rem; font-weight: 600; opacity: .95; }
.cardbody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.cardbody p { margin: 0; }
.advice { font-size: 1.05rem; font-weight: 600; }
.meta { color: var(--muted); font-size: .9rem; }
.small { font-size: .78rem; }
.detail { font-size: .92rem; }
.prec { font-size: .85rem; background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.prec b { display: block; }
.map { height: 240px; border-radius: 12px; overflow: hidden; background: #dfe7ec; margin-top: 4px; }
.hint { font-size: .78rem; color: var(--muted); margin-top: -2px !important; }
.pulse { animation: pulse .6s ease-out; }
@keyframes pulse { from { filter: brightness(1.35); } to { filter: none; } }

.plist, .alist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plist li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.plist .nm { flex: 1; min-width: 0; cursor: pointer; }
.plist .nm small { display: block; color: var(--muted); }
.pill { font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: #fff; white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; }
.pill svg { width: 14px; height: 14px; }
.pill.l0 { background: var(--safe); } .pill.l1 { background: var(--warn); color: #241a00; } .pill.l2 { background: var(--evac); } .pill.lx { background: var(--nodata); }
.rm { border: 0; background: transparent; color: var(--muted); font-size: .8rem; cursor: pointer; padding: 8px; text-decoration: underline; }
.empty { color: var(--muted); font-size: .9rem; }

.disclaimer { background: #fff7e0; border: 1px solid #f0d58a; border-radius: var(--radius); padding: 14px 16px; font-size: .9rem; color: #3b2f00; }
@media (prefers-color-scheme: dark) { .disclaimer { background: #2b2610; border-color: #5a4c18; color: #f2e7bf; } }
.disclaimer p { margin: 0 0 6px; }
.links { margin: 0; padding-left: 18px; }
.links a { color: inherit; font-weight: 600; }
.links li { padding: 3px 0; }
details { margin-top: 8px; } summary { cursor: pointer; font-weight: 600; }
#install { margin-top: 10px; }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheetbox { background: var(--card); width: 100%; max-width: 560px; max-height: 85vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.sheethead { display: flex; justify-content: space-between; align-items: center; }
.sheethead h2 { margin: 0; }
.demo { margin: 0; font-size: .85rem; background: #e6f0f5; color: var(--brand); border-radius: 10px; padding: 8px 10px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .demo { background: #1f3a4a; color: #cfe7f3; } }
.alist li { border-left: 6px solid var(--nodata); background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.alist li.l1 { border-color: var(--warn); } .alist li.l2 { border-color: var(--evac); } .alist li.l0 { border-color: var(--safe); }
.alist b { display: block; } .alist small { color: var(--muted); }
.maplibregl-ctrl-attrib { font-size: 10px; }
.me { width: 18px; height: 18px; border-radius: 9px; background: #1f6fd1; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(31,111,209,.4); }

/* presentation mode (?present=date): no time controls */
body.present .timebar, body.present .about { display: none; }
.brand .about { font-size: .72rem; color: #fff; opacity: .9; text-decoration: underline; white-space: nowrap; }
