/* ============================================================
   MAPEAMENTO DAS 4 FASES INTERNAS — Premium Night Mode CSS
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --bg: #0B0F19;
  --surface: #111827;
  --surface-2: #1a2235;
  --surface-3: #0f1520;
  --primary: #4F46E5;
  --secondary: #8B5CF6;
  --text: #F3F4F6;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;
  --gold: #C5A059;
  --gold-light: #d4b070;
  --gold-dark: #a8874a;
  --border: #1F2937;
  --border-light: #2d3748;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'Lato', system-ui, sans-serif;
  --fs: 18px;
  --maiden: #10B981;
  --mother: #F59E0B;
  --witch: #EF4444;
  --crone: #6366F1;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

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

/* ── Transição suave entre modos de leitura ── */
p, h1, h2, h3, h4, h5, h6, span, div, section, article, blockquote,
label, textarea, input, select, button, a, li, td, th {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

html { scroll-behavior: smooth; font-size: var(--fs); }

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

::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

::selection { background: rgba(197,160,89,0.3); color: var(--text); }

/* ── Loading Screen ── */
#loading-screen {
  position: fixed; inset: 0; background: var(--bg);
  z-index: 9999; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1.5rem;
  transition: opacity 0.7s ease;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }
.loading-moon { font-size: 3rem; animation: moonPulse 1.5s ease-in-out infinite; }
.loading-text { font-family: var(--font-ui); font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); opacity: 0.75; }
.loading-bar { width: 200px; height: 2px; background: var(--border); border-radius: 1px; overflow: hidden; }
.loading-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--gold)); animation: loadFill 1.8s ease forwards; }
@keyframes loadFill { from { width: 0; } to { width: 100%; } }

/* ── Cover ── */
#cover {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #1a1040 0%, #0B0F19 60%, #060810 100%);
  position: relative; overflow: hidden; padding: 3rem 2rem;
}
.stars-container { position: absolute; inset: 0; pointer-events: none; }
.star {
  position: absolute; background: white; border-radius: 50%;
  animation: twinkle var(--duration, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.5); }
}
.cover-content { text-align: center; z-index: 10; max-width: 680px; }
.cover-moon {
  font-size: 5.5rem; display: block; margin-bottom: 1.5rem;
  animation: moonPulse 3s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(197,160,89,0.5));
}
@keyframes moonPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(197,160,89,0.4)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 45px rgba(197,160,89,0.85)); }
}
.cover-eyebrow {
  font-family: var(--font-ui); font-size: 0.68rem; letter-spacing: 0.35em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 1.2rem; opacity: 0.8;
}
.cover-title {
  font-family: var(--font-display); font-size: clamp(2.3rem, 6vw, 4rem);
  font-weight: 600; line-height: 1.12; letter-spacing: 0.02em; color: var(--text);
  margin-bottom: 0.8rem; text-shadow: 0 2px 30px rgba(197,160,89,0.2);
}
.cover-subtitle {
  font-family: var(--font-display); font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 300; font-style: italic; color: var(--gold);
  margin-bottom: 3rem; line-height: 1.6; opacity: 0.9;
}
.cover-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; margin-bottom: 3rem; color: var(--gold); opacity: 0.55;
  font-size: 1rem; letter-spacing: 0.5em;
}
.cover-divider::before, .cover-divider::after {
  content: ''; flex: 1; max-width: 80px; height: 1px;
}
.cover-divider::before { background: linear-gradient(to right, transparent, var(--gold)); }
.cover-divider::after  { background: linear-gradient(to left, transparent, var(--gold)); }
.btn-start {
  display: inline-block; padding: 1rem 3rem; background: transparent;
  border: 1px solid var(--gold); color: var(--gold); font-family: var(--font-ui);
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.22em;
  text-transform: uppercase; cursor: pointer; border-radius: 50px;
  transition: all 0.4s ease; position: relative; overflow: hidden;
}
.btn-start::before {
  content: ''; position: absolute; inset: 0; background: var(--gold);
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease; z-index: -1;
}
.btn-start:hover { color: var(--bg); box-shadow: 0 0 35px rgba(197,160,89,0.45); }
.btn-start:hover::before { transform: scaleX(1); }
.cover-phases {
  display: flex; justify-content: center; gap: 2rem; margin-top: 3rem; flex-wrap: wrap;
}
.cover-phase-item {
  font-family: var(--font-ui); font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; display: flex; flex-direction: column;
  align-items: center; gap: 0.4rem; opacity: 0.8;
}
.cover-phase-icon { font-size: 1.5rem; }
.cover-phase-item.maiden { color: var(--maiden); }
.cover-phase-item.mother { color: var(--mother); }
.cover-phase-item.witch  { color: var(--witch); }
.cover-phase-item.crone  { color: var(--crone); }

/* ── Fixed Header ── */
#fixed-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(11,15,25,0.93); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border); padding: 0.55rem 1.5rem;
  display: flex; align-items: center; gap: 0.8rem;
  transform: translateY(-100%); transition: transform 0.4s ease, background-color 0.3s ease;
}
body.mode-white #fixed-header { background: rgba(245,240,232,0.96); }
body.mode-sepia #fixed-header { background: rgba(44,24,16,0.96); }
body.mode-night #fixed-header { background: rgba(0,0,0,0.97); }
#fixed-header.visible { transform: translateY(0); }
.header-progress-wrap { flex: 1; min-width: 0; }
.header-progress-label {
  font-family: var(--font-ui); font-size: 0.68rem; color: var(--text-muted);
  letter-spacing: 0.04em; margin-bottom: 4px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.header-progress-bar { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.header-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--gold));
  border-radius: 2px; transition: width 0.5s ease; width: 0%;
}
.header-controls { display: flex; align-items: center; gap: 0.4rem; }
.header-btn {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: 0.35rem 0.65rem; border-radius: 6px; cursor: pointer;
  font-family: var(--font-ui); font-size: 0.72rem; transition: all 0.2s; white-space: nowrap;
}
.header-btn:hover { border-color: var(--gold); color: var(--gold); }
.header-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(197,160,89,0.08); }

/* ── Save Indicator ── */
#save-indicator {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--surface); border: 1px solid var(--maiden);
  color: var(--maiden); font-family: var(--font-ui); font-size: 0.7rem;
  padding: 0.4rem 1rem; border-radius: 20px; opacity: 0;
  transform: translateY(8px); transition: all 0.3s ease; z-index: 500; letter-spacing: 0.05em;
}
#save-indicator.show { opacity: 1; transform: translateY(0); }

/* ── Bookmark Banner ── */
#bookmark-banner {
  position: fixed; top: 70px; left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--surface); border: 1px solid var(--gold);
  border-radius: 8px; padding: 0.75rem 1.4rem;
  display: flex; align-items: center; gap: 1rem;
  z-index: 120; opacity: 0; pointer-events: none;
  transition: all 0.4s; font-family: var(--font-ui);
  font-size: 0.75rem; color: var(--text-muted);
  box-shadow: var(--shadow); white-space: nowrap;
}
#bookmark-banner.show { opacity: 1; pointer-events: all; transform: translateX(-50%) translateY(0); }
#bookmark-banner .bm-go {
  background: var(--gold); border: none; color: var(--bg);
  padding: 0.3rem 0.9rem; border-radius: 4px; font-family: var(--font-ui);
  font-size: 0.7rem; font-weight: 700; cursor: pointer; letter-spacing: 0.05em; text-transform: uppercase;
}
#bookmark-banner .bm-dismiss {
  background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1rem; padding: 0;
}

/* ── Book Wrap & Container ── */
#book-wrap { padding-top: 0; padding-bottom: 5rem; overflow-x: hidden; }
.book-container {
  max-width: 780px; margin: 0 auto; background: var(--surface);
  box-shadow: 0 0 80px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(197,160,89,0.07);
  position: relative;
  transition: background-color 0.3s ease;
}

/* ── Chapter / Section ── */
.chapter, #intro {
  padding: 4.5rem 3.5rem;
  border-bottom: 1px solid var(--border);
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.chapter.visible, #intro.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 640px) {
  .chapter, #intro { padding: 3rem 1.5rem; }
}

.chapter-header { margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.chapter-number {
  font-family: var(--font-ui); font-size: 0.66rem; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--gold); opacity: 0.7; margin-bottom: 0.8rem; display: block;
}
.chapter-title {
  font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 600; line-height: 1.12; color: var(--text); margin-bottom: 0.6rem;
}
.chapter-subtitle {
  font-family: var(--font-display); font-size: 1.18rem; font-style: italic;
  color: var(--text-muted); font-weight: 300;
}
.chapter-meta { display: flex; align-items: center; gap: 1.5rem; margin-top: 1.2rem; flex-wrap: wrap; }
.chapter-read-time {
  font-family: var(--font-ui); font-size: 0.7rem; color: var(--text-dim); letter-spacing: 0.05em;
}
.chapter-read-time span { color: var(--gold); }

.section-title {
  font-family: var(--font-display); font-size: 1.65rem; font-weight: 600;
  color: var(--text); margin: 3rem 0 1.2rem; line-height: 1.2;
}
.section-sub {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 500;
  color: var(--gold); margin: 2rem 0 1rem; font-style: italic;
}

.ornament {
  text-align: center; margin: 2.5rem 0; color: var(--gold);
  font-size: 1rem; letter-spacing: 0.8em; opacity: 0.45;
}

p {
  margin-bottom: 1.4rem; font-size: 1rem; line-height: 1.9;
  color: var(--text); position: relative;
}
p.lead { font-size: 1.18rem; color: var(--text-muted); font-style: italic; font-weight: 300; }

/* Drop Cap */
.drop-cap::first-letter {
  font-family: 'Cormorant Garamond', serif; font-size: 5.2rem;
  font-weight: 700; float: left; line-height: 0.8;
  margin: 0.1em 0.15em 0 0; color: var(--gold);
  text-shadow: 0 0 20px rgba(197,160,89,0.35);
}

/* Blockquote */
blockquote {
  border-left: 3px solid var(--gold); padding: 1.4rem 2rem; margin: 2.5rem 0;
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 1.35rem; color: var(--gold-light);
  background: rgba(197,160,89,0.04); position: relative;
  border-radius: 0 8px 8px 0;
}
blockquote::before {
  content: '\201C'; font-size: 5rem; color: var(--gold); opacity: 0.18;
  position: absolute; top: -0.8rem; left: 0.8rem;
  font-family: 'Cormorant Garamond', serif; line-height: 1;
}
blockquote cite { display: block; margin-top: 0.8rem; font-size: 0.88rem; opacity: 0.65; font-style: normal; letter-spacing: 0.05em; }

