/* Healthy Yucaipa Walks
   Layout: one readable column (phone-first) with park-sign plates for names and
   distances, a bottom tab bar on phones that moves into the header on wide screens. */

:root {
  --bg: oklch(97.4% 0.007 150);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(95.2% 0.012 150);
  --ink: oklch(24% 0.035 165);
  --muted: oklch(46% 0.025 165);
  --line: oklch(88.5% 0.016 155);
  --brand: oklch(38% 0.07 162);
  --brand-hover: oklch(33% 0.07 162);
  --brand-ink: oklch(98% 0.008 150);
  --sun: oklch(83% 0.15 84);
  --sun-soft: oklch(95% 0.05 90);
  --sun-ink: oklch(32% 0.07 70);
  --live: oklch(58% 0.2 30);
  --danger: oklch(51% 0.19 27);
  --ok: oklch(52% 0.12 155);
  --warn: oklch(55% 0.13 65);
  --stroll: #2f7dc6;
  --stride: #13917c;
  --power: #e0632a;
  --me: #1d4ed8;

  --font-display: "Overpass", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "Overpass Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.2rem;
  --text-xl: 1.5rem;
  --text-2xl: clamp(1.75rem, 6vw, 2.3rem);

  --radius: 14px;
  --radius-lg: 20px;
  --gutter: 16px;
  --tabbar-h: 66px;
  --shadow: 0 1px 2px oklch(20% 0.03 165 / 8%), 0 8px 24px oklch(20% 0.03 165 / 7%);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(17.5% 0.018 165);
    --surface: oklch(21.5% 0.02 165);
    --surface-2: oklch(25.5% 0.022 165);
    --ink: oklch(94.5% 0.012 150);
    --muted: oklch(74% 0.02 155);
    --line: oklch(33% 0.022 165);
    --brand: oklch(44% 0.075 162);
    --brand-hover: oklch(49% 0.08 162);
    --sun-soft: oklch(30% 0.05 85);
    --sun-ink: oklch(90% 0.08 88);
    --live: oklch(68% 0.18 32);
    --danger: oklch(66% 0.17 27);
    --ok: oklch(72% 0.13 155);
    --warn: oklch(80% 0.12 75);
    --shadow: 0 1px 2px oklch(0% 0 0 / 30%), 0 8px 24px oklch(0% 0 0 / 30%);
    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px);
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--brand); }
@media (prefers-color-scheme: dark) { a { color: var(--sun); } }
img, svg { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 2000; }
.skip:focus { left: 8px; }

.view {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px var(--gutter) 0;
  outline: none;
}

.loading, .empty { padding-block: 48px; text-align: center; color: var(--muted); }
.empty h1 { color: var(--ink); margin-bottom: 8px; }
.empty .btn { margin-top: 16px; }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hint { color: var(--muted); font-size: var(--text-sm); }
.hint--pad { padding: 4px 18px 18px; }
.fine { color: var(--muted); font-size: var(--text-sm); }
.link-quiet { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: var(--text-sm); }

/* ---------------------------------------------------------------- header + tabs */

.topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  /* Solid on purpose: a backdrop-filter here would trap the fixed tab bar inside the header. */
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--brand);
  color: var(--brand-ink);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.02em;
  box-shadow: inset 0 -5px 0 var(--sun), inset 0 0 0 2px oklch(100% 0 0 / 18%);
  padding-bottom: 4px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.brand-text span { font-size: var(--text-sm); color: var(--muted); }
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 600;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
}
.tabs a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  min-height: 52px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
}
.tabs a i { font-size: 1.55rem; }
.tabs a[aria-current="page"] { color: var(--brand); background: color-mix(in oklab, var(--brand) 10%, transparent); }
@media (prefers-color-scheme: dark) {
  .tabs a[aria-current="page"] { color: var(--sun); background: color-mix(in oklab, var(--sun) 12%, transparent); }
}

@media (min-width: 900px) {
  body { padding-bottom: 48px; }
  .topbar-inner { max-width: 1040px; }
  .tabs {
    position: static;
    display: flex;
    gap: 4px;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
  }
  .tabs a { flex-direction: row; gap: 8px; min-height: 44px; padding: 8px 14px; font-size: 0.95rem; }
  .tabs a i { font-size: 1.25rem; }
}

