:root {
  --bottom-nav-height: calc(62px + env(safe-area-inset-bottom));
  --ink: #18231E;
  --field: #24382F;
  --moss: #5F7F52;
  --mist: #F4F7F1;
  --amber: #C58B37;
  --red: #B94A48;
  --paper: #FCFDF9;
  --line: rgba(24, 35, 30, 0.14);
  --glass: rgba(244, 247, 241, 0.78);
  --shadow: 0 20px 60px rgba(24, 35, 30, 0.18);
  color: var(--ink);
  background: var(--mist);
  font-family: Seravek, "Gill Sans Nova", Ubuntu, Calibri, "Source Sans Pro", sans-serif;
}

/* Shell — static first paint before the bundle (pub-A5, tokens drift point: palette from lil.ui.tokens) */
#shell { display: flex; flex-direction: column; min-height: 100dvh; background: #F4F7F1; }
.shell-topbar {
  min-height: 52px;
  background: rgba(24,35,30,.72);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(244,247,241,.14);
  flex-shrink: 0;
}
@media (max-width: 719px) { .shell-topbar { padding: 0 16px; } }
.shell-wordmark {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600; font-size: 1.1875rem;
  color: #F4F7F1; letter-spacing: 0;
}
.shell-nav {
  display: flex; gap: 12px; flex: 1 1 220px;
  align-items: center; overflow: hidden;
  font-size: 0.875rem; color: rgba(244,247,241,.62);
}
@media (max-width: 719px) { .shell-nav { display: none; } }
.shell-search {
  display: flex; align-items: center; gap: 10px;
  background: rgba(252,253,249,.70);
  border: 1px solid rgba(24,35,30,.20);
  border-radius: 3px; padding: 9px 14px;
  margin: 18px 18px 8px;
}
.shell-search-icon { display: flex; align-items: center; }
.shell-search-placeholder {
  font-size: 0.875rem; color: rgba(24,35,30,.45);
  font-family: Seravek, "Gill Sans Nova", Ubuntu, Calibri, "Source Sans Pro", sans-serif;
}
.shell-map {
  flex: 1; min-height: 300px;
  margin: 0;
  background: linear-gradient(90deg, #EFE8D6 25%, #C9BC9C 50%, #EFE8D6 75%);
  background-size: 200% 100%;
  animation: lil-shimmer 1.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .shell-map { animation: none; background: #EFE8D6; }
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--mist); }
body { margin: 0; min-height: 100%; letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { min-height: 45px; }
/* icon-only buttons (an svg and nothing else) keep their own size: the global minimum
   made every narrow one an oblong (skin/house-grammar, 2026-09-04) */
button:has(> svg:only-child), button:empty { min-height: 0; }
button { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-140%);
  z-index: 20;
  padding: .75rem 1rem;
  background: var(--paper);
  border: 2px solid var(--moss);
}
.skip-link:focus { transform: translateY(1rem); }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--amber) 18%, transparent);
}
.top-bar :focus-visible,
.bottom-nav :focus-visible,
.btn-ghost:focus-visible {
  outline-color: var(--paper);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 58%, transparent);
}

