/* ──────────────────────────────────────────────────────────────
   footpath.ai — design tokens
   civic / community, warm, OSM-ish (moss + terracotta on cream)
   ────────────────────────────────────────────────────────────── */

:root {
  /* footpath.ai — yellow / white / black */
  --bg:        #ffffff;
  --bg-2:      #f6f6f3;
  --surface:   #ffffff;
  --surface-2: #f3f3f0;
  --ink:       #0a0a0a;
  --ink-2:     #262626;
  --mute:      #6f6f6c;
  --line:      #e7e6e1;
  --line-2:    #efeeea;

  /* brand — footpath.ai */
  --yellow:      #FFF649;
  --yellow-edge: #E0D62F;
  --yellow-soft: #FFFBC2;
  --black:       #0A0A0A;
  --black-soft:  #181816;

  --moss:      var(--yellow);
  --moss-ink:  var(--black);
  --moss-soft: var(--yellow-soft);
  --terra:     var(--black);
  --terra-ink: #ffffff;
  --terra-soft:#f3f3f0;

  /* status (kept brand-neutral) */
  --good:      #2c8a3a;
  --warn:      #c98b1e;
  --bad:       #c93a3a;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow-s: 0 1px 0 rgba(10,10,10,.04), 0 1px 2px rgba(10,10,10,.04);
  --shadow-m: 0 1px 0 rgba(10,10,10,.04), 0 8px 20px -10px rgba(10,10,10,.18);

  /* type — slab serif for display matches footpath.ai brand */
  --f-ui:      "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --f-display: "Roboto Slab", "Newsreader", ui-serif, serif;
  --f-mono:    "DM Mono", ui-monospace, "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--f-ui);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

/* ───── layout ───── */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  background: var(--bg);
}
.app.app--topbar { grid-template-columns: 1fr; grid-template-rows: 56px 1fr; }
.app.app--rail   { grid-template-columns: 64px 1fr; }

.workspace {
  overflow: hidden;
  display: grid;
  grid-template-rows: 56px 1fr;
  background: var(--bg);
}
.workspace__head {
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.workspace__body { overflow: auto; }

/* ───── nav ───── */
.nav {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.nav__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 18px;
}
.brand__logo {
  display: block;
  /* Crop the built-in 15% transparent padding around the yellow square */
  width: 88px;
  height: auto;
  margin: -6px -10px -4px -8px;
  object-fit: contain;
}
.brand__logo--compact {
  width: 40px;
  margin: -4px -6px -2px -4px;
}
.brand__mark {
  width: 32px; height: 32px; border-radius: 7px;
  background: var(--yellow);
  display: grid; place-items: center;
  color: var(--black);
  font-family: var(--f-ui);
  font-weight: 700;
  font-style: normal;
  letter-spacing: -.04em;
  font-size: 14px;
}
.brand__name {
  font-family: var(--f-ui);
  font-size: 17px; letter-spacing: -.02em;
  font-weight: 700;
}
.brand__name em { font-style: normal; color: var(--ink); font-weight: 700; }

.nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--ink-2);
  border: 1px solid transparent;
  font-weight: 500;
  white-space: nowrap;
}
.nav__item:hover { background: rgba(0,0,0,.04); color: var(--ink); }
.nav__item.is-active {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-s);
}
.nav__item svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nav__group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--mute); padding: 18px 12px 6px; }
.nav__foot { margin-top: auto; padding: 12px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--terra-soft) center/cover;
  display: grid; place-items: center;
  color: var(--terra-ink); font-weight: 600; font-size: 12px;
  border: 1px solid var(--line);
}

/* compact rail variant */
.app--rail .nav { padding: 14px 8px; align-items: center; }
.app--rail .nav__item { justify-content: center; padding: 10px; width: 44px; }
.app--rail .nav__item span,
.app--rail .nav__group,
.app--rail .brand__name { display: none; }
.app--rail .nav__foot { padding: 8px; }
.app--rail .nav__collapse svg { transform: scaleX(-1); }

/* Collapse button — visually distinct from nav items */
.nav__collapse {
  margin-top: auto;
  margin-bottom: 8px;
  color: var(--mute) !important;
  background: transparent !important;
  border-color: transparent !important;
  font-size: 12px;
}
.nav__collapse:hover {
  background: rgba(0,0,0,.04) !important;
  color: var(--ink-2) !important;
}

/* Mobile drawer infrastructure — desktop default = hidden */
.nav__backdrop { display: none; }
.nav__mobile-close { display: none; }
.workspace__menu { display: none; }

