/* ==========================================================================
   Section 3 — Story · "A day in the field app"
   An automatic preview of a loan officer's day, with a step list that
   follows along (click a step to jump to it). js/sections/story.js plays it.

   Prefixes: .st- (section, steps, map) and .fp- (the field-app phone UI).
   Everything is scoped to .story.
   ========================================================================== */

/* The two columns slide in from 56px off each edge (.anim-from-left/right).
   Clip that so phones never get a page wider than the screen. */
.story { overflow-x: clip; }

.story {
  /* Local tokens — light */
  --st-card:      var(--surface);
  --st-grid-line: rgba(10,47,107,0.045);
  --st-label-bg:  var(--surface);

  --ph-bezel:   #0A1A33;
  --ph-screen:  #ffffff;
  --ph-card:    #F5F8FC;
  --ph-line:    rgba(13,27,42,0.08);
  --ph-shadow:  0 40px 80px -30px rgba(10,47,107,0.4), 0 18px 36px -18px rgba(10,47,107,0.22);

  position: relative;
  padding: clamp(72px, 9vw, 120px) var(--page-px);
  background: var(--surface-raised);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

:root[data-theme="dark"] .story {
  --st-card:      #08193A;
  --st-grid-line: rgba(147,190,240,0.05);
  --st-label-bg:  #08193A;

  --ph-bezel:   #1C3561;
  --ph-screen:  #0B1F42;
  --ph-card:    #10294F;
  --ph-line:    rgba(255,255,255,0.08);
  --ph-shadow:  0 40px 80px -30px rgba(0,0,0,0.7), 0 18px 36px -18px rgba(0,0,0,0.5);
}

.st-inner { max-width: var(--container); margin: 0 auto; }

/* ─── Head ────────────────────────────────────────────────────────────── */
.st-head { max-width: 760px; }
.st-title {
  font-size: var(--fs-section-title);
  letter-spacing: -0.03em;
  line-height: 1.12;
  text-wrap: balance;
}
.st-title em { font-style: normal; color: var(--accent); }
.st-sub {
  margin-top: 14px;
  font-size: var(--fs-section-sub);
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ─── Layout ──────────────────────────────────────────────────────────── */
.st-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  column-gap: clamp(32px, 6vw, 88px);
  row-gap: 40px;
  margin-top: clamp(32px, 4vw, 56px);
}

/* ─── Steps: a vertical timeline ──────────────────────────────────────── */
.st-steps { display: flex; flex-direction: column; }

.st-step-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 4px 0 22px 24px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

/* Rail: solid where there's signal, dashed amber where there isn't */
.st-step-rail {
  position: absolute;
  left: 0; top: 6px; bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--border-strong);
  overflow: hidden;
}
.st-step[data-signal="none"] .st-step-rail {
  background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--warn) 40%, transparent) 0 5px, transparent 5px 9px);
}
.st-step-fill {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 0;
  background: var(--accent);
}
.st-step[data-signal="none"] .st-step-fill {
  background: repeating-linear-gradient(180deg, var(--warn) 0 5px, transparent 5px 9px);
}
.st-step.is-done .st-step-fill { height: 100%; }

.st-step-time {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.3s ease;
}
.st-step-time b {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-secondary);
}
.st-step-time .st-bars { color: var(--text-muted); }

