/* The Trials Line — web app. Design system ported from the iOS app (Theme.swift):
   bold ink outlines, heavy-condensed display font, monospaced uppercase labels. */
:root {
  --paper: #F5F1EA;
  --ink: #2D2D2D;
  --pumpkin: #FD7014;
  --line: #DAD2C2;
  --muted: #7A7062;
  --surface: #FFFCF7;      /* near-white warm (Theme.surface) */
  --white: #ffffff;
  --danger: #C02222;
  --pumpkin-soft: #FFF0E6;

  /* radii (Theme.Radius) */
  --r-button: 14px;
  --r-card: 16px;
  --r-sheet: 22px;
  --r-chip: 999px;

  --shadow-card: 0 10px 24px rgba(0,0,0,0.10);
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.14);

  /* Body = system (SF on Apple); display = heavy condensed (SF Condensed on
     Apple, Saira Condensed elsewhere); labels = monospaced. */
  --font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Saira Condensed", "Arial Narrow", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
#app { height: 100vh; height: 100dvh; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* Heavy-condensed display type — the app's `.display(n)`. */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 75%;
  letter-spacing: 0.2px;
  line-height: 1.02;
}
/* ---------- SF Symbol icons ----------
   Real SF Symbols exported from macOS (assets/icons/*.png) applied as CSS masks
   so they tint with `currentColor` exactly like SwiftUI's foregroundStyle. */
.sfi {
  display: inline-block; width: 18px; height: 18px; flex: none; vertical-align: middle;
  background-color: currentColor;
  -webkit-mask-image: var(--sfi); mask-image: var(--sfi);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.icon-btn .sfi, .chev-btn .sfi, .round-btn .sfi,
.input-wrap .ghost-btn .sfi, .btn .sfi { width: 18px; height: 18px; }
.fab .sfi { width: 24px; height: 24px; }
.m-ride .sfi { width: 15px; height: 15px; }
.use-mine .sfi, .checkrow .box .sfi, .tour-card .close .sfi, .photo-pick .cam .sfi { width: 14px; height: 14px; }
.select-card .tick .sfi { width: 20px; height: 20px; }
.menu-item .chev .sfi, .privacy-note .sfi, .search-item .ic .sfi { width: 16px; height: 16px; }
.avatar .sfi { width: 34px; height: 34px; }
.finish .check .sfi { width: 64px; height: 64px; }

/* Monospaced uppercase label — the app's mono field labels / eyebrows. */
.mono-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Boot splash ---------- */
.boot-splash {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px; background: var(--paper);
}
.boot-splash .brand-logo { width: 240px; max-width: 62%; }
.boot-wordmark { display: block; width: 300px; max-width: 72%; height: auto; }
.brand-logo { display: block; width: 240px; max-width: 74%; height: auto; margin: 0 auto; }
.boot-spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--pumpkin);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Brand lockup ---------- */
.brand-lockup { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.brand-lockup .brand-mark { width: 92px; }
.brand-lockup .wordmark {
  font-family: var(--font-display); font-weight: 800; font-stretch: 75%;
  font-size: 30px; letter-spacing: 1.5px; color: var(--ink); line-height: 1;
}

/* ---------- Screens (auth / onboarding) ---------- */
.screen { height: 100%; overflow-y: auto; background: var(--paper); }
.screen-pad { max-width: 460px; margin: 0 auto; padding: 20px; min-height: 100%; display: flex; flex-direction: column; }

/* icon button (back chevron etc.) */
.icon-btn {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--white); border: 1.5px solid var(--ink); border-radius: 10px; color: var(--ink);
}
.icon-btn svg { width: 17px; height: 17px; }

.nav-row { display: flex; align-items: center; justify-content: space-between; min-height: 38px; margin-bottom: 8px; }
.text-link { background: none; border: none; color: var(--ink); font-size: 12px; font-weight: 600; text-decoration: underline; padding: 4px; }
.text-link.muted { color: var(--muted); text-decoration: none; }

.hero-title { font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: 30px; color: var(--ink); margin: 4px 0 2px; letter-spacing: 0.5px; }
.hero-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

/* segmented control (Sign in | Create account) */
.segment { display: flex; border: 1.5px solid var(--ink); border-radius: 10px; overflow: hidden; margin-bottom: 18px; }
.segment button {
  flex: 1; padding: 10px 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.4px;
  text-transform: uppercase; background: var(--white); color: var(--ink); border: none;
}
.segment button.on { background: var(--ink); color: var(--white); }

