/* ID Check — one dark camera screen with sheets.
   Colour does one job here: the verdict. Everything else is graphite and white. */

:root {
  --bg: #0A0A0B;
  --raised: #161618;
  --raised-2: #212124;
  --raised-3: #2C2C30;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #F4F4F5;
  --text-2: #A8A8B0;
  --text-3: #8C8C95;

  --ok: #22D37A;
  --ok-ink: #032312;
  --bad: #FF5552;
  --bad-ink: #2B0605;
  --warn: #FFB224;
  --warn-ink: #2B1B00;
  --ban: #C8173D;
  --ban-ink: #FFFFFF;

  --r-sheet: 28px;
  --r-group: 16px;
  --r-btn: 18px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --t-press: 120ms;
  --t-sheet: 460ms;

  --num: ui-rounded, "SF Pro Rounded", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sans: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  color-scheme: dark;
}

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

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--bg);
}

body {
  font: 400 1rem/1.4 var(--sans);
  color: var(--text);
  background: var(--bg);
  /* Pinned to the screen edges rather than a measured height: iPhone home-screen
     apps report the wrong height for a moment on launch, which made the layout jump. */
  position: fixed; inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(255, 255, 255, 0.25); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: var(--raised-3) transparent; }
input { caret-color: var(--text); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
button:focus-visible, input:focus-visible, .toggle-row:has(input:focus-visible) {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
input, select, textarea { font-size: 16px; font-family: inherit; color: inherit; }

svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }

/* ---------- App shell ---------- */

.app { position: fixed; inset: 0; touch-action: manipulation; }
.app, .sheet { -webkit-user-select: none; user-select: none; }
.sheet .rows dd, .sheet .who h2 { -webkit-user-select: text; user-select: text; }
.camera video { -webkit-touch-callout: none; pointer-events: none; }

.camera {
  position: absolute; inset: 0; background: #000; overflow: hidden;
  /* Reticle width: fits the phone's width, and shrinks on short or landscape screens. */
  --rw: min(88vw, 520px, calc((100svh - 250px) * 2.7));
  --rt: 44%;
}
.camera video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0; transition: opacity 280ms var(--ease-out);
}
.camera video.ready { opacity: 1; }
/* Darken everything except the reticle window, so the barcode area pops. */
.shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,0) 22%, rgba(0,0,0,0) 72%, rgba(0,0,0,.65));
  pointer-events: none;
}

.reticle {
  position: absolute;
  left: 50%; top: var(--rt);
  width: var(--rw);
  aspect-ratio: 2.7 / 1;
  transform: translate(-50%, -50%);
  border-radius: 20px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.42);
  transition: transform 220ms var(--ease-out);
}
.reticle i {
  position: absolute; width: 34px; height: 34px;
  border: 3.5px solid #fff; border-radius: 4px;
  transition: border-color 160ms var(--ease-out);
}
.reticle i:nth-child(1) { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 20px; }
.reticle i:nth-child(2) { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 20px; }
.reticle i:nth-child(3) { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 20px; }
.reticle i:nth-child(4) { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 20px; }
.reticle.live i { animation: breathe 2.4s ease-in-out infinite; }
.reticle.hit { transform: translate(-50%, -50%) scale(0.96); }
.reticle.hit i { border-color: var(--ok); animation: none; }
@keyframes breathe { 50% { opacity: 0.55; } }

.hint {
  position: absolute; left: 16px; right: 16px;
  top: calc(var(--rt) + var(--rw) / 5.4 + 22px);
  text-align: center;
  font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0,0,0,.6);
}

.cam-tools {
  position: absolute; left: 50%;
  top: calc(var(--rt) + var(--rw) / 5.4 + 62px);
  transform: translateX(-50%);
  display: flex; gap: 14px;
}

