/*
 * The public website.
 *
 * Hand-written and linked directly, like admin.css — no build step.
 *
 * The first half is the component base of the "eCrag Web" design, class for
 * class and under the design's own names: tokens, type (t-*), controls (btn,
 * chip, input, ava), containers (card, li, cells, media) and the app chrome
 * (hdr, mbar). A screen is assembled from these, so before writing a new
 * class, look for the one the design already has. The design's artboards
 * switch layout with container queries; here they are media queries with the
 * same widths, and its `cqi` units are `vw`.
 *
 * The second half is what the design draws inline or does not draw at all:
 * the topo, the gate over a locked photo, the download menu, forms.
 */

:root {
    --ink: #141118; --ink-2: rgba(20, 17, 24, 0.8); --muted: rgba(20, 17, 24, 0.66);
    --line: rgba(20, 17, 24, 0.12); --line-2: rgba(20, 17, 24, 0.08); --line-strong: rgba(20, 17, 24, 0.22);
    --surface: #FFFFFF; --surface-2: #F3F2EF; --hover: rgba(20, 17, 24, 0.04);
    --accent: #FF8A3D; --accent-hover: #F47A2C; --accent-strong: #E0611A; --accent-ink: #B04A10;
    /* Grade bands. The amber is darkened from the app's to read as text on white. */
    --g-green: #2E7D5B; --g-amber: #9A6700; --g-red: #C42A18;
    --f-sans: Archivo, system-ui, sans-serif; --f-mono: 'IBM Plex Mono', ui-monospace, monospace;
    --r-sm: 10px; --r-md: 14px; --r-lg: 18px;
    --shadow-pop: 0 20px 50px rgba(20, 17, 24, 0.2);
    --night: #101216;
    /* Under the map while its tiles load: the sea of the design's map. */
    --map-ground: #1C3550;

    /* The disciplines in the app's colours. */
    --boulder: #E11D2A;
    --sport: #0A6CF0;
    --trad: #E67A00;
    --dws: #0E9FA6;
    --buildering: #7A5AF8;

    /* Grounds and text on dark: the scrims over photos, the app block, the eyebrow. */
    --ink-deep: #0B0B0C;
    --on-dark: #FFFFFF; --on-dark-soft: #F2F4F7; --on-dark-muted: rgba(242, 244, 247, 0.78);
    --scrim-strong: rgba(16, 18, 22, 0.75); --scrim: rgba(16, 18, 22, 0.6); --scrim-soft: rgba(16, 18, 22, 0.55); --veil: rgba(16, 18, 22, 0.35);
    --glass: rgba(255, 255, 255, 0.94); --glass-edge: rgba(255, 255, 255, 0.6); --glass-edge-soft: rgba(255, 255, 255, 0.2);

    /* Ink at the strengths the design uses for chrome, controls and edges. */
    --fill: rgba(20, 17, 24, 0.05);
    --line-bar: rgba(20, 17, 24, 0.1); --line-control: rgba(20, 17, 24, 0.14); --line-chip: rgba(20, 17, 24, 0.16); --line-hover: rgba(20, 17, 24, 0.4); --line-pressed: rgba(20, 17, 24, 0.55);
    --ink-icon: rgba(20, 17, 24, 0.6); --ink-nav: rgba(20, 17, 24, 0.7); --ink-label: rgba(20, 17, 24, 0.72); --ink-bar: rgba(20, 17, 24, 0.78);
    --star-empty: rgba(20, 17, 24, 0.3);
    --surface-warm: #F7F6F3;

    /* The topo, and the accent on dark. */
    --topo-line: rgba(255, 138, 61, 0.95); --accent-press: rgba(255, 138, 61, 0.9); --accent-glow: rgba(255, 138, 61, 0.35); --accent-soft: rgba(255, 138, 61, 0.55);
    --accent-on-dark: #FFB27F;
    --marker-shadow: rgba(0, 0, 0, 0.4);

    /* A form's refusal. */
    --error-line: rgba(196, 42, 24, 0.35); --error-fill: rgba(196, 42, 24, 0.06);

    /* The about page draws disciplines and the middle grade tier in flat
       colours of its own, as the design does there. */
    --flat-boulder: #E0402A; --flat-sport: #2F6FE0; --flat-trad: #FF8A3D; --flat-buildering: #8A4FD8; --flat-dws: #1FB5C9;
    --tier-mid: #E8A317;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--surface); font-family: var(--f-sans); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* ---------- type ---------- */
.t-display { margin: 0; font: 900 64px/0.88 var(--f-sans); letter-spacing: -0.045em; text-transform: uppercase; }
.t-h1 { margin: 0; font: 800 clamp(30px, 3.2vw, 44px)/1 var(--f-sans); letter-spacing: -0.035em; }
.t-h2 { margin: 0; font: 800 clamp(22px, 2.2vw, 28px)/1.05 var(--f-sans); letter-spacing: -0.02em; }
.t-h3 { margin: 0; font: 700 17px/1.15 var(--f-sans); letter-spacing: -0.01em; }
.t-item { font: 600 14.5px/1.2 var(--f-sans); }
.t-body { margin: 0; font: 400 15px/1.55 var(--f-sans); color: var(--ink-2); text-wrap: pretty; }
.t-lead { margin: 0; font: 400 17px/1.5 var(--f-sans); color: var(--ink-2); text-wrap: pretty; }
.t-label { margin: 0; font: 500 9.5px/1.2 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.t-meta { font: 400 10.5px/1.35 var(--f-mono); letter-spacing: 0.06em; color: var(--muted); }
.t-mono { font: 600 10px/1 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; }
.t-grade { font: 600 12px/1 var(--f-mono); }
.t-trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eyebrow { display: inline-block; font: 600 10px/1 var(--f-mono); letter-spacing: 0.14em; background: var(--ink-deep); color: var(--on-dark-soft); padding: 5px 8px; }
.pill-tag { flex: none; display: inline-block; font: 600 9.5px/1 var(--f-mono); letter-spacing: 0.1em; padding: 6px 9px; border-radius: 12px; background: var(--fill); border: 1px solid var(--line); color: var(--ink); }
.pill-tag.acc { background: var(--accent); border-color: var(--accent); }
.link-arrow { font: 600 9.5px/1 var(--f-mono); letter-spacing: 0.12em; color: var(--ink); }
.link-arrow:hover { color: var(--accent-ink); }
.link-u { font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
a.link-plain:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none; height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent; font: 600 10.5px/1 var(--f-mono); letter-spacing: 0.12em; white-space: nowrap; color: var(--ink); cursor: pointer; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }
.btn-outline { background: var(--surface); border-color: var(--ink); }
.btn-outline:hover, .btn-soft:hover, .btn-ghost:hover { background: var(--hover); }
.btn-soft { background: var(--fill); border-color: var(--line); }
.btn-ghost { color: var(--ink-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 9.5px; border-radius: 9px; }
.btn-lg { height: 52px; border-radius: 12px; font-size: 11px; letter-spacing: 0.14em; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-control); display: flex; align-items: center; justify-content: center; }
a.icon-btn:hover, button.icon-btn:hover { background: var(--hover); }
.icon-btn.sm { width: 34px; height: 34px; background: var(--fill); border-color: var(--line); }
.icon-btn.lg { width: 44px; height: 44px; }
.icon-btn.acc { background: var(--accent); border-color: var(--accent); }
.icon-btn.ink { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-chip); font: 600 9.5px/1 var(--f-mono); letter-spacing: 0.1em; color: var(--ink); }
a.chip:hover { background: var(--hover); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.input { width: 100%; height: 48px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); padding: 0 14px; font: 400 15px/1 var(--f-sans); }
.field-label { display: block; margin-bottom: 8px; font: 600 9.5px/1 var(--f-mono); letter-spacing: 0.14em; color: var(--ink-label); }
.ava { width: 32px; height: 32px; flex: none; border-radius: 50%; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line-control); display: flex; align-items: center; justify-content: center; font: 600 10px/1 var(--f-mono); }
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava.lg { width: 36px; height: 36px; }