.app-shell {
  min-height: 100vh;
  padding: 18px 18px calc(var(--bottom-nav-height) + 22px);
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(116px, auto) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 10px 12px;
  color: var(--mist);
  background: color-mix(in srgb, var(--field) 92%, transparent);
  border: 1px solid rgba(244, 247, 241, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.panel .top-bar {
  position: static;
  grid-template-columns: minmax(44px, auto) minmax(0, 1fr) auto;
  min-height: 56px;
  box-shadow: none;
}
.panel .top-bar h1 { font-size: .92rem; }
.panel .top-bar .eyebrow { font-size: .62rem; }
.panel .top-bar .btn span { display: none; }
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 44px;
  color: inherit;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--moss);
  color: var(--paper);
  font-weight: 800;
}
.brand-name {
  max-width: 9ch;
  overflow: hidden;
  font-size: .82rem;
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
}
.route-title {
  min-width: 0;
}
.top-bar h1, .top-bar p { margin: 0; }
.top-bar h1 {
  overflow: hidden;
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-status {
  display: flex;
  justify-content: end;
  min-width: 0;
}
.top-status .status-led {
  color: var(--paper);
  background: rgba(244,247,241,.1);
  border-color: rgba(244,247,241,.2);
}
.top-status .status-led span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-status .status-led.is-done .led-dot { background: #9FCE8A; }
.top-status .status-led.is-warning .led-dot { background: var(--amber); }
.top-status .status-led.is-destructive .led-dot { background: #F09A96; }

.eyebrow {
  margin: 0 0 4px;
  color: color-mix(in srgb, currentColor 68%, transparent);
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant: small-caps;
  letter-spacing: 0.14em;
}

.showcase-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: stretch;
  padding: 28px 0 12px;
}
.showcase-hero h1 {
  max-width: 11ch;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  line-height: .98;
}
.showcase-hero p:not(.eyebrow) {
  max-width: 56ch;
  font-size: 1.05rem;
  line-height: 1.55;
}

.showcase-section {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-head h2 { margin: 0; font-size: 1.35rem; }
.section-body { width: 100%; }

.token-grid, .component-grid, .state-grid, .band-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.component-grid {
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), max-content));
  justify-content: start;
}
.component-grid > .btn {
  justify-self: start;
  min-width: 116px;
}
.composite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 16px;
  align-items: start;
}
.composite-grid > .sheet,
.composite-grid > .panel,
.composite-grid > .alert,
.composite-grid > .toast,
.composite-grid > .map-frame,
.composite-grid > .same-place-card {
  width: 100%;
  min-width: 0;
}
.composite-grid > .map-frame {
  min-height: 420px;
}
.motion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}
.login-layout {
  display: grid;
  place-items: start center;
  padding-top: clamp(28px, 8vh, 72px);
}
.login-panel {
  width: min(100%, 420px);
}
.login-form {
  display: grid;
  gap: 14px;
}
.login-status {
  min-height: 1.25rem;
  margin: 0;
  color: color-mix(in srgb, var(--ink) 66%, transparent);
  font-size: .86rem;
  font-weight: 750;
}
.login-status.is-destructive { color: var(--red); }
.login-status.is-done { color: var(--moss); }
.token, .panel, .metric, .list-row, .same-place-card, .alert, .toast, .motion-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(24, 35, 30, .08);
}
.token {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
}
.swatch {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--token);
  border: 1px solid rgba(0,0,0,.12);
}
code { font-size: .82rem; color: color-mix(in srgb, var(--ink) 64%, transparent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 8px;
  min-width: 44px;
  min-height: 48px;
  max-width: 100%;
  width: fit-content;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  transition: transform var(--exit, 140ms) var(--ease, cubic-bezier(.4,0,.6,1)), background var(--exit, 140ms) var(--ease, cubic-bezier(.4,0,.6,1)), border-color var(--exit, 140ms) var(--ease, cubic-bezier(.4,0,.6,1)), box-shadow var(--exit, 140ms) var(--ease, cubic-bezier(.4,0,.6,1));
  white-space: nowrap;
  overflow-wrap: normal;
  line-height: 1.15;
}
.btn span { min-width: 0; }
.btn:hover { border-color: color-mix(in srgb, var(--moss) 42%, transparent); }
.btn:active, .btn.is-done { transform: scale(.98); }
.btn-primary { color: var(--paper); background: var(--moss); border-color: var(--moss); }
.btn-ghost { color: inherit; background: rgba(244,247,241,.12); }
.btn-danger, .btn.is-destructive { color: var(--paper); background: var(--red); border-color: var(--red); }
.btn-segment { flex: 1; }
.btn[disabled] { cursor: not-allowed; opacity: .48; }
.icon { width: 1.1em; text-align: center; font-weight: 800; }

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.field span { font-size: .82rem; font-weight: 750; }
.field input, .field textarea {
  width: 100%;
  min-height: 45px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--paper);
}
.field select,
select {
  width: 100%;
  min-height: 45px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--paper);
}
.field.is-invalid input { border-color: var(--red); }
.textarea { grid-column: span 2; }

