/* Bree-ah shared design system.
   Tokens, type, and every component shared across the landing page, the
   sign-in flow, the capture app and the member portal. Page-specific layout
   stays inline in each page.

   OKLCH throughout: perceptual lightness makes the light/dark pair derivable
   rather than hand-tuned, and lets generated title plates hue-rotate without
   drifting in lightness. System font only: it ships optical sizing that a
   webfont does not, and keeps every page working offline.                 */

/* ── tokens ──────────────────────────────────────────────────────────── */
:root {
  color-scheme: light dark;

  /* Absolute, not relative: a url() inside a custom property resolves where
     it is used, not where it is declared. */
  --brand-icon: url("/assets/brand.jpg");

  --bg:            oklch(98.2% 0.003 250);
  --surface:       oklch(100% 0 0);
  --surface-2:     oklch(96.4% 0.004 250);
  --surface-hover: oklch(97.2% 0.010 250);
  --line:          oklch(91.5% 0.006 250);
  --line-strong:   oklch(85% 0.008 250);
  --text:          oklch(21% 0.012 250);
  --text-2:        oklch(50% 0.014 250);
  --text-3:        oklch(62% 0.012 250);
  --accent:        oklch(52% 0.168 212);
  --accent-hover:  oklch(47% 0.160 214);
  --accent-ring:   oklch(52% 0.168 212 / .28);
  --accent-soft:   oklch(52% 0.168 212 / .09);
  --accent-fg:     oklch(100% 0 0);
  --ok:            oklch(64% 0.155 152);
  --warn:          oklch(72% 0.150 70);
  --danger:        oklch(58% 0.190 25);
  --track:         oklch(91% 0.006 250);
  --shadow-c:      250 12% 12%;
  --card-edge:     transparent;

  /* The brand surface: the logo's deep navy and electric cyan. Constant in
     both schemes, because the logo artwork has a baked-in dark ground. */
  --navy-900: oklch(14% 0.030 258);
  --navy-800: oklch(18% 0.036 256);
  --navy-700: oklch(24% 0.044 254);
  --cyan:     oklch(80% 0.135 218);
  --cyan-2:   oklch(68% 0.170 232);

  --r-card: 20px; --r-el: 12px; --r-chip: 10px; --r-pill: 999px;

  --sh-1: 0 1px 2px hsl(var(--shadow-c) / .06);
  --sh-2: 0 1px 2px hsl(var(--shadow-c) / .06), 0 8px 24px -10px hsl(var(--shadow-c) / .18);
  --sh-3: 0 2px 4px hsl(var(--shadow-c) / .08), 0 16px 40px -12px hsl(var(--shadow-c) / .28);

  --ease-out: cubic-bezier(.2,.8,.2,1);
  --ease-in:  cubic-bezier(.4,0,1,1);
  --ease-spring: cubic-bezier(.34,1.3,.5,1);

  --header-h: 60px;
  --tabbar-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:            oklch(16.5% 0.012 258);
    --surface:       oklch(20.5% 0.014 258);
    --surface-2:     oklch(24% 0.014 258);
    --surface-hover: oklch(24.5% 0.020 258);
    --line:          oklch(28.5% 0.014 258);
    --line-strong:   oklch(35% 0.016 258);
    --text:          oklch(96% 0.006 258);
    --text-2:        oklch(70% 0.014 258);
    --text-3:        oklch(58% 0.014 258);
    --accent:        oklch(72% 0.150 212);
    --accent-hover:  oklch(78% 0.140 212);
    --accent-ring:   oklch(72% 0.150 212 / .30);
    --accent-soft:   oklch(72% 0.150 212 / .12);
    --accent-fg:     oklch(17% 0.02 258);
    --ok:            oklch(74% 0.150 152);
    --warn:          oklch(80% 0.140 70);
    --danger:        oklch(70% 0.170 25);
    --track:         oklch(28% 0.014 258);
    --shadow-c:      258 40% 3%;
    /* In dark mode shadows do less work; cards separate by a bright top
       edge instead -- light catching the material. */
    --card-edge:     oklch(100% 0 0 / .05);
  }
}

/* ── reset + type ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text",
               "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.58;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}
/* Components set `display`, which would otherwise beat the attribute. */
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea, label { font: inherit; color: inherit; }
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

