/* fludd — styles. Mobile first; desktop layout at >= 900px. Light + dark via prefers-color-scheme. */
:root {
  --bg: #ffffff; --bg2: #f4f6f8; --bg3: #e8ecf0; --fg: #0f1a24; --fg2: #4a5866; --fg3: #6b7a88;
  --line: #d9e0e6; --brand: #0b3b5c; --accent: #0369a1; --accent-fg: #fff;
  --c-info: #64748b; --c-ok: #15803d; --c-low: #0284c7; --c-moderate: #d97706; --c-high: #dc2626; --c-critical: #7c3aed;
  --red-bg: #fde8e8; --red-fg: #9b1c1c; --amber-bg: #fef3c7; --amber-fg: #8a4b06; --blue-bg: #e0f2fe; --blue-fg: #075985; --green-bg: #dcfce7; --green-fg: #166534;
  --shadow: 0 6px 24px rgba(15, 26, 36, .16), 0 1px 3px rgba(15, 26, 36, .12);
  --radius: 14px; --header-h: 56px; --peek-h: 156px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121a22; --bg2: #19232d; --bg3: #23303c; --fg: #e8eef3; --fg2: #b3c0cc; --fg3: #8a9aa8;
    --line: #2c3a47; --brand: #0b3b5c; --accent: #38bdf8; --accent-fg: #062033;
    --c-info: #94a3b8; --c-ok: #4ade80; --c-low: #38bdf8; --c-moderate: #fbbf24; --c-high: #f87171; --c-critical: #c4b5fd;
    --red-bg: #3b1515; --red-fg: #fecaca; --amber-bg: #3a2a0a; --amber-fg: #fde68a; --blue-bg: #0c2a3d; --blue-fg: #bae6fd; --green-bg: #0f2e1b; --green-fg: #bbf7d0;
    --shadow: 0 6px 24px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--fg); font: 15px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.05rem; } h3 { font-size: 1rem; }
