/* ─────────────────────────────────────────────
   AMENTA Run. The Marine, Red & Butter palette on AMENTA's glass: the
   planner's butter sheet and the route's card, floating over a full-screen
   map. Colours, fonts and
   glass are the variables below; reuse them rather than adding new ones.
   ───────────────────────────────────────────── */

:root {
  /* Marine, Red & Butter: butter-cream glass, marine blue for what you
     press, signal red for the route and the name, green for parks and go. */
  --bg:          #F7EFD2;
  --surface:     #EFE5C2;
  --border:      #D2C6A0;
  --marine:      #1C3A6B;
  --marine-soft: #5B7DB0;
  --signal:      #D7342B;
  --butter:      #F2CF5B;
  --text:        #13284A;
  --text-dim:    #4F5D74;
  --text-mute:   #66708A;
  --red:         #B02A22;
  --green:       #3F6B33;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-mono:  'DM Mono', 'Courier New', monospace;
  --font-brand: 'Arimo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  --glass-fill:        rgba(253, 248, 228, 0.55);
  --glass-fill-strong: rgba(253, 248, 228, 0.68);
  --glass-edge:        rgba(255, 255, 255, 0.80);
  --glass-specular:    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --glass-lift:        0 10px 30px rgba(19, 40, 74, 0.10), 0 2px 6px rgba(19, 40, 74, 0.05);
  --glass-lift-sm:     0 4px 14px rgba(19, 40, 74, 0.10), 0 1px 3px rgba(19, 40, 74, 0.06);
  --glass-ease:        cubic-bezier(0.22, 1, 0.36, 1);

  --butter-sheet: radial-gradient(130% 100% at 92% 0%,
    rgba(253, 248, 226, 0.96) 0%, rgba(248, 234, 176, 0.95) 55%, rgba(243, 220, 134, 0.95) 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-serif);
  overflow: hidden; overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--marine-soft); outline-offset: 2px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── The map ── */
/* Google Maps puts `position: relative` inline on the map's own element,
   which would undo a fixed position there and leave it 0px tall, so the
   wrapper is what is fixed to the screen and the map fills it. */
.map-wrap { position: fixed; inset: 0; z-index: 0; background: #F5EFD9; }
.map { width: 100%; height: 100%; }
.map-placeholder {
  display: flex; align-items: center; justify-content: center;
  text-align: center; font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text-mute); letter-spacing: 0.08em; line-height: 2;
}
.map-placeholder-mark { font-size: 1.4rem; color: var(--border); }

