/* ═══════════════════════════════════════════════════
   Light of Day — Tarot Reading
   Dual Theme (Dawn / Night) + Warm Emotional Design
   ═══════════════════════════════════════════════════ */

/* ── Dawn Theme (Default — warm, gentle, safe) ── */
[data-theme="dawn"] {
  --bg-primary: #faf7f2;
  --bg-secondary: #f0ebe3;
  --bg-card: #fff8ef;
  --bg-recessed: #ebe2d4;
  --bg-nav: rgba(250, 247, 242, 0.92);
  --gold: #a0845c;
  --gold-light: #c4a66a;
  --gold-dim: #8b7350;
  --gold-deep: #6b5530;
  --accent: #7b6b8a;
  --accent-light: #a594b5;
  --accent-dark: #4a3d5c;
  --text-primary: #3d3630;
  --text-secondary: #6b6055;
  --text-dim: #9a9088;
  --border-soft: rgba(160, 132, 92, 0.15);
  --border-accent: rgba(123, 107, 138, 0.2);
  /* Asymmetric two-layer: tight contact shadow + offset soft shadow (light from upper-left) */
  --shadow-soft: 0 1px 2px rgba(60, 40, 20, 0.07), 0 6px 18px -6px rgba(60, 40, 20, 0.12);
  --shadow-card: 0 1px 2px rgba(60, 40, 20, 0.09), 0 14px 32px -10px rgba(60, 40, 20, 0.18);
  --card-bg-major: linear-gradient(180deg, #f5eee4, #ebe2d4);
  --card-bg-wands: linear-gradient(180deg, #faf0ea, #f0e0d0);
  --card-bg-cups: linear-gradient(180deg, #eef2fa, #dde5f2);
  --card-bg-swords: linear-gradient(180deg, #f0f0f2, #e4e4ea);
  --card-bg-pentacles: linear-gradient(180deg, #eef5ee, #dce8dc);
  --card-back-bg: linear-gradient(135deg, #e8ddd0, #d4c8b8);
  --card-back-border: var(--gold);
  --reflection-bg: rgba(123, 107, 138, 0.06);
  --star-color: rgba(160, 132, 92, 0.15);
  --glow-color: rgba(123, 107, 138, 0.08);
  --wands: #c06040;
  --cups: #5080b0;
  --swords: #708090;
  --pentacles: #508050;
}

/* ── Night Theme (default) — dark navy near the icon ground, less saturated ── */
[data-theme="night"] {
  --bg-primary: #0e1828;
  --bg-secondary: #121d31;
  --bg-card: #16223a;
  --bg-recessed: #08111e;
  --bg-nav: rgba(14, 24, 40, 0.9);
  /* Antique gold tuned to match the engraved card-back illustration */
  --gold: #c9a961;
  --gold-light: #e6c97a;
  --gold-dim: #9b8240;
  --gold-deep: #6b5828;
  --accent: #9b6fd0;
  --accent-light: #b88ae8;
  --accent-dark: #6b3fa0;
  --text-primary: #e8e4d9;
  --text-secondary: #a09880;
  --text-dim: #6b6555;
  --border-soft: rgba(201, 169, 97, 0.18);
  --border-accent: rgba(155, 111, 208, 0.2);
  /* Deeper contact shadow on dark ground; offset soft shadow */
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 22px -6px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.55), 0 18px 40px -12px rgba(0, 0, 0, 0.55);
  --card-bg-major: linear-gradient(180deg, #1a0a2e, #0d0620);
  --card-bg-wands: linear-gradient(180deg, #1a0a0a, #2a1010);
  --card-bg-cups: linear-gradient(180deg, #0a0a1a, #0d1525);
  --card-bg-swords: linear-gradient(180deg, #0a0a0f, #151520);
  --card-bg-pentacles: linear-gradient(180deg, #0a1a0a, #0d200d);
  --card-back-bg: linear-gradient(135deg, #1a0a2e, #2d1b4e);
  --card-back-border: var(--gold);
  --reflection-bg: rgba(155, 111, 208, 0.08);
  --star-color: #c9a961;
  --glow-color: rgba(107, 63, 160, 0.2);
  --wands: #e84c3d;
  --cups: #3498db;
  --swords: #95a5a6;
  --pentacles: #27ae60;
}

/* ── CSS Variables (shared) ── */
:root {
  --card-width: 240px;
  --card-height: 384px;
  --card-width-sm: 160px;
  --card-height-sm: 256px;
  --transition-smooth: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --font-display: 'Cinzel', serif;
  --font-body: 'Cormorant Garamond', serif;
  --font-cn: 'Noto Serif SC', serif;
}

/* CJK font override */
[data-lang="zh"] body,
[data-lang="zh"] .question-input,
[data-lang="zh"] .reflection-input,
[data-lang="zh"] .field-role,
[data-lang="zh"] .field-label,
[data-lang="zh"] .field-hint,
[data-lang="zh"] .custom-card-label,
[data-lang="zh"] .welcome-message,
[data-lang="zh"] .result-meaning,
[data-lang="zh"] .modal-section p,
[data-lang="zh"] .journal-entry-note,
[data-lang="zh"] .journal-entry-reflection {
  font-family: var(--font-cn), var(--font-body), serif;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background 0.5s ease, color 0.5s ease;
}

/* Paper grain — barely-visible printed-page texture (isotropic) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
[data-theme="night"] body::before {
  opacity: 0.06;
  mix-blend-mode: screen;
}

/* Paper fiber — anisotropic vertical streaks suggesting handmade paper grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.025;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='400'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.02 0.6' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23f)'/></svg>");
}
[data-theme="night"] body::after {
  opacity: 0.03;
  mix-blend-mode: screen;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Star/Ambient Background ── */
.stars-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: var(--star-color);
  box-shadow: 0 0 4px var(--star-color), 0 0 8px var(--star-color);
  animation: twinkle var(--duration) ease-in-out infinite;
  opacity: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50% { opacity: var(--max-opacity); transform: scale(1); }
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.5s ease;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 2px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.nav-brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}
.nav-brand-text { line-height: 1; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 10;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  position: relative;
}

.nav-auth[hidden] {
  display: none;
}

.nav-auth-btn {
  height: 34px;
  width: 34px;
  max-width: 34px;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  transition: all var(--transition-smooth);
}

.nav-auth-btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.nav-auth-btn:disabled {
  cursor: default;
  opacity: 0.72;
}

.nav-auth-mark {
  width: auto;
  height: auto;
  border-radius: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: currentColor;
  font-family: Arial, sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
}

.nav-auth-text {
  position: absolute;
  width: 1px;
  height: 1px;
  min-width: 1px;
  max-width: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
}

.nav-auth-logout {
  flex: 0 0 auto;
}

.nav-auth-logout[hidden] {
  display: none;
}

.nav-auth-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 86px;
  padding: 0.35rem;
  background: var(--bg-nav);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  z-index: 30;
}

.nav-auth-menu[hidden] {
  display: none;
}

.nav-auth-menu-item {
  width: 100%;
  padding: 0.42rem 0.55rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-align: left;
}

.nav-auth-menu-item:hover,
.nav-auth-menu-item:focus-visible {
  background: rgba(184, 151, 100, 0.1);
  color: var(--gold);
  outline: none;
}

.nav-icon-btn {
  background: none;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition-smooth);
}

.nav-icon-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.pwa-install-btn[hidden] {
  display: none;
}

.lang-label {
  font-family: var(--font-cn);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Nav SVG icons (theme toggle, hamburger) */
.nav-icon-svg {
  width: 16px;
  height: 16px;
  display: block;
  color: currentColor;
}
.nav-toggle .nav-icon-svg { width: 20px; height: 20px; }

/* Theme icon toggle */
[data-theme="dawn"] .theme-icon-sun { display: none; }
[data-theme="dawn"] .theme-icon-moon { display: block; }
[data-theme="night"] .theme-icon-sun { display: block; }
[data-theme="night"] .theme-icon-moon { display: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-soft);
  color: var(--gold);
  font-size: 1.2rem;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  border-radius: 4px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 1px;
  transition: color var(--transition-smooth);
  position: relative;
  white-space: nowrap;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width var(--transition-smooth);
}

.nav-link:hover, .nav-link.active { color: var(--gold); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-more {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-more-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.nav-more-menu {
  position: absolute;
  top: calc(100% + 0.85rem);
  left: 50%;
  display: none;
  min-width: 132px;
  padding: 0.45rem;
  transform: translateX(-50%);
  background: var(--bg-nav);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.nav-more.open .nav-more-menu,
.nav-more:hover .nav-more-menu,
.nav-more:focus-within .nav-more-menu {
  display: grid;
}

.nav-more-link {
  padding: 0.52rem 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.76rem;
  letter-spacing: 0.9px;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 6px;
}

.nav-more-link:hover,
.nav-more-link.active {
  color: var(--gold);
  background: rgba(184, 151, 100, 0.08);
}

@media (max-width: 980px) and (min-width: 769px) {
  .nav-links {
    gap: 0.9rem;
  }

  .nav-link {
    font-size: 0.7rem;
    letter-spacing: 0.7px;
  }
}

/* ── Pages ── */
.page {
  display: none;
  min-height: 100vh;
  padding: 4rem 2rem 3rem;
  position: relative;
  z-index: 1;
}

.page.active {
  display: block;
  animation: pageFadeIn 0.6s ease-out;
}

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

/* ── Section Titles ── */
.section-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  text-align: center;
  color: var(--gold);
  margin-bottom: 0.4rem;
  letter-spacing: 4px;
  font-weight: 600;
}

.section-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 1rem;
  font-style: italic;
  margin-bottom: 2rem;
  letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════
   WHY THIS EXISTS
   ═══════════════════════════════════════ */
.why-page {
  padding: 5.8rem 1.5rem 4rem;
  overflow: hidden;
}

.why-container {
  max-width: 760px;
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 2.75rem);
  text-align: left;
}

.why-return {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 2rem;
  color: var(--text-dim);
  font-size: 0.98rem;
  font-style: italic;
  line-height: 1.2;
  text-decoration: none;
  transition: color var(--transition-smooth);
}

.why-return:hover {
  color: var(--gold);
}

.why-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 2.35rem;
}

.why-card-mark {
  width: 62px;
  height: 99px;
  border-radius: 8px;
  overflow: hidden;
  transform: rotate(-4deg);
  box-shadow: var(--shadow-card);
}

.why-card-mark .card-back-design {
  border-radius: 8px;
}

.why-page .section-title {
  margin: 0 0 0.45rem;
  color: var(--gold);
  font-size: clamp(1.95rem, 5vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: 0;
  text-align: left;
}

.why-page .section-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.22rem;
  line-height: 1.5;
  letter-spacing: 0;
  text-align: left;
}

.why-copy {
  max-width: 640px;
  margin-left: calc(62px + 1.1rem);
  color: var(--text-secondary);
  font-size: 1.08rem;
  line-height: 1.82;
  text-align: left;
}

.why-copy p {
  margin-bottom: 1.05rem;
}

.why-highlight {
  color: var(--text-primary);
}

.why-section {
  margin-bottom: 1.35rem;
}

.why-intro {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.why-intro p {
  margin-bottom: 1.05rem;
}

.why-origin {
  max-width: 590px;
}

.why-reminder {
  margin: 1.6rem 0 1.55rem;
  padding: 0.05rem 0 0.05rem 1rem;
  border-left: 1px solid var(--border-soft);
}

.why-focus-line {
  margin-bottom: 0.7rem;
  color: inherit;
  font-size: inherit;
  font-style: normal;
  letter-spacing: 0;
}

.why-emphasis {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font-style: normal;
  text-align: left;
}

.why-emphasis p {
  margin-bottom: 0.38rem;
  font-size: inherit;
  line-height: inherit;
}

.why-emphasis p:last-child {
  margin-bottom: 0;
}

.why-shape {
  margin-top: 1.35rem;
}

.why-ending {
  margin-top: 1.65rem;
}

.why-note {
  margin: 0 0 1.05rem;
  padding-top: 0;
  border-top: 0;
  color: inherit;
  font-size: inherit;
  font-style: normal;
  text-align: left;
}

.why-closing {
  margin: 0 0 0.55rem;
  color: inherit;
}

.why-closing-final {
  margin-bottom: 0;
}

[data-lang="zh"] .why-copy {
  font-family: var(--font-cn), var(--font-body), serif;
}

/* ═══════════════════════════════════════
   HERO / HOME PAGE
   ═══════════════════════════════════════ */
.hero {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding-top: 3rem;
}

/* Minimalist hero — fewer competing elements, more breathing room */
.hero-minimal {
  padding-top: 2.5rem;
  padding-bottom: 2rem;
  position: relative;
}

.hero-glow { display: none; }

/* ── Reusable divider — drop in <img class="divider" src="assets/divider-celestial.png" alt=""> ── */
.divider {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  margin: 2.5rem auto;
  opacity: 0.85;
}

/* Faint sun + sacred-geometry watermark behind the title */
.hero-art {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 460px;
  height: 460px;
  pointer-events: none;
  z-index: -1;
  animation: heroArtBreathe 8s ease-in-out infinite;
}
@keyframes heroArtBreathe {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
  50%      { transform: translateX(-50%) scale(1.04); opacity: 0.85; }
}

/* Hero divider — celestial line+crescent+star ornament */
.hero-divider {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  margin: 0 auto 1.4rem;
  opacity: 0.85;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: 4px;
  color: var(--gold-dim);
  margin-bottom: 1rem;
  position: relative;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 3rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 1.65;
}

.journal-auth-entry {
  display: flex;
  justify-content: flex-end;
  margin: -0.95rem 0 1rem;
  min-height: 32px;
}

.journal-sync-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.58rem;
  border: 1px solid rgba(184, 151, 100, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0;
  opacity: 0.86;
  transition: border-color var(--transition-smooth), color var(--transition-smooth), opacity var(--transition-smooth);
}

.journal-sync-link:hover,
.journal-sync-link:focus-visible {
  border-color: rgba(184, 151, 100, 0.5);
  color: var(--gold-dim);
  opacity: 1;
  outline: none;
}

.journal-sync-link:disabled {
  cursor: default;
  opacity: 0.42;
}

.journal-sync-link[hidden] {
  display: none;
}

.journal-sync-mark {
  font-family: Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
}

.journal-storage-note {
  max-width: 560px;
  margin: -0.45rem auto 1.1rem;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
  opacity: 0.72;
}

.hero-cta {
  margin-top: 0.5rem;
}

.hero-tagline {
  margin-top: 1.8rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.hero-link {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color var(--transition-smooth), border-color var(--transition-smooth);
}
.hero-link:hover {
  color: var(--gold);
  border-bottom-color: var(--gold-dim);
}
.hero-sep {
  margin: 0 0.7rem;
  opacity: 0.5;
}

.home-start-panel {
  width: min(760px, 100%);
  margin: 0 auto;
  text-align: left;
}

.home-start-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.home-start-option {
  min-height: 118px;
  padding: 1rem 1.1rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth), transform var(--transition-smooth);
}

.home-start-option:hover,
.home-start-option:focus-visible {
  border-color: var(--gold-dim);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
  outline: none;
}

.home-start-kicker {
  display: block;
  margin-bottom: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.home-start-title {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.home-start-copy {
  display: block;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.45;
}

.home-custom-start {
  position: relative;
  padding: 1rem;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid rgba(184, 151, 100, 0.38);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.home-custom-start::before {
  content: '';
  position: absolute;
  inset: -35% auto auto -15%;
  width: 38%;
  height: 170%;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 243, 204, 0.24) 45%, transparent 75%);
  transform: translateX(-120%) rotate(12deg);
  animation: homeStartShine 5.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes homeStartShine {
  0%, 58% { transform: translateX(-130%) rotate(12deg); opacity: 0; }
  68% { opacity: 1; }
  100% { transform: translateX(330%) rotate(12deg); opacity: 0; }
}

.home-custom-label {
  display: block;
  margin-bottom: 0.65rem;
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--gold);
  letter-spacing: 1.2px;
}

.home-custom-text {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  padding: 0.9rem 1rem;
  background: var(--input-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
}

.home-custom-text:focus {
  border-color: var(--gold-dim);
  outline: none;
  box-shadow: 0 0 0 3px rgba(184, 151, 100, 0.14);
}

.home-custom-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.home-spread-shortcuts {
  margin-top: 0.95rem;
}

.home-spread-shortcuts-label {
  display: block;
  margin-bottom: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.64rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
}

.home-spread-shortcut-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.home-spread-shortcut {
  min-height: 68px;
  padding: 0.65rem 0.72rem;
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(184, 151, 100, 0.24);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-smooth), background var(--transition-smooth), transform var(--transition-smooth);
}

.home-spread-shortcut:hover,
.home-spread-shortcut:focus-visible {
  background: rgba(184, 151, 100, 0.08);
  border-color: rgba(184, 151, 100, 0.54);
  transform: translateY(-1px);
  outline: none;
}

.home-spread-shortcut-name,
.home-spread-shortcut-meta {
  display: block;
}

.home-spread-shortcut-name {
  font-family: var(--font-display);
  font-size: 0.86rem;
  line-height: 1.18;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.home-spread-shortcut-meta {
  margin-top: 0.3rem;
  font-size: 0.76rem;
  line-height: 1.2;
  color: var(--text-secondary);
}

/* 0.5 start flow: make generated spread the primary path, with quieter fallbacks. */
.home-start-panel {
  width: min(680px, 100%);
}

.home-custom-start {
  padding: 1.15rem;
  background:
    linear-gradient(180deg, rgba(255, 247, 220, 0.035), transparent 54%),
    var(--bg-secondary);
}

.home-custom-kicker {
  display: block;
  margin-bottom: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.home-custom-label {
  margin-bottom: 0.75rem;
  font-size: 1.04rem;
  letter-spacing: 1px;
}

.home-custom-help {
  margin: -0.35rem 0 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.45;
}

.home-custom-text {
  min-height: 132px;
  background: rgba(0, 0, 0, 0.12);
}

.home-start-actions {
  width: min(520px, 100%);
  margin: 0.85rem auto 0;
  gap: 0.7rem;
}

.home-start-option {
  min-height: 74px;
  padding: 0.72rem 0.85rem;
  background: transparent;
  border-color: rgba(184, 151, 100, 0.2);
  box-shadow: none;
}

.home-start-option:hover,
.home-start-option:focus-visible {
  border-color: rgba(184, 151, 100, 0.54);
  box-shadow: none;
}

.draw-link-favorites {
  width: min(520px, 100%);
  margin: 0.95rem auto 0;
  padding: 0.75rem;
  background: rgba(255, 247, 220, 0.025);
  border: 1px solid rgba(184, 151, 100, 0.18);
  border-radius: 8px;
}

.draw-link-favorites-header {
  margin-bottom: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.draw-link-favorites-list {
  display: grid;
  gap: 0.45rem;
}

.draw-link-favorite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0.4rem;
}

.draw-link-favorite {
  min-width: 0;
  padding: 0.55rem 0.7rem;
  color: var(--text-secondary);
  text-decoration: none;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  transition: border-color var(--transition-smooth), color var(--transition-smooth);
}

.draw-link-favorite:hover,
.draw-link-favorite:focus-visible {
  color: var(--gold);
  border-color: var(--gold-dim);
  outline: none;
}

.draw-link-favorite-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draw-link-remove-btn {
  width: 2.2rem;
  min-height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color var(--transition-smooth), color var(--transition-smooth);
}

.draw-link-remove-btn:hover,
.draw-link-remove-btn:focus-visible {
  color: var(--gold);
  border-color: var(--gold-dim);
  outline: none;
}

.home-start-kicker {
  margin-bottom: 0.25rem;
  font-size: 0.62rem;
  letter-spacing: 1.4px;
}

.home-start-title {
  margin-bottom: 0.2rem;
  font-size: 0.92rem;
}

.home-start-copy {
  font-size: 0.84rem;
}

.btn-shine {
  box-shadow: 0 0 28px rgba(184, 151, 100, 0.2);
}


/* Welcome message — the warmth */
.welcome-message {
  max-width: 520px;
  margin: 0 auto 2.5rem;
  padding: 1.5rem 2rem;
  background: var(--reflection-bg);
  border-radius: 16px;
  border: 1px solid var(--border-soft);
}

.welcome-message p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  font-style: italic;
}

/* Hero floating cards */
.hero-cards-row {
  display: flex;
  justify-content: center;
  gap: 2.4rem;
  margin-bottom: 2.4rem;
  perspective: 1000px;
}

.hero-card {
  width: 100px;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  transform: rotate(var(--rotation));
  animation: heroFloat 4s ease-in-out infinite;
  animation-delay: var(--delay);
  box-shadow: var(--shadow-card);
}

@keyframes heroFloat {
  0%, 100% { transform: rotate(var(--rotation)) translateY(0); }
  50% { transform: rotate(var(--rotation)) translateY(-12px); }
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature {
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 1.8rem 1.2rem;
  transition: all var(--transition-smooth);
  cursor: pointer;
}

.feature:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.feature-icon { font-size: 2rem; display: block; margin-bottom: 0.8rem; }
.feature h3 { font-family: var(--font-display); color: var(--gold); font-size: 0.9rem; margin-bottom: 0.4rem; letter-spacing: 1px; }
.feature p { color: var(--text-secondary); font-size: 0.95rem; }

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */
.btn-primary {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 2px;
  padding: 0.9rem 2.2rem;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 50px;
  cursor: pointer;
  transition: background var(--transition-smooth), color var(--transition-smooth),
              border-color var(--transition-smooth), box-shadow var(--transition-smooth),
              transform var(--transition-smooth);
}

.btn-primary:hover {
  background: var(--gold);
  color: var(--bg-primary);
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 1px 2px rgba(60, 40, 20, 0.18), 0 10px 24px -8px rgba(160, 132, 92, 0.45);
}

.glow-pulse { animation: glowPulse 3s ease-in-out infinite; }

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(160, 132, 92, 0.2); }
  50% { box-shadow: 0 0 20px rgba(160, 132, 92, 0.4); }
}

.btn-secondary {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 2px;
  padding: 0.7rem 1.8rem;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition-smooth);
  margin-top: 2rem;
}

.btn-secondary:hover {
  background: rgba(160, 132, 92, 0.1);
  border-color: var(--gold);
}

.btn-gentle {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.6rem 1.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.btn-gentle:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-ghost {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.5rem 1.2rem;
  background: transparent;
  color: var(--text-dim);
  border: none;
  cursor: pointer;
  transition: color 0.3s;
}

.btn-ghost:hover { color: var(--text-secondary); }

.btn-small { font-size: 0.85rem; }
.btn-danger:hover { color: #c0392b; }

/* ═══════════════════════════════════════
   READING PAGES
   ═══════════════════════════════════════ */
.reading-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.question-input-container {
  max-width: 520px;
  margin: 0 auto 2rem;
  text-align: left;
}

.question-input-container-primary {
  max-width: 620px;
}

.field-role {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.45rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.78rem;
  line-height: 1.2;
}

.field-role-primary {
  border-color: rgba(160, 132, 92, 0.45);
  color: var(--gold);
}

.field-role-advanced {
  border-color: var(--border-accent);
  color: var(--accent);
}

.field-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.35;
}

.field-label-primary {
  color: var(--text-primary);
  font-size: 1.16rem;
}

.field-hint {
  margin: 0.35rem 0 0.8rem;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.5;
}

.question-input {
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 50px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-style: italic;
  text-align: left;
  outline: none;
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.question-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(160, 132, 92, 0.1);
}

.question-input::placeholder { color: var(--text-dim); }

/* ── Card Deck ── */
.deck-area { display: flex; justify-content: center; margin-bottom: 2rem; }

.card-deck {
  position: relative;
  width: var(--card-width);
  height: var(--card-height);
}

.deck-card {
  position: absolute;
  width: 100%; height: 100%;
  border-radius: 10px;
  background: #0d1f3d url('../assets/card-back.jpg') center/cover no-repeat;
  border: none;
  transition: all 0.3s ease;
  top: calc(var(--i) * -3px);
  left: calc(var(--i) * -2px);
  box-shadow: var(--shadow-soft);
}

.deck-card::after { display: none; }

/* Shuffle animations */
.shuffling .deck-card { animation: shuffleCards 0.4s ease-in-out both; }
.shuffling .deck-card:nth-child(1) { animation-delay: 0s; }
.shuffling .deck-card:nth-child(2) { animation-delay: 0.1s; }
.shuffling .deck-card:nth-child(3) { animation-delay: 0.2s; }
.shuffling .deck-card:nth-child(4) { animation-delay: 0.3s; }
.shuffling .deck-card:nth-child(5) { animation-delay: 0.4s; }

@keyframes shuffleCards {
  0% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-30px) rotate(-5deg); }
  50% { transform: translateX(30px) rotate(5deg); }
  75% { transform: translateX(-15px) rotate(-2deg); }
  100% { transform: translateX(0) rotate(0); }
}

.shuffling-2 .deck-card { animation: shuffleCards2 0.5s ease-in-out both; }
.shuffling-2 .deck-card:nth-child(1) { animation-delay: 0s; }
.shuffling-2 .deck-card:nth-child(2) { animation-delay: 0.08s; }
.shuffling-2 .deck-card:nth-child(3) { animation-delay: 0.16s; }
.shuffling-2 .deck-card:nth-child(4) { animation-delay: 0.24s; }
.shuffling-2 .deck-card:nth-child(5) { animation-delay: 0.32s; }

@keyframes shuffleCards2 {
  0% { transform: translateX(0) translateY(0); }
  30% { transform: translateX(20px) translateY(-20px) rotate(8deg); }
  60% { transform: translateX(-20px) translateY(-10px) rotate(-5deg); }
  100% { transform: translateX(0) translateY(0) rotate(0); }
}

/* ═══════════════════════════════════════
   TAROT CARD (3D Flip)
   ═══════════════════════════════════════ */
.drawn-card-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2rem 0;
}

.tarot-card {
  width: var(--card-width);
  height: var(--card-height);
  perspective: 1000px;
  cursor: pointer;
}

.card-inner {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tarot-card.flipped .card-inner { transform: rotateY(180deg); }
.tarot-card.reversed.flipped .card-inner { transform: rotateY(180deg) rotate(180deg); }

.card-front, .card-back {
  position: absolute;
  width: 100%; height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
}

/* Firefox needs both faces to be transformed for reliable backface culling. */
.card-back { transform: rotateY(0deg); }
.card-front { transform: rotateY(180deg); }

/* Card Back — illustrated celestial design (full-bleed JPG) */
.card-back-design {
  width: 100%; height: 100%;
  background: #0d1f3d url('../assets/card-back.jpg') center/cover no-repeat;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Image carries its own frame + centerpiece — no CSS ornament needed */
.card-back-design::before { display: none; }
.card-back-design::after { display: none; }
.card-back-pattern { display: none; }
.card-back-symbol { display: none; }

.card-back-pattern::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 75%; height: 75%;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1px solid rgba(160, 132, 92, 0.12);
  border-radius: 50%;
}

.card-back-pattern::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 40%; height: 40%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(160, 132, 92, 0.2);
  border-radius: 50%;
}

.card-back-symbol {
  font-size: 2.5rem;
  color: var(--gold);
  z-index: 1;
  text-shadow: 0 0 15px rgba(160, 132, 92, 0.3);
  animation: symbolPulse 3s ease-in-out infinite;
}

@keyframes symbolPulse {
  0%, 100% { text-shadow: 0 0 8px rgba(160, 132, 92, 0.2); }
  50% { text-shadow: 0 0 20px rgba(160, 132, 92, 0.5); }
}

.card-back-design.mini { border-width: 2px; }

/* Card Front — minimal frame; image dominates */
.card-front-content {
  width: 100%; height: 100%;
  border: 1.5px solid var(--gold-dim);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0.8rem;
  position: relative;
  overflow: hidden;
}

.card-front-content.suit-major { background: var(--card-bg-major); border-color: var(--gold-dim); }
.card-front-content.suit-wands { background: var(--card-bg-wands); border-color: rgba(192, 96, 64, 0.45); }
.card-front-content.suit-cups { background: var(--card-bg-cups); border-color: rgba(80, 128, 176, 0.45); }
.card-front-content.suit-swords { background: var(--card-bg-swords); border-color: rgba(112, 128, 144, 0.45); }
.card-front-content.suit-pentacles { background: var(--card-bg-pentacles); border-color: rgba(80, 128, 80, 0.45); }

.card-front-content::before {
  content: '';
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 1px solid rgba(160, 132, 92, 0.12);
  border-radius: 6px;
  pointer-events: none;
}

.card-numeral { font-family: var(--font-display); font-size: 0.85rem; color: var(--gold); letter-spacing: 2px; opacity: 0.7; }
.card-symbol-large { font-size: 3.5rem; line-height: 1; }
.card-name-display { font-family: var(--font-display); font-size: 0.8rem; color: var(--gold); letter-spacing: 1.5px; text-align: center; line-height: 1.3; }
.card-keywords-display { font-size: 0.7rem; color: var(--text-secondary); font-style: italic; text-align: center; opacity: 0.7; }
.card-suit-icon { font-size: 0.9rem; opacity: 0.5; }

/* RWS card art (1909 Pamela Colman Smith, public domain). Rendered B&W via filter. */
/* Full-bleed image card face — image IS the card. */
.card-front-image {
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.card-front-image::before { display: none; }   /* hide decorative inner border */
.card-art-full {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  box-shadow: none;
  filter: grayscale(1) contrast(1.05) brightness(0.97);
}
.card-art-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

/* Card entrance */
.card-enter { animation: cardSlideIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); }

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(-50px) scale(0.85); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Sparkle */
.sparkle { position: absolute; pointer-events: none; z-index: 100; }

.sparkle-particle {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold-light);
  animation: sparkleAnim 0.8s ease-out forwards;
}

@keyframes sparkleAnim {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

.flip-hint {
  color: var(--text-dim);
  font-style: italic;
  font-size: 1rem;
  margin-top: 1rem;
  animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ═══════════════════════════════════════
   READING RESULT
   ═══════════════════════════════════════ */
.reading-result {
  max-width: 580px;
  margin: 2rem auto 0;
  text-align: left;
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  animation: resultFadeIn 0.8s ease-out;
}

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

.result-card-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 0.25rem;
}

.result-orientation {
  font-size: 0.9rem;
  color: var(--accent);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.result-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.result-keyword {
  font-size: 0.75rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}

.result-meaning {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--text-primary);
}

.result-element-info {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════
   REFLECTION AREA — the heart of it
   ═══════════════════════════════════════ */
.reflection-area {
  max-width: 580px;
  margin: 1.5rem auto 0;
  animation: resultFadeIn 0.6s ease-out;
}

.reflection-prompt {
  padding: 1.5rem 2rem;
  background: var(--reflection-bg);
  border: 1px solid var(--border-accent);
  border-radius: 16px;
  text-align: left;
}

.reflection-question {
  font-size: 1.1rem;
  color: var(--accent);
  font-style: italic;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.reflection-hint {
  margin-bottom: 0.75rem;
}

.reflection-input {
  width: 100%;
  padding: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-smooth);
  min-height: 100px;
}

.reflection-input:focus {
  border-color: var(--accent);
}

.reflection-input::placeholder { color: var(--text-dim); font-style: italic; }

.reflection-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.draw-direct-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.7rem 0 1.2rem;
}

.draw-direct-actions .btn-ghost {
  margin-top: 0;
  border-radius: 999px;
}

.draw-direct-link {
  color: var(--gold-deep);
  border-color: rgba(184, 151, 100, 0.32);
}

.draw-link-save-btn.is-saved {
  opacity: 0.58;
  cursor: default;
}

/* ═══════════════════════════════════════
   SPREAD PICKER & UNIVERSAL SPREAD
   ═══════════════════════════════════════ */

/* Category filters */
.spread-category-filters {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-btn {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 1.2px;
  padding: 0.45rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1;
}

.filter-btn:hover {
  color: var(--gold);
}

.filter-btn.active {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold-dim);
}

/* Inline SVG category icons — line-art, inherit text color via currentColor */
.cat-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: currentColor;
  stroke: currentColor;
  opacity: 0.85;
  transition: opacity 0.25s ease;
}
.filter-btn:hover .cat-icon,
.filter-btn.active .cat-icon { opacity: 1; }

/* Spread grid */
.spread-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-bottom: 2rem;
}

.spread-grid-focus {
  display: block;
  margin-bottom: 1.1rem;
}

.spread-focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.spread-browse-all-btn {
  display: flex;
  margin: 0 auto 2rem;
}

/* Browse-all view: category headers with the complete spread library underneath. */
.spread-grid-grouped {
  display: block;
  margin-bottom: 2rem;
}
.spread-section {
  margin-bottom: 2.4rem;
}
.spread-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0 0.2rem;
}
.spread-section-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin: 0;
  font-weight: 500;
}
.spread-section-viewall {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--gold-deep);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition-smooth), border-color var(--transition-smooth);
}
.spread-section-viewall:hover {
  color: var(--gold);
  border-bottom-color: var(--gold-dim);
}
.spread-section-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.9rem;
}

