/* ==========================================================================
   PENTACLE — Dark Luxury & Luxury Light Stylesheet
   Mobile-First, Glassmorphism, Hybrid Tab Bar & Single-Focus Stage
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg-base: #070911;
  --bg-elevated: #0d1120;
  --bg-glass: rgba(16, 21, 37, 0.72);
  --bg-glass-strong: rgba(20, 26, 46, 0.88);
  --bg-card-surface: #111629;
  --bg-input: rgba(9, 12, 24, 0.78);

  --text-primary: #f3efe6;
  --text-secondary: #b9b4a8;
  --text-muted: #7f8498;

  --gold: #d4af6a;
  --gold-bright: #ebd09b;
  --gold-dim: #9a7b42;
  --gold-soft: rgba(212, 175, 106, 0.14);
  --gold-glow: rgba(212, 175, 106, 0.34);

  --border-subtle: rgba(212, 175, 106, 0.16);
  --border-strong: rgba(212, 175, 106, 0.42);

  /* Elemen Tarot */
  --el-fire: #e27d60;
  --el-water: #63a4db;
  --el-air: #b7a8e0;
  --el-earth: #7bb482;

  /* Status */
  --status-upright: #7bb482;
  --status-reversed: #d9826c;
  --danger: #df6b6b;

  /* Efek & Bayangan */
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.48);
  --shadow-gold: 0 8px 30px rgba(212, 175, 106, 0.16);
  --shadow-card: 0 14px 32px rgba(0, 0, 0, 0.42);
  --card-back-bg: radial-gradient(circle at 50% 35%, #1d2442 0%, #0b0f1f 85%);
  --card-face-bg: linear-gradient(165deg, #161b30 0%, #0c1020 100%);
  --orb-1: rgba(212, 175, 106, 0.11);
  --orb-2: rgba(74, 92, 173, 0.16);

  /* Design Tokens: Jarak, Radius & Tata Letak */
  --space-xs: 0.45rem;
  --space-sm: 0.75rem;
  --space-md: 1.1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.2rem;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --stage-max-width: 560px;
  --bottom-nav-h: 64px;
}

[data-theme="light"] {
  --bg-base: #f6f2ea;
  --bg-elevated: #ece5d8;
  --bg-glass: rgba(255, 252, 246, 0.8);
  --bg-glass-strong: rgba(255, 253, 249, 0.94);
  --bg-card-surface: #fdfbf7;
  --bg-input: rgba(255, 255, 255, 0.88);

  --text-primary: #1a1c24;
  --text-secondary: #4c5060;
  --text-muted: #767a8a;

  --gold: #9a7432;
  --gold-bright: #7d5b20;
  --gold-dim: #b69251;
  --gold-soft: rgba(154, 116, 50, 0.12);
  --gold-glow: rgba(154, 116, 50, 0.24);

  --border-subtle: rgba(154, 116, 50, 0.22);
  --border-strong: rgba(154, 116, 50, 0.52);

  --el-fire: #c4573b;
  --el-water: #2e72ab;
  --el-air: #6e5ea3;
  --el-earth: #3f7e4a;

  --status-upright: #3b7d48;
  --status-reversed: #b8563f;
  --danger: #b83b3b;

  --shadow-soft: 0 12px 32px rgba(42, 34, 18, 0.08);
  --shadow-gold: 0 8px 24px rgba(154, 116, 50, 0.14);
  --card-back-bg: radial-gradient(circle at 50% 35%, #2b2638 0%, #161421 88%);
  --card-face-bg: linear-gradient(165deg, #fffdf9 0%, #f3ece0 100%);
  --orb-1: rgba(186, 146, 74, 0.14);
  --orb-2: rgba(124, 134, 178, 0.12);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg-base);
  transition: background-color 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4, .serif {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0 0 0.85rem;
}

p:last-child {
  margin-bottom: 0;
}

button,
input,
textarea {
  font-family: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   Latar Atmosferik
   ========================================================================== */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

.orb-1 {
  width: 55vw;
  height: 55vw;
  max-width: 680px;
  max-height: 680px;
  top: -18%;
  right: -12%;
  background: var(--orb-1);
}

.orb-2 {
  width: 60vw;
  height: 60vw;
  max-width: 720px;
  max-height: 720px;
  bottom: -20%;
  left: -16%;
  background: var(--orb-2);
}

.ambient-grain {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: radial-gradient(var(--gold) 0.6px, transparent 0.6px);
  background-size: 26px 26px;
}

/* ==========================================================================
   Layout & Container
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1rem;
}

.main-shell {
  padding-top: 1.4rem;
  padding-bottom: 4.5rem;
}

.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}

/* ==========================================================================
   Header & Stepper
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-base) 82%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: none;
  border: none;
  padding: 0.25rem 0;
  cursor: pointer;
  text-align: left;
}

.brand-emblem {
  width: 40px;
  height: 40px;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 8px var(--gold-soft));
}

.brand:hover .brand-emblem {
  transform: scale(1.06);
  filter: drop-shadow(0 0 12px var(--gold-glow));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-primary);
  line-height: 1;
}

.brand-sub {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 2px;
}

.step-indicator {
  display: none;
  align-items: center;
  gap: 0.45rem;
}

.step-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.step-dot span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
}

.step-dot em {
  font-style: normal;
}

.step-dot.active {
  color: var(--gold-bright);
}

.step-dot.active span {
  background: var(--gold);
  border-color: var(--gold);
  color: #11131a;
}

.step-dot.completed {
  color: var(--text-secondary);
}

.step-dot.completed span {
  border-color: var(--gold);
  color: var(--gold);
}

.step-line {
  width: 24px;
  height: 1px;
  background: var(--border-subtle);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 40px;
  height: 40px;
  padding: 0 0.7rem;
  border-radius: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: var(--shadow-gold);
}

.btn-label-desktop {
  display: none;
  font-size: 0.82rem;
  font-weight: 500;
}

.badge-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--gold);
  color: #12141c;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ==========================================================================
   Section Stages & Typography
   ========================================================================== */
.stage-section {
  display: none;
  animation: fadeSlideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.stage-section.active {
  display: block;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stage-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 1.6rem;
}

.stage-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.stage-title {
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.stage-subtitle {
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.section-title {
  font-size: clamp(1.45rem, 3.2vw, 1.9rem);
  color: var(--text-primary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-lg {
  min-height: 48px;
  padding: 0.78rem 1.6rem;
  font-size: 0.95rem;
}

.btn-sm {
  min-height: 38px;
  padding: 0.45rem 0.95rem;
  font-size: 0.82rem;
}

.btn-xs {
  min-height: 32px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: #12141c;
  box-shadow: 0 6px 20px var(--gold-glow);
}

[data-theme="light"] .btn-primary {
  color: #fffdf8;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
  box-shadow: 0 10px 26px var(--gold-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-gold-outline {
  background: var(--gold-soft);
  border-color: var(--border-strong);
  color: var(--gold-bright);
}

.btn-gold-outline:hover {
  background: color-mix(in srgb, var(--gold) 24%, transparent);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--text-primary);
  background: var(--gold-soft);
}

.btn-danger-ghost {
  background: transparent;
  border-color: rgba(223, 107, 107, 0.35);
  color: var(--danger);
}

.btn-danger-ghost:hover {
  background: rgba(223, 107, 107, 0.12);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.stage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.stage-footer.single-right {
  justify-content: flex-end;
}

.stage-footer.compact-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Tahap 1: Form Kalibrasi
   ========================================================================== */
.calibration-card {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.35rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.field-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.label-opt {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.char-counter {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
}

.choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 0.9rem;
  border-radius: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.25s ease;
}

.choice-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.choice-card.selected {
  background: var(--gold-soft);
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}

.choice-glyph {
  font-size: 1.25rem;
  color: var(--gold);
  margin-bottom: 0.35rem;
  line-height: 1;
}

.choice-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.choice-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.text-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.55;
  resize: vertical;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.text-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.text-input::placeholder {
  color: var(--text-muted);
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.chip-btn {
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: var(--gold-soft);
}

.form-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.date-input {
  min-height: 46px;
  color-scheme: dark;
}

[data-theme="light"] .date-input {
  color-scheme: light;
}

.zodiac-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.7rem;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  background: var(--gold-soft);
  border: 1px solid var(--border-strong);
  animation: fadeSlideUp 0.3s ease;
}

.zodiac-pill-symbol {
  font-size: 1.4rem;
  color: var(--gold-bright);
  line-height: 1;
}

.zodiac-pill-text {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  line-height: 1.3;
}

.zodiac-pill-text span {
  color: var(--text-secondary);
  font-size: 0.74rem;
}

.style-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.style-option {
  display: flex;
  flex-direction: column;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.25s ease;
}

.style-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.style-option.selected {
  background: var(--gold-soft);
  border-color: var(--gold);
}

.style-option-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.style-option-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.toggle-row-spaced {
  margin-top: var(--space-sm);
}

.toggle-info {
  display: flex;
  flex-direction: column;
}

.toggle-title {
  font-size: 0.88rem;
  font-weight: 600;
}

.toggle-desc {
  font-size: 0.77rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(128, 134, 154, 0.32);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: 0.3s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--text-primary);
  transition: 0.3s ease;
}

.switch input:checked + .slider {
  background: var(--gold);
  border-color: var(--gold);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
  background: #12141c;
}

/* ==========================================================================
   Tahap 2: Pemilihan Pola Tebaran
   ========================================================================== */
.spread-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.spread-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.28s ease;
  position: relative;
}

.spread-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.spread-card.selected {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, var(--bg-glass));
  box-shadow: var(--shadow-gold);
}

.spread-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.spread-count-badge {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--gold-bright);
}

.rec-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  background: var(--gold);
  color: #12141c;
}

[data-theme="light"] .rec-badge {
  color: #fffdf8;
}

.spread-diagram {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 1rem;
}

.mini-card {
  width: 22px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  box-shadow: inset 0 0 8px rgba(212, 175, 106, 0.16);
}

.spread-diag-5 .mini-card:nth-child(2) { transform: translateY(-6px); }
.spread-diag-5 .mini-card:nth-child(4) { transform: translateY(-6px); }
.spread-diag-7 .mini-card { width: 17px; height: 27px; }
.spread-diag-7 .mini-card:nth-child(even) { transform: translateY(5px); }
.spread-diag-7 .mini-card:nth-child(odd) { transform: translateY(-4px); }

.spread-name {
  font-size: 1.45rem;
  margin-bottom: 0.35rem;
}

.spread-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.9rem;
}

.spread-slots-preview {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.35rem;
  width: 100%;
  margin-top: 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

/* Sejajarkan garis pemisah horizontal seluruh kartu dalam satu baris */
@media (min-width: 640px) {
  .spread-grid .spread-card,
  .spread-thematic-grid .spread-card {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 5;
    row-gap: 0;
    align-items: start;
    justify-items: stretch;
  }

  .spread-grid .spread-card-top,
  .spread-thematic-grid .spread-card-top {
    align-self: stretch;
    align-items: center;
  }

  .spread-grid .spread-slots-preview,
  .spread-thematic-grid .spread-slots-preview {
    align-self: stretch;
  }

  @supports not (grid-template-rows: subgrid) {
    .spread-grid .spread-card-top,
    .spread-thematic-grid .spread-card-top {
      min-height: 40px;
    }

    .spread-grid .spread-desc,
    .spread-thematic-grid .spread-desc {
      min-height: 4.6em;
    }
  }
}

.spread-slots-preview span {
  font-size: 0.71rem;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
}

/* ==========================================================================
   Tahap 3: Ritual Pengocokan & Kipas Kartu
   ========================================================================== */
.intention-pill {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--border-subtle);
  color: var(--gold-bright);
  font-size: 0.85rem;
  font-style: italic;
}

.ritual-panel {
  max-width: var(--stage-max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  text-align: center;
}

.ritual-panel.fan-stage-arched {
  max-width: 960px;
}

.deck-arena {
  position: relative;
  height: 248px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0 1.2rem;
  perspective: 1100px;
}

.shuffle-aura {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 72%);
  opacity: 0.45;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.deck-stack.is-shuffling + .shuffle-aura {
  opacity: 0.88;
  transform: scale(1.16);
}

.deck-stack.is-cutting + .shuffle-aura {
  opacity: 0.72;
  transform: scale(1.06);
}

.deck-stack {
  position: relative;
  width: 128px;
  aspect-ratio: 2 / 3;
  height: auto;
  transform-style: preserve-3d;
}

.deck-card-layer {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: var(--card-back-bg);
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(235, 208, 155, 0.16),
    2px 2px 0 rgba(212, 175, 106, 0.22);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  will-change: transform;
}

/* Ketebalan 7 lapis tumpukan dek 3D */
.layer-7 { transform: translate3d(-6px, 12px, -18px) rotate(-1.5deg); z-index: 1; opacity: 0.72; }
.layer-6 { transform: translate3d(-5px, 10px, -15px) rotate(-1deg); z-index: 2; opacity: 0.8; }
.layer-5 { transform: translate3d(-4px, 8px, -12px) rotate(-0.6deg); z-index: 3; opacity: 0.86; }
.layer-4 { transform: translate3d(-3px, 6px, -9px) rotate(-0.3deg); z-index: 4; opacity: 0.92; }
.layer-3 { transform: translate3d(-2px, 4px, -6px); z-index: 5; opacity: 0.95; }
.layer-2 { transform: translate3d(-1px, 2px, -3px); z-index: 6; opacity: 0.98; }
.layer-1 { transform: translate3d(0, 0, 0); z-index: 7; opacity: 1; }

.card-back-ornament {
  width: 84%;
  height: 88%;
  border: 1px solid rgba(212, 175, 106, 0.56);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card-back-ornament::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(212, 175, 106, 0.32);
  border-radius: 5px;
}

.card-back-ornament.mini-orn {
  border-color: rgba(212, 175, 106, 0.34);
}

.ornament-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  position: absolute;
}

.ornament-star {
  color: var(--gold-bright);
  font-size: 1.35rem;
}

.card-back-logo {
  width: 72%;
  max-width: 82px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(212, 175, 106, 0.35));
}

.card-back-logo-lg {
  width: 68%;
  max-width: 118px;
  margin-bottom: 18px;
}

/* Kilatan garis emas tipis tanda potong dek selesai */
.deck-cut-flash {
  position: absolute;
  inset: -4px;
  border-radius: 15px;
  pointer-events: none;
  opacity: 0;
  z-index: 20;
  border: 2px solid var(--gold-bright);
  box-shadow: 0 0 22px var(--gold-glow), inset 0 0 14px var(--gold-glow);
}

/* --------------------------------------------------------------------------
   1) ANIMASI KOCOK DEK (Riffle / Interleave Shuffle — Terbelah & Menyisip)
   -------------------------------------------------------------------------- */
.deck-stack.is-shuffling .deck-card-layer {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.52), 0 0 18px var(--gold-glow);
}

.deck-stack.is-shuffling .layer-1 { animation: riffleInterleaveRight 0.96s cubic-bezier(0.37, 0, 0.22, 1) 0ms both; }
.deck-stack.is-shuffling .layer-2 { animation: riffleInterleaveLeft  0.96s cubic-bezier(0.37, 0, 0.22, 1) 55ms both; }
.deck-stack.is-shuffling .layer-3 { animation: riffleInterleaveRight 0.96s cubic-bezier(0.37, 0, 0.22, 1) 110ms both; }
.deck-stack.is-shuffling .layer-4 { animation: riffleInterleaveLeft  0.96s cubic-bezier(0.37, 0, 0.22, 1) 165ms both; }
.deck-stack.is-shuffling .layer-5 { animation: riffleInterleaveRight 0.96s cubic-bezier(0.37, 0, 0.22, 1) 220ms both; }
.deck-stack.is-shuffling .layer-6 { animation: riffleInterleaveLeft  0.96s cubic-bezier(0.37, 0, 0.22, 1) 275ms both; }
.deck-stack.is-shuffling .layer-7 { animation: riffleBasePulse       0.96s cubic-bezier(0.37, 0, 0.22, 1) 300ms both; }

@keyframes riffleInterleaveRight {
  0%   { transform: translate3d(0, 0, 0) rotateZ(0deg) rotateY(0deg); }
  26%  { transform: translate3d(76px, -6px, 14px) rotateZ(7deg) rotateY(-14deg); }
  54%  { transform: translate3d(44px, -24px, 28px) rotateZ(-4deg) rotateY(10deg); }
  78%  { transform: translate3d(8px, -8px, 12px) rotateZ(2deg) rotateY(-4deg); }
  100% { transform: translate3d(0, 0, 0) rotateZ(0deg) rotateY(0deg); }
}

@keyframes riffleInterleaveLeft {
  0%   { transform: translate3d(-1px, 2px, -3px) rotateZ(0deg) rotateY(0deg); }
  26%  { transform: translate3d(-76px, -4px, 10px) rotateZ(-7deg) rotateY(14deg); }
  54%  { transform: translate3d(-44px, -22px, 24px) rotateZ(4deg) rotateY(-10deg); }
  78%  { transform: translate3d(-8px, -6px, 8px) rotateZ(-2deg) rotateY(4deg); }
  100% { transform: translate3d(-1px, 2px, -3px) rotateZ(0deg) rotateY(0deg); }
}

@keyframes riffleBasePulse {
  0%, 100% { transform: translate3d(-6px, 12px, -18px) rotate(-1.5deg); }
  50%      { transform: translate3d(0, 14px, -22px) rotate(1.5deg); }
}

/* --------------------------------------------------------------------------
   2) ANIMASI POTONG DEK (Clean Split & Stack Swap — Tegas, Jeda, Tukar Posisi)
   -------------------------------------------------------------------------- */
.deck-stack.is-cutting .layer-1,
.deck-stack.is-cutting .layer-2,
.deck-stack.is-cutting .layer-3 {
  animation: cutTopPackSwap 1.08s cubic-bezier(0.25, 0.85, 0.3, 1) both;
}

.deck-stack.is-cutting .layer-4,
.deck-stack.is-cutting .layer-5,
.deck-stack.is-cutting .layer-6,
.deck-stack.is-cutting .layer-7 {
  animation: cutBottomPackRise 1.08s cubic-bezier(0.25, 0.85, 0.3, 1) both;
}

.deck-stack.is-cutting .deck-cut-flash {
  animation: cutGoldEdgeFlash 1.08s ease-out both;
}

@keyframes cutTopPackSwap {
  0%   { transform: translate3d(0, 0, 0); z-index: 9; }
  22%  { transform: translate3d(0, -18px, 20px); z-index: 9; }
  42%  { transform: translate3d(92px, -16px, 20px) rotateZ(1.5deg); z-index: 9; }
  56%  { transform: translate3d(92px, 10px, -12px) rotateZ(0deg); z-index: 2; }
  82%  { transform: translate3d(0, 10px, -12px); z-index: 2; }
  100% { transform: translate3d(0, 0, 0); z-index: 6; }
}

@keyframes cutBottomPackRise {
  0%   { transform: translate3d(-3px, 8px, -10px); z-index: 3; }
  42%  { transform: translate3d(-3px, 8px, -10px); z-index: 3; }
  58%  { transform: translate3d(-12px, -12px, 18px); z-index: 10; }
  82%  { transform: translate3d(0, -4px, 14px); z-index: 10; }
  100% { transform: translate3d(-3px, 6px, -9px); z-index: 4; }
}

@keyframes cutGoldEdgeFlash {
  0%, 74% { opacity: 0; transform: scale(0.97); }
  85%     { opacity: 1; transform: scale(1.03); }
  100%    { opacity: 0; transform: scale(1.06); }
}

.ritual-status {
  max-width: 520px;
  margin: 0 auto 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.shuffle-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.35rem;
}

.meta-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.ritual-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

/* ==========================================================================
   Kipas Kartu Melengkung (Arched Card Fan — 60 FPS GPU & Responsif)
   ========================================================================== */
.fan-stage-arched {
  --fan-card-w: 96px;
  --fan-card-h: 158px;
  --fan-overlap: -16px;
  overflow: hidden;
}

.fan-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.fan-instruction {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.4rem, 4vw, 1.7rem);
  line-height: 1.15;
}

.fan-instruction strong {
  color: var(--gold-bright);
}

.fan-subtitle {
  max-width: 560px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0 0 0.35rem;
}

/* Indikator Slot Kartu Terpilih (Ringkas di Atas Lengkungan) */
.slot-tracker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  max-width: 680px;
}

.slot-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.72rem;
  padding: 0.26rem 0.68rem;
  border-radius: 999px;
  border: 1px dashed var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-muted);
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.slot-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.64rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.slot-pill.is-next {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.slot-pill.filled {
  border-style: solid;
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold-bright);
  font-weight: 600;
  box-shadow: 0 0 14px var(--gold-soft);
  animation: slotPop 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.slot-pill.filled .slot-pill-icon {
  background: var(--gold);
  border-color: var(--gold);
  color: #12141c;
}

@keyframes slotPop {
  0% { transform: scale(0.9); }
  55% { transform: scale(1.07); }
  100% { transform: scale(1); }
}

/* Area Viewport Lengkungan Kipas */
.fan-viewport-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0.15rem -0.5rem 0.25rem;
}

/* Penanda Fokus Tengah Halus di Atas Busur */
.fan-center-reticle {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  pointer-events: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  color: var(--gold-bright);
  font-size: 0.72rem;
  opacity: 0.85;
  text-shadow: 0 0 10px var(--gold-glow);
}

.fan-nav-btn {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--gold-bright);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.fan-nav-btn:hover {
  transform: translateY(-50%) scale(1.08);
  background: var(--gold);
  color: #11131a;
}

.fan-nav-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.fan-nav-btn.left { left: 10px; }
.fan-nav-btn.right { right: 10px; }

.card-fan-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-top: 2.85rem;
  padding-bottom: 2.9rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  mask-image: linear-gradient(to right, transparent 0%, #000 7%, #000 93%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 7%, #000 93%, transparent 100%);
}

.card-fan-scroll::-webkit-scrollbar {
  display: none;
}

.card-fan-scroll.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.card-fan-scroll.is-locked {
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.3s ease;
}

/* Padding kiri-kanan presisi agar kartu pertama & terakhir berhenti tepat di tengah */
.card-fan-track {
  display: flex;
  align-items: center;
  width: max-content;
  min-width: 100%;
  padding-inline: calc(50% - (var(--fan-card-w) / 2));
  min-height: calc(var(--fan-card-h) + 28px);
}

/* Kartu Tertutup di Dalam Lengkungan (Transform GPU & Culling dikendalikan oleh rAF) */
.fan-card {
  position: relative;
  width: var(--fan-card-w);
  aspect-ratio: 2 / 3;
  height: auto;
  margin-inline: var(--fan-overlap);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  scroll-snap-align: center;
  scroll-snap-stop: normal;
  transform-origin: center 130%;
  contain: style;
  -webkit-tap-highlight-color: transparent;
}

/* Alokasikan layer GPU hanya pada kartu aktif / terdekat agar ringan di iOS Safari */
.fan-card.is-gpu-active,
.fan-card.is-centered,
.fan-card.is-picking {
  will-change: transform;
}

.fan-card:first-child {
  margin-left: 0;
}

.fan-card:last-child {
  margin-right: 0;
}

.fan-card:focus-visible {
  outline: none;
}

.fan-card:focus-visible .fan-card-body {
  box-shadow: 0 0 0 2px var(--gold-bright), 0 14px 28px var(--gold-glow);
}

/* Desain Belakang Kartu Khas ARCANUM (Dark Indigo & Light Ivory) */
.fan-card-body {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 35%, #1d2442 0%, #0b0f1f 86%);
  border: 1.4px solid rgba(212, 175, 106, 0.56);
  box-shadow:
    -6px 10px 20px rgba(0, 0, 0, 0.52),
    0 2px 6px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(235, 208, 155, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    opacity 0.28s ease;
}

[data-theme="light"] .fan-card-body {
  background: radial-gradient(circle at 50% 35%, #fffdf8 0%, #ede3cf 88%);
  border-color: rgba(154, 116, 50, 0.58);
  box-shadow:
    -5px 9px 18px rgba(42, 34, 18, 0.16),
    0 2px 5px rgba(42, 34, 18, 0.1),
    inset 0 0 0 1px rgba(154, 116, 50, 0.2);
}

/* Bingkai Garis Ganda Emas */
.fan-card-body::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(212, 175, 106, 0.44);
  border-radius: 7px;
  pointer-events: none;
}

.fan-card-body::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(212, 175, 106, 0.28);
  border-radius: 4px;
  pointer-events: none;
}

[data-theme="light"] .fan-card-body::before {
  border-color: rgba(154, 116, 50, 0.45);
}

[data-theme="light"] .fan-card-body::after {
  border-color: rgba(154, 116, 50, 0.28);
}

.fan-card-emblem {
  position: relative;
  width: 64%;
  max-width: 68px;
  aspect-ratio: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.fan-card-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(212, 175, 106, 0.3));
}

