/* ============================================================
   RouteCast — app shell + injected-content styles
   Extends the parent site's warm paper palette. Light is default;
   [data-theme="dark"] is the alternate. Same design tokens as
   static/home/css/home.css, scoped locally so this file stands alone.
   ============================================================ */

:root {
  --bg:          #F4F2EC;
  --bg-tint:     #EFECE3;
  --surface:     #FAF9F5;
  --surface-2:   #F2F0E9;
  --ink:         #1B1A18;
  --ink-soft:    #3D3B36;
  --muted:       #6E6A61;
  --faint:       #97938A;
  --line:        #E0DCD1;
  --line-strong: #CFCABC;

  --clay:        #C1613F;
  --clay-hover:  #A94F31;
  --clay-soft:   #F3E4DC;
  --clay-ink:    #FFFFFF;

  --shadow-sm: 0 1px 2px rgba(31, 30, 28, .05);
  --shadow:    0 4px 16px -6px rgba(31, 30, 28, .16);
  --shadow-lg: 0 20px 50px -18px rgba(31, 30, 28, .30);

  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --ease:      cubic-bezier(.22, 1, .36, 1);

  --serif: "Newsreader", ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* risk levels */
  --rc-clear:      #4E8C6A;
  --rc-clear-soft: #E4EEE7;
  --rc-watch:      #C79A2E;
  --rc-watch-soft: #F4EBD3;
  --rc-caution:    #C1613F;
  --rc-caution-soft: #F3E4DC;
  --rc-danger:     #A63232;
  --rc-danger-soft: #F2DEDE;

  --map-filter: none;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #1B1A18;
    --bg-tint:     #201F1C;
    --surface:     #262522;
    --surface-2:   #2E2D29;
    --ink:         #F3F1EA;
    --ink-soft:    #D8D4C9;
    --muted:       #A19C90;
    --faint:       #7A756B;
    --line:        #383630;
    --line-strong: #4A4740;

    --clay:        #D9825F;
    --clay-hover:  #E89A79;
    --clay-soft:   #3A2B23;
    --clay-ink:    #1B1A18;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow:    0 4px 20px -6px rgba(0, 0, 0, .55);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .6);

    --rc-clear-soft:   #223229;
    --rc-watch-soft:   #362E1B;
    --rc-caution-soft: #3A2B23;
    --rc-danger-soft:  #3A2222;

    --map-filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.6);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg:          #1B1A18;
  --bg-tint:     #201F1C;
  --surface:     #262522;
  --surface-2:   #2E2D29;
  --ink:         #F3F1EA;
  --ink-soft:    #D8D4C9;
  --muted:       #A19C90;
  --faint:       #7A756B;
  --line:        #383630;
  --line-strong: #4A4740;

  --clay:        #D9825F;
  --clay-hover:  #E89A79;
  --clay-soft:   #3A2B23;
  --clay-ink:    #1B1A18;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow:    0 4px 20px -6px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .6);

  --rc-clear-soft:   #223229;
  --rc-watch-soft:   #362E1B;
  --rc-caution-soft: #3A2B23;
  --rc-danger-soft:  #3A2222;

  --map-filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.6);

  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

html, body { height: 100vh; height: 100dvh; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: inherit; }
button { font: inherit; }

::selection { background: var(--clay); color: var(--clay-ink); }

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   Shell
   ============================================================ */
.rc-app {
  /* Fixed to the window rather than sized with vh/dvh: on an installed app the
     status bar makes 100dvh taller than the area actually on screen, which
     pushed the bottom sheet off the bottom of the display. */
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.rc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: none;
  z-index: 30;
}

[data-fullscreen="on"] .rc-header { display: none; }

.rc-wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -.01em;
}
.rc-wordmark-mark {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--clay);
  color: var(--clay-ink);
}
.rc-wordmark-mark svg { width: 15px; height: 15px; }

.rc-header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.rc-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px;
  padding: 0 9px;
  background: var(--surface-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .8rem; font-weight: 600;
  transition: color .18s var(--ease), border-color .18s var(--ease), background-color .18s var(--ease);
}
.rc-iconbtn:hover { color: var(--ink); border-color: var(--line-strong); }
.rc-iconbtn svg { width: 16px; height: 16px; }

.rc-theme-icon { width: 15px; height: 15px; display: block; }
[data-theme="dark"] .rc-theme-icon-sun { display: none; }
:root:not([data-theme="dark"]) .rc-theme-icon-moon { display: none; }

