/* openroute POC — mobile-first hybrid shell, on the openroute design tokens. */

/* ---- self-hosted fonts (SIL OFL) ---- */
@font-face{font-family:'Fraunces';font-weight:400 900;font-display:swap;src:url('/fonts/fraunces-var.woff2') format('woff2');}
@font-face{font-family:'Hanken Grotesk';font-weight:400 700;font-display:swap;src:url('/fonts/hanken-grotesk-var.woff2') format('woff2');}
@font-face{font-family:'Bricolage Grotesque';font-weight:800;font-display:swap;src:url('/fonts/bricolage-grotesque-800.woff2') format('woff2');}
@font-face{font-family:'IBM Plex Mono';font-weight:500;font-display:swap;src:url('/fonts/ibm-plex-mono-500.woff2') format('woff2');}

/* ---- tokens ---- */
:root{
  --pine-700:#155a3b; --pine-500:#1c7a52; --pine-300:#57b487;
  --coral-500:#d85436; --coral-700:#bd4227; --coral-300:#ed7351;
  --sand-50:#f8f5ed; --sand-100:#f1ece0; --sand-200:#ece6d7; --sand-300:#ddd8c6; --sand-400:#c4bda7;
  --ink-900:#16211b; --ink-500:#55604f; --ink-400:#8a9180;
  --surf-befestigt:#6b7280; --surf-schotter:#cf8a3e; --surf-unbefestigt:#9a6a44; --surf-unbekannt:#c4bda7;
  --bg:var(--sand-50); --surface:var(--sand-100); --surface-2:var(--sand-200); --surface-hover:var(--sand-200);
  --text:var(--ink-900); --text-muted:var(--ink-500); --text-faint:var(--ink-400);
  --on-brand:var(--sand-50); --on-accent:#fff;
  --brand:var(--pine-700); --brand-hover:#0f3d29; --brand-soft:color-mix(in srgb,var(--pine-700) 10%,transparent);
  --accent:var(--coral-500); --accent-hover:var(--coral-700); --accent-soft:color-mix(in srgb,var(--coral-500) 12%,transparent);
  --border:var(--sand-300); --border-strong:var(--sand-400); --ring:var(--pine-500);
  --route-casing:#faf7f0;
  --elev-1:0 1px 2px rgba(22,33,27,.06),0 1px 3px rgba(22,33,27,.05);
  --elev-2:0 2px 6px rgba(22,33,27,.07),0 6px 20px rgba(22,33,27,.08);
  --elev-3:0 8px 30px rgba(22,33,27,.14);
  --radius-sm:8px; --radius-md:12px; --radius-lg:16px; --radius-pill:999px;
  --font-display:'Fraunces',Georgia,serif;
  --font-sans:'Hanken Grotesk',ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --font-wordmark:'Bricolage Grotesque','Hanken Grotesk',ui-sans-serif,sans-serif;
  --font-mono:'IBM Plex Mono',ui-monospace,'SF Mono',Consolas,monospace;
  --tap:44px; --nav-h:56px;
  --safe-top:env(safe-area-inset-top,0px); --safe-bottom:env(safe-area-inset-bottom,0px);
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0f130d; --surface:#171c14; --surface-2:#1e241a; --surface-hover:#2a3225;
  --text:#eae7d8; --text-muted:#a7ad99; --text-faint:#727a67; --on-brand:#0f130d;
  --brand:var(--pine-300); --brand-hover:#74cf9c; --brand-soft:color-mix(in srgb,var(--pine-300) 15%,transparent);
  --accent:var(--coral-300); --accent-hover:#f0855f; --accent-soft:color-mix(in srgb,var(--coral-300) 16%,transparent);
  --border:#2a3225; --border-strong:#3a4533; --ring:var(--pine-300);
  --route-casing:#0f130d; --surf-unbekannt:#3a4533;
  --elev-1:0 1px 2px rgba(0,0,0,.4); --elev-2:0 2px 6px rgba(0,0,0,.4),0 8px 26px rgba(0,0,0,.34); --elev-3:0 10px 34px rgba(0,0,0,.5);
  color-scheme:dark;
}}

*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{height:100%;margin:0;overflow-x:hidden}
body{background:var(--bg);color:var(--text);font-family:var(--font-sans);
  font-size:15px;line-height:1.5;-webkit-font-smoothing:antialiased;overflow:hidden}
.mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums}
button{font-family:inherit}
/* inline Lucide line-icons — stroke follows currentColor, so they adapt to
   theme + button state automatically. Sizing/centering shared here. */
.i{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;display:block}
.cb-spark .i{width:15px;height:15px}
.chat-input-row button{display:flex;align-items:center;justify-content:center}

/* ---- app shell ---- */
.app{position:fixed;inset:0;overflow:hidden}
.map-panel{position:absolute;inset:0;min-width:0}
#map{position:absolute;inset:0;-webkit-touch-callout:none}
/* suppress the iOS long-press callout/selection on the map so our own
   long-press-to-add-a-point gesture isn't hijacked by the native menu */
.maplibregl-canvas-container,.maplibregl-canvas{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}

/* ---- one-mode chrome: corner buttons (chat / profile / home) + stat pill ---- */
.corner-fab{position:absolute;z-index:7;width:44px;height:44px;border-radius:50%;background:var(--surface);
  border:1px solid var(--border-strong);box-shadow:var(--elev-2);display:flex;align-items:center;justify-content:center;
  color:var(--brand);cursor:pointer;transition:background .12s ease}
.corner-fab:hover{background:var(--surface-hover)}
.corner-fab:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.corner-fab[aria-expanded="true"]{background:var(--brand);color:var(--on-brand);border-color:var(--brand)}
.corner-fab .i{width:20px;height:20px}
.corner-fab.tl{top:calc(var(--safe-top) + 12px);left:12px}
.corner-fab.tr{top:calc(var(--safe-top) + 12px);right:12px}
.corner-fab.bl{bottom:calc(var(--safe-bottom) + 16px);left:12px;width:40px;height:40px;color:var(--text-muted)}
.fab-dot{position:absolute;top:4px;right:4px;width:10px;height:10px;border-radius:50%;background:var(--accent);
  border:2px solid var(--surface)}
.fab-dot[hidden]{display:none}
/* top-centre stat pill: km · climb · surface mini-bar; tap opens the stat card */
.stat-pill{position:absolute;z-index:7;top:calc(var(--safe-top) + 16px);left:50%;transform:translateX(-50%);
  display:flex;align-items:center;gap:7px;background:var(--surface);border:1px solid var(--border-strong);
  border-radius:var(--radius-pill);padding:.42rem .85rem;box-shadow:var(--elev-2);color:var(--text);
  font-size:.8rem;font-weight:650;white-space:nowrap;cursor:pointer;max-width:calc(100% - 130px);overflow:hidden}
.stat-pill[hidden]{display:none}
.stat-pill:hover{background:var(--surface-hover)}
.stat-pill:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.stat-pill .sp-sep{color:var(--text-faint)}
.sp-surf{display:inline-flex;width:30px;height:7px;border-radius:4px;overflow:hidden;flex:none}
.sp-surf i{display:block;height:100%}
.sp-surf[hidden]{display:none}
/* smallest phones: the surface chip is the first thing to go */
/* Narrow screens: shed pill extras progressively so it never runs under the
   corner buttons — full detail is one tap away (route card). The surface
   mini-bar fit fine on small phones BEFORE weather arrived, so the weather
   glyph goes first; the mini-bar only on the very narrowest devices. */
@media (max-width:540px){.sp-wx{display:none}.stat-pill{gap:6px;padding:.42rem .7rem}}
@media (max-width:340px){.sp-surf{display:none}}
/* seg switchers now live inside the Layers dialog as full-width wrapping rows */
.seg-switcher.seg-block{display:flex;flex-wrap:wrap;gap:4px;background:var(--surface-2);
  border:1px solid var(--border);border-radius:var(--radius-md);padding:4px;margin:.2rem 0 .1rem}
.ly-appearance{border-bottom:1px solid var(--border);padding-bottom:.6rem;margin-bottom:.2rem}
/* route dimmed: fade the waypoint markers along with the line so the map reads through */
.map-panel.route-dimmed .wp-marker{opacity:.28;transition:opacity .2s ease}
/* keyboard-shortcuts help list */
.kbd-list{display:flex;flex-direction:column;gap:.15rem}
.kbd-row{display:flex;align-items:center;gap:.7rem;padding:.32rem .1rem}
.kbd-row kbd{flex:0 0 auto;min-width:1.7rem;text-align:center;font-family:var(--font-mono);font-size:.78rem;
  padding:.12rem .4rem;border:1px solid var(--border-strong);border-bottom-width:2px;border-radius:6px;
  background:var(--surface-2);color:var(--text)}
.kbd-row span{font-size:.86rem;color:var(--text)}
.basemap-btn,.overlay-btn{padding:.32rem .7rem;font-size:.76rem;font-weight:600;background:transparent;
  border:1px solid transparent;border-radius:var(--radius-pill);color:var(--text);cursor:pointer;line-height:1.2;
  transition:background .12s ease,color .12s ease}
.basemap-btn:hover,.overlay-btn:hover{background:var(--surface-hover)}
.basemap-btn:focus-visible,.overlay-btn:focus-visible{outline:2px solid var(--ring);outline-offset:1px}
.basemap-btn[aria-pressed="true"]{background:var(--brand);color:var(--on-brand);border-color:var(--brand)}
.overlay-btn[aria-pressed="true"]{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}

/* ---- bottom-centre cluster: undo/redo · elevation · export · ⋯ ---- */
.draw-toolbar{position:absolute;z-index:7;bottom:calc(var(--safe-bottom) + 16px);left:50%;transform:translateX(-50%);
  display:flex;align-items:center;gap:2px;background:var(--surface);border:1px solid var(--border-strong);
  border-radius:var(--radius-pill);padding:4px;box-shadow:var(--elev-2)}
.draw-toolbar .tool-btn{width:40px;height:40px;border-radius:50%}
.draw-toolbar .tool-btn .i{width:19px;height:19px}
/* ⋯ menu: relocated FAB row + clear, a second strip popping above the cluster */
.more-menu{position:absolute;z-index:7;bottom:calc(var(--safe-bottom) + 70px);left:50%;transform:translateX(-50%);
  display:flex;align-items:center;gap:2px;background:var(--surface);border:1px solid var(--border-strong);
  border-radius:var(--radius-pill);padding:4px;box-shadow:var(--elev-2)}