.st-step-name {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.3;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

/* Only the active step shows its description */
.st-step-text {
  max-height: 0;
  overflow: hidden;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  opacity: 0;
  transition: max-height 0.5s var(--ease-out), opacity 0.35s ease, margin 0.5s var(--ease-out);
}

.st-step-btn:hover .st-step-name { color: var(--text-primary); }

.st-step.is-active .st-step-name { color: var(--text-primary); }
.st-step.is-active .st-step-time b { color: var(--text-primary); }
.st-step.is-active .st-step-time .st-bars { color: var(--accent); }
.st-step.is-active[data-signal="none"] .st-step-time .st-bars { color: var(--warn); }
.st-step.is-active .st-step-text {
  max-height: 8em;
  margin-top: 8px;
  opacity: 1;
}

/* Pause control (WCAG 2.2.2) */
.st-pause {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 12px 6px 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.st-pause:hover { color: var(--text-primary); background: rgba(10,47,107,0.04); }
.st-pause .ti { font-size: 14px; }

/* Signal bars (phone status bar + step labels) */
.st-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  flex-shrink: 0;
}
.st-bars i {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: currentColor;
  transition: opacity 0.3s ease;
}
.st-bars i:nth-child(1) { height: 4px; }
.st-bars i:nth-child(2) { height: 6.5px; }
.st-bars i:nth-child(3) { height: 9px; }
.st-bars i:nth-child(4) { height: 12px; }
.st-bars.is-off i { opacity: 0.22; }
.st-bars.is-weak i:nth-child(n+3) { opacity: 0.22; }

/* ─── Stage ───────────────────────────────────────────────────────────────
   A map card and an Android phone, laid out at a logical size
   (--st-w × --st-h) and scaled by JS (--st-scale) to the frame width.
   Desktop: side by side, the phone overlapping a reserved margin of the
   card. Phones: stacked (see Responsive).                               */
.st-stage-frame {
  --st-w: 640;
  --st-h: 600;
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: var(--st-w) / var(--st-h);
  justify-self: end;
}
.st-stage {
  position: absolute;
  top: 0; left: 0;
  width: calc(var(--st-w) * 1px);
  height: calc(var(--st-h) * 1px);
  margin: 0;
  transform: scale(var(--st-scale, 1));
  transform-origin: top left;
}

/* ─── Map card ──────────────────────────────────────────────────────────
   Three fixed zones: header (44) · map (468) · legend (48). Nothing
   crosses between them; the right 40px are kept clear for the phone.  */
.st-card {
  --map-land:    #F3F6FA;
  --map-parcel:  #EAEFF5;
  --map-block:   #DCE3EC;
  --map-water:   #CFE3F6;
  --map-minor:   #FFFFFF;
  --map-minor-c: #E1E7EF;
  --map-road:    #FFFFFF;
  --map-road-c:  #D3DCE7;
  --map-trail:   var(--blue-600);
  --map-contour: rgba(10,47,107,0.07);

  position: absolute;
  top: 20px; left: 0;
  z-index: 0;
  isolation: isolate;          /* keep the map's layers inside the card */
  width: 400px;
  height: 560px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(10,47,107,0.04), 0 24px 48px -28px rgba(10,47,107,0.25);
}
:root[data-theme="dark"] .st-card {
  --map-land:    #0A1C3D;
  --map-parcel:  #0D2247;
  --map-block:   #163063;
  --map-water:   #123A6B;
  --map-minor:   #17305C;
  --map-minor-c: #0A1C3D;
  --map-road:    #1E3B6E;
  --map-road-c:  #0A1C3D;
  --map-trail:   var(--blue-400);
  --map-contour: rgba(147,190,240,0.08);
  background: #08193A;
  box-shadow: 0 24px 48px -28px rgba(0,0,0,0.6);
}

.st-card-head {
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px 0 16px;
  border-bottom: 1px solid var(--border);
}
.st-card-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.st-card-title .ti { font-size: 15px; color: var(--text-muted); }

/* Live network status */
.st-net {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--good);
  background: color-mix(in srgb, currentColor 9%, transparent);
  border-radius: 99px;
  transition: color 0.3s ease, background 0.3s ease;
}
.st-net-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-net[data-level="weak"] { color: var(--accent-text); }
.st-net[data-level="none"] { color: var(--warn); }

/* Map */
.st-map-area {
  position: relative;
  flex: 0 0 468px;
  overflow: hidden;
  background: var(--map-land);
}
/* Soft vignette for depth */
.st-map-area::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;                 /* above the map art, below stops/labels/rider */
  pointer-events: none;
  box-shadow: inset 0 0 48px rgba(10,47,107,0.08);
}
:root[data-theme="dark"] .st-map-area::after { box-shadow: inset 0 0 56px rgba(0,0,0,0.35); }
.st-map { position: absolute; inset: 0; width: 400px; height: 468px; display: block; }