/* ---------- containers ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
a.card:hover { border-color: var(--line-hover); }
.card-pad { padding: 20px; }
.head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; }
.sec { margin-top: clamp(40px, 4.6vw, 64px); }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.li.inset { padding: 12px 20px; }
a.li:hover { background: var(--hover); }
.li-main { flex: 1; min-width: 0; }
.li-main .t-meta { display: block; margin-top: 5px; }
.cells { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.cells > * { background: var(--surface); }
.cell { padding: 14px 12px; min-width: 0; }
.cell-l { font: 500 8.5px/1.2 var(--f-mono); letter-spacing: 0.1em; color: var(--muted); }
.cell-v { margin-top: 7px; font: 700 clamp(14px, 1.4vw, 17px)/1 var(--f-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-v.acc { color: var(--accent-ink); }
.cell-v .t-grade { font: inherit; }
.c1 { grid-template-columns: minmax(0, 1fr); }
.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.media { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--night); }
.media > img, .media > a > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.media.sm { border-radius: var(--r-sm); }
.on-img { position: absolute; padding: 6px 10px; border-radius: 12px; background: var(--scrim-strong); font: 600 9.5px/1 var(--f-mono); letter-spacing: 0.1em; color: var(--on-dark); }
.on-img.corner { left: 14px; bottom: 14px; }
.pop { position: absolute; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-control); box-shadow: var(--shadow-pop); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; font: 600 10px/1 var(--f-mono); letter-spacing: 0.12em; color: var(--muted); }
.crumbs a:hover, .crumbs [aria-current] { color: var(--ink); }
.swatch { width: 9px; height: 9px; flex: none; border-radius: 2px; }
.bar-seg { height: 8px; border-radius: 4px; overflow: hidden; display: flex; gap: 2px; }
.bar-seg > * { flex-basis: 0; min-width: 4px; }

/* ---------- app chrome ---------- */
.hdr { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 0 32px; min-height: 64px; border-bottom: 1px solid var(--line-bar); background: var(--surface); }
.hdr form { display: flex; }
.logo { font: 800 17px/1 var(--f-sans); letter-spacing: 0.16em; }
.hdr-nav { display: flex; gap: 4px; }
.nav-a { height: 34px; padding: 0 14px; border-radius: 17px; display: flex; align-items: center; justify-content: center; font: 600 10.5px/1 var(--f-mono); letter-spacing: 0.14em; color: var(--ink-nav); }
.nav-a:hover { background: var(--fill); }
.nav-a.on { background: var(--ink); color: var(--on-dark); }
.hdr-sp { flex: 1; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 32px 40px 56px; }
.mbar, .show-sm { display: none; }
.mbar { height: 56px; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line-bar); background: var(--surface); }
.mbar form { display: flex; }
.mbar-title { flex: 1; min-width: 0; font: 600 13px/1 var(--f-mono); letter-spacing: 0.12em; color: var(--ink-bar); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot { border-top: 1px solid var(--line-bar); }
.foot .wrap { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.foot-nav { flex: 1; display: flex; flex-wrap: wrap; gap: 12px 24px; font-weight: 500; color: var(--muted); }
.foot-nav a:hover { color: var(--ink); }
/* The login pages end in a shorter one, centred. */
.foot.short { padding: 18px 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; color: var(--muted); }
.foot.short a:hover { color: var(--ink); }

/* ---------- page layouts ---------- */
.g-detail { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: stretch; }
.g-detail > figure { display: flex; flex-direction: column; min-width: 0; }
.g-detail.solo { grid-template-columns: minmax(0, 720px); }
.g-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.topo-ar, .crag-ar { flex: 1 1 auto; aspect-ratio: 4 / 3; }
.push { margin-top: auto; }

/* ====================================================================
   What the design draws inline, or does not draw.
   ==================================================================== */

/* Grades and disciplines */
.t-grade.easy { color: var(--g-green); }
.t-grade.mid { color: var(--g-amber); }
.t-grade.hard { color: var(--g-red); }
.t-grade.unknown { color: var(--muted); }
.t-grade.xl { font-size: 24px; font-weight: 700; }
.disc-boulder { background: var(--boulder); }
.disc-sport { background: var(--sport); }
.disc-trad { background: var(--trad); }
.disc-dws { background: var(--dws); }
.disc-buildering { background: var(--buildering); }
.stars { display: inline-flex; gap: 2px; }
.stars svg { display: block; fill: none; stroke: var(--star-empty); }
.stars svg.on { fill: var(--accent-strong); stroke: var(--accent-strong); }
.legend { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.legend li { display: flex; align-items: center; gap: 7px; font-size: 10.5px; letter-spacing: 0.06em; }
.legend span:last-child { font-weight: 400; color: var(--muted); }

/* Columns of a list that reads as a table */
.col-grade { width: 44px; flex: none; }
.col-wide { width: 150px; flex: none; }
.col-num { width: 70px; flex: none; text-align: right; }
.col-num .stars { justify-content: flex-end; }
.col-chev { width: 8px; flex: none; color: var(--muted); }
.list { overflow: hidden; }
.list > .li:first-child { border-top: 0; }
.list-head { font-size: 8.5px; }
.pages { justify-content: space-between; }
.pages span { color: var(--muted); }

/* The crag gallery: thumbnails are links, since nothing here switches photos */
.gallery { gap: 6px; }
.thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.thumbs .media { aspect-ratio: 4 / 3; }
.thumbs .more { position: absolute; inset: 0; background: var(--scrim-soft); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--on-dark); }

/* The "Download the app" menu: <details>, so it opens without a script */
.dl { position: relative; z-index: 20; flex: none; }
.dl summary { list-style: none; }
.dl summary::-webkit-details-marker { display: none; }
.dl .pop { right: 0; top: calc(100% + 8px); width: min(280px, calc(100vw - 32px)); }
.dl .li { border: 0; padding: 10px; border-radius: var(--r-sm); }
.dl .icon-btn { border-radius: var(--r-sm); }
.store { display: block; margin-top: 5px; font: 700 16px/1.1 var(--f-sans); }

/* A route's photo. For a member: the whole photo fitted into the frame, the
   line and the points laid over the photo itself — they are fractions of it,
   so the photo is never cropped. */
.topo-fit { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; container-type: size; }
.topo-box { position: relative; display: block; line-height: 0; }
.topo-box > img { display: block; width: auto; height: auto; max-width: 100cqw; max-height: 100cqh; }
.topo-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.topo-line polyline { fill: none; stroke: var(--topo-line); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 7 6; vector-effect: non-scaling-stroke; }
.pt { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; background: var(--scrim-soft); border: 1.5px solid var(--glass-edge); box-shadow: 0 3px 10px var(--marker-shadow); display: flex; align-items: center; justify-content: center; font: 700 11px/1 var(--f-mono); color: var(--on-dark-soft); }
.pt.top { width: 34px; height: 34px; }
.pt.start { border-color: var(--accent); }
.pt.photo { background: var(--scrim); border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-glow), 0 3px 10px var(--marker-shadow); }
.pt.photo:hover { background: var(--accent-press); color: var(--ink); }
/* On a spot's photo: the number of each line at its start, a link to its
   route. */
.pt.n { color: var(--on-dark); }
a.pt.n:hover { background: var(--accent-press); color: var(--ink); }
.pt-cam { position: absolute; right: -6px; bottom: -6px; width: 17px; height: 17px; border-radius: 9px; background: var(--accent); border: 1.5px solid var(--ink-icon); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.on-img.legend-photo { left: 12px; bottom: 12px; display: flex; align-items: center; gap: 8px; }
.ring { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.on-img.full { top: 12px; right: 12px; width: 40px; height: 40px; padding: 0; border-radius: 50%; background: var(--scrim); border: 1px solid var(--glass-edge-soft); display: flex; align-items: center; justify-content: center; }
.topos { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* A spot's photos, one under another, each in a frame of its own rather
   than one stretched to the height of the list beside it. */
.g-detail > .topos.many { align-self: start; }
.topos.many > .topo-ar { flex: none; }
/* A route's own photos: the frame takes the photo's shape, so there are no
   bars around it and nothing is cut off — as wide as the column, unless a
   tall photo would run past the screen, and then narrower. The column
   beside it is as long as it needs: the two are not stretched to match. */
.g-detail.align-start { align-items: start; }
.topo-shape { width: fit-content; max-width: 100%; margin: 0 auto; cursor: zoom-in; }
.topo-shape .topo-box > img { max-width: 100%; max-height: min(80vh, 760px); }
/* The same photo opened large, fitted whole into 90% of the screen; the
   page's script gives the copy the photo's shape as --ar. */
.topo-view { width: 90vw; height: 90vh; max-width: none; max-height: none; padding: 0; border: 0; border-radius: var(--r-lg); background: var(--night); overflow: hidden; }
.topo-view::backdrop { background: var(--scrim-strong); }
.topo-view .topo-fit { inset: 16px; }
.topo-view .topo-box { width: min(100cqw, calc(100cqh * var(--ar, 1.333))); }
.topo-view .topo-box > img { width: 100%; max-width: none; max-height: none; }
.topo-view .on-img.full { font: 400 22px/1 var(--f-sans); }
html:has(.topo-view[open]) { overflow: hidden; }

/* Figures that share each row between those there are, so that one left
   out leaves no empty cell. */
.cells.flow { display: flex; flex-wrap: wrap; }
.cells.flow > * { flex: 1 1 calc(33.333% - 1px); }

/* For everybody else: the photo under a blur, and the gate over it */
.media > img.blurred { filter: blur(22px) saturate(0.9); transform: scale(1.15); }
.veil { position: absolute; inset: 0; background: var(--veil); }
.gate { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; }
.gate .card { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 300px; padding: 22px 26px; border-radius: var(--r-lg); background: var(--glass); box-shadow: var(--shadow-pop); text-align: center; }
.gate .t-h3 { font-size: 20px; }
.gate .t-body { font-size: 13.5px; line-height: 1.45; }
/* In a panel on the map: smaller, and without the line of text. */
.gate.compact { padding: 12px; }
.gate.compact .card { gap: 10px; padding: 16px 20px; }
.gate.compact .icon-btn.lg { width: 36px; height: 36px; }
.gate.compact .t-h3 { font-size: 16px; }
.locked { position: relative; margin-top: 12px; }
.locked > p { filter: blur(5px); user-select: none; pointer-events: none; }
.locked > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* Forms */
.auth { max-width: 420px; margin: 0 auto; padding: clamp(8px, 5vw, 64px) 0 clamp(16px, 5vw, 64px); }
.or { margin: 22px 0; display: flex; align-items: center; gap: 12px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.alert { margin-top: 20px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--error-line); background: var(--error-fill); font: 400 14px/1.45 var(--f-sans); color: var(--g-red); }
.alert p + p { margin-top: 6px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.pw { position: relative; }
.pw .input { padding-right: 76px; }
.pw .btn { position: absolute; right: 8px; top: 8px; }
.help summary { list-style: none; cursor: pointer; color: var(--accent-ink); }
.help summary::-webkit-details-marker { display: none; }
.help[open] { flex-basis: 100%; order: 2; }
.help[open] summary { display: none; }
.help p { margin: 0 0 10px; font-size: 12.5px; line-height: 1.45; }

/* ---------- widths ---------- */
@media (max-width: 1000px) {
    .g-detail { grid-template-columns: minmax(0, 1fr); }
    /* Five sections, the menu, the avatar and LOG OUT fit one row at 834. */
    .hdr { column-gap: 12px; }
    .nav-a { padding: 0 12px; }
}

@media (max-width: 860px) {
    .g-2 { grid-template-columns: minmax(0, 1fr); }
    .wrap { padding: 24px 24px 48px; }
}

/* Phone: mirror the eCrag app — top bar, full-bleed content. */
@media (max-width: 640px) {
    .hdr { flex-wrap: nowrap; min-height: 56px; padding: 0 18px; gap: 8px; }
    .hdr-nav, .hdr-detail { display: none !important; }
    /* The design reaches the profile through a tab bar this site does not
       have yet, so the avatar stays in the phone's header. */
    .hdr-avatar .ava { width: 34px; height: 34px; }
    .hdr .btn-primary { width: 34px; height: 34px; border-radius: 17px; padding: 0; }
    .mbar { display: flex; }
    .hide-sm { display: none !important; }
    .show-sm { display: flex; }
    .wrap { padding: 12px 16px 28px; }
    .foot .wrap { padding-top: 22px; padding-bottom: 28px; }
    .crumbs { display: none; }
    .c3.sm2, .c4.sm2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .c3.m4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .cells.m-plain { background: transparent; border: 0; border-radius: 0; gap: 0; }
    .cells.m-plain > * { background: transparent; padding-left: 0; }
    .m-bleed { margin-left: -16px !important; margin-right: -16px !important; border-radius: 0 !important; border-left: 0 !important; border-right: 0 !important; }
    .m-nob { border-bottom: 0 !important; }
    .m-flat { border: 0 !important; border-radius: 0 !important; padding-left: 0 !important; padding-right: 0 !important; background: transparent !important; }
    .m-bleed .li.inset { padding-left: 16px; padding-right: 16px; }
    .topo-ar { aspect-ratio: auto; height: 437px; }
    .topo-shape { width: auto; max-width: none; }
    .topo-shape .topo-box > img { width: 100%; max-height: none; }
    /* Without a frame a short last row may keep to the columns above it. */
    .cells.flow > * { flex-basis: calc(25% - 1px); }
    .cells.flow.m-plain > * { flex-grow: 0; }
    .crag-ar { aspect-ratio: auto; height: 300px; border-radius: 0; }
    .cards { display: flex; overflow-x: auto; gap: 12px; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
    .cards::-webkit-scrollbar { display: none; }
    .cards > * { flex: 0 0 72%; scroll-snap-align: start; }
    .col-wide { width: 110px; }
}

/* Small joins between components */
.pill-tag + .t-h1 { margin-top: 14px; }
.t-h1 + .t-meta { display: block; margin-top: 12px; letter-spacing: 0.1em; }
.t-meta a:hover { color: var(--ink); }
.blk > :nth-child(2) { margin-top: 12px; }
.card.li { padding: 14px 16px; border-radius: var(--r-md); border-top: 1px solid var(--line); }
.card.li .t-item { display: block; font-size: 15px; }
.li-main > .t-item { display: block; }
.title-row { display: flex; align-items: baseline; gap: 12px; }
.sec > .list, .sec > .cards { margin-top: 16px; }
.group { margin-top: 32px; }
.group > .list { margin-top: 12px; }
.note { margin-top: 14px; }
.dl .note { margin: 6px 10px 4px; font-size: 9.5px; letter-spacing: 0.08em; }
.dl .t-meta { font-size: 9.5px; letter-spacing: 0.08em; }
.headline { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.headline .t-meta { letter-spacing: 0.1em; }
.val { min-width: 0; text-align: right; overflow-wrap: anywhere; line-height: 1.4; }
.foot-year { font-weight: 500; color: var(--muted); }
.hdr-hint { font: 400 12px/1 var(--f-mono); color: var(--muted); }

/* A sector card on a crag page, and the three cards under a gym */
.cards .card-pad { display: flex; flex-direction: column; gap: 12px; }
.bar-seg.thin { height: 5px; }
.cards.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
.cards.wide .card-pad { gap: 0; }
@media (max-width: 640px) {
    .cards.wide { display: grid; overflow: visible; margin: 0; padding: 0; gap: 36px; }
    .cards.wide.sec { margin-top: 36px; }
}

/* Login and nickname */
.auth-title { margin-top: 18px; font-size: clamp(40px, 4.4vw, 56px); line-height: 0.9; }
.auth .form { margin-top: 28px; }
.auth .stack { gap: 16px; }
.auth .btn-block { margin-top: 8px; }
.cells-free { margin-top: 28px; display: grid; gap: 8px; }
.foot-note { margin-top: 22px; text-align: center; font-size: 14px; }
.t-meta .style { color: var(--accent-ink); }

/* ---------- home ---------- */
.search { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px; border-radius: 20px; background: var(--hover); border: 1px solid var(--line); color: var(--ink-icon); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: 400 13px/1 var(--f-sans); color: var(--ink); }
.search.lg { flex: 1; min-width: 0; height: 56px; border-radius: var(--r-md); border: 1.5px solid var(--ink); background: var(--surface); padding: 0 18px; }
.search.lg input { font-size: 16px; }
.search:focus-within { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.g-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-top: clamp(8px, 2vw, 24px); }
.g-hero.solo { grid-template-columns: minmax(0, 720px); }
.hero-text { min-width: 0; }
.hero-title { margin-top: 22px; font-size: clamp(44px, 6.2vw, 92px); }
.t-display .acc { color: var(--accent-strong); }
.hero-text .t-lead { margin-top: 20px; max-width: 500px; }
.hero-search { margin-top: 26px; display: flex; gap: 8px; max-width: 540px; }
.hero-search .btn { height: 56px; }
.hero-text .chips { margin-top: 14px; }
.hero-media { display: block; aspect-ratio: 4 / 3; border-radius: 20px; }
.hero-open { position: absolute; left: 14px; right: 14px; bottom: 14px; height: 48px; align-items: center; border-radius: 12px; background: var(--surface); padding: 0 16px; font-size: 10.5px; }
.cells.big .cell-v { font-size: clamp(22px, 2.4vw, 32px); }
.crag-card { display: block; overflow: hidden; }
.crag-card .media { aspect-ratio: 4 / 3; border-radius: 0; }
.crag-card-body { padding: 14px 16px 16px; }
.crag-card-body .t-meta { margin-top: 6px; font-size: 9.5px; }
.crag-card-body .bar-seg { margin-top: 12px; }
.crag-card-body .head { margin-top: 8px; font-size: 10px; }
.t-h2.sm { font-size: 22px; }
.band-chips { margin: 14px 0 12px; }
.g-2 > .card { min-width: 0; display: flex; flex-direction: column; }
.send { display: block; font-size: 14px; line-height: 1.3; }
.send b { font-weight: 600; color: var(--ink); }
.sends-more { justify-content: space-between; padding-top: 14px; }
.app-block { border-radius: 20px; background: var(--ink); color: var(--on-dark-soft); padding: clamp(24px, 4vw, 48px); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.app-text { flex: 1 1 360px; min-width: 0; }
.app-eyebrow { color: var(--accent-on-dark); }
.app-block .t-display { margin-top: 14px; font-size: clamp(30px, 4vw, 56px); line-height: 0.92; }
.app-block .t-body { margin-top: 14px; max-width: 460px; color: var(--on-dark-muted); }
.stores { display: flex; flex-wrap: wrap; gap: 8px; }
.stores .btn { flex-direction: column; align-items: flex-start; gap: 4px; height: 56px; border-color: var(--on-dark); }
.stores .t-meta { font-size: 9px; }
.stores .store { margin: 0; font-size: 17px; line-height: 1; letter-spacing: 0; }
.about-line { margin-top: 28px; font-size: 14px; }

/* ---------- about us ---------- */
/* Left and right only: a section here is spaced from the one above by .sec. */
.lp-wrap { max-width: 1320px; margin-left: auto; margin-right: auto; padding-left: clamp(16px, 3.4vw, 48px); padding-right: clamp(16px, 3.4vw, 48px); }
.about-hero { padding-top: clamp(48px, 8vw, 112px); }
.about-hero .t-display { font-size: clamp(54px, 13vw, 188px); line-height: 0.86; }
.about-mark { display: flex; align-items: baseline; gap: 12px; margin-bottom: 32px; }
.about-mark .t-h3 { font-size: 15px; }
.about-mark .t-label { font-size: 11px; }
.about-hero .about-mark { align-items: center; margin-bottom: clamp(28px, 3.4vw, 48px); }
.about-intro { display: flex; flex-wrap: wrap; gap: clamp(24px, 4vw, 64px); padding-top: clamp(24px, 4vw, 64px); }
.about-intro .about-mark { flex: 1 1 240px; }
.about-intro .stack { flex: 2 1 420px; gap: 24px; }
.about-lead { font: 600 clamp(22px, 2.7vw, 38px)/1.18 var(--f-sans); letter-spacing: -0.02em; text-wrap: pretty; }
.about-text { max-width: 720px; font: 400 12.5px/1.6 var(--f-mono); color: var(--muted); text-wrap: pretty; }
.about-intro .about-text { font-size: 13px; line-height: 1.7; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); border-top: 1px solid var(--ink-deep); border-left: 1px solid var(--ink-deep); }
.feature { border-right: 1px solid var(--ink-deep); border-bottom: 1px solid var(--ink-deep); padding: 28px 24px 30px; display: flex; flex-direction: column; gap: 14px; min-height: 230px; }
.feature:hover { background: var(--surface-warm); }
.feature .t-h2 { margin-top: auto; font-size: clamp(22px, 2vw, 27px); }
.pill-tag.square { border-radius: 0; border-color: var(--ink-deep); background: transparent; }
.free { background: var(--accent); padding: clamp(28px, 4.4vw, 64px) clamp(22px, 3.9vw, 56px); display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-end; justify-content: space-between; }
.free .stack { flex: 1 1 480px; }
.free .t-display { font-size: clamp(36px, 6.4vw, 92px); line-height: 0.9; text-wrap: balance; }
.about-last { padding-bottom: clamp(64px, 9vw, 128px); }
.about-grades { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: clamp(32px, 4vw, 56px); }
.about-grades .stack { gap: 14px; }
.disciplines { border-top: 1px solid var(--ink-deep); }
.disciplines li { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--ink-deep); height: 52px; }
.disciplines li > :first-child { width: 28px; height: 28px; flex: none; }
.disciplines .t-h3 { flex: 1; font-size: 16px; }
/* The flat colours of the discipline list, as the design has them here. */
.disc-flat-boulder { background: var(--flat-boulder); }
.disc-flat-sport { background: var(--flat-sport); }
.disc-flat-trad { background: var(--flat-trad); }
.disc-flat-buildering { background: var(--flat-buildering); }
.disc-flat-dws { background: var(--flat-dws); }
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink-deep); }
.tier { padding: 20px 16px; min-height: 160px; display: flex; flex-direction: column; justify-content: space-between; color: var(--on-dark); }
.tier .t-mono { font-weight: 500; }
.tier .t-display { font-size: clamp(32px, 3.6vw, 52px); }
.tier.easy { background: var(--g-green); }
.tier.mid { background: var(--tier-mid); color: var(--ink-deep); }
.tier.hard { background: var(--g-red); }

@media (max-width: 1000px) {
    .g-hero { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- profile ---------- */
.hdr-avatar { display: block; flex: none; border-radius: 50%; }
.hdr-avatar.on .ava { border: 2px solid var(--ink); }
.g-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.g-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.show-sm-b { display: none; }
.prof-head { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 24px; }
.prof-head > .ava { width: clamp(80px, 8vw, 112px); height: clamp(80px, 8vw, 112px); font-size: 28px; }
.prof-id { flex: 1 1 260px; min-width: 0; }
.prof-id .t-h1 { font-size: clamp(28px, 2.6vw, 36px); }
.prof-id > .t-meta { display: block; margin-top: 8px; font-size: 12px; letter-spacing: 0.06em; }
.prof-counts { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: baseline; }
.prof-counts b { font-size: 16px; color: var(--ink); }
.prof-note { margin-top: 16px; }
.prof-stats { margin-top: 26px; }
.prof-stats .cell { padding: 18px 20px; }
.prof-stats .cell-v { margin-top: 10px; font-size: clamp(22px, 2vw, 28px); font-weight: 800; }
.prof-m { margin-top: 20px; }
.prof-m .cell { text-align: center; }
.prof-m .cell-v { font-size: 16px; }
.prof-row { margin-top: 12px; }
.figs { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.figs .t-label { white-space: nowrap; }
.figs b { font-size: 15px; color: var(--ink); }
.side { gap: 12px; }

/* The activity chart: a bar a day, and the dashed top and middle of the scale */
.act { margin-top: 18px; display: flex; gap: 10px; }
.act-axis { position: relative; flex: none; width: 16px; height: 120px; font-size: 8.5px; }
.act-axis span { position: absolute; right: 0; }
.act-axis span:nth-child(1) { top: -3px; }
.act-axis span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.act-axis span:nth-child(3) { bottom: -3px; }
.act-plot { position: relative; flex: 1; min-width: 0; height: 120px; display: flex; align-items: flex-end; gap: 1px; border-bottom: 1px solid var(--line-strong); }
.act.short .act-plot { height: 90px; }
.act-plot::before, .act-plot::after { content: ''; position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line-chip); }
.act-plot::before { top: 0; }
.act-plot::after { top: 50%; border-top-color: var(--line-bar); }
.act-plot > span { position: relative; z-index: 1; flex: 1; min-width: 0; height: 2px; background: var(--line); border-radius: 2px 2px 0 0; }
.act-plot > span.on { background: var(--accent-strong); }
.act-months { position: relative; height: 12px; margin-top: 8px; }
.act-months.axis { margin-left: 26px; }
.act-months span { position: absolute; font-size: 8.5px; }

/* Ascents by discipline */
.dring-row { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.dring { flex: none; width: 120px; height: 120px; border-radius: 50%; background: var(--line); display: flex; align-items: center; justify-content: center; }
.dring > span { width: 76px; height: 76px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.dring .t-h2 { font-size: 24px; }
.dring .t-label { font-size: 7.5px; }
.dlegend { flex: 1 1 160px; gap: 10px; }
.dlegend li { display: flex; align-items: center; gap: 9px; }
.dlegend .t-mono { flex: 1; font-size: 11px; letter-spacing: 0.06em; }

/* Recent climbs, projects, favourites */
.climbs { overflow: hidden; min-width: 0; }
.card-head { padding: 16px 20px 10px; }
.card-empty { display: block; padding: 6px 20px 18px; }
.climbs summary { list-style: none; cursor: pointer; border-top: 0; padding-top: 16px; padding-bottom: 16px; }
.climbs summary::-webkit-details-marker { display: none; }
.climbs summary .t-h3 { flex: 1; font-size: 16px; }
.caret { display: flex; transition: transform 0.15s; }
.climbs:not([open]) .caret { transform: rotate(-90deg); }
.col-when { width: 70px; flex: none; }
.rate { width: 60px; flex: none; display: flex; gap: 2px; }
.rate i { width: 8px; height: 8px; background: var(--line-chip); }
.rate i.on { background: var(--ink); }
.col-sg { width: 60px; flex: none; font-size: 11px; white-space: nowrap; }
.col-sg .t-grade { font-size: 11px; }
.cl-style { width: 80px; flex: none; text-align: right; }

/* Followers and following */
.follows { margin-top: 20px; }
.follows .card-empty { padding-top: 18px; }
.follows-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.follows-who:hover .t-item { text-decoration: underline; text-underline-offset: 3px; }
.follows-who .t-item { display: block; }

/* Edit profile */
.edit { max-width: 560px; }
.edit .alert { margin-top: 20px; }
.edit-photo { margin-top: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line-2); display: flex; align-items: flex-start; gap: 20px; }
.edit-photo > .ava { width: 80px; height: 80px; font-size: 22px; }
.edit-photo .stack { flex: 1; gap: 14px; align-items: flex-start; }
.edit .form { margin-top: 28px; gap: 18px; }
.edit-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.file { max-width: 100%; font: 400 13px/1.4 var(--f-sans); color: var(--ink-2); }
.file::file-selector-button { margin-right: 12px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--fill); font: 600 9.5px/1 var(--f-mono); letter-spacing: 0.12em; color: var(--ink); cursor: pointer; }
.select { appearance: none; padding-right: 40px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--ink-icon) 50%), linear-gradient(135deg, var(--ink-icon) 50%, transparent 50%); background-position: calc(100% - 20px) center, calc(100% - 15px) center; background-size: 5px 5px; background-repeat: no-repeat; }
.edit-actions { margin-top: 8px; display: flex; gap: 8px; }
.edit-actions .btn-primary { min-width: 160px; }
/* The grade scales: a part of the form under a hairline, as the photo is
   above it, each discipline a pair of the filters' tiles. */
.edit-scales { margin-top: 10px; padding-top: 28px; border-top: 1px solid var(--line-2); gap: 18px; }
.edit-scales .filter-tiles { margin-top: 0; }

@media (max-width: 1000px) {
    .g-side { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
    .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .show-sm-b { display: block; }
    .show-sm-b.cells { display: grid; }
    .cl-style { width: auto; }
    .act-months.axis { margin-left: 0; }
    .edit-pair { grid-template-columns: minmax(0, 1fr); }
    .edit-photo > .ava { width: 64px; height: 64px; }
    .edit-actions .btn-primary { flex: 1; }
}

/* ---------- route catalogue ---------- */
/* The filters above a route table: one GET form, chips that are checkboxes
   and radios, the grade range as two menus. */
.filters { margin-top: 16px; display: flex; flex-direction: column; gap: 18px; }
.filters-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters-row .search { flex: 1 1 260px; }
.filters-grades { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.filters-grades .select { width: 150px; }
/* A menu of its own in the row: the country or the city of the crag and gym
   lists. */
.filters-menu { flex: none; width: 180px; }
.filters-set { min-width: 0; margin: 0; padding: 0; border: 0; }
.filters-set legend { padding: 0; margin-bottom: 10px; }
.filters-actions { display: flex; justify-content: flex-end; gap: 8px; }
.input.sm { height: 40px; padding-left: 14px; font-size: 13px; }
label.chip { position: relative; cursor: pointer; }
label.chip:hover { background: var(--hover); }
.chip > input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.chip:has(> input:checked) { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }
.chip:has(> input:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.col-tick { width: 16px; flex: none; display: flex; color: var(--accent-strong); }
/* A route's number on its spot: the disc its photos carry at the start of
   its line. */
.col-n { width: 24px; flex: none; display: flex; }
.num { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); border: 1.5px solid var(--accent); display: flex; align-items: center; justify-content: center; font: 700 10.5px/1 var(--f-mono); color: var(--on-dark); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
    .filters { margin-top: 12px; }
    .filters-grades { flex: 1 1 100%; }
    .filters-grades .select { flex: 1; width: auto; min-width: 0; }
    .filters-menu { flex: 1 1 40%; width: auto; min-width: 0; }
    .filters-actions .btn-primary { flex: 1; }
}

/* ---------- filter panels ---------- */
/* The app's filter sheet, as the map's filters and the route catalogue's
   draw it: a head with RESET, sections under small labels, the kinds of
   place or progress as tiles, the disciplines as one row of tiles in their
   colours, and the grade range as a slider. The tiles are buttons where a
   script presses them (the map) and checkboxes or radios of a GET form
   where none does (the catalogue). */
.filter-head { padding: 20px 20px 8px; align-items: flex-end; }
.filter-head .t-h3 { font-size: 20px; font-weight: 800; letter-spacing: 0.14em; }
.filter-head .t-label { margin-top: 8px; font-size: 10px; }
.filter-tools { display: flex; align-items: center; gap: 10px; }
.filter-tools .btn-ghost { color: var(--accent-ink); }
.filter-foot { flex: none; padding: 12px 20px 18px; border-top: 1px solid var(--line); }
.filter-set { min-width: 0; margin: 0; padding: 12px 20px; border: 0; }
.filter-set > legend { padding: 0; }
.filter-set > legend.head { width: 100%; }
.filter-set > .search { margin-top: 0; }
.filter-tiles { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.filter-tiles .btn { position: relative; height: 48px; background: var(--surface); border: 1.5px solid var(--line-control); color: var(--ink-nav); }
.filter-tiles .btn[aria-pressed="true"], .filter-tiles .btn:has(> input:checked) { background: var(--surface-2); border-color: var(--line-pressed); color: var(--ink); }
/* A tile that is a form's checkbox or radio: the input lies over it, unseen. */
.filter-tiles .btn > input, .disc-tile > input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.filter-tiles .btn:has(> input:focus-visible), .disc-tile:has(> input:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: -3px; }
/* The disciplines as the app's sheet draws them: one row of tiles, each in
   its colour on a tint of it while picked, plain once left out. */
.disc-tiles { margin-top: 12px; display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; border: 1.5px solid var(--line-control); border-radius: 12px; overflow: hidden; }
.disc-tile { position: relative; min-width: 0; height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--surface); color: var(--ink-icon); font: 600 8.5px/1 var(--f-mono); letter-spacing: 0.04em; cursor: pointer; }
.disc-tile + .disc-tile { border-left: 1px solid var(--line-control); }
.disc-tile:hover { background: var(--hover); }
.disc-tile[aria-pressed="true"], .disc-tile:has(> input:checked) { background: color-mix(in srgb, var(--tint) 10%, var(--surface)); color: var(--tint); }
.disc-tile[aria-pressed="true"]:hover, .disc-tile:has(> input:checked):hover { background: color-mix(in srgb, var(--tint) 16%, var(--surface)); }
.disc-tile:focus-visible { outline-offset: -3px; }
/* The app's own icons, as masks over the tile's colour. */
.disc-icon { width: 40px; height: 26px; background: currentColor; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
.disc-icon-sport { -webkit-mask-image: url(../images/disciplines/sport.png); mask-image: url(../images/disciplines/sport.png); }
.disc-icon-boulder { -webkit-mask-image: url(../images/disciplines/boulder.svg); mask-image: url(../images/disciplines/boulder.svg); }
.disc-icon-trad { -webkit-mask-image: url(../images/disciplines/trad.png); mask-image: url(../images/disciplines/trad.png); }
.disc-icon-buildering { -webkit-mask-image: url(../images/disciplines/buildering.png); mask-image: url(../images/disciplines/buildering.png); }
.disc-icon-dws { -webkit-mask-image: url(../images/disciplines/dws.png); mask-image: url(../images/disciplines/dws.png); }
.tint-boulder { --tint: var(--boulder); }
.tint-sport { --tint: var(--sport); }
.tint-trad { --tint: var(--trad); }
.tint-buildering { --tint: var(--buildering); }
.tint-dws { --tint: var(--dws); }
/* The grade range as the app's slider: a dashed track, the range on it in
   the accent, dashed like a topo line, and a knob at either end.
   public/js/grade-slider.js sets --from and --to as it moves them. */
.filter-set .t-grade { font-size: 13px; letter-spacing: 0.06em; text-transform: none; }
/* In ink unless both ends share a band, whose colour then wins. */
.filter-set :where(.t-grade) { color: var(--ink); }
.grade-slider { --from: 0%; --to: 100%; position: relative; height: 40px; margin: 6px 12px 0; touch-action: none; cursor: pointer; }
/* What a script swaps: the slider for the menus. */
.filter-set [hidden] { display: none; }
.grade-track { position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 11px); }
.grade-band { position: absolute; left: var(--from); right: calc(100% - var(--to)); top: -0.5px; height: 3px; background: repeating-linear-gradient(90deg, var(--accent-press) 0 7px, transparent 7px 12px); }
.grade-knob { position: absolute; top: 50%; left: var(--from); width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: var(--scrim-soft); border: 1.5px solid var(--accent); box-shadow: 0 3px 10px var(--marker-shadow); }
.grade-knob[data-end="max"] { left: var(--to); }
.grade-ends { margin-top: 6px; font-size: 9px; }
/* Without a script the catalogue keeps its two menus in place of the
   slider. */
.filter-set .filters-grades { margin-top: 12px; }
.filter-set .filters-grades .select { flex: 1; width: auto; min-width: 0; }

/* A filter panel beside what it filters: on the left from 1000 px up,
   above it below that. */
.g-aside { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 24px; align-items: start; }
.g-aside > .card { overflow: hidden; }

@media (max-width: 1000px) {
    .g-aside { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
    .g-aside > .card .filter-head, .g-aside > .card .filter-set, .g-aside > .card .filter-foot { padding-left: 0; padding-right: 0; }
}

/* ---------- map ---------- */
/* The map fills the window under the header. `.map`, `.map-zoom`,
   `.map-legend`, `.tabbar` and `.tab` are the design's; the markers are what
   it draws inline. */
body:has(> .map) { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.map { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--map-ground); }
.map-canvas { position: absolute; inset: 0; }
.map-zoom { position: absolute; left: 372px; top: 16px; z-index: 2; display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; }
.map-zoom button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font: 500 20px/1 var(--f-sans); }
.map-zoom button + button { border-top: 1px solid var(--line); }
.map-zoom button:hover { background: var(--hover); }
.map-zoom button.off { color: var(--muted); }
.map-legend { position: absolute; left: 372px; bottom: 16px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-radius: 12px; background: var(--glass); font-weight: 500; font-size: 9.5px; letter-spacing: 0.08em; }
.map-legend li { display: flex; align-items: center; gap: 6px; }
.map-legend .swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--ink); }
.map-legend .swatch.round { border-radius: 50%; background: none; border: 3px solid var(--boulder); }
.map.near .legend-far, .map:not(.near) .legend-near { display: none; }
/* ROUTES IN THIS AREA, centred on what the filters leave of the map, and on
   a phone the filters' button beside it. */
.map-top { position: absolute; top: 16px; left: calc(50% + 178px); transform: translateX(-50%); z-index: 2; display: flex; gap: 8px; }
.map-area { box-shadow: var(--shadow-pop); }
.map-fbutton { display: none; background: var(--glass); }
.tabbar { display: none; }
.tab { flex: 1; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font: 500 9px/1 var(--f-mono); letter-spacing: 0.14em; color: var(--ink-nav); }
.tab.on { background: var(--ink); color: var(--on-dark); }

/* A place on the map: a ring split between its disciplines around the
   number of its routes, its name below; a spot's ring is smaller and has no
   name; a gym is a dark square. map.js gives the ring its shares, and its
   sizes mirror these. */
.pin { position: relative; width: 46px; height: 46px; border-radius: 50%; background: var(--ink-icon); box-shadow: 0 4px 14px var(--marker-shadow); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pin.big { width: 56px; height: 56px; }
.pin > b { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; font: 800 13px/1 var(--f-sans); color: var(--ink); }
.pin.big > b { width: 40px; height: 40px; }
.pin.spot { width: 36px; height: 36px; }
.pin.spot > b { width: 24px; height: 24px; font-size: 11px; }
.pin.gym { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--ink); color: var(--on-dark); }
.pin.gym > b { width: auto; height: auto; background: none; color: var(--on-dark); }
.pin-name { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 4px 7px; border-radius: 7px; background: var(--glass); font-size: 9.5px; letter-spacing: 0.08em; white-space: nowrap; color: var(--ink); pointer-events: none; }
/* The marker whose panel is open, ringed in the accent. */
.pin.on { box-shadow: 0 0 0 3px var(--accent), 0 4px 14px var(--marker-shadow); }

/* The panel a click on a crag, a gym or a spot opens: on the right, where
   W06 has its list of routes, and as tall as what it holds; from 860 px
   down a sheet from below, as W06's filters are. `.map-panel` is the
   design's; map.js fills .map-place-body with site/map/crag-panel or
   site/map/spot-panel. */
.map-panel { position: absolute; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-control); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); overflow: hidden; }
.map-panel[hidden] { display: none; }
.map-place { top: 16px; right: 16px; width: 320px; max-height: calc(100% - 32px); z-index: 3; outline: none; }
.map-place-body { min-height: 0; overflow: auto; overscroll-behavior: contain; }
/* Over a photo as often as not, so it keeps a background of its own. */
.icon-btn.map-close { position: absolute; top: 12px; right: 12px; z-index: 1; background: var(--glass); font: 500 16px/1 var(--f-sans); }
.place-photo { aspect-ratio: 16 / 10; border-radius: 0; }
.place-text { display: flex; flex-direction: column; gap: 18px; padding: 18px 20px 20px; }
.place-head .t-h2 { margin: 10px 0 8px; }
/* With no photo under it, the close button sits beside the name. */
.place.bare .place-head { padding-right: 44px; }
.place-line { font-size: 14px; }
.place-about { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.place-disc .li { padding: 10px 0; }
.place-disc .t-meta, .place-disc .t-grade { min-width: 64px; text-align: right; }
.place-actions { display: flex; flex-direction: column; gap: 8px; }

/* W06's filters: on the left on a desktop, as tall as what they hold; from
   860 px down a sheet from below that the FILTERS button brings up, closed
   by × and by SHOW N PLACES — which is all that button does, so a desktop,
   where the filters never close, goes without it. map.js does the
   pressing. */
.map-filters { top: 16px; left: 16px; width: 340px; max-height: calc(100% - 32px); z-index: 3; outline: none; }
.map-filters-body { flex: 1 1 auto; min-height: 0; padding-bottom: 8px; overflow: auto; overscroll-behavior: contain; }
/* SHOW N PLACES only puts the sheet away, so a desktop goes without it. */
.map-fclose, .map-ftoggle, .map-filters .filter-foot { display: none; }
.map-ftoggle { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 2; box-shadow: 0 10px 30px var(--marker-shadow); }

@media (max-width: 860px) {
    .map-zoom { left: auto; right: 16px; }
    .map-legend { left: 16px; bottom: 80px; }
    .map-top { left: 50%; }
    .map-place { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 80%; border-radius: 22px 22px 0 0; border-bottom: 0; }
    .place-photo { aspect-ratio: auto; height: 180px; }
    .map-filters { display: none; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 80%; border-radius: 22px 22px 0 0; border-bottom: 0; }
    .map-filters.open, .map-fclose, .map-ftoggle { display: flex; }
    .map-filters .filter-foot { display: block; }
}

/* Phone: the tab bar stands in for the header, and + and − give way to
   pinching; the location button stays, over the tab bar. */
@media (max-width: 640px) {
    .hdr-map { display: none !important; }
    .tabbar { display: flex; border-radius: 22px; overflow: hidden; background: var(--glass); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--line-control); z-index: 5; }
    .map > .tabbar { position: absolute; left: 12px; right: 12px; bottom: 20px; }
    .map-top { top: 12px; left: 12px; right: 12px; transform: none; }
    .map-top .map-area { flex: 1; }
    .map-fbutton { display: flex; }
    .map-ftoggle { display: none; }
    .map-legend { bottom: 96px; }
    .map-zoom { top: auto; bottom: 96px; }
    .map-zoom button + button { border-top: 0; }
    /* The sheets come up over the tab bar, as W06's filters do. */
    .map-place, .map-filters { z-index: 6; }
}
