/* =============================================================================
   BEYOND — interface styles
   Ink panels over a bright 3D scene, one cobalt accent, mono data labels
   (BEYOND-APP-DESIGN.md: the website's brand, inverted).
   ============================================================================= */

:root {
  /* BEYOND design tokens (BEYOND-APP-DESIGN.md) — shared with the website */
  --ink: #0D0F12;
  --snow: #EEF0EE;
  --paper: #FFFFFF;
  --cobalt: #2340FF;            /* the one accent: fills and active states */
  --cobalt-on-dark: #6B7FFF;    /* cobalt as text, focus ring or thin line on dark */
  --night-0: #0D0F12;           /* app background (= ink) */
  --night-1: #16191D;           /* panels */
  --night-2: #1F2328;           /* raised, hover, selected */
  --night-line: #2C3136;        /* hairlines on dark */
  /* hazard data: locked, identical on the website */
  --s25: #FFF5A0; --s30: #F7A934; --s35: #EB3B24; --s40: #8E1C12; --s45: #0B0B0B;
  --d1: #CCFF66; --d2: #FFFF00; --d3: #FF9900; --d4: #FF0000; --d5: #8B0000;

  /* app theme, from the tokens above */
  --glass: rgba(22, 25, 29, 0.74);          /* night-1, see-through over the map (user's choice, as the original app) */
  --glass-strong: rgba(22, 25, 29, 0.9);
  --glass-hi: rgba(238, 240, 238, 0.07);     /* raised / hover on the see-through panels */
  --line: #2C3136;
  --line-strong: #3A4047;
  --text: #EEF0EE;
  --text-dim: #9AA1A8;
  --text-faint: #6E757C;
  --accent: #6B7FFF;                         /* accent as text / lines on dark */
  --accent-fill: #2340FF;                    /* accent as a fill */
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(35, 64, 255, 0.18);
  --glow: #6B7FFF;
  --ok: #6B7FFF;
  --warn: #6B7FFF;                           /* interface notices: warm colours are hazard data only */
  --danger: #EEF0EE;
  --radius: 6px;
  --radius-sm: 2px;
  --shadow: none;                            /* depth from surface steps and hairlines */
  --rail-w: 64px;
  --panel-w: 320px;
  --top-h: 64px;
  --status-h: 36px;
  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Martian Mono', 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--night-0); color: var(--text);
  font: 13px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

#scene { position: fixed; inset: 0; }
#scene canvas { display: block; outline: none; }
body.picking #scene canvas { cursor: crosshair; }
body.drawing #scene canvas { cursor: copy; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- icons */
[data-icon] { display: inline-flex; width: 18px; height: 18px; flex: none; }
[data-icon] svg { width: 100%; height: 100%; }
.ico { color: var(--text-dim); }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--top-h);
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  pointer-events: none; z-index: 30;
}
.topbar > * { pointer-events: auto; }
.topbar::before {
  content: ''; position: fixed; left: 0; right: 0; top: 0; height: 120px; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 10, 16, 0.55) 0%, rgba(6, 10, 16, 0.22) 55%, rgba(6, 10, 16, 0) 100%);
}
.brand { display: flex; align-items: center; height: 40px; padding: 0 6px 0 4px; text-decoration: none; }
.brand img { height: 26px; width: auto; display: block; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55)); }   /* white logo: a soft shadow keeps it readable over snow */

.search {
  position: relative; display: flex; align-items: center; gap: 8px;
  width: min(440px, 46vw); height: 40px; padding: 0 12px; border-radius: 2px;
}
.search input {
  flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none;
  font-size: 14px; color: var(--text);
}
.search input::placeholder { color: var(--text-faint); }
.search input::-webkit-search-cancel-button { filter: invert(0.7); }
.search kbd { opacity: 0.6; }
.search:focus-within { border-color: rgba(107, 127, 255, 0.45); }
.search-results {
  position: absolute; top: 46px; left: 0; right: 0; max-height: 60vh; overflow: auto;
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.search-results .group { padding: 8px 10px 4px; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.search-results button {
  display: flex; width: 100%; align-items: center; gap: 10px; text-align: left;
  background: none; border: 0; border-radius: 2px; padding: 8px 10px; color: var(--text);
}
.search-results button small { color: var(--text-dim); margin-left: auto; font-family: var(--mono); font-size: 11px; }
.search-results button > svg { width: 16px; height: 16px; flex: none; color: var(--text-dim); }
.search-results button span small { display: block; line-height: 1.3; margin-top: 1px; }
.search-results button:hover, .search-results button.active { background: var(--accent-soft); }
.search-results .empty { padding: 10px; color: var(--text-dim); }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 6px; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--text);
}
.icon-btn:hover { border-color: var(--line-strong); background: rgba(30, 40, 54, 0.85); }
.icon-btn.small { width: 32px; height: 32px; border-radius: 2px; background: var(--glass-hi); }
.icon-btn.on { color: var(--accent); border-color: rgba(107, 127, 255, 0.4); }

.compass { width: 44px; height: 44px; border-radius: 50%; padding: 2px; border: 1px solid var(--line); }
.compass svg { width: 100%; height: 100%; }
.compass-ring { fill: none; stroke: rgba(255, 255, 255, 0.18); stroke-width: 1.5; }
.compass-needle { transform-origin: 20px 20px; transition: transform 0.08s linear; }
.needle-n { fill: var(--danger); }
.needle-s { fill: rgba(255, 255, 255, 0.75); }
.compass-n { display: none; }
.compass-sun { transform-origin: 20px 20px; transition: opacity 0.3s; }
.compass-sun circle { fill: #ffc94a; filter: drop-shadow(0 0 2px rgba(255, 201, 74, 0.9)); }
.sun-phase {
  margin-left: auto; margin-right: 8px; padding: 1px 7px; border-radius: 2px; font-size: 9.5px; letter-spacing: 0.08em;
  background: rgba(255, 201, 74, 0.16); color: #ffd98a;
}
.sun-phase[data-phase="golden"] { background: rgba(255, 150, 60, 0.2); color: #ffb877; }
.sun-phase[data-phase="blue"] { background: rgba(90, 140, 255, 0.2); color: #a9c4ff; }
.sun-phase[data-phase="twilight"], .sun-phase[data-phase="night"] { background: rgba(140, 150, 220, 0.16); color: #c3c9f2; }

/* ---------------------------------------------------------------- rail */
.rail {
  position: fixed; left: 14px; top: calc(var(--top-h) + 10px); bottom: calc(var(--status-h) + 24px);
  width: var(--rail-w); border-radius: 6px; padding: 8px 6px; z-index: 25;
  display: flex; flex-direction: column; gap: 4px;
}
.rail button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 7px; border: 0; border-radius: 6px; background: none; color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}
.rail button [data-icon] { width: 21px; height: 21px; }
.rail button em { font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
.rail button:hover { color: var(--text); background: var(--glass-hi); }
.rail button.on { color: var(--accent); background: var(--accent-soft); }
.rail button.on::before {
  content: ''; position: absolute; left: -7px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent);
}
.rail button.busy::after {
  content: ''; position: absolute; top: 6px; right: 10px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--glow); box-shadow: 0 0 8px var(--glow); animation: blink 1s infinite;
}
.rail-spacer { flex: 1; }

/* ---------------------------------------------------------------- panels */
.panels { position: fixed; left: calc(14px + var(--rail-w) + 10px); top: calc(var(--top-h) + 10px); z-index: 24; }
.panel {
  width: var(--panel-w); max-height: calc(100vh - var(--top-h) - var(--status-h) - 44px);
  border-radius: 6px; display: flex; flex-direction: column; overflow: hidden;
  animation: panelIn 0.18s ease-out;
}
.panel.wide { width: 360px; }
@keyframes panelIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.panel > header, .modal-card > header, .profile > header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 14px 10px 18px; border-bottom: 1px solid var(--line);
}
h2 {
  margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text);
}
.close {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 2px;
  border: 0; background: none; color: var(--text-dim);
}
.close:hover { background: var(--glass-hi); color: var(--text); }
.panel-body { padding: 14px 18px 18px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.panel-body::-webkit-scrollbar, .search-results::-webkit-scrollbar { width: 8px; }
.panel-body::-webkit-scrollbar-thumb, .search-results::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 2px; }