/* ---------------------------------------------------------------- buttons + chips */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms var(--ease), background-color 150ms var(--ease), border-color 150ms var(--ease);
}
.btn:hover { border-color: color-mix(in oklab, var(--ink) 30%, var(--line)); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn i { font-size: 1.2em; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn--big { width: 100%; min-height: 58px; font-size: 1.15rem; border-radius: 14px; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 0.92rem; }
.btn--danger { background: var(--danger); border-color: var(--danger); color: oklch(98% 0 0); }
.btn--ghost { background: transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-col { display: flex; flex-direction: column; gap: 10px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn i { font-size: 1.3rem; }
.link { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; cursor: pointer; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 9px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: 0.1em;
  color: var(--chip);
  background: color-mix(in oklab, var(--chip) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--chip) 35%, transparent);
}
.chip--stroll { --chip: var(--stroll); }
.chip--stride { --chip: var(--stride); }
.chip--power { --chip: var(--power); }
@media (prefers-color-scheme: dark) {
  .chip { color: color-mix(in oklab, var(--chip) 55%, white); }
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  vertical-align: 0.15em;
}
.tag--me { background: color-mix(in oklab, var(--me) 16%, transparent); color: var(--me); }
.tag--new { background: var(--sun-soft); color: var(--sun-ink); }
.tag--host { background: var(--brand); color: var(--brand-ink); }
@media (prefers-color-scheme: dark) { .tag--me { color: oklch(80% 0.1 265); } }

/* ---------------------------------------------------------------- sections */

.section { display: flex; flex-direction: column; gap: 12px; }
.section-title { font-size: var(--text-xl); font-weight: 800; }
.section-lede { color: var(--muted); max-width: 60ch; }
.page-head { display: flex; flex-direction: column; gap: 8px; }
.page-head h1 { font-size: var(--text-2xl); font-weight: 900; }
.page-head--row { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.card-title { font-size: var(--text-lg); font-weight: 800; }

.banner { padding: 12px 14px; border-radius: 12px; font-size: var(--text-sm); }
.banner--warn { background: var(--sun-soft); color: var(--sun-ink); }

/* ---------------------------------------------------------------- happening now (Today) */

.now { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.now-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--live);
}
.now-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.now-walk {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 2px solid color-mix(in oklab, var(--live) 50%, var(--line));
  box-shadow: var(--shadow);
}
.host-block {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--sun-soft);
  color: var(--sun-ink);
  font-size: 1.05rem;
}
.host-block i { font-size: 1.7rem; flex-shrink: 0; }
.host-note { display: block; font-size: 0.95rem; margin-top: 2px; }
.sheet-inner > .host-block { margin-top: 0; }
.now-people { margin-top: 14px; }
.now-people-title { font-weight: 800; font-family: var(--font-display); margin-bottom: 6px; }
.now-people-empty { margin-top: 12px; color: var(--muted); }
.name-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.name-chip { padding: 5px 11px; border-radius: 999px; background: var(--surface-2); font-size: 0.95rem; }
.name-chip small { font-weight: 700; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.85; }
.name-chip--host { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.name-chip--more { color: var(--muted); }
.now-host-actions .btn { flex: 1 1 150px; }
.map--host { margin-top: 10px; }
.host-map-note { padding: 8px 18px 0; }
.location-notice { display: flex; gap: 8px; align-items: flex-start; }
.location-notice i { font-size: 1.2rem; flex-shrink: 0; }
.now-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.dot-name { padding: 1px 6px; font-size: 12px; font-weight: 700; }
.now-walk h2 { font-size: var(--text-2xl); font-weight: 900; }
.now-meta { color: var(--muted); margin-top: 6px; }
.now-walk .link { margin-top: 6px; font-size: var(--text-sm); }
.now-in { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.now-in i { color: var(--ok); font-size: 1.5rem; flex-shrink: 0; }
.btn--join { width: 100%; min-height: 72px; font-size: 1.4rem; border-radius: 16px; font-weight: 800; }

/* ---------------------------------------------------------------- walk card (Today) */

.walk-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.walk-card.is-live { border-color: color-mix(in oklab, var(--live) 45%, var(--line)); }
.walk-card__body { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.walk-card__cta { gap: 12px; }
.walk-title { font-size: var(--text-2xl); font-weight: 900; }
.walk-meta, .walk-when { color: var(--muted); }
.walk-when strong { color: var(--ink); }
.soon {
  display: inline-block;
  margin-left: 4px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: var(--text-sm);
  color: var(--ink);
}

.live-pill {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  padding: 3px 11px 3px 9px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--live) 14%, transparent);
  color: var(--live);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--live) 60%, transparent);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: var(--text-sm); }
.note i { font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }
.note--night { background: color-mix(in oklab, #3b4a8a 13%, transparent); }
.note--sun { background: var(--sun-soft); color: var(--sun-ink); }

.map { width: 100%; background: var(--surface-2); z-index: 0; }
.map--card { height: 270px; }
.map--tall { height: min(56vh, 520px); min-height: 300px; border-radius: var(--radius-lg); border: 1px solid var(--line); }
.map--pick { height: 300px; border-radius: var(--radius); border: 1px solid var(--line); }

.legend {
  list-style: none;
  margin: 0;
  padding: 12px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--text-sm);
}
.legend li { display: grid; grid-template-columns: 22px auto minmax(0, 1fr); align-items: center; gap: 8px; }
.legend-line { width: 22px; height: 5px; border-radius: 3px; }
.legend-line--stroll { background: var(--stroll); }
.legend-line--stride { background: var(--stride); }
.legend-line--power { background: var(--power); }

.you { font-size: 1.02rem; }
.you--done { display: flex; gap: 8px; align-items: flex-start; }
.you--done i { color: var(--ok); font-size: 1.5rem; flex-shrink: 0; }
.buddy {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--sun-soft);
  color: var(--sun-ink);
}
.buddy i { font-size: 1.35rem; flex-shrink: 0; }

.live-list { border-top: 1px solid var(--line); padding: 4px 0 6px; }
.pace-list h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 18px 6px;
  font-size: 1rem;
  font-weight: 700;
}
.pace-list h3 span:not(.chip) { color: var(--muted); font-family: var(--font-body); font-weight: 400; font-size: var(--text-sm); }
.pace-list ul { list-style: none; margin: 0; padding: 0; }
.walker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 92px;
  align-items: center;
  gap: 12px;
  padding: 7px 18px;
  font-size: 0.95rem;
}
.walker--me { background: color-mix(in oklab, var(--me) 7%, transparent); }
.walker-name { min-width: 0; }
.walker-name small { display: block; color: var(--muted); font-size: 0.8rem; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--bar, var(--brand)); transition: width 600ms var(--ease); }
.pace-list--stroll { --bar: var(--stroll); }
.pace-list--stride { --bar: var(--stride); }
.pace-list--power { --bar: var(--power); }
.val { text-align: right; font-family: var(--font-num); font-size: 0.86rem; white-space: nowrap; }
.val--done { color: var(--ok); font-weight: 600; }
.val--muted { color: var(--muted); font-family: var(--font-body); }
.val small { display: block; font-family: var(--font-num); font-size: 0.78rem; }