.spread-tile {
  background: var(--bg-recessed);
  border: 1px solid rgba(201, 169, 97, 0.15);
  border-radius: 14px;
  padding: 1.6rem 1.3rem 2.4rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 170px;
}

.spread-tile:hover {
  border-color: rgba(201, 169, 97, 0.55);
  background: var(--bg-recessed);
  transform: translateY(-3px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 28px -8px rgba(0, 0, 0, 0.45);
}

/* Subtle category watermark — a large ghost icon in the bottom-right corner.
   Each category uses an SVG data URL with #b8a47e (gold-dim). Opacity stays low so
   it reads as art, not info. Scales up slightly on hover. */
.spread-tile::after {
  content: '';
  position: absolute;
  right: -14px;
  bottom: -18px;
  width: 96px;
  height: 96px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.07;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.spread-tile:hover::after {
  opacity: 0.14;
  transform: scale(1.08) rotate(-3deg);
}

.spread-tile[data-cat="quick"]::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 3 L13 11 L21 12 L13 13 L12 21 L11 13 L3 12 L11 11 Z' fill='%23a0845c'/></svg>");
}
.spread-tile[data-cat="love-connection"]::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0845c' stroke-width='1.4'><circle cx='9.2' cy='12' r='4.8'/><circle cx='14.8' cy='12' r='4.8'/></svg>");
}
.spread-tile[data-cat="self-discovery"]::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0845c' stroke-width='1.4'><circle cx='12' cy='12' r='9'/><circle cx='12' cy='12' r='2.4' fill='%23a0845c'/></svg>");
}
.spread-tile[data-cat="mind-body"]::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a0845c'><path d='M14.5 4.5 A7.5 7.5 0 1 0 14.5 19.5 A5.5 5.5 0 1 1 14.5 4.5 Z'/><circle cx='20' cy='12' r='1.4'/></svg>");
}
.spread-tile[data-cat="life-path"]::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0845c' stroke-width='1.4' stroke-linecap='round'><path d='M3 19 Q9 13 12 13 T21 5'/></svg>");
}
.spread-tile[data-cat="custom"]::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0845c' stroke-width='1.4'><rect x='7' y='3' width='10' height='18' rx='1.6'/><circle cx='12' cy='12' r='1.4' fill='%23a0845c'/></svg>");
}

