/* =====================================================================
   ECHOED MOMENTS — App & Auth screens
   Extends the landing design system (em.css). Built on the same tokens:
   Echo Blue / Moment Gold, Poppins (display) + Mulish (body), warm paper.
   These screens are NOT in the original design file — they are designed
   here to be consistent with the landing page's system.
   ===================================================================== */

/* ---- generic app page shell --------------------------------------- */
.app-body { background: var(--canvas); min-height: 100vh; display: flex; flex-direction: column; }

/* landing/auth header sign-in link */
.app-header .signin {
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm);
  color: var(--ink-800); text-decoration: none; margin-right: 4px;
}
.app-header .signin:hover { color: var(--blue-600); }

/* inline notice (allauth alerts, form-level messages) */
.notice {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-md);
  border: 1px solid var(--border); border-left-width: 4px;
  font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg1);
  margin-bottom: 20px; background: var(--surface);
}
.notice .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.notice-error { border-left-color: var(--danger); background: var(--danger-bg); }
.notice-error .ic { color: var(--danger); }
.notice-success { border-left-color: var(--success); background: var(--success-bg); }
.notice-success .ic { color: var(--success); }
.notice-info { border-left-color: var(--echo-blue); background: var(--wash-blue); }
.notice-info .ic { color: var(--echo-blue); }

/* simple data table (allauth manage screens) */
.data-table { width: 100%; border-collapse: collapse; font-family: var(--font-body); font-size: var(--text-sm); }
.data-table th, .data-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.data-table th { font-weight: 700; color: var(--fg3); text-transform: uppercase; letter-spacing: .06em; font-size: var(--text-xs); }

.page-head-action { flex: none; }

/* ---- error pages -------------------------------------------------- */
.error-page {
  flex: 1; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: clamp(48px, 9vw, 120px) 24px;
}
.error-page .error-inner { max-width: 480px; }
.error-page .error-code {
  font-family: var(--font-display); font-weight: 700; line-height: 1;
  font-size: clamp(4rem, 14vw, 7rem); color: var(--blue-100); letter-spacing: -0.04em; margin: 0 0 8px;
}
.error-page h1 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); color: var(--fg1); margin: 0 0 12px; }
.error-page p { font-family: var(--font-body); color: var(--fg2); margin: 0 auto 28px; max-width: 40ch; }
.error-page .spark { margin: 0 auto 24px; }

/* simplified app header (logged-in / app context) */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.app-header-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.app-header .logo { height: 26px; }
.app-nav { display: flex; gap: 26px; align-items: center; }
.app-nav a {
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm);
  color: var(--fg2); text-decoration: none; transition: color var(--dur-fast);
  display: inline-flex; align-items: center; gap: 8px;
}
.app-nav a .ic { width: 17px; height: 17px; }
.app-nav a:hover, .app-nav a.active { color: var(--echo-blue); }
.app-header .header-cta { display: flex; gap: 12px; align-items: center; }
.app-header .btn { padding: 10px 20px; font-size: var(--text-sm); }

/* avatar chip */
.avatar {
  width: 38px; height: 38px; border-radius: var(--radius-pill);
  background: var(--wash-blue); color: var(--blue-600);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-base);
  border: 1px solid var(--blue-100); cursor: pointer; text-decoration: none;
}

/* avatar dropdown menu */
.avatar-menu { position: relative; }
.avatar-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50;
  min-width: 232px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 8px; overflow: hidden;
}
.avatar-dropdown[hidden] { display: none; }
.avatar-id { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.avatar-id-name { display: block; font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm); color: var(--fg1); }
.avatar-id-email { display: block; font-family: var(--font-body); font-size: var(--text-xs); color: var(--fg3); margin-top: 2px; word-break: break-all; }
.avatar-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border-radius: var(--radius-xs);
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm);
  color: var(--fg2); text-decoration: none; background: none; border: none; cursor: pointer; text-align: left;
}
.avatar-item .ic { width: 17px; height: 17px; }
.avatar-item:hover { background: var(--bg-sunk); color: var(--ink-800); }
.avatar-item.is-danger { color: var(--danger); }
.avatar-item.is-danger:hover { background: var(--danger-bg); }
.avatar-logout { margin: 6px 0 0; padding: 6px 0 0; border-top: 1px solid var(--border); }

/* =====================================================================
   AUTH LAYOUT — split: brand panel + form card
   ===================================================================== */
.auth {
  flex: 1; display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh;
}
.auth-aside {
  position: relative; overflow: hidden; color: #fff;
  background-color: var(--ink-900);
  background-image:
    linear-gradient(to bottom, rgba(10,15,24,.62), rgba(10,15,24,.82)),
    url("../images/design/hero.801735669bbb.jpg");
  background-size: cover; background-position: center 42%;
  padding: clamp(40px, 5vw, 72px);
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-aside .logo { height: 30px; filter: brightness(0) invert(1); }
.auth-aside .mark {
  position: absolute; right: -120px; bottom: -40px; width: min(420px, 50%);
  opacity: .08; filter: brightness(0) invert(1); pointer-events: none;
}
.auth-aside-body { position: relative; z-index: 1; max-width: 30ch; }
.auth-aside-body .spark { margin-bottom: 28px; }
.auth-aside-body h2 {
  font-family: var(--font-display); font-weight: 700; color: #fff;
  font-size: clamp(1.9rem, 2.6vw, 2.6rem); line-height: 1.1; letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.auth-aside-body p { font-family: var(--font-body); color: rgba(255,255,255,.8); font-size: var(--text-md); line-height: 1.55; margin: 0; }
.auth-aside-foot { position: relative; z-index: 1; font-family: var(--font-body); font-size: var(--text-sm); color: rgba(255,255,255,.6); }

.auth-main {
  display: flex; align-items: center; justify-content: center;
  padding: clamp(32px, 5vw, 64px); background: var(--canvas);
}
.auth-card { width: 100%; max-width: 440px; }
.auth-card .eyebrow { margin-bottom: 14px; }
.auth-card h1 {
  font-family: var(--font-display); font-weight: 700; color: var(--fg1);
  font-size: var(--text-2xl); letter-spacing: -0.02em; margin: 0 0 10px; line-height: 1.1;
}
/* Base subtitle treatment so a `.sub` used outside .auth-card / .page-head
   (e.g. signup and password-reset inside .card.pad-lg) is still styled. The
   scoped rules below/above override this where they apply. */
.sub { font-family: var(--font-body); color: var(--fg2); font-size: var(--text-md); line-height: var(--leading-normal); margin: 0 0 var(--space-6); }
.auth-card .sub { font-family: var(--font-body); color: var(--fg2); font-size: var(--text-md); margin: 0 0 32px; line-height: 1.5; }
.auth-foot { margin-top: 28px; font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg2); text-align: center; }
.auth-foot a { color: var(--blue-600); font-weight: 700; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

/* mobile-only top bar for auth */
.auth-mobile-top { display: none; }

/* =====================================================================
   FORMS
   ===================================================================== */
.field { margin-bottom: 20px; }
.field > label {
  display: block; font-family: var(--font-body); font-weight: 700;
  font-size: var(--text-sm); color: var(--ink-700); margin-bottom: 8px;
}
.input, .select, .textarea {
  width: 100%; font-family: var(--font-body); font-size: var(--text-base);
  color: var(--fg1); background: var(--surface);
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 13px 16px; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.input::placeholder, .textarea::placeholder { color: var(--fg3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--echo-blue);
  box-shadow: 0 0 0 4px rgba(21,138,255,.14);
}
.textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-right: 46px; }
.input-toggle {
  position: absolute; right: 6px; width: 34px; height: 34px; border: none; background: none;
  color: var(--fg3); cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs);
}
.input-toggle:hover { color: var(--ink-700); background: var(--bg-sunk); }
.input-toggle .ic { width: 18px; height: 18px; }
.field-hint { font-family: var(--font-body); font-size: var(--text-xs); color: var(--fg3); margin-top: 7px; }
/* label row with a trailing char counter (e.g. title 0/50) */
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.char-count { font-family: var(--font-body); font-weight: 700; font-size: var(--text-xs); color: var(--fg3); font-variant-numeric: tabular-nums; transition: color var(--dur-fast); }
.char-count.is-warn { color: var(--danger); }
.field-error { font-family: var(--font-body); font-size: var(--text-xs); color: var(--danger); margin-top: 7px; }
.field.has-error .input { border-color: var(--danger); }

.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.checkline { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg2); cursor: pointer; }
.checkline input { width: 17px; height: 17px; accent-color: var(--echo-blue); }
.link-sm { font-family: var(--font-body); font-size: var(--text-sm); color: var(--blue-600); font-weight: 700; text-decoration: none; }
.link-sm:hover { text-decoration: underline; }

.btn-block { width: 100%; }
.btn-lg { padding: 16px 30px; font-size: var(--text-md); }

/* divider with label */
.or-divider { display: flex; align-items: center; gap: 14px; margin: 26px 0; color: var(--fg3); }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.or-divider span { font-family: var(--font-body); font-size: var(--text-xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; }

/* =====================================================================
   GENERIC APP MAIN / SECTION CONTAINERS
   ===================================================================== */
.app-main { flex: 1; padding: clamp(32px, 5vw, 56px) 0 96px; }
.app-wrap { max-width: 1100px; margin: 0 auto; padding: 0 32px; }
.app-wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 32px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.page-head .eyebrow { margin-bottom: 10px; }
.page-head h1 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); letter-spacing: -0.02em; color: var(--fg1); margin: 0; }
.page-head .sub { font-family: var(--font-body); color: var(--fg2); margin: 8px 0 0; max-width: 52ch; }

.back-link { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); font-weight: 700; font-size: var(--text-sm); color: var(--fg2); text-decoration: none; margin-bottom: 22px; }
.back-link .ic { width: 16px; height: 16px; }
.back-link:hover { color: var(--echo-blue); }

/* card surface */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 32px;
}
.card.pad-lg { padding: clamp(32px, 4vw, 48px); }

/* =====================================================================
   VAULT DASHBOARD
   ===================================================================== */
.vault-hero {
  position: relative; overflow: hidden; color: #fff;
  border-radius: var(--radius-xl); padding: clamp(32px, 4vw, 48px);
  min-height: 230px; display: flex; align-items: center;
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--echo-blue) 55%, var(--blue-500) 100%);
  box-shadow: 0 24px 56px rgba(21,138,255,.28); margin-bottom: 40px;
}
.vault-hero .cta-spark { position: absolute; right: -50px; top: -60px; width: 220px; height: 220px; border-radius: 999px; background: radial-gradient(circle, rgba(249,192,11,.32), transparent 65%); pointer-events: none; z-index: 1; }
/* photographic layer on the right, faded into the blue toward the text */
.vault-hero .vault-hero-media {
  position: absolute; inset: 0 0 0 auto; z-index: 0; pointer-events: none;
  /* cover fills the layer edge-to-edge (no internal hard edge), so a long
     left-to-right mask can dissolve the whole photo into the gradient with no
     seam. The layer is wide and the fade gradual, so the blend reads as one
     surface rather than a pasted rectangle. */
  width: 62%;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: 50% 38%;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 8%, rgba(0,0,0,.5) 48%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, transparent 8%, rgba(0,0,0,.5) 48%, #000 100%);
  opacity: .9;
}
.vault-hero-inner { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.vault-hero h1 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); color: #fff; margin: 0 0 10px; letter-spacing: -0.02em; }
.vault-hero p { font-family: var(--font-body); color: rgba(255,255,255,.88); margin: 0; max-width: 48ch; }
.vault-hero-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px;
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm);
  color: #fff; text-decoration: none;
  padding: 9px 16px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28);
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.vault-hero-link .ic { width: 16px; height: 16px; }
.vault-hero-link:hover { background: rgba(255,255,255,.24); border-color: rgba(255,255,255,.5); }
.vault-hero-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 40px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); padding: 24px 26px;
}
.stat .stat-ic { width: 42px; height: 42px; border-radius: var(--radius-md); background: var(--wash-blue); color: var(--echo-blue); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.stat .stat-ic .ic { width: 21px; height: 21px; }
.stat .stat-value { font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); color: var(--fg1); line-height: 1; }
.stat .stat-label { font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg2); margin-top: 6px; }

/* section subhead within app */
.app-subhead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 20px; flex-wrap: wrap; }
.app-subhead h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); color: var(--fg1); margin: 0; }

/* "X / Y vaults" quota badge — how many vaults this account may create. */
.vault-quota { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-weight: 700; font-size: var(--text-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; padding: 5px 11px; border-radius: var(--radius-pill); color: var(--gold-700); background: var(--wash-gold); }
.vault-quota .ic { width: 12px; height: 12px; }
.vault-quota.is-full { color: #fff; background: var(--gold-600); }

/* vault tools: short search + grid/list view toggle (right of the heading) */
.vault-tools { display: flex; align-items: center; gap: 10px; }
.vault-search { position: relative; display: flex; align-items: center; }
.vault-search .ic { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--fg3); pointer-events: none; }
.vault-search input {
  width: 200px; max-width: 46vw; font-family: var(--font-body); font-size: var(--text-sm);
  color: var(--fg1); background: var(--surface); border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill); padding: 9px 14px 9px 34px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.vault-search input::placeholder { color: var(--fg3); }
.vault-search input:focus { outline: none; border-color: var(--echo-blue); box-shadow: 0 0 0 4px rgba(21,138,255,.14); }
.vault-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* search suggestions dropdown */
.search-suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); overflow: hidden;
}
.search-suggest.hidden { display: none; }
.suggest-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: var(--radius-xs); cursor: pointer;
  font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg1);
}
.suggest-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-item:hover, .suggest-item.is-active { background: var(--bg-sunk); }

