/* ShotCoach design system.
   Direction: "night range" — deep graphite surfaces with a tritium
   night-sight green accent (the glow of pistol sights in the dark) and
   Trijicon-red for danger/overdue; condensed display type for the
   numbers that matter (distance, score). Light is warm range paper
   with a Trijicon red-sight accent. Tokens drive both; [data-theme]
   overrides the browser preference. */

* { box-sizing: border-box; margin: 0; }

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #131510;
  --bg-glow: rgba(179, 227, 77, .06);
  --card: #1b1e17;
  --card-2: #22261c;
  --fg: #e9ecdf;
  --muted: #9aa18a;
  --border: #303427;
  --border2: #252921;
  --input-bg: #0e100a;
  /* tritium night-sight green */
  --accent: #b3e34d;
  --accent-hi: #d0f37e;
  --accent-ink: #101c05;
  --ok: #6fbf6a;
  --due: #d9a62b;
  /* Trijicon-red sight glow for danger/overdue */
  --overdue: #ff4f3f;
  --ring: color-mix(in srgb, var(--accent) 70%, transparent);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .35);
  --shadow-card: var(--shadow-2);
  --radius: 14px;
  --radius-s: 10px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 16px;
  --space-4: 24px;
  --font-body: -apple-system, "Segoe UI", system-ui, "Helvetica Neue",
               Arial, sans-serif;
  --font-display: "Avenir Next Condensed", "Arial Narrow",
                  "Roboto Condensed", "Liberation Sans Narrow",
                  sans-serif-condensed, var(--font-body);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f1eee5;
    --bg-glow: rgba(210, 59, 34, .05);
    --card: #fbf9f2;
    --card-2: #f1ede1;
    --fg: #26221a;
    --muted: #6f6858;
    --border: #d6d0bf;
    --border2: #e3ded0;
    --input-bg: #edeadd;
    --accent: #d23b22;
    --accent-hi: #ea5a3c;
    --accent-ink: #fff5f1;
    --ok: #2e7d46;
    --due: #a87413;
    --overdue: #96230e;
    --shadow-1: 0 1px 2px rgba(60, 45, 20, .10);
    --shadow-2: 0 10px 28px rgba(60, 45, 20, .16), 0 2px 6px rgba(60, 45, 20, .08);
  --shadow-card: var(--shadow-2);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f1eee5;
  --bg-glow: rgba(210, 59, 34, .05);
  --card: #fbf9f2;
  --card-2: #f1ede1;
  --fg: #26221a;
  --muted: #6f6858;
  --border: #d6d0bf;
  --border2: #e3ded0;
  --input-bg: #edeadd;
  --accent: #d23b22;
  --accent-hi: #ea5a3c;
  --accent-ink: #fff5f1;
  --ok: #2e7d46;
  --due: #a87413;
  --overdue: #96230e;
  --shadow-1: 0 1px 2px rgba(60, 45, 20, .10);
  --shadow-2: 0 10px 28px rgba(60, 45, 20, .16), 0 2px 6px rgba(60, 45, 20, .08);
  --shadow-card: var(--shadow-2);
}

/* ---------- base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(900px 480px at 50% -120px,
                    var(--bg-glow), transparent 70%);
  background-repeat: no-repeat;
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.45;
  min-height: 100dvh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
main { padding: 0 var(--space-3) var(--space-3); max-width: 640px;
       margin: 0 auto; }

/* type scale */
h2 { margin: 12px 0 10px; font-size: 1.5rem; font-weight: 650;
     letter-spacing: -.01em; }
h3 { font-size: 1.05rem; font-weight: 650; margin: 0 0 4px; }
.eyebrow { font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: .14em; font-size: .78rem; font-weight: 600;
  color: var(--muted); }
.caption, .note, .muted { color: var(--muted); font-size: .85rem; }
.warn { color: var(--due); }
.bad { color: var(--overdue); }
a { color: var(--accent); }

/* ---------- header + brand ---------- */
header { position: relative; z-index: 50; overflow: visible;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 14px var(--space-3); max-width: 640px;
  margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--fg); text-decoration: none; }