.lead { margin: 0; color: var(--text); font-size: 13px; }
.hint { margin: 0; color: var(--text-dim); font-size: 12px; }
.small { margin: 0 0 6px; color: var(--text-dim); font-size: 12px; }
.muted { color: var(--text-dim); font-weight: 400; }
.micro {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 8px;
}
.micro output { font-family: var(--mono); letter-spacing: 0; text-transform: none; color: var(--text); font-weight: 600; }
.field { display: flex; flex-direction: column; }

/* a panel in parts (Settings: settings + data credits), each under a ruled heading */
.panel-part { display: flex; flex-direction: column; gap: 16px; }
.panel-part + .panel-part { margin-top: 12px; }
.panel-part > h3 {
  margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--snow);
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text);
}
.credits { margin: 0; }
.credits dt {
  margin-bottom: 3px; color: var(--text-dim);
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
}
.credits dd { margin: 0 0 11px; color: var(--text-dim); font-size: 12px; line-height: 1.45; overflow-wrap: break-word; }
.credits dd:last-child { margin-bottom: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--glass-hi);
  color: var(--text); font-weight: 600; font-size: 12.5px; white-space: nowrap;
}
.btn [data-icon] { width: 16px; height: 16px; }
.btn:hover { background: rgba(255, 255, 255, 0.1); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn.primary:hover { background: #3a55ff; }
.btn.ghost { background: none; border-color: transparent; color: var(--text-dim); }
.btn.ghost:hover { color: var(--text); background: var(--glass-hi); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.danger { color: #ffb3bb; }
.link { background: none; border: 0; color: var(--accent); padding: 2px 4px; font-size: 12px; font-weight: 600; }
.link:hover { text-decoration: underline; }

.segmented { display: flex; padding: 3px; gap: 3px; border-radius: 6px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); }
.segmented button {
  flex: 1; height: 30px; border: 0; border-radius: 2px; background: none; color: var(--text-dim); font-weight: 600; font-size: 12px;
}
.segmented button:hover { color: var(--text); }
.segmented button.on { background: rgba(255, 255, 255, 0.12); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.segmented.small button { height: 26px; font-size: 11.5px; padding: 0 8px; }
.segmented.wrap { flex-wrap: wrap; }
.segmented.wrap button { flex: 1 1 auto; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card {
  display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 10px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); text-align: left;
}
.card .swatch { grid-row: span 2; width: 30px; height: 30px; border-radius: 2px; border: 1px solid rgba(255, 255, 255, 0.15); }
.card b { font-size: 12.5px; font-weight: 600; }
.card small { font-size: 10.5px; color: var(--text-dim); line-height: 1.25; }
.card:hover { border-color: var(--line-strong); }
.card.on { border-color: rgba(107, 127, 255, 0.55); background: var(--accent-soft); }
.sw-none { background: linear-gradient(135deg, #f4f7fb 0 50%, #8c96a3 50%); }
.sw-slope { background: linear-gradient(135deg, #fdfd96 0 25%, #ffa500 25% 50%, #ff0000 50% 75%, #1a1a1a 75%); }
.sw-aspect { background: conic-gradient(#0000ff 0 12.5%, #add8f2 0 25%, #fff 0 37.5%, #f29e9e 0 50%, #f23333 0 62.5%, #9e2626 0 75%, #333 0 87.5%, #33338c 0); }
.sw-elev { background: linear-gradient(180deg, #7a0403, #fb8022, #d2e935, #32f298, #28bceb, #4662d7, #30123b); }
.sw-avy { background: linear-gradient(135deg, #ccff66 0 25%, #ffff00 25% 50%, #ff9900 50% 75%, #ff0000 75%); }
.sw-snowfall { background: linear-gradient(180deg, #e3f2ff, #62b0ff 40%, #3c4fd6 70%, #b02fb2); }
.overlay-cards .card:last-child:nth-child(odd) { grid-column: span 2; }
.sw-newsnow { background: radial-gradient(circle at 35% 30%, #ffffff 0 18%, transparent 19%), radial-gradient(circle at 70% 65%, #ffffff 0 14%, transparent 15%), linear-gradient(180deg, #a9d6ff, #2f7bf0); }
.wx-place { display: flex; flex-direction: column; gap: 8px; padding-bottom: 4px; }
#wxPlace b { display: block; font-size: 15px; }
#wxPlace small { color: var(--text-dim); font-size: 11.5px; font-family: var(--mono); }
.btn.small { height: 28px; padding: 0 10px; font-size: 11.5px; gap: 5px; }
.btn.small [data-icon] { width: 14px; height: 14px; display: inline-flex; }
#wxPick.on { border-color: var(--accent); color: var(--accent); }
.wx-body { display: flex; flex-direction: column; gap: 10px; }
.wx-head { display: flex; align-items: center; justify-content: space-between; }
.wx-head small { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.wx-days tr.wx-det { display: none; }
.wx-more-on .wx-days tr.wx-det { display: table-row; }
.wx-days tr.wx-det td { text-align: left; border-top: none; padding: 2px 0 8px; font-family: var(--font); }
.wx-sun { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-dim); margin-bottom: 5px; }
.wx-sun > span { min-width: 72px; color: #ffd36b; }
.wx-sun small { font-size: 9.5px; color: var(--text-faint); }
.wx-strip { flex: 1; display: flex; gap: 1px; height: 10px; }
.wx-strip i { flex: 1; border-radius: 2px; background: rgba(255, 200, 60, calc(0.08 + 0.92 * var(--f))); }
.wx-grid, .wx-cond { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 11.5px; }
.wx-grid span, .wx-cond > span { color: var(--text-dim); }
.wx-grid b { font-family: var(--mono); font-weight: 500; text-align: right; }
.wx-cond b { font-weight: 500; text-align: right; }
.wx-cond small { color: var(--text-faint); font-weight: 400; }
.wx-cond .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.wx-flag { display: inline-block; margin-top: 4px; font-size: 10.5px; color: #ffcf8a; }
.wx { display: flex; flex-direction: column; gap: 7px; padding: 10px 11px; border-radius: 6px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); }
.wx-now { display: flex; align-items: center; gap: 10px; }
.wx-icon { font-size: 28px; line-height: 1; }
.wx-now b { display: block; font-size: 17px; font-family: var(--mono); }
.wx-now small { color: var(--text-dim); font-size: 11.5px; }
.wx .mt-rows { font-size: 12px; }
.wx-days { width: 100%; border-collapse: collapse; font-size: 11.5px; font-family: var(--mono); }
.wx-days th { font: 600 9.5px var(--font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); text-align: right; padding: 0 0 3px; }
.wx-days td { padding: 3px 0; text-align: right; border-top: 1px solid var(--line); color: var(--text-dim); }
.wx-days td:first-child { text-align: left; color: var(--text); font-family: var(--font); }
.wx-days td:nth-child(2) { text-align: center; }
.wx-days td.sn { color: #9fd0ff; font-weight: 700; }
.wx .mt-foot a { color: var(--accent); }

/* avalanche bulletin (Inspect panel) */
.avy { display: flex; flex-direction: column; gap: 7px; padding: 10px 11px; border-radius: 6px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); }
.avy-title small, .avy-ahead > small { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.avy-head { display: flex; align-items: center; gap: 10px; }
.avy-head .avy-badge { font-size: 17px; min-width: 38px; height: 34px; border-radius: 2px; }
.avy-head b { display: block; font-size: 15px; }
.avy-head small { color: var(--text-dim); font-size: 11.5px; }
.avy-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 4px;
  border-radius: 5px; font-family: var(--mono); font-weight: 700; font-size: 11.5px; color: #111; background: #9aa4b1; vertical-align: -2px;
}
.avy-badge.l1 { background: #ccff66; } .avy-badge.l2 { background: #ffff00; } .avy-badge.l3 { background: #ff9900; }
.avy-badge.l4 { background: #ff0000; color: #fff; }
.avy-badge.l5 { background: repeating-linear-gradient(45deg, #c00000 0 4px, #111 4px 8px); color: #fff; }
.avy-line { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.avy-line b { color: var(--text); font-weight: 600; }
.avy-problems { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.avy-problems li { display: flex; align-items: center; gap: 9px; }
.avy-problems b { display: block; font-size: 12.5px; font-weight: 600; }
.avy-problems small { font-size: 11px; color: var(--text-dim); }
.avy-rose { width: 34px; height: 34px; flex: none; }
.avy-text { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--text-dim); }
.avy-text small { color: var(--text-faint); }
.avy-ahead { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.avy-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.avy-foot small { font-size: 10.5px; color: var(--text-faint); }
.avy-foot a { font-size: 12px; color: var(--accent, #6B7FFF); text-decoration: none; white-space: nowrap; }
#avyField .input { width: auto; }
.chips button:disabled { opacity: 0.4; cursor: not-allowed; }

/* inputs */
.input {
  height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.3); color: var(--text); outline: none; color-scheme: dark;
}
.input:focus { border-color: rgba(107, 127, 255, 0.5); }
.input.big { height: 44px; font-size: 22px; font-weight: 700; font-family: var(--mono); width: 110px; text-align: center; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; margin: 0; flex: 1;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--fill, 50%), rgba(255, 255, 255, 0.14) var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 0 0 3px rgba(107, 127, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.4);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0;
  box-shadow: 0 0 0 3px rgba(107, 127, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span {
  position: relative; width: 34px; height: 20px; border-radius: 6px; background: rgba(255, 255, 255, 0.16); flex: none;
  transition: background 0.15s;
}
.toggle span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(14px); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle:has(input:disabled) { cursor: default; color: var(--text-dim); }
.toggle input:disabled + span { opacity: 0.45; }

.toggle-list { display: flex; flex-direction: column; gap: 10px; }
.toggle small { margin-left: 4px; font-size: 11px; }
.piste-key { display: flex; flex-wrap: wrap; gap: 4px 11px; margin: -3px 0 2px 40px; font-size: 11px; color: var(--text-dim); }
.piste-key span { display: inline-flex; align-items: center; gap: 5px; }
.piste-key i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.piste-key i.dash { background: repeating-linear-gradient(90deg, #ff8a00 0 5px, transparent 5px 8px); }
.piste-key i.lift { height: 2px; background: #c9d1db; position: relative; }
.piste-key i.lift::after { content: ''; position: absolute; right: -2px; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button {
  height: 26px; padding: 0 9px; border-radius: 2px; border: 1px solid var(--line-strong); background: none;
  color: var(--text-dim); font-size: 11.5px; font-weight: 600;
}
.chips button:hover, .chips button.on { color: var(--text); border-color: rgba(107, 127, 255, 0.5); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-grid > div { padding: 9px 11px; border-radius: 6px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); }
.stat-grid small { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.stat-grid b { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.stat-grid.three { grid-template-columns: repeat(3, 1fr); }

.sun-scale { display: flex; justify-content: space-between; margin: 4px 0 0 40px; font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

kbd {
  display: inline-block; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px;
  font: 600 11px var(--mono); color: var(--text-dim); background: rgba(255, 255, 255, 0.04);
}

/* ---------------------------------------------------------------- SLABS panel */
.disclaimer {
  display: flex; gap: 10px; padding: 10px 12px; border-radius: 6px;
  background: rgba(255, 176, 32, 0.1); border: 1px solid rgba(255, 176, 32, 0.28); color: #ffe3b0;
}
.disclaimer p { margin: 0; font-size: 12px; }
.disclaimer [data-icon] { color: var(--warn); margin-top: 1px; }
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.step b { display: block; margin-bottom: 2px; }
.step .hint { margin-bottom: 9px; }
.step-n {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(107, 127, 255, 0.35);
}
.step.done .step-n { background: var(--accent); color: var(--accent-ink); }
.sel-info { margin-top: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); }
.sel-info b { color: var(--text); font-weight: 600; }
.sel-info .warn { color: var(--warn); }
.sel-info .bad { color: var(--danger); }

.progress { display: flex; flex-direction: column; gap: 6px; }
.progress-bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #c4ecff); transition: width 0.2s; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); font-family: var(--mono); }

.slabs-results { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; border-top: 1px solid var(--line); }
.results-head { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; }
.results-head .muted { font-size: 11.5px; font-family: var(--mono); }
.class-bars { display: flex; flex-direction: column; gap: 6px; }
.class-bar { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; font-size: 12px; }
.class-bar i { width: 12px; height: 12px; border-radius: 3px; }
.class-bar .bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; grid-column: 2; }
.class-bar .bar span { display: block; height: 100%; }
.class-bar output { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); grid-row: span 2; }
.class-bar .name { grid-column: 2; display: flex; justify-content: space-between; }
.class-bar .name small { color: var(--text-faint); font-family: var(--mono); }

/* ---------------------------------------------------------------- routes */
.drawing-hint {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 6px;
  background: rgba(255, 138, 61, 0.12); border: 1px solid rgba(255, 138, 61, 0.35); font-size: 12px;
}
.drawing-hint span { color: var(--text-dim); }
.route-list { display: flex; flex-direction: column; gap: 8px; }
.route-item {
  padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
  display: flex; flex-direction: column; gap: 8px;
}
.route-item.on { border-color: rgba(255, 138, 61, 0.55); }
.route-item .top { display: flex; align-items: center; gap: 8px; }
.route-item .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.route-item .name { flex: 1; min-width: 0; font-weight: 600; color: var(--text); padding: 2px 0; outline: none; cursor: text;
  overflow-wrap: anywhere; border-bottom: 1px solid transparent; }
.route-item .name:hover { border-bottom-color: var(--line-strong); }
.route-item .name:focus { border-bottom-color: var(--accent); }
.route-item .top { align-items: flex-start; }
.route-item .top .dot { margin-top: 6px; }
.route-item .stats { display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); }
.route-item .stats b { color: var(--text); font-weight: 600; }
.route-item .actions { display: flex; gap: 2px; margin: -2px 0 0 12px; }   /* own row under the name */
.route-item .actions button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 2px; background: none; color: var(--text-dim); }
.route-item .actions button:hover { background: var(--glass-hi); color: var(--text); }
.route-item .actions [data-icon] { width: 15px; height: 15px; }
.route-mode { margin-top: 2px; }
.route-risk { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--text-dim); }
.route-risk b { font-weight: 600; }
.route-risk small { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }
.risk-bar { display: flex; height: 6px; border-radius: 6px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.risk-bar i { display: block; height: 100%; }
.route-risk-progress { display: flex; flex-direction: column; gap: 4px; }
.route-risk-progress em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.route-time { display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); }
.route-time b { color: var(--text); font-size: 13px; }

/* ---------------------------------------------------------------- probe */
.probe-card { display: flex; flex-direction: column; gap: 10px; }
.probe-card .coords { font-family: var(--mono); font-size: 12px; color: var(--text-dim); display: grid; gap: 4px; }
.probe-card .coords b { color: var(--text); font-weight: 600; }
.aspect-mini { width: 38px; height: 38px; }

/* ---------------------------------------------------------------- places */
.place-list { display: grid; grid-template-columns: 1fr; gap: 4px; max-height: 280px; overflow: auto; }
.place-list button {
  display: flex; align-items: center; gap: 9px; text-align: left; padding: 8px 10px; border-radius: 2px;
  border: 0; background: none; color: var(--text);
}
.place-list button:hover { background: var(--glass-hi); }
.place-list [data-icon] { color: var(--text-faint); width: 15px; height: 15px; }

/* ---------------------------------------------------------------- legends */
.legend-dock {
  position: fixed; right: 16px; bottom: calc(var(--status-h) + 24px); z-index: 20;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none;
  max-height: calc(100vh - var(--top-h) - var(--status-h) - 50px); overflow-y: auto; scrollbar-width: none;
}
.legend-dock::-webkit-scrollbar { display: none; }
.legend {
  pointer-events: auto; min-width: 190px; padding: 12px 14px; border-radius: 6px;
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); animation: panelIn 0.18s ease-out;
}
.legend h3 { margin: 0 0 9px; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.legend li { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.legend li i { width: 22px; height: 12px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.18); flex: none; }
.legend li small { margin-left: auto; padding-left: 10px; color: var(--text-faint); font-family: var(--mono); font-size: 10.5px; }
.legend .ramp { height: 10px; border-radius: 5px; margin: 4px 0; }
.legend .scale { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 4px 0 2px; }
.legend .scale i { flex: 1; }
.legend .scale-labels { display: flex; font-family: var(--mono); font-size: 10px; color: var(--text-dim); }
.legend .scale-labels span { flex: 1; }
.legend .ramp-labels { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); }
.legend .rose { display: block; width: 132px; height: 132px; margin: 0 auto; }
.legend .note { margin: 8px 0 0; font-size: 10.5px; color: var(--text-faint); max-width: 210px; }

/* ---------------------------------------------------------------- profile */
.profile {
  position: fixed; left: calc(14px + var(--rail-w) + 10px); right: 230px; bottom: calc(var(--status-h) + 24px);
  height: 236px; border-radius: 6px; z-index: 22; display: flex; flex-direction: column; overflow: hidden;
}
.profile > header { padding: 8px 10px 6px 16px; }
.profile > header { display: flex; align-items: flex-start; gap: 16px; }
.profile header > b { font-size: 13px; padding-top: 3px; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.profile-stats { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 18px; min-width: 0; }
.profile-stats .st { display: flex; flex-direction: column; line-height: 1.2; }
.profile-stats .st small { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.profile-stats .st span { font: 600 12.5px var(--mono); color: var(--text); white-space: nowrap; }
.profile-stats .st span em { font-style: normal; font-weight: 400; color: var(--text-dim); font-size: 11px; }
.profile-stats .st.warn span { color: #ffb347; }
.profile-stats .sep { width: 1px; align-self: stretch; background: var(--line); }
.profile canvas { flex: 1; width: 100%; min-height: 0; cursor: crosshair; }
body.panel-open .profile { left: calc(14px + var(--rail-w) + 20px + var(--panel-w)); }
body.panel-wide .profile { left: calc(14px + var(--rail-w) + 20px + 360px); }

/* ---------------------------------------------------------------- status bar */
.statusbar {
  position: fixed; left: 14px; right: 14px; bottom: 12px; height: var(--status-h); z-index: 26;
  border-radius: 6px; display: flex; align-items: center; gap: 16px; padding: 0 14px;
  font-family: var(--mono); font-size: 12px;
}
.telemetry {
  display: flex; align-items: center; min-width: 0; flex: 1; color: var(--ok); text-transform: uppercase; letter-spacing: 0.08em;
  white-space: nowrap; overflow: hidden; text-shadow: 0 0 10px rgba(61, 220, 151, 0.35);
}
.telemetry span { overflow: hidden; text-overflow: ellipsis; }
.caret { width: 7px; height: 14px; margin-left: 3px; background: var(--ok); animation: blink 1s steps(1) infinite; flex: none; }
@keyframes blink { 50% { opacity: 0; } }
.readout { display: flex; gap: 18px; color: var(--text); white-space: nowrap; }
.readout span { display: flex; align-items: baseline; gap: 6px; }
.readout small { color: var(--text-faint); font-size: 10px; letter-spacing: 0.1em; }
.readout b { font-weight: 600; min-width: 46px; }
.readout .ro-coord b { min-width: 150px; }
.sys { display: flex; gap: 14px; align-items: center; color: var(--text-dim); white-space: nowrap; }
.loader { display: flex; align-items: center; gap: 7px; }
.loader i {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(107, 127, 255, 0.25); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.diag { color: var(--text-faint); }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; top: calc(var(--top-h) + 10px); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 6px;
  background: var(--glass-strong); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 13px;
  animation: toastIn 0.2s ease-out;
}
.toast.warn { border-color: rgba(255, 176, 32, 0.45); }
.toast.error { border-color: rgba(255, 77, 94, 0.55); }
.toast.ok { border-color: rgba(61, 220, 151, 0.45); }
.toast.out { opacity: 0; transform: translateY(-6px); transition: all 0.25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* drawing an area on a phone (UI.showPickBar): the panel steps aside, this bar stays */
.pick-bar { display: none; }
@media (max-width: 760px) {
  body.area-drawing .panels { visibility: hidden; }
  body.area-drawing .pick-bar:not([hidden]) {
    position: fixed; z-index: 55; left: 10px; right: 10px; top: calc(var(--top-h) + 6px);
    display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 6px;
    background: var(--glass-strong); border: 1px solid var(--line-strong); border-left: 2px solid var(--accent);
    box-shadow: var(--shadow); font-size: 13px;
  }
  .pick-bar span { flex: 1; }
  .pick-bar button {
    display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 2px;
    background: var(--glass-hi); border: 1px solid var(--line); color: inherit; font: inherit;
  }
  .pick-bar button svg { width: 14px; height: 14px; }
}
/* persistent terrain warnings (TerrainNotices.js): glacier slopes, coarse terrain */
.toast.notice { align-items: flex-start; width: min(460px, calc(100vw - 32px)); padding: 10px 8px 10px 12px; background: rgba(38, 30, 14, 0.92); color: #ffe9c2; }
.toast.notice .ni { color: var(--warn); flex: none; margin-top: 1px; }
.toast.notice p { margin: 0; flex: 1; font-size: 12px; line-height: 1.45; }
.toast.notice p b { display: block; font-size: 13px; color: #fff3dc; margin-bottom: 2px; }
.toast.notice .nx { flex: none; width: 24px; height: 24px; margin: -3px 0 0; border: 0; border-radius: 6px; background: none; color: #ffe9c2; font-size: 18px; line-height: 1; cursor: pointer; opacity: 0.75; }
.toast.notice .nx:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); }

/* ---------------------------------------------------------------- modals */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(4, 8, 14, 0.45); padding: 20px; animation: fadeIn 0.15s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-card { width: min(720px, 100%); max-height: calc(100vh - 40px); border-radius: 6px; display: flex; flex-direction: column; overflow: hidden; background: var(--glass-strong); }
.modal-card.narrow { width: min(460px, 100%); }
.modal-card header h2 { margin-bottom: 3px; }
.modal-card header p { margin: 0; font-size: 12.5px; }
.modal-body { padding: 18px 22px; overflow: auto; display: flex; flex-direction: column; gap: 18px; }
.modal-card > footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); }
.modal-card > footer .muted { font-family: var(--mono); font-size: 11.5px; }
#welcomeDialog .modal-body { gap: 14px; }
#welcomeDialog .small { margin: 0; }
.beta-tag { display: inline-block; margin-left: 6px; padding: 2px 6px; border: 1px solid var(--accent); border-radius: 2px; color: var(--accent); font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: middle; }
.lead abbr { text-decoration: none; cursor: help; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.danger-levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.danger-levels button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px; border-radius: 6px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--text-dim);
}
.danger-levels b { font-size: 20px; color: var(--text); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 2px; }
.danger-levels small { font-size: 10.5px; }
.danger-levels button[data-dl="1"] b { background: #ccff66; color: #1e2a00; }
.danger-levels button[data-dl="2"] b { background: #ffff00; color: #2a2a00; }
.danger-levels button[data-dl="3"] b { background: #ff9900; color: #2a1600; }
.danger-levels button[data-dl="4"] b { background: #ff0000; color: #fff; }
.danger-levels button[data-dl="5"] b { background: repeating-linear-gradient(45deg, #ff0000 0 6px, #111 6px 12px); color: #fff; }
.danger-levels button.on { border-color: rgba(107, 127, 255, 0.7); background: var(--accent-soft); color: var(--text); }

.aspect-rose { width: 210px; height: 210px; margin: 0 auto; }
.aspect-rose svg { width: 100%; height: 100%; }
.aspect-rose .sector { fill: rgba(255, 255, 255, 0.06); stroke: rgba(255, 255, 255, 0.2); stroke-width: 1; cursor: pointer; transition: fill 0.12s; }
.aspect-rose .sector:hover { fill: rgba(107, 127, 255, 0.25); }
.aspect-rose .sector.on { fill: #3c4a5c; }
.aspect-rose .sector.on.critical { fill: #1f6fd1; }
.aspect-rose text { fill: var(--text); font: 600 12px var(--font); pointer-events: none; }
.aspect-rose .center { fill: var(--glass-strong); stroke: rgba(255, 255, 255, 0.2); }

.ce-box { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: var(--text-dim); }

.help-grid { display: grid; grid-template-columns: 1fr; gap: 9px; }
.help-grid div { display: flex; align-items: center; gap: 8px; }
.help-grid span { margin-left: auto; color: var(--text-dim); }

/* ---------------------------------------------------------------- loading */
.loading {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(circle at 50% 40%, #16263a 0%, #0b1119 70%); transition: opacity 0.8s ease;
}
.loading img { width: min(340px, 72vw); height: auto; margin-bottom: 30px; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.65; } }
.loading-bar { width: 220px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.loading-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.loading p { margin: 10px 0 0; font: 12px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); }
.loading.done { opacity: 0; pointer-events: none; }

/* ---------------------------------------------------------------- RSA inspector marker label */
.map-label {
  position: fixed; z-index: 15; pointer-events: none; transform: translate(-50%, -130%);
  padding: 4px 8px; border-radius: 2px; background: var(--glass-strong); border: 1px solid var(--line-strong);
  font: 600 11px var(--mono); color: var(--text); white-space: nowrap;
}

.attribution {
  position: fixed; left: calc(14px + var(--rail-w) + 12px); bottom: calc(var(--status-h) + 16px); z-index: 19; font-size: 10px; color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); pointer-events: none;
}

/* ---------------------------------------------------------------- lift / piste hover */
.ski-tip {
  position: fixed; left: 0; top: 0; z-index: 16; pointer-events: none;
  display: flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 2px;
  background: var(--glass-strong); border: 1px solid var(--line-strong); color: var(--text);
  font-size: 12px; white-space: nowrap; box-shadow: var(--shadow);
}
.ski-tip span { color: var(--text-dim); font-size: 11px; }
.ski-tip i { width: 14px; height: 4px; border-radius: 2px; flex: none; }
.ski-tip i.dash { background: repeating-linear-gradient(90deg, #ff8a00 0 5px, transparent 5px 8px) !important; }
.ski-tip i.lift { height: 2px; background: #c9d1db; }
.area-tip { align-items: flex-start; max-width: 340px; white-space: normal; }
.area-tip .at { display: flex; flex-direction: column; gap: 1px; }
.area-tip .at span { color: var(--text); font-size: 11.5px; }
.area-tip .at small { color: var(--text-dim); font-size: 11px; line-height: 1.3; }
.area-tip i.sw { width: 12px; height: 12px; border-radius: 3px; margin-top: 2px; }
.sw.binding { background: rgba(228, 48, 38, 0.55); box-shadow: inset 0 0 0 2px #c41a14; }
.sw.voluntary { background: rgba(255, 198, 0, 0.5); box-shadow: inset 0 0 0 2px #d69600; }
.sw.reserve { background: rgba(40, 150, 72, 0.2); box-shadow: inset 0 0 0 2px #1e803c; }
.sw.glacier { background: rgba(166, 218, 244, 0.8); box-shadow: inset 0 0 0 2px #2884c0; }

/* ---------------------------------------------------------------- place names (OSM) */
#names { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.pn { position: absolute; left: 0; top: 0; will-change: transform; transition: opacity 0.28s ease; }
.pn.off { opacity: 0; }
.pn-b {
  position: absolute; left: 0; bottom: -4px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.pn-tx {
  white-space: nowrap; font: 600 11.5px/1.1 var(--font); color: #2a2017; letter-spacing: 0.01em;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 4px rgba(255, 255, 255, 0.9);
}
.pn-tx em { font: 500 10px/1 var(--font); font-style: normal; margin-left: 4px; color: #5a4733; }
.pn-mk { display: block; width: 8px; height: 8px; }
/* peaks: dark triangle */
.t-peak .pn-mk { width: 9px; height: 7px; background: #3a2c1e; clip-path: polygon(50% 0, 100% 100%, 0 100%); filter: drop-shadow(0 0 1px #fff); }
/* passes: )( */
.t-pass .pn-tx { font: italic 500 11px/1.1 var(--font); color: #3a2c1e; }
.t-pass .pn-mk { width: auto; height: 9px; font: 700 9px/9px var(--font); color: #3a2c1e; text-shadow: 0 0 2px #fff; }
.t-pass .pn-mk::before { content: ')('; letter-spacing: -0.5px; }
/* huts and bivouacs: red house */
.t-hut .pn-tx { font: 600 11px/1.1 var(--font); color: #a3201b; }
.t-bivouac .pn-tx { font: 500 10.5px/1.1 var(--font); color: #a3201b; }
.t-hut .pn-mk, .t-bivouac .pn-mk {
  width: 9px; height: 9px; background: #c62a22; clip-path: polygon(50% 0, 100% 45%, 100% 100%, 0 100%, 0 45%);
}
.t-bivouac .pn-mk { width: 7px; height: 7px; background: #fff; box-shadow: inset 0 0 0 2px #c62a22; }
/* settlements */
.t-city .pn-tx { font: 700 14.5px/1.1 var(--font); color: #11161c; }
.t-town .pn-tx { font: 700 13px/1.1 var(--font); color: #151a21; }
.t-village .pn-tx { font: 600 12px/1.1 var(--font); color: #1d232b; }
.t-hamlet .pn-tx { font: 500 11px/1.1 var(--font); color: #39414c; }
.t-city .pn-mk, .t-town .pn-mk, .t-village .pn-mk, .t-hamlet .pn-mk {
  border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #1d232b;
}
.t-city .pn-mk { width: 9px; height: 9px; }
.t-town .pn-mk { width: 7px; height: 7px; }
.t-village .pn-mk { width: 5px; height: 5px; box-shadow: 0 0 0 1.5px #1d232b; }
.t-hamlet .pn-mk { width: 4px; height: 4px; box-shadow: 0 0 0 1.5px #39414c; }
.t-glacier .pn-b { bottom: -7px; }
.t-glacier .pn-tx { font: italic 500 11px/1.1 var(--font); color: #1a66a0; letter-spacing: 0.03em; }
.t-glacier .pn-mk { display: none; }
/* dusk and night: light text on a dark halo */
#names.dark .pn-tx { color: #eef2f6; text-shadow: 0 0 2px #05080c, 0 0 2px #05080c, 0 0 4px rgba(5, 8, 12, 0.85); }
#names.dark .pn-tx em { color: #b9c3cf; }
#names.dark .t-hamlet .pn-tx { color: #c9d2dc; }
#names.dark .t-hut .pn-tx, #names.dark .t-bivouac .pn-tx { color: #ff9a90; }
#names.dark .t-glacier .pn-tx { color: #9fd4f6; }
#names.dark .t-peak .pn-mk { background: #e6ebf0; filter: drop-shadow(0 0 1px #000); }
#names.dark .t-pass .pn-mk { color: #e6ebf0; text-shadow: 0 0 2px #000; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .readout .ro-coord { display: none; }
  .profile { right: 16px; }
}
/* ---------------------------------------------------------------- refine (2 m terrain) */
.refine-btn {
  position: fixed; left: 50%; bottom: calc(var(--status-h) + 24px); transform: translateX(-50%); z-index: 21;
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 11px; border-radius: 19px;
  border: 1px solid var(--line-strong); color: var(--text); font-size: 12.5px; box-shadow: var(--shadow);
  animation: refineIn 0.25s ease;
}
.refine-btn [data-icon] { width: 18px; height: 18px; display: inline-flex; }
.refine-btn small { color: var(--text-dim); font-size: 11px; }
.refine-btn:hover { border-color: var(--accent); }
.refine-btn.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 0 18px rgba(107, 127, 255, 0.35), var(--shadow); color: var(--accent); }
.refine-btn.on small { color: var(--accent); }
.refine-btn.busy [data-icon] { animation: refinePulse 1s ease-in-out infinite; }
@keyframes refineIn { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes refinePulse { 50% { opacity: 0.35; } }

@media (max-width: 760px) {
  :root { --top-h: 58px; --status-h: 32px; }
  .brand img { height: 20px; }
  .topbar { gap: 10px; padding: 9px 10px; }
  .search { width: auto; flex: 1; min-width: 0; }
  .search input { font-size: 16px; } /* 16px stops iOS from zooming into the field */
  .search kbd { display: none; }
  .search-results { max-height: 50vh; }
  #viewModeBtn, #helpBtn { display: none; }
  .rail {
    top: auto; left: 10px; right: 10px; bottom: calc(var(--status-h) + 18px); width: auto; height: 60px;
    flex-direction: row; padding: 5px; border-radius: 6px;
  }
  .rail button { flex: 1; padding: 6px 0 4px; }
  .refine-btn { bottom: calc(var(--status-h) + 88px); }
  .rail button.on::before { display: none; }
  .rail-spacer { display: none; }
  .panels { left: 10px; right: 10px; top: auto; bottom: calc(var(--status-h) + 86px); }
  .panel, .panel.wide { width: auto; max-height: 52vh; }
  .readout span:nth-child(3) { display: none; }
  .telemetry { display: none; }
  .legend-dock { top: calc(var(--top-h) + 6px); bottom: auto; right: 10px; gap: 6px; }
  .legend { min-width: 0; max-width: 230px; padding: 8px 11px; }
  .legend h3 { margin-bottom: 7px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
  .legend h3::after { content: '▾'; margin-left: auto; font-size: 11px; letter-spacing: 0; }
  .legend.collapsed h3 { margin: 0; }
  .legend.collapsed h3::after { content: '▸'; }
  .legend.collapsed > :not(h3) { display: none; }
  .legend li { font-size: 11.5px; }
  .legend li small, .legend .note { display: none; }
  .profile { left: 10px !important; right: 10px; bottom: calc(var(--status-h) + 86px); height: 236px; }
  .profile > header { flex-wrap: wrap; gap: 2px 10px; padding: 7px 6px 4px 12px; }
  .profile header > b { flex: 1; max-width: none; }
  .profile header .close { order: 2; }
  .profile-stats {
    order: 3; flex-basis: 100%; flex-wrap: nowrap; gap: 14px; overflow-x: auto; padding-bottom: 3px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .profile-stats::-webkit-scrollbar { display: none; }
  .profile-stats .st { flex: none; }
  .profile-stats .st span { font-size: 12px; }
  .profile-stats .st span em, .profile-stats .sep { display: none; }
  .profile canvas { min-height: 110px; }
  .two-col { grid-template-columns: 1fr; }
  .danger-levels small { display: none; }
  .statusbar { left: 10px; right: 10px; bottom: 8px; }
  .attribution { left: 14px; right: 14px; bottom: calc(var(--status-h) + 84px); font-size: 9px; text-align: right; }
}

/* ---------------------------------------------------------------- point markers (snow stations, webcams) */
.markers { position: fixed; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.mk { position: absolute; left: 0; top: 0; will-change: transform; }
.mk-b {
  position: absolute; left: 0; bottom: 3px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 2px 6px 2px 3px; border-radius: 2px;
  background: rgba(14, 18, 24, 0.82); border: 1px solid rgba(255, 255, 255, 0.22); color: #f2f5f8;
  font: 700 11px/14px var(--mono); white-space: nowrap; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.mk-b::after { content: ''; position: absolute; left: 50%; bottom: -4px; width: 6px; height: 6px; transform: translateX(-50%) rotate(45deg); background: inherit; border-right: 1px solid rgba(255, 255, 255, 0.22); border-bottom: 1px solid rgba(255, 255, 255, 0.22); }
.mk-b i { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.mk.hot .mk-b { border-color: var(--accent); }
.marker-tip {
  position: fixed; left: 0; top: 0; z-index: 28; pointer-events: none; width: 248px;
  display: flex; flex-direction: column; gap: 7px; padding: 9px 10px; border-radius: 2px;
  background: var(--glass-strong); border: 1px solid var(--line-strong); color: var(--text); box-shadow: var(--shadow); font-size: 12px;
}
.mt-head { display: flex; align-items: center; gap: 8px; }
.mt-head i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.mt-head b { display: block; font-size: 12.5px; }
.mt-head small, .mt-foot { color: var(--text-dim); font-size: 11px; }
.mt-rows { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.mt-rows span { color: var(--text-dim); }
.mt-rows b { font-family: var(--mono); text-align: right; }
.mt-chart svg { display: block; width: 100%; height: 54px; }
.mt-chart .l { fill: none; stroke: #6B7FFF; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.mt-chart .a { fill: rgba(107, 127, 255, 0.16); }
.mt-chart .d line { stroke: rgba(255, 255, 255, 0.1); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mt-chart span { font-size: 10.5px; color: var(--text-faint); }
.mt-plot { width: 100%; border-radius: 6px; background: #fff; }
.mt-wait { color: var(--text-dim); }
.mk-b i.ext, .mt-head i.ext { background: none; box-shadow: none; border: 1.5px dashed #9fb4c8; }
.mt-note { margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--text-dim); }
.cams .mk-b { padding: 3px 5px; color: #dfe8f2; }
.cams .mk-b .ext { margin-left: -1px; font: 500 10px/1 var(--mono); color: var(--text-dim); }   /* link only: no preview */
.cams .mk-b:has(.ext) { border-style: dashed; color: var(--text-dim); }
.cams-tip { width: 300px; }
.mt-cam { display: block; width: 100%; min-height: 60px; border-radius: 6px; background: rgba(0, 0, 0, 0.3); object-fit: cover; }
.mt-cam.pano { aspect-ratio: 515 / 150; }

/* ---------------------------------------------------------------- offline download */
.off-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }   /* columns never wider than the panel */
.off-grid .btn { justify-content: flex-start; text-align: left; gap: 8px; padding: 8px 10px; height: auto; min-height: 34px; white-space: normal; }
.off-grid .btn > span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.off-grid .btn small { color: var(--text-dim); font-size: 10.5px; font-weight: 400; }
.off-grid .btn:disabled { opacity: 0.45; cursor: default; }
#offStatus { min-height: 1.2em; color: var(--text-dim); }
.off-progress { margin: 12px 0 4px; }

/* ---------------------------------------------------------------- route pace */
.field.pace { margin: 10px 0 4px; }
.field.pace .val { float: right; font-family: var(--mono); color: var(--text-dim); text-transform: none; letter-spacing: 0; }
.field.pace .segmented { margin-top: 6px; }
.field.pace .pace-down { display: block; margin-top: 12px; }
.field.pace .small { margin: 6px 0 0; color: var(--text-faint); }

/* =============================================================================
   BEYOND design guide (BEYOND-APP-DESIGN.md): type, colour, labels.
   Layout and interaction stay as above; this block only re-skins.
   ============================================================================= */
html, body {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'wdth' 87.5;        /* Martian Mono at 87.5 width; Hanken has no width axis */
}
.glass { -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); box-shadow: none; }
.topbar::before { background: none; }


/* display: panel titles, big numbers */
h2 {
  font: 600 15px/1.2 var(--display); letter-spacing: -0.01em; text-transform: none;
  font-variation-settings: 'wdth' 100; color: var(--text);
}
.wx-now b, .avy-head b, .input.big { font-family: var(--display); font-variation-settings: 'wdth' 100; }

/* data and labels: mono, uppercase, +0.04em */
.micro, .legend h3, .stat-grid small, .profile-stats .st small, .readout small, .wx-head small, .avy-title small,
.avy-ahead > small, .search-results .group, .wx-days th, .loading p, .sun-phase, .results-head .muted {
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
}
.micro, .legend h3, .readout small, .stat-grid small, .profile-stats .st small { color: var(--text-dim); }
.micro output, .micro .val { font-family: var(--mono); color: var(--text); letter-spacing: 0; text-transform: none; }

/* buttons: primary cobalt, secondary snow outline */
.btn { border-radius: 2px; background: transparent; border: 1px solid rgba(238, 240, 238, 0.38); font-weight: 600; }
.btn:hover { background: transparent; border-color: var(--snow); }
.btn.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; font-size: 14px; }
.btn.primary:hover { background: #3a55ff; border-color: #3a55ff; }
.btn.ghost { border-color: transparent; }
.btn.danger { color: var(--text); }
.link { color: var(--accent); }

/* segmented controls and chips: mono uppercase, hairline; active = snow */
.segmented { padding: 0; gap: 4px; background: none; border: 0; border-radius: 0; }
.segmented button, .chips button {
  border: 1px solid var(--line); border-radius: 2px; background: none; color: var(--text-dim); box-shadow: none;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
}
.segmented button:hover, .chips button:hover { color: var(--text); border-color: var(--line-strong); }
.segmented button.on, .chips button.on { color: var(--text); border-color: var(--snow); background: none; box-shadow: none; }
.segmented button { flex: 1 1 auto; white-space: nowrap; padding: 0 8px; }   /* mono caps are wider: size by label, never wrap */

/* sliders and toggles: cobalt track, snow thumb */
input[type="range"]::-webkit-slider-runnable-track { border-radius: 2px; background: linear-gradient(90deg, var(--accent-fill) var(--fill, 50%), #2C3136 var(--fill, 50%)); }
input[type="range"]::-moz-range-track { border-radius: 2px; background: #2C3136; }
input[type="range"]::-moz-range-progress { border-radius: 2px; background: var(--accent-fill); }
input[type="range"]::-webkit-slider-thumb { width: 14px; height: 14px; margin-top: -5px; border-radius: 2px; background: var(--snow); box-shadow: none; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 2px; background: var(--snow); box-shadow: none; }
.toggle span { border-radius: 2px; background: #2C3136; }
.toggle span::after { border-radius: 1px; background: var(--snow); box-shadow: none; }
.toggle input:checked + span { background: var(--accent-fill); }
.toggle input:focus-visible + span, .btn:focus-visible, .segmented button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* rail: the selected tool is a cobalt fill */
.rail button.on { color: #fff; background: var(--accent-fill); }
.rail button.on::before { display: none; }
.rail button.busy::after { background: var(--accent); box-shadow: none; }
.icon-btn:hover { background: var(--glass-hi); }
/* street view: armed = waiting for the click on the terrain, on = standing on the map */
#streetViewBtn.armed { color: var(--accent); border-color: var(--accent); }
#streetViewBtn.on { color: #fff; background: var(--accent-fill); border-color: var(--accent-fill); }
body.street-view:not(.picking) #scene canvas { cursor: grab; }
body.street-view:not(.picking) #scene canvas:active { cursor: grabbing; }

/* cards (layer picker): selected = snow hairline on the raised surface; swatch = the layer's legend */
.card { background: none; }
.card.on { border-color: var(--snow); background: var(--glass-hi); }
.card .swatch { border-radius: 2px; border: 1px solid rgba(238, 240, 238, 0.28); }
.sw-slope { background: linear-gradient(90deg, transparent 0 16.6%, var(--s25) 16.6% 33.3%, var(--s30) 33.3% 50%, var(--s35) 50% 66.6%, var(--s40) 66.6% 83.3%, var(--s45) 83.3%); }
.sw-avy { background: linear-gradient(90deg, var(--d1) 0 20%, var(--d2) 20% 40%, var(--d3) 40% 60%, var(--d4) 60% 80%, var(--d5) 80%); }
.sw-elev { background: linear-gradient(0deg, #2e6b3a, #6e9e4e 20%, #c9c27a 40%, #a9774a 60%, #8a8580 80%, #f4f5f2); }
.sw-none { background: linear-gradient(135deg, #e7e9e7 0 50%, #7d848b 50%); }
.sw-newsnow, .sw-snowfall { background: linear-gradient(0deg, #e3f2ff, #a9d6ff 14%, #62b0ff 28%, #2f7bf0 43%, #3c4fd6 57%, #7440cf 71%, #b02fb2 86%, #e2287a); }

/* legends: flat class swatches, hard edges, dark ones outlined in snow */
.legend { box-shadow: none; }
.legend li i { border-radius: 2px; border: 1px solid rgba(238, 240, 238, 0.22); }
.legend li i.empty { background: transparent !important; border-color: rgba(238, 240, 238, 0.7); }
.legend li i.dark { border-color: var(--snow); }
.legend .ramp, .legend .scale { border-radius: 2px; }

/* hazard badges: EAWS colours flat, level 5 outlined */
.avy-badge.l5 { background: var(--d5); color: #fff; box-shadow: inset 0 0 0 1px var(--snow); }
.danger-levels button[data-dl="5"] b { background: var(--d5); color: #fff; box-shadow: inset 0 0 0 1px var(--snow); }
.danger-levels button.on { border-color: var(--snow); background: var(--glass-hi); }
.aspect-rose .sector.on.critical { fill: var(--accent-fill); }
.profile-stats .st.warn span { color: var(--s35); }

/* readouts and status line: mono key in grey, value in snow; steady, no typing, no glow */
.readout b { color: var(--text); font-family: var(--mono); }
.telemetry { color: var(--text); text-shadow: none; font-size: 11px; letter-spacing: 0.04em; }
.caret { display: none; }

/* notices, toasts, hints: neutral surfaces, cobalt icons (warm colours are hazard data) */
.toast { box-shadow: none; }
.toast.warn, .toast.ok { border-color: rgba(107, 127, 255, 0.55); }
.toast.error { border-color: var(--snow); }
.toast.notice { background: var(--glass-strong); color: var(--text); border-left: 2px solid var(--accent); }
.toast.notice .ni { color: var(--accent); }
.toast.notice p b { color: var(--text); }
.toast.notice .nx { color: var(--text-dim); border-radius: 2px; }
.disclaimer { background: var(--glass-hi); border-color: var(--line); color: var(--text); }
.disclaimer [data-icon] { color: var(--accent); }
.drawing-hint { background: var(--glass-hi); border: 1px solid var(--line); border-left: 2px solid var(--accent); }
.route-item { background: none; }
.route-item.on { border-color: var(--snow); background: var(--glass-hi); }
.sel-info .warn, .sel-info .bad { color: var(--accent); }

/* sun and weather details in neutrals */
.sun-phase, .sun-phase[data-phase] { background: none; border: 1px solid var(--line); color: var(--text-dim); }
.compass-sun circle { fill: var(--snow); filter: none; }
.needle-n { fill: var(--accent); }
.wx-sun > span { color: var(--text); }
.wx-strip i { background: rgba(238, 240, 238, calc(0.06 + 0.9 * var(--f))); }
.wx-flag { color: var(--text-dim); }
.wx, .avy, .stat-grid > div { background: var(--glass-hi); }

/* progress, loader, refine, loading screen */
.progress-bar span { background: var(--accent-fill); }
.loader i { border-color: rgba(107, 127, 255, 0.25); border-top-color: var(--accent); }
.refine-btn { border-radius: 2px; }
.refine-btn.on { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; box-shadow: none; }
.refine-btn.on small { color: rgba(255, 255, 255, 0.8); }
.loading { background: var(--night-0); }
.loading-bar { border-radius: 2px; }
.loading-bar span { background: var(--accent-fill); }

@media (max-width: 760px) {
}

/* account dialog (js/core/account.js) and the route storage line (RouteTool.js) */
#accountBtn.on { color: var(--accent); border-color: rgba(107, 127, 255, 0.4); }
.account-body { gap: 14px; }
.account-body .field .micro { margin-bottom: 6px; }
.account-body .input { width: 100%; font-size: 14px; }
.account-body .field .hint { margin-top: 5px; }
.account-body .btn.primary { align-self: stretch; height: 40px; }
.acct-links { justify-content: space-between; }
.acct-msg { margin: 0; padding: 9px 12px; border-left: 2px solid var(--accent); background: var(--glass-hi); font-size: 12.5px; line-height: 1.45; }
.acct-msg.error { border-left-color: #ff6b7a; color: #ffd0d5; }
.acct-captcha:empty { display: none; }
.acct-user p { margin: 0 0 8px; }
.acct-user .row, .acct-delete { margin-top: 12px; justify-content: space-between; }
.route-store { margin: 10px 0 0; padding: 8px 10px; border-left: 2px solid var(--line-strong); background: var(--glass-hi); font-size: 12px; color: var(--text-dim); }
.route-store.warn { border-left-color: var(--accent); color: var(--text); }
.route-store .link { padding: 0; }

/* motion: functional only, and none when the user asks for less */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