.view-toggle { display: inline-flex; background: var(--bg-sunk); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 3px; gap: 2px; }
.view-btn {
  width: 34px; height: 32px; border: none; background: none; cursor: pointer;
  border-radius: var(--radius-pill); color: var(--fg3);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.view-btn .ic { width: 17px; height: 17px; }
.view-btn:hover { color: var(--ink-700); }
.view-btn.is-active { background: var(--surface); color: var(--echo-blue); box-shadow: var(--shadow-xs); }

/* sort-by-date up/down toggle — single icon button, matches the toolbar pills */
.sort-toggle {
  width: 40px; height: 40px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; border-radius: var(--radius-pill); color: var(--fg2);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.sort-toggle .ic { width: 18px; height: 18px; }
.sort-toggle:hover { color: var(--echo-blue); border-color: var(--blue-200); }
.sort-toggle:focus-visible { outline: none; border-color: var(--echo-blue); box-shadow: 0 0 0 4px rgba(21,138,255,.14); }

.vault-empty-search { font-family: var(--font-body); color: var(--fg2); text-align: center; padding: 40px 0; }

.memory-card.is-filtered-out { display: none; }
.memory-card.is-locked { cursor: pointer; }

/* locked-memory modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(14, 23, 38, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: modal-fade var(--dur-base) var(--ease-out);
}
.modal-overlay.hidden, .modal-overlay[hidden] { display: none; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative; width: 100%; max-width: 420px; text-align: center;
  background: var(--surface); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); padding: clamp(32px, 5vw, 44px) clamp(28px, 4vw, 40px);
  animation: modal-rise var(--dur-base) var(--ease-out);
}
@keyframes modal-rise { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px;
  border: none; background: none; cursor: pointer; border-radius: var(--radius-pill);
  color: var(--fg3); display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--bg-sunk); color: var(--ink-700); }
.modal-close .ic { width: 18px; height: 18px; }
.modal-ic {
  width: 64px; height: 64px; border-radius: var(--radius-pill); margin: 0 auto 20px;
  background: var(--wash-gold); color: var(--gold-600);
  display: flex; align-items: center; justify-content: center;
}
.modal-ic .ic { width: 30px; height: 30px; }
/* A lock in a modal is the brand mark, so it wears true brand gold rather than
   the softer amber the generic modal icon uses. */
.modal-ic.is-lock { color: var(--moment-gold); }
.modal-card h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); color: var(--fg1); margin: 0 0 12px; }
.modal-sub { font-family: var(--font-body); font-size: var(--text-base); color: var(--fg2); line-height: 1.55; margin: 0 0 28px; }

/* ── Welcome carousel modal ─────────────────────────────────────────── */
.wc-card {
  max-width: 520px; width: 100%;
  padding: clamp(28px, 4vw, 40px) clamp(24px, 4vw, 36px) 28px;
  text-align: center;
  /* no overflow:hidden here — let the viewport div handle clipping */
}

/* Clipping viewport — sits between the card padding and the track */
.wc-viewport {
  overflow: hidden;
  width: 100%;
}

/* Slide track — full-width overflow window */
.wc-track {
  display: flex;
  transition: transform 380ms cubic-bezier(.4,0,.2,1);
  will-change: transform;
  /* width is auto; each slide is 100% of the viewport, not the track */
}
.wc-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Intro slide */
.wc-intro { padding: 8px 0 20px; }
.wc-intro .wt-scene { margin: 0 auto 24px; }
.wc-intro h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); color: var(--fg1); margin: 0 0 12px; }
.wc-intro .modal-sub { margin-bottom: 8px; }
.wc-hint { font-size: var(--text-sm); color: var(--fg3); margin: 0; }
.wc-hint-link { color: var(--echo-blue); font-weight: 600; text-decoration: none; }
.wc-hint-link:hover { text-decoration: underline; }

/* Step slides — image frame */
.wc-frame {
  position: relative;
  /* Match the crops' aspect ratio so the whole screenshot shows at every
     width and the percentage-positioned callouts stay accurate on mobile. */
  width: 100%; aspect-ratio: 448 / 220;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--ink-50);
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.wc-frame img {
  width: 100%; height: 100%;
  /* Crops are pre-cut to the frame's aspect ratio, so cover fills edge-to-edge
     with no letterboxing while keeping the framed UI fully visible. */
  object-fit: cover; object-position: center top;
  display: block;
}

/* Callout annotation — pill badge that points at the relevant UI area.
   A small dot anchors the pill to the exact spot it describes. */
.wc-callout {
  position: absolute;
  display: flex; align-items: center; gap: 6px;
  background: var(--echo-blue); color: #fff;
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  padding: 6px 12px 6px 8px;
  border-radius: var(--radius-pill);
  box-shadow: 0 6px 18px rgba(21,138,255,.40), 0 0 0 3px rgba(255,255,255,.6);
  white-space: nowrap;
  max-width: calc(100% - 24px);
  pointer-events: none;
  z-index: 2;
  animation: wc-callout-in 420ms cubic-bezier(.34,1.56,.64,1) both;
}
/* On narrow frames the pills shrink rather than spill past the screenshot. */
@media (max-width: 460px) {
  .wc-callout { font-size: 10px; padding: 5px 10px 5px 7px; }
}
.wc-callout .ic { width: 14px; height: 14px; flex-shrink: 0; }

/* Pulsing anchor dot, centred on the pill's leading edge */
.wc-callout::before {
  content: "";
  position: absolute; left: -5px; top: 50%;
  width: 10px; height: 10px; margin-top: -5px;
  border-radius: 50%;
  background: var(--echo-blue);
  box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 0 0 6px rgba(21,138,255,.25);
  animation: wc-dot-pulse 2s ease-out infinite;
}

@keyframes wc-callout-in {
  from { opacity: 0; transform: translateX(var(--wc-tx, 0)) scale(.85); }
  to   { opacity: 1; transform: translateX(var(--wc-tx, 0)) scale(1); }
}
@keyframes wc-dot-pulse {
  0%   { box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 0 0 4px rgba(21,138,255,.45); }
  70%  { box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 0 0 12px rgba(21,138,255,0); }
  100% { box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 0 0 12px rgba(21,138,255,0); }
}
@media (prefers-reduced-motion: reduce) {
  .wc-callout { animation: none; }
  .wc-callout::before { animation: none; }
}

.wc-text { text-align: left; padding: 0 2px; }
.wc-step-badge {
  display: inline-block; font-size: var(--text-xs); font-weight: 600;
  color: var(--echo-blue); text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 6px;
}
.wc-text h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-lg); color: var(--fg1); margin: 0 0 8px;
}
.wc-text p { font-size: var(--text-base); color: var(--fg2); line-height: 1.55; margin: 0; }

/* Dot indicators */
.wc-dots {
  display: flex; justify-content: center; gap: 6px;
  margin: 20px 0 16px;
}
.wc-dot {
  width: 8px; height: 8px; border-radius: var(--radius-pill);
  background: var(--ink-300); transition: background var(--dur-fast), width var(--dur-fast);
}
.wc-dot--active { background: var(--echo-blue); width: 22px; }

/* Prev / Next row */
.wc-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.wc-nav .btn { min-width: 120px; }
.wc-btn-next { margin-left: auto; }

/* =====================================================================
   MEMORY CARDS — each reflection type carries its own hue, so a vault of
   moments reads as a warm, varied collection rather than a wall of blue.
   The gradient band is short (a signal, not a hero image); title + meta
   lead. Grid and list share one card; list reflows it into a row.
   ===================================================================== */

/* per reflection-type identity (icon hue, deep ink, soft wash) — blue default */
.memory-card { --rt: var(--echo-blue); --rt-ink: var(--blue-700); --rt-wash: var(--wash-blue); }
.memory-card[data-rtype="child"]       { --rt:#e8588f; --rt-ink:#a5285c; --rt-wash:#fdeef4; }
.memory-card[data-rtype="future_self"] { --rt:#7a5af0; --rt-ink:#4a32a8; --rt-wash:#f0ecfd; }
.memory-card[data-rtype="loved_one"]   { --rt:#e2503f; --rt-ink:#a8331f; --rt-wash:#fdecea; }
.memory-card[data-rtype="personal"]    { --rt:#0e9c8c; --rt-ink:#0a6b60; --rt-wash:#e6f7f4; }
.memory-card[data-rtype="advice"]      { --rt:#e0a800; --rt-ink:#8f6800; --rt-wash:#fff8e6; }
.memory-card[data-rtype="other"]       { --rt:#158aff; --rt-ink:#0a59b4; --rt-wash:#eef6ff; }

.memory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* full-bleed hero card: gradient "image" + bottom scrim + overlaid text */
.memory-card {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 5 / 4; min-height: 248px;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); text-decoration: none; color: #fff;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.memory-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.memory-card:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--rt) 45%, transparent), var(--shadow-lg); }

/* the type-tinted "photo" surface (recordings carry no real image) */
.memory-bg {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(95% 75% at 78% 12%, rgba(255,255,255,.26), transparent 60%),
    linear-gradient(160deg, var(--rt) 0%, var(--rt-ink) 78%);
}
.memory-bg.is-sealed { filter: saturate(.82) brightness(.94); }
/* user-chosen cover photo fills the card (under the scrim) */
.memory-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* sealed: tease the cover heavily blurred + darkened until it unlocks.
   transform scale hides the soft transparent edges blur leaves behind. */
.memory-cover.is-sealed { filter: blur(9px) brightness(.82) saturate(.95); transform: scale(1.1); }
/* large faint type glyph, set into the upper area like a watermark */
.memory-glyph { position: absolute; right: 14px; top: 12px; color: rgba(255,255,255,.18); display: flex; }
.memory-glyph .ic { width: 104px; height: 104px; }
/* bottom scrim so overlaid text always reads, whatever the hue */
.memory-card::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 30%, rgba(8,12,20,.18) 52%, rgba(8,12,20,.74) 100%);
}
/* over a real photo, deepen the scrim a touch so any image keeps text legible */
.memory-card.has-cover::after {
  background: linear-gradient(180deg, rgba(8,12,20,.12) 0%, transparent 34%, rgba(8,12,20,.32) 60%, rgba(8,12,20,.82) 100%);
}

.memory-type {
  position: absolute; z-index: 3; left: 14px; top: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--ink-800); font-family: var(--font-body); font-weight: 700; font-size: var(--text-xs);
  padding: 6px 12px; border-radius: var(--radius-pill); box-shadow: var(--shadow-xs);
}
.memory-type .ic { width: 14px; height: 14px; color: var(--rt); }

/* top-right corner status badge (lock / open / draft) */
.memory-corner {
  position: absolute; z-index: 3; right: 14px; top: 14px;
  width: 34px; height: 34px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.22); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff; border: 1px solid rgba(255,255,255,.32);
}
.memory-corner .ic { width: 17px; height: 17px; }
.memory-corner.is-open { background: color-mix(in srgb, var(--success) 88%, transparent); border-color: transparent; }

/* "From <name>" gift badge for shared moments — gold, sits above the scrim text */
.memory-from {
  position: absolute; z-index: 3; left: 14px; top: 56px;
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500)); color: var(--ink-900);
  font-family: var(--font-body); font-weight: 700; font-size: var(--text-xs);
  padding: 5px 11px; border-radius: var(--radius-pill); box-shadow: 0 6px 14px rgba(249,192,11,.35); border: 2px solid #fff;
}
.memory-from .ic { width: 13px; height: 13px; }

