/* =============================================================================
   RUN TRACKER — /run/ page styles. A light map canvas sits beneath the dark,
   high-contrast activity controls used throughout RunDMV.
   ============================================================================= */
:root{
  --bg: #FFFFFF;
  --bg-soft: #F4F4F4;
  --ink: #0A0A0C;
  --ink-dim: rgba(10,10,12,.55);
  --coral: #FF4D2E;
  --volt: #5B8C00;
  --cobalt: #3E63FF;
  --run-green: #7ED957;
  --chip: rgba(16,18,20,.94);
  --sheet: #101214;
  --sheet-soft: #191d22;
  --sheet-ink: #F7F8FA;
  --sheet-muted: rgba(247,248,250,.62);
  --sheet-line: rgba(255,255,255,.14);
  --font: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after{ box-sizing: border-box; margin: 0; padding: 0; }
/* display rules on classes must never beat the hidden attribute */
[hidden]{ display: none !important; }
html, body{ height: 100%; }
body.run-page{ font-family: var(--font); background: var(--bg-soft); overscroll-behavior: none; }
button{ font-family: inherit; cursor: pointer; }

.run-app{ position: fixed; inset: 0; overflow: hidden; }
.run-map{ position: absolute; inset: 0; background: var(--bg-soft); }
.run-map .mapboxgl-ctrl-attrib{ font-family: var(--font); font-size: 10px; background: rgba(255,255,255,.82); }

/* Dark circular chips (shared look with the homepage finder chrome) */
.map-chip{
  position: relative; width: 48px; height: 48px; border: 0; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--chip); color: #fff; text-decoration: none;
  box-shadow: 0 6px 18px rgba(10,10,12,.28); touch-action: manipulation;
}
.map-chip svg{ width: 22px; height: 22px; }
.map-chip[aria-pressed="false"]{ opacity: .62; }
.map-chip__badge{
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--run-green); color: var(--ink);
  font-size: .72rem; font-weight: 800; border: 2px solid #101214;
}