/* ── Top bar: the name, where you are, your runs ── */
.topbar {
  position: fixed; z-index: 10;
  top: calc(var(--safe-top) + 10px); left: 10px; right: 10px;
  display: flex; align-items: center; gap: 8px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand, .where, .top-btn, .locate-btn {
  border: 1px solid var(--glass-edge);
  background: var(--glass-fill-strong);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: var(--glass-specular), var(--glass-lift-sm);
}
.brand {
  flex-shrink: 0; height: 44px; padding: 0 14px;
  border-radius: 999px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1;
}
.logo { font-family: var(--font-brand); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.16em; color: var(--signal); padding-left: 0.16em; }
.logo-run { margin-top: 3px; align-self: flex-end; font-family: var(--font-brand); font-weight: 700; font-size: 0.5rem; letter-spacing: 0.2em; color: var(--marine); }
.where {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  border-radius: 999px;
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-dim);
}
.where span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.where svg, .top-btn svg, .locate-btn svg {
  flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.where svg { width: 15px; height: 15px; color: var(--marine); }
.top-btn, .locate-btn {
  position: relative; flex-shrink: 0; width: 44px; height: 44px; padding: 0;
  border-radius: 50%; color: var(--text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.top-btn svg, .locate-btn svg { width: 19px; height: 19px; }
.top-btn:active, .locate-btn:active { transform: scale(0.94); }
.top-btn-count {
  position: absolute; top: -3px; right: -3px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--marine); color: var(--bg);
  font-family: var(--font-mono); font-size: 0.58rem; line-height: 18px; text-align: center;
}
.locate-btn {
  position: fixed; z-index: 9;
  top: calc(var(--safe-top) + 64px); right: 10px;
}
body.mode-pick .locate-btn { display: none; }

/* ── The planner ── */
.run-sheet {
  position: fixed; z-index: 5;
  left: 8px; right: 8px; bottom: calc(var(--safe-bottom) + 8px);
  max-width: 480px; margin: 0 auto;
  max-height: calc(100% - var(--safe-top) - var(--safe-bottom) - 130px);
  display: flex; flex-direction: column;
  background: var(--butter-sheet);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid rgba(255, 250, 232, 0.9);
  border-radius: 30px;
  box-shadow: var(--glass-specular), 0 18px 40px rgba(19, 40, 74, 0.22), 0 2px 6px rgba(19, 40, 74, 0.08);
  overflow: hidden;
  animation: fadeUp 0.35s var(--glass-ease) both;
}
.run-head { flex-shrink: 0; padding: 8px 14px 2px 18px; touch-action: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.run-grabber {
  width: 38px; height: 5px; border-radius: 3px;
  background: rgba(19, 40, 74, 0.22); margin: 0 auto 10px;
}
.run-head-row { display: flex; align-items: center; gap: 10px; }
.run-head-icon { color: var(--marine); display: flex; }
.run-head-icon svg, .run-go svg {
  width: 24px; height: 24px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.run-title {
  flex: 1; margin: 0; min-width: 0;
  font-family: var(--font-serif); font-size: 1.55rem; font-weight: 400; color: var(--text);
  transition: font-size 0.3s var(--glass-ease);
}
.run-head-sum { display: none; }
.run-fold {
  width: 34px; height: 34px; padding: 0; flex-shrink: 0;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.5); color: var(--text-dim);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.run-fold svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.3s var(--glass-ease);
}
.run-sheet.folded .run-body { display: none; }
/* Mid-fold the body's height is set by the drag or the spring (app.js),
   so it stays drawn and is clipped rather than scrolled. */
.run-sheet.moving .run-body { display: block; overflow: hidden; }
.run-sheet.folded .run-fold svg { transform: rotate(180deg); }
.run-sheet.folded .run-title { flex: 0 0 auto; font-size: 1.25rem; }
.run-sheet.folded .run-head-sum {
  display: block; flex: 1; min-width: 0;
  font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.run-body {
  flex: 0 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 0 18px 4px;
}
.run-foot { flex-shrink: 0; padding: 0 18px 16px; }
.run-label {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(19, 40, 74, 0.6);
  margin: 14px 0 8px;
}
.run-dist { display: flex; align-items: center; justify-content: space-between; }
.run-step {
  width: 48px; height: 48px; padding: 0; flex-shrink: 0;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.6); box-shadow: var(--glass-lift-sm);
  color: var(--marine); font-size: 1.6rem; line-height: 1; font-weight: 300;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s var(--glass-ease);
}
.run-step:active { transform: scale(0.92); }
.run-step:disabled { opacity: 0.4; }
.run-km { text-align: center; }
.run-km b {
  font-family: var(--font-serif); font-weight: 400; font-size: 3.6rem; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.run-km-unit { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); margin-left: 4px; }
.run-time {
  display: block; margin: 6px auto 0; padding: 4px 8px;
  border: none; background: none; border-radius: 8px;
  font-family: var(--font-mono); font-size: 0.68rem; color: rgba(19, 40, 74, 0.62);
  text-decoration: underline dotted rgba(63, 107, 51, 0.5); text-underline-offset: 3px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.run-presets { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.run-pill, .run-preset {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 999px;
  background: rgba(255, 255, 255, 0.45); color: var(--text-dim);
  font-family: var(--font-mono); font-size: 0.7rem;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.run-pill svg {
  width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.run-pill[aria-pressed="true"], .run-preset[aria-pressed="true"] {
  background: var(--marine); border-color: var(--marine); color: var(--bg);
}
.run-seg {
  position: relative; display: flex; padding: 3px;
  border-radius: 999px; background: rgba(19, 40, 74, 0.08);
}
.run-seg button {
  position: relative; z-index: 1; flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; border: 0; border-radius: 999px; background: none;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.run-seg button[aria-checked="true"] { color: var(--text); }
.run-seg svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.run-seg-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 999px; background: rgba(255, 255, 255, 0.85); box-shadow: var(--glass-lift-sm);
  transition: transform 0.42s var(--glass-ease);
}
.run-seg.to .run-seg-thumb { transform: translateX(100%); }
[dir="rtl"] .run-seg.to .run-seg-thumb { transform: translateX(-100%); }
[dir="rtl"] .run-seg-thumb { left: auto; right: 3px; }
.run-dest { margin-top: 10px; animation: fadeUp 0.3s var(--glass-ease) both; }
.run-field {
  display: flex; align-items: center; gap: 10px;
  padding: 0 8px 0 14px; height: 46px;
  border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.62);
}
.run-field svg {
  width: 18px; height: 18px; flex-shrink: 0; color: var(--marine);
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.run-field input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: none; outline: none;
  font-family: var(--font-serif); font-size: 17px; color: var(--text);
}
.run-field input::placeholder { color: var(--text-mute); }
.run-field-clear {
  width: 32px; height: 32px; border: 0; background: none; padding: 0;
  color: var(--text-mute); font-size: 0.8rem; cursor: pointer;
}
.run-sugg { margin-top: 6px; border-radius: 16px; background: rgba(255, 255, 255, 0.4); overflow: hidden; }
.run-sugg:empty { display: none; }
.run-sugg button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 44px; padding: 8px 14px;
  border: 0; border-top: 1px solid rgba(19, 40, 74, 0.06); background: none;
  font-family: var(--font-serif); font-size: 1rem; color: var(--text); text-align: start;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.run-sugg button:first-child { border-top: 0; }
.run-sugg svg {
  width: 16px; height: 16px; flex-shrink: 0; color: var(--marine);
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.run-sugg .recent svg { color: var(--green); }
.run-sugg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-sugg em {
  font-style: normal; font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-mute);
  flex-shrink: 0;
}
.run-note {
  margin-top: 8px; padding: 0 4px;
  font-family: var(--font-serif); font-size: 0.98rem; line-height: 1.4; color: var(--text-dim);
}
.run-note:empty { display: none; }
.run-prefs { display: flex; flex-wrap: wrap; gap: 6px; }
.run-always {
  display: flex; align-items: center; gap: 6px; margin-top: 10px;
  font-family: var(--font-mono); font-size: 0.62rem; color: rgba(19, 40, 74, 0.58);
}
.run-always svg {
  width: 13px; height: 13px; flex-shrink: 0; color: var(--green);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.run-error {
  margin-top: 12px; padding: 10px 14px; border-radius: 14px;
  background: rgba(253, 248, 228, 0.7); color: var(--red);
  font-family: var(--font-serif); font-size: 1rem; line-height: 1.35;
}
.run-go {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 54px; margin-top: 14px;
  border: 0; border-radius: 999px;
  background: var(--marine); color: var(--bg);
  font-family: var(--font-serif); font-size: 1.25rem;
  box-shadow: 0 8px 20px rgba(28, 58, 107, 0.3);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s var(--glass-ease), opacity 0.2s;
}
.run-go svg { width: 20px; height: 20px; }
.run-sheet.folded .run-go { margin-top: 8px; }
.run-go:active { transform: scale(0.98); }
.run-go:disabled { opacity: 0.7; cursor: progress; }
.run-go.is-loading svg { animation: runStride 0.6s ease-in-out infinite alternate; }
@keyframes runStride { from { transform: translateX(-3px); } to { transform: translateX(3px); } }

/* ── The route's card ── */
.run-card {
  position: fixed; z-index: 5;
  left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 12px);
  max-width: 460px; margin: 0 auto;
  padding: 12px 16px 14px;
  border-radius: 28px; border: 1px solid var(--glass-edge);
  background: rgba(253, 248, 228, 0.86);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: var(--glass-specular), 0 18px 40px rgba(19, 40, 74, 0.18);
  animation: fadeUp 0.35s var(--glass-ease) backwards; /* not "both": its last frame would hold transform and undo the drag */
}
.run-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.run-back {
  display: inline-flex; align-items: center; gap: 4px;
  height: 34px; padding: 0 12px 0 6px;
  border: 1px solid rgba(19, 40, 74, 0.1); border-radius: 999px;
  background: rgba(255, 255, 255, 0.6); color: var(--text-dim);
  font-family: var(--font-mono); font-size: 0.66rem; cursor: pointer;
}
.run-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .run-back svg { transform: scaleX(-1); }
.run-kicker {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--green);
}
.run-name {
  margin-top: 2px; font-family: var(--font-serif); font-size: 1.4rem; line-height: 1.15; color: var(--text);
}
.run-sub { margin-top: 2px; font-family: var(--font-serif); font-size: 0.98rem; color: var(--text-dim); }
.run-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 10px; }
.run-stat b {
  display: block; font-family: var(--font-serif); font-weight: 400;
  font-size: 1.35rem; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text);
}
.run-stat span { font-family: var(--font-mono); font-size: 0.58rem; color: var(--text-mute); }
.run-mix { display: flex; gap: 2px; height: 8px; margin-top: 12px; border-radius: 4px; overflow: hidden; }
.run-mix i { display: block; min-width: 0; }
.run-legend {
  display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 7px;
  font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-dim);
}
.run-legend span { display: inline-flex; align-items: center; gap: 5px; }
.run-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.mix-park { background: var(--green); }
.mix-path { background: var(--butter); }
.mix-street { background: var(--border); }
/* Beside a car road: the road's red, hatched, so it reads apart from on it. */
.mix-traffic { background: repeating-linear-gradient(135deg, var(--red) 0 2px, var(--border) 2px 4px); }
.mix-road { background: var(--red); }
.run-actions { display: flex; gap: 8px; margin-top: 12px; }
.run-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; padding: 0 14px; flex-shrink: 0;
  border: 1px solid rgba(19, 40, 74, 0.1); border-radius: 999px;
  background: rgba(255, 255, 255, 0.6); color: var(--text);
  font-family: var(--font-mono); font-size: 0.7rem; text-decoration: none; white-space: nowrap;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.run-btn svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.run-btn.primary { flex: 1; min-width: 0; background: var(--marine); border-color: var(--marine); color: var(--bg); }
.run-btn:active { transform: scale(0.97); }
.run-btn:disabled { opacity: 0.6; cursor: progress; }
.run-dots { display: flex; gap: 2px; }
.run-dots button {
  width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.run-dots button::before {
  content: ""; width: 6px; height: 6px; border-radius: 3px; background: rgba(19, 40, 74, 0.18);
  transition: width 0.25s var(--glass-ease), background 0.25s;
}
.run-dots button.on::before { width: 16px; background: var(--marine); }

/* ── Picking where a run ends: a fixed pin in the middle, the map under it ── */
.run-pick { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
.run-pick-pin {
  position: absolute; left: 50%; top: 50%;
  width: 28px; height: 38px; margin: -38px 0 0 -14px;
  background: var(--marine);
  clip-path: path("M14 38 C11 32 0 24 0 14 C0 6 6 0 14 0 C22 0 28 6 28 14 C28 24 17 32 14 38 Z");
  filter: drop-shadow(0 4px 6px rgba(19, 40, 74, 0.3));
}
.run-pick-pin::after {
  content: ""; position: absolute; left: 9px; top: 9px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--bg);
}
.run-pick-bar {
  position: absolute; left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 12px);
  max-width: 460px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 24px;
  border: 1px solid var(--glass-edge); background: rgba(253, 248, 228, 0.86);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: var(--glass-specular), var(--glass-lift);
  pointer-events: auto;
}
.run-pick-cancel {
  width: 40px; height: 40px; flex-shrink: 0; padding: 0;
  border-radius: 50%; border: 1px solid rgba(19, 40, 74, 0.1); background: rgba(255, 255, 255, 0.6);
  color: var(--text-dim); font-size: 0.8rem; cursor: pointer;
}
.run-pick-hint { flex: 1; min-width: 0; font-family: var(--font-serif); font-size: 1rem; line-height: 1.3; color: var(--text-dim); }
.run-pick-done {
  height: 44px; padding: 0 16px; flex-shrink: 0;
  border: 0; border-radius: 999px; background: var(--marine); color: var(--bg);
  font-family: var(--font-mono); font-size: 0.72rem; cursor: pointer;
}

/* ── Your runs ── */
.runs-overlay {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(19, 40, 74, 0.24);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.32s ease, visibility 0s linear 0.32s;
}
.runs-overlay.open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 0.32s ease, visibility 0s;
}
.runs-sheet {
  position: absolute; left: 8px; right: 8px;
  bottom: calc(var(--safe-bottom) + 8px);
  max-width: 480px; margin: 0 auto;
  max-height: calc(100% - var(--safe-top) - var(--safe-bottom) - 40px);
  display: flex; flex-direction: column;
  border-radius: 30px; border: 1px solid var(--glass-edge);
  background: rgba(253, 248, 228, 0.9);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: var(--glass-specular), 0 18px 40px rgba(19, 40, 74, 0.22);
  outline: none; overflow: hidden;
  transform: translateY(calc(100% + 24px + var(--safe-bottom)));
  transition: transform 0.42s var(--glass-ease);
}
.runs-overlay.open .runs-sheet { transform: none; }
.runs-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px 20px; }
.runs-title { flex: 1; margin: 0; font-family: var(--font-serif); font-size: 1.55rem; font-weight: 400; }
.run-close {
  width: 36px; height: 36px; padding: 0; flex-shrink: 0;
  border-radius: 50%; border: 1px solid rgba(19, 40, 74, 0.1);
  background: rgba(255, 255, 255, 0.6); color: var(--text-dim);
  font-size: 0.85rem; cursor: pointer;
}
.runs-list { overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 14px; }
.runs-empty { margin: 8px 8px 16px; font-size: 1.05rem; line-height: 1.4; color: var(--text-dim); }