/* ---------------------------------------------------------------- park sign (meet + routes) */

.meet { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 620px) { .meet { grid-template-columns: 220px minmax(0, 1fr); align-items: start; } }
.meet-text { display: flex; flex-direction: column; gap: 10px; }

.sign {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px 18px;
  border-radius: 12px;
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: inset 0 0 0 3px var(--brand), inset 0 0 0 5px oklch(100% 0 0 / 55%);
  font-family: var(--font-display);
}
.sign-kicker { font-weight: 800; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sun); }
.sign-main { font-weight: 900; font-size: 1.6rem; text-transform: uppercase; letter-spacing: 0.01em; line-height: 1.05; }
.sign-sub { font-weight: 600; opacity: 0.85; }

/* ---------------------------------------------------------------- pace cards */

.paces { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 700px) { .paces { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pace {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.pace header { display: flex; gap: 12px; align-items: center; }
.pace header p { color: var(--muted); font-size: var(--text-sm); }
.pace h3 { font-size: 1.25rem; font-weight: 800; }
.pace-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  color: white;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  background: var(--pace);
}
.pace-mark svg { width: 22px; height: 22px; fill: white; }
.pace--stroll { --pace: var(--stroll); }
.pace--stride { --pace: var(--stride); }
.pace--power { --pace: var(--power); }
.pace-facts { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--text-sm); }
.pace-facts div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; }
.pace-facts dt { color: var(--muted); }
.pace-facts dd { margin: 0; }