/* full-screen toggle: expand/contract icon swap, mirrors the theme sun/moon swap */
.rc-fs-icon { width: 16px; height: 16px; display: block; }
#fullscreen-btn[aria-pressed="true"] .rc-fs-icon-expand { display: none; }
#fullscreen-btn[aria-pressed="false"] .rc-fs-icon-contract { display: none; }

/* install button: filled clay pill, the primary header action when visible */
.rc-btn-install {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px;
  padding: 0 14px 0 11px;
  background: var(--clay);
  color: var(--clay-ink);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: .82rem; font-weight: 600;
  white-space: nowrap;
  transition: background-color .18s var(--ease), transform .18s var(--ease);
}
.rc-btn-install:hover { background: var(--clay-hover); }
.rc-btn-install:active { transform: translateY(1px); }
.rc-btn-install svg { width: 16px; height: 16px; flex: none; }
.rc-btn-install[hidden] { display: none; }

.rc-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* ============================================================
   Map
   ============================================================ */
/* The map lives inside a wrapper that owns the layout slot and the clip.
   Course-up rotation grows #map past the wrapper's edges (see compass.js);
   the wrapper's overflow:hidden is what keeps that off the rest of the UI. */
.rc-map-wrap {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  background: var(--surface-2);
  /* Leaflet's own panes run z-index 200-800. Without a stacking context of its
     own the map paints straight over the panel (z-index 20), which left the
     bottom sheet invisible underneath the tiles while still swallowing every
     touch meant for the map. isolate keeps those panes contained. */
  position: relative;
  overflow: hidden;
  z-index: 0;
  isolation: isolate;
}
.rc-map {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: var(--surface-2);
}
.rc-map .leaflet-tile-pane { filter: var(--map-filter); }

/* ---- course-up rotation ------------------------------------------------
   One transform on the map element: composited, no reflow, and Leaflet's
   own projection never learns about it. Everything that carries text or
   points at a place counter-rotates about its own anchor so it stays
   upright and stays put. --rc-bearing is written by compass.js. */
html[data-rotate="on"] .rc-map {
  transform: rotate(var(--rc-bearing, 0deg));
  transform-origin: 50% 50%;
  will-change: transform;
}
html[data-rotate="on"] .rc-marker {
  transform: rotate(calc(-1 * var(--rc-bearing, 0deg)));
  transform-origin: 50% calc(100% + 7px); /* the stem tip, which sits on the coordinate */
}
/* Leaflet's own controls sit inside the map element, so under rotation they
   are both tilted and pushed out past the visible area. Hide them; the app's
   own map buttons live outside the rotated element, and pinch/scroll zoom
   (anchored to the centre by compass.js) still works. */
html[data-rotate="on"] .rc-map .leaflet-control-container { display: none; }
html[data-rotate="on"] .rc-marker-pin {
  transform: rotate(calc(-1 * var(--rc-bearing, 0deg))) rotate(-45deg);
  transform-origin: 50% 28px;             /* the pin's point, matching iconAnchor */
}

/* ============================================================
   Panel (desktop sidebar / mobile bottom sheet)
   ============================================================ */
.rc-panel {
  flex: none;
  width: 400px;
  max-width: 42vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 20;
}

.rc-sheet-handle {
  display: none;
  width: 100%;
  min-height: 44px;
  border: none;
  background: transparent;
  cursor: grab;
  padding: 14px 0 12px;
  touch-action: none;
}
.rc-sheet-handle::after {
  content: "";
  display: block;
  width: 40px; height: 4px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--line-strong);
}
.rc-panel.is-dragging { transition: none !important; }

.rc-panel-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* Results render above the form; without this the browser scrolls to keep
     the pressed button in place and hides the summary the rider asked for. */
  overflow-anchor: none;
  overscroll-behavior: contain;
  padding: 18px 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   Peek bar — always-visible summary button under the drag handle
   ============================================================ */