.brand em, .login-title em { color: var(--accent); font-style: normal; }
/* the crosshair mark is always tritium green (both themes), like the
   login target; the COACH wordmark keeps the theme accent */
.brand svg { width: 22px; height: 22px; color: #b3e34d; }

/* ---------- user menu (native <details>, zero JS required) ---------- */
.usermenu { position: relative; margin: 0; }
.usermenu summary { list-style: none; display: inline-flex;
  align-items: center; gap: 7px; cursor: pointer; min-height: 40px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); font-weight: 600; font-size: .9rem;
  user-select: none; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--card-2); }
.usermenu .caret { width: 11px; height: 8px; color: var(--muted);
  transition: transform .15s ease; }
.usermenu[open] .caret { transform: rotate(180deg); }
.usermenu-panel { position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 232px; padding: 6px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-2); z-index: 60; }
.usermenu-panel form { margin: 0; }
.usermenu-panel a, .usermenu-panel button { display: flex;
  align-items: center; width: 100%; min-height: 44px; padding: 10px 12px;
  margin: 0; border: none; border-radius: 8px; background: none;
  color: var(--fg); font-size: .95rem; font-weight: 500; text-align: left;
  text-decoration: none; cursor: pointer; }
.usermenu-panel a:hover, .usermenu-panel button:hover {
  background: var(--card-2); }
/* danger = red menu-item text inside menus; page-level destructive
   actions use button.danger — intentional per-container convention */
.usermenu-panel .menu-danger { color: var(--overdue); }
.usermenu-panel .menu-sep { border: none;
  border-top: 1px solid var(--border2); margin: 6px 4px; }

/* ---------- cards + layout ---------- */
.card { background: var(--card); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: var(--space-3);
  margin: var(--space-2) 0; box-shadow: var(--shadow-1); }
.stack label { display: block; margin: 10px 0 4px; color: var(--muted);
  font-size: .9rem; }
.row { display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 8px 0; }

/* ---------- forms ---------- */
input, select, textarea { font: inherit; font-size: 1rem;
  padding: 11px 12px; width: 100%; border-radius: var(--radius-s);
  border: 1px solid var(--border); background: var(--input-bg);
  color: var(--fg); }