/* Active Focus State (Kartu Tengah) */
.fan-card.is-centered .fan-card-body {
  border-color: var(--gold-bright);
  border-width: 1.8px;
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.56),
    0 0 26px var(--gold-glow),
    inset 0 0 18px rgba(212, 175, 106, 0.18);
}

[data-theme="light"] .fan-card.is-centered .fan-card-body {
  border-color: var(--gold);
  box-shadow:
    0 14px 28px rgba(42, 34, 18, 0.2),
    0 0 22px var(--gold-glow),
    inset 0 0 14px rgba(154, 116, 50, 0.14);
}

.fan-card.is-centered .fan-card-emblem {
  border-color: var(--gold-bright);
  transform: scale(1.1);
}

/* Desktop Hover Halus pada Kartu Samping */
@media (hover: hover) and (pointer: fine) {
  .fan-card:not(.is-centered):not(.is-picking):hover .fan-card-body {
    transform: translateY(-9px);
    border-color: var(--gold-bright);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.48), 0 0 16px var(--gold-soft);
  }
}

/* Animasi Terpilih: Melayang Naik, Mengecil & Memudar lalu Merapat */
.fan-card.is-picking {
  pointer-events: none;
  z-index: 60 !important;
}

.fan-card.is-picking .fan-card-body {
  transform: translate3d(0, -60px, 0) scale(0.85);
  opacity: 0;
  transition:
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease;
}