.display { font-size: clamp(30px, 6vw, 38px); font-weight: 660; line-height: 1.06; letter-spacing: -.024em; }
.t-hero  { font-size: clamp(38px, 7.2vw, 68px); font-weight: 700; line-height: 1.02; letter-spacing: -.035em; }
.t-h1    { font-size: clamp(26px, 4.4vw, 34px); font-weight: 660; line-height: 1.1; letter-spacing: -.022em; }
.t-title { font-size: 24px; font-weight: 640; line-height: 1.15; letter-spacing: -.016em; }
.t-head  { font-size: 17px; font-weight: 600; line-height: 1.3;  letter-spacing: -.006em; }
.t-lead  { font-size: clamp(16px, 2.2vw, 19px); line-height: 1.55; }
.t-label { font-size: 13px; font-weight: 500; line-height: 1.4;  letter-spacing: .004em; }
.t-small { font-size: 13px; line-height: 1.45; }
.t-caps  { font-size: 11px; font-weight: 620; line-height: 1.2;  letter-spacing: .07em; text-transform: uppercase; }
.t-mono  { font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
           font-size: 12px; line-height: 1.5; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.tnum { font-variant-numeric: tabular-nums; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 760px; }

/* ── brand ───────────────────────────────────────────────────────────── */
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 680; font-size: 17px; letter-spacing: -.015em;
  color: var(--text); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.mark {
  /* The artwork is a JPEG with a baked-in dark ground, so it is kept as a
     rounded tile -- it reads as a deliberate app icon on any background. */
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  background: var(--navy-900) var(--brand-icon) center / cover;
  box-shadow: 0 1px 2px hsl(var(--shadow-c) / .18),
              inset 0 0 0 1px oklch(100% 0 0 / .10);
}

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--line);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: 0 1.1rem;
  border: 1px solid var(--btn-bd); border-radius: var(--r-el);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform 90ms cubic-bezier(.2,0,0,1), background-color 140ms,
              border-color 140ms, color 140ms, box-shadow 140ms, opacity 140ms;
}
.btn:hover { text-decoration: none; background: var(--surface-hover); }
.btn:active { transform: scale(.975); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary {
  --btn-bg: var(--accent); --btn-fg: var(--accent-fg); --btn-bd: transparent;
  box-shadow: 0 1px 2px hsl(var(--shadow-c) / .12), inset 0 1px 0 oklch(100% 0 0 / .14);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bd: transparent; }
.btn-danger:hover { background: color-mix(in oklab, var(--danger) 88%, #000); }
.btn-danger-quiet { --btn-fg: var(--danger); }
.btn-lg { min-height: 52px; padding: 0 1.5rem; font-size: 16px; border-radius: 14px; }
.btn-sm { min-height: 34px; padding: 0 .75rem; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; border-radius: 10px; }

/* Loading: the label stays for width, hidden behind a spinner. */
.btn[aria-busy="true"] { color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--btn-fg); border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn {
  background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer;
  font-weight: 560;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ── forms ───────────────────────────────────────────────────────────── */
.field { display: grid; gap: .375rem; }
.field + .field { margin-top: 1rem; }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.label { font-size: 14px; font-weight: 580; }
.input {
  width: 100%; min-height: 46px; padding: .625rem .875rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-el);
  background: var(--surface); color: var(--text);
  font-size: 16px; /* 16px: iOS zooms the page into anything smaller */
  transition: border-color 140ms, box-shadow 140ms;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--text-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 25%, transparent); }
input.input:read-only { background: var(--surface-2); color: var(--text-2); }
select.input { appearance: none; padding-right: 2.25rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
                    linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; }
.hint { font-size: 13px; color: var(--text-2); }
.error-text { font-size: 13px; color: var(--danger); font-weight: 520; }
.error-text:empty { display: none; }

.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 3.25rem; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  height: 38px; padding: 0 .625rem; border: 0; border-radius: 9px;
  background: none; color: var(--text-2); font-size: 13px; font-weight: 580; cursor: pointer;
}
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }

.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: .25rem; }
.strength i { height: 4px; border-radius: var(--r-pill); background: var(--track); transition: background-color 200ms; }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength[data-score="2"] i:nth-child(-n+2) { background: var(--warn); }
.strength[data-score="3"] i:nth-child(-n+3) { background: color-mix(in oklab, var(--ok) 70%, var(--warn)); }
.strength[data-score="4"] i { background: var(--ok); }

.check { display: flex; align-items: flex-start; gap: .625rem; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: .12rem 0 0; accent-color: var(--accent); flex: none; }