.rc-peek-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 4px 18px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.rc-peek-bar-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}
.rc-peek-bar-primary {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-peek-bar-secondary {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-peek-bar-secondary:empty { display: none; }
#peek-bar-badge { flex: none; max-width: 42%; }
#peek-bar-badge:empty { display: none; }

@media (min-width: 821px) {
  .rc-peek-bar { display: none; }
}

.rc-empty {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .92rem;
}
.rc-empty p { margin: 0; }
.rc-panel[data-has-route] .rc-empty { display: none; }

/* ============================================================
   Status
   ============================================================ */
.rc-status {
  font-size: .85rem;
  color: var(--muted);
  min-height: 0;
}
.rc-status:empty { display: none; }
.rc-status[data-kind="error"] { color: var(--rc-danger); }
.rc-status.rc-busy { color: var(--muted); }

.rc-spinner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.rc-spinner::before {
  content: "";
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--clay);
  animation: rc-spin .7s linear infinite;
  flex: none;
}
@media (prefers-reduced-motion: reduce) {
  .rc-spinner::before { animation-duration: 1.4s; }
}
@keyframes rc-spin { to { transform: rotate(360deg); } }

.rc-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--rc-danger-soft);
  border: 1px solid color-mix(in srgb, var(--rc-danger) 35%, var(--line));
  border-radius: var(--radius-sm);
  color: var(--rc-danger);
  font-size: .85rem;
}
.rc-error svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }

/* ============================================================
   Form
   ============================================================ */
.rc-form { display: flex; flex-direction: column; gap: 14px; }

.rc-label {
  display: block;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}