/* overlaid content block at the bottom */
.memory-overlay { position: absolute; z-index: 2; inset: auto 0 0 0; padding: 18px 18px 18px; display: flex; flex-direction: column; gap: 4px; }
.memory-overlay h3 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); color: #fff; margin: 0; line-height: 1.2; text-shadow: 0 1px 10px rgba(0,0,0,.3); }
.memory-overlay p { font-family: var(--font-body); font-size: var(--text-sm); color: rgba(255,255,255,.86); margin: 0; line-height: 1.4; }
.memory-unlock { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; font-family: var(--font-body); font-weight: 700; font-size: var(--text-sm); color: #fff; }
.memory-unlock .ic { width: 15px; height: 15px; color: rgba(255,255,255,.92); }

/* ---- LIST (feed) view: shorter hero rows ----
   The card flows top→bottom: media pill (+ optional "From" badge) on the first
   row, then the title / type / status stacked just under it. The overlay is NOT
   bottom-anchored here (a short row would push the title up behind the pill). */
.memory-grid.is-list { display: flex; flex-direction: column; gap: 14px; }
.memory-grid.is-list .memory-card {
  aspect-ratio: auto; min-height: 0;
  padding: 14px 16px 16px; display: flex; flex-direction: column;
}
.memory-grid.is-list .memory-card:hover { transform: translateY(-2px); }
.memory-grid.is-list .memory-glyph { top: 50%; transform: translateY(-50%); }
/* scrim spans the whole row (no longer a bottom-only fade) so text stays legible */
.memory-grid.is-list .memory-card::after { background: linear-gradient(180deg, rgba(8,12,20,.16), rgba(8,12,20,.52)); }
/* pills flow inline at the top instead of absolute-positioning */
.memory-grid.is-list .memory-type,
.memory-grid.is-list .memory-from { position: static; }
.memory-grid.is-list .memory-corner { top: 12px; right: 14px; }   /* corner badge stays pinned */
/* a top row holding the media pill (+ From badge); leaves room for the corner badge */
.memory-grid.is-list .memory-type { z-index: 3; align-self: flex-start; }
.memory-grid.is-list .memory-from { z-index: 3; align-self: flex-start; margin-top: 8px; }
/* title block sits below the pills, in normal flow */
.memory-grid.is-list .memory-overlay { position: static; inset: auto; padding: 12px 0 0; padding-right: 44px; }
.memory-grid.is-list .memory-overlay h3 { font-size: var(--text-md); }
.memory-grid.is-list .memory-unlock { margin-top: 6px; }
@media (max-width: 560px) {
  .memory-grid.is-list .memory-glyph .ic { width: 84px; height: 84px; }
}

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-weight: 700; font-size: var(--text-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; padding: 5px 11px; border-radius: var(--radius-pill); }
.status-pill .ic { width: 12px; height: 12px; }
.status-sealed { color: var(--gold-700); background: var(--wash-gold); }
/* Actionable status pill (rendered as a <button>): opens the set-date modal. */
.status-pill-action { border: none; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.status-pill-action:hover,
.status-pill-action:focus-visible { color: #fff; background: var(--gold-600); }
.status-draft { color: var(--ink-600); background: var(--ink-50); }
.status-open { color: var(--success); background: var(--success-bg); }
/* Semantic status pills so badges map level -> the correct colour family
   (a danger badge must read red, an info badge blue), not reuse the gold
   "sealed" style. */
.status-danger { color: var(--danger); background: var(--danger-bg); }
.status-info { color: var(--blue-700); background: var(--wash-blue); }

/* empty state */
.empty-state { text-align: center; padding: clamp(48px, 7vw, 88px) 32px; }
.empty-state .empty-ic { width: 72px; height: 72px; border-radius: var(--radius-pill); background: var(--wash-blue); color: var(--echo-blue); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 22px; }
.empty-state .empty-ic .ic { width: 34px; height: 34px; }
/* The lock is the brand mark (gold), so a lock badge wears gold rather than the
   default blue used by mail/check empty states. See the .spark-lock signature.
   Defined unscoped as well so a lock badge works outside an .empty-state parent
   (e.g. the seal screen's centred badge inside a plain .card). */
.empty-ic.is-lock,
.empty-state .empty-ic.is-lock { background: var(--wash-gold); color: var(--moment-gold); }
.empty-ic.is-lock {
  width: 72px; height: 72px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
}
.empty-ic.is-lock .ic { width: 34px; height: 34px; }
.empty-state h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); margin: 0 0 10px; }
.empty-state p { font-family: var(--font-body); color: var(--fg2); max-width: 42ch; margin: 0 auto 26px; }

/* =====================================================================
   RECORDING WIZARD
   ===================================================================== */
.wizard { max-width: 820px; margin: 0 auto; padding: 0 32px; }
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 40px; }
.stepper .step-node { display: flex; align-items: center; gap: 12px; flex: 1; }
.stepper .step-dot {
  width: 36px; height: 36px; border-radius: var(--radius-pill); flex: none;
  background: var(--surface); border: 1.5px solid var(--border-strong); color: var(--fg3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm);
}
.stepper .step-node.done .step-dot { background: var(--echo-blue); border-color: var(--echo-blue); color: #fff; }
.stepper .step-node.active .step-dot { background: var(--surface); border-color: var(--echo-blue); color: var(--echo-blue); box-shadow: 0 0 0 4px rgba(21,138,255,.14); }
.stepper .step-node .step-text { font-family: var(--font-body); font-weight: 700; font-size: var(--text-sm); color: var(--fg3); white-space: nowrap; }
.stepper .step-node.active .step-text, .stepper .step-node.done .step-text { color: var(--ink-800); }
.stepper .step-line { height: 2px; background: var(--border-strong); flex: 1; margin: 0 8px; border-radius: 2px; }
.stepper .step-node.done + .step-line { background: var(--echo-blue); }

.wizard-head { text-align: center; margin-bottom: 36px; }
.wizard-head .eyebrow { margin-bottom: 12px; }
.wizard-head h1 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); letter-spacing: -0.02em; margin: 0 0 10px; }
.wizard-head p { font-family: var(--font-body); color: var(--fg2); max-width: 50ch; margin: 0 auto; }

/* type choice cards */
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .choice-grid { grid-template-columns: repeat(2, 1fr); } }
/* small screens: a swipeable slider (cards peek to signal there's more) */
@media (max-width: 640px) {
  .choice-grid {
    display: flex; grid-template-columns: none; gap: 14px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    margin: 0 -20px; padding: 4px 20px 16px;          /* full-bleed scroll within the wrap */
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .choice-grid::-webkit-scrollbar { display: none; }
  .choice-grid .choice { flex: 0 0 78%; max-width: 320px; scroll-snap-align: center; }
}
/* swipe hint — only meaningful when the grid becomes a slider */
.choice-swipe-hint { display: none; }
@media (max-width: 640px) {
  .choice-swipe-hint {
    display: inline-flex; align-items: center; gap: 9px; margin: 0 0 14px;
    font-family: var(--font-body); font-weight: 700; font-size: var(--text-xs);
    letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg3);
  }
  .choice-swipe-hint .ic { width: 16px; height: 16px; color: var(--echo-blue); }
}

/* Per reflection-type bottom wash for the picker cards (empty-vault starter
   slider + new-memory type chooser). Mirrors the .memory-card --rt-wash map,
   each deepened with a touch of the type's main hue so the bottom blend reads
   a little stronger while staying subtle. Cards without a data-rtype fall back
   to the neutral blue wash. */
.starter-card, .choice { --rt: var(--echo-blue); --rt-ink: var(--blue-700); --rt-wash: var(--wash-blue); }
.starter-card[data-rtype="child"],       .choice[data-rtype="child"]       { --rt:#e8588f; --rt-ink:#a5285c; --rt-wash: color-mix(in srgb, #e8588f 22%, #fdeef4); }
.starter-card[data-rtype="future_self"], .choice[data-rtype="future_self"] { --rt:#7a5af0; --rt-ink:#4a32a8; --rt-wash: color-mix(in srgb, #7a5af0 22%, #f0ecfd); }
.starter-card[data-rtype="loved_one"],   .choice[data-rtype="loved_one"]   { --rt:#e2503f; --rt-ink:#a8331f; --rt-wash: color-mix(in srgb, #e2503f 22%, #fdecea); }
.starter-card[data-rtype="personal"],    .choice[data-rtype="personal"]    { --rt:#0e9c8c; --rt-ink:#0a6b60; --rt-wash: color-mix(in srgb, #0e9c8c 22%, #e6f7f4); }
.starter-card[data-rtype="advice"],      .choice[data-rtype="advice"]      { --rt:#e0a800; --rt-ink:#8f6800; --rt-wash: color-mix(in srgb, #e0a800 22%, #fff8e6); }
.starter-card[data-rtype="other"],       .choice[data-rtype="other"]       { --rt:#158aff; --rt-ink:#0a59b4; --rt-wash: color-mix(in srgb, #158aff 22%, #eef6ff); }

.choice {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px 26px; cursor: pointer; text-align: left; text-decoration: none; color: inherit;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
  display: block; position: relative; overflow: hidden;
}
/* slight bottom-up wash of the card's reflection-type hue (see --rt-wash map) */
.choice::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(0deg, var(--rt-wash, transparent) 0%, transparent 38%);
}
.choice > * { position: relative; z-index: 1; }
.choice:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue-200); }
.choice.selected { border-color: var(--echo-blue); box-shadow: 0 0 0 4px rgba(21,138,255,.12); }
.choice .choice-ic { width: 52px; height: 52px; border-radius: var(--radius-md); background: var(--wash-blue); color: var(--echo-blue); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.choice .choice-ic .ic { width: 26px; height: 26px; }
.choice h3 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); margin: 0 0 8px; }
.choice p { font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg2); margin: 0; line-height: 1.5; }

/* prompt chips */
/* the reflection-type eyebrow above the list needs breathing room */
.prompt-type-label { margin-bottom: 8px; }
/* scrollable list — shows ~5 prompts, the rest scroll. The padding keeps
   focus rings / hover lift from clipping against the scroll edge. */
.prompt-list {
  display: flex; flex-direction: column; gap: 14px;
  max-height: 392px; overflow-y: auto;
  padding: 12px 8px 12px 4px; margin: 0 -8px 0 -4px;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
  /* soft fade at the top & bottom scroll edges instead of a hard cut-off */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}
.prompt-list::-webkit-scrollbar { width: 8px; }
.prompt-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.prompt-list::-webkit-scrollbar-track { background: transparent; }
.prompt-item {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.prompt-item:hover { border-color: var(--blue-200); transform: translateX(2px); }
.prompt-item.selected { border-color: var(--echo-blue); box-shadow: 0 0 0 3px rgba(21,138,255,.12); }
.prompt-item .num { font-family: var(--font-display); font-weight: 700; color: var(--gold-500); font-size: var(--text-lg); min-width: 1.6em; }
.prompt-item p { margin: 0; font-family: var(--font-body); font-size: var(--text-md); color: var(--ink-700); }

/* recorder stage */
.recorder { text-align: center; }
.recorder-stage {
  position: relative; aspect-ratio: 16/10; border-radius: var(--radius-xl); overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, rgba(21,138,255,.18), transparent 60%), linear-gradient(180deg, var(--ink-900), var(--ink-800));
  display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.08); margin-bottom: 26px;
}
.recorder-stage .placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.recorder-stage .placeholder .ic { width: 46px; height: 46px; opacity: .8; }
/* one shared label style for BOTH the video + audio placeholders */
.stage-label { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 500; color: rgba(255,255,255,.6); letter-spacing: .03em; }
.rec-controls-hint { font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg3); letter-spacing: .03em; }
.rec-timer { position: absolute; top: 18px; left: 18px; z-index: 3; display: inline-flex; align-items: center; gap: 9px; background: rgba(0,0,0,.5); backdrop-filter: blur(6px); color: #fff; font-family: var(--font-mono); font-size: var(--text-sm); padding: 8px 14px; border-radius: var(--radius-pill); }
.rec-timer .rec-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--danger); animation: pulse-rec 1.4s var(--ease-soft) infinite; }
@keyframes pulse-rec { 0%,100%{opacity:1;} 50%{opacity:.3;} }
.rec-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 4px; }

/* record / stop button — a ring around a red shape (dot = idle/record, square = stop).
   Sits on the light card background below the stage. */
.rec-btn {
  width: 70px; height: 70px; border-radius: var(--radius-pill); cursor: pointer; flex: none;
  background: var(--surface); border: 3px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; padding: 0;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.rec-btn.start:hover { transform: scale(1.06); border-color: var(--danger); box-shadow: 0 6px 16px rgba(226,80,63,.28); }
.rec-btn:active { transform: scale(.94); }
/* the inner red shape; default a circle (record), square when stopping */
.rec-btn.start::before { content: ""; width: 30px; height: 30px; border-radius: 999px; background: var(--danger); transition: border-radius var(--dur-fast), width var(--dur-fast), height var(--dur-fast); }
.rec-btn.start.is-stop::before { width: 24px; height: 24px; border-radius: 6px; }
.rec-btn.start .ic { display: none; }  /* shape is drawn via ::before, not an icon */
/* secondary round control (restart) — light surface with an icon */
.rec-btn.secondary { width: 52px; height: 52px; background: var(--surface); color: var(--ink-700); border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm); }
.rec-btn.secondary::before { content: none; }
.rec-btn.secondary .ic { display: block; width: 22px; height: 22px; }

/* recorder tabs (Video / Audio / Upload) */
.rec-tabs { display: flex; justify-content: center; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.rec-tab {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-base);
  color: var(--fg2); background: none; border: none;
  padding: 12px 18px; position: relative; transition: color var(--dur-fast);
}
.rec-tab .ic { width: 18px; height: 18px; }
.rec-tab:hover { color: var(--ink-700); }
.rec-tab.active { color: var(--echo-blue); }
.rec-tab.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--echo-blue); border-radius: 2px; }

/* upload dropzone (inside recorder stage) */
.rec-dropzone {
  position: absolute; inset: 22px; border-radius: var(--radius-lg);
  border: 2px dashed rgba(255,255,255,.24);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: rgba(255,255,255,.6); font-family: var(--font-body); text-align: center;
}
.rec-dropzone .ic { width: 40px; height: 40px; color: rgba(255,255,255,.4); }
.rec-dropzone .formats { font-size: var(--text-xs); color: rgba(255,255,255,.35); margin-top: 4px; }
.rec-dropzone .uploaded-name { color: var(--gold-300); font-weight: 700; }

