* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 16px/1.5 var(--font); font-weight: 500;
  color: var(--ink); -webkit-font-smoothing: none; font-smooth: never; }
body { display: flex; flex-direction: column; height: 100dvh; background: var(--bg);
  image-rendering: pixelated; }
button { font: inherit; cursor: pointer; color: var(--ink); }

/* pixel bevel helpers */
.bevel { border: 3px solid var(--border-dark);
  box-shadow: inset 3px 3px 0 var(--hi), inset -3px -3px 0 var(--lo), 4px 4px 0 rgba(0,0,0,.22); }
.bevel-btn { border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo), 3px 3px 0 var(--lo); }
.bevel-btn:active { box-shadow: inset -2px -2px 0 var(--hi), inset 2px 2px 0 var(--lo);
  transform: translate(2px, 2px); }

/* ---------- header ---------- */
header {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3); background: var(--bg); color: var(--on-dark);
  border-bottom: 3px solid var(--border-dark);
}
.brand { font-family: var(--font-display); font-weight: 700; font-size: 20px; white-space: nowrap; }
.count { font-size: 14px; color: var(--on-dark-soft); white-space: nowrap; }
/* On phones the header is tight (brand + buttons + name+avatar chip); drop the
   spot count, tighten gaps, and cap the name so it can't overflow. */
@media (max-width: 480px) {
  .count { display: none; }
  header { gap: 5px; }
  header .icon-btn { padding: 0 var(--sp-2); }
}
.sync-status { font-size: 12px; font-weight: 700; padding: 2px 7px; white-space: nowrap;
  border: 2px solid var(--border-dark); color: var(--ink); cursor: pointer;
  box-shadow: inset 1px 1px 0 var(--hi), inset -1px -1px 0 var(--lo); }
.sync-status.syncing, .sync-status.pending { background: var(--status-addressed); }
.sync-status.offline { background: var(--surface-2); }
.sync-status.failed { background: var(--status-flagged); color: var(--on-dark); }
.spacer { margin-left: auto; }
/* [hidden] must beat any explicit display (e.g. .icon-btn below) — otherwise the
   admin-only Review button, which ships hidden, shows for everyone. */
[hidden] { display: none !important; }

.locate, .icon-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 var(--sp-3);
  background: var(--status-clean); color: var(--ink); border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo);
  font-size: 15px; font-weight: 700; white-space: nowrap;
}
.locate:active, .icon-btn:active { box-shadow: inset -2px -2px 0 var(--hi), inset 2px 2px 0 var(--lo);
  transform: translate(1px, 1px); }

/* ---------- map ---------- */
#map-wrap { flex: 1; min-height: 0; position: relative; }
#map { position: absolute; inset: 0; background: var(--map-bg); }
.leaflet-tile { filter: var(--tile-filter); } /* real map -> light poppy cyan */
.leaflet-container { background: var(--map-bg); font-family: var(--font); }

/* ---------- bottom "next up" sheet (nearest cleaning / verification) ---------- */
#sheet {
  overflow: auto; background: var(--surface);
  border-top: 3px solid var(--border-dark); padding: var(--sp-3) var(--sp-4);
  box-shadow: inset 0 3px 0 var(--hi);
}
#next-up { display: flex; flex-direction: column; gap: var(--sp-2); }
.next-row {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; text-align: left;
  background: var(--surface-2); border: 3px solid var(--border-dark); color: var(--ink);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo); padding: var(--sp-2) var(--sp-3);
}
.next-row:active { transform: translate(1px, 1px); }
.next-row[disabled] { opacity: .55; }
.next-ic { width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border: 3px solid var(--border-dark); color: var(--on-dark);
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.4), inset -2px -2px 0 rgba(0,0,0,.3); }
.next-ic-clean { background: var(--status-flagged); }
.next-ic-verify { background: var(--status-unvisited); }
.next-ic .pin-svg { width: 24px; height: 24px; }
.next-body { display: flex; flex-direction: column; }
.next-label { font-weight: 700; }
.next-meta { font-size: 13px; color: var(--ink-soft); }
.next-go { margin-left: auto; font-family: var(--font-display); font-weight: 700;
  font-size: 13px; color: var(--bg); white-space: nowrap; }
.empty { color: var(--ink-soft); margin: var(--sp-1) 0; }
.badge { color: var(--ink); padding: .1rem .4rem; font-size: 13px; font-weight: 700;
  border: 2px solid var(--border-dark); }

