/* Versant: dark alpine glass over a full-bleed 3D map, one warm accent (alpenglow), a grotesk for names and
   numbers. The map is the only thing in colour; the interface stays ink. */
:root {
  --ink: #f4f4f5;
  --ink-2: #b4b4bd;
  --ink-3: #85858f;
  --fill: rgba(255, 255, 255, 0.09);
  --fill-2: rgba(255, 255, 255, 0.06);
  --hairline: rgba(255, 255, 255, 0.1);
  --surface: rgba(16, 18, 24, 0.8);
  --card: rgba(255, 255, 255, 0.055);
  --accent: #ff6a3d;
  --accent-soft: rgba(255, 106, 61, 0.16);
  --pink: #ff6a3d;
  --display: "Space Grotesk", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color-scheme: dark;
  --radius: 18px;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.42), 0 1px 3px rgba(0, 0, 0, 0.3);
  --side: 384px;
  --gap: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0c0e13; }
#map { position: fixed; inset: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.4; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
svg { width: 100%; height: 100%; display: block; }

.glass {
  background: var(--surface);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--shadow);
  border: 0.5px solid rgba(255, 255, 255, 0.09);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; z-index: 3;
  top: var(--gap); left: var(--gap); bottom: var(--gap);
  width: var(--side);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: opacity 0.4s, transform 0.4s;
}
.grabber { display: none; }

.search {
  position: relative; display: flex; align-items: center;
  margin: 0 14px 4px; height: 38px;
  background: var(--fill); border-radius: 11px;
}
.search-icon { width: 18px; height: 18px; margin: 0 6px 0 10px; color: var(--ink-3); flex: none; }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none;
  font-size: 15px; letter-spacing: -0.01em;
}
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.search kbd {
  margin-right: 9px; font: 600 11px/1 ui-monospace, monospace; color: var(--ink-3);
  border: 1px solid var(--hairline); border-radius: 5px; padding: 3px 6px;
}
.search:focus-within kbd { display: none; }

.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  background: var(--fill); border-radius: 9px; padding: 2px;
}
.seg button {
  border: 0; background: transparent; border-radius: 7px; padding: 6px 8px;
  font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.seg button span { width: 15px; height: 15px; }
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.16); font-weight: 600; }
.seg.small button { padding: 4px 8px; font-size: 12px; }


