/* ==========================================================================
   LateCheck — "The Night Desk"
   One stylesheet for the member app and shared pieces of the public pages.
   Tokens → base → components → app shell → screens → motion & reduced motion.
   ========================================================================== */

@font-face {
  font-family: "Bodoni Moda";
  src: url("/assets/fonts/bodoni-moda-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("/assets/fonts/bodoni-moda-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/jost-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Grounds: lacquered night, never pure black */
  --night: #0d0b0c;
  --night-2: #171315;
  --night-3: #211a1e;
  --night-4: #2a2126;
  --line: #382c32;
  --line-soft: #2a2126;

  /* Brand */
  --wine: #800f2f;
  --wine-hi: #b8274f;
  --wine-deep: #3c0a19;
  --brass: #e8c99b;
  --brass-soft: #c9ad85;

  /* Text */
  --text: #f7f2ec;
  --text-2: #a89da2;

  /* State */
  --ok: #49b981;
  --err: #e34d5d;
  --err-ink: #ff8c97;

  /* Type */
  --font-display: "Bodoni Moda", "Bodoni 72", Didot, "Bodoni MT", Georgia, serif;
  --font-ui: "Jost", "Futura", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: clamp(2rem, 1.5rem + 2.2vw, 2.75rem);
  --fs-display: clamp(2.75rem, 1.4rem + 6.4vw, 5.75rem);

  /* Space, radius, depth */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r-sm: 10px;
  --r-input: 14px;
  --r-card: 22px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgb(6 3 5 / 0.55), 0 8px 24px rgb(6 3 5 / 0.45);
  --shadow-2: 0 2px 8px rgb(6 3 5 / 0.55), 0 28px 64px rgb(6 3 5 / 0.62);

  /* Motion (Emil Kowalski's curves) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --t-press: 160ms; /* release; press itself runs at 100ms via :active */
  --t-fast: 180ms;
  --t-ui: 240ms;
  --t-sheet: 420ms;

  /* Shell */
  --top-h: 60px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

/* ---- Lenis (from lenis.css, inlined so the stylesheet stays first-party) ---- */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent], .lenis [data-lenis-prevent-wheel], .lenis [data-lenis-prevent-touch] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
.lenis.lenis-autoToggle { transition-property: overflow; transition-duration: 1ms; transition-behavior: allow-discrete; }

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--night);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brass); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text); }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.15; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--wine); color: var(--text); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 3px solid var(--night); }
::-webkit-scrollbar-track { background: transparent; }
input, textarea { caret-color: var(--brass); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s4); top: -60px; z-index: 100;
  background: var(--brass); color: var(--night); padding: var(--s2) var(--s4); border-radius: var(--r-pill);
}
.skip-link:focus { transform: translateY(76px); }
.svg-icon { width: 22px; height: 22px; flex: none; }
.svg-icon--sm { width: 18px; height: 18px; }
.svg-icon--lg { width: 28px; height: 28px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.serif { font-family: var(--font-display); }

/* ---- Logotype ------------------------------------------------------------ */
.logo {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.logo__dot { color: var(--brass); }
.logo:hover { color: var(--text); }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-line: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 50px; padding: 0 var(--s5);
  border-radius: var(--r-pill);
  border: 1px solid var(--btn-line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 500; font-size: var(--fs-md); letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease, opacity var(--t-fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn--primary { --btn-bg: var(--wine); --btn-line: var(--wine); --btn-fg: var(--text); }
.btn--ghost { --btn-bg: transparent; --btn-line: color-mix(in oklab, var(--brass) 45%, var(--line)); --btn-fg: var(--text); }
.btn--quiet { --btn-bg: transparent; --btn-line: transparent; --btn-fg: var(--brass); padding: 0 var(--s3); }
.btn--danger { --btn-bg: transparent; --btn-line: color-mix(in oklab, var(--err) 55%, var(--line)); --btn-fg: var(--err-ink); }
.btn--soft { --btn-bg: var(--night-3); --btn-line: var(--line); }
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 40px; padding: 0 var(--s4); font-size: var(--fs-sm); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.is-loading { color: transparent; position: relative; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px;
  border-radius: 50%; border: 2px solid rgb(247 242 236 / 0.35); border-top-color: var(--text);
  animation: spin 700ms linear infinite;
}
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { --btn-bg: var(--wine-hi); --btn-line: var(--wine-hi); }
  .btn--ghost:hover, .btn--soft:hover { --btn-line: var(--brass); }
  .btn--quiet:hover { --btn-fg: var(--text); }
  .btn--danger:hover { --btn-line: var(--err); }
}

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: var(--brass);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-fast) ease, border-color var(--t-fast) ease;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn--ring { border-color: var(--line); background: var(--night-2); }
.icon-btn--sm { width: 36px; height: 36px; }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--night-3); } }
.badge-dot {
  position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--wine-hi); color: var(--text);
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--night);
}
.badge-dot:empty { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 9px; right: 9px; }

/* ---- Forms --------------------------------------------------------------- */
.form { display: grid; gap: var(--s4); }
.field { display: grid; gap: 6px; }
.field__label { font-size: var(--fs-sm); color: var(--text-2); font-weight: 500; }
.field__hint { font-size: var(--fs-xs); color: var(--text-2); }
.field__error { font-size: var(--fs-sm); color: var(--err-ink); min-height: 0; }
.field__error:empty { display: none; }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 13px var(--s4);
  border-radius: var(--r-input); border: 1px solid var(--line);
  background: var(--night-2); color: var(--text); font-size: var(--fs-md);
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease;
}
.textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--brass) 50%), linear-gradient(135deg, var(--brass) 50%, transparent 50%); background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 44px; }
.input::placeholder, .textarea::placeholder { color: color-mix(in oklab, var(--text-2) 85%, var(--night)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brass); background: var(--night-3); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--err); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 52px; }
.input-wrap .icon-btn { position: absolute; right: 4px; top: 4px; }
.code-input { font-size: 1.75rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; font-family: var(--font-ui); }