input[type="checkbox"], input[type="radio"] { width: auto;
  accent-color: var(--accent); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 1px;
  border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

button { font: inherit; font-size: 1rem; font-weight: 650; width: 100%;
  margin-top: 10px; padding: 12px 16px; min-height: 44px;
  border: none; border-radius: var(--radius-s); cursor: pointer;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  box-shadow: var(--shadow-1); transition: filter .12s, transform .06s; }
button:hover { filter: brightness(1.07); }
button:active { transform: translateY(1px); filter: brightness(.97); }
button.secondary { background: var(--card-2); color: var(--fg);
  border: 1px solid var(--border); box-shadow: none; }
button.secondary:hover { filter: none; background: var(--border2); }
button.danger { background: none; color: var(--overdue);
  border: 1px solid color-mix(in srgb, var(--overdue) 45%, transparent);
  box-shadow: none; }
button.danger:hover { filter: none;
  background: color-mix(in srgb, var(--overdue) 12%, transparent); }
button.busy { opacity: .7; cursor: progress; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; padding: 5px 12px;
  border-radius: 999px; color: #fff; text-decoration: none;
  font-weight: 650; font-size: .85rem; }
.chip.ok { background: var(--ok); }
.chip.due { background: var(--due); color: #1e1602; }
.chip.overdue { background: var(--overdue); }

.chip-toggle { display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
  font-size: .85rem; font-weight: 600; cursor: pointer; margin: 0; }
.chip-toggle input { margin: 0; }
.chip-toggle:has(input:checked) { border-color: var(--accent);
  color: var(--fg);
  background: color-mix(in srgb, var(--accent) 13%, transparent); }
.chip-toggle:has(input:focus-visible) { outline: 2px solid var(--ring);
  outline-offset: 2px; }

/* ---------- flash banners ----------
   Fixed toast, not in-flow: saves restore the user's scroll position,
   so the confirmation must be visible wherever they are on the page.
   Sits above the bottom tab bar on phones, top-right on wide screens. */
.flash { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 11px 8px 11px 14px;
  position: fixed; left: 12px; right: 12px; z-index: 60;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-s); font-weight: 600; font-size: .95rem;
  border: 1px solid; transition: opacity .25s; }
@media (min-width: 720px) {
  .flash { left: auto; right: 20px; top: 68px; bottom: auto;
    max-width: 380px; }
}
.flash.ok {
  color: color-mix(in srgb, var(--ok) 80%, var(--fg));
  background: color-mix(in srgb, var(--ok) 13%, var(--card));
  border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.flash.bad {
  color: color-mix(in srgb, var(--overdue) 85%, var(--fg));
  background: color-mix(in srgb, var(--overdue) 12%, var(--card));
  border-color: color-mix(in srgb, var(--overdue) 40%, transparent); }
.flash.closing { opacity: 0; }
.flash-close { width: 36px; min-height: 36px; margin: 0; padding: 0;
  flex: none; background: none; border: none; box-shadow: none;
  color: inherit; font-size: 1.2rem; line-height: 1; opacity: .7; }
.flash-close:hover { filter: none; opacity: 1; }

/* ---------- photo dropzone ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 26px 16px; text-align: center; cursor: pointer;
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: var(--radius); background:
  color-mix(in srgb, var(--accent) 4%, transparent);
  transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent); }
.dropzone.has-file { border-style: solid; }
.dropzone .dz-input { position: absolute; width: 1px; height: 1px;
  opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.dz-icon { width: 34px; height: 34px; color: var(--accent); }
.dz-title { font-weight: 700; }
.dz-sub { font-size: .85rem; color: var(--muted); }
.dz-file { font-size: .85rem; font-weight: 600; color: var(--accent);
  word-break: break-all; }

/* ---------- field help popover ---------- */
.label-row { display: flex; align-items: center; gap: 8px; }
.field-help { position: relative; }
.field-help summary { list-style: none; cursor: pointer; width: 22px;
  height: 22px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: .8rem; font-weight: 700;
  color: var(--accent);
  border: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent); }
.field-help summary::-webkit-details-marker { display: none; }
.field-help[open] summary { background:
  color-mix(in srgb, var(--accent) 15%, transparent); }
.help-pop { position: absolute; left: 0; top: 28px; z-index: 40;
  width: min(320px, 78vw); padding: 12px 14px; font-size: .88rem;
  line-height: 1.45; color: var(--fg); background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-s);
  box-shadow: var(--shadow-card); }

/* ---------- password eye toggle ---------- */
.pw-field { position: relative; display: block; }
.pw-field input { width: 100%; padding-right: 46px; }
.pw-eye { position: absolute; right: 2px; top: 50%;
  transform: translateY(-50%); width: 44px; min-height: 44px; margin: 0;
  padding: 0; display: flex; align-items: center; justify-content: center;
  background: none; border: none; box-shadow: none; color: var(--muted); }
.pw-eye:hover { filter: none; color: var(--fg); }
.pw-eye.showing { color: var(--accent); }
/* the icon must never be the click target — the button is */
.pw-eye svg { width: 20px; height: 20px; pointer-events: none; }
.pw-eye * { pointer-events: none; }

/* ---------- coach's orders ---------- */
.orders-card { border-left: 3px solid var(--accent); }
.orders-text { white-space: pre-wrap; line-height: 1.55; }
/* The briefing lives in a standard .card; the summary reads like any
   card's h3 header (fg colour, same scale) with a chevron — matching
   every other section on every page, not a special accent bar. */
.orders-brief summary { list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; min-height: 44px; }
.orders-brief summary::-webkit-details-marker { display: none; }
.orders-brief summary:focus-visible { outline: 2px solid var(--ring);
  outline-offset: 2px; border-radius: var(--radius-s); }
.brief-title { display: flex; align-items: center; gap: 8px;
  font-size: 1.05rem; font-weight: 650; color: var(--fg); }
.brief-icon { width: 18px; height: 18px; color: var(--accent);
  flex: none; }
.orders-brief .chev { width: 14px; height: 14px; flex: none;
  color: var(--muted); transition: transform .15s; }
