/* Mobile-first. No build step. */
:root {
  --bg: #f8fafc; --card: #fff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --brand: #0e7490; --good: #16a34a; --marg: #d97706; --nogo: #94a3b8;
  --radius: 14px; --tab-h: 62px;
  /* Bottom clearance under the tab icons/labels. 0px on Cloudflare Pages (no host badge); set
     ~60px if a host ever injects a floating corner badge (Netlify's sat ~16-50px above the bottom). */
  --badge-clear: 0px;
  --tab-pad: max(var(--badge-clear), env(safe-area-inset-bottom));
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1220; --card: #111a2e; --text: #e2e8f0; --muted: #94a3b8; --line: #1e293b; }
  .leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--text); }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { padding-bottom: calc(var(--tab-h) + var(--tab-pad)); line-height: 1.45; }
a { color: var(--brand); }
h1 { font-size: 1.4rem; margin: .4rem 0; } h2 { font-size: 1.05rem; margin: 1.1rem 0 .4rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .dim { opacity: .25; }
.warn { background: #fef3c7; color: #78350f; padding: .5rem .75rem; border-radius: 10px; }

.topbar { position: sticky; top: 0; z-index: 1000; display: flex; justify-content: space-between; align-items: center;
  padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top)); background: var(--brand); color: #fff; }
.brand { color: #fff; text-decoration: none; font-weight: 700; display: flex; gap: .5rem; align-items: center; }
.gear { color: #fff; text-decoration: none; font-size: 1.4rem; }
.view { max-width: 760px; margin: 0 auto; padding: .75rem; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + var(--tab-pad)); padding-bottom: var(--tab-pad);
  background: var(--card); border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--muted); font-size: .75rem; }
.tabbar a span { font-size: 1.25rem; line-height: 1.2; }
.tabbar a.on { color: var(--brand); font-weight: 600; }

.locbar { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .75rem; margin-bottom: .6rem; }
.locbar-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .2rem 0; }
.locbar input { flex: 1; min-width: 0; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; background: var(--bg); color: var(--text); }
.locbar-msg { margin: .2rem 0 0; font-size: .85rem; min-height: 1em; }