/* ---------------------------------------------------------------- icebreaker */

.ice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--sun-soft);
  color: var(--sun-ink);
}
.ice .eyebrow, .ice .hint { color: inherit; opacity: 0.8; }
.ice-q { font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; line-height: 1.2; text-wrap: balance; }
.ice--inline { padding: 16px; }
.ice--inline .ice-q { font-size: 1.15rem; }
.ice .btn { background: transparent; border-color: color-mix(in oklab, var(--sun-ink) 30%, transparent); color: inherit; }

/* ---------------------------------------------------------------- group goal */

.goal-figure { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.goal-big { font-family: var(--font-display); font-weight: 900; font-size: 2.6rem; line-height: 1; }
.goal-of { color: var(--muted); }
.goal-track {
  position: relative;
  height: 12px;
  margin: 26px 12px 6px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.goal-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--stride)); }
.goal-stop {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  border: 2px solid var(--muted);
}
.goal-stop.is-passed { border-color: var(--brand-ink); background: var(--brand); }
.goal-you {
  position: absolute;
  bottom: 100%;
  transform: translate(-50%, -2px);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sun);
  color: oklch(25% 0.05 70);
  font-size: 1.1rem;
  box-shadow: var(--shadow);
}
.goal-stops {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0 20px;
  font-size: 0.95rem;
}
.goal-stops li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.goal-stops li.is-passed { color: var(--ink); }
.goal-stops li.is-passed i { color: var(--ok); }
.goal-stops li.is-next { color: var(--ink); font-weight: 700; }

.schedule { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.schedule li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.sched-day { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.sched-time { font-family: var(--font-num); }

/* ---------------------------------------------------------------- routes */

.route-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
}
.chip-btn[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 2px solid white; box-shadow: 0 0 0 1px var(--line); }

.routes { display: flex; flex-direction: column; gap: 18px; }
.route {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 0 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.route > :not(.route-sign) { margin-inline: 18px; }
.route .btn { align-self: flex-start; }
.route-sign {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 18px;
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: inset 0 -6px 0 var(--route);
}
.route-sign h2 { font-size: 1.35rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.01em; }
.route-dist {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--sun);
  color: oklch(24% 0.05 70);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.route-dist small { font-size: 0.7rem; letter-spacing: 0.08em; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px 16px; }
.facts dt { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.facts dd { margin: 0; font-size: 0.95rem; }
.est h3, .times h3 { font-size: 1rem; font-weight: 800; margin-bottom: 6px; }
.est ul, .typical { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.95rem; }
.est li, .typical li { display: flex; align-items: center; gap: 6px; }
.times { display: flex; flex-direction: column; gap: 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); font-family: var(--font-body); font-size: 0.78rem; }

/* ---------------------------------------------------------------- anywhere */

.choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 600px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 18px;
  text-align: left;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 150ms var(--ease), transform 150ms var(--ease);
}
.choice:hover { border-color: var(--brand); }
.choice:active { transform: scale(0.99); }
.choice i { font-size: 2rem; color: var(--brand); margin-bottom: 4px; }
@media (prefers-color-scheme: dark) { .choice i { color: var(--sun); } }
.choice strong { font-family: var(--font-display); font-size: 1.15rem; }
.choice span { color: var(--muted); font-size: 0.92rem; }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--muted); }

/* ---------------------------------------------------------------- forms */

.form { display: flex; flex-direction: column; gap: 16px; }
.form--inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.form--inline .field { flex: 1 1 220px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-weight: 700; }
.field em { font-weight: 400; font-style: normal; color: var(--muted); }
.field small { color: var(--muted); font-size: 0.85rem; }
.field input, .field select, select {
  min-height: 50px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  width: 100%;
  font-size: 1rem;
}
.field input:focus, select:focus { border-color: var(--brand); outline: 3px solid color-mix(in oklab, var(--brand) 25%, transparent); outline-offset: 0; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.field-row:has(.field--short) { grid-template-columns: minmax(0, 1fr) 110px; }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--brand); flex-shrink: 0; }

