/* =========================================================================
   Sway, Public Family Web Tracker
   Neon / cyber aesthetic. Palette extracted from the Sway logo (S-road that
   gradients cobalt-blue -> teal -> green). Mobile-first, glassmorphic, dark.
   ========================================================================= */

:root {
  /* Brand hues (from logo) */
  --brand-blue: #0054B6;
  --brand-blue-bright: #008CE0;
  --brand-teal: #008C70;
  --brand-green: #1CA854;
  --brand-green-bright: #38B638;

  /* Neon accents */
  --neon-blue: #22B0FF;
  --neon-cyan: #2BE0D0;
  --neon-green: #2BE06A;

  /* Base */
  --bg0: #05070E;
  --bg1: #0A0E1A;
  --surface: #0E1422;
  --surface-hi: #141C2E;

  /* Glass */
  --glass-fill: rgba(255, 255, 255, 0.055);
  --glass-fill-strong: rgba(255, 255, 255, 0.10);
  --glass-border: rgba(255, 255, 255, 0.14);

  /* Text */
  --text-hi: #F2F6FF;
  --text-mid: #AFBCD4;
  --text-lo: #6C7A95;

  /* Semantic */
  --healthy: #2BE06A;
  --healthy-deep: #1CA854;
  --due: #FFB02E;
  --due-deep: #E08A00;
  --alert: #FF2D4B;
  --alert-deep: #C10E2A;
  --sos: #FF0040;
  --sos-deep: #B3001B;
  --completed: #22B0FF;
  --neutral: #6C7A95;

  /* Live accent, re-pointed per state */
  --accent: var(--neon-green);
  --accent-deep: var(--healthy-deep);
  --accent-soft: rgba(43, 224, 106, 0.16);

  /* Layout */
  --maxw: 760px;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow-card: 0 18px 60px rgba(0, 0, 0, 0.55);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg0);
  color: var(--text-hi);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  transition: background-color 1.1s ease;
}

/* Alert mode: deliberate background wash toward red */
body.is-alert {
  background: #0c0407;
}

h1, h2, h3, .display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: var(--neon-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--text-mid); }
.tiny { font-size: 0.78rem; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------------------------------------------------------------- backdrop */
.bg-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-glow {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  transition: background 1.1s ease, opacity 1.1s ease;
}
.bg-glow--top {
  top: -30vmax;
  left: -20vmax;
  background: radial-gradient(circle, rgba(0, 84, 182, 0.55), transparent 65%);
}
.bg-glow--bottom {
  bottom: -34vmax;
  right: -22vmax;
  background: radial-gradient(circle, rgba(28, 168, 84, 0.40), transparent 65%);
}
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 80%);
}
.alert-wash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 120%, rgba(255, 45, 75, 0.45), transparent 60%);
  opacity: 0;
  transition: opacity 1.1s ease;
}
body.is-alert .alert-wash { opacity: 1; }
body.is-alert .bg-glow--top {
  background: radial-gradient(circle, rgba(193, 14, 42, 0.45), transparent 65%);
}
body.is-alert .bg-glow--bottom {
  background: radial-gradient(circle, rgba(255, 45, 75, 0.40), transparent 65%);
}

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 18px 12px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(5, 7, 14, 0.85), rgba(5, 7, 14, 0.25));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-hi);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 10px rgba(34, 176, 255, 0.55));
}
.brand-word {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  background: linear-gradient(100deg, var(--neon-blue), var(--neon-cyan), var(--neon-green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar-tag {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-lo);
  padding: 4px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass-fill);
}

/* ---------------------------------------------------------------- layout */
.app {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 16px 40px;
  flex: 1 0 auto;
}

.footer {
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: 16px 16px calc(20px + var(--safe-bottom));
  font-size: 0.72rem;
  color: var(--text-lo);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.footer .dot { opacity: 0.5; }
.footer a { color: var(--text-mid); }

/* ---------------------------------------------------------------- cards */
.card {
  position: relative;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.25), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.card--glow { box-shadow: var(--shadow-card), 0 0 40px var(--accent-soft); }
.card--glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid var(--accent);
  opacity: 0.35;
  pointer-events: none;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-lo);
  margin-bottom: 12px;
}
.section-label svg { width: 14px; height: 14px; opacity: 0.8; }