/* ── Signing in: the sheet, Google's button, and the foot of Your runs ── */
#signinOverlay { z-index: 21; }
.signin-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 20px 18px; }
.signin-text { margin: 0; font-size: 1.1rem; line-height: 1.4; color: var(--text); }
.signin-note { margin: 2px 0 0; font-family: var(--font-mono); font-size: 0.62rem; line-height: 1.6; color: var(--text-mute); }
.privacy-link {
  display: block; margin-top: 8px; text-align: center;
  font-family: var(--font-mono); font-size: 0.62rem; color: var(--marine);
}
.profile-menu-item { text-decoration: none; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; height: 52px; padding: 0 20px;
  border: 1px solid rgba(19, 40, 74, 0.16); border-radius: 999px;
  background: #FFFFFF; color: #1F1F1F;
  font-family: var(--font-brand); font-weight: 700; font-size: 0.95rem;
  box-shadow: var(--glass-lift-sm); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.google-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.google-btn:active { transform: scale(0.98); }
.google-btn.small { height: 44px; font-size: 0.85rem; }
.signin-later {
  align-self: center; padding: 8px 16px; border: 0; background: none;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em;
  color: var(--text-dim); cursor: pointer;
}
.runs-account {
  position: relative;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(19, 40, 74, 0.08);
}
.runs-account [hidden] { display: none; }
/* The profile menu opens upward over the list, inside the sheet, which clips:
   with few or no runs the list keeps room for the menu, so it never covers
   the sheet's title and close button. */
.runs-sheet:has(#profile:not([hidden])) .runs-list { min-height: 150px; }
.runs-signin { padding: 4px 6px; }

/* ── Profile: AMENTA's profile menu, in AMENTA Run's colours ── */
.profile-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 48px;
  background: none; border: none; border-radius: 999px;
  padding: 6px 10px 6px 6px;
  color: var(--text); cursor: pointer; text-align: start;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}
.profile-btn:hover,
.profile-btn[aria-expanded="true"] { background: rgba(19, 40, 74, 0.06); }
.profile-avatar {
  flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--marine); color: var(--bg);
  font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; line-height: 1;
}
.profile-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-serif); font-size: 1rem; font-weight: 600;
}
.profile-btn-chevron,
.profile-menu svg {
  width: 16px; height: 16px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.profile-btn-chevron { color: var(--text-mute); transition: transform 0.2s; }
.profile-btn[aria-expanded="true"] .profile-btn-chevron { transform: rotate(180deg); }

.profile-menu {
  position: absolute; left: 10px; right: 10px; bottom: calc(100% - 2px); z-index: 2;
  background: var(--bg);
  border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--glass-lift);
  padding: 6px;
  transform-origin: bottom left;
  animation: profileMenuIn 0.18s var(--glass-ease);
}
@keyframes profileMenuIn {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .profile-menu { animation: none; } }
.profile-menu-email {
  padding: 8px 10px 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.64rem; color: var(--text-mute);
}
.profile-menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 44px;
  background: none; border: none; border-radius: 12px;
  padding: 8px 10px;
  color: var(--text); cursor: pointer; text-align: start;
  font-family: var(--font-serif); font-size: 1rem;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.profile-menu-item > span:first-of-type { flex: 1; }