.orders-brief[open] .chev { transform: rotate(180deg); }
.brief-form { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) {
  .orders-brief .chev, .row-actions .chev { transition: none; }
}

/* ---------- misc rows ---------- */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
/* position manager: name input on its own line, then three equal
   action buttons — the forms dissolve into the grid */
.pos-actions { display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; }
.pos-actions form { display: contents; }
.pos-actions input[name="name"] { grid-column: 1 / -1; }
.pos-actions button { width: 100%; margin: 0; }
.banner-action { margin-top: 14px; }

/* ---------- profiles ---------- */
.profile-list { display: flex; flex-direction: column; }
.profile-line { display: flex; align-items: center; flex-wrap: wrap;
  justify-content: space-between; gap: 6px 12px; padding: 10px 2px;
  border-top: 1px solid var(--border); }
.profile-line:first-child { border-top: none; }
.profile-line[hidden] { display: none; }
.profile-id { display: flex; flex-direction: column; gap: 2px;
  min-width: 0; }
.profile-id .caption { overflow: hidden; text-overflow: ellipsis; }
.row-actions summary { list-style: none; cursor: pointer;
  font-weight: 600; color: var(--accent); min-height: 44px;
  display: flex; align-items: center; gap: 6px; padding: 0 10px;
  margin: 0 -10px; border-radius: var(--radius-s); }
.row-actions summary::-webkit-details-marker { display: none; }
.row-actions summary:hover { background:
  color-mix(in srgb, var(--accent) 8%, transparent); }
.row-actions summary:focus-visible { outline: 2px solid var(--ring);
  outline-offset: 2px; }
.row-actions .chev { width: 14px; height: 14px; flex: none;
  transition: transform .15s; }
.row-actions[open] .chev { transform: rotate(180deg); }
.row-actions[open] { flex: 1 1 100%; }
.temp-pass { display: inline-block; font-size: 1.25rem; font-weight: 700;
  letter-spacing: .06em; padding: 6px 12px; border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  user-select: all; }

/* ---------- hero: deal a drill ---------- */
.hero { text-align: center; padding: 10vh 8px 26px; }
.hero.onboard { padding-top: 4vh; padding-bottom: 8px; }
.hero-title { font-size: 1.7rem; font-weight: 700; letter-spacing: -.01em;
  margin: 10px 0 8px; }
.hero-sub { color: var(--muted); max-width: 34ch; margin: 0 auto 22px; }
.btn-hero { font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: .1em; font-size: 1.25rem; font-weight: 700;
  padding: 18px 20px; border-radius: var(--radius);
  box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 35%, transparent),
              var(--shadow-1); }

/* ---------- drill card / drill banner ---------- */
.drill-card, .drill-banner { text-align: center;
  background: linear-gradient(180deg,
              color-mix(in srgb, var(--accent) 7%, var(--card)),
              var(--card) 55%);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: var(--radius); padding: 22px var(--space-3) var(--space-3);
  margin: var(--space-2) 0; box-shadow: var(--shadow-2); }
.drill-banner { padding-bottom: 18px; box-shadow: var(--shadow-1); }
.drill-position { font-family: var(--font-display);
  text-transform: uppercase; letter-spacing: .06em;
  font-size: 1.7rem; font-weight: 700; margin: 10px 0 0; }