/* ---------------------------------------------------------------- hero / status */
.hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.hero-route {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  font-weight: 700;
  line-height: 1.1;
}
.hero-route .arrow {
  color: var(--accent);
  margin: 0 6px;
  filter: drop-shadow(0 0 8px var(--accent));
}
.hero-sub { color: var(--text-mid); font-size: 0.95rem; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  white-space: nowrap;
}
.status-chip .pulse-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse-ring 1.8s infinite;
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 var(--accent-soft); }
  70%  { box-shadow: 0 0 0 9px rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

/* ---------------------------------------------------------------- countdown */
.countdown {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(120deg, var(--accent-soft), transparent);
  border: 1px solid var(--glass-border);
}
.ring {
  --pct: 0;
  width: 76px; height: 76px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(closest-side, var(--surface) 70%, transparent 71%),
    conic-gradient(var(--accent) calc(var(--pct) * 1%), rgba(255, 255, 255, 0.08) 0);
  box-shadow: 0 0 20px var(--accent-soft);
  transition: background 0.6s linear;
}
.ring span {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text-hi);
  text-align: center;
  line-height: 1.05;
}
.countdown-body { min-width: 0; }
.countdown-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--text-hi);
}
.countdown-value.is-overdue { color: var(--alert); }
.countdown-label { color: var(--text-mid); font-size: 0.85rem; }

/* ---------------------------------------------------------------- key/value */
.kv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}
.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.kv:last-child { border-bottom: none; }
.kv-key {
  color: var(--text-lo);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.kv-val {
  text-align: right;
  font-weight: 600;
  color: var(--text-hi);
  word-break: break-word;
}
.kv-val.accent { color: var(--accent); }

/* Big plate badge */
.plate {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 1.35rem;
  padding: 8px 16px;
  border-radius: 10px;
  background: #0d1626;
  border: 1.5px solid var(--accent);
  color: var(--text-hi);
  box-shadow: 0 0 18px var(--accent-soft);
  text-transform: uppercase;
}

.plate-photo {
  margin-top: 12px;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  display: block;
}

/* ---------------------------------------------------------------- map */
.map-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}
.map {
  width: 100%;
  height: 320px;
  background: #0a0e1a;
}
.map .leaflet-control-attribution {
  background: rgba(5, 7, 14, 0.7);
  color: var(--text-lo);
  font-size: 10px;
}
.map .leaflet-control-attribution a { color: var(--text-mid); }
.map-empty {
  display: grid;
  place-items: center;
  height: 320px;
  color: var(--text-lo);
  text-align: center;
  padding: 24px;
}

/* Pulsing latest-position marker (DivIcon) */
.live-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 var(--accent);
  animation: live-pulse 1.8s infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(43, 224, 106, 0.55); }
  70%  { box-shadow: 0 0 0 16px rgba(43, 224, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(43, 224, 106, 0); }
}
body.is-alert .live-dot { background: var(--alert); }
body.is-alert .live-dot {
  animation-name: live-pulse-alert;
}
@keyframes live-pulse-alert {
  0%   { box-shadow: 0 0 0 0 rgba(255, 45, 75, 0.6); }
  70%  { box-shadow: 0 0 0 16px rgba(255, 45, 75, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 45, 75, 0); }
}
.crumb-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(43, 224, 106, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
body.is-alert .crumb-dot { background: rgba(255, 45, 75, 0.85); }

.last-seen {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-mid);
  font-size: 0.9rem;
}
.last-seen .blip {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
}