.profile-menu-item:hover,
.profile-menu-item:focus-visible { background: var(--surface); outline: none; }
.profile-menu-item:active { background: rgba(19, 40, 74, 0.1); }
.profile-menu-item > svg { color: var(--marine); }
.runs-row {
  display: flex; align-items: center; gap: 4px;
  border-top: 1px solid rgba(19, 40, 74, 0.07);
}
.runs-row:first-child { border-top: 0; }
.runs-open {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  padding: 10px 6px; border: 0; background: none; text-align: start; cursor: pointer;
}
.runs-thumb { width: 72px; height: 48px; flex-shrink: 0; border-radius: 12px; background: #F5EFD9; }
.runs-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.runs-name { font-family: var(--font-serif); font-size: 1.08rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runs-meta { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runs-del {
  width: 44px; height: 44px; flex-shrink: 0; padding: 0;
  border: 0; background: none; color: var(--text-mute); font-size: 0.8rem; cursor: pointer;
}


/* ── A run in progress ──
   The top bar steps aside for the run's own panel; Hold to end, Pause and
   Follow sit at the bottom, the compass button on the right. */
body.mode-live .topbar, body.mode-live .locate-btn,
body.mode-summary .topbar, body.mode-summary .locate-btn { display: none; }
.live-panel {
  position: fixed; z-index: 6;
  top: calc(var(--safe-top) + 10px); left: 10px; right: 10px;
  max-width: 480px; margin: 0 auto;
  padding: 12px 18px 14px; border-radius: 28px;
  background: rgba(253, 248, 228, 0.88);
  border: 1px solid var(--glass-edge);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: var(--glass-specular), var(--glass-lift);
}
.live-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em;
}
.live-state { display: inline-flex; align-items: center; gap: 7px; color: var(--green); }
.live-state i {
  width: 8px; height: 8px; border-radius: 4px; background: currentColor;
  box-shadow: 0 0 0 4px rgba(63, 107, 51, 0.18);
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse { 50% { box-shadow: 0 0 0 7px rgba(63, 107, 51, 0.05); } }
.live-panel.paused .live-state { color: var(--marine); }
.live-panel.paused .live-state i { border-radius: 1px; width: 7px; box-shadow: none; animation: none; }
.live-plan { color: var(--text-mute); letter-spacing: 0.04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-clock {
  margin-top: 2px; text-align: center;
  font-family: var(--font-serif); font-size: 4.4rem; line-height: 1; font-variant-numeric: tabular-nums;
  color: var(--text);
}
.live-panel.paused .live-clock { color: var(--text-mute); }
.live-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 6px; text-align: center; }
.live-stats b {
  display: block; font-family: var(--font-serif); font-weight: 400;
  font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.live-stats span { font-family: var(--font-mono); font-size: 0.58rem; color: var(--text-mute); }
.live-progress { height: 6px; margin-top: 10px; border-radius: 3px; background: rgba(19, 40, 74, 0.1); overflow: hidden; }
.live-progress i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--marine); transition: width 0.6s var(--glass-ease); }
.live-panel.paused .live-progress i { background: var(--marine-soft); }
.live-progress-text {
  display: flex; justify-content: space-between; margin-top: 5px;
  font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-dim);
}
.live-banner {
  position: fixed; z-index: 7; left: 16px; right: 16px; max-width: 440px; margin: 0 auto;
  top: calc(var(--safe-top) + 236px);
  padding: 10px 14px; border-radius: 16px;
  background: var(--text); color: var(--bg);
  font-family: var(--font-mono); font-size: 0.68rem; line-height: 1.4; text-align: center;
  box-shadow: var(--glass-lift);
}
.live-compass {
  position: fixed; z-index: 6; right: 10px; top: calc(var(--safe-top) + 236px);
  width: 48px; height: 48px; padding: 0; border-radius: 50%;
  border: 1px solid var(--glass-edge); background: rgba(253, 248, 228, 0.88);
  backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: var(--glass-specular), var(--glass-lift-sm);
  color: var(--text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.live-banner:not([hidden]) ~ .live-compass { top: calc(var(--safe-top) + 290px); }
.live-compass svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.live-compass .needle-n { fill: var(--red); stroke: var(--red); }
.live-compass .needle-s { fill: currentColor; }
.live-compass.active { background: var(--marine); border-color: var(--marine); color: var(--bg); box-shadow: 0 0 0 6px rgba(28, 58, 107, 0.18); }
.live-compass.active .needle-n { fill: var(--bg); stroke: var(--bg); }
.live-compass.active .needle-s { fill: none; }
.live-controls {
  position: fixed; z-index: 6;
  left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 12px);
  max-width: 460px; margin: 0 auto;
  padding: 12px 18px; border-radius: 34px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(253, 248, 228, 0.9); border: 1px solid var(--glass-edge);
  backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: var(--glass-specular), 0 18px 40px rgba(19, 40, 74, 0.18);
}
.live-end, .live-follow {
  width: 76px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; touch-action: manipulation;
}
.live-label { font-family: var(--font-mono); font-size: 0.6rem; }
.live-end { color: var(--red); }
.live-end-ring { position: relative; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.live-end-progress { position: absolute; inset: 0; width: 56px; height: 56px; transform: rotate(-90deg); }
.live-end-progress circle {
  fill: none; stroke: var(--red); stroke-width: 3; opacity: 0.35;
  stroke-dasharray: 170; stroke-dashoffset: 0;
}
.live-end.holding .live-end-progress circle { opacity: 1; animation: holdRing 1s linear forwards; }
@keyframes holdRing { from { stroke-dashoffset: 170; } to { stroke-dashoffset: 0; } }
.live-end-icon { width: 18px; height: 18px; fill: currentColor; }
.live-controls.paused .live-end-ring { background: var(--red); border-radius: 50%; color: var(--bg); }
.live-controls.paused .live-end-icon { fill: var(--bg); }
.live-controls.paused .live-end-progress circle { stroke: var(--bg); opacity: 0.5; }
.live-main {
  width: 84px; height: 84px; padding: 0; border: 0; border-radius: 50%;
  background: var(--marine); color: var(--bg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(28, 58, 107, 0.35);
  -webkit-tap-highlight-color: transparent; transition: transform 0.15s var(--glass-ease), background 0.2s;
}
.live-main:active { transform: scale(0.95); }
.live-main svg { width: 30px; height: 30px; fill: currentColor; }
.live-main .icon-play { display: none; }
.live-controls.paused .live-main { background: var(--green); box-shadow: 0 10px 24px rgba(63, 107, 51, 0.35); }
.live-controls.paused .live-main .icon-play { display: block; }
.live-controls.paused .live-main .icon-pause { display: none; }
.live-follow { color: var(--text-dim); }
.live-follow-ring {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid rgba(19, 40, 74, 0.12); background: rgba(255, 255, 255, 0.6);
  display: flex; align-items: center; justify-content: center;
}
.live-follow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.live-follow[aria-pressed="true"] .live-follow-ring { border-color: var(--green); color: var(--green); }

.calib {
  position: fixed; z-index: 8; left: 10px; right: 10px; max-width: 440px; margin: 0 auto;
  bottom: calc(var(--safe-bottom) + 132px);
  padding: 20px 20px 18px; border-radius: 28px; text-align: center;
  background: rgba(253, 248, 228, 0.96); border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-specular), 0 18px 40px rgba(19, 40, 74, 0.2);
  animation: fadeUp 0.3s var(--glass-ease) both;
}
.calib-art { display: block; width: 150px; height: 78px; margin: 0 auto; }
.calib-art path { fill: none; stroke: var(--marine-soft); stroke-width: 2.5; stroke-dasharray: 3 6; stroke-linecap: round; }
.calib-art rect { fill: #FFFBEA; stroke: var(--text); stroke-width: 2; }
.calib-art .calib-speaker { fill: var(--text); stroke: none; }
.calib-art g { animation: calibMove 2.4s ease-in-out infinite; transform-origin: 75px 39px; }
@keyframes calibMove {
  0% { transform: translate(112px, 17px) rotate(28deg); }
  25% { transform: translate(75px, 39px) rotate(-10deg); }
  50% { transform: translate(38px, 61px) rotate(-28deg); }
  75% { transform: translate(75px, 39px) rotate(10deg); }
  100% { transform: translate(112px, 17px) rotate(28deg); }
}
.calib-title { margin: 10px 0 4px; font-family: var(--font-serif); font-size: 1.6rem; font-weight: 400; }
.calib-text { margin: 0; font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.35; color: var(--text-dim); }
.calib-acc { margin-top: 14px; text-align: start; }
.calib-acc-row { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-dim); }
.calib-acc-row span:last-child { color: var(--marine); }
.calib-acc-bar { height: 6px; margin-top: 6px; border-radius: 3px; background: rgba(19, 40, 74, 0.1); overflow: hidden; }
.calib-acc-bar i { display: block; height: 100%; width: 0; background: var(--marine-soft); transition: width 0.4s var(--glass-ease); }
.calib.good .calib-acc-bar i { background: var(--green); }
.calib.good .calib-acc-row span:last-child { color: var(--green); }
.calib-done {
  width: 100%; height: 48px; margin-top: 16px; border-radius: 999px;
  border: 1px solid rgba(19, 40, 74, 0.12); background: rgba(255, 255, 255, 0.7);
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--text); cursor: pointer;
}

/* ── After a run ── */
.summary {
  position: fixed; inset: 0; z-index: 15; background: var(--bg);
  display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + 14px) 16px calc(var(--safe-bottom) + 14px);
  animation: fadeUp 0.35s var(--glass-ease) both;
}
.summary-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; max-width: 480px; width: 100%; margin: 0 auto; }
.summary-top { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em; }
.summary-kicker { display: inline-flex; align-items: center; gap: 7px; color: var(--green); }
.summary-kicker svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.summary-when { color: var(--text-mute); letter-spacing: 0.04em; }
.summary-map {
  margin-top: 10px; height: 180px; border-radius: 24px; overflow: hidden;
  border: 1px solid var(--glass-edge); background: #F5EFD9; box-shadow: var(--glass-lift-sm);
}
.summary-map svg { display: block; width: 100%; height: 100%; }
.summary-title { margin: 12px 0 0; font-family: var(--font-serif); font-size: 2rem; font-weight: 400; line-height: 1.1; }
.summary-meta { margin-top: 3px; font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-dim); }
.summary-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.summary-stat { padding: 10px 14px; border-radius: 18px; background: var(--glass-fill-strong); border: 1px solid var(--glass-edge); }
.summary-stat b { display: block; font-family: var(--font-serif); font-weight: 400; font-size: 2.1rem; line-height: 1; font-variant-numeric: tabular-nums; }
.summary-stat b small { font-size: 1.1rem; }
.summary-stat span { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-mute); }
.summary-note { margin-top: 8px; font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-dim); }
.summary-note:empty { display: none; }
.summary-label { margin-top: 14px; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em; color: rgba(19, 40, 74, 0.6); }
.summary-splits { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; font-family: var(--font-mono); font-size: 0.7rem; }
.split { display: flex; align-items: center; gap: 10px; }
.split > span:first-child { width: 48px; color: var(--text-mute); white-space: nowrap; }
.split-bar { flex: 1; height: 10px; border-radius: 5px; background: rgba(19, 40, 74, 0.07); }
.split-bar i { display: block; height: 100%; border-radius: 5px; background: var(--marine-soft); }
.split.fastest .split-bar i { background: var(--green); }
.split > span:last-child { width: 40px; text-align: end; font-variant-numeric: tabular-nums; }
.split.fastest > span:last-child { color: var(--green); }
.summary-actions { flex-shrink: 0; max-width: 480px; width: 100%; margin: 10px auto 0; display: flex; flex-direction: column; gap: 8px; }
.summary-save {
  height: 56px; border: 0; border-radius: 999px; background: var(--marine); color: var(--bg);
  font-family: var(--font-serif); font-size: 1.35rem; cursor: pointer;
  box-shadow: 0 8px 20px rgba(28, 58, 107, 0.3);
}
.summary-save[hidden] { display: none; }
.summary-row { display: flex; gap: 8px; }
.summary-btn {
  flex: 1; height: 46px; border-radius: 999px;
  border: 1px solid rgba(19, 40, 74, 0.12); background: rgba(255, 255, 255, 0.6);
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text); cursor: pointer;
}
.summary-btn.danger { color: var(--red); border-color: rgba(176, 42, 34, 0.25); background: none; }