.more-menu[hidden]{display:none}
.more-menu .tool-btn{width:40px;height:40px;border-radius:50%}
.more-menu .tool-btn .i{width:19px;height:19px}
.tool-btn{width:40px;height:40px;display:flex;align-items:center;justify-content:center;font-size:1rem;
  background:transparent;border:1px solid transparent;border-radius:9px;color:var(--text);cursor:pointer;line-height:1;
  transition:background .12s ease,color .12s ease}
.tool-btn:hover{background:var(--surface-hover)}
.tool-btn:focus-visible{outline:2px solid var(--ring);outline-offset:1px}
.tool-btn[aria-pressed="true"]{background:var(--brand);color:var(--on-brand);border-color:var(--brand)}
.tool-btn.tool-danger:hover{background:color-mix(in srgb,#c0392b 14%,transparent);color:#c0392b}
.tool-sep{width:1px;align-self:stretch;background:var(--border);margin:2px 2px}

.edit-hint{position:absolute;top:calc(var(--safe-top) + 110px);left:50%;transform:translateX(-50%);z-index:6;
  background:var(--brand);color:var(--on-brand);font-size:.78rem;padding:.35rem .7rem;border-radius:var(--radius-pill);
  box-shadow:var(--elev-1);max-width:82%;text-align:center}

.map-attribution{position:absolute;right:0;bottom:0;z-index:4;font-size:.6rem;color:var(--text-muted);
  background:color-mix(in srgb,var(--surface) 82%,transparent);padding:.1rem .4rem;max-width:100%}
.map-attribution a{color:inherit;text-decoration:underline}

/* ---- profile panel (in-flow in the sheet/sidebar; ⚙ toggles it on mobile) ---- */
.profile-panel{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);
  padding:.6rem .7rem;display:flex;flex-direction:column;gap:.5rem;flex:none}
.profile-panel[hidden]{display:none}
.pp-head{width:100%;padding:0;background:none;border:0;font-family:inherit;text-align:left;color:var(--text-faint);
  font-size:.7rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;cursor:default;
  display:flex;align-items:center;justify-content:space-between}
.pp-body{display:flex;flex-direction:column;gap:.5rem}
/* collapsed-profile summary: a glance at the active settings. Hidden by default
   (the expanded body carries the same info); revealed only when collapsed on
   the desktop card, where the body is display:none. */
.pp-summary{display:none;flex-wrap:wrap;gap:.3rem}
.pp-chip{font-size:.68rem;line-height:1.5;padding:.05rem .45rem;border-radius:var(--radius-pill);
  border:1px solid var(--border);background:var(--surface-2);color:var(--text-muted);white-space:nowrap}
.pp-chip-key{color:var(--brand);font-weight:600;background:var(--brand-soft);
  border-color:color-mix(in srgb,var(--brand) 45%,transparent)}
.pp-chip-avoid{color:var(--text-faint)}
.pp-sub{font-size:.64rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--text-faint);
  margin-top:.15rem;padding-top:.45rem;border-top:1px solid var(--border)}
.pp-row{display:flex;flex-direction:column;gap:.3rem}
.pp-label{font-size:.78rem;color:var(--text)}
.pp-seg{display:flex;gap:2px}
.pp-seg button{flex:1;padding:.34rem 0;font-size:.72rem;font-weight:600;background:var(--surface-2);
  border:1px solid var(--border-strong);border-radius:8px;color:var(--text);cursor:pointer;transition:background .12s ease,color .12s ease}
