/* Design system: Minimalism & Swiss (UI UX Pro Max), slate neutrals,
   green as the "access granted" status colour, system font (SF Pro on iOS). */

:root {
  color-scheme: light dark;

  /* Colour tokens: light */
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --fg: #0f172a;
  --fg-muted: #475569;      /* 7.6:1 on surface */
  --fg-subtle: #64748b;     /* 4.8:1 on surface */
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #0f172a;
  --on-primary: #ffffff;
  --accent: #16a34a;
  --accent-fg: #15803d;     /* 5.0:1 on white */
  --accent-soft: #dcfce7;
  --info-fg: #1d4ed8;
  --info-soft: #dbeafe;
  --danger: #dc2626;        /* 4.8:1 on white */
  --danger-soft: #fee2e2;
  --warn-fg: #92400e;
  --warn-soft: #fef3c7;
  --chip-human: #e0e7ff;
  --chip-human-fg: #3730a3;
  --chip-car: #fef3c7;
  --chip-car-fg: #92400e;
  --ring: #2563eb;
  --scrim: rgba(15, 23, 42, 0.45);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.18);

  /* Type scale */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  --t-large: 34px;
  --t-title: 22px;
  --t-body: 17px;
  --t-sub: 15px;
  --t-caption: 13px;

  /* Spacing (4/8 rhythm) and shape */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-full: 999px;
  --tap: 44px;
  --tabbar-h: 56px;

  /* Motion */
  --dur-press: 120ms;
  --dur-enter: 240ms;
  --dur-exit: 160ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #151c2c;
    --surface-2: #1b2336;
    --fg: #f8fafc;
    --fg-muted: #cbd5e1;    /* 11:1 */
    --fg-subtle: #94a3b8;   /* 6.2:1 on surface */
    --border: #253047;
    --border-strong: #334155;
    --primary: #f8fafc;
    --on-primary: #0f172a;
    --accent: #22c55e;
    --accent-fg: #4ade80;
    --accent-soft: rgba(34, 197, 94, 0.16);
    --info-fg: #93c5fd;
    --info-soft: rgba(59, 130, 246, 0.18);
    --danger: #f87171;      /* 5.6:1 on surface */
    --danger-soft: rgba(239, 68, 68, 0.16);
    --warn-fg: #fcd34d;
    --warn-soft: rgba(245, 158, 11, 0.16);
    --chip-human: rgba(129, 140, 248, 0.18);
    --chip-human-fg: #c7d2fe;
    --chip-car: rgba(251, 191, 36, 0.16);
    --chip-car-fg: #fde68a;
    --ring: #60a5fa;
    --scrim: rgba(0, 0, 0, 0.6);
    --shadow: none;
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--info-fg); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 20px; height: 20px; }
.icon.lg { width: 28px; height: 28px; }

main {
  max-width: 600px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + var(--s4)) var(--s4) calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--s6));
}
body.no-tabs main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (min-width: 600px) { main { padding-left: var(--s5); padding-right: var(--s5); } }

/* ---------- typography & page header ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin: var(--s2) 0 var(--s5); }
.page-head .eyebrow { font-size: var(--t-caption); font-weight: 600; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
h1 { font-size: var(--t-large); line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; margin: 0; }
h2 { font-size: var(--t-title); line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; margin: 0; }
.section { margin-top: var(--s6); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); min-height: var(--tap); }
.section-head h2 { font-size: 20px; }
.count { color: var(--fg-subtle); font-weight: 600; margin-left: 6px; }
.muted { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }
.caption { font-size: var(--t-caption); }
p { margin: 0 0 var(--s3); }

.subpage-bar { display: flex; align-items: center; gap: var(--s2); margin: calc(-1 * var(--s2)) 0 var(--s3) calc(-1 * var(--s2)); }

/* ---------- buttons ---------- */