.toast {
  position: fixed; z-index: 30; left: 50%; top: calc(var(--safe-top) + 18px); transform: translateX(-50%);
  padding: 10px 18px; border-radius: 999px; background: var(--green); color: #FFFBEA;
  font-family: var(--font-mono); font-size: 0.74rem; white-space: nowrap;
  box-shadow: var(--glass-lift); animation: fadeUp 0.3s var(--glass-ease) both;
}
.toast.error { background: var(--red); white-space: normal; text-align: center; max-width: calc(100% - 32px); }

/* The route card's gestures: a grabber to fold it, the routes in a pager. */
.run-card { touch-action: none; -webkit-user-select: none; user-select: none; will-change: transform; }
.run-card.dragging { cursor: grabbing; }
.run-grab {
  display: block; width: 72px; height: 22px; margin: -10px auto -4px; padding: 0;
  border: 0; background: none; cursor: grab; -webkit-tap-highlight-color: transparent;
}
.run-grab::before {
  content: ""; display: block; width: 38px; height: 5px; margin: 0 auto;
  border-radius: 3px; background: rgba(19, 40, 74, 0.2);
}
.run-pager { overflow: hidden; margin: 0 -16px; }
.run-track { display: flex; will-change: transform; }
.run-slide { flex: 0 0 100%; min-width: 0; padding: 0 16px; box-sizing: border-box; }
.run-slide[aria-hidden="true"] { pointer-events: none; }
.run-card.collapsed { cursor: pointer; }
/* Folded, only the route's name shows; what is under it fades as it goes. */
.run-slide .run-sub, .run-slide .run-stats, .run-slide .run-mix, .run-slide .run-legend,
.run-card .run-start, .run-card .run-actions, .run-card .run-allow-note { transition: opacity 0.22s ease; }
.run-card.collapsed .run-slide .run-sub, .run-card.collapsed .run-slide .run-stats,
.run-card.collapsed .run-slide .run-mix, .run-card.collapsed .run-slide .run-legend,
.run-card.collapsed .run-start, .run-card.collapsed .run-actions, .run-card.collapsed .run-allow-note { opacity: 0; }