ul, ol { margin: 1rem 0 1.4rem 1.5rem; }
li { margin-bottom: 0.45rem; line-height: 1.7; }
li::marker { color: var(--gold); }

/* Para Wrap & Margin Notes */
.para-wrap { position: relative; }
.note-btn {
  position: absolute; right: -2.8rem; top: 0;
  background: none; border: none; cursor: pointer; font-size: 1rem;
  opacity: 0; transition: opacity 0.2s; padding: 0.2rem; color: var(--text-dim);
}
.para-wrap:hover .note-btn { opacity: 1; }
.note-btn.has-note { opacity: 1; color: var(--gold); }
.inline-note { display: none; margin-top: 0.5rem; padding: 0.7rem; background: rgba(197,160,89,0.06); border: 1px solid rgba(197,160,89,0.2); border-radius: 6px; }
.inline-note.open { display: block; }
.inline-note textarea {
  width: 100%; background: transparent; border: none; color: var(--text-muted);
  font-family: var(--font-ui); font-size: 0.82rem; resize: vertical;
  min-height: 60px; outline: none; line-height: 1.6;
}

/* ── Phase Cards ── */
.phase-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 4px solid var(--gold); padding: 2rem; border-radius: var(--radius);
  margin-bottom: 2rem; transition: transform 0.2s, box-shadow 0.2s;
}
.phase-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.phase-card.maiden { border-left-color: var(--maiden); }
.phase-card.mother { border-left-color: var(--mother); }
.phase-card.witch  { border-left-color: var(--witch); }
.phase-card.crone  { border-left-color: var(--crone); }

.phase-card-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.phase-icon { font-size: 2.2rem; line-height: 1; }
.phase-card-header h3 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; margin-bottom: 0.1rem; }
.phase-card.maiden .phase-card-header h3 { color: var(--maiden); }
.phase-card.mother .phase-card-header h3 { color: var(--mother); }
.phase-card.witch  .phase-card-header h3 { color: var(--witch); }
.phase-card.crone  .phase-card-header h3 { color: var(--crone); }
.phase-days { font-family: var(--font-ui); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--text-muted); }

.phase-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0; }
.phase-tag { font-family: var(--font-ui); font-size: 0.65rem; padding: 0.22rem 0.65rem; border-radius: 20px; border: 1px solid currentColor; letter-spacing: 0.05em; opacity: 0.8; }
.phase-card.maiden .phase-tag { color: var(--maiden); }
.phase-card.mother .phase-tag { color: var(--mother); }
.phase-card.witch  .phase-tag { color: var(--witch); }
.phase-card.crone  .phase-tag { color: var(--crone); }

.phase-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
@media (max-width: 560px) { .phase-card-grid { grid-template-columns: 1fr; } }
.phase-card-col h4 { font-family: var(--font-ui); font-size: 0.67rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.45rem; }
.phase-card-col ul { margin: 0; padding-left: 1rem; font-size: 0.9rem; }
.phase-card-col li { margin-bottom: 0.25rem; color: var(--text-muted); }
.phase-shadow { margin-top: 1rem; padding: 0.75rem 1rem; background: rgba(0,0,0,0.2); border-radius: 6px; font-size: 0.88rem; font-style: italic; color: var(--text-muted); }
.phase-extras { display: flex; gap: 2rem; margin-top: 1rem; flex-wrap: wrap; }
.phase-extras > div { font-family: var(--font-ui); font-size: 0.73rem; color: var(--text-dim); }
.phase-extras strong { color: var(--text-muted); display: block; margin-bottom: 0.2rem; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.62rem; }

/* ── Flip Cards ── */
.flip-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1.4rem; margin: 2rem 0; }
.flip-card { perspective: 1000px; height: 220px; cursor: pointer; }
.flip-card-inner { transition: transform 0.65s cubic-bezier(0.4,0,0.2,1); transform-style: preserve-3d; height: 100%; position: relative; }
.flip-card.flipped .flip-card-inner, .flip-card:hover .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back {
  position: absolute; width: 100%; height: 100%; backface-visibility: hidden;
  border-radius: var(--radius); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 1.5rem; text-align: center; border: 1px solid var(--border);
}
.flip-card-back { transform: rotateY(180deg); background: var(--surface-2); }
.flip-card.maiden .flip-card-front { background: linear-gradient(135deg,rgba(16,185,129,.15),rgba(16,185,129,.04)); border-color: rgba(16,185,129,.3); }
.flip-card.mother .flip-card-front { background: linear-gradient(135deg,rgba(245,158,11,.15),rgba(245,158,11,.04)); border-color: rgba(245,158,11,.3); }
.flip-card.witch  .flip-card-front { background: linear-gradient(135deg,rgba(239,68,68,.15),rgba(239,68,68,.04));  border-color: rgba(239,68,68,.3); }
.flip-card.crone  .flip-card-front { background: linear-gradient(135deg,rgba(99,102,241,.15),rgba(99,102,241,.04)); border-color: rgba(99,102,241,.3); }
.flip-card.maiden .flip-card-back { border-color: rgba(16,185,129,.3); }
.flip-card.mother .flip-card-back { border-color: rgba(245,158,11,.3); }
.flip-card.witch  .flip-card-back { border-color: rgba(239,68,68,.3); }
.flip-card.crone  .flip-card-back { border-color: rgba(99,102,241,.3); }
.flip-phase-icon { font-size: 2.5rem; margin-bottom: 0.8rem; }
.flip-phase-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; margin-bottom: 0.3rem; }
.flip-card.maiden .flip-phase-name { color: var(--maiden); }
.flip-card.mother .flip-phase-name { color: var(--mother); }
.flip-card.witch  .flip-phase-name { color: var(--witch); }
.flip-card.crone  .flip-phase-name { color: var(--crone); }
.flip-hint { font-family: var(--font-ui); font-size: 0.62rem; letter-spacing: 0.1em; color: var(--text-dim); text-transform: uppercase; margin-top: 0.5rem; }
.flip-affirmation { font-family: var(--font-display); font-style: italic; font-size: 1.1rem; line-height: 1.65; color: var(--gold-light); }

/* ── Cycle Wheel ── */
.cycle-wheel-wrap { display: flex; flex-direction: column; align-items: center; margin: 2.5rem 0; gap: 1.5rem; }
#cycle-wheel { max-width: 340px; width: 100%; cursor: pointer; filter: drop-shadow(0 0 30px rgba(197,160,89,.12)); }
.wheel-segment { transition: opacity 0.3s, filter 0.3s; }
.wheel-segment:hover { opacity: 0.82; }
.wheel-segment.active-phase { filter: brightness(1.28) drop-shadow(0 0 8px currentColor); }
.wheel-legend { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.wheel-legend-item {
  display: flex; align-items: center; gap: 0.4rem; font-family: var(--font-ui);
  font-size: 0.7rem; color: var(--text-muted); cursor: pointer;
  padding: 0.3rem 0.8rem; border-radius: 20px; border: 1px solid transparent; transition: all 0.2s;
}
.wheel-legend-item:hover { border-color: var(--border-light); }
.wheel-legend-item.current { border-color: var(--gold); color: var(--gold); }
.wheel-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.wheel-phase-info { font-family: var(--font-ui); font-size: 0.72rem; text-align: center; color: var(--text-muted); max-width: 340px; line-height: 1.5; min-height: 2.5em; }

/* ── Worksheet ── */
.worksheet {
  background: rgba(17,24,39,.8); border: 1px solid var(--gold);
  border-radius: 12px; padding: 2.5rem; margin: 3rem 0; position: relative; overflow: hidden;
}
.worksheet::before {
  content: ''; position: absolute; inset: 0; border-radius: 12px;
  background: linear-gradient(135deg,rgba(197,160,89,.04),transparent 60%); pointer-events: none;
}
.worksheet-title {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 600;
  color: var(--gold); margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.7rem;
}
.worksheet-subtitle { font-family: var(--font-ui); font-size: 0.75rem; color: var(--text-dim); letter-spacing: 0.05em; margin-bottom: 2rem; }
.input-group { margin-bottom: 1.5rem; }
.label-main { display: block; font-family: var(--font-ui); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.5rem; }
.label-hint { display: block; font-size: 0.82rem; color: var(--text-dim); font-style: italic; margin-bottom: 0.5rem; font-family: var(--font-body); }
.input-text {
  width: 100%; background: rgba(15,20,35,.8); border: 1px solid var(--border);
  color: var(--text); padding: 0.75rem 1rem; font-family: var(--font-body);
  font-size: 1.05rem; border-radius: 6px; transition: border-color 0.3s, box-shadow 0.3s; line-height: 1.7;
}
.input-text:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(197,160,89,.1); }
textarea.input-text { resize: vertical; min-height: 90px; }

/* Sliders */
.slider-group { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.9rem; }
.slider-label { font-family: var(--font-ui); font-size: 0.75rem; color: var(--text-muted); flex: 0 0 150px; }
input[type="range"] { -webkit-appearance: none; width: 100%; height: 6px; background: var(--border); border-radius: 3px; flex: 1; touch-action: pan-y; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); cursor: pointer; box-shadow: 0 0 0 3px rgba(197,160,89,.2); transition: box-shadow 0.2s; }
input[type="range"]::-webkit-slider-thumb:hover { box-shadow: 0 0 0 8px rgba(197,160,89,.3); }
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); cursor: pointer; border: none; box-shadow: 0 0 0 3px rgba(197,160,89,.2); }
input[type="range"]::-moz-range-track { height: 6px; background: var(--border); border-radius: 3px; }
.slider-value { font-family: var(--font-ui); font-size: 0.8rem; color: var(--gold); flex: 0 0 2rem; text-align: right; }

/* ── Checklist ── */
.checklist-section { background: var(--surface-2); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid var(--border); }
.checklist-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.checklist-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.checklist-section.maiden .checklist-title { color: var(--maiden); }
.checklist-section.mother .checklist-title { color: var(--mother); }
.checklist-section.witch  .checklist-title { color: var(--witch); }
.checklist-section.crone  .checklist-title { color: var(--crone); }
.checklist-progress-wrap { width: 52px; height: 52px; position: relative; flex-shrink: 0; }
.checklist-progress-wrap svg { transform: rotate(-90deg); width: 52px; height: 52px; }
.checklist-progress-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-ui); font-size: 0.65rem; font-weight: 700; color: var(--gold); }
.checklist-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,.04); cursor: pointer; }
.checklist-item:last-child { border-bottom: none; }
.checklist-item input[type="checkbox"] { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border: 1px solid var(--border-light); border-radius: 4px; cursor: pointer; flex-shrink: 0; position: relative; transition: all 0.2s; }
.checklist-item input[type="checkbox"]:checked { background: var(--gold); border-color: var(--gold); }
.checklist-item input[type="checkbox"]:checked::after { content: '✓'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: var(--bg); font-size: 0.62rem; font-weight: 900; }
.checklist-item label { font-size: 0.93rem; color: var(--text-muted); cursor: pointer; transition: all 0.2s; }
.checklist-item input:checked + label { text-decoration: line-through; opacity: 0.45; }

