/**
 * LUME Styles — Pastel Edition
 * Soft, intimate, visually appealing
 */

:root {
  /* ═══════════════════════════════════════════════════════════════
     PASTEL PALETTE
     ═══════════════════════════════════════════════════════════════ */
  --bg: #f4f0f8;
  --bg-subtle: #f4f1f8;
  --surface: #ffffff;
  --ink: #2d2a33;
  --ink-soft: #5c5867;
  --ink-muted: #9993a3;

  /* Pastel accents */
  --pastel-rose: #f8d7da;
  --pastel-peach: #fce8dc;
  --pastel-mint: #d4edda;
  --pastel-sky: #d6eaf8;
  --pastel-lavender: #e8daf8;
  --pastel-cream: #fef9e7;

  /* Axis colors (soft pastels) */
  --axis-altruism: #a8d5ba;      /* soft green */
  --axis-loyalty: #f5c6aa;       /* soft coral */
  --axis-justice: #b8c5f2;       /* soft blue */

  /* State colors */
  /* State colors — semantic in UI: purple = your choice, teal = people / world pulse */
  --state-personal: #7eb5d6;     /* people's choice lane (teal) */
  --state-pulse: #c9a7d8;        /* your choice lane (purple) */
  --state-personal-bg: rgba(126, 181, 214, 0.15);
  --state-pulse-bg: rgba(201, 167, 216, 0.18);

  /* Question progress dots (past / current / upcoming) */
  --progress-dot-past: #8a84a3;
  --progress-dot-current: #1a1a1b;
  --progress-dot-upcoming: #cccccc;
  --question-ack-bg: #f2f2f7;

  /* Commitment screen */
  --commit-bg: #1e1b24;
  --commit-text: #f0edf4;
  --commit-muted: #a9a3b3;

  /* Layout */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --space: clamp(16px, 4vw, 24px);
  --max-width: 420px;

  /* Typography */
  --font-ui: 'Jost', -apple-system, BlinkMacSystemFont, sans-serif;
  --font: var(--font-ui);
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-italic: 'Fraunces', serif;

  /* Landing headline uses 1.5× scale; in-game display beats use 1× */
  --landing-scale: 1.5;
  --landing-headline: clamp(calc(1.78rem * var(--landing-scale)), 7vw, calc(2.5rem * var(--landing-scale)));
  --display-headline: clamp(1.78rem, 7vw, 2.5rem);
  --spark: #C97B4F;
  --radius-btn: 999px;
  --accent: #B5A7D4;
  --accent-strong: #7A6CB8;
  --hairline: rgba(31, 26, 54, 0.12);
  --shadow-lift: 0 2px 4px rgba(26, 26, 32, 0.04), 0 18px 40px rgba(26, 26, 32, 0.08);

  /* Semantic tokens (light / Lavender) */
  --on-accent-strong: #FBFAFE;
  --panel-bg: linear-gradient(165deg, #ffffff 0%, var(--pastel-lavender) 100%);
  --panel-bg-solid: #ffffff;
  --overlay-scrim: rgba(45, 42, 51, 0.3);
  --chrome-link: #6b6779;
  --chrome-link-hover-bg: rgba(0, 0, 0, 0.05);
  --input-bg: #faf8fc;
  --input-border: #e5e3e8;
  --badge-bg: rgba(181, 167, 212, 0.25);
  --scenario-bg: linear-gradient(180deg, rgba(201, 167, 216, 0.22) 0%, rgba(201, 167, 216, 0.12) 100%);
  --scenario-border: rgba(201, 167, 216, 0.55);
  --scenario-pulse-bg: linear-gradient(180deg, rgba(126, 181, 214, 0.22) 0%, rgba(126, 181, 214, 0.1) 100%);
  --dilemma-band-bg: #EFEDF4;
  --dilemma-grid-dot: rgba(122, 108, 184, 0.18);
  --dilemma-grid-line: rgba(122, 108, 184, 0.18);
  --dilemma-ink-offset: var(--state-personal);
  --dilemma-ink-main: var(--state-pulse);
  --viz-fill: var(--pastel-lavender);
  --account-prompt-bg: linear-gradient(135deg, var(--pastel-cream) 0%, var(--pastel-peach) 100%);
  --milestone-done-bg: rgba(212, 237, 218, 0.35);
  --milestone-done-border: rgba(74, 124, 89, 0.35);
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --error-text: #dc2626;
  --toggle-track-bg: #e8e4ee;
  --toggle-thumb-bg: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════════════════════════ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

body:has(.screen.landing) {
  background: #EFEDF4;
}

[data-theme="light"] {
  --chrome-link: #4a4258;
  --chrome-link-hover-bg: rgba(31, 26, 54, 0.12);
}

[data-theme="dark"] {
  color-scheme: dark;

  /* ── Noir (night mode) ──────────────────────────────── */

  /* Surfaces — deep espresso brown, not pure black */
  --bg: #16110C;
  --bg-subtle: #1c1610;
  --bg-card: #221C14;
  --surface: #221C14;

  /* Ink (text) — warm bone, never harsh white */
  --ink: #F2EAD8;
  --ink-soft: #C8BFA8;
  --ink-mute: #807562;
  --ink-muted: #807562;

  /* Accent — candlelit gold, two strengths */
  --accent: #E8B860;
  --accent-strong: #F0CC85;

  /* Spark — gold doubles as the spark in this theme */
  --spark: #F0CC85;

  /* Hairlines — bone-tinted at low opacity */
  --hairline: rgba(242, 234, 216, 0.10);
  --hairline-strong: rgba(242, 234, 216, 0.20);

  /* Elevation — deeper shadows for the dark ground */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 40px rgba(0, 0, 0, 0.6);

  /* Radii */
  --radius-card: 24px;
  --radius-btn: 999px;
  --radius-option: 16px;

  /* Semantic tokens (Noir) */
  --on-accent-strong: #16110C;
  --panel-bg: linear-gradient(165deg, #221C14 0%, #1c1610 100%);
  --panel-bg-solid: #221C14;
  --overlay-scrim: rgba(10, 8, 5, 0.65);
  --chrome-link: #C8BFA8;
  --chrome-link-hover-bg: rgba(242, 234, 216, 0.10);
  --input-bg: #221C14;
  --input-border: rgba(242, 234, 216, 0.10);
  --badge-bg: rgba(232, 184, 96, 0.15);
  --question-ack-bg: #1c1610;
  --progress-dot-past: #807562;
  --progress-dot-current: #F2EAD8;
  --progress-dot-upcoming: #3d3428;
  /* Question lanes: gold = your choice, pearl = world pulse */
  --state-pulse: #F0CC85;
  --state-pulse-bg: rgba(240, 204, 133, 0.18);
  --state-personal: #D4DCE8;
  --state-personal-bg: rgba(212, 220, 232, 0.16);
  --scenario-bg: linear-gradient(180deg, rgba(232, 184, 96, 0.18) 0%, rgba(232, 184, 96, 0.08) 100%);
  --scenario-border: rgba(240, 204, 133, 0.45);
  --scenario-pulse-bg: linear-gradient(180deg, rgba(212, 220, 232, 0.14) 0%, rgba(212, 220, 232, 0.06) 100%);
  --dilemma-band-bg: #1c1610;
  --dilemma-grid-dot: rgba(242, 234, 216, 0.16);
  --dilemma-grid-line: rgba(242, 234, 216, 0.16);
  --dilemma-ink-offset: var(--state-personal);
  --dilemma-ink-main: var(--state-pulse);
  --viz-fill: rgba(232, 184, 96, 0.35);
  --account-prompt-bg: #221C14;
  --milestone-done-bg: rgba(200, 160, 64, 0.12);
  --milestone-done-border: rgba(232, 184, 96, 0.30);
  --error-bg: rgba(220, 38, 38, 0.12);
  --error-border: rgba(220, 38, 38, 0.35);
  --error-text: #f87171;
  --toggle-track-bg: #2a2218;
  --toggle-thumb-bg: #F2EAD8;
}

[data-theme="dark"] body:has(.screen.landing) {
  background: var(--bg);
}

[data-theme="dark"] .landing-frame {
  --bg: #16110C;
  --bg-card: #221C14;
  --ink: #F2EAD8;
  --ink-soft: #C8BFA8;
  --ink-mute: #807562;
  --accent: #E8B860;
  --accent-strong: #F0CC85;
  /* Landing rotating words stay apricot in dark mode */
  --spark: #C97B4F;
  --hairline: rgba(242, 234, 216, 0.10);
  --hairline-strong: rgba(242, 234, 216, 0.20);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 40px rgba(0, 0, 0, 0.6);
  --radius-card: 24px;
  --radius-btn: 999px;
  --radius-option: 16px;
  --on-accent-strong: #16110C;
  --chrome-link: #C8BFA8;
  --chrome-link-hover-bg: rgba(242, 234, 216, 0.10);
  --badge-bg: rgba(232, 184, 96, 0.15);
  --panel-bg: linear-gradient(165deg, #221C14 0%, #1c1610 100%);
}

#app {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  /* No contain:* here — it would make position:fixed (e.g. .commitment-backdrop)
     use #app as the containing block, so the dimmer only covers this column. */
}

#app > .screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ═══════════════════════════════════════════════════════════════
   SCREEN TRANSITIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */

.brand {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

h1 {
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h2 {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
}

.lead {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 28px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  transition: all 150ms ease;
}

.btn-primary {
  width: 100%;
  background: var(--ink);
  color: #fff;
}

[data-theme="dark"] .btn-primary {
  background: var(--accent-strong);
  color: var(--on-accent-strong);
}

[data-theme="dark"] .btn-primary:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 42, 51, 0.2);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  width: 100%;
  background: var(--bg-subtle);
  color: var(--ink-soft);
}

.btn-secondary:hover {
  background: var(--pastel-lavender);
  color: var(--ink);
}

[data-theme="dark"] .btn-secondary:hover {
  background: var(--bg-card);
  color: var(--ink);
}

.btn-ghost {
  padding: 12px 20px;
  color: var(--ink-muted);
  font-weight: 500;
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--bg-subtle);
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.03);
}

.card-pastel {
  background: linear-gradient(135deg, var(--pastel-lavender) 0%, var(--pastel-sky) 100%);
}

/* ═══════════════════════════════════════════════════════════════
   LANDING SCREEN
   ═══════════════════════════════════════════════════════════════ */

.landing {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-height: 0;
}

.landing-frame {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  /* Lavender + apricot — landing only */
  --bg: #EFEDF4;
  --bg-card: #FBFAFE;
  --ink: #1F1A36;
  --ink-soft: #4a4258;
  --ink-mute: #8e88a0;
  --accent: #B5A7D4;
  --accent-strong: #7A6CB8;
  --spark: #C97B4F;
  --hairline: rgba(31, 26, 54, 0.12);
  --hairline-strong: rgba(31, 26, 54, 0.20);
  --shadow: 0 1px 2px rgba(26, 26, 32, 0.04), 0 8px 24px rgba(26, 26, 32, 0.06);
  --font-ui: 'Jost', -apple-system, sans-serif;
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-italic: 'Fraunces', serif;
  --radius-btn: 999px;
  --landing-lead: clamp(calc(0.64rem * var(--landing-scale)), 2.56vw, calc(0.72rem * var(--landing-scale)));
  --landing-btn-size: clamp(calc(0.6rem * var(--landing-scale)), 2.2vw, calc(0.68rem * var(--landing-scale)));
  --landing-btn-pad-y: clamp(10px, 2.4vw, 12px);
  --landing-btn-pad-x: clamp(28px, 7.5vw, 36px);
  --on-accent-strong: #FBFAFE;
  --chrome-link: #4a4258;
  --chrome-link-hover-bg: rgba(31, 26, 54, 0.12);
  --badge-bg: rgba(181, 167, 212, 0.25);
  --panel-bg: linear-gradient(165deg, #ffffff 0%, var(--pastel-lavender) 100%);
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.landing-header .brand {
  font-family: var(--font-ui);
  font-size: calc(var(--landing-headline) * 0.255);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent-strong);
}

.word-with-badge {
  position: relative;
  display: inline-block;
}

.daily-badge {
  position: absolute;
  top: -14px;
  right: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  padding: 2px 5px;
  border: 1px solid var(--ink-muted);
  border-radius: var(--radius-sm);
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--pastel-peach);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: #8b5a3c;
}

.landing-header .streak-badge {
  font-family: var(--font-ui);
  font-size: calc(var(--landing-headline) * 0.266);
  padding: 0.245em 0.455em;
  gap: 2.8px;
  background: var(--badge-bg);
  color: var(--accent-strong);
}

.landing-frame .daily-badge {
  color: var(--ink-mute);
  border-color: var(--hairline);
}

.landing-content {
  text-align: center;
}

.landing-content h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22em;
  font-family: var(--font-display);
  font-size: var(--landing-headline);
  font-weight: 700;
  font-optical-sizing: auto;
  letter-spacing: -0.03em;
  line-height: 1.22;
  color: var(--accent-strong);
  margin-bottom: 32px;
}