/* audio stage centerpiece */
.rec-audio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; font-family: var(--font-body); }
.rec-audio .audio-orb {
  width: 96px; height: 96px; border-radius: var(--radius-pill);
  background: rgba(21,138,255,.16); border: 1px solid rgba(255,255,255,.14);
  display: flex; align-items: center; justify-content: center; color: var(--blue-300);
}
.rec-audio .audio-orb .ic { width: 44px; height: 44px; }

/* consistent icon-in-orb used by BOTH the video and audio placeholders */
.stage-orb {
  width: 88px; height: 88px; border-radius: var(--radius-pill); flex: none;
  background: rgba(21,138,255,.16); border: 1px solid rgba(255,255,255,.14);
  display: flex; align-items: center; justify-content: center;
}
.stage-orb img { width: 42px; height: 42px; filter: brightness(0) invert(1); opacity: .92; }

/* optional image attach panel */
.attach-panel {
  margin-top: 24px; padding: 20px 22px; border: 1px solid var(--border);
  border-radius: var(--radius-md); background: var(--bg-sunk);
}
.attach-panel label.title { display: block; font-family: var(--font-body); font-weight: 700; font-size: var(--text-sm); color: var(--ink-700); }
.attach-panel .hint { font-family: var(--font-body); font-size: var(--text-xs); color: var(--fg3); margin: 2px 0 12px; }
.file-input {
  font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg2);
  width: 100%; padding: 9px 12px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer;
}
.file-input::file-selector-button {
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm);
  margin-right: 12px; padding: 7px 14px; border: none; border-radius: var(--radius-xs);
  background: var(--wash-blue); color: var(--blue-600); cursor: pointer;
}
.attach-preview { margin-top: 12px; max-height: 180px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.attach-remove { margin-top: 10px; font-family: var(--font-body); font-size: var(--text-xs); color: var(--fg2); background: none; border: none; text-decoration: underline; cursor: pointer; }

/* multi-image attach: thumbnail grid + cover selection (new_record) */
.attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; margin-top: 4px; }
.attach-grid:empty { display: none; }
.attach-thumb {
  position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer; border: 2px solid transparent; background: var(--surface);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-thumb:hover { box-shadow: var(--shadow-sm); }
.attach-thumb.is-cover { border-color: var(--echo-blue); box-shadow: 0 0 0 3px rgba(21,138,255,.16); }
.attach-thumb-x {
  position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: var(--radius-pill);
  border: none; cursor: pointer; background: rgba(14,23,38,.62); color: #fff;
  display: flex; align-items: center; justify-content: center; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.attach-thumb-x:hover { background: var(--danger); }
.attach-thumb-x .ic { width: 14px; height: 14px; }
.attach-cover-badge {
  position: absolute; left: 0; right: 0; bottom: 0; display: none;
  align-items: center; justify-content: center; gap: 5px;
  background: linear-gradient(180deg, transparent, rgba(21,138,255,.92)); color: #fff;
  font-family: var(--font-body); font-weight: 700; font-size: 10px; letter-spacing: var(--tracking-caps);
  text-transform: uppercase; padding: 12px 4px 5px;
}
.attach-cover-badge .ic { width: 11px; height: 11px; }
.attach-thumb.is-cover .attach-cover-badge { display: flex; }
.attach-add {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 12px; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm); color: var(--blue-600);
  background: var(--wash-blue); border: 1px solid var(--blue-100); border-radius: var(--radius-sm);
  padding: 10px 16px; transition: background var(--dur-fast), border-color var(--dur-fast);
}
.attach-add:hover { background: #e3f0ff; border-color: var(--blue-200); }
.attach-add .ic { width: 17px; height: 17px; }
.attach-cover-hint { display: inline-flex; align-items: center; gap: 7px; margin: 12px 0 0; font-family: var(--font-body); font-size: var(--text-xs); color: var(--fg3); }
.attach-cover-hint .ic { width: 14px; height: 14px; color: var(--gold-500); }

/* prompt recall banner on record step */
.prompt-recall { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-radius: var(--radius-md); background: var(--wash-gold); border: 1px solid var(--gold-100); margin-bottom: 24px; }
.prompt-recall .ic { width: 18px; height: 18px; color: var(--gold-600); flex: none; margin-top: 2px; }
.prompt-recall .label { font-family: var(--font-body); font-weight: 700; font-size: var(--text-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--gold-700); margin: 0 0 3px; }
.prompt-recall p { font-family: var(--font-display); font-style: italic; font-size: var(--text-md); color: var(--ink-700); margin: 0; }

/* seal-confirmation actions — stacked (primary on top, quiet cancel below),
   centered and width-capped so they sit balanced in the narrow card */
.seal-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 28px; }
.seal-actions .btn { max-width: 340px; }
.seal-actions .btn-ghost { box-shadow: none; color: var(--fg2); }
.seal-actions .btn-ghost:hover { color: var(--ink-800); background: var(--bg-sunk); transform: none; }

.hidden { display: none !important; }

/* preview / playback */
.player {
  position: relative; aspect-ratio: 16/9; border-radius: var(--radius-xl); overflow: hidden;
  background-color: var(--ink-900); background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg);
}
.player::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,15,24,.1), rgba(10,15,24,.5)); }
.player .play-btn { position: relative; z-index: 1; width: 84px; height: 84px; border-radius: var(--radius-pill); border: none; background: rgba(255,255,255,.92); color: var(--blue-700); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-lg); transition: transform var(--dur-fast); }
.player .play-btn:hover { transform: scale(1.06); }
.player .play-btn .ic { width: 34px; height: 34px; margin-left: 4px; }

/* playback image gallery (cover-first, with thumbnail strip) */
.playback-gallery-main { width: 100%; max-height: 28rem; object-fit: contain; border-radius: var(--radius-md); background: var(--bg-sunk); }
.playback-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.playback-thumb {
  width: 64px; height: 64px; padding: 0; border-radius: var(--radius-xs); overflow: hidden; cursor: pointer;
  border: 2px solid transparent; background: none; transition: border-color var(--dur-fast) var(--ease-out);
}
.playback-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.playback-thumb:hover { border-color: var(--border-strong); }
.playback-thumb.is-active { border-color: var(--echo-blue); }

.wizard-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 36px; }
.wizard-foot .spacer { flex: 1; }

/* summary list (details review) */
.summary { display: flex; flex-direction: column; gap: 0; }
.summary-row { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.summary-row:last-child { border-bottom: none; }
.summary-row .s-label { font-family: var(--font-body); font-weight: 700; font-size: var(--text-sm); color: var(--fg3); width: 140px; flex: none; text-transform: uppercase; letter-spacing: .06em; }
.summary-row .s-value { font-family: var(--font-body); font-size: var(--text-base); color: var(--fg1); }

/* =====================================================================
   FLOATING ACTION BUTTON — single "new memory" entry point
   ===================================================================== */
.fab {
  position: fixed; right: clamp(20px, 4vw, 40px); bottom: clamp(20px, 4vw, 40px);
  z-index: 60; width: 60px; height: 60px; border-radius: var(--radius-pill);
  background: var(--echo-blue); color: var(--fg-on-blue); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(21,138,255,.42); text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.fab .ic { width: 26px; height: 26px; }
.fab::after {
  content: ""; position: absolute; inset: -6px; border-radius: var(--radius-pill);
  border: 2px solid var(--spark-soft); pointer-events: none;
}
.fab:hover { background: var(--blue-600); transform: translateY(-3px) scale(1.04); box-shadow: 0 16px 36px rgba(21,138,255,.5); }
.fab:active { transform: scale(.95); }
/* tooltip label on hover */
.fab .fab-label {
  position: absolute; right: calc(100% + 14px); top: 50%; transform: translateY(-50%) translateX(6px);
  background: var(--ink-800); color: #fff; white-space: nowrap;
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm);
  padding: 8px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.fab .fab-label::after {
  content: ""; position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  border: 6px solid transparent; border-left-color: var(--ink-800);
}
.fab:hover .fab-label, .fab:focus-visible .fab-label { opacity: 1; transform: translateY(-50%) translateX(0); }
@media (prefers-reduced-motion: reduce) { .fab, .fab:hover { transition: none; transform: none; } }

/* onboarding hint pointing at the FAB — fades out on scroll, returns at top */
.fab-hint {
  position: fixed; z-index: 59; pointer-events: none;
  /* sit just above-left of the FAB (FAB is 60px at right/bottom clamp(20,4vw,40)) */
  right: clamp(40px, 5vw, 62px); bottom: clamp(92px, 11vw, 116px);
  display: flex; flex-direction: column; align-items: flex-end; gap: 0;
  text-align: right;
  /* frosted backdrop so it floats clearly above any card behind it */
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 14px 18px 10px;
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.fab-hint.is-hidden { opacity: 0; transform: translateY(8px); }
.fab-hint .hint-text {
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: clamp(1.1rem, 2vw, 1.45rem); line-height: 1.12; letter-spacing: -0.01em;
  color: var(--ink-800);
}
.fab-hint .hint-text em { font-style: italic; color: var(--echo-blue); }
.fab-hint .hint-arrow {
  width: clamp(54px, 7vw, 72px); height: auto; margin: 4px -2px 0 0;
  color: var(--echo-blue); overflow: visible;
}
.fab-hint .hint-arrow .spark {
  fill: var(--moment-gold);
}
/* onboarding hint is a large-screen-only nudge — it has no room on tablets/phones */
@media (max-width: 860px) { .fab-hint { display: none; } }
@media (prefers-reduced-motion: reduce) { .fab-hint { transition: opacity var(--dur-base) linear; } }

/* =====================================================================
   TOASTS  (parity with existing window.showToast)
   ===================================================================== */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border); border-left-width: 4px;
  box-shadow: var(--shadow-lg); border-radius: var(--radius-sm); padding: 14px 16px;
  font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg1);
  transition: opacity .3s; animation: toast-in .3s var(--ease-out);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast .ic { width: 18px; height: 18px; flex: none; }
.toast .toast-msg { flex: 1; }
.toast .toast-x { border: none; background: none; cursor: pointer; color: var(--fg3); font-size: 18px; line-height: 1; }
.toast.success { border-left-color: var(--success); } .toast.success .ic { color: var(--success); }
.toast.error { border-left-color: var(--danger); } .toast.error .ic { color: var(--danger); }
.toast.warning { border-left-color: var(--warning); } .toast.warning .ic { color: var(--gold-600); }
.toast.info { border-left-color: var(--echo-blue); } .toast.info .ic { color: var(--echo-blue); }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
/* ── Tablet & smart-display (Nest Hub Max 1280, iPad 1024/768) ─────────── */
@media (max-width: 1024px) {
  .app-wrap { padding: 0 28px; }
  .stat-strip { gap: 14px; }
}

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-mobile-top { display: flex; align-items: center; justify-content: center; padding: 22px; border-bottom: 1px solid var(--border); }
  .auth-mobile-top .logo { height: 26px; }
  .app-nav { display: none; }
  .stepper .step-node .step-text { display: none; }
}

/* ── Small tablets / large phones ──────────────────────────────────────── */
@media (max-width: 720px) {
  .app-main { padding: clamp(24px, 5vw, 40px) 0 88px; }
  .app-wrap { padding: 0 20px; }
  .app-header-inner { padding: 12px 20px; }
  .vault-hero { min-height: 0; padding: clamp(26px, 5vw, 36px); margin-bottom: 28px; }
  .vault-hero h1 { font-size: var(--text-xl); }
  /* stats sit in one compact row of three on phones, not a tall stack */
  .stat-strip { grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 30px; }
  .stat { padding: 16px 14px; }
  .stat .stat-ic { width: 34px; height: 34px; margin-bottom: 10px; }
  .stat .stat-ic .ic { width: 17px; height: 17px; }
  .stat .stat-value { font-size: var(--text-lg); }
  .stat .stat-label { font-size: var(--text-xs); }
  /* controls stack under the heading and go full width */
  .app-subhead { flex-direction: column; align-items: stretch; gap: 14px; }
  .vault-tools { width: 100%; justify-content: space-between; }
  .vault-search { flex: 1; }
  .vault-search input { width: 100%; max-width: none; }
}