.rc-field-group { position: relative; min-width: 0; }
.rc-field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; }
.rc-depart-at-group:has(#depart-at[hidden]) { display: none; }
.rc-field-row:has(.rc-depart-at-group[style*="display: none"]),
.rc-field-row:has(#depart-at[hidden]) { grid-template-columns: 1fr; }

.rc-input-row { display: flex; gap: 6px; }

.rc-input, .rc-select {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: .92rem;
  padding: 9px 11px;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .16s var(--ease), background-color .16s var(--ease);
}
.rc-input::placeholder { color: var(--faint); }
.rc-input:focus, .rc-select:focus { border-color: var(--clay); outline: none; }
.rc-select { cursor: pointer; }

.rc-inputbtn {
  flex: none;
  display: grid; place-items: center;
  width: 38px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.rc-inputbtn:hover { color: var(--clay); border-color: var(--line-strong); }
.rc-inputbtn svg { width: 16px; height: 16px; }

.rc-swap-row { display: flex; justify-content: flex-end; margin: -6px 0; }
.rc-swap { width: 30px; height: 30px; border-radius: 50%; }

/* results dropdowns */
.rc-results {
  list-style: none;
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  z-index: 25;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}
.rc-results[hidden] { display: none; }

.rc-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.rc-result:hover, .rc-result.is-active {
  background: var(--surface-2);
}
.rc-result-name { font-size: .88rem; color: var(--ink); }
.rc-result-addr {
  font-size: .76rem;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* stops */
.rc-stops { display: flex; flex-direction: column; gap: 8px; }
.rc-stop-row {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.rc-stop-row input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: .88rem;
  padding: 8px 10px;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.rc-stop-row input:focus { border-color: var(--clay); outline: none; }
.rc-stop-remove {
  flex: none;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  background: transparent;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.rc-stop-remove:hover { color: var(--rc-danger); border-color: var(--rc-danger); }
.rc-stop-remove svg { width: 14px; height: 14px; }

.rc-textbtn {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none;
  color: var(--clay);
  font-size: .85rem; font-weight: 500;
  cursor: pointer;
  padding: 2px 0;
}
.rc-textbtn:hover { color: var(--clay-hover); }
.rc-textbtn svg { width: 14px; height: 14px; }

/* segmented control */
.rc-segmented {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}
.rc-seg-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 8px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  font-size: .85rem;
  cursor: pointer;
  transition: color .16s var(--ease), background-color .16s var(--ease);
}
.rc-seg-btn svg { width: 15px; height: 15px; }
.rc-seg-btn:hover { color: var(--ink); }
.rc-seg-btn[aria-pressed="true"] {
  background: var(--surface);
  color: var(--clay);
  box-shadow: var(--shadow-sm);
}

.rc-form-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px;
}
.rc-btn-primary {
  font: inherit; font-size: .92rem; font-weight: 500;
  padding: 10px 22px;
  background: var(--clay);
  color: var(--clay-ink);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .18s var(--ease), transform .18s var(--ease);
}
.rc-btn-primary:hover { background: var(--clay-hover); }
.rc-btn-primary:active { transform: translateY(1px); }
.rc-btn-primary:disabled { opacity: .55; cursor: default; }

/* ============================================================
   Summary card
   ============================================================ */
.rc-summary {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rc-summary[hidden] { display: none; }

.rc-summary-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rc-summary-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; min-width: 0; }
.rc-summary-top .rc-badge { flex: 1 1 100%; min-width: 0; max-width: 100%; }
.rc-summary-stat {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
}
.rc-summary-rain { font-size: .84rem; color: var(--muted); }

.rc-advice-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.rc-advice {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .84rem;
  color: var(--ink-soft);
}
.rc-advice::before {
  content: "";
  flex: none;
  width: 5px; height: 5px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--clay);
}

.rc-reason {
  font-size: .84rem;
  color: var(--ink-soft);
  padding-left: 14px;
  position: relative;
}
.rc-reason::before {
  content: "–";
  position: absolute; left: 0;
  color: var(--faint);
}

/* ============================================================
   Badges (risk level)
   ============================================================ */
.rc-badge {
  display: inline-flex; align-items: flex-start; gap: 6px;
  font-size: .74rem; font-weight: 600;
  letter-spacing: .02em;
  padding: 4px 11px;
  border-radius: 14px;
  white-space: normal;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  text-align: left;
}
.rc-badge:empty { display: none; }
.rc-badge::before {
  content: "";
  flex: none;
  width: 6px; height: 6px;
  margin-top: 5px;
  border-radius: 50%;
  background: currentColor;
}
.rc-badge.is-clear   { background: var(--rc-clear-soft);   color: var(--rc-clear); }
.rc-badge.is-watch   { background: var(--rc-watch-soft);   color: var(--rc-watch); }
.rc-badge.is-caution { background: var(--rc-caution-soft); color: var(--rc-caution); }
.rc-badge.is-danger  { background: var(--rc-danger-soft);  color: var(--rc-danger); }

/* ============================================================
   Alternative routes
   ============================================================ */
.rc-alts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rc-alts:empty { display: none; }

.rc-alt {
  flex: 1 1 auto;
  min-width: 130px;
  text-align: left;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .16s var(--ease), background-color .16s var(--ease);
}
.rc-alt:hover { border-color: var(--line-strong); }
.rc-alt.is-active {
  border-color: var(--clay);
  background: var(--clay-soft);
}
.rc-alt-name { display: block; font-size: .85rem; font-weight: 500; color: var(--ink); }
.rc-alt-meta { display: block; font-size: .76rem; color: var(--muted); margin-top: 2px; }

/* ============================================================
   Departure planner
   ============================================================ */
.rc-depart-planner {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.rc-depart-planner:empty { display: none; }

.rc-offset {
  flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 46px;
  padding: 8px 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .16s var(--ease), background-color .16s var(--ease);
}
.rc-offset:hover { border-color: var(--line-strong); }
.rc-offset.is-active { border-color: var(--clay); background: var(--clay-soft); }
.rc-offset.is-best { box-shadow: 0 0 0 1.5px var(--rc-clear) inset; }
.rc-offset-h { font-size: .76rem; font-weight: 500; color: var(--ink-soft); }
.rc-offset-dot { width: 7px; height: 7px; border-radius: 50%; }

.rc-planner-label {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
  flex: 0 0 100%;
}
.rc-planner-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.rc-planner-hint {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--muted);
  margin-top: 6px;
  flex: 0 0 100%;
}
.rc-planner-hint svg { width: 14px; height: 14px; flex: none; }

/* ============================================================
   Timeline / checkpoint chips
   ============================================================ */
.rc-timeline {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 4px 2px 10px;
  margin: -4px -2px 0;
  scroll-snap-type: x proximity;
  flex-shrink: 0;
}
.rc-timeline:empty { display: none; }

.rc-chip {
  scroll-snap-align: start;
  flex: none;
  width: 108px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 10px 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: border-color .16s var(--ease), background-color .16s var(--ease), transform .16s var(--ease);
}
.rc-chip:hover { transform: translateY(-1px); }
.rc-chip.is-selected { background: var(--surface); box-shadow: var(--shadow); }

.rc-chip.is-clear   { border-left-color: var(--rc-clear); }
.rc-chip.is-watch   { border-left-color: var(--rc-watch); }
.rc-chip.is-caution { border-left-color: var(--rc-caution); }
.rc-chip.is-danger  { border-left-color: var(--rc-danger); }

.rc-chip-day  { font-family: var(--mono); font-size: .64rem; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.rc-chip-time { font-size: .82rem; font-weight: 600; color: var(--ink); }
.rc-chip-icon { width: 22px; height: 22px; color: var(--clay); margin: 1px 0; }
.rc-chip-icon svg { width: 100%; height: 100%; }
.rc-chip-temp { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); line-height: 1; }
.rc-chip-place {
  font-size: .72rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc-chip-meta { font-size: .68rem; color: var(--faint); }
.rc-chip-dist { font-family: var(--mono); font-size: .66rem; color: var(--faint); margin-top: 1px; }

/* ============================================================
   Checkpoint detail panel
   ============================================================ */
.rc-details {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rc-details[hidden] { display: none; }

.rc-detail-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
}
.rc-detail-head .rc-badge { flex: 1 1 100%; min-width: 0; }

.rc-detail-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 12px;
}
.rc-detail-k {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
}
.rc-detail-v { font-size: .86rem; color: var(--ink-soft); min-width: 0; overflow-wrap: break-word; word-break: break-word; }

.rc-reason-list, .rc-advice-detail-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }

/* ============================================================
   Legend + attribution
   ============================================================ */
.rc-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: .78rem; color: var(--muted);
}
.rc-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.rc-legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.rc-legend-dot[data-level="clear"]   { background: var(--rc-clear); }
.rc-legend-dot[data-level="watch"]   { background: var(--rc-watch); }
.rc-legend-dot[data-level="caution"] { background: var(--rc-caution); }
.rc-legend-dot[data-level="danger"]  { background: var(--rc-danger); }

.rc-attrib {
  font-size: .72rem;
  color: var(--faint);
  line-height: 1.6;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.rc-attrib a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.rc-attrib a:hover { color: var(--clay); }

/* ============================================================
   Leaflet chrome overrides
   ============================================================ */
.leaflet-container {
  background: var(--surface-2);
  font-family: var(--sans);
}
.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
.leaflet-top.leaflet-left {
  margin-top: calc(10px + env(safe-area-inset-top));
  margin-left: calc(10px + env(safe-area-inset-left));
}
.leaflet-bottom.leaflet-left {
  margin-bottom: calc(10px + env(safe-area-inset-bottom));
  margin-left: calc(10px + env(safe-area-inset-left));
}
.leaflet-bottom.leaflet-right {
  margin-bottom: calc(10px + env(safe-area-inset-bottom));
  margin-right: calc(10px + env(safe-area-inset-right));
}
.leaflet-control-zoom a:hover { background: var(--surface-2) !important; }
.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: var(--shadow-sm) !important; }
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 88%, transparent) !important;
  color: var(--faint) !important;
  border-radius: var(--radius-sm) 0 0 0;
}
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow) !important;
}
.leaflet-popup-tip { background: var(--surface) !important; }
.leaflet-popup-content { font-family: var(--sans); font-size: .85rem; }