/* ── Quiz ── */
.quiz-wrap { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 2.5rem; margin: 2rem 0; }
.quiz-step { display: none; }
.quiz-step.active { display: block; }
.quiz-counter { font-family: var(--font-ui); font-size: 0.7rem; color: var(--text-dim); letter-spacing: 0.1em; margin-bottom: 0.8rem; text-transform: uppercase; }
.quiz-question { font-family: var(--font-display); font-size: 1.45rem; font-weight: 500; line-height: 1.4; color: var(--text); margin-bottom: 1.8rem; }
.quiz-options { display: flex; flex-direction: column; gap: 0.75rem; }
.quiz-option { background: rgba(15,20,35,.6); border: 1px solid var(--border); color: var(--text-muted); padding: 0.9rem 1.2rem; border-radius: 8px; cursor: pointer; text-align: left; font-family: var(--font-body); font-size: 1.05rem; transition: all 0.2s; line-height: 1.5; }
.quiz-option:hover { border-color: var(--gold); color: var(--text); background: rgba(197,160,89,.06); }
.quiz-option.selected { border-color: var(--gold); background: rgba(197,160,89,.1); color: var(--gold); }
.quiz-progress-bar { height: 3px; background: var(--border); border-radius: 2px; margin-bottom: 1.5rem; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: linear-gradient(90deg, var(--secondary), var(--gold)); border-radius: 2px; transition: width 0.4s ease; }
.quiz-result { display: none; text-align: center; padding: 2rem 0; animation: fadeIn 0.6s ease; }
.quiz-result.show { display: block; }
.quiz-result-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.quiz-result-type { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: var(--gold); margin-bottom: 0.5rem; }
.quiz-result-desc { font-family: var(--font-display); font-size: 1.1rem; font-style: italic; color: var(--text-muted); max-width: 460px; margin: 0 auto 1.5rem; line-height: 1.7; }
.quiz-result-affirmation { font-family: var(--font-display); font-size: 1.25rem; font-style: italic; color: var(--gold-light); border-left: 3px solid var(--gold); padding: 1rem 1.5rem; text-align: left; background: rgba(197,160,89,.04); border-radius: 0 8px 8px 0; max-width: 460px; margin: 0 auto; }
.btn-quiz-next { margin-top: 1.5rem; padding: 0.72rem 2rem; background: var(--primary); color: white; border: none; border-radius: 6px; font-family: var(--font-ui); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; transition: all 0.2s; opacity: 0.45; pointer-events: none; }
.btn-quiz-next.enabled { opacity: 1; pointer-events: all; }
.btn-quiz-next.enabled:hover { background: var(--secondary); transform: translateY(-1px); }
.btn-quiz-reset { margin-top: 0.8rem; background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 0.45rem 1.1rem; border-radius: 6px; font-family: var(--font-ui); font-size: 0.72rem; cursor: pointer; transition: all 0.2s; }
.btn-quiz-reset:hover { border-color: var(--gold); color: var(--gold); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Timer ── */
.timer-wrap { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 2.5rem; margin: 2rem 0; text-align: center; }
.timer-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--gold); margin-bottom: 0.3rem; }
.timer-subtitle { font-family: var(--font-ui); font-size: 0.73rem; color: var(--text-dim); letter-spacing: 0.05em; margin-bottom: 2rem; }
.timer-duration-btns { display: flex; justify-content: center; gap: 0.7rem; margin-bottom: 2rem; flex-wrap: wrap; }
.timer-dur-btn { padding: 0.48rem 1.1rem; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-muted); border-radius: 6px; font-family: var(--font-ui); font-size: 0.78rem; cursor: pointer; transition: all 0.2s; }
.timer-dur-btn:hover, .timer-dur-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(197,160,89,.08); }
.timer-circle-wrap { position: relative; width: 180px; height: 180px; margin: 0 auto 1.5rem; }
.timer-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-track { fill: none; stroke: var(--border); stroke-width: 6; }
.timer-prog { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.timer-display { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-time { font-family: var(--font-display); font-size: 2.2rem; font-weight: 300; color: var(--text); line-height: 1; }
.timer-label { font-family: var(--font-ui); font-size: 0.62rem; color: var(--text-dim); letter-spacing: 0.1em; margin-top: 0.3rem; }
.timer-controls { display: flex; gap: 1rem; justify-content: center; margin-bottom: 1.2rem; }
.timer-btn { padding: 0.62rem 1.8rem; border-radius: 50px; font-family: var(--font-ui); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; cursor: pointer; transition: all 0.2s; }
.timer-btn-start { background: var(--gold); border: none; color: var(--bg); }
.timer-btn-start:hover { background: var(--gold-light); transform: scale(1.03); }
.timer-btn-reset { background: none; border: 1px solid var(--border); color: var(--text-muted); }
.timer-btn-reset:hover { border-color: var(--gold); color: var(--gold); }
.timer-message { font-family: var(--font-display); font-style: italic; font-size: 1rem; color: var(--text-muted); min-height: 1.8em; }

/* ── Diary ── */
.diary-wrap { margin: 2rem 0; }
.diary-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; color: var(--gold); margin-bottom: 1.5rem; text-align: center; }
.diary-week-labels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.5rem; margin-bottom: 0.3rem; }
.diary-week-label { font-family: var(--font-ui); font-size: 0.6rem; text-align: center; color: var(--text-dim); letter-spacing: 0.05em; text-transform: uppercase; }
.diary-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.5rem; }
.diary-day { aspect-ratio: 1; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; position: relative; gap: 0.15rem; }
.diary-day:hover { border-color: var(--gold); transform: scale(1.06); }
.diary-day-num { font-family: var(--font-ui); font-size: 0.78rem; font-weight: 700; color: var(--text-muted); }
.diary-day-emoji { font-size: 0.9rem; line-height: 1; }
.diary-day.has-entry { border-color: rgba(197,160,89,.4); background: rgba(197,160,89,.06); }
.diary-day.has-entry .diary-day-num { color: var(--gold); }
.diary-day.p-maiden { border-color: rgba(16,185,129,.3); }
.diary-day.p-mother { border-color: rgba(245,158,11,.3); }
.diary-day.p-witch  { border-color: rgba(239,68,68,.3); }
.diary-day.p-crone  { border-color: rgba(99,102,241,.3); }

/* ── Mood Graph ── */
.mood-graph-wrap { margin: 2rem 0; }
.mood-graph-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--gold); margin-bottom: 1.5rem; }
.mood-graph-grid { display: flex; gap: 5px; flex-wrap: wrap; padding-top: 1.5rem; }
.mood-square { width: 36px; height: 36px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; transition: all 0.2s; position: relative; }
.mood-square:hover { transform: scale(1.12); border-color: var(--gold); }
.mood-square .day-label { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-family: var(--font-ui); font-size: 0.52rem; color: var(--text-dim); white-space: nowrap; }
.mood-square.filled { border-color: rgba(197,160,89,.35); }
.mood-legend { display: flex; gap: 1.2rem; margin-top: 1rem; flex-wrap: wrap; }
.mood-legend-item { display: flex; align-items: center; gap: 0.35rem; font-family: var(--font-ui); font-size: 0.68rem; color: var(--text-dim); cursor: pointer; }

/* ── Belief Cards ── */
.belief-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.9rem; overflow: hidden; transition: box-shadow 0.2s; }
.belief-card:hover { box-shadow: var(--shadow); }
.belief-header { padding: 1.1rem 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.belief-number { font-family: var(--font-ui); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.15em; color: var(--gold); opacity: 0.7; flex-shrink: 0; }
.belief-text { font-family: var(--font-display); font-size: 1.05rem; font-style: italic; color: var(--text); flex: 1; }
.belief-toggle { color: var(--text-dim); transition: transform 0.3s; font-size: 0.8rem; flex-shrink: 0; }
.belief-card.open .belief-toggle { transform: rotate(180deg); }
.belief-body { display: none; padding: 0 1.5rem 1.5rem; border-top: 1px solid var(--border); }
.belief-card.open .belief-body { display: block; }
.belief-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.2rem; }
@media (max-width: 560px) { .belief-row { grid-template-columns: 1fr; } }
.belief-origin, .belief-reprog { padding: 1rem; border-radius: 6px; font-size: 0.9rem; line-height: 1.6; }
.belief-origin { background: rgba(239,68,68,.07); border: 1px solid rgba(239,68,68,.2); color: var(--text-muted); }
.belief-origin strong { color: #EF4444; display: block; margin-bottom: 0.3rem; font-family: var(--font-ui); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; }
.belief-reprog { background: rgba(16,185,129,.07); border: 1px solid rgba(16,185,129,.2); color: var(--text-muted); font-style: italic; }
.belief-reprog strong { color: var(--maiden); display: block; margin-bottom: 0.3rem; font-style: normal; font-family: var(--font-ui); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* ── TOC ── */
#toc-toggle {
  position: fixed; top: 50%; right: 0; transform: translateY(-50%);
  z-index: 150; background: var(--surface); border: 1px solid var(--border);
  border-right: none; border-radius: 8px 0 0 8px; padding: 0.8rem 0.5rem;
  cursor: pointer; color: var(--text-muted); transition: all 0.2s;
  writing-mode: vertical-rl; font-family: var(--font-ui); font-size: 0.62rem;
  letter-spacing: 0.12em; text-transform: uppercase; display: flex;
  align-items: center; gap: 0.4rem;
}
#toc-toggle:hover { color: var(--gold); border-color: var(--gold); }
#toc-panel {
  position: fixed; right: -320px; top: 0; width: 300px; height: 100vh;
  background: var(--surface); border-left: 1px solid var(--border);
  z-index: 200; transition: right 0.35s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; padding: 2rem 1.5rem;
}
#toc-panel.open { right: 0; }
#toc-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 190; opacity: 0; pointer-events: none; transition: opacity 0.35s; }
#toc-overlay.open { opacity: 1; pointer-events: all; }
.toc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.toc-header h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--gold); }
.toc-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.3rem; padding: 0.2rem; transition: color 0.2s; }
.toc-close:hover { color: var(--gold); }
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin-bottom: 0; }
.toc-list a { display: block; padding: 0.55rem 0.8rem; color: var(--text-muted); text-decoration: none; font-family: var(--font-ui); font-size: 0.78rem; border-radius: 6px; transition: all 0.2s; letter-spacing: 0.02em; line-height: 1.4; }
.toc-list a:hover { color: var(--gold); background: rgba(197,160,89,.07); }
.toc-list a.toc-chapter { color: var(--text); font-weight: 700; font-size: 0.8rem; margin-top: 0.5rem; }
.toc-list a.toc-sub { padding-left: 1.5rem; font-size: 0.72rem; }
.toc-list .toc-sep { border: none; border-top: 1px solid var(--border); margin: 0.5rem 0; }