.spread-tile-icon {
  display: none;  /* legacy emoji icon — replaced by typography */
}

.spread-tile-rule {
  display: block;
  width: 28px;
  height: 1px;
  background: var(--gold-dim);
  margin: 0.55rem auto 0.65rem;
  opacity: 0.55;
  transition: opacity var(--transition-smooth), width var(--transition-smooth);
}
.spread-tile:hover .spread-tile-rule {
  opacity: 0.85;
  width: 44px;
}

.spread-tile-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold);
  margin: 0;
  letter-spacing: 1.3px;
  font-weight: 600;
}

.spread-tile-desc {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-style: italic;
  font-weight: 300;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.55;
}

.spread-tile-count {
  position: absolute;
  bottom: 0.7rem;
  right: 0.9rem;
  font-size: 0.62rem;
  font-family: var(--font-display);
  letter-spacing: 1.5px;
  color: var(--gold-deep);
  text-transform: uppercase;
  opacity: 0.7;
}

.spread-tile-badge {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  font-size: 0.58rem;
  font-family: var(--font-display);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold-deep);
  border: 1px solid rgba(160, 132, 92, 0.28);
  border-radius: 999px;
  padding: 0.16rem 0.42rem;
  background: rgba(160, 132, 92, 0.06);
}

/* Active spread view */
.spread-active {
  text-align: center;
}