.chips { display: flex; gap: .4rem; margin: .4rem 0 .7rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: .4rem .8rem; font-size: .85rem; cursor: pointer; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn, .btn-sm { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: .7rem 1rem; text-decoration: none; font-weight: 600; font-size: .95rem; cursor: pointer; text-align: center; }
.btn-sm { padding: .55rem .8rem; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .6rem 0; }
.tesla-btn { grid-column: 1 / -1; font-family: inherit; }
.tesla-hint { grid-column: 1 / -1; margin: -.25rem 0 0; text-align: center; }

.badge { display: inline-block; border-radius: 999px; padding: .1rem .55rem; font-size: .78rem; font-weight: 700; color: #fff; white-space: nowrap; vertical-align: middle; }
.badge-good { background: var(--good); } .badge-marginal { background: var(--marg); } .badge-nogo { background: var(--nogo); }
.badge-loading { background: var(--line); color: var(--muted); }
.stars { color: var(--brand); letter-spacing: 1px; font-size: .8rem; }
.arrow { vertical-align: middle; color: #2563eb; }
.tag { background: #fde68a; color: #78350f; border-radius: 6px; padding: 0 .35rem; font-size: .75rem; }
.windnote { display: inline-block; background: #fef3c7; color: #92400e; border-radius: 6px; padding: 0 .35rem; font-size: .72rem; white-space: nowrap; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-link { display: flex; gap: .7rem; color: inherit; text-decoration: none; padding: .55rem; }
.thumb { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.photo-empty { display: flex; align-items: center; justify-content: center; background: var(--line); color: var(--muted); font-size: .75rem; text-align: center; }
.card-body { min-width: 0; flex: 1; }
.card-title { font-weight: 700; }
.card-row { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; margin-top: .25rem; }

.map { height: calc(100dvh - var(--tab-h) - var(--tab-pad) - 120px); min-height: 360px; border-radius: var(--radius); border: 1px solid var(--line); }
.map-legend { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .4rem; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.dot.home { background: #2563eb; }

.rank { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; counter-reset: r; }
.rank li { counter-increment: r; }
.rank-row { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .75rem; color: inherit; text-decoration: none; }
.rank-row strong::before { content: counter(r) ". "; color: var(--muted); }

.detail .back { text-decoration: none; font-size: .9rem; }
.hero-img { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--radius); display: block; margin-top: .4rem; }
.hero .photo-empty { height: 120px; border-radius: var(--radius); margin-top: .4rem; }
.credit { font-size: .72rem; color: var(--muted); margin: .25rem 0 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; margin: .7rem 0; }
.panel h2 { margin-top: 0; }
.now { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.now-main { display: grid; gap: .3rem; }
.now-wind { display: flex; align-items: center; gap: .3rem; }
.big { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.rose { flex-shrink: 0; color: var(--muted); }
.daystrip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(78px, 1fr); gap: .4rem; overflow-x: auto; padding-bottom: .3rem; }
.day-btn { display: grid; gap: .2rem; justify-items: center; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: .45rem .2rem; font-size: .85rem; cursor: pointer; }
.day-btn.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.table-wrap { overflow-x: auto; }
.hourly { width: 100%; border-collapse: collapse; font-size: .85rem; }
.hourly th, .hourly td { padding: .32rem .35rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.hourly td.num { text-align: right; font-variant-numeric: tabular-nums; }
.hourly tr.lvl-good { background: color-mix(in srgb, var(--good) 10%, transparent); }
.tide-day { margin: .3rem 0; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.tide { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .1rem .45rem; }
.tide.high { border-color: #60a5fa; } .tide.low { border-color: #fbbf24; }
.hazards li::marker { content: "⚠ "; }

.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem 1rem 1rem; }
.steps li { margin-bottom: .55rem; }
.settings { display: grid; gap: .8rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.settings label { display: grid; gap: .25rem; font-size: .9rem; }
.settings input { padding: .6rem; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; background: var(--bg); color: var(--text); }
.settings fieldset { border: 1px solid var(--line); border-radius: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.row { display: flex; gap: .5rem; }

@media (min-width: 700px) {
  .thumb { width: 120px; height: 100px; }
  .cards { grid-template-columns: 1fr 1fr; }
}

/* Kite size chips + recommendation */
.kchip { display: inline-block; border-radius: 999px; padding: .1rem .55rem; font-size: .78rem; font-weight: 700; white-space: nowrap;
  background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); }
.kchip-light { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }
.kchip-strong { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.kchip-none { background: var(--line); color: var(--muted); border-color: var(--line); }
.k-light { color: #0369a1; font-weight: 600; } .k-strong { color: #b91c1c; font-weight: 600; }
.kite-rec { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.kite-rec h2 { margin-bottom: .35rem; }
.kite-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .35rem 0; border-top: 1px solid var(--line); }
.kite-line:first-of-type { border-top: 0; }
.kite-when { font-weight: 600; font-size: .92rem; }
.kite-pick { text-align: right; }
.kite-size { font-size: 1.35rem; font-weight: 800; color: var(--brand); }
.nudge { margin: .2rem 0 .6rem; }
.rank-kite { margin-top: .3rem; }

/* Settings: segmented unit switch, two-column weight */
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--brand); border-radius: 10px; overflow: hidden; }
.settings .seg-opt { display: block; position: relative; margin: 0; gap: 0; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: block; text-align: center; padding: .6rem; font-weight: 600; color: var(--brand); }
.seg-opt input:checked + span { background: var(--brand); color: #fff; }
.seg-opt input:focus-visible + span { outline: 2px solid var(--text); outline-offset: -4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .5rem; }
.settings fieldset { display: grid; gap: .5rem; }
/* Keep settings inside phone width (fieldsets default to min-content; inputs have intrinsic widths). */
.settings fieldset { min-width: 0; margin: 0; }
.settings input:not([type=radio]) { width: 100%; min-width: 0; }
.grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Settings: kite quiver chips + "Add a kite" select */
.kites-field { display: grid; gap: .45rem; min-width: 0; }
.field-label { font-size: .9rem; }
.kite-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; min-width: 0; }
.kite-own { display: inline-flex; align-items: center; gap: .15rem; background: var(--brand); color: #fff; border-radius: 999px; padding: .15rem .2rem .15rem .75rem; font-weight: 700; font-size: .95rem; }
.kite-x { border: 0; background: rgba(255,255,255,.22); color: #fff; width: 1.9rem; height: 1.9rem; border-radius: 50%; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.kite-x:disabled { opacity: .35; cursor: not-allowed; }
.settings select { width: 100%; min-width: 0; padding: .6rem; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; background: var(--bg); color: var(--text); }

/* Beginner vs intermediate/advanced wind */
:root { --beg: #14b8a6; --adv: #f59e0b; }
.kchip-adv { background: #fef3c7; color: #92400e; border-color: #fbbf24; }
.k-adv { color: #b45309; font-weight: 600; }
.kite-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin: .3rem 0 .6rem; }
.lg { display: inline-block; width: 1.1rem; height: .55rem; border-radius: 3px; vertical-align: middle; }
.lg-beg { background: var(--beg); }
.lg-adv { background: repeating-linear-gradient(135deg, var(--adv) 0 4px, #fcd34d 4px 8px); margin-left: .4rem; }
.bands { margin: .3rem 0; min-width: 0; }
.band-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.band, .band-axis { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); column-gap: .5rem; row-gap: .1rem; align-items: center; }
.band-kite { font-weight: 700; font-size: .9rem; }
.band-bar, .band-scale { position: relative; height: .8rem; background: var(--line); border-radius: 4px; min-width: 0; }
.band-scale { background: none; height: 1rem; }
.band-text { grid-column: 2; font-size: .8rem; }
.band-axis .band-text { grid-column: 2; }
.band-seg { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.seg-beg { background: var(--beg); }
.seg-adv { background: repeating-linear-gradient(135deg, var(--adv) 0 4px, #fcd34d 4px 8px); }
.adv-txt { color: #b45309; font-weight: 600; }
.band-tick { position: absolute; top: 0; transform: translateX(-50%); font-size: .7rem; color: var(--muted); }
.band-tick:first-child { transform: none; } .band-tick:nth-child(3) { transform: translateX(-100%); }
.tick-beg { color: #b45309; font-weight: 700; }
.band-mark { position: absolute; top: -.15rem; transform: translateX(-50%); width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid #2563eb; }
.kite-bands-wrap { margin: .4rem 0 .1rem; }
.kite-bands-wrap summary { cursor: pointer; color: var(--brand); font-weight: 600; }
@media (prefers-color-scheme: dark) { .kchip-adv { background: #422006; color: #fcd34d; border-color: #b45309; } }
.kite-legend { gap: .2rem .8rem; }
.lg-item { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.lg-adv { margin-left: 0; }
.kite-line { display: flex; flex-wrap: wrap; justify-content: space-between; row-gap: .3rem; }
.kite-line > :first-child { flex: 1 1 9rem; min-width: 0; }
.kite-pick { flex: 0 1 auto; margin-left: auto; }
.kite-pick .kchip { white-space: nowrap; }

/* Best days: day headings; .dtag pills are used by the Level selector */
.day-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin: 1rem 0 .5rem; }
.day-head h2 { margin: 0; }
.dtag { display: inline-grid; grid-auto-flow: column; border: 1px solid var(--brand); border-radius: 999px; overflow: hidden; }
.dtag-opt { border: 0; background: transparent; color: var(--brand); font: inherit; font-size: .78rem; font-weight: 600; padding: .3rem .6rem; cursor: pointer; }
.dtag-opt + .dtag-opt { border-left: 1px solid color-mix(in srgb, var(--brand) 45%, transparent); }
.dtag-opt[aria-pressed="true"] { background: var(--brand); color: #fff; }
.dtag-opt:focus-visible { outline: 2px solid var(--text); outline-offset: -3px; }
.day-empty { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: .6rem .75rem; }
@media (prefers-color-scheme: dark) { .dtag-opt { color: color-mix(in srgb, var(--brand) 45%, var(--text)); } .dtag-opt[aria-pressed="true"] { color: #fff; } }

/* Skill-level filter (cumulative pills, reuse .dtag look) */
.skill-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .2rem 0 .6rem; }
.dtag-opt.lit { background: color-mix(in srgb, var(--brand) 55%, transparent); color: #fff; }
.dtag-opt.lit[aria-pressed="true"] { background: var(--brand); }
.hidden-note { margin: -.2rem 0 .6rem; }
.nowrap { white-space: nowrap; }
.lvl { display: inline-block; border-radius: 6px; padding: 0 .4rem; font-size: .7rem; font-weight: 700; vertical-align: middle; border: 1px solid; }
.lvl-beginner { color: #0f766e; background: #ccfbf1; border-color: #5eead4; }
.lvl-intermediate { color: #1d4ed8; background: #dbeafe; border-color: #93c5fd; }
.lvl-advanced { color: #92400e; background: #fef3c7; border-color: #fbbf24; }
.lvl-unknown { color: var(--muted); background: var(--line); border-color: var(--line); }
@media (prefers-color-scheme: dark) {
  .lvl-beginner { color: #5eead4; background: #042f2e; border-color: #0f766e; }
  .lvl-intermediate { color: #93c5fd; background: #172554; border-color: #1d4ed8; }
  .lvl-advanced { color: #fcd34d; background: #422006; border-color: #b45309; }
}
/* Favorites */
.has-fav { position: relative; }
.fav-btn { background: none; border: 0; font-size: 1.35rem; line-height: 1; color: var(--muted); cursor: pointer; padding: .25rem; }
.fav-btn.on { color: #eab308; }
.fav-corner { position: absolute; top: .3rem; right: .3rem; z-index: 1; }
.has-fav .card-body, .has-fav .rank-main { padding-right: 1.8rem; }
.fav-badge { display: inline-block; font-size: .72rem; font-weight: 600; color: #854d0e; background: #fef9c3; border: 1px solid #fde047; border-radius: 6px; padding: 0 .4rem; margin-top: .15rem; }
@media (prefers-color-scheme: dark) { .fav-badge { color: #fde047; background: #422006; border-color: #a16207; } }
.list-h { font-size: .95rem; margin: .6rem 0 .4rem; }
.list-h:empty { display: none; }
.fav-cards { margin-bottom: .4rem; }
.detail-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.detail-tags { margin: 0 0 .4rem; }
.dot.fav { background: transparent; border: 3px solid #facc15; }
.dot.dimmed { background: #9ca3af; opacity: .35; }

/* Max drive slider (miles) */
.filters { display: grid; gap: .3rem; margin-bottom: .4rem; }
.range-row { display: grid; gap: .15rem; max-width: 420px; }
.range-row input[type=range] { width: 100%; accent-color: var(--brand); margin: 0; }
.range-row b { color: var(--brand); }
.range-scale { display: flex; justify-content: space-between; font-size: .7rem; }
@media (prefers-color-scheme: dark) { .range-row b { color: color-mix(in srgb, var(--brand) 45%, var(--text)); } .range-row input[type=range] { accent-color: #22d3ee; } }
.settings input[type=range] { padding: 0; border: 0; background: none; }

/* Forecast map (#/map): day chips, compact filters, numbered markers, popup, ranked list */
.map-view .map { height: calc(100dvh - var(--tab-h) - var(--tab-pad) - 230px); min-height: 320px; }
.day-chips { flex-wrap: nowrap; overflow-x: auto; margin: .2rem 0 .4rem; padding-bottom: .15rem; scrollbar-width: none; }
.day-chips::-webkit-scrollbar { display: none; }
.day-chips .chip { flex: 0 0 auto; padding: .35rem .7rem; }
.filters.compact { grid-template-columns: auto minmax(140px, 1fr); align-items: center; gap: .2rem .8rem; margin-bottom: .45rem; }
.filters.compact .skill-row { margin: 0; }
.filters.compact .skill-row > .small { display: none; }
.filters.compact .dtag-opt { padding: .25rem .5rem; font-size: .74rem; }
.filters.compact .range-scale { display: none; }
@media (max-width: 420px) { .filters.compact { grid-template-columns: 1fr; } }
.mk-wrap { background: none; border: 0; }
.mk { box-sizing: border-box; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.45); font: 800 .85rem/1 system-ui, sans-serif; color: #fff; background: #64748b; }
.mk-good { background: #16a34a; }
.mk-marginal { background: var(--marg); color: #fff; } /* same orange as .badge-marginal */
.mk-nogo { background: #9ca3af; color: #1f2937; }
.mk-ranked { border-width: 2.5px; border-color: #0f172a; font-size: .9rem; }
.mk-fav { border: 3.5px solid #facc15; }
.mk-dim { opacity: .3; }
/* Map cluster bubbles (Leaflet.markercluster icons built in ui/map.js) */
.mkc-wrap { overflow: visible; }
.mkc { box-sizing: border-box; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.95); box-shadow: 0 0 0 4px rgba(15,23,42,.18), 0 1px 4px rgba(0,0,0,.35);
  color: #fff; font-weight: 800; font-size: .95rem; cursor: pointer; }
.mkc-good { background: #16a34a; }
.mkc-marginal { background: var(--marg); }
.mkc-nogo { background: #9ca3af; color: #1f2937; }
.mkc-none { background: #64748b; }
.mkc-dim { background: #9ca3af; color: #1f2937; opacity: .45; font-size: .78rem; box-shadow: none; border-width: 2px; }
.mkc-rank { position: absolute; top: -9px; right: -12px; padding: 1px 5px; border-radius: 9px; background: #0f172a; color: #fff;
  font-size: .7rem; line-height: 1.25; border: 1.5px solid #fff; white-space: nowrap; pointer-events: none; }
.mkc-cap { position: absolute; left: 50%; bottom: -15px; transform: translateX(-50%); padding: 0 4px; border-radius: 6px;
  background: rgba(255,255,255,.92); color: #166534; font-size: .64rem; font-weight: 700; line-height: 1.3; white-space: nowrap; pointer-events: none; }
.mkc-fav { border-color: #facc15; }
.mkc-star { position: absolute; top: -9px; left: -9px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%;
  background: #facc15; color: #713f12; font-style: normal; font-size: .72rem; line-height: 1; border: 1.5px solid #fff; pointer-events: none; }
.mkc-legend { display: inline-grid; width: 18px; height: 18px; font-size: .62rem; border-width: 1.5px; box-shadow: none; vertical-align: middle; margin-right: .2rem; cursor: default; }
@media (prefers-color-scheme: dark) { .mkc { border-color: #0b1220; } .mkc.mkc-fav { border-color: #facc15; } .mkc-star { border-color: #0b1220; } .mkc-rank { border-color: #0b1220; background: #f8fafc; color: #0f172a; } .mkc-cap { background: rgba(15,23,42,.9); color: #86efac; } }
.mk-legend { display: inline-grid; width: 18px; height: 18px; font-size: .68rem; vertical-align: middle; margin-right: .2rem; }
@media (prefers-color-scheme: dark) { .mk { border-color: #0b1220; } .mk-ranked { border-color: #f8fafc; } .mk-fav { border-color: #facc15; } }
.pop { display: grid; gap: .2rem; min-width: 190px; }
.pop-head { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; padding-right: 1rem; }
.pop .pop-fav { margin-left: auto; font-size: 1.2rem; padding: 0 .1rem; }
.pop a { font-weight: 600; }
.leaflet-popup-content { margin: .7rem .8rem; }
.rank-n { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 800; font-size: .8rem; padding: 0 .3rem; }
.map-rank-h { font-size: 1rem; margin: .7rem 0 .4rem; }
.map-rank { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; gap: .4rem; }
.map-rank-row { display: flex; gap: .6rem; align-items: flex-start; width: 100%; text-align: left; background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: .5rem .65rem; font: inherit; cursor: pointer; }
.map-rank-row:active { border-color: var(--brand); }
.map-rank-main { display: grid; gap: .15rem; min-width: 0; }
.fav-mini { color: #eab308; }

/* Show unrated chip (next to the Level pills) */
.tog-chip { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: .28rem .65rem; font: inherit; font-size: .76rem; font-weight: 600; cursor: pointer; }
.tog-chip.on { color: var(--text); background: var(--line); border-color: var(--muted); }
.filters.compact .tog-chip { padding: .22rem .5rem; font-size: .72rem; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }
@media (prefers-color-scheme: dark) { .linkbtn { color: #5eead4; } }

/* Ridden ("I've ridden here") */
.ride-btn { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card);
  color: var(--muted); font: 700 .85rem/1 system-ui, sans-serif; cursor: pointer; padding: 0; }
.ride-btn.on { background: #0d9488; border-color: #0d9488; color: #fff; }
.ride-btn.ride-full { width: auto; height: auto; padding: .4rem .8rem; font-size: .88rem; }
.ride-btn.demo { width: 1.25rem; height: 1.25rem; font-size: .7rem; vertical-align: middle; cursor: default; }
.ride-corner { position: absolute; top: 2.35rem; right: .45rem; z-index: 1; }
.ride-badge { display: inline-block; font-size: .72rem; font-weight: 600; color: #0f766e; background: #ccfbf1; border: 1px solid #5eead4; border-radius: 6px; padding: 0 .4rem; margin: .15rem .25rem 0 0; }
@media (prefers-color-scheme: dark) { .ride-badge { color: #5eead4; background: #042f2e; border-color: #0f766e; } .ride-btn.on { background: #0f766e; border-color: #14b8a6; } }
.ride-row { display: flex; align-items: center; gap: .7rem; margin: .1rem 0 .6rem; }
.ride-mini { color: #0d9488; font-weight: 800; }
.pop-btns { margin-left: auto; display: inline-flex; align-items: center; gap: .3rem; }
.pop .pop-btns .pop-fav { margin-left: 0; }
.pop .ride-btn { width: 1.5rem; height: 1.5rem; font-size: .78rem; }
.mk-ride { position: absolute; right: -5px; bottom: -5px; width: 13px; height: 13px; border-radius: 50%; background: #0d9488; color: #fff;
  font: 900 8px/13px system-ui, sans-serif; text-align: center; font-style: normal; border: 1.5px solid #fff; box-shadow: 0 0 0 .5px rgba(0,0,0,.4); pointer-events: none; }
.ride-dot-legend { display: inline-block; width: 13px; height: 13px; border-radius: 50%; background: #0d9488; color: #fff; font: 900 8px/13px system-ui, sans-serif; text-align: center; vertical-align: middle; margin-right: .2rem; border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--line); }
@media (prefers-color-scheme: dark) { .mk-ride, .ride-dot-legend { border-color: #0b1220; } }

/* Badges tab */
.badges-view h1 { margin: .2rem 0 .3rem; }
.ride-summary { margin: .2rem 0 .4rem; }
.meter { display: block; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: .5rem; }
.meter > span { display: block; height: 100%; background: #0d9488; border-radius: inherit; }
.meter.mini { height: 5px; margin: .15rem 0 0; width: 100%; }
.badge-grid { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.badge-card { display: grid; gap: .15rem; justify-items: center; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .5rem; }
.badge-icon { font-size: 2rem; line-height: 1.1; width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #fde68a, #f59e0b); box-shadow: 0 2px 6px rgba(245,158,11,.35); }
.badge-name { font-weight: 700; }
.badge-date { color: #0f766e; font-weight: 600; }
.badge-card.earned { border-color: #fbbf24; }
.badge-card.locked .badge-icon { filter: grayscale(1); opacity: .45; background: var(--line); box-shadow: none; }
.badge-card.locked .badge-name { color: var(--muted); }
.badge-prog { font-weight: 600; }
@media (prefers-color-scheme: dark) { .badge-date { color: #5eead4; } .badge-card.earned { border-color: #b45309; } }
.ride-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .35rem; }
.ride-list li { display: flex; align-items: center; gap: .55rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .45rem .6rem; }
.ride-list a { color: inherit; text-decoration: none; min-width: 0; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--tab-pad) + 12px); transform: translate(-50%, 20px); opacity: 0;
  z-index: 2000; background: #0f172a; color: #fff; padding: .65rem 1rem; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.3);
  font-size: .92rem; max-width: calc(100vw - 2rem); text-decoration: none; transition: opacity .25s, transform .25s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-color-scheme: dark) { .toast { background: #f8fafc; color: #0f172a; } }
.pop .ride-badge { justify-self: start; width: fit-content; }

/* Live cams (spot page) + list indicator */
.cam-list { list-style: none; padding: 0; margin: .3rem 0; }
.cam-list li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.cam-list li:last-child { border-bottom: 0; }
.cam-list a { font-weight: 600; }
.cam-low { font-style: italic; }
.cam-ind { font-size: .85rem; vertical-align: middle; }