.segmented {
  display: flex;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--field) 8%, var(--paper));
}
.segmented .btn {
  min-width: min(100%, 96px);
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.wrap { flex-wrap: wrap; }

.chip, .status-led {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: .86rem;
  font-weight: 750;
  white-space: nowrap;
  overflow-wrap: normal;
  line-height: 1.15;
}
.chip.is-warning, .status-led.is-warning { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 42%, transparent); }
.chip.is-done, .status-led.is-done { color: var(--moss); border-color: color-mix(in srgb, var(--moss) 42%, transparent); }
.chip.is-destructive, .status-led.is-destructive { color: var(--red); border-color: color-mix(in srgb, var(--red) 42%, transparent); }
.led-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.metric {
  display: grid;
  gap: 7px;
  padding: 16px;
}
.metric span, .metric small { color: color-mix(in srgb, var(--ink) 64%, transparent); }
.metric strong { font-size: 1.7rem; }

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 16px;
}
.list-row div { display: grid; gap: 6px; min-width: 0; }
.list-row span { overflow-wrap: anywhere; }
.review-queue-row,
.export-action-row {
  min-width: 0;
}
.review-queue-row > .row,
.export-action-row > .row {
  justify-content: flex-end;
}

.map-frame {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--field) 22%, transparent);
  background:
    linear-gradient(35deg, rgba(95,127,82,.24), transparent 42%),
    linear-gradient(145deg, rgba(197,139,55,.18), transparent 35%),
    var(--mist);
  box-shadow: var(--shadow);
}
.map-frame.is-interactive {
  touch-action: none;
  cursor: grab;
}
.map-frame.is-interactive.is-panning {
  cursor: grabbing;
}
.capture-layout > .map-frame,
.public-map-frame {
  aspect-ratio: 4 / 3;
  min-height: min(60vh, 460px);
}
.osm-tiles {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  opacity: .88;
  filter: saturate(.72) contrast(.96);
}
.osm-tiles img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--mist);
  user-select: none;
  pointer-events: none;
}
.map-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(36,56,47,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36,56,47,.12) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: .32;
  mix-blend-mode: multiply;
}
.pin {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -22px;
  border-radius: 50%;
  color: var(--paper);
  background: var(--moss);
  box-shadow: 0 10px 28px rgba(24,35,30,.32);
}
.accuracy-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 132px;
  height: 132px;
  margin: -66px;
  border-radius: 50%;
  border: 2px solid rgba(95,127,82,.45);
  background: rgba(95,127,82,.12);
  animation: accuracy-pulse 1800ms ease-in-out infinite;
}
.map-controls {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  backdrop-filter: blur(16px);
}
.map-controls .btn {
  min-width: 40px;
  min-height: 40px;
  padding-inline: 8px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  font-size: 1rem;
  font-weight: 800;
}
.map-nav-pad .btn {
  min-width: 32px;
  width: 32px;
  min-height: 32px;
  padding-inline: 0;
  font-size: 1.06rem;
  line-height: 1;
}
.map-zoom-controls {
  display: flex;
  gap: 6px;
}
.map-action-status {
  grid-column: 1 / -1;
  min-height: 20px;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
  font-size: .72rem;
  font-weight: 750;
  line-height: 1.25;
}
.map-readout {
  justify-self: end;
  max-width: 15ch;
  overflow: hidden;
  color: color-mix(in srgb, var(--ink) 68%, transparent);
  font-size: .74rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-nav-pad {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  display: grid;
  grid-template-columns: 32px 32px 32px;
  grid-template-rows: 32px 32px 32px;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(244,247,241,.78);
  backdrop-filter: blur(14px);
}
.map-pad-label {
  display: grid;
  place-items: center;
  grid-column: 2;
  grid-row: 2;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--field);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  font-size: .66rem;
  font-weight: 900;
}
.map-nav-pad .btn:nth-child(2) { grid-column: 2; grid-row: 1; }
.map-nav-pad .btn:nth-child(3) { grid-column: 1; grid-row: 2; }
.map-nav-pad .btn:nth-child(4) { grid-column: 3; grid-row: 2; }
.map-nav-pad .btn:nth-child(5) { grid-column: 2; grid-row: 3; }
.map-attribution {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: color-mix(in srgb, var(--ink) 74%, transparent);
  background: rgba(244,247,241,.82);
  font-size: .72rem;
  font-weight: 800;
  backdrop-filter: blur(12px);
}