/* ── Modals ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.77); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1.5rem; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 2.5rem; max-width: 520px; width: 100%; box-shadow: 0 24px 80px rgba(0,0,0,.75); transform: translateY(20px); transition: transform 0.3s; max-height: 90vh; overflow-y: auto; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-title { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; color: var(--gold); margin-bottom: 0.5rem; }
.modal-text { font-family: var(--font-body); font-size: 1rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* Diary Modal */
.diary-modal-day { font-family: var(--font-ui); font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gold); margin-bottom: 1.2rem; }
.mood-select { display: flex; gap: 0.6rem; margin: 0.5rem 0 1.2rem; flex-wrap: wrap; }
.mood-opt { font-size: 1.5rem; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface-2); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.mood-opt:hover, .mood-opt.selected { border-color: var(--gold); background: rgba(197,160,89,.1); transform: scale(1.1); }
.energy-stars { display: flex; gap: 0.4rem; margin: 0.5rem 0 1.2rem; }
.energy-star { font-size: 1.4rem; cursor: pointer; transition: transform 0.2s; opacity: 0.3; }
.energy-star.active { opacity: 1; }
.energy-star:hover { transform: scale(1.2); }

/* Highlight Tooltip */
#highlight-tooltip { position: fixed; background: var(--surface); border: 1px solid var(--border-light); border-radius: 50px; padding: 8px 16px; display: none; gap: 10px; align-items: center; z-index: 1000; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
#highlight-tooltip.show { display: flex; }
.hl-btn { width: 24px; height: 24px; border-radius: 50%; border: none; cursor: pointer; transition: transform 0.2s; }
.hl-btn:hover { transform: scale(1.2); }
.hl-gold { background: #C5A059; } .hl-purple { background: #8B5CF6; } .hl-pink { background: #EC4899; }
.hl-label { font-family: var(--font-ui); font-size: 0.62rem; color: var(--text-dim); letter-spacing: 0.05em; }
.highlight { cursor: pointer; border-radius: 2px; padding: 1px 0; }
.highlight.gold { background: rgba(197,160,89,.35); }
.highlight.purple { background: rgba(139,92,246,.35); }
.highlight.pink { background: rgba(236,72,153,.35); }
/* Paragraph-level highlights */
.para-wrap p.highlight { cursor: default; display: block; border-radius: 4px; padding: 6px 8px; margin: 0 -8px; }
/* Remove button for tooltip */
.hl-remove { background: rgba(239,68,68,.15); color: #EF4444; font-size: 11px; font-weight: 700; display: none; align-items: center; justify-content: center; }
#highlight-tooltip.has-hl .hl-remove { display: flex; }
/* iOS: prevent input auto-zoom */
@media (max-width: 768px) { input, textarea, select { font-size: 16px; } }

/* Focus Mode */
body.focus-mode .para-wrap p { opacity: 0.2; transition: opacity 0.3s; }
body.focus-mode .para-wrap.focused p { opacity: 1; }

/* ── Buttons ── */
.btn-action { display: inline-block; padding: 0.82rem 2.2rem; background: var(--gold); color: var(--bg); border: none; border-radius: 6px; font-family: var(--font-ui); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; transition: all 0.2s; margin: 0.4rem; }
.btn-action:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(197,160,89,.32); }
.btn-action.secondary { background: transparent; border: 1px solid var(--border-light); color: var(--text-muted); }
.btn-action.secondary:hover { border-color: var(--gold); color: var(--gold); background: transparent; transform: none; box-shadow: none; }
.btn-action.danger { background: transparent; border: 1px solid rgba(239,68,68,.4); color: #EF4444; }
.btn-action.danger:hover { background: rgba(239,68,68,.1); border-color: #EF4444; transform: none; box-shadow: none; }

/* ── Utility ── */
.neuro-callout { background: linear-gradient(135deg,rgba(79,70,229,.1),rgba(139,92,246,.05)); border: 1px solid rgba(79,70,229,.3); border-radius: var(--radius); padding: 1.5rem; margin: 2rem 0; }
.neuro-callout h4 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: #818CF8; margin-bottom: 0.8rem; }
.neuro-callout p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin: 2rem 0; }
.stat-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 1.2rem; text-align: center; }
.stat-number { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: var(--gold); line-height: 1; margin-bottom: 0.4rem; }
.stat-label { font-family: var(--font-ui); font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.04em; line-height: 1.4; }
.stat-phase { display: block; font-family: var(--font-ui); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 0.4rem; opacity: 0.7; }
.stat-card.s-maiden .stat-number,.stat-card.s-maiden .stat-phase{color:var(--maiden)}
.stat-card.s-mother .stat-number,.stat-card.s-mother .stat-phase{color:var(--mother)}
.stat-card.s-witch  .stat-number,.stat-card.s-witch  .stat-phase{color:var(--witch)}
.stat-card.s-crone  .stat-number,.stat-card.s-crone  .stat-phase{color:var(--crone)}

.protocol-steps { counter-reset: step; list-style: none; padding: 0; margin: 1.5rem 0; }
.protocol-steps li { counter-increment: step; display: flex; gap: 1.2rem; align-items: flex-start; padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.protocol-steps li::before { content: counter(step); flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: rgba(197,160,89,.08); border: 1px solid var(--gold); color: var(--gold); font-family: var(--font-ui); font-size: 0.78rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.protocol-steps li strong { color: var(--text); display: block; margin-bottom: 0.2rem; font-family: var(--font-ui); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.protocol-steps li p { margin-bottom: 0; font-size: 0.92rem; color: var(--text-muted); }

.type-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.2rem; }
.type-card-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.type-badge { font-family: var(--font-ui); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.28rem 0.75rem; border-radius: 20px; flex-shrink: 0; }
.type-badge.t1{background:rgba(16,185,129,.15);color:var(--maiden)}
.type-badge.t2{background:rgba(139,92,246,.15);color:var(--secondary)}
.type-badge.t3{background:rgba(197,160,89,.15);color:var(--gold)}
.type-badge.t4{background:rgba(239,68,68,.15);color:var(--witch)}
.type-badge.t5{background:rgba(99,102,241,.15);color:var(--crone)}
.type-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--text); margin-bottom: 0.2rem; }
.type-tagline { font-family: var(--font-display); font-style: italic; font-size: 0.93rem; color: var(--text-muted); }
.type-challenge { font-family: var(--font-ui); font-size: 0.75rem; padding: 0.5rem 0.9rem; background: rgba(239,68,68,.07); border-left: 3px solid rgba(239,68,68,.4); color: var(--text-muted); border-radius: 0 4px 4px 0; margin-top: 0.8rem; }
.type-card ul { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.5rem; }

.pillar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.2rem; margin: 2rem 0; }
.pillar-card { background: var(--surface-2); border: 1px solid var(--border); border-top: 3px solid var(--secondary); border-radius: var(--radius); padding: 1.5rem; }
.pillar-card h4 { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; color: var(--secondary); margin-bottom: 0.7rem; }
.pillar-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0; }

hr.fancy { border: none; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 3rem 0; opacity: 0.3; }

.highlight-box { background: rgba(79,70,229,.08); border: 1px solid rgba(79,70,229,.25); border-radius: var(--radius); padding: 1.4rem; margin: 1.5rem 0; }
.highlight-box h4 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; color: #818CF8; margin-bottom: 0.6rem; }
.highlight-box p { margin-bottom: 0; font-size: 0.93rem; color: var(--text-muted); }

.conclusion-quote-block { text-align: center; padding: 3rem 2rem; margin: 2rem 0; }
.conclusion-quote-block p { font-family: var(--font-display); font-size: 1.5rem; font-style: italic; color: var(--gold-light); margin-bottom: 1rem; line-height: 1.5; }

.commitment-wrap { background: var(--surface-2); border: 1px solid var(--gold); border-radius: 12px; padding: 2rem; margin: 2rem 0; text-align: center; }
.commitment-wrap h3 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--gold); margin-bottom: 1rem; }
.commitment-wrap p { font-style: italic; color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.97rem; }

/* ── Responsive ── */
@media (max-width: 800px) { .book-container{border-radius:0;} .note-btn{right:-1.5rem;} }
@media (max-width: 640px) { .flip-cards-grid{grid-template-columns:repeat(2,1fr);} .stat-grid{grid-template-columns:repeat(2,1fr);} }
@media (max-width: 480px) { .flip-cards-grid{grid-template-columns:1fr;} .flip-card{height:180px;} .mood-square{width:30px;height:30px;font-size:.85rem;} .diary-day-num{font-size:.7rem;} }

/* ══════════════════════════════════════════════════════════
   PWA INSTALL BAR & IOS MODAL
   ══════════════════════════════════════════════════════════ */

/* Barra inferior de instalação — mobile only */
#pwa-install-bar {
  display: none; /* controlado por JS */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9000;
  align-items: center;
  gap: 0;
  padding: 0;
  background: linear-gradient(135deg, #3730a3 0%, #4F46E5 50%, #6d28d9 100%);
  border-top: 1px solid rgba(197,160,89,0.4);
  box-shadow: 0 -4px 30px rgba(79,70,229,0.5), 0 -1px 0 rgba(197,160,89,0.3);
  /* Começa fora da tela */
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.4s ease;
}

/* Esconde em desktop */
@media (min-width: 769px) {
  #pwa-install-bar { display: none !important; }
}

/* Botão principal de instalação */
#pwa-install-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}
#pwa-install-btn:active {
  background: rgba(255,255,255,0.08);
}

.pwa-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: rgba(197,160,89,0.15);
  border: 1.5px solid rgba(197,160,89,0.5);
  border-radius: 50%;
  color: #C5A059;
  flex-shrink: 0;
  animation: pwa-bounce 2.5s ease-in-out infinite;
}
@keyframes pwa-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.pwa-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pwa-text strong {
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #C5A059;
  letter-spacing: 0.03em;
}
.pwa-text small {
  font-family: 'Lato', sans-serif;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 300;
}