.seg { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.seg legend { width: 100%; }
.seg label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  cursor: pointer;
}
.seg label:has(input:checked) { border-color: var(--brand); background: color-mix(in oklab, var(--brand) 10%, transparent); }
.seg input { accent-color: var(--brand); }

.pace-pick { gap: 8px; }
.pace-option {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-areas: "radio name" "radio detail";
  column-gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  cursor: pointer;
}
.pace-option input { grid-area: radio; width: 22px; height: 22px; margin: 0; accent-color: var(--opt); }
.pace-option__name { grid-area: name; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.pace-option__detail { grid-area: detail; color: var(--muted); font-size: 0.9rem; }
.pace-option:has(input:checked) { border-color: var(--opt); background: color-mix(in oklab, var(--opt) 9%, transparent); }
.pace-option--stroll { --opt: var(--stroll); }
.pace-option--stride { --opt: var(--stride); }
.pace-option--power { --opt: var(--power); }

.plan { gap: 10px; }
.plan-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 76px; gap: 8px; align-items: center; }
.plan-row select { min-height: 46px; padding: 8px 10px; }
.start-label { display: flex; gap: 8px; align-items: flex-start; font-size: 0.95rem; }
.start-label i { color: var(--live); font-size: 1.2rem; margin-top: 2px; }

.you-are { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.confirm { width: 100%; font-weight: 700; }
.form-error {
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--danger) 13%, transparent);
  color: var(--danger);
  font-weight: 700;
}
.transfer-code {
  font-family: var(--font-num);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  word-break: break-all;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  user-select: all;
}
.organizer summary { cursor: pointer; color: var(--muted); font-size: var(--text-sm); }
.organizer form { margin-top: 12px; }
.people-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 18px 0;
  font-size: 1.3rem;
  font-weight: 900;
}
.people-count {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 1rem;
}
.usage { display: grid; gap: 6px; font-size: 0.95rem; }
.usage div { display: flex; justify-content: space-between; gap: 12px; }

/* ---------------------------------------------------------------- me */

.me-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.me-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.me-head h1 { font-size: var(--text-2xl); font-weight: 900; }
.me-head p { color: var(--muted); }
.avatar {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: var(--brand);
  color: var(--brand-ink);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.4rem;
  box-shadow: inset 0 -6px 0 var(--sun);
  padding-bottom: 5px;
}
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.walk-card .tile { background: var(--surface-2); border-color: transparent; }
.tile-val { font-family: var(--font-display); font-weight: 900; font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-label { color: var(--muted); font-size: 0.85rem; }

.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px;
  border-radius: 14px;
  border: 1.5px dashed var(--line);
  color: var(--muted);
}
.badge.is-earned { border-style: solid; border-color: color-mix(in oklab, var(--sun) 60%, var(--line)); background: var(--sun-soft); color: var(--sun-ink); }
.badge-icon { font-size: 1.9rem; line-height: 1; margin-bottom: 4px; }
.badge-name { font-family: var(--font-display); font-weight: 800; color: var(--ink); }
.badge.is-earned .badge-name { color: inherit; }
.badge-desc { font-size: 0.85rem; }
.badges--row { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

.bests, .history { list-style: none; margin: 0; padding: 0; }
.bests li, .history li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bests small, .history small { color: var(--muted); }
.history li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; }
.history-date { color: var(--muted); font-size: 0.9rem; }
.history-num { font-size: 0.85rem; white-space: nowrap; }

/* ---------------------------------------------------------------- QR + sheet + toast */

.qr { width: min(260px, 100%); padding: 14px; background: white; border-radius: 16px; border: 1px solid var(--line); }
.qr svg { display: block; width: 100%; height: auto; }
.qr-url { font-family: var(--font-num); font-size: 0.85rem; color: var(--muted); word-break: break-all; }

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.sheet::backdrop { background: oklch(15% 0.02 165 / 55%); }
.sheet[open] { animation: rise 280ms var(--ease); }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 22px; } }
.sheet-inner { display: flex; flex-direction: column; gap: 16px; padding: 20px var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px)); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-head h2 { font-size: 1.5rem; font-weight: 900; }