.fan-card.is-collapsing {
  width: 0 !important;
  margin-inline: 0 !important;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: width 0.22s ease, margin 0.22s ease, opacity 0.18s ease;
}

/* Indikator Posisi Dek 78 Kartu (Tipis & Elegan) */
.fan-position-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.38rem;
  margin: -0.35rem auto 0.85rem;
  width: min(240px, 76%);
}

.fan-position-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.fan-progress-track {
  position: relative;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: var(--border-subtle);
  overflow: hidden;
}

.fan-progress-fill {
  width: 50%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  box-shadow: 0 0 8px var(--gold-glow);
  transition: width 0.18s ease-out;
}

/* Tombol Pil Aksi Utama di Bawah Lengkungan Tengah */
.fan-primary-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.15rem;
}

.fan-select-pill {
  min-width: min(280px, 92%);
  min-height: 48px;
  border-radius: 999px;
  padding: 0.72rem 1.65rem;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.fan-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 460px;
}

/* Adaptasi Desktop / Tablet (>= 769px): Lengkungan Lebih Lega + Panah Tepi */
@media (min-width: 769px) {
  .fan-stage-arched {
    --fan-card-w: 116px;
    --fan-card-h: 192px;
    --fan-overlap: -14px;
  }

  .fan-nav-btn {
    display: inline-flex;
  }

  .card-fan-scroll {
    padding-top: 3.25rem;
    padding-bottom: 4.1rem;
  }

  .fan-card-emblem {
    width: 66%;
    max-width: 78px;
  }
}

/* Adaptasi Mobile (<= 768px): Panah Tersembunyi & Ruang Lega Ibu Jari */
@media (max-width: 768px) {
  .fan-nav-btn {
    display: none !important;
  }

  .fan-viewport-wrap {
    margin-inline: -1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fan-card.is-picking .fan-card-body {
    transform: scale(0.94);
  }
}

/* ==========================================================================
   Tahap 4 & 5: Pengungkapan Kartu (3D Flip) & Clarifier
   ========================================================================== */
.reading-top-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.reading-title {
  margin-bottom: 0.25rem;
}

.reading-question-quote {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.18rem;
  color: var(--gold-bright);
  margin-top: 0.25rem;
}

.reading-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.reveal-hint-bar {
  padding: 0.72rem 1rem;
  border-radius: 12px;
  background: var(--gold-soft);
  border: 1px solid var(--border-subtle);
  font-size: 0.84rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 1.35rem;
}

.cards-reveal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  width: 100%;
  max-width: var(--stage-max-width);
  margin: 0 auto var(--space-xl);
}

