/* EnduroSends. Tokens first: light is the default, dark overrides below. */
:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-2: #eef2ee;
  --line: #d0d8d2;
  --line-strong: #8a9890;
  --ink: #131c17;
  --muted: #53625a;
  --plate: #ffd400;
  --on-plate: #131c17;
  --dh: #c8006a;
  --enduro: #d95f00;
  --xc: #0a63bf;
  --ok: #17703f;
  --ok-bg: #e2f4e9;
  --warn: #8f4100;
  --warn-bg: #ffefd2;
  --focus: #0a63bf;
  --shadow: 0 2px 10px rgba(19, 28, 23, .14);
  --shadow-up: 0 -4px 18px rgba(19, 28, 23, .12);
  --peek: 84px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1310;
  --surface: #151d19;
  --surface-2: #1f2a24;
  --line: #33413a;
  --line-strong: #6f8077;
  --ink: #eef3ef;
  --muted: #a6b6ad;
  --dh: #ff5aa8;
  --enduro: #ff9340;
  --xc: #62aeff;
  --ok: #62d391;
  --ok-bg: #12301f;
  --warn: #ffc56b;
  --warn-bg: #3a2a10;
  --focus: #ffd400;
  --shadow: 0 2px 12px rgba(0, 0, 0, .5);
  --shadow-up: 0 -4px 18px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
@media (prefers-contrast: more) {
  :root { --line: var(--line-strong); --muted: var(--ink); }
}

* { box-sizing: border-box; }
html { height: 100%; font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  height: 100%; margin: 0; overflow: hidden;
  font: 400 1rem/1.45 var(--body);
  color: var(--ink); background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--xc); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 10px 14px;
  background: var(--plate); color: var(--on-plate); font-weight: 600; border-radius: 8px;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- map ---------- */
#map { position: fixed; inset: 0; background: var(--surface-2); z-index: 0; }
.leaflet-container { font: inherit; background: var(--surface-2); }
.leaflet-control-attribution { font-size: .6875rem; background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--ink) !important; }
.leaflet-bottom { bottom: calc(var(--peek) + var(--sab)); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.leaflet-bar a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.65); }