.check { display: flex; gap: var(--s3); align-items: flex-start; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; }
.check input { appearance: none; flex: none; width: 22px; height: 22px; margin: 1px 0 0; border-radius: 7px; border: 1px solid var(--line); background: var(--night-2); display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--wine); border-color: var(--wine-hi); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border-left: 2px solid var(--text); border-bottom: 2px solid var(--text); transform: translateY(-1px) rotate(-45deg); }
.check a { color: var(--brass); }

/* Toggle switch */
.switch { position: relative; display: inline-flex; flex: none; width: 52px; height: 30px; }
.switch input { appearance: none; position: absolute; inset: 0; margin: 0; border-radius: var(--r-pill); background: var(--night-4); border: 1px solid var(--line); cursor: pointer; transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--text-2); pointer-events: none; transition: transform var(--t-ui) var(--ease-out), background-color var(--t-fast) ease; }
.switch:has(input:checked)::after { transform: translateX(22px); background: var(--text); }
.switch input:checked { background: var(--wine); border-color: var(--wine-hi); }

/* Choice chips (multi/single select) */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--s4);
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--night-2);
  color: var(--text); font-size: var(--fs-sm); cursor: pointer; user-select: none;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-fast) ease, border-color var(--t-fast) ease;
}
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"], .chip[aria-checked="true"], .chip.is-on { background: var(--wine); border-color: var(--wine-hi); }
.chip .svg-icon { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: var(--brass-soft); } }

/* Option rows (radio cards) */
.options { display: grid; gap: var(--s3); }
.option {
  display: flex; align-items: center; gap: var(--s4); width: 100%; text-align: left;
  min-height: 64px; padding: var(--s4); border-radius: 18px;
  border: 1px solid var(--line); background: var(--night-2); cursor: pointer;
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease, transform var(--t-press) var(--ease-out);
}
.option:active { transform: scale(0.985); }
.option[aria-checked="true"] { border-color: var(--wine-hi); background: color-mix(in oklab, var(--wine) 22%, var(--night-2)); }
.option__icon { color: var(--brass); flex: none; }
.option__text { flex: 1; display: grid; gap: 2px; }
.option__title { font-weight: 500; }
.option__desc { font-size: var(--fs-sm); color: var(--text-2); }
.option__mark { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; }
.option[aria-checked="true"] .option__mark { border-color: var(--wine-hi); background: var(--wine-hi); box-shadow: inset 0 0 0 4px var(--night-2); }
@media (hover: hover) and (pointer: fine) { .option:hover { border-color: var(--brass-soft); } }

/* Range (age) */
.range { display: grid; gap: var(--s2); }
.range input[type="range"] { width: 100%; accent-color: var(--wine-hi); }

/* ---- Notices, chips, tags ------------------------------------------------ */
.notice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); border-radius: 16px; background: var(--night-2); border: 1px solid var(--line); font-size: var(--fs-sm); color: var(--text-2); }
.notice .svg-icon { color: var(--brass); margin-top: 1px; }
.notice strong { color: var(--text); font-weight: 500; }
.notice--warn { border-color: color-mix(in oklab, var(--err) 45%, var(--line)); }
.notice--warn .svg-icon { color: var(--err-ink); }
.notice--ok .svg-icon { color: var(--ok); }
.notice--dev { border-style: dashed; border-color: var(--brass-soft); }

.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.01em;
  background: rgb(13 11 12 / 0.72); color: var(--text); border: 1px solid rgb(232 201 155 / 0.28);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tag__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgb(73 185 129 / 0.2); }
.tag--tonight .tag__dot { background: var(--brass); box-shadow: 0 0 0 3px rgb(232 201 155 / 0.18); }
.tag--weekend .tag__dot { background: var(--wine-hi); box-shadow: 0 0 0 3px rgb(184 39 79 / 0.2); }
.tag--exploring .tag__dot { background: transparent; border: 1.5px solid var(--text-2); box-shadow: none; }
.tag--demo { color: var(--night); background: var(--brass); border-color: var(--brass); letter-spacing: 0.06em; }
.tag--plain { background: var(--night-3); border-color: var(--line); backdrop-filter: none; }

.seal { width: 20px; height: 20px; color: var(--brass); flex: none; }
.nearby { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-size: var(--fs-sm); }
.nearby .svg-icon { width: 16px; height: 16px; color: var(--brass); }

/* ---- Skeletons, empty, error -------------------------------------------- */
.skel { position: relative; overflow: hidden; background: var(--night-3); border-radius: var(--r-sm); }
.skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgb(232 201 155 / 0.06), transparent);
  animation: shimmer 1.4s linear infinite;
}
.skel--card { aspect-ratio: 4 / 5; border-radius: var(--r-card); }
.skel--line { height: 14px; }
.skel--row { height: 72px; border-radius: 16px; }

.empty { display: grid; justify-items: center; text-align: center; gap: var(--s4); padding: var(--s8) var(--s5); max-width: 420px; margin: 0 auto; }
.empty__art { width: 112px; height: 112px; color: var(--brass); }
.empty__title { font-family: var(--font-display); font-size: var(--fs-2xl); }
.empty__text { color: var(--text-2); }

