/* BenjiSnap — same look as BenjiHealth / BenjiGarage / BenjiRoute: Benjiverse colours, dark always, Sora (self-hosted at fonts/). Mobile first. Base copied from BenjiHealth 1.1.0 app.css with the food, workout, chart, calendar and camera styles removed. */

:root {
  /* Benjiverse tokens (match benjiverse.app) */
  /* palette (Me > Appearance > Colours): the teal values below are the default; :root[data-palette] blocks further down override only these --pal-* tokens.
     d = on the dark theme, l = on the light theme. Status colours (good, bad, amber, over-target, calendar states) never come from a palette. */
  --pal-accent-d: #5eead4; --pal-accent-l: #0b7490;
  --pal-viz-d: #1ea5bb; --pal-viz-l: #0891b2;
  --pal-rgb-d: 94, 234, 212; --pal-rgb-l: 8, 145, 178;
  --pal-g1: #5eead4; --pal-g2: #22b8cf; --pal-on: #06202b;
  --void: #070f26;
  --color-bg-top: #0b1736;
  --color-bg-mid: #0b2244;
  --color-bg-bottom: #0a3340;
  --surface: rgba(19, 34, 67, 0.78);
  --surface-hover: #1b2f5a;
  --border: #28406e;
  --ink: #f4f6fb;
  --muted: #9fb2d4;
  --accent-soft: var(--pal-accent-d);
  --blue: #0e7490;
  --blue-bright: var(--pal-g2);
  --ui-gradient: linear-gradient(135deg, var(--pal-g1) 0%, var(--pal-g2) 100%); /* palette gradient: dark --pal-on text on it keeps AA (7:1) in every palette, both modes */
  --accent-gradient: var(--ui-gradient);
  --navy-glow: #1d4f91;
  --nebula-violet: #5b3fd0;
  --nebula-magenta: #b0409a;
  --starlight: #ffe9c4;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --sans: "Sora", system-ui, sans-serif;
  --mono: var(--sans);          /* numbers use Sora with tabular figures, no mono face */

  /* app aliases */
  --bg: #0b1736;
  --panel: #0f1d3f;            /* solid stand-in for --surface over the page gradient */
  --raise: #162a54;            /* inputs / chips on a panel */
  --text: var(--ink);
  --line: var(--border);
  --accent: var(--accent-soft);
  --on-accent: var(--pal-on);
  --focus: var(--pal-accent-d);
  --good: #4ade80;
  --bad: #ff8d93;
  --amber: #fbbf24;
  --c-ok: #3ddc84;
  --c-slow: #ffb020;
  --c-heavy: #ff4d5a;
  --c-closed: #1b1030;
  --c-minor: #8499bf;
  --halo: #070f26;
  --gutter: 14px;
  --tap: 44px;
  --field: #070f26;             /* input background */
  --btn-bg: transparent;
  --tab-bg: rgba(11, 23, 54, 0.94);
  --shadow: rgba(0, 0, 0, 0.6);
  --warn-bg: #3d2c05; --warn-ink: #ffe2a0;
  --err-bg: #4a1220; --err-ink: #ffd6db;
  --note-bg: #2c2268; --note-ink: #ffe9c4;
  /* chart colours: one teal for the data, amber for the goal / "over target" (checked with the dataviz validator: dark ΔE 19+, light ΔE 20+) */
  --viz-line: var(--pal-viz-d); --viz-over: #c98500; --viz-goal: #c98500;
  --viz-grid: rgba(159, 178, 212, 0.16); --viz-axis: rgba(159, 178, 212, 0.45); --viz-tick: #9fb2d4; --viz-ring: #0f1d3f;
  --st-on: #3ddc84; --st-low: #8499bf; --st-over: #ffb020;
  /* accent-derived tokens: change --accent-rgb (palettes / light mode) and the tints follow */
  --accent-rgb: var(--pal-rgb-d);
  --primary-shadow: 0 8px 30px -8px rgba(var(--accent-rgb), 0.45);
  --primary-shadow-hover: 0 10px 36px -6px rgba(var(--accent-rgb), 0.65);
  --switch-knob: var(--muted);
  --tab-sel-bg: rgba(var(--accent-rgb), 0.1);
  --chip-sel-bg: rgba(var(--accent-rgb), 0.12);
  --picker-filter: invert(0.85);
  color-scheme: dark;
}
:root[data-theme="dark"] { color-scheme: dark; }
/* light mode: tokens only. The two blocks below are identical (system light unless the user forced dark, and forced light) — keep them in sync (a test checks). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --void: #eef3fb; --color-bg-top: #f6f9fe; --color-bg-mid: #edf3fb; --color-bg-bottom: #e4f1f3;
    --surface: rgba(255, 255, 255, 0.92); --surface-hover: #e1eaf7; --border: #b6c5de;
    --ink: #0b1736; --muted: #475a7d; --accent-soft: var(--pal-accent-l); --blue-bright: var(--pal-viz-l);
    --bg: #f6f9fe; --panel: #ffffff; --raise: #e4ecf8; --focus: var(--pal-accent-l);
    --good: #157a3b; --bad: #b42336; --amber: #a64b09; --starlight: #3b2a00;
    --field: #ffffff; --btn-bg: rgba(255, 255, 255, 0.8); --tab-bg: rgba(255, 255, 255, 0.96); --shadow: rgba(11, 23, 54, 0.22);
    --warn-bg: #fff1cc; --warn-ink: #4d3500; --err-bg: #fde3e7; --err-ink: #6a1020; --note-bg: #e7e2fb; --note-ink: #2c2268;
    --viz-line: var(--pal-viz-l); --viz-over: #b45309; --viz-goal: #b45309;
    --viz-grid: rgba(71, 90, 125, 0.16); --viz-axis: rgba(71, 90, 125, 0.5); --viz-tick: #475a7d; --viz-ring: #ffffff;
    --st-on: #157a3b; --st-low: #5b6f93; --st-over: #b45309;
    --accent-rgb: var(--pal-rgb-l); --primary-shadow: 0 8px 24px -10px rgba(var(--accent-rgb), 0.6);
    --switch-knob: #5b6f93; --picker-filter: none;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --void: #eef3fb; --color-bg-top: #f6f9fe; --color-bg-mid: #edf3fb; --color-bg-bottom: #e4f1f3;
  --surface: rgba(255, 255, 255, 0.92); --surface-hover: #e1eaf7; --border: #b6c5de;
  --ink: #0b1736; --muted: #475a7d; --accent-soft: var(--pal-accent-l); --blue-bright: var(--pal-viz-l);
  --bg: #f6f9fe; --panel: #ffffff; --raise: #e4ecf8; --focus: var(--pal-accent-l);
  --good: #157a3b; --bad: #b42336; --amber: #a64b09; --starlight: #3b2a00;
  --field: #ffffff; --btn-bg: rgba(255, 255, 255, 0.8); --tab-bg: rgba(255, 255, 255, 0.96); --shadow: rgba(11, 23, 54, 0.22);
  --warn-bg: #fff1cc; --warn-ink: #4d3500; --err-bg: #fde3e7; --err-ink: #6a1020; --note-bg: #e7e2fb; --note-ink: #2c2268;
  --viz-line: var(--pal-viz-l); --viz-over: #b45309; --viz-goal: #b45309;
  --viz-grid: rgba(71, 90, 125, 0.16); --viz-axis: rgba(71, 90, 125, 0.5); --viz-tick: #475a7d; --viz-ring: #ffffff;
  --st-on: #157a3b; --st-low: #5b6f93; --st-over: #b45309;
  --accent-rgb: var(--pal-rgb-l); --primary-shadow: 0 8px 24px -10px rgba(var(--accent-rgb), 0.6);
  --switch-knob: #5b6f93; --picker-filter: none;
  color-scheme: light;
}

/* palettes (teal is the default, set on :root above) */
:root[data-palette="ocean"] { --pal-accent-d: #7cc4ff; --pal-accent-l: #1d5fc4; --pal-viz-d: #3b8cf0; --pal-viz-l: #2563eb; --pal-rgb-d: 124, 196, 255; --pal-rgb-l: 37, 99, 235; --pal-g1: #93c5fd; --pal-g2: #60a5fa; --pal-on: #061a33; }
:root[data-palette="nebula"] { --pal-accent-d: #c4b5fd; --pal-accent-l: #6d28d9; --pal-viz-d: #8b6cf6; --pal-viz-l: #7c3aed; --pal-rgb-d: 196, 181, 253; --pal-rgb-l: 124, 58, 237; --pal-g1: #c4b5fd; --pal-g2: #a78bfa; --pal-on: #1a0f3d; }
:root[data-palette="berry"] { --pal-accent-d: #f9a8d4; --pal-accent-l: #be185d; --pal-viz-d: #e0559e; --pal-viz-l: #db2777; --pal-rgb-d: 249, 168, 212; --pal-rgb-l: 219, 39, 119; --pal-g1: #f9a8d4; --pal-g2: #f472b6; --pal-on: #3a0a24; }
:root[data-palette="moonlight"] { --pal-accent-d: #cbd5e1; --pal-accent-l: #334155; --pal-viz-d: #8fa3c2; --pal-viz-l: #475569; --pal-rgb-d: 203, 213, 225; --pal-rgb-l: 71, 85, 105; --pal-g1: #e2e8f0; --pal-g2: #a5b4c8; --pal-on: #0b1736; }

*, *::before, *::after { box-sizing: border-box; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;             /* a scrolling page (not BenjiRoute's fixed map screen), so the sticky header works */
  overflow-x: hidden;
  background-color: var(--void);
  color: var(--ink);
  font: 400 16px/1.45 var(--sans);
  -webkit-text-size-adjust: 100%;
  font-variant-numeric: tabular-nums;
}
body { background-image: linear-gradient(180deg, var(--color-bg-top) 0%, var(--color-bg-mid) 45%, var(--color-bg-bottom) 100%); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
h1 em { font-style: normal; color: var(--accent-soft); }
p { margin: 0; }
a { color: var(--accent-soft); }

/* ---------- shared controls (16px inputs: no iOS focus zoom) ---------- */
input[type="text"], input[type="password"], input[type="search"], input[type="tel"], input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}
input[type="text"]:focus-visible, input[type="password"]:focus-visible, input[type="search"]:focus-visible, input[type="tel"]:focus-visible, input[type="date"]:focus-visible, input[type="number"]:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent-soft); outline-offset: 1px; }
/* iOS Safari: date inputs ignore min-height/padding unless appearance is reset, and render a taller, centred value */
input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; line-height: 1.2; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; min-height: 1.2em; margin: 0; }
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.8; filter: var(--picker-filter); }
input::placeholder { color: var(--muted); opacity: 1; }
.btn {
  min-height: var(--tap);
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s var(--ease), background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.btn-primary {
  background: var(--ui-gradient); border-color: transparent; color: var(--on-accent);
  box-shadow: var(--primary-shadow);
}
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); padding: 0 12px; }
.btn-small { min-height: var(--tap); font-size: 0.875rem; padding: 0 14px; }
.btn-danger { color: var(--bad); }
.icon-btn {
  flex: none;
  display: grid; place-items: center;
  width: var(--tap); height: var(--tap);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--btn-bg);
  color: var(--accent-soft);
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s, transform 0.3s var(--ease);
}
.icon-btn:active { transform: scale(0.95); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) {
  .btn:hover { background: var(--surface-hover); border-color: var(--blue-bright); }
  .btn[aria-disabled="true"]:hover, .btn:disabled:hover { background: var(--btn-bg); border-color: var(--line); }
  .btn-primary:hover { background: var(--ui-gradient); box-shadow: var(--primary-shadow-hover); transform: translateY(-2px); }
  .btn-quiet:hover { background: var(--surface-hover); border-color: transparent; color: var(--ink); }
  .icon-btn:hover { background: var(--surface-hover); border-color: var(--blue-bright); }
}
.form-error { color: var(--bad); font-weight: 600; font-size: 0.9375rem; }
.form-error:empty { display: none; }
/* lookup spinner inside the Check button */
.spinner {
  display: inline-block; width: 1em; height: 1em; margin-right: 0.5em; vertical-align: -0.15em;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left)); }