.sheet {
  display: grid;
  align-content: start;
  min-height: var(--sheet-detent, 50vh);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  animation: sheet-rise var(--move, 175ms) var(--ease, cubic-bezier(.4,0,.6,1)) both;
}
.composite-grid .sheet {
  min-height: clamp(300px, 34vh, 420px);
}
.sheet-handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(24,35,30,.24);
}
.sheet h3 { margin: 0 0 14px; }
.sheet > * + * { margin-top: 12px; }

.alert, .toast, .same-place-card, .panel, .motion-card { padding: 16px; }
.alert, .toast, .same-place-card, .panel, .motion-card, .sheet, .metric, .list-row {
  max-width: 100%;
}
.alert {
  display: grid;
  gap: 4px;
  border-width: 1px;
  border-left-width: 1px;
  border-color: color-mix(in srgb, var(--amber) 32%, var(--line));
  background: color-mix(in srgb, var(--amber) 9%, var(--paper));
}
.alert.is-destructive {
  border-color: color-mix(in srgb, var(--red) 36%, var(--line));
  background: color-mix(in srgb, var(--red) 8%, var(--paper));
}
.alert.is-warning {
  border-color: color-mix(in srgb, var(--amber) 32%, var(--line));
  background: color-mix(in srgb, var(--amber) 9%, var(--paper));
}
.toast {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}
.toast.is-animated { animation: toast-in var(--move, 175ms) var(--ease, cubic-bezier(.4,0,.6,1)) both; }
.toast.is-leaving { animation: toast-out var(--exit, 140ms) var(--ease, cubic-bezier(.4,0,.6,1)) both; }
.toast-viewport {
  position: fixed;
  left: 50%;
  top: calc(14px + env(safe-area-inset-top));
  z-index: 60;
  display: grid;
  justify-items: center;
  width: min(100% - 28px, 420px);
  min-height: 1px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast-viewport .toast {
  width: fit-content;
  pointer-events: auto;
}
.same-place-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.same-place-card h3, .same-place-card p { margin: 0; }
.same-place-card h3,
.same-place-card p {
  overflow-wrap: anywhere;
}
.choice-status {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 68%, transparent);
  font-size: .82rem;
  font-weight: 750;
  line-height: 1.35;
}
.same-place-card[data-choice="existing-place"] {
  border-color: color-mix(in srgb, var(--moss) 46%, var(--line));
}
.same-place-card[data-choice="new-place"] {
  border-color: color-mix(in srgb, var(--amber) 46%, var(--line));
}
.same-place-card .row {
  flex-wrap: wrap;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 3px 8px calc(3px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: color-mix(in srgb, var(--field) 92%, transparent);
  color: var(--mist);
  box-shadow: 0 -10px 28px rgba(24, 35, 30, .16);
  backdrop-filter: blur(18px);
}
.app-shell > .bottom-nav {
  position: fixed;
}
.bottom-nav a {
  display: grid;
  place-items: center;
  gap: 0;
  min-height: 44px;
  border-radius: 6px;
  font-size: .64rem;
  line-height: 1.05;
}
.bottom-nav a.active { background: var(--moss); color: var(--paper); }
.bottom-nav.is-embedded {
  position: static;
  inset: auto;
  margin-top: auto;
  box-shadow: none;
}
.bottom-nav.is-embedded a span { display: none; }
.bottom-nav.is-embedded .icon {
  width: auto;
  font-size: .9rem;
}
.bottom-nav:not(.is-embedded) .icon {
  font-size: .72rem;
  line-height: 1;
}
.app-shell-sample {
  display: flex;
  flex-direction: column;
  min-height: 300px;
}
.app-shell-sample .bottom-nav {
  grid-template-columns: repeat(5, minmax(44px, 1fr));
}

.journey-screen {
  display: grid;
  gap: 18px;
  align-content: start;
}
.route-alert {
  margin-top: 12px;
}
.journey-screen > section,
.journey-screen > main {
  min-height: auto;
  padding: 0;
}
.journey-screen .hero-panel h1 {
  max-width: 14ch;
  font-size: clamp(2rem, 12vw, 3.4rem);
  line-height: 1;
}
.collector-home-view .route-header {
  display: grid;
  gap: 4px;
}
.collector-home-view .route-header h1 {
  margin: 0;
}
.collect-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding-bottom: 14px;
}
.collect-actions .btn {
  width: min(100%, 260px);
  justify-content: center;
}
@media (max-width: 520px) {
  .collect-actions .btn {
    flex: 1 1 150px;
  }
}
.collected-summary {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: color-mix(in srgb, var(--ink) 68%, transparent);
  font-size: .88rem;
}
.collected-summary .eyebrow {
  margin: 0;
}
.collected-summary .list-stack {
  gap: 6px;
}
.collected-summary .list-row {
  padding: 8px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.media-capture-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.media-capture-actions .btn {
  width: 100%;
}
.ios-switch {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 32px;
  min-width: 52px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}
.switch-track {
  position: relative;
  display: block;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 18%, var(--paper));
  transition: background var(--move) var(--ease);
}
.ios-switch.is-on .switch-track {
  background: var(--moss);
}
.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 2px 6px rgba(24, 35, 30, .24);
  transition: transform var(--move) var(--ease);
}
.ios-switch.is-on .switch-thumb {
  transform: translateX(20px);
}