.st-parcels rect { fill: var(--map-parcel); stroke: var(--map-block); stroke-opacity: 0.5; stroke-width: 1; }
.st-blocks rect  { fill: var(--map-block); }
.st-river {
  fill: none;
  stroke: var(--map-water);
  stroke-width: 14;
  stroke-linecap: round;
}
.st-road-minor path {
  fill: none;
  stroke: var(--map-minor);
  stroke-width: 3;
  stroke-linecap: round;
  paint-order: stroke;
  filter: drop-shadow(0 0 0.6px var(--map-minor-c));
}
.st-glow--full { stop-color: var(--good); }
.st-glow--weak { stop-color: var(--accent); }

/* Coverage: glow + range rings + dashed boundary + a slow broadcast pulse */
.st-cov-ring  { fill: none; stroke-width: 1; }
.st-cov-edge  { fill: none; stroke-width: 1.25; stroke-dasharray: 3 4; }
.st-cov-pulse {
  fill: none;
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: st-broadcast 3.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.st-cov--weak .st-cov-pulse { animation-delay: 1.6s; }
.st-cov--full .st-cov-ring  { stroke: var(--good);   stroke-opacity: 0.30; }
.st-cov--full .st-cov-edge  { stroke: var(--good);   stroke-opacity: 0.70; }
.st-cov--full .st-cov-pulse { stroke: var(--good); }
.st-cov--weak .st-cov-ring  { stroke: var(--accent); stroke-opacity: 0.28; }
.st-cov--weak .st-cov-edge  { stroke: var(--accent); stroke-opacity: 0.65; }
.st-cov--weak .st-cov-pulse { stroke: var(--accent); }

@keyframes st-broadcast {
  0%   { transform: scale(0.2); opacity: 0.55; }
  80%  { opacity: 0.08; }
  100% { transform: scale(1);   opacity: 0; }
}

/* Network band tag on the coverage edge */
.st-band {
  position: absolute;
  top: 0; left: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px 2px 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  border-radius: 99px;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px -2px rgba(10,47,107,0.35);
}
.st-band .ti { font-size: 12px; }
.st-band--full { background: var(--good); }
.st-band--weak { background: var(--accent); }
:root[data-theme="dark"] .st-band { color: #061530; }

/* Terrain contours */
.st-contours path { fill: none; stroke: var(--map-contour); stroke-width: 1; }

.st-road-casing { fill: none; stroke: var(--map-road-c); stroke-width: 9;   stroke-linecap: round; stroke-linejoin: round; }
.st-road        { fill: none; stroke: var(--map-road);   stroke-width: 6;   stroke-linecap: round; stroke-linejoin: round; }
.st-trail {
  fill: none;
  stroke: var(--map-trail);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;            /* JS sets 1 − progress */
}

/* Stops */
.st-stop {
  position: absolute;
  z-index: 2;
  top: 0; left: 0;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--surface);
  border: 2.5px solid var(--text-muted);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(10,47,107,0.18);
  transition: border-color 0.3s ease, background 0.3s ease;
}
.st-stop.is-reached { border-color: var(--map-trail); background: var(--map-trail); box-shadow: 0 0 0 3px var(--surface) inset, 0 1px 3px rgba(10,47,107,0.25); }
:root[data-theme="dark"] .st-stop:not(.st-stop--branch) { background: #08193A; }
:root[data-theme="dark"] .st-stop.is-reached:not(.st-stop--branch) { background: var(--map-trail); box-shadow: 0 0 0 3px #08193A inset; }

.st-stop--branch,
.st-stop--branch.is-reached {
  width: 28px; height: 28px;
  margin: -14px 0 0 -14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--text-primary);
  border: 2px solid var(--surface);
  border-radius: 9px;
  box-shadow: 0 6px 14px -6px rgba(10,47,107,0.55);
}
:root[data-theme="dark"] .st-stop--branch { color: #08193A; border-color: #08193A; }
.st-stop--branch i { font-size: 15px; }

/* Callout labels (positioned by JS from data-label) */
.st-label {
  position: absolute;
  z-index: 2;
  top: 0; left: 0;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 2px 6px -2px rgba(10,47,107,0.14);
}
:root[data-theme="dark"] .st-label { background: #0E2550; }
.st-label[data-anchor="start"]  { transform: translate(0, -50%); }
.st-label[data-anchor="end"]    { transform: translate(-100%, -50%); }
.st-label[data-anchor="middle"] { transform: translate(-50%, -50%); }

/* Rider: a navigation-style puck */
.st-rider {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  z-index: 3;
  will-change: transform;
}
.st-rider-puck {
  position: absolute;
  left: -15px; top: -15px;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  color: var(--map-trail);
  background: var(--surface);
  border: 2px solid var(--map-trail);
  border-radius: 50%;
  box-shadow: 0 6px 16px -4px rgba(10,47,107,0.45);
  transition: color 0.3s ease, border-color 0.3s ease;
}
:root[data-theme="dark"] .st-rider-puck { background: #0E2550; }
.st-rider-puck i { font-size: 16px; }
.st-rider-halo {
  position: absolute;
  left: -22px; top: -22px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--map-trail);
  opacity: 0.14;
  transition: background 0.3s ease;
}
.st-rider.is-offline .st-rider-puck { color: var(--warn); border-color: var(--warn); }
.st-rider.is-offline .st-rider-halo { background: var(--warn); }

/* Legend */
.st-legend {
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 48px 0 16px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.st-legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.st-key { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.st-key--full { background: radial-gradient(circle, color-mix(in srgb, var(--good) 55%, transparent), color-mix(in srgb, var(--good) 15%, transparent)); }
.st-key--weak { background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), color-mix(in srgb, var(--accent) 15%, transparent)); }
.st-key--trail { width: 16px; height: 3.5px; border-radius: 2px; background: var(--blue-600); }
:root[data-theme="dark"] .st-key--trail { background: var(--blue-400); }

/* ─── Phone: unbranded Android (Galaxy A-series proportions) ──────────── */
.fp-device {
  position: absolute;
  top: 10px; left: 372px;
  z-index: 1;                  /* always above the map card */
  width: 268px;
  height: 580px;
  padding: 7px;
  background: #0C0F14;
  border-radius: 42px;
  /* metallic edge + depth */
  box-shadow:
    0 0 0 1.5px #3A414B,
    0 0 0 3px #1A1E24,
    0 40px 80px -30px rgba(10,47,107,0.45),
    0 18px 36px -18px rgba(10,47,107,0.3);
}
:root[data-theme="dark"] .fp-device {
  box-shadow:
    0 0 0 1.5px #4A5462,
    0 0 0 3px #1A1E24,
    0 40px 80px -30px rgba(0,0,0,0.8);
}
.fp-btn {
  position: absolute;
  right: -4.5px;
  width: 3px;
  background: #2A2F37;
  border-radius: 0 2px 2px 0;
}
.fp-btn--vol   { top: 110px; height: 64px; }
.fp-btn--power { top: 190px; height: 40px; }

.fp-screen {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ph-screen);
  border-radius: 35px;
  color: var(--text-primary);
}
/* faint glass reflection */
.fp-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0) 32%);
  pointer-events: none;
}
.fp-camera {
  position: absolute;
  top: 11px; left: 50%;
  z-index: 4;
  width: 10px; height: 10px;
  margin-left: -5px;
  background: #050607;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px #15191F;
}