/* ---- App shell ------------------------------------------------------------ */
.app { min-height: 100dvh; }
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--night); z-index: 60; transition: opacity 200ms var(--ease-out); }
.boot.is-done { opacity: 0; pointer-events: none; }
.boot__inner { display: grid; justify-items: center; gap: var(--s4); }
.boot__bell { width: 92px; height: 92px; color: var(--brass); }
.boot__logo { font-size: 2.6rem; }
.boot__tag { font-family: var(--font-display); font-style: italic; color: var(--text-2); font-size: var(--fs-lg); }
.boot__line { width: 120px; height: 1px; background: var(--line); overflow: hidden; border-radius: 1px; }
.boot__line::after { content: ""; display: block; width: 40%; height: 100%; background: var(--brass); animation: bootline 1.1s var(--ease-in-out) infinite; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--s2);
  height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) var(--s3) 0 var(--s4);
  background: color-mix(in oklab, var(--night) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__title { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2); }
.topbar__title h1 { font-family: var(--font-display); font-size: var(--fs-xl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { display: flex; align-items: center; gap: 2px; }

.main { padding: var(--s4) var(--s4) calc(var(--nav-h) + var(--safe-b) + var(--s6)); max-width: 1180px; margin: 0 auto; }
.main--bare { padding-bottom: var(--s7); }
.main--flush { padding: 0; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in oklab, var(--night-2) 94%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.navlink {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 3px;
  color: var(--text-2); text-decoration: none; font-size: 0.75rem; letter-spacing: 0.02em;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--t-fast) ease;
}
.navlink .svg-icon { width: 24px; height: 24px; }
.navlink[aria-current="page"] { color: var(--brass); }
.navlink[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; border-radius: 0 0 2px 2px; background: var(--brass); }
.navlink .badge-dot { top: 6px; right: calc(50% - 22px); }
.navlink:active .svg-icon { transform: scale(0.92); }
.navlink .svg-icon { transition: transform var(--t-press) var(--ease-out); }

.rail { display: none; }

@media (min-width: 960px) {
  .has-rail { display: grid; grid-template-columns: 260px 1fr; }
  .has-rail .bottomnav { display: none; }
  .has-rail .rail {
    display: flex; flex-direction: column; gap: var(--s5);
    position: sticky; top: 0; height: 100dvh; padding: var(--s6) var(--s4);
    border-right: 1px solid var(--line-soft); background: var(--night);
  }
  .rail__brand { display: grid; gap: 6px; padding: 0 var(--s3) var(--s4); border-bottom: 1px solid var(--line-soft); }
  .rail__brand .logo { font-size: 2rem; }
  .rail__tag { font-family: var(--font-display); font-style: italic; color: var(--text-2); font-size: var(--fs-sm); }
  .rail nav { display: grid; gap: 4px; }
  .rail .navlink { display: flex; justify-items: start; justify-content: flex-start; gap: var(--s3); padding: 0 var(--s4); height: 50px; border-radius: 14px; font-size: var(--fs-md); color: var(--text); }
  .rail .navlink .svg-icon { color: var(--brass); }
  .rail .navlink[aria-current="page"] { background: color-mix(in oklab, var(--wine) 70%, var(--night)); color: var(--text); }
  .rail .navlink[aria-current="page"]::before { display: none; }
  .rail .navlink .badge-dot { position: static; margin-left: auto; box-shadow: none; }
  .rail__foot { margin-top: auto; display: grid; gap: var(--s2); }
  .has-rail .main { padding-bottom: var(--s7); padding-left: var(--s6); padding-right: var(--s6); }
  .has-rail .topbar { padding-left: var(--s6); padding-right: var(--s5); }
  .has-rail .topbar .logo--mobile { display: none; }
  @media (hover: hover) and (pointer: fine) { .rail .navlink:not([aria-current="page"]):hover { background: var(--night-2); } }
}

.rail-promo { padding: var(--s4); border-radius: 18px; background: linear-gradient(160deg, color-mix(in oklab, var(--wine) 55%, var(--night-2)), var(--night-2) 70%); border: 1px solid var(--line); display: grid; gap: var(--s2); }
.rail-promo h2 { font-family: var(--font-display); font-size: var(--fs-xl); display: flex; align-items: center; gap: var(--s2); }
.rail-promo p { font-size: var(--fs-sm); color: var(--text-2); }

/* ---- Toasts ---------------------------------------------------------------- */
.toasts { position: fixed; z-index: 90; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + var(--s3)); display: grid; justify-items: center; gap: var(--s2); pointer-events: none; padding: 0 var(--s4); }
@media (min-width: 960px) { .toasts { bottom: var(--s5); left: auto; right: var(--s5); justify-items: end; } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--s3); max-width: 440px;
  padding: var(--s3) var(--s4); border-radius: 16px; background: var(--night-3); border: 1px solid var(--line);
  box-shadow: var(--shadow-2); font-size: var(--fs-sm);
  transform: translateY(12px); opacity: 0;
  transition: transform var(--t-ui) var(--ease-out), opacity var(--t-ui) var(--ease-out);
}
.toast.is-in { transform: none; opacity: 1; }
.toast.is-out { transform: translateY(6px); opacity: 0; transition-duration: 160ms; }
.toast .svg-icon { color: var(--brass); }
.toast--error .svg-icon { color: var(--err-ink); }
.toast--ok .svg-icon { color: var(--ok); }