.login-card {
  position: relative;
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 8px;
  padding: 28px 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 60px -24px var(--shadow);
}
.login-card::before {
  content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
}
.login-card h1 { font-size: clamp(2rem, 9vw, 2.5rem); }
.login-lead { color: var(--muted); margin-bottom: 10px; font: 600 0.75rem/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.login-card label { font-weight: 600; font-size: 0.9375rem; margin-top: 6px; color: var(--ink); }
.login-card .btn { margin-top: 14px; min-height: 48px; }
.login-card .btn + .btn { margin-top: 0; }
.login-card form { display: flex; flex-direction: column; }   /* single-button forms (unsubscribe page) */
.login-text { color: var(--ink); font-size: 1rem; line-height: 1.45; }
.login-alt { text-align: center; font-size: 0.9375rem; margin-top: 6px; }
.login-card .btn:not(.btn-primary):not(.btn-quiet) { border-color: var(--muted); }   /* ≥3:1 against the card */
@media (hover: hover) { .login-card .btn:not(.btn-primary):not(.btn-quiet):hover { border-color: var(--blue-bright); } }
.login-alt a { display: inline-block; min-height: 44px; box-sizing: border-box; padding: 13px 10px; color: var(--accent-soft); text-underline-offset: 3px; }   /* 44px+ touch target */
.login-alt a:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; border-radius: 4px; }
@media (max-height: 420px) {
  .login { align-items: start; padding-top: 12px; padding-bottom: 12px; }
  .login-card { padding: 14px 20px 12px; gap: 4px; }
  .login-card h1 { font-size: 1.5rem; }
  .login-lead { display: none; }
  .login-card .btn { min-height: 44px; margin-top: 8px; }
  .login-alt { margin-top: 0; }
  .login-alt a { padding: 11px 10px; min-height: 44px; }
}