.hero-panel,
.status-card,
.story-card,
.media-card,
.review-card,
.queue-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(24, 35, 30, .08);
}
.hero-panel,
.status-card,
.story-card,
.media-card,
.review-card {
  padding: clamp(18px, 3.6vw, 24px);
}
.hero-panel h1,
.status-card h2,
.story-card h2 {
  margin: 0;
}
.action-grid,
.summary-grid,
.story-fields,
.capture-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}
.section-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-block: 14px;
}
.section-stepper .eyebrow {
  flex-basis: 100%;
  margin: 0;
}
.nav-button,
button.primary,
button.secondary,
.tappable {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 45px;
  max-width: 100%;
  width: fit-content;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
}
.nav-button.active,
button.primary {
  color: var(--paper);
  border-color: var(--moss);
  background: var(--moss);
}
button.secondary {
  background: color-mix(in srgb, var(--field) 8%, var(--paper));
}
.step-number,
.status-pill {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--field);
  background: color-mix(in srgb, var(--moss) 14%, var(--paper));
  font-size: .78rem;
  font-weight: 800;
}
.sticky-footer,
.section-header,
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.sticky-footer {
  gap: 12px;
  padding-block: 8px;
}
.sticky-footer .btn {
  min-width: min(100%, 132px);
}
.queue-list,
.media-list,
.manifest-list {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}
.queue-card,
.manifest-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  padding: 12px;
}
.queue-status-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.queue-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.queue-card small,
.manifest-row small {
  color: color-mix(in srgb, var(--ink) 64%, transparent);
  overflow-wrap: anywhere;
}
.queue-card .btn,
.manifest-row .btn {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
}
.manifest-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 10px;
}
.manifest-row small {
  grid-column: 2;
}
.manifest-row .btn {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.collection-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: end;
  padding: 16px;
  background: rgba(24, 35, 30, .32);
}
.collection-action-sheet {
  width: min(100%, 560px);
  justify-self: center;
  min-height: auto;
}
.collection-toast,
.admin-toast {
  position: fixed;
  left: 50%;
  top: calc(14px + env(safe-area-inset-top));
  z-index: 60;
  width: fit-content;
  max-width: min(420px, calc(100vw - 28px));
  transform: translateX(-50%);
}
.collection-toast.is-animated,
.admin-toast.is-animated {
  animation: fixed-toast-in var(--move, 175ms) var(--ease, cubic-bezier(.4,0,.6,1)) both;
}
.collection-toast.is-leaving,
.admin-toast.is-leaving {
  animation: fixed-toast-out var(--exit, 140ms) var(--ease, cubic-bezier(.4,0,.6,1)) both;
}

.media-mode-control {
  margin-top: 12px;
}
.youtube-url-panel,
.youtube-preview-card {
  display: grid;
  gap: 12px;
}
.youtube-embed-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--field) 10%, var(--paper));
}
.youtube-embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.youtube-link-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-height: 45px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-weight: 750;
}
.url-metadata {
  display: grid;
  gap: 8px;
  margin: 0;
}
.url-metadata div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.url-metadata dt {
  color: color-mix(in srgb, var(--ink) 64%, transparent);
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant: small-caps;
  letter-spacing: 0.14em;
}
.url-metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.capture-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
  padding-top: 18px;
}
.capture-layout > .sheet {
  min-height: auto;
  overflow: visible;
}
.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--field) 14%, var(--paper));
}
.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--moss);
}
.progress.is-animated span {
  width: 72%;
  animation: progress-sweep 2400ms ease-in-out infinite;
}