.landing-headline-line {
  display: block;
  white-space: nowrap;
  font-weight: inherit;
}

.landing-content .lead {
  display: flex;
  justify-content: center;
  font-family: var(--font-italic);
  font-size: var(--landing-lead);
  font-weight: 500;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 28px;
}

.lead-line {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  max-width: 100%;
  transform: translateX(0.7em);
}

.lead-prefix {
  white-space: nowrap;
}

.rotating-word {
  display: inline-block;
  min-width: 10ch;
  width: max-content;
  text-align: left;
  margin-left: 0.28em;
  vertical-align: baseline;
  flex-shrink: 0;
  color: var(--spark);
  transition: opacity 1200ms ease, transform 1200ms ease;
}

.rotating-word.fade-out {
  opacity: 0;
  transform: translateY(-6px);
}

.rotating-word.fade-in {
  animation: fadeInUp 1200ms ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.landing-content .btn-primary {
  position: relative;
  width: auto;
  font-family: var(--font-ui);
  font-size: var(--landing-btn-size);
  padding: var(--landing-btn-pad-y) var(--landing-btn-pad-x);
  background: var(--bg-card);
  color: var(--ink);
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: color 900ms ease;
}

.landing-content .btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-strong);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 900ms ease;
  z-index: 0;
}