/* ---------- banners / badges / notes / dialogs (from BenjiRoute) ---------- */
.banners { display: flex; flex-direction: column; }
.banner { padding: 9px var(--gutter); font-size: 0.8125rem; line-height: 1.35; font-weight: 600; border-left: 4px solid transparent; }
.banner-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.banner-demo { background: var(--note-bg); color: var(--note-ink); border-left-color: var(--nebula-violet); }
.banner-warn { background: var(--warn-bg); color: var(--warn-ink); border-left-color: var(--amber); }
.banner-error { background: var(--err-bg); color: var(--err-ink); border-left-color: var(--c-heavy); }
.badge {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--field);
  font: 600 0.6875rem/1.6 var(--mono); letter-spacing: 0; color: var(--muted);
}
.badge.trend-worse { color: var(--bad); border-color: var(--bad); }
.badge.trend-better { color: var(--good); border-color: var(--good); }
.badge.confirmed { color: var(--good); border-color: var(--good); }
.badge.warn { color: var(--amber); border-color: var(--amber); }   /* #fbbf24 on #070f26 / #0f1d3f is ~11:1 */
.note { padding: 10px var(--gutter); font-size: 0.8125rem; color: var(--muted); }
.dialog {
  width: min(92vw, 420px); padding: 24px 22px;
  border: 1px solid var(--line); border-radius: 20px;
  background: var(--panel); color: var(--ink);
  box-shadow: 0 24px 60px -16px var(--shadow);
  overscroll-behavior: contain;
}
.dialog::backdrop { background: rgba(7, 15, 38, 0.72); }
.dialog h2 { font-size: 1.375rem; margin-bottom: 14px; }
.dialog label { display: block; font-weight: 600; margin-bottom: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.manage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.manage-row { display: flex; gap: 6px; align-items: center; }
.manage-row input { flex: 1; min-width: 0; }
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 50;
  padding: 6px max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  padding-top: max(6px, env(safe-area-inset-top));
  background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.top-row { display: flex; align-items: center; gap: 10px; min-height: 40px; padding-bottom: 6px; }
.top-row h1 { font-size: 1.375rem; font-weight: 800; }
.brand-mark { width: auto; height: 1.4em; display: inline-block; vertical-align: -0.3em; margin-right: 0.35em; }   /* as BenjiRoute */
.login-card .brand-mark { height: 1.15em; vertical-align: -0.2em; }
.status { flex: 1; min-width: 0; font: 600 0.6875rem/1.3 var(--mono); letter-spacing: 0.01em; color: var(--muted); text-align: right; }
.banner-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 14px max(var(--gutter), env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left)); }
.panel-tab { display: flex; flex-direction: column; gap: 16px; }
.panel-tab:focus { outline: none; }   /* iOS focuses the panel on a tap: no outline round the whole page, as .main */
.panel-tab > h2, .block > h2 { font-size: 1.125rem; letter-spacing: -0.02em; }
.block { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; }
.hint { color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
.field-label { font-weight: 600; font-size: 0.9375rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row > .btn { flex: 1 1 140px; }
.switch { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 700; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; position: relative; margin: 0; width: 52px; height: 32px; border-radius: 999px; background: var(--raise); border: 2px solid var(--border); cursor: pointer; transition: background-color 0.15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--switch-knob); transition: transform 0.15s, background-color 0.15s; }
.switch input:checked { background: var(--accent-soft); border-color: var(--accent-soft); }
.switch input:checked::after { transform: translateX(20px); background: var(--void); }
.switch input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.switch-hint { margin: -4px 0 4px 64px; font-size: 0.875rem; color: var(--muted); }
.form-ok { color: var(--good); font-weight: 600; font-size: 0.9375rem; }
.form-ok:empty { display: none; }
.credit { padding: 4px 0 0; font-size: 0.8125rem; color: var(--muted); line-height: 1.5; }
.credit p + p { margin-top: 8px; }
.dialog p { margin-bottom: 4px; }


.panel-title { font-size: 1.125rem; letter-spacing: -0.02em; margin-bottom: 10px; }
.noscript { padding: var(--gutter); }
.panel-tab[hidden] { display: none !important; }
.login-card h1 { text-align: center; }
.login-card h1:focus, #status:focus { outline: none; }   /* programmatic focus targets, not controls */
.app.is-guest .top-row h1 { flex: 1; }
.empty { padding: 20px 16px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; display: flex; flex-direction: column; gap: 6px; }
.empty strong { font-size: 1.125rem; }

@media (min-width: 640px) { .main { padding-top: 24px; } }
@media (prefers-reduced-motion: reduce) {
  .tab, .switch input, .switch input::after { transition: none; }
  .btn:active { transform: none; }
  .spinner { animation: none; width: 0.5em; height: 0.5em; margin-right: 0.6em; vertical-align: 0.05em; background: currentColor; border: 0; }
}
@media (forced-colors: active) {
  .switch input { forced-color-adjust: none; background: Canvas; border-color: CanvasText; }
  .switch input::after { background: CanvasText; }
  .switch input:checked { background: Highlight; border-color: Highlight; }
  .switch input:checked::after { background: HighlightText; }
  .tab[aria-selected="true"] { outline: 2px solid Highlight; }
}


/* =====================================================================================================================
   1.0 screens
   ===================================================================================================================== */
textarea { padding: 10px 14px; min-height: 88px; resize: vertical; line-height: 1.4; }
select { padding-right: 34px; -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); }
input.is-check { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
label.field-label, .field > label { font-weight: 600; font-size: 0.9375rem; }
.field-hint { font-size: 0.8125rem; color: var(--muted); }
.field-error { font-size: 0.875rem; color: var(--bad); font-weight: 600; }
.field-error:empty { display: none; }
.field-row { display: flex; gap: 10px; }
.field-row > .field { flex: 1 1 0; }
.unit-suffix { position: relative; }
.unit-suffix input { padding-right: 44px; }
.unit-suffix::after { content: attr(data-unit); position: absolute; right: 14px; top: 0; height: var(--tap); display: flex; align-items: center; color: var(--muted); font-size: 0.875rem; pointer-events: none; }
.field .unit-suffix { margin-top: 0; }

/* ---- bottom tab bar (iOS safe area) ---- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; justify-content: center; gap: 12px;   /* Hangouts and Me sit together in the middle, not pinned to the left */
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: var(--tab-bg); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  flex: 0 1 132px; min-height: 52px; padding: 4px 2px; border: 0; border-radius: 14px;
  background: transparent; color: var(--muted); font: inherit; font-size: 0.6875rem; font-weight: 700; cursor: pointer;
  transition: color 0.25s, background-color 0.25s;
}
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-selected="true"] { color: var(--accent-soft); background: var(--tab-sel-bg); }
.tab:focus-visible { outline-offset: -3px; }
@media (hover: hover) { .tab:hover { color: var(--ink); background: var(--surface-hover); } }
@media (min-width: 700px) { .tabs { max-width: 640px; left: 50%; right: auto; width: 100%; transform: translateX(-50%); border-radius: 20px 20px 0 0; border: 1px solid var(--line); border-bottom: 0; } }