.motion-card {
  display: grid;
  gap: 12px;
  min-height: 180px;
  align-content: start;
}
.press-demo .btn { animation: press-breathe 1800ms ease-in-out infinite; }
.mini-map {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(35deg, rgba(95,127,82,.24), transparent 42%),
    linear-gradient(90deg, rgba(36,56,47,.12) 1px, transparent 1px),
    linear-gradient(rgba(36,56,47,.12) 1px, transparent 1px),
    var(--mist);
  background-size: auto, 28px 28px, 28px 28px, auto;
}
.mini-ring, .mini-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.mini-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid rgba(95,127,82,.45);
  background: rgba(95,127,82,.12);
  animation: accuracy-pulse 1800ms ease-in-out infinite;
}
.mini-pin {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 10px 28px rgba(24,35,30,.32);
}
.focus-target {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mist);
  font-weight: 800;
}

@keyframes sheet-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(10px) scale(.98); }
}
@keyframes fixed-toast-in {
  from { opacity: 0; transform: translate(-50%, 10px) scale(.98); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes fixed-toast-out {
  from { opacity: 1; transform: translate(-50%, 0) scale(1); }
  to { opacity: 0; transform: translate(-50%, 10px) scale(.98); }
}
@keyframes accuracy-pulse {
  0%, 100% { transform: scale(.92); opacity: .62; }
  50% { transform: scale(1.05); opacity: 1; }
}
@keyframes progress-sweep {
  0% { width: 18%; }
  65% { width: 72%; }
  100% { width: 72%; }
}
@keyframes press-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(.98); }
}
.coordinate {
  margin: 4px 0 2px;
  padding: 12px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--field) 8%, var(--paper));
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.place-bands {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.place .capture-layout {
  align-items: start;
}
.place-bands .chip {
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding-inline: 12px;
}
.place-alert {
  gap: 6px;
  padding: 14px;
  line-height: 1.32;
}
.place-alert .btn {
  justify-self: start;
  margin-top: 4px;
}
.place-alert[data-acknowledged="true"] {
  border-color: color-mix(in srgb, var(--moss) 42%, var(--line));
  background: color-mix(in srgb, var(--moss) 9%, var(--paper));
}
.place-alert strong {
  font-size: 1rem;
  line-height: 1.2;
}
.place .same-place-card {
  padding: 14px;
  gap: 10px;
}
.place .sheet {
  gap: 2px;
  padding: clamp(14px, 2.6vw, 18px);
}
.place .same-place-card .row {
  margin-top: 2px;
}
.place-actions {
  flex-wrap: wrap;
  padding-top: 4px;
  padding-bottom: calc(68px + env(safe-area-inset-bottom));
}
.place-actions .btn {
  min-width: 96px;
}
.place > .bottom-nav {
  margin-top: 0;
}

@media (max-width: 860px) {
  .showcase-hero, .capture-layout { grid-template-columns: 1fr; }
  .showcase-hero h1 { max-width: 12ch; font-size: 3.1rem; }
  .textarea { grid-column: auto; }
  .map-frame { min-height: 330px; }
  .capture-layout > .map-frame,
  .public-map-frame {
    min-height: auto;
    aspect-ratio: 4 / 3;
  }
  .component-grid { grid-template-columns: 1fr; }
  .composite-grid, .motion-grid { grid-template-columns: 1fr; }
  .section-head {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 460px) {
  .app-shell {
    padding: 14px 14px calc(var(--bottom-nav-height) + 14px);
  }
  .top-bar {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 9px;
  }
  .brand-lockup {
    width: 44px;
  }
  .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .top-status .status-led {
    max-width: 112px;
    padding-inline: 8px;
    font-size: .76rem;
  }
  .place {
    padding-inline: 16px;
  }
  .place .sheet {
    padding: 14px;
  }
  .place-bands {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .place-actions {
    gap: 8px;
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }
  .place-actions .btn {
    flex: 1 1 130px;
  }
  .place-alert,
  .place .same-place-card {
    padding: 14px;
  }
  .nav-button,
  button.primary,
  button.secondary,
  .tappable {
    width: 100%;
    white-space: normal;
  }
  .review-queue-row,
  .export-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  .review-queue-row > .row,
  .export-action-row > .row {
    justify-content: start;
  }
  .review-queue-row .chip,
  .review-queue-row .status-led,
  .export-action-row .chip,
  .export-action-row .status-led {
    white-space: normal;
  }
}

@media (min-width: 861px) {
  .app-shell { padding-bottom: calc(var(--bottom-nav-height) + 28px); }
  .bottom-nav a {
    grid-template-columns: 24px auto;
    grid-auto-flow: column;
    gap: 8px;
    font-size: .84rem;
  }
}

@media (max-width: 520px) {
  .segmented {
    display: grid;
    grid-template-columns: 1fr;
  }
  .segmented .btn {
    width: 100%;
    min-width: 0;
  }
}

/* Reduced motion is rung 0 of the level-of-detail ladder (html[data-lod="0"],
   set at runtime by lil.ui.primitives/select-rung!); the rung's rules live in the
   token style block. This branch only covers the instant before the runtime runs. */
html:not([data-lod]) {
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      transition-duration: 0.001ms !important;
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      scroll-behavior: auto !important;
    }
  }
}

/* --- House grammar additions (skin/house-grammar) --------------------------- */

/* phone header: one-row bar (brand + menu + lang); nav drops down from menu button.
   The inline nav is not rendered inside .lil-top-bar on mobile, so these rules
   only style the dropdown nav rendered as a sibling element below the header. */
@media (max-width: 719px) {
  .lil-top-bar { padding: 0 16px !important; flex-wrap: nowrap !important; }
  .lil-top-nav { scrollbar-width: none; }
  .lil-top-nav::-webkit-scrollbar { display: none; }
  .lil-top-nav > * { white-space: nowrap; flex-shrink: 0; }
}

/* the record card is the sheet on phones: rises from the bottom edge (Junk 2026-09-04) */
@media (max-width: 719px) {
  .lil-record-card {
    top: auto !important; right: 0 !important; left: 0 !important; bottom: 0 !important;
    width: auto !important; height: var(--sheet-h, 58%) !important;
    transition: height var(--move) var(--ease);
    border-radius: 12px 12px 0 0 !important;
    animation-name: atlas-sheet-rise !important;
  }
  .lil-record-card [role="button"][aria-label$="the sheet"] { touch-action: none; }
}

/* Press by pressure: compress and darken, never brighten; 0 ms attack. */
.btn:active, .atlas-press:active, .lil-btn:active {
  transform: scale(var(--press-scale, .93));
  box-shadow: inset 0 0 0 999px rgba(24,20,10,.08);
  transition: none;
}

/* Rows follow the container: explicit 48 ms stagger, 18 px rise and fade. */
.lil-stagger > * { animation: lil-row-in var(--move, 175ms) var(--ease-out, cubic-bezier(.2,0,.4,1)) both; animation-delay: calc(var(--lead, 105ms) + var(--stagger, 48ms) * var(--i, 0)); }
.lil-stagger > :nth-child(1) { --i: 0; } .lil-stagger > :nth-child(2) { --i: 1; } .lil-stagger > :nth-child(3) { --i: 2; }
.lil-stagger > :nth-child(4) { --i: 3; } .lil-stagger > :nth-child(5) { --i: 4; } .lil-stagger > :nth-child(6) { --i: 5; }
.lil-stagger > :nth-child(7) { --i: 6; } .lil-stagger > :nth-child(n+8) { --i: 7; }
@keyframes lil-row-in { from { opacity: 0; transform: translateY(var(--rise, 18px)); } to { opacity: 1; transform: none; } }

/* Reveal candidate A: relief and light on the terrain layer (rung ≥ 2 only).
   A multiply pass lit from the north-west over the Leaflet tile pane; no chrome element. */
html[data-relief="on"][data-lod="2"] .leaflet-container::after,
html[data-relief="on"][data-lod="3"] .leaflet-container::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  z-index: 450; /* above the map pane (400: tiles, polygons, markers), below the controls (800) */
  background:
    radial-gradient(120% 90% at 18% 12%, rgba(255,246,222,.30) 0%, rgba(255,246,222,0) 55%),
    linear-gradient(155deg, rgba(255,250,235,.12) 0%, rgba(24,20,10,0) 45%, rgba(24,20,10,.26) 100%);
  mix-blend-mode: multiply;
}
html[data-relief="on"][data-lod="2"] .leaflet-tile-pane img,
html[data-relief="on"][data-lod="3"] .leaflet-tile-pane img { filter: contrast(1.06) saturate(.92); }