/* ---- Dialogs & sheets ------------------------------------------------------ */
dialog.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; max-height: min(88dvh, 760px);
  padding: 0; border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0;
  background: var(--night-2); color: var(--text); box-shadow: var(--shadow-2);
  transform: translateY(100%);
  transition: transform var(--t-sheet) var(--ease-drawer);
}
dialog.sheet.is-open { transform: translateY(0); }
dialog.sheet::backdrop { background: rgb(8 5 7 / 0.6); opacity: 0; transition: opacity var(--t-sheet) var(--ease-out); }
dialog.sheet.is-open::backdrop { opacity: 1; }
.sheet__grab { width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: 10px auto 0; }
.sheet__head { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5) var(--s2); }
.sheet__head h2 { flex: 1; font-family: var(--font-display); font-size: var(--fs-2xl); }
.sheet__body { padding: var(--s2) var(--s5) calc(var(--s5) + var(--safe-b)); overflow-y: auto; max-height: calc(min(88dvh, 760px) - 80px); }
.sheet__actions { display: grid; gap: var(--s2); margin-top: var(--s5); }
@media (min-width: 720px) {
  dialog.sheet { inset: 0; margin: auto; width: min(520px, calc(100% - 48px)); border-radius: 26px; border-bottom: 1px solid var(--line); height: fit-content; transform: translateY(8px) scale(0.97); opacity: 0; transition: transform var(--t-ui) var(--ease-out), opacity var(--t-ui) var(--ease-out); }
  dialog.sheet.is-open { transform: none; opacity: 1; }
  .sheet__grab { display: none; }
}

.menu-list { display: grid; }
.menu-item { display: flex; align-items: center; gap: var(--s4); min-height: 56px; padding: 0 var(--s2); border: 0; background: none; text-align: left; border-bottom: 1px solid var(--line-soft); cursor: pointer; color: var(--text); width: 100%; font-size: var(--fs-md); }
.menu-item:last-child { border-bottom: 0; }
.menu-item .svg-icon { color: var(--brass); }
.menu-item--danger, .menu-item--danger .svg-icon { color: var(--err-ink); }

/* ---- Page sections & lists ---------------------------------------------- */
.page-head { display: grid; gap: var(--s2); margin: var(--s2) 0 var(--s5); }
.page-head h1 { font-family: var(--font-display); font-size: var(--fs-3xl); }
.page-head p { color: var(--text-2); }
.section { display: grid; gap: var(--s3); margin-top: var(--s6); }
.section__title { font-size: var(--fs-sm); font-weight: 500; color: var(--brass); letter-spacing: 0.04em; }
.panel { background: var(--night-2); border: 1px solid var(--line); border-radius: 20px; }
.panel--pad { padding: var(--s5); }

.list { display: grid; }
.row {
  display: flex; align-items: center; gap: var(--s4); min-height: 72px; padding: var(--s3) var(--s2);
  border-bottom: 1px solid var(--line-soft); color: var(--text); text-decoration: none; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer;
}
.row:last-child { border-bottom: 0; }
.row__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row__title { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.row__title .name { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 500; }
.row__sub { color: var(--text-2); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__sub.is-unread { color: var(--text); }
.row__meta { display: grid; justify-items: end; gap: 6px; font-size: var(--fs-xs); color: var(--text-2); }
.row__chev { color: var(--text-2); }
.unread-pill { min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); background: var(--wine-hi); color: var(--text); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
@media (hover: hover) and (pointer: fine) { a.row:hover, button.row:hover { background: color-mix(in oklab, var(--night-2) 60%, transparent); } }

.avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: var(--night-3); border: 1px solid var(--line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 96px; height: 96px; }
.avatar--xl { width: 128px; height: 128px; border: 2px solid var(--brass-soft); }

.settings-list { display: grid; background: var(--night-2); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.settings-item { display: flex; align-items: center; gap: var(--s4); min-height: 60px; padding: 0 var(--s4); color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-soft); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; font-size: var(--fs-md); cursor: pointer; }
.settings-item:last-child { border-bottom: 0; }
.settings-item > .svg-icon:first-child { color: var(--brass); }
.settings-item__label { flex: 1; display: grid; }
.settings-item__value { color: var(--text-2); font-size: var(--fs-sm); }
.settings-item--toggle { cursor: default; }
.settings-item--toggle .settings-item__label small { color: var(--text-2); font-size: var(--fs-sm); }
@media (hover: hover) and (pointer: fine) { a.settings-item:hover, button.settings-item:hover { background: var(--night-3); } }

/* Segmented tabs */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--night-2); border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; }
.seg__btn { flex: none; min-height: 40px; padding: 0 var(--s4); border-radius: var(--r-pill); border: 0; background: transparent; color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background-color var(--t-fast) ease, color var(--t-fast) ease; }
.seg__btn[aria-selected="true"] { background: var(--wine); color: var(--text); }
.seg__count { font-variant-numeric: tabular-nums; opacity: 0.8; }