/* Android status bar: time left, icons right */
.fp-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 32px;
  padding: 4px 20px 0 22px;
  font-size: 11.5px;
  font-weight: 500;
}
.fp-status-icons { display: flex; align-items: center; gap: 5px; }
.fp-status-icons .ti { font-size: 15px; }
.fp-bars { height: 10px; }
.fp-bars i:nth-child(1) { height: 3px; }
.fp-bars i:nth-child(2) { height: 5.5px; }
.fp-bars i:nth-child(3) { height: 8px; }
.fp-bars i:nth-child(4) { height: 10px; }

/* Android heads-up notification */
.fp-push {
  position: absolute;
  top: 36px; left: 9px; right: 9px;
  z-index: 3;
  padding: 10px 14px 12px;
  background: var(--ph-screen);
  border-radius: 20px;
  box-shadow: 0 10px 28px -8px rgba(10,47,107,0.35), 0 0 0 1px var(--ph-line);
  transform: translateY(-130%);
  opacity: 0;
  transition: transform 0.5s var(--ease-out), opacity 0.3s ease;
}
:root[data-theme="dark"] .fp-push { background: #15305E; box-shadow: 0 10px 28px -8px rgba(0,0,0,0.6); }
.fp-push.is-shown { transform: translateY(0); opacity: 1; }
.fp-push-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 10px;
  color: var(--text-muted);
}
.fp-push-meta img { width: 14px; height: 14px; }
.fp-push b     { display: block; font-size: 12px; font-weight: 600; }
.fp-push small { display: block; margin-top: 1px; font-size: 10.5px; line-height: 1.35; color: var(--text-secondary); }