/* Kartu Slot Wrapper */
.reading-slot-card {
  display: flex;
  flex-direction: column;
  padding: 1.2rem;
  transition: border-color 0.3s ease;
}

.reading-slot-card.is-revealed {
  border-color: var(--border-strong);
}

.slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.slot-badge {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.orientation-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.orientation-badge.upright {
  background: rgba(123, 180, 130, 0.16);
  color: var(--status-upright);
  border: 1px solid rgba(123, 180, 130, 0.35);
}

.orientation-badge.reversed {
  background: rgba(217, 130, 108, 0.16);
  color: var(--status-reversed);
  border: 1px solid rgba(217, 130, 108, 0.35);
}

/* 3D Flip Scene */
.tarot-card-scene {
  width: min(210px, 60vw);
  aspect-ratio: 2 / 3;
  height: auto;
  margin: 0 auto 1.15rem;
  perspective: 1200px;
  cursor: pointer;
}

.tarot-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.tarot-card-scene.flipped .tarot-card-inner {
  transform: rotateY(180deg);
}

.tarot-face {
  position: absolute;
  inset: 0;
  border-radius: 15px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42);
}

.tarot-face-back {
  background: var(--card-back-bg);
  border: 1.5px solid var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.tarot-face-back:hover {
  box-shadow: 0 0 28px var(--gold-glow);
}

.tap-to-reveal-label {
  position: absolute;
  bottom: 18px;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: rgba(8, 10, 18, 0.72);
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 106, 0.35);
}

.tarot-face-front {
  transform: rotateY(180deg);
  background: var(--card-face-bg);
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tarot-face-front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 25%, rgba(255, 240, 200, 0.22) 50%, transparent 75%);
  transform: translateX(-120%);
  pointer-events: none;
}

.tarot-card-scene.flipped .tarot-face-front::after {
  animation: shimmerSweep 1.1s ease 0.35s forwards;
}

@keyframes shimmerSweep {
  to { transform: translateX(130%); }
}

.tarot-svg-art {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.5s ease;
}

.tarot-card-scene.is-reversed .tarot-svg-art {
  transform: rotate(180deg);
}

/* Detail Kartu Terungkap */
.card-details-panel {
  animation: fadeSlideUp 0.45s ease;
}

.card-title-block {
  text-align: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-name-en {
  font-size: 1.45rem;
  color: var(--text-primary);
}

.card-name-id {
  font-size: 0.84rem;
  color: var(--gold);
  margin-top: 0.12rem;
}

.card-meta-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.meta-tag {
  font-size: 0.71rem;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.meta-tag.el-fire { border-color: color-mix(in srgb, var(--el-fire) 55%, transparent); color: var(--el-fire); }
.meta-tag.el-water { border-color: color-mix(in srgb, var(--el-water) 55%, transparent); color: var(--el-water); }
.meta-tag.el-air { border-color: color-mix(in srgb, var(--el-air) 55%, transparent); color: var(--el-air); }
.meta-tag.el-earth { border-color: color-mix(in srgb, var(--el-earth) 55%, transparent); color: var(--el-earth); }

.card-keywords {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.kw-pill {
  font-size: 0.72rem;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-bright);
}

.card-archetype {
  font-size: 0.84rem;
  font-style: italic;
  color: var(--text-secondary);
  padding: 0.65rem 0.8rem;
  border-left: 2px solid var(--gold);
  background: var(--bg-input);
  border-radius: 0 8px 8px 0;
  margin-bottom: 0.85rem;
}

.card-meaning-text {
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 0.8rem;
}

.card-advice-box {
  font-size: 0.83rem;
  color: var(--text-secondary);
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 8%, var(--bg-input));
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.9rem;
}

.card-advice-box strong {
  color: var(--gold-bright);
}

/* Clarifier Button & Result */
.clarifier-zone {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-subtle);
}

.btn-clarifier {
  width: 100%;
}

.clarifier-result {
  margin-top: 0.75rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  animation: fadeSlideUp 0.4s ease;
}

.clarifier-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.clarifier-mini-svg {
  width: 48px;
  height: 78px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--gold);
  flex-shrink: 0;
}

.clarifier-mini-svg.is-reversed svg {
  transform: rotate(180deg);
}

.clarifier-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
  color: var(--gold-bright);
}

.clarifier-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.clarifier-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Dashboard Analisis Simbolik & Transparansi Logika
   ========================================================================== */
.synthesis-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.85rem;
  animation: fadeSlideUp 0.55s ease;
}

.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric-card {
  padding: 1.2rem;
}

.metric-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.metric-icon {
  color: var(--gold);
  font-size: 1.1rem;
}

.metric-head h4 {
  font-size: 1.22rem;
  color: var(--text-primary);
}

.metric-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Visual Bar Rasio & Elemen */
.ratio-bar-track {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-input);
  margin: 0.65rem 0;
}

.ratio-major {
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
}

.ratio-minor {
  background: rgba(135, 148, 184, 0.45);
}

.ratio-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

.element-row {
  margin-bottom: 0.58rem;
}

.element-row-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  margin-bottom: 0.22rem;
}

.element-track {
  height: 7px;
  border-radius: 999px;
  background: var(--bg-input);
  overflow: hidden;
}

.element-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.element-fill.fire { background: var(--el-fire); }
.element-fill.water { background: var(--el-water); }
.element-fill.air { background: var(--el-air); }
.element-fill.earth { background: var(--el-earth); }

.insight-callout {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: var(--bg-input);
  border-left: 2px solid var(--gold);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.insight-callout.alert {
  border-left-color: var(--status-reversed);
}

.resonance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-size: 0.74rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
}

/* Transparansi Logika */
.transparency-panel {
  padding: 0.2rem 1.2rem;
}

.transparency-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-secondary);
  list-style: none;
}

.transparency-summary::-webkit-details-marker {
  display: none;
}

.transparency-summary strong {
  color: var(--gold-bright);
}

.transparency-panel[open] .chevron {
  transform: rotate(180deg);
}

.chevron {
  transition: transform 0.25s ease;
  color: var(--gold);
}

.transparency-body {
  padding: 0 0 1rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.9rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.transparency-body ul {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* ==========================================================================
   Sintesis Narasi Terpadu
   ========================================================================== */
.narrative-section {
  padding: 1.5rem;
}

.narrative-head {
  margin-bottom: 1.1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}

.narrative-lead-callout {
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  border-left: 3px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 8%, var(--bg-input));
}

.narrative-lead-kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.narrative-lead-callout p {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.12rem, 3.4vw, 1.32rem);
  line-height: 1.5;
  color: var(--text-primary);
  margin: 0;
}

.narrative-prose {
  font-size: clamp(0.95rem, 2.8vw, 1.05rem);
  line-height: 1.75;
  color: #ebe6dc;
  margin-bottom: 1.45rem;
}

[data-theme="light"] .narrative-prose {
  color: #262934;
}

.narrative-prose p {
  margin: 0 0 1rem;
}

.narrative-prose p:last-child {
  margin-bottom: 0;
}

.narrative-prose strong {
  color: var(--gold-bright);
  font-weight: 600;
}

.actions-box {
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  background: var(--gold-soft);
  border: 1px solid var(--border-strong);
}

.actions-title {
  font-size: 1.25rem;
  color: var(--gold-bright);
  margin-bottom: 0.7rem;
}

.concrete-actions-list {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.89rem;
  color: var(--text-primary);
}

/* ==========================================================================
   Tahap 6: Refleksi, Jurnal & Guardrail Etis
   ========================================================================== */
.journal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

.reflection-card,
.journal-card {
  padding: 1.35rem;
}

.reflection-lead {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.45rem 0 1rem;
}

.reflection-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reflection-item {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: var(--bg-input);
  border-left: 3px solid var(--gold);
}