/* ---- cards, stacks, headings ---- */
.stack { display: flex; flex-direction: column; gap: 12px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.card h3, .card-title { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.big { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.lead { font-size: 1.0625rem; font-weight: 600; }
.muted { color: var(--muted); }
.sm { font-size: 0.875rem; }
.xs { font-size: 0.8125rem; }
.pos { color: var(--good); } .neg { color: var(--bad); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-soft); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.warnbox { padding: 12px 14px; border-radius: 14px; background: var(--warn-bg); color: var(--warn-ink); font-size: 0.9375rem; line-height: 1.45; border-left: 4px solid var(--amber); }
.infobox { padding: 12px 14px; border-radius: 14px; background: var(--raise); font-size: 0.9375rem; line-height: 1.45; }


/* ---- segmented control + chips ---- */
.seg { display: flex; padding: 3px; gap: 3px; background: var(--raise); border-radius: 999px; }
.seg button { flex: 1 1 0; min-height: 40px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 0.875rem; font-weight: 700; cursor: pointer; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px var(--shadow); }
.seg-small button { min-height: 36px; font-size: 0.8125rem; }
.seg button:focus-visible { outline-offset: -2px; }

/* ---- sheet (bottom sheet dialog) ---- */
.sheet {
  width: 100%; max-width: 640px; max-height: calc(100dvh - 24px - env(safe-area-inset-top)); margin: auto auto 0; padding: 0;
  border: 1px solid var(--line); border-radius: 24px 24px 0 0; background: var(--panel); color: var(--ink);
  box-shadow: 0 -20px 60px -16px var(--shadow); overscroll-behavior: contain; overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(7, 15, 38, 0.66); }
.sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 8px 20px; flex: none; }
.sheet-bar h2 { font-size: 1.25rem; outline: none; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 24px; } }
@media (prefers-reduced-motion: no-preference) { .sheet[open] { animation: sheet-in 0.28s var(--ease); } }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0.4; } }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; }
.sheet-actions .btn { width: 100%; }