/* Layers popover: toggle water/restroom overlays */
.map-popover{
  position: absolute; z-index: 10; top: calc(70px + env(safe-area-inset-top)); right: 14px;
  min-width: 224px; padding: 10px; border-radius: 16px;
  background: var(--chip); color: #fff;
  box-shadow: 0 14px 34px rgba(10,10,12,.35); display: grid; gap: 4px;
}
.map-popover__title{ padding: 4px 8px 6px; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.map-popover__row{
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 0; border-radius: 10px; background: transparent;
  color: #fff; font-family: inherit; font-size: .88rem; font-weight: 700; text-align: left; cursor: pointer;
}
.map-popover__row:hover{ background: rgba(255,255,255,.08); }
.map-popover__row:not(.is-on){ opacity: .55; }
.map-popover__row:not(.is-on) .map-popover__emoji{ filter: grayscale(1); opacity: .62; }
.map-popover__state{ margin-left: auto; font-size: .7rem; font-weight: 800; letter-spacing: .04em; color: var(--run-green); }
.map-popover__row:not(.is-on) .map-popover__state{ color: rgba(255,255,255,.4); }
.map-popover__emoji{ width: 24px; flex: 0 0 24px; font-size: 19px; line-height: 1; text-align: center; transition: opacity .2s ease, filter .2s ease; }

.run-topbar{
  position: absolute; z-index: 10; left: 14px; right: 14px;
  top: calc(14px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 12px; pointer-events: none;
}
.run-topbar > *{ pointer-events: auto; }
.run-back{ flex: 0 0 auto; }

/* Mile progress bar (reference: 0 — 1 mi — 2 mi ticks with green fill) */
.run-progress{ flex: 1 1 auto; padding: 6px 4px 0; }
.run-progress__labels{ display: flex; justify-content: space-between; margin-bottom: 4px; }
.run-progress__labels span{ font-size: .72rem; font-weight: 800; color: var(--ink); text-shadow: 0 1px 3px rgba(255,255,255,.85); }
.run-progress__track{ position: relative; height: 8px; border-radius: 999px; background: rgba(10,10,12,.82); overflow: hidden; }
.run-progress__fill{ position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: 999px; background: var(--run-green); transition: width .5s linear; }
.run-progress__tick{ position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.55); }

.run-side{
  position: absolute; z-index: 10; right: 14px;
  top: calc(78px + env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}

.run-status{
  position: absolute; z-index: 10; left: 50%; transform: translateX(-50%);
  top: calc(76px + env(safe-area-inset-top));
  max-width: min(86vw, 420px); padding: 8px 14px; border-radius: 999px;
  background: var(--chip); color: #fff; font-size: .8rem; font-weight: 700; text-align: center;
}
.run-status:empty{ display: none; }
.run-gps-chip{
  position: absolute; z-index: 10; left: 50%; transform: translateX(-50%);
  top: calc(118px + env(safe-area-inset-top));
  padding: 6px 12px; border-radius: 999px; background: #B8860B; color: #fff;
  font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
/* Stacks below the GPS chip so the two can never render on top of each other
   (a run can be both weak-signal and mid-detour at the same time). */

.run-quickfind{ font-size: 21px; }

/* Detour guidance banner: walking-route direction + distance + cancel */
.run-detour-banner{
  position: absolute; z-index: 10; left: 50%; transform: translateX(-50%);
  top: calc(158px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 9px;
  max-width: min(88vw, 430px); padding: 9px 14px; border: 0; border-radius: 999px;
  background: var(--cobalt); color: #fff; font-family: inherit;
  font-size: .84rem; font-weight: 800; box-shadow: 0 6px 18px rgba(10,10,12,.3);
}
.run-detour-banner__arrow{ display: inline-block; transition: transform .3s ease; }
.run-detour-banner__text{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-detour-banner__cancel{ font-size: 1.15rem; line-height: 1; opacity: .8; }

/* Location puck: blue dot + translucent heading cone */
.run-puck{ position: relative; width: 64px; height: 64px; pointer-events: none; }
.run-puck__cone{
  position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease;
  background: conic-gradient(from -30deg at 50% 50%, rgba(46,124,246,.42) 0deg, rgba(46,124,246,.42) 60deg, transparent 60deg);
  border-radius: 50%;
  /* cone apex sits at the dot; conic gradient wedge points "up" pre-rotation */
  clip-path: polygon(50% 50%, 0 0, 100% 0);
}
.run-puck.has-heading .run-puck__cone{ opacity: 1; }
.run-puck__dot{
  position: absolute; left: 50%; top: 50%; width: 18px; height: 18px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: #2E7CF6; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(10,10,12,.45);
}

/* Emoji amenity selected for active guidance — no black circle, just a clear halo. */
.poi-detour-marker{
  --poi-color: var(--cobalt);
  width: 42px; height: 42px; display: grid; place-items: center;
  font-size: 29px; line-height: 1; transform: scale(1.08);
  filter: drop-shadow(0 2px 3px rgba(10,10,12,.62)) drop-shadow(0 0 6px var(--poi-color));
  animation: poi-destination-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes poi-destination-pulse{
  0%, 100%{ transform: scale(1.08); filter: drop-shadow(0 2px 3px rgba(10,10,12,.62)) drop-shadow(0 0 4px var(--poi-color)); }
  50%{ transform: scale(1.18); filter: drop-shadow(0 2px 3px rgba(10,10,12,.62)) drop-shadow(0 0 10px var(--poi-color)); }
}

/* Bottom sheet: dark activity dashboard, peek <-> expanded. */
.run-sheet{
  position: absolute; z-index: 20; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #1a1f26 0%, var(--sheet) 36%); color: var(--sheet-ink); border-radius: 28px 28px 0 0;
  border-top: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 -14px 38px rgba(10,10,12,.32);
  padding: 0 max(20px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  max-height: 82svh; overflow: hidden auto;
  transition: transform .25s ease;
}
.run-sheet__handle-zone{ display: block; width: 100%; padding: 12px 0 8px; background: transparent; border: 0; }
.run-sheet__handle{ display: block; width: 42px; height: 4px; margin: 0 auto; border-radius: 999px; background: rgba(255,255,255,.34); }
.run-sheet h1{ font-size: 1.35rem; line-height: 1.15; color: var(--sheet-ink); }
.run-sheet__note{ margin-top: 10px; color: var(--sheet-muted); font-size: .84rem; line-height: 1.45; }
.run-sheet__note b{ color: var(--sheet-ink); }
.run-sheet__disclaimer{
  margin-top: 12px; padding: 10px 12px; border-left: 4px solid var(--coral);
  background: rgba(255,77,46,.14); border-radius: 0 10px 10px 0;
  color: rgba(255,255,255,.84); font-size: .8rem; font-weight: 600; line-height: 1.45;
}

/* Live stats: peek row + expanded grid */
.run-stats-peek{ display: flex; justify-content: space-between; gap: 10px; margin-top: 2px; }
.run-stat{ min-width: 0; }
.run-stat__value{ font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; color: var(--sheet-ink); font-variant-numeric: tabular-nums; }
.run-stat__label{ margin-top: 1px; font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--sheet-muted); }
.run-stats-grid{ display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px 10px; margin-top: 16px; }
.run-stats-grid .run-stat__value{ font-size: 1.15rem; }
.run-sheet.is-collapsed .run-sheet__expanded{ display: none; }

.run-splits{ margin-top: 16px; }
.run-splits h2{ font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--sheet-muted); }
.run-splits table{ width: 100%; margin-top: 8px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.run-splits td{ padding: 6px 0; font-size: .88rem; border-bottom: 1px solid var(--sheet-line); }
.run-splits td:last-child{ text-align: right; font-weight: 700; }

.run-actions{ display: grid; gap: 10px; margin-top: 18px; }
.run-actions--two{ grid-template-columns: 1fr 1fr; }
.run-btn{
  min-height: 54px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; padding: 12px 18px;
  font-size: .95rem; font-weight: 800; text-align: center; text-decoration: none;
  touch-action: manipulation;
}
.run-btn--primary{ background: var(--run-green); color: var(--ink); }
.run-btn--danger{ background: var(--coral); color: #fff; }
.run-btn--ghost{ background: transparent; color: var(--sheet-ink); border: 1px solid rgba(255,255,255,.28); }

.run-title-input{
  width: 100%; padding: 6px 0; border: 0; border-bottom: 1px solid var(--sheet-line);
  background: transparent; color: var(--sheet-ink); font-family: inherit;
  font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em;
}
.run-title-input:focus{ outline: none; border-bottom-color: var(--run-green); }
textarea.run-notes{
  width: 100%; margin-top: 14px; min-height: 76px; padding: 12px;
  border-radius: 12px; border: 1px solid var(--sheet-line);
  background: var(--sheet-soft); color: var(--sheet-ink); font-family: inherit; font-size: .9rem;
}
textarea.run-notes::placeholder{ color: rgba(255,255,255,.42); }

/* History */
.run-history{ margin-top: 16px; display: grid; gap: 8px; }
.run-history__row{
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border: 1px solid var(--sheet-line); border-radius: 12px;
  background: var(--sheet-soft); color: var(--sheet-ink);
}
.run-history__main{ flex: 1 1 auto; min-width: 0; }
.run-history__title{ font-size: .92rem; font-weight: 800; }
.run-history__sub{ margin-top: 2px; font-size: .76rem; color: var(--sheet-muted); }
.run-history__dist{ flex: 0 0 auto; font-size: .95rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.poi-cluster__list{ max-height: min(46svh, 420px); overflow: auto; padding-right: 2px; }
.poi-cluster__row{ min-height: 58px; }
.poi-cluster__emoji{ width: 32px; flex: 0 0 32px; font-size: 25px; line-height: 1; text-align: center; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }

/* Toast (RunDMV.showToast target) */
.route-toast{
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%) translateY(12px);
  bottom: calc(150px + env(safe-area-inset-bottom));
  padding: 10px 18px; border-radius: 999px; background: var(--chip); color: #fff;
  font-size: .86rem; font-weight: 700; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.route-toast.is-visible{ opacity: 1; transform: translateX(-50%) translateY(0); }

/* =============================================================================
   ACTIVITY LAYER — layered run-tracking UI over the map:
   compact metrics card + bottom dock + expanded dashboard + validation modal.
   ============================================================================= */
:root{
  --act-surface: #12151B;
  --act-overlay: rgba(15,18,24,.97);
  --act-ink: #F7F7F3;
  --act-muted: #9AA4B4;
  --act-action: #FF5538;
  --act-action-down: #D83C25;
  --act-paused: #FFD84A;
  --act-chart-on: #5A86EE;
  --act-chart-off: #363B45;
  --act-route: #24D8D2;
  --act-scrim: rgba(0,0,0,.55);
  --act-ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- compact metrics card ---------- */
.act-card{
  position: absolute; z-index: 24; left: 16px; right: 16px;
  bottom: calc(188px + env(safe-area-inset-bottom));
  border-radius: 18px; background: var(--act-surface); color: var(--act-ink);
  box-shadow: 0 12px 34px rgba(0,0,0,.4);
  overflow: hidden;
  transition: bottom .3s var(--act-ease), opacity .3s var(--act-ease);
}
.act-card__top{
  display: flex; align-items: center; justify-content: center; position: relative;
  height: 40px; transition: height .3s var(--act-ease), background .3s var(--act-ease);
}
.act-card__status{
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .72rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
}
.act-dot{ width: 8px; height: 8px; border-radius: 50%; background: var(--act-route); }
.act-card__expand{
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--act-muted); border-radius: 12px;
}
.act-card__expand svg{ width: 17px; height: 17px; }
.act-card__stats{
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 2px 8px 16px; background: var(--act-surface);
}
.act-stat{ display: grid; justify-items: center; gap: 3px; min-width: 0; }
.act-stat + .act-stat{ border-left: 1px solid rgba(255,255,255,.08); }
.act-stat__value{
  font-size: clamp(1.55rem, 8vw, 1.9rem); font-weight: 700; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums; color: var(--act-ink); line-height: 1.05;
}
.act-stat__label{
  font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--act-muted); white-space: nowrap;
}

/* LIVE: action-red dot with a soft pulse */
.act-card.is-live .act-dot, .act-expanded.is-live .act-dot{
  background: var(--act-action); animation: act-pulse 1.6s ease-in-out infinite;
}
@keyframes act-pulse{ 0%,100%{ opacity: 1 } 50%{ opacity: .35 } }

/* PAUSED: card grows — the status row becomes a full 58px yellow header */
.act-card.is-paused .act-card__top{ height: 58px; background: var(--act-paused); }
.act-card.is-paused .act-card__status{ color: #12151B; font-size: .82rem; }
.act-card.is-paused .act-dot{ background: #12151B; animation: none; }
.act-card.is-paused .act-card__expand{ color: rgba(18,21,27,.72); }
.act-card.is-paused .act-card__stats{ padding-top: 14px; padding-bottom: 22px; }

/* GPS acquisition: amber searching dot */
.act-card.is-acquiring .act-dot{ background: var(--act-paused); animation: act-pulse 1s ease-in-out infinite; }

/* ---------- bottom dock ---------- */
.act-dock{
  position: absolute; z-index: 24; left: 0; right: 0; bottom: 0;
  padding: 18px 24px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(15,18,24,.86) 0%, var(--act-surface) 42%);
  border-top: 1px solid rgba(255,255,255,.08);
  border-radius: 24px 24px 0 0;
  min-height: 132px; display: flex; align-items: center;
}
.act-dock > div{ width: 100%; }
.act-dock__ready{ display: flex; align-items: center; justify-content: space-between; }
.act-side{
  display: grid; justify-items: center; gap: 7px; border: 0; background: transparent;
  color: var(--act-ink); min-width: 64px; padding: 4px;
}
.act-side__chip{
  position: relative; width: 56px; height: 56px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #1B2027; border: 1px solid rgba(255,255,255,.1);
  font-size: 1.05rem; font-weight: 700; color: var(--act-ink);
}
.act-side__chip svg{ width: 24px; height: 24px; }
.act-side__check{
  position: absolute; top: -3px; right: -3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--act-route); color: #0A0A0C;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--act-surface);
}
.act-side__check svg{ width: 10px; height: 10px; }
.act-side__label{
  font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--act-muted);
}
.act-start{
  width: 72px; height: 72px; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--act-action); color: #fff;
  box-shadow: 0 10px 26px rgba(255,85,56,.42);
  transition: transform .15s ease, background .15s ease;
}
.act-start:active{ background: var(--act-action-down); transform: scale(.94); }
.act-start svg{ width: 30px; height: 30px; margin-left: 3px; }
.act-start.is-acquiring{ animation: act-acquire 1.2s ease-in-out infinite; }
@keyframes act-acquire{
  0%,100%{ box-shadow: 0 10px 26px rgba(255,85,56,.42), 0 0 0 0 rgba(255,85,56,.5); }
  50%{ box-shadow: 0 10px 26px rgba(255,85,56,.42), 0 0 0 14px rgba(255,85,56,0); }
}

.act-dock__live, .act-dock__paused{ display: flex; gap: 12px; }
.act-pill{
  flex: 1 1 0; min-width: 0; height: 60px; border: 0; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 1rem; font-weight: 700; letter-spacing: .02em;
  touch-action: manipulation; transition: background .15s ease, transform .15s ease;
}
.act-pill:active{ transform: scale(.97); }
.act-pill svg{ width: 19px; height: 19px; }
.act-pill--pause, .act-pill--resume{ background: var(--act-action); color: #fff; }
.act-pill--pause:active, .act-pill--resume:active{ background: var(--act-action-down); }
.act-pill--finish{ background: #F7F7F3; color: #12151B; }

/* ---------- expanded dashboard ---------- */
.act-expanded{
  position: absolute; z-index: 30; inset: 0;
  display: flex; flex-direction: column;
  background: var(--act-overlay); color: var(--act-ink);
  opacity: 0; transform: translateY(9%) scale(.96); transform-origin: 50% 88%;
  transition: opacity .46s var(--act-ease), transform .46s var(--act-ease);
}
.act-expanded.is-open{ opacity: 1; transform: none; }
/* map fades + scales gently behind the dashboard while it's up */
.run-app.is-expanded .run-map{ opacity: .5; transform: scale(1.05); }
.run-map{ transition: opacity .46s var(--act-ease), transform .46s var(--act-ease); }
/* everything else beneath the dashboard fades out completely */
.run-topbar, .run-side, .run-status, .run-gps-chip, .run-detour-banner, .act-dock{
  transition: opacity .3s var(--act-ease);
}
.run-app.is-expanded .run-topbar, .run-app.is-expanded .run-side, .run-app.is-expanded .run-status,
.run-app.is-expanded .run-gps-chip, .run-app.is-expanded .run-detour-banner,
.run-app.is-expanded .act-card, .run-app.is-expanded .act-dock, .run-app.is-expanded .map-popover{
  opacity: 0; pointer-events: none;
}

.act-expanded__header{
  position: relative; flex: 0 0 auto; height: 145px;
  padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: center;
  transition: background .3s var(--act-ease), color .3s var(--act-ease);
}
.act-collapse{
  position: absolute; left: 12px; bottom: 10px; width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.07); color: inherit;
}
.act-collapse svg{ width: 22px; height: 22px; }
.act-expanded__status{
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.05rem; font-weight: 700; letter-spacing: .3em; text-transform: uppercase;
}
.act-expanded__status .act-dot{ width: 10px; height: 10px; background: var(--act-action); }
.act-expanded.is-paused .act-expanded__header{ background: var(--act-paused); color: #12151B; }
.act-expanded.is-paused .act-expanded__status .act-dot{ background: #12151B; animation: none; }
.act-expanded.is-paused .act-collapse{ background: rgba(18,21,27,.12); }

.act-expanded__body{
  flex: 1 1 auto; min-height: 0; overflow: hidden auto;
  display: flex; flex-direction: column; justify-content: space-evenly;
  padding: 8px 24px 4px; text-align: center;
}
.act-xblock{ display: grid; gap: 2px; }
.act-xtimer, .act-xpace, .act-xdist{
  font-weight: 700; letter-spacing: -.05em; font-variant-numeric: tabular-nums; line-height: 1;
}
.act-xtimer{ font-size: clamp(48px, 15vw, 60px); }
.act-xpace{ font-size: clamp(56px, 18vw, 73px); }
.act-xdist{ font-size: clamp(64px, 21vw, 84px); }
.act-xlabel{
  font-size: .68rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--act-muted); margin-top: 4px;
}

/* splits: mile bars — active blue, average baseline in accent, gray placeholders */
.act-splits{ padding-bottom: 6px; }
.act-splits__title{ margin-bottom: 10px; }
.act-splits__chart{
  position: relative; height: 64px;
  display: flex; align-items: flex-end; justify-content: center; gap: 8px;
}
.act-splits__bar{
  width: clamp(18px, 8vw, 34px); border-radius: 6px 6px 3px 3px;
  background: var(--act-chart-off); min-height: 8px;
}
.act-splits__bar.is-active{ background: var(--act-chart-on); }
.act-splits__baseline{
  position: absolute; left: 6%; right: 6%; height: 2px; border-radius: 2px;
  background: var(--act-action); opacity: .85;
}
.act-splits__empty{ margin-top: 8px; font-size: .78rem; color: var(--act-muted); }
.act-splits__chart.has-splits + .act-splits__empty{ display: none; }

.act-expanded__actions{
  flex: 0 0 auto; padding: 10px 24px calc(14px + env(safe-area-inset-bottom));
}
.act-expanded__actions > div{ display: flex; gap: 12px; }

/* ---------- validation modal ---------- */
.act-scrim{
  position: absolute; z-index: 80; inset: 0; background: var(--act-scrim);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity .2s ease;
}
.act-scrim.is-open{ opacity: 1; }
.act-modal{
  width: min(321px, 100%); border-radius: 29px; padding: 26px 24px 22px;
  background: var(--act-surface); color: var(--act-ink); text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  transform: scale(.92); transition: transform .2s var(--act-ease);
}
.act-scrim.is-open .act-modal{ transform: scale(1); }
.act-modal h2{ font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; }
.act-modal p{ margin-top: 8px; font-size: .84rem; line-height: 1.45; color: var(--act-muted); }
.act-modal__actions{ display: flex; gap: 12px; margin-top: 18px; }
.act-modal__btn{
  flex: 1 1 0; min-width: 0; height: 48px; border-radius: 999px; border: 0;
  font-size: .9rem; font-weight: 700; touch-action: manipulation;
}
.act-modal__btn--ghost{ background: transparent; color: var(--act-muted); border: 1px solid rgba(255,255,255,.22); }
.act-modal__btn--primary{ background: var(--act-action); color: #fff; }
.act-modal__btn--primary:active{ background: var(--act-action-down); }

/* Detour banner + toasts must clear the dock */
@media (max-width: 480px){
  .act-card{ bottom: calc(178px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce){
  .run-sheet, .run-progress__fill, .route-toast{ transition: none; }
  .act-card, .act-card__top, .act-expanded, .run-map, .act-scrim, .act-modal{ transition: none; }
  .act-card.is-live .act-dot, .act-expanded.is-live .act-dot, .act-start.is-acquiring{ animation: none; }
  .poi-detour-marker{ animation: none; }
}