.landing-content .btn-primary:hover {
  color: var(--on-accent-strong);
}

.landing-content .btn-primary:hover::before {
  transform: scaleX(1);
}

.landing-content .btn-primary span {
  position: relative;
  z-index: 1;
}

/* No dilemmas empty state */
.no-questions-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.no-questions-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
}

.no-questions-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.no-questions-copy {
  color: var(--ink-muted);
  margin-bottom: 24px;
  max-width: 22rem;
}

.no-questions-btn {
  width: auto;
  padding: 12px 28px;
}


/* ═══════════════════════════════════════════════════════════════
   COMMITMENT SCREEN — Slide-up sheet with hold-to-confirm
   ═══════════════════════════════════════════════════════════════ */

.commitment-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--overlay-scrim);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 300ms ease;
}

.commitment-sheet {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  margin: 0 auto;
  z-index: 100;
  width: 90%;
  max-width: 320px;
  padding: 32px 24px;
  background: var(--panel-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  animation: slideUp 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(calc(100% + 24px));
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.commitment-sheet.closing {
  animation: slideDown 300ms ease forwards;
}

@keyframes slideDown {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(calc(100% + 24px));
  }
}

.commitment-handle {
  display: none;
}

.commitment-content {
  text-align: center;
}

.commitment-message {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
  margin-top: 40px;
  margin-bottom: 32px;
}

.commitment-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Hold-to-confirm button */
.hold-btn {
  position: relative;
  width: 70%;
  padding: 10px 24px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--surface);
  border: 1.5px solid var(--ink-muted);
  border-radius: var(--radius-btn);
  box-shadow: 0 2px 8px rgba(45, 42, 51, 0.15), 0 1px 3px rgba(45, 42, 51, 0.1);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: all 150ms ease;
  overflow: hidden;
}

.hold-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-strong);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0ms linear;
  z-index: 1;
}

.hold-btn.holding::before {
  transform: scaleX(1);
  transition: transform 1400ms linear;
}

.hold-btn-text {
  position: relative;
  z-index: 2;
  display: block;
  color: var(--ink);
}

.hold-btn-text-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3;
  color: var(--on-accent-strong);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0ms linear;
}

.hold-btn.holding .hold-btn-text-reveal {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1400ms linear;
}

.hold-btn.hold-complete::before {
  transform: scaleX(1);
  transition: none;
}

.hold-btn.hold-complete .hold-btn-text-reveal {
  clip-path: inset(0 0 0 0);
  transition: none;
}

.hold-btn.hold-complete {
  pointer-events: none;
  cursor: default;
}

.hold-btn-hint {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.6;
  margin-top: 2px;
}

.hold-btn:hover:not(.holding):not(.hold-complete) {
  background: var(--bg-subtle);
}

.commitment-dismiss {
  width: 70%;
  padding: 10px 20px;
  font-family: var(--font-ui);
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 150ms ease;
}

.commitment-dismiss:hover {
  color: var(--ink);
  background: var(--chrome-link-hover-bg);
}

/* ═══════════════════════════════════════════════════════════════
   QUESTION SCREEN
   ═══════════════════════════════════════════════════════════════ */

.question-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  margin: 0;
  max-width: none;
  justify-content: flex-start;
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.75rem;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.question-meta strong {
  color: var(--ink);
  font-weight: 600;
}

.progress-dots {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  background: var(--progress-dot-upcoming);
  transition: width 320ms ease, height 320ms ease, background 320ms ease, transform 320ms ease;
}

.progress-dot--past {
  background: var(--progress-dot-past);
}

.progress-dot--current {
  width: 14px;
  height: 14px;
  background: var(--progress-dot-current);
}

.progress-dot--upcoming {
  background: var(--progress-dot-upcoming);
}

.question-ack {
  flex: 1;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--question-ack-bg);
  border-radius: var(--radius-lg);
  margin-top: 4px;
}

.question-ack-word,
.question-pre-reveal-line {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--display-headline);
  font-weight: 700;
  font-optical-sizing: auto;
  letter-spacing: -0.03em;
  line-height: 1.22;
  color: var(--ink);
  text-align: center;
}

.question-ack-word {
  padding: 24px;
  animation: questionAckWord 2.4s ease-in-out forwards;
}

@keyframes questionAckWord {
  0% {
    opacity: 0;
    transform: scale(0.94);
  }
  15% {
    opacity: 1;
    transform: scale(1);
  }
  70% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.97);
  }
}

.question-pre-reveal {
  flex: 1;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--question-ack-bg);
  border-radius: var(--radius-lg);
  margin-top: 4px;
}

.question-pre-reveal-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 36px 28px;
  text-align: center;
}

.question-pre-reveal-brand {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-muted);
  opacity: 0.88;
}

.question-pre-reveal-line {
  max-width: none;
}

.question-pre-reveal-word {
  display: inline;
  animation: preRevealLineReveal 1.2s ease-out forwards;
}