/* ── Recording wizard (type / details / record) on small screens ───────── */
@media (max-width: 640px) {
  /* footer buttons must wrap, never overflow the card edge */
  .wizard-foot { flex-wrap: wrap; gap: 12px; margin-top: 28px; }
  .wizard-foot .spacer { display: none; }            /* no rigid push that forces overflow */
  .wizard-foot .btn { flex: 1 1 auto; justify-content: center; }
  .wizard-foot .btn-ghost { order: 2; }              /* Back below the primary action */
  .wizard-foot .btn-primary, .wizard-foot .btn-lg { order: 1; flex-basis: 100%; }
  .wizard-head h1 { font-size: var(--text-xl); }
  .card.pad-lg { padding: clamp(20px, 5vw, 28px); }
  /* unlock-mode pills wrap and fill the row evenly */
  [data-mode-btn] { flex: 1 1 calc(50% - 10px); }
  /* the recorder controls' preview actions (Re-record / Save) also wrap cleanly */
  .rec-controls { flex-wrap: wrap; }
  /* recorder tabs fit three across without overflow */
  .rec-tabs { gap: 0; }
  .rec-tab { padding: 12px 10px; font-size: var(--text-sm); flex: 1 1 0; justify-content: center; }
  .rec-tab .ic { width: 16px; height: 16px; }
  .rec-btn { width: 62px; height: 62px; }
  .rec-btn.secondary { width: 48px; height: 48px; }
  /* native file input can't truncate off-card */
  .file-input { font-size: var(--text-xs); padding: 8px 10px; }
  .file-input::file-selector-button { margin-right: 8px; padding: 6px 10px; }
  /* date-picker popup must stay within the viewport */
  .emw-pop { left: 0; right: 0; }
  .emw-cal { width: min(286px, calc(100vw - 56px)); }
}

/* ── Phones (iPhone 14/Pixel 7 ≈390–412, down toward SE) ───────────────── */
@media (max-width: 480px) {
  .memory-grid { grid-template-columns: 1fr; gap: 14px; }
  .vault-hero p { font-size: var(--text-sm); }
  .recorder-stage { aspect-ratio: 4 / 3; }           /* a little taller/narrower so the preview + label fit */
}

/* ── iPhone SE and the narrowest viewports (375 and below) ─────────────── */
@media (max-width: 380px) {
  .app-wrap { padding: 0 14px; }
  .app-header-inner { padding: 11px 14px; }
  .vault-hero { padding: 22px; }
  .vault-hero h1 { font-size: var(--text-lg); }
  /* three tiny stats still fit; tighten further */
  .stat-strip { gap: 8px; }
  .stat { padding: 13px 10px; }
  .stat .stat-value { font-size: var(--text-md); }
  .fab { width: 54px; height: 54px; right: 18px; bottom: 18px; }
  .fab .ic { width: 23px; height: 23px; }
}

/* =====================================================================
   VAULT EMPTY STATE — starter reflection cards in a slider
   ===================================================================== */
.empty-intro { text-align: center; margin: clamp(36px,6vw,64px) auto 30px; max-width: 56ch; }
.empty-intro .spark { margin: 0 auto 20px; }
.empty-intro .eyebrow { margin-bottom: 12px; }
.empty-intro h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); color: var(--fg1); margin: 0 0 12px; letter-spacing: -0.02em; }
.empty-intro p { font-family: var(--font-body); color: var(--fg2); margin: 0 auto; max-width: 48ch; line-height: 1.55; }

/* slider shell (reuses carousel.js: [data-carousel] + [data-prev]/[data-next] + [data-track]) */
.starter-slider { position: relative; }
.starter-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.starter-controls .hint { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-family: var(--font-body); font-weight: 700; font-size: var(--text-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg3); }
.starter-controls .hint .ic { width: 16px; height: 16px; color: var(--echo-blue); }
.starter-arrows { display: flex; gap: 10px; }
.starter-arrow { width: 44px; height: 44px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-700); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: color var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast), opacity var(--dur-fast); }
.starter-arrow:hover:not(:disabled) { color: var(--echo-blue); border-color: var(--echo-blue); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.starter-arrow:active:not(:disabled) { transform: scale(.94); }
.starter-arrow:disabled { opacity: .34; cursor: not-allowed; }
.starter-arrow .ic { width: 20px; height: 20px; }

.starter-track {
  display: flex; gap: 20px; align-items: stretch;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 6px 4px 22px; margin: -6px -4px 0;
  scrollbar-width: none; -ms-overflow-style: none;
}
.starter-track::-webkit-scrollbar { display: none; }
.starter-track.dragging { scroll-behavior: auto; scroll-snap-type: none; cursor: grabbing; }
.starter-track.dragging * { cursor: grabbing; }

/* each card is a <form> wrapping a full-bleed <button.starter-card> that POSTs the type */
.starter-slide { scroll-snap-align: start; flex: 0 0 auto; width: clamp(260px, 70vw, 300px); margin: 0; display: flex; }
.starter-card {
  position: relative; overflow: hidden;
  width: 100%; cursor: pointer; font: inherit; text-align: left;
  display: flex; flex-direction: column; color: inherit;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px 26px; box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
/* slight bottom-up wash of the card's reflection-type hue (see --rt-wash map) */
.starter-card::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(0deg, var(--rt-wash, transparent) 0%, transparent 38%);
}
.starter-card > * { position: relative; z-index: 1; }
.starter-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--blue-200); }
.starter-card .s-ic { width: 52px; height: 52px; border-radius: var(--radius-md); background: var(--wash-blue); color: var(--echo-blue); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.starter-card .s-ic .ic { width: 26px; height: 26px; }
.starter-card h3 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); margin: 0 0 8px; color: var(--fg1); }
.starter-card p { font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg2); margin: 0 0 16px; line-height: 1.5; flex: 1; }
.starter-card .s-go { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-weight: 700; font-size: var(--text-sm); color: var(--blue-600); }
.starter-card .s-go .ic { width: 15px; height: 15px; }

.starter-foot { text-align: center; margin-top: 22px; }
.starter-foot .link-sm { font-size: var(--text-base); }

/* =====================================================================
   CUSTOM WIDGETS — branded date picker + select (em-widgets.js)
   The native field stays in the DOM as the value source but is hidden.
   ===================================================================== */
.emw { position: relative; }
.emw .emw-native {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); border: 0;
}
/* trigger looks exactly like an .input field */
.emw-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--font-body); font-size: var(--text-base); color: var(--fg1); text-align: left;
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 13px 16px; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.emw-trigger:hover { border-color: var(--ink-300); }
.emw-trigger:focus-visible { outline: none; border-color: var(--echo-blue); box-shadow: 0 0 0 4px rgba(21,138,255,.14); }
.emw-pop.is-open ~ .emw-trigger, .emw-pop.is-open + .emw-trigger { }
.emw .emw-trigger > .ic { width: 18px; height: 18px; color: var(--fg3); flex: none; }
.emw-trigger .emw-val.is-placeholder { color: var(--fg3); }
.emw .emw-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* shared popup */
.emw-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 70;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  display: none;
}
.emw-pop.is-open { display: block; animation: emw-pop-in var(--dur-fast) var(--ease-out); }
/* flip above the field when there's no room below (e.g. low inside a modal) */
.emw-pop.is-up { top: auto; bottom: calc(100% + 6px); }
@keyframes emw-pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---- calendar ---- */
.emw-cal { width: 286px; padding: 14px; }
.emw-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.emw-cal-titlewrap { display: inline-flex; align-items: baseline; gap: 6px; }
.emw-cal-title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-base); color: var(--fg1); }
/* month-name / year in the header are clickable to open the month / year grids */
.emw-cal-title-btn { border: none; background: none; cursor: pointer; padding: 2px 5px; border-radius: var(--radius-xs); }
.emw-cal-title-btn:hover { background: var(--wash-blue); color: var(--blue-700); }
.emw-cal-nav { display: flex; gap: 4px; }
.emw-nav { width: 30px; height: 30px; border: none; background: none; border-radius: var(--radius-xs); cursor: pointer; color: var(--fg2); display: flex; align-items: center; justify-content: center; }
.emw-nav:hover:not(:disabled) { background: var(--bg-sunk); color: var(--ink-800); }
.emw-nav:disabled { color: var(--ink-200); cursor: not-allowed; }
.emw-nav .ic { width: 17px; height: 17px; }
.emw-cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.emw-cal-dow span { text-align: center; font-family: var(--font-body); font-weight: 700; font-size: var(--text-xs); color: var(--fg3); padding: 4px 0; }
.emw-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.emw-day {
  aspect-ratio: 1; border: none; background: none; cursor: pointer; border-radius: var(--radius-xs);
  font-family: var(--font-body); font-size: var(--text-sm); color: var(--ink-700);
  display: flex; align-items: center; justify-content: center;
}
.emw-day:hover:not(:disabled):not(.is-empty) { background: var(--wash-blue); color: var(--blue-700); }
.emw-day.is-empty { cursor: default; }
.emw-day.is-today { font-weight: 700; color: var(--echo-blue); }
.emw-day.is-selected { background: var(--echo-blue); color: #fff; font-weight: 700; }
.emw-day.is-selected:hover { background: var(--blue-600); color: #fff; }
.emw-day:disabled { color: var(--ink-200); cursor: not-allowed; }

/* month + year pickers: 3-column grids reusing the day-cell look */
.emw-cal-months, .emw-cal-years { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.emw-mo, .emw-yr {
  border: none; background: none; cursor: pointer; border-radius: var(--radius-xs);
  font-family: var(--font-body); font-size: var(--text-sm); color: var(--ink-700);
  padding: 12px 0; display: flex; align-items: center; justify-content: center;
}
.emw-mo:hover:not(:disabled), .emw-yr:hover:not(:disabled) { background: var(--wash-blue); color: var(--blue-700); }
.emw-mo.is-current, .emw-yr.is-current { font-weight: 700; color: var(--echo-blue); }
.emw-mo.is-selected, .emw-yr.is-selected { background: var(--echo-blue); color: #fff; font-weight: 700; }
.emw-mo.is-selected:hover, .emw-yr.is-selected:hover { background: var(--blue-600); color: #fff; }
.emw-mo:disabled, .emw-yr:disabled { color: var(--ink-200); cursor: not-allowed; }

.emw-cal-foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.emw-link { border: none; background: none; cursor: pointer; font-family: var(--font-body); font-weight: 700; font-size: var(--text-sm); color: var(--blue-600); padding: 4px 6px; border-radius: var(--radius-xs); }
.emw-link:hover { background: var(--wash-blue); }

/* ---- select menu ---- */
.emw-menu { min-width: 100%; max-height: 280px; overflow-y: auto; padding: 6px; }
.emw-opt {
  display: block; width: 100%; text-align: left; border: none; background: none; cursor: pointer;
  font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg1);
  padding: 10px 12px; border-radius: var(--radius-xs);
}
.emw-opt:hover { background: var(--bg-sunk); }
.emw-opt.is-active { background: var(--wash-blue); color: var(--blue-700); font-weight: 700; }

/* visually-hidden but accessible to screen readers (replaces the old Tailwind utility) */
.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;
}

/* =====================================================================
   "OPENING A MOMENT" — seal-breaking animation before playback
   ===================================================================== */
.unseal-overlay { background: rgba(10,15,24,.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.unseal-stage { display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; }
.unseal-seal { position: relative; width: 132px; height: 132px; display: flex; align-items: center; justify-content: center; }

/* concentric rings that pulse outward */
.unseal-rings, .unseal-rings::before, .unseal-rings::after {
  position: absolute; left: 50%; top: 50%; width: 92px; height: 92px;
  border-radius: 999px; border: 2px solid var(--gold-400); transform: translate(-50%,-50%);
  opacity: 0;
}
.unseal-rings { animation: unseal-ring 1.8s var(--ease-out) .15s forwards; }
.unseal-rings::before { content: ""; animation: unseal-ring 1.8s var(--ease-out) .35s forwards; }
.unseal-rings::after  { content: ""; animation: unseal-ring 1.8s var(--ease-out) .55s forwards; }
@keyframes unseal-ring {
  0% { opacity: .7; width: 92px; height: 92px; }
  100% { opacity: 0; width: 190px; height: 190px; }
}

/* the gold wax-seal disc */
.unseal-disc {
  position: relative; z-index: 2; width: 92px; height: 92px; border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  color: var(--ink-900); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px rgba(249,192,11,.5), inset 0 -3px 8px rgba(143,104,0,.4);
  animation: unseal-disc-pop .5s var(--ease-spring) both;
}
@keyframes unseal-disc-pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.unseal-disc .ic { position: absolute; width: 40px; height: 40px; }
/* lock fades/rotates out, lock-open fades in — the "break" */
.unseal-lock { animation: unseal-lock-out .4s var(--ease-out) .55s both; }
.unseal-open { opacity: 0; animation: unseal-open-in .5s var(--ease-spring) .95s both; }
@keyframes unseal-lock-out { 0% { opacity: 1; transform: scale(1) rotate(0); } 100% { opacity: 0; transform: scale(.6) rotate(-18deg); } }
@keyframes unseal-open-in  { 0% { opacity: 0; transform: scale(.5); } 60% { transform: scale(1.15); } 100% { opacity: 1; transform: scale(1); } }

/* gold burst flash at the moment it opens */
.unseal-burst {
  position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; transform: translate(-50%,-50%);
  border-radius: 999px; background: radial-gradient(circle, rgba(255,247,225,.95), rgba(249,192,11,.5) 40%, transparent 70%);
  opacity: 0; animation: unseal-burst .6s var(--ease-out) .95s forwards;
}
@keyframes unseal-burst { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.3); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-50%) scale(9); } }

.unseal-title {
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg);
  color: #fff; margin: 0; letter-spacing: -0.01em;
  opacity: 0; animation: unseal-text .5s var(--ease-out) .9s both;
}
@keyframes unseal-text { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .unseal-rings, .unseal-rings::before, .unseal-rings::after,
  .unseal-disc, .unseal-lock, .unseal-open, .unseal-burst, .unseal-title { animation: none; }
  .unseal-lock { display: none; } .unseal-open { opacity: 1; } .unseal-title { opacity: 1; }
}

/* =====================================================================
   FIRST-LOGIN WELCOME — warm greeting shown once per browser
   ===================================================================== */
.welcome-overlay { background: rgba(14,23,38,.55); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.welcome-card {
  position: relative; width: 100%; max-width: 480px; text-align: center;
  background: var(--surface); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); padding: clamp(36px, 5vw, 48px) clamp(28px, 4vw, 40px) clamp(32px, 4vw, 40px);
  animation: welcome-rise .6s var(--ease-out) both;
}
@keyframes welcome-rise { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.welcome-ic {
  width: 72px; height: 72px; border-radius: var(--radius-pill); margin: 0 auto 22px;
  background: var(--wash-gold); color: var(--gold-600);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 8px rgba(224,168,0,.08);
}
.welcome-ic .ic { width: 32px; height: 32px; }
.welcome-eyebrow {
  font-family: var(--font-body); font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  font-size: var(--text-xs); color: var(--gold-600); margin: 0 0 10px;
}
.welcome-card h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); color: var(--fg1); margin: 0 0 14px; line-height: 1.25; }
.welcome-body { font-family: var(--font-body); font-size: var(--text-base); color: var(--fg2); line-height: 1.65; margin: 0 0 16px; }
.welcome-card .btn { margin-top: 8px; }
.welcome-sig { font-family: var(--font-body); font-style: italic; color: var(--fg3); font-size: var(--text-sm); margin: 22px 0 0; }
@media (prefers-reduced-motion: reduce) { .welcome-card { animation: none; } }