/* ---------- modal / capture sheet ---------- */
#sheet-backdrop, .backdrop { position: fixed; inset: 0; background: rgba(16,34,26,.55); z-index: 1000; }
.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: calc(100% - 2 * var(--sp-3)); max-width: 26rem;
  max-height: calc(100dvh - 2 * var(--sp-4)); overflow: auto; z-index: 1001;
  background: var(--surface); color: var(--ink);
  border: 4px solid var(--border-dark);
  box-shadow: inset 3px 3px 0 var(--hi), inset -3px -3px 0 var(--lo), 6px 6px 0 rgba(0,0,0,.3);
  padding: var(--sp-4);
}
.modal.narrow { max-width: 20rem; }
.modal h3 { margin: 0 0 var(--sp-3); font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.sheet-sub { margin: -8px 0 var(--sp-2); font-size: 13px; color: var(--ink-soft); }
.field { display: flex; flex-direction: column; gap: var(--sp-1); margin-bottom: var(--sp-3);
  font-size: 14px; color: var(--ink-soft); }
.field input { font: inherit; color: var(--ink); padding: var(--sp-3);
  background: #fff; border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 var(--lo); }
.sheet-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ---------- pixel buttons ---------- */
.btn {
  flex: 1; min-width: 6rem; border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo), 3px 3px 0 var(--lo);
  padding: var(--sp-3); font-weight: 700; color: var(--ink);
}
.btn:active { box-shadow: inset -2px -2px 0 var(--hi), inset 2px 2px 0 var(--lo);
  transform: translate(2px, 2px); }
.btn.danger { background: var(--status-flagged); }
.btn.ok     { background: var(--status-clean); }
.btn.nav    { background: var(--status-done); }
.btn.before { background: var(--surface-2); }
.btn.after  { background: var(--status-addressed); }
.btn.video  { background: #9a8cf0; }
.btn.done   { background: var(--status-done); }
.btn.ghost  { background: var(--surface-2); flex: 0 0 auto; }
.btn.block  { width: 100%; }

.info { margin: 0 0 var(--sp-3); font-size: 14px; color: var(--ink-soft); }
.info.warn { color: #b4471f; font-weight: 700; }
.info.error { color: #b4471f; font-weight: 700; }

/* ---------- toast (alert() replacement) ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0) + 92px);
  transform: translateX(-50%); z-index: 3000; max-width: min(24rem, 92vw);
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px;
  padding: var(--sp-2) var(--sp-3); text-align: center;
  border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo), 4px 4px 0 rgba(0,0,0,.25);
}
.toast.warn { background: var(--status-flagged); color: var(--on-dark); }

/* ---------- avatars + profile picker ---------- */
.avatar { display: inline-grid; place-items: center; flex: none; vertical-align: middle;
  border: 2px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo); }
.avatar svg { width: 74%; height: 74%; display: block; }
#account { min-width: 0; display: flex; }  /* let the chip shrink + ellipsize the name */
.account-chip { padding: 0 var(--sp-3) 0 4px; min-width: 0; max-width: 12rem; }
.account-chip .avatar { width: 28px; height: 28px; flex: none; }
.account-name { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-2); }
.avatar-grid button { padding: 3px; background: var(--surface-2); cursor: pointer;
  border: 3px solid var(--border-dark); display: grid; place-items: center; }
.avatar-grid button.on { border-color: var(--status-done);
  box-shadow: inset 0 0 0 2px var(--status-done); }
.avatar-grid .avatar { width: 100% !important; height: auto !important; aspect-ratio: 1; }
.color-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.color-opt { width: 34px; height: 34px; cursor: pointer; border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo); }
.color-opt.on { outline: 3px solid var(--status-done); outline-offset: 2px; }

/* ---------- leaderboard ---------- */
.modal.leaderboard { max-height: 82vh; overflow: auto; }
.lb-sub { font-size: 13px; color: var(--ink-soft); margin: 0 0 var(--sp-3); }
.lb-list { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.lb-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3);
  background: var(--surface-2); border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo); }
.lb-row.mine { outline: 3px solid var(--status-done); outline-offset: -3px; }
.lb-rank { font-family: var(--font-display); font-weight: 700; font-size: 16px;
  min-width: 30px; text-align: center; }
.lb-name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-pts { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--bg); }
.lb-pts small { font-size: 11px; color: var(--ink-soft); margin-left: 2px; }

/* ---------- admin review queue ---------- */
.modal.admin-queue { max-height: 82vh; overflow: auto; }
.admin-list { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.review-card { display: grid; grid-template-columns: 72px 1fr; gap: var(--sp-3);
  align-items: center; padding: var(--sp-2); background: var(--surface-2);
  border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo); }