.pre-reveal-ellipsis {
  display: inline;
  white-space: nowrap;
}

.pre-reveal-dot {
  display: inline-block;
  min-width: 0.32em;
  text-align: center;
  opacity: 0.18;
  animation: preRevealDotChase 1.05s ease-in-out infinite;
}

.pre-reveal-dot:nth-child(1) {
  animation-delay: 0s;
}

.pre-reveal-dot:nth-child(2) {
  animation-delay: 0.175s;
}

.pre-reveal-dot:nth-child(3) {
  animation-delay: 0.35s;
}

@keyframes preRevealDotChase {
  0%, 55%, 100% {
    opacity: 0.18;
    transform: translateY(0);
  }
  22% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes preRevealLineReveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.question-card {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 14px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.question-scenario {
  border: 2px solid var(--scenario-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  flex-shrink: 0;
  background: var(--scenario-bg);
  transition: background 400ms ease, border-color 400ms ease;
}

.question-scenario.pulse-mode {
  background: var(--scenario-pulse-bg);
  border-color: var(--state-personal);
}

.question-illustration-band {
  aspect-ratio: 16 / 5;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  flex-shrink: 0;
}

.dilemma-art__band-fill {
  fill: var(--dilemma-band-bg);
  stroke: none;
}

.dilemma-art__grid-dot {
  fill: var(--dilemma-grid-dot);
  stroke: none;
}

.dilemma-art__grid-line {
  fill: none;
  stroke: var(--dilemma-grid-line);
  stroke-width: 0.55;
}

.dilemma-art__grid-line--grain {
  stroke-width: 0.6;
  opacity: 0.55;
}

.question-scenario .question-text {
  border: none;
  border-radius: 0;
  background: transparent;
  min-height: 0;
  margin-bottom: 0;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--scenario-border);
}

.question-scenario.pulse-mode .question-text {
  background: transparent;
  border-top-color: var(--state-personal);
}

.question-scenario.pulse-mode .question-text.pulse-mode {
  border-color: transparent;
}

.dilemma-art {
  display: block;
  width: 100%;
  height: 100%;
  vertical-align: top;
}

.dilemma-art__ink--offset {
  stroke: var(--dilemma-ink-offset);
}

.dilemma-art__ink--main {
  stroke: var(--dilemma-ink-main);
}

.question-card::-webkit-scrollbar {
  width: 8px;
}

.question-card::-webkit-scrollbar-track {
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  margin: 14px 0;
}

.question-card::-webkit-scrollbar-thumb {
  background: var(--ink-muted);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
  min-height: 48px;
}

.question-card::-webkit-scrollbar-thumb:hover {
  background: var(--ink-soft);
  background-clip: padding-box;
}

@supports (scrollbar-width: thin) {
  .question-card {
    scrollbar-width: thin;
    scrollbar-color: rgba(153, 147, 163, 0.75) transparent;
  }
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.axis-badges {
  display: none;
}

.question-prompt {
  display: none;
}

.question-text {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 24px;
  padding: 16px;
  background: var(--scenario-bg);
  border: 2px solid var(--scenario-border);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  transition: background 400ms ease, border-color 400ms ease;
}

.question-copy {
  display: block;
  transition: opacity 400ms ease;
}

.question-copy-pulse {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 16px;
  pointer-events: none;
}

.question-text.show-pulse-copy .question-copy-pulse {
  pointer-events: auto;
}

.question-text:not(.show-pulse-copy) .question-copy-personal {
  opacity: 1;
}

.question-text:not(.show-pulse-copy) .question-copy-pulse {
  opacity: 0;
}

.question-text.show-pulse-copy .question-copy-personal {
  opacity: 0;
  pointer-events: none;
}

.question-text.show-pulse-copy .question-copy-pulse {
  opacity: 1;
}

.question-text.pulse-mode {
  color: var(--ink);
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  flex: 0 1 auto;
}

.option-btn {
  display: grid;
  grid-template-columns: 1fr 28px;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  text-align: left;
  background: var(--surface);
  border: 2px solid var(--bg-subtle);
  border-radius: var(--radius-lg);
  transition: border-color 150ms ease, background 150ms ease;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--bg-subtle);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.option-btn:active:not(:disabled) {
  transform: scale(0.99);
}

.option-btn:disabled {
  cursor: default;
}

.option-text {
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  min-width: 0;
}

.option-undo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.undo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--state-pulse);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 200ms ease, transform 200ms ease;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 2px #fff) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.undo-icon.show {
  opacity: 1;
  transform: scale(1);
  animation: undoGlowYours 2.5s ease infinite;
}

.option-btn.selected-pulse .undo-icon {
  color: var(--state-personal);
}

.option-btn.selected-pulse .undo-icon.show {
  animation: undoGlowPeople 2.5s ease infinite;
}

@keyframes undoGlowYours {
  0%, 100% { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 3px #fff) drop-shadow(0 0 6px rgba(201, 167, 216, 0.45)); }
  50% { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 4px #fff) drop-shadow(0 0 10px rgba(201, 167, 216, 0.55)); }
}

@keyframes undoGlowPeople {
  0%, 100% { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 3px #fff) drop-shadow(0 0 6px rgba(126, 181, 214, 0.45)); }
  50% { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 4px #fff) drop-shadow(0 0 10px rgba(126, 181, 214, 0.55)); }
}

.option-btn.can-undo {
  position: relative;
  z-index: 0;
  animation: canUndoPulse 1.2s ease-in-out infinite;
}

@keyframes canUndoPulse {
  0%, 100% {
    border-color: var(--state-pulse);
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, 0.6),
      0 0 0 2px rgba(201, 167, 216, 0.5),
      0 0 12px rgba(184, 143, 212, 0.35);
  }
  50% {
    border-color: #8b4fc4;
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, 0.95),
      0 0 0 3px rgba(139, 79, 196, 0.85),
      0 0 28px rgba(139, 79, 196, 0.55);
  }
}

.option-btn.selected-pulse.can-undo {
  animation: canUndoPulsePulse 1.2s ease-in-out infinite;
}

@keyframes canUndoPulsePulse {
  0%, 100% {
    border-color: var(--state-personal);
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, 0.55),
      0 0 0 2px rgba(126, 181, 214, 0.55),
      0 0 12px rgba(90, 163, 196, 0.35);
  }
  50% {
    border-color: #2e8bb0;
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, 0.95),
      0 0 0 3px rgba(46, 139, 176, 0.8),
      0 0 28px rgba(46, 139, 176, 0.55);
  }
}

/* Your choice (personal) = purple · People's choice (pulse) = teal */
.option-btn.selected-personal {
  border-color: var(--state-pulse);
  background: var(--state-pulse-bg);
}

.option-btn.selected-personal .option-key {
  background: var(--state-pulse);
  color: var(--on-accent-strong);
}

.option-btn.selected-personal .option-text {
  color: var(--ink);
}

.option-btn.selected-pulse {
  border-color: var(--state-personal);
  background: var(--state-personal-bg);
}

.option-btn.selected-pulse .option-key {
  background: var(--state-personal);
  color: var(--on-accent-strong);
}

.option-btn.dimmed {
  opacity: 0.5;
}

/* Legend */
.legend {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.58rem;
  color: var(--ink-muted);
  flex-shrink: 0;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 300ms ease;
}

.legend.visible {
  visibility: visible;
  opacity: 1;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.legend-dot-yours { background: var(--state-pulse); }
.legend-dot-people { background: var(--state-personal); }

/* ═══════════════════════════════════════════════════════════════
   REVEAL SCREEN
   ═══════════════════════════════════════════════════════════════ */

.reveal-screen {
  text-align: center;
  padding: 6vh 20px 48px;
  max-width: 480px;
  margin: 0 auto;
}

.reveal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 22px 20px 18px;
  text-align: left;
}

.reveal-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.reveal-card-brand {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.reveal-card-date {
  font-size: 0.7rem;
  font-style: italic;
  font-family: var(--font-italic);
  color: var(--ink-muted);
}

.reveal-card-kicker {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.85;
  margin: 0 0 6px;
}

.reveal-label {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  animation: pulse 600ms ease;
}

.reveal-label--card {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 7vw, 2.15rem);
  margin-bottom: 10px;
  line-height: 1.2;
}

.reveal-mirror {
  font-family: var(--font-italic);
  font-size: 1rem;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 32px;
  line-height: 1.6;
}

.reveal-mirror--card {
  font-family: var(--font-italic);
  font-size: 0.98rem;
  margin-bottom: 20px;
}

.reveal-card-footer-url {
  margin: 20px 0 0;
  font-size: 0.65rem;
  color: var(--ink-muted);
}

/* Hexagon/Quadrilateral visualization */
.viz-container {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.hexagon-viz {
  width: 240px;
  height: 240px;
}

.hexagon-viz .spoke {
  stroke: var(--bg-subtle);
  stroke-width: 1;
}

.hexagon-viz .spoke-label {
  font-size: 9px;
  fill: var(--ink-muted);
  text-anchor: middle;
}

.hexagon-viz .shape-fill {
  fill: var(--viz-fill);
  fill-opacity: 0.4;
  stroke: var(--state-personal);
  stroke-width: 2;
}

.hexagon-viz .point {
  fill: var(--state-personal);
  r: 5;
}

.hexagon-viz .center-point {
  fill: var(--ink-muted);
  r: 3;
}

/* Fault Line bars */
.fault-line {
  margin: 24px 0;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.fault-line h3 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 16px;
  text-align: left;
}

.fault-line--card {
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.fault-line--card h3 {
  display: none;
}

.fault-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.fault-bar:last-child {
  margin-bottom: 0;
}

.fault-bar-label {
  width: 70px;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.fault-bar-label.left {
  text-align: right;
}

.fault-bar-label.right {
  text-align: left;
}

.fault-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  position: relative;
  overflow: visible;
}

.fault-bar-track::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--ink-muted);
  opacity: 0.3;
  transform: translateX(-50%);
}

.fault-bar-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 0;
  transition: left 600ms cubic-bezier(0.4, 0, 0.2, 1), width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Square edge at centre notch; rounded cap only toward the pole label */
.fault-bar-fill--from-left {
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.fault-bar-fill--from-right {
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.fault-bar-fill[data-axis="altruism"] { background: var(--axis-altruism); }
.fault-bar-fill[data-axis="loyalty"] { background: var(--axis-loyalty); }
.fault-bar-fill[data-axis="justice"] { background: var(--axis-justice); }

/* Share section */
.share-section {
  margin-top: 14px;
}

.share-section-lead {
  margin: 0;
  max-width: 22rem;
  margin-inline: auto;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-soft);
  text-align: center;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-actions--reveal {
  gap: 16px;
  align-items: stretch;
}

.share-actions--reveal .share-actions--row {
  margin: 0;
}

.share-actions--row {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

.share-pill {
  appearance: none;
  border: 1px solid rgba(153, 147, 163, 0.55);
  background: var(--bg-subtle);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.share-pill__icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.share-pill:hover {
  background: var(--bg-subtle);
  border-color: var(--hairline-strong);
}

.share-pill:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Share card preview modal */
.share-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fadeIn 200ms ease;
}

.share-modal {
  background: var(--panel-bg-solid);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 380px;
  padding: 24px 22px 22px;
  position: relative;
  box-shadow: var(--shadow-lift);
  text-align: center;
}

.share-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.share-modal__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}

.share-modal__subtitle {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0 0 16px;
  line-height: 1.45;
}

.share-modal__preview {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  margin-bottom: 16px;
}

.share-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-modal__actions .btn {
  width: 100%;
}

.share-modal--loading {
  padding: 32px 24px;
}

.share-modal__download {
  width: 100%;
}

/* Account prompt */
.account-prompt {
  margin-top: 32px;
  padding: 24px;
  background: var(--account-prompt-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.account-prompt h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  width: 100%;
}

.account-prompt p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 16px;
  line-height: 1.5;
  max-width: 22rem;
  width: 100%;
}

.account-prompt .btn-primary {
  width: fit-content;
  max-width: min(100%, 20rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  background: var(--accent-strong);
  color: var(--on-accent-strong);
  border-radius: var(--radius-btn);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   SHARE CARD (for html2canvas rendering)
   ═══════════════════════════════════════════════════════════════ */

.share-card-render {
  width: 360px;
  padding: 32px;
  background: linear-gradient(145deg, #faf8fc 0%, #f0ebf6 100%);
  font-family: var(--font-ui);
  text-align: center;
}

/* Offscreen export: match on-screen reveal card + explicit colors for html2canvas */
.share-card-render.share-card-render--reveal {
  width: 400px;
  padding: 22px 20px 18px;
  background: #ffffff;
  text-align: left;
  box-sizing: border-box;
}

.share-card-render.share-card-render--reveal .reveal-mirror--card {
  color: #5c5867;
}

.share-card-render.share-card-render--reveal .fault-bar-track {
  background: #f4f1f8;
}

.share-card-render.share-card-render--reveal .fault-bar-track::before {
  background: #9993a3;
}

.share-card-render.share-card-render--reveal .fault-bar-fill[data-axis="altruism"] {
  background: #a8d5ba;
}

.share-card-render.share-card-render--reveal .fault-bar-fill[data-axis="loyalty"] {
  background: #f5c6aa;
}

.share-card-render.share-card-render--reveal .fault-bar-fill[data-axis="justice"] {
  background: #b8c5f2;
}

.share-card-render.share-card-render--reveal .fault-bar-label {
  color: #5c5867;
}

.share-card-render.share-card-render--reveal .reveal-label--card {
  color: #2d2a33;
}

.share-card-render .card-header {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #9993a3;
  margin-bottom: 16px;
}

.share-card-render .card-label {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #2d2a33;
  margin-bottom: 20px;
}

.share-card-render .card-mirror {
  font-family: var(--font-italic);
  font-size: 14px;
  font-style: italic;
  color: #5c5867;
  line-height: 1.6;
  margin-bottom: 24px;
}

.share-card-render .card-footer {
  font-size: 11px;
  color: #9993a3;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 40px; }

.text-center { text-align: center; }

/* ═══════════════════════════════════════════════════════════════
   AUTH MODAL
   ═══════════════════════════════════════════════════════════════ */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 200ms ease;
}

.auth-modal {
  background: var(--panel-bg-solid);
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  padding: 32px 28px;
  position: relative;
  animation: slideUp 250ms ease;
  box-shadow: var(--shadow-lift);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-modal__close,
.deletion-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.auth-modal__close:hover,
.deletion-modal__close:hover {
  background: var(--chrome-link-hover-bg);
}

.auth-modal__close svg,
.deletion-modal__close svg {
  display: block;
  width: 16px;
  height: 16px;
}

.auth-modal__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  text-align: center;
}

.auth-modal__subtitle {
  font-size: 14px;
  color: var(--ink-soft);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-ui);
  font-size: 15px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(122, 108, 184, 0.15);
}

[data-theme="dark"] .auth-input:focus {
  box-shadow: 0 0 0 3px rgba(240, 204, 133, 0.15);
}

.auth-input::placeholder {
  color: var(--ink-muted);
}

.auth-btn {
  font-family: var(--font-ui);
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.15s;
}

.auth-btn--primary {
  background: var(--accent-strong);
  color: var(--on-accent-strong);
}

.auth-btn--primary:hover {
  filter: brightness(1.05);
}

.auth-btn--primary:disabled {
  background: var(--ink-muted);
  color: var(--surface);
  cursor: not-allowed;
}

.auth-btn--google {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--input-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-btn--google:hover {
  background: var(--bg-subtle);
}

.auth-btn--google svg {
  width: 18px;
  height: 18px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--input-border);
}

.auth-footer {
  margin-top: 20px;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.5;
}

.auth-success {
  text-align: center;
  padding: 20px 0;
}

.auth-success__icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.auth-success__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.auth-success__text {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.auth-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* Account closure request modal (above auth overlay) */
.deletion-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 20px;
  animation: fadeIn 200ms ease;
}

.deletion-modal {
  background: var(--panel-bg-solid);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
  position: relative;
  animation: slideUp 250ms ease;
  box-shadow: var(--shadow-lift);
}

.deletion-modal__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  text-align: center;
}

.deletion-modal__text {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 12px;
}

.deletion-modal__input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--ink);
  margin-top: 8px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.deletion-modal__input:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(122, 108, 184, 0.15);
}

[data-theme="dark"] .deletion-modal__input:focus {
  box-shadow: 0 0 0 3px rgba(240, 204, 133, 0.15);
}

.deletion-modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Profile Pill */
.profile-pill {
  position: relative;
}

.profile-pill__btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent-strong);
  color: var(--on-accent-strong);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}