.spread-back-btn {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.spread-active-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
  margin: 0 0 0.4rem;
}

.spread-active-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
}

.generated-spread-preview {
  width: min(700px, 100%);
  margin: 0 auto 1.5rem;
  padding: 1rem;
  text-align: left;
  background: rgba(255, 247, 220, 0.035);
  border: 1px solid rgba(184, 151, 100, 0.28);
  border-radius: 8px;
}

.generated-spread-note {
  margin: 0 0 0.9rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

.generated-spread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.generated-spread-actions .btn-ghost {
  border-radius: 999px;
  margin-top: 0;
}

.generated-ai-action {
  color: var(--gold);
  border: 1px solid rgba(201, 169, 97, 0.42);
  background: rgba(201, 169, 97, 0.055);
}

.generated-ai-action:hover {
  color: var(--gold);
  border-color: rgba(201, 169, 97, 0.7);
  background: rgba(201, 169, 97, 0.1);
}

.generated-save-action {
  border: 1px solid rgba(255, 247, 220, 0.12);
  color: var(--text-dim);
}

.generated-save-action:hover {
  color: var(--text-secondary);
  border-color: rgba(255, 247, 220, 0.22);
}

.generated-save-action.is-saved {
  opacity: 0.58;
  cursor: default;
}

.generated-spread-position-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.generated-spread-position {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.generated-position-number {
  color: var(--gold-deep);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 1.2px;
}

.generated-position-body {
  display: grid;
  gap: 0.35rem;
}

.generated-position-body strong {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.98rem;
  line-height: 1.35;
}

.generated-position-role {
  width: fit-content;
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.generated-position-body p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.45;
}

/* Dynamic card area */
.spread-cards-area {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.spread-position {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  animation: cardSlideIn 0.5s ease-out both;
}

.position-label {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 2px;
}

/* Slightly smaller cards for large spreads (still visible at a glance) */
.spread-cards-area .tarot-card-sm {
  width: 140px;
  height: 224px;
}

.spread-cards-area .tarot-card-sm .card-back-design {
  padding: 10px;
}

/* Results */
.three-card-reading { display: flex; flex-direction: column; gap: 1.5rem; }

.reading-position-result {
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  text-align: left;
}

.position-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

/* ═══════════════════════════════════════
   PERSONALITY QUIZZES
   ═══════════════════════════════════════ */

/* Quiz Picker */
.quiz-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.quiz-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.quiz-tile:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
}

.quiz-tile-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.8rem;
}

.quiz-tile-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.quiz-tile-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 1.2rem;
  line-height: 1.5;
}

.quiz-start-btn {
  font-size: 0.85rem;
  padding: 0.5rem 1.5rem;
}

/* Active Quiz — Progress */
.quiz-active {
  max-width: 600px;
  margin: 0 auto;
}

.quiz-progress {
  width: 100%;
  height: 4px;
  background: var(--border-soft);
  border-radius: 2px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  border-radius: 2px;
  transition: width 0.4s ease;
}

.quiz-progress-text {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 2rem;
}

/* Question */
.quiz-question {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.quiz-question-enter {
  animation: quizFadeIn 0.35s ease-out;
}

/* Options */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.quiz-options-enter {
  animation: quizFadeIn 0.35s ease-out 0.1s both;
}

.quiz-option {
  display: block;
  width: 100%;
  padding: 1rem 1.2rem;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  line-height: 1.5;
}

.quiz-option:hover {
  border-color: var(--gold);
  background: var(--bg-secondary);
  transform: translateX(4px);
}

.quiz-option:active {
  transform: scale(0.98);
}

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

/* Quiz Result */
.quiz-result {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.quiz-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  margin-bottom: 1.5rem;
  animation: quizResultReveal 0.6s ease-out;
}

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

.quiz-result-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.quiz-result-emoji {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.quiz-result-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold);
  margin: 0 0 1rem;
}

