/* Barlow (SIL OFL 1.1, see vendor/fonts/OFL.txt): a grotesk modeled on California highway signs. */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url(vendor/fonts/barlow-400.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url(vendor/fonts/barlow-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url(vendor/fonts/barlow-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url(vendor/fonts/barlow-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url(vendor/fonts/barlow-semi-condensed-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url(vendor/fonts/barlow-semi-condensed-700.woff2) format("woff2"); }

:root {
  --ink: #2d2620;
  --ink-2: #5c5146;
  --ink-3: #8a7d70;
  --paper: #fbf8f3;
  --paper-2: #f3ede4;
  --line: #e2d9cc;
  --sand: #ede4d3;
  --rock: #c9a77c;
  --accent: #1d6fd1;
  --me: #1d6fd1;
  --g0: #2b8a3e; /* VB–V2 */
  --g1: #1971c2; /* V3–V5 */
  --g2: #c2410c; /* V6–V8 */
  --g3: #c92a2a; /* V9–V11 */
  --g4: #6741d9; /* V12+ */
  --sheet-w: 410px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --sans: "Barlow", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --cond: "Barlow Semi Condensed", "Barlow", ui-sans-serif, -apple-system, system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
/* No double-tap zoom on phones (pinch-zooming the map still works). */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body {
  font: 16px/1.4 var(--sans);
  font-feature-settings: "tnum" 0;
  color: var(--ink);
  /* Same as the list sheet: if iOS ever leaves a band below the sheet, it blends in. */
  background: var(--paper);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.muted { color: var(--ink-3); }

/* ------------------------------------------------------------------ map */
#map { position: fixed; inset: 0; background: var(--sand); }
#map.sat { background: #4b4338; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font: 11px/1.4 var(--sans); background: rgba(251, 248, 243, .82) !important; }
.leaflet-boulders-pane canvas { cursor: pointer; }

/* Constant-size dots stand in for boulders until their real footprint is big enough to tap. */
.bdot {
  border-radius: 50%; background: var(--rock); border: 1.5px solid #4a3a2a;
}
#map.sat .bdot { background: #fff3dc; border-color: #fff; box-shadow: 0 0 0 1.5px rgba(0,0,0,.45); }
#map.z-near .bdot, #map.z-far .bdot { opacity: 0; pointer-events: none; }
.bdot.dim { opacity: .25; }
.bdot.sel { background: #ffd25a; border-color: #000; transform: scale(1.35); opacity: 1; }

.blabel span {
  position: absolute; left: 0; top: 2px; transform: translateX(-50%);
  white-space: nowrap; font: 600 12.5px/1.1 var(--cond); letter-spacing: .01em; color: var(--ink);
  text-shadow: 0 0 2px #fff, 0 0 3px #fff;
  opacity: 0;
}
.blabel i { font-style: normal; font-weight: 600; color: var(--ink-3); }
#map.z-labels .blabel span { opacity: 1; }
#map.z-labels .blabel.dim span, #map.z-labels .blabel.hide span { opacity: 0; }
#map:not(.z-areas) .blabel.sel span { opacity: 1; font-size: 14px; }
#map.sat .blabel span { color: #fff; text-shadow: 0 0 3px #000, 0 1px 2px #000; }
#map.sat .blabel i { color: #e9dcc8; }

.alabel button {
  position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-50% + var(--dy, 0px)));
  display: flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer;
  border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink);
  border-radius: 999px; padding: 4px 10px 4px 12px; box-shadow: 0 2px 8px rgba(45, 38, 32, .25);
  font: 700 14px/1.1 var(--cond); letter-spacing: .02em; text-transform: uppercase;
  transition: opacity .2s;
}
.alabel button span { font-weight: 600; font-size: 12.5px; background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 7px; letter-spacing: 0; }
.alabel.sel button { background: #ffd25a; }
#map:not(.z-areas) .alabel button { opacity: 0; pointer-events: none; }

.me-icon { pointer-events: none; }
.me-dot {
  position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--me); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.me-dot::after {
  content: ""; position: absolute; inset: -9px; border-radius: 50%;
  border: 2px solid var(--me); opacity: 0; animation: ping 2s ease-out infinite;
}
.me-cone { position: absolute; left: -30px; top: -30px; width: 60px; height: 60px; transform: rotate(var(--hd, 0deg)); display: none; }
.me-cone.on { display: block; }
@keyframes ping { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.8); opacity: 0; } }

/* ------------------------------------------------------------------ chrome */
.topbar {
  position: fixed; z-index: 1000; left: 12px; top: calc(12px + var(--safe-t));
  display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; pointer-events: none;
  max-width: calc(100vw - 80px);
}
.brand {
  display: flex; align-items: center; gap: 9px; pointer-events: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: 13px; padding: 6px 6px 6px 9px;
  box-shadow: 0 2px 10px rgba(45, 38, 32, .14);
}
.brand svg { width: 30px; height: 30px; flex: none; }
.regionbtn {
  border: 0; background: transparent; padding: 2px 4px 2px 0; margin: 0; text-align: left; cursor: pointer; color: inherit;
  display: flex; flex-direction: column; border-radius: 8px; -webkit-tap-highlight-color: transparent;
  transition: transform .14s var(--ease, ease);
}
.regionbtn:active { transform: scale(.97); }
.brand .h1 { font: 700 18px/1 var(--cond); letter-spacing: .04em; text-transform: uppercase; }
.brand .sub { display: inline-flex; align-items: center; gap: 1px; margin: 2px 0 0; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.brand .sub svg { width: 16px; height: 16px; flex: none; transition: transform .25s var(--ease, ease); }
.regionbtn[aria-expanded="true"] .sub svg { transform: rotate(180deg); }
.regionmenu { padding: 4px 6px 8px; transform-origin: top left; }
.regionmenu .rmh { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 8px 8px 6px; }
.regionmenu .rmh .muted { font-size: 12.5px; }
.rlist { list-style: none; margin: 0; padding: 0; }
.rlist button {
  width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left;
  padding: 9px 8px; border-radius: 9px; cursor: pointer; color: inherit; font: inherit; transition: background-color .18s ease;
}
.rlist button:active, .rlist button:hover { background: var(--paper-2); }
.rlist button.on { background: #fff7dc; }
.rlist .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rlist .name { font: 700 16.5px/1.15 var(--cond); }
.rlist .meta { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.rlist .here svg { width: 20px; height: 20px; color: var(--accent); }
.rlist .dist { font-size: 13px; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.rlist .chev { color: var(--ink-3); font-size: 20px; }
body.switching .sheet, body.switching #map { opacity: .45; transition: opacity .2s ease; }
.elsewhere { margin: 4px 12px 12px; border: 1px dashed var(--line); border-radius: 12px; overflow: hidden; }
.elsewhere .item {
  display: flex; gap: 11px; align-items: center; width: 100%; text-align: left; border: 0; background: #fff;
  padding: 11px 14px; cursor: pointer; color: inherit; font: inherit; transition: background-color .18s ease;
}
.elsewhere .item + .item { border-top: 1px solid var(--line); }
.elsewhere .item:active, .elsewhere .item:hover { background: var(--paper-2); }
.oregions { list-style: none; margin: 0 0 12px; padding: 0; }
.oregions li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.oregions li:first-child { border-top: 0; }
.oregions li > span:first-child { display: flex; flex-direction: column; }
.oregions .muted { font-size: 13px; }
.oregions .ok { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: #2e7d32; font-size: 14px; }
.oregions .ok svg { width: 18px; height: 18px; }
.acct {
  margin-left: 4px; height: 34px; min-width: 34px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  display: inline-flex; align-items: center; gap: 5px; padding: 0 10px 0 7px; cursor: pointer; font-weight: 600; font-size: 14px;
}
.acct[hidden] { display: none; }
.acct span { white-space: nowrap; }
.acct svg { width: 18px; height: 18px; }
.acct.in { padding: 0; width: 34px; justify-content: center; overflow: hidden; }
.acct img { width: 100%; height: 100%; object-fit: cover; }
.acct .ini { font-weight: 700; }
.acctmenu {
  pointer-events: auto; flex-basis: 100%; max-width: 300px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px 14px 12px; box-shadow: 0 6px 20px rgba(45, 38, 32, .2); font-size: 14px;
}
.gbtn { min-height: 44px; margin-top: 6px; }
.locstatus {
  pointer-events: auto; align-self: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  font-size: 13.5px; color: var(--ink-2); box-shadow: 0 2px 10px rgba(45, 38, 32, .12);
}
.locstatus b { color: var(--me); font-weight: 600; }
.locstatus.off { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }

.mapbtns {
  position: fixed; z-index: 1000; right: 12px; top: calc(12px + var(--safe-t));
  display: flex; flex-direction: column; gap: 8px;
}
.fab {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 2px 10px rgba(45, 38, 32, .16);
}
.fab svg { width: 22px; height: 22px; }
.fab.on { color: #fff; background: var(--me); border-color: var(--me); }
.fab.wait svg { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fab:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.toast {
  position: fixed; z-index: 1300; left: 50%; top: calc(74px + var(--safe-t)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 15px; border-radius: 11px; font-size: 14.5px; font-weight: 500;
  max-width: min(92vw, 440px); box-shadow: 0 6px 20px rgba(0,0,0,.25); text-align: center;
}

/* ------------------------------------------------------------------ sheet */
.sheet {
  position: fixed; z-index: 1100; left: 0; right: 0; bottom: 0;
  height: 88dvh; background: var(--paper);
  border-radius: 18px 18px 0 0; box-shadow: 0 -6px 24px rgba(45, 38, 32, .22);
  display: flex; flex-direction: column;
  transform: translateY(calc(88dvh - var(--peek)));
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  --peek: calc(178px + var(--safe-b));
  --mini: calc(26px + var(--safe-b));
  touch-action: pan-y;
}
.sheet[data-snap="half"] { transform: translateY(calc(88dvh - 52dvh)); }
.sheet[data-snap="full"] { transform: translateY(0); }
/* Minimized: only the handle stays on screen; drag it up (or tap it) to bring the list back. */
.sheet[data-snap="hidden"] { transform: translateY(calc(88dvh - var(--mini))); }
.sheet > section { transition: opacity .2s; }
.sheet[data-snap="hidden"] > section { opacity: 0; pointer-events: none; }
.sheet.dragging { transition: none; }
.handle { flex: none; height: 24px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.handle span { width: 40px; height: 5px; border-radius: 3px; background: #cbbfae; }

#listview, #detail { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#listview[hidden], #detail[hidden] { display: none; }
.controls { flex: none; padding: 0 14px 8px; border-bottom: 1px solid var(--line); }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 11px; padding: 0 11px; height: 44px;
}
.search svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.search input { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; height: 100%; font-size: 16.5px; }
.search input::placeholder { color: var(--ink-3); }
.tabs { display: flex; gap: 4px; margin-top: 9px; background: var(--paper-2); border-radius: 10px; padding: 3px; }
.tabs button {
  flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 7px 4px; cursor: pointer;
  font: 600 15px/1.2 var(--sans); color: var(--ink-2); white-space: nowrap;
}
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(45,38,32,.14); }
.tabs b { font-weight: 500; color: var(--ink-3); font-size: 13px; margin-left: 1px; font-variant-numeric: tabular-nums; }
.filters { margin-top: 9px; }
.filters[hidden] { display: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-top: 8px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 11px;
  font: 700 14px/1.2 var(--cond); letter-spacing: .02em; cursor: pointer; color: var(--ink-2); white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.chip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 5px; vertical-align: 1px; }
.chip[aria-pressed="true"] .sw { background: #fff; }
.row2 { display: flex; gap: 10px; margin-top: 8px; }
.sel { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); flex: 1; font-weight: 500; }
.sel select {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 6px; font-size: 16px;
}
.sel.area select { font-weight: 600; color: var(--ink); }

.list { list-style: none; margin: 0; padding: 0 0 8px; overflow-y: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.list li { border-bottom: 1px solid var(--line); }
.list .item {
  display: flex; gap: 11px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 14px; cursor: pointer;
}
.list .item:hover { background: var(--paper-2); }
.list .empty { padding: 28px 16px; text-align: center; color: var(--ink-3); }
.item .main { flex: 1; min-width: 0; overflow: hidden; }
.item .name, .item .meta { display: block; }
.item .name { font-weight: 600; font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.003em; }
.item .meta { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .dist { font-size: 12.5px; color: var(--ink-3); text-align: right; white-space: nowrap; flex: none; font-variant-numeric: tabular-nums; }
.item .dist b { display: block; color: var(--me); font-size: 14px; font-weight: 600; }
.item .thumb { width: 52px; height: 34px; flex: none; }
.marks { display: inline; }
.mark { display: inline-flex; align-items: center; gap: 1px; height: 15px; margin-left: 5px; vertical-align: -2px; color: #b7791f; }
.mark svg { width: 15px; height: 15px; }
.mark.inlist { color: var(--accent); }
.mark.inlist b { font: 700 11.5px/1 var(--cond); }
.mark.dl { color: var(--g0); }
/* Saved / listed climbs stand out while scrolling: a colored edge on the row. */
.list li.kept-saved > .item { background: #fffaf0; box-shadow: inset 4px 0 0 #e0a526; }
.list li.kept-list > .item { background: #f5f9ff; box-shadow: inset 4px 0 0 var(--accent); }
.inpick { margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 2px 12px 10px; }
.inpick .pick { margin: 0; }
.inpick .pick li:first-child { border-top: 0; }
.inpick .pick label { padding: 9px 0; font-size: 15.5px; }
.inpick .newl { margin: 6px 0 0; }
[data-act=addlist][aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.vids { display: inline-flex; align-items: center; gap: 1px; color: #c4302b; font-weight: 600; }
.vids svg { width: 13px; height: 13px; }

.savedhead { padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 14.5px; background: var(--paper-2); }
.savedhead > div:first-child { flex: 1; min-width: 180px; }
.savedhead .sync { flex-basis: 100%; font-size: 13.5px; color: var(--ink-2); }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; }

.grade {
  flex: none; min-width: 46px; text-align: center; border-radius: 7px; padding: 3px 6px;
  font: 700 15.5px/1.2 var(--cond); letter-spacing: .01em; color: #fff; background: var(--c, #666); font-variant-numeric: tabular-nums;
}
.stars { color: #d08700; letter-spacing: -1px; font-size: 12.5px; }
.stars .off { color: #d9cfc2; }
.votes { color: var(--ink-3); font-size: .92em; margin-left: 3px; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font: 700 11px/1.4 var(--cond); border-radius: 4px; padding: 0 4px; background: #fde2e1; color: #a61b1b; margin-left: 5px; vertical-align: 2px; }

.credits { flex: none; font-size: 12px; color: var(--ink-3); padding: 8px 14px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); }
.credits a { color: var(--ink-2); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 6px 13px 6px 10px; font: 600 14.5px/1.2 var(--sans); cursor: pointer; white-space: nowrap;
}
.pill svg { width: 17px; height: 17px; }
.pill.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.pill[data-act="dl"].on { background: var(--g0); border-color: var(--g0); }
.pill.solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill.busy { opacity: .6; pointer-events: none; }
.pill:disabled { opacity: .5; }

/* ------------------------------------------------------------------ detail */
#detail { overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(16px + var(--safe-b)); }
.dhead { position: sticky; top: 0; z-index: 2; background: var(--paper); padding: 0 14px 10px; border-bottom: 1px solid var(--line); box-shadow: 0 -2px 0 var(--paper); }
/* (the shadow covers a sub-pixel sliver of scrolled text that can peek out above the sticky header) */
.dtop { display: flex; align-items: center; gap: 9px; }
.back {
  border: 1px solid var(--line); background: #fff; border-radius: 9px; height: 34px; padding: 0 10px 0 6px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 2px; font-size: 15px; font-weight: 600; flex: none;
}
.back svg { width: 18px; height: 18px; }
.dhead h2 { margin: 0; font: 700 22px/1.1 var(--cond); letter-spacing: .005em; flex: 1; min-width: 0; }
.dsub { font-size: 13.5px; color: var(--ink-2); margin-top: 5px; font-weight: 500; }
.where { display: flex; align-items: center; gap: 10px; margin-top: 8px; background: #e8f0fb; border-radius: 10px; padding: 7px 10px; font-size: 14.5px; }
.where .arrow { width: 30px; height: 30px; flex: none; transition: transform .3s; }
.where b { color: var(--me); font-weight: 600; }
.where.off { background: var(--paper-2); color: var(--ink-2); }
.dbody { padding: 12px 14px 0; }
.art { background: linear-gradient(#f6efe4, #fbf8f3); border: 1px solid var(--line); border-radius: 14px; padding: 6px 4px 2px; }
.art .scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.art svg { width: 100%; height: auto; display: block; }
.art .badge text { pointer-events: none; }
.artcap { font-size: 12px; color: var(--ink-3); padding: 2px 8px 6px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.facts { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 2px; }
.facts span { background: var(--paper-2); border-radius: 8px; padding: 3px 9px; font-size: 13.5px; color: var(--ink-2); }
.facts b { color: var(--ink); font-weight: 600; }
.approach { font-size: 14px; color: var(--ink-2); margin: 8px 0 0; }

.plist { list-style: none; margin: 12px 0 0; padding: 0; }
.plist li { border-top: 1px solid var(--line); }
.prob { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 2px; cursor: pointer; align-items: flex-start; }
.prob .num {
  width: 25px; height: 25px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--c); color: #fff; font: 700 14px/1 var(--cond); margin-top: 1px;
}
.prob .main { flex: 1; min-width: 0; }
.prob .name { font-weight: 600; font-size: 16.5px; }
.prob .meta { display: block; font-size: 13.5px; color: var(--ink-2); }
/* A climb's details grow open smoothly (grid 0fr -> 1fr) instead of popping in. */
.plist .more {
  display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows .32s var(--ease), opacity .22s ease, visibility 0s linear .32s;
}
.plist .more-in { min-height: 0; overflow: hidden; padding: 0 2px 0 37px; font-size: 14.5px; color: var(--ink-2); }
.plist li.on .more { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows .36s var(--ease), opacity .3s ease .05s, visibility 0s; }
.plist li.on .more-in { padding-bottom: 14px; }
.plist .more p { margin: 8px 0 0; }
.plist .more a { font-weight: 600; }
.plist li { transition: background-color .25s ease; }
.plist li.on { background: #fff7dc; }
.acts { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 2px; }

.betavids { margin-top: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 8px; }
.bvh { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; color: var(--ink); font-size: 15px; }
.bvh b { white-space: nowrap; }
.bvh svg { width: 16px; height: 16px; color: #c4302b; }
.bvh span { color: var(--ink-3); font-size: 13px; }
.vrow { display: flex; gap: 10px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: thin; }
.vid { flex: none; width: 168px; text-decoration: none; color: var(--ink); }
.vid img, .vid .noimg { width: 168px; height: 94px; border-radius: 8px; object-fit: cover; display: block; background: #2d2620; }
.vid .noimg { display: grid; place-items: center; color: #fff; }
.vid .noimg svg { width: 30px; height: 30px; }
.vid .vt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; font-weight: 600; line-height: 1.25; margin-top: 5px; }
.vid .vm { display: block; font-size: 12px; color: var(--ink-3); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.betavids .none { margin: 6px 0 0; color: var(--ink-3); }
.ysearch { display: inline-block; margin-top: 6px; font-size: 14px; }
.vnote { margin: 6px 0 0 !important; font-size: 12.5px; color: var(--ink-3); }

/* ------------------------------------------------------------------ lists */
#listpane { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(16px + var(--safe-b)); }
#listpane[hidden] { display: none; }
.lhead { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.lhead > div { flex: 1; min-width: 0; }
.lhead b { display: block; font: 700 17px/1.2 var(--cond); text-transform: uppercase; letter-spacing: .03em; }
.lhead .muted { font-size: 13.5px; }
.licon { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--paper-2); color: var(--ink-2); }
.licon svg { width: 20px; height: 20px; }
.licon.saved { background: #fff1d6; color: #b7791f; }
.chev { font-size: 24px; line-height: 1; color: var(--ink-3); flex: none; }
.lacts { margin-top: 9px; }
.pill.danger { color: #a61b1b; border-color: #f2c4c2; }
.pill.dlall { background: var(--g0); border-color: var(--g0); color: #fff; }
.llist { list-style: none; margin: 0; padding: 2px 14px 0; }
.llist > .empty { padding: 26px 6px; color: var(--ink-3); text-align: center; }
.lb { border-bottom: 1px solid var(--line); padding: 4px 0 8px; }
.lbh { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; padding: 8px 0 4px; cursor: pointer; }
.lbh .main, .lp .main { flex: 1; min-width: 0; }
.lbh .name { display: block; font: 700 17.5px/1.2 var(--cond); letter-spacing: .005em; }
.lbh .meta, .lp .meta { display: block; font-size: 13.5px; color: var(--ink-2); }
.lbh .dist { font-size: 12.5px; color: var(--ink-3); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lbh .dist b { display: block; color: var(--me); font-size: 14px; font-weight: 600; }
.pinno { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--ink); color: #fff; font: 700 15px/1 var(--cond); }
.lb ul { list-style: none; margin: 0; padding: 0 0 0 38px; }
.lb ul li { display: flex; align-items: center; }
.lp { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; padding: 6px 0; cursor: pointer; }
.lp .name { display: block; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm { border: 0; background: transparent; color: var(--ink-3); font-size: 22px; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; flex: none; }
.rm:hover { background: var(--paper-2); color: #a61b1b; }

/* Numbered pins for the open list (constant size, so they stay readable at any zoom). */
.lpin button {
  position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 8px));
  display: flex; align-items: center; justify-content: center; gap: 3px;
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 15px;
  background: var(--ink); color: #fff; border: 2px solid #fff; cursor: pointer;
  font: 700 15.5px/1 var(--cond); box-shadow: 0 2px 7px rgba(0, 0, 0, .35);
}
.lpin button::after { content: ""; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 6px solid transparent; border-top: 8px solid var(--ink); }
.lpin button i { font-style: normal; font-weight: 600; font-size: 12.5px; opacity: .8; }
#map.listmode .alabel { display: none; }

/* Add-to-list picker */
.pick { list-style: none; margin: 8px 0 4px; padding: 0; }
.pick li { border-top: 1px solid var(--line); }
.pick label { display: flex; align-items: center; gap: 11px; padding: 11px 2px; cursor: pointer; font-size: 16px; font-weight: 600; }
.pick input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.pick label > span:first-of-type { flex: 1; display: flex; align-items: center; gap: 8px; }
.pick svg { width: 18px; height: 18px; color: var(--ink-2); }
.newl { display: flex; gap: 8px; margin: 12px 0 4px; }
.newl input { flex: 1; min-width: 0; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px; font-size: 16px; }

/* ------------------------------------------------------------------ offline modal */
.modal { position: fixed; inset: 0; z-index: 1250; background: rgba(30, 24, 18, .45); display: grid; place-items: end center; }
.modal[hidden] { display: none; }
.modal .card {
  width: min(560px, 100%); max-height: 88dvh; overflow-y: auto; background: var(--paper);
  border-radius: 18px 18px 0 0; padding: 6px 18px calc(18px + var(--safe-b)); box-shadow: 0 -8px 30px rgba(0,0,0,.25);
}
.mhead { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--paper); padding: 8px 0 4px; }
.mhead h3 { margin: 0; font: 700 21px/1.1 var(--cond); letter-spacing: .03em; text-transform: uppercase; }
.x { border: 0; background: var(--paper-2); width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.modal .body { font-size: 15px; }
.modal h4 { font: 700 15px/1.2 var(--cond); text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 4px; color: var(--ink-2); }
.ostat { display: flex; gap: 12px; align-items: center; background: var(--paper-2); border-radius: 12px; padding: 12px; margin: 8px 0 10px; }
.ostat svg { width: 26px; height: 26px; flex: none; color: var(--ink-3); }
.ostat.ok { background: #e6f4ea; }
.ostat.ok svg { color: var(--g0); }
.ostat b { display: block; font-size: 16px; }
.ostat span { font-size: 13.5px; color: var(--ink-2); }
.ogrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; font-size: 14px; }
.ogrid ul { margin: 4px 0 0; padding-left: 18px; color: var(--ink-2); }
.ok { color: var(--g0); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.ok svg { width: 18px; height: 18px; }
svg.inl { width: 16px; height: 16px; vertical-align: -3px; }

/* iPhone home-screen installs with a translucent status bar: see fixStandaloneGap() in app.js. */
html.ios-gap, html.ios-gap body { height: 100vh; overflow: hidden; }
html.ios-gap body { position: relative; }
html.ios-gap #map, html.ios-gap .modal { position: absolute; }
html.ios-gap .sheet { position: absolute; bottom: 0; height: 88vh; transform: translateY(calc(88vh - var(--peek))); }
html.ios-gap .sheet[data-snap="half"] { transform: translateY(calc(88vh - 52vh)); }
html.ios-gap .sheet[data-snap="full"] { transform: translateY(0); }
html.ios-gap .sheet[data-snap="hidden"] { transform: translateY(calc(88vh - var(--mini))); }
html.ios-gap .topbar, html.ios-gap .mapbtns, html.ios-gap .toast { position: absolute; }


/* ================================================================== motion & polish
   Everything animates transform / opacity (cheap on phones). Easing is a soft spring. */
:root {
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);
  --shadow-1: 0 1px 2px rgba(45, 38, 32, .08), 0 4px 14px rgba(45, 38, 32, .10);
  --shadow-2: 0 2px 6px rgba(45, 38, 32, .10), 0 12px 32px rgba(45, 38, 32, .16);
}

/* Sheet: iOS-like spring between peek / half / full / minimized. */
.sheet {
  transition: transform .46s var(--spring);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .6) inset, 0 -8px 30px rgba(45, 38, 32, .16);
}
.handle span { transition: width .2s var(--ease), background-color .2s; }
.handle:active span { width: 52px; background: #b3a590; }

/* Panes slide: forward from the right, back from the left, quick fade when swapping. */
@keyframes pane-fwd { from { opacity: 0; transform: translate3d(26px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes pane-back { from { opacity: 0; transform: translate3d(-26px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes pane-swap { from { opacity: 0; transform: translate3d(0, 6px, 0); } to { opacity: 1; transform: none; } }
.enter-fwd { animation: pane-fwd .32s var(--ease) backwards; }
.enter-back { animation: pane-back .32s var(--ease) backwards; }
.enter-swap { animation: pane-swap .26s var(--ease) backwards; }

/* Tabs: a white pill slides under the selected tab. */
.tabs { position: relative; isolation: isolate; }
.tabs::before {
  content: ""; position: absolute; z-index: -1; top: 3px; bottom: 3px; left: 3px;
  width: calc((100% - 14px) / 3); border-radius: 8px; background: #fff;
  box-shadow: 0 1px 3px rgba(45, 38, 32, .14);
  transform: translateX(calc(var(--tab-i, 0) * (100% + 4px)));
  transition: transform .38s var(--spring);
}
.tabs button { position: relative; transition: color .2s ease; }
.tabs button[aria-selected="true"] { background: transparent; box-shadow: none; }

/* Press feedback: everything tappable gives a little. */
.pill, .fab, .chip, .back, .acct, .x, .alabel button, .lpin button, .vid, .rm, .link {
  transition: transform .14s var(--ease), background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.pill:active, .fab:active, .chip:active, .back:active, .acct:active, .x:active, .rm:active { transform: scale(.95); }
.vid:active { transform: scale(.97); }
.alabel button:active { transform: translate(-50%, calc(-50% + var(--dy, 0px))) scale(.95); }
.list .item, .prob, .lbh, .lp { transition: background-color .18s ease; -webkit-tap-highlight-color: transparent; }
.list .item:active, .lbh:active, .lp:active { background: var(--paper-2); }
.prob:active { background: rgba(45, 38, 32, .04); }

/* Floating chrome: softer layered shadows, crisper borders. */
.brand, .fab, .locstatus { box-shadow: var(--shadow-1); border-color: rgba(45, 38, 32, .08); }
.fab.on { box-shadow: 0 4px 14px rgba(29, 111, 209, .35); }
.alabel button { box-shadow: var(--shadow-1); }
.lpin button { box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }

/* Search: lifts and glows while you type. */
.search { transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
.search:focus-within { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 111, 209, .14); }

/* Little things pop in. */
@keyframes pop-in { from { opacity: 0; transform: translate3d(0, -6px, 0) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-up { from { transform: translate3d(0, 40px, 0); opacity: .4; } to { transform: none; opacity: 1; } }
.inpick:not([hidden]), .acctmenu:not([hidden]) { animation: pop-in .26s var(--ease) backwards; }
.acctmenu { box-shadow: var(--shadow-2); border-color: rgba(45, 38, 32, .08); transform-origin: top right; }
.toast { animation: toast-in .3s var(--spring) backwards; }
.toast.leaving { opacity: 0; transform: translate(-50%, -8px); transition: opacity .2s ease, transform .2s ease; }
.modal:not([hidden]) { animation: fade-in .22s ease backwards; }
.modal:not([hidden]) .card { animation: card-up .42s var(--spring) backwards; }

/* Detail drawing and video cards. */
.art { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); }
.vid img { transition: box-shadow .2s ease; box-shadow: 0 2px 8px rgba(45, 38, 32, .14); }
.grade { box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12); }
.chip[aria-pressed="true"] { box-shadow: 0 2px 8px color-mix(in srgb, var(--c) 35%, transparent); }
.where .arrow { transition: transform .5s var(--spring); }

/* ------------------------------------------------------------------ ticks */
.pill.tick.on { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.pill.tick.on svg { color: #fff; }
.mark.ticked { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #2e7d32; color: #fff; vertical-align: -3px; }
.mark.ticked svg { width: 12px; height: 12px; }
.tickpanel { margin-top: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; background: #eef7ee; border: 1px solid #cfe5cf; border-radius: 12px; padding: 9px 12px; }
.tickpanel:not([hidden]) { animation: pop-in .26s var(--ease) backwards; }
.tickdate { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #1f5e23; margin-right: auto; }
.tickdate span { display: inline-flex; align-items: center; gap: 4px; }
.tickdate span svg { width: 17px; height: 17px; }
.tickdate input { font: 600 16px var(--sans); color: var(--ink); background: #fff; border: 1px solid #cfe5cf; border-radius: 9px; padding: 6px 9px; min-height: 38px; }
.tickpanel .link { font-weight: 600; }
.tickpanel .link.danger { color: #a61b1b; }
.licon.ticks { background: #2e7d32; color: #fff; }
.lp .sent { display: inline-flex; align-items: center; gap: 2px; color: #2e7d32; font-weight: 600; }
.lp .sent svg { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ add to home screen */
.installnudge {
  position: fixed; z-index: 1150; left: 12px; right: 70px; top: calc(70px + var(--safe-t)); max-width: 440px;
  display: flex; align-items: center; gap: 11px; text-align: left; cursor: pointer; color: inherit; font: inherit;
  background: var(--paper); border: 1px solid rgba(45, 38, 32, .1); border-radius: 16px; padding: 10px 10px 10px 10px;
  box-shadow: var(--shadow-2); animation: pop-in .4s var(--spring) backwards;
}
.installnudge[hidden] { display: none; }
.installnudge img { width: 42px; height: 42px; border-radius: 10px; flex: none; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.installnudge .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.installnudge .t b { font-size: 14.5px; line-height: 1.2; }
.installnudge .t span { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.installnudge .go { flex: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; border-radius: 999px; padding: 8px 13px; }
.installnudge .later { flex: none; width: 30px; height: 30px; display: grid; place-items: center; font-size: 22px; color: var(--ink-3); border-radius: 50%; }
.installnudge:active { transform: scale(.985); }

.installguide { position: fixed; inset: 0; z-index: 1300; background: rgba(30, 24, 18, .55); display: flex; flex-direction: column; justify-content: center; padding: calc(16px + var(--safe-t)) 14px calc(16px + var(--safe-b)); animation: fade-in .22s ease backwards; }
.installguide[hidden] { display: none; }
.installguide[data-arrow="bottom-right"], .installguide[data-arrow="bottom"] { justify-content: flex-start; padding-top: calc(70px + var(--safe-t)); }
.installguide[data-arrow="top-right"] { justify-content: flex-end; padding-bottom: calc(40px + var(--safe-b)); }
.igcard { width: 100%; max-width: 440px; margin: 0 auto; background: var(--paper); border-radius: 20px; padding: 16px 16px 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); animation: card-up .45s var(--spring) backwards; }
.ighead { display: flex; align-items: center; gap: 12px; }
.ighead > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ighead b { font: 700 21px/1.1 var(--cond); }
.ighead span { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.igapp img { width: 50px; height: 50px; border-radius: 12px; display: block; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.igsteps { list-style: none; margin: 14px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.igsteps li { display: flex; align-items: center; gap: 11px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; animation: pop-in .4s var(--ease) backwards; animation-delay: calc(120ms + var(--d)); }
.ignum { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 14px/24px var(--cond); text-align: center; }
.igicon { flex: none; width: 38px; height: 38px; border-radius: 10px; background: #e8f0fb; color: var(--accent); display: grid; place-items: center; }
.igicon svg { width: 22px; height: 22px; }
.igtext { font-size: 15.5px; line-height: 1.3; }
.igdone { width: 100%; justify-content: center; min-height: 46px; font-size: 16px; }
.igarrow { position: fixed; width: 40px; height: 56px; color: #fff; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); display: none; pointer-events: none; }
.igarrow svg { width: 100%; height: 100%; }
@keyframes ig-down { 0%, 100% { transform: translateY(-6px); } 50% { transform: translateY(8px); } }
@keyframes ig-up { 0%, 100% { transform: rotate(180deg) translateY(-6px); } 50% { transform: rotate(180deg) translateY(8px); } }
.installguide[data-arrow="bottom-right"] .igarrow { display: block; right: 14px; bottom: calc(6px + var(--safe-b)); animation: ig-down 1.1s ease-in-out infinite; }
.installguide[data-arrow="bottom"] .igarrow { display: block; left: calc(50% - 20px); bottom: calc(6px + var(--safe-b)); animation: ig-down 1.1s ease-in-out infinite; }
.installguide[data-arrow="top-right"] .igarrow { display: block; right: 14px; top: calc(6px + var(--safe-t)); animation: ig-up 1.1s ease-in-out infinite; }

/* ------------------------------------------------------------------ desktop */
@media (min-width: 900px) {
  .sheet {
    top: 12px; left: 12px; bottom: 12px; right: auto; width: var(--sheet-w); height: auto;
    border-radius: 16px; transform: none !important; box-shadow: 0 4px 24px rgba(45,38,32,.2);
  }
  .handle { display: none; }
  .controls { padding-top: 14px; }
  .dhead { padding-top: 14px; }
  .topbar { left: calc(var(--sheet-w) + 24px); }
  #map .leaflet-control-container .leaflet-bottom.leaflet-left { left: calc(var(--sheet-w) + 12px); }
  .modal { place-items: center; }
  .modal .card { border-radius: 18px; }
}
@media (max-width: 899px) {
  .leaflet-bottom { bottom: calc(178px + var(--safe-b)); }
  body.sheet-hidden .leaflet-bottom { bottom: calc(26px + var(--safe-b)); }
}
@media (max-width: 440px) {
  .acct:not(.in) { width: 34px; padding: 0; justify-content: center; }
  .acct:not(.in) span { display: none; }
}
@media (max-width: 380px) {
  .brand .sub { font-size: 12px; }
  .ogrid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .me-dot::after { animation: none; }
}