p { margin: .45em 0; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.muted { color: var(--fg2); } .small { font-size: .875rem; } .tiny { font-size: .78rem; }
.pre { white-space: pre-line; }
.row { display: flex; align-items: center; flex-wrap: wrap; } .gap { gap: 8px; } .push { margin-left: auto; }
.skip { position: absolute; left: -999px; top: 0; z-index: 9999; background: var(--bg); padding: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.noscript { padding: 20px; }

/* ---------- header ---------- */
#topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 1000; display: flex; align-items: center; gap: 10px;
  height: calc(var(--header-h) + var(--safe-t)); padding: var(--safe-t) 10px 0; background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.logo { width: 30px; height: 30px; }
.brand-name { font-weight: 750; letter-spacing: -.01em; white-space: nowrap; }
.status {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 7px 12px;
  background: var(--bg2); cursor: pointer; text-align: left; font-weight: 600; font-size: .92rem;
}
.status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
@media (max-width: 600px) {
  .status { padding: 5px 10px; font-size: .82rem; line-height: 1.22; border-radius: 14px; align-self: center; }
  .status-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
.status-updated { color: var(--fg3); font-weight: 500; font-size: .78rem; white-space: nowrap; }
.su-short { display: none; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fg3); flex: none; }
.status.lvl-red { background: var(--red-bg); color: var(--red-fg); } .lvl-red .status-dot { background: var(--c-high); animation: pulse 1.6s infinite; }
.status.lvl-amber { background: var(--amber-bg); color: var(--amber-fg); } .lvl-amber .status-dot { background: var(--c-moderate); }
.status.lvl-blue { background: var(--blue-bg); color: var(--blue-fg); } .lvl-blue .status-dot { background: var(--c-low); }
.status.lvl-unknown { background: var(--bg2); color: var(--fg); outline: 2px dashed var(--line); } .lvl-unknown .status-dot { background: var(--fg3); }
.status.lvl-green { background: var(--green-bg); color: var(--green-fg); } .lvl-green .status-dot { background: var(--c-info); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .55); } 70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }
@media (prefers-reduced-motion: reduce) { .lvl-red .status-dot { animation: none; } * { scroll-behavior: auto !important; transition: none !important; } }
.top-actions { display: flex; gap: 6px; flex: none; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 10px; min-height: 40px; min-width: 40px; justify-content: center; font-size: .85rem; font-weight: 600; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.chip-safety { color: var(--red-fg); border-color: color-mix(in srgb, var(--c-high) 40%, var(--line)); }
.ribbon { position: fixed; top: calc(var(--header-h) + var(--safe-t)); left: 0; right: 0; z-index: 999; height: 26px; line-height: 18px; background: var(--amber-bg); color: var(--amber-fg); font-size: .8rem; padding: 4px 12px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-short { display: none; }
@media (max-width: 700px) { .rb-long { display: none; } .rb-short { display: inline; } }

@media (max-width: 600px) {
  .brand-name { display: none; }
  .status-updated { font-size: .7rem; opacity: .85; align-self: flex-end; }
  .su-long { display: none; } .su-short { display: inline; }
  .chip span { display: none; }
  .chip-safety { padding: 6px 8px; }
  #btn-lang { font-size: .78rem; padding: 6px 8px; }
}

/* ---------- map ---------- */
#main { position: fixed; inset: calc(var(--header-h) + var(--safe-t)) 0 0 0; }
body:has(#ribbon:not([hidden])) #main { top: calc(var(--header-h) + var(--safe-t) + 26px); }
#map { position: absolute; inset: 0; background: var(--bg3); z-index: 0; }
.leaflet-container { font: inherit; background: var(--bg3); }
.leaflet-control-attribution { font-size: 10px; }
.leaflet-bottom.leaflet-right { bottom: calc(var(--peek-h) + 8px + var(--safe-b)); }
.leaflet-bar a { background: var(--bg); color: var(--fg); border-color: var(--line); }
@media (max-width: 899px) { .leaflet-control-zoom { display: none; } }
.radar-tiles { image-rendering: auto; }
@media (prefers-color-scheme: dark) { .leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg2); color: var(--fg); } .leaflet-container a.leaflet-popup-close-button { color: var(--fg2); } }

/* search + controls */
.search { position: absolute; z-index: 800; top: 10px; left: 10px; right: 120px; max-width: 420px; }
#search input { width: 100%; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding: 0 12px 0 36px; box-shadow: var(--shadow); }
.search-ico { position: absolute; left: 11px; top: 11px; color: var(--fg3); }
.search-results { margin-top: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.sr { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; border-bottom: 1px solid var(--line); cursor: pointer; }
.sr:hover, .sr:focus { background: var(--bg2); }
.pad { padding: 10px 12px; }
.map-ctrls { position: absolute; z-index: 800; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 8px; }
.ctrl { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 52px; padding: 7px 0 5px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); box-shadow: var(--shadow); cursor: pointer; font-size: .68rem; font-weight: 600; color: var(--fg2); }
.ctrl .ico { width: 20px; height: 20px; color: var(--fg); }
.layers-pop { position: absolute; z-index: 900; top: 10px; right: 70px; width: min(330px, calc(100vw - 84px)); max-height: calc(100% - 140px); overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px; }
.ly-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.ly-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ly-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.ly-l { display: block; font-weight: 600; } .ly-n { display: block; font-size: .78rem; color: var(--fg2); }
.sw { width: 14px; height: 14px; border-radius: 4px; flex: none; margin-top: 3px; }
.sw-comm { background: var(--c-high); border-radius: 50%; } .sw-311 { background: #475569; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #999; }
.sw-radar { background: linear-gradient(90deg, #04e9e7, #01c501, #fdf802, #fd9500, #fd0000); } .sw-zone { border: 2px dashed #c2410c; background: rgba(249, 115, 22, .15); border-radius: 50%; }
.sw-hot { background: rgba(37, 99, 235, .45); border-radius: 50%; } .sw-meet { background: #7c3aed; border-radius: 50%; }
.ly-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; padding-top: 8px; font-size: .8rem; color: var(--fg2); }
.ly-legend span { display: inline-flex; align-items: center; gap: 5px; }
.icon-btn { border: 0; background: none; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; display: inline-grid; place-items: center; color: var(--fg2); font-size: 1.1rem; }
.icon-btn:hover { background: var(--bg2); }

.radar-chip { position: absolute; z-index: 800; left: 10px; bottom: calc(var(--peek-h) + 10px + var(--safe-b)); display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px 3px 3px; box-shadow: var(--shadow); font-size: .8rem; font-weight: 600; }
.radar-btn { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; cursor: pointer; }

.fab { position: absolute; z-index: 850; left: 50%; transform: translateX(-50%); bottom: calc(var(--peek-h) + 14px + var(--safe-b)); display: inline-flex; align-items: center; gap: 6px; padding: 0 22px; height: 50px; border-radius: 999px; border: 0; background: var(--c-high); color: #fff; font-weight: 750; font-size: 1.02rem; box-shadow: 0 8px 22px rgba(220, 38, 38, .35), var(--shadow); cursor: pointer; }
@media (prefers-color-scheme: dark) { .fab { background: #dc2626; } }
.fab .ico { width: 22px; height: 22px; }
body[data-sheet="full"] .fab, body[data-sheet="half"] .fab { opacity: 0; pointer-events: none; }
body.picking .fab, body.picking .sheet, body.picking .search, body.picking .map-ctrls, body.picking .radar-chip, body.picking .layers-pop { display: none; }

/* map picker */
.picker { position: absolute; inset: 0; z-index: 950; pointer-events: none; }
.picker-pin { position: absolute; left: 50%; top: 50%; width: 36px; height: 48px; margin: -48px 0 0 -18px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 48'%3E%3Cpath d='M18 47S34 30 34 17A16 16 0 0 0 2 17c0 13 16 30 16 30z' fill='%23dc2626' stroke='%23fff' stroke-width='2.5'/%3E%3Ccircle cx='18' cy='17' r='6' fill='%23fff'/%3E%3C/svg%3E"); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.picker-pin::after { content: ''; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: rgba(0, 0, 0, .3); }
.picker-bar { position: absolute; left: 10px; right: 10px; bottom: calc(14px + var(--safe-b)); margin: 0 auto; max-width: 520px; pointer-events: auto; background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }
.picker-bar p { margin: 0 0 10px; font-weight: 600; }
.picker-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* markers */
.rm-wrap { background: none; border: 0; }
.rm { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); position: relative; transition: transform .15s; }
.rm .ico { width: 18px; height: 18px; }
.rm:hover { transform: scale(1.12); }
.rm.sev-info { background: var(--c-info); } .rm.sev-low { background: #0284c7; } .rm.sev-moderate { background: #d97706; } .rm.sev-high { background: #dc2626; } .rm.sev-critical { background: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, .35), 0 2px 6px rgba(0, 0, 0, .35); }
.rm.receded { background: var(--bg); color: #475569; border-color: #64748b; border-style: solid; }
.rm.sample { border-style: dashed; }
.rm-badge { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; font-size: 9.5px; font-weight: 800; padding: 1px 4px; border-radius: 6px; white-space: nowrap; line-height: 1.3; }
.mm { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: #7c3aed; color: #fff; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.mm .ico { width: 17px; height: 17px; } .mm.ended { opacity: .45; } .mm.sample { border-style: dashed; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .25); }

/* popups */
.leaflet-popup-content { margin: 12px 14px; font-size: .9rem; line-height: 1.4; }
.leaflet-popup-content-wrapper { border-radius: 14px; }
.pop h3 { font-size: 1.02rem; margin: 2px 0 4px; }
.pop p { margin: 4px 0; }
.pop-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 5px; padding-right: 18px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--fg2); }
.pop-kicker.sev-critical { color: var(--c-critical); } .pop-kicker.sev-high { color: var(--c-high); } .pop-kicker.sev-moderate { color: var(--c-moderate); } .pop-kicker.sev-low { color: var(--c-low); } .pop-kicker.sev-info { color: var(--c-info); }
.pop-src { display: inline-flex; gap: 4px; align-items: center; font-size: .8rem; }
.pop-photo { width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; margin: 6px 0; display: block; }
.note-q { font-style: italic; }
.rec-line { color: var(--fg2); font-weight: 600; display: flex; gap: 5px; align-items: center; }
.vote-row { display: flex; gap: 6px; margin: 8px 0 4px; } .vote-row .btn { flex: 1; justify-content: center; }
.pop-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 6px; }
.pop-foot .btn { padding: 4px 8px; font-size: .78rem; }

/* ---------- bottom sheet ---------- */
.sheet {
  position: absolute; z-index: 870; left: 0; right: 0; bottom: 0; background: var(--bg); border-radius: 18px 18px 0 0; box-shadow: 0 -6px 24px rgba(15, 26, 36, .18);
  display: flex; flex-direction: column; transition: height .25s ease; padding-bottom: var(--safe-b);
}
.sheet[data-state="peek"] { height: calc(var(--peek-h) + var(--safe-b)); }
.sheet[data-state="half"] { height: 52%; }
.sheet[data-state="full"] { height: calc(100% - 8px); }
.sheet-grab { height: 22px; display: grid; place-items: center; cursor: grab; touch-action: none; flex: none; }
.sheet-grab span { width: 42px; height: 5px; border-radius: 3px; background: var(--line); }
.tabs { display: flex; gap: 2px; padding: 0 8px 6px; flex: none; border-bottom: 1px solid var(--line); }
.tab { flex: 1 1 auto; border: 0; background: none; padding: 8px 4px; border-radius: 10px; font-weight: 650; font-size: .92rem; color: var(--fg2); cursor: pointer; position: relative; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
.tab.on { background: var(--bg2); color: var(--fg); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; flex: none; border-radius: 9px; background: var(--bg3); color: var(--fg); font-size: .72rem; line-height: 18px; text-align: center; }
.badge.hot { background: var(--c-high); color: #fff; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px 24px; -webkit-overflow-scrolling: touch; }
.sheet[data-state="peek"] .sheet-body { overflow: hidden; }

@media (min-width: 900px) {
  :root { --peek-h: 0px; }
  .sheet, .sheet[data-state] { top: 0; bottom: 0; left: 0; right: auto; width: 400px; height: auto; border-radius: 0; box-shadow: none; border-right: 1px solid var(--line); }
  .sheet-grab { display: none; }
  .tabs { padding-top: 8px; }
  .timebar { padding-top: 12px; }
  .sheet[data-state="peek"] .sheet-body { overflow-y: auto; }
  #map { left: 400px; }
  .search { left: 412px; }
  .fab { left: calc(400px + (100% - 400px) / 2); bottom: 22px; }
  body[data-sheet] .fab { opacity: 1; pointer-events: auto; }
  .radar-chip { left: 412px; bottom: 22px; }
  .leaflet-bottom.leaflet-right { bottom: 0; }
  .picker { left: 400px; }
  body.picking .sheet { display: flex; }
}

/* ---------- cards & lists ---------- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.card-h .ico { color: var(--fg2); }
.card-safety { border-color: color-mix(in srgb, var(--c-high) 45%, var(--line)); background: color-mix(in srgb, var(--red-bg) 55%, var(--bg)); }
.card-safety .ico { color: var(--c-high); }
.big { font-size: 1rem; }
.ok-line { display: flex; gap: 6px; align-items: center; color: var(--green-fg); }
@media (prefers-color-scheme: light) { .ok-line { color: #166534; } }
.err { color: var(--c-high); }
.note { background: var(--amber-bg); color: var(--amber-fg); padding: 6px 8px; border-radius: 8px; font-size: .85rem; }
.banner { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; font-weight: 600; font-size: .9rem; }
.banner.red { background: var(--red-bg); color: var(--red-fg); }
.alert { border-left: 4px solid var(--c-low); padding: 6px 10px; margin: 6px 0; background: var(--bg2); border-radius: 0 10px 10px 0; }
.alert.lvl-urgent { border-color: var(--c-high); } .alert.lvl-advisory { border-color: var(--c-moderate); }
.alert summary { cursor: pointer; } .alert .instr { font-weight: 600; }
.skel span { display: block; height: 14px; margin: 8px 0; border-radius: 6px; background: linear-gradient(90deg, var(--bg2), var(--bg3), var(--bg2)); background-size: 200% 100%; animation: sk 1.2s infinite; }
.skel span:nth-child(2n) { width: 70%; }
@keyframes sk { to { background-position: -200% 0; } }

.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; height: 92px; align-items: end; margin: 6px 0 2px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.bar-fill { width: 100%; border-radius: 4px 4px 2px 2px; background: var(--c-low); opacity: .45; min-height: 3px; max-height: 64px; }
.bar.mid .bar-fill { opacity: .75; } .bar.hi .bar-fill { opacity: 1; background: #0369a1; }
@media (prefers-color-scheme: dark) { .bar.hi .bar-fill { background: #38bdf8; } }
.bar-v { font-size: .66rem; color: var(--fg2); margin-bottom: 2px; }
.bar-x { position: absolute; bottom: -16px; font-size: .66rem; color: var(--fg3); white-space: nowrap; }
.bars + p { margin-top: 18px; }

.tide-row { display: flex; gap: 14px; align-items: center; }
.tide-big { display: flex; align-items: baseline; gap: 3px; } .tide-big .num { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; } .tide-big .unit { color: var(--fg2); font-weight: 600; }
.tide-big.mid .num { color: var(--c-moderate); } .tide-big.hi .num { color: var(--c-high); }
.tide-meta { font-size: .87rem; } .warn { color: var(--c-high); }
.spark { width: 100%; height: 70px; margin-top: 6px; overflow: visible; }
.spark-pred { fill: none; stroke: var(--fg3); stroke-width: 1.5; stroke-dasharray: 4 3; }
.spark-obs { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.spark-6 { stroke: var(--c-moderate); stroke-width: 1; stroke-dasharray: 2 3; } .spark-lbl { fill: var(--c-moderate); font-size: 9px; }
.spark-now { stroke: var(--fg2); stroke-width: 1; }
.spark-key { font-size: .75rem; color: var(--fg2); display: flex; gap: 6px; align-items: center; }
.spark-key .k { width: 16px; height: 0; border-top: 2.5px solid var(--accent); display: inline-block; } .spark-key .k.pred { border-top: 1.5px dashed var(--fg3); margin-left: 8px; }

.nb-list, .r-list, .m-list, .n-list, .thread { list-style: none; margin: 0; padding: 0; }
.nb-row { display: grid; grid-template-columns: 12px 1fr auto; grid-template-areas: "d n a" "d w w"; gap: 0 8px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 2px; cursor: pointer; }
.nb-row .dot { grid-area: d; margin-top: 5px; } .nb-name { grid-area: n; font-weight: 650; } .nb-what { grid-area: w; font-size: .85rem; color: var(--fg2); } .nb-age { grid-area: a; font-size: .8rem; color: var(--fg3); }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; background: var(--fg3); }
.dot.sev-info { background: #fff; border: 2px solid #64748b; } .dot-311 { background: #475569; } .dot.sev-low { background: var(--c-low); } .dot.sev-moderate { background: var(--c-moderate); } .dot.sev-high { background: var(--c-high); } .dot.sev-critical { background: var(--c-critical); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { background: var(--bg2); border-radius: 999px; padding: 3px 9px; font-size: .8rem; }

.tab-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 6px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--bg2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 8px; font-weight: 600; font-size: .85rem; cursor: pointer; color: var(--fg2); }
.seg button.on { background: var(--bg); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.r-row, .m-row { display: flex; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 2px; cursor: pointer; align-items: flex-start; }
.r-row:hover, .m-row:hover, .nb-row:hover { background: var(--bg2); }
.r-ico, .m-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; background: var(--fg3); }
.r-ico .ico, .m-ico .ico { width: 18px; height: 18px; }
.r-ico.sev-info { background: #64748b; } .r-ico.sev-low { background: #0284c7; } .r-ico.sev-moderate { background: #d97706; } .r-ico.sev-high { background: #dc2626; } .r-ico.sev-critical { background: #7c3aed; }
.m-ico { background: #7c3aed; border-radius: 9px; }
.r-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.r-title { font-weight: 650; } .r-where { font-size: .84rem; color: var(--fg2); } .r-note { font-size: .84rem; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.r-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.r-age { font-size: .8rem; color: var(--fg3); white-space: nowrap; } .r-conf { font-size: .75rem; color: var(--green-fg); font-weight: 650; } .r-conf.rec { color: var(--c-info); }
.m-row.ended { opacity: .55; }
.tag { display: inline-block; font-size: .66rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; padding: 1px 5px; border-radius: 5px; background: var(--amber-bg); color: var(--amber-fg); vertical-align: 1px; }
.empty { text-align: center; padding: 24px 10px; color: var(--fg2); } .empty .ico { width: 34px; height: 34px; color: var(--fg3); }

.notice { border-left: 4px solid var(--c-low); background: var(--bg2); border-radius: 0 12px 12px 0; padding: 8px 12px; margin-bottom: 8px; }
.notice.lvl-urgent { border-color: var(--c-high); } .notice.lvl-advisory { border-color: var(--c-moderate); }
.n-src { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--fg2); }

.m-detail h2 { font-size: 1.2rem; margin: 4px 0; }
.back { margin-bottom: 6px; }
.guide { background: var(--bg2); border-radius: 12px; padding: 8px 12px; margin: 10px 0; }
.guide summary { cursor: pointer; font-weight: 650; display: flex; gap: 6px; align-items: center; }
.guide ol { margin: 6px 0 2px; padding-left: 20px; font-size: .88rem; } .guide li { margin: 4px 0; }
.thread-h { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.thread { max-height: 300px; overflow-y: auto; margin: 8px 0; }
.msg { background: var(--bg2); border-radius: 12px; padding: 6px 10px; margin: 6px 30px 6px 0; display: flex; flex-direction: column; }
.msg.mine { margin: 6px 0 6px 30px; background: var(--blue-bg); }
.msg-who { font-weight: 700; font-size: .8rem; } .msg-t { font-size: .72rem; color: var(--fg3); }
.msg-form { display: flex; gap: 8px; align-items: flex-end; } .msg-form textarea { flex: 1; }
.join-form input { flex: 1; min-width: 140px; }

details.about, details.mod { margin: 14px 2px; font-size: .9rem; } details summary { cursor: pointer; font-weight: 600; }
.src-list { padding-left: 18px; margin: 6px 0; } .src-list li { margin: 3px 0; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: var(--accent); color: var(--accent-fg); border-radius: 10px; padding: 9px 14px; font-weight: 650; cursor: pointer; text-decoration: none; }
.btn.sm { padding: 6px 11px; font-size: .86rem; min-height: 40px; }
.vote-row .btn { min-height: 44px; }
.btn.ghost { background: var(--bg); color: var(--fg); border-color: var(--line); }
.btn.ghost.on, .btn.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.primary { background: var(--c-high); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.link.danger, .danger { color: var(--c-high); }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .88rem; margin: 10px 0; flex: 1; }
.form .row label { min-width: 130px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 10px; font-weight: 400; min-height: 42px; width: 100%; }
textarea { resize: vertical; }
.check { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 600; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--c-high); flex: none; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; padding: 8px 12px; }
legend { font-weight: 700; padding: 0 4px; }

/* ---------- dialogs ---------- */
.dlg { border: 0; padding: 0; border-radius: 18px; width: min(560px, calc(100vw - 20px)); max-height: calc(100dvh - 30px); background: var(--bg); color: var(--fg); box-shadow: var(--shadow); }
.dlg::backdrop { background: rgba(10, 20, 30, .45); }
.dlg[open] { display: flex; flex-direction: column; }
@media (max-width: 600px) { .dlg { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; } }
.dlg-h { display: flex; align-items: center; gap: 6px; padding: 12px 10px 8px 16px; border-bottom: 1px solid var(--line); flex: none; }
.dlg-h h2 { flex: 1; display: flex; gap: 8px; align-items: center; font-size: 1.1rem; }
.dlg-b { padding: 10px 16px 16px; overflow-y: auto; flex: 1; }
.dlg-f { padding: 10px 0 0; display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: -16px; background: var(--bg); padding-bottom: 12px; }
.dlg > .dlg-f { padding: 10px 16px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); }
.kind-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 420px) { .kind-grid { grid-template-columns: 1fr; } }
.kind-btn { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; cursor: pointer; min-height: 60px; }
.kind-btn:hover, .kind-btn:focus-visible { border-color: var(--accent); background: var(--bg2); }
.kind-btn span span { display: block; }
.depth-list { display: grid; gap: 8px; }
.depth-btn { display: flex; gap: 12px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; cursor: pointer; text-align: left; min-height: 54px; }
.depth-btn:hover, .depth-btn:focus-visible { border-color: var(--accent); background: var(--bg2); }
.depth-vis { width: 30px; height: 38px; border: 2px solid var(--fg3); border-radius: 4px 4px 6px 6px; display: flex; align-items: flex-end; overflow: hidden; flex: none; }
.depth-vis span { display: block; width: 100%; background: #0284c7; }
.d1 .depth-vis span, .d2 .depth-vis span { background: #d97706; } .d3 .depth-vis span { background: #dc2626; } .d4 .depth-vis span { background: #7c3aed; }
.loc-box p { margin: 2px 0 8px; }
.photo-box { margin: 10px 0; } .photo-prev { display: block; max-width: 100%; max-height: 160px; border-radius: 10px; margin-bottom: 6px; }
.file-btn { flex-direction: row !important; margin: 0 !important; display: inline-flex !important; }
.mk-grid { display: grid; gap: 6px; }
.mk { flex-direction: row !important; align-items: flex-start; gap: 10px !important; padding: 8px; border: 1px solid var(--line); border-radius: 10px; margin: 0 !important; font-weight: 400 !important; cursor: pointer; }
.mk input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.mk span span { display: block; }
.mk:has(input:checked) { border-color: var(--accent); background: var(--bg2); }
.call-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.call { background: var(--bg2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.call strong { font-size: 1.6rem; } .call.red { background: var(--red-bg); color: var(--red-fg); }
.safety-list { padding-left: 18px; } .safety-list li { margin: 7px 0; }
.digest { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }

/* toast */
.toast { position: fixed; z-index: 2000; left: 50%; top: calc(var(--header-h) + var(--safe-t) + 12px); transform: translate(-50%, -20px); opacity: 0; pointer-events: none; background: #111827; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; max-width: calc(100vw - 30px); box-shadow: var(--shadow); transition: all .2s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #991b1b; } .toast.ok { background: #166534; }

.safe-first { background: var(--bg2); border-radius: 12px; padding: 10px 12px; margin: 4px 0 10px !important; }
.ok-line .ico { color: var(--c-ok); }

/* Dark mode without a CARTO key: dim OpenStreetMap tiles instead of a bright map at night */
@media (prefers-color-scheme: dark) { .osm-dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); } }

/* ---------- incidents ---------- */
.rm-count { position: absolute; top: -7px; right: -8px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #111827; color: #fff; font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center; border: 1.5px solid #fff; }
.r-ico { position: relative; }
.r-count { position: absolute; top: -5px; right: -7px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: #111827; color: #fff; font-size: 9.5px; font-weight: 800; line-height: 16px; text-align: center; border: 1.5px solid var(--bg); }
.ctx { list-style: none; padding: 0; margin: 6px 0; font-size: .82rem; color: var(--fg2); }
.ctx li { display: flex; gap: 6px; align-items: flex-start; margin: 3px 0; }
.ctx .ico { margin-top: 1px; color: var(--c-low); }
.tl { list-style: none; padding: 0; margin: 8px 0; border-left: 2px solid var(--line); }
.tl-item { position: relative; padding: 4px 0 12px 16px; display: grid; grid-template-columns: 62px 1fr; gap: 8px; }
.tl-item::before { content: ''; position: absolute; left: -7px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--fg3); border: 2px solid var(--bg); }
.tl-item.sev-critical::before { background: #7c3aed; } .tl-item.sev-high::before { background: #dc2626; } .tl-item.sev-moderate::before { background: #d97706; } .tl-item.sev-low::before { background: #0284c7; } .tl-item.sev-info::before { background: #fff; border-color: #64748b; }
.tl-time { font-size: .8rem; color: var(--fg2); font-variant-numeric: tabular-nums; padding-top: 2px; }
.tl-body p { margin: 3px 0; }
.tl-actions { margin-top: 4px; } .tl-actions .btn.sm { min-height: 36px; padding: 4px 9px; font-size: .8rem; }

/* ---------- time slider ---------- */
.timebar { display: flex; align-items: center; gap: 10px; padding: 0 12px 8px; flex: none; }
.time-live { border: 0; border-radius: 999px; padding: 4px 10px; min-height: 30px; font-size: .74rem; font-weight: 800; letter-spacing: .05em; background: var(--bg2); color: var(--fg2); cursor: pointer; white-space: nowrap; }
.time-live.on { background: var(--c-high); color: #fff; }
.time-live.on::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #fff; margin-right: 6px; vertical-align: 1px; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .time-live.on::before { animation: none; } }
.timebar.past .time-live { background: var(--accent); color: var(--accent-fg); }
.time-range { flex: 1; min-width: 0; accent-color: var(--accent); height: 28px; }
.time-label { font-size: .8rem; font-weight: 650; color: var(--fg2); white-space: nowrap; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.timebar.past .time-label { color: var(--accent); }
.status.lvl-past { background: var(--blue-bg); color: var(--blue-fg); } .lvl-past .status-dot { background: var(--accent); }
body.past-view .fab { filter: grayscale(.6); opacity: .85; }
body.past-view #map { box-shadow: inset 0 0 0 3px var(--accent); }
.radar-chip:has(#radar-play[hidden]) { padding: 7px 12px; }

/* =====================================================================
   Floating layout: the map fills the whole screen and every control
   floats above it as a rounded, slightly translucent card.
   ===================================================================== */
:root { --glass: color-mix(in srgb, var(--bg) 86%, transparent); --float-gap: 10px; --float-r: 16px; --top-h: 48px; }
.glass { background: var(--glass); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { :root { --glass: var(--bg); } }

/* map underneath everything */
#main, body:has(#ribbon:not([hidden])) #main { inset: 0; top: 0; }

/* top bar: transparent row of floating pills */
#topbar { inset: calc(var(--float-gap) + var(--safe-t)) var(--float-gap) auto var(--float-gap); height: var(--top-h); padding: 0; background: none; border: 0; pointer-events: none; gap: 8px; }
#topbar > * { pointer-events: auto; }
.brand { height: var(--top-h); padding: 0 14px 0 9px; border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.status { height: var(--top-h); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.status.lvl-loading, .status.lvl-unknown { background: var(--glass); }
.status.lvl-red { background: color-mix(in srgb, var(--red-bg) 92%, transparent); }
.status.lvl-amber { background: color-mix(in srgb, var(--amber-bg) 92%, transparent); }
.status.lvl-blue, .status.lvl-past { background: color-mix(in srgb, var(--blue-bg) 92%, transparent); }
.status.lvl-green { background: color-mix(in srgb, var(--green-bg) 92%, transparent); }
.top-actions .chip { height: var(--top-h); min-width: var(--top-h); padding: 0 14px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow); border-color: transparent; }

/* demo/preview note: a small floating pill instead of a full-width band */
.ribbon { top: auto; left: 50%; right: auto; bottom: calc(var(--float-gap) + var(--safe-b)); transform: translateX(-50%); width: max-content; max-width: min(92vw, 640px); height: auto; padding: 5px 12px; border: 0; border-radius: 999px; box-shadow: var(--shadow); font-size: .75rem; z-index: 880; }

/* search + map controls float under the top bar */
.search { top: calc(var(--top-h) + var(--float-gap) * 2 + var(--safe-t)); }
.map-ctrls { top: calc(var(--top-h) + var(--float-gap) * 2 + var(--safe-t)); right: var(--float-gap); gap: 0; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: var(--float-r); box-shadow: var(--shadow); padding: 4px; }
.map-ctrls .ctrl { border: 0; box-shadow: none; background: transparent; border-radius: 12px; }
.map-ctrls .ctrl:hover { background: var(--bg2); }
#search input { background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-color: transparent; border-radius: var(--float-r); height: 46px; }
.layers-pop { top: calc(var(--top-h) + var(--float-gap) * 2 + var(--safe-t)); right: 78px; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 0; border-radius: var(--float-r); }
.radar-chip { background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 0; }
.toast { top: calc(var(--top-h) + var(--float-gap) * 2 + var(--safe-t)); }

/* ---------- phones: floating pills on top, sheet floats at the bottom ---------- */
@media (max-width: 899px) {
  :root { --top-h: 44px; --float-gap: 8px; }
  .brand { padding: 0 6px; }
  .top-actions .chip { padding: 0 10px; }
  #btn-lang { font-size: .78rem; }
  .sheet { left: 6px; right: 6px; bottom: calc(6px + var(--safe-b)); border-radius: 20px; background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 8px 30px rgba(15, 26, 36, .28); padding-bottom: 0; }
  .sheet[data-state="peek"] { height: var(--peek-h); }
  .sheet[data-state="full"] { height: calc(100% - var(--top-h) - var(--float-gap) * 2 - 6px - var(--safe-t) - var(--safe-b)); }
  .ribbon { bottom: auto; top: calc(var(--top-h) + var(--float-gap) * 2 + 52px + var(--safe-t)); left: var(--float-gap); transform: none; max-width: calc(100vw - 90px); }
  .fab { bottom: calc(var(--peek-h) + 18px + var(--safe-b)); }
  .radar-chip { bottom: calc(var(--peek-h) + 18px + var(--safe-b)); }
  .leaflet-bottom.leaflet-right { bottom: calc(var(--peek-h) + 12px + var(--safe-b)); }
  .search { right: 84px; }
}

/* ---------- desktop: floating side panel that can be tucked away ---------- */
@media (min-width: 900px) {
  :root { --panel-w: 390px; --panel-top: calc(var(--top-h) + var(--float-gap) * 2 + var(--safe-t)); }
  #map { left: 0; }
  .sheet, .sheet[data-state] {
    top: var(--panel-top); bottom: var(--float-gap); left: var(--float-gap); width: var(--panel-w);
    border: 0; border-radius: 20px; background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
    box-shadow: 0 10px 34px rgba(15, 26, 36, .22), 0 1px 3px rgba(15, 26, 36, .1); overflow: hidden;
    transition: transform .28s ease, opacity .2s ease;
  }
  body.panel-hidden .sheet { transform: translateX(calc(-100% - 2 * var(--float-gap))); opacity: 0; pointer-events: none; }
  .search { left: calc(var(--panel-w) + var(--float-gap) * 2); right: auto; width: min(380px, calc(100vw - var(--panel-w) - 120px)); }
  body.panel-hidden .search { left: calc(var(--float-gap) + 52px); }
  .fab { left: calc(var(--panel-w) + var(--float-gap) + (100% - var(--panel-w) - var(--float-gap)) / 2); bottom: 48px; }
  body.panel-hidden .fab { left: 50%; }
  .radar-chip { left: calc(var(--panel-w) + var(--float-gap) * 2); bottom: var(--float-gap); }
  body.panel-hidden .radar-chip { left: var(--float-gap); }
  .ribbon { left: calc(var(--panel-w) + var(--float-gap) + (100% - var(--panel-w) - var(--float-gap)) / 2); }
  body.panel-hidden .ribbon { left: 50%; }
  .picker { left: 0; }
  .leaflet-bottom.leaflet-right { bottom: 0; }
  .leaflet-control-zoom { margin-right: var(--float-gap) !important; margin-bottom: 28px !important; border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 12px !important; overflow: hidden; }
  .panel-toggle { display: grid; }
  body.panel-hidden .panel-toggle { left: var(--float-gap); }
}
.panel-toggle {
  display: none; position: absolute; z-index: 875; top: var(--panel-top, 70px); left: calc(var(--panel-w, 390px) + var(--float-gap) * 2 - 2px);
  width: 44px; height: 46px; place-items: center; border: 0; border-radius: var(--float-r); cursor: pointer; color: var(--fg);
  background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow); transition: left .28s ease;
}
.panel-toggle .ico { width: 20px; height: 20px; transition: transform .28s ease; }
body.panel-hidden .panel-toggle .ico { transform: rotate(180deg); }
@media (min-width: 900px) { .search { left: calc(var(--panel-w) + var(--float-gap) * 2 + 52px); } }

/* cards inside the floating panel sit on glass, so give them a solid-ish surface */
.sheet .card, .sheet .notice, .sheet .alert { background: color-mix(in srgb, var(--bg) 70%, transparent); }
.tabs { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
@media (min-width: 900px) { .panel-toggle { display: grid; } }
body[data-sheet="full"] .ribbon, body.picking .ribbon { display: none; }
.search-ico { z-index: 2; pointer-events: none; }

/* official layers + cards */
.om { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: #facc15; color: #422006; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.om .ico { width: 14px; height: 14px; }
.sb { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #92400e; color: #fff; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.sb .ico { width: 17px; height: 17px; }
.sw-fz { background: rgba(59,130,246,.35); border: 1px solid #1d4ed8; }
.sw-out { background: #facc15; border: 1px dashed #a16207; }
.sw-clo { background: repeating-linear-gradient(90deg, #b91c1c 0 5px, transparent 5px 9px); height: 4px; margin-top: 8px; border-radius: 0; }
.sw-sb { background: #92400e; }
.card-official { border-left: 4px solid var(--accent); }
.card-official .card-h .ico { color: var(--accent); }
.dem-text { margin: 4px 0; }
.notice.official { border-left-color: var(--accent); }
.notice.official .n-src { display: flex; gap: 5px; align-items: center; }

/* radar key: light -> heavy using the radar's own colors */
.radar-key { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: 600; color: var(--fg2); margin-left: 4px; padding-left: 8px; border-left: 1px solid var(--line); }
.radar-key i { display: inline-block; width: 46px; height: 7px; border-radius: 4px; background: linear-gradient(90deg, rgba(2,253,2,.35), #01c501, #fdf802, #fd9500, #fd0000); }

/* ---- Quick report (camera first) ---- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dlg-quick .form.quick { display: flex; flex-direction: column; gap: 12px; }
.qphoto img { display: block; width: 100%; max-height: 24vh; object-fit: cover; border-radius: 12px; background: var(--bg2); }
.qphoto-actions { display: flex; gap: 8px; margin-top: 6px; }
.qphoto-empty { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 12px; border: 2px dashed var(--line); border-radius: 12px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.qphoto-empty svg { width: 30px; height: 30px; }
.qphoto-empty span { font-weight: 600; }
.qphoto-empty small { opacity: .65; }
.qloc { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.qloc > svg { width: 18px; height: 18px; flex: none; }
.qloc-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qlabel { font-size: 12px; font-weight: 600; opacity: .7; width: 100%; }
.qchip { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: inherit; font: inherit; font-size: 14px; cursor: pointer; }
.qchip svg { width: 16px; height: 16px; }
.qchip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.small-chips .qchip { min-height: 32px; font-size: 13px; padding: 4px 10px; }
.qsafe { display: flex; gap: 6px; align-items: flex-start; margin: 0; }
.qsafe svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.dlg-quick textarea { resize: vertical; }
.qpost { position: sticky; bottom: -16px; margin: 0 -16px -16px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-top: 1px solid var(--line); z-index: 2; }
.qpost .btn.big { width: 100%; min-height: 48px; font-size: 16px; }

/* =====================================================================
   Layout v2: one top bar, a briefing at the top of the panel, and a
   storm timeline (past 12 h + next 12 h) along the bottom of the map.
   ===================================================================== */

/* ---- briefing ---- */
.brief-in { display: flex; flex-direction: column; gap: 8px; }
.brief-h { margin: 0; font-size: 1.06rem; line-height: 1.38; font-weight: 650; letter-spacing: -.005em; }
.brief-d { margin: 0; font-size: .9rem; line-height: 1.45; color: var(--fg2); }
.brief-in.past .brief-h { font-size: .95rem; font-weight: 600; color: var(--blue-fg); }
.brief-in.past .btn { align-self: flex-start; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 2px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 58px; padding: 8px 10px; border: 0; border-radius: 12px; background: var(--bg2); color: var(--fg); text-align: left; cursor: pointer; }
.stat:hover { filter: brightness(.97); }
.stat-v { font-size: 1.3rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-l { font-size: .74rem; color: var(--fg2); line-height: 1.25; }
.stat.tone-red { background: var(--red-bg); } .stat.tone-red .stat-v, .stat.tone-red .stat-l { color: var(--red-fg); }
.stat.tone-amber { background: var(--amber-bg); } .stat.tone-amber .stat-v, .stat.tone-amber .stat-l { color: var(--amber-fg); }
.stat.tone-blue { background: var(--blue-bg); } .stat.tone-blue .stat-v, .stat.tone-blue .stat-l { color: var(--blue-fg); }
.brief { display: none; }
.brief-inline { margin: 2px 2px 12px; }

/* ---- storm timeline ---- */
.dock { display: flex; align-items: center; gap: 12px; flex: none; }
.dock-side { display: flex; align-items: center; gap: 8px; flex: none; }
.dock-when { display: flex; flex-direction: column; min-width: 0; }
.time-label { text-align: left; min-width: 0; font-size: .82rem; }
.time-sub { font-size: .72rem; color: var(--fg3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock.past .time-label { color: var(--accent); }
.dock-replay { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font-size: .8rem; font-weight: 650; cursor: pointer; white-space: nowrap; }
.dock-replay .ico { width: 14px; height: 14px; }
.dock-replay[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.dock-graph { flex: 1; min-width: 0; display: flex; gap: 8px; }
.dock-labels { display: grid; grid-template-rows: var(--trk-rows); flex: none; width: 56px; font-size: .68rem; font-weight: 650; color: var(--fg3); }
.dock-labels span { display: flex; align-items: center; }
.dock-plot { position: relative; flex: 1; min-width: 0; }
.dock-tracks { position: relative; display: grid; grid-template-rows: var(--trk-rows); height: 100%; }
.trk { position: relative; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.trk:last-of-type { border-bottom: 0; }
.trk i { position: absolute; bottom: 2px; border-radius: 3px 3px 1px 1px; }
.trk-axis { border-bottom: 0; }
.tk { position: absolute; top: 0; transform: translateX(-50%); font-size: .66rem; color: var(--fg3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk-now { font-weight: 800; color: var(--fg); }
.tk-fc { left: auto; right: 0; transform: none; font-weight: 650; }
.rb { background: var(--c-high); opacity: .85; }
.rb.sev-critical { background: var(--c-critical); } .rb.sev-moderate { background: var(--c-moderate); } .rb.sev-low, .rb.sev-info { background: var(--c-low); }
.pb { background: var(--accent); }
.pb.lo { opacity: .35; } .pb.mid { opacity: .65; } .pb.hi { opacity: 1; }
.trk-bay svg { position: absolute; inset: 2px 0; width: 100%; height: calc(100% - 4px); overflow: visible; }
.b-obs { fill: none; stroke: #d97706; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.b-pred { fill: none; stroke: var(--fg3); stroke-width: 1.5; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.b-flag { stroke: var(--c-high); stroke-width: 1; stroke-dasharray: 2 4; opacity: .55; vector-effect: non-scaling-stroke; }
.b-hi { position: absolute; transform: translate(-50%, -115%); font-size: .64rem; font-weight: 700; color: var(--amber-fg); background: var(--amber-bg); padding: 0 4px; border-radius: 4px; white-space: nowrap; }
.dock-now { position: absolute; top: 14px; bottom: 0; width: 2px; margin-left: -1px; background: var(--fg); border-radius: 1px; pointer-events: none; }
.dock-future { position: absolute; top: 14px; bottom: 0; right: 0; background: color-mix(in srgb, var(--bg3) 45%, transparent); border-radius: 0 6px 6px 0; pointer-events: none; }
.dock-after { position: absolute; top: 14px; bottom: 0; background: color-mix(in srgb, var(--bg) 55%, transparent); pointer-events: none; }
.dock-view { position: absolute; top: 14px; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; }
@media (prefers-color-scheme: dark) { .b-obs { stroke: #fbbf24; } }

/* the slider covers the past half of the plot; its thumb is a tall handle on the timeline */
#dock .time-range { position: absolute; left: 0; width: 50%; min-height: 0; padding: 0; border: 0; border-radius: 0; top: 12px; bottom: 0; height: auto; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: ew-resize; z-index: 2; }
#dock .time-range::-webkit-slider-runnable-track { height: 100%; background: transparent; }
#dock .time-range::-moz-range-track { height: 100%; background: transparent; }
#dock .time-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 100%; border-radius: 6px; background: color-mix(in srgb, var(--accent) 22%, transparent); border: 2px solid var(--accent); box-sizing: border-box; }
#dock .time-range::-moz-range-thumb { width: 12px; height: 100%; border-radius: 6px; background: color-mix(in srgb, var(--accent) 22%, transparent); border: 2px solid var(--accent); }
#dock .time-range:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---- phones: compact timeline in the panel, briefing at the top of Now ---- */
@media (max-width: 899px) {
  .dock { --trk-rows: 0px 15px 15px 0px; padding: 0 12px 8px; gap: 10px; }
  .dock-side { gap: 8px; }
  .dock-when { width: 76px; }
  .time-sub, .dock-replay, .dock-labels, .tk { display: none; }
  .trk-axis, .trk-bay { visibility: hidden; overflow: hidden; border: 0; }
  .dock-plot { height: 34px; }
  .dock-tracks { height: 30px; margin-top: 2px; }
  .dock-now, .dock-future, .dock-after, .dock-view, #dock .time-range { top: 0; }
  #dock .time-range { top: -4px; bottom: -4px; }
  body[data-sheet="full"] #topbar .search, body[data-sheet="full"] #topbar .map-ctrls { display: none; }
  /* search + map buttons live in the header now but keep their floating spots on phones */
  #topbar .search { position: fixed; top: calc(var(--top-h) + var(--float-gap) * 2 + var(--safe-t)); left: var(--float-gap); right: 84px; max-width: 420px; }
  #topbar .map-ctrls { position: fixed; top: calc(var(--top-h) + var(--float-gap) * 2 + var(--safe-t)); right: var(--float-gap); }
}

/* ---- desktop: one bar across the top, timeline floating along the bottom ---- */
@media (min-width: 900px) {
  :root { --top-h: 60px; --dock-h: 128px; --trk-rows: 14px 24px 26px 1fr; }
  #topbar {
    height: var(--top-h); padding: 0 10px 0 12px; gap: 10px; pointer-events: auto; border-radius: 18px;
    background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
    box-shadow: 0 8px 28px rgba(15, 26, 36, .18), 0 1px 3px rgba(15, 26, 36, .1);
  }
  #topbar .brand { height: auto; padding: 0 4px 0 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  #topbar .status { height: 40px; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; flex: 1 1 auto; }
  #topbar .status.lvl-loading, #topbar .status.lvl-unknown { background: var(--bg2); }
  #topbar .search { position: relative; inset: auto; flex: 0 1 300px; min-width: 170px; width: auto; max-width: none; }
  #topbar #search input { height: 40px; border-radius: 12px; background: var(--bg2); border: 1px solid transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  #topbar #search input:focus { background: var(--bg); border-color: var(--line); }
  #topbar .search-ico { top: 10px; }
  #topbar .search-results { position: absolute; left: 0; right: 0; top: 46px; margin: 0; }
  #topbar .map-ctrls { position: static; flex-direction: row; gap: 4px; padding: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; flex: none; }
  #topbar .map-ctrls .ctrl { flex-direction: row; width: auto; height: 40px; padding: 0 11px; gap: 6px; font-size: .85rem; color: var(--fg); border-radius: 12px; }
  #topbar .map-ctrls .ctrl .ico { width: 18px; height: 18px; }
  #topbar .top-actions .chip { height: 40px; min-width: 40px; padding: 0 12px; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: transparent; }
  #topbar .top-actions .chip:hover, #topbar .map-ctrls .ctrl:hover { background: var(--bg2); }
  #topbar .top-actions { gap: 2px; padding-left: 6px; border-left: 1px solid var(--line); }
  .layers-pop { right: var(--float-gap); }

  .brief { display: block; padding: 16px 16px 12px; flex: none; }
  .brief-inline { display: none; }
  .tabs { padding-top: 0; }

  .dock {
    position: absolute; z-index: 860; left: calc(var(--panel-w) + var(--float-gap) * 2); right: var(--float-gap); bottom: var(--float-gap);
    height: var(--dock-h); padding: 10px 14px 10px 12px; gap: 14px; align-items: stretch; border-radius: 18px;
    background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
    box-shadow: 0 8px 28px rgba(15, 26, 36, .18), 0 1px 3px rgba(15, 26, 36, .1); transition: left .28s ease;
  }
  body.panel-hidden .dock { left: var(--float-gap); }
  .dock-side { flex-direction: column; align-items: flex-start; justify-content: space-between; width: 168px; gap: 6px; }
  .dock-when { gap: 1px; }
  .time-label { font-size: 1.02rem; font-weight: 750; color: var(--fg); }
  .time-sub { white-space: normal; line-height: 1.3; }
  .dock-graph { padding-left: 12px; border-left: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
  body.picking .dock { display: none; }

  .fab { bottom: calc(var(--dock-h) + var(--float-gap) + 44px); }
  .ribbon { bottom: calc(var(--dock-h) + var(--float-gap) * 2); }
  .radar-chip { bottom: calc(var(--dock-h) + var(--float-gap) * 2); }
  .leaflet-bottom.leaflet-right { bottom: calc(var(--dock-h) + var(--float-gap)); }
  .leaflet-control-zoom { margin-bottom: 8px !important; }
}
@media (min-width: 900px) and (max-width: 1240px) {
  #topbar .brand-name, #topbar .map-ctrls .ctrl span, #topbar .chip-safety span { display: none; }
  #topbar .map-ctrls .ctrl { padding: 0 10px; }
  #topbar .search { flex-basis: 220px; }
  .dock-side { width: 132px; }
}
/* the layers menu lives in the top bar too, so nothing in the bar can cover it */
#topbar .layers-pop { position: fixed; z-index: 900; max-height: calc(100dvh - 190px); }
@media (min-width: 900px) {
  #topbar .layers-pop { position: absolute; top: calc(100% + 10px); right: 0; max-height: calc(100dvh - var(--top-h) - var(--dock-h) - 60px); }
}
@media (min-width: 900px) { .ribbon { max-width: min(640px, calc(100vw - var(--panel-w) - 120px)); } body.panel-hidden .ribbon { max-width: min(640px, calc(100vw - 120px)); } }

/* ---- spot comments ---- */
.cm-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.cm { background: var(--bg2); border-radius: 12px; padding: 8px 11px; }
.cm.mine { background: var(--blue-bg); }
.cm-h { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: .82rem; }
.cm-name { font-weight: 700; }
.cm-age { margin-left: auto; color: var(--fg3); font-size: .75rem; white-space: nowrap; }
.cm-body { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-act { display: flex; gap: 12px; margin-top: 2px; }
.cm-act .link { min-height: 32px; }
.cm-form { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.cm-form textarea { resize: vertical; min-height: 64px; }
.cm-foot { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.cm-foot .tiny { line-height: 1.35; }
.cm-foot .btn { flex: none; }