.pwa-moon {
  font-size: 1.6rem;
  color: rgba(197,160,89,0.6);
  padding-right: 4px;
  animation: pwa-moon-pulse 3s ease-in-out infinite;
}
@keyframes pwa-moon-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Botão de dispensar (X) */
#pwa-dismiss {
  width: 48px; height: 100%;
  min-height: 68px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
#pwa-dismiss:active {
  background: rgba(128,128,128,0.12);
  color: var(--text);
}

/* ── Modal iOS ── */
#ios-install-modal {
  display: none; /* controlado por JS */
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 env(safe-area-inset-bottom, 0);
}

#ios-install-content {
  background: var(--surface);
  border: 1px solid rgba(197,160,89,0.3);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 28px 24px 32px;
  width: 100%;
  max-width: 520px;
  position: relative;
  transform: translateY(40px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34,1.3,0.64,1), opacity 0.3s ease;
}

#ios-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(128,128,128,0.12);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
#ios-modal-close:active { background: rgba(128,128,128,0.2); }

.ios-moon-icon {
  font-size: 2.8rem;
  text-align: center;
  margin-bottom: 8px;
  animation: pulse 3s ease-in-out infinite;
}

#ios-install-content h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  color: #C5A059;
  text-align: center;
  margin-bottom: 6px;
}

#ios-install-content > p {
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

.ios-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(79,70,229,0.1);
  border: 1px solid rgba(79,70,229,0.2);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.ios-step-num {
  width: 28px; height: 28px;
  background: #4F46E5;
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.ios-step-text {
  font-family: 'Lato', sans-serif;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.ios-share-icon {
  width: 18px; height: 18px;
  color: #60a5fa;
  vertical-align: middle;
  flex-shrink: 0;
}

.ios-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(79,70,229,0.25);
  border: 1px solid rgba(79,70,229,0.4);
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 700;
  color: #a5b4fc;
  font-size: 0.82rem;
}

.ios-arrow-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 16px 0 20px;
  opacity: 0.6;
  animation: pwa-bounce 1.8s ease-in-out infinite;
}
.ios-arrow-hint span {
  font-family: 'Lato', sans-serif;
  font-size: 0.75rem;
  color: #C5A059;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ios-close-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #4F46E5, #6d28d9);
  border: 1px solid rgba(197,160,89,0.3);
  border-radius: 12px;
  color: #C5A059;
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.ios-close-btn:active {
  opacity: 0.85;
  transform: scale(0.98);
}

/* Esconder barra no print */
@media print {
  #pwa-install-bar, #ios-install-modal { display: none !important; }
}

/* ── Print ── */
@media print {
  body{background:white;color:black;}
  #fixed-header,#toc-toggle,#toc-panel,#highlight-tooltip,#loading-screen,.modal-overlay,#save-indicator,#bookmark-banner{display:none!important;}
  .book-container{box-shadow:none;}
  .chapter{page-break-before:always;opacity:1;transform:none;}
  #intro{opacity:1;transform:none;}
}

/* ═══════════════════════════════════════════════════════════════
   ALMA DE LIVRO PREMIUM — Refatoração visual literária
   ═══════════════════════════════════════════════════════════════ */

/* ── Fundo escuro com gradiente que simula abertura de livro ── */
#book-wrap {
  background: linear-gradient(90deg,
    #030508 0%, #070b12 5%,
    #0B0F19 12%, #0B0F19 88%,
    #070b12 95%, #030508 100%
  );
  padding: 0 0 7rem;
}

/* ── Container: simulação de páginas com sombra lateral de livro ── */
.book-container {
  max-width: 740px;
  margin: 0 auto;
  background: var(--surface);
  box-shadow:
    -14px 0 60px rgba(0,0,0,0.8),
     14px 0 60px rgba(0,0,0,0.8),
    -4px  0 20px rgba(0,0,0,0.6),
     4px  0 20px rgba(0,0,0,0.6),
    inset 0 0 0 1px rgba(197,160,89,0.08);
  border-left:  1px solid rgba(197,160,89,0.13);
  border-right: 1px solid rgba(197,160,89,0.13);
  position: relative;
}

/* Lombada do livro (efeito de encadernação) */
.book-container::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: linear-gradient(180deg,
    rgba(197,160,89,0.18) 0%,
    rgba(197,160,89,0.07) 25%,
    rgba(197,160,89,0.15) 50%,
    rgba(197,160,89,0.07) 75%,
    rgba(197,160,89,0.18) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* ── Capítulos: margens generosas de livro ── */
.chapter, #intro {
  padding: 5.5rem 5rem 4.5rem;
  position: relative;
  border-bottom: none;
}

/* Divisor ornamental entre capítulos */
.chapter + .chapter,
#intro + .chapter {
  border-top: none;
}

.chapter + .chapter::before,
#intro + .chapter::before {
  content: '✦  ✧  ☽  ✧  ✦';
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--gold);
  opacity: 0.3;
  letter-spacing: 0.9em;
  padding-top: 3rem;
  margin-bottom: -2.5rem;
}

/* Linha dourada abaixo do ornamento */
.chapter + .chapter::after,
#intro + .chapter::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(197,160,89,0.35) 20%,
    rgba(197,160,89,0.2) 50%,
    rgba(197,160,89,0.35) 80%, transparent 100%
  );
  margin: 0 5rem 1.5rem;
}

/* ── Animação de virada de página ── */
.chapter, #intro {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.chapter.visible, #intro.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Numeração romana — estilo tipográfico literário ── */
.chapter-number {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.45em;
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
  opacity: 0.8;
  margin-bottom: 1.1rem;
  display: block;
}

/* Linha decorativa abaixo do número do capítulo */
.chapter-header {
  margin-bottom: 3rem;
  padding-bottom: 2.2rem;
  border-bottom: none;
  position: relative;
}

.chapter-header::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg,
    var(--gold) 0%, rgba(197,160,89,0.4) 40%,
    rgba(197,160,89,0.15) 70%, transparent 100%
  );
  margin-top: 2.2rem;
}

/* ── Título do capítulo ── */
.chapter-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.5vw, 3.1rem);
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.7rem;
  letter-spacing: 0.01em;
}

/* ── Drop cap dourado proeminente ── */
.drop-cap::first-letter {
  font-family: var(--font-display);
  font-size: 5.2rem;
  font-weight: 700;
  float: left;
  line-height: 0.78;
  color: var(--gold);
  margin-right: 0.12rem;
  margin-top: 0.08rem;
  text-shadow:
    0 0 40px rgba(197,160,89,0.4),
    0 2px 8px rgba(0,0,0,0.5);
}

/* ── Blockquote literário com aspas gigantes ── */
blockquote {
  position: relative;
  border-left: 3px solid var(--gold);
  border-left-width: 0; /* removido — a borda vem do ::after */
  padding: 2.2rem 2.5rem 2rem 4rem;
  background: rgba(197,160,89,0.035);
  margin: 3rem 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.95;
  border-radius: 0 6px 6px 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Aspa decorativa gigante */
blockquote::before {
  content: '\201C';
  position: absolute;
  left: 0.5rem;
  top: -1.2rem;
  font-family: var(--font-display);
  font-size: 7rem;
  color: var(--gold);
  opacity: 0.25;
  line-height: 1;
  font-style: normal;
  pointer-events: none;
}

/* Borda lateral dourada com gradiente */
blockquote::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg,
    var(--gold) 0%,
    rgba(197,160,89,0.5) 50%,
    rgba(197,160,89,0.2) 100%
  );
  border-radius: 2px;
}

/* ── Ornamentos entre seções ── */
.ornament {
  text-align: center;
  font-size: 0.82rem;
  color: var(--gold);
  margin: 4rem 0;
  letter-spacing: 0.7em;
  opacity: 0.45;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.ornament::before,
.ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(197,160,89,0.35));
  margin: 0 1.5rem;
}

.ornament::after {
  background: linear-gradient(270deg, transparent, rgba(197,160,89,0.35));
}

/* ── Título de seção com acento dourado ── */
.section-title {
  font-family: var(--font-display);
  font-size: 1.72rem;
  font-weight: 600;
  color: var(--text);
  margin: 3.5rem 0 1.5rem;
  line-height: 1.18;
  position: relative;
  padding-bottom: 0.9rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 36px; height: 1px;
  background: var(--gold);
  opacity: 0.5;
}

/* ── Parágrafos — ritmo literário ── */
p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 2.05;
  margin-bottom: 1.3rem;
  letter-spacing: 0.013em;
}

/* ── hr.fancy ornamental ── */
hr.fancy {
  border: none;
  margin: 4.5rem 0;
  position: relative;
  text-align: center;
  height: 0;
}

hr.fancy::before {
  content: '◆';
  display: inline-block;
  color: var(--gold);
  opacity: 0.3;
  font-size: 0.65rem;
  letter-spacing: 2em;
}

hr.fancy::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(197,160,89,0.2), transparent);
  margin-top: 0.9rem;
}

/* ── Cabeçalho fixo: título do capítulo em itálico dourado ── */
.header-progress-label {
  font-family: var(--font-display) !important;
  font-style: italic !important;
  font-size: 0.85rem !important;
  color: var(--gold) !important;
  opacity: 0.88;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Intro label ── */
.intro-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.45em;
  font-style: italic;
  color: var(--gold);
  opacity: 0.8;
  display: block;
  margin-bottom: 1.1rem;
}

/* ── Responsivo ── */
@media (max-width: 900px) {
  .book-container::before { display: none; }
}

@media (max-width: 700px) {
  .chapter, #intro { padding: 3.5rem 2.2rem 3rem; }
  .chapter + .chapter::after,
  #intro + .chapter::after { margin: 0 2.2rem 1.5rem; }
  blockquote { padding: 1.8rem 1.5rem 1.6rem 3rem; font-size: 1.15rem; }
  blockquote::before { font-size: 5rem; }
  .drop-cap::first-letter { font-size: 3.8rem; }
  .chapter-title { font-size: clamp(1.7rem, 6vw, 2.5rem); }
}