.reflection-item-source {
  display: block;
  font-size: 0.71rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.reflection-item-question {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.18rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.4;
}

.journal-textarea {
  margin-top: 0.85rem;
  min-height: 130px;
}

.journal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.save-status {
  font-size: 0.8rem;
  color: var(--status-upright);
}

.ethical-guardrail {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 0.79rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.guardrail-icon {
  color: var(--gold);
  font-size: 1rem;
  margin-top: 1px;
}

/* ==========================================================================
   Modal Riwayat & JSON
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 7, 13, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  animation: fadeIn 0.25s ease;
}

#json-modal.modal-backdrop {
  justify-content: center;
  padding: 1rem;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-drawer {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  border-radius: 20px 0 0 20px;
  display: flex;
  flex-direction: column;
  background: var(--bg-glass-strong);
}

.modal-box {
  width: 100%;
  max-width: 720px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-glass-strong);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.3rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.45rem;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.15rem 1.3rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.95rem 1.3rem;
  border-top: 1px solid var(--border-subtle);
}

.history-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.history-item {
  padding: 1rem;
  border-radius: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.85rem;
  transition: border-color 0.25s ease;
}

.history-item:hover {
  border-color: var(--border-strong);
}

.history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.history-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.history-tag {
  font-size: 0.7rem;
  padding: 0.14rem 0.52rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-bright);
}

.history-question {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.12rem;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}

.history-cards-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.history-card-chip {
  font-size: 0.71rem;
  padding: 0.16rem 0.48rem;
  border-radius: 6px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.history-note-preview {
  font-size: 0.79rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.75rem;
}

.history-item-actions {
  display: flex;
  gap: 0.5rem;
}

.json-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}

.json-code-block {
  margin: 0;
  padding: 1rem;
  border-radius: 12px;
  background: #090c16;
  color: #e2d5b7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.5;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: calc(100% - 2rem);
  max-width: 380px;
  pointer-events: none;
}

.toast {
  padding: 0.78rem 1.1rem;
  border-radius: 12px;
  background: var(--bg-glass-strong);
  border: 1px solid var(--gold);
  color: var(--text-primary);
  font-size: 0.84rem;
  text-align: center;
  box-shadow: var(--shadow-soft), var(--shadow-gold);
  animation: toastPop 0.35s ease;
}

@keyframes toastPop {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Responsive Breakpoints (Mobile-First -> Tablet -> Desktop)
   ========================================================================== */
@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }

  .calibration-card {
    padding: 1.9rem;
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .spread-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn-label-desktop {
    display: inline;
  }

  .reading-top-bar {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

@media (min-width: 900px) {
  .step-indicator {
    display: inline-flex;
  }

  .category-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .form-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .spread-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .cards-reveal-grid[data-spread-count="3"],
  .cards-reveal-grid[data-spread-count="5"],
  .cards-reveal-grid[data-spread-count="7"] {
    max-width: var(--stage-max-width);
    grid-template-columns: 1fr;
  }

  .journal-grid {
    grid-template-columns: 1fr 1fr;
  }

  .narrative-section {
    padding: 2rem;
  }
}

@media (max-width: 480px) {
  .modal-drawer {
    border-radius: 0;
  }

  .tarot-card-scene {
    width: 176px;
    aspect-ratio: 2 / 3;
    height: auto;
  }
}

/* ==========================================================================
   UPGRADE UX & STORAGE — Fase Bulan, Banner Sesi, Tab Hasil, Foil, Inspector
   ========================================================================== */

/* 1. Indikator Fase Bulan di Header */
.moon-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  height: 40px;
  padding: 0 0.72rem;
  border-radius: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--gold-bright);
  font-size: 0.76rem;
  font-weight: 500;
  white-space: nowrap;
}

.moon-svg {
  width: 17px;
  height: 17px;
  color: var(--gold);
  flex-shrink: 0;
}

.moon-label {
  display: none;
  color: var(--text-secondary);
}

@media (min-width: 768px) {
  .moon-label {
    display: inline;
  }
}

/* 2. Banner Penyelamat Sesi, Kunci Kartu Harian & Mode Pratinjau Link */
.session-banner,
.status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.15rem;
  margin-bottom: 1.35rem;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--gold) 10%, var(--bg-glass-strong));
  animation: fadeSlideUp 0.35s ease;
}

.session-banner {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.session-banner-text,
.status-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.session-banner-text strong,
.status-banner-text strong {
  color: var(--gold-bright);
  font-size: 0.9rem;
}

.session-banner-actions,
.status-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* 3. Field Nama Panggilan & Profil Ringkas */
.profile-sub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.profile-memory-hint {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* 4. Bilah Aksi Bawa Pulang (Link, Bagikan, Story 9:16, PDF) */
.reading-export-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
}

.reading-export-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-right: auto;
}

.reading-export-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
}

.reading-export-actions .btn {
  width: 100%;
  text-align: center;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .reading-export-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: auto;
  }
}

/* 5. Navigasi 3 Tab Hasil (Pola Besar | Detail Kartu | Aksi & Jurnal) */
.reading-tabs-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  padding: 0.38rem;
  border-radius: 14px;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.35rem;
  position: sticky;
  top: 74px;
  z-index: 30;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.reading-tab-btn {
  min-height: 40px;
  padding: 0.45rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
}

.reading-tab-btn:hover {
  color: var(--text-primary);
  background: var(--gold-soft);
}

.reading-tab-btn.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: #12141c;
  box-shadow: 0 4px 14px var(--gold-glow);
}

[data-theme="light"] .reading-tab-btn.active {
  color: #fffdf8;
}

/* Aturan Visibilitas Konten Berdasarkan Tab Aktif */
#step-4.tabs-ready[data-active-tab="overview"] #cards-reveal-grid,
#step-4.tabs-ready[data-active-tab="overview"] #reflection-journal-section,
#step-4.tabs-ready[data-active-tab="overview"] .actions-box {
  display: none;
}

#step-4.tabs-ready[data-active-tab="cards"] .dashboard-section,
#step-4.tabs-ready[data-active-tab="cards"] #narrative-synthesis,
#step-4.tabs-ready[data-active-tab="cards"] #reflection-journal-section {
  display: none;
}

#step-4.tabs-ready[data-active-tab="actions"] #cards-reveal-grid,
#step-4.tabs-ready[data-active-tab="actions"] .dashboard-section,
#step-4.tabs-ready[data-active-tab="actions"] #narrative-synthesis .narrative-head,
#step-4.tabs-ready[data-active-tab="actions"] #narrative-synthesis #narrative-prose {
  display: none;
}

#step-4.tabs-ready[data-active-tab="actions"] #narrative-synthesis {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

/* 6. Efek Kilau 3D (Foil Tilt & Shimmer) pada Kartu Terbuka */
.tarot-face-front,
.inspector-card-stage {
  --foil-x: 50%;
  --foil-y: 50%;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  transform-style: preserve-3d;
}

.tarot-card-scene.flipped .tarot-face-front {
  transition: transform 0.2s ease-out, box-shadow 0.25s ease;
}

.tarot-card-scene.flipped .tarot-face-front.foil-active {
  transform: rotateY(180deg) perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) scale(1.02);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.48), 0 0 24px var(--gold-glow);
}

.foil-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    radial-gradient(
      circle at var(--foil-x) var(--foil-y),
      rgba(255, 244, 209, 0.44) 0%,
      rgba(212, 175, 106, 0.22) 28%,
      rgba(255, 255, 255, 0) 64%
    ),
    linear-gradient(
      125deg,
      rgba(235, 208, 155, 0.08) 0%,
      rgba(212, 175, 106, 0.16) 50%,
      rgba(235, 208, 155, 0.05) 100%
    );
  transition: opacity 0.25s ease;
}

[data-theme="light"] .foil-overlay {
  mix-blend-mode: soft-light;
}

.foil-active .foil-overlay {
  opacity: 1;
}

.inspect-hint-pill {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.16rem 0.56rem;
  border-radius: 999px;
  background: rgba(7, 9, 17, 0.78);
  color: var(--gold-bright);
  border: 1px solid rgba(212, 175, 106, 0.4);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
  white-space: nowrap;
}

.tarot-card-scene.flipped:hover .inspect-hint-pill,
.tarot-card-scene.flipped:focus-visible .inspect-hint-pill {
  opacity: 1;
}

/* 7. Modal Card Inspector */
#card-inspector-modal.modal-backdrop {
  justify-content: center;
  padding: 1rem;
}

.inspector-modal-box {
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-glass-strong);
}

.inspector-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
  align-items: start;
}

@media (min-width: 700px) {
  .inspector-layout {
    grid-template-columns: 248px 1fr;
  }
}

.inspector-visual-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.inspector-card-stage {
  position: relative;
  width: 224px;
  aspect-ratio: 2 / 3;
  height: auto;
  border-radius: 16px;
  background: var(--card-face-bg);
  border: 1.5px solid var(--gold);
  overflow: hidden;
  box-shadow: var(--shadow-soft), var(--shadow-gold);
  transition: transform 0.2s ease-out;
}

.inspector-card-stage.foil-active {
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) scale(1.02);
}

.inspector-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.inspector-card-stage.is-reversed .tarot-svg-art {
  transform: rotate(180deg);
}

.inspector-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.inspector-card-title {
  font-size: 1.95rem;
  color: var(--text-primary);
}

.inspector-card-sub {
  font-size: 0.94rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

.inspector-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.inspector-meta-box {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
}

.inspector-meta-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.el-text-fire { color: var(--el-fire); }
.el-text-water { color: var(--el-water); }
.el-text-air { color: var(--el-air); }
.el-text-earth { color: var(--el-earth); }

.inspector-block {
  margin-bottom: 0.9rem;
}

.inspector-kabbalah {
  font-size: 0.86rem;
  color: var(--text-primary);
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: var(--bg-input);
  border-left: 2px solid var(--gold);
}

.inspector-archetype {
  font-size: 0.86rem;
  font-style: italic;
  color: var(--text-secondary);
}

.inspector-keywords {
  justify-content: flex-start;
  margin-bottom: 0;
}

/* 8. Tombol Cadangan & Pulihkan di Modal Riwayat */
.history-backup-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1.3rem;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--gold) 6%, transparent);
}

.history-backup-bar .btn {
  flex: 1 1 auto;
}

/* 9. Template Tersembunyi Ekspor Gambar Story 9:16 (540x960 * scale 2 = 1080x1920) */
.story-export-stage {
  position: fixed;
  left: -9999px;
  top: 0;
  pointer-events: none;
  z-index: -10;
}

.story-canvas {
  width: 540px;
  height: 960px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
}

