:root {
  --c-powder: #08306b; --c-maybe: #4292c6; --c-no: #c6dbef; --c-na: #e6e6e6;
  --ink: #0b1b33; --muted: #4a5a73; --line: #b9c6da; --bg: #f4f7fb; --accent: #08306b;
  --warn-bg: #fff3cd; --warn-ink: #5c4400;
  --top-h: 0px; --nav-h: 56px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 16px/1.4 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; } .warn { background: var(--warn-bg); color: var(--warn-ink); padding: 6px 10px; border-radius: 8px; }
button { font: inherit; color: inherit; }
a { color: var(--accent); }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
#top { background: var(--accent); color: #fff; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; }
#top h1 { font-size: 19px; margin: 0; letter-spacing: .2px; }
#top .row1 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#top .muted { color: #cfe0f7; }
#day-sel { display: flex; background: rgba(255,255,255,.18); border-radius: 12px; padding: 3px; }
#day-sel button { border: 0; background: transparent; color: #fff; min-height: 44px; padding: 0 16px; border-radius: 10px; font-weight: 600; }
#day-sel button.on { background: #fff; color: var(--accent); }

/* Varsom bar: always visible, compact (never collapsible) */
#varsom-bar { background: #fff; border-bottom: 2px solid var(--accent); padding: 4px 8px 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; z-index: 500; }
#varsom-bar .lbl { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; width: 100%; }
.vchip { display: flex; flex: 1 1 28%; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 8px; min-height: 48px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); text-decoration: none; line-height: 1.15; min-width: 0; }
.vchip .lv { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; font-size: 14px; }
.vchip .vt2 { display: flex; align-items: center; gap: 6px; }
.vchip b { font-size: 12.5px; white-space: nowrap; } .vchip small { font-size: 13px; font-weight: 700; }
.vchip.na { border-style: dashed; font-weight: 600; font-size: 14px; }
.vblock { border: 2px solid var(--ink); border-radius: 10px; padding: 8px 10px; background: #fff; }
.vblock .t { font-weight: 800; }

#views { flex: 1; position: relative; min-height: 0; }
.view { position: absolute; inset: 0; overflow: auto; }
#view-map { overflow: hidden; }
#map { position: absolute; inset: 0; background: #dfe6ee; }
#nav { display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 800; }
#nav button { flex: 1; min-height: var(--nav-h); border: 0; background: #fff; font-weight: 700; font-size: 16px; color: var(--muted); }
#nav button.on { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }

.legend { position: absolute; left: 6px; right: 6px; bottom: 16px; z-index: 600; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 10px; padding: 4px 6px; font-size: 12px; }
.legend .lg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.legend button { border: 0; background: #eef2f8; border-radius: 8px; font-weight: 700; min-width: 44px; min-height: 44px; margin-left: auto; font-size: 18px; }
.legend .it { display: inline-flex; align-items: center; gap: 4px; }
.sw { width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px #6b7a90; flex: none; }
.sw.powder { background: var(--c-powder); } .sw.maybe { background: var(--c-maybe); } .sw.no { background: var(--c-no); }
.sw.na { background: var(--c-na); border: 2px dashed #6b7a90; box-shadow: none; }
.attrib { position: absolute; left: 0; right: 0; bottom: 0; z-index: 550; font-size: 9px; line-height: 1.2; background: rgba(255,255,255,.88); padding: 1px 6px; }

/* markers */
.mk { position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 16px; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.45); }
.mk.powder { background: var(--c-powder); color: #fff; } .mk.maybe { background: var(--c-maybe); color: #fff; } .mk.no { background: var(--c-no); color: var(--c-powder); }
.mk.na { background: var(--c-na); color: #555; border: 3px dashed #6b7a90; box-shadow: none; }
.mk .wind { position: absolute; right: -8px; top: -8px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); display: grid; place-items: center; }
.mk.cl { font-size: 17px; flex-direction: column; line-height: 1; } .mk.cl .cl-s { font-size: 9px; font-weight: 700; margin-top: 1px; }
.mk-label { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--ink); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; pointer-events: none; }
.leaflet-div-icon { background: none; border: 0; }

/* sheet */
#sheet { position: absolute; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); max-height: 64%; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 18px rgba(0,0,0,.3); z-index: 1000; display: flex; flex-direction: column; }
#sheet-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); }
#sheet-head .ttl { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#sheet-head h2 { font-size: 18px; margin: 0; }
#sheet-body { overflow: auto; padding: 10px 12px 16px; }
.xbtn { min-width: 48px; min-height: 48px; border: 0; background: #eef2f8; border-radius: 12px; font-size: 22px; font-weight: 700; }
.back { min-height: 44px; border: 0; background: none; color: var(--accent); font-weight: 700; padding: 0 4px; }
.frow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px; min-height: 56px; margin-bottom: 8px; }
.frow .nm { font-weight: 700; } .frow .sub { font-size: 13px; color: var(--muted); }
.frow .sc { margin-left: auto; text-align: right; font-weight: 800; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1.5px solid var(--ink); background: #fff; }
.cat { font-weight: 800; }
.reason { margin: 6px 0; } .reason li { margin: 3px 0; }
.windnote { background: #eaf2fb; border-left: 5px solid var(--c-powder); padding: 8px 10px; border-radius: 6px; margin: 8px 0; }
.remark { background: #f3f3f3; border-left: 5px solid #777; padding: 8px 10px; border-radius: 6px; margin: 8px 0; font-size: 14px; }
.disc { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.note { border-bottom: 1px solid #e3e9f2; padding: 6px 0; font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.tag { min-height: 44px; padding: 0 14px; border: 2px solid var(--c-powder); border-radius: 12px; background: #fff; font-weight: 700; color: var(--c-powder); }
.tag.on { background: var(--c-powder); color: #fff; }
.btn { min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; }
.btn.alt { background: #fff; color: var(--accent); border: 2px solid var(--accent); }
.btn.danger { background: #fff; color: #8a1c1c; border: 2px solid #8a1c1c; }
input[type=text], textarea { width: 100%; font: inherit; padding: 10px; border: 2px solid var(--line); border-radius: 10px; min-height: 48px; }
.pad { padding: 14px; } .card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.screen { position: fixed; inset: 0; background: var(--bg); padding: 24px 18px; overflow: auto; z-index: 3000; }
.screen h1 { color: var(--accent); }
#modal { position: fixed; inset: 0; background: rgba(8,20,45,.6); z-index: 4000; display: flex; align-items: flex-end; justify-content: center; }
#modal .box { background: #fff; border-radius: 16px 16px 0 0; padding: 18px; max-height: 90%; overflow: auto; width: 100%; max-width: 560px; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #0b1b33; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 5000; pointer-events: none; max-width: 90%; }
.grp { font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.demo-banner { background: #ffe0e0; color: #6b0000; padding: 6px 10px; font-weight: 700; text-align: center; }
footer.src { font-size: 12px; color: var(--muted); padding: 10px 14px 24px; }
@media (min-width: 700px) { #sheet { left: auto; width: 440px; right: 12px; border-radius: 16px; bottom: calc(var(--nav-h) + 12px); } }