/* The route card's Start run, and Another's allowance. */
.run-start {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 56px; margin-top: 14px; border: 0; border-radius: 999px;
  background: var(--marine); color: var(--bg); cursor: pointer;
  font-family: var(--font-serif); font-size: 1.35rem;
  box-shadow: 0 8px 20px rgba(28, 58, 107, 0.3);
  -webkit-tap-highlight-color: transparent;
}
.run-start svg { width: 20px; height: 20px; fill: currentColor; }
.run-start:active { transform: scale(0.98); }
.run-card .run-actions { margin-top: 10px; }
/* Under Start run: a web app gets no GPS with the screen off. */
.run-screen-note {
  margin: 8px 0 0; text-align: center;
  font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-mute);
}
.run-card .run-actions .run-btn { flex: 1; min-width: 0; }
.run-btn.run-another { position: relative; flex: 1.2; overflow: visible; }
.run-badge {
  position: absolute; top: -7px; right: -2px;
  min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box;
  border-radius: 10px; border: 2px solid #FFFBEA;
  background: var(--green); color: #FFFBEA;
  font-family: var(--font-mono); font-size: 0.64rem; line-height: 16px; text-align: center;
}
.run-btn.run-another:disabled { opacity: 1; cursor: default; color: var(--text-mute); background: rgba(19, 40, 74, 0.04); border-style: dashed; }
.run-btn.run-another:disabled .run-badge { background: var(--border); color: var(--text); }
.run-allow-note { margin-top: 10px; text-align: center; font-family: var(--font-mono); font-size: 0.64rem; color: var(--text-dim); }