/* Android gesture bar */
.fp-gesture {
  flex: 0 0 auto;
  width: 96px;
  height: 4px;
  margin: 6px auto 8px;
  border-radius: 4px;
  background: var(--text-primary);
  opacity: 0.35;
}

.fp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px 10px;
}
.fp-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.4px; }
.fp-sub   { font-size: 11.5px; color: var(--text-muted); }
.fp-avatar {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-soft);
  border-radius: 50%;
}

.fp-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px;
  padding: 8px 11px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: background 0.3s ease, color 0.3s ease;
}
.fp-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.fp-pill[data-state="online"]  { background: var(--good-soft); color: var(--good); }
.fp-pill[data-state="offline"] { background: var(--warn-soft); color: var(--warn); }
.fp-pill[data-state="syncing"] { background: var(--accent-soft); color: var(--accent-text); }
.fp-pill[data-state="syncing"] .fp-pill-dot { animation: st-blink 0.7s ease-in-out infinite alternate; }


/* Tasks */
.fp-tasks {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 14px 0;
  overflow: hidden;
}
.fp-task {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--ph-line);
  border-radius: 12px;
  background: var(--ph-screen);
  transition: background 0.35s ease, border-color 0.35s ease;
}
.fp-task[hidden] { display: none; }
.fp-task[data-state="done"],
.fp-task[data-state="saved"] { background: var(--ph-card); border-color: transparent; }
.fp-task.is-new { animation: st-task-in 0.55s var(--ease-out) both; border-color: var(--accent-line); }

.fp-chip {
  flex-shrink: 0;
  min-width: 58px;
  margin-top: 1px;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  border-radius: 6px;
}
.fp-chip--collect  { background: var(--accent-soft); color: var(--accent-text); }
.fp-chip--disburse { background: var(--good-soft);   color: var(--good); }
.fp-chip--follow   { background: var(--warn-soft);   color: var(--warn); }
.fp-chip--verify   { background: var(--text-primary); color: var(--surface); }

.fp-task-body { min-width: 0; flex: 1; }
.fp-task-body b     { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.fp-task-body small { display: block; font-size: 10.5px; color: var(--text-muted); line-height: 1.35; }
.fp-task-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--accent-text);
}
.fp-task[data-state="saved"] .fp-task-state { color: var(--warn); }
.fp-task[data-state="done"]  .fp-task-state { color: var(--good); }

.fp-foot { padding: 10px 18px 10px; }
.fp-foot-row { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; }
.fp-meter { height: 6px; margin-top: 6px; overflow: hidden; background: var(--ph-line); border-radius: 99px; }
.fp-meter span { display: block; width: 0; height: 100%; background: var(--good); border-radius: 99px; transition: width 0.5s var(--ease-out); }

.fp-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 6px 12px;
  border-top: 1px solid var(--ph-line);
}
.fp-tabs span {
  display: grid;
  justify-items: center;
  gap: 2px;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text-muted);
}
.fp-tabs .ti { font-size: 17px; }
.fp-tabs .is-active { color: var(--accent-text); }
/* ─── Keyframes ───────────────────────────────────────────────────────── */
@keyframes st-blink   { from { opacity: 0.35; } to { opacity: 1; } }
@keyframes st-task-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .st-grid { grid-template-columns: minmax(0, 1fr); }
  .st-stage-frame { order: -1; justify-self: center; }
}
/* Phones: stack the phone under the map so neither shrinks too far */
@media (max-width: 600px) {
  .st-stage-frame { --st-w: 400; --st-h: 1112; max-width: 420px; }
  .st-card   { top: 0; }
  .fp-device { top: 588px; left: 66px; height: 520px; }   /* below the card, no overlap */
  .st-card-head, .st-legend { padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .st-cov-pulse { animation: none; opacity: 0; }
}