@media (max-width: 480px) {
  .chapter, #intro { padding: 2.5rem 1.4rem 2rem; }
  .chapter + .chapter::after,
  #intro + .chapter::after { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   NOVAS FUNCIONALIDADES — Foco, Marcador, Grifo, Modos, Flip
   ═══════════════════════════════════════════════════════════════ */

/* ── Modos de leitura — transição suave ── */
body,
.book-container,
#cover,
#fixed-header,
#toc-panel,
.modal,
.worksheet,
.phase-card,
.flip-card-front,
.flip-card-back,
.checklist-section,
.belief-card,
.timer-wrap,
blockquote {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

/* ── White Mode ── */
body.mode-white {
  --bg: #F5F0E8; --surface: #FFFFFF; --surface-2: #F7F3EE;
  --surface-3: #EDE8E0; --text: #1C1917; --text-muted: #57534E;
  --text-dim: #78716C; --border: #D6C9BD; --border-light: #C4B5A5;
  --gold: #8B6914; --gold-light: #A07820; --gold-dark: #6B5010;
  --shadow: 0 4px 24px rgba(0,0,0,0.15);
}
body.mode-white #book-wrap {
  background: linear-gradient(90deg, #C8C0B4 0%, #D9D0C5 5%, #F5F0E8 12%, #F5F0E8 88%, #D9D0C5 95%, #C8C0B4 100%);
}
body.mode-white #cover {
  background: radial-gradient(ellipse at 50% 30%, rgba(79,70,229,0.07) 0%, #E8E2D8 55%, #DDD7CC 100%);
}
body.mode-white .book-container {
  box-shadow: -12px 0 50px rgba(0,0,0,0.12), 12px 0 50px rgba(0,0,0,0.12), inset 0 0 0 1px rgba(197,160,89,0.2);
}
body.mode-white .book-container::before {
  background: linear-gradient(180deg, rgba(197,160,89,0.2) 0%, rgba(197,160,89,0.08) 50%, rgba(197,160,89,0.2) 100%);
}
body.mode-white .star { background: rgba(79,70,229,0.15); }

/* White Mode — Atividades (worksheets, inputs, cards) */
body.mode-white .worksheet {
  background: rgba(255,255,255,0.85);
  border-color: #8B6914;
}
body.mode-white .worksheet::before {
  background: linear-gradient(135deg,rgba(139,105,20,0.06),transparent 60%);
}
body.mode-white .worksheet-title { color: #8B6914; }
body.mode-white .worksheet-subtitle { color: #78716C; }
body.mode-white .input-text {
  background: #FFFFFF;
  border-color: #C4B5A5;
  color: #1C1917;
}
body.mode-white .input-text:focus {
  border-color: #8B6914;
  box-shadow: 0 0 0 3px rgba(139,105,20,0.12);
}
body.mode-white .phase-shadow {
  background: rgba(0,0,0,0.05);
  color: #57534E;
}
body.mode-white .phase-card {
  background: #F7F3EE;
  border-color: #D6C9BD;
}
body.mode-white .highlight-box {
  background: rgba(79,70,229,0.05);
  border-color: rgba(79,70,229,0.2);
}
body.mode-white .highlight-box h4 { color: #4338CA; }
body.mode-white .energy-chart {
  background: rgba(0,0,0,0.04);
  border-color: #D6C9BD;
}
body.mode-white .library-highlight-item { background: rgba(0,0,0,0.04); }
body.mode-white .journey-phrase {
  background: rgba(139,105,20,0.06);
  border-color: rgba(139,105,20,0.25);
}

/* ── Sépia ── */
body.mode-sepia {
  --bg: #2C1810; --surface: #3D2B1F; --surface-2: #4A3428;
  --surface-3: #261510; --text: #E8D5B7; --text-muted: #C4A882;
  --text-dim: #9E7D5A; --border: #5C3D2A; --border-light: #6B4A35;
}
body.mode-sepia #book-wrap {
  background: linear-gradient(90deg, #160B06 0%, #1E0F09 5%, #2C1810 12%, #2C1810 88%, #1E0F09 95%, #160B06 100%);
}
body.mode-sepia #cover {
  background: radial-gradient(ellipse at 50% 30%, #4A2010 0%, #2C1810 60%, #160B06 100%);
}

/* ── Night Mode ── */
body.mode-night {
  --bg: #000000; --surface: #0A0A0A; --surface-2: #111111;
  --surface-3: #070707; --text: #E0E0E0; --text-muted: #A0A0A0;
  --text-dim: #666666; --border: #1A1A1A; --border-light: #242424;
}
body.mode-night #book-wrap { background: #000; }
body.mode-night #cover { background: #000; }
body.mode-night .book-container {
  box-shadow: none;
  border-left-color: rgba(197,160,89,0.08);
  border-right-color: rgba(197,160,89,0.08);
}

/* ── Feature tip modals ── */
.feature-tip-modal {
  position: fixed; inset: 0; z-index: 8500;
  background: rgba(0,0,0,0.78); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.feature-tip-box {
  background: var(--surface); border: 1px solid var(--gold);
  border-radius: 18px; padding: 2.8rem 2.2rem 2.4rem;
  max-width: 420px; width: 100%; text-align: center;
  box-shadow: 0 32px 90px rgba(0,0,0,0.85), 0 0 0 1px rgba(197,160,89,0.1);
  transition: background-color 0.3s ease;
}
.feature-tip-icon { font-size: 2.8rem; margin-bottom: 0.7rem; display: block; }
.feature-tip-title {
  font-family: var(--font-display); font-size: 1.7rem;
  color: var(--gold); margin-bottom: 1rem;
}
.feature-tip-desc {
  font-family: var(--font-display); font-size: 1.08rem;
  font-style: italic; color: var(--text-muted);
  line-height: 1.85; margin-bottom: 2rem;
}
.feature-tip-btn {
  padding: 0.9rem 2.8rem;
  background: rgba(197,160,89,0.1); border: 1px solid var(--gold);
  color: var(--gold); border-radius: 50px;
  font-family: var(--font-ui); font-size: 0.78rem;
  font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  cursor: pointer; transition: all 0.3s;
}
.feature-tip-btn:hover { background: rgba(197,160,89,0.22); }

/* ── Reading mode selector ── */
.mode-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.75rem; margin-bottom: 1.8rem;
}
.mode-option {
  padding: 1.1rem 0.9rem; border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.06); cursor: pointer;
  transition: all 0.25s; text-align: center;
}
.mode-option:hover { border-color: rgba(197,160,89,0.5); }
.mode-option.active { border-color: var(--gold); background: rgba(197,160,89,0.1); }
.mode-option[data-mode="dark"]  { background: rgba(11,15,25,0.85); }
.mode-option[data-mode="white"] { background: rgba(245,240,232,0.12); }
.mode-option[data-mode="sepia"] { background: rgba(61,43,31,0.55); }
.mode-option[data-mode="night"] { background: rgba(0,0,0,0.7); }
.mode-option-icon { font-size: 1.5rem; margin-bottom: 0.4rem; display: block; }
.mode-option-name {
  font-family: var(--font-ui); font-size: 0.68rem;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text); display: block; margin-bottom: 0.2rem;
}
.mode-option-desc {
  font-family: var(--font-display); font-size: 0.78rem;
  font-style: italic; color: var(--text-muted);
}

/* ── Highlight — 4ª cor (verde) ── */
.highlight.green { background: rgba(16,185,129,0.28); }
.hl-green { background: #10B981; }

/* ── Foco aprimorado ── */
body.focus-mode .para-wrap p {
  opacity: 0.07;
  filter: blur(0.4px);
  transition: opacity 0.4s ease, filter 0.4s ease;
}
body.focus-mode .para-wrap.focused p {
  opacity: 1 !important;
  filter: none !important;
}

/* ── Grifo: badge de contagem ── */
#grifo-count {
  display: inline-block; background: var(--gold); color: var(--bg);
  font-size: 0.52rem; font-weight: 700; border-radius: 8px;
  padding: 1px 4px; margin-left: 2px; vertical-align: top;
  line-height: 1.6; min-width: 14px; text-align: center;
}
#grifo-count:empty { display: none; }

/* Modo grifo ativo: cursor crosshair em parágrafos */
body.grifo-mode .para-wrap { cursor: crosshair; }
body.grifo-mode .para-wrap p {
  outline: 1px dashed rgba(197,160,89,0.18); border-radius: 3px;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}

/* ── Flip de página ── */
@keyframes flipOut {
  0%   { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(-24px); }
}
@keyframes flipIn {
  0%   { opacity: 0; transform: translateX(24px); }
  100% { opacity: 1; transform: translateX(0); }
}
.book-container.flipping-out {
  animation: flipOut 0.25s ease-in forwards;
}
.book-container.flipping-in {
  animation: flipIn 0.28s ease-out forwards;
}

/* ── Botões de navegação entre capítulos ── */
.chapter-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2.2rem 0 0.5rem; margin-top: 2.5rem;
  border-top: 1px solid rgba(197,160,89,0.1);
}
.chapter-nav-btn {
  background: none; border: 1px solid var(--border-light);
  color: var(--text-dim); padding: 0.65rem 1.5rem;
  border-radius: 50px; font-family: var(--font-ui);
  font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; transition: all 0.25s;
}
.chapter-nav-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.chapter-nav-btn:disabled { opacity: 0.18; cursor: default; }

/* ── TOC bookmark marker ── */
.toc-bookmark-marker { color: var(--gold); margin-left: 0.3rem; font-size: 0.75rem; }

/* ── @keyframes ribbonPop (caso não exista) ── */
@keyframes ribbonPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.45) rotate(14deg); }
  70%  { transform: scale(0.9) rotate(-5deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .mode-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .feature-tip-box { padding: 2rem 1.5rem; }
  .chapter-nav-btn { font-size: 0.62rem; padding: 0.6rem 1rem; }
}

/* =================================================================
   NOVAS FUNCIONALIDADES v2.0 — Alma de livro premium noturno
   Relógio, Calendário, Questionário Mensal, Insights, Recomendações,
   Linha do Tempo, Modo Cerimônia, Biblioteca Pessoal
   ================================================================= */

/* ── RELÓGIO E SAUDAÇÃO NA CAPA ── */
.cover-clock-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.35rem; margin-bottom: 1.8rem;
}
.cover-time {
  font-family: var(--font-display); font-size: 2.4rem; font-weight: 300;
  color: var(--gold); letter-spacing: 0.08em;
  text-shadow: 0 0 20px rgba(197,160,89,0.4);
}
.cover-greeting {
  font-family: var(--font-display); font-size: 1.15rem; font-style: italic;
  color: var(--text-muted); letter-spacing: 0.04em;
}
.cover-phase-suggest {
  font-family: var(--font-ui); font-size: 0.65rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold); opacity: 0.8;
  background: rgba(197,160,89,0.08); border: 1px solid rgba(197,160,89,0.22);
  padding: 0.28rem 0.9rem; border-radius: 20px; margin-top: 0.2rem;
}