.profile-pill__btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--panel-bg-solid);
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
  border: 1px solid var(--hairline);
  min-width: 200px;
  padding: 8px 0;
  display: none;
}

.profile-pill.open .profile-dropdown {
  display: block;
  animation: fadeIn 150ms ease;
}

.profile-dropdown__header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--input-border);
}

.profile-dropdown__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.profile-dropdown__email {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.profile-dropdown__item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--ink);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}

.profile-dropdown__item:hover {
  background: var(--chrome-link-hover-bg);
}

.profile-dropdown__item--danger {
  color: #dc2626;
}

/* Top chrome — theme toggle + sign in / profile */
.top-chrome {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  line-height: 0;
  border-radius: 999px;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent-strong, #7A6CB8);
  outline-offset: 2px;
}

.theme-toggle__track {
  position: relative;
  display: block;
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: #B5A7D4;
  box-shadow: inset 0 1px 2px rgba(31, 26, 54, 0.18);
  transition: background 280ms ease;
}

.theme-toggle--dark .theme-toggle__track {
  background: #CDBFA0;
  box-shadow: inset 0 1px 2px rgba(31, 26, 54, 0.22);
}

.theme-toggle__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 26, 54, 0.22);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.theme-toggle--dark .theme-toggle__knob {
  transform: translateX(20px);
}

