* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 14px/1.35 -apple-system, system-ui, sans-serif; color: #111; }
body { display: flex; flex-direction: column; }
#banner { background: #b00020; color: #fff; padding: 4px 10px; font-size: 12px; font-weight: 600; text-align: center; }
#banner a { color: #fff; }

#bar { display: flex; align-items: center; gap: 14px; padding: 8px 12px; background: #fff; border-bottom: 1px solid #ddd; flex-wrap: wrap; }
#modes { display: inline-flex; border: 1px solid #bbb; border-radius: 22px; overflow: hidden; }
#modes button { border: 0; background: #fff; padding: 9px 18px; font-size: 15px; font-weight: 600; cursor: pointer; }
#modes button.on { background: #1d3557; color: #fff; }
#when { display: flex; align-items: center; gap: 6px; }
#when button { font-size: 18px; width: 38px; height: 36px; border: 1px solid #bbb; border-radius: 8px; background: #fff; cursor: pointer; }
#date { font-size: 14px; padding: 6px; }
#hour { width: 220px; }
#hourLabel { min-width: 150px; font-weight: 600; }
#customizeBtn { margin-left: auto; font-size: 14px; padding: 8px 14px; border: 1px solid #1d3557; color: #1d3557; background: #fff; border-radius: 8px; cursor: pointer; }
#customizeBtn.on { background: #1d3557; color: #fff; }

#main { flex: 1; position: relative; min-height: 0; display: flex; }
#map { flex: 1; }
.card { position: absolute; background: rgba(255,255,255,.94); border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,.25); padding: 10px 12px; z-index: 2; }
#conditions { top: 12px; left: 12px; min-width: 230px; }
#esacCard { top: 12px; left: 262px; max-width: 280px; }
#legend { bottom: 28px; left: 12px; max-height: calc(100% - 230px); overflow-y: auto; max-width: 300px; }
#conditions .big { font-size: 22px; font-weight: 700; }
#conditions .row { display: flex; align-items: center; gap: 10px; margin: 2px 0; }
#conditions .arrow { display: inline-block; font-size: 26px; line-height: 1; }
#conditions .sub { color: #555; font-size: 12px; }
#legend .item { display: flex; align-items: center; gap: 8px; margin: 3px 0; font-size: 13px; }
#legend .sw { width: 18px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.35); display: inline-block; }
#legend .title { font-weight: 700; margin-bottom: 4px; }
.danger { display: inline-block; padding: 2px 8px; border-radius: 4px; font-weight: 700; }

body.mode-snow .avy-only { display: none !important; }
body.mode-avy .snow-only { display: none !important; }

#drawer { width: 360px; overflow-y: auto; border-left: 1px solid #ccc; padding: 8px 12px; background: #fff; }
#drawer[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; gap: 8px; position: sticky; top: -8px; background: #fff; padding: 6px 0; }
.drawer-head b { flex: 1; }
#drawer h3 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #333; }
#drawer label { display: block; margin: 3px 0; }
#strip { width: 100%; height: 56px; display: block; cursor: pointer; margin-top: 4px; }
.note { color: #666; font-size: 11px; }

.maplibregl-popup-content { font-size: 13px; max-width: 340px; }
.maplibregl-popup-content table td { padding: 1px 6px 1px 0; vertical-align: top; }
.maplibregl-popup-content table td:first-child { color: #666; }
.popup canvas { display: block; margin-top: 6px; }
#legend .seg { display: inline-flex; margin-left: 8px; border: 1px solid #1d3557; border-radius: 12px; overflow: hidden; vertical-align: middle; }
#legend .seg button { border: 0; background: #fff; color: #1d3557; font-size: 11px; padding: 2px 8px; cursor: pointer; }
#legend .seg button.on { background: #1d3557; color: #fff; }
#legend a { display: block; margin-top: 4px; }