.story-canvas.theme-dark {
  background: radial-gradient(circle at 20% 15%, #19213c 0%, #090c17 55%, #060810 100%);
  color: #f3efe6;
  --st-gold: #d4af6a;
  --st-gold-bright: #ebd09b;
  --st-muted: #a9a499;
  --st-surface: rgba(18, 24, 43, 0.84);
  --st-border: rgba(212, 175, 106, 0.36);
}

.story-canvas.theme-light {
  background: radial-gradient(circle at 20% 15%, #ffffff 0%, #f5efe4 60%, #eadfcd 100%);
  color: #1a1c24;
  --st-gold: #9a7432;
  --st-gold-bright: #7d5b20;
  --st-muted: #5a5e6d;
  --st-surface: rgba(255, 253, 248, 0.9);
  --st-border: rgba(154, 116, 50, 0.38);
}

.story-border-frame {
  flex: 1;
  border: 1.5px solid var(--st-border);
  border-radius: 20px;
  padding: 24px 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  position: relative;
}

.story-header {
  text-align: center;
}

.story-brand-kicker {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--st-gold-bright);
  line-height: 1.1;
}

.story-meta-date {
  font-size: 11px;
  color: var(--st-muted);
  margin-top: 6px;
}

/* Spotlight Eksklusif Nama Panggilan di Template Story 9:16 */
.story-spotlight-block {
  margin-top: 10px;
  padding: 10px 12px 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(212, 175, 106, 0.11) 0%, rgba(212, 175, 106, 0.03) 100%);
  border: 1px solid var(--st-border);
  text-align: center;
}

.story-spotlight-kicker {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--st-muted);
  margin-bottom: 4px;
}

.story-spotlight-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.story-spotlight-line {
  flex: 0 1 46px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--st-gold), transparent);
  opacity: 0.85;
}

.story-spotlight-star {
  font-size: 10px;
  color: var(--st-gold-bright);
  line-height: 1;
}

.story-spotlight-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.04em;
  color: var(--st-gold-bright);
  text-shadow: 0 0 18px rgba(212, 175, 106, 0.45);
  max-width: 310px;
  word-wrap: break-word;
}

.story-spotlight-name.is-fallback {
  font-size: 21px;
  letter-spacing: 0.1em;
}

.story-spotlight-zodiac {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(212, 175, 106, 0.14);
  border: 1px solid var(--st-border);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--st-gold-bright);
}

.story-spread-pill {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 13px;
  border-radius: 999px;
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--st-muted);
  letter-spacing: 0.04em;
}

.story-cards-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
}

.story-mini-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.story-cards-grid.count-1 .story-mini-card { width: 204px; }
.story-cards-grid.count-1 .story-mini-art { width: 158px; height: 262px; }

.story-cards-grid.count-3 .story-mini-card { width: 140px; }
.story-cards-grid.count-3 .story-mini-art { width: 112px; height: 186px; }

.story-cards-grid.count-5 { gap: 8px 12px; }
.story-cards-grid.count-5 .story-mini-card { width: 136px; }
.story-cards-grid.count-5 .story-mini-art { width: 82px; height: 136px; }

.story-cards-grid.count-7 { gap: 6px 8px; }
.story-cards-grid.count-7 .story-mini-card { width: 106px; }
.story-cards-grid.count-7 .story-mini-art { width: 68px; height: 112px; }

.story-mini-slot {
  font-size: 8.2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.25;
  color: var(--st-muted);
  margin-bottom: 4px;
  max-width: 100%;
  min-height: 21px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: visible;
  text-overflow: clip;
}

.story-cards-grid.count-7 .story-mini-slot {
  font-size: 7.4px;
  min-height: 18px;
}

.story-mini-art {
  border-radius: 9px;
  overflow: hidden;
  border: 1.2px solid var(--st-gold);
  background: #0d1122;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32);
}

.story-canvas.theme-light .story-mini-art {
  background: #fdfaf2;
}

.story-mini-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.story-mini-art.is-reversed svg {
  transform: rotate(180deg);
}

.story-mini-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  margin-top: 5px;
  line-height: 1.15;
}

.story-cards-grid.count-7 .story-mini-name {
  font-size: 11px;
}

.story-mini-orient {
  font-size: 8.5px;
  font-weight: 700;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 999px;
}

.story-mini-orient.up {
  color: #7bb482;
  background: rgba(123, 180, 130, 0.16);
}

.story-mini-orient.rev {
  color: #d9826c;
  background: rgba(217, 130, 108, 0.16);
}

.story-synthesis-box {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  text-align: center;
}

.story-synthesis-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--st-gold-bright);
  margin-bottom: 6px;
}

.story-synthesis-quote {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 17px;
  font-style: italic;
  line-height: 1.38;
  margin: 0;
}

.story-elements-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--st-surface);
  border: 1px solid var(--st-border);
}

.story-elements-title {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--st-muted);
  margin-bottom: 8px;
  text-align: center;
}

.story-elements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
}

.story-el-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  margin-bottom: 3px;
}

.story-el-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(130, 136, 160, 0.24);
  overflow: hidden;
}

.story-el-fill {
  height: 100%;
  border-radius: 999px;
}

.story-el-fill.fire { background: #e27d60; }
.story-el-fill.water { background: #63a4db; }
.story-el-fill.air { background: #b7a8e0; }
.story-el-fill.earth { background: #7bb482; }

.story-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--st-border);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--st-muted);
}

/* Elemen Khusus Cetak (Tersembunyi di Layar) */
.print-only-meta,
.print-journal-mirror {
  display: none;
}

/* 10. Penghormatan Preferensi Pengurangan Gerak */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .foil-overlay {
    display: none !important;
  }
}

/* ==========================================================================
   @media print — Cetak / Simpan PDF Bersih (Latar Putih, Kontras Tinggi)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 14mm;
  }

  * {
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  html,
  body {
    background: #ffffff !important;
    color: #14161c !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
  }

  /* Sembunyikan navigasi, tombol, modal, animasi latar & elemen non-cetak */
  .ambient-bg,
  .top-nav,
  .reading-top-actions,
  .reading-export-bar,
  .reading-tabs-bar,
  .reveal-hint-bar,
  .session-banner,
  .status-banner,
  .btn-clarifier,
  .journal-actions,
  #journal-notes,
  #btn-view-json,
  .inspect-hint-pill,
  .foil-overlay,
  .modal-backdrop,
  .toast-container,
  .story-export-stage,
  #step-1,
  #step-2,
  #step-3 {
    display: none !important;
  }

  /* Paksa seluruh bagian Hasil Bacaan tampil lengkap melampaui tab */
  #step-4,
  #step-4.tabs-ready #cards-reveal-grid,
  #step-4.tabs-ready #synthesis-wrapper,
  #step-4.tabs-ready .dashboard-section,
  #step-4.tabs-ready #narrative-synthesis,
  #step-4.tabs-ready #narrative-synthesis .narrative-head,
  #step-4.tabs-ready #narrative-synthesis #narrative-prose,
  #step-4.tabs-ready .actions-box,
  #step-4.tabs-ready #reflection-journal-section {
    display: block !important;
  }

  .main-shell,
  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .print-only-meta {
    display: block !important;
    font-size: 9.5pt;
    color: #4a4f5e;
    margin-top: 4pt;
    padding-bottom: 10pt;
    border-bottom: 1px solid #d4cfc3;
  }

  .print-journal-mirror {
    display: block !important;
    margin-top: 8pt;
    padding: 10pt;
    border: 1px solid #d4cfc3;
    border-radius: 6pt;
    background: #fafafa;
    color: #14161c;
    white-space: pre-wrap;
    font-size: 10pt;
  }

  .glass-panel,
  .reading-slot-card,
  .metric-card,
  .narrative-section,
  .reflection-card,
  .journal-card,
  .transparency-panel,
  .actions-box,
  .ethical-guardrail {
    background: #ffffff !important;
    color: #14161c !important;
    border: 1px solid #d8d2c5 !important;
    border-radius: 8pt !important;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 12pt !important;
  }

  .stage-eyebrow,
  .slot-badge,
  .card-name-id,
  .actions-title,
  .narrative-prose strong,
  .card-advice-box strong,
  .reflection-item-source {
    color: #7a591e !important;
  }

  .stage-title,
  .section-title,
  .card-name-en,
  .metric-head h4,
  .card-meaning-text,
  .narrative-prose,
  .concrete-actions-list,
  .reflection-item-question {
    color: #111319 !important;
  }

  .stage-subtitle,
  .card-archetype,
  .card-advice-box,
  .metric-body,
  .insight-callout,
  .ethical-guardrail {
    color: #2f3440 !important;
    background: #f8f6f1 !important;
  }

  /* Tata Kartu Cetak Rapi 2 Kolom & Tampilkan Wajah Depan Langsung */
  .cards-reveal-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10pt !important;
    margin-bottom: 14pt !important;
  }

  .cards-reveal-grid[data-spread-count="1"] {
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
  }

  .tarot-card-scene {
    width: 118px !important;
    height: 196px !important;
    margin-bottom: 8pt !important;
  }

  .tarot-card-inner {
    transform: none !important;
  }

  .tarot-face-back {
    display: none !important;
  }

  .tarot-face-front {
    position: relative !important;
    transform: none !important;
    background: #fcfaf4 !important;
    border: 1px solid #9a7432 !important;
  }

  .dashboard-grid,
  .journal-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10pt !important;
  }

  .dashboard-section,
  .narrative-section,
  .journal-grid {
    break-before: auto;
    page-break-before: auto;
  }

  .transparency-panel {
    display: block !important;
  }

  .transparency-body {
    display: block !important;
  }

  .info-tip-btn,
  .info-tooltip-popover,
  #story-preview-modal,
  #floating-export-dock,
  #mobile-bottom-tabbar,
  #auth-modal,
  #card-library-modal,
  .card-accordion-toggle {
    display: none !important;
  }

  .card-accordion-body {
    grid-template-rows: 1fr !important;
    opacity: 1 !important;
  }

  .card-accordion-inner {
    overflow: visible !important;
  }

  .reading-dedication-spotlight {
    background: #ffffff !important;
    border: 1px solid #c9b992 !important;
    color: #14161c !important;
  }

  .dedication-name {
    color: #7a591e !important;
    text-shadow: none !important;
  }
}

/* ==========================================================================
   PEMBARUAN UX TAHAP 1 — Tanggal 3 Kolom, Tooltip ⓘ, Spotlight & Pratinjau Story
   ========================================================================== */