.theme-toggle__sun {
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 11px;
  color: #fff;
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 1;
  pointer-events: none;
}

.theme-toggle--dark .theme-toggle__sun {
  opacity: 1;
}

.theme-toggle__sun-icon {
  display: block;
  width: 11px;
  height: 11px;
}

.theme-toggle__moon {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  color: #E8DFC8;
  opacity: 1;
  transition: opacity 200ms ease;
  z-index: 1;
  pointer-events: none;
}

.theme-toggle__moon-icon {
  display: block;
  width: 10px;
  height: 10px;
}

.theme-toggle--dark .theme-toggle__moon {
  opacity: 0;
}

/* Sign-in link (landing only) */
.signin-link {
  position: static;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--chrome-link);
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-btn);
  background: none;
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
}

.signin-link:hover {
  color: var(--ink);
  background: var(--chrome-link-hover-bg);
}

[data-theme="light"] body:has(.screen.landing) .signin-link {
  color: var(--chrome-link);
}

[data-theme="light"] body:has(.screen.landing) .signin-link:hover {
  color: var(--ink);
  background: var(--chrome-link-hover-bg);
}

[data-theme="dark"] .top-chrome .signin-link {
  color: var(--chrome-link);
}

[data-theme="dark"] .top-chrome .signin-link:hover {
  color: var(--ink);
  background: var(--chrome-link-hover-bg);
}