.alert {
  display: flex; gap: .625rem; align-items: flex-start;
  padding: .75rem .875rem; border-radius: var(--r-el); font-size: 14px;
  border: 1px solid color-mix(in oklab, var(--danger) 30%, transparent);
  background: color-mix(in oklab, var(--danger) 8%, transparent);
}
.alert:empty { display: none; }
.alert-ok {
  border-color: color-mix(in oklab, var(--ok) 35%, transparent);
  background: color-mix(in oklab, var(--ok) 9%, transparent);
}
.alert-info { border-color: var(--accent-ring); background: var(--accent-soft); }

/* ── surfaces ────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--sh-2), inset 0 1px 0 var(--card-edge);
}
.card-pad { padding: 1.5rem; }
.divider { height: 1px; background: var(--line); border: 0; margin: 1.25rem 0; }

.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .55rem; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; line-height: 1.5;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.badge-ok { color: var(--ok); background: color-mix(in oklab, var(--ok) 10%, transparent);
            border-color: color-mix(in oklab, var(--ok) 28%, transparent); }
.badge-warn { color: color-mix(in oklab, var(--warn) 75%, var(--text));
              background: color-mix(in oklab, var(--warn) 12%, transparent);
              border-color: color-mix(in oklab, var(--warn) 32%, transparent); }
.badge-accent { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-ring); }

.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, oklch(62% 0.13 var(--h, 220deg)), oklch(44% 0.12 calc(var(--h, 220deg) + 40deg)));
  color: #fff; font-size: 13px; font-weight: 680; letter-spacing: .01em;
  box-shadow: inset 0 0 0 1px oklch(100% 0 0 / .14);
}
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

/* Generated title plate, shown first and replaced by the poster if it loads. */
.poster { position: relative; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden;
          background: var(--track); }
.plate {
  width: 100%; aspect-ratio: 2/3; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg,
    oklch(58% 0.13 var(--h)), oklch(38% 0.10 calc(var(--h) + 38deg)));
  color: #fff; font-size: 34px; font-weight: 640; letter-spacing: -.03em;
  box-shadow: inset 0 0 0 1px oklch(100% 0 0 / .10);
}
.poster .plate { position: absolute; inset: 0; height: 100%; border-radius: 0; box-shadow: none;
                 font-size: clamp(16px, 30cqi, 34px); }
.poster { container-type: inline-size; }
.poster img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 280ms ease-out;
}
.poster img.in { opacity: 1; }

.skeleton {
  position: relative; overflow: hidden; border-radius: 8px; background: var(--surface-2);
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--surface) 60%, transparent), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.empty {
  text-align: center; padding: 3rem 1.5rem;
  border: 1px dashed var(--line-strong); border-radius: var(--r-card);
}
.empty-icon {
  width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 16px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.empty-icon svg { width: 26px; height: 26px; }
.empty p { max-width: 40ch; margin: .375rem auto 1.25rem; color: var(--text-2); }

.tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
}
.tab {
  min-height: 34px; padding: 0 .9rem; border: 0; border-radius: 9px;
  background: none; color: var(--text-2); font-size: 14px; font-weight: 580; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.tab .count { margin-left: .35rem; color: var(--text-3); font-weight: 500; }

/* ── site header ─────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 1.5rem; }
.nav { display: flex; align-items: center; gap: .25rem; }
.nav a {
  padding: .45rem .75rem; border-radius: 9px;
  color: var(--text-2); font-size: 14px; font-weight: 560;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.header-end { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.user-btn {
  display: flex; align-items: center; gap: .5rem; padding: 3px; padding-right: .5rem;
  border: 1px solid transparent; border-radius: var(--r-pill);
  background: none; cursor: pointer;
}
.user-btn:hover, .user-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--line); }
.user-btn .chev { width: 14px; height: 14px; color: var(--text-2); }

.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  min-width: 240px; padding: .375rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--sh-3);
  transform-origin: top right; animation: menu-in 160ms var(--ease-out);
}
.menu[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.menu-head { padding: .625rem .75rem .75rem; border-bottom: 1px solid var(--line); margin-bottom: .375rem; }
.menu-head .name { font-weight: 620; }
.menu-head .email { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.menu a, .menu button {
  display: flex; align-items: center; gap: .625rem; width: 100%;
  padding: .55rem .75rem; border: 0; border-radius: 9px; background: none;
  color: var(--text); font-size: 14px; font-weight: 520; text-align: left; cursor: pointer;
}
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }
.menu svg { width: 17px; height: 17px; color: var(--text-2); }
.menu .sep { height: 1px; background: var(--line); margin: .375rem 0; }

/* Bottom tab bar: the member nav on phones, where the header has no room. */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-2); font-size: 11px; font-weight: 600; text-decoration: none;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar .tab-identify span.dot {
  width: 42px; height: 42px; margin-top: -14px; border-radius: 14px;
  background: var(--navy-900) var(--brand-icon) center / cover;
  box-shadow: 0 6px 16px -6px hsl(var(--shadow-c) / .5), inset 0 0 0 1px oklch(100% 0 0 / .12);
}

