:root {
  --bg: #0f1412; --panel: #171e1b; --panel2: #1f2924; --line: #2b3732;
  --ink: #e6ebe8; --muted: #93a29c; --accent: #f0a63c;
  --green: #3fbf6f; --amber: #e8b339; --red: #d95a4e; --grey: #5c6b66;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "SF Pro Text", Roboto, "Segoe UI", sans-serif; font-size: 14px; overflow: hidden; }
#map { position: absolute; inset: 0; background: #0f1412; }
.leaflet-tile { filter: brightness(.72) contrast(1.1) saturate(.7); }
.leaflet-control-attribution { background: rgba(15,20,18,.7) !important; color: var(--muted) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-control-zoom { display: none; }

#topbar { position: absolute; top: calc(env(safe-area-inset-top) + 10px); left: 10px; right: 10px; z-index: 900;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
#topbar > * { pointer-events: auto; }
.seg { display: inline-flex; background: rgba(23,30,27,.92); border: 1px solid var(--line); border-radius: 999px; padding: 3px; align-self: flex-start; backdrop-filter: blur(8px); }
.seg button { border: 0; background: transparent; color: var(--muted); font-weight: 600; padding: 6px 14px; border-radius: 999px; font-size: 13px; }
.seg button.on { background: var(--accent); color: #1a1208; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: rgba(23,30,27,.92); color: var(--muted); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 600; backdrop-filter: blur(8px); }
.chip.on { border-color: var(--accent); color: var(--accent); }

#status { position: absolute; left: 10px; bottom: calc(env(safe-area-inset-bottom) + 12px); z-index: 900;
  font-size: 11px; color: var(--muted); background: rgba(23,30,27,.85); padding: 4px 8px; border-radius: 6px; max-width: 60vw; }
#status.warn { color: var(--amber); }

#listBtn, #locBtn { position: absolute; right: 10px; z-index: 900; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(23,30,27,.92); color: var(--ink); font-size: 20px; backdrop-filter: blur(8px); }
#listBtn { bottom: calc(env(safe-area-inset-bottom) + 64px); }
#locBtn { bottom: calc(env(safe-area-inset-bottom) + 12px); }

/* markers (SVG so drive dots can sit under the pin) */
.pinsvg { width: 28px; height: 28px; display: block; overflow: visible; }
.pin { stroke: #0f1412; stroke-width: 2; }
.pin.green { fill: var(--green); } .pin.amber { fill: var(--amber); }
.pin.red { fill: var(--red); } .pin.grey { fill: var(--grey); }
.pin.fav { stroke: var(--accent); stroke-width: 2.5; }
.drv { fill: #e6ebe8; stroke: #0f1412; stroke-width: .8; }
.drvn { font: 700 8px -apple-system, Roboto, sans-serif; fill: #e6ebe8; text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: #0f1412; stroke-width: 2px; }
.cluster { background: rgba(23,30,27,.9); border: 2px solid var(--line); color: var(--ink); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.cluster.green { border-color: var(--green); } .cluster.amber { border-color: var(--amber); } .cluster.red { border-color: var(--red); }

/* bottom sheet */
#sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 950; background: var(--panel); border-radius: 18px 18px 0 0;
  max-height: 78vh; display: flex; flex-direction: column; box-shadow: 0 -8px 30px rgba(0,0,0,.5);
  transform: translateY(0); transition: transform .25s ease; }
#sheet.hidden { transform: translateY(110%); }
.grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 4px; flex: none; }
#sheetBody { overflow-y: auto; padding: 6px 16px calc(env(safe-area-inset-bottom) + 16px); }
h2 { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.25; }
.sub { color: var(--muted); font-size: 12px; margin: 2px 0 10px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.badge { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px; background: var(--panel2); color: var(--ink); }
.badge.green { background: rgba(63,191,111,.18); color: var(--green); }
.badge.amber { background: rgba(232,179,57,.18); color: var(--amber); }
.badge.red { background: rgba(217,90,78,.18); color: var(--red); }
.badge.grey { color: var(--muted); }
.sec { margin: 14px 0 0; }
.lbl { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.val { font-size: 13.5px; line-height: 1.5; }
.val a { color: var(--accent); text-decoration: none; }
.dirs { display: flex; gap: 5px; flex-wrap: wrap; }
.dir { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--panel2); font-weight: 600; }

/* hourly forecast strip */
.hours { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.hr { text-align: center; font-size: 10px; color: var(--muted); }
.hr .bar { height: 46px; border-radius: 5px; background: var(--panel2); position: relative; margin-bottom: 3px; overflow: hidden; }
.hr .fill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 5px; opacity: .85; }
.hr.green .fill { background: var(--green); } .hr.amber .fill { background: var(--amber); }
.hr.red .fill { background: var(--red); } .hr.unknown .fill { background: var(--grey); }
.hr .ms { font-weight: 700; color: var(--ink); font-size: 11px; }
.hr .arrow { display: inline-block; font-size: 12px; color: var(--ink); }
.daysum { display: flex; gap: 8px; margin: 6px 0 8px; font-size: 12px; color: var(--muted); }

/* wind rose */
.roseWrap { display: flex; align-items: center; gap: 14px; }
.rose { width: 130px; height: 130px; flex: none; }
.roseTxt { font-size: 12px; color: var(--muted); line-height: 1.5; }

.cams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cam { display: block; border-radius: 8px; overflow: hidden; background: var(--panel2); color: var(--muted); font-size: 11px; text-decoration: none; }
.cam img { width: 100%; height: 80px; object-fit: cover; display: block; }
.cam span { display: block; padding: 5px 7px; }

/* list */
#list { position: absolute; inset: 0; z-index: 960; background: var(--bg); display: flex; flex-direction: column; }
#list.hidden { display: none; }
.listHead { display: flex; justify-content: space-between; align-items: center; padding: calc(env(safe-area-inset-top) + 14px) 16px 10px; font-weight: 700; border-bottom: 1px solid var(--line); }
.listHead button { border: 0; background: var(--panel2); color: var(--ink); width: 32px; height: 32px; border-radius: 8px; font-size: 14px; }
#listBody { overflow-y: auto; padding: 6px 12px calc(env(safe-area-inset-bottom) + 12px); }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.row .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.row .dot.green { background: var(--green); } .row .dot.amber { background: var(--amber); }
.row .dot.red { background: var(--red); } .row .dot.grey { background: var(--grey); }
.row .nm { flex: 1; font-weight: 600; }
.row .nm small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.row .rt { color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; }
.row .rt b { color: var(--ink); }

/* drive slider chip */
.chip.slider { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; }
.chip.slider input { width: 110px; accent-color: var(--accent); margin: 0; }
.chip.slider.on { border-color: var(--accent); }
#driveLbl { white-space: nowrap; }

/* fly cone markers (flyable sites): wedge points downwind, number = noon m/s */
.cone { width: 80px; height: 80px; display: block; overflow: visible; }
.cone .wedge.green { fill: var(--green); } .cone .wedge.amber { fill: var(--amber); }
.cone text { font: 800 13px -apple-system, Roboto, sans-serif; fill: #0f1412; text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: rgba(255,255,255,.55); stroke-width: 2px; }
.cone .site { fill: #0f1412; stroke: #fff; stroke-width: 1.5; }
.cone.fav .site { stroke: var(--accent); stroke-width: 2.5; }

/* per-day wind "thermometer" bars: 0–8 m/s scale, zones per Erik's rule */
.dayrow { margin: 10px 0 14px; }
.dayrow .dh { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; margin-bottom: 22px; }
.dayrow .dh b { font-size: 13.5px; }
.dayrow .dh .st { font-weight: 700; }
.dayrow .dh .st.green { color: var(--green); } .dayrow .dh .st.amber { color: var(--amber); }
.dayrow .dh .st.red { color: var(--red); } .dayrow .dh .st.grey { color: var(--muted); }
.tbar { position: relative; height: 10px; border-radius: 5px; margin: 0 14px 26px;
  background: linear-gradient(90deg, var(--amber) 0 25%, var(--green) 25% 50%, var(--amber) 50% 75%, var(--red) 75% 100%); opacity: .95; }
.tbar .tick { position: absolute; top: 12px; font-size: 9px; color: var(--muted); transform: translateX(-50%); }
.tbar .mk { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 16px; height: 16px; border-radius: 50%;
  background: var(--panel); border: 2.5px solid var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.tbar .mk .t { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.tbar .mk .v { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.tbar .mk .v .arr { display: inline-block; font-size: 11px; }
.tbar .mk.red { border-color: var(--red); } .tbar .mk.green { border-color: var(--green); } .tbar .mk.amber { border-color: var(--amber); }
.scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin: -18px 14px 6px; }