/* fields — white with a bold ink outline (the app's field style) */
.field { margin-bottom: 14px; }
.field > label { display: block; margin-bottom: 6px; }
.input-wrap {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px;
  background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--r-button);
}
.input-wrap:focus-within { box-shadow: 0 0 0 3px rgba(253,112,20,0.18); }
.input-wrap input { flex: 1; border: none; outline: none; background: transparent; font-size: 15px; color: var(--ink); height: 100%; }
.input-wrap .ghost-btn { background: none; border: none; color: var(--muted); display: flex; padding: 4px; }
.input-wrap .ghost-btn svg { width: 18px; height: 18px; }
textarea.tl {
  width: 100%; padding: 12px; font-size: 15px; background: var(--white);
  border: 1.5px solid var(--ink); border-radius: var(--r-button); color: var(--ink);
  outline: none; resize: vertical; min-height: 84px;
}
textarea.tl:focus { box-shadow: 0 0 0 3px rgba(253,112,20,0.18); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Date-of-birth month / day / year selectors — far faster than scrolling a
   native date spinner back through decades (type a year to jump straight to it). */
.dob-row { display: flex; gap: 8px; }
.dob-select {
  height: 46px; padding: 0 30px 0 12px; font-size: 15px; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--r-button);
  outline: none; -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232D2D2D' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
}
.dob-select:focus { box-shadow: 0 0 0 3px rgba(253,112,20,0.18); }
.dob-row > .dob-select:nth-child(1) { flex: 1.5; }  /* month (name is widest) */
.dob-row > .dob-select:nth-child(2) { flex: 0.8; }  /* day */
.dob-row > .dob-select:nth-child(3) { flex: 1.1; }  /* year */

/* buttons — PumpkinButtonStyle / InkButtonStyle (radius 14, minHeight 48) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; padding: 0 16px; font-size: 15px; font-weight: 600;
  border-radius: var(--r-button); border: none; color: var(--white); background: var(--pumpkin);
  transition: transform 0.12s, filter 0.15s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.4; }
.btn.ink { background: var(--ink); }
.btn.outline { background: var(--white); color: var(--ink); border: 1.5px solid var(--ink); }

.form-msg { font-size: 13px; margin: 4px 0 12px; padding: 10px 12px; border-radius: 10px; line-height: 1.4; }
.form-msg.error { background: #FDE8E4; color: #A23214; border: 1px solid #F3B8A6; }
.form-msg.info { background: #EAF3EC; color: #2C6B3D; border: 1px solid #B9DBC2; }

/* terms checkbox row */
.checkrow { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; color: var(--ink); line-height: 1.4; }
.checkrow .box {
  width: 20px; height: 20px; flex: none; border: 1.5px solid var(--muted); border-radius: 5px;
  display: flex; align-items: center; justify-content: center; color: transparent; margin-top: 1px;
}
.checkrow.on .box { background: var(--ink); border-color: var(--ink); color: #fff; }
.checkrow .box svg { width: 13px; height: 13px; }
.terms-links { display: flex; gap: 16px; justify-content: center; margin-top: 10px; }

/* ---------- Welcome slides (pre-signin, ports iOS WelcomeView) ---------- */
.welcome { height: 100%; display: flex; flex-direction: column; background: var(--paper); }
.welcome-top { display: flex; justify-content: flex-end; padding: 12px 24px 0; }
.welcome-top .skip { background: none; border: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px; }
.welcome-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 24px; overflow: hidden; }
.slide { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; width: 100%; }
.slide-hero { gap: 18px; }
.slide-hero .brand-logo { max-width: 300px; width: 300px; }
.hero-copy { font-size: 14px; color: var(--muted); text-align: center; line-height: 1.55; margin: 0; }

.slide-copy { max-width: 310px; text-align: center; padding-top: 24px; }
.slide-copy .eyebrow { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--pumpkin); }
.slide-copy h2 { font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: 28px; color: var(--ink); margin: 8px 0 0; }
.slide-copy p { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin: 8px 0 0; }