@media (max-width: 760px) {
  .site-header .nav { display: none; }
  .has-tabbar .tabbar { display: flex; }
  .has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 1rem); }
}

/* Verify-your-email strip under the header. */
.notice-bar {
  background: var(--accent-soft); border-bottom: 1px solid var(--accent-ring);
  font-size: 14px;
}
.notice-bar .container { display: flex; align-items: center; gap: .75rem; min-height: 44px; flex-wrap: wrap; padding-top: .4rem; padding-bottom: .4rem; }
.notice-bar[hidden] { display: none; }

/* ── footer ──────────────────────────────────────────────────────────── */
.site-footer { padding: 2.5rem 0 2rem; color: var(--text-2); font-size: 13px; }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }

/* ── toasts ──────────────────────────────────────────────────────────── */
.toasts {
  position: fixed; z-index: 90; left: 50%; transform: translateX(-50%);
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  display: grid; gap: .5rem; width: min(440px, calc(100vw - 2rem));
  pointer-events: none;
}
.has-tabbar .toasts { bottom: calc(var(--tabbar-h) + 1rem + env(safe-area-inset-bottom)); }
.toast {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem .875rem .75rem 1rem; border-radius: 14px;
  background: oklch(24% 0.02 258); color: oklch(97% 0.005 258);
  box-shadow: var(--sh-3); font-size: 14px; font-weight: 520;
  pointer-events: auto; animation: toast-in 260ms var(--ease-spring);
}
.toast.out { animation: toast-out 180ms var(--ease-in) forwards; }
.toast .ico { width: 20px; height: 20px; flex: none; }
.toast.ok .ico { color: oklch(78% 0.15 152); }
.toast.error .ico { color: oklch(74% 0.16 25); }
.toast .msg { flex: 1; }
.toast a, .toast button.act {
  color: oklch(82% 0.12 212); font-weight: 650; background: none; border: 0; cursor: pointer; padding: 0;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ── dialogs: modal and drawer ───────────────────────────────────────── */
dialog { color: var(--text); }
dialog::backdrop { background: oklch(10% 0.02 258 / .5); backdrop-filter: blur(3px); }
.modal {
  width: min(440px, calc(100vw - 2rem)); padding: 0; border: 0;
  border-radius: var(--r-card); background: var(--surface); box-shadow: var(--sh-3);
}
.modal[open] { animation: modal-in 220ms var(--ease-out); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-body { padding: 1.5rem; }
.modal-body p { margin-top: .5rem; color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; padding: 0 1.5rem 1.5rem; }

.drawer {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh;
  width: min(480px, 100vw); padding: 0; border: 0;
  background: var(--surface); box-shadow: var(--sh-3);
}
.drawer[open] { animation: drawer-in 280ms var(--ease-out); }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
@media (max-width: 560px) {
  .drawer { margin: auto 0 0; width: 100vw; height: auto; max-height: 92dvh; border-radius: 20px 20px 0 0; }
  .drawer[open] { animation-name: sheet-in; }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
}

/* ── motion ──────────────────────────────────────────────────────────── */
.rise { animation: rise 320ms var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.fade { animation: fade 200ms ease-out both; }
@keyframes fade { from { opacity: 0; } }
.pop { animation: pop 380ms var(--ease-spring) both; }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }

/* ── accessibility ───────────────────────────────────────────────────── */
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  padding: .5rem .875rem; border-radius: 9px; background: var(--accent); color: var(--accent-fg);
}
.skip:focus { top: .75rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible, .input:focus-visible { outline-offset: 2px; border-radius: var(--r-el); }

@media (prefers-reduced-transparency: reduce) {
  .site-header, .tabbar { background: var(--bg); backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .card, .input, .btn { border-color: var(--text-2); }
}
/* Reduced motion gets a gentler equivalent, not nothing: cross-fades stay,
   travel and overshoot go. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 140ms !important;
  }
  .rise, .pop { animation: fade 160ms ease-out both; }
  .skeleton::after { display: none; }
}