/* ── BANNER DE INSIGHT ── */
.insight-banner {
  display: none; background: linear-gradient(135deg, rgba(197,160,89,0.1), rgba(79,70,229,0.06));
  border: 1px solid rgba(197,160,89,0.32); border-radius: 12px;
  padding: 1.2rem 1.5rem; margin: 1.5rem 0; position: relative;
  animation: fadeIn 0.6s ease;
}
.insight-banner.visible { display: block; }
.insight-banner-label {
  font-family: var(--font-ui); font-size: 0.6rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold); opacity: 0.75; margin-bottom: 0.5rem; display: block;
}
.insight-banner-text {
  font-family: var(--font-display); font-size: 1.05rem; font-style: italic;
  color: var(--text-muted); line-height: 1.75;
}
.insight-banner-close {
  position: absolute; top: 0.7rem; right: 0.9rem;
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 0.9rem; transition: color 0.2s;
}
.insight-banner-close:hover { color: var(--gold); }

/* ── CARD DE RECOMENDAÇÃO ── */
.recommendation-card {
  display: none; background: rgba(11,15,25,0.97);
  border: 1px solid var(--gold); border-radius: 14px;
  padding: 1.6rem 1.8rem; margin: 1.5rem 0;
  box-shadow: 0 8px 40px rgba(197,160,89,0.1);
  animation: fadeIn 0.7s ease;
}
.recommendation-card.visible { display: block; }
.recommendation-phase-badge {
  font-family: var(--font-ui); font-size: 0.6rem; letter-spacing: 0.18em;
  text-transform: uppercase; padding: 0.22rem 0.8rem; border-radius: 20px;
  border: 1px solid currentColor; display: inline-block; margin-bottom: 0.8rem;
}
.rec-maiden { color: var(--maiden); }
.rec-mother { color: var(--mother); }
.rec-witch  { color: var(--witch); }
.rec-crone  { color: var(--crone); }
.recommendation-card-title {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 600;
  color: var(--gold); margin-bottom: 0.6rem;
}
.recommendation-card-text {
  font-family: var(--font-display); font-size: 1.05rem; font-style: italic;
  color: var(--text-muted); line-height: 1.82;
}

/* ── BOTÃO CERIMÔNIA NA CAPA ── */
.btn-ceremony {
  display: inline-block; padding: 0.8rem 2.2rem;
  background: transparent; border: 1px solid rgba(197,160,89,0.45);
  color: var(--text-muted); font-family: var(--font-ui);
  font-size: 0.73rem; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; cursor: pointer; border-radius: 50px;
  transition: all 0.4s ease; margin-top: 1rem;
}
.btn-ceremony:hover {
  border-color: var(--gold); color: var(--gold);
  box-shadow: 0 0 20px rgba(197,160,89,0.2);
}

/* ── OVERLAY MODO CERIMÔNIA ── */
#ceremony-overlay {
  display: none; position: fixed; inset: 0; z-index: 9200;
  background: #030508; overflow-y: auto;
}
#ceremony-overlay.open { display: block; animation: fadeIn 0.8s ease; }
.ceremony-inner {
  max-width: 640px; margin: 0 auto; padding: 4rem 2.5rem 6rem;
  text-align: center; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ceremony-close {
  position: fixed; top: 1.2rem; right: 1.4rem;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(197,160,89,0.3);
  color: var(--gold); border-radius: 50%; width: 40px; height: 40px;
  font-size: 1.1rem; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; z-index: 10;
}
.ceremony-close:hover { background: rgba(197,160,89,0.15); }
.ceremony-candle {
  font-size: 4.5rem; margin-bottom: 2rem; display: block;
  animation: candleFlicker 2.2s ease-in-out infinite;
  filter: drop-shadow(0 0 16px rgba(255,180,50,0.8));
}
@keyframes candleFlicker {
  0%,100% { transform: scale(1) rotate(-1deg);   filter: drop-shadow(0 0 12px rgba(255,180,50,0.7)); }
  25%      { transform: scale(1.05) rotate(1.5deg); filter: drop-shadow(0 0 24px rgba(255,200,80,0.95)); }
  50%      { transform: scale(0.97) rotate(-0.5deg); filter: drop-shadow(0 0 8px rgba(255,160,30,0.6)); }
  75%      { transform: scale(1.03) rotate(2deg);  filter: drop-shadow(0 0 18px rgba(255,190,60,0.85)); }
}
.ceremony-title {
  font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 600; color: var(--gold); margin-bottom: 0.8rem; letter-spacing: 0.03em;
}
.ceremony-subtitle {
  font-family: var(--font-display); font-size: 1.1rem; font-style: italic;
  color: var(--text-muted); margin-bottom: 3rem; line-height: 1.7;
}
.ceremony-divider {
  color: var(--gold); opacity: 0.4; letter-spacing: 0.8em;
  font-size: 0.85rem; margin: 2.5rem 0; display: block;
}
.ceremony-step {
  background: rgba(197,160,89,0.04); border: 1px solid rgba(197,160,89,0.14);
  border-radius: 12px; padding: 1.8rem; margin-bottom: 1.4rem;
  text-align: left; transition: border-color 0.3s;
}
.ceremony-step:hover { border-color: rgba(197,160,89,0.3); }
.ceremony-step-num {
  font-family: var(--font-ui); font-size: 0.58rem; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--gold); opacity: 0.6; margin-bottom: 0.5rem; display: block;
}
.ceremony-step-title {
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 600;
  color: var(--text); margin-bottom: 0.65rem;
}
.ceremony-step-text {
  font-family: var(--font-display); font-style: italic; font-size: 1rem;
  color: var(--text-muted); line-height: 1.85;
}
.ceremony-closing {
  font-family: var(--font-display); font-size: 1.25rem; font-style: italic;
  color: var(--gold-light); margin-top: 2.5rem; line-height: 1.8;
  border-top: 1px solid rgba(197,160,89,0.2); padding-top: 2.5rem; text-align: center;
}

/* ── TOC — itens novos ── */
.toc-section-label {
  font-family: var(--font-ui); font-size: 0.6rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--gold); opacity: 0.45;
  padding: 0.6rem 1.2rem 0.2rem; display: block; margin-top: 0.5rem;
}

/* ── SEÇÃO CALENDÁRIO ── */
#section-calendar {
  display: none; padding: 4.5rem 3.5rem;
  border-top: 1px solid var(--border);
}
#section-calendar.visible { display: block; animation: fadeIn 0.5s ease; }
.calendar-header-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem;
}
.calendar-month-title {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--gold);
}
.calendar-nav-btn {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  font-size: 1rem; transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.calendar-nav-btn:hover { border-color: var(--gold); color: var(--gold); }
.calendar-instruction {
  font-family: var(--font-display); font-style: italic; font-size: 0.93rem;
  color: var(--text-muted); margin-bottom: 1.8rem; line-height: 1.65;
  padding: 0.9rem 1.2rem; background: rgba(197,160,89,0.04);
  border-left: 3px solid rgba(197,160,89,0.3); border-radius: 0 6px 6px 0;
}
.calendar-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px;
}
.calendar-weekday {
  font-family: var(--font-ui); font-size: 0.6rem; text-align: center;
  color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; padding: 0.3rem 0;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-day {
  aspect-ratio: 1; border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--border); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; transition: all 0.2s; position: relative; min-height: 44px;
}
.calendar-day:hover { border-color: var(--gold); transform: scale(1.06); z-index: 1; }
.calendar-day.empty { background: transparent; border-color: transparent; cursor: default; pointer-events: none; }
.calendar-day-num {
  font-family: var(--font-ui); font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
}
.calendar-day.today .calendar-day-num { color: var(--gold); }
.calendar-day.today { border-color: rgba(197,160,89,0.6); box-shadow: 0 0 0 1px rgba(197,160,89,0.25); }
.calendar-day-phase { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.calendar-day.has-entry { box-shadow: 0 0 0 2px var(--gold), 0 0 8px rgba(197,160,89,0.2); }
.calendar-day.has-entry .calendar-day-num { color: var(--gold); }
.calendar-day-emoji { font-size: 0.72rem; line-height: 1; }

/* ── SEÇÃO JORNADA ── */
#section-journey {
  display: none; border-top: 1px solid var(--border);
}
#section-journey.visible { display: block; animation: fadeIn 0.5s ease; }
.journey-stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; margin: 2rem 0;
}
.journey-stat-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.2rem; text-align: center; transition: border-color 0.2s;
}
.journey-stat-card:hover { border-color: var(--gold); }
.journey-stat-num {
  font-family: var(--font-display); font-size: 2.4rem; font-weight: 300; color: var(--gold);
}
.journey-stat-label {
  font-family: var(--font-ui); font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-dim); margin-top: 0.3rem;
}
.journey-milestones { margin: 2rem 0; }
.journey-milestone {
  display: flex; align-items: center; gap: 1rem; padding: 0.85rem 1rem;
  border-radius: 8px; margin-bottom: 0.6rem;
  background: var(--surface-2); border: 1px solid var(--border); transition: all 0.2s;
}
.journey-milestone.achieved { border-color: rgba(197,160,89,0.4); background: rgba(197,160,89,0.06); }
.journey-milestone-icon { font-size: 1.4rem; }
.journey-milestone-icon.locked { filter: grayscale(1) opacity(0.3); }
.journey-milestone-text { font-family: var(--font-display); font-size: 0.98rem; color: var(--text-muted); flex: 1; }
.journey-milestone.achieved .journey-milestone-text { color: var(--gold-light); }
.journey-milestone-date { font-family: var(--font-ui); font-size: 0.62rem; color: var(--text-dim); }
.energy-chart-wrap { margin: 2.5rem 0; }
.energy-chart-title { font-family: var(--font-display); font-size: 1.2rem; color: var(--gold); margin-bottom: 1rem; }
.energy-chart {
  display: flex; align-items: flex-end; gap: 3px;
  height: 90px; background: rgba(0,0,0,0.2); border-radius: 8px;
  padding: 8px 8px 0; overflow-x: auto; border: 1px solid var(--border);
}
.energy-bar {
  min-width: 14px; flex: 1; border-radius: 3px 3px 0 0;
  background: linear-gradient(to top, var(--primary), var(--gold));
  opacity: 0.72; transition: opacity 0.2s; cursor: pointer;
}
.energy-bar:hover { opacity: 1; }
.energy-bar-empty { min-width: 14px; flex: 1; border-radius: 3px 3px 0 0; background: var(--border); opacity: 0.25; }
.journey-phrase {
  font-family: var(--font-display); font-size: 1.2rem; font-style: italic;
  color: var(--gold-light); text-align: center; margin-top: 2rem;
  padding: 1.5rem; border: 1px solid rgba(197,160,89,0.2);
  border-radius: 8px; background: rgba(197,160,89,0.04); line-height: 1.7;
}