.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button, .filters-button {
  flex: none; border: 0; border-radius: 999px; padding: 6px 12px; background: var(--fill-2);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.chips button[aria-pressed="true"], .filters-button[aria-expanded="true"] { background: var(--ink); color: #101218; }
.chips-row { display: flex; align-items: center; border-bottom: 0.5px solid var(--hairline); }
.chips-row .chips { flex: 1; min-width: 0; padding-left: 6px; }
.filters-button { margin-left: 14px; display: inline-flex; align-items: center; gap: 5px; }
.filters-button span { width: 15px; height: 15px; }
.badge { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 650; line-height: 17px; text-align: center; }
.filters { padding: 0 14px 2px; border-bottom: 0.5px solid var(--hairline); }
.chips.aspects { flex-wrap: wrap; overflow: visible; padding: 2px 0; }
.chips.aspects button { min-width: 36px; padding: 5px 7px; }

.views { flex: 1; overflow-y: auto; padding: 4px 14px 18px; overscroll-behavior: contain; }
.section-title { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; margin: 16px 2px 8px; }
.section-title small { font-weight: 450; color: var(--ink-3); margin-left: 4px; font-size: 12px; }
.hint { color: var(--ink-2); font-size: 13px; line-height: 1.45; margin: 12px 2px; }
.footnote { color: var(--ink-3); font-size: 11.5px; line-height: 1.45; margin: 18px 2px 0; }
.empty { color: var(--ink-3); font-size: 13px; margin: 6px 2px 10px; line-height: 1.45; }

.list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.card {
  position: relative; display: flex; align-items: stretch; width: 100%; text-align: left;
  border: 0; background: var(--card); border-radius: 12px; padding: 10px 12px 10px 16px;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.07);
  transition: transform 0.12s ease, background 0.12s ease;
}
.card:hover { background: rgba(255, 255, 255, 0.1); }
.card:active { transform: scale(0.985); }
.card-bar { position: absolute; left: 6px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; }
.card-body { display: grid; gap: 3px; min-width: 0; flex: 1; }
.card-body b {
  font-weight: 600; font-size: 14px; letter-spacing: -0.01em; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-body small { color: var(--ink-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-line { color: var(--ink-3); align-self: center; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.facts:empty { display: none; }
.facts .grade { color: var(--ink); font-weight: 650; background: var(--fill-2); border-radius: 5px; padding: 0 6px; }
.facts.big { font-size: 13px; gap: 6px 14px; }
.card-row { display: flex; gap: 6px; align-items: center; }
.card-row .card { flex: 1; }

.place-row {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent;
  padding: 10px 4px; border-bottom: 0.5px solid var(--hairline); font-size: 14px; text-align: left; color: var(--accent);
}
.place-row svg { width: 18px; height: 18px; flex: none; }
#search-results h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); font-weight: 600; margin: 14px 2px 6px; }

.tabbar {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  border-top: 0.5px solid var(--hairline); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.03);
}
.tabbar button {
  border: 0; background: transparent; display: grid; justify-items: center; gap: 2px;
  font-size: 10.5px; font-weight: 500; color: var(--ink-3); padding: 4px 0;
}
.tabbar button span { width: 22px; height: 22px; }
.tabbar button[aria-selected="true"] { color: var(--accent); }

/* ---------- Detail ---------- */
.view-bar { position: sticky; top: -4px; z-index: 1; padding: 6px 0 4px; margin: 0 -14px; padding-left: 8px; background: linear-gradient(var(--surface) 70%, transparent); }
.back { border: 0; background: transparent; color: var(--accent); font-size: 15px; display: inline-flex; align-items: center; gap: 2px; padding: 4px 6px; }
.back span { width: 18px; height: 18px; }
.detail .hero { margin: 0 -14px; aspect-ratio: 16 / 10; overflow: hidden; background: var(--fill); }
.detail .hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; margin: 8px -14px 0; padding: 0 14px; scrollbar-width: none; }
.thumbs button { flex: none; border: 0; padding: 0; border-radius: 8px; overflow: hidden; width: 64px; height: 48px; background: var(--fill); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail-head { margin: 14px 2px 12px; }
.eyebrow { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 4px; }
.detail-head h2 { font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -0.022em; margin: 0; }
.detail-head .sub { color: var(--ink-2); margin: 4px 0 10px; font-size: 13px; }
.actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 4px 0 12px; }
.action {
  display: grid; justify-items: center; gap: 5px; border: 0; background: transparent; color: var(--accent);
  font-size: 11px; font-weight: 500; text-decoration: none; padding: 0;
}
.action svg { width: 40px; height: 40px; padding: 10px; border-radius: 50%; background: var(--accent-soft); }
.note { font-size: 12.5px; color: var(--ink-2); background: var(--fill-2); border-radius: 10px; padding: 8px 10px; }
.note button { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.kv div { background: var(--card); border-radius: 10px; padding: 8px 10px; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.05); }
.kv dt { font-size: 11px; color: var(--ink-3); }
.kv dd { margin: 2px 0 0; font-weight: 600; font-size: 13px; }
.text { margin: 16px 2px; }
.text h3, .detail section > h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 600; margin: 0 0 6px; }
.text p, .text li { font-size: 14px; line-height: 1.55; margin: 0 0 8px; }
.text h4 { font-size: 14px; margin: 12px 0 4px; }
.text ul { padding-left: 18px; margin: 0 0 8px; }
.text a, .credit a { color: var(--accent); text-decoration: none; }
.detail section { margin: 18px 0; }
.credit { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; margin-top: 22px; }
.skeleton { height: 14px; border-radius: 6px; margin: 10px 0; background: linear-gradient(90deg, var(--fill-2), var(--fill), var(--fill-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton.short { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Plan ---------- */
.row-toggle { display: flex; align-items: center; justify-content: space-between; padding: 9px 2px; border-bottom: 0.5px solid var(--hairline); font-size: 14px; cursor: pointer; }
.switch { appearance: none; width: 42px; height: 25px; border-radius: 999px; background: rgba(120, 120, 128, 0.22); position: relative; transition: background 0.2s; cursor: pointer; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(17px); }
.button-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.pill { border: 0; border-radius: 999px; padding: 7px 14px; background: var(--fill); font-size: 13px; font-weight: 550; }
.pill.primary { background: var(--accent); color: #fff; font-weight: 650; }
.field { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); margin: 12px 0; }
.field input { border: 0; background: var(--fill); border-radius: 10px; padding: 9px 11px; font-size: 14px; color: var(--ink); outline: none; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.stat-grid div { background: var(--card); border-radius: 10px; padding: 8px 10px; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.05); }
.stat-grid dt { font-size: 11px; color: var(--ink-3); }
.stat-grid dd { margin: 2px 0 0; font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; }
.icon-btn { border: 0; background: transparent; width: 30px; height: 30px; padding: 6px; border-radius: 50%; color: var(--ink-2); flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--fill); }

/* ---------- Map tools and layers ---------- */
.map-tools { position: fixed; z-index: 4; top: var(--gap); right: var(--gap); }
.maplibregl-ctrl-top-right { top: 62px; }
.maplibregl-ctrl-group { border-radius: 12px !important; overflow: hidden; box-shadow: var(--shadow) !important; background: var(--surface) !important; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.maplibregl-ctrl-group button { width: 36px; height: 36px; }
.popover {
  position: absolute; top: 54px; right: 0; width: 310px; z-index: 2; border-radius: 16px; padding: 6px 14px 14px;
  max-height: calc(100vh - 90px); overflow-y: auto;
}
.popover h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 600; margin: 14px 0 8px; }
.bases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bases button { border: 0; background: transparent; padding: 0; display: grid; gap: 5px; font-size: 12px; font-weight: 500; }
.bases img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1); transition: box-shadow 0.15s; }
.bases button[aria-pressed="true"] img { box-shadow: 0 0 0 2.5px var(--accent); }
.bases button[aria-pressed="true"] span { color: var(--accent); font-weight: 600; }
#period { margin: 10px 0 2px; }
.slider { display: grid; gap: 4px; font-size: 13px; padding: 10px 2px 4px; color: var(--ink-2); }
.slider output { color: var(--ink); font-weight: 600; margin-left: 4px; }
.slider input { accent-color: var(--accent); width: 100%; }
/* Two thumbs on one track: the inputs overlap, only their thumbs take the pointer. */
.range { position: relative; height: 24px; }
.range::before {
  content: ""; position: absolute; left: 10px; right: 10px; top: 10px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(120, 120, 128, 0.22) var(--lo), var(--accent) var(--lo) var(--hi), rgba(120, 120, 128, 0.22) var(--hi));
}
.range input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.range input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 0 0.5px rgba(0, 0, 0, 0.06); cursor: pointer; }
.range input::-moz-range-thumb { pointer-events: auto; width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 0 0.5px rgba(0, 0, 0, 0.06); cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--ink-2); padding: 8px 2px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 14px; height: 9px; border-radius: 2px; }
.legend small { flex-basis: 100%; color: var(--ink-3); font-size: 11px; }