/* ============================================================
   Map markers — pinned to the ground, not floating
   ============================================================ */

/* .rc-dot — a small checkpoint mark at every sampled coordinate.
   iconAnchor is set by app.js to the element's centre. */
.rc-dot {
  display: block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--rc-clear);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 3px rgba(20, 18, 15, .35);
}
.rc-dot.is-clear   { background: var(--rc-clear); }
.rc-dot.is-watch   { background: var(--rc-watch); }
.rc-dot.is-caution { background: var(--rc-caution); }
.rc-dot.is-danger  { background: var(--rc-danger); }
.rc-dot.is-selected {
  width: 13px; height: 13px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent), 0 1px 3px rgba(20, 18, 15, .4);
}

/* .rc-marker — a chip drawn only for checkpoints that survive decluttering.
   iconAnchor is set by app.js to [x, height] so the stem tip lands exactly
   on the coordinate: the chip body sits above it, solid and grounded. */
.rc-marker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px 5px 6px;
  margin-bottom: 7px; /* room for the stem */
  background: var(--surface);
  border: 1.5px solid var(--rc-clear);
  border-radius: 999px;
  box-shadow: 0 3px 8px -2px rgba(20, 18, 15, .38), 0 1px 2px rgba(20, 18, 15, .22);
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.rc-marker-stem {
  position: absolute;
  left: 50%; top: 100%;
  width: 8px; height: 8px;
  margin-left: -4px;
  margin-top: -4px;
  background: var(--surface);
  border-right: 1.5px solid var(--rc-clear);
  border-bottom: 1.5px solid var(--rc-clear);
  transform: rotate(45deg);
  border-radius: 0 0 2px 0;
  z-index: -1;
}
.rc-marker-icon { width: 15px; height: 15px; display: grid; place-items: center; color: var(--muted); flex: none; }
.rc-marker-icon svg { width: 100%; height: 100%; }
.rc-marker-temp { line-height: 1; }

