:root {
  --handle: rgba(15, 42, 51, 0.18);   /* the sheets' drag handle */
  /* Chutemap palette "Glacier": teal ink, glacier-teal accent (was FATMAP navy + cyan until 2026-11-10) */
  --bg: #f3f6f6;
  --panel: rgba(255, 255, 255, 0.97);
  --panel-solid: #ffffff;
  --card: #ffffff;
  --text: #0f2a33;
  --muted: #5d6f75;
  --grid: rgba(15, 42, 51, 0.08);
  --line: rgba(15, 42, 51, 0.1);
  --fill: rgba(15, 42, 51, 0.05);
  --fill-strong: rgba(15, 42, 51, 0.1);
  --accent: #00969c;
  --navy: #0f2a33;            /* the ink: deep teal (the app icon still has FATMAP navy) */
  --brand-grad: linear-gradient(135deg, #00969c, #0f2a33);
  --accent-text: #ffffff;
  --on-bg: #0f2a33;           /* a selected chip/segment */
  --on-text: #ffffff;
  --record: #ff5a36;
  --danger: #e5484d;
  --radius: 18px;
  --shadow: 0 3px 12px rgba(15, 42, 51, 0.18);
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --dock-b: max(12px, calc(var(--safe-b) - 6px));   /* the floating tab dock's gap to the screen's bottom */
  --bottom: calc(var(--tabbar-h) + var(--dock-b) + 10px);   /* what the dock covers, and a gap above it */
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font: 15px/1.4 -apple-system, system-ui, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
#map { position: absolute; inset: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---- per-tab visibility ---- */
.map-only, .record-only, .home-only, .profile-only, .explore-only { display: none; }
body[data-tab="map"] .map-only:not([hidden]),
body[data-tab="record"] .record-only:not([hidden]),
body[data-tab="home"] .home-only,
body[data-tab="profile"] .profile-only,
body[data-tab="explore"] .explore-only { display: block; }
body[data-tab="map"] .fab.map-only:not([hidden]) { display: grid; }
body[data-tab="home"] .fab-col, body[data-tab="profile"] .fab-col,
body[data-tab="home"] .legends, body[data-tab="profile"] .legends, body[data-tab="explore"] .legends { display: none !important; }

/* ---- buttons ---- */
.fab, .icon-btn { display: grid; place-items: center; border: 1px solid var(--line); cursor: pointer;
  padding: 0; -webkit-appearance: none; appearance: none; line-height: 0; }   /* iOS adds padding to buttons */
.fab > svg, .icon-btn > svg, .fly-btn > svg, .del > svg { display: block; }
svg.x { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.fly-btn svg.x { width: 16px; height: 16px; }
.fab { width: 46px; height: 46px; border-radius: 14px; background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow); font-weight: 800; font-size: 14px; }
.fab.active { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.fab .dot { fill: currentColor; stroke: none; opacity: 0; }
.fab.located .dot { opacity: 1; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--fill); flex: none; position: relative; }
/* every small round button gets a 44 px finger target (gloves) without looking bigger */
.icon-btn::after { content: ''; position: absolute; inset: -5px; }
.icon-btn.small::after { inset: -8px; }
.chip { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--fill); white-space: nowrap; font-weight: 500; }
.chip:hover { background: var(--fill-strong); }
.chip.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 650; }
.chip.danger { color: var(--danger); }
.chip.big { flex: 1; padding: 13px; font-weight: 650; font-size: 16px; }
.chip.wide { width: 100%; margin-top: 12px; padding: 12px; }
select.chip { appearance: none; -webkit-appearance: none; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.row.end { justify-content: flex-end; margin-top: 16px; }
.demo-row { justify-content: space-between; align-items: center; flex-wrap: nowrap; padding: 10px 12px; border-radius: 12px; background: rgba(255, 153, 0, 0.1); border: 1px dashed rgba(255, 153, 0, 0.6); }
.demo-row small { display: block; color: var(--muted); font-size: 11px; }

/* ---- top bar / search ---- */
.topbar { position: absolute; top: calc(10px + var(--safe-t)); left: 12px; right: 70px; z-index: 4; }   /* search results cover the map buttons */
.search { position: relative; display: flex; align-items: center; gap: 8px; max-width: 420px; height: 46px; padding: 0 14px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.search svg { color: var(--muted); flex: none; width: 20px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
#searchResults { position: absolute; top: 52px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none; border-radius: 14px;
  background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; }
#searchResults li { padding: 10px 12px; border-radius: 10px; cursor: pointer; }
#searchResults li:hover, #searchResults li.sel { background: var(--fill); }
#searchResults small { display: block; color: var(--muted); }
#searchResults li:not(.note) { display: flex; align-items: center; gap: 12px; }
#searchResults li > div { min-width: 0; flex: 1; }
#searchResults li span, #searchResults li small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.sr-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--fill); color: var(--muted); }
.sr-ic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-ic.peak { color: #1f9d63; background: rgba(47, 211, 138, .14); }
.sr-ic.peak svg { fill: rgba(47, 211, 138, .35); }
.sr-ic.town { color: #00969c; background: rgba(0, 150, 156, .12); }
.sr-ic.tour { color: var(--lv, #f08c00); background: color-mix(in srgb, var(--lv, #f08c00) 14%, transparent); }
.sr-ic.tour circle { fill: currentColor; }
.sr-ic.ski { color: #e5383b; background: rgba(229, 56, 59, .11); }
.sr-ic.mine { color: #9b30d9; background: rgba(155, 48, 217, .11); }
.sr-ic.mine circle { fill: currentColor; }

.fab-col { position: absolute; right: 12px; top: calc(10px + var(--safe-t)); display: grid; gap: 10px; z-index: 3; }
.maplibregl-ctrl-top-right { top: calc(250px + var(--safe-t)); right: 2px; }
.maplibregl-ctrl-group { background: var(--panel) !important; border: 1px solid var(--line); border-radius: 14px !important; box-shadow: var(--shadow) !important; }
.maplibregl-ctrl-group button { width: 44px; height: 44px; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
.maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: var(--bottom); }
.maplibregl-ctrl-attrib { background: rgba(17, 20, 24, 0.6) !important; color: var(--muted); font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--muted); }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.maplibregl-ctrl-scale { background: rgba(17, 20, 24, 0.6); color: var(--text); border-color: var(--text); }
body.sheet-open .maplibregl-ctrl-bottom-right, body.sheet-open .maplibregl-ctrl-bottom-left { display: none; }

.legends { position: absolute; left: 12px; right: 70px; top: calc(70px + var(--safe-t)); z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; }
.legends .legend { pointer-events: auto; }
/* a tapped point's details win over the legend: it folds to its title meanwhile (the small slope bar stays) */
body.popup-open .legend.foldable > :not(.legend-fold):not(b:first-of-type) { display: none !important; }
body.popup-open .legend.foldable .legend-fold svg { transform: rotate(180deg); }
body.popup-open .legends .legend:not(.foldable):not(.legend-bar) { display: none; }
.legends > .legend:not(.legend-bar):not(.legend-chip) { align-self: flex-start; }
.legend { padding: 10px 12px; border-radius: 12px; background: var(--panel);
  border: 1px solid var(--line); backdrop-filter: blur(12px); font-size: 12px; display: grid; gap: 3px; box-shadow: var(--shadow); }
.legend b { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 10px; border-radius: 3px; }
.legend-bar { width: min(300px, 100%); padding: 6px 10px 5px; gap: 3px; }
.legend-chip { padding: 4px 10px; font-weight: 700; }
.legend-bar .bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; }
.legend-bar .bar i { flex: 1; width: auto; height: 100%; border-radius: 0; }
.legend-bar .bar { align-items: stretch; gap: 0; }
.legend-bar .ticks { display: flex; font-size: 10px; font-weight: 700; color: var(--muted); }
.legend-bar .ticks span { flex: 1; }

/* ---- sheets (above the tab bar) ---- */
.sheet { position: absolute; left: 0; right: 0; bottom: var(--bottom); z-index: 4; padding: 8px 16px 14px; background: var(--panel);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow); }
#advSheet { max-height: 62vh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* tall: up to just under the search bar + chips; the sheet stays on the tab bar, white below its content */
#advSheet.tall { max-height: none; height: calc(100dvh - var(--bottom) - var(--safe-t) - 130px); background: var(--panel-solid); }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--handle); margin: 0 auto 8px; cursor: pointer; }
/* bigger invisible touch target around the small bar */
.grabber { position: relative; }
.grabber::before { content: ''; position: absolute; left: -60px; right: -60px; top: -14px; bottom: -10px; }
#advSheet .grabber, #advSheet .sheet-head, #advSheet .sheet-back { touch-action: none; }
/* The map handles every touch itself. (With MapLibre's pinch handler switched off, for our own two-finger
   gestures, it would otherwise mark the map "pinch-zoom", and iOS then starts its own page zoom, swallowing
   or cancelling touches: a second drag got no reaction.) */
.maplibregl-canvas-container, .maplibregl-canvas-container .maplibregl-canvas { touch-action: none !important; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.sheet h3 { font-size: 19px; line-height: 1.25; }
.stat-row { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.stat-row span { color: var(--muted); font-size: 12px; display: flex; flex-direction: column; }
.stat-row b { color: var(--text); font-size: 16px; font-weight: 650; }
#profileCanvas { display: block; width: 100%; height: 130px; margin: 6px 0; cursor: crosshair; touch-action: pan-y; }   /* vertical swipes still scroll the sheet */
@media (min-width: 900px) { #advSheet.collapsed #profileCanvas, #advSheet.collapsed .actions, #advSheet.collapsed .summary, #advSheet.collapsed .tour-info { display: none; } }
/* the small sheet's "there's more" handle: centred at its bottom, an up chevron + what's there */
.sheet-more { display: none; align-items: center; justify-content: center; gap: 2px; margin: 4px auto -4px; padding: 6px 14px 4px;
  color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; width: max-content; }
.sheet-more svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sheet-more:active { opacity: .5; }
#advSheet.collapsed .sheet-more { display: flex; }
#advSheet.collapsed.pin-mode .sheet-more, body.flying .sheet-more { display: none; }
/* Phones: the tour sheet is one panel from just under the status bar to the tab bar, everything in it
   laid out; it slides (app.js slideSheet) and the tab bar covers what is below. It reaches 240 px past
   the screen's bottom, so a spring that overshoots never lifts it off the tab bar. Opaque, like Google Maps'. */
@media (max-width: 899px) {
  #advSheet, #advSheet.tall { top: calc(var(--safe-t) + 8px); bottom: -240px; padding-bottom: calc(var(--bottom) + 254px); height: auto; max-height: none; overflow-y: hidden; z-index: 5;
    background: var(--panel-solid); backdrop-filter: none; -webkit-backdrop-filter: none; transform: translate3d(0, 100vh, 0); will-change: transform; }
  #advSheet.scrolls { overflow-y: auto; }
  #advSheet .sheet-more, #advSheet.collapsed .sheet-more { display: flex; position: absolute; left: 0; right: 0; z-index: 1; width: auto;
    margin: 0; padding: 6px 14px 12px; background: var(--panel-solid); }
  #advSheet.pin-mode .sheet-more { display: none; }
}
.actions { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.actions::-webkit-scrollbar { display: none; }
.summary { margin: 10px 0 0; color: var(--muted); white-space: pre-wrap; }

/* record panel */
.rec-unsaved { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: #fff4d6; color: #6a4b00; font-size: 14px; font-weight: 600; }
.gps-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.gps-dot { width: 10px; height: 10px; border-radius: 50%; background: #777; }
.gps-dot.good { background: #3ecf6e; } .gps-dot.ok { background: #f5c542; } .gps-dot.bad { background: var(--danger); }
.field-label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.select, .input { width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--fill); outline: 0; }
.select { appearance: none; -webkit-appearance: none; }
.select option { background: var(--panel-solid); }
textarea.input { resize: vertical; }
.record-btn { width: 100%; margin-top: 14px; padding: 16px; border: 0; border-radius: 16px; background: var(--record); color: #fff; font-size: 18px; font-weight: 750;
  display: flex; align-items: center; justify-content: center; gap: 10px; }
.record-btn span { width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.rec-time { display: flex; align-items: baseline; justify-content: space-between; }
.rec-time b { font-size: 40px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.rec-state { color: var(--record); font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: .06em; display: flex; align-items: center; gap: 6px; }
.rec-state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
.rec-state.paused { color: var(--muted); } .rec-state.paused::before { animation: none; }
@keyframes pulse { 50% { opacity: .25; } }
.rec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 14px; font-variant-numeric: tabular-nums; }
.rec-grid div { background: var(--fill); border-radius: 12px; padding: 8px 10px; }
.rec-grid small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.rec-grid b { font-size: 18px; }
.rec-actions { display: flex; gap: 8px; }
#recFollow.active { background: var(--accent); color: var(--accent-text); }

/* ---- full screens (Home, Profile) ---- */
.screen { position: absolute; left: 0; right: 0; top: 0; bottom: var(--bottom); z-index: 5; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(18px + var(--safe-t)) 16px 24px; background: var(--bg); }
.screen-head h1, .profile-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.section-title { font-size: 18px; margin: 22px 0 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 14px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .chip.active { background: var(--text); color: var(--bg); }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.card { min-width: 0; display: flex; gap: 12px; padding: 12px; border-radius: 16px; background: var(--card); cursor: pointer; border: 1px solid transparent; text-align: left; width: 100%; }
.card:hover { border-color: var(--line); }
.card.visited, .feed-card.visited { opacity: .55; filter: grayscale(.7); }   /* a Discover line you've opened */
.sheet-back { margin: -8px 0 0 -8px; }
.card .thumb { width: 74px; height: 74px; border-radius: 12px; flex: none; background: #2a3038 center/cover; position: relative; overflow: hidden; }
.card .thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.card .body { min-width: 0; flex: 1; }
.card .body b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .body small { display: block; color: var(--muted); font-size: 13px; }
.card .tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; }

.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; font-weight: 800;
  background: var(--brand-grad); color: #fff; flex: none; }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--fill); overflow-x: auto; scrollbar-width: none; }
.segmented button { flex: 1; padding: 8px 6px; font-size: 14px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 600; white-space: nowrap; }
.segmented button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(15, 42, 51, 0.15); }
.segmented.small { padding: 3px; } .segmented.small button { padding: 5px 10px; font-size: 13px; }
.pane { padding-top: 12px; }
.list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--card); }
.list li.clickable { cursor: pointer; }
.list li .grow { flex: 1; min-width: 0; }
.list li b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.list li small { color: var(--muted); font-size: 13px; }
.fav-star { flex: none; width: 40px; height: 40px; margin: -8px -6px -8px 0; border: 0; background: none; display: grid; place-items: center; color: var(--muted); }
.fav-star svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.fav-star.on { color: var(--accent); } .fav-star.on svg { fill: currentColor; }
.list li .del { border: 0; background: none; color: var(--muted); font-size: 16px; padding: 4px 6px; }
.list li .del svg.x { width: 22px; height: 22px; stroke-width: 1.5; }
.list .swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.settings li { justify-content: space-between; }
.settings li span small { display: block; color: var(--muted); font-size: 12px; }
.about { font-size: 12px; margin-top: 18px; }
.switch { position: relative; }
.switch input, .toggle input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 999px; background: rgba(15, 42, 51, 0.15);
  position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after, .toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked, .toggle input:checked { background: #3ecf6e; }
.switch input:checked::after, .toggle input:checked::after { transform: translateX(18px); }
.switch i { display: none; }
.progress { position: relative; height: 30px; margin-top: 12px; border-radius: 10px; background: var(--fill); overflow: hidden; }
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); opacity: .5; transition: width .2s; }
.progress span { position: relative; display: block; text-align: center; line-height: 30px; font-size: 13px; font-weight: 600; }

/* ---- tab bar ---- */
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; height: var(--bottom); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(14, 17, 21, 0.96); border-top: 1px solid var(--line); backdrop-filter: blur(16px); }
.tabbar button { border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; }
.tabbar button .fill { fill: currentColor; }
.tabbar button[data-tab="record"] { color: var(--record); }
.tabbar button.active { color: var(--text); }
.tabbar button[data-tab="record"].active { color: var(--record); }
body.is-recording .tabbar button[data-tab="record"] svg { animation: pulse 1.4s infinite; }

/* ---- modal sheets ---- */
@keyframes sheet-in { from { transform: translate3d(0, 100%, 0); } to { transform: translate3d(0, 0, 0); } }
@keyframes fade-in { from { opacity: 0; } }
.modal:not([hidden]) { animation: sheet-in .22s cubic-bezier(.32, .72, 0, 1) backwards; will-change: transform; }   /* the iOS sheet curve, no end jolt */
.scrim:not([hidden]) { animation: fade-in .18s ease-out; }
.modal.closing { animation: none; transform: translate3d(0, 100%, 0) !important; transition: transform .22s cubic-bezier(.32, .72, 0, 1) !important; }
.scrim.closing { animation: none; opacity: 0 !important; transition: opacity .22s !important; }
@media (prefers-reduced-motion: reduce) { .modal:not([hidden]), .scrim:not([hidden]) { animation: none; } }
.scrim { position: absolute; inset: 0; z-index: 8; background: rgba(15, 42, 51, 0.35); }
.modal { position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; max-height: 88vh; overflow-y: auto; padding: 16px 18px calc(22px + var(--safe-b));
  background: var(--panel-solid); border-radius: 22px 22px 0 0; box-shadow: var(--shadow); border-top: 1px solid var(--line); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.modal-head h3 { font-size: 20px; }
.modal h4 { margin: 18px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.basemaps { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.basemaps button { padding: 0; border: 2px solid transparent; border-radius: 12px; background: none; overflow: hidden; text-align: left; }
.basemaps button img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #222; }
.basemaps button span { display: block; padding: 5px 4px; font-size: 12px; color: var(--muted); }
.basemaps button.active { border-color: var(--accent); }
.basemaps button.active span { color: var(--text); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; cursor: pointer; }
.toggle span { flex: 1; }
.toggle input { order: 2; }
.slider { display: block; padding: 6px 0; }
.slider > span { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.slider output { color: var(--text); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.range2 { display: grid; gap: 0; }
.custom { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(0, 220, 255, 0.07); border: 1px solid rgba(0, 220, 255, 0.25); }
.aspects { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: 6px; }
.aspects button { padding: 7px 0; min-height: 40px; border-radius: 8px; border: 1px solid var(--line); background: none; font-size: 12px; font-weight: 700; color: var(--muted); }
.aspects button.on { background: rgba(0, 220, 255, 0.85); color: #04151b; border-color: transparent; }
.sun { display: grid; gap: 6px; padding: 4px 0; }
.sun input[type=date] { background: var(--fill); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.sun .chip { justify-self: start; }

/* ---- popups, banners ---- */
/* Map popups: dark glass (FATMAP-like), with a round ✕ on the outside top-right corner so it never covers
   the content and is always easy to hit. The pointer arrow takes the same colour on every side. */
.maplibregl-popup { --pop: rgba(16, 18, 24, 0.82); }
.maplibregl-popup-content { background: var(--pop); color: #fff; border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip, .maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--pop) !important; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--pop) !important; }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--pop) !important; }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--pop) !important; }
.maplibregl-popup-close-button { position: absolute; top: -12px; right: -12px; width: 32px; height: 32px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; font-size: 20px; line-height: 1; color: #fff; background: rgba(16, 18, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.22); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
.maplibregl-popup-close-button::before { content: ''; position: absolute; inset: -8px; }   /* a bigger target for the finger */
.maplibregl-popup-close-button:hover { background: rgba(40, 44, 54, 0.95); }
.maplibregl-popup-content .inspect dt { color: rgba(255, 255, 255, 0.62); }
.maplibregl-popup-content .chip { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.18); color: #fff; font-weight: 600; }
.maplibregl-popup-content a { color: #7fd0ff; }
.maplibregl-popup-content .chip:focus, .maplibregl-popup-close-button:focus, .maplibregl-popup-content a:focus { outline: none; }
/* a long bulletin scrolls inside the popup (its height is set to the room it has: keepPopupClear) */
.maplibregl-popup-content > * { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.maplibregl-popup-content .aval { background: rgba(255, 255, 255, 0.08); }
.maplibregl-popup-content .aval-head span, .maplibregl-popup-content .aval p.hl { color: rgba(255, 255, 255, 0.62); }
.inspect { display: grid; grid-template-columns: auto auto; gap: 2px 16px; font-variant-numeric: tabular-nums; margin: 0; }
.inspect dt { color: var(--muted); }
.inspect dd { margin: 0; font-weight: 600; text-align: right; }
.inspect .title { grid-column: 1 / -1; font-weight: 700; margin-bottom: 4px; }
.inspect .chip { grid-column: 1 / -1; margin-top: 8px; }
.nav-banner { position: absolute; top: calc(66px + var(--safe-t)); left: 12px; right: 70px; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px 10px 16px; border-radius: 16px; background: #1f6f43; box-shadow: var(--shadow); }
.nav-banner.off { background: #8a3a1a; }
.nav-banner b { display: block; font-size: 17px; }
.nav-banner small { color: rgba(255, 255, 255, 0.8); }
.drawbar { position: absolute; top: calc(66px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 7; display: flex; gap: 8px; align-items: center;
  padding: 8px 10px 8px 16px; border-radius: 999px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); white-space: nowrap; }
.drop-hint { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; font-size: 22px; font-weight: 700; background: rgba(10, 14, 18, 0.75); border: 3px dashed var(--accent); }
.toast { position: fixed; left: 50%; top: calc(70px + var(--safe-t)); transform: translateX(-50%); z-index: 30; padding: 11px 16px; border-radius: 12px;
  background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.user-dot { width: 20px; height: 20px; border-radius: 50%; background: #2f8cff; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47, 140, 255, 0.25), 0 2px 6px rgba(0,0,0,.4); }
.cursor-dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #111; box-shadow: 0 0 0 3px rgba(255, 255, 255, .4); }
/* during a flythrough the dot can be dragged along the route: bigger, with a large invisible grip */
body.flying .cursor-dot { width: 22px; height: 22px; cursor: grab; touch-action: none; }
body.flying .cursor-dot::before { content: ''; position: absolute; inset: -16px; border-radius: 50%; }
.cursor-dot.dragging { width: 28px; height: 28px; cursor: grabbing; box-shadow: 0 0 0 6px rgba(0, 150, 156, .35); }   /* (MapLibre positions it with transform)*/

/* ---- desktop: dock everything in a left column ---- */
@media (min-width: 900px) {
  :root { --col: 400px; }
  .tabbar { left: 12px; bottom: 12px; width: var(--col); height: 64px; padding: 0; border-radius: 18px; border: 1px solid var(--line); }
  :root { --bottom: 84px; }
  .sheet { left: 12px; width: var(--col); border-radius: var(--radius); border: 1px solid var(--line); max-height: calc(100vh - 170px); overflow-y: auto; }
  .screen { left: 12px; top: 12px; width: var(--col); border-radius: var(--radius); border: 1px solid var(--line); }
  .topbar { left: calc(var(--col) + 24px); }
  .legends { left: auto; right: 70px; top: auto; bottom: 30px; align-items: flex-end; flex-direction: column-reverse; }
  .legend-bar { width: 300px; }
  .modal { left: auto; right: 12px; top: 12px; bottom: 12px; width: 380px; max-height: none; border-radius: 22px; border: 1px solid var(--line); }
  .scrim { background: transparent; }
  .nav-banner { left: calc(var(--col) + 24px); right: auto; width: 380px; }
  .drawbar { left: calc(50% + var(--col) / 2); }
  .maplibregl-ctrl-bottom-left { left: calc(var(--col) + 12px); bottom: 0; }
  .maplibregl-ctrl-bottom-right { bottom: 0; }
  body.sheet-open .maplibregl-ctrl-bottom-right, body.sheet-open .maplibregl-ctrl-bottom-left { display: block; }
}

/* ---- offline area selection (FATMAP-style frame) ---- */
.dl-frame { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.dl-hole { position: absolute; left: 22px; right: 22px; top: calc(24px + var(--safe-t)); bottom: var(--dl-bottom, 340px);
  border: 2px solid #fff; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(10, 14, 18, 0.55); }
.dl-hole span { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.6); font-size: 12px; font-weight: 700; white-space: nowrap; }
body.dl-mode .sheet:not(.dl-panel), body.dl-mode .fab-col, body.dl-mode .topbar, body.dl-mode .legends, body.dl-mode .tabbar, body.dl-mode .nav-banner, body.dl-mode .drawbar, body.dl-mode .maplibregl-ctrl-top-right { display: none !important; }
body.dl-mode .dl-panel { bottom: 0; padding-bottom: calc(14px + var(--safe-b)); display: grid; gap: 10px; }
.dl-maps { display: flex; gap: 8px; flex-wrap: wrap; }
.dl-maps label { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--fill); font-size: 14px; }
.dl-maps input { accent-color: var(--accent); width: 18px; height: 18px; }
.dl-stats { font-size: 13px; color: var(--muted); }
.dl-stats b { color: var(--text); }
@media (min-width: 900px) {
  .dl-hole { left: calc(var(--col) + 40px); right: 90px; top: 40px; bottom: 40px; }
  body.dl-mode .dl-panel { bottom: 12px; }
}

/* ===== FATMAP chrome (matched to FATMAP screenshots) ===== */
.topbar { left: 14px; right: 14px; top: calc(8px + var(--safe-t)); }
.search { max-width: none; height: 50px; padding: 0 6px 0 14px; gap: 6px; border-radius: 14px; background: #fff; border: 0; box-shadow: var(--shadow); }
.search input { font-size: 17px; font-weight: 500; color: var(--text); }
.search input::placeholder { color: var(--muted); font-weight: 400; }
.search-ic { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; color: var(--text); padding: 0; flex: none; }
.search .search-ic svg, .search > svg.search-ic { width: 24px; height: 24px; color: var(--text); }
.search > svg.search-ic { width: 22px; color: var(--muted); }
.search-sep { width: 1px; align-self: stretch; margin: 10px 2px; background: var(--line); }
.chips-row { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.chips-row::-webkit-scrollbar { display: none; }
.map-chip { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: #fff; color: var(--text);
  font-size: 15px; font-weight: 500; white-space: nowrap; box-shadow: var(--shadow); }
.map-chip svg { width: 18px; height: 18px; }
.map-chip.on { background: var(--on-bg); color: var(--on-text); }
/* season chip: ❄ Winter (ice blue) / ☀ Summer (warm) */
.map-chip.season { gap: 6px; padding: 0 14px 0 12px; font-weight: 600; }
.map-chip.season svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.map-chip.season.winter { color: #0b6fb3; } .map-chip.season.winter .sun { display: none; }
.map-chip.season.summer { color: #c26a00; } .map-chip.season.summer .snow { display: none; }
.fab-col { top: calc(124px + var(--safe-t)); right: 14px; gap: 14px; }
.fab { width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: var(--text); box-shadow: var(--shadow); backdrop-filter: none; -webkit-backdrop-filter: none; }
.fab svg { width: 24px; height: 24px; }
.fab.active { background: var(--on-bg); color: var(--on-text); }
.fab-bottom { top: auto; bottom: calc(var(--bottom) + 76px); }
body.sheet-open .fab-bottom, body[data-tab="record"] .fab-bottom { bottom: calc(var(--bottom) + 16px); }
.fab-big { width: 56px; height: 56px; }
.fab-big svg { width: 30px; height: 30px; color: var(--accent); stroke-width: 3; }
.fab-big .dot { fill: var(--accent); opacity: 1; stroke: none; }
.fab-big.located { background: var(--accent); }
.fab-big.located svg, .fab-big.located .dot { color: #fff; fill: #fff; }
#compassBtn .needle { width: 28px; height: 28px; transition: transform .1s linear; stroke: none; will-change: transform; }
/* (on the native map the needle has its angle every frame: easing it only drew the page over the map more) */
html.native-map #compassBtn .needle { transition: none; }
#compassBtn .needle .n { fill: #ff624c; }
#compassBtn .needle .s { fill: #0f2a33; }
.legends { top: calc(124px + var(--safe-t)); }
.discover-peek { position: absolute; left: 0; right: 0; bottom: var(--bottom); z-index: 4; padding: 8px 20px 16px; background: #fff;
  border-radius: 18px 18px 0 0; box-shadow: 0 -2px 12px rgba(15, 42, 51, 0.12); cursor: pointer; }
.discover-peek h3 { font-size: 20px; font-weight: 700; }
.discover-peek .muted { font-weight: 600; }
body[data-tab="map"] .discover-peek:not([hidden]) { display: block; }
body.sheet-open .discover-peek, body.dl-mode .discover-peek, body.drawing .discover-peek { display: none !important; }
.tabbar { background: #fff; border-top: 1px solid var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; }
.tabbar button { color: var(--muted); font-size: 12px; font-weight: 600; gap: 3px; }
.tabbar button svg.solid { width: 28px; height: 28px; fill: currentColor; stroke: none; }
.tabbar button.active, .tabbar button[data-tab="record"], .tabbar button[data-tab="record"].active { color: var(--muted); }
.tabbar button.active { color: var(--accent) !important; }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-scale { color: var(--text); }
@media (min-width: 900px) {
  .topbar { left: calc(var(--col) + 24px); right: auto; width: 520px; }
  .discover-peek { display: none !important; }
  .fab-bottom { bottom: 40px; }
}

/* ---- Explore guidebooks ---- */
.guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.guide { position: relative; border: 0; padding: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 3 / 4; background: #2a3038 center/cover; text-align: left; color: #fff; cursor: pointer; box-shadow: var(--shadow); }
.guide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(15, 42, 51, 0.85)); }
.guide div { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1; }
.guide small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.guide b { display: block; font-size: 17px; line-height: 1.2; margin-top: 2px; }
.guide span { display: block; font-size: 12px; opacity: .85; margin-top: 4px; }

/* ---- account & sync ---- */
.sync-box { display: grid; gap: 6px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.sync-box p { margin: 0 0 4px; }
.row-btns { display: flex; gap: 8px; margin-top: 10px; }
.link-btn { border: 0; background: none; color: var(--accent); padding: 8px 0 0; min-height: 36px; text-align: left; font-weight: 600; }
.link-btn.danger { color: var(--danger); display: block; padding-top: 14px; }
#legalLinks a { color: var(--accent); font-weight: 600; text-decoration: none; }

.section-title small { font-size: 13px; font-weight: 500; margin-left: 6px; }
#resortSearch { margin-bottom: 10px; }

/* ---- flythrough controller ---- */
.fly-bar { position: absolute; left: 12px; right: 12px; bottom: calc(var(--bottom) + 12px); z-index: 5; padding: 10px 12px; border-radius: 18px;
  display: grid; gap: 8px; color: #fff; background: rgba(16, 18, 24, 0.82); border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); }
.fly-row { display: flex; align-items: center; gap: 10px; }
.fly-btn { width: 40px; height: 40px; flex: none; border: 0; padding: 0; -webkit-appearance: none; appearance: none; border-radius: 50%; background: #fff; color: #10121a; font-size: 15px; font-weight: 700; display: grid; place-items: center; }
#flyStop { background: rgba(255, 255, 255, 0.14); color: #fff; }
#flyStop svg { stroke: currentColor; }
/* the position slider: light-blue track (app colour), round knob; a tall invisible grip for the finger */
.fly-range { position: relative; flex: 1; min-width: 0; height: 36px; touch-action: none; cursor: pointer; }
.fly-range::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: rgba(0, 150, 156, 0.35); }
.fly-range .fly-fill { position: absolute; left: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--accent); width: 0; }
.fly-range .fly-knob { position: absolute; top: 50%; left: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #fff;
  border: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); transition: width .12s, height .12s, margin .12s; }
.fly-range.active .fly-knob { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
.fly-opts { flex-wrap: wrap; gap: 6px; }
.fly-pos { font-size: 13px; font-weight: 700; color: #fff; margin-right: auto; font-variant-numeric: tabular-nums; }
.fly-chip { border: 0; border-radius: 999px; padding: 6px 11px; min-height: 40px; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 13px; font-weight: 600; }
.fly-chip.primary { background: var(--accent); color: #fff; }
/* while flying the controls take the route sheet's place at the bottom (more track in view) */
body.flying #advSheet, body.flying .fab-bottom, body.flying .maplibregl-ctrl-bottom-left, body.flying .maplibregl-ctrl-bottom-right { display: none !important; }
body.flying .legends { display: none !important; }
@media (min-width: 900px) { .fly-bar { left: calc(var(--col) + 24px); right: auto; width: 520px; } }

/* ---- ski tours ---- */
.tour-info { margin-top: 12px; }
.tour-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tour-chip { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--fill); color: var(--text); }
.tour-chip.level { color: #fff; }
.tour-credit { display: block; margin-top: 10px; font-size: 12px; color: var(--accent); text-decoration: none; }
#advSheet.pin-mode #advStats, #advSheet.pin-mode #profileCanvas, #advSheet.pin-mode .actions { display: none; }
.tour-pin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.45); }
.thumb .tour-pin.small { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.card .thumb { position: relative; }
.lvl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.aspect-row { align-items: center; margin-top: -4px; }
.aspect-row .muted { font-size: 13px; margin-right: 2px; }

.inspect .wildlife { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 1px; margin: 0 0 8px; padding: 8px 10px; border-radius: 10px;
  background: rgba(47, 158, 68, 0.1); border-left: 3px dashed #2f9e44; max-width: 240px; }
.inspect .wildlife.prohibited, .inspect .wildlife.regulated { background: rgba(47, 158, 68, 0.14); border-left: 3px solid #1e7b34; }
.inspect .wildlife b { display: flex; align-items: center; gap: 6px; color: #1e7b34; }
.inspect .wildlife .x { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #1e7b34; color: #fff; font-size: 11px; }
.inspect .wildlife .when { color: var(--muted); }
.inspect .wildlife span { font-size: 13px; }
.inspect .petzl { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 1px; margin: 0 0 8px; padding: 8px 10px; border-radius: 10px;
  background: rgba(59, 44, 133, 0.09); border-left: 3px solid #3b2c85; max-width: 240px; }
.inspect .petzl b { color: #3b2c85; }
.inspect .petzl.delicate { background: rgba(232, 89, 12, 0.1); border-left-color: #e8590c; }
.inspect .petzl.delicate b { color: #d9480f; }
.inspect .petzl span { font-size: 13px; }
.inspect .petzl small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.inspect .aval { grid-column: 1 / -1; margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; background: rgba(127, 127, 127, 0.1); font-size: 13px; max-width: 260px; }
.inspect .aval-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inspect .aval-head i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.25); }
.inspect .aval-head span { color: var(--muted); font-size: 12px; }
.inspect .aval-top { display: flex; align-items: center; gap: 10px; }
.inspect .aval-rose { width: 58px; height: 58px; flex: none; }
.inspect .aval-rose text { font-size: 7px; font-weight: 700; fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, 0.6); stroke-width: 1.5px; }
.inspect .aval-region { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.inspect .aval p { margin: 4px 0; }
.inspect .aval p.hl { color: var(--muted); }
.inspect .aval ul { margin: 4px 0; padding-left: 16px; }
.inspect .aval li { margin: 1px 0; }
.inspect .aval li.here { font-weight: 600; }
.inspect .aval li.here::marker { content: '⚠ '; }
.inspect .aval a { font-size: 11px; }
.legend .steep-key { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; max-width: 200px; line-height: 1.25; }
.legend .steep-key i.hatch, .inspect .steep i.hatch { flex: none; width: 14px; height: 14px; border-radius: 3px; background: repeating-linear-gradient(45deg, #6e0014 0 2px, transparent 2px 7px), #ff9900; }
.inspect .aval p.steep { padding: 6px 8px; border-radius: 8px; }
.inspect .aval p.steep.over { background: rgba(229, 56, 59, 0.22); }
.inspect .aval p.steep.ok { background: rgba(63, 179, 92, 0.18); }
.legend small { display: block; max-width: 190px; margin-top: 4px; font-size: 10px; color: var(--muted); }
.inspect .wildlife a { font-size: 13px; margin-top: 2px; }

/* ---- social (www/js/social.js) ---- */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; display: block; }   /* (profile photos are tall: the face) */
.avatar.small { width: 34px; height: 34px; font-size: 13px; flex: none; }
.role-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: rgba(0, 150, 156, 0.14); color: var(--accent); vertical-align: middle; white-space: nowrap; }
.role-badge.role-guide { background: rgba(229, 56, 59, 0.12); color: #c3261b; }
.profile-social { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 6px 0 0; }
.profile-social .link-btn { padding: 0; font-weight: 600; color: var(--text); }
.bio { margin: 10px 0 4px; white-space: pre-wrap; }
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 12px; }
.feed { display: grid; gap: 14px; margin-bottom: 22px; }
.feed-card { border-radius: 18px; background: var(--card); overflow: hidden; cursor: pointer; }
.feed-who { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px 10px; border: 0; background: none; text-align: left; font: inherit; color: inherit; }
.feed-who b { font-weight: 700; }
.feed-who small { margin-left: auto; }
.feed-photo { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.route-thumb { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: #2a3038; }
.route-thumb .win { position: absolute; top: 0; left: 50%; height: 100%; aspect-ratio: 1; transform: translateX(-50%); }
.route-thumb .win img { position: absolute; width: 100%; height: 100%; }
.route-thumb .win svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.feed-body { padding: 10px 14px 14px; }
.feed-body b { display: block; font-size: 17px; margin: 2px 0; }
.feed-text { margin: 6px 0 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.adv-owner { display: flex; align-items: center; gap: 8px; padding: 0 0 6px; border: 0; background: none; font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.photo-strip { display: flex; gap: 8px; overflow-x: auto; margin: 10px 0; scrollbar-width: none; }
.photo-strip img { height: 96px; border-radius: 12px; flex: none; cursor: pointer; }
.photo-strip.edit .photo { position: relative; width: 84px; height: 84px; flex: none; border-radius: 12px; overflow: hidden; background: var(--fill); }
.photo-strip.edit .photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-strip.edit .photo .del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: #fbfbf9; color: var(--muted); box-shadow: 0 1px 4px rgba(20, 20, 19, .10), 0 4px 14px rgba(20, 20, 19, .14); display: grid; place-items: center; padding: 0; }
.photo-strip.edit .photo .del svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.5; }
.photo-strip.edit .photo.add { border: 1px dashed var(--line); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.avatar-edit { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.modal.tall { max-height: 86vh; overflow-y: auto; }
.list li.person .avatar.small { width: 40px; height: 40px; }
.list li .check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.list li.checked .check { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--panel-solid); }
.radio-list { display: grid; gap: 4px; margin: 8px 0 10px; }
.radio-list .radio { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--fill); cursor: pointer; }
.action-sheet { display: grid; gap: 6px; padding-bottom: calc(14px + var(--safe-b, 0px)); }
.action-sheet .action { padding: 15px; border: 0; border-radius: 14px; background: var(--fill); font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.action-sheet .action.danger { color: var(--danger); }
.action-sheet .action.cancel { margin-top: 6px; background: transparent; color: var(--muted); }
/* Instagram-style actions under the picture: outline heart and bubble, count beside each. */
.feed-stats { display: flex; align-items: center; gap: 2px; padding: 6px 8px 0; color: var(--text); }
.feed-stats button { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 6px; border: 0; background: none;
  font: inherit; font-size: 15px; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.feed-stats b { font-weight: 600; font-variant-numeric: tabular-nums; }
.feed-stats svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; transition: transform .15s; }
.feed-stats button:active svg { transform: scale(.88); }
.feed-stats + .feed-body { padding-top: 0; }
.heart path { transition: fill .15s, stroke .15s; }
.feed-stats .like.on .heart, .chip.on .heart { fill: #ff3040; stroke: #ff3040; }
.feed-stats .like.pop svg { animation: heart-pop .38s cubic-bezier(.32,.72,0,1); }
@keyframes heart-pop { 0% { transform: scale(1); } 35% { transform: scale(1.3); } 100% { transform: scale(1); } }
.eyebrow-row { display: flex; align-items: center; gap: 8px; }
.eyebrow-row .adv-actions { flex: none; padding: 0; margin: -14px -6px -14px auto; }   /* on the type line, at the right edge; no taller line */
#advSheet .title-block { flex: 1; min-width: 0; }
/* "Liked by lina and 3 others" with the latest faces overlapping */
.liked-by { display: flex; align-items: center; gap: 0; width: 100%; min-height: 32px; padding: 0; border: 0; background: none;
  font: inherit; font-size: 14px; color: var(--text); text-align: left; cursor: pointer; }
.liked-by .avatar.tiny { width: 22px; height: 22px; font-size: 9px; border: 2px solid var(--panel-solid, #fff); margin-right: -7px; flex: none; }
.liked-by .avatar.tiny:last-of-type { margin-right: 6px; }
.liked-by b { font-weight: 700; margin: 0 .25em; }
.liked-by b:first-of-type { margin-left: .25em; }
.more-comments { display: block; padding: 6px 0 2px; min-height: 32px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.comments { list-style: none; margin: 8px 0 10px; padding: 0; display: grid; gap: 14px; }
.comments .comment { position: relative; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.comments .comment .c-row { display: flex; gap: 12px; align-items: flex-start; position: relative; z-index: 1; }
.comments .comment .avatar { width: 32px; height: 32px; font-size: 12px; cursor: pointer; }
.comments .comment .grow { flex: 1; min-width: 0; }
.comments .comment p { margin: 1px 0 0; font-size: 14.5px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.comments .who { font-weight: 700; cursor: pointer; }
.comment-meta { display: flex; align-items: center; gap: 14px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.comment-meta button { padding: 2px 0; border: 0; background: none; font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.comment-heart { flex: none; width: 32px; height: 32px; margin: 2px -6px 0 0; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.comment-heart svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.comment-heart.on svg { fill: #ff3040; stroke: #ff3040; }
.comment-heart.pop svg { animation: heart-pop .38s cubic-bezier(.32,.72,0,1); }
/* Your comment: your face, a borderless field and a blue Post (grey until you type) */
.comment-form { display: flex; align-items: center; gap: 10px; padding: 8px 0 4px; border-top: 1px solid var(--line); }
.comment-form .avatar { width: 32px; height: 32px; font-size: 12px; }
.comment-form .input { flex: 1; margin: 0; border: 0; background: transparent; padding: 10px 0; font-size: 15px; }
.post-btn { border: 0; background: none; padding: 10px 2px; min-height: 40px; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; }
.post-btn:disabled { opacity: .4; }
/* Double-tap like on a feed picture */
.feed-media { position: relative; }
.feed-media .feed-photo { display: block; }
.big-heart { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.big-heart svg { width: 96px; height: 96px; fill: #fff; stroke: none; filter: drop-shadow(0 4px 14px rgba(0,0,0,.35)); animation: big-heart .9s cubic-bezier(.32,.72,0,1) forwards; }
@keyframes big-heart { 0% { transform: scale(0); opacity: 0; } 15% { transform: scale(1.2); opacity: 1; } 30% { transform: scale(.95); } 45%, 75% { transform: scale(1); opacity: 1; } 100% { transform: scale(.6) translateY(-30px); opacity: 0; } }
/* Activity, like Instagram */
#activityList { gap: 0; }
#activityList li.notif-sec { display: block; padding: 16px 2px 6px; background: none; font-weight: 700; font-size: 16px; }
#activityList li.notif { gap: 12px; padding: 8px 2px; border-radius: 0; background: none; align-items: center; }
#activityList li.notif.unread { background: none; }
.notif-faces { position: relative; flex: none; width: 44px; height: 44px; cursor: pointer; }
.notif-faces .avatar { width: 44px; height: 44px; font-size: 15px; }
.notif-faces.two .avatar { position: absolute; width: 32px; height: 32px; font-size: 12px; }
.notif-faces.two .avatar:first-child { right: 0; bottom: 0; z-index: 1; border: 2px solid var(--panel-solid, #fff); }
.notif-faces.two .avatar:last-child { left: 0; top: 0; }
.notif-text { flex: 1; min-width: 0; margin: 0; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.notif-text b, #activityList .notif-text b { display: inline; font-weight: 700; white-space: normal; }
.notif-time { color: var(--muted); }
.notif-thumb { flex: none; width: 44px !important; height: 44px; aspect-ratio: auto !important; border-radius: 6px; object-fit: cover; }
.notif-acts { display: flex; gap: 6px; flex: none; }
.ig-btn { flex: none; min-height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--fill); font: inherit; font-size: 13.5px; font-weight: 700; color: var(--text); cursor: pointer; }
.ig-btn.primary { background: var(--accent); color: #fff; }
.ig-btn:disabled { opacity: .5; }
.icon-btn.small { width: 28px; height: 28px; font-size: 16px; }
.icon-btn.bell { position: relative; width: 36px; height: 36px; }
.icon-btn.bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.icon-btn.bell i { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff3b6b;
  color: #fff; font-size: 11px; font-style: normal; font-weight: 700; display: grid; place-items: center; }
.list li.unread { background: rgba(0, 150, 156, 0.08); }
.list li.person span { display: block; }

#searchResults li.note { color: var(--muted); pointer-events: none; font-size: 14px; }
.discover-peek { touch-action: none; }

/* ---- Profile, like a social app (Instagram layout, Chutemap colours) ---- */
.avatar svg { width: 100%; height: 100%; display: block; }
.avatar.big { width: 86px; height: 86px; font-size: 30px; }
.ig-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.ig-top .row-btns { margin: 0; }
.ig-handle { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; padding: 0; color: var(--text);
  font-size: 22px; font-weight: 800; letter-spacing: -.02em; min-width: 0; }
.ig-handle span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-handle.placeholder { color: var(--accent); font-size: 18px; }
.ig-handle .chev svg { width: 20px; height: 20px; stroke-width: 2.5; }
.ig-head { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; }
/* Ring around the picture in the brand gradient, white gap inside — like a story ring. */
.ava-ring { flex: none; padding: 3px; border: 0; border-radius: 50%; background: conic-gradient(from 210deg, #00969c, #0f2a33, #00969c); }
.ava-ring > .avatar { border: 3px solid var(--bg); }
.ig-who { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.ig-who h1 { font-size: 16px !important; font-weight: 750 !important; margin: 0; letter-spacing: 0 !important; }
.follows-you { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--fill-strong); color: var(--muted); }
#profileScreen .bio, #userBody .bio { margin: 4px 0 2px; font-size: 14.5px; }
#profileWebsite, #userBody .link { display: inline-block; font-weight: 650; color: var(--navy); text-decoration: none; font-size: 14px; margin-bottom: 2px; }
.ig-actions { display: flex; gap: 8px; margin: 12px 0; }
.ig-actions .chip { flex: 1; font-weight: 650; padding: 9px 10px; border-radius: 10px; }
.ig-actions .chip.icon { flex: none; width: 42px; padding: 0; display: grid; place-items: center; }
.ig-actions .chip.icon svg { width: 20px; height: 20px; }
.ig-actions .chip.primary { background: var(--accent); }
#profRequests { margin-bottom: 12px; }
.small-note { font-size: 12.5px; margin: 8px 2px 14px; }

/* Points: deep navy card with the light-blue progress bar. */
.points-card { display: block; width: 100%; text-align: left; border: 0; border-radius: 16px; padding: 14px 16px 12px; margin: 0 0 4px;
  color: var(--text); background: linear-gradient(180deg, #eaf7ff, #fff 70%); box-shadow: inset 0 0 0 1px var(--line); }
.points-card.flat { margin-bottom: 14px; }
.pc-top { display: flex; align-items: center; gap: 12px; }
.pc-badge { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font-weight: 850; font-size: 17px; color: #fff;
  background: var(--navy); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.pc-pts { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.pc-level { display: block; font-size: 12.5px; color: var(--muted); }
.pc-rank { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: rgba(0, 150, 156, .14); color: #0a86c8; white-space: nowrap; }
.pc-go { width: 18px; height: 18px; opacity: .6; flex: none; }
.pc-scale { margin: 14px 0 10px; }
.pc-track svg { display: block; width: 100%; height: auto; overflow: visible; }
.pc-track path { fill: none; stroke-linejoin: miter; stroke-linecap: butt; }
.pc-track .ahead { stroke: rgba(0, 150, 156, .5); stroke-width: 2.5; stroke-dasharray: 7 5; }
.pc-track .done { stroke: var(--accent); stroke-width: 4.5; }
.pc-track .flag circle { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.pc-track .flag text { fill: var(--navy); stroke: none; font-size: 10.5px; font-weight: 850; text-anchor: middle; }
.pc-track .flag.reached circle { fill: var(--accent); }
.pc-track .flag.reached text { fill: #fff; }
.pc-track .lbl { stroke: none; font-size: 11.5px; }
.pc-track .nm { fill: var(--navy); font-weight: 750; }
.pc-track .go { fill: #0a86c8; font-weight: 700; }
.pc-track .you { fill: #fff; stroke: var(--navy); stroke-width: 3; }
.pc-stats { display: flex; gap: 18px; font-size: 12px; color: var(--muted); }
.pc-stats b { color: var(--text); font-size: 14px; margin-right: 4px; }

/* Ranking */
.rank { list-style: none; padding: 0; margin: 12px 0; }
.rank li { gap: 10px; }
.rank li.me { background: rgba(0, 150, 156, .1); border-radius: 12px; }
.rank-pos { width: 26px; flex: none; text-align: center; font-weight: 800; color: var(--muted); }
.rank-pos.top1 { color: #e0a100; } .rank-pos.top2 { color: #8a96a8; } .rank-pos.top3 { color: #c0703a; }
.rank-pts { text-align: right; display: flex; flex-direction: column; }
.rank-pts b { font-size: 15px; }
.points-how { margin-top: 8px; font-size: 14px; }
.points-how summary { font-weight: 700; color: var(--accent); cursor: pointer; padding: 6px 0; }
.points-how ul { padding-left: 18px; margin: 6px 0; }

/* Invite */
.invite-hero { text-align: center; padding: 4px 8px 14px; }
.invite-hero > b { display: block; font-size: 19px; margin: 10px 0 4px; }
.invite-hero p { margin: 0; font-size: 14px; }
.invite-art { width: 76px; height: 76px; margin: 0 auto; border-radius: 22px; background: var(--navy); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(15, 42, 51, .25); }
.invite-art svg { width: 54px; height: 54px; stroke: none; fill: var(--accent); }
.invite-art .snow { fill: #fff; }
.invite-art .chute { fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: butt; }
.invite-link { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--fill); margin-bottom: 10px; }
.invite-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; color: var(--navy); }
#inviteSheet .chip.wide { margin-bottom: 8px; padding: 12px; font-weight: 650; }
.center { text-align: center; }

/* Edit: avatar picker and @username field */
.avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin: 4px 0 6px; }
.avatar-pick { aspect-ratio: 1; border-radius: 50%; padding: 0; border: 2px solid transparent; overflow: hidden; background: none; }
.avatar-pick svg { width: 100%; height: 100%; display: block; }
.avatar-pick.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
@media (max-width: 360px) { .avatar-grid { grid-template-columns: repeat(6, 1fr); } }
.handle-input { position: relative; }
.handle-input span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 650; pointer-events: none; }
.handle-input .input { padding-left: 28px; }
.handle-state { display: block; min-height: 16px; font-size: 12.5px; color: var(--muted); margin: 3px 2px 0; }
.handle-state.ok { color: #12a150; } .handle-state.bad { color: var(--danger); }
.req-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: var(--card); border-radius: 14px; padding: 10px 12px; margin: 0 0 12px; text-align: left; color: var(--text); box-shadow: 0 1px 4px rgba(15, 42, 51, .08); }
.req-row[hidden] { display: none; }
.req-row b { font-size: 14.5px; } .req-row small { flex: 1; color: var(--muted); font-size: 12.5px; }
.req-row svg { width: 18px; height: 18px; color: var(--muted); }
.req-dot { min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; }
.points-card.flat .pc-go { display: none; }
#rankList .role-badge { display: none; }
.avatar-edit .grow { display: flex; align-items: center; gap: 14px; }
.toggle span small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.field-label small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); margin-left: 4px; }
.signin-card { border-radius: 16px; padding: 14px 16px; margin: 12px 0; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, rgba(0, 150, 156, .55), transparent 55%), var(--navy); }
.signin-card[hidden], #profileActions[hidden] { display: none; }
.signin-card b { font-size: 16px; }
.signin-card p { margin: 4px 0 0; font-size: 13.5px; color: rgba(255, 255, 255, .78); }
.signin-card .chip { flex: 1; font-weight: 650; }
.signin-card .chip:not(.primary) { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .2); color: #fff; }
#authSheet .chip.wide { margin-top: 10px; padding: 12px; font-weight: 650; }
.avatar svg.nobody { width: 56%; height: 56%; fill: rgba(255, 255, 255, .9); stroke: none; }
#authSheet .link-btn { display: block; }
/* Sign in / create account: one sheet, two clearly different screens */
#authSheet.signin .only-signup, #authSheet.signup .only-signin { display: none !important; }
.auth-hero { text-align: center; margin: -8px 0 8px; }
.auth-hero h2 { margin: 12px 0 4px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.auth-hero p { margin: 0 12px; font-size: 14px; }
#authSheet.signup .invite-art { background: var(--accent); }
#authSheet.signup .invite-art svg { fill: var(--navy); }
/* iPhone: a little more compact, so Sign in and "New to Chutemap?" fit above the keyboard (app.js
   keepRoomForKeyboard); the logo stays clear of the grabber, and moves up beside a back button */
html.kb-glide #authSheet .auth-hero { margin: -10px 0 4px; }
html.kb-glide #authSheet .modal-head:has(.back-btn:not([hidden])) + .auth-hero { margin-top: -30px; }
html.kb-glide #authSheet .invite-art { width: 44px; height: 44px; border-radius: 13px; }
html.kb-glide #authSheet .invite-art svg { width: 32px; height: 32px; }
html.kb-glide #authSheet .auth-hero h2 { margin-top: 6px; }
.auth-switch { text-align: center; margin: 14px 0 0; font-size: 14.5px; color: var(--muted); }
.auth-switch .link-btn { display: inline !important; padding: 0; font-size: 14.5px; }
.center-btn { margin: 8px auto 0; width: fit-content; }
.auth-legal { text-align: center; font-size: 12px; margin: 10px 0 0; }
#authSheet.signin .only-reset, #authSheet.signup .only-reset, #authSheet.reset .only-signin, #authSheet.reset .only-signup, #authSheet.reset .no-reset { display: none !important; }
.pw-rules { list-style: none; padding: 0; margin: 6px 2px 2px; font-size: 12.5px; color: var(--muted); }
.pw-rules li::before { content: "○"; display: inline-block; width: 18px; }
.pw-rules li.ok { color: #12a150; }
.pw-rules li.ok::before { content: "✓"; }

/* Avatar maker */
.avatar.skier { background: none; }
.skier-cta { display: flex; align-items: center; gap: 12px; width: 100%; margin: 10px 0 4px; padding: 10px 12px; border-radius: 16px; text-align: left;
  border: 0; color: #fff; background: var(--brand-grad, linear-gradient(135deg, #00969c, #0f2a33)); }
.skier-cta-art { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex: none; border: 2px solid rgba(255, 255, 255, .7); }
.skier-cta-art svg { width: 100%; height: 100%; display: block; }
.skier-cta > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.skier-cta b { font-size: 16px; }
.skier-cta small { font-size: 12.5px; opacity: .85; }
.skier-cta > svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.skier-sheet { height: 92vh; max-height: 92vh; padding-bottom: 0; display: flex; flex-direction: column; overflow: hidden; }   /* fixed: switching tabs never changes its height */
.sk-stage { position: relative; display: flex; justify-content: center; flex: none; }
.sk-preview { height: 30vh; max-height: 260px; aspect-ratio: 2 / 3; border-radius: 20px; overflow: hidden; box-shadow: 0 8px 24px rgba(15, 42, 51, .25); }
.sk-preview svg, .sk-opt svg, #skBust svg { width: 100%; height: 100%; display: block; }
#skBust { position: absolute; left: 4px; bottom: 0; width: 64px; height: 64px; border: 3px solid var(--bg); }
.sk-dice { position: absolute; right: 4px; bottom: 0; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: #fff;
  display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0, 150, 156, .4); }
.sk-dice svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2; }
.sk-dice svg circle { fill: #fff; stroke: none; }
.sk-dice:active { transform: rotate(20deg) scale(.94); }
.sk-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 6px; flex: none; scrollbar-width: none; }
.sk-tabs::-webkit-scrollbar { display: none; }
.sk-tab { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--fill); font-weight: 600; white-space: nowrap; }
.sk-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.sk-options { overflow-y: auto; flex: 1; min-height: 120px; padding-bottom: 8px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sk-row.styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sk-row.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sk-opt { position: relative; padding: 0; border: 2px solid transparent; overflow: hidden; }
.sk-row.styles .sk-opt { aspect-ratio: 1; border-radius: 16px; background: var(--fill); }
.sk-row.styles .sk-opt.tall { aspect-ratio: 2 / 3; }
.sk-opt span { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 2px 3px; font-size: 10.5px; font-weight: 650; color: #fff;
  background: linear-gradient(transparent, rgba(15, 42, 51, .75)); text-align: center; }
.sk-row.swatches .sk-opt { width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.sk-opt.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.sk-foot { flex: none; padding: 8px 0 calc(14px + var(--safe-b)); background: var(--bg); }
.sk-foot .chip.wide { margin-top: 0; }

/* Profile hero, like Snapchat's: your skier big on its background colours */
.sc-hero { position: relative; margin: calc(-18px - var(--safe-t)) -16px 0; padding: calc(6px + var(--safe-t)) 16px 14px; overflow: hidden; color: #fff;
  background: linear-gradient(165deg, var(--hero1, #00969c), var(--hero2, #0f2a33)); }
.sc-hero::before { content: ''; position: absolute; left: -10%; right: -10%; bottom: 0; height: 58%; pointer-events: none;
  background: radial-gradient(120% 60% at 50% 100%, rgba(255, 255, 255, .18), transparent 70%); }
.sc-hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(transparent 52%, rgba(15, 42, 51, .6)); }
.sc-bar { position: relative; z-index: 2; display: flex; justify-content: flex-end; gap: 8px; }
.sc-pill, .sc-round { position: relative; height: 40px; border: 0; border-radius: 20px; color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(15, 42, 51, .42); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-weight: 650; font-size: 16px; }
.sc-pill { padding: 0 16px 0 13px; margin-right: auto; }
.sc-round { width: 40px; }
.sc-pill svg, .sc-round svg { width: 22px; height: 22px; stroke: #fff; }
.sc-count { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px;
  background: #ff3b5c; color: #fff; font-size: 11px; font-style: normal; font-weight: 750; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.sc-dot { position: absolute; top: 3px; right: 3px; width: 11px; height: 11px; border-radius: 50%; background: #ff3b5c; border: 2px solid #fff; }
.sc-skier { position: absolute; z-index: 0; left: 50%; top: calc(2px + var(--safe-t)); height: 250px; aspect-ratio: 2 / 3; transform: translateX(-30%);
  border: 0; padding: 0; background: none; }
.sc-skier svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 10px 18px rgba(15, 42, 51, .35)); }
.sc-skier.ghost svg { opacity: .45; }
.sc-make { position: absolute; left: 50%; top: 34%; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  background: rgba(255, 255, 255, .92); color: var(--navy); font-weight: 750; font-size: 14px; box-shadow: 0 4px 14px rgba(15, 42, 51, .3); }
.sc-id { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; margin-top: 118px; pointer-events: none; }
.sc-id > * { pointer-events: auto; }
.sc-ava { position: relative; flex: none; border: 0; padding: 0; background: none; border-radius: 50%; }
.sc-ava .avatar.big { width: 78px; height: 78px; border: 3px solid rgba(255, 255, 255, .9); box-shadow: 0 6px 18px rgba(15, 42, 51, .35); }
.sc-pen { position: absolute; right: -4px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(15, 42, 51, .35); }
.sc-pen svg { width: 17px; height: 17px; stroke: var(--navy); stroke-width: 2.4; fill: var(--navy); }
.sc-names { min-width: 0; display: grid; gap: 2px; justify-items: start; }
.sc-names h1 { margin: 0; font-size: 23px !important; font-weight: 800 !important; letter-spacing: -.01em !important; color: #fff;
  text-shadow: 0 2px 10px rgba(15, 42, 51, .5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sc-handle { border: 0; background: none; padding: 0; color: rgba(255, 255, 255, .88); font-size: 16px; font-weight: 600; text-shadow: 0 1px 6px rgba(15, 42, 51, .5); }
.sc-handle.placeholder { color: #fff; text-decoration: underline; }
.sc-names .role-badge { margin-top: 2px; }
.sc-actions { position: relative; z-index: 2; display: flex; gap: 10px; margin-top: 12px; }
.sc-btn { flex: 1; height: 40px; border-radius: 20px; border: 0; color: #fff; font-size: 15.5px; font-weight: 650;
  background: rgba(255, 255, 255, .2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.sc-btn.outline { background: rgba(15, 42, 51, .35); box-shadow: inset 0 0 0 2px #fff; }
.sc-btn:active, .sc-pill:active, .sc-round:active { transform: scale(.97); }
#profileScreen .signin-card { margin-top: 12px; }
.pc-pts { white-space: nowrap; }
.sk-range-label { display: flex; justify-content: space-between; align-items: baseline; }
.sk-range-label b { color: var(--text); font-size: 15px; letter-spacing: 0; text-transform: none; }
.sk-range { width: 100%; accent-color: var(--accent); height: 28px; }
.sk-range-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: -2px; }

/* Profile QR code */
/* Sits under Invite, out of the bar's flow so the hero layout doesn't shift; both pills share a
   width so they stack as a matching pair. */
.sc-bar .sc-pill { width: 112px; padding: 0; }
.sc-pill.share { position: absolute; left: 0; top: 50px; }
/* The tile: exact 3px padding so the margin is even on both sides; radius = padding + the rounded
   finder squares' own radius, so the corners run concentric (like a Snapcode). */
.sc-pill.share .qr-mini { width: 28px; height: 28px; padding: 3px; box-sizing: border-box; background: #8fe0e2; border-radius: 5px; }
.sc-pill:not(.share) { margin-right: 0; }
.sc-bar .sc-pill:first-child { margin-right: auto; }
.qr-mini { width: 28px; height: 28px; border-radius: 7px; overflow: hidden; display: block; flex: none; }
.qr-mini svg, .qr-code svg { width: 100%; height: 100%; display: block; }
.qr-card { margin: 8px auto 14px; padding: 18px 18px 14px; max-width: 320px; border-radius: 28px; background: var(--brand-grad, linear-gradient(135deg, #00969c, #0f2a33));
  box-shadow: 0 10px 30px rgba(15, 42, 51, .3); color: #fff; }
.qr-code { aspect-ratio: 1; border-radius: 20px; overflow: hidden; box-shadow: 0 4px 16px rgba(15, 42, 51, .35); }
.qr-who { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.qr-who .avatar.small { width: 40px; height: 40px; border: 2px solid #fff; }
.qr-who b { display: block; font-size: 17px; }
.qr-who small { opacity: .85; font-size: 14px; }
.qr-hint { margin: 10px 0 0; font-size: 13px; opacity: .8; }
.qr-sheet .chip.wide { margin-top: 8px; }

/* Profile stats card: four counts, then the most-skied area. Level ladder in the points sheet. */
.pstats { margin: 12px 0 10px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(15, 42, 51, .06); overflow: hidden; }
.pstats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.pstats-grid > * { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 12px 2px 10px; border: 0; background: none; color: var(--text); min-width: 0; font: inherit; }
.pstats-grid > * + * { box-shadow: inset 1px 0 0 var(--line); }
.pstats-grid > button:active { background: var(--line); }
.pstats-grid b { font-size: 21px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.pstats-grid span { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pstats-top { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); }
.pstats-top .grow { min-width: 0; display: grid; }
.pstats-top small { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pstats-top b { font-size: 15.5px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pstats-top b.none { font-weight: 550; color: var(--muted); }
.pstats-ico { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(150deg, #00969c, #0f2a33); }
.pstats-ico svg { width: 22px; height: 22px; fill: #fff; stroke: #0f2a33; stroke-width: 1.2; stroke-linejoin: round; }
.pstats-days { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.levels-title { margin: 4px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.levels { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.levels li { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--line); }
.levels li:first-child { border-top: 0; }
.levels li .grow { min-width: 0; display: grid; }
.levels li small { color: var(--muted); font-size: 12.5px; }
.lv-badge { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; font-weight: 800; font-size: 13px;
  background: var(--line); color: var(--muted); }
.lv-left { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.levels li.done .lv-badge { background: rgba(0, 150, 156, .18); color: var(--accent); }
.levels li.done .lv-left { color: var(--muted); font-weight: 600; }
.levels li.current { background: rgba(0, 150, 156, .1); }
.levels li.current .lv-badge { background: var(--accent); color: #fff; }
.levels li.current .lv-left { color: var(--accent); }

/* Weekly streak row in the stats card */
.pstats-top.streak .pstats-ico { background: linear-gradient(150deg, #ffb347, #ff5f2e); }
.pstats-top .flame { font-size: 19px; line-height: 1; }
.pstats-top.season .pstats-ico { background: linear-gradient(150deg, #8fd8ff, #2f7bff); }
.pstats-top .flake { font-size: 17px; line-height: 1; }
.pstats-days.warn { color: #ff5f2e; }
.pstats-top.streak .pstats-days { font-size: 12.5px; }

/* Next levels under the points card */

/* Invite nudge */
.invite-nudge { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin: 10px 0 2px; padding: 12px 14px; border: 0; border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 150, 156, .16), rgba(0, 150, 156, .05)); color: var(--text); font: inherit; }
.invite-nudge .grow { min-width: 0; display: grid; gap: 2px; }
.invite-nudge b { font-size: 15px; }
.invite-nudge small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.invite-nudge .badge-bar { margin-top: 6px; }
.in-ico { font-size: 26px; flex: none; }
.chev-r svg { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2.4; }

/* Badges: a scrolling row; locked ones faded with their progress */
.badges .section-title, .passport .section-title { margin-top: 18px; }
.badge-row { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.badge-row::-webkit-scrollbar { display: none; }
.badge { flex: none; width: 104px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 8px 10px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; text-align: center; }
.badge b { font-size: 13px; line-height: 1.2; }
.badge small { font-size: 11.5px; color: var(--muted); }
.badge-ico { font-size: 30px; line-height: 1.1; filter: grayscale(1); opacity: .45; }
.badge.done { border-color: rgba(0, 150, 156, .45); background: linear-gradient(160deg, rgba(0, 150, 156, .14), transparent 70%); }
.badge.done .badge-ico { filter: none; opacity: 1; }
.badge.done small { color: var(--accent); font-weight: 700; }
.badge-bar { display: block; width: 100%; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 3px; }
.badge-bar::before { content: ''; display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--accent); border-radius: 2px; }

/* Ski passport: stamps */
.stamps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stamp { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 12px;
  border-radius: 14px; border: 1.5px dashed rgba(0, 150, 156, .5); background: var(--bg); color: var(--text); font: inherit; text-align: left; min-width: 0; }
.stamp-ico { grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(150deg, #00969c, #0f2a33); }
.stamp-ico svg { width: 18px; height: 18px; fill: #fff; }
.stamp b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.stamp small { font-size: 12px; color: var(--muted); }
#advList .list-head { padding: 14px 2px 6px; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 0; background: none; }

/* Points: you on the skin track */
.pc-track { position: relative; }
.pc-track .avatar.track-ava { position: absolute; width: 30px; height: 30px; transform: translate(-50%, -50%); font-size: 11px;
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px var(--accent), 0 2px 8px rgba(15, 42, 51, .3); }
.pc-track .flag.start circle { fill: var(--navy); stroke: var(--navy); }
.pc-track .flag.start text { fill: #fff; }

/* Messages */
.conv .grow small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .grow small.unread-text { color: var(--text); font-weight: 650; }
.conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: var(--muted); }
.conv-dot { min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 750; display: grid; place-items: center; }
.modal.chat:not([hidden]) { display: flex; flex-direction: column; height: 86vh; overflow: hidden; padding-bottom: calc(10px + var(--safe-b)); }
.chat-who { flex: 1; display: flex; align-items: center; gap: 10px; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; font-size: 16px; text-align: left; padding: 0 6px; min-width: 0; }
.chat-who .avatar { width: 34px; height: 34px; flex: none; }
.chat-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-who small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding: 8px 2px; -webkit-overflow-scrolling: touch; }
.chat-day { align-self: center; font-size: 11.5px; color: var(--muted); font-weight: 650; margin: 10px 0 4px; }
.msg { max-width: 78%; padding: 8px 12px; border-radius: 18px; background: var(--fill-strong); font-size: 15px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--accent); color: #fff; }
.msg.pending { opacity: .55; }
.msg-seen { align-self: flex-end; font-size: 11px; color: var(--muted); margin: 2px 4px 0; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); font-size: 14px; padding: 0 24px; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; resize: none; max-height: 120px; border: 1px solid var(--line); border-radius: 20px; padding: 9px 14px; font: inherit; font-size: 16px; background: var(--bg); color: var(--text); }
.chat-send { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: var(--accent); display: grid; place-items: center; }
.chat-send svg { width: 20px; height: 20px; stroke: #fff; fill: #fff; stroke-linejoin: round; }
.chat-send:disabled { opacity: .45; }
.notif-acts { display: flex; gap: 6px; }

/* Someone's profile: the hero like your own, under the sheet's buttons */
#userSheet { height: 86vh; padding-top: 0; border-top: 0; }
#userSheet .modal-head { position: sticky; top: 0; z-index: 4; height: 52px; margin: 0 -18px -52px; padding: 0 8px; gap: 4px; justify-content: flex-start; transition: background .2s, box-shadow .2s; }
#userSheet .modal-head .grabber { position: absolute; left: 50%; top: 8px; margin: 0 0 0 -20px; background: rgba(255, 255, 255, .75); box-shadow: 0 1px 3px rgba(15, 42, 51, .25); }
#userSheet .grabber { touch-action: none; }
.sc-hero.user-hero { margin: 0 -18px 12px; padding: 14px 18px 16px; border-radius: 22px 22px 0 0; min-height: 230px; display: flex; flex-direction: column; justify-content: flex-end; }
.sc-hero.user-hero .sc-skier { top: 6px; height: 230px; }
.sc-hero.user-hero .sc-id { margin-top: 0; }
.sc-hero.user-hero.no-skier { min-height: 150px; }
.sc-hero.user-hero .follows-you { background: rgba(255, 255, 255, .22); color: #fff; }

/* landscape: keep floating controls clear of the notch / Dynamic Island */
@media (orientation: landscape) {
  .topbar { left: calc(14px + env(safe-area-inset-left, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); }
  .fab-col { right: calc(14px + env(safe-area-inset-right, 0px)); }
  .legends { left: calc(12px + env(safe-area-inset-left, 0px)); right: calc(70px + env(safe-area-inset-right, 0px)); }
  .modal, .discover-peek { padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
}

/* keyboard open: sheets sit on top of it (--kb set from visualViewport in app.js) */
html:not(.kb-glide) body.kb-open .modal { bottom: var(--kb, 0px); max-height: min(88vh, calc(100vh - var(--kb, 0px) - var(--safe-t) - 12px)); padding-bottom: 12px; }
body.kb-open .modal.chat:not([hidden]) { height: min(86vh, calc(100vh - var(--kb, 0px) - var(--safe-t) - 12px)); padding-bottom: 8px; }
/* In the apps a sheet glides up with the keyboard in one move, just enough for the field you type in (app.js, --kblift) */
html.kb-glide .modal:not(.dm-page):not(.search-sheet) { transition: bottom var(--kbms, .34s) var(--kbcurve, cubic-bezier(.2, .85, .25, 1)); }
html.kb-lifted .modal:not(.dm-page):not(.search-sheet) { bottom: var(--kblift, 0px); max-height: min(88vh, calc(100vh - var(--kblift, 0px) - var(--safe-t) - 12px)); }
.chat-offline { margin: 0 0 6px; padding: 8px 12px; border-radius: 10px; background: #fff4d6; color: #6a4b00; font-size: 13px; font-weight: 600; text-align: center; }
.auth-error:empty { display: none; }
.auth-error { margin: 4px 0 8px; }
#locateBtn.locating svg { animation: pulse 1s infinite; }
/* Sheets whose content loads after they open keep one height from the first frame: they used to slide
   up small ("Loading…") and then jump taller when the list arrived, right at the end of the animation. */
#peopleSheet, #rankSheet, #listSheet, #messagesSheet, #activitySheet, #sendSheet, #postsSheet { height: 86vh; }

/* Discover is a sheet over the map (rounded top; drag it down to go back to the map). No grabber: the
   back button is enough, like Explore, and the header sits where Explore's does. */
#homeScreen { border-radius: 18px 18px 0 0; box-shadow: 0 -2px 12px rgba(15, 42, 51, .12); }

/* the same grabber on every sheet */
.modal > .grabber { margin: -6px auto 10px; }
.modal.chat > .grabber { flex: none; }
.modal > .grabber, #userSheet .grabber { cursor: grab; }
/* Discover: on/off pairs (Following / Nearby, Ski touring / Freeride) — both on by default */
.toggle-row { display: flex; gap: 8px; }
.toggle-row button { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s, border-color .15s; }
.toggle-row button::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; flex: none; }
.toggle-row button.on { background: var(--on-bg); border-color: var(--on-bg); color: var(--on-text); }
.toggle-row button.on::before { border: 0; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.6L12 5.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.toggle-row.big { margin-bottom: 10px; }
.toggle-row.big button { flex: 1; justify-content: center; min-height: 44px; font-size: 15px; }
.feed-head .toggle-row button { padding: 6px 12px 6px 9px; min-height: 36px; font-size: 13.5px; }
/* Following / Others on the left, find people and the bell on the right — one row. */
.feed-head { flex-wrap: nowrap; }
.feed-title-row .row-btns { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.feed-title-row .row-btns .icon-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--fill); color: var(--text); }
.feed-title-row .row-btns svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feed-group { margin: 4px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.feed-group:not(:first-child) { margin-top: 16px; }
.section-sub { margin: -6px 0 10px; font-size: 13px; }
/* profile hero: relation badges on the far right */
.rel-badges { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; align-self: flex-end; }
.sc-hero.user-hero .follows-you { padding: 4px 9px; font-size: 12px; border-radius: 8px; white-space: nowrap; }
.sc-hero.user-hero .follows-you.on { background: #fff; color: var(--text); }

/* ---- Instagram-style extras ---- */
/* Share and bookmark beside the heart and bubble; the bookmark on the right, black when saved. */
.feed-stats .save { margin-left: auto; }
.feed-stats .share svg { stroke-linecap: round; }
.feed-stats .save.on .save-ico { fill: currentColor; }
/* No picture yet: Instagram's grey head-and-shoulders, plainly "add a picture". */
.avatar.default { background: #c7c7cc; overflow: hidden; }
.avatar.default svg { width: 100%; height: 100%; fill: #fff; stroke: none; }
.avatar.big.default svg { width: 100%; height: 100%; }
/* Profile tab: your picture with a ring when you're there, a red dot when something's new. */
.tabbar .tab-icon { position: relative; display: grid; place-items: center; width: 28px; height: 28px; }
.tab-ava { display: none; }
.tabbar button.has-ava .tab-icon > svg { display: none; }
.tabbar button.has-ava .tab-ava { display: block; }
.tab-ava .avatar { width: 27px; height: 27px; font-size: 10px; box-sizing: border-box; }
.tabbar button.has-ava.active .tab-ava .avatar { box-shadow: 0 0 0 1.5px var(--panel-solid, #fff), 0 0 0 3px var(--text); }
.tab-dot { position: absolute; top: -1px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #ff3040; border: 2px solid #fff; box-sizing: content-box; }
/* The floating Search / Messages dock */
.dock { display: none; position: absolute; left: 50%; bottom: calc(var(--bottom) + 12px); z-index: 7; transform: translateX(-50%);
  gap: 2px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 6px 24px rgba(15, 42, 51, .16), 0 0 0 .5px rgba(15, 42, 51, .08); transition: transform .28s cubic-bezier(.32,.72,0,1), opacity .2s; }
body[data-tab="home"] .dock, body[data-tab="profile"] .dock, body[data-tab="explore"] .dock { display: flex; }
body.dock-away .dock { transform: translate(-50%, calc(100% + 24px)); opacity: 0; pointer-events: none; }
.dock button { position: relative; display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; background: none;
  font: inherit; font-size: 14.5px; font-weight: 700; color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dock button:active { background: rgba(15, 42, 51, .07); }
.dock button + button::before { content: ''; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 1px; background: var(--line); }
.dock svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dock .sc-count { position: static; box-shadow: none; margin-left: -1px; }
#homeScreen, #profileScreen, #exploreScreen { padding-bottom: 84px; }
@media (prefers-reduced-motion: reduce) { .dock { transition: none; } }
/* Sheets stacked on a sheet: the next one comes in from the right, ‹ slides back from the left
   (like pages in Instagram), instead of rising from the bottom again. */
@keyframes sheet-push { from { transform: translate3d(100%, 0, 0); } }
@keyframes sheet-pop { from { transform: translate3d(-28%, 0, 0); opacity: .4; } }
.modal.push:not([hidden]) { animation: sheet-push .3s cubic-bezier(.32, .72, 0, 1) backwards; }
.modal.pop:not([hidden]) { animation: sheet-pop .3s cubic-bezier(.32, .72, 0, 1) backwards; }
.modal-head .back-btn { margin-right: 8px; }
.modal-head .back-btn:not([hidden]) + .grabber + *, .modal-head .back-btn:not([hidden]) + h3 { margin-right: auto; }
@media (prefers-reduced-motion: reduce) { .modal.push:not([hidden]), .modal.pop:not([hidden]) { animation: none; } }
/* Unread conversations like Instagram: name and last message in bold black, a blue dot. */
.conv.unread .grow b { font-weight: 800; }
.conv.unread .grow small.unread-text { color: var(--text); font-weight: 750; }
.conv.unread .conv-side > span:first-child { color: var(--text); font-weight: 700; }
/* Send sheet: search, a grid of faces (tap = blue check), other apps along the bottom. */
.send-search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; margin: 4px 0 14px; border-radius: 12px; background: var(--fill); }
.send-search svg { width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.send-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); outline: none; }
.send-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 8px; padding-bottom: 120px; }
.send-grid .empty { grid-column: 1 / -1; }
.send-person { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.send-ava { position: relative; }
.send-ava .avatar { width: 76px; height: 76px; font-size: 26px; transition: transform .15s; }
.send-person:active .avatar { transform: scale(.94); }
.send-check { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--panel-solid, #fff); box-sizing: border-box;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.6L12 5.4' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
  transform: scale(0); transition: transform .18s cubic-bezier(.32, .72, 0, 1); }
.send-person.on .send-check { transform: scale(1); }
.send-name { max-width: 100%; font-size: 13.5px; line-height: 1.25; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.send-foot { position: sticky; bottom: 0; margin: 0 -18px calc(-22px - var(--safe-b)); padding: 12px 18px calc(14px + var(--safe-b));
  background: var(--panel-solid, #fff); border-top: 1px solid var(--line); }
.send-apps { display: flex; gap: 22px; }
.send-apps button { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.app-ico { width: 58px; height: 58px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; }
.app-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.app-ico.wa { background: #25d366; color: #fff; }
.app-ico.wa .fill { fill: #fff; stroke: none; }
.send-compose { display: flex; gap: 10px; align-items: center; }
.send-compose .input { flex: 1; margin: 0; }
.send-compose .ig-btn { min-height: 44px; padding: 0 18px; }
/* A tour sent in chat */
.msg.msg-card { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; font: inherit; cursor: pointer; padding: 10px 14px 10px 10px; }
.msg-card-ico { width: 40px; height: 40px; border-radius: 10px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; flex: none; }
.msg:not(.mine) .msg-card-ico { background: var(--accent); }
.msg-card-ico svg { width: 22px; height: 22px; fill: #fff; }
.msg-card-txt b { display: block; font-weight: 700; }
.msg-card-txt small { opacity: .75; font-size: 12.5px; }
/* ---- Profiles like Instagram: icon tabs, then a 3-column grid of tours, edge to edge ---- */
.ig-tabs { display: flex; margin: 16px -18px 0; border-bottom: 1px solid var(--line); }
#profileScreen .ig-tabs { margin: 16px -16px 0; }
.ig-tabs button { flex: 1; height: 46px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); position: relative; cursor: pointer; }
.ig-tabs button.on { color: var(--text); }
.ig-tabs button.on::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 1.5px; background: var(--text); }
.ig-tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ig-pane { padding-top: 2px; }
.tour-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 0 -18px; }
#profileScreen .tour-grid { margin: 0 -16px; }
.tour-tile { position: relative; aspect-ratio: 3 / 4; padding: 0; border: 0; overflow: hidden; background: #2a3038; cursor: pointer; }
.tour-tile > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tour-tile .route-thumb { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.tour-tile:active { filter: brightness(.85); }
.tile-multi, .tile-lock { position: absolute; top: 7px; right: 7px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.tile-lock { right: auto; left: 7px; }
.tile-multi svg, .tile-lock svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.tile-up { position: absolute; left: 7px; bottom: 6px; color: #fff; font-size: 12.5px; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.ig-locked { display: grid; place-items: center; width: 64px; height: 64px; margin: 28px auto 4px; border: 2px solid var(--text); border-radius: 50%; }
.ig-locked svg { width: 28px; height: 28px; fill: none; stroke: var(--text); stroke-width: 1.8; }
.ig-locked + .empty { border: 0; padding-top: 4px; }
.my-grid { margin: 10px 0 14px; }
/* The posts sheet */
.posts-title { display: flex; flex-direction: column; align-items: center; flex: 1; line-height: 1.15; }
.posts-title small { font-size: 12.5px; font-weight: 600; }
/* sticky from the sheet's very top edge (top/margin = minus the sheet's 16px padding): otherwise the tours scroll
   through a see-through strip above the header */
#postsSheet .modal-head { position: sticky; top: -16px; z-index: 3; margin: -16px -18px 8px; padding: 22px 18px 8px; background: var(--panel-solid, #fff); }
#postsSheet .feed { gap: 18px; }
.modal-head > .back-btn:not([hidden]) + .posts-title { margin-right: 0; }
#postsSheet .modal-head:not(:has(.back-btn:not([hidden]))) .posts-title { margin-left: 42px; }

/* Tour sheet, smallest step: title + stats (the likes & comments go too) */

/* Comments sheet, like Instagram: half height, full once scrolled / pulled up; field at the bottom */
/* one height, like Instagram's comments: tall, the post's top still showing above it */
/* One position, like Instagram: the top stays put; the keyboard only lifts the bottom (the field) */
.modal.chat.comments-sheet:not([hidden]) { top: 14vh; height: auto; max-height: none; padding-bottom: calc(6px + var(--safe-b)); }
body.kb-open .modal.chat.comments-sheet:not([hidden]) { height: auto; max-height: none; padding-bottom: 6px; }
.comments-sheet .modal-head { justify-content: center; position: relative; min-height: 32px; margin-bottom: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-inline: -18px; }
.comments-sheet .modal-head h3 { font-size: 16px; font-weight: 700; }
.comments-sheet .modal-head [data-close] { position: absolute; right: 12px; top: -6px; }
.comments-sheet .modal-head .back-btn { position: absolute; left: 12px; top: -6px; margin: 0; }
.comments-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-top: 14px; }
.comments-scroll .comments { margin: 0 0 12px; gap: 18px; }
.comments-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 56px 0; color: var(--muted); font-size: 14px; }
.comments-empty b { color: var(--text); font-size: 20px; font-weight: 750; }
.comments-foot { flex: none; margin: 0 -18px; padding: 0 18px; border-top: 1px solid var(--line); }
.emoji-row { display: flex; justify-content: space-between; padding: 8px 2px 0; }
.emoji-row button { border: 0; background: none; padding: 4px; font-size: 26px; line-height: 1; cursor: pointer; }
.comments-foot .comment-form { border-top: 0; }

/* ⋯ on profiles: Instagram's three dots, and its frosted menu card */
.more-dots svg { width: 22px; height: 22px; fill: currentColor; stroke: none !important; }
.pop-catch { position: fixed; inset: 0; z-index: 30; }
.pop-menu { position: fixed; min-width: 236px; padding: 6px 0; border-radius: 22px; background: rgba(250, 250, 252, .86); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 12px 40px rgba(15, 42, 51, .22), 0 0 0 .5px rgba(15, 42, 51, .08); transform-origin: top right; animation: pop-in .2s cubic-bezier(.32, .72, 0, 1); }
.pop-menu.out { opacity: 0; transform: scale(.92); transition: opacity .15s, transform .15s; }
@keyframes pop-in { from { opacity: 0; transform: scale(.85); } }
.pop-menu button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 22px; border: 0; background: none; font: inherit; font-size: 16.5px; color: var(--text); text-align: left; cursor: pointer; }
.pop-menu button:active { background: rgba(15, 42, 51, .06); }
.pop-menu button svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pop-menu button.danger { color: #ed4956; }
@media (prefers-color-scheme: dark) { .pop-menu { background: rgba(38, 38, 44, .86); } }

/* About this account */
.about-sheet { text-align: center; }
.about-sheet .modal-head h3 { font-size: 16px; font-weight: 700; flex: 1; text-align: center; }
.about-sheet .modal-head .back-btn[hidden] { display: block; visibility: hidden; }
.about-ava { width: 84px !important; height: 84px !important; margin: 14px auto 10px; }
.about-name { margin: 0; font-weight: 750; font-size: 17px; }
.about-handle { margin: 2px 0 0; }
.about-note { margin: 14px 12px 6px; font-size: 13px; }
.about-rows { list-style: none; margin: 10px 0 0; padding: 0; text-align: left; }
.about-rows li { display: flex; align-items: center; gap: 14px; padding: 12px 2px; }
.about-rows svg { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.about-rows b { display: block; font-weight: 650; }
.about-rows small { color: var(--muted); }

/* Someone's profile, Instagram's top bar: ‹ left, ⋯ right, plain icons (white over the hero, with a
   soft shadow); scrolled past the hero it turns into a white bar with their @username */
#userSheet .modal-head .icon-btn { width: 40px; height: 40px; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: #fff; filter: drop-shadow(0 1px 2px rgba(15, 42, 51, .45)); transition: color .2s, filter .2s; }
/* ‹ like your own profile's: a round frosted button over the hero; a plain ‹ once the bar turns white */
#userSheet .modal-head .back-btn { margin: 0 0 0 2px; width: 40px; height: 40px; border-radius: 20px; color: #fff; filter: none;
  background: rgba(15, 42, 51, .42); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .2s, color .2s; }
#userSheet .modal-head .back-btn svg { width: 22px; height: 22px; stroke: currentColor; transition: width .2s, height .2s; }
#userSheet .modal-head .back-btn:active { transform: scale(.97); }
#userSheet.scrolled .modal-head .back-btn { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
#userSheet.scrolled .modal-head .back-btn svg { width: 26px; height: 26px; }
#userSheet .modal-head .more-dots { margin-left: auto; }
#userSheet .modal-head .more-dots svg { width: 28px; height: 28px; fill: currentColor; }
.user-bar-name { font-weight: 750; font-size: 18px; opacity: 0; transition: opacity .2s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#userSheet.scrolled .modal-head { background: var(--panel-solid); box-shadow: 0 .5px 0 var(--line); }
#userSheet.scrolled .modal-head .icon-btn { color: var(--text); filter: none; }
#userSheet.scrolled .user-bar-name { opacity: 1; }
#userSheet.scrolled .modal-head .grabber { opacity: 0; }

/* Instagram's profile tabs: a thin line slides to the tab, the page slides in from that side */
.ig-tabs { position: relative; }
.ig-tabs button.on::after { content: none; }
.ig-ink { position: absolute; left: 0; bottom: -1px; height: 1px; background: var(--text); transition: transform .3s cubic-bezier(.32, .72, 0, 1); }
.slide-r { animation: tab-in-r .3s cubic-bezier(.32, .72, 0, 1); }
.slide-l { animation: tab-in-l .3s cubic-bezier(.32, .72, 0, 1); }
@keyframes tab-in-r { from { transform: translate3d(40%, 0, 0); opacity: 0; } }
@keyframes tab-in-l { from { transform: translate3d(-40%, 0, 0); opacity: 0; } }
.ig-tabs svg { stroke-width: 1.7; }

/* grid tiles: the tour's name over a soft shade at the bottom */
.tile-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 8px 7px; display: flex; flex-direction: column; gap: 1px; text-align: left; color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0)); pointer-events: none; }
.tile-cap b { font-size: 12.5px; font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.tile-cap small { font-size: 11px; font-weight: 600; opacity: .9; }
.feed-stats svg, .adv-actions svg { stroke-width: 2; }
#userSheet { overflow-x: hidden; }

/* Ski touring | Freeride: one joined pill, two halves; a half that's on is filled (both on by
   default = everything). Tap one to see only that, again for both. */
.pair-toggle { display: flex; margin: 4px 0 12px; padding: 3px; gap: 3px; border-radius: 999px; background: var(--fill); }
.pair-toggle button { flex: 1; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font: inherit; font-size: 15px; font-weight: 650; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.pair-toggle button svg { width: 20px; height: 20px; stroke-width: 1.8; }
.pair-toggle button.on { background: var(--panel-solid, #fff); color: var(--text); box-shadow: 0 1px 3px rgba(15, 42, 51, .14), 0 0 0 .5px rgba(15, 42, 51, .06); }
.pair-toggle button.on svg { color: var(--accent); }
.pair-toggle button:active { transform: scale(.97); }
#exploreScreen .pair-toggle { margin: 6px 0 14px; }

/* the bar: ‹ on the left, Invite and Share under it; bell, skier and Settings on the right */
#profileHero .sc-bar { justify-content: flex-start; }
#profileHero .sc-bar .tab-back { margin-right: auto; }
.tab-back svg { stroke-width: 2.4; }
.sc-pills { position: absolute; left: 0; top: 50px; display: flex; flex-direction: column; gap: 10px; }
.sc-pills .sc-pill.share { position: static; }
.sc-pills .sc-pill { margin: 0 !important; }
/* Discover / Explore: ‹ before the title */
.head-row { display: flex; align-items: center; gap: 6px; }
.tab-back.plain { margin-left: -8px; }
/* One back button everywhere (Discover / Explore's ‹): a plain chevron in the text colour, 26 px in a
   36 px button, no circle. Only on profiles (yours and others'), over the cover picture, it's a round
   frosted one like the buttons next to it. */
.tab-back.plain, .sheet-back, .modal-head .back-btn, #chatBack, #searchBack { flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 0;
  background: none; color: var(--text); place-items: center; cursor: pointer; box-shadow: none; }
.tab-back.plain:not([hidden]), .sheet-back:not([hidden]), .modal-head .back-btn:not([hidden]), #chatBack:not([hidden]), #searchBack:not([hidden]) { display: grid; }
.tab-back.plain::after, .modal-head .back-btn::after, #chatBack::after { inset: -4px; }
.tab-back.plain svg, .sheet-back svg, .modal-head .back-btn svg, #chatBack svg, #searchBack svg { width: 26px; height: 26px; fill: none; stroke: currentColor;
  stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
body[data-tab="profile"] .dock { display: none; }   /* search and messages are on the profile itself */

/* Settings and activity */
.settings-sheet { height: 92vh; padding-bottom: calc(30px + var(--safe-b)); background: var(--bg, #f2f2f7); }
.settings-sheet .modal-head { justify-content: center; position: relative; }
.settings-sheet .modal-head h3 { font-size: 17px; font-weight: 700; }
.settings-sheet .modal-head [data-close] { position: absolute; right: 0; }
.settings-sheet .modal-head .back-btn { position: absolute; left: 0; }
.settings-sheet .send-search { margin: 6px 0 4px; }
.set-group { margin-top: 14px; }
.set-group h4 { margin: 0 4px 6px !important; font-size: 13px !important; font-weight: 650 !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--muted); }
.set-group > .set-row:first-of-type, .set-group > .list { border-radius: 14px 14px 0 0; }
.set-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 8px 14px; border: 0; background: var(--card, #fff); color: var(--text);
  font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.set-group .set-row { border-radius: 0; box-shadow: inset 0 -.5px 0 var(--line); }
.set-group .set-row:first-of-type { border-radius: 14px 14px 0 0; }
.set-group .set-row:last-child { border-radius: 0 0 14px 14px; box-shadow: none; }
.set-group .set-row:first-of-type:last-child { border-radius: 14px; }
.set-row:active { filter: brightness(.95); }
.set-row > svg:first-child { width: 24px; height: 24px; flex: none; stroke-width: 1.7; }
.set-row span { flex: 1; min-width: 0; }
.set-row small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.set-row .chev { width: 18px; height: 18px; color: var(--muted); stroke-width: 2; flex: none; }
.set-group .list { gap: 0; border-radius: 14px; overflow: hidden; }
.set-group .list li { border-radius: 0; box-shadow: inset 0 -.5px 0 var(--line); min-height: 54px; padding: 8px 14px; }
.set-group .list li:last-child { box-shadow: none; }
.set-group .list a { color: var(--text); text-decoration: none; font-size: 16px; }
.set-about { margin-top: 10px; border-radius: 14px; background: var(--card, #fff); padding: 0 14px; }
.set-about summary { display: flex; align-items: center; gap: 14px; min-height: 54px; font-size: 16px; cursor: pointer; list-style: none; }
.set-about summary::-webkit-details-marker { display: none; }
.set-about summary svg { width: 24px; height: 24px; stroke-width: 1.7; }
.set-about .about { font-size: 12px; padding-bottom: 12px; margin: 0; }
.set-group .sync-box { background: none; padding: 0; border: 0; }
.set-link { display: block; width: 100%; min-height: 50px; padding: 0 14px; border: 0; background: var(--card, #fff); font: inherit; font-size: 16px; text-align: left; color: var(--text); cursor: pointer; box-shadow: inset 0 -.5px 0 var(--line); }
#syncAccount .set-link:first-child { border-radius: 14px 14px 0 0; }
#syncAccount .set-link:last-child { border-radius: 0 0 14px 14px; box-shadow: none; }
.set-link.blue { color: #00898f; }
.set-link.danger { color: #ed4956; }
.set-hide { display: none !important; }

/* Share your profile, like Snapchat's: full screen on a dark blur; the code on a coloured card in a
   rounded frame with your avatar in the middle; Send to top right, apps along the bottom. */
.modal.qr-full { top: 0; max-height: none; height: 100%; border-radius: 0; border: 0; padding: calc(12px + var(--safe-t)) 18px calc(18px + var(--safe-b));
  display: flex; flex-direction: column; overflow: hidden; color: #fff;
  background: radial-gradient(120% 70% at 50% 25%, #2a3a7a 0%, #141b46 55%, #0f2a33 100%); }
.qr-full > .grabber { display: none; }
.qr-top { display: flex; justify-content: space-between; align-items: center; }
.qr-send { height: 46px; padding: 0 18px 0 22px; border: 0; border-radius: 23px; background: #fff; color: #0f2a33; font: inherit; font-size: 17px; font-weight: 700;
  display: flex; align-items: center; gap: 10px; }
.qr-send svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.qr-full .qr-card { flex: none; margin: auto; width: min(78vw, 330px); max-width: none; padding: 34px 26px 26px; border-radius: 30px; text-align: center;
  background: linear-gradient(170deg, #9be3ff, #6fcdf7); color: #0f2a33; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.qr-frame { position: relative; margin: 0 auto; width: 82%; padding: 8%; box-sizing: border-box; border: 5px solid #0f2a33; border-radius: 22%; }
.qr-full .qr-code { width: 100%; height: auto; aspect-ratio: 1; border-radius: 0; box-shadow: none; overflow: visible; }
.qr-full .qr-code svg { width: 100%; height: 100%; }   /* the frame takes the code's square: WebKit stretched a frame with its own aspect-ratio and % padding */
.qr-full .qr-code { position: relative; }
/* in the code's hole, the profile picture's tall pill (openQr sizes it to the hole) */
.qr-ava { position: absolute; left: 50%; top: 50%; min-height: 0; transform: translate(-50%, -50%); border: 0; box-shadow: none; border-radius: 999px !important; }
.qr-name { display: block; margin-top: 18px; font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.qr-handle { display: block; margin-top: 2px; font-size: 16px; opacity: .8; }
.qr-full .qr-hint { margin: 16px 0 0; font-size: 13px; opacity: .7; }
.qr-apps { display: flex; justify-content: space-between; gap: 6px; padding-top: 10px; }
.qr-apps button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; color: #fff; font: inherit; font-size: 12.5px; }
.qr-apps .app-ico { width: 56px; height: 56px; background: rgba(255, 255, 255, .16); }
.qr-apps .app-ico svg { width: 26px; height: 26px; stroke: #fff; }
.qr-apps .app-ico.sms { background: #34c759; }
.qr-apps .app-ico.sms svg .fill { fill: #fff; stroke: none; }
.qr-apps .app-ico.wa { background: #25d366; }

/* the bell under Settings (it scrolls away with the header) */
#profileHero .sc-bar { position: relative; }
.sc-under { position: absolute; right: 0; top: 50px; }
/* Messages / Search shrink a little once the profile scrolls (Instagram) */

/* points under the @username */
.sc-points { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; padding: 3px 10px 3px 6px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font: inherit; font-size: 14px; font-weight: 750;
  font-variant-numeric: tabular-nums; cursor: pointer; }
.sc-points svg { width: 17px; height: 17px; stroke: #ffd34d; stroke-width: 1.8; }
.sc-points svg .fill { fill: #ffd34d; stroke: none; }
.sc-points:active { transform: scale(.96); }
/* your own grid / trophy tabs */
#profileScreen #myTabs { margin-top: 14px; }
#profileScreen .pane[data-pane=stats] > * + * { margin-top: 12px; }
/* room between the tab bar and the points card, like the card's sides */
#profileScreen .pane[data-pane=stats], .ig-pane > .points-card:first-child { margin-top: 6px; }

/* Share next to ‹ in the bar; the skier a little to the right to leave them room */
#profileHero .sc-bar .tab-back { margin-right: auto; }
#profileHero .sc-bar .sc-pill.share { position: static; margin: 0 !important; }
.sc-points svg { stroke: #8fe0e2; }
.sc-points svg .fill { fill: #8fe0e2; }

/* Share in the bar: a size smaller than the round buttons; the skier a touch further left */
#profileHero .sc-bar .sc-pill.share { width: auto; height: 40px; align-self: center; padding: 0 12px;   /* the same gap left of the code as right of "Share" */ gap: 6px; font-size: 14px; border-radius: 20px; }   /* as tall as Settings beside it */
/* whole-pixel padding (even on every side); corner radius = padding + the finder squares' own (2.5 modules of ~0.69 px), so the corners run concentric */
#profileHero .sc-pill.share .qr-mini { width: 22px; height: 22px; padding: 1px; border-radius: 2.7px; flex: none; }
#profileScreen .sc-skier { transform: translateX(-37%); }
#profileHero .sc-bar { gap: 8px; align-items: center; }
#profileScreen .bio, #userBody .bio { margin: 12px 2px 10px; }   /* under the header, above the numbers (Instagram) */

/* Discover: while Ski touring | Freeride re-filters, the old cards stay (dimmed) until the new ones swap in */
#tourList { transition: opacity .15s; }
#tourList.swapping { opacity: .45; transition-delay: .08s; }

/* The few ✕ left (tour card, offline download, QR screen): Apple Maps' close button, a small grey
   disc with a short bold cross, rather than a big round button. */
/* The close button, one look throughout the app (like the Claude app's): a near-white circle on a
   soft, wide shadow, with a thin dark-grey ✕ a third of its width. */
.icon-btn.close-btn, .qr-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fbfbf9; color: var(--muted);
  box-shadow: 0 2px 6px rgba(20, 20, 19, .06), 0 6px 22px rgba(20, 20, 19, .10); display: grid; place-items: center; flex: none;
  align-self: flex-start; position: relative; padding: 0; transition: transform .12s, background .12s; }
.icon-btn.close-btn::after, .qr-x::after { content: ''; position: absolute; inset: -6px; }
.icon-btn.close-btn svg.x, .qr-x svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
/* with ‹ back on its own row above the title, the ✕ moves up beside it */
#advBack:not([hidden]) + .sheet-head { position: relative; }
#advBack:not([hidden]) + .sheet-head .close-btn { position: absolute; top: -37px; right: 0; }   /* up beside ‹, so the likes can reach the right edge */
.icon-btn.close-btn:active, .qr-x:active { transform: scale(.92); background: #f0f0ec; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.icon-btn.close-btn, .qr-x) { background: #30302e; color: #e8e8e3; box-shadow: 0 2px 6px rgba(0, 0, 0, .25), 0 6px 22px rgba(0, 0, 0, .35); } }
:root[data-theme="dark"] :is(.icon-btn.close-btn, .qr-x) { background: #30302e; color: #e8e8e3; box-shadow: 0 2px 6px rgba(0, 0, 0, .25), 0 6px 22px rgba(0, 0, 0, .35); }

/* Comments, one to one with Instagram: "handle  3h · Author · Edited" on top, the text under it,
   Reply under that; the heart on the right with its count below. Replies indented with smaller
   pictures, "—— View 2 more replies" to open them. Swipe left: Report / Delete behind the row. */
.comments .c-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; font-size: 13px; line-height: 1.3; }
.comments .c-head .who { font-weight: 650; color: var(--text); cursor: pointer; }
.comments .c-head span { color: var(--muted); }
.comments .c-head span + span::before { content: '· '; }
.comments .comment p.c-body { margin: 2px 0 0; font-size: 14.5px; line-height: 1.38; }
.comments .mention { color: #4a8fd9; }
.comments .comment-meta { margin-top: 5px; gap: 16px; font-size: 12.5px; }
.comments .c-like { flex: none; width: 34px; margin: 4px -8px 0 0; display: flex; flex-direction: column; align-items: center; }
.comments .c-like .comment-heart { width: 30px; height: 26px; margin: 0; }
.comments .c-like .comment-heart svg { width: 15px; height: 15px; stroke-width: 2; }
.comments .c-like small { min-height: 13px; font-size: 11.5px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.comments .comment.reply { margin-left: 44px; }
.comments .comment.reply .avatar { width: 26px; height: 26px; font-size: 10px; }
.comments .c-thread { margin: -8px 0 0 44px; }
.comments .c-thread button { display: flex; align-items: center; gap: 12px; padding: 2px 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.comments .c-thread button::before { content: ''; width: 24px; height: 1px; background: currentColor; opacity: .6; }
/* long press: the comment lights up while its menu is open */
.comments .comment .c-row { transition: background .15s; border-radius: 12px; }
.comments .comment.pressed .c-row { background: var(--fill); box-shadow: 0 0 0 6px var(--fill); }
.comments .comment.removing { opacity: 0; transform: translateX(-24px); transition: opacity .2s, transform .2s; }
/* swipe left: the row covers the sheet's full width so the buttons stay hidden behind it */
.comments-scroll { margin: 0 -18px; padding-inline: 18px; }
.comments-scroll .comment { overflow: hidden; margin: -6px -18px; touch-action: pan-y; }
.comments-scroll .comment .c-row { padding: 6px 18px; background: var(--panel-solid); box-shadow: none; border-radius: 0; }
.comments-scroll .comment.pressed .c-row { background: var(--fill); box-shadow: none; }
.comments-scroll .comment.reply { margin-left: -18px; }
.comments-scroll .comment.reply .c-row { padding-left: 62px; }
.comments-scroll .comment:not(.swiped):not(.swiping) .c-actions { visibility: hidden; }
.c-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; }
.c-act { width: 72px; border: 0; padding: 0; display: grid; place-items: center; color: #fff; cursor: pointer; }
.c-act svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.c-act.report { background: #8e8e93; }
.c-act.delete { background: #ff3b30; }
/* "Replying to lina  ✕" / "Editing comment  ✕" above the field */
.comments-bar { display: flex; align-items: center; justify-content: space-between; margin: 8px -18px 0; padding: 9px 18px; background: var(--fill); font-size: 13px; color: var(--muted); }
.comments-bar button { width: 24px; height: 24px; display: grid; place-items: center; border: 0; padding: 0; background: none; color: var(--muted); cursor: pointer; }
.comments-bar svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
/* more comments loading at the end of the list */
.comments .c-more { height: 44px; display: grid; place-items: center; }
.comments .c-more::before { content: ''; width: 22px; height: 22px; border-radius: 50%; border: 2.4px solid var(--line); border-top-color: var(--muted); animation: c-spin .8s linear infinite; }
@keyframes c-spin { to { transform: rotate(360deg); } }

/* Search (Instagram's): full height from just under the status bar; with the keyboard up only the
   bottom moves, so nothing jumps. Grey rounded field, ⓧ to clear, Cancel on the right. */
.modal.search-sheet:not([hidden]) { top: calc(var(--safe-t) + 10px); max-height: none; display: flex; flex-direction: column; padding: 8px 16px 0; overflow: hidden; }
body.kb-open .modal.search-sheet { bottom: var(--kb, 0px); max-height: none; padding-bottom: 0; }
.search-sheet > .grabber { margin: -2px auto 8px; }
.srch-bar { display: flex; align-items: center; gap: 14px; padding-bottom: 8px; }
.srch-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 11px; border-radius: 12px; background: var(--fill); }
.srch-field > svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.srch-field input { flex: 1; min-width: 0; height: 100%; border: 0; padding: 0; background: none; outline: none; font: inherit; font-size: 16px; color: var(--text); -webkit-appearance: none; appearance: none; }
.srch-field input::placeholder { color: var(--muted); }
.srch-field input::-webkit-search-cancel-button { display: none; }
.srch-clear { width: 19px; height: 19px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #9a9aa2; color: #fff; cursor: pointer; }
.srch-clear svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.srch-cancel { flex: none; padding: 6px 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); cursor: pointer; }
.srch-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; list-style: none; margin: 0 -16px; padding: 4px 16px calc(16px + var(--safe-b)); }
.srch-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; background: none; border-radius: 0; }
.srch-list li.srch-row { cursor: pointer; }
.srch-list li.srch-row:active { opacity: .6; }
.srch-list li .grow { flex: 1; min-width: 0; }
.srch-list li .avatar { width: 44px; height: 44px; flex: none; }
.srch-list li b { display: block; font-size: 14.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srch-list li small { display: block; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srch-list li.srch-head { justify-content: space-between; padding: 8px 0 4px; }
.srch-list li.srch-head b { font-size: 16px; font-weight: 700; }
.srch-list li.srch-head button { border: 0; padding: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; }
.srch-x { width: 32px; height: 32px; margin-right: -6px; display: grid; place-items: center; flex: none; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.srch-list li.srch-empty { display: block; padding: 48px 24px; text-align: center; font-size: 14px; color: var(--muted); }

/* Pull to refresh (Discover, Explore), like Safari: the page slides down (--pull); the spinner (30 px,
   8 round spokes, iOS grey) stays put near the top. Caught: a small pop, then it spins smoothly
   clockwise, a bit dimmer, with a fading tail (the spokes behind the leading one dimmer). */
.ptr-host.ptr-on > :not(.ptr) { transform: translate3d(0, var(--pull, 0px), 0); }
.ptr-host.ptr-anim > :not(.ptr) { transition: transform .38s cubic-bezier(.2, .9, .3, 1); }
.ptr { position: absolute; left: 50%; top: calc(var(--safe-t) + 22px); z-index: 3; width: 30px; height: 30px; margin-left: -15px; opacity: 0;
  pointer-events: none; color: #8e8e93; }
.ptr svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ptr line { stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; }
.ptr.caught { animation: ptr-pop .28s cubic-bezier(.3, 1.6, .5, 1); }
.ptr.spinning svg { animation: ptr-spin .85s linear infinite; }
.ptr.spinning line { transition: opacity .6s ease-out; }
.ptr.spinning { transition: opacity .6s ease-out; opacity: .72 !important; }
.ptr.spinning line:nth-child(8) { opacity: 1 !important; }   .ptr.spinning line:nth-child(7) { opacity: .82 !important; }
.ptr.spinning line:nth-child(6) { opacity: .66 !important; } .ptr.spinning line:nth-child(5) { opacity: .52 !important; }
.ptr.spinning line:nth-child(4) { opacity: .42 !important; } .ptr.spinning line:nth-child(3) { opacity: .36 !important; }
.ptr.spinning line:nth-child(2) { opacity: .32 !important; } .ptr.spinning line:nth-child(1) { opacity: .3 !important; }
.ptr.ptr-out { opacity: 0 !important; transition: opacity .22s; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@keyframes ptr-pop { 0% { transform: scale(1); } 45% { transform: scale(1.09); } 100% { transform: scale(1); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ptr { color: #98989f; } }
:root[data-theme="dark"] .ptr { color: #98989f; }

/* ---- The floating glass tab dock (phones): a frosted pill with the four tabs and the round Record
   button beside it, over the map, sheets and screens, which run to the screen's bottom. ---- */
@media (max-width: 899px) {
  .tabbar { left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); max-width: 520px; margin: 0 auto; bottom: var(--dock-b); height: var(--tabbar-h); padding: 0; display: flex; gap: 10px; align-items: center;
    background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
  .tab-pill, .tab-record { pointer-events: auto; }
  /* with a sheet open on the map, a white base under the dock: the sheet ends at the dock (what is
     further down in it doesn't show around the pill) */
  .tabbar::before { content: ''; position: absolute; left: -100vw; right: -100vw; top: -6px; bottom: calc(-1 * var(--dock-b)); z-index: -1;
    background: var(--panel-solid); display: none; }
  body.sheet-open:not(.flying) .tabbar::before { display: block; }
  .tab-pill { flex: 1; height: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; padding: 0 6px; box-sizing: border-box;
    border-radius: 999px; background: rgba(255, 255, 255, .74); -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 10px 30px rgba(15, 42, 51, .18), 0 0 0 .5px rgba(15, 42, 51, .06); }
  .tabbar .tab-pill button { height: 52px; margin: 0 1px; border-radius: 999px; font-size: 10.5px; font-weight: 650; gap: 2px; color: #4a5160;
    -webkit-tap-highlight-color: transparent; transition: background-color .25s, color .25s; }
  .tabbar .tab-pill button svg.solid { width: 24px; height: 24px; }
  .tabbar .tab-pill button.active { background: rgba(0, 150, 156, .15); color: #007a80 !important; }
  .tabbar .tab-pill button:active { transform: scale(.94); }
  .tabbar .tab-icon { width: 24px; height: 24px; }
  .tab-ava .avatar { width: 24px; height: 24px; }
  .tabbar .tab-record { flex: none; width: var(--tabbar-h); height: var(--tabbar-h); padding: 0; border: 0; border-radius: 50%; background: var(--record); display: grid; place-items: center;
    box-shadow: 0 10px 26px rgba(255, 90, 54, .42); -webkit-tap-highlight-color: transparent; transition: transform .2s; }
  .tabbar .tab-record i { width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: border-radius .25s, transform .25s; }
  .tabbar .tab-record:active { transform: scale(.92); }
  .tabbar .tab-record.active { box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 10px 26px rgba(255, 90, 54, .42); }
  body.is-recording .tabbar .tab-record i { border-radius: 4px; transform: scale(.8); }
  body.is-recording .tabbar .tab-record i { animation: pulse 1.4s infinite; }
  /* sheets and screens reach the bottom; their content stops above the dock */
  .sheet:not(#advSheet) { bottom: 0; padding-bottom: calc(var(--bottom) + 8px); }
  .screen, #homeScreen, #profileScreen, #exploreScreen { bottom: 0; padding-bottom: calc(var(--bottom) + 24px); }   /* (the ids: over their 84px above) */
  .discover-peek { left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); max-width: 520px; margin: 0 auto; bottom: var(--bottom); border-radius: 26px; padding: 8px 20px 14px;
    background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, .95); box-shadow: 0 8px 26px rgba(15, 42, 51, .16); }
}
@media (max-width: 899px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tab-pill { background: rgba(38, 38, 44, .72); border-color: rgba(255, 255, 255, .08); }
  :root:not([data-theme="light"]) .tabbar .tab-pill button { color: #c7c7cc; }
}
/* wide screens keep the plain bar: the pill's tabs and Record in one row */
@media (min-width: 900px) {
  .tab-pill { display: contents; }
  .tabbar .tab-record i { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--record); }
}

/* ---- Map screen on phones, as in the dock design: the chips up top beside the layers button, the
   search bar tucked away until the dock's Search opens it, "Discover <place>" as a card with an arrow. ---- */
@media (max-width: 899px) {
  .topbar { right: max(74px, calc(env(safe-area-inset-right) + 60px)); }
  .topbar .search { display: none; }
  .chips-row { margin-top: 0; padding: 2px 0 6px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent); }
  .map-chip { height: 40px; padding: 0 16px; font-weight: 600; background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6);
    box-shadow: 0 2px 10px rgba(15, 42, 51, .12), inset 0 0 0 1px rgba(255, 255, 255, .9); }
  .map-chip.on { background: var(--on-bg); color: var(--on-text); box-shadow: 0 2px 10px rgba(15, 42, 51, .2); }
  #chipActivities { display: none; }   /* the Discover card does this */
  body.map-search .topbar { right: max(14px, env(safe-area-inset-right)); }
  body.map-search .topbar .search { display: flex; }
  body.map-search .chips-row, body.map-search .fab-col { display: none; }   /* all the side circles, locate and feedback too */
  .fab-col:not(.fab-bottom) { top: calc(8px + var(--safe-t)); gap: 12px; }
  .fab-col.fab-bottom { bottom: calc(var(--bottom) + 90px); }
  .fab-col .fab:not(.fab-big) { background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6);
    box-shadow: 0 2px 10px rgba(15, 42, 51, .12), inset 0 0 0 1px rgba(255, 255, 255, .9); }
  .fab-col .fab.active { background: var(--on-bg); color: var(--on-text); }
  .legends { top: calc(64px + var(--safe-t)); }
  .tabbar .tab-search { flex: none; pointer-events: auto; width: var(--tabbar-h); height: var(--tabbar-h); padding: 0; border-radius: 50%; display: grid; place-items: center; color: var(--text);
    background: rgba(255, 255, 255, .74); -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 10px 30px rgba(15, 42, 51, .18), 0 0 0 .5px rgba(15, 42, 51, .06); -webkit-tap-highlight-color: transparent; transition: transform .2s; }
  .tabbar .tab-search svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; }
  .tabbar .tab-search:active { transform: scale(.92); }
  #dockSearch { display: none; }   /* the dock has Search */
  .discover-peek { padding: 14px 16px 14px 20px; }
  body[data-tab="map"] .discover-peek:not([hidden]) { display: flex; align-items: center; gap: 12px; }
  .discover-peek .grabber { display: none; }
  .discover-peek .peek-txt { flex: 1; min-width: 0; }
  .discover-peek small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
  .discover-peek h3 { font-size: 20px; margin: 1px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .discover-peek .muted { color: inherit; font-weight: 700; }
  .peek-go { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
}
@media (max-width: 899px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tabbar .tab-search, :root:not([data-theme="light"]) .map-chip:not(.on), :root:not([data-theme="light"]) .fab-col .fab:not(.fab-big):not(.active) { background: rgba(38, 38, 44, .72); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
}
@media (min-width: 900px) {
  .tab-search { display: none !important; }
  .peek-go, .discover-peek small { display: none; }
}

/* aspect legend: a small compass rose and the eight faces in two rows */
.legend .aspect-rose { display: block; width: 64px; height: 64px; margin: 6px auto 4px; }
.legend .aspect-dirs { display: grid; grid-template-columns: repeat(4, auto); gap: 2px 8px; font-size: 11px; font-weight: 600; }
.legend .aspect-dirs span { display: flex; align-items: center; gap: 4px; }
.legend .aspect-dirs i { width: 9px; height: 9px; border-radius: 50%; }
.legend .aspect-rose path, .legend .aspect-rose circle { stroke: #fff; stroke-width: 1.2; }

/* ---- Community tab: a switch on top (Community | Profile), then the group tours ---- */
body:not(.prof-view) #profileScreen, body.prof-view #communityScreen { display: none !important; }
body[data-tab="profile"]:not(.prof-view) .dock { display: flex; }   /* messages at hand on Community */
#commSeg { display: none; position: absolute; z-index: 7; top: calc(8px + var(--safe-t)); left: max(16px, env(safe-area-inset-left)); padding: 3px; gap: 2px; border-radius: 999px;
  background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(18px) saturate(1.8); backdrop-filter: blur(18px) saturate(1.8);
  box-shadow: 0 4px 16px rgba(15, 42, 51, .14), inset 0 0 0 1px rgba(255, 255, 255, .8); }
body[data-tab="profile"] #commSeg { display: flex; }
body.dl-mode #commSeg { display: none; }
#commSeg button { height: 34px; padding: 0 15px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 14px; font-weight: 650; color: #4a5160; -webkit-tap-highlight-color: transparent; transition: background-color .2s, color .2s; }
#commSeg button[aria-selected="true"] { background: var(--on-bg); color: var(--on-text); }
body.prof-view #profileHero .sc-bar .tab-back { visibility: hidden; }   /* the switch sits there */
.comm-head { padding-top: 46px; }
.comm-head h1 { font-size: 30px; }
.comm-cta { display: flex; align-items: center; gap: 14px; width: 100%; margin: 6px 0 4px; padding: 14px 16px; border: 0; border-radius: 18px; text-align: left; font: inherit; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #00969c, #2f6bff); box-shadow: 0 8px 22px rgba(16, 120, 255, .28); -webkit-tap-highlight-color: transparent; }
.comm-cta:active { transform: scale(.98); }
.comm-cta b { display: block; font-size: 17px; }
.comm-cta small { display: block; font-size: 13px; opacity: .9; margin-top: 1px; }
.cta-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; }
.cta-ic svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }
.gt-list { display: grid; gap: 10px; padding-bottom: 12px; }
/* Community: how far around the map's middle the activities come from */
.comm-near { margin-top: 22px; padding-top: 4px; border-top: 1px solid var(--line); }
.comm-km { display: grid; gap: 4px; margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.gt-when-title { margin: 8px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
/* No activities of yours yet */
.comm-empty { display: grid; justify-items: start; gap: 6px; padding: 16px; border-radius: 16px; border: 1px dashed rgba(0, 150, 156, .45); background: rgba(0, 150, 156, .06); }
.comm-empty b { font-size: 16px; }
.comm-empty p { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.comm-km b { color: var(--text); }
/* iOS's slider: a thin track, green up to a round white thumb */
.comm-km input { -webkit-appearance: none; appearance: none; height: 30px; margin: 0; background: none;
  --p: 50%; }
.comm-km input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--p), var(--fill-strong) var(--p)); }
.comm-km input::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -12px; border-radius: 50%; background: #fff;
  box-shadow: 0 0.5px 4px rgba(0, 0, 0, .12), 0 6px 13px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
/* the date strip's last tile: any later day, from the system date picker */
.gt-day.more { position: relative; width: 64px; border-style: dashed; color: var(--accent); }
.gt-day.more small { color: var(--accent); }
.gt-day.more svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.gt-day.more input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; }
.gt-list .section-title { margin: 14px 0 0; }
.gt-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 18px; background: var(--card); text-align: left; font: inherit; color: var(--text); cursor: pointer;
  box-shadow: 0 1px 0 var(--line); -webkit-tap-highlight-color: transparent; }
.gt-card:active { transform: scale(.985); }
.gt-cal { flex: none; width: 52px; padding: 6px 0 7px; border-radius: 14px; background: var(--panel-solid); display: grid; justify-items: center; line-height: 1.05;
  box-shadow: inset 0 3px 0 var(--lv, var(--accent)), 0 1px 4px rgba(15, 42, 51, .08); }
.gt-cal small { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.gt-cal b { font-size: 22px; font-weight: 800; margin: 1px 0; }
.gt-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.gt-title { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-main > small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-who { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 600; min-width: 0; }
.gt-who .avatar { width: 20px; height: 20px; flex: none; }
.gt-dots { display: inline-flex; gap: 3px; margin-left: 4px; flex-wrap: wrap; }
.gt-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.gt-dots i.on { background: var(--accent); }
.gt-dots.big { gap: 5px; margin: 8px 0 0; }
.gt-dots.big i { width: 12px; height: 12px; }
.gt-badge { flex: none; align-self: flex-start; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--fill); color: var(--muted); }
.gt-badge.open { background: rgba(0, 150, 156, .14); color: #007a80; }
.gt-badge.hot { background: #ff3b30; color: #fff; }
.gt-badge.wait { background: rgba(255, 159, 10, .16); color: #b26a00; }
.gt-badge.in { background: rgba(52, 199, 89, .16); color: #1d8a3f; }
.gt-badge.own { background: var(--on-bg); color: var(--on-text); }
/* the form */
.gt-field { display: grid; gap: 6px; margin: 12px 0 0; }
.gt-field > span { font-size: 13px; font-weight: 700; color: var(--muted); }
.gt-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gt-days { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px 4px; }
.gt-days::-webkit-scrollbar { display: none; }
.gt-day { flex: none; width: 50px; padding: 7px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--fill); display: grid; justify-items: center; font: inherit; color: var(--text); line-height: 1.1; }
.gt-day small { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.gt-day b { font-size: 18px; }
.gt-day.wknd { border-color: rgba(0, 150, 156, .45); }
.gt-day[aria-pressed="true"] { background: var(--on-bg); border-color: var(--on-bg); color: var(--on-text); }
.gt-day[aria-pressed="true"] small { color: rgba(255, 255, 255, .75); }
.gt-step { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--fill); }
.gt-step button { width: 38px; height: 36px; border: 0; border-radius: 10px; background: var(--panel-solid); font-size: 22px; font-weight: 600; color: var(--text); box-shadow: 0 1px 3px rgba(15, 42, 51, .12); }
.gt-step b { font-size: 18px; }
#gtLevel .chip[aria-pressed="true"] { background: var(--lv); border-color: var(--lv); color: #fff; }
#gtPost { margin-top: 16px; }
.gt-route { display: flex; align-items: center; gap: 12px; width: 100%; margin: 8px 0 0; padding: 10px; border: 0; border-radius: 16px; background: var(--card); text-align: left; font: inherit; color: var(--text); }
.gt-route .route-thumb { flex: none; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; }
.gt-route b { display: block; font-size: 15px; }
.gt-go svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* one tour */
.gt-head { margin: 4px 0 4px; }
.gt-when { display: block; font-size: 14px; font-weight: 700; color: var(--accent); }
.gt-head h2 { font-size: 24px; margin: 2px 0 6px; }
.gt-facts { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; color: var(--muted); font-weight: 600; }
.gt-lv { padding: 1px 9px; border-radius: 999px; color: #fff; background: var(--lv); }
.gt-sub { font-size: 15px; margin: 16px 0 6px; }
.gt-going { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: var(--card); }
.gt-faces { display: flex; gap: 12px; margin-top: 10px; overflow-x: auto; }
.gt-face { display: grid; justify-items: center; gap: 3px; border: 0; background: none; font: inherit; color: var(--text); padding: 0; }
.gt-face .avatar { width: 44px; height: 44px; }
.gt-face small { font-size: 11px; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-note { margin: 12px 0 0; white-space: pre-wrap; line-height: 1.45; }
.gt-act { display: grid; gap: 10px; margin-top: 14px; }
.gt-act .gt-sub { margin-bottom: 0; }
.gt-reqs li { flex-wrap: wrap; }
.gt-msg { margin: 4px 0 0; font-size: 14px; color: var(--text); white-space: pre-wrap; }
.gt-state { font-weight: 700; color: var(--muted); }
.gt-state.accepted { color: #1d8a3f; }
.gt-mine { margin: 0; padding: 12px 14px; border-radius: 14px; font-weight: 700; background: var(--fill); }
.gt-mine.in { background: rgba(52, 199, 89, .14); color: #1d8a3f; }
.gt-mine.wait { background: rgba(255, 159, 10, .14); color: #b26a00; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #commSeg { background: rgba(38, 38, 44, .72); box-shadow: 0 4px 16px rgba(0, 0, 0, .3); }
  :root:not([data-theme="light"]) #commSeg button { color: #c7c7cc; }
  :root:not([data-theme="light"]) #commSeg button[aria-selected="true"] { background: #fff; color: #0f2a33; }
}
.gt-dots.big { display: flex; }
@media (max-width: 899px) {
  .tab-pill { padding: 0 4px; }
  .tabbar .tab-pill button { font-size: 10px; letter-spacing: -.01em; margin: 0; }
}
.gt-comments { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--line); }
.gt-comments .comments { gap: 12px; }
.gt-none { font-size: 14px; padding: 4px 0; }
.gt-org { padding: 0 6px; border-radius: 6px; background: rgba(0, 150, 156, .14); color: #007a80; font-weight: 700; font-size: 11px; }
.gt-send { flex: none; border: 0; background: none; font: inherit; font-weight: 700; color: var(--accent); padding: 8px 4px; }
.gt-send:disabled { opacity: .4; }
.gt-draw { display: flex; align-items: center; gap: 10px; width: 100%; margin: 10px 0 0; padding: 12px 14px; border: 1.5px dashed rgba(0, 150, 156, .55); border-radius: 14px;
  background: rgba(0, 150, 156, .07); font: inherit; font-weight: 700; color: #007a80; text-align: left; }
.gt-draw svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.drawbar #drawUndo:disabled { opacity: .45; }
/* Discover pushed in from the side (tap on the map's Discover strip) is a page, not a sheet: square corners */
#homeScreen.pushed { border-radius: 0; box-shadow: -2px 0 12px rgba(15, 42, 51, .12); }

/* ---- Explore: one place. Its name is the title; tap it for the place list. ---- */
.place-btn { display: inline-flex; align-items: center; gap: 4px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.place-btn h1 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-btn svg { flex: none; width: 22px; height: 22px; margin-top: 3px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.place-btn:active { opacity: .6; }
.place-trips { display: flex; align-items: center; gap: 12px; width: 100%; margin: 4px 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-solid, #fff);
  color: inherit; font: inherit; text-align: left; box-shadow: 0 2px 10px rgba(15, 42, 51, .06); cursor: pointer; }
.place-trips[hidden] { display: none; }
.place-trips .cta-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #00969c, #007a80); }
.place-trips .cta-ic svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.place-trips b { display: block; font-size: 15px; }
.place-trips small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-trips .grow { min-width: 0; }
.place-trips::after { content: '›'; font-size: 24px; color: var(--muted); line-height: 1; }
/* the place list: search on top, nearby ski areas, the regions in a sideways row, then every resort */
#exploreScreen #resortSearch { margin: 4px 0 6px; }
#exploreScreen .list-head { padding: 14px 2px 6px; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 0; background: none; list-style: none; }
#exploreScreen .guides { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 140px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 8px; scroll-snap-type: x mandatory; }
#exploreScreen .guides::-webkit-scrollbar { display: none; }
#exploreScreen .guide { scroll-snap-align: start; }
#exploreScreen.searching .place-hide-q, #exploreScreen.searching #nearList { display: none; }
/* the people feed, now under Community's group tours */
#communityScreen .comm-feed-title { margin-top: 26px; }

/* the place list is pushed over Explore: Explore stays underneath, so sliding back shows it, not the map */
body[data-tab="explore"] #homeScreen { display: block; }
#exploreScreen:not(.searching) #placeSuggest { display: none; }
#placeSuggest .list-head { padding: 14px 4px; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 14px; }

/* ---- Map on phones: Search is the round button top left (before the chips); the dock's right-hand
   circle is My location (the blue dot) on the map and while recording, Search elsewhere. ---- */
.map-search-btn { display: none; }
@media (max-width: 899px) {
  body[data-tab="map"]:not(.map-search) .topbar { display: flex; align-items: flex-start; gap: 8px; }
  .topbar .chips-row { flex: 1; min-width: 0; }
  .map-search-btn { display: grid; flex: none; place-items: center; width: 40px; height: 40px; margin-top: 2px; padding: 0; border: 0; border-radius: 50%; color: var(--text);
    background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6);
    box-shadow: 0 2px 10px rgba(15, 42, 51, .12), inset 0 0 0 1px rgba(255, 255, 255, .9); -webkit-tap-highlight-color: transparent; }
  .map-search-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
  .map-search-btn:active { transform: scale(.92); }
  body.map-search .map-search-btn { display: none; }
  body[data-tab="map"] .tabbar .tab-search, body[data-tab="record"] .tabbar .tab-search { visibility: hidden; }
  .fab-col.fab-bottom, body.sheet-open .fab-col.fab-bottom, body[data-tab="record"] .fab-col.fab-bottom { top: auto; right: max(14px, env(safe-area-inset-right)); bottom: var(--dock-b); z-index: 7; }
  .fab-col.fab-bottom .fab-big { width: var(--tabbar-h); height: var(--tabbar-h); background: rgba(255, 255, 255, .74); -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 10px 30px rgba(15, 42, 51, .18), 0 0 0 .5px rgba(15, 42, 51, .06); }
  .fab-col.fab-bottom .fab-big.located { background: var(--accent); }
}
@media (max-width: 899px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .map-search-btn, :root:not([data-theme="light"]) .fab-col.fab-bottom .fab-big:not(.located) { background: rgba(38, 38, 44, .72); }
}

/* ---- Planning: a card at the bottom (above the dock on phones): what to do + length, then the buttons ---- */
.drawbar { flex-direction: column; align-items: stretch; gap: 10px; white-space: normal; border-radius: 22px; padding: 12px 12px 12px; width: min(520px, calc(100vw - 28px)); box-sizing: border-box; }
.drawbar .draw-txt { padding: 0 6px; }
.drawbar .draw-txt b { display: block; font-size: 17px; }
.drawbar .draw-txt small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.drawbar .draw-btns { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; }
.drawbar .draw-btns .chip { justify-content: center; height: 44px; font-size: 15px; font-weight: 650; }
@media (max-width: 899px) {
  .drawbar { top: auto; bottom: var(--bottom); }
  body.drawing .discover-peek { display: none !important; }
}
/* Plan in the dock: lit while planning (the Map tab under it isn't) */
body.drawing .tabbar .tab-pill button.active { background: none; color: #4a5160 !important; }
body.drawing .tabbar .tab-pill #tabPlan { background: rgba(0, 150, 156, .15); color: #007a80 !important; }
body.drawing .tabbar #tabPlan { color: var(--accent); }
.tabbar #tabPlan svg path { fill: none; stroke: currentColor; }
@media (max-width: 899px) {
  .tab-pill { padding: 0 3px; }
  .tabbar .tab-pill button { margin: 0; font-size: 10px; letter-spacing: -.01em; }
}
@media (max-width: 899px) { .tab-pill { grid-template-columns: 1fr 1.1fr .85fr 1.3fr; } }
/* after Done: what the route is for */
.drawbar .draw-after { display: none; flex-direction: column; gap: 8px; }
.drawbar.after .draw-btns { display: none; }
.drawbar.after .draw-after { display: flex; }
.drawbar .draw-after .chip { justify-content: center; height: 46px; font-size: 15px; font-weight: 650; }
.drawbar .draw-after .plain-btn { height: 36px; background: none; border: 0; box-shadow: none; color: var(--muted); }
/* ⋯ beside ✕ on a tour's sheet */
.icon-btn.adv-menu { margin-right: -4px; }
.icon-btn.adv-menu svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
#advBack:not([hidden]) + .sheet-head .adv-menu { right: 48px; }
#advSheet .sheet-head .title-block { flex: 1; min-width: 0; }
/* a planned / imported tour row (profile): › for "opens on the map", then the tour sheet's ⋯ without its circle */
.icon-btn.close-btn.row-more { align-self: center; margin: -6px -8px -6px 0; background: none !important; box-shadow: none !important; }
.icon-btn.close-btn.row-more:active { background: var(--fill); }
.row-go { flex: none; align-self: center; width: 20px; height: 20px; margin-left: 4px; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }

/* ---- Messages in the dock (after Community); the floating Messages pill is gone ---- */
.dock { display: none !important; }
.tabbar .tab-count { top: -5px; right: -9px; min-width: 17px; height: 17px; font-size: 10.5px; line-height: 17px; border: 2px solid #fff; box-sizing: content-box; padding: 0 4px; }
/* unread messages on the tab: a plain red dot like Community's, the count would cover the bubble */
.tabbar .tab-pill .tab-count { top: -1px; right: -3px; width: 10px; min-width: 0; height: 10px; padding: 0; font-size: 0; border-radius: 50%; background: #ff3040; border: 2px solid #fff; box-shadow: none; box-sizing: content-box; }
@media (max-width: 899px) {
  .tab-pill { grid-template-columns: .8fr 1fr .8fr 1.25fr 1.2fr; padding: 0 2px; }
  .tabbar { gap: 8px; }
  .tabbar .tab-record, .tabbar .tab-search, .fab-col.fab-bottom .fab-big { width: 58px; height: 58px; }
  .tabbar .tab-pill button { font-size: 9.5px; letter-spacing: -.015em; }
}
@media (max-width: 899px) {
  .tab-pill { min-width: 0; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.25fr) minmax(0, 1.2fr); }
  .tabbar .tab-pill button { padding: 0; min-width: 0; white-space: nowrap; }
}
/* five tabs: the dock nearer the screen's edges, smaller Record and My location, more room for the tabs */
@media (max-width: 899px) {
  .tabbar { left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); gap: 6px; }
  .tabbar .tab-record, .tabbar .tab-search, .fab-col.fab-bottom .fab-big { width: 52px; height: 52px; }
  .fab-col.fab-bottom, body.sheet-open .fab-col.fab-bottom, body[data-tab="record"] .fab-col.fab-bottom { right: max(8px, env(safe-area-inset-right)); bottom: calc(var(--dock-b) + (var(--tabbar-h) - 52px) / 2); }
  .tabbar .tab-record i { width: 18px; height: 18px; }
  .fab-col.fab-bottom .fab-big svg { width: 26px; height: 26px; }
  .tabbar .tab-search svg { width: 22px; height: 22px; }
  .tab-pill { padding: 0 4px; }
  .tabbar .tab-pill button { font-size: 10px; letter-spacing: -.01em; }
}
/* the Explore card and the planning card line up with the dock's edges */
@media (max-width: 899px) {
  .discover-peek { left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); }
  .drawbar { width: min(520px, calc(100vw - 16px)); }
}
/* the tab pill as tall as Record and My location; the selected tab as on iOS: a soft grey capsule,
   icon and label in the accent blue (no tinted blue fill) */
@media (max-width: 899px) {
  .tab-pill { height: 52px; align-self: center; padding: 0 3px; }
  .tabbar .tab-pill button { height: 44px; gap: 1px; border-radius: 999px; }
  .tabbar .tab-pill button svg.solid, .tabbar .tab-icon { width: 22px; height: 22px; }
  .tabbar .tab-pill button.active, body.drawing .tabbar .tab-pill #tabPlan { background: rgba(15, 42, 51, .075); color: #00898f !important; }
  body.drawing .tabbar .tab-pill button.active:not(#tabPlan) { background: none; color: #4a5160 !important; }
}
@media (max-width: 899px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tabbar .tab-pill button.active, :root:not([data-theme="light"]) body.drawing .tabbar .tab-pill #tabPlan { background: rgba(255, 255, 255, .12); color: #4db2ff !important; }
}

/* ---- Four tabs (Explore opens from the card on the map) ---- */
@media (max-width: 899px) {
  .tab-pill { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 4px; }
  .tabbar .tab-pill button { font-size: 10.5px; letter-spacing: 0; }
}
/* the Explore card: "EXPLORE", the place, then what's there as small tags */
.peek-eyebrow { display: block; font-size: 11.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: #00898f; }
.discover-peek h3#peekPlace { margin: 1px 0 0; }
.peek-facts { display: flex; gap: 6px; margin-top: 7px; overflow: hidden; }
.peek-facts:not(:has(span:not([hidden]))) { display: none; }
.peek-facts span { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 12px; background: rgba(15, 42, 51, .06); font-size: 12.5px; font-weight: 650; color: #2b2f3a; white-space: nowrap; }
.peek-facts span[hidden] { display: none; }
.peek-facts .grp { background: rgba(52, 199, 89, .14); color: #1f8a43; }
.peek-facts .snow { background: rgba(0, 137, 143, .12); color: #007a80; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .peek-facts span { background: rgba(255, 255, 255, .1); color: #e8e8ee; }
  :root:not([data-theme="light"]) .peek-facts .grp { background: rgba(52, 199, 89, .2); color: #6be38f; }
}
/* the tags scroll sideways (new snow, ski tours, freeride, group tours) */
.peek-facts { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-right: -6px; padding-right: 14px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent); }
.peek-facts::-webkit-scrollbar { display: none; }
.peek-facts span { flex: none; }
.peek-facts .snow.none { background: rgba(15, 42, 51, .06); color: #5b6270; }

/* ---- Record only on the map (and while recording); elsewhere the dock is the tabs and Search ---- */
body:not([data-tab="map"]):not([data-tab="record"]) .tabbar .tab-record { display: none; }

/* ---- Messages, like Instagram's: full-screen pages, a chat pushed in from the right ---- */
.modal.dm-page:not([hidden]) { top: 0; bottom: 0; height: auto !important; max-height: none; border-radius: 0; box-shadow: none; z-index: 12;
  padding: var(--safe-t) 0 0; display: flex; flex-direction: column; overflow: hidden; background: var(--panel-solid, #fff);
  animation: sheet-push .32s cubic-bezier(.32, .72, 0, 1) backwards; }
.modal.dm-page > .grabber { display: none; }
.dm-head { flex: none; display: flex; align-items: center; gap: 4px; height: 52px; padding: 0 8px; }
.dm-head h3 { flex: 1; margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.dm-ic { width: 44px; height: 44px; flex: none; border: 0; background: none; color: var(--text); display: grid; place-items: center; padding: 0; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
.dm-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dm-ic:active { background: var(--fill); }
.dm-search { flex: none; display: flex; align-items: center; gap: 8px; margin: 2px 16px 8px; height: 38px; padding: 0 12px; border-radius: 12px; background: var(--fill); }
.dm-search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.dm-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); outline: none; }
.dm-label { flex: none; padding: 8px 16px 6px; font-size: 16px; font-weight: 750; }
.dm-list { flex: 1; overflow-y: auto; margin: 0; padding: 0 0 calc(20px + var(--safe-b)); list-style: none; -webkit-overflow-scrolling: touch; }
.dm-list .empty { padding: 30px 24px; text-align: center; color: var(--muted); }
.dm-list .conv { display: flex; align-items: center; gap: 12px; padding: 8px 16px; cursor: pointer; border: 0; background: none; }
.dm-list .conv:active { background: var(--fill); }
.dm-list .conv .avatar { width: 56px; height: 56px; flex: none; }
.dm-list .conv .grow { flex: 1; min-width: 0; }
.dm-list .conv b { display: block; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-list .conv small { display: flex; font-size: 14px; color: var(--muted); margin-top: 1px; min-width: 0; }
.dm-list .conv .conv-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dm-list .conv .conv-time { flex: none; white-space: pre; }
.dm-list .conv.unread b, .dm-list .conv.unread small { color: var(--text); font-weight: 700; }
.dm-list .conv-dot { flex: none; width: 9px; height: 9px; min-width: 0; padding: 0; border-radius: 50%; background: #00898f; }
/* the chat */
.dm-chat .dm-head { border-bottom: 1px solid var(--line); }
.dm-chat .chat-who { padding: 0 4px; gap: 10px; }
.dm-chat .chat-who .avatar { width: 34px; height: 34px; }
.dm-chat .chat-who span { font-size: 16px; font-weight: 700; line-height: 1.15; }
.dm-chat .chat-list { padding: 8px 12px 6px; gap: 2px; }
.chat-day { font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 0 8px; }
.dm-chat .msg { max-width: 72%; padding: 9px 14px; border-radius: 22px; font-size: 15.5px; line-height: 1.3; background: #efefef; color: #000; position: relative; margin-left: 34px; }
.dm-chat .msg.mine { background: #00898f; color: #fff; margin-left: 0; }
.dm-chat .msg.run-top:not(.mine), .dm-chat .msg.run-mid:not(.mine) { border-bottom-left-radius: 6px; }
.dm-chat .msg.run-mid:not(.mine), .dm-chat .msg.run-end:not(.mine) { border-top-left-radius: 6px; }
.dm-chat .msg.mine.run-top, .dm-chat .msg.mine.run-mid { border-bottom-right-radius: 6px; }
.dm-chat .msg.mine.run-mid, .dm-chat .msg.mine.run-end { border-top-right-radius: 6px; }
.dm-chat .msg:not(.run-top):not(.run-mid) { margin-bottom: 6px; }
.dm-chat .msg-ava { position: absolute; left: -34px; bottom: 0; width: 28px !important; height: 28px !important; }
.dm-chat .msg.msg-card { background: #efefef; color: #000; }
.dm-chat .msg.msg-card.mine { background: #00898f; color: #fff; }
.dm-chat .msg-seen { margin: 0 4px 4px; font-size: 12px; }
/* the field: a rounded pill, "Send" in blue once there's text */
.dm-chat .chat-form { flex: none; border: 0; padding: 6px 12px calc(8px + var(--safe-b)); }
body.kb-open .dm-chat .chat-form { padding-bottom: 8px; }
.dm-field { flex: 1; display: flex; align-items: flex-end; min-height: 44px; border-radius: 22px; background: var(--fill); padding: 0 6px 0 16px; }
.dm-field textarea { flex: 1; border: 0; background: none; border-radius: 0; padding: 12px 0; font-size: 16px; line-height: 20px; max-height: 120px; outline: none; color: var(--text); }
.dm-chat .chat-send { width: auto; height: 44px; border-radius: 0; background: none; padding: 0 10px; color: #00898f; font: inherit; font-size: 16px; font-weight: 700; }
.dm-chat .chat-send:disabled { display: none; }
/* keyboard up: the chat fills just what's visible (iOS also scrolls the page, which hid the top and the
   newest messages), the field on the keyboard, the list shrinking from the top */
body.kb-open .modal.dm-page:not([hidden]) { top: var(--vvtop, 0px); bottom: auto; height: var(--vvh, 100%) !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dm-chat .msg:not(.mine) { background: #262626; color: #f5f5f5; }
}
.modal.dm-page.pop:not([hidden]) { animation: sheet-pop .3s cubic-bezier(.32, .72, 0, 1) backwards; }
.modal.dm-page.closing { transform: translate3d(100%, 0, 0) !important; }   /* leaves to the right, as it came */
/* New message (people picker from the inbox): a full page like the inbox */
#peopleSheet.dm-page:not([hidden]) { padding: var(--safe-t) 16px 0; }
#peopleSheet.dm-page .modal-head { flex: none; height: 52px; margin: 0; }
#peopleSheet.dm-page #peopleSearch { flex: none; height: 38px; border: 0; border-radius: 12px; background: var(--fill); margin: 2px 0 8px; }
#peopleSheet.dm-page #peopleList { flex: 1; align-content: start; overflow-y: auto; margin: 0 -16px; padding: 0 0 calc(20px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
#peopleSheet.dm-page #peopleList > li { padding-left: 16px; padding-right: 16px; }
#peopleSheet.dm-page .list-head { font-size: 16px; font-weight: 750; color: var(--text); text-transform: none; letter-spacing: 0; border: 0; background: none; padding-top: 8px; }

/* ---- The chat's gestures: hold, swipe to reply, swipe for times; replies and reactions ---- */
.dm-chat .chat-list { touch-action: pan-y; overflow-x: hidden; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.dm-chat .msg { transition: transform .25s cubic-bezier(.32, .72, 0, 1); }
.dm-chat .msg.pending { opacity: .55; }
.dm-chat .msg.flash { animation: msg-flash .9s; }
@keyframes msg-flash { 30% { filter: brightness(.82); } }
/* swipe right: a reply arrow appears at the bubble's left */
.dm-chat .msg.swiping::before { content: ''; position: absolute; left: -40px; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%;
  background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23262626' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14 4 9l5-5'/%3E%3Cpath d='M4 9h10.5a5.5 5.5 0 0 1 0 11H11'/%3E%3C/svg%3E") center / 16px no-repeat;
  opacity: var(--reply, 0); transform: scale(calc(.6 + .4 * var(--reply, 0))); }
.dm-chat .msg:not(.mine).swiping::before { left: -72px; }
/* swipe left: every message moves left and its time shows at the screen's right edge */
.msg-time { position: absolute; top: 50%; transform: translateY(-50%); left: calc(100% + var(--edge, 0px) + 12px); font-size: 11.5px; color: var(--muted); white-space: nowrap; pointer-events: none; }
.chat-list.peeking .msg { transform: translateX(var(--peek, 0px)); transition: none; }
.chat-list.peek-back .msg { transition: transform .25s cubic-bezier(.32, .72, 0, 1); }
/* a reply: what it answers, small and faded, above it */
.msg-quote { align-self: flex-start; max-width: 70%; margin: 8px 0 -10px 34px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; cursor: pointer; }
.msg-quote.mine { align-self: flex-end; align-items: flex-end; margin-left: 0; }
.msg-quote small { font-size: 11.5px; color: var(--muted); padding: 0 4px; }
.msg-quote-text { padding: 8px 14px 16px; border-radius: 18px; background: transparent; border: 1.5px solid var(--line); color: var(--muted); font-size: 14px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* reactions: a small pill hanging from the bubble's bottom */
.dm-chat .msg.has-react { margin-bottom: 20px !important; }
.msg-react { position: absolute; bottom: -17px; left: 10px; height: 24px; padding: 0 7px; border-radius: 12px; border: 2px solid var(--panel-solid, #fff); background: #efefef; color: #000;
  font: inherit; font-size: 13px; line-height: 20px; white-space: nowrap; cursor: pointer; }
.msg.mine .msg-react { left: auto; right: 10px; }
/* what you're replying to, over the field */
.chat-reply { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px 4px 18px; border-top: 1px solid var(--line); }
.chat-reply[hidden] { display: none; }
.chat-reply .grow { min-width: 0; }
.chat-reply b { display: block; font-size: 13px; }
.chat-reply span { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply button { flex: none; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); padding: 0; display: grid; place-items: center; }
.chat-reply button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* the long-press menu: blurred chat, the message lifted, emoji above, actions below */
.msg-menu { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .18); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); opacity: 0; transition: opacity .18s; }
.msg-menu.open { opacity: 1; }
.msg-menu > * { position: absolute; }
.msg-lifted { margin: 0 !important; max-height: 40vh; overflow: hidden; box-shadow: 0 8px 30px rgba(0, 0, 0, .18); }
.msg-lifted .msg-time, .msg-lifted .msg-react { display: none; }
.dm-chat .msg-lifted, .msg-menu .msg { max-width: none; }
.msg-menu .msg { padding: 9px 14px; border-radius: 22px; font-size: 15.5px; line-height: 1.3; background: #efefef; color: #000; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-menu .msg.mine { background: #00898f; color: #fff; }
.msg-emoji { display: flex; gap: 2px; height: 50px; padding: 0 6px; border-radius: 25px; background: var(--panel-solid, #fff); box-shadow: 0 6px 24px rgba(0, 0, 0, .16); align-items: center;
  transform-origin: bottom left; animation: emoji-in .28s cubic-bezier(.32, .72, 0, 1) backwards; }
.msg-emoji:empty { display: none; }
.msg-emoji button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; font-size: 27px; line-height: 1; padding: 0; transition: transform .12s; }
.msg-emoji button:active { transform: scale(1.25); }
.msg-emoji button.on { background: var(--fill); }
@keyframes emoji-in { from { transform: scale(.6); opacity: 0; } }
.msg-acts { width: 230px; border-radius: 14px; overflow: hidden; background: rgba(250, 250, 250, .96); box-shadow: 0 8px 30px rgba(0, 0, 0, .16); animation: emoji-in .24s cubic-bezier(.32, .72, 0, 1) backwards; }
.msg-acts button { width: 100%; height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border: 0; background: none; font: inherit; font-size: 16px; color: #000; }
.msg-acts button + button { border-top: 1px solid rgba(0, 0, 0, .08); }
.msg-acts button:active { background: rgba(0, 0, 0, .06); }
.msg-acts button.danger { color: #ed4956; }
.msg-acts svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .msg-acts { background: rgba(38, 38, 40, .96); }
  :root:not([data-theme="light"]) .msg-acts button { color: #f5f5f5; }
  :root:not([data-theme="light"]) .msg-react { background: #262626; color: #fff; border-color: #000; }
}
.msg-time { opacity: 0; }
.chat-list.peeking .msg-time { opacity: 1; }
.msg-quote-text { display: block; padding: 8px 14px 16px; }
.msg-quote-text span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 18px; }

/* the dock over the Messages inbox (not in a chat, where the field is): Messages lit, Search on the right */
body:has(#messagesSheet:not([hidden]):not(.closing)) .tabbar { z-index: 13; }
body:has(#messagesSheet:not([hidden]):not(.closing)) .tabbar .tab-record { display: none; }
body:has(#messagesSheet:not([hidden]):not(.closing)) .tabbar .tab-search { visibility: visible; }
body:has(#messagesSheet:not([hidden]):not(.closing)) .tabbar .tab-pill button.active { background: none; color: #4a5160 !important; }
body:has(#messagesSheet:not([hidden]):not(.closing)) .tabbar .tab-pill #tabMsg { background: rgba(15, 42, 51, .075); color: #00898f !important; }
#messagesSheet .dm-list { padding-bottom: calc(var(--bottom) + 16px); }
/* edited messages, the edit bar */
.msg-note { align-self: flex-start; margin: -2px 0 6px 48px; font-size: 11.5px; color: var(--muted); }
.msg-note.mine { align-self: flex-end; margin: -2px 6px 6px 0; }
.chat-reply.editing b { color: #00898f; }
/* inbox: swipe a chat left for Delete */
.conv-wrap { position: relative; overflow: hidden; list-style: none; }
.conv-wrap .conv { position: relative; z-index: 1; background: var(--panel-solid, #fff); transition: transform .25s cubic-bezier(.32, .72, 0, 1); }
.conv-wrap .conv.open { transform: translateX(-88px); }
.conv-del { position: absolute; top: 0; right: 0; bottom: 0; width: 88px; border: 0; background: #ed4956; color: #fff; font: inherit; font-size: 15px; font-weight: 650; }
/* long press on a chat (Instagram): a preview card of the chat, a big frosted menu below */
.conv-preview { position: absolute; left: 16px; right: 16px; border-radius: 32px; overflow: hidden; display: flex; flex-direction: column;
  background: rgba(255, 255, 255, .96); box-shadow: 0 16px 50px rgba(0, 0, 0, .2); animation: emoji-in .26s cubic-bezier(.32, .72, 0, 1) backwards; cursor: pointer; }
.pv-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; border-bottom: 1px solid rgba(0, 0, 0, .06); }
.pv-head .avatar { width: 32px; height: 32px; flex: none; }
.pv-head b { font-size: 16px; font-weight: 700; color: #000; }
.pv-msgs { flex: 1; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 10px 14px 14px; }
.pv-msg { align-self: flex-start; max-width: 75%; padding: 8px 13px; border-radius: 20px; background: #efefef; color: #000; font-size: 14.5px; line-height: 1.3;
  white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pv-msg.mine { align-self: flex-end; background: #00898f; color: #fff; }
.pv-empty { margin: auto; color: #8e8e8e; font-size: 14px; }
.conv-acts { position: absolute; left: 16px; width: min(64vw, 280px); border-radius: 28px; overflow: hidden; padding: 6px 0;
  background: rgba(242, 242, 247, .9); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .18); animation: emoji-in .26s cubic-bezier(.32, .72, 0, 1) backwards; transform-origin: top left; }
.conv-acts button { width: 100%; height: 52px; display: flex; align-items: center; gap: 16px; padding: 0 22px; border: 0; background: none; font: inherit; font-size: 18px; color: #000; text-align: left; }
.conv-acts button:active { background: rgba(0, 0, 0, .06); }
.conv-acts button.danger { color: #ed4956; }
.conv-acts svg { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .conv-preview { background: rgba(28, 28, 30, .97); }
  :root:not([data-theme="light"]) .pv-head b { color: #fff; }
  :root:not([data-theme="light"]) .pv-msg:not(.mine) { background: #262626; color: #f5f5f5; }
  :root:not([data-theme="light"]) .conv-acts { background: rgba(44, 44, 46, .9); }
  :root:not([data-theme="light"]) .conv-acts button:not(.danger) { color: #fff; }
}
/* iOS alert */
.ios-alert { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity .16s; }
.ios-alert.open { opacity: 1; }
.ios-alert-card { width: 270px; border-radius: 14px; overflow: hidden; background: rgba(245, 245, 245, .97); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); text-align: center;
  transform: scale(1.12); transition: transform .2s cubic-bezier(.32, .72, 0, 1); }
.ios-alert.open .ios-alert-card { transform: none; }
.ios-alert-card b { display: block; padding: 19px 16px 2px; font-size: 17px; font-weight: 600; color: #000; }
.ios-alert-card p { margin: 0; padding: 2px 16px 19px; font-size: 13px; line-height: 1.35; color: #000; }
.ios-alert-btns { display: grid; grid-template-columns: 1fr 1fr; border-top: .5px solid rgba(60, 60, 67, .29); }
.ios-alert-btns button { height: 44px; border: 0; background: none; font: inherit; font-size: 17px; color: #00898f; }
.ios-alert-btns button + button { border-left: .5px solid rgba(60, 60, 67, .29); }
.ios-alert-btns button.danger { color: #ff3b30; font-weight: 600; }
.ios-alert-btns button.strong { font-weight: 600; }
.ios-alert-btns button:active { background: rgba(0, 0, 0, .06); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ios-alert-card { background: rgba(44, 44, 46, .97); }
  :root:not([data-theme="light"]) .ios-alert-card b, :root:not([data-theme="light"]) .ios-alert-card p { color: #fff; }
}
/* swipe-to-delete as on Instagram: the red button runs the row's full height, "Delete" in white */
.conv-del { width: 88px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }

/* ---- Two circles beside the tabs on every screen: Record / My location on the map; elsewhere
   this screen's create (＋ or ✎) and Search ---- */
.tab-act { display: none; }
.tabbar .tab-act { display: none; }   /* (over ".tabbar button { display: flex }"; shown off the map, below) */
@media (max-width: 899px) {
  .tabbar .tab-act { flex: none; pointer-events: auto; width: 52px; height: 52px; padding: 0; border-radius: 50%; place-items: center; color: var(--text);
    background: rgba(255, 255, 255, .74); -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 10px 30px rgba(15, 42, 51, .18), 0 0 0 .5px rgba(15, 42, 51, .06); -webkit-tap-highlight-color: transparent; transition: transform .2s; }
  .tabbar .tab-act:active { transform: scale(.92); }
  .tabbar .tab-act { position: relative; }
  .tabbar .tab-act svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar .tab-act .tab-count { top: -4px; right: -4px; }
  body:not([data-tab="map"]):not([data-tab="record"]) .tabbar .tab-act { display: grid; }
  body:has(#messagesSheet:not([hidden]):not(.closing)) .tabbar .tab-act { display: grid; }
}
@media (max-width: 899px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tabbar .tab-act { background: rgba(38, 38, 44, .72); border-color: rgba(255, 255, 255, .08); }
}

/* ---- Layers sheet: three maps, Offline maps, the rest folded away ---- */
.map-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 14px; }
.map-kinds button { border: 0; padding: 0; background: none; font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 6px; align-items: center; cursor: pointer; }
.map-kinds img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .15s; }
.map-kinds span { font-size: 14px; font-weight: 600; }
.map-kinds button.active img { box-shadow: 0 0 0 3px #00898f; }
.map-kinds button.active span { color: #00898f; }
.offline-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-solid, #fff);
  font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.offline-row .off-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #00969c, #007a80); }
.offline-row .off-ic svg { width: 23px; height: 23px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.offline-row b { display: block; font-size: 15px; }
.offline-row small { display: block; color: var(--muted); font-size: 13px; }
.offline-row .chev { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.more-layers { border-top: 1px solid var(--line); padding-top: 4px; }
.more-layers > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 12px 2px; font-size: 15px; font-weight: 600; color: var(--muted); }
.more-layers > summary::-webkit-details-marker { display: none; }
.more-layers > summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.more-layers[open] > summary::after { transform: rotate(225deg) translate(-2px, -2px); }
/* the search bar is only search now */
.topbar .search input { padding-right: 12px; }
/* the map's search bar like iOS's: a frosted capsule field, a grey ✕ inside, Cancel beside it */
.topbar .search { height: 44px; padding: 0 10px 0 14px; gap: 8px; border-radius: 22px; max-width: 520px;
  background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 2px 12px rgba(15, 42, 51, .14), inset 0 0 0 1px rgba(255, 255, 255, .9); }
.topbar .search > svg.search-ic { width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 2.3; stroke-linecap: round; }
.topbar .search input { font-size: 16px; font-weight: 400; padding-right: 4px; -webkit-appearance: none; appearance: none; }
.topbar .search input::-webkit-search-cancel-button { display: none; }
#searchBack { display: none !important; }
#searchClear { width: 20px; height: 20px; border-radius: 50%; background: #9a9aa2; color: #fff; }
#searchClear[hidden] { display: none; }
.topbar .search #searchClear svg { width: 11px; height: 11px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; color: #fff; }
.topbar .search #searchResults { top: 52px; border-radius: 18px; }
.search-cancel { flex: none; height: 44px; padding: 0 16px; border: 0; border-radius: 22px; font: inherit; font-size: 16px; font-weight: 500; color: var(--text); cursor: pointer;
  background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 2px 12px rgba(15, 42, 51, .14), inset 0 0 0 1px rgba(255, 255, 255, .9); }
.search-cancel[hidden] { display: none; }
.search-cancel:active { opacity: .6; }
body[data-tab="map"] .topbar.map-only:not([hidden]) { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.topbar .search { flex: 1 1 0; min-width: 0; width: auto; }
@media (min-width: 900px) { .topbar .chips-row { flex-basis: 100%; } }

/* ---- Messages, more of Instagram: the chat's top, big emoji, reactions, the details page ---- */
.chat-intro { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 26px 0 22px; text-align: center; align-self: stretch; }
.chat-intro .avatar { width: 96px !important; height: 96px !important; margin-bottom: 10px; font-size: 34px; }
.chat-intro b { font-size: 20px; font-weight: 700; }
.chat-intro small { font-size: 14px; color: var(--muted); }
.chat-intro-btn { margin-top: 14px; height: 34px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--fill); font: inherit; font-size: 14px; font-weight: 600; color: var(--text); }
.chat-intro-btn:active { opacity: .6; }
.dm-chat .msg.big-emoji, .msg-menu .msg.big-emoji { background: none !important; padding: 0 2px; font-size: 44px; line-height: 1.1; }
.dm-chat .msg.big-emoji .msg-ava { bottom: 4px; }
.msg-emoji .emoji-more { display: grid; place-items: center; background: var(--fill); width: 36px; height: 36px; margin-left: 2px; font-size: 22px; }
.msg-emoji .emoji-more svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; }
.msg-react { cursor: pointer; }

/* iOS's sheet over the chat (drawn on its own layer, the chat stays) */
.dm-sheet { position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, 0); transition: background .22s; }
.dm-sheet.open { background: rgba(0, 0, 0, .32); }
.dm-sheet-card { position: absolute; left: 0; right: 0; bottom: 0; max-height: 72vh; overflow-y: auto; overscroll-behavior: contain; border-radius: 16px 16px 0 0; background: var(--panel-solid, #fff);
  padding: 6px 0 calc(14px + var(--safe-b)); transform: translateY(100%); transition: transform .26s cubic-bezier(.32, .72, 0, 1); }
.dm-sheet.open .dm-sheet-card { transform: none; }
.dm-sheet-card .grabber { margin: 2px auto 8px; }
.dm-sheet-title { display: block; text-align: center; font-size: 16px; font-weight: 700; padding: 4px 16px 12px; border-bottom: 1px solid var(--line); }
.dm-sheet-card > button { display: block; width: 100%; height: 52px; padding: 0 20px; border: 0; background: none; text-align: left; font: inherit; font-size: 16px; color: var(--text); }
.dm-sheet-card > button + button { border-top: 1px solid var(--line); }
.dm-sheet-card > button:active { background: var(--fill); }
.dm-sheet-card > button.danger { color: #ed4956; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); padding: 8px 10px; }
.emoji-grid button { aspect-ratio: 1; border: 0; background: none; font-size: 30px; padding: 0; border-radius: 10px; }
.emoji-grid button:active { background: var(--fill); transform: scale(1.15); }
.react-list { padding: 4px 0; }
.react-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; border: 0; background: none; text-align: left; font: inherit; color: var(--text); }
.react-row .avatar { width: 44px; height: 44px; flex: none; }
.react-row .grow { flex: 1; min-width: 0; }
.react-row b { display: block; font-size: 15px; font-weight: 600; }
.react-row small { display: block; font-size: 13px; color: var(--muted); }
.react-emoji { font-size: 26px; }

/* the chat's details */
.dm-info { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--panel-solid, #fff); padding-top: var(--safe-t);
  transform: translate3d(100%, 0, 0); transition: transform .28s cubic-bezier(.32, .72, 0, 1); overflow-y: auto; }
.dm-info.open { transform: none; }
.dm-info .dm-head { flex: none; display: flex; align-items: center; height: 52px; padding: 0 8px; }
.dm-info-title { flex: 1; text-align: center; margin-right: 44px; font-size: 17px; font-weight: 700; }
.dm-info-top { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 16px 6px; }
.dm-info-top .avatar { width: 96px !important; height: 96px !important; margin-bottom: 10px; font-size: 34px; }
.dm-info-top b { font-size: 20px; font-weight: 700; }
.dm-info-top small { font-size: 14px; color: var(--muted); }
.dm-info-btns { display: flex; justify-content: center; gap: 28px; padding: 18px 16px 22px; }
.dm-info-btns button { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; font: inherit; font-size: 13px; color: var(--text); }
.dm-info-btns i { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--fill); }
.dm-info-btns svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dm-info-btns button.on i { background: var(--text); color: var(--panel-solid, #fff); }
.dm-info-rows { border-top: 1px solid var(--line); }
.dm-info-rows button { display: block; width: 100%; height: 52px; padding: 0 20px; border: 0; background: none; text-align: left; font: inherit; font-size: 16px; color: var(--text); }
.dm-info-rows button.danger { color: #ed4956; }
.dm-info-rows button:active { background: var(--fill); }

/* the inbox: muted chats, and Mute beside Delete when you swipe */
.conv-muted { width: 14px; height: 14px; margin-left: 5px; vertical-align: -2px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.conv-wrap .conv.open { transform: translateX(-176px); }
.conv-mute { position: absolute; top: 0; right: 88px; bottom: 0; width: 88px; border: 0; background: #8e8e93; color: #fff; font: inherit; font-size: 15px; font-weight: 600; }
/* ---- The chat as Instagram draws it now (iOS 26): the messages run under a floating header of round
   glass buttons, the field a grey pill — a photo icon right while empty, a blue send pill while typing ---- */
.dm-chat .dm-head { position: absolute; z-index: 3; top: 0; left: 0; right: 0; height: auto; padding: calc(var(--safe-t) + 6px) 12px 14px; gap: 10px; border: 0;
  background: linear-gradient(var(--panel-solid, #fff) 55%, rgba(255, 255, 255, 0)); pointer-events: none; }
.dm-chat .dm-head > * { pointer-events: auto; }
.modal.dm-chat:not([hidden]) { padding-top: 0; }
.dm-chat #chatBack { width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: 0 1px 8px rgba(0, 0, 0, .08), inset 0 0 0 .5px rgba(0, 0, 0, .1); display: grid; }
.dm-chat #chatBack svg { width: 24px; height: 24px; }
.dm-chat .chat-who { flex: 0 1 auto; height: 46px; padding: 0 14px 0 5px; border-radius: 23px; gap: 9px; background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: 0 1px 8px rgba(0, 0, 0, .08), inset 0 0 0 .5px rgba(0, 0, 0, .1); }
.dm-chat .chat-who .avatar { width: 36px; height: 36px; }
.dm-chat .chat-who span { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.chat-who-name { display: flex; align-items: center; gap: 2px; min-width: 0; font-size: 16px; font-weight: 700; }
.chat-who-name i { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-who-name svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dm-chat .chat-who small { font-size: 13px; font-weight: 400; color: var(--muted); }
.dm-chat .chat-list { padding-top: calc(var(--safe-t) + 70px); }
.dm-chat #chatOffline { position: relative; z-index: 4; margin-top: calc(var(--safe-t) + 64px); }

/* the field */
.dm-chat .chat-form { padding: 6px 12px calc(8px + var(--safe-b)); }
.dm-field { align-items: center; min-height: 48px; border-radius: 24px; background: var(--fill); padding: 0 6px 0 18px; gap: 4px; }
.dm-field textarea { padding: 14px 0; }
.chat-photo { flex: none; width: 40px; height: 40px; border: 0; background: none; padding: 0; display: grid; place-items: center; color: var(--text); }
.chat-photo svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dm-chat .chat-send { flex: none; width: 56px; height: 38px; padding: 0; border: 0; border-radius: 19px; background: #00898f; color: #fff; display: grid; place-items: center; }
.dm-chat .chat-send svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transform: translate(-1px, 1px); }
.dm-chat .chat-send:disabled { display: none; }
.dm-chat .chat-send:not(:disabled) ~ .chat-photo, .dm-field:has(.chat-send:not(:disabled)) .chat-photo { display: none; }
.dm-chat .chat-send:active { opacity: .7; }
.dm-chat .chat-send.saving svg { display: none; }
.dm-chat .chat-send.saving::after { content: ''; width: 9px; height: 16px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-2px) rotate(45deg); }

/* replying: a plain line over the field, a picture's thumbnail and ✕ at the right */
.chat-reply { padding: 12px 10px 8px 22px; gap: 12px; border-top: 1px solid var(--line); }
.chat-reply .grow { flex: 1; }
.chat-reply b { font-size: 15px; font-weight: 400; color: var(--text); }
.chat-reply span { font-size: 15px; color: var(--text); margin-top: 2px; }
.chat-reply-img { width: 34px; height: 44px; flex: none; object-fit: cover; border-radius: 6px; }
.chat-reply-img[hidden] { display: none; }
.chat-reply button { width: 40px; height: 40px; color: var(--text); }
.chat-reply button svg { width: 22px; height: 22px; stroke-width: 1.8; }

/* a photo: the picture itself, rounded, without a bubble */
.dm-chat .msg.msg-photo, .msg-menu .msg.msg-photo { padding: 0; width: 62%; max-width: 260px; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 22px !important; background: var(--fill) !important; }
.msg.msg-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dm-chat .msg.msg-photo .msg-ava { border-radius: 50%; }
.dm-chat .msg.msg-photo:not(.mine) { overflow: visible; }
.dm-chat .msg.msg-photo:not(.mine) img { border-radius: 22px; }
.photo-view { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0, 0, 0, 0); transition: background .2s; }
.photo-view.open { background: #000; }
.photo-view img { max-width: 100%; max-height: 100%; object-fit: contain; opacity: 0; transform: scale(.92); transition: opacity .2s, transform .25s cubic-bezier(.32, .72, 0, 1); }
.photo-view.open img { opacity: 1; transform: none; }

/* the long press: a light frosted screen, the reactions across it, the menu card with the time on top */
.msg-menu { background: rgba(245, 245, 247, .55); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); }
.msg-emoji { left: 14px !important; right: 14px !important; height: 62px; padding: 0 10px; border-radius: 31px; justify-content: space-between; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
.msg-emoji button { width: 46px; height: 46px; font-size: 32px; }
.msg-emoji .emoji-more { background: none; width: 46px; height: 46px; }
.msg-emoji .emoji-more svg { width: 26px; height: 26px; stroke-width: 1.8; }
.msg-acts { width: 250px; border-radius: 26px; padding: 6px 0; background: rgba(250, 250, 252, .9); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .14), inset 0 0 0 .5px rgba(0, 0, 0, .08); }
.msg-acts-time { padding: 12px 22px 6px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.msg-acts button { height: 52px; justify-content: flex-start; gap: 16px; padding: 0 22px; font-size: 17px; }
.msg-acts button + button { border-top: 0; }
.msg-acts svg { width: 24px; height: 24px; flex: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dm-chat .dm-head { background: linear-gradient(var(--panel-solid) 55%, transparent); }
  :root:not([data-theme="light"]) .dm-chat #chatBack, :root:not([data-theme="light"]) .dm-chat .chat-who { background: rgba(40, 40, 44, .78); }
  :root:not([data-theme="light"]) .msg-menu { background: rgba(0, 0, 0, .4); }
  :root:not([data-theme="light"]) .msg-acts { background: rgba(44, 44, 46, .92); }
  :root:not([data-theme="light"]) .msg-acts button:not(.danger) { color: #fff; }
}
/* keyboard up: no room for the home bar under the field */
body.kb-up .dm-chat .chat-form, body.kb-open .dm-chat .chat-form { padding-bottom: 8px; }
/* the camera, left in the empty field (Instagram's place for it), gone while you type */
.chat-cam { flex: none; width: 38px; height: 38px; margin-left: -12px; border: 0; border-radius: 50%; background: #00898f; color: #fff; display: grid; place-items: center; padding: 0; }
.chat-cam svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.chat-cam:active { opacity: .7; }
.dm-field:has(.chat-send:not(:disabled)) .chat-cam { display: none; }
.dm-field:has(.chat-cam) textarea { padding-left: 6px; }
.dm-field:has(.chat-send:not(:disabled)) textarea { padding-left: 0; }

/* a photo before it's sent (Snapchat's): full screen on black, a line of text across it */
.snap { position: fixed; inset: 0; z-index: 70; background: #000; opacity: 0; transition: opacity .2s; }
.snap.open { opacity: 1; }
.snap-stage { position: absolute; inset: calc(var(--safe-t) + 4px) 0 calc(var(--safe-b) + 84px); display: grid; place-items: center; }
.snap-frame { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.snap-frame img { max-width: 100%; max-height: 100%; border-radius: 18px; display: block; }
.snap-cap { position: absolute; transform: translateY(-50%); border: 0; border-radius: 0; background: rgba(0, 0, 0, .55); color: #fff; text-align: center;
  font-family: -apple-system, system-ui, sans-serif; font-weight: 500; outline: none; padding: 0 12px; }
.snap-cap[hidden] { display: none; }
.snap-x, .snap-t { position: absolute; top: calc(var(--safe-t) + 14px); width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .35); color: #fff; display: grid; place-items: center; padding: 0; font: 700 18px -apple-system, system-ui, sans-serif; }
.snap-x { left: 14px; } .snap-t { right: 14px; }
.snap-x svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.snap-send { position: absolute; right: 14px; bottom: calc(var(--safe-b) + 18px); height: 50px; max-width: calc(100% - 28px); padding: 0 18px 0 22px; border: 0; border-radius: 25px; background: #00898f; color: #fff;
  display: flex; align-items: center; gap: 10px; font: 600 16px -apple-system, system-ui, sans-serif; }
.snap-send span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snap-send svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.snap-send:active { opacity: .75; }
/* the inbox's swipe, as iOS draws it: the row stays solid (its pressed shade too), Mute and Delete
   grow out from the right edge as the row moves, each half of the opening */
.conv-wrap { --sw: 0px; }
.dm-list .conv-wrap .conv:active { background: #f2f2f4; }
.conv-wrap.swiping .conv, .conv-wrap.swiping .conv:active { transition: none; background: var(--panel-solid, #fff); }
.conv-wrap .conv-mute, .conv-wrap .conv-del { width: calc(var(--sw) / 2 + 1px); overflow: hidden; white-space: nowrap; padding: 0; text-overflow: clip;
  transition: width .25s cubic-bezier(.32, .72, 0, 1), right .25s cubic-bezier(.32, .72, 0, 1); }
.conv-wrap .conv-mute { right: calc(var(--sw) / 2); }
.conv-wrap.swiping .conv-mute, .conv-wrap.swiping .conv-del { transition: none; }
.conv-wrap .conv-del { background: #ff3b30; }
.conv-wrap .conv-mute { background: #8e8e93; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dm-list .conv-wrap .conv:active { background: #1c1c1e; }
}
.conv-wrap .conv-mute, .conv-wrap .conv-del { display: grid; place-items: center; }
/* Mute and Delete, rounder (iOS 26): a coloured circle with a white icon, its word under it, on the
   inbox's own background; they grow and fade in with the swipe */
.conv-wrap .conv-mute, .conv-wrap .conv-del { background: none !important; color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; font-weight: 600; }
.conv-wrap .conv-mute i, .conv-wrap .conv-del i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; flex: none;
  transform: scale(clamp(.35, calc(var(--sw) / 176px), 1)); opacity: clamp(0, calc(var(--sw) / 120px), 1);
  transition: transform .25s cubic-bezier(.32, .72, 0, 1), opacity .2s; box-shadow: 0 4px 12px rgba(0, 0, 0, .12); }
.conv-wrap .conv-mute i { background: linear-gradient(#a1a1a8, #7d7d85); }
.conv-wrap .conv-del i { background: linear-gradient(#ff5a50, #ee2d23); }
.conv-wrap .conv-mute svg, .conv-wrap .conv-del svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.conv-wrap .conv-mute span, .conv-wrap .conv-del span { opacity: clamp(0, calc((var(--sw) - 100px) / 60px), 1); transition: opacity .2s; }
.conv-wrap .conv-mute:active i, .conv-wrap .conv-del:active i { transform: scale(.9); }
.conv-wrap .conv-del { color: #ee2d23; }
.conv-wrap.swiping .conv-mute i, .conv-wrap.swiping .conv-del i, .conv-wrap.swiping .conv-mute span, .conv-wrap.swiping .conv-del span { transition: none; }
/* An app, not a page: holding a finger on text never starts iOS's text selection (it did on the
   inbox's long-press preview: a second buzz and Copy · Look Up · Translate). Fields keep it. */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable="true"], [contenteditable=""] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* ---- The camera (Snapchat's layout): the picture in a rounded card on black, a strip of black under it ---- */
.snap-card, .snap .snap-stage { position: absolute; left: 0; right: 0; top: calc(var(--safe-t) + 6px); bottom: calc(var(--safe-b) + 66px); border-radius: 22px; overflow: hidden; background: #111; }
.snap-card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.snap-card.mirror video { transform: scaleX(-1); }
.snap-head { position: absolute; top: 16px; left: 70px; right: 70px; text-align: center; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .45); pointer-events: none; }
.snap-head b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.snap-head span { display: block; font-size: 17px; font-weight: 600; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snap-close, .snap-tools button { width: 44px; height: 44px; border: 0; background: none; color: #fff; padding: 0; display: grid; place-items: center; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .45)); }
.snap-close { position: absolute; top: 14px; left: 10px; }
.snap-close svg, .snap-tools svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.snap-tools { position: absolute; top: 14px; right: 10px; display: flex; flex-direction: column; gap: 14px; }
.snap-tools button.on { color: #ffd60a; }
.snap-tools button.on svg { fill: currentColor; }
.snap-tools button:active, .snap-close:active { transform: scale(.88); }
.snap-shutter { position: absolute; left: 50%; bottom: 22px; width: 84px; height: 84px; margin-left: -42px; border-radius: 50%; border: 6px solid #fff; background: rgba(255, 255, 255, .08); padding: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .25); transition: transform .12s; }
.snap-shutter:active { transform: scale(.9); background: rgba(255, 255, 255, .3); }
.snap-white { position: absolute; inset: 0; background: #fff8e8; opacity: 0; pointer-events: none; transition: opacity .12s; }
.snap-white.on { opacity: 1; }

/* the photo after: the same card, ✕ top left, Aa on the right, the send button on the black under it */
.snap .snap-stage { display: grid; place-items: center; }
.snap .snap-frame img { border-radius: 0; }
.snap .snap-x { top: calc(var(--safe-t) + 20px); left: 10px; background: none; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .45)); }
.snap .snap-x svg { width: 28px; height: 28px; }
.snap .snap-t { top: calc(var(--safe-t) + 20px); right: 10px; background: none; font-size: 24px; font-weight: 800; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .45)); }
.snap .snap-send { bottom: calc(var(--safe-b) + 10px); right: 12px; height: 46px; background: #00898f; }

/* ---- The chat with the keyboard, as Instagram: the page glides up and down with it (--kbh, set as the
   keyboard starts to move, on its curve), the field floats over the messages, which run under it ---- */
/* the page stays full height (white behind the see-through keyboard, as in iMessage); its content and
   the field rise by the keyboard's height */
body.kb-up .modal.dm-page:not([hidden]) { top: 0; bottom: 0; height: auto !important; padding-bottom: var(--kbh, 0px); }
.modal.dm-page:not([hidden]) { transition: padding-bottom .34s cubic-bezier(.2, .85, .25, 1); }
body.kb-up #chatSheet .chat-dock { bottom: var(--kbh, 0px); }
#chatSheet .chat-dock { transition: bottom .34s cubic-bezier(.2, .85, .25, 1); }
#chatSheet .chat-dock { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0), var(--panel-solid, #fff) 60%); }
#chatSheet .chat-dock > * { pointer-events: auto; }
#chatSheet .chat-reply { border-top: 0; background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  margin: 0 12px 6px; border-radius: 18px; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
#chatSheet .chat-form { background: none; padding-top: 8px; }
#chatSheet .dm-field { background: rgba(240, 240, 243, .82); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06), inset 0 0 0 .5px rgba(0, 0, 0, .06); }
#chatSheet .chat-list { scroll-padding-bottom: 80px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #chatSheet .chat-dock { background: linear-gradient(transparent, var(--panel-solid) 60%); }
  :root:not([data-theme="light"]) #chatSheet .dm-field, :root:not([data-theme="light"]) #chatSheet .chat-reply { background: rgba(44, 44, 46, .82); }
}
/* the app's keyboard tracker moves the page every frame: no easing of our own on top, and nothing
   else moves it (the visual-viewport sizing for sheets made it jump back and forth). As in iMessage
   the field stays put until the keyboard's top reaches it (over the home bar), then rides on it. */
body.kb-live .modal.dm-page:not([hidden]) { top: 0 !important; bottom: 0 !important; height: auto !important; transition: none;
  padding-bottom: max(0px, calc(var(--kbl, 0px) - var(--safe-b))); }
body.kb-live #chatSheet .chat-dock { transition: none; bottom: 0; will-change: transform; }   /* moved by transform (app.js slideChat) */
body.kb-live #chatSheet .chat-list { will-change: transform; }
body.kb-live #chatSheet .chat-form, body.kb-live.kb-up #chatSheet .chat-form { padding-bottom: calc(8px + var(--safe-b)); }

/* ---- iMessage's edges and field: no bars — the messages run under the header and the field and
   blur away at the screen's edges; the field a thin white pill with a hairline, the camera a grey
   circle outside it, the photo icon inside at the right, a blue ↑ to send ---- */
.dm-chat .dm-head { background: none; }
.dm-chat .dm-head::before, #chatSheet .chat-dock::before { content: ''; position: absolute; left: 0; right: 0; z-index: -1; pointer-events: none;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.dm-chat .dm-head::before { top: 0; bottom: -18px; background: linear-gradient(rgba(255, 255, 255, .72), rgba(255, 255, 255, 0));
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
#chatSheet .chat-dock { background: none; }
#chatSheet .chat-dock::before { top: -18px; bottom: 0; background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, .72));
  -webkit-mask-image: linear-gradient(transparent, #000 45%); mask-image: linear-gradient(transparent, #000 45%); }
#chatSheet .chat-form { display: flex; align-items: flex-end; gap: 8px; padding-left: 12px; padding-right: 12px; }
#chatSheet .chat-cam { width: 38px; height: 38px; margin: 0 0 1px; flex: none; background: rgba(235, 235, 240, .9); color: var(--text);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .06); }
#chatSheet .chat-cam svg { width: 21px; height: 21px; stroke-width: 1.9; }
#chatSheet .dm-field:has(.chat-send:not(:disabled)) ~ .chat-cam, #chatSheet .chat-form:has(.chat-send:not(:disabled)) .chat-cam { display: grid; }
#chatSheet .dm-field { flex: 1; min-height: 40px; border-radius: 20px; padding: 0 4px 0 14px; background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .13); align-items: flex-end; }
#chatSheet .dm-field textarea { padding: 10px 0 10px; font-size: 17px; line-height: 20px; }
#chatSheet .dm-field textarea::placeholder { color: #a6a6ab; }
#chatSheet .chat-photo { width: 34px; height: 40px; color: #9a9aa0; }
#chatSheet .chat-photo svg { width: 22px; height: 22px; }
#chatSheet .chat-send { width: 30px; height: 30px; margin: 0 1px 5px 4px; border-radius: 50%; background: #00898f; }
#chatSheet .chat-send svg { width: 18px; height: 18px; stroke-width: 2.6; transform: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dm-chat .dm-head::before { background: linear-gradient(rgba(0, 0, 0, .6), transparent); }
  :root:not([data-theme="light"]) #chatSheet .chat-dock::before { background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
  :root:not([data-theme="light"]) #chatSheet .dm-field { background: rgba(28, 28, 30, .92); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
  :root:not([data-theme="light"]) #chatSheet .chat-cam { background: rgba(58, 58, 60, .9); }
}

/* Past avalanches (avalanche overlay): dot key, the faces rose for the view, a tapped record, the tour chip */
.legend .past-head { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.legend i.dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid; box-sizing: border-box; margin: 0 2px; }
.legend .past-faces { display: flex; align-items: center; gap: 10px; margin: 4px 0 2px; font-size: 11px; line-height: 1.35; }
.legend .past-faces b { font-size: inherit; color: var(--text); text-transform: none; letter-spacing: 0; }
.past-rose { flex: none; width: 56px; height: 56px; }
.past-rose .ring { fill: none; stroke: var(--line); stroke-width: 1; }
.past-rose .axes { stroke: var(--line); stroke-width: .8; }
.past-rose path:not(.axes) { fill: #8b3fd9; fill-opacity: .85; stroke: #fff; stroke-width: .8; }
.inspect.past-aval i.lvl { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.inspect.past-aval small { display: block; grid-column: 1 / -1; margin-top: 4px; color: var(--muted); }
.tour-chip.past-chip { border: 0; font: inherit; background: #efe6fb; color: #5a1fa3; cursor: pointer; }
.legend .past-key { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11px; }
.legend .past-key span { display: flex; align-items: center; gap: 3px; }
/* the chat page itself never shrinks for the keyboard: its list runs to the screen's bottom (room at
   its end comes from fitChatList in app.js), only the field rides on the keyboard */
body.kb-up #chatSheet.modal.dm-page:not([hidden]), body.kb-live #chatSheet.modal.dm-page:not([hidden]) { padding-bottom: 0; }
/* the field on the left, the camera on the right, larger (photos and text on them go through it) */
#chatSheet .chat-form .chat-cam { width: 44px; height: 44px; margin: 0 0 -2px; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--text); }
#chatSheet .chat-form .chat-cam svg { width: 30px; height: 30px; stroke-width: 1.8; }
#chatSheet .chat-form .chat-cam:active { opacity: .55; }
#chatSheet .dm-field { padding-right: 5px; }
#chatSheet .dm-field textarea { padding-right: 6px; }
.snap-gallery { position: absolute; bottom: 38px; left: calc(50% - 120px); width: 52px; height: 52px; border: 0; border-radius: 14px; padding: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; }
.snap-gallery svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.snap-gallery:active { transform: scale(.9); }
.snap-card video { opacity: 0; transition: opacity .18s; }
.snap-card video.ready { opacity: 1; }
.snap-card video { transition: opacity .15s; }
.snap-card .snap-gallery { bottom: 38px; }
/* the camera's picture: our canvas (the video is a hidden pixel feeding it) */
.snap-card video { position: absolute; inset: auto; left: 0; top: 0; width: 2px !important; height: 2px !important; opacity: .01 !important; pointer-events: none; }   /* (not quite invisible: iOS pauses videos it thinks are hidden) */
.snap-card.mirror video { transform: none; }
.snap-view { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .15s; }
.snap-view.ready { opacity: 1; }
.photo-view { touch-action: none; }

/* view once photos (Instagram's): a "Photo" bubble with a ring until it's opened, then "Opened" */
.dm-chat .msg.msg-once { display: flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px; border: 0; font: inherit; font-size: 15.5px; font-weight: 600; text-align: left; cursor: pointer; }
.dm-chat .msg.msg-once svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dm-chat .msg.msg-once small { font-size: 12.5px; font-weight: 500; opacity: .65; margin-left: 2px; }
.dm-chat .msg.msg-once:not(.mine):not(.opened) { color: #00898f; }
.dm-chat .msg.msg-once.opened { background: none !important; color: var(--muted) !important; box-shadow: inset 0 0 0 1px var(--line); cursor: default; font-weight: 500; }
.snap-once { position: absolute; left: 12px; bottom: calc(var(--safe-b) + 14px); height: 40px; padding: 0 14px 0 10px; border: 0; border-radius: 20px; display: flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; font: 600 14px -apple-system, system-ui, sans-serif; }
.snap-once svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.snap-once.on { background: #fff; color: #000; }
.snap-once:active { transform: scale(.95); }

/* ---- Map popups, like the app's other cards (the Explore card, the dock): light frosted glass, round
   corners, the ✕ a small grey circle inside the corner. The point popup in three tiles. ---- */
.maplibregl-popup { --pop: rgba(255, 255, 255, .9); }
.maplibregl-popup-content { color: var(--text); border-radius: 24px; padding: 16px; border: 0;
  box-shadow: 0 12px 36px rgba(15, 42, 51, .18), inset 0 0 0 .5px rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(24px) saturate(1.7); backdrop-filter: blur(24px) saturate(1.7); }
.maplibregl-popup-close-button { top: 10px; right: 10px; width: 28px; height: 28px; font-size: 0; color: var(--muted); background: rgba(118, 118, 128, .14); border: 0; box-shadow: none; z-index: 2; }
.maplibregl-popup-close-button::after { content: ''; width: 11px; height: 11px;
  background: linear-gradient(45deg, transparent 44%, currentColor 44% 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, currentColor 44% 56%, transparent 56%); }
.maplibregl-popup-close-button:hover { background: rgba(118, 118, 128, .22); }
.maplibregl-popup-content .inspect dt { color: var(--muted); }
.maplibregl-popup-content .chip { background: var(--fill); border-color: transparent; color: var(--text); }
.maplibregl-popup-content a { color: var(--accent, #00898f); }
.maplibregl-popup-content .aval { background: rgba(15, 42, 51, .04); }
.maplibregl-popup-content .aval-head span, .maplibregl-popup-content .aval p.hl { color: var(--muted); }
.maplibregl-popup-content > .inspect { padding-right: 4px; }
.maplibregl-popup-content > .inspect > .title { padding-right: 30px; }

.inspect.pt { display: flex; flex-direction: column; gap: 0; min-width: 236px; }
.inspect.pt > .title { font-size: 17px; font-weight: 750; margin: 0 0 10px; }
.pt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-right: 30px; }
.inspect.pt > .title + .pt-stats, .inspect.pt > div:not(.pt-stats):not(.pt-pos) + .pt-stats { margin-right: 0; }
.pt-stats > div { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px 10px; border-radius: 14px; background: rgba(118, 118, 128, .1); min-width: 0; }
.pt-stats small { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.pt-stats b { display: flex; align-items: center; gap: 5px; font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-slope i { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #34c759; }
.pt-slope.s2 i { background: #ffd60a; } .pt-slope.s3 i { background: #ff9f0a; } .pt-slope.s4 i { background: #ff3b30; } .pt-slope.s5 i { background: #af52de; }
.pt-slope.s2, .pt-slope.s3 { background: rgba(255, 159, 10, .14); } .pt-slope.s4, .pt-slope.s5 { background: rgba(255, 59, 48, .12); }
.pt-arrow { width: 15px; height: 15px; flex: none; fill: currentColor; }
.pt-pos { margin: 10px 2px 0; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pt-add { flex: none; display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; height: 44px; margin-top: 12px; border: 0; border-radius: 22px;
  background: #00898f; color: #fff; font: inherit; font-size: 15.5px; font-weight: 650; cursor: pointer; }
.pt-add svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pt-add:active { opacity: .8; transform: scale(.98); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .maplibregl-popup { --pop: rgba(36, 36, 40, .9); }
  :root:not([data-theme="light"]) .maplibregl-popup-content { box-shadow: 0 12px 36px rgba(0, 0, 0, .4); }
}
/* the point popup's head row (the ✕ in it, at the right) and tiles across the whole card */
.pt-head { display: flex; align-items: center; min-height: 28px; margin: -4px 38px 10px 2px; }
.pt-head span { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #00898f; }
.pt-head b { font-size: 17px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maplibregl-popup-content .pt ~ .maplibregl-popup-close-button, .maplibregl-popup-content:has(.pt) .maplibregl-popup-close-button { top: 12px; right: 12px; }
.pt-stats { margin-right: 0 !important; }
.pt-stats b { font-size: 18px; }
.pt-stats b u { text-decoration: none; font-size: 13px; font-weight: 650; color: var(--muted); margin-left: 1px; }
.pt-slope b u { margin-left: 0; color: inherit; font-size: 18px; font-weight: 750; }
.pt-stats b u { margin-left: -3px; }
.pt-stats .pt-slope b u { margin-left: -5px; }
/* the ✕ drawn in the exact middle (the button's own "×" character, hidden, still took a place in it) */
.maplibregl-popup-close-button::after { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
/* foldable legends: the arrow top right; folded, only the title stays (tap it or the arrow to open) */
.legend.foldable { position: relative; padding-right: 38px; }
.legend-fold { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center;
  background: rgba(118, 118, 128, .12); color: var(--text); cursor: pointer; }
.legend .legend-fold svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.legend.folded .legend-fold svg { transform: rotate(180deg); }
.legend.folded > :not(.legend-fold):not(b:first-of-type) { display: none !important; }
.legend.folded { cursor: pointer; padding-top: 11px; padding-bottom: 11px; }
.legend.folded > b:first-of-type { line-height: 16px; }
/* the download panel drags down to its title (more map to frame the area), up again to download */
.dl-panel .dl-grab { margin: -2px auto 4px; }
.dl-panel.min > :not(.dl-grab):not(.sheet-head) { display: none !important; }
.dl-panel.min { cursor: grab; }
.dl-panel.min .sheet-head h3 { font-size: 16px; }
body.dl-mode .dl-panel.min { gap: 4px; padding-top: 8px; }
.dl-hole { transition: bottom .3s cubic-bezier(.32, .72, 0, 1); }
/* Offline maps: a downloaded area as a row (map icon, name, size · maps · date, ✕) */
.list .off-area { display: flex; align-items: center; gap: 12px; }
.off-area .off-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(0, 137, 143, .12); }
.off-area .off-ic svg { width: 22px; height: 22px; fill: none; stroke: #00898f; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.off-area .grow { min-width: 0; }
.off-area b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#offlineSheet .offline-row { margin-bottom: 12px; }
.peek-facts .grp.none { background: rgba(52, 199, 89, .09); color: #3f9a5c; }   /* still the group tours' green, lighter */

/* ---- The dock: Map · Plan in a pill, Record on its own in the middle (on every tab),
   Community · Messages in a pill. My location sits
   under the compass on the right. ---- */
@media (max-width: 899px) {
  .tabbar { gap: 10px; }
  .tabbar .tab-pill { flex: 1; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; padding: 0 4px; }
  .tabbar > .tab-act { display: none !important; }
  /* Record in the middle on every tab; search lives in Community's and Messages' own bars */
  .tabbar > .tab-search { display: none !important; }
  body .tabbar > .tab-record { display: grid !important; }
  /* My location: under the compass, like the other map buttons */
  .fab-col.fab-bottom, body.sheet-open .fab-col.fab-bottom, body[data-tab="record"] .fab-col.fab-bottom {
    top: calc(var(--safe-t) + 8px + 3 * 46px + 3 * 12px); bottom: auto; }
  /* (four buttons above it while Weather shows) */
  body:has(#weatherBtn:not([hidden])) .fab-col.fab-bottom { top: calc(var(--safe-t) + 8px + 4 * 46px + 4 * 12px); }
  .fab-col.fab-bottom .fab-big { width: 46px; height: 46px; }
  .fab-col.fab-bottom .fab-big svg { width: 22px; height: 22px; }
}
@media (max-width: 899px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tabbar .tab-pill .tab-search { background: #f2f2f7; color: #111 !important; }
}
@media (max-width: 899px) {
  .fab-col.fab-bottom, body.sheet-open .fab-col.fab-bottom, body[data-tab="record"] .fab-col.fab-bottom { right: calc(14px + env(safe-area-inset-right, 0px)); }
}

/* ---- Community's top: a search bar (tours or people) as on the map, the Community · Profile switch right ---- */
.comm-top { display: none; position: absolute; z-index: 7; top: calc(8px + var(--safe-t)); left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right));
  align-items: center; gap: 8px; pointer-events: none; }
body[data-tab="profile"] .comm-top { display: flex; }
body.dl-mode .comm-top { display: none; }
.comm-top > * { pointer-events: auto; }
.comm-top #commSeg { position: static; flex: none; }   /* right beside the search button */
.comm-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border: 0; border-radius: 22px; cursor: pointer;
  background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 2px 12px rgba(15, 42, 51, .14), inset 0 0 0 1px rgba(255, 255, 255, .9); font: inherit; font-size: 16px; color: var(--muted); text-align: left; }
.comm-search svg { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2.3; stroke-linecap: round; }
.comm-search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comm-search:active { opacity: .7; }
body.prof-view .comm-search { visibility: hidden; }
.comm-top #commSeg button { height: 38px; padding: 0 12px; }
/* search results: a tour row */
.srch-tour { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.srch-tour .grow { min-width: 0; }
.srch-tour b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-tour small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Community's search in place: the bar takes the width (the switch steps aside), Cancel beside it,
   results on the page under it */
.comm-search input { flex: 1; min-width: 0; height: 100%; border: 0; padding: 0; background: none; outline: none; font: inherit; font-size: 16px; color: var(--text); -webkit-appearance: none; appearance: none; }
.comm-search input::placeholder { color: var(--muted); }
.comm-search input::-webkit-search-cancel-button { display: none; }
.comm-search .srch-clear[hidden] { display: none; }
.comm-search { cursor: text; }
body.comm-searching .comm-top #commSeg { display: none; }
body.comm-searching .comm-search { visibility: visible; }
.comm-top .search-cancel[hidden] { display: none; }
/* a dropdown under the bar (like the map's search), the page staying where it is behind it */
.comm-results { position: fixed; z-index: 8; left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); top: calc(var(--safe-t) + 60px);
  max-height: calc(100vh - var(--safe-t) - 60px - var(--bottom) - 8px); max-height: calc(100dvh - var(--safe-t) - 60px - var(--bottom) - 8px);
  padding: 4px 14px; border-radius: 18px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow);
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; animation: comm-r-in .18s ease-out; transform-origin: top center; }
.comm-results[hidden] { display: none; }
@keyframes comm-r-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.comm-results .srch-list { margin: 0; padding: 0; overflow: visible; }
.comm-results .comm-r-tour { list-style: none; margin: 0 0 8px; }
.comm-results .comm-r-tour .gt-card { width: 100%; }
body:not([data-tab="profile"]) .comm-results { display: none !important; }
/* the whole bulletin, folded under "Show full bulletin" in the tapped spot's popup */
.aval-more { margin: 8px 0 6px; }
.aval-more > summary { list-style: none; display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; border-radius: 18px; cursor: pointer;
  background: rgba(118, 118, 128, .12); font-size: 13.5px; font-weight: 650; color: var(--text); }
.aval-more > summary::-webkit-details-marker { display: none; }
.aval-more > summary::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.aval-more[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.aval-more .less, .aval-more[open] .more { display: none; }
.aval-more[open] .less { display: inline; }
.aval-report { padding: 4px 2px 0; }
.aval-report h4 { margin: 12px 0 4px; font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.aval-report p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.45; color: var(--text); }
/* the tapped spot's avalanche card when no bulletin is out (off season) */
.aval.aval-off { margin: 0 0 10px; padding: 10px 12px; border-radius: 14px; background: rgba(118, 118, 128, .1); }
.aval-off-row { display: flex; align-items: center; gap: 10px; }
.aval-off-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; }
.aval-off-ic svg { width: 30px; height: 30px; fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linejoin: round; }
.aval-off b { display: block; font-size: 16px; font-weight: 750; }
.aval-off-row span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.aval.aval-off > a { display: inline-block; margin-top: 6px; font-size: 12px; }

/* ---- Community: tiles, groups, events, the chooser, find activities ---- */
.comm-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 4px; }
.comm-tile { display: grid; justify-items: center; gap: 8px; padding: 16px 6px 13px; border: 0; border-radius: 18px; background: var(--card); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; box-shadow: 0 1px 0 var(--line); -webkit-tap-highlight-color: transparent; }
.comm-tile:active { transform: scale(.97); }
.comm-tile svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.section-row { display: flex; align-items: baseline; justify-content: space-between; }
.link-btn { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 650; padding: 4px 0; cursor: pointer; }
.grp-strip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 6px; scroll-snap-type: x mandatory; }
.grp-strip::-webkit-scrollbar { display: none; }
.grp-chip { flex: none; display: grid; justify-items: center; gap: 6px; width: 84px; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--text); position: relative; cursor: pointer; }
.grp-chip span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.grp-thumb { flex: none; width: 64px; height: 64px; border-radius: 16px; background: var(--fill) center / cover no-repeat; display: grid; place-items: center; }
.grp-initial { color: #fff; font-weight: 800; font-size: 26px; text-shadow: 0 1px 6px rgba(0, 0, 0, .25); }
.grp-dot { position: absolute; top: -2px; right: 8px; width: 12px; height: 12px; border-radius: 50%; background: #ff3040; border: 2px solid var(--panel-solid); }
.grp-strip.big { min-height: 230px; }
/* Community's groups near here: smaller cards than the Groups page's */
.grp-strip.mid .grp-card { width: 58%; max-width: 230px; height: 150px; border-radius: 16px; }
.grp-strip.mid .grp-card-name { font-size: 18px; }
.grp-strip.mid .empty { flex: 1; }
.grp-card { flex: none; width: 72%; max-width: 280px; height: 230px; padding: 0; border: 0; border-radius: 20px; overflow: hidden; scroll-snap-align: start; cursor: pointer; background: none; }
.grp-card-img { position: relative; width: 100%; height: 100%; background: var(--fill) center / cover no-repeat; display: flex; flex-direction: column; justify-content: space-between;
  padding: 14px 16px; color: #fff; text-align: left; }
.grp-card-img::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, .05) 40%, rgba(0, 0, 0, .55)); }
.grp-card-img > * { position: relative; }
.grp-card-img .grp-initial { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; opacity: .25; }
.grp-card-top { display: grid; gap: 1px; font-weight: 700; font-size: 14px; }
.grp-card-name { font-size: 22px; line-height: 1.15; font-weight: 800; }
.grp-modes { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 10px; padding: 0 16px; }
.grp-search { margin: 4px 0 6px; }
.grp-list .grp-row { display: flex; align-items: center; gap: 14px; padding: 8px 0; }
.grp-row .grow { display: grid; gap: 2px; min-width: 0; }
.grp-row b { font-size: 16px; }
.grp-fab { position: sticky; float: right; bottom: calc(14px + var(--safe-b)); margin-top: 8px; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--accent); color: #fff;
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0, 150, 156, .4); cursor: pointer; }
.grp-fab svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.grp-hero { position: relative; height: 170px; border-radius: 20px; background: var(--fill) center / cover no-repeat; display: flex; align-items: flex-end; padding: 14px 16px; overflow: hidden; }
.grp-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, .55)); }
.grp-hero .grp-initial { position: absolute; inset: 0; display: grid; place-items: center; font-size: 80px; opacity: .25; }
.grp-hero-name { position: relative; color: #fff; font-size: 24px; font-weight: 800; line-height: 1.15; }
.grp-meta { margin: 10px 0 4px; color: var(--muted); font-size: 14px; }
.grp-acts { display: flex; gap: 8px; margin: 8px 0 12px; }
.grp-acts .chip { flex: 1; }
.grp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -16px 12px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.grp-tabs button { flex: none; border: 0; background: none; font: inherit; font-weight: 650; color: var(--muted); padding: 10px 10px 9px; border-bottom: 2.5px solid transparent; cursor: pointer; }
.grp-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.grp-pane { display: grid; align-content: start; gap: 10px; padding-bottom: 20px; min-height: 45vh; }   /* the sheet keeps its height while a tab loads */
.grp-about { white-space: pre-wrap; line-height: 1.45; margin: 0; }
.grp-more { width: 36px; height: 36px; font-size: 20px; color: var(--muted); }
.grp-chat { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.grp-msg { display: flex; gap: 10px; align-items: flex-start; }
.grp-msg p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.grp-msg .avatar { cursor: pointer; }
.grp-chat-form { position: sticky; bottom: 0; padding: 10px 0 calc(10px + var(--safe-b)); background: var(--panel-solid); }
.gf-cover { width: 100%; height: 140px; border: 1.5px dashed var(--line); border-radius: 18px; background: var(--fill) center / cover no-repeat; color: var(--muted);
  font: inherit; font-weight: 650; display: grid; place-items: center; margin-bottom: 8px; cursor: pointer; }
.gf-cover.has { border-style: solid; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.create-opts { display: grid; gap: 12px; padding-bottom: calc(16px + var(--safe-b)); }
.create-opt { display: flex; gap: 16px; align-items: flex-start; padding: 18px 16px; border: 1.5px solid var(--line); border-radius: 18px; background: var(--card); color: var(--text);
  text-align: left; font: inherit; cursor: pointer; }
.create-opt:active { transform: scale(.985); background: var(--fill); }
.create-opt svg { flex: none; width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.create-opt b { display: block; font-size: 18px; margin-bottom: 4px; }
.create-opt small { display: block; color: var(--muted); font-size: 14px; line-height: 1.35; }
.gt-card.event .gt-cal { box-shadow: inset 0 3px 0 #b8427f, 0 1px 4px rgba(15, 42, 51, .08); }
.gt-tag { display: block; color: #b8427f; font-weight: 700; font-size: 12px; }
.gt-group-link { border: 0; background: var(--fill); color: var(--text); font: inherit; font-size: 13px; font-weight: 650; padding: 6px 12px; border-radius: 999px; margin-top: 8px; cursor: pointer; }
.find-filters { display: grid; gap: 8px; }
.find-filters .chips { display: flex; gap: 8px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.find-filters .chips::-webkit-scrollbar { display: none; }
.find-filters .chip { min-height: 36px; padding: 6px 13px; }
.find-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 10px; }
.find-bar b { font-size: 14px; }
.act-pill { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 64px); z-index: 7; display: flex; gap: 10px; align-items: center;
  padding: 9px 16px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; font: inherit; font-weight: 650; box-shadow: var(--shadow); cursor: pointer; }
.act-pill b { opacity: .7; }
body:not([data-tab="map"]) .act-pill { display: none; }
:is(.grp-modes, #gtSport, #gfSport, #gfClosed, .find-filters .chips) .chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
#fLevel .chip[aria-pressed="true"] { background: var(--lv, var(--navy)); border-color: var(--lv, var(--navy)); }
#gtSport, #gfSport, #gfClosed { display: flex; flex-wrap: wrap; gap: 8px; }
#gtGroup { -webkit-appearance: none; appearance: none; width: 100%; min-height: 46px; padding-right: 40px; font: inherit; color: var(--text);
  background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f5f75' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 14px center / 18px no-repeat; }
.modal :is(.grp-strip, .grp-modes, .find-filters .chips) { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; scroll-padding-left: 18px; }
/* (popups are light now) the bulletin's region line in grey */
.inspect .aval-region { color: var(--muted); }
/* The activity form's fields line up: the same height, and the time box stays in its half (iOS gives
   a time input its own minimum width and centres its text) */
.gt-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
#gtFormSheet :is(input.input, select.input) { height: 48px; box-sizing: border-box; margin: 0; }
#gtTime { -webkit-appearance: none; appearance: none; min-width: 0; width: 100%; display: block; text-align: left; font: inherit; color: var(--text); }
#gtTime::-webkit-date-and-time-value { text-align: left; margin: 0; }
#gtFormSheet .gt-step { height: 48px; box-sizing: border-box; }
/* (personal builds) the avalanche legend's "try last winter's bulletin" button */
.legend .legend-test { display: block; width: 100%; margin: 8px 0 2px; padding: 7px 10px; border: 0; border-radius: 10px; background: rgba(0, 137, 143, .12);
  color: #007a80; font: inherit; font-size: 12px; font-weight: 650; text-align: left; cursor: pointer; }
.legend .legend-test:active { opacity: .7; }
.gt-types { display: flex; flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
.gt-types::-webkit-scrollbar { display: none; }
/* Your groups on your profile (only you see them) and groups in common on someone else's */
.prof-groups { margin: 6px 0 4px; }
.prof-groups-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.only-you { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.only-you svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.prof-groups .grp-thumb { width: 54px; height: 54px; border-radius: 14px; }
.grp-faces { display: flex; align-items: center; margin-top: 5px; }
.grp-faces .avatar { width: 24px; height: 24px; font-size: 10px; margin-right: -6px; box-shadow: 0 0 0 2px var(--panel-solid, #fff); }
.grp-more-n { margin-left: 12px; font-size: 12px; font-weight: 700; color: var(--muted); }
.common-groups { display: grid; gap: 8px; margin: 14px 0 4px; }
.common-groups > b { font-size: 13px; color: var(--muted); }
.grp-pill { flex: none; display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--fill);
  font: inherit; font-weight: 650; font-size: 14px; color: var(--text); cursor: pointer; }
.grp-pill .grp-thumb { width: 30px; height: 30px; border-radius: 50%; }
.grp-pill .grp-initial { font-size: 14px; }

/* Who can see a tour: rounded pill segments with icons; "Only me" is Pro */
.vis-seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--fill); }
.vis-seg button { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 40px; padding: 8px 6px;
  border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background .2s, color .2s, box-shadow .2s, transform .12s; }
.vis-seg button:active { transform: scale(.96); }
.vis-seg svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.vis-seg button.active { background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(15, 42, 51, 0.14); }
.vis-seg .pro-tag { position: absolute; top: -7px; right: 4px; padding: 1px 6px; border-radius: 999px; font: 800 9px/14px system-ui; letter-spacing: .04em; font-style: normal;
  color: #fff; background: linear-gradient(135deg, #ff9f0a, #ff375f); box-shadow: 0 1px 4px rgba(255, 55, 95, .35); }
.vis-seg.pro .pro-tag, .vis-seg.local .pro-tag { display: none; }
.vis-seg:not(.pro):not(.local) button[data-v="private"] { color: color-mix(in srgb, var(--muted) 70%, transparent); }

/* Community search collapsed to a round button (like the map's), the bar only while searching */
.comm-search-btn { display: grid; flex: none; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; color: var(--text);
  background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6);
  box-shadow: 0 2px 10px rgba(15, 42, 51, .12), inset 0 0 0 1px rgba(255, 255, 255, .9); -webkit-tap-highlight-color: transparent; }
.comm-search-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.comm-search-btn:active { transform: scale(.92); }
body:not(.comm-searching) .comm-search { display: none; }
body.comm-searching .comm-search-btn { display: none; }
.comm-search { animation: comm-open .24s cubic-bezier(.32, .72, 0, 1); }
@keyframes comm-open { from { clip-path: inset(0 calc(100% - 44px) 0 0 round 22px); } to { clip-path: inset(0 0 0 0 round 22px); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .comm-search-btn { background: rgba(38, 38, 44, .72); } }

/* recording panel: a grabber to drag it down to its top row while recording */
.rec-grab { margin-bottom: 6px; }
.rec-grab::after { content: ""; position: absolute; inset: -14px -60px; }
#recPanel { touch-action: none; }
#recPanel.rec-min .rec-time { cursor: pointer; }
/* Groups on profiles: always a section; in none yet, what groups are and how to find one */
.grp-list .grp-empty { display: grid; grid-template-columns: 54px 1fr; gap: 6px 14px; align-items: center; padding: 8px 0; }
.grp-empty .grp-thumb { grid-row: span 2; }
.grp-empty p { margin: 0; font-size: 14px; }
.grp-empty .row-btns { display: flex; gap: 8px; }
.common-groups > b small { font-weight: 600; }
.common-groups .grp-none { margin: 0; font-size: 14px; }
.grp-pill.common { border-color: var(--accent, #2c6fb7); }

/* Chutemap Pro: the PRO tag on Pro features, and the paywall sheet */
.pro-tag { display: inline-block; vertical-align: 2px; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font: 800 9px/14px system-ui; letter-spacing: .04em; font-style: normal;
  color: #fff; background: linear-gradient(135deg, #ff9f0a, #ff375f); box-shadow: 0 1px 4px rgba(255, 55, 95, .35); }
.is-pro .pro-tag { display: none; }
.set-row .pro-tag { margin: 0 6px 0 auto; }
.pro-sheet .pro-hero { text-align: center; padding: 6px 8px 14px; }
.pro-badge { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 22px; display: grid; place-items: center;
  background: linear-gradient(135deg, #ff9f0a, #ff375f); box-shadow: 0 10px 26px rgba(255, 55, 95, .32); }
.pro-badge svg { width: 40px; height: 40px; fill: #fff; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }
.pro-hero h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; }
.pro-hero p { margin: 0 auto; max-width: 300px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.pro-perks { list-style: none; margin: 0; padding: 4px 14px; border-radius: var(--radius); background: var(--card); box-shadow: 0 1px 0 var(--line); }
.pro-perks li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pro-perks li:last-child { border-bottom: 0; }
.pro-perks li > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.pro-perks b { font-size: 15px; }
.pro-perks small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.pro-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, #ff375f 12%, transparent); }
.pro-ic svg { width: 20px; height: 20px; fill: none; stroke: #ff375f; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pro-check { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pro-perks li.lead .pro-ic { background: linear-gradient(135deg, #ff9f0a, #ff375f); }
.pro-perks li.lead .pro-ic svg { stroke: #fff; }
.pro-free { margin: 10px 4px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.pro-buy { display: grid; gap: 10px; padding-bottom: 8px; }
.pro-plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
  border: 2px solid #ff375f; background: color-mix(in srgb, #ff375f 6%, var(--card)); }
.pro-plan > span { display: grid; gap: 2px; }
.pro-plan small { color: var(--muted); font-size: 13px; }
.pro-price { text-align: right; }
.pro-price b { font-size: 22px; letter-spacing: -.01em; }
.chip.pro-cta { min-height: 54px; font-size: 17px; font-weight: 700; border: 0; color: #fff; background: linear-gradient(135deg, #ff9f0a, #ff375f); box-shadow: 0 8px 20px rgba(255, 55, 95, .3); }
.pro-restore { justify-self: center; padding: 6px 12px; }
.pro-fine { margin: 0 6px; text-align: center; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.pro-have { display: grid; gap: 4px; margin-top: 16px; padding: 16px; border-radius: var(--radius); text-align: center; background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.pro-have small { color: var(--muted); }
.pro-legal { margin: 14px 0 4px; text-align: center; font-size: 12.5px; color: var(--muted); }
.pro-legal a { color: inherit; }
.pro-cta:disabled { opacity: .55; }
.pro-plan > .pro-price { display: block; white-space: nowrap; } .pro-price small { margin-left: 3px; }
/* phones: Share on your profile is the round QR code alone (search + the switch take the left) */
@media (max-width: 899px) {
  #profileHero .sc-bar .sc-pill.share { width: 40px; padding: 0; justify-content: center; }
  #profileHero .sc-bar .sc-pill.share > span:last-child { display: none; }
}

/* Skill levels: a card on every profile (ski touring, freeride, piste: five steps each) */
.skills-card { margin: 10px 0; padding: 12px 14px 6px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(15, 42, 51, .06); }
.skills-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.skills-head b { font-size: 15px; font-weight: 750; }
.skills-edit { border: 0; background: none; padding: 4px 0 4px 12px; font: inherit; font-size: 14px; font-weight: 650; color: var(--accent); }
.skills-empty { display: block; width: 100%; margin: 4px 0 8px; padding: 12px; border: 1.5px dashed var(--line); border-radius: 12px; background: none; font: inherit; font-size: 14px; color: var(--muted); text-align: left; }
.skill-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.skill-row + .skill-row { box-shadow: inset 0 1px 0 var(--line); }
.skill-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(0, 150, 156, .12); color: var(--accent); }
.skill-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.skill-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.skill-txt span { font-weight: 650; font-size: 14.5px; }
.skill-txt small { color: var(--muted); font-size: 13px; }
.skill-row:not(.unset) .skill-txt small { color: var(--accent); font-weight: 650; }
.skill-steps { flex: none; display: flex; gap: 4px; }
.skill-steps i { width: 16px; height: 7px; border-radius: 4px; background: var(--fill-strong); }
.skill-steps i.on { background: var(--accent); }
.skill-row.unset .skill-ic { background: var(--fill); color: var(--muted); }
/* the editor */
.skills-edit-body { display: grid; gap: 18px; padding: 4px 2px 8px; }
.skill-sec-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.skill-sec-top b { font-size: 16px; }
.skill-pick { display: grid; grid-template-columns: 1fr 1.25fr 1fr 1fr .8fr; gap: 3px; padding: 3px; border-radius: 14px; background: var(--fill); }
.skill-pick button { min-width: 0; height: 38px; padding: 0 2px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 11.5px; font-weight: 650; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: clip; letter-spacing: -.02em; transition: background .15s, color .15s; }
.skill-pick button.on { background: rgba(0, 150, 156, .16); color: var(--accent); }
.skill-pick button.cur { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0, 150, 156, .35); }
.skill-info { margin: 8px 2px 0; min-height: 36px; font-size: 13.5px; color: var(--muted); }
/* An activity's skill level needed: the same picker, per discipline of its type */
.gt-skills { display: grid; gap: 12px; }
.gt-skill-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 650; }
.gt-skill-top .skill-ic { width: 26px; height: 26px; }
.gt-skill-top small { margin-left: auto; font-weight: 600; color: var(--muted); }
.gt-skill-top small.set { color: var(--accent); }
.gt-skill-need { display: inline-flex; align-items: center; gap: 5px; }
.gt-skill-need svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gt-skill-warn { margin: 8px 0 0; font-size: 13px; color: #b25e00; }
.dm-sheet-card .skills-save { margin-top: 4px; text-align: center; background: var(--accent) !important; color: #fff !important; font-weight: 700; border-radius: 14px; }
/* the same, small, beside the avatar: glass chips with an icon and five mini steps */
.skill-mini { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.skill-mini[hidden] { display: none; }
.skill-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px 0 6px; border: 0; border-radius: 999px; color: #fff;
  background: rgba(255, 255, 255, .2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.skill-chip svg { width: 15px; height: 15px; fill: none; stroke: #8fe0e2; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skill-chip-steps { display: flex; gap: 2px; }
.skill-chip-steps i { width: 5px; height: 9px; border-radius: 2px; background: rgba(255, 255, 255, .3); }
.skill-chip-steps i.on { background: var(--accent); }   /* the green of the skill card's steps */
.skill-chip:active { transform: scale(.95); }

/* Profile top, "photo + skier": the round picture (photo, or the skier's face) on the left with the
   name; the cartoon skier stands on the right — one face each, never the same one twice */
#profileScreen .sc-skier, .sc-hero.user-hero .sc-skier { left: auto; right: -18px; transform: none; height: 262px; }
#profileScreen .sc-skier { top: calc(36px + var(--safe-t)); right: 32px; height: 250px; }   /* left of the bell, its feet clear of the buttons */
.sc-hero.user-hero .sc-skier { top: 0; height: 236px; }
/* the picture: a tall capsule (like a ski), so a photo shows you with your skis; name beside it */
#profileScreen .sc-id, .sc-hero.user-hero .sc-id { max-width: 62%; align-items: flex-end; gap: 12px; }
#profileScreen .sc-id { margin-top: 22px; }
#profileScreen .sc-ava, .sc-hero.user-hero .sc-ava { border-radius: 48px; }
#profileScreen .sc-ava .avatar.big, .sc-hero.user-hero .sc-ava .avatar.big { width: 92px; height: 152px; border-radius: 46px; border: 3px solid #fff; }
#profileScreen .sc-ava .avatar.big.skier, .sc-hero.user-hero .sc-ava .avatar.big.skier { background: rgba(255, 255, 255, .2); }
#profileScreen .sc-names, .sc-hero.user-hero .sc-names { padding-bottom: 4px; }
#profileScreen .sc-make { left: 50%; top: 40%; }
#profileScreen .avatar.add-photo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff;
  background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-style: dashed !important; border-color: rgba(255, 255, 255, .7) !important; box-shadow: none; }
#profileScreen .avatar.add-photo svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
#profileScreen .avatar.add-photo span { font-size: 12.5px; font-weight: 700; }
#avatarRing.no-photo .sc-pen { display: none; }
.sc-ava[hidden] { display: none; }

/* Snow report (snowreport.js): the popup row, the sheet, the chips and the map keys */
.snow-row { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 8px; padding: 8px 10px 8px 8px; border: 0; border-radius: 14px; background: rgba(0, 150, 156, .08); color: var(--text); font: inherit; text-align: left; }
.snow-row:active { background: rgba(0, 150, 156, .16); }
.snow-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.snow-row b { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; }
.snow-row b i { margin-right: 6px; vertical-align: 0; }
.snow-row b i, .snow-chip i, .snow-key i { flex: none; width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.snow-row span { font-size: 12px; color: var(--muted); }
.snow-row em { display: flex; align-items: center; font-style: normal; font-size: 12px; font-weight: 650; color: var(--accent); white-space: nowrap; }
.snow-row em svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.snow-rose { display: block; }
.snow-rose.mini { width: 46px; height: 46px; flex: none; }
.snow-rose text { font-size: 8.5px; font-weight: 700; fill: var(--muted); }
.snow-rose.mini text.n { font-size: 7px; fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, .55); stroke-width: 1.5px; }
.snow-rep { padding: 0 16px calc(18px + env(safe-area-inset-bottom)); }
.sr-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 12px; }
.sr-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sr-kpis > div { padding: 9px 10px; border-radius: 14px; background: var(--fill, rgba(118, 118, 128, .1)); min-width: 0; }
.sr-kpis small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.sr-kpis b { font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-kpis u { text-decoration: none; font-size: 12px; color: var(--muted); font-weight: 600; }
.sr-rose { display: flex; align-items: center; gap: 12px; margin: 12px 0 6px; }
.sr-rose .snow-rose { width: 200px; height: 200px; flex: none; }
.sr-rings { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.sr-rings b { color: var(--text); font-weight: 650; }
.sr-wind { margin-top: 4px; color: var(--text); }
.snow-key { display: flex; flex-wrap: wrap; gap: 5px 12px; font-size: 12px; color: var(--text); margin: 4px 0; }
.snow-key span { display: inline-flex; align-items: center; gap: 5px; }
.legend .snow-key, #snowLegend .snow-key { max-width: 210px; gap: 4px 10px; font-size: 11.5px; }
.sr-best { margin: 12px 0; padding: 11px 13px; border-radius: 14px; background: rgba(0, 150, 156, .1); color: var(--text); font-size: 14px; line-height: 1.4; }
.sr-best b { color: var(--accent); }
.sr-card { margin: 10px 0; padding: 12px; border-radius: 16px; border: 1px solid var(--line); }
.sr-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.sr-row small { color: var(--muted); font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
.sr-row small i.fc { width: 9px; height: 9px; border-radius: 2px; background: #9cc9ff; display: inline-block; }
.sr-days { display: block; width: 100%; height: auto; margin-top: 6px; }
.sr-days rect.past { fill: #3d9bff; } .sr-days rect.fc { fill: #9cc9ff; }
.sr-days .v { font-size: 9.5px; font-weight: 700; fill: var(--text); }
.sr-days .d { font-size: 10px; fill: var(--muted); } .sr-days .d.t { fill: var(--accent); font-weight: 750; }
.sr-days .fl { fill: none; stroke: #e2725b; stroke-width: 1.8; stroke-dasharray: 4 3; }
.sr-fl { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.sr-st { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.sr-st b { font-size: 16px; color: var(--text); }
.sr-st span { color: var(--muted); }
.sr-st a { color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none; }
.sr-spark { width: 90px; height: 30px; flex: none; }
.sr-spark polyline { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sr-alert { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 46px; margin: 4px 0 10px; border: 0; border-radius: 23px; background: var(--fill, rgba(118, 118, 128, .12)); color: var(--text); font: inherit; font-size: 14.5px; font-weight: 650; }
.sr-alert svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.sr-alert.on { background: var(--accent); color: #fff; }
.sr-alert.on svg { fill: currentColor; }
.sr-note { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; }
.snow-chip { display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; padding: 3px 8px; border-radius: 10px; background: rgba(61, 155, 255, .12); color: var(--text); font-size: 11.5px; font-weight: 650; width: fit-content; }
button.tour-chip.snow-chip { margin-top: 0; border: 0; font: inherit; font-size: 12px; font-weight: 650; }
.zero-key { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; }
.zero-key i { width: 20px; height: 3px; background: repeating-linear-gradient(90deg, rgb(236, 38, 200) 0 6px, transparent 6px 9px); }
#snowLegend .zero-key:not(:first-child) { margin-top: 6px; }
.snow-rose path, .snow-rose text, .sr-days rect, .sr-days text { stroke-linecap: butt; }
.snow-rose text, .sr-days text { stroke: none; }
.sr-days rect { stroke: none; }
#snowLegend .snow-key { display: grid; grid-template-columns: auto auto; gap: 3px 10px; }
body.comm-searching #profileHero .sc-bar { visibility: hidden; }   /* the profile's ⋯ / share buttons, under the open search bar */
/* the skill editor: the same side margins as the rest of the app's sheets */
.skills-edit-body { padding: 4px 20px 0; }
.dm-sheet-card .skills-save { width: calc(100% - 40px) !important; margin: 8px 20px calc(14px + var(--safe-b, env(safe-area-inset-bottom))); }

/* Someone's profile: a full page pushed in from the right (Instagram), ‹ to go back; no grabber or pull-down */
#userSheet.modal:not([hidden]) { top: 0; bottom: 0; height: auto; max-height: none; border-radius: 0; box-shadow: none; z-index: 12;
  padding-bottom: calc(22px + var(--safe-b)); animation: sheet-push .32s cubic-bezier(.32, .72, 0, 1) backwards; }
#userSheet.modal.pop:not([hidden]) { animation: sheet-pop .3s cubic-bezier(.32, .72, 0, 1) backwards; }
#userSheet.modal.closing { transform: translate3d(100%, 0, 0) !important; }
#userSheet .modal-head { height: calc(52px + var(--safe-t)); padding-top: var(--safe-t); margin-bottom: calc(-52px - var(--safe-t)); }
#userSheet .modal-head .grabber { display: none; }
#userSheet .sc-hero.user-hero { border-radius: 0; padding-top: calc(52px + var(--safe-t)); min-height: calc(250px + var(--safe-t));
  box-shadow: 0 -600px 0 600px var(--hero1, #00969c); }   /* it bounces like your own profile: its colour fills above it, not white */
#userSheet .sc-hero.user-hero .sc-skier { top: calc(20px + var(--safe-t)); }
#userSheet .sc-hero.user-hero.no-skier { min-height: calc(170px + var(--safe-t)); }
.legend.snow-type-key { max-width: 300px; }   /* left, under the avalanche key (not centred like the bars) */

/* ---- Weather (the Weather chip's page) ---- */
.wx-fab .wx-ic { width: 30px; height: 30px; }
.wx-sheet .modal-head h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Mountain · Valley · Stations: the app's pill toggle, the white pill sliding to the chosen one */
.wx-tabs { position: relative; display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 0; margin: 2px 0 14px; padding: 3px; border-radius: 999px; background: var(--fill); }
.wx-tabs::before { content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 3)); border-radius: 999px;
  background: var(--panel-solid, #fff); box-shadow: 0 1px 3px rgba(15, 42, 51, .14), 0 0 0 .5px rgba(15, 42, 51, .06);
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .32s cubic-bezier(.3, 1.25, .5, 1); }
.wx-tabs button { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 46px; padding: 4px 6px;
  border: 0; border-radius: 999px; background: none; font: inherit; color: var(--muted); cursor: pointer; transition: color .2s; -webkit-tap-highlight-color: transparent; }
.wx-tabs button:active { transform: scale(.97); }
.wx-tabs button svg { width: 20px; height: 20px; flex: none; stroke-width: 1.8; transition: color .2s; }
.wx-tabs button span { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; font-size: 15px; font-weight: 650; line-height: 1.15; }
.wx-tabs button small { font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.wx-tabs button.on { color: var(--text); }
.wx-tabs button.on svg { color: var(--accent); }
/* the sheet keeps its size, white, whichever page is in it (and while one is on its way) */
.modal.wx-sheet:not([hidden]) { min-height: min(80vh, 760px); background: var(--panel-solid, #fff); }
#wxBody { transition: opacity .18s; }
#wxBody.wx-switching { opacity: .45; pointer-events: none; }
.wx-wait { padding: 28px 4px; text-align: center; }
.wx { padding-bottom: calc(14px + var(--safe-b)); }
.wx h4 { margin: 16px 0 8px; font-size: 15px; font-weight: 750; }
.wx-ic { width: 30px; height: 30px; flex: none; stroke: none; fill: none; overflow: visible; }
.wx-now { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 16px; background: linear-gradient(160deg, rgba(0, 150, 156, .1), rgba(15, 42, 51, .04)); }
.wx-now small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.wx-now > div:first-child b { display: block; margin: 2px 0; font-size: 18px; font-weight: 750; }
.wx-now span { display: block; font-size: 13px; color: var(--muted); line-height: 1.35; }
.wx-now-t { display: flex; align-items: center; gap: 4px; flex: none; }
.wx-now-t .wx-ic { width: 46px; height: 46px; }
.wx-now-t b { font-size: 40px; font-weight: 300; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.wx-hours { display: flex; gap: 2px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.wx-hours::-webkit-scrollbar { display: none; }
.wx-hours > div { flex: none; width: 46px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wx-hours time { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.wx-hours b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wx-hours small { min-height: 14px; font-size: 11px; font-weight: 650; color: var(--muted); }
.wx-hours small.sn { color: #1f7fd6; } .wx-hours small.pp { color: #5b8fb8; }
.wx-days { border-radius: 14px; border: 1px solid var(--line); overflow: hidden; }
.wx-dh, .wx-d { display: grid; grid-template-columns: 1.35fr 1.3fr 36px 0.95fr 0.85fr 0.6fr; align-items: center; }
.wx-dh { padding: 9px 0 7px; font-size: 11.5px; font-weight: 650; color: var(--muted); line-height: 1.15; text-align: center; border-bottom: 1px solid var(--line); }
.wx-dh > span { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; white-space: nowrap; }
.wx-dh svg { width: 14px; height: 14px; flex: none; stroke: var(--accent); stroke-width: 2; }
.wx-d { min-height: 50px; }
.wx-d + .wx-d { border-top: 1px solid var(--line); }
.wx-d > span { display: flex; flex-direction: column; justify-content: center; align-self: stretch; min-width: 0; padding: 4px 3px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.wx-d > span:first-child { padding-left: 10px; text-align: left; }
.wx-d > span:nth-child(2) { color: var(--muted); }
.wx-d > span:nth-child(2) b { color: var(--text); }
.wx-d > span:nth-child(3) { align-items: center; padding: 0; }
.wx-d b { font-weight: 700; white-space: nowrap; }
.wx-d small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* wind (km/h, the day's strongest): calm · breezy · strong · storm */
.wx-d .w1 { background: #fff1c9; } .wx-d .w2 { background: #ffc78a; } .wx-d .w3 { background: #f2665a; color: #fff; }
.wx-d .w3 small { color: rgba(255, 255, 255, .85); }
/* new snow (cm) */
.wx-d .s1 { background: #e3f0fd; } .wx-d .s2 { background: #a9d1f7; } .wx-d .s3 { background: #3f97ea; color: #fff; }
.wx-d .s3 small { color: rgba(255, 255, 255, .85); }
/* sunshine (hours) */
.wx-d .u1 { background: #fff6d6; } .wx-d .u2 { background: #ffe58c; } .wx-d .u3 { background: #ffc93b; }
.wx-radar { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.wx-radar-ic { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #0f5a5e 0%, #0b3540 60%, #0a2630 100%); box-shadow: inset 0 0 0 1px rgba(93, 242, 180, .25), 0 3px 10px rgba(15, 42, 51, .22); }
.wx-radar-ic svg { width: 44px; height: 44px; overflow: visible; stroke: none; fill: none; }
.wx-radar-ic .ring { fill: none; stroke: rgba(93, 242, 180, .28); stroke-width: .8; }
.wx-radar-ic .beam { stroke: #8dffd0; stroke-width: 1.1; stroke-linecap: round; }
.wx-radar-ic .sweep { transform-origin: 20px 20px; animation: wx-sweep 3.2s linear infinite; }
.wx-radar-ic .core { fill: #8dffd0; stroke: none; }
.wx-radar-ic .blip { stroke: none; animation: wx-blip 3.2s linear infinite; }
.wx-radar-ic .b1 { fill: #ffe033; animation-delay: .35s; } .wx-radar-ic .b2 { fill: #5fd85a; animation-delay: 2s; } .wx-radar-ic .b3 { fill: #b394ff; animation-delay: 1.45s; }
@keyframes wx-sweep { to { transform: rotate(360deg); } }
@keyframes wx-blip { 0%, 100% { opacity: .35; } 8% { opacity: 1; } 40% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .wx-radar-ic .sweep, .wx-radar-ic .blip { animation: none; } }
.wx-radar > span { flex: 1; min-width: 0; }
.wx-radar .wx-go { width: 18px; height: 18px; flex: none; stroke: var(--muted); stroke-width: 2; fill: none; }
.wx-dh .wx-dh-snow svg { width: 15px; height: 15px; stroke-width: 1.7; }
.wx-radar b { display: block; font-size: 15px; font-weight: 700; }
.wx-radar small { font-size: 12.5px; color: var(--muted); }
.wx-note { display: block; margin-top: 10px; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.wx-st { padding-bottom: calc(14px + var(--safe-b)); }
.wx-st-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.wx-st-row b { font-size: 15px; font-weight: 700; }
.wx-st-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.wx-st-row a { color: var(--accent); text-decoration: none; }
.wx-st-v { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.wx-st-v b { font-size: 18px; }
body.radar-on .discover-peek, body.radar-on[data-tab="map"] .discover-peek:not([hidden]) { display: none !important; }
.wx-d em { font-style: normal; white-space: nowrap; }
.wx-st-row > div:first-child { min-width: 0; }
.wx-st-row small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-fl { width: 12px; height: 12px; margin-right: 2px; vertical-align: -2px; stroke: var(--accent); stroke-width: 1.8; fill: none; stroke-linecap: round; }
/* the radar's slider belongs to the map: away while another tab or a sheet is up, back with the map
   (the radar stays on until its ✕) */
body:not([data-tab="map"]) .radar-panel, body:has(.modal:not([hidden])) .radar-panel, body:has(.dm-sheet) .radar-panel,
body.sheet-open .radar-panel, body.drawing .radar-panel, body.dl-mode .radar-panel { display: none; }

/* the radar's time ruler, as in MeteoSwiss's app: a white bar above the tab bar, the hours sliding
   under a fixed line, the time in a tag above it (light for measured, darker for forecast) */
.radar-panel { position: fixed; z-index: 30; left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); max-width: 520px; margin: 0 auto; bottom: var(--bottom);
  --cur: 46%; transform: translateY(14px); opacity: 0; transition: transform .32s cubic-bezier(.2, .9, .3, 1), opacity .22s; }
.radar-panel.open { transform: none; opacity: 1; }
.rp-bar { display: flex; height: 74px; border-radius: 18px; background: #fff; box-shadow: 0 8px 26px rgba(15, 42, 51, .18); border: 1px solid rgba(15, 42, 51, .08); overflow: hidden; }
.rp-play { display: grid; place-items: center; width: 60px; flex: none; border: 0; border-right: 1px solid rgba(15, 42, 51, .1); background: none; color: var(--text); cursor: pointer; }
.rp-play svg { width: 28px; height: 28px; fill: currentColor; stroke: none; }
.rp-play .pause { fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; }
.rp-play .play { display: block; } .rp-play .pause { display: none; }
.rp-play.playing .play { display: none; } .rp-play.playing .pause { display: block; }
.rp-view { position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: grab; outline: none; }
.rp-view.dragging { cursor: grabbing; }
.rp-ruler { position: absolute; top: 0; bottom: 0; left: var(--cur); will-change: transform; transition: transform .38s ease-out; }
.rp-view.dragging .rp-ruler { transition: transform .08s linear; }
.rp-ruler i { position: absolute; top: 44px; width: 1px; height: 5px; background: rgba(15, 42, 51, .3); }
.rp-ruler i.h { top: 40px; height: 12px; background: rgba(15, 42, 51, .45); }
.rp-ruler span { position: absolute; top: 25px; transform: translateX(3px); font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1; }
.rp-ruler span em { position: absolute; bottom: 14px; left: 0; font-style: normal; font-size: 11.5px; font-weight: 700; }
.rp-ruler b { position: absolute; top: 60px; height: 3px; border-radius: 2px; }
.rp-ruler b.meas { background: #8fb6bd; } .rp-ruler b.fc { top: 65px; background: #6f86d8; }
.rp-cursor { position: absolute; top: 0; bottom: 0; left: var(--cur); width: 2px; margin-left: -1px; background: #5f8f98; pointer-events: none; }
.rp-tag { position: absolute; bottom: calc(100% + 8px); left: calc(60px + (100% - 60px) * .46); transform: translateX(-50%); display: grid; justify-items: center; gap: 1px;
  min-width: 96px; padding: 7px 12px 6px; border-radius: 10px; background: #a9c7cb; color: #0f2a33; box-shadow: 0 4px 14px rgba(15, 42, 51, .18); pointer-events: none; }
.rp-tag::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #a9c7cb; }
.rp-tag b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rp-tag span { font-size: 13.5px; font-weight: 600; }
.rp-tag small { font-size: 12px; font-weight: 600; color: rgba(15, 42, 51, .62); }
.radar-panel.future .rp-tag { background: #6f98a1; color: #fff; } .radar-panel.future .rp-tag::after { border-top-color: #6f98a1; }
.radar-panel.future .rp-tag small { color: rgba(255, 255, 255, .78); }
.radar-panel .icon-btn.rp-close { position: absolute; left: auto; right: 0; bottom: calc(100% + 10px); }

/* The native map (iOS, www/js/nativemap.js) draws under the page: the page is see-through where the map is,
   and the web map's own canvas (it no longer draws) is hidden. */
html.native-map, html.native-map body, html.native-map #map { background: transparent; }
html.native-map .maplibregl-canvas { visibility: hidden; }
.fb-kinds { margin: 12px 0 10px; }
.fb-contact { margin-top: 8px; }
.fb-contact[hidden] { display: none; }
/* under the location button, which stays where it was */
#feedbackBtn { position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%); }
@media (min-width: 900px) { body.sheet-open #feedbackBtn { display: none !important; } }   /* (phones: it stays under My location, top right) */
/* a day opened: its weather every 3 hours */
.wx-d:not(.wx-b) { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wx-d[aria-expanded=true] { background: var(--fill); }
.wx-chev { width: 12px; height: 12px; margin-left: 3px; vertical-align: -1px; fill: none; stroke: var(--muted); stroke-width: 2.4; transition: transform .2s; }
.wx-d[aria-expanded=true] .wx-chev { transform: rotate(180deg); }
.wx-dx { border-top: 1px solid var(--line); background: var(--fill); }
.wx-dx + .wx-d { border-top: 1px solid var(--line); }
.wx-b { min-height: 40px; }
.wx-b + .wx-b { border-top: 1px solid rgba(127, 127, 127, .14); }
.wx-b > span:first-child { padding-left: 16px; color: var(--muted); }
.wx-b > span:first-child b { font-weight: 650; color: var(--text); }
.wx-b .wx-ic { width: 24px; height: 24px; }
/* the app is too old: update (js/updates.js) */
.update-needed { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 24px; background: var(--bg); text-align: center; }
.update-needed > div { max-width: 320px; }
.update-needed svg { width: 46px; height: 46px; fill: none; stroke: var(--accent); stroke-width: 2; }
.update-needed h3 { margin: 12px 0 6px; font-size: 22px; }
.update-needed p { margin: 0 0 18px; color: var(--muted); line-height: 1.4; }
/* Profile groups sit on cards: keep the card's own padding (the sheet's list is flat), room before the tabs */
.prof-groups { margin-bottom: 18px; }
.prof-groups .grp-list .grp-row, .prof-groups .grp-list .grp-empty { padding: 12px 14px; }
.prof-groups .grp-empty { align-items: start; }
.prof-groups .grp-empty .grp-thumb { align-self: center; }
/* Signed-out community card: the button clear of the text */
.signin-card > .chip { margin-top: 14px; }
/* Signed out: "Saved on this phone only · Sign in …" under the tours */
#advList .local-note { display: block; padding: 10px 2px 2px; background: none; border: 0; font-size: 13px; color: var(--muted); }
#advList .local-note .link { padding: 0; border: 0; background: none; font: inherit; font-weight: 650; color: var(--accent); cursor: pointer; }
/* People to follow (Community): a row of cards like Instagram's suggestions */
.suggest-wrap { margin: 4px 0 6px; }
.suggest-wrap[hidden] { display: none; }
.suggest-where { margin: 2px 0 10px; font-size: 13.5px; }
.sugg-strip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 8px; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; }
.sugg-strip::-webkit-scrollbar { display: none; }
.sugg-card { position: relative; flex: none; width: 152px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 16px 10px 12px; border-radius: 16px; background: var(--card); box-shadow: 0 1px 4px rgba(15, 42, 51, .06); text-align: center; cursor: pointer; }
.sugg-card .avatar.big { width: 64px; height: 64px; font-size: 24px; margin-bottom: 8px; }
.sugg-card b { max-width: 100%; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg-card small { max-width: 100%; color: var(--muted); font-size: 12.5px; }
.sugg-handle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg-why { min-height: 2.6em; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sugg-card .ig-btn { align-self: stretch; margin-top: 8px; }
.sugg-x { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.sugg-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
/* Local guides: the same card in gold — a fine gold edge, a small tag up top, the avatar's gold ring */
.guide-card { padding-top: 12px; box-shadow: 0 0 0 1.5px rgba(244, 184, 28, .55), 0 2px 10px rgba(184, 134, 11, .14);
  background: linear-gradient(180deg, rgba(255, 230, 154, .28), transparent 46%), var(--card); }
.guide-card .guide-tag { margin-bottom: 10px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold-ink, #5a3d00); background: linear-gradient(150deg, var(--gold1, #ffe69a), var(--gold2, #f4b81c)); white-space: nowrap; }
.guide-card .avatar.big { margin-top: 2px; }
.guide-card .ig-btn { margin-top: auto; }   /* (buttons line up when a line is missing) */
.guide-card .sugg-why { margin-bottom: 8px; }
.toggle-row button[hidden] { display: none; }
/* Favourite ski areas (Edit profile) */
.area-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.area-chips:empty { display: none; }
.area-chip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--fill); font-size: 14px; font-weight: 600; }
.area-x { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.area-x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.area-add { position: relative; }
.area-hits { list-style: none; margin: 6px 0 0; padding: 4px; border-radius: 12px; background: var(--card); box-shadow: 0 4px 16px rgba(15, 42, 51, .12); }
.area-hits[hidden] { display: none; }
.area-hits li { padding: 10px 12px; border-radius: 8px; font-size: 15px; }
.area-hits li.clickable:active { background: var(--fill); }
/* Favourite ski areas under a bio */
.prof-areas { display: flex; align-items: center; gap: 5px; margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.prof-areas[hidden] { display: none; }
.prof-areas svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
/* "Recent tours" with find-people and the bell beside it; the filter chips below get the full width */
.feed-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#communityScreen .feed-title-row { margin-top: 26px; }
#communityScreen .feed-title-row .comm-feed-title { margin: 0; }
.feed-title-row .row-btns { margin-top: 0; }
.feed-head #feedSeg { min-width: 0; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.feed-head #feedSeg::-webkit-scrollbar { display: none; }
.feed-head .toggle-row button { flex: none; white-space: nowrap; }

/* Someone's profile: Follow / Message / Share in the hero, like your own profile's buttons; "Follows you" beside the @username */
.sc-handle-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.sc-hero.user-hero .sc-handle-row .follows-you { padding: 2px 7px; font-size: 11.5px; border-radius: 6px; background: rgba(255, 255, 255, .22); color: #fff; }
.sc-hero.user-hero .sc-actions { margin-top: 14px; }
.sc-btn.solid { background: #fff; color: #0f2a33; }
.sc-btn.icon { flex: none; width: 40px; padding: 0; display: grid; place-items: center; }
.sc-btn.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-btn:disabled { opacity: .6; }
#userSheet .sc-hero.user-hero:not(.no-skier) { min-height: calc(316px + var(--safe-t)); }   /* the skier's skis end above the buttons */
/* the skier a little lower (feet level with the bottom of the picture) and further in from the edge */
#userSheet .sc-hero.user-hero .sc-skier { top: calc(56px + var(--safe-t)); right: 10px; }

/* Pull to refresh on someone's profile (the bar stays, the spinner below it, light on the hero's colour)
   and in Messages (only the list moves; the spinner in the gap above it) */
#userSheet.ptr-host.ptr-on > .modal-head { transform: none; }
#userSheet > .ptr { top: calc(var(--safe-t) + 62px); color: rgba(255, 255, 255, .92); }
#messagesSheet.ptr-host.ptr-on > :not(.ptr):not(.dm-list) { transform: none; }
#messagesSheet > .ptr { top: calc(var(--safe-t) + 158px); }

/* Search page rows (people, tours) pressed: a grey rounded background, like the map search's list (not a fade) */
.srch-list li.srch-row { margin: 0 -10px; padding: 8px 10px; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
.srch-list li.srch-row:active { opacity: 1; background: var(--fill); }

/* Map search: Recent (Instagram-like), a heading with Clear all, ✕ on each row */
#searchResults li.sr-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 4px; cursor: default; background: none; }
#searchResults li.sr-head b { font-size: 15px; font-weight: 700; }
#searchResults li.sr-head button { border: 0; padding: 4px 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; }
#searchResults .sr-x { flex: none; width: 30px; height: 30px; margin-right: -6px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
#searchResults .sr-x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
#searchResults .sr-x:active { background: var(--fill); }

/* Recent searches (Search page and Community's bar): a typed search as 🔍 in a grey circle, the size of an avatar */
.srch-list .srch-q-ic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--fill); color: var(--text); }
.srch-list .srch-q-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.srch-list li.srch-q b { font-weight: 600; }
.srch-list .srch-x { border-radius: 50%; }
.srch-list .srch-x:active { background: var(--fill-strong, var(--fill)); }
.comm-results .srch-list li.srch-row { margin: 0 -8px; padding: 8px; }

/* New message: the people close together, like Instagram (no cards, no gaps) */
#peopleSheet.dm-page #peopleList { gap: 0; }
#peopleSheet.dm-page #peopleList > li:not(.list-head):not(.empty) { padding-top: 8px; padding-bottom: 8px; border-radius: 0; background: none; }
#peopleSheet.dm-page #peopleList > li:not(.list-head):not(.empty):active { background: var(--fill); }
#peopleSheet.dm-page #peopleList .avatar { width: 44px; height: 44px; }
/* New message's search: 🔍 at the start, like the Messages page's search box */
#peopleSheet.dm-page #peopleSearch { padding: 0 12px 0 38px; font-size: 16px; outline: none; box-shadow: none;
  background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 18px 18px; }
#peopleSheet.dm-page #peopleSearch::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Your own posts: ⋯ at the right of the name row (who can see it, Delete) */
.feed-card.has-more { position: relative; }
.feed-card.has-more .feed-who { padding-right: 54px; }
/* ⋯ on your own tours: the same dots as top right on a profile (no circle), in the text colour */
.feed-more { position: absolute; top: 9px; right: 8px; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: opacity .12s; }
.feed-more svg { width: 28px; height: 28px; fill: currentColor; stroke: none !important; }
.feed-more:active { opacity: .45; }
/* Rename: iOS's alert with a text field */
.ios-alert-card.has-input b { padding-bottom: 12px; }
.ios-alert-input { display: block; width: calc(100% - 32px); box-sizing: border-box; margin: 0 16px 16px; padding: 7px 8px; border: .5px solid rgba(60, 60, 67, .3); border-radius: 7px;
  background: #fff; font: inherit; font-size: 16px; color: #000; outline: none; -webkit-user-select: text; user-select: text; }
.ios-alert-btns button:disabled { opacity: .4; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ios-alert-input { background: #1c1c1e; border-color: rgba(255, 255, 255, .16); color: #fff; }
}
/* the posts sheet's title in the middle (under the grabber), with or without ‹ */
#postsSheet .modal-head .posts-title { margin: 0 42px; }
#postsSheet .modal-head:has(.back-btn:not([hidden])) .posts-title { margin: 0 42px 0 0; }

/* Comments: the title in the middle, clear of ‹ (the general "‹ then title on the left" rule pushed it under the arrow) */
.comments-sheet .modal-head { padding-inline: 56px; }
.comments-sheet .modal-head > h3, .comments-sheet .modal-head .back-btn:not([hidden]) + h3 { margin: 0 auto; text-align: center; }

/* Dark mode, map buttons and chips on their dark glass: light icons and text (they kept the dark ones) */
@media (max-width: 899px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.map-chip:not(.on), .fab-col .fab:not(.fab-big):not(.active), .map-search-btn, .tabbar .tab-search, .fab-col.fab-bottom .fab-big:not(.located)) { color: #f2f2f7; }
  :root:not([data-theme="light"]) :is(.map-chip:not(.on), .fab-col .fab:not(.fab-big):not(.active), .map-search-btn, .fab-col.fab-bottom .fab-big:not(.located)) { box-shadow: 0 6px 22px rgba(0, 0, 0, .35), inset 0 0 0 .5px rgba(255, 255, 255, .14); }
  :root:not([data-theme="light"]) #compassBtn .needle .s { fill: #e8e8ed; }
}

/* My location like the other map buttons (white glass, dark in dark mode); found: only the ring and dot turn teal */
@media (max-width: 899px) {
  .fab-col.fab-bottom .fab-big, .fab-col.fab-bottom .fab-big.located { background: rgba(255, 255, 255, .82); border: 0;
    box-shadow: 0 2px 10px rgba(15, 42, 51, .12), inset 0 0 0 1px rgba(255, 255, 255, .9); color: var(--text); }
  .fab-col.fab-bottom .fab-big.located { color: var(--accent); }
  .fab-col.fab-bottom .fab-big svg { color: inherit; stroke-width: 2.2; }
  .fab-col.fab-bottom .fab-big:not(.located) .dot { opacity: 0; }
  .fab-col.fab-bottom .fab-big.located svg { color: inherit; fill: none; }
  .fab-col.fab-bottom .fab-big.located .dot { color: inherit; fill: currentColor; }
}
@media (max-width: 899px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fab-col.fab-bottom .fab-big, :root:not([data-theme="light"]) .fab-col.fab-bottom .fab-big.located { background: rgba(38, 38, 44, .72); box-shadow: 0 6px 22px rgba(0, 0, 0, .35), inset 0 0 0 .5px rgba(255, 255, 255, .14); color: #f2f2f7; }
  :root:not([data-theme="light"]) .fab-col.fab-bottom .fab-big.located { color: #3cc8ce; }
}

/* The logo (www/icon.svg): teal, the mountain as a white outline and the chute straight down from the summit */
.invite-art { background: linear-gradient(135deg, #2ad4cf, #00969c); }
.invite-art svg { width: 60px; height: 60px; fill: none; stroke: #fff; }
.invite-art .peak { stroke-width: 22; stroke-linejoin: round; }
.invite-art .chute { stroke-width: 10; stroke-linecap: butt; }
/* Map tab: the logo's mountain as a line drawing */
.tabbar svg.logo-line { fill: none !important; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.tabbar button svg.logo-line { width: 28px; height: 28px; }
@media (max-width: 899px) { .tabbar .tab-pill button svg.logo-line { width: 24px; height: 24px; } }

/* "Check your email" after creating an account */
#authSheet:not(.verify) .only-verify, #authSheet.verify #syncLogin { display: none !important; }
.auth-verify { display: grid; gap: 12px; margin-top: 4px; }
.verify-to { margin: 0; text-align: center; font-size: 15.5px; line-height: 1.45; }
.verify-to b { font-size: 16.5px; word-break: break-all; }
.verify-steps { margin: 2px 0 0; padding: 14px 16px 14px 34px; border-radius: 14px; background: var(--fill); font-size: 15px; line-height: 1.5; display: grid; gap: 6px; }
.verify-junk { margin: 0; text-align: center; font-size: 13.5px; }
.auth-verify .chip.wide { width: 100%; }


/* ==== Dark mode: the whole app (iPhone/Android set to dark). Every colour token gets a dark value, so
   cards, sheets, popups and lists follow; the few surfaces with a fixed white get theirs below. ==== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --handle: rgba(255, 255, 255, 0.24);
    --bg: #0b1012;
    --panel: rgba(28, 31, 33, 0.97);
    --panel-solid: #1c1f21;
    --card: #24282b;
    --text: #eef3f4;
    --muted: #9aa8ac;
    --grid: rgba(255, 255, 255, 0.08);
    --line: rgba(255, 255, 255, 0.12);
    --fill: rgba(255, 255, 255, 0.07);
    --fill-strong: rgba(255, 255, 255, 0.14);
    --accent: #16adb3;
    --navy: #2b4a52;
    --on-bg: #eef3f4;
    --on-text: #0f1a1d;
    --shadow: 0 3px 14px rgba(0, 0, 0, 0.45);
  }
  :root:not([data-theme="light"]):not(.native-map) body { background: var(--bg); }
  :root:not([data-theme="light"]) body { color: var(--text); }
  /* fixed white surfaces */
  :root:not([data-theme="light"]) :is(.search, .topbar .search, .search-cancel, .comm-search, .dock) { background: rgba(38, 38, 44, .86); color: var(--text); }
  :root:not([data-theme="light"]) :is(.discover-peek, .rp-bar) { background: var(--panel-solid); }
  :root:not([data-theme="light"]) .search input, :root:not([data-theme="light"]) .search input::placeholder { color: var(--text); }
  :root:not([data-theme="light"]) .search input::placeholder { opacity: .55; }
  :root:not([data-theme="light"]) .modal, :root:not([data-theme="light"]) .sheet { color: var(--text); }
}
@media (min-width: 900px) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabbar { background: var(--panel-solid); } }
/* the logo on sign-up too: outline only (the old logo's filled peak rule) */
#authSheet .invite-art, #authSheet.signup .invite-art { background: linear-gradient(135deg, #2ad4cf, #00969c); }
#authSheet .invite-art svg, #authSheet.signup .invite-art svg { fill: none; stroke: #fff; }
/* dark mode: tour icons by level stay visible (black = very difficult) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sr-ic.tour { color: color-mix(in srgb, var(--lv, #f08c00) 70%, #fff); background: color-mix(in srgb, var(--lv, #f08c00) 26%, #3a4044); }
}
/* dark mode: the popup's coloured sections keep readable titles */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .inspect .wildlife b { color: #5fd17b; }
  :root:not([data-theme="light"]) .inspect .wildlife.prohibited, :root:not([data-theme="light"]) .inspect .wildlife.regulated { border-left-color: #3fb35c; }
  :root:not([data-theme="light"]) .inspect .wildlife .x { background: #2f9e44; }
  :root:not([data-theme="light"]) .inspect .petzl { background: rgba(140, 120, 240, 0.14); border-left-color: #8f80ea; }
  :root:not([data-theme="light"]) .inspect .petzl b { color: #b8acff; }
  :root:not([data-theme="light"]) .inspect .petzl.delicate { background: rgba(232, 89, 12, 0.16); border-left-color: #ff7a33; }
  :root:not([data-theme="light"]) .inspect .petzl.delicate b { color: #ff9a62; }
  :root:not([data-theme="light"]) .inspect .aval-head i { border-color: rgba(255, 255, 255, 0.3); }
  :root:not([data-theme="light"]) .pt-head span { color: #2bc3c8; }
}
/* dark mode: pastel cells and notes keep dark text; tinted chips and notes get dark tints */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.wx-d .w1, .wx-d .w2, .wx-d .s1, .wx-d .s2, .wx-d .u1, .wx-d .u2, .wx-d .u3) { color: #10191c; }
  :root:not([data-theme="light"]) :is(.wx-d .w1, .wx-d .w2, .wx-d .s1, .wx-d .s2, .wx-d .u1, .wx-d .u2, .wx-d .u3) small { color: rgba(16, 25, 28, .7); }
  :root:not([data-theme="light"]) .tour-chip.past-chip { background: rgba(155, 80, 230, .24); color: #d4b5ff; }
  :root:not([data-theme="light"]) :is(.rec-unsaved, .chat-offline) { background: rgba(245, 180, 40, .16); color: #ffd27a; }
  :root:not([data-theme="light"]) .photo-strip.edit .photo .del { background: #30302e; color: #e8e8e3; }
}
/* iPhone: the native map draws under the page, so the page stays see-through there in dark mode too */
html.native-map, html.native-map body, html.native-map #map { background: transparent !important; }
#searchResults li { touch-action: manipulation; }   /* no tap delay on the result and Recent rows */

/* ==== Verified ski guide: a gold ring (and star) on the picture, "★ VERIFIED SKI GUIDE" above the name ==== */
:root { --gold1: #ffe69a; --gold2: #f4b81c; --gold3: #b8860b; --gold-ink: #5a3d00; }
.sc-hero.is-guide .sc-ava .avatar.big { border: 0 !important; padding: 3.5px; background: linear-gradient(150deg, var(--gold1), var(--gold2) 45%, var(--gold3) 80%, var(--gold1)) !important;
  box-shadow: 0 0 0 1px rgba(255, 220, 120, .5), 0 0 18px rgba(255, 200, 60, .55); }
.sc-hero.is-guide .sc-ava .avatar.big > img, .sc-hero.is-guide .sc-ava .avatar.big > svg { border-radius: 42px; }
.guide-badge { position: absolute; z-index: 3; top: -4px; right: -6px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--gold1), var(--gold2)); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); pointer-events: none; }
.guide-badge svg { width: 15px; height: 15px; fill: #7a5200; stroke: none; }
.v-guide { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; justify-self: start; padding: 2px 8px 2px 6px; border-radius: 999px; margin-bottom: 2px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: var(--gold-ink); background: linear-gradient(150deg, var(--gold1), var(--gold2)); text-shadow: none; }
.v-guide svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
/* small pictures (feed, comments, search, people): a gold ring around them */
.avatar.av-guide { box-shadow: 0 0 0 2px var(--panel-solid), 0 0 0 4px var(--gold2), 0 0 10px rgba(255, 200, 60, .45); }
.role-badge.role-guide { background: linear-gradient(150deg, var(--gold1), var(--gold2)); color: var(--gold-ink); }
/* Edit profile: the row, and the request sheet */
.guide-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.guide-row .grow { display: grid; gap: 1px; min-width: 0; }
.guide-row small { color: var(--muted); font-size: 13px; }
.guide-row > svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.guide-star { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 17px; color: var(--gold-ink); background: linear-gradient(150deg, var(--gold1), var(--gold2)); }
.guide-row.verified { border-color: var(--gold2); }
.guide-row.verified > svg { display: none; }
.guide-sheet .guide-intro { margin: 0 0 4px; font-size: 14px; line-height: 1.45; }
.guide-proof { display: grid; place-items: center; min-height: 64px; border: 1.5px dashed var(--line); border-radius: 14px; color: var(--accent); font-weight: 650; cursor: pointer; }
.guide-proof.picked { border-style: solid; border-color: var(--accent); }
.guide-sheet textarea.input { resize: vertical; }
.guide-sheet .chip.wide { width: 100%; margin-top: 6px; }

/* ==== Guide notes: the button in the tap popup, the note popup, the add sheet ==== */
.pt-note { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 8px; padding: 11px 14px; border: 0; border-radius: 14px;
  font: inherit; font-weight: 700; cursor: pointer; color: var(--gold-ink); background: linear-gradient(150deg, var(--gold1), var(--gold2)); }
.pt-note svg { width: 15px; height: 15px; fill: currentColor; flex: none; }
.pt-note.locked { background: var(--fill); color: var(--muted); font-weight: 600; font-size: 13.5px; }
.pt-note.locked svg { fill: var(--muted); opacity: .6; }
.inspect.gnote { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; width: 250px; max-width: 100%; }
.gn-kind { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .07em;
  color: var(--gold-ink); background: linear-gradient(150deg, var(--gold1), var(--gold2)); }
.gn-kind svg { width: 11px; height: 11px; fill: currentColor; }
.gn-who { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.gn-who .avatar { width: 36px; height: 36px; flex: none; }
.gn-who span { display: grid; min-width: 0; }
.gn-who b { font-size: 14.5px; }
.gn-who small { font-size: 12px; color: #b07d00; font-weight: 650; }
.gn-body { margin: 0; font-size: 15.5px; line-height: 1.4; font-weight: 600; white-space: pre-wrap; }
.gn-photo { width: 100%; max-height: 200px; object-fit: cover; border-radius: 12px; }
.gn-facts { font-size: 12.5px; color: var(--muted); }
.gn-acts { display: flex; justify-content: flex-end; }
.gn-acts button { border: 0; background: none; padding: 4px 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.gn-acts .gn-del { color: var(--danger); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gn-who small { color: #f4c542; } }
.note-sheet .note-where { margin: 0 0 8px; font-size: 13.5px; }
.note-kinds, .note-days { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.note-kinds button, .note-days button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.note-kinds button.on, .note-days button.on { border-color: transparent; background: linear-gradient(150deg, var(--gold1), var(--gold2)); color: var(--gold-ink); font-weight: 700; }
.note-sheet textarea.input { resize: vertical; font-size: 16px; }
.note-count { display: block; text-align: right; margin: 2px 0 6px; font-size: 12px; }
.note-sheet .note-photo { margin: 4px 0 6px; }
.note-sheet .chip.wide { width: 100%; }
.gn-head { padding-right: 30px; }

/* ===== The browser version (body.web, app.chutemap.com) ===== */
body.web .tabbar .tab-record, body.web #recPanel, body.web #proFine, body.web #proRestore { display: none !important; }
body.web .get-app-btn:not([hidden]) { display: flex; }
.get-app-btn { position: fixed; z-index: 6; top: 14px; right: 14px; display: none; align-items: center; gap: 7px; height: 40px; padding: 0 16px 0 12px;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-text, #fff); font: inherit; font-size: 14px; font-weight: 650;
  box-shadow: var(--shadow); cursor: pointer; }
.get-app-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.get-app-btn:hover { filter: brightness(1.08); }
@media (min-width: 900px) { body.web .fab-col:not(.fab-bottom) { top: 66px; } }
@media (max-width: 899px) { .get-app-btn { top: calc(var(--safe-t, 0px) + 112px); left: 14px; right: auto; height: 34px; padding: 0 13px 0 10px; font-size: 13px; }
  body.web:not([data-tab="map"]) .get-app-btn, body.web.sheet-open .get-app-btn { display: none; } }
body.web:has(.modal:not([hidden])) .get-app-btn, body.web.dl-mode .get-app-btn { display: none; }
.get-app-sheet { text-align: center; }
.ga-hero { display: grid; justify-items: center; gap: 6px; padding: 4px 18px 0; }
.ga-hero img { border-radius: 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.ga-hero h2 { margin: 8px 0 0; font-size: 21px; }
.ga-hero p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.ga-qr { width: 184px; height: 184px; margin: 18px auto 4px; }
.ga-qr svg { width: 100%; height: 100%; display: block; }
.ga-scan { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.ga-store { display: flex; align-items: center; justify-content: center; gap: 10px; width: 220px; margin: 0 auto 10px; padding: 9px 16px; border-radius: 12px;
  background: #000; color: #fff; text-decoration: none; text-align: left; }
.ga-store svg { width: 24px; height: 24px; fill: currentColor; }
.ga-store span { display: grid; font-size: 18px; font-weight: 650; line-height: 1.1; }
.ga-store small { font-size: 11px; font-weight: 500; opacity: .85; }
@media (min-width: 900px) { body.web #navBtn { display: none; } }   /* (turn-by-turn on a laptop: no GPS) */