.finish { display: flex; flex-direction: column; gap: 14px; align-items: stretch; text-align: center; }
.finish h2 { font-size: 2rem; font-weight: 900; }
.finish-mark {
  align-self: center;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--sun);
  color: oklch(24% 0.05 70);
  font-size: 2.2rem;
}
.finish-route { color: var(--muted); }
.finish-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.finish-stats div { display: flex; flex-direction: column; padding: 12px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.finish-stats strong { font-size: 1rem; white-space: nowrap; }
.pb { padding: 10px 12px; border-radius: 12px; background: color-mix(in oklab, var(--ok) 14%, transparent); font-weight: 700; }
.new-badges { text-align: left; }
.finish .ice { text-align: left; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
  transform: translateX(-50%);
  z-index: 3000;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow);
  font-size: 0.95rem;
}
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---------------------------------------------------------------- walk screen */

.is-walking { overflow: hidden; }
.walk-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-top: env(safe-area-inset-top, 0px);
}
.walk-top { display: flex; gap: 12px; align-items: center; padding: 10px var(--gutter); }
.walk-top h2 { font-size: 1.2rem; font-weight: 800; }
.map--walk { flex: 1; min-height: 200px; }
.walk-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px var(--gutter) calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--line);
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.walk-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.walk-stats > div { display: flex; flex-direction: column; }
.stat-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stat-val { font-size: 1.9rem; font-weight: 600; line-height: 1.1; }
.stat-unit { font-size: 0.85rem; color: var(--muted); }
.walk-progress { position: relative; height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.walk-progress > i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: inherit; transition: width 500ms var(--ease); }
.lap-tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--surface); }
.gps { font-size: 0.88rem; color: var(--muted); min-height: 1.3em; }
.gps[data-tone="ok"]::before { content: "● "; color: var(--ok); }
.gps[data-tone="warn"] { color: var(--warn); }
.walk-actions { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.walk-actions .btn--big { min-height: 56px; }
.walk-actions .confirm { grid-column: 1 / -1; }
.sim-btn { align-self: center; }

#walk-mini {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 700;
  max-width: 560px;
  margin: 0 auto;
}
@media (min-width: 900px) { #walk-mini { bottom: 20px; } }
.walk-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 0;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.walk-mini strong { margin-left: auto; color: var(--sun); }

/* ---------------------------------------------------------------- map markers */

.leaflet-container { font-family: var(--font-body); }
.pin-start { position: relative; }
.pin-start__flag {
  position: absolute;
  left: 0;
  bottom: 22px;
  padding: 3px 8px;
  border-radius: 6px 6px 6px 0;
  background: var(--brand);
  color: white;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: inset 0 -3px 0 var(--sun), 0 2px 6px rgb(0 0 0 / 35%);
}
.pin-start__pole { position: absolute; left: -1px; bottom: 0; width: 3px; height: 24px; background: white; border-radius: 2px; box-shadow: 0 0 0 1px rgb(0 0 0 / 30%); }
.pin-amenity {
  display: grid !important;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: #1f4d3c;
  border: 2px solid #1f4d3c;
  font-size: 14px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 35%);
}
.leaflet-tooltip { font-family: var(--font-body); font-weight: 700; }

/* ---------------------------------------------------------------- print sign */

.print-sign { display: none; }
@media print {
  @page { margin: 0.5in; }
  body { background: white; color: black; padding: 0; }
  body > *:not(.print-sign) { display: none !important; }
  .print-sign {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    color: #123526;
    font-family: var(--font-display);
  }
  .ps-kicker { font-size: 28pt; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
  .ps-title { font-size: 60pt; font-weight: 900; text-transform: uppercase; line-height: 1; }
  .ps-sub { font-size: 20pt; font-family: var(--font-body); }
  .ps-qr { width: 4.6in; padding: 0.15in; border: 6px solid #1f4d3c; border-radius: 0.2in; }
  .ps-qr svg { width: 100%; height: auto; display: block; }
  .ps-sched { font-size: 24pt; font-weight: 800; }
  .ps-foot { font-size: 14pt; font-family: var(--font-body); }
}

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