.round {
  width: 48px; height: 48px; border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(28, 28, 31, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--line);
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-press);
}
.round:active { transform: scale(0.92); background: rgba(60, 60, 66, 0.8); }
.round[aria-pressed="true"] { background: #fff; color: #000; }
.round.small { position: relative; width: 40px; height: 40px; background: var(--raised-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
.round.small svg { width: 18px; height: 18px; }
.round.small::after { content: ""; position: absolute; inset: -6px; }

/* Camera off panel */
.cam-off {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 96px 32px 140px; text-align: center;
  background: radial-gradient(120% 70% at 50% 35%, #1a1a1d 0%, var(--bg) 70%);
}
.cam-off-icon { width: 44px; height: 44px; color: var(--text-2); stroke-width: 1.5; margin-bottom: 6px; }
.cam-off h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.cam-off p { color: var(--text-2); max-width: 32ch; margin-bottom: 12px; text-wrap: pretty; }
.cam-off .btn { width: min(100%, 320px); }

/* Top and bottom bars */
.topbar {
  position: absolute; top: 0; left: 0; right: 0;
  padding: calc(var(--safe-t) + 12px) calc(var(--safe-r) + 16px) 0 calc(var(--safe-l) + 16px);
  display: flex; justify-content: space-between; align-items: center;
  max-width: 560px; margin: 0 auto;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.pill {
  height: 44px; padding: 0 16px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(28, 28, 31, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--line);
  font-weight: 700; letter-spacing: -0.01em;
  transition: transform var(--t-press) var(--ease-out);
}
.pill:active { transform: scale(0.95); }
.limit { font-family: var(--num); font-size: 1.0625rem; }
.counter { padding-right: 18px; }
.count { display: inline-block; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; min-width: 1ch; text-align: right; }
.count-label { font-size: 0.8125rem; color: var(--text-2); font-weight: 600; }

.bottombar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 calc(var(--safe-r) + 12px) calc(var(--safe-b) + 10px) calc(var(--safe-l) + 12px);
  display: grid; grid-template-columns: 76px 1fr 76px; align-items: center;
  max-width: 560px; margin: 0 auto;
}
.tab {
  height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.01em; color: #fff;
  border-radius: 16px;
  transition: transform var(--t-press) var(--ease-out), opacity var(--t-press);
}
.tab svg { width: 24px; height: 24px; filter: drop-shadow(0 1px 6px rgba(0,0,0,.55)); }
.tab span { text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.tab:active { transform: scale(0.92); opacity: 0.7; }

.status {
  justify-self: center;
  height: 36px; padding: 0 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8125rem; font-weight: 600; color: var(--text);
  background: rgba(28, 28, 31, 0.6);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.status .dot { width: 7px; height: 7px; border-radius: 99px; background: var(--text-3); flex: none; }
.status.live .dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(34,211,122,.6); animation: ping 1.8s var(--ease-out) infinite; }
.status.err .dot { background: var(--warn); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(34,211,122,.55); } 80%, 100% { box-shadow: 0 0 0 7px rgba(34,211,122,0); } }

/* ---------- Buttons ---------- */

.btn {
  position: relative; overflow: hidden; isolation: isolate;
  height: 52px; padding: 0 20px; border-radius: var(--r-btn);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em;
  transition: transform var(--t-press) var(--ease-out), background-color 160ms, color 160ms, opacity 160ms;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.big { height: 64px; font-size: 1.1875rem; border-radius: 20px; }
.btn.primary { background: #fff; color: #000; }
.btn.secondary { background: var(--raised-2); color: var(--text); }
.btn.secondary:active { background: var(--raised-3); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.btn.ok { background: var(--ok); color: var(--ok-ink); }
.btn.danger { background: transparent; color: #FF6B81; border: 1.5px solid rgba(200, 23, 61, 0.55); height: 48px; font-size: 0.9375rem; }
.btn svg { width: 20px; height: 20px; stroke-width: 2.2; }
.link { color: var(--text-2); font-weight: 600; font-size: 0.9375rem; padding: 10px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }

/* Hold-to-act: a fill sweeps across while the finger stays down. */
.btn .fill {
  position: absolute; inset: 0; z-index: -1;
  transform: scaleX(0); transform-origin: left;
  transition: transform 220ms var(--ease-out);
}
.btn.danger .fill { background: var(--ban); }
.btn.ok .fill { background: rgba(3, 35, 18, 0.22); }
.btn.secondary .fill { background: var(--raised-3); }
.btn.holding .fill { transform: scaleX(1); transition: transform var(--hold, 800ms) linear; }
.btn.danger.holding { color: #fff; border-color: var(--ban); }
.btn.hold:active { transform: scale(0.985); }

/* Confirm turns into a held override when the ID is flagged. */
.btn.override { background: var(--raised-2); color: var(--text); }
.btn.override .fill { background: rgba(255, 255, 255, 0.4); }
.btn.override.holding { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.55); }
.btn.white { background: #fff; color: #000; }

/* ---------- Sheets ---------- */

.scrim {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55);
  opacity: 0; pointer-events: none;
  transition: opacity 300ms var(--ease-out);
}
.scrim.on { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-width: 560px; margin: 0 auto;
  background: var(--raised);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.5);
  transform: translateY(105%);
  transition: transform var(--t-sheet) var(--ease-sheet);
  display: flex; flex-direction: column;
  max-height: calc(100% - var(--safe-t) - 12px);
  will-change: transform;
}
.sheet.open { transform: translateY(0); }
.sheet.dragging { transition: none; }

/* Result */
.result { overflow: hidden; }
.verdict {
  --v: var(--ok); --v-ink: var(--ok-ink);
  background: var(--v); color: var(--v-ink);
  padding: 22px 22px 20px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  transition: background-color 200ms;
  flex: none;
}
.verdict.bad { --v: var(--bad); --v-ink: var(--bad-ink); }
.verdict.warn { --v: var(--warn); --v-ink: var(--warn-ink); }
.verdict.ban { --v: var(--ban); --v-ink: var(--ban-ink); }
.verdict.unknown { --v: var(--raised-3); --v-ink: var(--text); }
.verdict-age { display: flex; flex-direction: column; }
.age { font-size: 6.5rem; font-weight: 800; line-height: 0.82; letter-spacing: -0.05em; }
.age-unit { font-size: 0.8125rem; font-weight: 700; margin-top: 8px; opacity: 0.78; }
.verdict-text { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 2px; padding-bottom: 4px; min-width: 0; }
.verdict-text strong { font-size: 1.625rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; text-wrap: balance; }
.verdict-text span { font-size: 0.875rem; font-weight: 600; opacity: 0.8; }
.verdict-icon { width: 30px; height: 30px; stroke-width: 2.6; margin-bottom: 6px; }

.sheet.open .verdict-age, .sheet.open .verdict-text { animation: rise 420ms var(--ease-out) both; }
.sheet.open .verdict-text { animation-delay: 40ms; }
@keyframes rise { from { transform: translateY(10px) scale(0.97); opacity: 0; } }
.verdict.flash { animation: flash 900ms ease-out; }
@keyframes flash { 0%, 30%, 60% { filter: brightness(1); } 15%, 45% { filter: brightness(1.25); } }

.sheet-body { padding: 18px 20px 4px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.who h2 { font-size: 1.625rem; font-weight: 750; letter-spacing: -0.025em; line-height: 1.12; overflow-wrap: anywhere; text-wrap: balance; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { height: 26px; padding: 0 10px; border-radius: 99px; display: inline-flex; align-items: center; font-size: 0.75rem; font-weight: 700; background: var(--raised-2); color: var(--text-2); letter-spacing: 0.01em; }
.chip.sample { color: #000; background: #fff; }

.notes { display: grid; gap: 8px; margin-top: 14px; }
.notes:empty { display: none; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.note svg { width: 20px; height: 20px; margin-top: 1px; }
.note.warn { background: rgba(255, 178, 36, 0.12); color: #FFC75A; }
.note.bad { background: rgba(255, 85, 82, 0.12); color: #FF8A87; }
.note.ban { background: rgba(200, 23, 61, 0.16); color: #FF7D96; }

.rows { margin-top: 14px; border-radius: var(--r-group); background: var(--raised-2); }
.rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 16px; }
.rows > div + div { box-shadow: inset 0 1px 0 var(--line); }
.rows dt { color: var(--text-2); font-size: 0.9375rem; flex: none; }
.rows dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; }
.rows dd.bad { color: #FF8A87; }
.rows dd.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9375rem; letter-spacing: 0.02em; }

.actions { flex: none; padding: 14px 16px calc(var(--safe-b) + 14px); display: grid; gap: 22px; background: var(--raised); box-shadow: 0 -1px 0 var(--line); }
.decide { display: grid; grid-template-columns: 1fr 1.55fr; gap: 10px; }
.actions.review { grid-template-columns: 1fr; gap: 10px; }
.actions .label { white-space: nowrap; }

/* Panels (history, settings) */
.panel { top: calc(var(--safe-t) + 12px); }
.grabber { height: 22px; display: grid; place-items: center; cursor: grab; touch-action: none; flex: none; }
.grabber span { width: 38px; height: 5px; border-radius: 99px; background: var(--raised-3); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 10px 20px; touch-action: none; flex: none; }
.panel-head h2 { font-size: 1.375rem; font-weight: 750; letter-spacing: -0.02em; }
.panel-body { padding: 4px 16px calc(var(--safe-b) + 28px); overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }

.group-title { font-size: 0.8125rem; font-weight: 650; color: var(--text-2); margin: 26px 4px 8px; display: flex; align-items: center; gap: 8px; letter-spacing: 0.01em; }
.badge { font-size: 0.75rem; font-weight: 800; color: var(--text); background: var(--raised-3); border-radius: 99px; padding: 1px 8px; }
.foot { font-size: 0.8125rem; color: var(--text-3); margin: 10px 4px 0; line-height: 1.45; text-wrap: pretty; }

.group { background: var(--raised-2); border-radius: var(--r-group); overflow: hidden; }
.toggle-row, .row-btn {
  min-height: 52px; padding: 10px 16px; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 1rem; font-weight: 500; text-align: left;
  cursor: pointer;
}
.toggle-row + .toggle-row, .row-btn + .row-btn { box-shadow: inset 0 1px 0 var(--line); }
.row-btn:active { background: var(--raised-3); }
.danger-text { color: #FF7D96; }

/* iOS-style switch, styled from a native checkbox so it stays a real control. */
input[type="checkbox"][switch] {
  appearance: none; -webkit-appearance: none;
  width: 51px; height: 31px; border-radius: 99px; flex: none;
  background: var(--raised-3); position: relative; cursor: pointer;
  transition: background-color 200ms var(--ease-out);
}
input[type="checkbox"][switch]::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 99px;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
  transition: transform 240ms var(--ease-out);
}
input[type="checkbox"][switch]:checked { background: var(--ok); }
input[type="checkbox"][switch]:checked::before { transform: translateX(20px); }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--raised-2); border-radius: 16px; }
.segmented button { height: 48px; border-radius: 12px; font-family: var(--num); font-size: 1.125rem; font-weight: 750; color: var(--text-2); transition: background-color 180ms var(--ease-out), color 180ms; }
.segmented button[aria-checked="true"] { background: #fff; color: #000; }
.segmented button:active { transform: scale(0.97); }

.stepper { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 16px; background: var(--raised-2); border-radius: var(--r-group); }
.stepper-ctl { display: flex; align-items: center; gap: 8px; }
.stepper input { width: 64px; height: 40px; text-align: center; font-size: 1.375rem; font-weight: 800; background: transparent; border: 0; color: var(--text); -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper .round.small { background: var(--raised-3); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.panel-body > .btn { width: 100%; margin-top: 14px; }

/* History */
.tally { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 20px; border-radius: 20px; background: var(--raised-2); }
.tally-main { display: flex; flex-direction: column; }
.tally-main .num { font-size: 4.5rem; font-weight: 800; line-height: 0.85; letter-spacing: -0.05em; }
.tally-main > span:last-child { font-size: 0.875rem; font-weight: 650; color: var(--text-2); margin-top: 8px; }
.tally-side { text-align: right; font-size: 0.9375rem; color: var(--text-2); display: grid; gap: 2px; }
.tally-side .num { color: var(--text); font-weight: 800; }
.since { font-size: 0.75rem; color: var(--text-3); margin-top: 6px; }

.list { list-style: none; background: var(--raised-2); border-radius: var(--r-group); overflow: hidden; }
.list:empty { display: none; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: left; min-height: 64px; }
.list > li + li { box-shadow: inset 0 1px 0 var(--line); }
.item:active { background: var(--raised-3); }
.item-age { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: var(--num); font-weight: 800; font-size: 1.125rem; flex: none; background: var(--raised-3); }
.item-age.ok { background: rgba(34,211,122,.14); color: var(--ok); }
.item-age.bad { background: rgba(255,85,82,.14); color: #FF8A87; }
.item-age.warn { background: rgba(255,178,36,.14); color: var(--warn); }
.item-age.ban { background: rgba(200,23,61,.2); color: #FF7D96; }
.item-main { flex: 1; min-width: 0; }
.item-main b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-main small { display: block; font-size: 0.8125rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 0.75rem; font-weight: 750; padding: 4px 9px; border-radius: 99px; flex: none; background: var(--raised-3); color: var(--text-2); }
.tag.in { background: rgba(34,211,122,.14); color: var(--ok); }
.tag.denied { color: var(--text-2); }
.tag.banned { background: rgba(200,23,61,.2); color: #FF7D96; }
.bans .item { cursor: default; }
.bans .item:active { background: none; }
.unban { font-size: 0.875rem; font-weight: 700; color: var(--text); background: var(--raised-3); height: 34px; padding: 0 14px; border-radius: 99px; flex: none; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 32px 24px; color: var(--text-2); }
.empty svg { width: 34px; height: 34px; stroke-width: 1.5; color: var(--text-3); }
.empty p { max-width: 30ch; font-size: 0.9375rem; text-wrap: pretty; }
.empty.small { padding: 18px 16px; background: var(--raised-2); border-radius: var(--r-group); }
.empty.small p { max-width: none; }
.list:not(:empty) + .empty { display: none; }

/* Toast */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 84px);
  max-width: 440px; margin: 0 auto;
  min-height: 52px; padding: 6px 6px 6px 18px; border-radius: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; color: #000; font-weight: 650;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  transform: translateY(12px) scale(0.98); opacity: 0;
  transition: transform 260ms var(--ease-out), opacity 200ms var(--ease-out);
}
.toast.on { transform: none; opacity: 1; }
.toast button { height: 40px; padding: 0 16px; border-radius: 13px; background: #000; color: #fff; font-weight: 700; font-size: 0.9375rem; }

/* Counter roll */
.count.roll { animation: roll 360ms var(--ease-out); }
@keyframes roll { from { transform: translateY(70%); opacity: 0; } }

@media (hover: hover) and (pointer: fine) {
  .btn.secondary:hover { background: var(--raised-3); }
  .row-btn:hover, .item:hover { background: rgba(255,255,255,.03); }
  .round:hover { background: rgba(50, 50, 55, 0.8); }
}

@media (max-width: 340px) {
  .hint { font-size: 0.8125rem; }
  .pill { padding: 0 12px; }
}
@media (min-height: 760px) {
  .age { font-size: 7.5rem; }
}
/* iPhone SE / mini: keep the verdict and the buttons on screen together */
@media (max-height: 700px) {
  .verdict { padding: 16px 18px 14px; }
  .age { font-size: 5.25rem; }
  .verdict-text strong { font-size: 1.375rem; }
  .sheet-body { padding-top: 14px; }
  .who h2 { font-size: 1.375rem; }
  .rows > div { padding: 11px 14px; }
  .btn.big { height: 58px; }
  .actions { gap: 14px; padding-top: 12px; }
  .tally-main .num { font-size: 3.75rem; }
}
/* Phone on its side */
@media (orientation: landscape) and (max-height: 500px) {
  .camera { --rt: 50%; --rw: min(60vw, 460px, calc((100svh - 120px) * 2.7)); }
  .hint { top: auto; bottom: calc(var(--safe-b) + 74px); }
  .cam-tools { top: 50%; left: auto; right: calc(var(--safe-r) + 16px); transform: translateY(-50%); flex-direction: column; }
  .cam-off { padding: 60px 32px 90px; gap: 8px; }
  .cam-off-icon, .cam-off p { display: none; }
  .sheet { max-width: 640px; }
  .verdict { padding: 12px 18px; }
  .sheet-body { padding-top: 10px; }
  .who h2 { font-size: 1.25rem; }
  .actions { grid-template-columns: 1.4fr 1fr; align-items: center; gap: 10px; padding-top: 10px; }
  .btn.big { height: 52px; }
  .actions .btn.danger { height: 52px; }
  .age { font-size: 3.5rem; }
  .verdict-icon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet { transition: transform 1ms, opacity 200ms; }
  .reticle.live i, .status.live .dot, .verdict.flash { animation: none; }
  .sheet.open .verdict-age, .sheet.open .verdict-text, .count.roll { animation: fade 200ms both; }
  @keyframes fade { from { opacity: 0; } }
}
@media (prefers-reduced-transparency: reduce) {
  .round, .pill, .status { background: var(--raised-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