/* ── SEÇÃO BIBLIOTECA ── */
#section-library {
  display: none; border-top: 1px solid var(--border);
}
#section-library.visible { display: block; animation: fadeIn 0.5s ease; }
.library-tab-row { display: flex; gap: 0.5rem; margin-bottom: 1.8rem; flex-wrap: wrap; }
.library-tab {
  padding: 0.5rem 1.3rem; border-radius: 20px; border: 1px solid var(--border);
  background: none; color: var(--text-muted); font-family: var(--font-ui);
  font-size: 0.7rem; letter-spacing: 0.06em; cursor: pointer; transition: all 0.2s;
}
.library-tab:hover { border-color: var(--gold); color: var(--gold); }
.library-tab.active { border-color: var(--gold); color: var(--gold); background: rgba(197,160,89,0.08); }
.library-content { display: none; }
.library-content.active { display: block; }
.library-highlight-item {
  padding: 0.9rem 1rem; border-radius: 6px; margin-bottom: 0.7rem;
  font-family: var(--font-display); font-style: italic; font-size: 0.98rem;
  color: var(--text-muted); border-left: 3px solid; line-height: 1.72;
  background: rgba(0,0,0,0.15);
}
.library-highlight-item.color-gold   { border-color: var(--gold);    background: rgba(197,160,89,0.06); }
.library-highlight-item.color-purple { border-color: #8B5CF6;         background: rgba(139,92,246,0.06); }
.library-highlight-item.color-pink   { border-color: #EC4899;         background: rgba(236,72,153,0.06); }
.library-highlight-item.color-green  { border-color: var(--maiden);   background: rgba(16,185,129,0.06); }
.library-note-item {
  padding: 1rem 1.1rem; border-radius: 8px; margin-bottom: 0.8rem;
  background: var(--surface-2); border: 1px solid var(--border);
}
.library-note-date {
  font-family: var(--font-ui); font-size: 0.6rem; color: var(--text-dim);
  letter-spacing: 0.08em; margin-bottom: 0.4rem; text-transform: uppercase;
}
.library-note-text {
  font-family: var(--font-display); font-size: 0.96rem; color: var(--text-muted); line-height: 1.72;
}
.library-empty {
  text-align: center; padding: 3rem 1rem;
  font-family: var(--font-display); font-style: italic; color: var(--text-dim); font-size: 1rem;
}
.library-export-btn {
  display: inline-block; margin-top: 1.5rem; padding: 0.7rem 2rem;
  background: none; border: 1px solid var(--gold); color: var(--gold);
  border-radius: 50px; font-family: var(--font-ui); font-size: 0.73rem;
  font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer; transition: all 0.3s; min-height: 44px;
}
.library-export-btn:hover { background: rgba(197,160,89,0.12); }

/* ── MODAL CALENDÁRIO (REGISTRO DO DIA REAL) ── */
.cal-modal-date {
  font-family: var(--font-ui); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold); opacity: 0.75; margin-bottom: 1.4rem;
}
.cal-practices-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.5rem;
}
.cal-practice-chk {
  display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
  font-family: var(--font-ui); font-size: 0.76rem; color: var(--text-muted);
}
.cal-practice-chk input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px;
  border: 1px solid var(--border-light); border-radius: 3px; cursor: pointer;
  flex-shrink: 0; position: relative; transition: all 0.2s;
}
.cal-practice-chk input[type="checkbox"]:checked { background: var(--gold); border-color: var(--gold); }
.cal-practice-chk input[type="checkbox"]:checked::after {
  content: "✓"; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%); color: var(--bg); font-size: 0.52rem; font-weight: 900;
}

/* ── MODAL QUESTIONÁRIO MENSAL ── */
#monthly-quiz-modal {
  display: none; position: fixed; inset: 0; z-index: 9100;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
  align-items: flex-start; justify-content: center; padding: 1.5rem;
  overflow-y: auto;
}
#monthly-quiz-modal.open { display: flex; }
.monthly-quiz-box {
  background: #111827; border: 1px solid var(--gold);
  border-radius: 20px; padding: 2.5rem; max-width: 580px; width: 100%;
  box-shadow: 0 40px 100px rgba(0,0,0,0.9); margin: auto;
  animation: fadeIn 0.5s ease;
}
.monthly-quiz-title {
  font-family: var(--font-display); font-size: 1.85rem; font-weight: 600;
  color: var(--gold); text-align: center; margin-bottom: 0.4rem;
}
.monthly-quiz-subtitle {
  font-family: var(--font-display); font-size: 0.98rem; font-style: italic;
  color: var(--text-muted); text-align: center; margin-bottom: 2rem; line-height: 1.6;
}
.monthly-quiz-field { margin-bottom: 1.6rem; }
.monthly-quiz-field label {
  display: block; font-family: var(--font-ui); font-size: 0.7rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 0.5rem;
}
.phase-btn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.phase-choice-btn {
  padding: 0.62rem 0.8rem; border-radius: 8px; border: 1px solid var(--border);
  background: none; color: var(--text-muted); font-family: var(--font-ui);
  font-size: 0.7rem; cursor: pointer; transition: all 0.2s; text-align: center; min-height: 44px;
}
.phase-choice-btn:hover { border-color: var(--gold); color: var(--gold); }
.phase-choice-btn.sel-maiden { border-color: var(--maiden); color: var(--maiden); background: rgba(16,185,129,0.08); }
.phase-choice-btn.sel-mother { border-color: var(--mother); color: var(--mother); background: rgba(245,158,11,0.08); }
.phase-choice-btn.sel-witch  { border-color: var(--witch);  color: var(--witch);  background: rgba(239,68,68,0.08); }
.phase-choice-btn.sel-crone  { border-color: var(--crone);  color: var(--crone);  background: rgba(99,102,241,0.08); }
.monthly-save-btn {
  width: 100%; padding: 1rem; background: rgba(197,160,89,0.1);
  border: 1px solid var(--gold); color: var(--gold);
  border-radius: 50px; font-family: var(--font-ui); font-size: 0.78rem;
  font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  cursor: pointer; margin-top: 0.5rem; transition: all 0.3s; min-height: 48px;
}
.monthly-save-btn:hover { background: rgba(197,160,89,0.22); }

/* ── HISTÓRICO DE INSIGHTS ── */
#section-insights {
  display: none; padding: 4.5rem 3.5rem; border-top: 1px solid var(--border);
}
#section-insights.visible { display: block; animation: fadeIn 0.5s ease; }
.insight-history-item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.2rem 1.4rem; margin-bottom: 1rem;
  border-left: 3px solid var(--gold);
}
.insight-history-date {
  font-family: var(--font-ui); font-size: 0.6rem; color: var(--text-dim);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.4rem;
}
.insight-history-text {
  font-family: var(--font-display); font-style: italic; font-size: 0.98rem;
  color: var(--text-muted); line-height: 1.75;
}

/* ── Tooltips da barra de ferramentas ── */
.htip-wrap {
  position: relative;
  display: inline-flex;
}
.htip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  white-space: nowrap;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--gold-dark);
  pointer-events: none;
  z-index: 9999;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.htip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--gold-dark);
}
.htip-wrap:hover .htip,
.htip-wrap:focus-within .htip {
  display: block;
}

/* ── Slider legend ── */
.slider-legend {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
  letter-spacing: 0.03em;
}

/* ── Input hint ── */
.input-hint {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

/* ── Biblioteca — botão PDF + export row ── */
.library-export-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}
.library-export-btn.pdf {
  background: linear-gradient(135deg, #8B6914, var(--gold));
  color: #0B0F19;
  font-weight: 700;
}
.library-export-btn.pdf:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
}

/* ── Jornada — gráfico com humor ── */
.energy-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
  height: 100%;
  gap: 2px;
}
.energy-bar-mood {
  font-size: 0.6rem;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chart-axis-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

/* Gráfico mensal ── */
.monthly-energy-chart-wrap {
  margin-top: 1.5rem;
}
.monthly-energy-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100px;
  padding: 0.5rem 0 0;
  border-bottom: 1px solid var(--border-light);
}
.monthly-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}
.monthly-bar {
  width: 100%;
  max-width: 32px;
  background: linear-gradient(to top, var(--primary), var(--gold));
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
}
.monthly-bar-label {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 4px;
  text-align: center;
}
.monthly-bar-avg {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  color: var(--gold);
  text-align: center;
}

/* Marcos — locked label ── */
.locked-label {
  color: var(--text-dim);
  font-size: 0.6rem;
  font-style: italic;
}

/* ── Responsivo global novas seções ── */
@media (max-width: 700px) {
  #section-calendar, #section-journey, #section-library,
  #section-insights { padding: 3rem 1.5rem; }
  .ceremony-inner { padding: 3rem 1.4rem 5rem; }
  .cal-practices-grid { grid-template-columns: 1fr; }
  .journey-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .monthly-quiz-box { padding: 1.8rem 1.4rem; }
  .library-export-row { flex-direction: column; }

  /* Calendário: zera padding lateral do inner div (inline style)
     para não acumular com o padding já dado ao container externo */
  #section-calendar > span {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  #section-calendar > div {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Jornada / Biblioteca: reduz padding lateral do inner div */
  #section-journey > div,
  #section-library > div {
    padding-left: 0.2rem !important;
    padding-right: 0.2rem !important;
  }

  /* Calendário: cabeçalho ‹ Mês Ano › numa linha, centralizado */
  .calendar-header-row {
    gap: 0.6rem;
  }
  .calendar-month-title {
    flex: 1;
    text-align: center;
    font-size: 1.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .calendar-nav-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
  }

  /* Grade do calendário: sem overflow lateral */
  .calendar-weekdays,
  .calendar-grid {
    width: 100%;
    box-sizing: border-box;
  }
  .calendar-day { min-height: 40px; }
}

@media (max-width: 480px) {
  .cover-time { font-size: 1.8rem; }
  .phase-btn-grid { grid-template-columns: 1fr 1fr; }

  /* Cards da Jornada menores em telas muito pequenas */
  .journey-stat-grid { gap: 0.5rem; }
  .journey-stat-card { padding: 0.9rem 0.6rem; }
  .journey-stat-num { font-size: 2rem; }
  .journey-stat-label { font-size: 0.58rem; }

  /* Calendário em telas menores que 480px */
  .calendar-day { min-height: 36px; }
  .calendar-day-num { font-size: 0.68rem; }
  .calendar-weekday { font-size: 0.55rem; }
  .calendar-grid { gap: 3px; }
  .calendar-weekdays { gap: 3px; }
}