/* ---- Discover ---------------------------------------------------------------- */
.disc-tools { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.filters { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; flex: 1; padding: 2px; margin: -2px; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { flex: none; }

.deck { position: relative; height: min(calc(100dvh - var(--top-h) - var(--nav-h) - var(--safe-b) - 150px), 640px); min-height: 420px; max-width: 460px; margin: 0 auto; touch-action: pan-y; }
.deck__card { position: absolute; inset: 0; will-change: transform; }
.deck__card:not(.is-top) { pointer-events: none; }
.deck__card.is-next { transform: scale(0.955) translateY(14px); opacity: 0.7; transition: transform var(--t-ui) var(--ease-out), opacity var(--t-ui) var(--ease-out); }
.deck__card.is-top { z-index: 2; cursor: grab; }
.deck__card.is-dragging { cursor: grabbing; }
.deck__actions { display: flex; justify-content: center; align-items: center; gap: var(--s5); margin-top: var(--s4); }
.act {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--night-2); color: var(--text); cursor: pointer;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-fast) ease, border-color var(--t-fast) ease;
  box-shadow: var(--shadow-1);
}
.act:active { transform: scale(0.93); }
.act .svg-icon { width: 26px; height: 26px; }
.act--like { width: 76px; height: 76px; background: var(--wine); border-color: var(--wine-hi); }
.act--like .svg-icon { width: 32px; height: 32px; }
.act--view { width: 52px; height: 52px; color: var(--brass); }
.act--view .svg-icon { width: 22px; height: 22px; }
@media (hover: hover) and (pointer: fine) { .act:hover { border-color: var(--brass-soft); } .act--like:hover { background: var(--wine-hi); } }

.pcard {
  position: relative; height: 100%; border-radius: var(--r-card); overflow: hidden;
  background: var(--night-3); border: 1px solid color-mix(in oklab, var(--brass) 18%, var(--line));
  box-shadow: var(--shadow-2); isolation: isolate; user-select: none; -webkit-user-select: none;
}
.pcard__media { position: absolute; inset: 0; }
.pcard__media img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.pcard__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgb(13 11 12 / 0) 38%, rgb(13 11 12 / 0.55) 62%, rgb(13 11 12 / 0.94) 100%); z-index: 1; }
.pcard__top { position: absolute; z-index: 2; top: var(--s3); left: var(--s3); right: var(--s3); display: flex; justify-content: space-between; gap: var(--s2); }
.pcard__dots { position: absolute; z-index: 2; top: 8px; left: var(--s4); right: var(--s4); display: flex; gap: 4px; }
.pcard__dots span { flex: 1; height: 3px; border-radius: 3px; background: rgb(247 242 236 / 0.3); }
.pcard__dots span.is-on { background: var(--text); }
.pcard__body { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: var(--s5); display: grid; gap: var(--s2); }
.pcard__name { display: flex; align-items: center; gap: var(--s2); font-family: var(--font-display); font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.25rem); font-weight: 500; line-height: 1.05; }
.pcard__name .age { font-weight: 400; }
.pcard__headline { font-family: var(--font-display); font-style: italic; color: var(--brass); }
.pcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.pcard__intent { font-size: var(--fs-sm); color: var(--text-2); }
.pcard__photo-tap { position: absolute; inset: 0 0 35% 0; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; }
.pcard__photo-tap button { background: transparent; border: 0; cursor: pointer; }
.stamp {
  position: absolute; z-index: 3; top: 22%; padding: 6px 14px; border: 3px solid currentColor; border-radius: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0; pointer-events: none; background: rgb(13 11 12 / 0.25);
}
.stamp--like { left: 18px; color: var(--brass); transform: rotate(-14deg); }
.stamp--pass { right: 18px; color: var(--text); transform: rotate(14deg); }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: var(--s4); }
.gcard { display: grid; border-radius: var(--r-card); overflow: hidden; background: var(--night-2); border: 1px solid color-mix(in oklab, var(--brass) 16%, var(--line)); }
.gcard__media { position: relative; aspect-ratio: 4 / 5; background: var(--night-3); }
.gcard__media img { width: 100%; height: 100%; object-fit: cover; }
.gcard__media .pcard__scrim { background: linear-gradient(180deg, rgb(13 11 12 / 0) 50%, rgb(13 11 12 / 0.9) 100%); }
.gcard__info { position: absolute; z-index: 2; left: var(--s4); right: var(--s4); bottom: var(--s3); display: grid; gap: 6px; }
.gcard__name { font-family: var(--font-display); font-size: var(--fs-xl); display: flex; align-items: center; gap: 6px; }
.gcard__actions { display: flex; align-items: center; gap: var(--s2); padding: var(--s3); }
.gcard__actions .btn { flex: 1; min-height: 44px; }
.gcard__link { position: absolute; inset: 0; z-index: 1; }

/* ---- Profile detail -------------------------------------------------------- */
.profile { max-width: 640px; margin: 0 auto; }
.gallery { position: relative; border-radius: var(--r-card); overflow: hidden; background: var(--night-3); }
.gallery__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4 / 5; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide { flex: 0 0 100%; scroll-snap-align: start; }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery .pcard__dots { top: 10px; }
.gallery__nav { position: absolute; z-index: 2; top: 50%; translate: 0 -50%; }
.gallery__nav--prev { left: var(--s2); }
.gallery__nav--next { right: var(--s2); }
.profile__head { display: grid; gap: var(--s2); margin: var(--s5) 0 var(--s4); }
.profile__name { display: flex; align-items: center; gap: var(--s2); font-family: var(--font-display); font-size: var(--fs-3xl); }
.profile__bio { font-size: var(--fs-lg); line-height: 1.6; max-width: 62ch; }
.facts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.actionbar {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + var(--s3)); z-index: 5;
  display: flex; gap: var(--s3); padding: var(--s3); margin-top: var(--s6);
  border-radius: var(--r-pill); background: color-mix(in oklab, var(--night-2) 92%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-2);
}
.actionbar .btn { flex: 1; }
@media (min-width: 960px) { .actionbar { bottom: var(--s5); } }
.consent-note { display: flex; gap: var(--s2); color: var(--text-2); font-size: var(--fs-sm); margin-top: var(--s4); }
.consent-note .svg-icon { color: var(--brass); width: 18px; height: 18px; }