.quiz-result-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0 0 1.5rem;
}

.quiz-result-card-art {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.quiz-result-card-art .tarot-card {
  width: 140px;
  height: 224px;
}

.quiz-result-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.quiz-result-actions .btn-primary,
.quiz-result-actions .btn-secondary,
.quiz-result-actions .btn-ghost {
  width: 100%;
  max-width: 280px;
}

/* ═══════════════════════════════════════
   AI READING
   ═══════════════════════════════════════ */
.ai-reading-area {
  margin: 1.5rem 0;
  text-align: center;
}

.btn-ai {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 1px;
  padding: 0.7rem 1.8rem;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(123, 107, 138, 0.25);
}

.btn-ai:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(123, 107, 138, 0.35);
}

.btn-ai:active {
  transform: scale(0.97);
}

.btn-ai:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ai-btn-icon {
  font-size: 1.1rem;
}

/* Loading orb */
.ai-reading-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 0;
}

.ai-loading-orb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-light), var(--accent) 70%, transparent 100%);
  animation: orbPulse 1.8s ease-in-out infinite;
  box-shadow: 0 0 30px var(--glow-color), 0 0 60px var(--glow-color);
}

@keyframes orbPulse {
  0%, 100% { transform: scale(0.8); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
}

.ai-loading-text {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.9rem;
  animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* AI Content */
.ai-reading-content {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 16px;
  padding: 2rem 1.8rem;
  text-align: left;
  animation: aiReveal 0.6s ease-out;
  position: relative;
}

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

.ai-reading-text {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.ai-reading-footer {
  margin-top: 1.2rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  font-style: italic;
}

.ai-interpretation-entry + .ai-interpretation-entry {
  margin-top: 1.35rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-soft);
}

.ai-interpretation-header {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
  margin-bottom: 0.7rem;
}

.ai-interpretation-labels {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  text-align: left;
}

.ai-interpretation-actions {
  flex: 0 0 auto;
}

.ai-interpretation-title {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 0.86rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ai-interpretation-meta {
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.4;
}

.ai-copy-btn {
  padding: 0.2rem 0.58rem;
  border: 1px solid rgba(160, 132, 92, 0.28);
  border-radius: 999px;
  color: var(--gold-deep);
  font-size: 0.72rem;
  line-height: 1.2;
}

.ai-copy-btn:hover {
  color: var(--gold);
  border-color: rgba(160, 132, 92, 0.45);
}

.ai-followup-controls {
  max-width: 640px;
  margin: 1rem auto 0.75rem;
  text-align: left;
}

.ai-followup-input {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
}

.ai-followup-input:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(160, 132, 92, 0.12);
}

.ai-followup-note {
  margin-top: 0.45rem;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.4;
}

.ai-reading-state {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
  color: var(--text-primary);
  line-height: 1.6;
}

/* ═══════════════════════════════════════
   JOURNAL PAGE
   ═══════════════════════════════════════ */
.journal-container {
  max-width: 1080px;
  margin: 0 auto;
  min-width: 0;
}

.journal-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  min-width: 120px;
}

.journal-filter-card {
  appearance: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.journal-filter-card:hover,
.journal-filter-card.active {
  border-color: var(--gold-dim);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.journal-filter-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gold);
  display: block;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.journal-empty {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-icon {
  display: block;
  width: 200px;
  height: auto;
  margin: 0 auto 1.2rem;
  opacity: 0.85;
}

.journal-empty p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-style: italic;
  margin-bottom: 1.5rem;
}

.journal-insights {
  width: min(900px, 100%);
  margin: 0 auto 1.2rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.journal-insights-header,
.journal-insight-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}

.journal-insights-header {
  padding-bottom: 0.8rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-soft);
}

.journal-insights-header h3,
.journal-insight-heading h4 {
  font-family: var(--font-display);
  color: var(--gold);
  line-height: 1.25;
}

.journal-insights-header h3 {
  font-size: 1rem;
  letter-spacing: 1.5px;
}

.journal-insights-header span,
.journal-insight-heading span,
.journal-pattern-block-heading span,
.journal-energy-period-meta,
.journal-frequency-copy span,
.journal-card-pattern-copy span,
.journal-card-pattern-copy em,
.journal-insight-empty {
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.35;
}

.journal-insight-heading {
  margin-bottom: 0.65rem;
}

.journal-insight-heading h4 {
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.journal-insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.journal-insight-panel {
  min-width: 0;
}

.journal-pattern-map {
  grid-column: 1 / -1;
}

.journal-pattern-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 1rem;
}

.journal-pattern-block {
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: var(--bg-card);
}

.journal-pattern-block-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.65rem;
}

.journal-pattern-block-heading strong {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.7px;
}

.journal-pattern-block-heading span {
  text-align: right;
}

.journal-rhythm-map {
  display: grid;
  grid-template-columns: 2.7rem repeat(4, minmax(2.7rem, 1fr));
  gap: 0.28rem;
  align-items: stretch;
}

.journal-rhythm-corner,
.journal-rhythm-slot-label,
.journal-rhythm-day-label,
.journal-rhythm-cell {
  min-width: 0;
}

.journal-rhythm-slot-label,
.journal-rhythm-day-label {
  display: flex;
  align-items: center;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.58rem;
  letter-spacing: 0.7px;
  line-height: 1.1;
}

.journal-rhythm-slot-label {
  justify-content: center;
  text-align: center;
}

.journal-rhythm-day-label {
  justify-content: flex-end;
  padding-right: 0.1rem;
}

.journal-rhythm-cell,
.journal-card-day-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  background: var(--bg-recessed);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.62rem;
  line-height: 1;
}

.journal-rhythm-cell {
  min-height: 1.75rem;
}

.journal-card-pattern-list {
  display: grid;
  gap: 0.65rem;
}

.journal-card-pattern-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0.45rem 0.65rem;
  align-items: center;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-soft);
}

.journal-card-pattern-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.journal-card-thumb-pattern {
  width: 30px;
  height: 48px;
}

.journal-card-pattern-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.journal-card-pattern-copy strong {
  overflow: hidden;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.7px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journal-card-pattern-copy em {
  font-style: normal;
}

.journal-card-day-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(var(--pattern-days), minmax(1.08rem, 1fr));
  gap: 0.16rem;
  width: 100%;
}

.journal-card-day-cell {
  min-width: 1.08rem;
  height: 1.18rem;
  font-size: 0.52rem;
}

.journal-rhythm-cell.heat-1,
.journal-card-day-cell.heat-1 {
  border-color: rgba(185, 154, 85, 0.35);
  background: rgba(185, 154, 85, 0.18);
}

.journal-rhythm-cell.heat-2,
.journal-card-day-cell.heat-2 {
  border-color: rgba(224, 184, 79, 0.45);
  background: rgba(224, 184, 79, 0.28);
  color: var(--text-primary);
}

.journal-rhythm-cell.heat-3,
.journal-card-day-cell.heat-3 {
  border-color: rgba(123, 107, 138, 0.55);
  background: rgba(123, 107, 138, 0.42);
  color: var(--text-primary);
}

.journal-rhythm-cell.heat-4,
.journal-card-day-cell.heat-4 {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--gold-deep), var(--gold));
  color: #fff;
}

.journal-energy-periods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.journal-energy-period {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
  padding: 0.68rem;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: var(--bg-card);
}

.journal-energy-period-label {
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.journal-energy-period strong {
  min-width: 0;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.86rem;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.journal-energy-mix {
  display: flex;
  width: 100%;
  height: 0.24rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-recessed);
}

.journal-energy-mix.empty {
  opacity: 0.45;
}

.journal-energy-segment {
  flex: 0 0 var(--energy-share);
  min-width: 0.4rem;
}

.journal-frequency-list {
  display: grid;
  gap: 0.45rem;
}

.journal-frequency-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 0.5rem 0.65rem;
  align-items: center;
  padding: 0.48rem 0;
  border-top: 1px solid var(--border-soft);
}

.journal-frequency-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.journal-card-thumb-frequency {
  width: 30px;
  height: 48px;
}

.journal-frequency-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.journal-frequency-copy strong {
  overflow: hidden;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.7px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journal-frequency-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.journal-frequency-meter {
  grid-column: 2 / -1;
  height: 0.2rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-recessed);
}

.journal-frequency-meter span {
  display: block;
  width: var(--frequency-share);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
}