/* ---------- Winter imagery chip ---------- */
.winter-chip {
  position: fixed; z-index: 2; bottom: 22px;
  left: calc(var(--side) + var(--gap) + (100vw - var(--side) - var(--gap)) / 2); transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 12px; border-radius: 14px; white-space: nowrap;
  transition: bottom 0.3s;
}
.chip-icon { width: 20px; height: 20px; color: var(--accent); margin-right: 4px; }
.chip-text { display: grid; line-height: 1.2; margin-right: 4px; }
.chip-text b { font-size: 13px; font-weight: 600; }
.chip-text small { font-size: 11px; color: var(--ink-3); }
.winter-chip .seg { margin-left: 6px; }
body.has-profile .winter-chip { bottom: 214px; }

/* ---------- Elevation profile ---------- */
.profile {
  position: fixed; z-index: 2; left: calc(var(--side) + var(--gap) * 2); right: 64px; bottom: 34px;
  height: 178px; border-radius: 16px; padding: 8px 10px 6px; display: grid; grid-template-rows: auto 1fr;
}
.profile header { display: flex; align-items: center; gap: 8px; padding: 0 0 2px 4px; }
.profile-head { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 0 10px; align-items: baseline; overflow: hidden; white-space: nowrap; }
.profile-head b { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.profile-head span { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.profile canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; min-height: 0; }
.readout { position: absolute; top: 34px; right: 18px; font-size: 12px; font-weight: 600; background: rgba(16, 18, 24, 0.92); border-radius: 6px; padding: 1px 7px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.readout:empty { display: none; }

/* ---------- Map markers and tooltips ---------- */
.wp { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); cursor: grab; }
.wp.start { border-color: #34c759; width: 20px; height: 20px; }
.wp.end { border-color: #101218; width: 20px; height: 20px; }
.hover-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--pink); border: 2px solid #fff; box-shadow: 0 0 0 5px rgba(255, 106, 61, 0.3); pointer-events: none; }
.map-tip .maplibregl-popup-content {
  position: relative; border-radius: 14px; padding: 10px 14px 10px 20px; box-shadow: var(--shadow);
  background: rgba(16, 18, 24, 0.9); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 0.5px solid rgba(255, 255, 255, 0.1); color: var(--ink);
  display: grid; gap: 4px; font-size: 13px; pointer-events: none; min-width: 190px;
}
.map-tip b { font-family: var(--display); font-size: 14.5px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.tip-bar { position: absolute; left: 8px; top: 11px; bottom: 11px; width: 3px; border-radius: 3px; }
.tip-kind { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.tip-hint { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.map-tip .maplibregl-popup-tip { display: none; }
.maplibregl-ctrl-attrib { font-size: 10.5px; }

/* ---------- Fly-over: the map alone ---------- */
.stop-flight {
  position: fixed; z-index: 6; top: 18px; left: 50%; transform: translate(-50%, -80px); border: 0; border-radius: 999px;
  padding: 9px 16px; font-size: 13px; font-weight: 600; transition: transform 0.4s; display: flex; gap: 8px; align-items: center;
}
.stop-flight kbd { font: 600 10px ui-monospace, monospace; color: var(--ink-3); border: 1px solid var(--hairline); border-radius: 4px; padding: 2px 5px; }
body.flying .stop-flight { transform: translate(-50%, 0); }
body.flying .sidebar, body.flying .profile, body.flying .map-tools, body.flying .winter-chip,
body.flying .maplibregl-ctrl-top-right, body.flying .maplibregl-ctrl-bottom-right { opacity: 0; pointer-events: none; }
body.flying .sidebar { transform: translateX(-24px); }

.toast {
  position: fixed; z-index: 7; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #f4f4f5; color: #101218; font-weight: 550; padding: 10px 16px; border-radius: 12px; font-size: 13px;
  box-shadow: var(--shadow); max-width: min(90vw, 460px);
}

/* ---------- Phones: the sidebar becomes a bottom sheet ---------- */
@media (max-width: 760px) {
  :root { --side: 0px; }
  .sidebar {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 58vh;
    border-radius: var(--radius) var(--radius) 0 0; transition: height 0.3s ease;
  }
  .grabber { display: block; border: 0; background: transparent; padding: 8px 0 0; height: 18px; flex: none; }
  .grabber::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.3); margin: 0 auto; }
  .search { margin-top: 6px; }
  body.sheet-collapsed .sidebar { height: calc(150px + env(safe-area-inset-bottom)); }
  body.sheet-collapsed .views { visibility: hidden; }
  .profile { left: 8px; right: 8px; bottom: calc(58vh + 8px); height: 140px; }
  body.sheet-collapsed .profile { bottom: calc(158px + env(safe-area-inset-bottom)); }
  .winter-chip { left: 10px; transform: none; top: calc(10px + env(safe-area-inset-top)); bottom: auto; max-width: calc(100vw - 70px); }
  .winter-chip .seg { display: none; }
  body.has-profile .winter-chip { bottom: auto; }
  .maplibregl-ctrl-bottom-right { bottom: 58vh; }
  body.sheet-collapsed .maplibregl-ctrl-bottom-right { bottom: 150px; }
  .popover { width: min(300px, calc(100vw - 24px)); }
}

/* ---------- Identity ---------- */
.brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 12px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.logo svg { width: 26px; height: 26px; }
.logo span { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.03em; }
.brand .seg { flex: none; }
.brand .seg button { padding: 5px 10px; font-size: 12.5px; }
.section-title, .detail-head h2, .card-body b, .stat-grid dd, .kv dd, .profile-head b, .chip-text b { font-family: var(--display); }
.section-title { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.detail-head h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.card-body b { font-weight: 600; font-size: 14.5px; }
.facts .grade { background: rgba(255, 255, 255, 0.12); }
.chips button .dot { margin-right: 6px; vertical-align: 0; }
.card.ghost { height: 62px; background: linear-gradient(90deg, var(--fill-2), var(--fill), var(--fill-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.hint b { color: var(--ink); font-weight: 600; }

/* ---------- The dock: tools on the map ---------- */
.dock { display: flex; gap: 2px; padding: 4px; border-radius: 15px; }
.dock button {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--ink-2);
  border-radius: 11px; padding: 7px 11px 7px 9px; font-size: 13px; transition: background 0.15s, color 0.15s;
}
.dock button span { width: 18px; height: 18px; }
.dock button b { font-weight: 550; }
.dock button:hover { background: var(--fill); color: var(--ink); }
.dock button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.dock button[aria-expanded="true"] { background: rgba(255, 255, 255, 0.16); color: var(--ink); }
.tray { position: fixed; z-index: 3; top: 66px; right: 62px; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.tray > * { pointer-events: auto; }
body:has(#layers:not([hidden])) .tray { display: none; }
.legend-card { border-radius: 14px; padding: 4px 12px; max-width: 330px; }
.sun-bar { display: flex; align-items: center; gap: 8px; border-radius: 16px; padding: 8px 10px; width: 420px; max-width: calc(100vw - 80px); }
.sun-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.sun-line { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; overflow: hidden; }
.sun-line b { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sun-line span { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.sun-track { position: relative; height: 18px; }
.sun-track::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 4px; border-radius: 2px; background: rgba(120, 130, 190, 0.35); }
.sun-track i { position: absolute; top: 7px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #ff6a3d, #ffd166 22%, #fff3c4 50%, #ffd166 78%, #ff6a3d); }
.sun-track input { position: absolute; inset: 0; width: 100%; margin: 0; background: none; -webkit-appearance: none; appearance: none; }
.sun-track input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.35), 0 1px 4px rgba(0, 0, 0, 0.4); cursor: grab; }
.sun-track input::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.35); cursor: grab; }
.sun-bar .icon-btn { background: var(--fill); color: var(--ink); width: 34px; height: 34px; padding: 8px; }

/* What is under the pointer */
.probe {
  position: fixed; z-index: 2; left: calc(var(--side) + var(--gap) * 2); top: var(--gap);
  display: flex; align-items: baseline; gap: 10px; border-radius: 12px; padding: 7px 12px; font-size: 12px; color: var(--ink-2);
  font-variant-numeric: tabular-nums; pointer-events: none; white-space: nowrap;
}
.probe b { font-family: var(--display); font-size: 14px; color: var(--ink); font-weight: 600; }
@media (hover: none) { .probe { display: none; } }
body.flying .probe, body.flying .tray { opacity: 0; }

/* MapLibre's own controls, in the same ink */
.maplibregl-ctrl-group { background: var(--surface) !important; border: 0.5px solid rgba(255, 255, 255, 0.09); }
.maplibregl-ctrl-group button + button { border-top-color: var(--hairline) !important; }
.maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib { background: rgba(16, 18, 24, 0.72) !important; color: #a1a1aa; }
.maplibregl-ctrl-attrib a { color: #d4d4d8 !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); background-color: transparent !important; }
.maplibregl-ctrl-scale { background: rgba(16, 18, 24, 0.6); color: #e4e4e7; border-color: #e4e4e7; }
.search input::-webkit-search-cancel-button { filter: invert(1) grayscale(1); }
.readout { color: var(--ink); }

@media (max-width: 760px) {
  .dock button b { display: none; }
  .dock button { padding: 8px; }
  .tray { right: 8px; top: 62px; }
  .maplibregl-ctrl-top-right { top: 62px; }
  .brand { padding-top: 4px; }
}
.maplibregl-ctrl-attrib-inner { color: #a1a1aa; }
.maplibregl-popup { z-index: 5; }

/* Source of an itinerary */
.src { display: inline-flex; align-items: center; gap: 5px; flex: none; align-self: flex-start; font-size: 11px; font-weight: 600; color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.src img { width: 18px; height: 18px; border-radius: 5px; background: #fff; object-fit: cover; }
.tip-kind { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.from { margin: 6px 0 0; }
.from .src img { width: 20px; height: 20px; }

/* Phones: keep the map tools clear of the status bar and of each other */
@media (max-width: 760px) {
  .map-tools { top: calc(8px + env(safe-area-inset-top)); right: 8px; }
  .maplibregl-ctrl-top-right { top: calc(58px + env(safe-area-inset-top)); }
  .winter-chip { top: calc(60px + env(safe-area-inset-top)); max-width: calc(100vw - 66px); overflow: hidden; }
  .tray { top: calc(116px + env(safe-area-inset-top)); }
  .profile { height: 132px; }
}

/* Selecting on the map: the list of itineraries under one click, and how to let go of the open one */
.map-tip.map-pick .maplibregl-popup-content { pointer-events: auto; padding: 10px; gap: 6px; max-height: min(420px, 55vh); overflow-y: auto; }
.map-pick .tip-kind { color: var(--ink-3); padding: 0 4px 2px; }
.card[aria-current="true"] { box-shadow: inset 0 0 0 1.5px var(--accent); }
.view-bar { display: flex; align-items: center; justify-content: space-between; padding-right: 14px; }
.bar-hint { font-size: 11px; color: var(--ink-3); }
.bar-hint kbd { font: 600 10px ui-monospace, monospace; border: 1px solid var(--hairline); border-radius: 4px; padding: 1px 4px; }
@media (hover: none) { .bar-hint span { display: none; } }
/* Source chips in the filters: the badge takes the chip's colour, pressed or not */
.chips button .src { color: inherit; align-self: center; font-size: inherit; font-weight: inherit; }
.chips button .src img { width: 16px; height: 16px; }

/* Photos on the mountain */
.photo-tip .maplibregl-popup-content { padding: 6px; min-width: 0; gap: 6px; }
.photo-tip img { width: 200px; max-height: 150px; object-fit: cover; border-radius: 9px; display: block; }
.photo-tip b { font-size: 12.5px; padding: 0 4px 2px; }
.lightbox { position: fixed; inset: 0; z-index: 20; background: rgba(6, 8, 12, 0.9); display: grid; place-items: center; padding: 24px; }
.lightbox figure { margin: 0; display: grid; gap: 10px; max-width: min(1200px, 100%); max-height: 100%; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 130px); border-radius: 12px; object-fit: contain; margin: 0 auto; display: block; }
.lightbox figcaption { display: grid; gap: 3px; text-align: center; font-size: 12.5px; color: var(--ink-2); }
.lightbox figcaption b { font-family: var(--display); font-size: 16px; color: var(--ink); }
.lightbox a { color: var(--accent); text-decoration: none; }
.lightbox .icon-btn { position: fixed; width: 44px; height: 44px; padding: 11px; background: rgba(255, 255, 255, 0.12); color: #fff; }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; }
.lb-next { right: 18px; top: 50%; }

/* ---------- Fly: wind stations, take-offs and the wind they need ---------- */
.verdict { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.verdict::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--v); }
.rose { flex: none; align-self: center; display: block; margin-left: 8px; }
.need { display: flex; align-items: center; gap: 12px; margin: 4px 0 6px; }
.need .rose { margin: 0; }
.need p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.need p b { color: var(--ink); font-weight: 650; }
.note.warn { background: rgba(239, 68, 68, 0.16); color: var(--ink); }
.day { background: var(--card); border-radius: 12px; padding: 10px 10px 8px; margin: 0 0 8px; box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.07); }
.day-head { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.day-head b { font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.day-head small { color: var(--ink-3); flex: 1; }
.day-sum { margin: 3px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.day-sum b { color: var(--ink); font-weight: 600; }
.day-sum .verdict { margin-left: 4px; font-size: 12px; }
.hours { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; margin-top: 8px; }
.hr { position: relative; display: grid; justify-items: center; gap: 1px; padding: 3px 0 4px; border-radius: 6px; font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--v) 22%, transparent); box-shadow: inset 0 -3px 0 var(--v); }
.hr.now { outline: 1.5px solid var(--ink); }
.hr small { font-size: 10px; color: var(--ink-3); }
.hr i { font-style: normal; font-size: 13px; line-height: 1; }
.hr b { font-size: 12px; font-weight: 650; }
.hr em { font-style: normal; font-size: 10px; color: var(--ink-2); }
.hr u { position: absolute; top: 3px; right: 3px; width: 4px; height: 4px; border-radius: 50%; background: #38bdf8; }
.hours-key, .chart-key { font-size: 11px; color: var(--ink-3); line-height: 1.45; margin: 6px 2px 0; }
.chart { height: auto; margin-top: 8px; }
.chart text { font-size: 9px; fill: #85858f; font-variant-numeric: tabular-nums; }
.chart-key { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.chart-key i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: 3px; }
#fly-sheet .stat-grid { grid-template-columns: repeat(2, 1fr); }
#fly-sheet .seg { margin-bottom: 4px; }
a.pill { text-decoration: none; color: var(--ink); }