.rc-marker.is-clear,   .rc-marker.is-clear   .rc-marker-stem { border-color: var(--rc-clear); }
.rc-marker.is-watch,   .rc-marker.is-watch   .rc-marker-stem { border-color: var(--rc-watch); }
.rc-marker.is-caution, .rc-marker.is-caution .rc-marker-stem { border-color: var(--rc-caution); }
.rc-marker.is-danger,  .rc-marker.is-danger  .rc-marker-stem { border-color: var(--rc-danger); }
.rc-marker.is-clear   .rc-marker-icon { color: var(--rc-clear); }
.rc-marker.is-watch   .rc-marker-icon { color: var(--rc-watch); }
.rc-marker.is-caution .rc-marker-icon { color: var(--rc-caution); }
.rc-marker.is-danger  .rc-marker-icon { color: var(--rc-danger); }

.rc-marker.is-selected {
  border-width: 2px;
  box-shadow: 0 5px 12px -2px rgba(20, 18, 15, .45), 0 1px 3px rgba(20, 18, 15, .3);
  z-index: 2;
}

.rc-marker-start, .rc-marker-end,
.rc-marker-pin.rc-marker-start, .rc-marker-pin.rc-marker-end {
  background: var(--clay);
  color: var(--clay-ink);
  border-color: var(--clay);
}
.rc-marker-start .rc-marker-icon,
.rc-marker-end .rc-marker-icon { color: var(--clay-ink); }
.rc-marker-start .rc-marker-stem, .rc-marker-end .rc-marker-stem {
  background: var(--clay);
  border-color: var(--clay);
}

/* .rc-rider — you, on the map. The arrow points at your course in MAP space,
   so course-up (which rotates the map by minus that course) shows it upright
   without a second calculation. */
.rc-rider {
  display: block;
  width: 26px; height: 26px;
  color: var(--clay);
  filter: drop-shadow(0 1px 2px rgba(20, 18, 15, .5));
  transform-origin: 50% 50%;
}
.rc-rider svg {
  width: 100%; height: 100%;
  stroke: var(--surface);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

/* legacy pin-style start/end divIcon (kept for compatibility) */
.rc-marker-pin {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--clay);
  color: var(--clay-ink);
  border: 2px solid var(--surface);
  box-shadow: 0 3px 8px -2px rgba(20, 18, 15, .4);
}
.rc-marker-pin svg { width: 15px; height: 15px; transform: rotate(45deg); }

/* ============================================================
   Floating map controls
   ============================================================ */
.rc-map-controls {
  position: absolute;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(var(--sheet-h, 150px) + 12px);
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: bottom .28s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .rc-map-controls { transition: none; }
}
@media (min-width: 821px) {
  .rc-map-controls { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

.rc-mapbtn {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease), background-color .16s var(--ease);
}
.rc-mapbtn:hover { color: var(--clay); border-color: var(--line-strong); }
.rc-mapbtn:active { transform: translateY(1px); }
.rc-mapbtn svg { width: 19px; height: 19px; }
.rc-mapbtn[hidden] { display: none; }
/* The needle points at true north, so in course-up it swings with the map. */
.rc-compass-needle { transform: rotate(var(--rc-bearing, 0deg)); }
.rc-compass-tail { opacity: .45; }
#ctl-compass[data-mode="course"] {
  color: var(--clay);
  border-color: var(--clay);
}
@media (prefers-reduced-motion: reduce) {
  html[data-rotate="on"] .rc-map { transition: none; }
}

#ctl-nav { color: var(--clay-ink); background: var(--clay); border-color: var(--clay); }
#ctl-nav:hover { background: var(--clay-hover); color: var(--clay-ink); }

/* keep Leaflet's own zoom control in the same right-hand column, above the stack.
   --rc-controls-h is kept current by app.js (the map-controls stack's rendered
   height); it falls back to room for all three buttons. */
.leaflet-bottom.leaflet-right {
  margin-right: calc(12px + env(safe-area-inset-right));
  margin-bottom: calc(var(--sheet-h, 150px) + 12px + var(--rc-controls-h, 164px));
  transition: margin-bottom .28s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .leaflet-bottom.leaflet-right { transition: none; }
}
@media (min-width: 821px) {
  .leaflet-bottom.leaflet-right {
    margin-bottom: calc(16px + env(safe-area-inset-bottom) + var(--rc-controls-h, 164px));
  }
}

/* ============================================================
   Centre-pin place picker
   ============================================================ */