/* ---- Chat ------------------------------------------------------------------ */
.chat { display: grid; grid-template-rows: auto 1fr auto; height: 100dvh; }
.has-rail .chat { height: 100dvh; }
.chat__head { display: flex; align-items: center; gap: var(--s3); padding: calc(var(--s2) + var(--safe-t)) var(--s3) var(--s2); border-bottom: 1px solid var(--line-soft); background: var(--night); }
.chat__who { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s3); color: var(--text); text-decoration: none; }
.chat__who .avatar { width: 40px; height: 40px; }
.chat__who .name { font-family: var(--font-display); font-size: var(--fs-xl); }
.chat__scroll { overflow-y: auto; padding: var(--s4); display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.chat__notice { align-self: center; max-width: 360px; text-align: center; font-size: var(--fs-xs); color: var(--text-2); padding: var(--s3) var(--s4); border: 1px solid var(--line-soft); border-radius: 14px; margin: var(--s2) 0 var(--s4); }
.chat__day { align-self: center; font-size: var(--fs-xs); color: var(--text-2); margin: var(--s3) 0; }
.bubble { max-width: min(78%, 520px); padding: 10px 14px; border-radius: 20px; font-size: var(--fs-md); line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble--them { align-self: flex-start; background: var(--night-3); border: 1px solid var(--line-soft); border-bottom-left-radius: 6px; }
.bubble--me { align-self: flex-end; background: var(--wine); border-bottom-right-radius: 6px; }
.bubble.is-pending { opacity: 0.6; }
.bubble.is-failed { outline: 1px solid var(--err); }
.bubble__time { display: block; margin-top: 3px; font-size: 11px; color: rgb(247 242 236 / 0.62); text-align: right; }
.bubble--image { padding: 4px; background: var(--night-3); }
.bubble--image img { border-radius: 16px; max-height: 320px; width: auto; }
.blurred { position: relative; display: block; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 16px; overflow: hidden; }
.blurred img { filter: blur(22px) saturate(0.7); transform: scale(1.1); }
.blurred span { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--fs-sm); color: var(--text); background: rgb(13 11 12 / 0.35); }
.composer { display: flex; align-items: flex-end; gap: var(--s2); padding: var(--s2) var(--s3) calc(var(--s2) + var(--safe-b)); border-top: 1px solid var(--line-soft); background: var(--night); }
.composer .textarea { min-height: 46px; max-height: 140px; padding: 11px var(--s4); border-radius: 23px; resize: none; }
.composer .icon-btn--send { background: var(--wine); color: var(--text); flex: none; }
.composer .icon-btn--send:disabled { opacity: 0.4; }

/* ---- Match moment ------------------------------------------------------------ */
.match-moment { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: var(--s5); background: radial-gradient(120% 80% at 50% 20%, rgb(128 15 47 / 0.55), rgb(13 11 12 / 0.96) 60%); opacity: 0; transition: opacity 320ms var(--ease-out); }
.match-moment.is-in { opacity: 1; }
.match-moment__inner { display: grid; justify-items: center; gap: var(--s5); text-align: center; max-width: 420px; }
.match-moment__pair { display: flex; align-items: center; }
.match-moment__pair .avatar { width: 112px; height: 112px; border: 2px solid var(--brass); }
.match-moment__pair .avatar + .avatar { margin-left: -18px; }
.match-moment__bell { width: 64px; height: 64px; color: var(--brass); }
.match-moment h2 { font-family: var(--font-display); font-size: clamp(2.5rem, 2rem + 3vw, 3.5rem); }
.match-moment p { color: var(--text-2); }
.match-moment__actions { display: grid; gap: var(--s2); width: 100%; }

/* ---- Service bell (signature object) --------------------------------------- */
.bell-ctl {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4) 0 6px;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--night-2); color: var(--text);
  font-size: var(--fs-sm); cursor: pointer; white-space: nowrap;
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease, transform var(--t-press) var(--ease-out);
}
.bell-ctl:active { transform: scale(0.97); }
.bell-ctl[data-state="now"], .bell-ctl[data-state="tonight"], .bell-ctl[data-state="weekend"], .bell-ctl[data-state="exploring"] { border-color: color-mix(in oklab, var(--brass) 50%, var(--line)); }
.bell { position: relative; width: 34px; height: 34px; color: var(--brass); flex: none; }
.bell svg { width: 100%; height: 100%; overflow: visible; }
.bell canvas { width: 100%; height: 100%; }
.bell__lamp { position: absolute; top: 4px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--night-2); opacity: 0; transform: scale(0.9); transition: opacity var(--t-ui) var(--ease-out), transform var(--t-ui) var(--ease-out); }
.bell-ctl[data-state="now"] .bell__lamp { opacity: 1; transform: none; }
.bell-ctl[data-state="tonight"] .bell__lamp, .bell-ctl[data-state="weekend"] .bell__lamp { opacity: 1; transform: none; background: var(--brass); }
.bell .bell__striker { transform-box: fill-box; transform-origin: 50% 100%; }
.bell .bell__dome { transform-box: fill-box; transform-origin: 50% 100%; }
@media (max-width: 420px) { .bell-ctl__label { display: none; } .bell-ctl { padding-right: 6px; } }