.scene-card {
  position: relative; width: 250px; height: 210px; background: #fff;
  border: 1.5px solid var(--ink); border-radius: var(--r-card);
  box-shadow: 0 5px 10px rgba(0,0,0,0.08); overflow: hidden; flex: none;
}
.scene-grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-item { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; }
.scene-ring { border: 1.5px dashed rgba(253,112,20,0.5); border-radius: 50%; }
.scene-pin { color: var(--pumpkin); display: flex; }
.scene-pin .sfi { width: 26px; height: 26px; }

.dots { display: flex; gap: 6px; justify-content: center; padding-bottom: 18px; }
.dots .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--line); transition: width 0.28s, background 0.28s; }
.dots .dot.on { width: 22px; background: var(--pumpkin); }

.welcome-actions { padding: 0 24px; display: flex; flex-direction: column; align-items: center; }
.welcome-actions .btn { width: 100%; }
.welcome-foot {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--muted); text-align: center; padding: 14px 0 20px;
}

/* ---------- Onboarding wizard ---------- */
.wizard { height: 100%; display: flex; flex-direction: column; background: var(--paper); }
.wizard-top { padding: 16px 20px 12px; }
.wizard-top .row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.wizard-top .step-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.progress-track { display: flex; gap: 4px; }
.progress-track .seg { flex: 1; height: 3px; border-radius: 2px; background: var(--line); transition: background 0.28s; }
.progress-track .seg.on { background: var(--pumpkin); }
.chev-btn { background: none; border: none; color: var(--ink); display: flex; padding: 4px; }
.chev-btn svg { width: 18px; height: 18px; }
.chev-btn[disabled] { color: transparent; }

.wizard-body { flex: 1; overflow-y: auto; padding: 8px 24px 24px; }
.step-title { font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: 32px; color: var(--ink); }
.step-sub { color: var(--muted); font-size: 14px; margin: 6px 0 20px; }

.wizard-footer { padding: 12px 24px 24px; border-top: 1px solid var(--line); background: var(--paper); }