/* 1. Input Tanggal Lahir 3 Kolom (Tahun / Bulan / Tanggal) & Sub-Hint */
.field-subhint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.74rem;
  color: var(--gold);
  opacity: 0.9;
}

.birthdate-triple-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.35fr 0.85fr;
  gap: 0.5rem;
}

.birth-input-year {
  min-height: 46px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  padding: 0.7rem 0.55rem;
}

.birth-select {
  min-height: 46px;
  padding: 0.7rem 1.85rem 0.7rem 0.75rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.birth-select option {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

.birth-validation-msg {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--status-reversed);
}

/* 2. Sistem Hint / Tooltip Edukatif (ⓘ) */
.moon-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.label-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: wrap;
}

.label-with-tip .field-label {
  margin-bottom: 0;
}

.form-group > .label-with-tip {
  margin-bottom: 0.65rem;
}

.btn-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.clarifier-action-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.clarifier-action-row .btn-clarifier {
  flex: 1;
}

.info-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--gold-soft);
  color: var(--gold-bright);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.info-tip-btn:hover,
.info-tip-btn.is-open {
  background: var(--gold);
  color: #12141c;
  border-color: var(--gold);
  transform: scale(1.06);
}

[data-theme="light"] .info-tip-btn:hover,
[data-theme="light"] .info-tip-btn.is-open {
  color: #fffdf8;
}

.metric-tip-btn {
  margin-left: auto;
}

.info-tooltip-popover {
  position: fixed;
  z-index: 260;
  width: min(310px, calc(100vw - 24px));
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--gold);
  box-shadow: var(--shadow-soft), var(--shadow-gold);
  color: var(--text-primary);
  animation: fadeSlideUp 0.2s ease;
}

.info-tooltip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.info-tooltip-head strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.06rem;
  color: var(--gold-bright);
}

.info-tooltip-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 6px;
}

.info-tooltip-close:hover {
  color: var(--text-primary);
  background: var(--gold-soft);
}

.info-tooltip-popover p {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}

/* 3. Tajuk Dedikasi Personal (Spotlight Nama Panggilan di Tahap 4 Web) */
.reading-dedication-spotlight {
  text-align: center;
  padding: 1.05rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 13%, var(--bg-glass)) 0%, var(--bg-glass) 100%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-gold);
  animation: fadeSlideUp 0.45s ease;
}

.dedication-kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-split .field-label,
.form-split .label-with-tip {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
}

.dedication-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
  max-width: 100%;
}

.dedication-ornament {
  font-size: 0.72rem;
  color: var(--gold);
  opacity: 0.85;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

.dedication-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.28rem, 4.6vw, 2.25rem);
  font-weight: 700;
  line-height: 1.18;
  color: var(--gold-bright);
  text-shadow: 0 0 22px var(--gold-glow);
  text-align: center;
  min-width: 0;
  overflow-wrap: break-word;
}

.dedication-zodiac {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.55rem;
  padding: 0.22rem 0.82rem;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-bright);
}

/* 4. Modal Pratinjau Gambar Story 9:16 (Simpan ke Galeri) */
#story-preview-modal.modal-backdrop {
  justify-content: center;
  padding: 1rem;
}

.story-preview-box {
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-glass-strong);
}

.story-preview-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}

.story-preview-img-frame {
  width: 100%;
  max-width: 280px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-soft), var(--shadow-gold);
  background: var(--bg-base);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.story-preview-img-frame.is-guided {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px var(--gold-glow), 0 12px 32px rgba(0, 0, 0, 0.55);
  animation: guideImagePulse 0.85s ease 2;
}

@keyframes guideImagePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

.story-preview-img {
  width: 100%;
  height: auto;
  display: block;
  -webkit-touch-callout: default;
  user-select: auto;
}

.story-mobile-tip {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  background: var(--gold-soft);
  border: 1px solid var(--border-subtle);
  margin: 0;
}

.story-preview-footer {
  flex-wrap: wrap;
}

.story-preview-footer .btn-primary {
  flex: 1 1 180px;
}

@media (max-width: 480px) {
  .birthdate-triple-grid {
    gap: 0.4rem;
  }

  .story-preview-img-frame {
    max-width: 245px;
  }
}

/* ==========================================================================
   FLOATING BOTTOM NAVBAR ("BAWA PULANG HASIL" — MOBILE ONLY)
   ========================================================================== */
.floating-export-dock {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  right: 12px;
  max-width: 460px;
  margin: 0 auto;
  z-index: 80;

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 20px;

  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.44), 0 0 22px var(--gold-soft);

  /* Default tersembunyi (slide-down) */
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

[data-theme="light"] .floating-export-dock {
  box-shadow: 0 10px 28px rgba(42, 34, 18, 0.14), 0 0 0 1px rgba(154, 116, 50, 0.16);
}

.floating-export-dock.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  padding: 6px 4px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.dock-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.dock-btn:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--gold-soft);
}

.dock-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

/* Tombol Utama: Story dengan sorotan aksen emas */
.dock-btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: #12141c;
  box-shadow: 0 4px 14px var(--gold-glow);
}

[data-theme="light"] .dock-btn-primary {
  color: #fffdf8;
}

.dock-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 100%);
  color: #12141c;
}

[data-theme="light"] .dock-btn-primary:hover:not(:disabled) {
  color: #fffdf8;
}

/* Status Umpan Balik "Tersalin" pada Tombol Link */
.dock-btn.is-copied {
  color: var(--status-upright);
  background: rgba(123, 180, 130, 0.14);
  border-color: rgba(123, 180, 130, 0.36);
}

.dock-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.dock-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dock-spinner {
  animation: dockSpin 0.85s linear infinite;
}

@keyframes dockSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile-only (< 768px): Ruang aman Bottom Tab Bar, Floating Dock & Toast */
@media (max-width: 767px) {
  .main-shell {
    padding-bottom: calc(var(--bottom-nav-h) + 28px + env(safe-area-inset-bottom, 0px));
  }

  #step-4.tabs-ready {
    padding-bottom: calc(var(--bottom-nav-h) + 92px + env(safe-area-inset-bottom, 0px));
  }

  .toast-container {
    bottom: calc(var(--bottom-nav-h) + 14px + env(safe-area-inset-bottom, 0px));
  }

  body.has-floating-dock .toast-container {
    bottom: calc(var(--bottom-nav-h) + 84px + env(safe-area-inset-bottom, 0px));
  }
}

/* Sembunyikan Floating Dock & Bottom Tab Bar di layar desktop (>= 768px) */
@media (min-width: 768px) {
  .floating-export-dock,
  .mobile-bottom-tabbar {
    display: none !important;
  }
}

/* ==========================================================================
   HYBRID TAB BAR — Desktop Sticky Top Bar (>= 768px) & Mobile Fixed Bottom Bar (< 768px)
   ========================================================================== */
.desktop-tab-bar {
  display: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.desktop-tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.desktop-tab-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.desktop-tab-btn:hover {
  color: var(--text-primary);
  background: var(--gold-soft);
}

.desktop-tab-btn.is-active {
  background: var(--gold-soft);
  border-color: var(--border-strong);
  color: var(--gold-bright);
}

.auth-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-upright);
  box-shadow: 0 0 8px var(--status-upright);
  flex-shrink: 0;
}

/* Fixed Bottom Tab Bar Mobile (< 768px) */
.mobile-bottom-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 95;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  min-height: var(--bottom-nav-h);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-glass-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.32);
}

.mobile-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  padding: 4px 2px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-tab-btn:active {
  transform: scale(0.95);
}

.mobile-tab-btn.is-active {
  color: var(--gold-bright);
  background: var(--gold-soft);
}

.mobile-tab-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-tab-icon {
  width: 20px;
  height: 20px;
}

.mobile-tab-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.mobile-tab-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: #12141c;
  font-size: 0.64rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-tab-icon-wrap .auth-status-dot {
  position: absolute;
  top: -2px;
  right: -5px;
}

@media (min-width: 768px) {
  .desktop-tab-bar {
    display: inline-flex;
  }
}

@media (max-width: 767px) {
  .icon-btn,
  .moon-pill {
    min-width: 40px;
    height: 40px;
  }

  .moon-pill {
    padding: 0 0.58rem;
  }

  .nav-inner {
    gap: 0.45rem;
    min-height: 56px;
  }

  .brand-title {
    font-size: 1.12rem;
    letter-spacing: 0.14em;
  }

  .brand-sub {
    display: none;
  }

  /* Spasi & Hierarki Visual Lebih Bernapas di Mobile */
  .container {
    padding-inline: 16px;
  }

  .glass-panel {
    border-color: color-mix(in srgb, var(--gold) 12%, transparent);
    border-radius: 18px;
  }

  .calibration-card,
  .ritual-panel,
  .narrative-section,
  .reflection-card,
  .journal-card,
  .metric-card,
  .reading-slot-card {
    padding: 18px 16px;
  }

  .reading-tab-btn,
  .btn {
    min-height: 44px;
  }

  .reading-export-actions .btn {
    min-height: 44px;
    font-size: 0.78rem;
  }
}

/* Pastikan Card Inspector Selalu Tampil di Atas Modal Pustaka, Jurnal & Auth */
#card-library-modal,
#auth-modal {
  z-index: 115;
}

#card-inspector-modal {
  z-index: 130;
}

#story-preview-modal {
  z-index: 135;
}

/* 2. Accordion / Progressive Disclosure Detail Kartu (Prioritas Mobile) */
.card-summary-meaning {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #ebe6dc;
  margin-bottom: 0.85rem;
}

[data-theme="light"] .card-summary-meaning {
  color: #262934;
}