/* ---------------------------------------------------------------- ALERT */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(255, 45, 75, 0.22), rgba(193, 14, 42, 0.12));
  border: 1.5px solid var(--alert);
  box-shadow: 0 0 40px rgba(255, 45, 75, 0.30);
  animation: banner-slide 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes banner-slide {
  from { opacity: 0; transform: translateY(26px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.alert-banner .bolt {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--alert);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(255, 45, 75, 0.6);
  animation: pulse-ring-alert 1.6s infinite;
}
@keyframes pulse-ring-alert {
  0%   { box-shadow: 0 0 0 0 rgba(255, 45, 75, 0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(255, 45, 75, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 45, 75, 0); }
}
.alert-banner .bolt svg { width: 24px; height: 24px; }
.alert-banner-text h2 {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 2px;
}
.alert-banner-text p { margin: 0; color: #ffd2da; font-size: 0.9rem; }

/* Large plate in alert */
.alert-focus {
  text-align: center;
  padding: 24px 18px;
}
.alert-focus .plate-xl {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: clamp(2.2rem, 11vw, 3.4rem);
  padding: 14px 22px;
  border-radius: 14px;
  background: #15060a;
  border: 2px solid var(--alert);
  color: #fff;
  box-shadow: 0 0 30px rgba(255, 45, 75, 0.35);
  display: inline-block;
  text-transform: uppercase;
}
.alert-focus .alert-focus-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ff8a9c;
}
.alert-focus .loc {
  margin-top: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--text-hi);
  font-size: 1.05rem;
}
.alert-focus .loc small { color: var(--text-mid); display: block; font-size: 0.78rem; margin-top: 4px; }

/* Playbook */
.playbook {
  margin-bottom: 16px;
}
.playbook .section-label { color: #ff8a9c; }
.playbook-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.call-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 18px;
  border-radius: 16px;
  border: 1.5px solid var(--glass-border);
  background: var(--glass-fill-strong);
  color: var(--text-hi);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
  animation: call-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.call-btn:hover { text-decoration: none; transform: translateY(-2px); }
.call-btn:active { transform: scale(0.985); }
.call-btn .ic {
  width: 46px; height: 46px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.call-btn .ic svg { width: 22px; height: 22px; }
.call-btn .label-wrap { display: flex; flex-direction: column; min-width: 0; }
.call-btn .label-wrap .who { font-size: 0.74rem; color: var(--text-mid); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.call-btn .label-wrap .num { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.call-btn .chev { margin-left: auto; color: var(--text-lo); }

/* primary = traveler, dominant red */
.call-btn--primary {
  background: linear-gradient(120deg, var(--alert), var(--alert-deep));
  border-color: var(--alert);
  box-shadow: 0 14px 36px rgba(255, 45, 75, 0.4);
  color: #fff;
}
.call-btn--primary .ic { background: rgba(255, 255, 255, 0.18); color: #fff; }
.call-btn--primary .label-wrap .who { color: #ffd2da; }
.call-btn--primary .chev { color: rgba(255, 255, 255, 0.7); }
.call-btn--operator .ic { background: rgba(34, 176, 255, 0.18); color: var(--neon-blue); }
.call-btn--frsc .ic { background: rgba(255, 176, 46, 0.18); color: var(--due); }
.call-btn--emergency {
  border-color: var(--alert);
  box-shadow: 0 0 24px rgba(255, 45, 75, 0.22);
}
.call-btn--emergency .ic { background: rgba(255, 45, 75, 0.2); color: var(--alert); }
.call-btn--security .ic { background: rgba(43, 224, 208, 0.18); color: var(--neon-cyan); }

/* ===========================================================================
   SOS, a louder, distinct state ABOVE the gone-quiet alert.
   =========================================================================== */
body.is-sos { background: #14000a; }
body.is-sos .bg-glow--top { background: radial-gradient(circle, rgba(255,0,64,0.30), transparent 60%); opacity: 1; }
body.is-sos .bg-glow--bottom { background: radial-gradient(circle, rgba(255,0,64,0.18), transparent 60%); opacity: 1; }
body.is-sos .live-dot, body.is-sos .crumb-dot { background: var(--sos); }

.sos-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 18px; margin-bottom: 14px; border-radius: 20px;
  background: linear-gradient(120deg, var(--sos), var(--sos-deep));
  border: 1.5px solid #ff5e83;
  box-shadow: 0 16px 50px rgba(255, 0, 64, 0.5);
  animation: sosPulse 1.1s ease-in-out infinite;
}
@keyframes sosPulse {
  0%, 100% { box-shadow: 0 16px 50px rgba(255, 0, 64, 0.42); }
  50% { box-shadow: 0 16px 64px rgba(255, 0, 64, 0.72); }
}
.sos-banner .bolt {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.22);
}
.sos-banner .bolt svg { width: 26px; height: 26px; color: #fff; }
.sos-banner-text h2 { margin: 0 0 2px; font-size: 1.18rem; color: #fff; letter-spacing: -0.01em; }
.sos-banner-text p { margin: 0; color: #ffe0e8; font-size: 0.92rem; }

/* call buttons pinned at the very top, the dominant, easily-tapped elements */
.sos-calls { display: grid; gap: 12px; margin-bottom: 14px; }
@media (min-width: 460px) { .sos-calls { grid-template-columns: 1fr 1fr; } }
.big-call {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; border-radius: 18px; text-decoration: none;
  min-height: 72px; color: #fff;
  background: linear-gradient(120deg, var(--sos), var(--sos-deep));
  border: 1.5px solid #ff5e83;
  box-shadow: 0 14px 40px rgba(255, 0, 64, 0.45);
  transition: transform 0.12s ease;
}
.big-call:active { transform: scale(0.98); }
.big-call .ic {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.2);
}
.big-call .ic svg { width: 24px; height: 24px; color: #fff; }
.big-call-label { display: flex; flex-direction: column; min-width: 0; }
.big-call-label .who { font-size: 0.82rem; color: #ffe0e8; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.big-call-label .num { font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.big-call--emergency { background: linear-gradient(120deg, #ff2d4b, #b3001b); }

.card--sos { border-color: rgba(255, 0, 64, 0.5); box-shadow: 0 12px 44px rgba(255, 0, 64, 0.22); }

/* calm "SOS raised then cleared" notice on an otherwise-normal page */
.sos-cleared {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; margin-bottom: 14px; border-radius: 16px;
  background: rgba(255, 45, 75, 0.08);
  border: 1px solid rgba(255, 45, 75, 0.35);
  color: var(--text-hi); font-size: 0.9rem; line-height: 1.4;
}
.sos-cleared .ic {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 45, 75, 0.16); color: var(--alert);
}
.sos-cleared .ic svg { width: 18px; height: 18px; }
.sos-cleared strong { color: var(--alert); }

@keyframes call-rise {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}
.playbook-grid .call-btn:nth-child(1) { animation-delay: 0.02s; }
.playbook-grid .call-btn:nth-child(2) { animation-delay: 0.08s; }
.playbook-grid .call-btn:nth-child(3) { animation-delay: 0.14s; }
.playbook-grid .call-btn:nth-child(4) { animation-delay: 0.20s; }
.playbook-grid .call-btn:nth-child(5) { animation-delay: 0.26s; }

/* ---------------------------------------------------------------- completed */
.arrived {
  text-align: center;
  padding: 30px 20px;
}
.arrived .check {
  width: 76px; height: 76px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  box-shadow: 0 0 30px var(--accent-soft);
}
.arrived .check svg { width: 38px; height: 38px; }
.arrived h2 { font-size: 1.6rem; margin-bottom: 6px; }
.arrived p { color: var(--text-mid); margin: 0; }

/* ---------------------------------------------------------------- states */
.state {
  text-align: center;
  padding: 60px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.state .state-ic {
  width: 84px; height: 84px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  color: var(--text-mid);
}
.state .state-ic svg { width: 40px; height: 40px; }
.state h2 { font-size: 1.5rem; }
.state p { color: var(--text-mid); max-width: 42ch; margin: 0 auto; }
.state .help-call {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill-strong);
  color: var(--text-hi);
  font-weight: 600;
  text-decoration: none;
}

.loader-ring {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--neon-blue);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton shimmer for re-renders */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* Soft value update flash */
.flash {
  animation: flash 0.9s ease;
}
@keyframes flash {
  0%   { color: var(--accent); text-shadow: 0 0 12px var(--accent); }
  100% { }
}

/* Live refresh tick */
.refresh-tick {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  color: var(--text-lo);
  margin: 0 auto 14px;
  width: fit-content;
}
.refresh-tick .live-led {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: led 2s infinite;
}
@keyframes led { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------------------------------------------------------------- responsive */
@media (min-width: 620px) {
  .app { padding: 26px 22px 48px; }
  .map { height: 380px; }
  .kv-grid { grid-template-columns: 1fr 1fr; column-gap: 28px; }
  .kv-grid .kv.full { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* real logo in the header (replaces the old invented mark) */
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px; object-fit: cover;
  box-shadow: 0 0 14px rgba(34, 176, 255, 0.4);
}