/* Saved indicator on reveal */
.saved-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  color: #15803d;
  font-size: 14px;
  font-weight: 500;
}

.saved-indicator__icon {
  font-size: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   PROFILE SCREEN
   ═══════════════════════════════════════════════════════════════ */

.profile-screen {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space);
  padding-bottom: 48px;
}

.profile-top {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  margin-bottom: 20px;
}

.profile-top-spacer {
  width: 40px;
  height: 1px;
}

.profile-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  text-align: center;
  justify-self: center;
  grid-column: 2;
}

.icon-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  justify-self: start;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.icon-back-btn:hover {
  color: var(--ink);
  background: var(--chrome-link-hover-bg);
}

.icon-back-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon-back-btn__svg {
  display: block;
  width: 20px;
  height: 20px;
}

.profile-preview-note {
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.45;
  margin: -8px 0 20px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border-radius: 10px;
  border: 1px solid var(--input-border);
}

.profile-loading,
.profile-error {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.profile-error {
  color: #b45309;
}

.profile-retry {
  margin-top: 12px;
}

.profile-section {
  margin-bottom: 16px;
  padding: 20px;
}

.profile-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin: 0 0 14px;
}

.profile-muted {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

.profile-sis-score {
  font-size: 1rem;
  color: var(--ink);
  margin: 0;
}

.profile-sis-score strong {
  font-weight: 700;
}

.fault-line--profile {
  margin-top: 4px;
}

.last-session-date {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin: 0 0 6px;
}

.last-session-archetype {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 14px;
  line-height: 1.3;
}

.profile-streak-line {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.profile-streak-num {
  font-weight: 600;
  color: var(--ink);
}

.profile-session-toggle {
  margin-bottom: 18px;
}

.profile-session-toggle__track {
  display: flex;
  position: relative;
  background: var(--toggle-track-bg);
  border-radius: 999px;
  padding: 3px;
}

.profile-session-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  width: calc((100% - 6px) / 2);
  border-radius: 999px;
  background: var(--toggle-thumb-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}

.profile-session-toggle--today .profile-session-toggle__thumb {
  transform: translateX(100%);
}

.profile-session-toggle--yesterday .profile-session-toggle__thumb {
  transform: translateX(0);
}

.profile-session-toggle__btn {
  flex: 1;
  position: relative;
  z-index: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.2s ease;
}

.profile-session-toggle__btn--active {
  color: var(--ink);
}

[data-theme="dark"] .profile-session-toggle__btn--active {
  color: var(--on-accent-strong);
}

.profile-session-toggle__btn:hover {
  color: var(--ink);
}

[data-theme="dark"] .profile-session-toggle__btn--active:hover {
  color: var(--on-accent-strong);
}

.profile-pulse-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.profile-pulse-heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 10px;
  letter-spacing: 0;
  text-transform: none;
}

.profile-pulse-insight {
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.55;
  margin: 0;
}

.profile-pro-hint {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin: 10px 0 0;
  line-height: 1.45;
}

.profile-sis-caption {
  font-size: 0.84rem;
  color: var(--ink-muted);
  margin: 10px 0 0;
  line-height: 1.45;
}

.fault-line--meter-100 {
  margin-top: 8px;
}

.milestone-bubbles {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 8px;
  margin-top: 8px;
}

.milestone-bubble {
  flex: 1 1 18%;
  min-width: 64px;
  max-width: 92px;
  text-align: center;
}

.milestone-bubble__ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid var(--hairline);
  background: var(--bg-subtle);
}

.milestone-bubble--spark .milestone-bubble__ring {
  border-color: #60a5fa;
  background: rgba(96, 165, 250, 0.15);
}

.milestone-bubble--cadence .milestone-bubble__ring {
  border-color: #a78bfa;
  background: rgba(167, 139, 250, 0.15);
}

.milestone-bubble--jedi .milestone-bubble__ring {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.15);
}

.milestone-bubble--oracle .milestone-bubble__ring {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.18);
}

.milestone-bubble--unlocked .milestone-bubble__ring {
  border-width: 2px;
}

.milestone-bubble--locked {
  opacity: 0.55;
}

.milestone-bubble--locked .milestone-bubble__title {
  color: var(--ink-muted);
}

.milestone-bubble__title {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.milestone-bubble__sub {
  display: block;
  font-size: 0.68rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.profile-pulse-report-cta .pulse-report-link {
  margin-top: 12px;
  width: 100%;
}

.pulse-report-screen {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space);
  padding-bottom: 48px;
}

.pulse-report-top {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  margin-bottom: 24px;
}

.pulse-report-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  text-align: center;
  grid-column: 2;
}

.pulse-report-inner {
  max-width: 36rem;
  margin: 0 auto;
}

.pulse-report-lead {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 20px;
}

.pulse-report-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 10px;
}

.pulse-report-card {
  padding: 20px;
}

.milestones-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.milestone-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
}

.milestone-row--done {
  border-color: var(--milestone-done-border);
  background: var(--milestone-done-bg);
}

.milestone-row--locked {
  opacity: 0.72;
}

.milestone-row__mark {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--ink-muted);
  width: 1.25rem;
  text-align: center;
}

.milestone-row--done .milestone-row__mark {
  color: var(--accent-strong);
}

.milestone-row__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.milestone-row__sub {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.profile-account-card .profile-section-title {
  margin-bottom: 16px;
}

.profile-name-form {
  margin-bottom: 16px;
}

.profile-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.profile-name-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-input {
  flex: 1;
  min-width: 140px;
  padding: 12px 14px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--input-bg);
  color: var(--ink);
}

.profile-save-name {
  flex-shrink: 0;
}

.profile-field {
  margin-bottom: 14px;
}

.profile-email-readonly,
.profile-plan {
  display: block;
  font-size: 0.95rem;
  color: var(--ink);
  margin-top: 4px;
}

.profile-delete-btn {
  width: 100%;
  margin-top: 8px;
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid var(--error-border);
}