/* Your runs: a run that was run, apart from routes only planned. */
.runs-pill {
  flex-shrink: 0; padding: 2px 7px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.1em;
  border: 1px solid rgba(19, 40, 74, 0.2); color: var(--text-dim);
}
.runs-pill.done { background: var(--green); border-color: var(--green); color: #FFFBEA; }
.runs-name-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.runs-row.done { background: rgba(63, 107, 51, 0.08); border-radius: 18px; border-top-color: transparent; }

/* Small phones: tighter buttons and controls, the planner tightens up. */
@media (max-width: 360px) {
  .run-actions .run-btn { padding: 0 8px; gap: 5px; font-size: 0.64rem; }
  .where { padding: 0 10px; gap: 5px; }
  .live-controls { padding: 10px 12px; }
  .live-main { width: 76px; height: 76px; }
}
@media (max-height: 700px) {
  .live-clock { font-size: 3.4rem; }
  .live-stats b { font-size: 1.35rem; }
  .live-banner, .live-compass { top: calc(var(--safe-top) + 200px); }
  .live-banner:not([hidden]) ~ .live-compass { top: calc(var(--safe-top) + 254px); }
  .calib { bottom: calc(var(--safe-bottom) + 116px); padding: 14px 16px; }
  .calib-art { display: none; }
  .calib-title { margin-top: 0; font-size: 1.35rem; }
  .calib-done { margin-top: 12px; height: 44px; }
}
@media (max-height: 640px) {
  .run-km b { font-size: 2.8rem; }
  .run-label { margin: 10px 0 6px; }
  .run-presets { margin-top: 8px; }
  .run-step { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .run-sheet, .run-card, .run-dest, .calib, .summary, .toast { animation: none; }
  .live-state i, .calib-art g { animation: none; }
  .live-end.holding .live-end-progress circle { animation-duration: 1s; }
  .run-seg-thumb, .runs-sheet, .run-fold svg, .run-title { transition: none; }
  .run-go.is-loading svg { animation: none; }
}