/* selection cards (skill / bike) — ink fill when chosen, like the app */
.select-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 16px; margin-bottom: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-button); color: var(--ink);
  transition: background 0.2s, border-color 0.2s;
}
.select-card.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.select-card .t { display: block; font-size: 15px; font-weight: 700; }
.select-card .d { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.select-card.on .d { color: rgba(255,255,255,0.8); }
.select-card .grow { flex: 1; display: flex; flex-direction: column; }
.select-card .tick { color: #fff; display: none; }
.select-card.on .tick { display: block; }
.select-card .tick svg { width: 20px; height: 20px; }

/* avatar as rounded-rect with ink bg + pumpkin display initials (RiderInfoCard) */
.avatar {
  border-radius: 18px; background: var(--ink); color: var(--pumpkin);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-stretch: 75%;
  background-size: cover; background-position: center; overflow: hidden;
}

/* location "Use mine" pill */
.use-mine {
  display: inline-flex; align-items: center; gap: 5px; padding: 0 14px; height: 46px;
  background: var(--ink); color: #fff; border: none; border-radius: var(--r-chip);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.use-mine svg { width: 13px; height: 13px; }

/* range slider tinted pumpkin */
input[type="range"] { width: 100%; accent-color: var(--pumpkin); }

/* area-search autocomplete */
.area-suggests { margin-top: 8px; border: 1.5px solid var(--line); border-radius: var(--r-button); overflow: hidden; background: var(--surface); }
.area-sug { display: block; width: 100%; text-align: left; padding: 10px 12px; background: none; border: none; border-bottom: 1px solid var(--line); }
.area-sug:last-child { border-bottom: none; }
.area-sug:hover { background: var(--paper); }
.area-sug .t { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.area-sug .s { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.finish {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; text-align: center; padding: 24px; background: var(--paper);
}
.finish .check { width: 64px; height: 64px; color: var(--pumpkin); }
.finish h1 { font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: 44px; margin: 0; color: var(--ink); }
.finish p { color: var(--muted); font-size: 16px; max-width: 300px; margin: 0; }

/* ---------- Map app ---------- */
.map-app { position: relative; height: 100%; width: 100%; }
#map { position: absolute; inset: 0; z-index: 0; background: var(--paper); }
/* clean up leaflet chrome to feel more native */
.leaflet-container { font-family: var(--font); }
.leaflet-control-zoom { border: 1.5px solid var(--ink) !important; border-radius: 12px !important; overflow: hidden; box-shadow: var(--shadow-sm); }
.leaflet-control-zoom a { color: var(--ink) !important; }
.leaflet-bar a { border-bottom-color: var(--line) !important; }

.top-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 500; display: flex; gap: 10px; padding: 14px; pointer-events: none; }
.top-bar > * { pointer-events: auto; }
.round-btn {
  width: 44px; height: 44px; flex: none; border-radius: 50%; padding: 0;
  background: var(--white); border: 2px solid var(--ink); color: var(--ink);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
}
.round-btn svg { width: 18px; height: 18px; }
.avatar-btn { font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: 16px; overflow: hidden; background-size: cover; background-position: center; background-repeat: no-repeat; }

.layer-toggle {
  position: absolute; top: 68px; right: 14px; z-index: 500; display: flex; flex-direction: column; gap: 4px;
  padding: 6px; background: var(--white); border: 1.5px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.layer-chip {
  display: flex; align-items: center; justify-content: center; padding: 7px 14px; font-size: 11px; font-weight: 800;
  letter-spacing: 0.6px; text-transform: uppercase; border-radius: 9px; border: none; background: transparent; color: var(--ink);
}
.layer-chip.on { background: var(--ink); color: var(--white); }
.layer-chip:not(.on) { opacity: 0.55; }

.fab-stack { position: absolute; right: 14px; bottom: 26px; z-index: 500; display: flex; flex-direction: column; gap: 12px; }
.fab {
  width: 52px; height: 52px; border-radius: var(--r-button); display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--ink); box-shadow: var(--shadow-card);
}
.fab svg { width: 22px; height: 22px; }
.fab.light { background: var(--white); color: var(--ink); }
.fab.pumpkin { background: var(--pumpkin); border-color: var(--pumpkin); color: var(--white); }

/* marker + name label below it (matches the iOS map annotations). The label is
   absolutely positioned so it never affects the glyph's anchor point. */
.m-wrap { position: relative; }
.m-label {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 3px; font-size: 11px; font-weight: 700; color: var(--ink);
  white-space: nowrap; pointer-events: none; letter-spacing: 0.1px;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 1px 2px #fff, 0 0 5px #fff;
}

/* map markers (divIcon content) — exact match to iOS markers */
.m-rider { width: 18px; height: 18px; border-radius: 50%; background: var(--pumpkin); border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--ink), 0 2px 3px rgba(0,0,0,0.3); }
/* Spot diamond — orange centre, ink frame, white outer edge (matches SpotDiamond). */
.m-spot { width: 15px; height: 15px; background: var(--pumpkin); border: 2.5px solid var(--ink); transform: rotate(45deg); box-shadow: 0 0 0 2px #fff, 0 2px 3px rgba(0,0,0,0.3); }
.m-ride {
  width: 26px; height: 26px; border-radius: 8px; background: var(--pumpkin); border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--ink), 0 2px 3px rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; color: #fff;
}
.m-ride svg { width: 16px; height: 16px; }

/* welcome tour card (first map open) — sits left, clear of the layer toggle,
   and above it in z-order so the close button is always tappable. */
.tour-card {
  position: absolute; top: 74px; left: 14px; right: auto; width: min(370px, calc(100% - 132px)); z-index: 600;
  background: #fff; border: 1.5px solid var(--ink); border-radius: var(--r-card); padding: 14px; box-shadow: var(--shadow-card);
}
.tour-card .eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--pumpkin); font-weight: 600; }
.tour-card h3 { font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: 20px; margin: 2px 0 10px; }
.tour-card .trow { display: flex; align-items: center; gap: 9px; font-size: 12px; margin: 5px 0; }
.tour-card .trow .k { width: 20px; display: flex; justify-content: center; flex: none; }
.tour-card .close { position: absolute; top: 10px; right: 10px; background: none; border: none; color: var(--ink); padding: 4px; }
.tour-card .close svg { width: 14px; height: 14px; }

/* ---------- Bottom sheet ---------- */
.sheet-scrim { position: absolute; inset: 0; z-index: 900; background: rgba(0,0,0,0.28); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.sheet-scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1000; background: var(--paper);
  border-top-left-radius: var(--r-sheet); border-top-right-radius: var(--r-sheet); border-top: 1.5px solid var(--ink);
  box-shadow: 0 -6px 24px rgba(0,0,0,0.18); max-height: 86%; overflow-y: auto; transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2,0.8,0.2,1); padding: 8px 20px 28px;
}
.sheet.open { transform: translateY(0); }
.grabber { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 6px auto 14px; }
.sheet h2 { font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: 26px; margin: 0 0 4px; color: var(--ink); }
.sheet .meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.sheet .desc { font-size: 14px; line-height: 1.5; margin: 12px 0; white-space: pre-wrap; color: var(--ink); }