.btn {
  appearance: none; border: 0; cursor: pointer; user-select: none;
  min-height: 52px; padding: 0 var(--s5); border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font-size: var(--t-body); font-weight: 600; text-decoration: none;
  background: var(--primary); color: var(--on-primary);
  transition: opacity var(--dur-press) var(--ease), background-color var(--dur-press) var(--ease);
}
.btn.block { width: 100%; }
.btn:active { opacity: 0.8; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--fg); box-shadow: inset 0 0 0 1px var(--border-strong); }
.btn.success { background: var(--accent); color: #052e16; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.ghost { background: transparent; color: var(--fg); min-height: var(--tap); padding: 0 var(--s3); }
.btn.small { min-height: 36px; padding: 0 var(--s3); font-size: var(--t-sub); border-radius: var(--r-sm); }
.btn + .btn { margin-top: var(--s3); }
.btn .spinner { width: 18px; height: 18px; border-width: 2px; margin: 0; }

.icon-btn {
  appearance: none; border: 0; cursor: pointer; flex: none;
  width: var(--tap); height: var(--tap); border-radius: var(--r-full);
  display: inline-grid; place-items: center;
  background: transparent; color: var(--fg);
  transition: background-color var(--dur-press) var(--ease);
}
.icon-btn:active { background: var(--border); }
.icon-btn.filled { background: var(--primary); color: var(--on-primary); }
.icon-btn.filled:active { opacity: 0.8; }

.text-btn {
  appearance: none; border: 0; background: none; cursor: pointer;
  min-height: var(--tap); padding: 0 var(--s2); margin: 0 calc(-1 * var(--s2));
  color: var(--info-fg); font-size: var(--t-sub); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.text-btn.danger { color: var(--danger); }
.text-btn:active { opacity: 0.6; }

/* ---------- quick-order tiles ---------- */

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
@media (min-width: 520px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile {
  appearance: none; border: 0; cursor: pointer; text-align: left; position: relative;
  min-height: 120px; padding: var(--s4); border-radius: var(--r-lg);
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--s3);
  text-decoration: none;
  transition: transform var(--dur-press) var(--ease), background-color var(--dur-press) var(--ease);
}
.tile:active { transform: scale(0.97); }
.tile .tile-label { font-size: var(--t-body); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.tile .tile-hint { font-size: var(--t-caption); color: var(--fg-subtle); margin-top: 2px; }
.tile.busy { pointer-events: none; }
.tile.busy::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--surface); opacity: 0.6; }
.tile.done { background: var(--accent-soft); }
.tile.add { background: transparent; box-shadow: inset 0 0 0 2px var(--border-strong); color: var(--fg-muted); align-items: flex-start; }
.tile .edit-badge {
  position: absolute; top: var(--s3); right: var(--s3); width: 28px; height: 28px; border-radius: var(--r-full);
  display: grid; place-items: center; background: var(--primary); color: var(--on-primary);
}
.tile .edit-badge .icon { width: 16px; height: 16px; }

.chip-icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; flex: none; }
.chip-icon.human { background: var(--chip-human); color: var(--chip-human-fg); }
.chip-icon.transport { background: var(--chip-car); color: var(--chip-car-fg); }
.chip-icon.neutral { background: var(--surface-2); color: var(--fg-muted); box-shadow: inset 0 0 0 1px var(--border); }
.chip-icon.ok { background: var(--accent-soft); color: var(--accent-fg); }

/* ---------- cards & lists ---------- */

.card { background: var(--surface); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow); }
.card + .card { margin-top: var(--s3); }
.stack > * + * { margin-top: var(--s3); }

.pass { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s3); align-items: start; }
.pass-title { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.pass-meta { font-size: var(--t-sub); color: var(--fg-muted); margin-top: 2px; }
.pass-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s1); }
.progress { height: 6px; border-radius: var(--r-full); background: var(--border); overflow: hidden; flex: 1; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.remaining { font-size: var(--t-caption); color: var(--fg-subtle); white-space: nowrap; }
.events { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s2); }
.event { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-caption); color: var(--fg-muted); background: var(--surface-2); border-radius: var(--r-full); padding: 4px 10px; }
.event .icon { width: 14px; height: 14px; }

.plate {
  display: inline-block; font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.04em;
  padding: 1px 8px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--fg); background: var(--surface);
}

.status {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: var(--t-caption); font-weight: 600; padding: 4px 10px; border-radius: var(--r-full);
  background: var(--surface-2); color: var(--fg-muted);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.confirmed { background: var(--accent-soft); color: var(--accent-fg); }
.status.new, .status.in_process { background: var(--info-soft); color: var(--info-fg); }
.status.cancelled, .status.overdue { background: var(--danger-soft); color: var(--danger); }

.list { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: var(--s3); min-height: 60px; padding: var(--s3) var(--s4);
  color: inherit; text-decoration: none; background: none; border: 0; width: 100%; text-align: left;
  position: relative;
}
button.list-row, a.list-row { cursor: pointer; transition: background-color var(--dur-press) var(--ease); }
button.list-row:active, a.list-row:active { background: var(--surface-2); }
.list-row + .list-row::before { content: ""; position: absolute; top: 0; left: 72px; right: 0; height: 1px; background: var(--border); }
.list-row.no-icon + .list-row::before, .list-row.no-icon::before { left: var(--s4); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .row-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.list-row .row-sub { font-size: var(--t-sub); color: var(--fg-subtle); }
.list-row .chev { color: var(--fg-subtle); }
.list-group-title { font-size: var(--t-caption); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-subtle); margin: var(--s5) var(--s4) var(--s2); }

.history-day { margin: var(--s5) var(--s1) var(--s2); font-size: var(--t-sub); font-weight: 600; color: var(--fg-muted); }
.history-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); min-height: 60px; }
.history-row + .history-row { border-top: 1px solid var(--border); }
.history-row .grow { flex: 1; min-width: 0; }