.journal-energy-segment.tone-clear { background: #6ccf8f; }
.journal-energy-segment.tone-restless { background: #a575d6; }
.journal-energy-segment.tone-grounded { background: #b99a55; }
.journal-energy-segment.tone-low { background: #4f85c5; }
.journal-energy-segment.tone-spark { background: #e0b84f; }
.journal-energy-segment.tone-soft { background: var(--text-dim); }

/* Timeline */
.journal-timeline {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  padding: 0;
  margin: 0 auto;
}

.journal-entry {
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: left;
  transition: all var(--transition-smooth);
  animation: resultFadeIn 0.4s ease-out;
}

.journal-entry:hover {
  border-color: var(--gold-dim);
  box-shadow: var(--shadow-soft);
}

.journal-entry-date {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
  letter-spacing: 0.5px;
}

.journal-entry-question {
  font-style: italic;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.journal-entry-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.journal-card-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.journal-card-tag.reversed {
  border-style: dashed;
  opacity: 0.7;
}

.journal-generated-trace {
  margin: 0.85rem 0 0.9rem;
  padding: 0.9rem;
  border: 1px solid rgba(184, 151, 100, 0.22);
  border-radius: 8px;
  background: rgba(255, 247, 220, 0.03);
}

.journal-generated-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.94rem;
}

.journal-generated-meta {
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.journal-generated-summary {
  margin: 0.35rem 0 0.75rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.journal-generated-positions {
  display: grid;
  gap: 0.55rem;
}

.journal-generated-position {
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-soft);
}

.journal-generated-position-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
  color: var(--text-primary);
}

.journal-position-index {
  color: var(--gold-deep);
  font-family: var(--font-display);
  font-size: 0.75rem;
}

.journal-position-role,
.journal-generated-orientation {
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.journal-position-rationale {
  margin: 0.25rem 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.45;
}

.journal-generated-card {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.82rem;
}

.journal-entry-reflection {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  padding: 0.8rem 1rem;
  background: var(--reflection-bg);
  border-radius: 8px;
  margin-top: 0.5rem;
  border-left: 3px solid var(--accent);
}

.journal-entry-reflection::before {
  content: '"';
  font-size: 1.5rem;
  color: var(--accent-light);
  opacity: 0.5;
}

.journal-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2rem;
}

.journal-actions .btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.journal-history-layout {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: stretch;
}

.journal-calendar {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.journal-calendar-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.journal-calendar-heading {
  text-align: center;
}

.journal-calendar-heading h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 1.7px;
  color: var(--gold);
  line-height: 1.25;
}

.journal-calendar-heading p {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-top: 0.2rem;
}

.journal-calendar-nav {
  appearance: none;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-family: var(--font-display);
  font-size: 0.64rem;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.journal-calendar-nav:hover,
.journal-calendar-nav:focus-visible {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: rgba(160, 132, 92, 0.07);
  outline: none;
}

.journal-calendar-nav:disabled {
  cursor: default;
  opacity: 0.36;
}

.journal-calendar-nav:disabled:hover {
  border-color: var(--border-soft);
  color: var(--text-secondary);
  background: transparent;
}

.journal-calendar-weekdays,
.journal-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.journal-calendar-weekdays {
  margin-bottom: 0.4rem;
}

.journal-calendar-weekdays span {
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.journal-calendar-day {
  min-width: 0;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  position: relative;
  padding: 0.48rem;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--text-primary);
  text-align: left;
}

button.journal-calendar-day {
  font: inherit;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

button.journal-calendar-day:hover,
button.journal-calendar-day:focus-visible,
.journal-calendar-day.selected {
  border-color: var(--gold-dim);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
  outline: none;
}

.journal-calendar-day.selected {
  background: rgba(160, 132, 92, 0.08);
}

.journal-calendar-day.out-month {
  opacity: 0.34;
}

.journal-calendar-day.has-notes {
  box-shadow: inset 0 -2px 0 rgba(160, 132, 92, 0.35);
}

.journal-calendar-number {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.journal-calendar-day.has-readings .journal-calendar-number {
  color: var(--gold);
}

.journal-calendar-count {
  position: absolute;
  top: 0.4rem;
  right: 0.45rem;
  min-width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.68rem;
  line-height: 1;
}

.journal-calendar-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  margin-top: auto;
}

.journal-energy-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--text-dim);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.03);
}

.journal-energy-dot.tone-clear { background: #6ccf8f; }
.journal-energy-dot.tone-restless { background: #a575d6; }
.journal-energy-dot.tone-grounded { background: #b99a55; }
.journal-energy-dot.tone-low { background: #4f85c5; }
.journal-energy-dot.tone-spark { background: #e0b84f; }
.journal-energy-dot.tone-soft { background: var(--text-dim); }

.journal-history-group {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.journal-history-date {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding-left: 0.2rem;
}

.journal-history-list {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
}

.journal-history-card {
  width: clamp(150px, 17vw, 190px);
  min-height: 116px;
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: block;
  text-align: left;
  color: var(--text-primary);
  font: inherit;
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 0.82rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.journal-history-card:hover,
.journal-history-card.selected {
  border-color: var(--gold-dim);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.journal-history-card.selected {
  background: rgba(160, 132, 92, 0.08);
}

.journal-history-row-top,
.journal-detail-status-row,
.journal-history-meta,
.journal-detail-meta-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.journal-history-row-top {
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.journal-history-date-mini {
  font-family: var(--font-display);
  font-size: 0.66rem;
  color: var(--text-dim);
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.journal-history-time {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.1;
  color: var(--gold);
  letter-spacing: 0.7px;
  margin-bottom: 0.45rem;
}

.journal-history-row-top time {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.journal-history-preview {
  display: block;
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.25;
  margin-bottom: 0.45rem;
  min-height: 2.35rem;
  overflow: hidden;
}

.journal-history-meta {
  color: var(--text-dim);
  font-size: 0.74rem;
  margin-bottom: 0;
}

.journal-history-meta span + span::before {
  content: '/';
  color: var(--border-accent);
  margin-right: 0.5rem;
}

.journal-filter-empty {
  color: var(--text-dim);
  font-style: italic;
  padding: 1rem 0.2rem;
}

.journal-card-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--bg-recessed);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

.journal-card-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.04) brightness(0.96);
}

.journal-card-thumb.reversed img {
  transform: rotate(180deg);
}

.journal-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.journal-status-complete {
  color: var(--pentacles);
  border-color: rgba(39, 174, 96, 0.42);
  background: rgba(39, 174, 96, 0.08);
}

.journal-status-failed {
  color: var(--wands);
  border-color: rgba(232, 76, 61, 0.42);
  background: rgba(232, 76, 61, 0.08);
}

.journal-status-pending {
  color: var(--gold);
  border-color: rgba(160, 132, 92, 0.5);
  background: rgba(160, 132, 92, 0.1);
}

.journal-status-idle {
  color: var(--text-dim);
}

.journal-status-incomplete {
  color: var(--cups);
  border-color: rgba(52, 152, 219, 0.42);
  background: rgba(52, 152, 219, 0.08);
}

.journal-detail {
  width: min(900px, 100%);
  margin: 0 auto;
}

.journal-detail-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 1.2rem;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.journal-detail-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 1rem;
}

.journal-detail-top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.journal-detail-session-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
}

.journal-detail-session-count {
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.journal-detail-session-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
}

.journal-detail-session-btn {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  max-width: 100%;
  padding: 0.38rem 0.62rem;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.journal-detail-session-btn:hover,
.journal-detail-session-btn.selected {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: rgba(160, 132, 92, 0.08);
}

.journal-detail-session-time {
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}

.journal-detail-session-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journal-detail-kicker {
  color: var(--text-dim);
  font-size: 0.78rem;
  letter-spacing: 0.7px;
  margin-bottom: 0.25rem;
}

.journal-detail-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--gold);
  letter-spacing: 1px;
  line-height: 1.25;
  margin-bottom: 0.65rem;
}

.journal-detail-status-row {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.journal-detail-section {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.journal-detail-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.journal-detail-section h4 {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.journal-detail-section p,
.journal-detail-state {
  color: var(--text-primary);
  font-size: 0.98rem;
  line-height: 1.65;
}

.journal-detail-position-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.journal-detail-position {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem 0.6rem;
  align-items: center;
  padding: 0.55rem 0;
  border-top: 1px solid var(--border-soft);
}

.journal-detail-position:first-child {
  border-top: 0;
}

.journal-detail-position strong {
  color: var(--text-primary);
  font-size: 0.92rem;
}

.journal-detail-position .journal-position-rationale {
  grid-column: 2 / -1;
  margin: -0.1rem 0 0;
}

.journal-detail-meta-list span {
  color: var(--text-secondary);
  font-size: 0.88rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
}

.journal-detail-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.journal-detail-card-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.journal-detail-card-row {
  display: grid;
  grid-template-columns: 42px minmax(110px, 0.8fr) minmax(180px, 1.2fr) auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.journal-detail-clarifier-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-left: 1.25rem;
}

.journal-detail-clarifier-row {
  background: rgba(160, 132, 92, 0.07);
}

.journal-card-thumb-detail {
  width: 36px;
  height: 58px;
  border-radius: 5px;
}

.journal-detail-card-position {
  color: var(--text-dim);
  font-size: 0.78rem;
}

.journal-detail-card-name {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.8px;
}

.journal-detail-card-orientation {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.journal-detail-state {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
}

.journal-detail-state.failed {
  border-color: rgba(232, 76, 61, 0.35);
}

.journal-detail-state.incomplete {
  border-color: rgba(52, 152, 219, 0.35);
}

.journal-interpretation-list {
  display: grid;
  gap: 0.9rem;
}

.journal-interpretation-item {
  padding-left: 0.85rem;
  border-left: 2px solid var(--border-soft);
}

.journal-interpretation-item.status-complete {
  border-left-color: var(--gold-dim);
}

.journal-interpretation-item.status-incomplete {
  border-left-color: rgba(52, 152, 219, 0.55);
}

.journal-interpretation-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.45rem;
}

.journal-interpretation-head strong {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 0.86rem;
  letter-spacing: 0.8px;
}

.journal-interpretation-head span {
  color: var(--text-dim);
  font-size: 0.78rem;
  text-align: right;
}

.journal-retry-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.35rem;
}

.journal-retry-row .btn-secondary {
  margin-top: 0;
  padding: 0.45rem 0.95rem;
  font-size: 0.68rem;
  letter-spacing: 1.2px;
}

.journal-retry-row .btn-secondary:disabled {
  cursor: default;
  color: var(--text-dim);
  border-color: var(--border-soft);
  opacity: 0.65;
}

.journal-retry-row span {
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.4;
  flex: 1 1 180px;
}

.journal-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.8rem;
}

.journal-detail-muted {
  color: var(--text-dim) !important;
  font-style: italic;
}

@media (max-width: 900px) {
  .journal-container {
    max-width: 700px;
  }

  .journal-timeline {
    margin-inline: 0;
    padding-inline: 0;
  }

  .journal-calendar {
    padding: 0.75rem;
  }

  .journal-insights {
    padding: 0.75rem;
  }

  .journal-insights-grid,
  .journal-pattern-grid,
  .journal-energy-periods {
    grid-template-columns: 1fr;
  }

  .journal-pattern-block {
    overflow-x: auto;
  }

  .journal-pattern-block-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .journal-pattern-block-heading span {
    text-align: left;
  }

  .journal-rhythm-map {
    min-width: 330px;
  }

  .journal-card-day-strip {
    min-width: 430px;
  }

  .journal-calendar-header {
    gap: 0.6rem;
  }

  .journal-calendar-nav {
    padding: 0.32rem 0.55rem;
    font-size: 0.58rem;
  }

  .journal-calendar-weekdays,
  .journal-calendar-grid {
    gap: 0.25rem;
  }

  .journal-calendar-day {
    min-height: 58px;
    padding: 0.35rem;
    border-radius: 6px;
  }

  .journal-calendar-count {
    top: 0.28rem;
    right: 0.28rem;
    min-width: 1rem;
    height: 1rem;
    font-size: 0.58rem;
  }

  .journal-energy-dot {
    width: 0.38rem;
    height: 0.38rem;
  }

  .journal-detail-card-row {
    grid-template-columns: 34px 1fr auto;
  }

  .journal-detail-session-switcher {
    align-items: stretch;
  }

  .journal-detail-session-list {
    width: 100%;
  }

  .journal-detail-session-btn {
    flex: 1 1 180px;
  }

  .journal-card-thumb-detail {
    grid-row: 1 / 3;
  }

  .journal-detail-card-position {
    grid-column: 2 / 4;
  }

  .journal-detail-card-name {
    grid-column: 2 / 3;
  }

  .journal-detail-card-orientation {
    grid-column: 3 / 4;
  }
}

/* ═══════════════════════════════════════
   CARD LIBRARY
   ═══════════════════════════════════════ */
.library-container { max-width: 1100px; margin: 0 auto; }

.library-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.filter-btn {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 0.45rem 1rem;
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 25px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.filter-btn:hover { border-color: var(--gold); color: var(--gold); }
.filter-btn.active { background: rgba(160, 132, 92, 0.1); border-color: var(--gold); color: var(--gold); }

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}

.library-card {
  cursor: pointer;
  transition: all var(--transition-smooth);
  text-align: center;
}

.library-card:hover { transform: translateY(-5px); }

.card-mini {
  width: 100%;
  aspect-ratio: 5/8;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.8rem 0.4rem;
  border: 2px solid;
  transition: all var(--transition-smooth);
  position: relative;
}

.library-card:hover .card-mini { box-shadow: var(--shadow-card); }

.card-mini.suit-major { background: var(--card-bg-major); border-color: var(--gold-dim); }
.card-mini.suit-wands { background: var(--card-bg-wands); border-color: rgba(192, 96, 64, 0.4); }
.card-mini.suit-cups { background: var(--card-bg-cups); border-color: rgba(80, 128, 176, 0.4); }
.card-mini.suit-swords { background: var(--card-bg-swords); border-color: rgba(112, 128, 144, 0.4); }
.card-mini.suit-pentacles { background: var(--card-bg-pentacles); border-color: rgba(80, 128, 80, 0.4); }

.card-mini-symbol { font-size: 1.6rem; }
/* Image-dominant library mini: full-bleed image, name below the frame as caption */
.card-mini-image {
  padding: 0;
  overflow: hidden;
  position: relative;
}
.card-mini-art-full {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  filter: grayscale(1) contrast(1.05) brightness(0.97);
}
.library-card-caption {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.3;
  margin-top: 0.45rem;
}
.card-mini-name { font-family: var(--font-display); font-size: 0.6rem; color: var(--text-primary); letter-spacing: 0.5px; text-align: center; line-height: 1.3; }
.card-mini-numeral { font-family: var(--font-display); font-size: 0.55rem; color: var(--text-dim); letter-spacing: 1px; }

/* ═══════════════════════════════════════
   MODAL
   ═══════════════════════════════════════ */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active { display: flex; animation: modalFadeIn 0.3s ease-out; }

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

.modal-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  max-width: 520px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 2.5rem;
  z-index: 1;
  animation: modalSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.8rem;
  cursor: pointer;
  transition: color 0.3s;
  line-height: 1;
}

.modal-close:hover { color: var(--gold); }

.modal-card-header { text-align: center; margin-bottom: 1.5rem; }
.modal-card-art {
  display: block;
  max-width: 220px;
  width: 100%;
  height: auto;
  margin: 0 auto 0.8rem;
  border-radius: 6px;
  filter: grayscale(1) contrast(1.05) brightness(0.97);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.modal-card-symbol { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.modal-card-name { font-family: var(--font-display); font-size: 1.4rem; color: var(--gold); letter-spacing: 2px; }
.modal-card-numeral { font-family: var(--font-display); font-size: 0.8rem; color: var(--text-dim); letter-spacing: 2px; }

.modal-section { margin-bottom: 1.5rem; }

.modal-section-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-soft);
}

.modal-section p { font-size: 1.02rem; line-height: 1.7; color: var(--text-primary); }

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}

.modal-meta-item { font-size: 0.85rem; color: var(--text-dim); }
.modal-meta-item span { color: var(--text-secondary); }

/* ═══════════════════════════════════════
   TOAST NOTIFICATION
   ═══════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 1rem;
  z-index: 3000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
.footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border-soft);
  position: relative;
  z-index: 1;
}

.footer-brand { font-family: var(--font-display); font-size: 0.9rem; color: var(--gold-dim); letter-spacing: 3px; margin-bottom: 0.4rem; }
.footer-subtitle { color: var(--text-dim); font-style: italic; font-size: 0.9rem; margin-bottom: 0.5rem; }
.footer-copy { color: var(--text-dim); font-size: 0.75rem; opacity: 0.6; }
.footer-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  opacity: 0.75;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition-smooth), border-color var(--transition-smooth);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--gold-dim);
  border-bottom-color: var(--gold-dim);
  outline: none;
}

.legal-page {
  min-height: 100vh;
}

.legal-main {
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 6.5rem 0 3rem;
}

.legal-back {
  display: inline-block;
  margin-bottom: 1.6rem;
  color: var(--text-dim);
  font-size: 0.86rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition-smooth), border-color var(--transition-smooth);
}

.legal-back:hover,
.legal-back:focus-visible {
  color: var(--gold-dim);
  border-bottom-color: var(--gold-dim);
  outline: none;
}

.legal-document {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.72;
}

.legal-document h1,
.legal-document h2 {
  font-family: var(--font-display);
  color: var(--gold);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.legal-document h1 {
  margin-bottom: 0.5rem;
  font-size: 2.1rem;
}

.legal-document h2 {
  margin-top: 2rem;
  margin-bottom: 0.45rem;
  font-size: 1.2rem;
}

.legal-document p,
.legal-document ul {
  margin-bottom: 1rem;
}

.legal-document ul {
  padding-left: 1.2rem;
}

.legal-effective {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.legal-note {
  color: var(--text-dim);
  font-size: 0.92rem;
}

/* ═══════════════════════════════════════
   DRAW MODE TOGGLE (Quick / Ritual)
   ═══════════════════════════════════════ */
.draw-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.8rem auto 1rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 0.85rem;
}
.draw-mode-toggle .dm-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  padding: 0 0.4rem;
}
.draw-mode-toggle .dm-btn {
  padding: 0.35rem 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all var(--transition-smooth);
}
.draw-mode-toggle .dm-btn:hover { color: var(--gold); }
.draw-mode-toggle .dm-btn.active {
  background: rgba(160, 132, 92, 0.12);
  color: var(--gold);
  border-color: var(--gold-dim);
}

/* ═══════════════════════════════════════
   RITUAL FAN — fanned face-down cards user picks from
   ═══════════════════════════════════════ */
/* Focus mode: hide distractions while picking or shuffling.
   display: none collapses the layout so no blank space sits where the title used to. */
body.ritual-picking .nav,
body.ritual-picking .section-title,
body.ritual-picking .section-subtitle,
body.ritual-picking .question-input-container,
body.ritual-picking .draw-mode-toggle,
body.ritual-picking .draw-direct-actions,
body.ritual-picking .deck-area,
body.ritual-picking .custom-card-picker,
body.ritual-picking .spread-back-btn,
body.ritual-picking .spread-active-title,
body.ritual-picking .spread-active-desc,
body.ritual-shuffling .nav,
body.ritual-shuffling .section-title,
body.ritual-shuffling .section-subtitle,
body.ritual-shuffling .question-input-container,
body.ritual-shuffling .draw-mode-toggle,
body.ritual-shuffling .draw-direct-actions,
body.ritual-shuffling .deck-area,
body.ritual-shuffling .custom-card-picker,
body.ritual-shuffling .spread-back-btn,
body.ritual-shuffling .spread-active-title,
body.ritual-shuffling .spread-active-desc {
  display: none !important;
}

/* ── Ritual shuffle stage (between draw button and fan) ── */
.ritual-shuffle-stage {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem auto;
}
.ritual-shuffle-stage.active {
  animation: shuffleStageEnter 0.5s ease backwards;
}
@keyframes shuffleStageEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ritual-shuffle-stage.active { display: flex; }
.ritual-shuffle-hint {
  font-family: var(--font-display);
  color: var(--gold);
  letter-spacing: 2px;
  font-size: 0.95rem;
  text-align: center;
  margin: 0;
  opacity: 0.85;
}
.ritual-shuffle-deck {
  position: relative;
  width: var(--card-width);
  height: var(--card-height);
}
.ritual-shuffle-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.ritual-shuffle-count:not(:empty) {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05em 0.55em;
  background: rgba(160, 132, 92, 0.18);
  border-radius: 999px;
  font-size: 0.85em;
  color: var(--gold);
  vertical-align: 1px;
}

.ritual-fan {
  position: relative;
  /* Break out of reading-container so the fan has room to spread */
  width: 100vw;
  max-width: 1100px;
  left: 50%;
  transform: translateX(-50%);
  height: 360px;
  margin: 2rem auto 1rem;
}
.ritual-fan-active { display: block; }
.ritual-prompt {
  font-family: var(--font-display);
  color: var(--gold);
  letter-spacing: 2px;
  font-size: 1rem;
  text-align: center;
  margin: 1.5rem 0 0.5rem;
  opacity: 0.85;
  animation: fanPromptPulse 2.4s ease-in-out infinite;
}
@keyframes fanPromptPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.fan-card {
  /* --i is position in fan, --n is fan size. Gentler 5° spread. */
  --angle: calc((var(--i) - (var(--n) - 1) / 2) * 5deg);
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 110px;
  height: 175px;
  margin-left: -55px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  cursor: pointer;
  /* Pivot just below cards -> visible arc that fits any viewport */
  transform-origin: 50% 280%;
  transform: rotate(var(--angle));
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.4s ease,
              box-shadow 0.3s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  animation: fanCardEnter 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
  animation-delay: calc(var(--i) * 0.045s);
  overflow: hidden;
  z-index: calc(var(--i) + 1);
}
@keyframes fanCardEnter {
  from { opacity: 0; transform: translateY(120px) rotate(var(--angle)); }
  to   { opacity: 1; transform: rotate(var(--angle)); }
}
.fan-card:hover {
  transform: rotate(var(--angle)) translateY(-30px) scale(1.04);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
  z-index: 100;
  border-color: var(--gold);
}
.fan-card.picked {
  opacity: 0;
  pointer-events: none;
  transform: rotate(var(--angle)) translateY(-260px) scale(0.7);
}
.fan-card .card-back-design {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  padding: 10px;
}
.fan-card .card-back-symbol { font-size: 1.8rem; }

/* ═══════════════════════════════════════
   CUSTOM CARD PICKER (Custom spread)
   ═══════════════════════════════════════ */
.custom-card-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
  flex-wrap: wrap;
  text-align: left;
}
.advanced-field-copy {
  max-width: 280px;
}
.custom-card-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--gold);
  line-height: 1.35;
}
.custom-card-control {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.custom-step-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  transition: all var(--transition-smooth);
}
.custom-step-btn:hover { background: rgba(160, 132, 92, 0.15); border-color: var(--gold); }
.custom-card-picker input[type="number"] {
  width: 60px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold);
  background: var(--bg-secondary);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 0.3rem 0;
  /* hide spinner */
  -moz-appearance: textfield;
  appearance: textfield;
}
.custom-card-picker input::-webkit-outer-spin-button,
.custom-card-picker input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ═══════════════════════════════════════
   CLARIFIER CARDS
   ═══════════════════════════════════════ */
.clarifier-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}
.clarifier-item {
  display: flex;
  gap: 0.8rem;
  padding: 0.8rem;
  background: rgba(160, 132, 92, 0.05);
  border: 1px dashed var(--border-soft);
  border-radius: 8px;
  animation: cardSlideIn 0.4s ease-out;
}
.clarifier-item.reversed .clarifier-art {
  transform: rotate(180deg);
}
.clarifier-art {
  width: 60px;
  height: auto;
  flex-shrink: 0;
  border-radius: 4px;
  filter: grayscale(1) contrast(1.05) brightness(0.97);
  align-self: flex-start;
}
.clarifier-meta { flex: 1; min-width: 0; }
.clarifier-tag {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 1.5px;
  margin-bottom: 0.2rem;
  opacity: 0.8;
}
.clarifier-name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.15rem;
}
.clarifier-orientation {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 0.4rem;
}
.clarifier-meaning {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.btn-clarifier {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.4rem 1rem;
  background: transparent;
  border: 1px dashed var(--gold-dim);
  border-radius: 18px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all var(--transition-smooth);
}
.btn-clarifier:hover { background: rgba(160, 132, 92, 0.08); border-style: solid; }

/* ═══════════════════════════════════════
   COPY SUMMARY BUTTONS
   ═══════════════════════════════════════ */
#copy-summary-single-btn,
#copy-summary-spread-btn {
  display: inline-block;
  margin: 0.8rem auto 0;
}