/* ---------- top bar ---------- */
.top {
  position: fixed; z-index: 500;
  top: calc(var(--sat) + 10px); left: 10px; right: 10px;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.search {
  display: flex; align-items: center; gap: 2px;
  height: 52px; padding: 0 4px 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.search .lead { color: var(--muted); margin-right: 8px; }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 1.0625rem;
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input::-webkit-search-cancel-button { display: none; }
.search:focus-within { border-color: var(--focus); box-shadow: var(--shadow), 0 0 0 2px var(--focus); }
.iconbtn {
  width: 44px; height: 44px; display: grid; place-items: center; flex: none;
  border: 0; border-radius: 10px; background: none;
}
.iconbtn:hover { background: var(--surface-2); }
.iconbtn:active, .iconbtn.on, .iconbtn[aria-expanded="true"] { background: var(--plate); color: var(--on-plate); }

.suggest {
  position: absolute; z-index: 5; left: 0; right: 0; top: 58px;
  list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  max-height: 46vh; overflow: auto;
}
.suggest li.h { padding: 8px 10px 4px; font-size: .8125rem; color: var(--muted); }
.suggest button {
  display: block; width: 100%; min-height: 44px; text-align: left;
  padding: 8px 10px; border: 0; border-radius: 9px; background: none;
}
.suggest button:hover, .suggest button:focus-visible { background: var(--surface-2); }
.suggest small { display: block; color: var(--muted); font-size: .8125rem; }

.filters {
  display: flex; gap: 6px; margin-top: 8px; padding: 2px;
  overflow-x: auto; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  min-height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow);
  background: var(--surface); font-weight: 600; font-size: .9375rem; white-space: nowrap;
}
.chip i { width: 16px; height: 5px; border-radius: 3px; background: var(--muted); }
.chip.dh i { background: var(--dh); }
.chip.enduro i { background: var(--enduro); }
.chip.xc i { background: repeating-linear-gradient(90deg, var(--xc) 0 5px, transparent 5px 8px); }
.chip[aria-pressed="true"] { border-color: var(--ink); }
.chip[aria-pressed="false"] { color: var(--muted); background: var(--surface-2); box-shadow: none; border-style: dashed; border-color: var(--line-strong); }
.chip[aria-pressed="false"] i { background: none; height: 0; border-top: 2px dotted var(--muted); border-radius: 0; }
.chip.plain[aria-expanded="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip.flag::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--dh); }

.pop {
  margin-top: 6px; padding: 12px 14px 14px; max-width: 360px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  max-height: 62vh; overflow: auto;
}
.pop label { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.pop input[type="checkbox"], .pop input[type="radio"] { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }
.pop-h { margin: 12px 0 2px; font: 700 1.125rem/1.2 var(--display); }
.pop-h:first-child { margin-top: 0; }
.pop-note { margin: 10px 0 0; font-size: .8125rem; color: var(--muted); }
.segmented { display: flex; gap: 6px; margin: 6px 0 4px; }
.segmented label { flex: 1; min-height: 0; display: block; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span {
  display: grid; place-items: center; min-height: 44px; padding: 0 8px; text-align: center;
  border: 1px solid var(--line-strong); border-radius: 10px; font-weight: 500;
}
.segmented input:checked + span { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 600; }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.legend { list-style: none; margin: 6px 0 0; padding: 0; font-size: .9375rem; }
.legend li { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.lg { width: 34px; height: 0; border-top: 5px solid var(--muted); border-radius: 3px; flex: none; }
.lg.dh { border-color: var(--dh); }
.lg.enduro { border-color: var(--enduro); border-top-width: 4px; }
.lg.xc { border-top: 3px dashed var(--xc); border-radius: 0; }
.lg.own { border-color: var(--enduro); outline: 2.5px solid var(--ink); outline-offset: 0; border-radius: 4px; }
.lg.risk { border-top: 4px dotted var(--enduro); border-radius: 0; }

.loadbtn {
  position: fixed; z-index: 450; left: 50%; transform: translateX(-50%);
  top: calc(var(--sat) + 118px);
  min-height: 42px; padding: 0 18px; border-radius: 21px;
  border: 0; background: var(--plate); color: var(--on-plate); font-weight: 600; white-space: nowrap; box-shadow: var(--shadow);
}
.loadbtn.hint, .loadbtn.busy { background: var(--surface); color: var(--ink); font-weight: 500; border: 1px solid var(--line); }
.loadbtn.busy::before {
  content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid var(--ink); border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- navigation banner ---------- */
.navbanner {
  position: fixed; z-index: 520; top: calc(var(--sat) + 10px); left: 10px; right: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 8px 8px 6px;
  background: var(--plate); color: var(--on-plate); border-radius: 14px; box-shadow: var(--shadow);
}
.navinfo { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 4px 10px; color: inherit; border-radius: 10px; }
.nav-dist { display: block; font: 700 2.125rem/1 var(--display); }
.nav-dist.long { font-size: 1.25rem; line-height: 1.2; }
.nav-sub { display: block; font-size: .875rem; margin-top: 2px; }
.navbanner .btn.dark { background: #131c17; color: #fff; border-color: #131c17; }
.navbanner :focus-visible { outline-color: #131c17; }
body.navigating .top, body.navigating .loadbtn { display: none; }

/* ---------- sheet ---------- */
.sheet {
  position: fixed; z-index: 480; left: 0; right: 0; bottom: 0;
  height: calc(var(--peek) + var(--sab));
  display: flex; flex-direction: column;
  background: var(--surface); border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0; box-shadow: var(--shadow-up);
  transition: height .22s ease-out;
}
.sheet.dragging { transition: none; }
.sheet-head { flex: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.grip { display: block; width: 100%; height: 24px; padding: 0; border: 0; background: none; border-radius: 18px 18px 0 0; }
.grip span { display: block; width: 44px; height: 5px; margin: 0 auto; border-radius: 3px; background: var(--line-strong); }
.brandrow { display: none; }
.tabs { display: flex; padding: 0 10px; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs button {
  flex: 1; min-height: 46px; padding: 0 2px; border: 0; background: none; white-space: nowrap;
  font: 700 1.25rem/1 var(--display); color: var(--muted);
  border-bottom: 4px solid transparent; margin-bottom: -1px; border-radius: 8px 8px 0 0;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--plate); }
.tabs b {
  display: inline-block; margin-left: 5px; min-width: 20px; padding: 2px 5px; vertical-align: 2px;
  font: 600 .8125rem/1.2 var(--body); background: var(--surface-2); border-radius: 10px; color: var(--ink);
}
.tabs b:empty { display: none; }
.panes { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; outline: none; }
.pane { padding: 16px 16px calc(28px + var(--sab)); }

h2 { margin: 0 0 6px; font: 700 1.75rem/1.1 var(--display); letter-spacing: .005em; }
h2:focus { outline: none; }
h3 { margin: 22px 0 8px; font: 700 1.25rem/1.2 var(--display); }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 16px;
  border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  font-weight: 600; text-decoration: none; color: var(--ink); text-align: center;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--plate); border-color: var(--plate); color: var(--on-plate); }
.btn.primary:hover { filter: brightness(.96); }
.btn.dark { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 56px; font-size: 1.0625rem; }
.btn[disabled] { opacity: .5; cursor: default; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.btnrow .btn { flex: 1 1 150px; padding: 0 10px; font-size: .9375rem; }
.back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -8px 0 4px -8px; padding: 0 10px 0 6px;
  border: 0; background: none; font-weight: 600; border-radius: 10px;
}
.linkbtn { border: 0; background: none; padding: 10px 0; min-height: 44px; text-decoration: underline; color: var(--muted); }

/* hero: the import is the front door */
.hero { margin: -16px -16px 0; padding: 20px 16px 18px; background: var(--plate); color: var(--on-plate); }
.hero h2 { font-size: 2.125rem; line-height: 1; margin-bottom: 8px; }
.hero p { max-width: 34ch; }
.hero .btn { background: #131c17; color: #fff; border-color: #131c17; margin-top: 4px; }
.hero :focus-visible { outline-color: #131c17; }
.steps { list-style: none; margin: 18px 0 0; padding: 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; padding: 10px 0; counter-increment: s; }
.steps li::before {
  content: counter(s); width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--plate); color: var(--on-plate); border: 2px solid var(--ink); border-radius: 6px;
  font: 700 1.5rem/1 var(--display);
}
.steps b { display: block; }
.steps span { color: var(--muted); font-size: .9375rem; }

/* lists */
.list { list-style: none; margin: 8px 0 0; padding: 0; }
.list li { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.trail {
  flex: 1; min-width: 0; display: grid; grid-template-columns: 6px 1fr; column-gap: 12px; row-gap: 2px;
  min-height: 56px; padding: 10px 0; border: 0; background: none; text-align: left; border-radius: 8px;
}
.trail .bar { grid-row: 1 / span 2; border-radius: 3px; background: var(--muted); }
.bar.dh { background: var(--dh); }
.bar.enduro { background: var(--enduro); }
.bar.xc { background: repeating-linear-gradient(180deg, var(--xc) 0 6px, transparent 6px 9px); }
.trail .tn { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trail .tm { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .875rem; color: var(--muted); align-items: center; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: 6px;
  font: 600 .8125rem/1.45 var(--body); color: var(--ink); white-space: nowrap;
}
.tag svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tag.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tag.own, .tag.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.tag.q { color: var(--muted); }
.addbtn { flex: none; width: 52px; display: grid; place-items: center; border: 0; background: none; border-radius: 8px; }
.addbtn span {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); border-radius: 8px; font: 700 1.375rem/1 var(--display);
}
.addbtn.in span { background: var(--plate); color: var(--on-plate); border: 2px solid var(--ink); }

.hot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hot button {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); font-weight: 500;
}
.hot button:hover { background: var(--surface-2); }
.hot small { color: var(--muted); margin-left: 5px; }

/* detail */
.badges { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 6px 0 12px; align-items: center; }
.cls { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.cls i { width: 22px; height: 6px; border-radius: 3px; }
.cls.dh i { background: var(--dh); }
.cls.enduro i { background: var(--enduro); }
.cls.xc i { background: repeating-linear-gradient(90deg, var(--xc) 0 6px, transparent 6px 9px); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stats div { padding: 10px 12px; background: var(--surface-2); border-radius: 12px; }
.stats b { display: block; font: 700 1.625rem/1.05 var(--display); }
.stats span { font-size: .8125rem; color: var(--muted); }
.stats.four { grid-template-columns: repeat(2, 1fr); }
.note { display: flex; gap: 10px; padding: 12px; margin: 12px 0; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: .9375rem; }
.note svg { width: 20px; height: 20px; flex: none; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.note.plain { background: var(--surface-2); color: var(--ink); }
canvas.profile { display: block; width: 100%; height: 124px; margin: 8px 0; }

/* forms */
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: .875rem; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .seg select, .cand input[type="text"], .cand select {
  width: 100%; min-height: 46px; padding: 0 12px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink);
}
.fieldrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.startrow { display: flex; flex-wrap: wrap; gap: 6px; }
.startrow button {
  flex: 1 1 auto; min-height: 44px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-weight: 500;
}
.startrow button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }

/* plan: stages and liaisons, like a race sheet */
.sheetlist { list-style: none; margin: 12px 0; padding: 0; }
.stage { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; padding: 10px 0; }
.plate {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--plate); color: var(--on-plate); border: 2px solid var(--ink); border-radius: 6px;
  font: 700 1.625rem/1 var(--display);
}
.stage .tn { font-weight: 600; }
.stage .tm { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .875rem; color: var(--muted); align-items: center; }
.tools { display: flex; gap: 4px; margin-top: 8px; }
.tools button {
  width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.tools button:hover { background: var(--surface-2); }
.tools button[disabled] { opacity: .35; }
.tools .ic { width: 19px; height: 19px; }
.seg { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 2px 0; }
.seg .rail { justify-self: center; width: 0; height: 100%; min-height: 48px; border-left: 3px dotted var(--ink); }
.seg.lift .rail { border-left-style: dashed; }
.seg .body { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .875rem; }
.seg select { width: auto; min-height: 44px; font-size: .875rem; }

.saved { list-style: none; margin: 8px 0; padding: 0; }
.saved li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.saved .tn { font: 700 1.375rem/1.2 var(--display); }

/* ride review */
.cand { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cand > input[type="checkbox"] { width: 24px; height: 24px; margin-top: 10px; accent-color: var(--ink); }
.cand .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: .875rem; color: var(--muted); align-items: center; }
.cand .dup { margin: 6px 0 0; font-size: .875rem; color: var(--muted); }
.cand .meta button { min-height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-weight: 500; }
.rides { list-style: none; margin: 8px 0 0; padding: 0; }
.rides li { border-bottom: 1px solid var(--line); }
.rides button { display: block; width: 100%; min-height: 56px; padding: 10px 0; text-align: left; border: 0; background: none; border-radius: 8px; }
.rides .tn { font-weight: 600; display: block; }
details.help { margin: 18px 0 0; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
details.help summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
details.help ol, details.help ul { padding-left: 20px; margin: 0 0 12px; }
details.help li { margin-bottom: 6px; }

.parking { list-style: none; margin: 6px 0; padding: 0; }
.parking li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }

.dropzone {
  position: fixed; inset: 12px; z-index: 950; display: grid; place-items: center;
  background: color-mix(in srgb, var(--plate) 88%, transparent); color: var(--on-plate);
  border: 3px dashed #131c17; border-radius: 20px; font: 700 2rem/1.1 var(--display); text-align: center; padding: 20px;
  pointer-events: none;
}
.toast {
  position: fixed; z-index: 900; left: 50%; transform: translateX(-50%);
  top: calc(var(--sat) + 168px); width: max-content;
  max-width: min(92vw, 440px); padding: 11px 15px;
  background: var(--ink); color: var(--surface); border-radius: 12px; font-size: .9375rem; text-align: center; box-shadow: var(--shadow);
}
body.navigating .toast { top: calc(var(--sat) + 96px); }

/* map markers */
.pin-plate {
  width: 26px; height: 26px; display: grid; place-items: center;
  background: #ffd400; border: 2px solid #131c17; border-radius: 5px;
  font: 700 1.0625rem/1 var(--display); color: #131c17;
}
.pin-me { width: 18px; height: 18px; border-radius: 50%; background: #0a63bf; border: 3px solid #fff; box-shadow: 0 0 0 2px #0a63bf; }
.pin-flag {
  padding: 1px 7px; background: #131c17; color: #fff; border-radius: 6px; border: 1px solid #fff;
  font: 600 .75rem/1.5 var(--body); white-space: nowrap; transform: translate(-50%, -135%); display: inline-block;
}

/* ---------- desktop: sheet becomes a side panel ---------- */
@media (min-width: 900px) {
  :root { --panel: 420px; }
  .sheet {
    top: 0; right: auto; width: var(--panel); height: 100% !important;
    border-top: 0; border-right: 1px solid var(--line); border-radius: 0; transition: none; box-shadow: var(--shadow);
  }
  .grip { display: none; }
  .brandrow { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px; }
  .mark { width: 30px; height: 30px; }
  .mark rect { fill: var(--plate); }
  .mark path { fill: none; stroke: #131c17; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
  .word { font: 700 1.5rem/1 var(--display); letter-spacing: .01em; }
  .sheet-head { touch-action: auto; }
  .top, .navbanner { left: calc(var(--panel) + 14px); right: auto; width: 440px; }
  .loadbtn { left: calc(var(--panel) + 234px); }
  .leaflet-bottom { bottom: 0; }
  .leaflet-left { left: var(--panel); }
  .toast { left: calc(var(--panel) + 234px); }
  .dropzone { left: calc(var(--panel) + 12px); }
}

@media (prefers-reduced-motion: reduce) {
  .sheet { transition: none; }
  .loadbtn.busy::before { animation-duration: 2.4s; }
}
@media (forced-colors: active) {
  .chip, .btn, .search, .pop, .sheet, .tag { border: 1px solid CanvasText; }
  .tabs button[aria-selected="true"] { border-bottom-color: Highlight; }
}

/* One-time risk confirmation before navigation or GPX export. */
.ack { max-width: min(440px, calc(100vw - 32px)); padding: 20px; border: 0; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.ack::backdrop { background: rgba(13, 19, 16, .55); }
.ack h2 { margin: 0 0 8px; font-family: var(--display); font-size: 1.5rem; color: var(--warn); }
.ack p { margin: 0 0 12px; line-height: 1.45; }
.ack a { color: var(--focus); }
.ack .btnrow { margin-top: 16px; }
.note a { color: inherit; text-decoration: underline; white-space: nowrap; }