/* ---- Door hanger (Ghost Mode) --------------------------------------------- */
.hanger {
  position: relative; display: grid; justify-items: center; gap: var(--s3); width: 190px; padding: 64px var(--s4) var(--s5);
  border-radius: 22px 22px 18px 18px; border: 1px solid var(--line); background: var(--night-3); color: var(--text);
  cursor: pointer; text-align: center; font: inherit;
  transition: background-color var(--t-ui) var(--ease-out), border-color var(--t-ui) ease, transform var(--t-press) var(--ease-out);
}
.hanger:active { transform: scale(0.98); }
.hanger::before { content: ""; position: absolute; top: 16px; width: 44px; height: 44px; border-radius: 50%; background: var(--night); border: 1px solid var(--line); }
.hanger__kicker { font-size: var(--fs-sm); color: var(--text-2); }
.hanger__word { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.05; }
.hanger__state { font-size: var(--fs-sm); color: var(--text-2); }
.hanger[aria-checked="true"] { background: var(--wine); border-color: var(--wine-hi); }
.hanger[aria-checked="true"] .hanger__kicker, .hanger[aria-checked="true"] .hanger__state { color: rgb(247 242 236 / 0.8); }
.hanger-wrap { display: flex; gap: var(--s5); align-items: center; flex-wrap: wrap; }
.hanger-wrap p { flex: 1; min-width: 200px; color: var(--text-2); }

/* ---- Auth & onboarding ------------------------------------------------------ */
.auth { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.auth__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: calc(var(--s3) + var(--safe-t)) var(--s4) var(--s3); }
.auth__body { width: 100%; max-width: 460px; margin: 0 auto; padding: var(--s4) var(--s5) var(--s8); display: grid; align-content: start; gap: var(--s5); }
.auth__mark { width: 64px; height: 64px; color: var(--brass); margin: var(--s4) auto 0; }
.auth__title { font-family: var(--font-display); font-size: var(--fs-3xl); text-align: center; }
.auth__lede { color: var(--text-2); text-align: center; max-width: 36ch; margin: 0 auto; }
.auth__or { display: flex; align-items: center; gap: var(--s3); color: var(--text-2); font-size: var(--fs-sm); }
.auth__or::before, .auth__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth__foot { text-align: center; color: var(--text-2); font-size: var(--fs-sm); }
.auth__foot a, .auth__foot button { color: var(--brass); background: none; border: 0; cursor: pointer; padding: 0; font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }
.btn--provider { --btn-bg: var(--text); --btn-fg: var(--night); --btn-line: var(--text); }
.steps { display: flex; gap: 6px; justify-content: center; }
.steps span { width: 22px; height: 3px; border-radius: 3px; background: var(--line); transition: background-color var(--t-ui) ease; }
.steps span.is-done { background: var(--brass-soft); }
.steps span.is-now { background: var(--brass); width: 34px; }
.checklist { display: grid; gap: var(--s3); }
.checklist li { display: flex; gap: var(--s3); align-items: flex-start; }
.checklist .svg-icon { color: var(--ok); flex: none; margin-top: 1px; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.photo-slot { position: relative; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--night-2); border: 1px dashed var(--line); display: grid; place-items: center; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot--add { cursor: pointer; color: var(--brass); border-color: color-mix(in oklab, var(--brass) 40%, var(--line)); }
.photo-slot--add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-slot__badge { position: absolute; left: 6px; bottom: 6px; }
.photo-slot__tools { position: absolute; right: 4px; top: 4px; display: flex; gap: 2px; }
.photo-slot__tools .icon-btn { width: 34px; height: 34px; background: rgb(13 11 12 / 0.7); color: var(--text); }
.photo-slot.is-main { border: 1px solid var(--brass-soft); }
.photo-slot.is-drag-over { outline: 2px solid var(--brass); }

.cropper { position: relative; overflow: hidden; border-radius: 18px; background: var(--night); aspect-ratio: 4 / 5; touch-action: none; cursor: grab; }
.cropper img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; user-select: none; }
.cropper__frame { position: absolute; inset: 0; border: 2px solid rgb(232 201 155 / 0.8); border-radius: 18px; pointer-events: none; box-shadow: 0 0 0 999px rgb(13 11 12 / 0.4) inset; }