.pp-seg button:hover{background:var(--surface-hover)}
.pp-seg button[aria-pressed="true"]{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
/* bike-type: wrap when many types; niche types reveal with the expanded panel */
.pp-seg-wrap{flex-wrap:wrap;gap:4px}
.pp-seg-wrap button{flex:1 1 auto;min-width:60px}
.pp-hint{font-size:.66rem;font-weight:500;color:var(--text-faint)}
/* Schotter / Steigungen as slim sliders (value relative to the bike-type default) */
.pp-slrow{display:flex;flex-direction:column;gap:2px}
.pp-slhead{display:flex;justify-content:space-between;align-items:baseline;font-size:.78rem;color:var(--text)}
.pp-lvl b{font-size:.78rem;font-weight:600;color:var(--accent)}
.pp-range{-webkit-appearance:none;appearance:none;width:100%;height:5px;border-radius:3px;margin:5px 0 1px;
  background:var(--border-strong);outline:none;cursor:pointer}
.pp-range::-webkit-slider-thumb{-webkit-appearance:none;width:17px;height:17px;border-radius:50%;background:var(--accent);
  border:2px solid var(--surface);box-shadow:0 1px 3px rgba(0,0,0,.3);cursor:pointer}
.pp-range::-moz-range-thumb{width:17px;height:17px;border-radius:50%;background:var(--accent);
  border:2px solid var(--surface);box-shadow:0 1px 3px rgba(0,0,0,.3);cursor:pointer}
.pp-range:focus-visible{outline:2px solid var(--ring);outline-offset:3px}
.pp-ends{display:flex;justify-content:space-between;font-size:.64rem;color:var(--text-faint)}
/* tighter avoidance list */
.pp-avoid{display:flex;flex-direction:column}
.pp-avoid .pp-toggle{min-height:29px}
.pp-toggle{display:flex;align-items:center;gap:.45rem;font-size:.8rem;color:var(--text);cursor:pointer;min-height:34px}
.pp-toggle input{accent-color:var(--brand);width:16px;height:16px;cursor:pointer;flex:none}
.pp-foot{font-size:.66rem;color:var(--text-faint);border-top:1px solid var(--border);padding-top:.4rem}
/* quick-select bike types (always visible, even collapsed) — pill chips w/ colour dot */
.pp-quick{display:flex;flex-direction:column;gap:.35rem;margin-top:.1rem}
.pp-quick .pp-seg-wrap{gap:5px}
.pp-quick button[data-type]{display:inline-flex;align-items:center;gap:.4rem;flex:0 1 auto;min-width:0;
  padding:.32rem .62rem;border-radius:var(--radius-pill);font-size:.73rem}
.pp-quick button[data-type]::before{content:"";width:8px;height:8px;border-radius:50%;flex:none;
  background:var(--dot,var(--text-faint))}
.pp-quick button[data-type][aria-pressed="true"]::before{background:var(--on-accent)}
.pp-quick button[data-type="road"]{--dot:#6b7280}
.pp-quick button[data-type="allroad"]{--dot:#1c7a8a}
.pp-quick button[data-type="trekking"]{--dot:#2e7d4f}
.pp-quick button[data-type="gravel"]{--dot:#cf8a3e}
.pp-quick button[data-type="mtb"]{--dot:#9a6a44}
.pp-quick button[data-type="ebike"]{--dot:#0ea5a0}
.pp-quick button[data-type="tandem"],.pp-quick button[data-type="liegerad"],
.pp-quick button[data-type="lastenrad"]{--dot:#6f79b0}
.pp-quick button[data-type="faltrad"]{--dot:#8a9180}

/* tabs: switch the surface×terrain control between two sliders and the 2D pad */
.pp-tabs{display:flex;gap:3px;background:var(--surface);border:1px solid var(--border-strong);
  border-radius:10px;padding:3px;margin:.35rem 0 .2rem}
.pp-tab{flex:1;padding:.36rem;font:650 .74rem/1 inherit;color:var(--text-muted);background:none;border:0;
  border-radius:8px;cursor:pointer;transition:background .12s ease,color .12s ease}
.pp-tab.on{background:var(--brand);color:var(--on-brand)}
.pp-tab:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.pp-pane[hidden]{display:none}
/* surface-roughness segmented control (Smooth/Mixed/Rough) */
.pp-rough-row .pp-seg{margin:0}
.pp-seg-hint{margin-top:5px;font-size:.62rem;font-weight:600;color:var(--text-faint);min-height:.85em}
/* two accessible sliders (surface, climbs) */
.pp-slider{margin:.55rem 0}
.pp-slider-top{display:flex;justify-content:space-between;align-items:baseline;font-size:.75rem;font-weight:600;color:var(--text);margin-bottom:6px}
.pp-slider-val{font-size:.72rem;font-weight:600;color:var(--accent);font-family:var(--font-mono)}
.pp-range2{width:100%;-webkit-appearance:none;appearance:none;height:7px;border-radius:5px;
  background:linear-gradient(90deg,var(--surface-hover),var(--accent));cursor:pointer}
.pp-range2::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;border-radius:50%;background:var(--accent);
  border:3px solid var(--surface);box-shadow:0 1px 4px rgba(0,0,0,.35);cursor:pointer}
.pp-range2::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:var(--accent);
  border:3px solid var(--surface);box-shadow:0 1px 4px rgba(0,0,0,.35);cursor:pointer}
.pp-range2:focus-visible{outline:2px solid var(--ring);outline-offset:3px}
.pp-slider-ends{display:flex;justify-content:space-between;margin-top:5px;font-size:.55rem;font-weight:700;
  letter-spacing:.04em;text-transform:uppercase;color:var(--text-faint)}

/* the surface (X) × terrain (Y) pad — one continuous 2-axis control */
.pp-pad-wrap{margin:.3rem 0 .2rem}
.pp-pad-frame{position:relative}
.pp-pad{position:relative;aspect-ratio:1/.86;border-radius:12px;overflow:hidden;border:1px solid var(--border-strong);
  background:var(--surface-2);touch-action:none;cursor:crosshair;user-select:none;-webkit-user-select:none}
.pp-grid{position:absolute;inset:0;pointer-events:none}
.pp-grid .v,.pp-grid .h{position:absolute;background:color-mix(in srgb,var(--text-faint) 18%,transparent)}
.pp-grid .v{top:0;bottom:0;width:1px}.pp-grid .h{left:0;right:0;height:1px}
.pp-grid .mid{background:color-mix(in srgb,var(--text-faint) 38%,transparent)}
/* zone blobs: label anchored to the blob top so the centred puck never sits on
   the text; slim ellipses so neighbours in the mid-band stay distinct. */
.pp-zone{position:absolute;transform:translate(-50%,-50%);width:33%;height:42%;border-radius:50%;pointer-events:none;
  display:flex;flex-direction:column;align-items:center;justify-content:flex-start;text-align:center;padding-top:.3rem;
  background:radial-gradient(circle,color-mix(in srgb,var(--zc) 30%,transparent),transparent 68%)}
.pp-zone-wide{width:42%;height:38%}
.pp-zone span{font-size:.62rem;font-weight:750;color:var(--text);opacity:.95;line-height:1.05;white-space:nowrap;
  text-shadow:0 0 3px var(--surface-2),0 0 3px var(--surface-2),0 0 5px var(--surface-2)}
.pp-zone small{font-size:.49rem;font-weight:600;opacity:.72;margin-top:1px;white-space:nowrap;
  text-shadow:0 0 3px var(--surface-2),0 0 4px var(--surface-2)}
.pp-zone[data-z="road"]{--zc:#6b7280}
.pp-zone[data-z="allroad"]{--zc:#1c7a8a}
.pp-zone[data-z="trekking"]{--zc:#2e7d4f}
.pp-zone[data-z="gravel"]{--zc:#cf8a3e}
.pp-zone[data-z="mtb"]{--zc:#9a6a44}
.pp-zone[data-z="comfort"]{--zc:#6f79b0}
/* terrain (Y) axis hints inside the pad top/bottom; surface (X) axis rides in the
   caption below so the puck (which reaches both horizontal edges) never hides it */
.pp-axlbl{position:absolute;left:50%;transform:translateX(-50%);font-size:.52rem;font-weight:700;letter-spacing:.05em;
  text-transform:uppercase;color:var(--text-faint);pointer-events:none;z-index:2}
.pp-axlbl span{text-shadow:0 0 3px var(--surface-2),0 0 4px var(--surface-2),0 0 6px var(--surface-2)}
.pp-axlbl.t{top:4px}
.pp-axlbl.b{bottom:4px}
.pp-puck{position:absolute;width:22px;height:22px;border-radius:50%;background:var(--accent);border:3px solid var(--surface);
  transform:translate(-50%,-50%);box-shadow:0 1px 6px rgba(0,0,0,.45);z-index:3;pointer-events:none}
.pp-puck::after{content:"";position:absolute;inset:-7px;border-radius:50%;
  border:1.5px solid color-mix(in srgb,var(--accent) 50%,transparent)}
/* surface (X) axis caption — endpoints + centred axis name, styled to match the
   terrain labels inside so both axes read alike */
.pp-xaxis{display:flex;justify-content:space-between;align-items:center;margin:5px 2px 0;font-size:.52rem;font-weight:700;
  letter-spacing:.05em;text-transform:uppercase;color:var(--text-faint)}
.pp-xaxis-mid{color:color-mix(in srgb,var(--text-faint) 70%,transparent);letter-spacing:.08em}
.pp-pad-read{margin-top:6px;font-size:.72rem;font-weight:600;color:var(--text-muted);text-align:center;font-family:var(--font-mono)}

/* ---- drawers: chat (left) · ride profile (right) ----
   Overlay panels below 1024px; the chat drawer docks as a column above (see the
   min-width block at the end). One mode — there is no sheet and no mode switch. */
.drawer{position:absolute;top:0;bottom:0;z-index:10;width:min(86%,400px);display:flex;flex-direction:column;
  background:var(--surface);transition:transform .28s cubic-bezier(.16,1,.3,1);will-change:transform}
.drawer.left{left:0;border-right:1px solid var(--border);border-radius:0 20px 20px 0;
  box-shadow:12px 0 34px rgba(0,0,0,.18);transform:translateX(-103%)}
.drawer.right{right:0;border-left:1px solid var(--border);border-radius:20px 0 0 20px;
  box-shadow:-12px 0 34px rgba(0,0,0,.18);transform:translateX(103%)}
.drawer.open{transform:translateX(0)}
.drawer-head{display:flex;align-items:center;gap:.5rem;flex:none;
  padding:calc(var(--safe-top) + 10px) 14px 8px;border-bottom:1px solid var(--border)}
.drawer-title{font-size:.95rem;font-weight:700;color:var(--text)}
.drawer-body{flex:1;min-height:0;overflow-y:auto;padding:10px 14px;display:flex;flex-direction:column;gap:10px}
#chat-drawer .drawer-body{overflow-y:hidden} /* the transcript scrolls itself */
.pane{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:10px}
.drawer-foot{flex:none;border-top:1px solid var(--border);padding:8px 14px calc(10px + var(--safe-bottom))}
.foot-btn{display:flex;align-items:center;gap:8px;width:100%;background:var(--surface-2);color:var(--text);
  border:1px solid var(--border);border-radius:var(--radius-md);padding:.55rem .8rem;font-family:inherit;
  font-size:.85rem;font-weight:600;cursor:pointer}
.foot-btn:hover{background:var(--surface-hover)}
.foot-btn .i{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.foot-btn:focus-visible{outline:2px solid var(--ring);outline-offset:1px}
.drawer-backdrop{position:absolute;inset:0;z-index:9;background:rgba(15,19,13,.42)}
.drawer-backdrop[hidden]{display:none}
/* the ride-profile panel inside its drawer: plain block, always expanded */
#profile-drawer .profile-panel{background:transparent;border:0;padding:0;margin:0}
#profile-drawer .pp-head{display:none}
/* composer hugs the drawer bottom, above the home-indicator area */
#chat-drawer .chat-input-row{padding-bottom:calc(10px + var(--safe-bottom))}

/* ---- stat card: route facts over the map, opened by the stat pill ---- */
/* Stat card unfolds DOWNWARD from the stat pill (top-anchored, not a bottom
   drawer): transform-origin at top-centre so it reads as growing out of the
   pill. Content animates in on open (count-up / bar-grow / elevation-draw). */
.stat-card{position:absolute;z-index:8;left:8px;right:8px;top:calc(var(--safe-top) + 58px);
  /* stop above the bottom action cluster (bottom safe-inset + ~64px) so the card
     never overlaps it */
  max-height:calc(100dvh - var(--safe-top) - var(--safe-bottom) - 168px);
  background:var(--surface);border:1px solid var(--border-strong);border-radius:18px;box-shadow:var(--elev-3);
  display:flex;flex-direction:column;padding:0 14px 12px;
  transform-origin:top center;animation:statcard-in .26s cubic-bezier(.16,1,.3,1)}
.stat-card[hidden]{display:none}
.stat-card .pane{overflow-y:auto}
/* colour legend under the surface/road band */
.ri-legend{display:flex;flex-wrap:wrap;gap:5px 12px;margin-top:8px}
.ri-legend:empty{display:none}
.ri-legend-item{display:inline-flex;align-items:center;gap:5px;font-size:.68rem;font-weight:600;color:var(--text-muted)}
.ri-legend-item i{width:11px;height:11px;border-radius:3px;flex:none}
.ri-legend-item .rl-km{color:var(--text-faint);font-size:.62rem}
/* weather along the ride: tabs, arrival-time chips, 3-day forecast, wind toggle */
/* horizontal padding already comes from .drawer-body (14px); a 2nd inset here
   made the weather section sit narrower than the surface section above it. */
.wx-panel{padding:10px 0;border-top:1px solid var(--border)}
.wx-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.wx-tabs{display:inline-flex;gap:2px;background:var(--bg-subtle,var(--bg));border:1px solid var(--border);border-radius:var(--radius-pill);padding:2px}
.wx-tab{background:none;border:0;padding:3px 10px;border-radius:var(--radius-pill);font:inherit;font-size:.7rem;font-weight:700;color:var(--text-muted);cursor:pointer}
.wx-tab.on{background:var(--accent);color:var(--on-accent)}
.wx-link{background:none;border:0;padding:0;color:var(--accent);font:inherit;font-size:.72rem;font-weight:700;cursor:pointer;text-decoration:underline;text-underline-offset:2px;white-space:nowrap}
.wx-link[hidden]{display:none}
.wx-controls{display:flex;align-items:center;gap:10px;margin-top:8px;flex-wrap:wrap}
.wx-controls .wx-spacer{flex:1}
.wx-hint{font-size:.66rem;color:var(--text-faint)}
/* rolling 3-hour weather strip (next 72 h) */
.wx-hours{display:flex;gap:5px;margin-top:8px;overflow-x:auto;scrollbar-width:thin;padding-bottom:3px}
.wx-hour{flex:none;width:54px;display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 3px;cursor:pointer;
  border:1px solid var(--border);border-radius:var(--radius-md,10px);background:var(--bg);font-size:.66rem;color:var(--text-muted)}
.wx-hour.wx-wet{border-color:#4a7fa5;background:color-mix(in srgb, #4a7fa5 10%, transparent)}
.wx-hour.on{border-color:var(--accent);background:color-mix(in srgb, var(--accent) 14%, transparent);color:var(--text)}
.wxh-time{font-weight:700;color:var(--text)}
.wxh-emo{font-size:1rem;line-height:1.1}
.wxh-wind{color:var(--text-faint);display:inline-flex;align-items:center;gap:2px}
.wxh-dir{display:inline-block;font-size:.7rem;line-height:1;transform-origin:center}
.wx-foot{margin:7px 0 0;font-size:.66rem;color:var(--text-faint)}
.wx-foot:empty{display:none}
.wx-foot .wx-exposure{margin-top:2px;color:var(--text-muted)}
/* Meteogram: temp uses the coral accent; precip + night get their own tokens. */
:root{--wx-precip:#3f7fbf;--wx-night:rgba(30,40,36,.055);--wx-ride:color-mix(in srgb,var(--accent) 12%,transparent)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--wx-precip:#5aa0e6;--wx-night:rgba(0,0,0,.26);--wx-ride:color-mix(in srgb,var(--accent) 16%,transparent)}}
:root[data-theme="dark"]{--wx-precip:#5aa0e6;--wx-night:rgba(0,0,0,.26);--wx-ride:color-mix(in srgb,var(--accent) 16%,transparent)}
.wx-mete{display:block;width:100%;height:224px;touch-action:pan-x;cursor:pointer}
.profile-ask-link{display:inline-block;margin:6px 2px 0;padding:0;border:0;background:none;color:var(--accent,#2e8b57);font:inherit;font-size:.82rem;cursor:pointer;text-align:left}
.profile-ask-link:hover{text-decoration:underline}
/* 7-day forecast: horizontally scrollable card strip */
.wx-days{display:flex;gap:8px;margin-top:8px;overflow-x:auto;scrollbar-width:thin;padding-bottom:3px}
.wx-day{flex:none;min-width:86px;display:flex;flex-direction:column;align-items:center;gap:3px;padding:9px 6px;
  border:1px solid var(--border);border-radius:var(--radius-md,10px);font-size:.68rem;color:var(--text-faint)}
.wxd-dir{display:inline-block;font-size:.7rem;line-height:1;transform-origin:center}
.wxd-name{font-weight:700;color:var(--text);text-transform:capitalize}
.wxd-emo{font-size:1.35rem;line-height:1}
.wxd-temp{color:var(--text-muted);font-size:.7rem}
/* Windy-style wind particle overlay on the map */
/* Wind particles sit ABOVE the GL canvas but UNDER everything interactive:
   markers and popups (context menu, POI) get explicit z-indexes because
   MapLibre ships them with z-index:auto, which a positive canvas z would beat. */
.wind-canvas{position:absolute;inset:0;pointer-events:none;z-index:1;opacity:.9}
.maplibregl-marker{z-index:3}
.maplibregl-popup{z-index:4}
/* current weather in the collapsed top pill */
.sp-wx{margin-left:6px;padding-left:6px;border-left:1px solid var(--border);white-space:nowrap}
.sp-wx[hidden]{display:none}
/* ride-time pace picker (click the time stat) */
.stat-time-btn{position:relative;background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer;text-align:inherit}
.stat-time-btn .pace-caret{color:var(--text-faint);font-size:.85em}
.stat-time-btn:hover .unit,.stat-time-btn:focus-visible .unit{color:var(--text)}
.stat-time-btn:focus-visible{outline:2px solid var(--ring);outline-offset:2px;border-radius:6px}
/* anchored to <body> with fixed coords (set in JS) so it escapes the stat
   card's overflow-clipping pane */
.pace-pop{position:fixed;z-index:40;min-width:196px;
  background:var(--surface);border:1px solid var(--border-strong);border-radius:12px;box-shadow:var(--elev-3);
  padding:6px;display:flex;flex-direction:column;gap:2px}
.pace-h{font-size:.6rem;font-family:var(--font-mono);letter-spacing:.12em;text-transform:uppercase;color:var(--text-faint);padding:4px 8px 2px}
.pace-row{display:flex;justify-content:space-between;align-items:baseline;gap:14px;padding:7px 9px;border-radius:8px;
  background:none;border:0;color:var(--text);cursor:pointer;font:inherit;text-align:left}
.pace-row:hover{background:var(--surface-2)}
.pace-row.on{background:var(--brand-soft)}
.pace-row .pace-name{font-weight:600;font-size:.86rem}
.pace-row .pace-figs{font-size:.72rem;color:var(--text-muted)}
.pace-plan{display:flex;align-items:center;flex-wrap:wrap;gap:6px;padding:2px 9px 6px;font-size:.8rem;color:var(--text)}
.pace-wind{font-size:.68rem;padding:1px 6px;border-radius:999px;font-family:var(--font-mono)}
.pace-wind.head{background:rgba(192,57,43,.14);color:#c0392b}
.pace-wind.tail{background:var(--brand-soft);color:var(--brand)}
.wp-eta{flex:none;font-size:.7rem;color:var(--text-muted);min-width:2.6em;text-align:right}
@keyframes statcard-in{from{opacity:0;transform:translateY(-10px) scale(.97)}to{opacity:1;transform:none}}
/* peek mode: card collapses to a slim top bar naming the tapped item, opening
   the map below. Default: bar hidden, full card shown. */
.stat-peek{display:none}
.stat-card.peek{max-height:none;padding-bottom:8px;animation:statpeek-in .22s cubic-bezier(.16,1,.3,1)}
.stat-card.peek .grab,.stat-card.peek .pane{display:none}
.stat-card.peek .stat-peek{display:flex;align-items:center;gap:9px;width:100%;
  padding:12px 4px 4px;background:none;border:0;color:var(--text);cursor:pointer;text-align:left;font:inherit}
.stat-peek .sp-em{font-size:1.05rem;line-height:1}
.stat-peek .sp-lbl{font-weight:650;font-size:.92rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stat-peek .sp-km{margin-left:2px;font-size:.68rem;font-weight:650;color:var(--text-muted);white-space:nowrap;
  background:var(--surface-2,var(--pad));border-radius:var(--radius-pill);padding:2px 8px}
.stat-peek .sp-km:empty{display:none}
.stat-peek .sp-exp{margin-left:auto;color:var(--brand);font-size:1.1rem;line-height:1}
@keyframes statpeek-in{from{opacity:.4;transform:scaleY(.9);transform-origin:top}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.stat-card.peek{animation:none}}
/* pill stays lit while its card is open, so the connection reads */
.stat-pill[aria-expanded="true"]{background:var(--brand);color:var(--on-brand);border-color:var(--brand)}
.stat-pill[aria-expanded="true"] .sp-sep{color:color-mix(in srgb,var(--on-brand) 55%,transparent)}
/* content entrances, replayed each open via the .animating class */
.surf-seg{transition:width .55s cubic-bezier(.16,1,.3,1)}
@keyframes elev-draw{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
.stat-card.animating .rh-tier{animation:hint-rise .45s ease backwards}
.stat-card.animating #rh-schoen{animation-delay:.18s}
.stat-card.animating #rh-beachten{animation-delay:.3s}
@keyframes hint-rise{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){
  .stat-card,.stat-card.animating .rh-tier{animation:none}
  .surf-seg{transition:none}
}
/* the one-time long-press teaching hint */
.gesture-hint{position:absolute;z-index:7;bottom:calc(var(--safe-bottom) + 76px);left:50%;transform:translateX(-50%);
  white-space:nowrap;max-width:92%;overflow:hidden;text-overflow:ellipsis;font-size:.74rem;font-weight:600;
  background:color-mix(in srgb,var(--ink-900,#16211b) 80%,transparent);color:#f8f5ed;
  border-radius:var(--radius-pill);padding:.4rem .85rem;pointer-events:none}
.gesture-hint[hidden]{display:none}
/* toast: assistant answered while the chat drawer was closed */
.or-toast{position:absolute;z-index:12;top:calc(var(--safe-top) + 68px);left:50%;transform:translateX(-50%);
  display:flex;align-items:center;gap:.5rem;background:var(--brand);color:var(--on-brand);font-size:.82rem;
  font-weight:600;padding:.5rem .9rem;border-radius:var(--radius-pill);box-shadow:var(--elev-2);cursor:pointer;
  max-width:88%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;animation:or-toast-in .25s cubic-bezier(.16,1,.3,1)}
.or-toast[hidden]{display:none}
@keyframes or-toast-in{from{opacity:0;transform:translate(-50%,-8px)}to{opacity:1;transform:translate(-50%,0)}}
.grab{width:40px;height:5px;border-radius:3px;background:var(--border-strong);border:0;margin:9px auto 4px;
  cursor:grab;flex:none;padding:0}
.grab:focus-visible{outline:2px solid var(--ring);outline-offset:3px}
.sheet-actions{margin-left:auto;display:flex;gap:5px}
.sheet-act{width:32px;height:32px;display:flex;align-items:center;justify-content:center;padding:0;cursor:pointer;
  border:1px solid var(--border-strong);border-radius:9px;background:var(--surface);color:var(--text)}
.sheet-act .i{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.sheet-act:hover{background:var(--surface-hover)}
.sheet-act.flash{color:var(--brand);border-color:var(--brand)}
.sheet-act:focus-visible{outline:2px solid var(--ring);outline-offset:1px}
/* saved-routes overview */
.routes-brand{display:flex;align-items:center;gap:.5rem}
.routes-list{display:flex;flex-direction:column;gap:.4rem;min-width:min(88vw,300px);max-height:60vh;overflow-y:auto}
.route-row{display:flex;align-items:center;gap:.5rem;padding:.5rem .55rem;border:1px solid var(--border);
  border-radius:10px;background:var(--surface-2)}
.route-load{flex:1;min-width:0;text-align:left;background:none;border:0;cursor:pointer;font-family:inherit;padding:0}
.route-name{display:block;font-family:var(--font-display);font-size:.9rem;font-weight:560;color:var(--text);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.route-meta{display:block;font-size:.72rem;color:var(--text-muted);font-family:var(--font-mono);margin-top:1px}
.route-del{flex:0 0 auto;background:none;border:0;color:var(--text-faint);cursor:pointer;padding:.25rem;border-radius:7px;
  display:flex;align-items:center}
.route-del .i{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.9}
.route-del:hover{color:#c0392b;background:var(--surface-hover)}
.routes-empty{font-size:.83rem;color:var(--text-muted);padding:.6rem .2rem;line-height:1.45}
.wordmark{display:flex;align-items:center;gap:0;font-family:var(--font-wordmark);font-weight:800;
  font-size:1.15rem;letter-spacing:-.022em;color:var(--text)}
/* gap:0 so "open" and "routr" read as ONE word; the glyph gets its own spacing. */
.wordmark>svg{margin-right:8px}
.wordmark b{color:var(--brand);font-weight:800}
#pane-route{overflow-y:auto}

/* ---- chat ---- */
.chat-transcript{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:.6rem}
.chat-msg{display:flex;flex-direction:column;gap:.3rem;max-width:92%}
.chat-msg.user{align-self:flex-end;align-items:flex-end}
.chat-msg.assistant{align-self:flex-start}
.chat-bubble{font-size:.9rem;line-height:1.45;padding:.5rem .7rem;border-radius:14px}
.chat-msg.user .chat-bubble{background:var(--brand);color:var(--on-brand);border-bottom-right-radius:5px}
.chat-msg.assistant .chat-bubble{background:var(--surface-2);border:1px solid var(--border);border-bottom-left-radius:5px}
.chat-msg.assistant.error .chat-bubble{border-color:var(--accent);color:var(--accent)}
.chat-msg.thinking .chat-bubble{opacity:.6;animation:pulse 1.1s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:.35}50%{opacity:.85}}

/* routing-in-progress: chat bubble with an animated (flowing) route glyph */
.chat-msg.routing .chat-bubble{display:flex;align-items:center;gap:.5rem;color:var(--brand);
  background:var(--brand-soft);border:1px solid color-mix(in srgb,var(--brand) 30%,transparent)}
.routing-glyph{width:34px;height:14px;flex:none;color:var(--accent)}
.routing-glyph path{stroke-dasharray:5 5;animation:route-flow .9s linear infinite}
@keyframes route-flow{to{stroke-dashoffset:-20}}
.routing-label{font-size:.9rem;font-weight:500}

/* thin indeterminate progress bar sliding across the top of the map */
.route-progress{position:absolute;top:0;left:0;right:0;height:3px;z-index:9;overflow:hidden;
  background:color-mix(in srgb,var(--accent) 16%,transparent);pointer-events:none}
.route-progress span{position:absolute;top:0;bottom:0;width:38%;border-radius:3px;
  background:linear-gradient(90deg,transparent,var(--accent),transparent);animation:route-slide 1.15s ease-in-out infinite}
@keyframes route-slide{0%{left:-40%}100%{left:100%}}
.chat-applied{display:flex;flex-wrap:wrap;gap:.3rem}
.applied-chip{font-size:.7rem;color:var(--brand);border:1px solid color-mix(in srgb,var(--brand) 45%,transparent);
  background:var(--brand-soft);border-radius:var(--radius-pill);padding:.08rem .45rem;white-space:nowrap}
/* first-run onboarding: tappable example prompts + a how-it-works hint */
.onboard-examples{display:flex;flex-direction:column;gap:.4rem;margin-top:.55rem}
.onboard-chip{display:flex;align-items:center;gap:.5rem;text-align:left;background:var(--surface);
  border:1px solid var(--border-strong);border-radius:12px;padding:.5rem .7rem;font-family:inherit;
  font-size:.85rem;color:var(--text);cursor:pointer;transition:border-color .12s ease,background .12s ease}
.onboard-chip::before{content:"↳";color:var(--accent);font-weight:700;flex:none}
.onboard-chip:hover{border-color:var(--brand);background:var(--brand-soft)}
.onboard-chip:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.onboard-hint{margin-top:.55rem;font-size:.76rem;color:var(--text-faint);line-height:1.4}
/* contextual weather hero chip: same shape, brand-forward */
.onboard-chip.onboard-hero{border-color:var(--brand);background:var(--brand-soft);font-weight:600}
.onboard-chip.onboard-hero::before{content:"☀";color:var(--brand)}
.onboard-alpha{margin-top:.3rem;opacity:.8}
/* cancel button + alpha note inside the routing indicator bubble */
.routing-cancel{margin-left:.6rem;flex:none;font:inherit;font-size:.76rem;font-weight:600;color:var(--text-muted);
  background:none;border:1px solid var(--border-strong);border-radius:999px;padding:.15rem .55rem;cursor:pointer}
.routing-cancel:hover{color:var(--text);border-color:var(--brand)}
.routing-alpha{flex-basis:100%;margin-top:.35rem;font-size:.72rem;color:var(--text-faint);line-height:1.35}
.chat-msg.routing .chat-bubble{flex-wrap:wrap} /* room for the alpha note line */
/* quick-reply chips for place disambiguation ("which Paris?") */
.choice-row{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.4rem}
.choice-chip{font-size:.8rem;font-weight:600;color:var(--text);background:var(--surface);cursor:pointer;
  border:1px solid var(--border-strong);border-radius:var(--radius-pill);padding:.32rem .7rem;text-align:left;
  transition:background .12s ease,border-color .12s ease,color .12s ease}
.choice-chip:hover:not(:disabled){border-color:var(--brand);background:var(--brand-soft)}
.choice-chip:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.choice-chip.on{background:var(--brand);color:var(--on-brand);border-color:var(--brand)}
.choice-chip:disabled{opacity:.55;cursor:default}
.choice-chip.on:disabled{opacity:1}

/* Contextual quick-refinement chips above the chat input: a single horizontally
   scrollable row so it never pushes the input off-screen on mobile. */
.chat-suggestions{display:flex;gap:.4rem;overflow-x:auto;scrollbar-width:none;
  padding:.1rem .1rem .45rem;margin:0 -.1rem;-webkit-overflow-scrolling:touch}
.chat-suggestions::-webkit-scrollbar{display:none}
.suggest-chip{flex:none;font-size:.78rem;font-weight:600;color:var(--text);background:var(--surface);
  cursor:pointer;white-space:nowrap;border:1px solid var(--border-strong);border-radius:var(--radius-pill);
  padding:.3rem .68rem;transition:background .12s ease,border-color .12s ease,transform .1s ease}
.suggest-chip:hover{border-color:var(--brand);background:var(--brand-soft)}
.suggest-chip:active{transform:scale(.96)}
.suggest-chip:focus-visible{outline:2px solid var(--ring);outline-offset:2px}

/* Route-variant comparison card (generative loops): a small stack of options,
   each colour-keyed to its map overlay, with stats, highlights and pick/refine. */
.variant-list{display:flex;flex-direction:column;gap:.45rem;margin-top:.55rem}
.variant-card{border:1px solid var(--border-strong);border-left:3px solid var(--vc,var(--brand));
  border-radius:var(--radius-md,10px);background:var(--surface);padding:.5rem .6rem}
.vc-head{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}
.vc-dot{width:.6rem;height:.6rem;border-radius:50%;background:var(--vc,var(--brand));flex:none}
.vc-head strong{font-size:.85rem}
.vc-stats{font-size:.76rem;color:var(--text-soft,var(--muted));font-variant-numeric:tabular-nums}
.vc-hi{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.3rem;font-size:.73rem;color:var(--text-soft,var(--muted))}
.vc-acts{display:flex;gap:.4rem;margin-top:.5rem}
.vc-pick,.vc-edit{font-size:.78rem;font-weight:600;cursor:pointer;border-radius:var(--radius-pill);
  padding:.3rem .7rem;border:1px solid var(--border-strong);transition:background .12s ease,border-color .12s ease}
.vc-pick{background:var(--brand);color:var(--on-brand);border-color:var(--brand)}
.vc-pick:hover{filter:brightness(1.05)}
.vc-edit{background:var(--surface);color:var(--text)}
.vc-edit:hover{border-color:var(--brand);background:var(--brand-soft)}
.vc-pick:focus-visible,.vc-edit:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
/* "type instead" escape hatch reads quieter than the real candidates */
.choice-chip.ghost{color:var(--text-muted);border-style:dashed;background:transparent}
.choice-chip.ghost:hover:not(:disabled){color:var(--brand);background:transparent}

.chat-input-row{display:flex;gap:.4rem;padding:10px 12px;border-top:1px solid var(--border);flex:none}
.cb-field{position:relative;flex:1;min-width:0}
.cb-spark{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--accent);font-size:.9rem;pointer-events:none}
.chat-input-row input{width:100%;min-height:var(--tap);border:1px solid var(--border-strong);border-radius:var(--radius-pill);
  background:var(--bg);color:var(--text);padding:0 .9rem 0 2rem;font-size:.9rem;font-family:inherit}
.chat-input-row input::placeholder{color:var(--text-faint)}
.chat-input-row input:focus{outline:2px solid var(--ring);outline-offset:-1px;border-color:transparent}
.chat-input-row button{min-width:var(--tap);min-height:var(--tap);border-radius:50%;border:1px solid var(--accent);
  background:var(--accent);color:var(--on-accent);font-weight:700;font-size:1.05rem;cursor:pointer;flex:none;
  transition:background .12s ease}
.chat-input-row button:hover:not(:disabled){background:var(--accent-hover)}
.chat-input-row button:disabled{opacity:.45;cursor:default}
.chat-input-row button:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
/* voice-mode button: quiet secondary look until active */
#voice-mode-btn{background:var(--bg);color:var(--accent);border-color:var(--border-strong)}
/* voice mode engaged: filled accent, gentle breathing halo so it's clear the
   app is in a hands-free conversation even when the mic is momentarily idle */
#voice-mode-btn.active{background:var(--accent);color:var(--on-accent);border-color:var(--accent);animation:mic-pulse 2.4s ease-in-out infinite}
@keyframes mic-pulse{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb, var(--accent) 35%, transparent)}50%{box-shadow:0 0 0 8px transparent}}

/* voice-chat status line: says in words whose turn it is. Colour + motion make
   the three phases unmistakable at a glance -- an icon change alone was too subtle. */
.voice-status{display:flex;align-items:center;gap:8px;margin:0 2px 6px;padding:7px 12px;border-radius:var(--radius-pill);
  font-size:.82rem;font-weight:600;line-height:1;background:var(--surface-2);color:var(--text)}
.voice-status-dot{width:9px;height:9px;border-radius:50%;flex:none;background:var(--text-muted)}
.voice-status.tappable{cursor:pointer}
.voice-status.tappable:active{filter:brightness(.94)}
/* your turn: green, actively pulsing -- the clearest "talk now" cue */
.voice-status[data-state="listening"]{background:color-mix(in srgb,var(--pine-500,#2f9e6b) 16%,transparent);color:var(--brand)}
.voice-status[data-state="listening"] .voice-status-dot{background:var(--brand);animation:voice-blink 1s ease-in-out infinite}
/* app working: amber, spinning ring */
.voice-status[data-state="thinking"]{background:color-mix(in srgb,#d9a441 18%,transparent);color:#b07d15}
.voice-status[data-state="thinking"] .voice-status-dot{background:transparent;border:2px solid color-mix(in srgb,#d9a441 45%,transparent);border-top-color:#b07d15;animation:voice-spin .7s linear infinite}
/* app speaking: accent, breathing */
.voice-status[data-state="speaking"]{background:var(--accent-soft);color:var(--accent-hover)}
.voice-status[data-state="speaking"] .voice-status-dot{background:var(--accent-hover);animation:voice-breathe 1.1s ease-in-out infinite}
@keyframes voice-blink{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.7)}}
@keyframes voice-spin{to{transform:rotate(360deg)}}
@keyframes voice-breathe{0%,100%{transform:scale(.75);opacity:.7}50%{transform:scale(1.15);opacity:1}}
@media (prefers-reduced-motion: reduce){
  #voice-mode-btn.active{animation:none}
  .voice-status-dot{animation:none!important}
}

/* ---- stat bar + belag ---- */
/* Wraps instead of scrolling: the surface block drops to a second full-width
   row when the three number stats fill the width, so the bar never scrolls
   horizontally even on very small phones. */
.stat-bar{display:flex;align-items:stretch;flex-wrap:wrap;gap:.5rem 1.1rem;background:var(--bg);
  border:1px solid var(--border-strong);border-radius:var(--radius-md);padding:.5rem .8rem;flex:none}
/* each stat stays a tidy two-line block (number + label); cells don't shrink,
   so a long label wraps the bar to a new row rather than onto extra text lines */
.stat{display:flex;flex-direction:column;gap:.1rem;justify-content:center;flex:none}
.stat .num{font-size:1.05rem;font-weight:500;color:var(--brand);line-height:1;font-family:var(--font-mono)}
.stat .unit{font-size:.64rem;color:var(--text-muted);white-space:nowrap}
.stat-time-btn .unit{color:var(--text);font-weight:600}
.stat-surface{min-width:118px;border-left:1px solid var(--border);padding-left:1rem}
.stat-surface[hidden]{display:none}
/* phones: guarantee no horizontal scroll — the surface summary takes its own
   full-width row under the numbers, divided by a top rule instead of a left one */
@media (max-width:480px){
  .stat-bar{gap:.45rem .9rem}
  .stat-surface{flex-basis:100%;min-width:0;border-left:0;padding-left:0;
    border-top:1px solid var(--border);padding-top:.4rem;margin-top:.1rem}
}
.surf-bar{display:flex;height:8px;width:100%;overflow:hidden;border-radius:2px;background:var(--surf-unbekannt)}
.surf-seg{height:100%}
.surf-seg+.surf-seg{border-left:1px solid var(--surface)}
.surf-befestigt{background:var(--surf-befestigt)}
.surf-schotter{background:var(--surf-schotter)}
.surf-unbefestigt{background:var(--surf-unbefestigt)}
.surf-unbekannt{background:var(--surf-unbekannt)}

/* ---- issue #10: positional surface / road-character band ---- */
.route-insight[hidden]{display:none}
.route-insight{margin-top:.55rem}
.ri-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:.4rem}
.ri-map-toggle{border:1px solid var(--border-strong);background:transparent;color:var(--text-muted);
  font-family:inherit;font-size:.68rem;font-weight:600;padding:.24rem .6rem;border-radius:var(--radius-pill);cursor:pointer}
.ri-map-toggle.on{background:var(--brand);color:var(--on-brand);border-color:var(--brand)}
.ri-modes{display:inline-flex;gap:2px;background:var(--surface-2);border-radius:var(--radius-pill);padding:2px}
.ri-modes button{border:0;background:transparent;font-family:inherit;font-size:.7rem;font-weight:600;
  color:var(--text-muted);padding:.22rem .6rem;border-radius:var(--radius-pill);cursor:pointer}
.ri-modes button.on{background:var(--surface);color:var(--text);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.ri-band{display:flex;height:14px;width:100%;overflow:hidden;border-radius:4px;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--text) 9%,transparent)}
.ri-seg{height:100%;transition:filter .12s}
.ri-seg:hover{filter:brightness(1.1) saturate(1.1)}
.ri-seg[data-cls="befestigt"]{background:var(--surf-befestigt)}
.ri-seg[data-cls="schotter"]{background:var(--surf-schotter)}
.ri-seg[data-cls="unbefestigt"]{background:var(--surf-unbefestigt)}
.ri-seg[data-cls="unbekannt"]{background:repeating-linear-gradient(45deg,var(--surf-unbekannt),var(--surf-unbekannt) 4px,transparent 4px,transparent 8px)}
.ri-seg[data-cls="quiet"]{background:#2e7d4f}
.ri-seg[data-cls="cycle"]{background:#1c7a8a}
.ri-seg[data-cls="main"]{background:#c2703a}
.ri-seg[data-cls="path"]{background:#8a6d3b}
.ri-axis{display:flex;justify-content:space-between;font-family:var(--font-mono);font-size:.6rem;
  color:var(--text-faint);margin-top:2px}
.ri-summary{font-family:var(--font-display);font-size:.82rem;color:var(--text);margin:.35rem 0 0;line-height:1.4}

/* ---- issue #11: route hints ("Unterwegs — beachten") ---- */
.route-hints[hidden]{display:none}
.route-hints{margin-top:.6rem}
.rh-head{font-size:.66rem;letter-spacing:.09em;text-transform:uppercase;font-weight:700;
  color:var(--text-faint);margin-bottom:.35rem}
.rh-head-good{color:var(--brand)}
.rh-tier+.rh-tier{margin-top:.5rem}
.route-hints .rh-tier[hidden]{display:none}
.rh-list{display:flex;flex-direction:column;gap:2px}
.rh-loading{display:flex;align-items:center;gap:.5rem;padding:.45rem .5rem;font-size:.78rem;color:var(--text-muted)}
.rh-spin{width:13px;height:13px;flex:none;border-radius:50%;border:2px solid var(--border-strong);
  border-top-color:var(--brand);animation:rh-spin .7s linear infinite}
@keyframes rh-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.rh-spin{animation-duration:1.6s}}
.rh-item{display:flex;align-items:flex-start;gap:.6rem;width:100%;text-align:left;
  background:transparent;border:0;border-radius:10px;padding:.45rem .5rem;cursor:pointer;
  font-family:inherit;transition:background .13s}
.rh-item:hover{background:var(--surface-2)}
/* "show N more / show less" toggle under the highlights list */
.rh-more{align-self:flex-start;margin:2px 0 0 .5rem;background:transparent;border:0;cursor:pointer;
  font-family:inherit;font-size:.74rem;font-weight:600;color:var(--brand);padding:.3rem .1rem}
.rh-more:hover{text-decoration:underline}
.rh-more:focus-visible{outline:2px solid var(--ring);outline-offset:2px;border-radius:6px}
.rh-em{font-size:1.05rem;line-height:1.2;flex:0 0 1.3rem;text-align:center}
.rh-body{display:flex;flex-direction:column;min-width:0;line-height:1.3}
.rh-t{font-family:var(--font-display);font-size:.82rem;font-weight:520;color:var(--text)}
.rh-d{font-size:.72rem;color:var(--text-muted)}
.rh-km{margin-left:auto;align-self:center;flex:0 0 auto;font-family:var(--font-mono);
  font-size:.64rem;font-weight:600;color:var(--text-muted);background:var(--surface-2);
  border-radius:var(--radius-pill);padding:2px 7px;white-space:nowrap;font-variant-numeric:tabular-nums}

/* ---- elevation panel ---- */
/* A standalone floating strip pinned just above the bottom-centre cluster,
   independent of the route-facts card. Same surface/shadow language as the
   toolbar so the two read as one bottom stack. */
.elevation-panel{position:absolute;z-index:7;bottom:calc(var(--safe-bottom) + 70px);left:50%;transform:translateX(-50%);
  width:min(560px,calc(100% - 24px));height:132px;background:var(--surface);border:1px solid var(--border-strong);
  border-radius:var(--radius-md);padding:.45rem .7rem .55rem;display:flex;flex-direction:column;gap:.3rem;
  box-shadow:var(--elev-2);animation:elev-pop .22s cubic-bezier(.16,1,.3,1)}
.elevation-panel .elev-plot{animation:elev-draw .7s ease-out}
.elevation-panel[hidden]{display:none}
@keyframes elev-pop{from{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%,0)}}
/* when the elevation strip is open, lift the ⋯ menu above it so they don't stack */
body.elev-showing .more-menu{bottom:calc(var(--safe-bottom) + 214px)}
@media (prefers-reduced-motion:reduce){.elevation-panel,.elevation-panel .elev-plot{animation:none}}
.elev-head{display:flex;align-items:center;gap:.5rem;font-size:.7rem;color:var(--text-muted)}
.elev-head .mono{margin-left:auto}
.elev-close{flex:0 0 auto;width:22px;height:22px;display:flex;align-items:center;justify-content:center;padding:0;
  background:var(--surface);border:1px solid var(--border-strong);border-radius:6px;color:var(--text);
  font-size:.78rem;line-height:1;cursor:pointer}
.elev-close:hover{background:var(--surface-hover)}
.elev-close:focus-visible{outline:2px solid var(--ring);outline-offset:1px}
.elev-plot{position:relative;flex:1;min-height:0;touch-action:none;cursor:crosshair}
.elev-svg{width:100%;height:100%;display:block}
.elev-svg path{fill:color-mix(in srgb,var(--brand) 28%,transparent);stroke:var(--brand);stroke-width:1.5;vector-effect:non-scaling-stroke}
.elev-cursor-line{stroke:var(--accent);stroke-width:1;vector-effect:non-scaling-stroke;pointer-events:none}
.elev-cursor-dot{fill:var(--accent);stroke:var(--surface);stroke-width:1.2;vector-effect:non-scaling-stroke;pointer-events:none}
.elev-tooltip{position:absolute;top:0;transform:translateX(-50%);background:var(--accent);color:#fff;font-size:.66rem;
  font-family:var(--font-mono);padding:.1rem .35rem;border-radius:4px;white-space:nowrap;pointer-events:none;z-index:2}
.elev-empty{color:var(--text-muted);font-size:.8rem}

/* ---- markers ---- */
.wp-marker{width:14px;height:14px;border-radius:50%;background:var(--surface);border:2px solid var(--accent);
  box-shadow:0 0 0 1px rgba(0,0,0,.25);cursor:grab}
.wp-marker.start{background:var(--brand);border-color:var(--surface);width:16px;height:16px}
/* distance markers along the route (km) — small pill, non-interactive */
.km-pin{background:var(--surface);color:var(--text);border:1.5px solid var(--brand);border-radius:999px;
  font-family:var(--font-mono);font-size:10px;font-weight:600;line-height:1;padding:2px 5px;white-space:nowrap;
  box-shadow:0 1px 3px rgba(0,0,0,.35);pointer-events:none}
.map-panel.route-dimmed .km-pin{opacity:.3;transition:opacity .2s ease}
/* focus pin: dropped where a highlight/hint is tapped, so the spot is marked */
.focus-pin{position:relative;width:16px;height:16px;border-radius:50%;background:var(--accent);
  border:3px solid var(--surface);box-shadow:0 0 0 1.5px var(--accent),0 1px 4px rgba(0,0,0,.4)}
.focus-pin::after{content:"";position:absolute;inset:-5px;border-radius:50%;border:2px solid var(--accent);
  animation:focus-pulse 1.5s ease-out infinite}
@keyframes focus-pulse{0%{transform:scale(.7);opacity:.85}100%{transform:scale(1.9);opacity:0}}
@media (prefers-reduced-motion:reduce){.focus-pin::after{animation:none;opacity:.5}}
/* waypoint list (reorder / rename / delete) */
.wp-list-wrap{border-top:1px solid var(--border);padding-top:.5rem;margin-top:.2rem}
.wp-list-head{font-size:.64rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--text-faint);margin-bottom:.4rem}
.wp-list{display:flex;flex-direction:column;gap:.3rem}
.wp-row{display:flex;align-items:center;gap:.35rem}
.wp-dot{flex:none;width:14px;text-align:center;color:var(--brand);font-size:.8rem}
.wp-name{flex:1;min-width:0;background:var(--surface-2);border:1px solid transparent;border-radius:8px;
  padding:.3rem .45rem;font-family:inherit;font-size:.82rem;color:var(--text)}
.wp-name:hover{border-color:var(--border-strong)}
.wp-name:focus{outline:none;border-color:var(--brand);background:var(--surface)}
.wp-mv,.wp-del{flex:none;width:28px;height:28px;display:flex;align-items:center;justify-content:center;
  border:1px solid var(--border-strong);border-radius:7px;background:var(--surface);color:var(--text-muted);
  cursor:pointer;font-size:.7rem}
.wp-mv:hover:not(:disabled),.wp-del:hover{border-color:var(--brand);color:var(--brand)}
.wp-mv:disabled{opacity:.35;cursor:default}
.wp-del .i{width:15px;height:15px}
.route-hover-marker{width:12px;height:12px;border-radius:50%;background:var(--accent);border:2px solid var(--surface);
  box-shadow:0 0 0 1px rgba(0,0,0,.3);pointer-events:none}

/* ---- Home / route overview (branded dashboard over the editor) ---- */
.home-view{position:absolute;inset:0;z-index:14;background:var(--bg);display:flex;flex-direction:column;
  padding-top:var(--safe-top)}
.home-top{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;
  border-bottom:1px solid var(--border);flex:none}
.home-top .wordmark{font-family:var(--font-wordmark);font-size:1.15rem;font-weight:800;letter-spacing:-.02em;
  display:flex;align-items:center;gap:0;color:var(--text)}
.home-top .wordmark b{color:var(--brand);font-weight:800}
.home-close{width:38px;height:38px;display:flex;align-items:center;justify-content:center;border-radius:50%;
  border:1px solid var(--border-strong);background:var(--surface);color:var(--text);cursor:pointer}
.home-close:hover{background:var(--surface-hover)}
.home-close:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.home-scroll{flex:1;min-height:0;overflow-y:auto;padding:22px 16px calc(28px + var(--safe-bottom));
  max-width:720px;width:100%;margin:0 auto}
.home-hero{padding:8px 2px 22px}
.home-eyebrow{font-size:.7rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--brand);
  margin:0 0 .5rem;display:flex;align-items:center;gap:.5rem}
.home-eyebrow::before{content:"";width:20px;height:2px;background:var(--brand);border-radius:2px}
.home-title{font-family:var(--font-display);font-weight:600;font-size:clamp(1.8rem,7vw,2.6rem);line-height:1.05;
  letter-spacing:-.02em;margin:0 0 .5rem;color:var(--text);text-wrap:balance}
.home-sub{color:var(--text-muted);font-size:1rem;line-height:1.5;margin:0 0 1.2rem;max-width:46ch}
.home-cta{display:inline-flex;align-items:center;gap:.5rem;background:var(--accent);color:var(--on-accent);
  border:0;border-radius:var(--radius-pill);font-family:inherit;font-size:.95rem;font-weight:650;
  padding:.7rem 1.3rem;cursor:pointer;box-shadow:var(--elev-1);transition:background .12s ease,transform .12s ease}
.home-cta:hover{background:var(--accent-hover)}
.home-cta:active{transform:translateY(1px)}
.home-cta:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.home-sec-head{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem;
  padding-top:1.1rem;border-top:1px solid var(--border);margin-bottom:.9rem}
.home-sec-head h2{font-family:var(--font-display);font-weight:600;font-size:1.25rem;letter-spacing:-.01em;margin:0;color:var(--text)}
.home-count{font-family:var(--font-mono);font-size:.8rem;color:var(--text-faint)}
.home-routes{display:grid;grid-template-columns:1fr;gap:10px}
@media (min-width:560px){.home-routes{grid-template-columns:1fr 1fr}}
.home-card{position:relative;display:flex;flex-direction:column;gap:.35rem;text-align:left;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);
  padding:14px 15px;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease,transform .12s ease}
.home-card:hover{border-color:var(--brand);box-shadow:var(--elev-1)}
.home-card:active{transform:translateY(1px)}
.home-card:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.home-card .hc-name{font-weight:650;font-size:.98rem;color:var(--text);line-height:1.25;padding-right:26px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.home-card .hc-meta{display:flex;align-items:center;gap:.5rem;font-size:.8rem;color:var(--text-muted);
  font-variant-numeric:tabular-nums}
.home-card .hc-km{font-weight:650;color:var(--brand)}
.home-card .hc-badge{font-size:.64rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase;
  color:var(--text-faint);border:1px solid var(--border-strong);border-radius:var(--radius-pill);padding:.05rem .4rem}
.home-card .hc-del{position:absolute;top:10px;right:10px;width:26px;height:26px;display:flex;align-items:center;
  justify-content:center;border-radius:7px;border:0;background:transparent;color:var(--text-faint);cursor:pointer;opacity:.7}
.home-card .hc-del:hover{background:var(--surface-2);color:var(--accent);opacity:1}
.home-card .hc-del .i{width:15px;height:15px}
.home-empty{text-align:center;color:var(--text-muted);background:var(--surface-2);border:1px dashed var(--border-strong);
  border-radius:var(--radius-md);padding:26px 18px;font-size:.92rem}
.home-actions{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center}
.home-secondary{background:var(--surface);color:var(--text);border:1px solid var(--border-strong);
  border-radius:var(--radius-pill);font-family:inherit;font-size:.9rem;font-weight:600;padding:.65rem 1.1rem;cursor:pointer}
.home-secondary:hover{border-color:var(--brand)}
.home-secondary:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
/* export format chooser */
.exp-btns{display:flex;flex-direction:column;gap:.5rem}
.exp-opt{display:flex;flex-direction:column;align-items:flex-start;gap:.1rem;text-align:left;
  background:var(--surface-2);border:1px solid var(--border-strong);border-radius:var(--radius-md);
  padding:.6rem .8rem;cursor:pointer;font-family:inherit}
.exp-opt:hover{border-color:var(--brand)}
.exp-opt:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.exp-opt b{font-size:.95rem;color:var(--text)}
.exp-opt span{font-size:.78rem;color:var(--text-muted)}

/* confirm dialog (clear route) — cancel vs. destructive action */
.confirm-btns{display:flex;gap:.5rem;justify-content:flex-end;margin-top:.4rem}
.confirm-btns button{padding:.5rem .9rem;border-radius:var(--radius-md);cursor:pointer;font-family:inherit;
  font-size:.85rem;border:1px solid var(--border-strong)}
.confirm-cancel{background:var(--surface-2);color:var(--text)}
.confirm-cancel:hover{border-color:var(--brand)}
.confirm-danger{background:#c0392b;border-color:#c0392b;color:#fff}
.confirm-danger:hover{background:#a93226;border-color:#a93226}
.confirm-btns button:focus-visible{outline:2px solid var(--ring);outline-offset:2px}

/* ---- ≥1024px (desktop + tablet landscape): the chat drawer docks as a left
   column; the profile drawer stays a fly-out; everything else is identical.
   One shell, one question: overlay or dock. ---- */
@media (min-width:1024px){
  .app{display:flex}
  .map-panel{position:relative;flex:1;min-width:0;order:2}
  /* docked chat: a static column in the flex row, slid away when closed */
  .drawer.left{position:relative;inset:auto;transform:none;order:1;flex:none;width:380px;
    border-radius:0;box-shadow:none;z-index:6;margin-left:0;transition:margin-left .25s cubic-bezier(.16,1,.3,1)}
  .drawer.left:not(.open){margin-left:-380px}
  .drawer.left .drawer-head{padding-top:14px}
  /* the fly-out profile drawer keeps its overlay behavior at a fixed width */
  .drawer.right{width:380px}
  /* no dim layer when the only overlay is the narrow right fly-out */
  .drawer-backdrop{display:none}
  /* stat card: don't span the whole map — a centred reader column. Centre via
     auto-margins (not translateX) so the open animation's transform is free.
     The card is an .app child (fixed to the viewport), so when the chat column
     is docked-open we shift its left edge past that 380px column — otherwise it
     centres over the whole viewport and reads shifted left of the map + pill. */
  .stat-card{left:0;right:0;margin-inline:auto;width:min(600px,72%)}
  .app:has(#chat-drawer.open) .stat-card{left:380px}
  /* mirror for the right-hand routing-profile column: pull the card's right
     edge in past the 380px drawer so it re-centres in the open map area
     instead of sliding under the profile panel */
  .app:has(#profile-drawer.open) .stat-card{right:380px}
  /* a docked-open chat means the top-left FAB is redundant */
  .app:has(#chat-drawer.open) #chat-fab{display:none}
}

/* ---- dev settings (localhost only) ---- */
/* floats above the bottom-left Home chip */
.dev-btn{position:fixed;left:12px;bottom:calc(var(--safe-bottom) + 64px);z-index:30;
  font-size:.72rem;font-weight:600;padding:.35rem .6rem;border-radius:var(--radius-pill);
  border:1px solid var(--border-strong);background:var(--surface);color:var(--text-muted);
  cursor:pointer;box-shadow:var(--elev-1);opacity:.72}
.dev-btn:hover{opacity:1}
.dev-btn:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.dev-dialog{border:1px solid var(--border-strong);border-radius:16px;background:var(--surface);color:var(--text);
  padding:0;max-width:min(430px,92vw);width:100%;box-shadow:var(--elev-3)}
.dev-dialog::backdrop{background:rgba(0,0,0,.5)}
.dev-form{padding:18px;display:flex;flex-direction:column;gap:12px}
.dev-head{display:flex;align-items:center;justify-content:space-between;font-size:1rem}
.dev-x{border:0;background:none;color:var(--text-faint);font-size:1rem;cursor:pointer;padding:2px 6px}
.dev-x:hover{color:var(--text)}
.dev-note{margin:0;font-size:.74rem;color:var(--text-faint);line-height:1.45}
.dev-note code{font-family:var(--font-mono);font-size:.9em}
.dev-field{display:flex;flex-direction:column;gap:.25rem;font-size:.8rem}
.dev-field span{color:var(--text-muted);font-weight:600}
.dev-field input,.dev-field select{padding:.5rem .6rem;border:1px solid var(--border-strong);border-radius:8px;
  background:var(--bg);color:var(--text);font-size:.85rem;font-family:inherit;width:100%}
.dev-field input:focus,.dev-field select:focus{outline:2px solid var(--ring);outline-offset:-1px;border-color:transparent}
.dev-group{border:1px solid var(--border);border-radius:10px;padding:.55rem .7rem .7rem;display:flex;flex-direction:column;gap:8px;margin:0}
.dev-group[hidden]{display:none}
.dev-group legend{font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--text-faint);padding:0 .3rem}
.dev-status{font-size:.78rem;padding:.4rem .6rem;border-radius:8px}
.dev-status[hidden]{display:none}
.dev-status.ok{background:var(--brand-soft);color:var(--brand)}
.dev-status.err{background:color-mix(in srgb,var(--accent) 15%,transparent);color:var(--accent)}
.dev-actions{display:flex;justify-content:flex-end}
.dev-save{padding:.5rem .9rem;border-radius:var(--radius-pill);border:1px solid var(--brand);background:var(--brand);
  color:var(--on-brand);font-weight:600;cursor:pointer;font-family:inherit}
.dev-save:hover{filter:brightness(1.06)}
.dev-save:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
/* desktop: dev button into the map's bottom-left, clear of the left sidebar.
   Placed after the base .dev-btn so it wins source-order at >=768px. */
@media (min-width:768px){.dev-btn{left:372px;bottom:12px}}

/* ---- map layers dialog + POI overlays ---- */
.ly-group{display:flex;flex-direction:column;gap:1px}
.ly-title{font-size:.66rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--text-faint);margin:.35rem 0 .15rem}
.ly-item{display:flex;align-items:center;gap:.5rem;font-size:.85rem;color:var(--text);cursor:pointer;min-height:34px}
.ly-item input{accent-color:var(--brand);width:16px;height:16px;cursor:pointer;flex:none}
.ly-dot{width:11px;height:11px;border-radius:50%;background:var(--c,#888);box-shadow:0 0 0 2px var(--surface),0 0 0 3px rgba(0,0,0,.12);flex:none}
.maplibregl-popup-content{border-radius:12px;padding:12px 14px;font-family:var(--font-sans);box-shadow:var(--elev-2)}
.poi-pop{display:flex;flex-direction:column;gap:8px;min-width:150px}
.poi-pop strong{font-size:.95rem;color:#1a1a1a}
.poi-oh{font-size:.74rem;color:#555;font-family:var(--font-mono)}
.poi-add{padding:.45rem .7rem;border-radius:var(--radius-pill);border:1px solid var(--brand);background:var(--brand);
  color:var(--on-brand);font-weight:600;font-size:.8rem;cursor:pointer;font-family:inherit}
.poi-add:hover{filter:brightness(1.06)}
.poi-pop-btns{display:flex;flex-wrap:wrap;gap:6px}
.poi-report,.poi-sv{padding:.45rem .7rem;border-radius:var(--radius-pill);border:1px solid var(--border-strong);
  background:transparent;color:var(--text-muted);font-weight:600;font-size:.8rem;cursor:pointer;font-family:inherit}
.poi-report:hover,.poi-sv:hover{border-color:var(--brand);color:var(--brand)}
.osm-note-subject{font-size:.8rem;color:var(--text-muted);font-family:var(--font-mono)}
.osm-note-chips{display:flex;flex-wrap:wrap;gap:6px}
.osm-chip{padding:.35rem .6rem;border-radius:var(--radius-pill);border:1px solid var(--border-strong);
  background:transparent;color:var(--text);font-size:.76rem;cursor:pointer;font-family:inherit}
.osm-chip:hover{border-color:var(--brand);color:var(--brand)}
#osm-note-text{width:100%;resize:vertical;font:inherit;padding:.5rem .6rem;border-radius:8px;
  border:1px solid var(--border-strong);background:var(--surface);color:var(--text)}
#osm-note-text:focus{outline:2px solid var(--ring);outline-offset:-1px;border-color:transparent}

/* right-click / long-press context menu on the map (theme-aware: MapLibre's
   popup content defaults to white, so set our own surface + text explicitly). */
.ctx-pop .maplibregl-popup-content{padding:5px;border-radius:12px;box-shadow:var(--elev-2);
  border:1px solid var(--border-strong);background:var(--surface);color:var(--text)}
.ctx-pop .maplibregl-popup-tip{display:none}
.ctx-menu{display:flex;flex-direction:column;min-width:196px}
.ctx-menu button{text-align:left;background:none;border:none;padding:.55rem .7rem;border-radius:8px;
  font-family:inherit;font-size:.86rem;color:var(--text);cursor:pointer;white-space:nowrap}
.ctx-menu button:hover{background:var(--surface-hover)}
/* explicit divider between routing actions and the utility group (street view / report) */
.ctx-sep{height:1px;background:var(--border);margin:4px 6px}
/* the utility actions after the divider read a touch quieter */
.ctx-sep ~ button{color:var(--text-muted)}

/* ---- micro-animations (all neutralised by the reduced-motion guard below) ---- */
@keyframes or-msg-in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
@keyframes or-view-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes or-pop-in{from{opacity:0;transform:scale(.96) translateY(6px)}to{opacity:1;transform:none}}
@keyframes or-fade-in{from{opacity:0}to{opacity:1}}
@keyframes or-chip-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
/* chat: each message eases in as it arrives */
.chat-msg{animation:or-msg-in .28s cubic-bezier(.2,.7,.3,1)}
/* full-screen home: gentle rise-in when opened */
.home-view:not([hidden]){animation:or-view-in .32s cubic-bezier(.2,.7,.3,1)}
/* dialogs: scale-fade in, backdrop fades */
.dev-dialog[open]{animation:or-pop-in .2s cubic-bezier(.2,.7,.3,1)}
.dev-dialog::backdrop{animation:or-fade-in .2s ease}
/* onboarding example prompts stagger in */
.onboard-chip{animation:or-chip-in .3s ease backwards}
.onboard-chip:nth-child(1){animation-delay:.04s}
.onboard-chip:nth-child(2){animation-delay:.1s}
.onboard-chip:nth-child(3){animation-delay:.16s}
/* small chips pop in (not km-pins — they rebuild on every zoom) */
.applied-chip,.choice-chip{animation:or-chip-in .25s ease backwards}
/* stat numbers give a tiny bump when the route is (re)calculated */
@keyframes or-bump{0%{transform:scale(1)}32%{transform:scale(1.13)}100%{transform:scale(1)}}
.stat .num.bump{display:inline-block;animation:or-bump .38s cubic-bezier(.2,.7,.3,1)}
/* hover lift on cards / options (transitions already declared on them) */
.home-card:hover{transform:translateY(-2px)}
.exp-opt:hover{transform:translateY(-1px)}
.onboard-chip:hover{transform:translateX(2px)}
.onboard-chip{transition:border-color .12s ease,background .12s ease,transform .12s ease}

/* startup access gate: full-screen, covers the app until the invite check passes */
.access-gate{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;
  padding:24px;background:var(--bg);animation:or-fade-in .2s ease}
.access-gate.gate-done{opacity:0;pointer-events:none;transition:opacity .35s ease}
.gate-card{width:100%;max-width:360px;display:flex;flex-direction:column;align-items:center;gap:18px;text-align:center}
.gate-brand{font-weight:800;font-size:1.5rem;letter-spacing:-.02em}
.gate-logo{color:var(--brand)}.gate-logo span{color:var(--accent)}
.gate-checking{display:flex;align-items:center;justify-content:center;min-height:48px;color:var(--text-faint)}
.gate-check-spin{width:26px;height:26px;animation:or-spin .8s linear infinite}
.gate-form{display:flex;flex-direction:column;align-items:center;gap:12px;width:100%;
  animation:or-pop-in .28s cubic-bezier(.2,.7,.3,1)}
.gate-lock{display:flex;color:var(--brand);width:34px;height:34px;align-items:center;justify-content:center;
  border-radius:50%;background:var(--brand-soft)}
.gate-lock .i{width:19px;height:19px}
.gate-title{font-size:1.05rem}
.gate-note{margin:0;font-size:.82rem;color:var(--text-faint);line-height:1.45}
.gate-share-hint{margin:0;font-size:.82rem;line-height:1.45;color:var(--brand);background:var(--brand-soft);border-radius:8px;padding:8px 10px}
#gate-code{width:100%;padding:.7rem .8rem;font-size:1rem;text-align:center;border:1px solid var(--border-strong);
  border-radius:10px;background:var(--surface-2);color:var(--text)}
#gate-code:focus{outline:2px solid var(--ring);outline-offset:-1px;border-color:transparent}
.gate-error{margin:0;font-size:.78rem;font-weight:600;color:var(--accent)}
.gate-form .access-submit{width:100%;margin-top:2px}

/* shared submit button (loading spinner / success check) — used by the gate */
.access-submit{position:relative;display:flex;align-items:center;justify-content:center;gap:.4rem;
  padding:.6rem 1rem;border:0;border-radius:var(--radius-pill);background:var(--brand);color:var(--on-brand);
  font:inherit;font-weight:700;font-size:.88rem;cursor:pointer;transition:background .12s ease,transform .08s ease}
.access-submit:hover{background:var(--brand-hover)}
.access-submit:active{transform:scale(.98)}
.access-submit:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.access-submit .access-spin,.access-submit .access-check{display:none;width:18px;height:18px}
/* loading: swap label for a spinning ring */
.access-submit.is-loading{pointer-events:none}
.access-submit.is-loading .access-submit-label{display:none}
.access-submit.is-loading .access-spin{display:block;animation:or-spin .7s linear infinite}
/* success: swap for a checkmark that draws itself in, then the dialog closes */
.access-submit.is-success .access-submit-label,.access-submit.is-success .access-spin{display:none}
.access-submit.is-success .access-check{display:block;stroke-dasharray:20;stroke-dashoffset:20;
  animation:or-check-draw .35s ease forwards}
.access-submit.is-success{background:var(--brand)}
/* wrong code: the input shakes and the error note fades in */
@keyframes or-shake{10%,90%{transform:translateX(-1px)}20%,80%{transform:translateX(2px)}
  30%,50%,70%{transform:translateX(-4px)}40%,60%{transform:translateX(4px)}}
.access-code-shake{animation:or-shake .4s cubic-bezier(.36,.07,.19,.97)}
@keyframes or-spin{to{transform:rotate(360deg)}}
@keyframes or-check-draw{from{stroke-dashoffset:20}to{stroke-dashoffset:0}}

@media (prefers-reduced-motion:reduce){*{animation-duration:.001ms!important;transition-duration:.001ms!important}}