.avatar { width: 48px; height: 48px; border-radius: var(--r-full); display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 18px; flex: none; }

/* Switch */
.switch {
  appearance: none; border: 0; cursor: pointer; flex: none; position: relative;
  width: 51px; height: 31px; border-radius: var(--r-full); background: var(--border-strong);
  transition: background-color var(--dur-enter) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: transform var(--dur-enter) var(--ease);
}
.switch::before { content: ""; position: absolute; inset: -7px -4px; } /* 45px hit area */
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- empty, banner, skeleton ---------- */

.empty { text-align: center; padding: var(--s6) var(--s4); }
.empty .chip-icon { margin: 0 auto var(--s3); width: 56px; height: 56px; border-radius: var(--r-lg); }
.empty-title { font-weight: 600; margin-bottom: var(--s1); }
.empty-text { font-size: var(--t-sub); color: var(--fg-subtle); max-width: 300px; margin: 0 auto; }

.banner { display: flex; gap: var(--s3); align-items: flex-start; border-radius: var(--r-lg); padding: var(--s4); background: var(--warn-soft); color: var(--warn-fg); margin-bottom: var(--s4); }
.banner .grow { flex: 1; }
.banner b { display: block; margin-bottom: 2px; }
.banner .btn { margin-top: var(--s3); }

.skeleton { border-radius: var(--r-lg); background: var(--surface); position: relative; overflow: hidden; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--surface-2), transparent);
  transform: translateX(-100%); animation: shimmer 1.2s infinite;
}
.skeleton.tile-sk { height: 120px; }
.skeleton.card-sk { height: 96px; margin-top: var(--s3); }
@keyframes shimmer { to { transform: translateX(100%); } }

.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--fg); border-radius: 50%; animation: spin 0.8s linear infinite; margin: var(--s6) auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */

.field { display: block; margin-bottom: var(--s4); }
.field-label { display: block; font-size: var(--t-sub); font-weight: 600; margin: 0 var(--s1) var(--s2); }
.field-label .opt { font-weight: 400; color: var(--fg-subtle); }
.field-hint { font-size: var(--t-caption); color: var(--fg-subtle); margin: var(--s2) var(--s1) 0; }
.field-error { font-size: var(--t-caption); color: var(--danger); margin: var(--s2) var(--s1) 0; display: flex; gap: 6px; align-items: center; }
.field-error .icon { width: 16px; height: 16px; }
.input {
  width: 100%; min-height: 52px; padding: var(--s3) var(--s4);
  font-size: var(--t-body); background: var(--surface); color: var(--fg);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  transition: border-color var(--dur-press) var(--ease), box-shadow var(--dur-press) var(--ease);
}
.input::placeholder { color: var(--fg-subtle); }
.input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input.plate-input { font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.input.code-input { font-family: var(--font-mono); font-size: 28px; letter-spacing: 0.4em; text-align: center; }
.input.phone-input { font-size: 20px; letter-spacing: 0.02em; }
textarea.input { min-height: 88px; resize: vertical; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; gap: 3px; border-radius: var(--r-md); background: var(--border); margin-bottom: var(--s4); }
.segmented button {
  appearance: none; border: 0; cursor: pointer; min-height: 40px; border-radius: 11px;
  background: transparent; color: var(--fg-muted); font-weight: 600; font-size: var(--t-sub);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background-color var(--dur-press) var(--ease), color var(--dur-press) var(--ease);
}
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }

.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  appearance: none; cursor: pointer; min-height: 40px; padding: 0 var(--s4); border-radius: var(--r-full);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg);
  font-size: var(--t-sub); font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
  transition: background-color var(--dur-press) var(--ease), border-color var(--dur-press) var(--ease);
}
.chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.chip .icon { width: 18px; height: 18px; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 60px; padding: var(--s2) var(--s4); }
.toggle-row .grow { flex: 1; }
.form-card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); margin-bottom: var(--s4); }
.form-card .toggle-row + .toggle-row, .form-card .toggle-row + .reveal, .form-card .reveal + .toggle-row { border-top: 1px solid var(--border); }
.reveal { padding: var(--s2) var(--s4) var(--s4); }