/* ---- Premium ---------------------------------------------------------------- */
.plans { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.plan { display: grid; gap: var(--s2); padding: var(--s5); border-radius: 20px; background: var(--night-2); border: 1px solid var(--line); }
.plan--feature { background: linear-gradient(170deg, color-mix(in oklab, var(--wine) 45%, var(--night-2)), var(--night-2) 75%); border-color: color-mix(in oklab, var(--brass) 35%, var(--line)); }
.plan__name { font-family: var(--font-display); font-size: var(--fs-xl); }
.plan__price { font-size: var(--fs-2xl); font-weight: 500; font-variant-numeric: tabular-nums; }
.plan__price small { font-size: var(--fs-sm); color: var(--text-2); font-weight: 400; }
.plan p { color: var(--text-2); font-size: var(--fs-sm); }
.plan .btn { margin-top: var(--s2); }

/* ---- Utility layout ---------------------------------------------------------- */
.stack { display: grid; gap: var(--s4); }
.stack--sm { gap: var(--s2); }
.stack--lg { gap: var(--s6); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.split { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.center { text-align: center; }
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.mt-2 { margin-top: var(--s2); } .mt-4 { margin-top: var(--s4); } .mt-6 { margin-top: var(--s6); }
.hide-desktop { }
@media (min-width: 960px) { .hide-desktop { display: none !important; } }
@media (max-width: 959px) { .hide-mobile { display: none !important; } }

/* ---- Error page ------------------------------------------------------------- */
.error-page { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: var(--s4); padding: var(--s6); text-align: center; }
.error-page__code { font-family: var(--font-display); font-size: 5rem; color: var(--brass); line-height: 1; }
.error-page__title { font-family: var(--font-display); font-size: var(--fs-3xl); }
.error-page__msg { color: var(--text-2); max-width: 44ch; }

/* ---- View entrance (one authored move per screen, interruptible) ------------- */
.view-enter { animation: view-in 180ms var(--ease-out) both; }

@keyframes view-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes bootline { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .view-enter { animation: view-fade 200ms ease both; }
  .skel::after, .boot__line::after { animation: none; }
  dialog.sheet, dialog.sheet.is-open { transition: opacity 200ms ease; transform: none !important; }
  dialog.sheet:not(.is-open) { opacity: 0; }
  .deck__card.is-next { transform: none; }
  .btn:active, .chip:active, .act:active, .icon-btn:active, .option:active, .hanger:active { transform: none; }
  .toast { transform: none; }
}
@keyframes view-fade { from { opacity: 0; } }

/* Shell column beside the desktop rail */
.stage { min-width: 0; }
.seal-wrap { display: inline-flex; align-items: center; }

/* Match moment uses <dialog> for focus trapping: reset the UA box */
dialog.match-moment { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; color: var(--text); }
dialog.match-moment::backdrop { background: transparent; }
.center-self { justify-self: center; margin-inline: auto; }
details > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: var(--s3); }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; color: var(--brass); font-size: 1.25rem; line-height: 1; }
details[open] > summary::after { content: "–"; }
.page-head h1 .logo__dot { margin-left: 2px; }
.disc-area { min-height: 300px; }

/* ---- Review fixes ------------------------------------------------------------ */
[hidden] { display: none !important; }
@media (min-width: 960px) { .rail .navlink { align-items: center; } }
.deck { height: clamp(380px, calc(100dvh - var(--top-h) - var(--nav-h) - var(--safe-b) - 264px), 640px); }
@media (min-width: 960px) { .deck { height: clamp(420px, calc(100dvh - var(--top-h) - 240px), 640px); } }
.actionbar .btn { white-space: nowrap; }
.actionbar .icon-btn { flex: none; width: 50px; height: 50px; border: 1px solid var(--line); }
.pcard__name .age { margin-left: -0.12em; }

/* ---- Motion review fixes (Emil Kowalski's rules) ---- */
.btn:active, .icon-btn:active, .chip:active, .option:active, .act:active, .bell-ctl:active, .hanger:active, .navlink:active .svg-icon { transition-duration: 100ms; }
.icon-btn:active, .act:active { transform: scale(0.96); }
.navlink:active .svg-icon { transform: scale(0.96); }
/* Sheets: enter on the drawer curve, leave faster than they arrive */
dialog.sheet { transition: transform 260ms var(--ease-drawer); }
dialog.sheet.is-open { transition-duration: var(--t-sheet); }
@media (min-width: 720px) {
  dialog.sheet { transition: transform 180ms var(--ease-out), opacity 180ms var(--ease-out); }
  dialog.sheet.is-open { transition-duration: 240ms; }
}
.match-moment { transition: opacity 200ms var(--ease-out); }
.match-moment.is-in { transition-duration: 320ms; }
details > summary::after { content: none; }
.summary-chev { color: var(--brass); transition: transform var(--t-fast) var(--ease-out); }
details[open] .summary-chev { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) {
  .toast, .toast.is-in, .toast.is-out { transform: none; }
  .bell__lamp, .switch::after { transition-property: opacity, background-color; }
  .summary-chev { transition: none; }
}
.bell-art .bell__dome, .bell-art .bell__striker, .boot__bell .bell__dome, .boot__bell .bell__striker { transform-box: fill-box; transform-origin: 50% 100%; }

/* ---- Finish-review fixes ---------------------------------------------------- */
/* Ghost Mode door hanger: a real hanger outline (hole + slit), brass hairline edge, wordmark at the foot */
.hanger {
  width: 176px; min-height: 360px; padding: 108px var(--s4) var(--s5);
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
  border: 1px solid color-mix(in oklab, var(--brass) 55%, var(--line));
  border-radius: 16px 16px 24px 24px; background: var(--night-3);
}
.hanger::before {
  top: 30px; left: 50%; translate: -50% 0; width: 58px; height: 58px; border-radius: 50%;
  background: var(--night); border: 1px solid color-mix(in oklab, var(--brass) 55%, var(--line));
}
.hanger::after {
  content: ""; position: absolute; top: -1px; left: 50%; translate: -50% 0; width: 12px; height: 34px;
  background: var(--night); border-inline: 1px solid color-mix(in oklab, var(--brass) 55%, var(--line));
}
.hanger__word { font-size: 1.75rem; }
.hanger__mark { margin-top: auto; font-family: var(--font-display); font-size: 1.05rem; color: var(--brass); }
.hanger[aria-checked="true"] { border-color: var(--wine-hi); }
.hanger[aria-checked="true"]::before, .hanger[aria-checked="true"]::after { border-color: var(--wine-hi); }
.hanger[aria-checked="true"] .hanger__mark { color: var(--text); }
/* Profile action bar docks onto the tab bar: nothing shows through underneath */
.actionbar {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b)); margin: var(--s6) calc(-1 * var(--s4)) 0;
  border-radius: 0; border-inline: 0; border-bottom: 0; background: var(--night); box-shadow: none;
  padding: var(--s3) var(--s4); backdrop-filter: none; -webkit-backdrop-filter: none;
}
@media (min-width: 960px) { .actionbar { bottom: 0; margin-inline: 0; border-radius: 20px 20px 0 0; } }
/* Filter chips fade at the edge instead of ending on a sliver */
.filters { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 24px; }