/* profile links menu */
.menu-list { margin: 14px 0 0; border: 1.5px solid var(--line); border-radius: var(--r-button); overflow: hidden; }
.menu-item { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); background: var(--surface); }
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--paper); }
.menu-item .chev { color: var(--muted); display: flex; }
.menu-item .chev svg { width: 16px; height: 16px; }

.rider-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.rider-head .avatar { width: 64px; height: 64px; font-size: 24px; flex: none; }
.rider-head .nm { font-size: 19px; font-weight: 700; color: var(--ink); }
.rider-head .sb { font-size: 12px; color: var(--muted); margin-top: 3px; }

.stat-rows { border-top: 1px solid var(--line); }
.stat-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.stat-row .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); }
.stat-row .v { font-size: 13px; font-weight: 600; color: var(--ink); text-align: right; }

.section-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; padding: 4px 10px; border-radius: var(--r-chip); background: var(--white); border: 1.5px solid var(--ink); color: var(--ink); }
.badge.pumpkin { background: var(--pumpkin); color: #fff; border-color: var(--pumpkin); }
.badge.ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.stars { color: var(--pumpkin); letter-spacing: 2px; }
.empty-hint { color: var(--muted); font-size: 13px; text-align: center; padding: 8px; }
.privacy-note { color: var(--muted); font-size: 12px; margin-top: 14px; display: flex; gap: 8px; align-items: flex-start; }

.sheet-photos { display: flex; gap: 8px; overflow-x: auto; margin: 12px 0; padding-bottom: 4px; }
.sheet-photos img { height: 130px; border-radius: 10px; border: 1.5px solid var(--ink); flex: none; }

/* pick map inside sheets */
.pick-map { height: 200px; border-radius: var(--r-card); border: 1.5px solid var(--ink); overflow: hidden; margin: 4px 0 8px; }

/* profile-photo picker (onboarding + edit) */
.photo-row { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.photo-pick { position: relative; background: none; border: none; padding: 0; }
.photo-pick .avatar { width: 76px; height: 76px; font-size: 26px; border-radius: 20px; border: 1.5px solid var(--ink); }
.photo-pick .cam {
  position: absolute; right: -4px; bottom: -4px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--pumpkin); border: 2px solid var(--white); color: #fff; display: flex; align-items: center; justify-content: center;
}
.photo-pick .cam svg { width: 14px; height: 14px; }
.photo-center { display: flex; justify-content: center; margin: 4px 0 18px; }
.photo-center .photo-pick .avatar { width: 96px; height: 96px; border-radius: 50%; font-size: 30px; }
.photo-center .photo-pick .cam { right: 2px; bottom: 2px; }

/* ---------- Admin / moderation queue (admin.html) ---------- */
.admin { height: 100%; display: flex; flex-direction: column; background: var(--paper); }
.admin-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1.5px solid var(--ink); background: var(--white);
}
.admin-title { font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: 22px; color: var(--ink); }
.admin-body { flex: 1; overflow-y: auto; padding: 16px; max-width: 640px; width: 100%; margin: 0 auto; }
.admin-loading { text-align: center; color: var(--muted); padding: 40px; }
.admin-count { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

.admin-empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.admin-empty h2 { font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: 26px; color: var(--ink); margin: 12px 0 6px; }
.admin-empty p { font-size: 14px; margin: 0 auto; max-width: 340px; }
.admin-empty-icon { width: 48px; height: 48px; margin: 0 auto; color: var(--muted); }
.admin-empty-icon.ok { color: var(--pumpkin); }
.admin-empty-icon .sfi { width: 48px; height: 48px; }

/* Tab bar between Moderation and Analytics */
.admin-tabs {
  display: flex; gap: 8px; padding: 10px 16px 0; background: var(--white);
  border-bottom: 1.5px solid var(--ink); max-width: 640px; width: 100%; margin: 0 auto;
}
.admin-tab {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--muted); background: none; border: none; padding: 8px 4px 10px; cursor: pointer;
  border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
}
.admin-tab.active { color: var(--ink); border-bottom-color: var(--pumpkin); font-weight: 700; }