.profile-delete-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.profile-delete-hint {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin: 8px 0 0;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════
   NOIR — component overrides
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .card {
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .profile-screen .card-pastel {
  background: var(--panel-bg);
}

[data-theme="dark"] .profile-screen .fault-line--profile {
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

[data-theme="dark"] .milestone-bubble--spark .milestone-bubble__ring {
  border-color: var(--accent-strong);
  background: rgba(240, 204, 133, 0.12);
}

[data-theme="dark"] .milestone-bubble--cadence .milestone-bubble__ring {
  border-color: var(--accent);
  background: rgba(232, 184, 96, 0.12);
}

[data-theme="dark"] .milestone-bubble--jedi .milestone-bubble__ring {
  border-color: #C8A040;
  background: rgba(200, 160, 64, 0.12);
}

[data-theme="dark"] .milestone-bubble--oracle .milestone-bubble__ring {
  border-color: #F0CC85;
  background: rgba(240, 204, 133, 0.18);
}

[data-theme="dark"] .undo-icon {
  filter: drop-shadow(0 0 1px var(--bg)) drop-shadow(0 0 2px rgba(240, 204, 133, 0.4));
}

[data-theme="dark"] .undo-icon.show {
  animation: undoGlowYoursDark 2.5s ease infinite;
}

[data-theme="dark"] .option-btn.selected-pulse .undo-icon.show {
  animation: undoGlowPeopleDark 2.5s ease infinite;
}

@keyframes undoGlowYoursDark {
  0%, 100% {
    filter: drop-shadow(0 0 1px var(--bg)) drop-shadow(0 0 4px rgba(240, 204, 133, 0.45));
  }
  50% {
    filter: drop-shadow(0 0 2px var(--bg)) drop-shadow(0 0 8px rgba(240, 204, 133, 0.65));
  }
}

@keyframes undoGlowPeopleDark {
  0%, 100% {
    filter: drop-shadow(0 0 1px var(--bg)) drop-shadow(0 0 4px rgba(212, 220, 232, 0.45));
  }
  50% {
    filter: drop-shadow(0 0 2px var(--bg)) drop-shadow(0 0 8px rgba(212, 220, 232, 0.65));
  }
}

[data-theme="dark"] .option-btn.selected-pulse.can-undo {
  animation: canUndoPulsePearlDark 1.2s ease-in-out infinite;
}

@keyframes canUndoPulsePearlDark {
  0%, 100% {
    border-color: var(--state-personal);
    box-shadow:
      inset 0 0 0 2px rgba(212, 220, 232, 0.22),
      0 0 0 2px rgba(212, 220, 232, 0.32),
      0 0 12px rgba(212, 220, 232, 0.18);
  }
  50% {
    border-color: #E8EEF4;
    box-shadow:
      inset 0 0 0 2px rgba(212, 220, 232, 0.38),
      0 0 0 3px rgba(212, 220, 232, 0.48),
      0 0 20px rgba(212, 220, 232, 0.28);
  }
}

[data-theme="dark"] .option-btn.can-undo {
  animation: canUndoPulseDark 1.2s ease-in-out infinite;
}

@keyframes canUndoPulseDark {
  0%, 100% {
    border-color: var(--state-pulse);
    box-shadow:
      inset 0 0 0 2px rgba(240, 204, 133, 0.2),
      0 0 0 2px rgba(240, 204, 133, 0.25),
      0 0 12px rgba(240, 204, 133, 0.15);
  }
  50% {
    border-color: var(--accent-strong);
    box-shadow:
      inset 0 0 0 2px rgba(240, 204, 133, 0.35),
      0 0 0 3px rgba(240, 204, 133, 0.4),
      0 0 20px rgba(240, 204, 133, 0.25);
  }
}

/* Share card export stays light-branded — no dark overrides */

/* ═══════════════════════════════════════════════════════════════
   LANDING RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 640px) {
  :root {
    --landing-headline: clamp(calc(2.05rem * var(--landing-scale)), 6vw, calc(2.82rem * var(--landing-scale)));
    --display-headline: clamp(2.05rem, 6vw, 2.82rem);
  }

  .landing-frame {
    --landing-lead: clamp(calc(0.66rem * var(--landing-scale)), 2.24vw, calc(0.76rem * var(--landing-scale)));
    --landing-btn-size: clamp(calc(0.64rem * var(--landing-scale)), 2vw, calc(0.72rem * var(--landing-scale)));
    --landing-btn-pad-y: 12px;
    --landing-btn-pad-x: 40px;
  }

  .landing-content .btn-primary {
    padding: 14px 42px;
  }
}

@media (min-width: 1024px) {
  :root {
    --landing-headline: clamp(calc(2.28rem * var(--landing-scale)), 4.6vw, calc(3.05rem * var(--landing-scale)));
    --display-headline: clamp(2.28rem, 4.6vw, 3.05rem);
  }

  .landing-frame {
    --landing-lead: clamp(calc(0.68rem * var(--landing-scale)), 1.92vw, calc(0.8rem * var(--landing-scale)));
    --landing-btn-size: clamp(calc(0.68rem * var(--landing-scale)), 1.6vw, calc(0.76rem * var(--landing-scale)));
    --landing-btn-pad-y: 14px;
    --landing-btn-pad-x: 44px;
  }
}

/* Very small phones — allow headline lines to wrap if needed */
@media (max-width: 639px) {
  .landing-header:not(:has(.streak-badge)) {
    justify-content: center;
  }

  .landing-header:has(.streak-badge) .brand {
    margin-left: clamp(4px, 2vw, 10px);
  }
}

@media (max-width: 480px) {
  :root {
    --landing-headline: clamp(calc(1.58rem * var(--landing-scale)), 7.5vw, calc(2.08rem * var(--landing-scale)));
    --display-headline: clamp(1.58rem, 7.5vw, 2.08rem);
  }

  .landing-frame {
    --landing-lead: clamp(calc(0.6rem * var(--landing-scale)), 3.2vw, calc(0.68rem * var(--landing-scale)));
    --landing-btn-size: clamp(calc(0.56rem * var(--landing-scale)), 2.6vw, calc(0.64rem * var(--landing-scale)));
    --landing-btn-pad-y: 9px;
    --landing-btn-pad-x: 26px;
  }

  .landing-headline-line {
    white-space: normal;
  }

  .lead-line {
    flex-direction: column;
    align-items: center;
    gap: 0.1em;
  }

  .lead-prefix {
    white-space: normal;
    text-align: center;
  }

  .landing-content h1 {
    margin-bottom: 24px;
  }

  .question-scenario .question-text {
    padding: 10px 12px 12px;
  }

  .question-text {
    padding: 14px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