/* The one overlay ground: leather or dimmed paper (skin choice, showcase group 3). */
html[data-ground="leather"] .lil-overlay-ground { background: #2A2724 var(--leather-tile, none); background-size: 768px 768px; }
html[data-ground="leather-field"] .lil-overlay-ground { background: #24382F var(--leather-tile, none); background-size: 768px 768px; background-blend-mode: luminosity; }

/* Attribution override — legible paper-register line */
.leaflet-container .leaflet-control-attribution {
  font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: rgba(42, 36, 22, .72);
  background: rgba(239, 232, 214, .88);
  padding: 3px 10px;
  border-radius: 2px 0 0 0;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.leaflet-container .leaflet-control-attribution a {
  color: rgba(42, 36, 22, .72);
  text-decoration: none;
  pointer-events: none;
}

/* Leaflet tooltip reset for all parcel/estate classes */
.parcel-pill.leaflet-tooltip,
.parcel-slat.leaflet-tooltip,
.estate-label.leaflet-tooltip {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.parcel-pill.leaflet-tooltip::before,
.parcel-slat.leaflet-tooltip::before,
.estate-label.leaflet-tooltip::before {
  display: none;
}

/* Parcel name pills — Leaflet permanent tooltips styled as material pills */
.parcel-pill {
  background: rgba(95,127,82,.85);
  color: #fff;
  font-family: "Seravek", "Gill Sans Nova", Ubuntu, Calibri, sans-serif;
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 10px;
  border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  white-space: nowrap;
  pointer-events: none;
}
.parcel-pill::before {
  display: none;
}
.parcel-pill--boundary-marker  { background: rgba(204,58,56,.80); }
.parcel-pill--cultural-feature { background: rgba(176,120,40,.80); }
.parcel-pill--natural-resource { background: rgba(52,128,96,.80); }
.parcel-pill--sacred-place     { background: rgba(204,136,16,.80); }
.parcel-pill--landmark         { background: rgba(69,128,56,.80); }
.parcel-pill--facility         { background: rgba(69,128,56,.80); }
.parcel-pill--livelihood       { background: rgba(152,112,16,.80); }
.parcel-pill--lookout          { background: rgba(40,104,128,.80); }

/* Slat label — rotated name on polygon geometry */
.parcel-slat {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  pointer-events: none;
}
.parcel-slat::before {
  display: none;
}

/* Community estate boundaries.
   The .leaflet-tooltip compound selector out-specifies Leaflet's own
   stylesheet, which loads after this file and otherwise wins the color. */
.estate-label,
.estate-label.leaflet-tooltip {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(24,35,30,.9), 0 0 12px rgba(24,35,30,.7), 0 0 24px rgba(24,35,30,.5);
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}
.estate-label::before {
  display: none;
}

/* Footer-legal line */
.footer-legal {
  font-size: 0.5625rem;
  color: rgba(24,35,30,.38);
  letter-spacing: 0.02em;
  text-align: center;
  padding: 8px 24px;
}

/* Masonry responsive breakpoints */
@media (max-width: 900px) {
  [data-view="stories-grid"] { columns: 2 !important; }
}
@media (max-width: 600px) {
  [data-view="stories-grid"] { columns: 1 !important; }
}

/* Frosted-glass material for map overlay panels (Junk ruling, demo day 2026-08-27):
   translucent paper over blurred terrain; text stays fully legible. */
.glass-panel {
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
}

/* Ghost pin riding the cursor while add-story placement is armed */
.add-story-cursor-pin {
  background: transparent;
  border: none;
  pointer-events: none;
}