/* =====================================================================
   VAULT DASHBOARD — empty state, "add vault" card, and the wide
   two-step create modal. Reuses the design tokens above.
   ===================================================================== */

/* Empty dashboard: a calm invitation to make the first vault. */
.vault-empty { text-align: center; max-width: 520px; margin: clamp(40px, 9vh, 100px) auto 0; }
.vault-empty-orb {
  width: 84px; height: 84px; border-radius: var(--radius-pill); margin: 0 auto 22px;
  background: var(--wash-gold); color: var(--gold-600);
  display: flex; align-items: center; justify-content: center;
}
.vault-empty-orb .ic { width: 38px; height: 38px; }
.vault-empty h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); color: var(--fg1); margin: 0 0 10px; }
.vault-empty .sub { font-family: var(--font-body); font-size: var(--text-base); color: var(--fg2); line-height: 1.6; margin: 0 0 26px; }

/* "New vault" tile that lives at the end of the memory grid. */
.memory-card-add {
  border: 2px dashed var(--border); background: var(--bg-sunk);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--fg2);
  font-family: var(--font-body); font-weight: 700;
  transition: border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.memory-card-add::after { content: none; }   /* no gradient veil on the add tile */
.memory-card-add:hover { border-color: var(--gold-500); color: var(--gold-600); transform: translateY(-4px); }
.add-inner { display: inline-flex; align-items: center; gap: 8px; }
.add-inner .ic { width: 18px; height: 18px; }

/* Wide modal variant for the multi-field create flow (base modal is a
   narrow, centered confirmation dialog). */
.modal-card-wide {
  max-width: 780px; text-align: left;
  /* Cap height to the viewport, but DON'T clip with overflow:auto — that traps
     the absolutely-positioned date popup and forces a stray scrollbar. The
     calendar flips up (.emw-pop.is-up) when low, so it stays on-screen. */
  max-height: 92vh; overflow: visible;
}
.modal-card-wide h2 { text-align: left; }
.modal-card-wide .modal-sub { text-align: left; margin-bottom: 22px; }

/* ── Settings modal (Account ▸ Billing two-pane layout) ───────────────── */
.settings-layout { display: flex; gap: 28px; margin-top: 18px; }
.settings-sidebar { flex: 0 0 160px; border-right: 1px solid var(--border); padding-right: 18px; }
.settings-section-label { font-family: var(--font-body); font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fg3); margin: 0 0 8px; }
.settings-nav-item {
  display: block; width: 100%; text-align: left; font-family: var(--font-body); font-size: var(--text-sm);
  background: transparent; border: none; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--fg2); cursor: pointer;
}
.settings-nav-item.is-active { background: var(--bg-sunk); color: var(--fg1); font-weight: 700; }
.settings-panel { flex: 1 1 auto; min-width: 0; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.settings-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settings-row-title { font-family: var(--font-body); font-weight: 700; font-size: var(--text-base); color: var(--fg1); }
.settings-row-sub {
  font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg2); line-height: 1.5;
}
.settings-reactivate-link {
  display: inline-block; margin-top: 10px;
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 700;
  color: var(--echo-blue); text-decoration: none;
  /* Rendered as a <button> (POSTs to billing:resume) — reset native chrome so
     it still reads as a text link. */
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer;
}
.settings-reactivate-link:hover { text-decoration: underline; }
/* Keep the action button on one line: don't let the flex row shrink it or wrap
   its label. Use the compact button padding/size within this settings row. */
.settings-row .btn {
  flex: 0 0 auto; white-space: nowrap;
  padding: 10px 20px; font-size: var(--text-sm);
}
@media (max-width: 640px) {
  .settings-layout { flex-direction: column; }
  .settings-sidebar { flex-basis: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 14px; }
}

/* ── Numbered stepper at the top of the create-vault modal ───────────── */
.stepper {
  list-style: none; margin: 0 0 26px; padding: 0;
  display: flex; align-items: center; gap: 0;
}
.stepper-step {
  display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0;
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 600; color: var(--fg3);
}
/* connector line between steps */
.stepper-step:not(:last-child)::after {
  content: ""; flex: 1; height: 2px; margin: 0 12px; border-radius: 2px;
  background: var(--border); transition: background var(--dur-base) var(--ease-out);
}
.stepper-dot {
  flex: none; width: 28px; height: 28px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-sunk); color: var(--fg3); border: 1.5px solid var(--border);
  font-size: var(--text-sm); font-weight: 700;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.stepper-label { white-space: nowrap; }
/* active step: filled blue dot + dark label */
.stepper-step.is-active .stepper-dot { background: var(--echo-blue); color: #fff; border-color: var(--echo-blue); }
.stepper-step.is-active { color: var(--fg1); }
/* completed step: blue-tinted dot + filled connector */
.stepper-step.is-done .stepper-dot { background: var(--wash-blue); color: var(--echo-blue); border-color: transparent; }
.stepper-step.is-done::after { background: var(--echo-blue); }
@media (max-width: 560px) {
  .stepper-label { display: none; }
  .stepper-step:not(:last-child)::after { margin: 0 8px; }
}

/* ── Release-date mode tiles (replaces the bulky pills) — 2×2 icon cards ── */
.mode-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mode-tile {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px 16px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md);
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm); color: var(--fg1);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.mode-tile:hover { border-color: var(--blue-200); box-shadow: var(--shadow-sm); }
.mode-tile .mode-tile-ic {
  flex: none; width: 34px; height: 34px; border-radius: var(--radius-sm, 8px);
  display: flex; align-items: center; justify-content: center;
  background: var(--wash-blue); color: var(--echo-blue);
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.mode-tile .mode-tile-ic .ic { width: 18px; height: 18px; }
.mode-tile.selected {
  border-color: var(--echo-blue); background: var(--wash-blue);
  box-shadow: 0 0 0 3px rgba(21,138,255,.12);
}
.mode-tile.selected .mode-tile-ic { background: var(--echo-blue); color: #fff; }

/* Fifth tile: "decide later" — spans both columns, with a supporting hint line */
.mode-tile-wide { grid-column: 1 / -1; align-items: flex-start; }
.mode-tile-text { display: flex; flex-direction: column; gap: 3px; }
.mode-tile-wide .mode-tile-hint {
  font-weight: 400; font-size: var(--text-xs); color: var(--fg2); line-height: 1.45;
}
.mode-tile-wide.selected .mode-tile-hint { color: color-mix(in srgb, var(--echo-blue) 70%, var(--fg1)); }

/* Breathing room between the mode tiles and the active mode pane below them. */
[data-mode-pane] { padding-top: 8px; }

@media (max-width: 480px) { .mode-tiles { grid-template-columns: 1fr; } }

/* Tighter choice grid inside the modal (the wizard version is full-page). */
.choice-grid-compact { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.choice-grid-compact .choice { padding: 16px 18px; }
/* tighter icon + smaller wash so the compact card isn't hollow */
.choice-grid-compact .choice .choice-ic { width: 40px; height: 40px; margin-bottom: 12px; }
.choice-grid-compact .choice .choice-ic .ic { width: 20px; height: 20px; }
.choice-grid-compact .choice h3 { font-size: var(--text-base); margin: 0 0 4px; }
.choice-grid-compact .choice p { font-size: var(--text-xs); line-height: 1.45; }
.choice-grid-compact .choice::after { background: linear-gradient(0deg, var(--rt-wash, transparent) 0%, transparent 60%); }
/* selected-state check badge (top-right), shown only when the card is chosen */
.choice-check {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 22px; height: 22px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--echo-blue); color: #fff;
  opacity: 0; transform: scale(.6); transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.choice-check .ic { width: 14px; height: 14px; }
.choice.selected .choice-check { opacity: 1; transform: scale(1); }
@media (max-width: 560px) { .choice-grid-compact { grid-template-columns: 1fr; } }
.vault-empty-count { display: inline-flex; margin: 0 auto 20px; background: var(--bg-sunk); color: var(--fg2); }

/* Inline error summary shown at the top of the create-vault modal's details
   step when a submit comes back invalid (so it's never hidden below the fold). */
.form-error-summary {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 18px; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 600;
}
.form-error-summary .ic { width: 18px; height: 18px; flex: none; }

/* Walkthrough nudge inside the welcome banner (first-visit only). */
.vault-hero-link {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 20px;
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm);
  color: #fff; text-decoration: none; padding: 8px 14px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .16); transition: background var(--dur-base) var(--ease-out);
}
.vault-hero-link:hover { background: rgba(255, 255, 255, .26); }
.vault-hero-link .ic { width: 16px; height: 16px; }

/* =====================================================================
   VAULT DETAIL PAGE — header + moments grid
   ===================================================================== */
/* Reflection-type hue map, shared by the detail header and moment cards. */
.vault-head[data-rtype="child"],       .moment-card[data-rtype="child"]       { --rt:#e8588f; --rt-ink:#a5285c; --rt-wash:#fdeef4; }
.vault-head[data-rtype="future_self"], .moment-card[data-rtype="future_self"] { --rt:#7a5af0; --rt-ink:#4a32a8; --rt-wash:#f0ecfd; }
.vault-head[data-rtype="loved_one"],   .moment-card[data-rtype="loved_one"]   { --rt:#e2503f; --rt-ink:#a8331f; --rt-wash:#fdecea; }
.vault-head[data-rtype="personal"],    .moment-card[data-rtype="personal"]    { --rt:#0e9c8c; --rt-ink:#0a6b60; --rt-wash:#e6f7f4; }
.vault-head[data-rtype="advice"],      .moment-card[data-rtype="advice"]      { --rt:#e0a800; --rt-ink:#8f6800; --rt-wash:#fff8e6; }
.vault-head[data-rtype="other"],       .moment-card[data-rtype="other"]       { --rt:#158aff; --rt-ink:#0a59b4; --rt-wash:#eef6ff; }
.vault-head, .moment-card { --rt: var(--echo-blue); --rt-ink: var(--blue-700); --rt-wash: var(--wash-blue); }

/* Header band: a soft type-tinted card with the glyph as a watermark. */
.vault-head {
  position: relative; overflow: hidden; margin: 18px 0 18px;
  display: flex; align-items: flex-start; gap: 20px;
  padding: clamp(24px, 3vw, 34px); border-radius: var(--radius-xl);
  background: linear-gradient(135deg, color-mix(in srgb, var(--rt) 14%, var(--surface)), var(--surface) 70%);
  border: 1px solid var(--border);
}
.vault-head-glyph {
  flex: none; width: 58px; height: 58px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  background: var(--rt-wash); color: var(--rt-ink);
}
.vault-head-glyph .ic { width: 28px; height: 28px; }
.vault-head-main { flex: 1; min-width: 0; }
.vault-head-main h1 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); color: var(--fg1); margin: 0 0 6px; letter-spacing: -0.02em; }
.vault-head-meta { font-family: var(--font-body); font-size: var(--text-base); color: var(--fg2); margin: 0; }
.vault-head-desc { font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg2); margin: 10px 0 0; line-height: 1.55; }
.vault-head-status { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Live countdown to a sealed vault's release date. Pinned to the right of the
   banner (a direct flex child of .vault-head, which keeps .vault-head-main at
   flex:1 on the left). */
.countdown { flex: none; align-self: flex-start; display: flex; gap: clamp(12px, 2vw, 22px); }
.countdown-cell { display: flex; flex-direction: column; align-items: center; }

/* Odometer digit window: a fixed-size clipped box showing one line. On update the
   inner reel (current value + incoming value stacked above it) slides down so the
   new number rolls in from the top, like a mechanical meter. */
.countdown-num {
  /* Fixed width so digit changes (e.g. 9 → 10) never shift the layout. h/m/s are
     always 2 zero-padded digits; days can run to 3 (a year+ out). */
  --cd-line: clamp(1.7rem, 4vw, 2.4rem);
  display: block; width: 2.2ch; height: var(--cd-line);
  overflow: hidden; position: relative;
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--cd-line); line-height: var(--cd-line);
  color: var(--fg1); font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.countdown-num[data-cd="days"] { width: 3.4ch; }
.countdown-reel {
  display: flex; flex-direction: column;
  /* Start showing the bottom line (current value); the incoming value sits above. */
  transform: translateY(calc(var(--cd-line) * -1));
}
.countdown-reel > span { display: block; height: var(--cd-line); text-align: center; }
.countdown-num.is-rolling .countdown-reel {
  transform: translateY(0);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) {
  .countdown-num.is-rolling .countdown-reel { transition: none; }
}
.countdown-label {
  margin-top: 6px; font-family: var(--font-body); font-size: var(--text-xs);
  color: var(--fg2); text-transform: lowercase; letter-spacing: var(--tracking-caps);
}
.vault-head-action { flex: none; white-space: nowrap; }
.status-muted { background: var(--bg-sunk); color: var(--fg2); }
.status-sealed { background: var(--wash-gold); color: var(--gold-600); }
.vault-locked-note { display: flex; align-items: center; gap: 8px; margin: 0 0 26px; }
.vault-locked-note .ic { width: 15px; height: 15px; flex: none; }
@media (max-width: 620px) {
  .vault-head { flex-wrap: wrap; }
  .vault-head-action { width: 100%; justify-content: center; }
  /* Countdown drops below the content and reads left-aligned on small screens. */
  .countdown { width: 100%; margin-top: 4px; justify-content: flex-start; }
}

/* Moments grid: same card language as the dashboard, a touch smaller. */
.moment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.moment-card {
  position: relative; display: block; overflow: hidden; text-decoration: none; color: #fff;
  aspect-ratio: 1 / 1; min-height: 180px;
  border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.moment-card[href]:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.moment-card-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(95% 75% at 78% 12%, rgba(255,255,255,.24), transparent 60%),
    linear-gradient(160deg, var(--rt) 0%, var(--rt-ink) 80%);
  /* An inline background-image cover, when present, layers over the gradient
     fallback. Size/position live here so the shorthand above can't reset them. */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.moment-card.is-sealed .moment-card-bg { filter: saturate(.82) brightness(.92); }
.moment-card-glyph { position: absolute; right: 10px; top: 8px; z-index: 1; color: rgba(255,255,255,.18); display: flex; }
.moment-card-glyph .ic { width: 84px; height: 84px; }
.moment-card::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 35%, rgba(8,12,20,.62) 100%);
}
.moment-card-corner, .moment-card-play {
  position: absolute; z-index: 3; right: 12px; top: 12px;
  width: 32px; height: 32px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.22); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff; border: 1px solid rgba(255,255,255,.32);
}
.moment-card-corner .ic, .moment-card-play .ic { width: 16px; height: 16px; }
/* The sealed-moment corner badge carries the lock, which is the brand mark, so
   it wears gold (the play badge beside it stays neutral white-on-glass). */
.moment-card-corner.is-lock { color: var(--moment-gold); }
.moment-card-overlay { position: absolute; z-index: 2; inset: auto 0 0 0; padding: 14px 14px 16px; }
.moment-card-overlay h3 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); color: #fff; margin: 0; line-height: 1.2; text-shadow: 0 1px 10px rgba(0,0,0,.3); }
.moment-card-sub { font-family: var(--font-body); font-size: var(--text-xs); color: rgba(255,255,255,.82); margin: 3px 0 0; }
/* add tile */
.moment-card-add {
  border: 2px dashed var(--border); background: var(--bg-sunk); color: var(--fg2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-weight: 700;
  transition: border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.moment-card-add::after { content: none; }
.moment-card-add:hover { border-color: var(--gold-500); color: var(--gold-600); transform: translateY(-4px); }

/* Storage meter in the vault header (owner only). */
.storage-meter { margin-top: 16px; max-width: 320px; }
.storage-meter-bar {
  height: 7px; border-radius: 999px; background: var(--bg-sunk); overflow: hidden;
  border: 1px solid var(--border);
}
.storage-meter-bar span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--echo-blue), var(--blue-500));
  transition: width var(--dur-base) var(--ease-out);
}
.storage-meter-label { display: block; margin-top: 6px; font-family: var(--font-body); font-size: var(--text-xs); color: var(--fg3); }

/* Empty-vault first-moment tile (shown only when there are no moments). */
.moment-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px; padding: clamp(32px, 6vw, 56px) 24px; max-width: 460px; margin: 8px 0;
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  background: var(--bg-sunk); text-decoration: none; cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.moment-empty:hover { border-color: var(--gold-500); transform: translateY(-3px); }
.moment-empty-orb {
  width: 52px; height: 52px; border-radius: var(--radius-pill); margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--wash-gold); color: var(--gold-600);
}
.moment-empty-orb .ic { width: 24px; height: 24px; }
.moment-empty-title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); color: var(--fg1); }
.moment-empty-sub { font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg2); line-height: 1.5; }