.drill-distance { margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.drill-distance .num { font-family: var(--font-display);
  font-size: 4.4rem; font-weight: 700; line-height: 1.05;
  color: var(--accent); letter-spacing: .01em; }
.drill-distance .unit { font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin-left: 7px; }
.reroll button { margin-top: 8px; }
.lock-chips { display: flex; justify-content: center; gap: 8px;
  margin-top: 10px; flex-wrap: wrap; }

@media (prefers-reduced-motion: no-preference) {
  [data-reveal] { animation: reveal .35s cubic-bezier(.2, .9, .3, 1.15) both; }
  [data-reveal] .drill-distance {
    animation: reveal .4s .07s cubic-bezier(.2, .9, .3, 1.15) backwards; }
  @keyframes reveal {
    from { opacity: 0; transform: scale(.95) translateY(10px); }
  }
}

/* ---------- home stats strip ---------- */
.stats-strip { display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap; margin: var(--space-3) 0; }
.stats-strip .chip { flex: none; }
.stat { flex: 1 1 0; min-width: 84px; text-align: center;
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 12px; padding: 8px 10px; }
.stat-num { display: block; font-family: var(--font-display);
  font-size: 1.45rem; font-weight: 700;
  font-variant-numeric: tabular-nums; }
.stat-label { display: block; font-size: .68rem;
  text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }

/* ---------- session rows ---------- */
.session-list { margin: var(--space-2) 0; }
.section-title { margin: var(--space-3) 0 6px; }
.session-item-wrap { display: flex; align-items: stretch;
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 12px; margin: 8px 0; overflow: hidden;
  box-shadow: var(--shadow-1); }
.session-item { flex: 1; display: grid;
  grid-template-columns: 1fr auto; align-items: center;
  column-gap: 12px; row-gap: 1px; padding: 12px 14px;
  color: var(--fg); text-decoration: none; min-height: 44px; }
.session-item:hover { background: var(--card-2); }
.session-date { grid-column: 1; font-weight: 600;
  font-variant-numeric: tabular-nums; }
.session-meta { grid-column: 1; color: var(--muted); font-size: .85rem; }
.score-chip { grid-column: 2; grid-row: 1 / span 2; justify-self: end;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  font-variant-numeric: tabular-nums; padding: 5px 12px;
  border-radius: 10px; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent); }
.row-delete { flex: none; width: auto; min-width: 48px; margin: 0;
  padding: 0 12px; align-self: stretch; border: none; border-radius: 0;
  border-left: 1px solid var(--border2); background: none;
  box-shadow: none; color: var(--muted); font-size: .78rem;
  font-weight: 600; }
.row-delete:hover { filter: none; color: var(--overdue);
  background: color-mix(in srgb, var(--overdue) 10%, transparent); }
.more-link { margin: 10px 2px; font-size: .9rem; }

/* ---------- history filter bar ---------- */
.filter-bar { display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px 10px; align-items: end; }
.filter-bar label { display: block; margin: 0; font-size: .78rem;
  color: var(--muted); }
.filter-bar button { grid-column: 1 / -1; margin: 4px 0 0; }
@media (min-width: 560px) {
  .filter-bar { grid-template-columns: 2fr 2fr 1fr 1fr; }
}

/* ---------- charts ---------- */
.chart-wrap { position: relative; width: 100%; }
.chart-wrap canvas { display: block; width: 100%; }

/* ---------- session detail ---------- */
.target-photo { max-width: 100%; border-radius: var(--radius-s);
  border: 1px solid var(--border2); }
.photo-form input[type="file"] { padding: 10px; }
.feedback { background: var(--card-2); border: 1px solid var(--border2);
  border-radius: var(--radius-s); padding: 12px 14px; margin: 10px 0; }
.feedback-text { white-space: pre-wrap; margin-top: 6px; }

/* ---------- settings item rows ---------- */
/* Locker equipment: each item is a bordered block; the edit row and
   the full-width Delete sit on their own lines — no display:contents,
   so Save/Delete/Add controls never merge or get mis-tapped. */
.gear-item { border: 1px solid var(--border2); border-radius: var(--radius-s);
  padding: 10px; margin: 8px 0; background: var(--card-2); }