#new-thought-spread-btn {
  margin: 0.8rem 0.35rem 0;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-auth-btn {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .nav-auth-text {
    display: none;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft);
    transform: none;
    left: 0;
  }

  .nav-links.open { display: flex; }
  .nav-link { padding: 0.8rem 1.5rem; border-bottom: 1px solid var(--border-soft); }
  .nav-link::after { display: none; }

  .nav-more {
    display: block;
    width: 100%;
  }

  .nav-more-toggle {
    width: 100%;
    text-align: left;
  }

  .nav-more-menu {
    position: static;
    min-width: 0;
    padding: 0;
    transform: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .nav-more:hover .nav-more-menu {
    display: none;
  }

  .nav-more.open .nav-more-menu,
  .nav-more:focus-within .nav-more-menu {
    display: grid;
  }

  .nav-more-link {
    padding: 0.7rem 2.25rem;
    border-bottom: 1px solid var(--border-soft);
    border-radius: 0;
  }

  .hero-title { font-size: 2.4rem; }
  .hero-features { grid-template-columns: 1fr; gap: 1rem; }
  .hero-card { width: 80px; height: 128px; }

  :root {
    --card-width: 160px;
    --card-height: 256px;
  }

  .spread-cards-area {
    gap: 0.85rem;
    margin: 1.4rem 0;
  }

  .spread-cards-area .tarot-card {
    width: 140px;
    height: 224px;
  }

  .spread-cards-area .tarot-card-sm {
    width: 118px;
    height: 189px;
  }

  .spread-position { gap: 0.6rem; }

  .spread-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .spread-focus-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

  .quiz-picker { grid-template-columns: 1fr; }
  .quiz-question { font-size: 1.05rem; }
  .quiz-result-title { font-size: 1.3rem; }

  .library-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.7rem; }

  .section-title { font-size: 1.5rem; }
  .page { padding: 4.5rem 1rem 3rem; }
  .why-page { padding: 4.8rem 1rem 3rem; }
  .why-container { padding-inline: clamp(0.8rem, 3vw, 1.4rem); }
  .why-return { margin-bottom: 1.5rem; }
  .why-hero { gap: 0.95rem; margin-bottom: 2rem; }
  .why-card-mark { width: 56px; height: 90px; }
  .why-copy { max-width: 640px; margin-left: 0; font-size: 1.03rem; line-height: 1.78; }
  .why-reminder { padding-left: 1rem; }
  .reading-result, .reflection-prompt { padding: 1.2rem; }
  .modal-content { padding: 1.5rem; }
  .welcome-message { padding: 1rem 1.2rem; }

  .journal-stats { gap: 1rem; }
  .stat-item { min-width: 90px; padding: 0.8rem 1rem; }

  /* Smaller, tighter fan on tablet width */
  .ritual-fan { height: 280px; }
  .fan-card {
    width: 80px;
    height: 128px;
    margin-left: -40px;
    --angle: calc((var(--i) - (var(--n) - 1) / 2) * 4.5deg);
    transform-origin: 50% 260%;
  }
  .fan-card .card-back-symbol { font-size: 1.4rem; }

  /* Mobile-compact spread result: fits more in one screenshot */
  .three-card-reading { gap: 0.7rem; }
  .reading-position-result {
    padding: 0.85rem 1rem;
    border-radius: 10px;
  }
  .position-title {
    font-size: 0.7rem;
    margin-bottom: 0.15rem;
    letter-spacing: 1.5px;
  }
  .result-card-name { font-size: 1.05rem; }
  .result-orientation { font-size: 0.7rem; margin-bottom: 0.3rem; }
  .result-meaning { font-size: 0.85rem; line-height: 1.45; }
  .clarifier-list { gap: 0.5rem; margin-top: 0.6rem; }
  .clarifier-item { padding: 0.5rem 0.6rem; gap: 0.6rem; }
  .clarifier-art { width: 44px; }
  .clarifier-meaning { font-size: 0.78rem; line-height: 1.4; }
  .btn-clarifier { font-size: 0.7rem; padding: 0.3rem 0.8rem; margin-top: 0.5rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.8rem; }
  .why-page { padding: 4.6rem 0.95rem 2.8rem; }
  .why-container { padding-inline: 0.55rem; }
  .why-return { margin-bottom: 1.25rem; }
  .why-hero { grid-template-columns: 1fr; gap: 0.9rem; margin-bottom: 1.75rem; }
  .why-card-mark { width: 50px; height: 80px; transform: rotate(-3deg); }
  .why-page .section-title { font-size: 1.95rem; }
  .why-page .section-subtitle { font-size: 1.02rem; }
  .why-copy { font-size: 0.98rem; line-height: 1.76; }
  .why-section { margin-bottom: 1.25rem; }
  .why-reminder { margin: 1.45rem 0; padding-left: 0.9rem; }
  .why-ending { margin-top: 1.45rem; }

  .spread-cards-area {
    gap: 0.55rem;
    margin: 1rem 0;
  }

  .spread-cards-area .tarot-card {
    width: 108px;
    height: 173px;
  }

  .spread-cards-area .tarot-card-sm {
    width: 86px;
    height: 138px;
  }

  .spread-position { gap: 0.45rem; }

  .spread-grid { grid-template-columns: 1fr 1fr; }
  .spread-focus-grid { grid-template-columns: 1fr; }

  .quiz-option { padding: 0.8rem 1rem; font-size: 0.88rem; }
  .quiz-result-card { padding: 1.5rem 1.2rem; }

  .library-grid { grid-template-columns: repeat(3, 1fr); }

  .reflection-actions { flex-direction: column; gap: 0.5rem; }

  /* Tightest fan on phones */
  .ritual-fan { height: 220px; margin-top: 1rem; }
  .fan-card {
    width: 60px;
    height: 96px;
    margin-left: -30px;
    --angle: calc((var(--i) - (var(--n) - 1) / 2) * 4deg);
    transform-origin: 50% 240%;
  }
  .fan-card .card-back-symbol { font-size: 1rem; }
  .ritual-prompt { font-size: 0.85rem; margin: 0.8rem 0 0.3rem; }

  /* Tighter still on phones — aim for screenshot-in-one-shot */
  :root {
    --card-width: 130px;
    --card-height: 208px;
  }
  .page { padding: 4.2rem 0.8rem 2rem; }
  .section-title { font-size: 1.3rem; margin-bottom: 0.4rem; }
  .section-subtitle { font-size: 0.85rem; margin-bottom: 0.8rem; }
  .reading-position-result { padding: 0.7rem 0.85rem; }
  .position-title { font-size: 0.65rem; }
  .result-card-name { font-size: 0.98rem; }
  .result-meaning { font-size: 0.8rem; }
  .clarifier-art { width: 38px; }
  .clarifier-name { font-size: 0.88rem; }
  .clarifier-meaning { font-size: 0.74rem; }
  .spread-active-title { font-size: 1.15rem; }
  .spread-active-desc { font-size: 0.85rem; }
  .filter-btn { font-size: 0.78rem; padding: 0.4rem 0.7rem; }
  .spread-category-filters { gap: 0.4rem; }
}

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

@media (max-width: 720px) {
  .home-spread-shortcut-list {
    grid-template-columns: 1fr;
  }

  .home-start-actions {
    grid-template-columns: 1fr;
  }

  .home-start-option {
    min-height: 96px;
  }

  .home-custom-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .home-custom-actions .btn-primary,
  .home-custom-actions .btn-ghost { width: 100%; }
}