/* =====================================================================
   MOMENTS TOOLBAR + LIST VIEW + SPEED-DIAL FAB (vault detail)
   ===================================================================== */
.moment-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 20px;
}
.moment-search {
  position: relative; flex: 1; min-width: 220px;
  display: flex; align-items: center;
}
.moment-search .ic { position: absolute; left: 14px; width: 17px; height: 17px; color: var(--fg3); pointer-events: none; }
.moment-search input {
  width: 100%; padding: 11px 14px 11px 40px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg1);
}
.moment-search input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(21,138,255,.12); }
.moment-tools { display: flex; align-items: center; gap: 10px; }
.moment-sort .select { min-width: 150px; }

/* sealed moment cards are <button>s now — reset native button chrome */
button.moment-card { width: 100%; text-align: left; font: inherit; cursor: pointer; }

/* List view: cards reflow into compact horizontal rows. */
/* List view: clean neutral rows — a small type-tinted thumbnail on the left,
   dark title + sub text on a surface row, and the status/lock pulled right.
   (Reads like a real list rather than a full-bleed colored banner.) */
.moment-grid.is-list { display: flex; flex-direction: column; gap: 8px; }
.moment-grid.is-list .moment-card {
  aspect-ratio: auto; min-height: 0; height: 64px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px 0 0; overflow: hidden;
  /* Soft tint of the row's own reflection-type hue (not flat white), so rows
     stand off the near-white page and read as cards. --rt is set per row via
     data-rtype; ~12% over the surface gives a gentle lavender/pink/etc. wash. */
  background: color-mix(in srgb, var(--rt) 12%, var(--surface));
  color: var(--fg1);
  border: 1px solid color-mix(in srgb, var(--rt) 22%, var(--border));
  box-shadow: var(--shadow-xs);
}
.moment-grid.is-list .moment-card:hover {
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
  background: color-mix(in srgb, var(--rt) 18%, var(--surface));
  border-color: color-mix(in srgb, var(--rt) 38%, var(--border));
}
/* No gradient block in list view (a dark thumbnail leaves a visible seam
   against the soft row tint). Instead, drop the gradient surface and show the
   glyph in a soft rounded badge — same hue family as the row, so it blends. */
.moment-grid.is-list .moment-card-bg { display: none; }
.moment-grid.is-list .moment-card::after { content: none; }   /* no full-card scrim in list mode */
.moment-grid.is-list .moment-card-glyph {
  position: static; flex: none; order: 0; transform: none;
  width: 40px; height: 40px; margin-left: 14px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--rt) 26%, var(--surface));
  color: var(--rt-ink);
}
.moment-grid.is-list .moment-card-glyph .ic { width: 20px; height: 20px; }
/* text block flows after the thumbnail, dark on the neutral row */
.moment-grid.is-list .moment-card-overlay { position: static; flex: 1; min-width: 0; padding: 0; order: 1; }
.moment-grid.is-list .moment-card-overlay h3 {
  font-size: var(--text-md); color: var(--fg1); text-shadow: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.moment-grid.is-list .moment-card-sub { color: var(--fg2); }
.moment-grid.is-list .moment-card-sub .ic { color: var(--fg3); }
/* status / lock / play pulled to the right edge, as a quiet chip */
.moment-grid.is-list .moment-card-corner,
.moment-grid.is-list .moment-card-play {
  position: static; flex: none; transform: none; margin-left: auto; order: 2;
  width: 32px; height: 32px;
  background: var(--surface); color: var(--fg2); border: 1px solid var(--border);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
/* Keep the brand gold on the lock chip in list view too (matching specificity
   so it isn't reset to --fg2 by the rule above). */
.moment-grid.is-list .moment-card-corner.is-lock { color: var(--moment-gold); }
.moment-grid.is-list .moment-card-play { color: var(--echo-blue); }

/* ── Speed-dial FAB (radial "flower") ───────────────────────────────────
   The toggle sits in the corner; petals fan out on a quarter-circle arc
   (up and to the left) when open. Each petal animates from the toggle's
   centre to its arc position. --r is the arc radius. */
.speed-dial { position: fixed; right: 28px; bottom: 28px; z-index: 60; width: 60px; height: 60px; }
.speed-dial-toggle {
  position: absolute; right: 0; bottom: 0; z-index: 2;
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.speed-dial .speed-dial-plus { transition: transform var(--dur-base) var(--ease-out); }
.speed-dial.is-open .speed-dial-toggle { background: var(--blue-700); }
.speed-dial.is-open .speed-dial-plus { transform: rotate(135deg); }   /* + → × */

.speed-dial-petals { position: absolute; right: 7px; bottom: 7px; z-index: 1; }
.speed-dial-petal {
  --r: 104px;
  position: absolute; right: 0; bottom: 0;
  width: 46px; height: 46px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--echo-blue);
  border: 1px solid var(--border); box-shadow: var(--shadow-md); text-decoration: none;
  opacity: 0; pointer-events: none; transform: translate(0, 0) scale(.5);
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.speed-dial-petal .ic { width: 20px; height: 20px; }
.speed-dial-petal:hover { background: var(--echo-blue); color: #fff; border-color: var(--echo-blue); }
/* Fan out along a quarter arc: straight up, up-left 45°, straight left.
   (Works for up to 3 petals; with 2 it uses the first two angles.) */
.speed-dial.is-open .speed-dial-petal { opacity: 1; pointer-events: auto; }
.speed-dial.is-open .speed-dial-petal:nth-child(1) { transform: translate(0, calc(-1 * var(--r))) scale(1); }
.speed-dial.is-open .speed-dial-petal:nth-child(2) { transform: translate(calc(-0.707 * var(--r)), calc(-0.707 * var(--r))) scale(1); }
.speed-dial.is-open .speed-dial-petal:nth-child(3) { transform: translate(calc(-1 * var(--r)), 0) scale(1); }

/* Hover tooltip (the one-liner) to the upper-left of each petal. */
.speed-dial-petal::after {
  content: attr(data-tip); position: absolute; right: calc(100% + 10px); top: 50%;
  transform: translateY(-50%); white-space: nowrap;
  background: var(--ink-800); color: #fff; font-family: var(--font-body); font-weight: 600; font-size: var(--text-xs);
  padding: 5px 10px; border-radius: var(--radius-sm, 8px); box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-fast);
}
.speed-dial-petal:hover::after { opacity: 1; }
@media (max-width: 560px) { .speed-dial { right: 18px; bottom: 18px; } }

/* =====================================================================
   UNIFIED CARD LANGUAGE — one soft, type-tinted look across dashboard
   vault cards, detail moment cards, list rows and reflection tiles.
   (Overrides the older bold-gradient treatment; source-order wins.)
   ===================================================================== */

/* ---- Dashboard vault cards + detail grid moment cards: soft tint ---- */
.memory-card:not(.memory-card-add), .moment-card:not(.moment-card-add) {
  color: var(--fg1);
  background: color-mix(in srgb, var(--rt) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--rt) 22%, var(--border));
}
/* drop the saturated gradient + dark scrim — light surface needs neither */
.memory-bg, .moment-card-bg { display: none; }
.memory-card::after, .moment-card::after { content: none; }

/* ---- Moment cards that carry a cover photo: show it edge-to-edge ----
   The unified light surface hides .moment-card-bg, but when a moment has an
   uploaded cover we reveal that layer (its inline background-image paints the
   photo), restore the dark bottom scrim for legibility, and switch the title
   to white so it reads over the image. */
.moment-card.has-cover .moment-card-bg { display: block; }
.moment-card.has-cover::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 35%, rgba(8,12,20,.62) 100%);
}
.moment-card.has-cover { color: #fff; }
.moment-card.has-cover .moment-card-overlay h3,
.moment-card.has-cover .moment-card-sub { color: #fff; }

/* glyph → a rounded type-colored badge, top-left, like the list/choice icon */
.memory-glyph, .moment-card-glyph {
  position: absolute; right: auto; left: 16px; top: 16px; transform: none;
  width: 46px; height: 46px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--rt) 22%, var(--surface));
  color: var(--rt-ink);
}
.memory-glyph .ic, .moment-card-glyph .ic { width: 24px; height: 24px; }