.rc-pick { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.rc-pick[hidden] { display: none; }

.rc-pick-pin {
  position: absolute;
  left: 50%;
  top: calc((100% - var(--sheet-h, 150px)) / 2);
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--clay);
  pointer-events: none;
  transition: transform .12s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .rc-pick-pin { transition: none; }
}
.rc-pick-pin svg {
  width: 40px; height: 40px;
  filter: drop-shadow(0 3px 4px rgba(20, 18, 15, .35));
  transition: transform .12s var(--ease);
}
.rc-pick-shadow {
  display: block;
  width: 14px; height: 5px;
  margin-top: -3px;
  border-radius: 50%;
  background: rgba(20, 18, 15, .3);
  transition: transform .12s var(--ease), opacity .12s var(--ease);
}
.rc-pick-pin.is-moving { transform: translate(-50%, -114%); }
.rc-pick-pin.is-moving svg { transform: translateY(-6px); }
.rc-pick-pin.is-moving .rc-pick-shadow { transform: scale(.55); opacity: .55; }

@media (min-width: 821px) {
  /* desktop: panel is a sidebar beside the map, not a sheet over it */
  .rc-pick-pin { top: 50%; }
  .rc-pick-card { left: 0; right: auto; max-width: 380px; margin: 0 0 20px 20px; border-radius: var(--radius-lg); border: 1px solid var(--line); bottom: 0; }
}