/* ---- toast ---- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 80; display: flex; align-items: center; gap: 6px; width: max-content; max-width: min(calc(100vw - 32px), 520px); min-height: 48px; padding: 12px 18px; border-radius: 18px; line-height: 1.35; text-wrap: pretty; background: var(--ink); color: var(--void); font-weight: 600; font-size: 0.9375rem; box-shadow: 0 10px 30px var(--shadow); }
.toast .btn { color: var(--void); text-decoration: underline; flex: none; margin: -6px -8px -6px 0; }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; font-size: 0.9375rem; line-height: 1.45; cursor: pointer; }
.check input { flex: none; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--accent-soft); }
/* ---- misc ---- */
.list-plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.skeleton { height: 90px; border-radius: 16px; background: var(--raise); opacity: 0.6; }
.disclaimer { font-size: 0.8125rem; color: var(--muted); line-height: 1.5; }
.me-row { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; padding: 8px 0; background: none; border: 0; border-top: 1px solid var(--line); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.me-row:first-of-type { border-top: 0; }
.me-row .chev { color: var(--muted); }
.dev-flag { position: fixed; top: 0; left: 0; right: 0; z-index: 99; padding: 2px 8px; font-size: 0.6875rem; font-weight: 700; text-align: center; background: #c026d3; color: #fff; }
.sheet-bar h2:focus { outline: none; }

.skip-link { position: absolute; left: 8px; top: -60px; z-index: 120; padding: 10px 14px; border-radius: 10px; background: var(--panel); color: var(--ink); font-weight: 700; }
.skip-link:focus { top: max(8px, env(safe-area-inset-top)); }
html { scroll-padding-top: 76px; scroll-padding-bottom: 96px; }
option { background: var(--field); color: var(--ink); }
.main:focus { outline: none; }

/* ---- report a problem / make a request (speech-bubble in the header, sheet "Tell us") ---- */
.feedback-btn { color: var(--muted); }
.feedback-btn[hidden] { display: none; }
.fb-form { display: flex; flex-direction: column; gap: 14px; }
.fb-kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-chip { position: relative; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--btn-bg); color: var(--ink); font-weight: 600; font-size: 0.9375rem; cursor: pointer; transition: background-color 0.25s, border-color 0.25s; }
.fb-chip:has(.fb-radio:checked) { border-color: var(--accent-soft); background: var(--chip-sel-bg); color: var(--accent-soft); }
.fb-chip:has(.fb-radio:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.fb-radio { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.fb-text { min-height: 120px; padding: 10px 14px; }
.fb-count { align-self: flex-end; font-variant-numeric: tabular-nums; }
.fb-msg { color: var(--bad); font-weight: 600; font-size: 0.9375rem; }
.fb-msg:empty { display: none; }
.fb-thanks { font-weight: 700; font-size: 1.0625rem; color: var(--good); outline: none; }
.fb-thanks[hidden] { display: none; }

/* ---- Me tab: Benjiverse avatar + name ---- */
.me-card { flex-direction: row; align-items: center; gap: 16px; }
.me-pic { flex: none; }
.me-id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card .me-name { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; text-transform: none; color: var(--ink); overflow-wrap: anywhere; }
.me-link { display: inline-flex; align-items: center; min-height: var(--tap); }   /* 44px tap height */
.av { position: relative; display: block; box-sizing: border-box; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: #0f1b3d; }
.av img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.av[data-frame] { padding: 3px; background: var(--ring, #0f1b3d); }
.av[data-frame] img { background: #0f1b3d; }
.av[data-frame="rainbow-ring"] { background: conic-gradient(#ef4444, #f59e0b, #eab308, #22c55e, #06b6d4, #6366f1, #d946ef, #ef4444); }
.av[data-frame="bronze-ring"] { --ring: #b45309; }
.av[data-frame="silver-ring"] { --ring: #94a3b8; }
.av[data-frame="gold-ring"] { --ring: #eab308; }
.av[data-frame="platinum-ring"] { --ring: #67e8f9; }
.av[data-frame="diamond-ring"] { --ring: #c4b5fd; }
.av[data-frame="copper-ring"] { --ring: #b87333; }
.av[data-frame="emerald-ring"] { --ring: #10b981; }
.av[data-frame="sapphire-ring"] { --ring: #2563eb; }
.av[data-frame="ruby-ring"] { --ring: #dc2626; }
.av[data-frame="pink-ring"] { --ring: #ec4899; }

/* ---- Me tab: Appearance (theme + colour palette) ---- */
.seg-tall button { min-height: 44px; padding: 0 4px; font-size: 0.8125rem; white-space: nowrap; }
.pal-set { margin: 4px 0 0; padding: 0; border: 0; min-width: 0; }
.pal-set legend { padding: 0; margin-bottom: 8px; }
.pal-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pal-chip { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 14px 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--btn-bg); color: var(--ink); font-weight: 600; font-size: 0.9375rem; cursor: pointer; transition: background-color 0.25s, border-color 0.25s; }
.pal-chip:has(.fb-radio:checked) { border-color: var(--accent-soft); background: var(--chip-sel-bg); color: var(--accent-soft); }
.pal-chip:has(.fb-radio:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.swatch { flex: none; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 0 0 1px rgba(11, 23, 54, 0.35); }
.swatch[data-swatch="teal"] { background: linear-gradient(135deg, #5eead4, #22b8cf); }
.swatch[data-swatch="ocean"] { background: linear-gradient(135deg, #93c5fd, #2563eb); }
.swatch[data-swatch="nebula"] { background: linear-gradient(135deg, #c4b5fd, #7c3aed); }
.swatch[data-swatch="berry"] { background: linear-gradient(135deg, #f9a8d4, #db2777); }
.swatch[data-swatch="moonlight"] { background: linear-gradient(135deg, #e2e8f0, #64748b); }
.pal-tick { font-weight: 800; visibility: hidden; }
.pal-chip:has(.fb-radio:checked) .pal-tick { visibility: visible; }
@media (forced-colors: active) { .pal-chip:has(.fb-radio:checked) { border-color: Highlight; border-width: 2px; } .swatch { forced-color-adjust: none; } }
.av-ph { background: #0f1b3d; }

/* =====================================================================================================================
   0.3.0: hangouts, snap, album, viewer
   ===================================================================================================================== */
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.plan-ex { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }

/* time inputs: same look and 16px text as the others (no iOS zoom), iOS appearance reset like date */
input[type="time"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%; min-height: var(--tap); padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.2; text-align: left;
}
input[type="time"]::-webkit-date-and-time-value { text-align: left; min-height: 1.2em; margin: 0; }
input[type="time"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.8; filter: var(--picker-filter); }
input[type="time"]:focus-visible { border-color: var(--accent-soft); outline-offset: 1px; }
input[type="time"][aria-invalid="true"] { border-color: var(--bad); }
.timing { min-height: 1.3em; margin-top: -4px; }

/* ---- the Snap time banner (inside the sticky header, so it stays in view) ---- */
.live-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; padding: 10px 12px; border-radius: 16px; background: var(--ui-gradient); color: var(--on-accent); box-shadow: var(--primary-shadow); }
.live-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.live-text { font-weight: 800; font-size: 1rem; line-height: 1.25; }
.live-sub { font-size: 0.8125rem; font-weight: 600; overflow-wrap: anywhere; }
.live-actions { flex: none; display: flex; align-items: center; gap: 6px; }
.live-banner .btn { min-height: var(--tap); padding: 0 16px; border-color: rgba(6, 32, 43, 0.45); background: transparent; color: var(--on-accent); }
.live-banner .btn-primary { background: var(--on-accent); border-color: var(--on-accent); color: #fff; box-shadow: none; }
.live-banner .icon-btn { border-color: rgba(6, 32, 43, 0.45); background: transparent; color: var(--on-accent); font-size: 1rem; font-weight: 800; }
@media (hover: hover) { .live-banner .btn:hover, .live-banner .icon-btn:hover { background: rgba(6, 32, 43, 0.12); border-color: var(--on-accent); } .live-banner .btn-primary:hover { background: var(--on-accent); transform: none; box-shadow: none; } }
@media (max-width: 420px) { .live-banner { flex-wrap: wrap; } .live-actions { width: 100%; } .live-actions .btn-primary { flex: 1; } }

/* ---- hangout rows, invites, notices ---- */
.h-list { gap: 8px; }
.h-row { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px 12px 12px 14px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); font: inherit; cursor: pointer; transition: background-color 0.25s, border-color 0.25s; }
.h-row.is-live { border-color: var(--accent-soft); }
.h-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.h-name { font-weight: 700; font-size: 1.0625rem; overflow-wrap: anywhere; }
.h-meta { font-size: 0.875rem; }
.h-sub { font-size: 0.8125rem; color: var(--muted); }
.h-badges { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.h-badges:empty { display: none; }
.chev { flex: none; color: var(--muted); display: grid; place-items: center; }
.chev svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.live-badge { color: var(--accent-soft); border-color: var(--accent-soft); font-weight: 700; }
.badge { white-space: nowrap; }
.invite { border-color: var(--accent-soft); }
.card .invite-name { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; text-transform: none; color: var(--ink); overflow-wrap: anywhere; }
.invite .link-btn { align-self: flex-start; }
.notices .notice-line { padding: 6px 0; font-weight: 600; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.notices .notice-line:first-child { border-top: 0; }
.notices .btn { align-self: flex-start; }
.stack > .list-plain { gap: 8px; }

/* ---- calendar of past hangouts ---- */
.cal { display: flex; flex-direction: column; gap: 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-title { flex: 1; text-align: center; font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.02em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.6875rem; font-weight: 700; color: var(--muted); padding: 2px 0; }
.cal-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; min-height: 48px; padding: 6px 2px 4px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--muted); font: inherit; }
button.cal-cell { background: var(--surface); border-color: var(--line); color: var(--ink); cursor: pointer; }
.cal-num { font-size: 0.8125rem; font-weight: 700; line-height: 1; }
.cal-cell.is-out { opacity: 0.4; }
.cal-cell.is-today { border-color: var(--accent-soft); }
.cal-dot { min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--ui-gradient); color: var(--on-accent); font-size: 0.6875rem; font-weight: 800; line-height: 18px; text-align: center; }
.cal-dot:empty { width: 10px; min-width: 10px; height: 10px; padding: 0; border-radius: 50%; margin: 4px 0; }
@media (hover: hover) { button.cal-cell:hover, .h-row:hover { background: var(--surface-hover); border-color: var(--blue-bright); } }

/* ---- one hangout ---- */
.detail-top { min-height: var(--tap); }
.back-btn { padding-left: 4px; }
.detail-head { gap: 6px; }
.card .detail-title, .detail-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; text-transform: none; color: var(--ink); overflow-wrap: anywhere; line-height: 1.15; }
.snap-btn { flex: 1 1 140px; min-height: 52px; font-size: 1.0625rem; }
.upload-status:empty { display: none; }
.upload-status { display: flex; flex-direction: column; gap: 8px; }
.warnbox.rejected { display: flex; flex-direction: column; gap: 8px; }
.warnbox[role="status"] { font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
@media (min-width: 480px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--raise); cursor: pointer; }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.tile.is-loaded img { opacity: 1; }
.tile img:not([src]) { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) { .tile img { transition: opacity 0.25s var(--ease); } }
.tile:focus-visible { outline-offset: 2px; }
.people { gap: 4px; }
.person { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.av-sm { width: 36px; height: 36px; flex: none; }
.av-sm[data-frame] { padding: 2px; }

/* ---- the photo viewer: always dark, whatever the theme ---- */
.viewer { --ink: #f4f6fb; --muted: #b6c5e0; --line: #3a5282; --btn-bg: rgba(19, 34, 67, 0.85); --surface-hover: #1b2f5a; --bad: #ff8a95; --accent-soft: var(--pal-accent-d); --blue-bright: var(--pal-g2);
  width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  border: 0; background: #05091a; color: var(--ink); overscroll-behavior: contain; overflow: hidden; }
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: #000; }
.viewer-bar { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; }
.viewer-count { font-weight: 700; font-size: 0.9375rem; }
.viewer-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; touch-action: pan-y; }
.viewer-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-select: none; }
.viewer-img:not([src]) { display: none; }
.viewer-note { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px; background: rgba(5, 9, 26, 0.75); font-size: 0.875rem; font-weight: 600; text-align: center; }
.viewer-note:empty { display: none; }
.viewer-cap { flex: none; padding: 6px 14px 2px; text-align: center; font-size: 0.9375rem; color: var(--muted); overflow-wrap: anywhere; }
.viewer-actions { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 8px 12px 14px; }
.viewer-actions .btn { min-width: 96px; }
.viewer-prev, .viewer-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(5, 9, 26, 0.6); }
.viewer-prev { left: max(6px, env(safe-area-inset-left)); } .viewer-next { right: max(6px, env(safe-area-inset-right)); }
.viewer-prev:disabled, .viewer-next:disabled { opacity: 0.25; }
.viewer-prev:active, .viewer-next:active { transform: translateY(-50%) scale(0.95); }

/* ---- friend picker, pace chips, report reasons ---- */
.pick { display: flex; flex-direction: column; gap: 8px; }
.pick-list { display: flex; flex-direction: column; max-height: 40vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--field); -webkit-overflow-scrolling: touch; }
.pick-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.pick-row:first-child { border-top: 0; }
.pick-row input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--accent-soft); }
.pick-row:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 12px; }
.pick-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.pick-av { flex: none; display: block; }
.pick-count { align-self: flex-end; }
.pace-chip { flex: 1 1 104px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; padding: 8px 16px; min-height: 56px; }
.pace-main { font-weight: 700; }
.pace-sub { font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.pace-chip:has(.fb-radio:checked) .pace-sub { color: inherit; opacity: 0.9; }
.why-list { display: flex; flex-direction: column; gap: 8px; }
.why { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--btn-bg); cursor: pointer; }
.why:has(.fb-radio:checked) { border-color: var(--accent-soft); background: var(--chip-sel-bg); }
.why:has(.fb-radio:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.why-main { font-weight: 700; }
.why-sub { font-size: 0.875rem; color: var(--muted); }
@media (forced-colors: active) { .why:has(.fb-radio:checked), .pace-chip:has(.fb-radio:checked) { border-color: Highlight; border-width: 2px; } }

/* ---- help lines in the report sheets ---- */
.help-list { gap: 0; }
.help-link { display: inline-block; min-height: 44px; line-height: 44px; padding: 0 4px; font-weight: 700; color: var(--accent-soft); }
.help p { margin-bottom: 2px; }

/* =====================================================================================================================
   0.3.0: past hangouts, snap time countdown, camera screen
   ===================================================================================================================== */
/* the first step of "New hangout": two big choices */
.choice { border-radius: 18px; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; padding: 12px 16px; text-align: left; }
.choice-main { font-weight: 700; font-size: 1.0625rem; }
.choice-sub { font-size: 0.875rem; font-weight: 500; color: var(--muted); line-height: 1.35; white-space: normal; }
form.stack > .link-btn { align-self: flex-start; }

/* calendar: a past hangout still taking photos gets a ring round its dot */
.cal-cell.is-adding .cal-dot { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent-soft); }

/* the countdown line in the Snap time banner */
.live-count { font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.live-count:empty { display: none; }

/* album: Snap time n / late on a photo */
.tile-marks { position: absolute; left: 4px; bottom: 4px; right: 4px; display: flex; flex-wrap: wrap; gap: 3px; pointer-events: none; }
.tile-mark { padding: 1px 6px; border-radius: 999px; background: rgba(5, 9, 26, 0.78); color: #fff; font-size: 0.6875rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.tile-mark.is-late { color: #ffd98a; }
.cap-badge { margin-left: 6px; vertical-align: 1px; }

/* the camera screen: full-screen and dark whatever the theme (it is a viewfinder), same accent as the rest of BenjiSnap */
.camera { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: #fff; overflow: hidden; }
.camera[open] { display: flex; flex-direction: column; }
.camera::backdrop { background: #000; }
.camera-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); min-height: 64px; }
.camera-btn { flex: none; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 50%; background: rgba(19, 34, 67, 0.7); color: #fff; cursor: pointer; }
.camera-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.camera-btn:active { transform: scale(0.95); }
.camera-btn[hidden] { display: none; }
.camera-btn:focus-visible, .camera-shutter:focus-visible, .camera-done:focus-visible { outline: 3px solid var(--pal-accent-d); outline-offset: 3px; }
.camera-pill { flex: 0 1 auto; min-width: 0; margin: 0; padding: 6px 14px; border-radius: 999px; background: var(--ui-gradient); color: var(--pal-on); font-size: 0.8125rem; font-weight: 800; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.camera-pill.is-late { background: #ffd98a; color: #3d2c05; }
.camera-pill[hidden] { display: none; }
.camera-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; background: #000; overflow: hidden; }
.camera-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.camera-video.is-front { transform: scaleX(-1); }            /* a selfie preview reads like a mirror; the saved photo is not flipped */
.camera-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { .camera-flash.go { animation: camera-flash 0.28s ease-out; } }
@keyframes camera-flash { from { opacity: 0.85; } to { opacity: 0; } }
.camera-status { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: calc(100% - 28px); margin: 0; padding: 5px 14px; border-radius: 999px; background: rgba(5, 9, 26, 0.78); font-size: 0.875rem; font-weight: 600; text-align: center; }
.camera-status:empty, .camera-status[hidden] { display: none; }
.camera-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 24px; background: #070f26; }
.camera-fallback[hidden] { display: none; }
.camera-fallback-text { margin: 0 0 6px; font-size: 1.0625rem; font-weight: 600; line-height: 1.4; text-align: center; }
.camera-fallback .btn { --ink: #f4f6fb; --line: #3a5282; --btn-bg: rgba(19, 34, 67, 0.85); color: #f4f6fb; }
.camera-fallback .btn-primary { color: var(--pal-on); }
.camera-bottom { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.camera-count { justify-self: start; font-size: 0.9375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.camera-done { justify-self: end; min-height: 48px; padding: 0 18px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px; background: rgba(19, 34, 67, 0.7); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.camera-shutter { display: grid; place-items: center; width: 78px; height: 78px; padding: 0; border: 4px solid #fff; border-radius: 50%; background: transparent; cursor: pointer; }
.camera-shutter-in { display: block; width: 58px; height: 58px; border-radius: 50%; background: #fff; transition: transform 0.12s var(--ease); }
.camera-shutter:active .camera-shutter-in { transform: scale(0.88); }
.camera-shutter:disabled { opacity: 0.4; cursor: default; }
@media (prefers-reduced-motion: reduce) { .camera-shutter-in, .camera-btn { transition: none; } .camera-shutter:active .camera-shutter-in, .camera-btn:active { transform: none; } }
.camera { overscroll-behavior: contain; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.camera button { touch-action: manipulation; }

/* ---- 0.4.0: invite link ---- */
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card .row-between:has(.row-actions) { flex-wrap: wrap; gap: 8px; }
/* type+attribute selector above would beat a bare class, so this is element-qualified */
input[type="text"].link-field { font-size: 16px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; min-width: 0; }
.sheet .btn, .sheet .link-btn { min-height: var(--tap); }
.sheet .link-btn { align-self: flex-start; text-align: left; }
#joinNote { margin-top: 4px; }