.review-img { width: 72px; height: 72px; object-fit: cover; border: 2px solid var(--border-dark);
  background: var(--map-bg); }
.review-meta { font-size: 13px; line-height: 1.4; }
.review-note { color: var(--ink-soft); }
.review-actions { grid-column: 1 / -1; display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.review-actions .btn { padding: var(--sp-2); min-width: 0; }
.review-err { flex-basis: 100%; color: #b4471f; font-weight: 700; font-size: 13px; }

/* photo lightbox */
.modal.lightbox { width: auto; max-width: min(94vw, 42rem); padding: var(--sp-2);
  overflow: visible; }  /* base .modal scrolls, which would clip the corner ✕ */
.lightbox-img { display: block; cursor: pointer; max-width: 100%;
  max-height: 76vh; border: 3px solid var(--border-dark); background: var(--map-bg); }
.lightbox-close { position: absolute; top: -16px; right: -16px; width: 40px; height: 40px;
  display: grid; place-items: center; padding: 0; line-height: 1;
  font-weight: 700; font-size: 17px; color: var(--on-dark);
  background: var(--status-flagged); border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -2px 0 rgba(0,0,0,.3); }
.tl-thumb, .review-img, .act-thumb { cursor: pointer; }

/* points chip + my-activity modal */
.pts-chip { font-family: var(--font-display); font-weight: 700; background: var(--status-addressed); }
.act-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.act-head h3 { margin: 0; }
.act-pts { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.act-pending { font-size: 13px; color: var(--ink-soft); }
.act-streak { margin: 0 0 var(--sp-2); font-weight: 700; font-size: 14px; }
.act-list { display: flex; flex-direction: column; margin-bottom: var(--sp-3);
  max-height: 46vh; overflow: auto; }
.act-row { display: flex; align-items: center; gap: var(--sp-2); font-size: 13px;
  padding: var(--sp-2) 0; border-bottom: 2px solid var(--surface-2); }
.act-thumb { width: 40px; height: 40px; object-fit: cover; flex: none;
  border: 2px solid var(--border-dark); background: var(--map-bg); }
.act-dot { display: inline-block; }
.act-body { flex: 1; line-height: 1.35; }
.act-p { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }
.act-p.ok { color: #2c7a44; }
.act-p.pend { color: var(--ink-soft); }
.act-p.rej { color: #b4471f; }
.send-gauge { font-size: 13px; font-weight: 700; padding: var(--sp-2);
  background: var(--surface-2); border: 2px solid var(--border-dark);
  margin-bottom: var(--sp-2); }

/* admin tabs + activity log */
.admin-tabs { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.admin-tab { flex: 1; padding: var(--sp-2); font-weight: 700; background: var(--surface-2);
  border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo); }
.admin-tab.on { background: var(--status-clean); }
.activity-row { display: flex; justify-content: space-between; gap: var(--sp-2);
  font-size: 13px; padding: var(--sp-2) 0; border-bottom: 2px solid var(--surface-2); }
.tl-review { font-size: 12px; font-weight: 700; padding: 0 .3rem; white-space: nowrap;
  border: 2px solid var(--border-dark); }
.tl-review.pending { background: var(--status-addressed); color: var(--ink); }
.tl-review.rejected { background: var(--status-flagged); color: var(--on-dark); }

/* ---------- about modal ---------- */
.modal.about { max-height: 82vh; overflow: auto; }
.modal.about h4 { margin: var(--sp-4) 0 var(--sp-1); font-family: var(--font-display);
  font-weight: 700; font-size: 15px; color: var(--ink); }
.modal.about p { margin: 0 0 var(--sp-2); font-size: 14px; line-height: 1.55; }
.about-lead { font-weight: 700; }
.about-steps { margin: 0 0 var(--sp-2); padding-left: 1.2rem; font-size: 14px; line-height: 1.55; }
.about-steps li { margin-bottom: var(--sp-1); }
.about-chip { color: var(--on-dark); padding: 0 .3rem; border: 2px solid var(--border-dark); font-weight: 700; }
.about-foot { color: var(--ink-soft); margin-top: var(--sp-3) !important; }
.about-credit { font-size: 12px; color: var(--ink-soft); margin: var(--sp-2) 0 0 !important; }
.about-credit a { color: var(--ink); }

/* ---------- login card ---------- */
.center-card { margin: auto; max-width: 22rem; width: 100%; padding: var(--sp-5);
  background: var(--surface); border: 4px solid var(--border-dark);
  box-shadow: inset 3px 3px 0 var(--hi), inset -3px -3px 0 var(--lo); text-align: center; }
.center-card h1 { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin: 0 0 var(--sp-3); }

/* ---------- segmented toggles (pixel tabs) ---------- */
.segmented { display: inline-flex; background: var(--surface-2);
  border: 3px solid var(--border-dark); box-shadow: inset -2px -2px 0 var(--lo); }
.segmented button { border: 0; background: transparent; color: var(--ink-soft);
  font-family: var(--font-display); font-weight: 700; font-size: 14px; padding: var(--sp-2) var(--sp-3);
  white-space: nowrap; }
.segmented button.on { background: var(--status-clean); color: var(--ink);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo); }

/* ---------- route HUD ---------- */
.hud { position: fixed; z-index: 500; left: 0; right: 0; display: flex;
  justify-content: center; gap: var(--sp-2); padding: var(--sp-3); pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud.top { top: 0; flex-wrap: nowrap; padding-top: calc(var(--sp-3) + env(safe-area-inset-top, 0)); }
.hud.bottom { bottom: 0; padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom, 0)); }
.stat-card { background: var(--surface); border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo), 4px 4px 0 rgba(0,0,0,.25);
  padding: var(--sp-3) var(--sp-4); display: flex; gap: var(--sp-4); align-items: center; }
.stat-card .big { font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.progress-strip { font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.spinner { width: 20px; height: 20px; flex: none; border: 3px solid var(--border-dark);
  border-top-color: var(--status-done); box-shadow: 2px 2px 0 var(--lo);
  animation: spin .7s steps(8) infinite; }
.spinner-lg { width: 40px; height: 40px; border-width: 5px; box-shadow: 3px 3px 0 var(--lo); }
@keyframes spin { to { transform: rotate(360deg); } }
/* sweeping-broom loader (initial geolocation) — cuter than a spinner */
.broom-loader { position: relative; width: 72px; height: 72px; }
.broom-loader svg { position: absolute; top: 6px; left: 20px; width: 34px; height: 46px;
  transform-origin: 50% 14%; animation: sweep .65s ease-in-out infinite alternate; }
@keyframes sweep { from { transform: rotate(-26deg); } to { transform: rotate(26deg); } }
.broom-loader .dust { position: absolute; bottom: 10px; width: 5px; height: 5px;
  background: var(--on-dark-soft); border: 2px solid var(--border-dark); opacity: 0; }
.broom-loader .d1 { left: 18px; animation: mote .65s ease-out infinite; }
.broom-loader .d2 { left: 33px; animation: mote .65s ease-out infinite .22s; }
.broom-loader .d3 { left: 46px; animation: mote .65s ease-out infinite .44s; }
@keyframes mote { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 25% { opacity: 1; }
  100% { opacity: 0; transform: translate(7px, -12px) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .broom-loader svg { animation: none; }
  .broom-loader .dust { display: none; }
}

/* wayfinding loader (route calculation) — you-dot, dashed street-grid path with
   dashes marching TOWARD the destination, coral flag pin that hops. Mirrors the
   real route rendering (indigo you / sky polyline / coral goal). */
.route-loader { width: 84px; height: 84px; display: grid; place-items: center; }
.route-loader svg { width: 78px; height: 78px; }
.route-loader .rl-path { stroke: #2f9be0; stroke-width: 4;
  stroke-dasharray: 6 5; animation: rl-march .7s linear infinite; }
/* negative offset ⇒ dashes flow from the you-dot toward the pin */
@keyframes rl-march { to { stroke-dashoffset: -22; } }
.route-loader .rl-you { fill: #5a4fd0; stroke: #f4edda; stroke-width: 2; }
.route-loader .rl-pin { animation: rl-hop .7s steps(2) infinite; }
@keyframes rl-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) {
  .route-loader .rl-path, .route-loader .rl-pin { animation: none; }
}

/* centered, prominent loader card (route routing + initial geolocation) */
.loader-overlay { position: fixed; inset: 0; z-index: 700; display: grid;
  place-items: center; pointer-events: none; }
.loader-overlay .load-card { display: flex; flex-direction: column; align-items: center;
  gap: var(--sp-3); padding: var(--sp-5) var(--sp-5);
  background: var(--surface); border: 4px solid var(--border-dark);
  box-shadow: inset 3px 3px 0 var(--hi), inset -3px -3px 0 var(--lo), 6px 6px 0 rgba(0,0,0,.3); }
.loader-overlay .load-text { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink); }

/* ---------- map markers (pixel coins) ---------- */
.leaflet-div-icon { background: transparent; border: none; }
.pin {
  width: 34px; height: 34px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink);
  border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.5), inset -2px -2px 0 rgba(0,0,0,.3);
}
.pin-svg { width: 22px; height: 22px; display: block; }
.pin-flagged   { background: var(--status-flagged); animation: bob 1.6s ease-in-out infinite; }
.pin-addressed { background: var(--status-addressed); }
.pin-done      { background: var(--status-done); }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* "You are here": a round indigo dot with a white ring + dark outline (pops off
   the map, clearly distinct from the square drain pins) and a pulsing sonar halo. */
.you { position: relative; width: 18px; height: 18px; border-radius: 50%;
  background: var(--you); border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--border-dark), 0 2px 6px rgba(0,0,0,.45); }
.you::after { content: ""; position: absolute; left: 50%; top: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: var(--you); animation: you-pulse 1.8s ease-out infinite; }
@keyframes you-pulse {
  0% { transform: scale(1); opacity: .5; }
  100% { transform: scale(3.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .you::after { display: none; } }

.target { width: 46px; height: 46px; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 16px; color: var(--ink);
  border: 4px solid var(--border-dark);
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.5), inset -3px -3px 0 rgba(0,0,0,.3);
  animation: targetpulse 0.7s var(--ease) infinite; }
.target .pin-svg { width: 30px; height: 30px; }
.target-clean  { background: var(--status-flagged); }
.target-verify { background: var(--status-unvisited); color: #fff; }
@keyframes targetpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

.leaflet-control-zoom { border: 3px solid var(--border-dark) !important; box-shadow: none;
  margin: var(--sp-3) !important; }
.leaflet-control-zoom a { border: none !important; color: var(--ink) !important;
  background: var(--surface) !important; font-family: var(--font-display) !important; }

/* ---------- bottom-right map controls (Google-Maps-style) ----------
   Anchored to the MAP (absolute in #map-wrap), so they hug the map's bottom
   edge regardless of the sheet's height instead of floating over it. */
#map-controls { position: absolute; right: var(--sp-4);
  bottom: calc(env(safe-area-inset-bottom, 0) + 24px); z-index: 600; }
.map-fab { width: 48px; height: 48px; display: grid; place-items: center;
  background: var(--surface); color: var(--ink); font-size: 22px; line-height: 1;
  border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo), 3px 3px 0 var(--lo); }
.map-fab svg { width: 26px; height: 26px; display: block; }
.map-fab:active { box-shadow: inset -2px -2px 0 var(--hi), inset 2px 2px 0 var(--lo); transform: translate(2px,2px); }

.fab { position: absolute; right: calc(var(--sp-4) + 56px);
  bottom: calc(env(safe-area-inset-bottom, 0) + 24px); z-index: 600; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--border-dark); box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo), 3px 3px 0 var(--lo);
  padding: 0 var(--sp-4); background: var(--bg-2);
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--on-dark); }
.fab:active { box-shadow: inset -2px -2px 0 var(--hi), inset 2px 2px 0 var(--lo); transform: translate(2px,2px); }
.fab.exit { padding: 0; width: 48px; font-size: 18px; background: var(--status-flagged);
  right: var(--sp-4); top: calc(var(--sp-3) + env(safe-area-inset-top, 0)); bottom: auto; }

body.route-mode #map-controls { display: none; }

/* ---------- route mode ---------- */
body.route-mode header, body.route-mode #sheet { display: none; }

/* ---------- node timeline ---------- */
#node-timeline:not(:empty) { margin-top: var(--sp-4); border-top: 3px solid var(--border-dark); padding-top: var(--sp-3); }
.tl-title { margin: 0 0 var(--sp-2); font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--ink); }
.tl-item { display: flex; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-2); }
.tl-thumb { width: 40px; height: 40px; object-fit: cover; flex: none; border: 2px solid var(--border-dark); }
.tl-dot { background: var(--status-unvisited); }
.tl-body { font-size: 14px; }
.tl-when { color: var(--ink-soft); font-size: 13px; }

/* ---------- animations ---------- */
@keyframes fade { from { opacity: 0; } }
@keyframes slideup { from { transform: translateY(100%); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }
.pop { animation: pop var(--dur-slow) var(--ease-spring); }