/* overlaid text → dark, sits at the bottom over the tint (no scrim needed) */
.memory-overlay h3, .moment-card-overlay h3 { color: var(--fg1); text-shadow: none; }
.memory-overlay p, .moment-card-sub { color: var(--fg2); }
/* meta line (moment count + release status) under the title */
.memory-meta { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.memory-meta > span { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm); color: var(--fg2); }
.memory-meta .ic { width: 14px; height: 14px; color: var(--fg3); }
.memory-unlock { color: var(--rt-ink); }
.memory-unlock .ic { color: var(--rt-ink); }

/* status chips on a light surface: white pill instead of translucent-on-photo */
.memory-type { background: var(--surface); color: var(--fg2); box-shadow: var(--shadow-xs); border: 1px solid var(--border); }
.memory-corner, .moment-card-corner, .moment-card-play {
  background: var(--surface); color: var(--fg2);
  border: 1px solid var(--border); -webkit-backdrop-filter: none; backdrop-filter: none;
}
.memory-corner.is-open { background: var(--wash-gold); color: var(--gold-600); border-color: transparent; }
.moment-card-play { color: var(--echo-blue); }
.memory-card:not(.memory-card-add):hover, .moment-card:not(.moment-card-add):hover {
  border-color: color-mix(in srgb, var(--rt) 40%, var(--border));
}

/* ---- Reflection-type tiles: color the icon badge by type (was always blue) ---- */
.choice .choice-ic {
  background: color-mix(in srgb, var(--rt, var(--echo-blue)) 18%, var(--surface));
  color: var(--rt-ink, var(--echo-blue));
}
.choice.selected .choice-check { background: var(--rt, var(--echo-blue)); }

/* Write (letter) pane — a full-height text editor inside the recorder stage. */
.rec-write { position: absolute; inset: 0; padding: 14px; display: flex; }
.rec-write .textarea {
  flex: 1; width: 100%; height: 100%; resize: none; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--surface); color: var(--fg1);
  padding: 16px 18px; font-family: var(--font-body); font-size: var(--text-base); line-height: 1.6;
}
.rec-write .textarea:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(21,138,255,.12); }

/* A written letter, shown on the playback page. */
.playback-letter { font-family: var(--font-body); font-size: var(--text-md); line-height: 1.75; color: var(--fg1); white-space: normal; }
.playback-letter p { margin: 0 0 14px; }

/* =====================================================================
   WALKTHROUGH — scene tiles, step rows, and welcome modal scene
   Used by: vault/walkthrough.html and vault/_welcome_modal.html
   Tokens: --echo-blue --moment-gold --blue-700 --gold-600 --ink-800
           --radius-xl --shadow-md --font-display --text-xl --text-lg
           --surface --border --fg2
   ===================================================================== */

/* ---- Shared scene tile (gradient panel with Lucide glyphs) --------- */
.wt-scene {
  position: relative;
  width: 108px; height: 108px;
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  /* subtle inner highlight */
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.18);
  overflow: hidden;
}

/* Gradient variants */
.wt-scene--blue  { background: linear-gradient(135deg, var(--echo-blue) 0%, var(--blue-700) 100%); }
.wt-scene--gold  { background: linear-gradient(135deg, var(--moment-gold) 0%, var(--gold-600) 100%); }
.wt-scene--ink   { background: linear-gradient(135deg, var(--ink-800) 0%, var(--blue-700) 100%); }

/* Main glyph — large, white, centered */
.wt-scene .wt-scene-main {
  width: 48px; height: 48px; color: #fff; flex-shrink: 0;
  position: relative; z-index: 1;
}

/* Accent glyph — smaller, bottom-right offset */
.wt-scene .wt-scene-accent {
  position: absolute; bottom: 10px; right: 10px;
  width: 22px; height: 22px; color: rgba(255,255,255,.65);
  z-index: 1;
}

/* ---- Screenshot tile (real app screenshots, replaces .wt-scene on the
        static /walkthrough/ page; .wt-scene itself is kept for the modal) - */
.wt-shot {
  flex-shrink: 0;
  width: 400px; max-width: 400px;
}
.wt-shot img {
  display: block; width: 100%; height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  background: var(--surface);
}

/* ---- Step 1 hero carousel: cross-fading stack of the four create screens -- */
/* The hero step gets a colossal shot; the paired text stays flexible beside it. */
.wt-step-hero .wt-shot-carousel {
  width: 620px; max-width: 620px;
  position: relative;
  aspect-ratio: 5 / 4;              /* holds the frame while images cross-fade */
  background: var(--bg-sunk);       /* letterbox fill behind contained images */
  border-radius: var(--radius-lg);
  overflow: hidden;
}
/* Show the whole screenshot (never crop): portrait moment-form shots and
   landscape vault/modal shots both fit inside the frame, letterboxed as needed. */
.wt-shot-carousel img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain; object-position: center;
  opacity: 0;
  transition: opacity var(--dur-slow, 700ms) var(--ease-out);
}
.wt-shot-carousel img.is-active { opacity: 1; }
/* Progress dots, bottom-center over the frame */
.wt-carousel-dots {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 14px;
  display: flex; justify-content: center; gap: 8px;
}
.wt-carousel-dots span {
  width: 8px; height: 8px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,.55); box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: background var(--dur-base) var(--ease-out), width var(--dur-base) var(--ease-out);
}
.wt-carousel-dots span.is-active { background: #fff; width: 22px; }
/* Prev / next arrows, overlaid on the left and right edges of the frame */
.wt-carousel-nav {
  position: absolute; z-index: 3; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(14,23,38,.42); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.wt-carousel-nav:hover { background: rgba(14,23,38,.62); }
.wt-carousel-nav:active { transform: translateY(-50%) scale(.92); }
.wt-carousel-nav .ic { width: 20px; height: 20px; }
.wt-carousel-prev { left: 12px; }
.wt-carousel-next { right: 12px; }
@media (prefers-reduced-motion: reduce) {
  .wt-shot-carousel img { transition: none; }
}

/* ---- Page header (walkthrough.html only) --------------------------- */
.wt-head { max-width: 60ch; margin: 4px 0 48px; }
.wt-eyebrow {
  font-family: var(--font-display); font-size: var(--text-sm); font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--echo-blue); margin: 0 0 12px;
}
.wt-head h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-3xl); letter-spacing: -0.02em; line-height: 1.08;
  color: var(--fg1); margin: 0 0 16px;
}
.wt-lede {
  font-family: var(--font-body); font-size: var(--text-md);
  line-height: 1.65; color: var(--fg2); margin: 0;
}

/* ---- Walkthrough steps container ------------------------------------ */
.wt-steps {
  display: flex; flex-direction: column;
  gap: 40px;
  padding: 8px 0 40px;
}

/* Numbered eyebrow above each step heading — the steps are a real sequence,
   so the order carries meaning the reader needs. */
.wt-step-num {
  display: inline-block;
  font-family: var(--font-display); font-size: var(--text-sm); font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--echo-blue); margin-bottom: 10px;
}

/* ---- Individual step row: scene tile + descriptive text ------------- */
.wt-step {
  display: flex; flex-direction: row;
  align-items: center;
  gap: 36px;
}

/* On the page, make the scene tile larger than in the modal */
.wt-steps .wt-scene {
  width: 200px; height: 200px;
  flex-shrink: 0;
}
.wt-steps .wt-scene .wt-scene-main { width: 80px; height: 80px; }
.wt-steps .wt-scene .wt-scene-accent { width: 36px; height: 36px; bottom: 16px; right: 16px; }

/* Reversed steps: text left, tile right. Explicit class (not :nth-child) so the
   spark-row dividers interleaved between steps don't flip the alternation. */
.wt-step-reverse { flex-direction: row-reverse; }

/* Lock + line divider between steps, reusing the landing page's .spark-row. */
.wt-divider { margin: 4px 0; }

/* Step text block */
.wt-step-text { flex: 1; }
.wt-step h2 {
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700;
  color: var(--fg1); margin: 0 0 10px; letter-spacing: -0.01em;
}
.wt-step p {
  font-family: var(--font-body); color: var(--fg2); font-size: var(--text-md);
  line-height: 1.65; margin: 0; max-width: 50ch;
}

/* ---- Closing call to action ---------------------------------------- */
.wt-cta {
  margin: 24px 0 8px;
  padding: clamp(32px, 5vw, 52px);
  border-radius: var(--radius-xl);
  background: var(--wash-blue);
  border: 1px solid color-mix(in srgb, var(--echo-blue) 14%, transparent);
  text-align: center;
}
.wt-cta h2 {
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl);
  color: var(--fg1); margin: 0 0 8px; letter-spacing: -0.01em;
}
.wt-cta p {
  font-family: var(--font-body); font-size: var(--text-md); color: var(--fg2);
  line-height: 1.6; margin: 0 auto 24px; max-width: 46ch;
}

/* ---- Responsive: stack vertically on small screens ----------------- */
@media (max-width: 720px) {
  .wt-head { margin-bottom: 36px; }
  .wt-steps { gap: 36px; }
  .wt-step, .wt-step-reverse {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .wt-steps .wt-scene {
    width: 140px; height: 140px;
  }
  .wt-steps .wt-scene .wt-scene-main { width: 60px; height: 60px; }
  .wt-steps .wt-scene .wt-scene-accent { width: 28px; height: 28px; }
  .wt-shot { width: 100%; max-width: 440px; }
  .wt-step-hero .wt-shot-carousel { width: 100%; max-width: 440px; }
  .wt-step p { max-width: none; }
}

/* === Guided tour === */

/* Overlay container: fixed, full-screen, high z-index (above modal at 80).
   pointer-events:none so the dim doesn't swallow page interaction — the
   backdrop catcher, spotlight, and popover re-enable them selectively. */
.tour-overlay {
  position: fixed; inset: 0; z-index: 90;
  pointer-events: none;
}

/* Backdrop catcher: sits behind spotlight and popover; catches clicks on the
   dimmed area to end the tour. pointer-events:auto so it can receive clicks. */
.tour-backdrop {
  position: absolute; inset: 0;
  pointer-events: auto;
  cursor: pointer;
}

/* Spotlight: positioned box that creates the cutout dim via outer box-shadow.
   Transitions on geometry properties so it glides smoothly between steps. */
.tour-spotlight {
  position: absolute;
  border-radius: var(--radius-lg);
  /* Outer shadow dims everything outside the spotlight */
  box-shadow:
    0 0 0 9999px rgba(14, 23, 38, .55),
    0 0 0 3px var(--echo-blue);   /* subtle ring around the highlighted element */
  transition:
    left   var(--dur-base) var(--ease-out),
    top    var(--dur-base) var(--ease-out),
    width  var(--dur-base) var(--ease-out),
    height var(--dur-base) var(--ease-out);
  pointer-events: none;
  /* Ensure spotlight renders above backdrop but below the popover */
  z-index: 1;
}

/* Popover card */
.tour-pop {
  position: absolute;
  max-width: 320px;
  width: 320px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 24px 24px 20px;
  pointer-events: auto;
  z-index: 2;   /* above spotlight */
}

/* Close × button — top-right, mirrors .modal-close */
.tour-pop-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: none; background: none; cursor: pointer;
  border-radius: var(--radius-pill);
  color: var(--fg3);
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.tour-pop-close:hover { background: var(--bg-sunk); color: var(--ink-700); }
.tour-pop-close .ic { width: 16px; height: 16px; }

/* Step title */
.tour-pop-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-lg); color: var(--fg1);
  margin: 0 0 8px; padding-right: 28px; /* clear the × button */
  line-height: 1.25;
}

/* Step body */
.tour-pop-body {
  font-family: var(--font-body); color: var(--fg2);
  font-size: var(--text-sm); line-height: 1.55;
  margin: 0 0 16px;
}

/* Footer row: Back | counter | Next */
.tour-pop-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 4px;
}
.tour-pop-foot .btn { flex: none; padding: 8px 16px; font-size: var(--text-sm); }
.tour-pop-foot .btn[disabled],
.tour-pop-foot .btn[aria-disabled="true"] {
  opacity: .35; cursor: default; pointer-events: none;
}

/* Step counter (e.g. "1 / 4") */
.tour-pop-count {
  font-family: var(--font-body); font-size: var(--text-xs);
  color: var(--fg3); flex: 1; text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Centered fallback: no target / element not visible */
.tour-pop--center {
  position: fixed !important;
  left: 50% !important; top: 50% !important;
  transform: translate(-50%, -50%) !important;
}

/* Responsive adjustments */
@media (max-width: 720px) {
  .tour-pop {
    max-width: calc(100vw - 32px);
    width: calc(100vw - 32px);
  }
  .tour-pop--center {
    left: 50% !important; top: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: calc(100vw - 32px);
    width: calc(100vw - 32px);
  }
}