.gear-edit { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.gear-edit input { flex: 1 1 100%; }
.gear-edit select { flex: 1 1 8em; }
.gear-edit button { flex: 1 1 6em; width: auto; margin: 0; }
.gear-delete { margin: 8px 0 0; }
.gear-delete button { width: 100%; margin: 0; }

.item-row { display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 0; border-bottom: 1px solid var(--border2); }
.item-row form { display: contents; }
.item-row input { flex: 1 1 100%; }
.item-row button { flex: 1 1 0; width: auto; margin: 0; min-height: 44px; }
.add-row { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.add-row input { flex: 1 1 100%; }
.add-row button { flex: 1 1 0; width: auto; margin: 0; min-height: 44px; }

/* segmented control (theme picker) */
.seg { display: flex; gap: 3px; padding: 3px; border-radius: 11px;
  background: var(--input-bg); border: 1px solid var(--border);
  margin-top: 6px; }
.seg-opt { flex: 1; position: relative; margin: 0; }
.seg-opt input { position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 4px; border-radius: 8px; font-size: .82rem;
  font-weight: 600; color: var(--muted); border: 1px solid transparent;
  white-space: nowrap; }
.seg-opt input:checked + span { background: var(--card); color: var(--fg);
  border-color: var(--border); box-shadow: var(--shadow-1); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--ring);
  outline-offset: 2px; }

/* weekday picker */
.weekdays { display: flex; flex-wrap: wrap; gap: 6px; border: none;
  padding: 0; margin: 6px 0 0; }
.weekdays legend { padding: 0; margin-bottom: 6px; color: var(--muted);
  font-size: .9rem; }

/* onboarding "what do you shoot?" picker — same chrome as .weekdays */
.shoot-picker { border: none; padding: 0; margin: 6px 0 0;
  display: flex; flex-wrap: wrap; gap: 6px; }
.shoot-picker legend, .shoot-picker .caption { flex: 1 1 100%; }
.shoot-picker legend { padding: 0; margin-bottom: 6px;
  color: var(--muted); font-size: .9rem; }

/* live range preview */
.grid-preview { margin-top: 12px; padding: 10px 12px;
  border-radius: var(--radius-s); background: var(--input-bg);
  border: 1px dashed var(--border); font-size: .9rem;
  font-variant-numeric: tabular-nums; }
.grid-preview strong { color: var(--accent); font-weight: 650; }

/* ---------- empty states ---------- */
.empty-state { text-align: center; padding: 34px 16px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  margin: 14px 0; }
.empty-state .muted { margin-top: 4px; }
.empty-note { color: var(--muted); font-size: .9rem; margin: 10px 2px; }

/* ---------- login ---------- */
.login-brand { text-align: center; margin: 3vh auto 22px; }
/* the target mark is always the tritium night-sight green, in both
   themes — it reads as a sight, not the light-theme red accent */
.login-mark { width: 56px; height: 56px; color: #b3e34d;
  margin-bottom: 10px; }
.login-title { font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: .06em; font-size: 2.1rem; font-weight: 700; }
.tagline { color: var(--muted); margin-top: 6px; font-size: .95rem; }

/* ---------- tab bar: bottom on phones, rail on wide ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; position: relative; display: flex;
  flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 0 7px; min-height: 44px; color: var(--muted);
  text-decoration: none; font-size: .7rem; font-weight: 650;
  letter-spacing: .04em; }
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.active { color: var(--accent); }
.tabbar a.active::before { content: ""; position: absolute; top: -1px;
  left: 50%; transform: translateX(-50%); width: 30px; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--accent); }

@media (min-width: 760px) {
  body { padding-left: calc(96px + env(safe-area-inset-left));
         padding-bottom: var(--space-3); }
  .tabbar { top: 0; bottom: 0; right: auto;
    width: calc(96px + env(safe-area-inset-left));
    flex-direction: column; justify-content: flex-start; gap: 4px;
    border-top: none; border-right: 1px solid var(--border);
    padding-left: env(safe-area-inset-left);
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-bottom: 0; }
  .tabbar a { flex: 0 0 auto; padding: 13px 4px; }
  .tabbar a.active::before { top: 50%; left: 0;
    transform: translateY(-50%); width: 3px; height: 34px;
    border-radius: 0 3px 3px 0; }
}

/* ---------- login value proposition (signed-out) ---------- */
h3 .brief-icon { vertical-align: -3px; margin-right: 4px; }
.pitch { max-width: 640px; margin: 6px auto 0; padding: 6px 0 24px; }
.pitch-head { font-size: 1.25rem; font-weight: 650; letter-spacing: -.01em;
  margin: 10px 0 6px; }
.pitch-lead { color: var(--muted); margin-bottom: 14px; }
.pitch-list { list-style: none; display: flex; flex-direction: column;
  gap: 12px; margin: 0; padding: 0; }
.pitch-list li { position: relative; padding-left: 20px; }
.pitch-list li::before { content: ""; position: absolute; left: 0;
  top: .45em; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); }
.pitch-cta { margin-top: 16px; font-weight: 600; }