.card-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  margin-bottom: 0.65rem;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--gold-bright);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.card-accordion-toggle:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.card-accordion-chevron {
  transition: transform 0.25s ease;
  font-size: 0.9rem;
}

.reading-slot-card.is-expanded .card-accordion-chevron {
  transform: rotate(180deg);
}

.card-accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}

.reading-slot-card.is-expanded .card-accordion-body {
  grid-template-rows: 1fr;
  opacity: 1;
}

.card-accordion-inner {
  overflow: hidden;
}

.card-kabbalah-note {
  font-size: 0.81rem;
  line-height: 1.55;
  color: var(--text-secondary);
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: var(--bg-input);
  border-left: 2px solid var(--gold-dim);
  margin-bottom: 0.85rem;
}

.card-kabbalah-note strong {
  color: var(--gold-bright);
}

/* Pada layar desktop lebar, tampilkan detail penuh tanpa perlu klik accordion */
@media (min-width: 900px) {
  .card-accordion-toggle {
    display: none;
  }

  .card-accordion-body {
    grid-template-rows: 1fr;
    opacity: 1;
  }

  .card-accordion-inner {
    overflow: visible;
  }
}

/* Ringkasan visual kartu lebih hemat ruang di mobile saat accordion tertutup */
@media (max-width: 899px) {
  .reading-slot-card.is-revealed:not(.is-expanded) .tarot-card-scene {
    width: 138px;
    aspect-ratio: 2 / 3;
    height: auto;
    margin-bottom: 0.85rem;
  }
}

/* 3. Identitas Tarot Pribadi (Lencana Birth Card & Year Card) */
.tarot-identity-badges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.65rem;
  animation: fadeSlideUp 0.3s ease;
}

.identity-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
  padding: 0.6rem 0.72rem;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  min-height: 44px;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.16s ease;
}

.identity-chip:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
  transform: translateY(-1px);
}

.identity-chip-kicker {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.identity-chip-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.04rem;
  color: var(--text-primary);
  line-height: 1.15;
}

.identity-chip-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Kartu Identitas Ringkas di Modal Jurnal & Modal Profil/Auth */
.identity-panel-host {
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--gold) 6%, var(--bg-input));
  border: 1px solid var(--border-subtle);
}

.identity-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}

.identity-section-eyebrow {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.identity-sun-pill {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.identity-pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.identity-mini-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
  padding: 0.72rem 0.78rem;
  border-radius: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.18s ease;
}

.identity-mini-tile:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.identity-tile-role {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-weight: 700;
}

.identity-tile-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.12rem;
  color: var(--text-primary);
  line-height: 1.18;
}

.identity-tile-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.identity-tile-cta {
  margin-top: 4px;
  font-size: 0.68rem;
  color: var(--gold-bright);
}

.identity-empty-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* 4. Mode Cepat Ya/Tidak + Preset Tebaran Tematik (Tahap 2 & Hasil Tahap 4) */
.spread-subsection-head {
  margin: 1.7rem 0 0.85rem;
  text-align: left;
}

.spread-subsection-head h3 {
  font-size: 1.35rem;
  color: var(--text-primary);
}

.spread-subsection-head p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.spread-thematic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 720px) {
  .spread-thematic-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.spread-badge-accent {
  background: var(--gold-soft);
  border-color: var(--border-strong);
  color: var(--gold-bright);
}

.moon-phase-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--gold-bright);
}

/* Kartu Putusan Reflektif Mode Ya / Tidak */
.yesno-verdict-box {
  margin-bottom: 1.35rem;
  animation: fadeSlideUp 0.4s ease;
}

.yesno-verdict-card {
  padding: 1.15rem 1.25rem;
  border-radius: 16px;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.yesno-verdict-card.verdict-yes {
  border-left: 4px solid var(--status-upright);
}

.yesno-verdict-card.verdict-no {
  border-left: 4px solid var(--status-reversed);
}

.yesno-verdict-card.verdict-maybe {
  border-left: 4px solid var(--gold);
}

.yesno-verdict-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.yesno-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.yesno-pill {
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-bright);
  border: 1px solid var(--border-strong);
}

.verdict-yes .yesno-pill {
  background: rgba(123, 180, 130, 0.16);
  color: var(--status-upright);
  border-color: rgba(123, 180, 130, 0.42);
}

.verdict-no .yesno-pill {
  background: rgba(217, 130, 108, 0.16);
  color: var(--status-reversed);
  border-color: rgba(217, 130, 108, 0.42);
}

.yesno-lead {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.24rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}

.yesno-reason {
  font-size: 0.9rem;
  line-height: 1.72;
  color: var(--text-secondary);
  margin: 0;
}

/* 5. Pustaka 78 Kartu (Card Library Modal) */
#card-library-modal.modal-backdrop {
  justify-content: center;
  padding: 0.85rem;
}

.library-modal-box {
  width: 100%;
  max-width: 1020px;
  height: 90vh;
  max-height: 860px;
  display: flex;
  flex-direction: column;
  background: var(--bg-glass-strong);
}

.library-controls-bar {
  padding: 0.9rem 1.2rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.library-search-input {
  min-height: 44px;
}

.library-filter-pills {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.library-filter-pills::-webkit-scrollbar {
  display: none;
}

.library-filter-pill {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.library-filter-pill:hover {
  border-color: var(--gold);
  color: var(--text-primary);
}

.library-filter-pill.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  border-color: var(--gold);
  color: #12141c;
}

[data-theme="light"] .library-filter-pill.active {
  color: #fffdf8;
}

.library-count-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.library-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: var(--space-md);
  padding-block: var(--space-xs);
}

.library-card-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.library-card-tile:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.library-tile-art {
  width: 100%;
  max-width: 132px;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--card-face-bg);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.55rem;
}

.library-tile-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.library-tile-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.library-tile-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.02rem;
  color: var(--text-primary);
  line-height: 1.15;
}

.library-tile-sub {
  font-size: 0.72rem;
  color: var(--gold);
}

.library-tile-kw {
  font-size: 0.67rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.library-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Makna Ganda (Tegak & Terbalik) pada Card Inspector Mode Pustaka */
.inspector-dual-meanings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin-bottom: 0.95rem;
}

.inspector-meaning-card {
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.inspector-meaning-card .orientation-badge {
  display: inline-block;
  margin-bottom: 0.45rem;
}

.inspector-meaning-card .inspector-keywords {
  margin-bottom: 0.5rem;
}

.inspector-mini-advice {
  margin-top: 0.45rem;
  font-size: 0.79rem;
  color: var(--text-primary);
}

.kw-pill-rev {
  background: rgba(217, 130, 108, 0.14);
  color: var(--status-reversed);
}

/* 6. Statistik Jurnal, Pelacak Stalker Card & Bar Sinkronisasi Cloud */
.journal-cloud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.72rem 1.3rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-input);
}

.cloud-sync-status {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.cloud-sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cloud-sync-dot.is-local { background: var(--text-muted); }
.cloud-sync-dot.is-syncing { background: var(--gold); animation: pulseSync 1s infinite alternate; }
.cloud-sync-dot.is-synced { background: var(--status-upright); box-shadow: 0 0 8px var(--status-upright); }
.cloud-sync-dot.is-error { background: var(--status-reversed); }

@keyframes pulseSync {
  from { opacity: 0.4; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

.journal-migration-banner {
  margin-bottom: 0.95rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--gold) 12%, var(--bg-input));
  border: 1px solid var(--border-strong);
  font-size: 0.82rem;
  color: var(--text-primary);
}

.migration-banner-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.journal-analytics-panel {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.journal-stats-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.journal-stat-box {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.journal-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.journal-stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stalker-card-banner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.32rem;
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 15%, var(--bg-input)) 0%, var(--bg-input) 100%);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.16s ease;
}

.stalker-card-banner:hover {
  border-color: var(--gold-bright);
  transform: translateY(-1px);
}

.stalker-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.stalker-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin: 0;
}

.stalker-cta {
  font-size: 0.72rem;
  color: var(--gold);
}

/* 7. Modal Login & Akun Cloud (Lazy Registration) */
#auth-modal.modal-backdrop {
  justify-content: center;
  padding: 1rem;
}

.auth-modal-box {
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-glass-strong);
}

.auth-intro {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.btn-google-auth {
  width: 100%;
  min-height: 46px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.btn-google-auth:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-magic-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.auth-status-msg {
  margin-top: 0.8rem;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.auth-status-msg.is-info {
  background: var(--gold-soft);
  color: var(--gold-bright);
  border: 1px solid var(--border-subtle);
}

.auth-status-msg.is-success {
  background: rgba(123, 180, 130, 0.14);
  color: var(--status-upright);
  border: 1px solid rgba(123, 180, 130, 0.36);
}

.auth-status-msg.is-error {
  background: rgba(217, 130, 108, 0.14);
  color: var(--status-reversed);
  border: 1px solid rgba(217, 130, 108, 0.36);
}

.auth-config-warning {
  margin-bottom: 0.9rem;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  background: rgba(217, 130, 108, 0.12);
  border: 1px solid rgba(217, 130, 108, 0.32);
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.auth-user-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem;
  border-radius: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.auth-avatar-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: #12141c;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.auth-user-meta strong {
  font-size: 0.96rem;
  color: var(--text-primary);
}

.auth-user-meta span {
  font-size: 0.76rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-user-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.auth-user-actions .btn {
  flex: 1 1 140px;
}

@media (max-width: 480px) {
  #card-library-modal.modal-backdrop {
    padding: 0;
  }

  .library-modal-box {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .tarot-identity-badges,
  .identity-pair-grid {
    grid-template-columns: 1fr;
  }
}