.rc-pick-card {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  pointer-events: auto;
  margin: 0 auto;
  max-width: 480px;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rc-pick-title {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}
.rc-pick-label {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-pick-sub {
  font-size: .82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-pick-sub:empty { display: none; }
.rc-pick-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  margin-top: 12px;
}
.rc-pick-actions .rc-textbtn { margin-right: auto; min-height: 44px; }
.rc-pick-actions .rc-btn-primary { min-height: 44px; padding: 10px 24px; }

/* ============================================================
   Navigation HUD
   ============================================================ */
.rc-nav-hud {
  position: absolute;
  left: 0; right: 0; top: 0;
  z-index: 22;
  margin: calc(12px + env(safe-area-inset-top)) 12px 0;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.rc-nav-hud[hidden] { display: none; }

.rc-nav-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rc-nav-stats { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rc-nav-remaining {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-nav-eta { font-size: .8rem; color: var(--muted); }

.rc-nav-stop {
  flex: none;
  display: grid; place-items: center;
  width: 36px; height: 36px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
.rc-nav-stop:hover { color: var(--rc-danger); border-color: var(--rc-danger); }
.rc-nav-stop svg { width: 15px; height: 15px; }

.rc-nav-next {
  display: flex; align-items: center; gap: 8px;
  font-size: .86rem;
  color: var(--ink-soft);
  min-height: 0;
}
.rc-nav-next:empty { display: none; }
.rc-nav-next-icon { width: 20px; height: 20px; flex: none; color: var(--clay); }
.rc-nav-next-icon svg { width: 100%; height: 100%; }

.rc-nav-progress {
  position: relative;
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: visible;
}
.rc-nav-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--clay);
  border-radius: 999px;
  transition: width .3s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .rc-nav-progress-fill { transition: none; }
}
.rc-nav-tick {
  position: absolute;
  top: 50%;
  width: 5px; height: 5px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--rc-clear);
  border: 1px solid var(--surface);
}
.rc-nav-tick.is-clear   { background: var(--rc-clear); }
.rc-nav-tick.is-watch   { background: var(--rc-watch); }
.rc-nav-tick.is-caution { background: var(--rc-caution); }
.rc-nav-tick.is-danger  { background: var(--rc-danger); }

.rc-nav-alert {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--rc-caution-soft);
  color: var(--rc-caution);
  border: 1px solid color-mix(in srgb, var(--rc-caution) 35%, var(--line));
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 500;
}
.rc-nav-alert[hidden] { display: none; }
.rc-nav-alert[data-level="danger"] {
  background: var(--rc-danger-soft);
  color: var(--rc-danger);
  border-color: color-mix(in srgb, var(--rc-danger) 35%, var(--line));
}
.rc-nav-alert svg { width: 15px; height: 15px; flex: none; }

/* while navigating: sheet drops to peek, HUD owns the top of the map */
html[data-nav="on"] .rc-panel { pointer-events: auto; }
html[data-nav="on"] .rc-peek-bar-primary { color: var(--clay); }

/* ============================================================
   "Pin on map" button — in the From/To rows via .rc-inputbtn,
   and app.js injects a bare .rc-stop-pick into each stop row.
   ============================================================ */
.rc-stop-pick {
  flex: none;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  background: transparent;
  color: var(--clay);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease), background-color .16s var(--ease);
}
.rc-stop-pick svg { width: 14px; height: 14px; }
.rc-stop-pick:hover { border-color: var(--clay); }
.rc-stop-pick.is-active,
.rc-inputbtn.is-active {
  background: var(--clay-soft);
  border-color: var(--clay);
  color: var(--clay);
}

/* ============================================================
   Responsive: bottom sheet under 820px
   ============================================================ */
@media (max-width: 820px) {
  body { overflow: hidden; }

  .rc-body { flex-direction: column; }

  .rc-map-wrap { position: absolute; inset: 0; height: 100%; }

  .rc-panel {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    width: auto; max-width: none;
    height: auto;
    max-height: 92vh;
    max-height: 92dvh;
    border-left: none;
    border-top: 1px solid var(--line);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transition: transform .28s var(--ease), height .28s var(--ease);
    padding-bottom: env(safe-area-inset-bottom);
  }
  @media (prefers-reduced-motion: reduce) {
    .rc-panel { transition: none; }
  }

  .rc-sheet-handle { display: block; }

  /* three snap points: peek (map owns the screen) / half / open */
  .rc-panel[data-sheet="peek"] {
    height: calc(150px + env(safe-area-inset-bottom));
  }
  .rc-panel[data-sheet="peek"] .rc-panel-scroll { overflow: hidden; }

  .rc-panel[data-sheet="half"] {
    height: 52vh;
    height: 52dvh;
  }

  .rc-panel[data-sheet="open"] {
    height: 92vh;
    height: 92dvh;
  }

  /* iOS zoom-on-focus guard: inputs need >=16px */
  .rc-input, .rc-select, .rc-stop-row input { font-size: 16px; }

  /* comfortable touch targets */
  .rc-iconbtn, .rc-inputbtn, .rc-stop-remove, .rc-stop-pick, .rc-nav-stop {
    min-width: 44px; min-height: 44px;
  }
  .rc-swap.rc-inputbtn { min-width: 44px; min-height: 44px; width: 44px; height: 44px; }
  .rc-btn-install { min-height: 44px; }

  .rc-chip { min-height: 44px; scroll-snap-align: center; }
  .rc-timeline {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .rc-timeline::-webkit-scrollbar { display: none; }

  .rc-offset { min-height: 44px; }
  .rc-alt { min-height: 44px; display: flex; flex-direction: column; justify-content: center; }

  /* header: back link, wordmark and up to four actions on a narrow phone */
  .rc-header { gap: 8px; padding-left: calc(10px + env(safe-area-inset-left)); padding-right: calc(10px + env(safe-area-inset-right)); }
  .rc-wordmark { font-size: 1rem; gap: 6px; }
  .rc-wordmark-mark { width: 22px; height: 22px; }
  .rc-wordmark-mark svg { width: 13px; height: 13px; }
  .rc-header-actions { gap: 5px; }

  /* v2 overlays: keep clear of the sheet at every snap point, safe-area aware */
  .rc-nav-hud { margin-left: calc(10px + env(safe-area-inset-left)); margin-right: calc(10px + env(safe-area-inset-right)); }
  .rc-pick-card { max-width: none; }
  html[data-nav="on"] .rc-panel[data-sheet] { height: calc(150px + env(safe-area-inset-bottom)); }
}

@media (min-width: 821px) {
  .rc-sheet-handle { display: none; }
}

@media (max-width: 380px) {
  .rc-btn-install-label { display: none; }
  .rc-btn-install { padding: 0; width: 34px; min-width: 44px; justify-content: center; }
  .rc-wordmark-mark { display: none; }
}

@media (max-width: 340px) {
  .rc-wordmark { font-size: .88rem; }
  .rc-header { gap: 5px; }
  .rc-header-actions { gap: 3px; }
}

/* ============================================================
   iOS "Add to Home Screen" instruction sheet
   ============================================================ */
#ios-install[hidden] { display: none; }

.rc-ios-install {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.rc-ios-install-scrim {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 15, .45);
}

.rc-ios-install-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: rc-sheet-up .32s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .rc-ios-install-card { animation: none; }
}
@keyframes rc-sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.rc-ios-install-heading {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--ink);
}

.rc-ios-install-copy {
  font-size: .92rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.rc-ios-share-icon {
  width: 17px; height: 17px;
  vertical-align: -3px;
  margin: 0 2px;
  color: var(--clay);
}

#ios-install-close {
  align-self: stretch;
  min-height: 44px;
}