/* ── Mobile (≤768) ────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Sidebar stays visible as a persistent narrow rail — no off-canvas drawer */
  .app {
    grid-template-columns: 64px 1fr !important;
    grid-template-rows: 1fr !important;
  }
  .app--topbar { grid-template-rows: 1fr !important; }

  .nav {
    padding: 14px 8px;
    align-items: center;
    width: auto;
  }
  .nav__item {
    justify-content: center;
    padding: 10px;
    width: 44px;
  }
  .nav__item span,
  .brand__name { display: none; }
  .nav__collapse { display: none; }  /* rail is already minimal on mobile */
  .nav__foot { flex-direction: column; gap: 8px; }
  .nav__foot .col { display: none; }

  /* Topbar variant — also renders as the rail on mobile */
  .app--topbar .nav {
    flex-direction: column;
    align-items: center;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .app--topbar .nav__foot { margin-left: 0; margin-top: auto; }

  /* Workspace head */
  .app--topbar .workspace { grid-template-rows: 56px 1fr; }
  .app--topbar .workspace__head { display: flex; }
  .workspace__help { display: none; }   /* tighten on phones */
  .workspace__upload-label { display: none; }  /* icon-only Upload */
  .workspace__head { padding: 0 14px; gap: 10px; }

  /* Body paddings shrink */
  .pad-32 { padding: 18px 14px; }
  .pad-24 { padding: 16px; }

  /* Typography */
  h1 { font-size: 26px; }
  h2 { font-size: 20px; }
  h3 { font-size: 16px; }

  /* All 2/3/4-col grids collapse to one column */
  .pad-32 > .grid[style*="grid-template-columns"],
  .grid[style*="repeat(2"],
  .grid[style*="repeat(3"],
  .grid[style*="repeat(4"],
  .grid[style*="1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Photo tile grid — 3 cols instead of 6 */
  .grid[style*="repeat(6"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* Upload entry hero + canvas — single column */
  .pad-32[style*="320px"] {
    grid-template-columns: 1fr !important;
  }

  /* Detect step + map-anchored review — stack map + sidecard */
  .grid[style*="1.4fr"],
  .grid[style*="1.4fr 1fr"] {
    grid-template-columns: 1fr !important;
    height: auto !important;
  }

  /* Drop zone */
  .drop { padding: 32px 20px; }

  /* Steps wrap */
  .steps { flex-wrap: wrap; row-gap: 6px; }
  .steps__bar { display: none; }

  /* Tables become horizontally scrollable */
  .card .t,
  .card table.t { display: block; }
  .card table.t thead, .card table.t tbody { display: block; }
  .card table.t tr {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 8px 14px;
    gap: 4px 12px;
    border-bottom: 1px solid var(--line-2);
  }
  .card table.t thead { display: none; }
  .card table.t td {
    padding: 2px 0;
    border: 0;
  }
  .card table.t td:first-child { grid-column: 1 / -1; }

  /* Throughput stats stack into 2x2 */
  .thru { grid-template-columns: 1fr 1fr; }
  .thru__cell:nth-child(2) { border-right: 0; }
  .thru__cell:nth-child(1), .thru__cell:nth-child(2) { border-bottom: 1px solid var(--line-2); }

  /* Queue row tighter */
  .queue__row { grid-template-columns: 24px 1fr auto 22px; gap: 8px; padding: 8px 12px; }
  .queue__row .queue__size { display: none; }

  /* Selection toolbar wraps */
  .selbar { flex-wrap: wrap; }

  /* Editor full screen — stack panels */
  .editor__body { grid-template-columns: 1fr !important; grid-template-rows: 1fr auto; }
  .editor__side { border-left: 0; border-top: 1px solid var(--line); max-height: 50vh; }
  .editor__head { padding: 0 12px; gap: 8px; }
  .editor__head .btn span { display: none; }   /* icon-only variant switcher */

  /* Sign-in card */
  .signin__card { margin: 24px auto; padding: 24px; border-radius: var(--r-lg); }
  .signin__code input { font-size: 20px; padding: 12px 0; }

  /* Notices wrap */
  .notice { flex-wrap: wrap; }

  /* Headings dial — wider slider */
  .heading { grid-template-columns: 52px 1fr; gap: 10px; }
  .heading__dial { width: 52px; height: 52px; }

  /* License panel inside cards */
  .license-panel { padding: 12px; }

  /* Stepper compact label */
  .steps__item span:last-child { font-size: 12px; }
}

/* ── Very small (≤420) — extra-tight ─────────────────────────── */
@media (max-width: 420px) {
  .grid[style*="repeat(6"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .signin__code { gap: 6px; }
  .signin__code input { font-size: 18px; }
  h1 { font-size: 22px; }
  .pad-32 { padding: 14px 12px; }
  .workspace__head { padding: 0 10px; }
}

/* topbar variant */
.app--topbar .nav {
  flex-direction: row; align-items: center;
  padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--line);
  gap: 6px;
}
.app--topbar .nav__brand { padding: 0 12px 0 0; }
.app--topbar .nav__item { padding: 6px 12px; }
.app--topbar .nav__group { display: none; }
.app--topbar .nav__foot { margin-left: auto; border: 0; padding: 0; }
.app--topbar .workspace { grid-template-rows: 1fr; }
.app--topbar .workspace__head { display: none; }

/* ───── headers / typography ───── */
h1, h2, h3, h4 { margin: 0; font-family: var(--f-display); font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
h1 { font-size: 38px; line-height: 1.02; }
h2 { font-size: 26px; line-height: 1.08; }
h3 { font-size: 18px; line-height: 1.15; font-weight: 600; }
.eyebrow { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); font-weight: 600; }
.dek { color: var(--ink-2); font-size: 14px; line-height: 1.5; max-width: 56ch; }
em.serif-italic { font-family: var(--f-display); font-style: normal; font-weight: 700; color: var(--ink); background: linear-gradient(180deg, transparent 62%, var(--yellow) 62%); padding: 0 .08em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: -.01em; }

/* ───── buttons & chips ───── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 500;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--yellow); color: var(--black); border-color: var(--yellow-edge);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.btn--primary:hover { background: #FFFA7A; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: rgba(0,0,0,.05); }
.btn--terra { background: var(--black); color: #fff; border-color: var(--black); }
.btn--terra:hover { background: #1c1c1a; }
.btn--lg { padding: 14px 22px; font-size: 15px; }
.btn--icon { padding: 8px; width: 34px; height: 34px; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
}
.chip--moss  { background: var(--yellow);     color: var(--black); border-color: var(--yellow-edge); }
.chip--terra { background: var(--black);      color: #fff;         border-color: var(--black); }
.chip--warn  { background: #fff3d3;           color: #8a5e10;      border-color: #f0d590; }
.chip--bad   { background: #fbe3e3;           color: #8a2c2c;      border-color: #f0b8b8; }
.chip__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ───── card / panels ───── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-s);
}
.card--sunken { background: var(--surface-2); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* progress */
.progress {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--mute);
}
.progress__bar {
  flex: 1; height: 4px; background: var(--line-2);
  border-radius: 999px; overflow: hidden;
  min-width: 80px;
}
.progress__fill { height: 100%; background: var(--black); border-radius: 999px; }

/* steps */
.steps { display: flex; align-items: center; gap: 8px; }
.steps__item { display: flex; align-items: center; gap: 8px; color: var(--mute); font-size: 13px; }
.steps__num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--line-2); color: var(--ink-2);
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
}
.steps__item.is-active .steps__num { background: var(--yellow); color: var(--black); border: 1px solid var(--yellow-edge); }
.steps__item.is-done .steps__num { background: var(--black); color: #fff; }
.steps__item.is-active, .steps__item.is-done { color: var(--ink); }
.steps__bar { width: 28px; height: 1px; background: var(--line); }

/* table */
table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
table.t th { font-weight: 500; font-size: 12px; color: var(--mute); }

/* utilities */
.flex { display: flex; }
.grid { display: grid; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between > :first-child { min-width: 0; flex: 1 1 auto; }
.row.between > :last-child  { flex: 0 0 auto; white-space: nowrap; text-align: right; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.center  { justify-content: center; align-items: center; }
.pad-24  { padding: 24px; }
.pad-32  { padding: 32px; }
.mute    { color: var(--mute); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* drop zone */
.drop {
  position: relative;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  padding: 56px 36px;
  text-align: center;
}
.drop.is-hot { border-color: var(--black); background: var(--moss-soft); }

/* map placeholder */
.map {
  position: relative;
  background:
    radial-gradient(800px 500px at 30% 70%, rgba(232,238,63,.10), transparent 60%),
    radial-gradient(700px 400px at 70% 30%, rgba(10,10,10,.04), transparent 60%),
    repeating-linear-gradient(45deg, transparent 0 22px, rgba(10,10,10,.04) 22px 23px),
    repeating-linear-gradient(-45deg, transparent 0 22px, rgba(10,10,10,.04) 22px 23px),
    #f6f6f3;
  overflow: hidden;
  border-radius: var(--r-lg);
  color: #555;
}
.map--bare { border-radius: 0; }
.map__roads {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0%, transparent calc(50% - 1px), rgba(10,10,10,.18) calc(50% - 1px), rgba(10,10,10,.18) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(90deg,  transparent 0%, transparent calc(50% - 1px), rgba(10,10,10,.18) calc(50% - 1px), rgba(10,10,10,.18) calc(50% + 1px), transparent calc(50% + 1px));
  opacity: .6;
}
.map__attribution {
  position: absolute; right: 8px; bottom: 6px;
  font-family: var(--f-mono); font-size: 10px; color: var(--mute);
  background: rgba(251,247,235,.7); padding: 2px 6px; border-radius: 4px;
}
.map__layers {
  position: absolute; left: 12px; bottom: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 6px;
  display: flex; gap: 4px; box-shadow: var(--shadow-s);
}
.map__layer { padding: 4px 8px; font-size: 11px; border-radius: 6px; cursor: pointer; color: var(--mute); }
.map__layer.is-on { background: var(--ink); color: var(--bg); }

/* pin */
.pin {
  position: absolute;
  width: 14px; height: 14px;
  background: var(--black);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.pin--moss { background: var(--yellow); border-color: var(--black); }
.pin--warn { background: #f0b240; border-color: #fff; }
.pin--ghost { background: #d8d6cf; }
.pin--selected { outline: 3px solid rgba(10,10,10,.25); outline-offset: 2px; }
.pin--big { width: 20px; height: 20px; }

/* image tile */
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.tile__img {
  aspect-ratio: 4/3;
  background:
    repeating-linear-gradient(135deg, #eceae3 0 8px, #f3f1ea 8px 16px);
  position: relative;
  display: grid; place-items: center;
  color: var(--mute);
  font-family: var(--f-mono); font-size: 10px;
}
.tile__img--360 {
  background:
    radial-gradient(circle at 30% 30%, #1d1d1b 0 22%, transparent 23%),
    radial-gradient(circle at 70% 50%, #2a2a26 0 25%, transparent 26%),
    repeating-linear-gradient(90deg, #2c2c28 0 12px, #353530 12px 24px);
}
.tile__img--flat {
  background:
    linear-gradient(180deg, #cfcdc4 0 45%, #b8b6ac 45% 65%, #8d8a80 65% 100%);
}
.tile__img--rejected { filter: grayscale(.6) brightness(.92); }
.tile__badge {
  position: absolute; top: 6px; left: 6px;
  background: rgba(20,18,12,.7); color: var(--bg);
  font-family: var(--f-mono); font-size: 10px;
  padding: 2px 6px; border-radius: 4px;
}
.tile__meta {
  padding: 8px 10px; font-size: 12px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px;
}

/* checkbox/radio */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--mute); font-weight: 500; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="number"] {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
}
.field input:focus { outline: 2px solid var(--moss-soft); border-color: var(--moss); }

/* timeline */
.timeline {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
  box-shadow: var(--shadow-m);
}
.timeline__track {
  position: relative;
  height: 64px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(232,238,63,.30), rgba(232,238,63,.10)),
    repeating-linear-gradient(90deg, transparent 0 39px, var(--line-2) 39px 40px),
    var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.timeline__tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--black); border-radius: 1px; }
.timeline__tick--photo { background: #f0b240; }
.timeline__tick--gap { background: var(--warn); width: 6px; opacity: .5; }
.timeline__labels { display: flex; justify-content: space-between; padding: 6px 2px 0; font-family: var(--f-mono); font-size: 10px; color: var(--mute); }

/* tiny svg icons */
.i { width: 16px; height: 16px; flex: 0 0 16px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.i--lg { width: 20px; height: 20px; flex: 0 0 20px; }

/* scrollbars (subtle, on themed bg) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d2d0c8; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* notice banner */
.notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--black);
  border: 1px solid var(--black);
  border-radius: var(--r-md);
  color: #fff;
  font-size: 13px;
}
.notice--moss { background: var(--moss-soft); border-color: var(--yellow-edge); color: var(--ink); }

/* tweak overrides */
.density-compact .nav__item { padding: 7px 10px; }
.density-compact .card { border-radius: var(--r-md); }
.density-compact .pad-32 { padding: 22px; }

/* ── Leaflet pin styling ──────────────────────────────────────── */
.lm-pin {
  background: var(--black);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.lm-pin.lm-yellow { background: var(--yellow); border-color: var(--black); }
.lm-pin.lm-warn   { background: #f0b240; border-color: #fff; }
.lm-pin.lm-selected { outline: 3px solid rgba(10,10,10,.25); outline-offset: 2px; z-index: 500 !important; }
.lm-pin.lm-drag {
  cursor: grab;
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.lm-pin.lm-drag:active { cursor: grabbing; }
/* Leaflet container — neutralise its background */
.leaflet-container { font-family: var(--f-ui); background: #f2f1ed; }
.leaflet-control-attribution { font-size: 10px !important; background: rgba(255,255,255,.7) !important; }
.leaflet-bar a { color: var(--black) !important; }

/* ── Upload queue ─────────────────────────────────────────── */
.queue {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.queue__head {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  align-items: center;
}
.queue__list {
  max-height: 280px;
  overflow: auto;
}
.queue__row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto 22px;
  gap: 12px;
  padding: 8px 14px;
  align-items: center;
  font-size: 12px;
  border-bottom: 1px solid var(--line-2);
}
.queue__row:last-child { border-bottom: 0; }
.queue__row.is-uploading { background: var(--yellow-soft); }
.queue__row.is-failed    { background: #fbe3e3; }
.queue__row.is-done      .queue__name { color: var(--mute); }
.queue__thumb {
  width: 28px; height: 22px; border-radius: 4px;
  background: linear-gradient(180deg, #cfcdc4, #8d8a80);
  flex: 0 0 28px;
}
.queue__thumb--360 {
  background: linear-gradient(135deg, #1d1d1b 0%, #3a3a36 100%);
}
.queue__name { font-family: var(--f-mono); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue__size { font-family: var(--f-mono); font-size: 11px; color: var(--mute); }
.queue__status {
  font-family: var(--f-mono); font-size: 10px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--surface-2); color: var(--mute);
  letter-spacing: .04em; text-transform: uppercase;
}
.queue__status.is-uploading { background: var(--yellow); color: var(--black); }
.queue__status.is-done      { background: var(--moss-soft); color: var(--black); }
.queue__status.is-failed    { background: #fbe3e3; color: #8a2c2c; }
.queue__status.is-paused    { background: var(--ink-2); color: #fff; }
.queue__minibar {
  height: 3px; background: var(--line-2);
  border-radius: 999px; overflow: hidden;
  width: 60px;
}
.queue__minibar > div {
  height: 100%; background: var(--black); border-radius: 999px;
  transition: width .2s linear;
}

/* big throughput stats */
.thru {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.thru__cell {
  padding: 10px 14px;
  border-right: 1px solid var(--line-2);
}
.thru__cell:last-child { border-right: 0; }
.thru__label { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--mute); }
.thru__value { font-family: var(--f-display); font-size: 18px; font-weight: 600; margin-top: 2px; }

/* ── Heading dial ─────────────────────────────────────────── */
.heading {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
}
.heading__dial {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
}
.heading__dial::before,
.heading__dial::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 1px; height: 100%; background: var(--line-2);
  transform: translate(-50%, -50%);
}
.heading__dial::after { transform: translate(-50%, -50%) rotate(90deg); }
.heading__needle {
  position: absolute;
  left: 50%; top: 50%;
  width: 3px; height: 26px;
  background: var(--black);
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(0deg);
  border-radius: 2px;
}
.heading__needle::before {
  content: ""; position: absolute; left: 50%; top: -3px;
  width: 8px; height: 8px;
  background: var(--yellow);
  border: 1.5px solid var(--black);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.heading__hub {
  position: absolute;
  left: 50%; top: 50%; width: 6px; height: 6px;
  background: var(--ink); border-radius: 50%;
  transform: translate(-50%, -50%);
}
.heading__n {
  position: absolute; top: 3px; left: 50%; transform: translateX(-50%);
  font-family: var(--f-mono); font-size: 8px; color: var(--mute);
}
.heading__slider {
  width: 100%; accent-color: var(--yellow-edge);
}
.heading__readout {
  font-family: var(--f-mono); font-size: 12px;
  display: flex; justify-content: space-between;
}

/* leaflet heading marker (small arrow on selected pin) */
.lm-heading {
  position: relative;
}
.lm-heading__arrow {
  position: absolute;
  left: 50%; top: 50%;
  width: 2px; height: 22px;
  background: var(--black);
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%);
  border-radius: 2px;
  pointer-events: none;
}
.lm-heading__arrow::before {
  content: ""; position: absolute; top: -4px; left: 50%;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid var(--black);
  transform: translateX(-50%);
}

/* ── License panel ────────────────────────────────────────── */
.license-panel {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.55;
}
.license-panel strong { color: var(--ink); font-weight: 600; }
.license-panel summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--ink);
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
}
.license-panel summary::-webkit-details-marker { display: none; }
.license-panel summary::after {
  content: "▾";
  margin-left: auto;
  font-size: 10px;
  color: var(--mute);
  transition: transform .15s;
}
.license-panel[open] summary::after { transform: rotate(180deg); }
.license-panel__body { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.license-panel__body p { margin: 0 0 10px; }
.license-panel__body p:last-child { margin: 0; }

/* selection toolbar */
.selbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-md);
  margin-bottom: 12px;
  font-size: 13px;
}
.selbar .btn {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
  color: #fff;
  padding: 6px 12px;
}
.selbar .btn:hover { background: rgba(255,255,255,.16); }
.selbar .btn--primary {
  background: var(--yellow); color: var(--black); border-color: var(--yellow-edge);
}
.selbar .btn--primary:hover { background: #FFFA7A; }

/* cap notice */
.cap-notice {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: #fff3d3;
  border: 1px solid #f0d590;
  border-radius: var(--r-md);
  color: #8a5e10;
  font-size: 12px;
}

/* ── Landing (signed-out) ────────────────────────────────── */
.landing {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(430px, 41%) 1fr;
  background: var(--bg);
  overflow: hidden;
}

/* Left: white editorial panel */
.landing__panel {
  display: flex; flex-direction: column;
  padding: 22px 48px 18px;
  border-right: 1px solid var(--line);
}
.landing__panel-head {
  display: flex; align-items: center; justify-content: space-between;
}
.landing__logo {
  display: block;
  width: 104px; height: auto;
  margin: -14px -12px -10px -10px;
  object-fit: contain;
}
.landing__panel-body {
  margin: auto 0;
  padding: 40px 0;
  max-width: 440px;
}
.landing__title {
  margin: 14px 0 0;
  font-family: var(--f-display);
  font-size: clamp(32px, 3.4vw, 46px);
  line-height: 1.06;
  letter-spacing: -.01em;
}
.landing__dek {
  margin: 16px 0 0;
  font-size: 15.5px;
}
.landing__cta {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 28px;
}
.landing__cta input {
  flex: 1; min-width: 220px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 15px;
}
.landing__cta input:focus {
  outline: 2px solid var(--yellow-soft);
  border-color: var(--yellow-edge);
}
.landing__cta .btn--lg { white-space: nowrap; }
.landing__cta-note { margin-top: 10px; font-size: 12px; color: var(--mute); }
.landing__stats {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 36px;
  color: var(--mute);
  font-size: 12.5px;
}
.landing__stats strong { color: var(--ink); font-weight: 500; }
.landing__stat-dot { color: var(--line); }
.landing__legal {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--mute);
}
.landing__legal a { color: var(--ink-2); text-decoration: none; }
.landing__legal a:hover { text-decoration: underline; }

/* Right: full-height forward-looking 360 street view */
.landing__scene {
  position: relative;
  overflow: hidden;
  background: var(--black-soft);
  min-height: 100vh;
  container-type: size;
  container-name: scene;
}
@container scene (max-width: 560px) {
  .landing__scene-optional { display: none; }
}
.landing__pano-viewer { position: absolute; inset: 0; }
.landing__pano-viewer .pnlm-container { background: var(--black-soft); }
.landing__scene-maplink {
  position: absolute; top: 18px; right: 20px; z-index: 6;
  background: rgba(10,10,10,.72);
  border-color: rgba(255,255,255,.16);
  color: #fff;
  backdrop-filter: blur(6px);
}
.landing__scene-maplink:hover { background: rgba(10,10,10,.86); }
.landing__scene-foot {
  position: absolute; left: 20px; right: 20px; bottom: 16px; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.landing__scene-meta {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(10,10,10,.72);
  color: rgba(255,255,255,.92);
  font-size: 11.5px;
  backdrop-filter: blur(6px);
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.landing__scene-meta svg { flex: none; color: var(--yellow); }
.landing__scene-sep { color: rgba(255,255,255,.4); }
.landing__scene-dots { display: flex; gap: 8px; flex: none; }
.landing__scene-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.9);
  background: transparent;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(10,10,10,.25);
}
.landing__scene-dot.is-on { background: var(--yellow); border-color: var(--yellow); }

@media (max-width: 860px) {
  .landing { grid-template-columns: 1fr; grid-template-rows: auto minmax(300px, 42vh); }
  .landing__panel { order: 0; border-right: none; padding: 18px 24px 16px; }
  .landing__panel-body { padding: 28px 0; max-width: none; }
  .landing__scene { order: 1; min-height: 0; }
  .landing__cta { flex-direction: column; }
}

/* ── Sign-in ─────────────────────────────────────────────── */
.signin {
  position: relative;
  height: 100vh;
  overflow-y: auto;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--bg);
  overflow-x: hidden;
}
.signin__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 480px at 88% 12%, rgba(255,246,73,.30), transparent 60%),
    radial-gradient(900px 600px at 8% 92%, rgba(255,246,73,.18), transparent 60%),
    repeating-linear-gradient(135deg, transparent 0 80px, rgba(10,10,10,.025) 80px 81px),
    var(--bg);
  pointer-events: none;
}
/* Blurred, gently moving street view behind the sign-in card.
   Fixed to the viewport so short screens that scroll the card
   never reveal a bare band below it. */
.signin__pano {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.signin__pano-layer {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 2.4s ease;
}
.signin__pano-layer.is-active { opacity: 1; }
/* While a newly-mounted layer is still loading its image, let the previous
   scene show through instead of a dark plate. */
.signin__pano .pnlm-container { background: transparent; }
.signin__pano .landing__pano-viewer {
  position: absolute;
  inset: 0;
  filter: blur(2.5px);
  transform: scale(1.06); /* hide blur edge fringing */
  transform-origin: center;
}
.signin__pano-veil {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.30);
}
.signin .signin__legal { color: #fff; text-shadow: 0 1px 4px rgba(10,10,10,.5); }
.signin .signin__legal a { color: #fff; }
.signin__card {
  position: relative;
  align-self: center; /* size to content, not the full grid row */
  width: min(460px, calc(100% - 32px));
  margin: 40px auto 20px;
  padding: 36px 36px 32px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: 0 1px 0 rgba(10,10,10,.04), 0 24px 60px -30px rgba(10,10,10,.25);
  display: flex; flex-direction: column; gap: 18px;
}
.signin__brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.signin__logo {
  display: block;
  width: 96px;
  height: auto;
  /* Crop transparent padding so the yellow square sits flush */
  margin: -12px -12px 0 -8px;
  object-fit: contain;
}
.signin__field {
  display: flex; flex-direction: column; gap: 6px;
}
.signin__field > span {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--mute); font-weight: 600;
}
.signin__field input {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  font-size: 15px;
}
.signin__field input:focus {
  outline: 2px solid var(--yellow-soft);
  border-color: var(--yellow-edge);
}
.signin__divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--mute); font-size: 11px;
  text-transform: uppercase; letter-spacing: .12em;
}
.signin__divider::before,
.signin__divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.signin__inbox {
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex; flex-direction: column;
}
.signin__inbox-head {
  display: flex; justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.signin__code {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.signin__code input {
  font-family: var(--f-mono);
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  padding: 14px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  width: 100%;
}
.signin__code input:focus {
  outline: 2px solid var(--yellow-soft);
  border-color: var(--yellow-edge);
}
.signin__foot {
  font-size: 12px; color: var(--mute); line-height: 1.55;
}
/* Capture-guide callout, must read as a distinct action, not fine print */
.signin__guide {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--yellow-soft);
  border: 1px solid var(--yellow-edge);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink);
}
.signin__guide:hover { background: #FFF9A8; }
.signin__guide > svg { flex: none; }
.signin__guide > span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.signin__guide strong { font-size: 13.5px; font-weight: 600; }
.signin__guide-sub { font-size: 12px; color: var(--ink-2); }
.signin__foot a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.signin__legal {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 18px;
  font-size: 11px; color: var(--mute);
  flex-wrap: wrap;
}
.signin__legal a { color: var(--ink-2); text-decoration: none; }
.signin__legal a:hover { text-decoration: underline; }

/* Empty state */
.empty {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 48px 24px;
  gap: 12px;
  color: var(--ink-2);
}
.empty__mark {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--mute);
}
.empty h3 { font-family: var(--f-display); font-size: 20px; }
.empty p { margin: 0; color: var(--mute); font-size: 13px; max-width: 36ch; line-height: 1.5; }

/* full-page modal-ish editor */
.editor { display: grid; grid-template-rows: 56px 1fr 60px; height: 100%; }
.editor__head { display: flex; align-items: center; gap: 14px; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--bg); }
.editor__body { display: grid; grid-template-columns: 1fr 380px; overflow: hidden; }
.editor__main { position: relative; }
.editor__side { border-left: 1px solid var(--line); background: var(--surface); overflow: auto; padding: 18px; }
.editor__foot { display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-top: 1px solid var(--line); background: var(--bg); }

/* ── Nav: log out button ──────────────────────────────────────── */
.nav__foot-col { display: flex; flex-direction: column; gap: 10px; width: 100%; min-width: 0; }
.nav__foot-col .nav__logout { width: 100%; justify-content: center; }
.nav__logout {
  white-space: nowrap;
  gap: 6px;
  color: var(--mute);
  border: 1px solid var(--line);
}
.nav__logout:hover { color: var(--bad) !important; background: rgba(201,58,58,.07) !important; }

/* inline text-button that looks like a link */
.linkish {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  color: var(--ink); font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--yellow-edge); text-underline-offset: 2px;
}
.linkish:hover { text-decoration-color: var(--ink); }

/* ── Legal / info reading overlay ─────────────────────────────── */
.legal {
  position: fixed; inset: 0; z-index: 3000;
  display: grid; place-items: center;
  padding: 24px;
}
.legal__backdrop { position: absolute; inset: 0; background: rgba(10,10,10,.5); backdrop-filter: blur(2px); }
.legal__panel {
  position: relative;
  width: min(860px, 100%);
  height: min(88vh, 940px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: 0 30px 80px -20px rgba(10,10,10,.5);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: legalIn .22s cubic-bezier(.2,.7,.3,1);
}
@keyframes legalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.legal__close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  background: var(--surface) !important;
  border: 1px solid var(--line);
}
.legal__scroll { overflow: auto; padding: 0; scroll-behavior: smooth; }
.legal__doc { max-width: 660px; margin: 0 auto; padding: 40px 40px 64px; }
.legal__head { padding-right: 48px; }
.legal__title { font-family: var(--f-display); font-size: 34px; line-height: 1.05; margin: 4px 0 0; letter-spacing: -.01em; }

.legal__tabs {
  position: sticky; top: 0; z-index: 4;
  display: flex; gap: 4px; flex-wrap: wrap;
  margin: 18px 0 8px;
  padding: 10px 0;
  background: linear-gradient(var(--bg) 70%, rgba(255,255,255,0));
}
.legal__tab {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px; font-weight: 500;
  color: var(--ink-2); cursor: pointer;
}
.legal__tab:hover { border-color: var(--yellow-edge); }
.legal__tab.is-active { background: var(--yellow); border-color: var(--yellow-edge); color: var(--black); font-weight: 600; }

.legal__summary {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--yellow-soft);
  border: 1px solid var(--yellow-edge);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  font-size: 14.5px; line-height: 1.55;
  margin-bottom: 22px;
}
.legal__summary-mark {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px;
  background: var(--yellow); color: var(--black);
  display: grid; place-items: center;
}
.legal__summary em { font-style: normal; font-weight: 600; }

.legal__lede { font-size: 14.5px; line-height: 1.65; color: var(--ink-2); margin: 0 0 22px; }
.legal__clause { padding: 18px 0; border-top: 1px solid var(--line-2); }
.legal__clause h2 {
  display: flex; gap: 10px; align-items: baseline;
  font-family: var(--f-display); font-size: 19px; font-weight: 600; margin: 0 0 10px;
}
.legal__num { color: var(--yellow-edge); font-variant-numeric: tabular-nums; min-width: 16px; }
.legal__clause p, .legal__clause li { font-size: 14px; line-height: 1.62; color: var(--ink-2); }
.legal__clause p { margin: 0 0 10px; }
.legal__clause ul { margin: 0 0 10px; padding-left: 18px; }
.legal__clause li { margin: 0 0 6px; }
.legal__clause strong { color: var(--ink); font-weight: 600; }
.legal a, .legal__inlink {
  color: var(--ink); font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--yellow-edge);
  text-underline-offset: 2px;
}
.legal__inlink { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.legal__inlink:hover, .legal a:hover { text-decoration-color: var(--ink); }

.legal__kit { margin: 0 0 8px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-md); }
.legal__links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.legal__card-link {
  display: flex; align-items: center; gap: 12px;
  flex: 1 1 220px; min-width: 200px;
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
  text-decoration: none !important; color: var(--ink);
}
.legal__card-link:hover { border-color: var(--yellow-edge); background: var(--yellow-soft); }
.legal__card-link > div { flex: 1; }

@media (max-width: 768px) {
  .legal { padding: 0; }
  .legal__panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .legal__doc { padding: 28px 20px 56px; }
  .legal__title { font-size: 27px; }
}

/* ── Session detail modal ─────────────────────────────────────── */
.sheet {
  position: fixed; inset: 0; z-index: 2500;
  display: grid; place-items: center; padding: 24px;
}
.sheet__backdrop { position: absolute; inset: 0; background: rgba(10,10,10,.5); }
.sheet__panel {
  position: relative;
  width: min(720px, 100%);
  max-height: 88vh; overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: 0 30px 80px -20px rgba(10,10,10,.5);
  display: flex; flex-direction: column;
  animation: legalIn .2s cubic-bezier(.2,.7,.3,1);
}
.sheet__head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; }
.sheet__body { overflow: auto; padding: 0 22px 22px; }
.sheet__foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface); }
.sheet__thanks {
  display: flex; gap: 12px; align-items: center;
  background: var(--yellow-soft); border: 1px solid var(--yellow-edge);
  border-radius: var(--r-md); padding: 12px 14px; margin: 14px 0;
  font-size: 13.5px; line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════
   Mobile corrections — phone-friendly rail, maps, modals
   (loaded last so it wins over earlier rules)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Prevent any stray wide child from causing horizontal scroll */
  html, body { overflow-x: hidden; }

  /* ── Re-assert responsive type + spacing here: the earlier mobile overrides
     are cancelled by the base h1/.pad rules that appear later in the file. This
     block is last, so (equal specificity, later source) it wins without !important
     — and classed headings like .legal__title keep their own sizes. ── */
  h1 { font-size: 27px; line-height: 1.05; }
  h2 { font-size: 21px; }
  h3 { font-size: 16px; }
  .dek { font-size: 14px; }
  .pad-32 { padding: 20px 16px; }
  .pad-24 { padding: 16px; }

  /* ── Sidebar rail: the React tree renders its "expanded" footer/brand on
     mobile (compact keys off variant, not width), so force the compact look. ── */
  .nav__brand { padding: 8px 0 12px; justify-content: center; }
  .nav .brand__logo,
  .nav .brand__logo--compact { width: 38px !important; height: auto !important; margin: 0 !important; }

  .nav__foot { padding: 10px 6px; }
  .nav__foot-col { align-items: center; gap: 8px; }
  .nav__foot-col > .row { justify-content: center; }
  .nav__logout span { display: none; }            /* icon-only logout in the rail */
  .nav__logout { width: 44px; min-width: 44px; padding: 10px; justify-content: center; }
  .avatar { flex: 0 0 32px; }

  /* ── Maps: a height:100% map (review screen) collapses when its grid is
     stacked to one column — give every map a sensible floor. ── */
  .realmap { min-height: 300px; }

  /* Map-anchored review: don't force a tall min-height once stacked */
  .grid[style*="1.4fr"] { min-height: 0 !important; }

  /* ── Workspace head ── */
  .workspace__head { gap: 10px; }
  .workspace__head > div:first-of-type { font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* ── Dashboard "latest walk" caption can wrap rather than squash ── */
  .card .row.between { flex-wrap: wrap; gap: 8px; }

  /* ── Session detail modal: roomy, not cramped ── */
  .sheet { padding: 12px; }
  .sheet__panel { max-height: 92vh; }
  .sheet__head { padding: 16px 16px 10px; }
  .sheet__body { padding: 0 16px 16px; }
  .sheet__foot { padding: 12px 16px; flex-wrap: wrap; }
  .sheet__foot .btn { flex: 1 1 auto; justify-content: center; }
}

/* ── Phones (≤520): full-bleed modals, single-column photo grid ───── */
@media (max-width: 520px) {
  h1 { font-size: 23px; }
  h2 { font-size: 19px; }
  .pad-32 { padding: 16px 12px; }
  .sheet { padding: 0; }
  .sheet__panel { width: 100%; height: 100%; max-height: 100%; border: 0; border-radius: 0; }
  .grid[style*="repeat(6"] { grid-template-columns: repeat(2, 1fr) !important; }

  /* Hero + section headings breathe a little less */
  .dek { font-size: 13.5px; }
  .btn--lg { padding: 11px 16px; }

  /* Chips/filters wrap cleanly */
  .row.gap-8 { flex-wrap: wrap; }
}

/* ── Accessibility & mobile pass ─────────────────────────────────
   Visible keyboard focus, comfortable tap targets, reduced-motion. */
:where(a, button, input, textarea, select, [tabindex], .btn):focus-visible {
  outline: 3px solid var(--moss, #2f6b4f);
  outline-offset: 2px;
  border-radius: 6px;
}
/* Don't show the ring on mouse/touch, only keyboard (focus-visible handles this). */
:where(a, button, .btn):focus:not(:focus-visible) { outline: none; }

/* Comfortable hit areas — WCAG 2.5.5 (≥44px) for icon-only controls on touch. */
@media (pointer: coarse) {
  .btn, button.btn, .btn--icon, .legal__tab, .legal__close { min-height: 44px; }
  .btn--icon { min-width: 44px; }
}

/* Screen-reader-only utility (for icon-only buttons that need a label). */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Honour reduced-motion: drop non-essential transitions/animations. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