/* ---------- Analytics tab ---------- */
.an-when { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.an-foot, .an-section .empty-hint { font-size: 12px; color: var(--muted); }
.an-foot { text-align: center; margin: 18px 0 8px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.stat-card {
  background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--r-card);
  padding: 12px 14px; box-shadow: var(--shadow-sm);
}
.stat-num { font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: 34px; line-height: 1; color: var(--ink); }
.stat-label { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.an-section { margin-top: 18px; }
.an-h { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.an-note { font-size: 12px; color: var(--ink); background: var(--pumpkin-soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }

.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 28px; align-items: center; gap: 8px; }
.bar-label { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--pumpkin); border-radius: 999px; }
.bar-val { font-size: 12px; font-weight: 700; color: var(--ink); text-align: right; }

.mini-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.mini-stats > div {
  flex: 1; min-width: 84px; text-align: center; background: var(--white);
  border: 1.5px solid var(--line); border-radius: var(--r-card); padding: 10px 8px;
}
.mini-stats b { display: block; font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: 24px; color: var(--ink); }
.mini-stats span { font-size: 11px; color: var(--muted); }

.an-list { display: flex; flex-direction: column; }
.an-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.an-row:last-child { border-bottom: none; }
.an-row-label { font-size: 13px; color: var(--ink); }
.an-row-val { font-size: 13px; font-weight: 700; color: var(--pumpkin); }

.week-chart { background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--r-card); padding: 12px; box-shadow: var(--shadow-sm); }
.wc-bars { display: flex; align-items: flex-end; gap: 4px; height: 72px; }
.wc-col { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.wc-bar { width: 100%; min-height: 2px; background: var(--pumpkin); border-radius: 3px 3px 0 0; }
.wc-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10px; color: var(--muted); font-family: var(--font-mono); }

.report-card {
  background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--r-card);
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
/* Highlight the card an email/push deep-linked to (?report=<id>). */
.report-card.flash { animation: report-flash 2.4s ease-out; }
@keyframes report-flash {
  0%, 15% { border-color: var(--pumpkin); box-shadow: 0 0 0 3px var(--pumpkin-soft); }
  100% { border-color: var(--ink); box-shadow: var(--shadow-sm); }
}
.report-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.report-when { font-size: 12px; color: var(--muted); }
.report-subject { font-size: 16px; font-weight: 700; color: var(--ink); }
.report-gone { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.report-detail { font-size: 12px; color: var(--muted); margin-top: 2px; }
.report-note { font-size: 14px; color: var(--ink); font-style: italic; margin: 8px 0; padding: 8px 12px; background: var(--surface); border-radius: 10px; border: 1px solid var(--line); }
.report-by { font-size: 12px; color: var(--muted); margin-top: 8px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.report-btn {
  padding: 8px 14px; font-size: 13px; font-weight: 600; border-radius: var(--r-chip);
  border: 1.5px solid var(--ink); background: var(--white); color: var(--ink);
}
.report-btn.danger { border-color: var(--danger); color: var(--danger); }
.report-btn[disabled] { opacity: 0.5; }

/* destructive / secondary actions at the foot of a detail sheet */
.sheet-actions { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 6px; }
.sheet-action {
  display: block; width: 100%; text-align: center; padding: 11px 8px;
  background: none; border: none; font-size: 13px; font-weight: 600; color: var(--ink);
}
.sheet-action.danger { color: var(--danger); }
.sheet-action:hover { background: var(--surface); border-radius: 10px; }
.sheet-action[disabled] { opacity: 0.5; }

/* interactive star rating (spot detail) — mirrors SpotDetailSheet */
.rate-stars { display: flex; gap: 6px; margin: 2px 0 12px; }
.rate-stars.busy { opacity: 0.6; pointer-events: none; }
.rate-star { background: none; border: none; padding: 2px; color: var(--line); line-height: 0; }
.rate-star .sfi { width: 26px; height: 26px; }
.rate-star.on { color: var(--pumpkin); }

/* RSVP (ride detail) — mirrors RideDetailSheet.rsvpButton */
.rsvp-row { display: flex; gap: 10px; }
.rsvp-btn {
  flex: 1; min-height: 44px; padding: 0 12px; font-size: 14px; font-weight: 600;
  border-radius: var(--r-button); border: 1.5px solid var(--ink);
  background: var(--white); color: var(--ink);
}
.rsvp-btn[data-s="going"].on { background: var(--pumpkin); border-color: var(--pumpkin); color: #fff; }
.rsvp-btn[data-s="not_going"].on { background: var(--ink); color: #fff; }
.rsvp-btn[disabled] { opacity: 0.5; }
.going-names { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 4px; }
.going-name {
  font-size: 12px; font-weight: 600; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-chip); padding: 4px 10px;
}

/* in-picker search (add-spot / host-ride) — mirrors AddSpotView.searchField */
.picker-search { margin-bottom: 10px; }
.ps-field {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--r-button);
}
.ps-field .ps-ic { color: var(--muted); display: flex; }
.ps-field .ps-ic .sfi { width: 14px; height: 14px; }
.ps-input { flex: 1; border: none; outline: none; background: transparent; font-size: 15px; color: var(--ink); }
.ps-clear { background: none; border: none; color: var(--muted); display: flex; padding: 2px; }
.ps-clear .sfi { width: 15px; height: 15px; }
.ps-suggests {
  margin-top: 6px; background: var(--white); border: 1.5px solid var(--ink);
  border-radius: var(--r-button); overflow: hidden;
}
.ps-row {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 8px 12px; background: none; border: none; border-bottom: 1px solid var(--line);
}
.ps-row:last-child { border-bottom: none; }
.ps-row:hover { background: var(--paper); }
.ps-row-ic { width: 22px; display: flex; justify-content: center; flex: none; }
.ps-row .t { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.ps-row .s { display: block; font-size: 11px; color: var(--muted); }

/* picker caption above the map (mono, uppercase) */
.pick-caption {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
/* "Meeting at <spot>" / hint under the host-ride picker */
.pick-note { font-size: 11px; color: var(--muted); margin-top: 8px; min-height: 14px; }
.pick-note.on { color: var(--pumpkin); font-weight: 600; }

/* pumpkin mappin used as the picker pin (matches AddSpotView's annotation) */
.m-pick { color: var(--pumpkin); display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)); }
.m-pick .sfi { width: 34px; height: 34px; }

/* equal-width single-choice row (wheel size, riding style) — the web twin of
   SegmentedChoice in ProfileSetupView.swift */
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; padding: 13px 0; font-size: 15px; font-weight: 700;
  border-radius: var(--r-button); border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); transition: background .12s, color .12s, border-color .12s;
}
.seg button.on { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* spot photo picker (add-spot) — up to 3 thumbnails + an add tile */
.photo-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-thumb, .photo-add {
  width: 76px; height: 76px; border-radius: 12px; border: 1.5px solid var(--ink);
  flex: none; position: relative; background-size: cover; background-position: center;
}
.photo-add { background: var(--surface); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.photo-add .sfi { width: 22px; height: 22px; }
.photo-x {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: #fff; border: 2px solid var(--white); display: flex; align-items: center; justify-content: center; padding: 0;
}
.photo-x .sfi { width: 11px; height: 11px; }

/* chips for difficulty / category selection in add-spot / host-ride */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 13px; font-size: 13px; font-weight: 600; border-radius: var(--r-chip); border: 1.5px solid var(--ink); background: var(--white); color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; }

/* search */
.search-list { margin-top: 6px; }
.search-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 6px; background: none; border: none; border-bottom: 1px solid var(--line); }
.search-item:hover { background: var(--surface); }
.search-section { margin-bottom: 4px; }
.search-section-hdr {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); padding: 12px 6px 6px; position: sticky; top: 0; background: var(--paper);
}
.search-item .ic { width: 26px; flex: none; display: flex; justify-content: center; align-items: center; }
.search-item .ps-place-ic { color: var(--muted); display: flex; }
.search-item .ps-place-ic .sfi { width: 18px; height: 18px; }
.search-item .t { font-weight: 600; font-size: 15px; color: var(--ink); }
.search-item .s { font-size: 12px; color: var(--muted); }

.toast {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); z-index: 1200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-chip); font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-card); opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; max-width: 80%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 620px) {
  .sheet { left: 50%; right: auto; width: 460px; transform: translate(-50%, 100%); border: 1.5px solid var(--ink); border-radius: var(--r-sheet); bottom: 16px; }
  .sheet.open { transform: translate(-50%, 0); }
}