.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: var(--s2); }
.icon-grid button {
  appearance: none; cursor: pointer; height: 52px; border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg-muted);
  display: grid; place-items: center;
}
.icon-grid button[aria-checked="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* Sticky action bar for form pages (tab bar is hidden there). */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: var(--s3) var(--s4) calc(env(safe-area-inset-bottom) + var(--s3));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
.action-bar .inner { max-width: 600px; margin: 0 auto; display: flex; gap: var(--s3); }
.action-bar .btn { flex: 1; margin: 0; }

/* ---------- onboarding ---------- */

.hero { padding-top: 10vh; }
.hero .logo { width: 72px; height: 72px; border-radius: 18px; display: block; margin-bottom: var(--s5); box-shadow: var(--shadow-lg); }
.hero h1 { margin-bottom: var(--s3); }
.hero .lead { color: var(--fg-muted); font-size: var(--t-body); margin-bottom: var(--s5); }
.steps { display: flex; gap: var(--s2); margin-bottom: var(--s5); }
.steps span { height: 4px; flex: 1; border-radius: var(--r-full); background: var(--border); }
.steps span.on { background: var(--fg); }
.step-label { font-size: var(--t-caption); font-weight: 600; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--s2); }
.feature { display: flex; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s4); }
.feature .chip-icon { width: 40px; height: 40px; }

/* ---------- tab bar ---------- */

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--border);
}
.tabs .inner { display: flex; width: 100%; max-width: 600px; }
.tabs a {
  flex: 1; min-height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--fg-subtle); text-decoration: none; font-size: 11px; font-weight: 600; position: relative;
}
.tabs a[aria-current="page"] { color: var(--fg); }
.tabs a .dot { position: absolute; top: 8px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* ---------- toast ---------- */

.toast {
  position: fixed; left: var(--s4); right: var(--s4); z-index: 30; max-width: 568px; margin: 0 auto;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--s3));
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s3) var(--s3) var(--s4); min-height: 56px; border-radius: var(--r-md);
  background: #0f172a; color: #f8fafc; box-shadow: var(--shadow-lg);
  animation: toast-in var(--dur-enter) var(--ease);
}
body.no-tabs .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (prefers-color-scheme: dark) { .toast { background: #f8fafc; color: #0f172a; } }
.toast .msg { flex: 1; font-size: var(--t-sub); font-weight: 500; }
.toast .t-icon { color: #4ade80; }
.toast.error .t-icon { color: #f87171; }
@media (prefers-color-scheme: dark) { .toast .t-icon { color: #15803d; } .toast.error .t-icon { color: #dc2626; } }
.toast .toast-action { appearance: none; border: 0; background: rgba(255, 255, 255, 0.14); color: inherit; font-weight: 700; font-size: var(--t-sub); min-height: 36px; padding: 0 var(--s3); border-radius: var(--r-sm); cursor: pointer; }
@media (prefers-color-scheme: dark) { .toast .toast-action { background: rgba(15, 23, 42, 0.08); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- bottom sheet dialog ---------- */

dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 600px;
  border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--surface); color: var(--fg);
  max-height: 90dvh;
}
dialog.sheet[open] { animation: sheet-in var(--dur-enter) var(--ease); }
dialog.sheet::backdrop { background: var(--scrim); }
.sheet-body { padding: var(--s3) var(--s4) calc(env(safe-area-inset-bottom) + var(--s4)); }
.sheet-grabber { width: 36px; height: 5px; border-radius: var(--r-full); background: var(--border-strong); margin: 0 auto var(--s4); }
.sheet-title { font-size: var(--t-title); font-weight: 700; margin: 0 0 var(--s2); }
.sheet-text { color: var(--fg-muted); margin-bottom: var(--s4); }
.sheet-actions { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s2); }
.sheet-actions .btn { width: 100%; margin: 0; }
@media (min-width: 600px) {
  dialog.sheet { margin: auto; border-radius: var(--r-lg); max-width: 440px; }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }

/* ---------- entrance motion ---------- */

.fade-up { animation: fade-up var(--dur-enter) var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .skeleton::after { display: none; }
}

/* Small layout helpers */
.hero > .chip-icon { margin-bottom: var(--s4); width: 56px; height: 56px; }
.reveal .chips { margin-bottom: var(--s4); }
.reveal .field { margin-bottom: 0; }
.card h2.pass-title { font-size: var(--t-body); margin: var(--s1) 0 6px; }
.card .list { box-shadow: none; margin: 0 calc(-1 * var(--s4)) var(--s3); border-radius: 0; }
.card .banner { margin-bottom: var(--s3); }
.card code.key { margin-bottom: var(--s3); }
.below-list { margin: var(--s2) var(--s4) 0; }
#resend { margin-top: var(--s3); }

code.key { display: block; word-break: break-all; font-family: var(--font-mono); font-size: var(--t-caption); background: var(--surface-2); padding: var(--s3); border-radius: var(--r-sm); user-select: all; box-shadow: inset 0 0 0 1px var(--border); }
ol.howto { padding-left: 20px; margin: 0; }
ol.howto li { margin-bottom: var(--s2); color: var(--fg-muted); }
ol.howto b { color: var(--fg); }
