/* ============================================================
   Lumen Fé — Design System
   Paleta: azul-noite + dourado, inspirada em vitrais e ouro sacro
   ============================================================ */

:root {
  --navy-950: #0a0f26;
  --navy-900: #0f1638;
  --navy-800: #172152;
  --navy-700: #202c68;
  --navy-600: #2c3a82;
  --gold-600: #b6862c;
  --gold-500: #d4af37;
  --gold-400: #e8c766;
  --gold-300: #f3dd9a;
  --gold-100: #fbf1d8;
  --cream: #faf6ec;
  --paper: #fffdf7;
  --ink: #1b1f2e;
  --ink-soft: #4a4f66;
  --white: #ffffff;

  --season-advento: #5b3f8f;
  --season-natal: #c79a2e;
  --season-comum: #2f7d5a;
  --season-quaresma: #6b3fa0;
  --season-pascoa: #c7972e;
  --season-vermelho: #9c2b2b;

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-soft: 0 10px 30px -12px rgba(10, 15, 38, 0.35);
  --shadow-card: 0 4px 18px -6px rgba(10, 15, 38, 0.18);

  --font-display: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino, serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; }
a { color: inherit; }
::selection { background: var(--gold-300); }

/* ---------- App shell ---------- */
#app[hidden], .auth-screen[hidden] { display: none; }
#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 60px rgba(10,15,38,0.08);
}
.app-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.app-header {
  background: linear-gradient(160deg, var(--navy-900), var(--navy-700) 65%, var(--navy-800));
  color: var(--gold-100);
  padding: 18px 18px 22px;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 2px solid var(--gold-500);
}
.app-header .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.3px;
}
.brand .flame {
  width: 30px; height: 30px;
  filter: drop-shadow(0 0 6px rgba(212,175,55,0.6));
}
.header-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(232,199,102,0.4);
  background: rgba(255,255,255,0.06);
  color: var(--gold-300);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn:active { transform: scale(0.94); }

.back-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.back-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(232,199,102,0.35);
  color: var(--gold-200, var(--gold-300));
  border-radius: 999px;
  padding: 6px 14px 6px 10px;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer;
  font-size: 13px;
}
.header-title {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 2px 0 2px;
}
.header-sub { font-size: 13px; color: var(--gold-300); opacity: 0.9; }

/* ---------- Main content ---------- */
main#view {
  flex: 1;
  padding: 16px 16px 96px;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px);} to { opacity:1; transform:none; } }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 30;
  background: var(--navy-900);
  border-top: 2px solid var(--gold-500);
  display: flex;
  justify-content: space-around;
  padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
}
.nav-item {
  background: none; border: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: rgba(255,255,255,0.55);
  padding: 6px 4px;
  cursor: pointer;
  flex: 1;
  font-size: 10.5px;
  border-radius: 10px;
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item.active { color: var(--gold-400); }
.nav-item.active svg { filter: drop-shadow(0 0 5px rgba(212,175,55,0.7)); }

/* ---------- Cards & sections ---------- */
.section-title {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--navy-800);
  margin: 22px 0 10px;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: 0.2px;
}
.section-title:first-child { margin-top: 4px; }
.section-title .bar { width: 4px; height: 16px; background: var(--gold-500); border-radius: 3px; }

.card {
  background: var(--paper);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(23,33,82,0.06);
  padding: 16px;
}

.hero-card {
  background: linear-gradient(150deg, var(--navy-900), var(--navy-700));
  color: var(--gold-100);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.hero-card::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 85% -10%, rgba(212,175,55,0.35), transparent 55%);
  pointer-events: none;
}
.hero-date { font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--gold-300); }
.hero-verse { font-family: var(--font-display); font-size: 18px; line-height: 1.5; margin: 8px 0 4px; }
.hero-ref { font-size: 12.5px; color: rgba(255,255,255,0.7); }

.season-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 5px 11px; border-radius: 999px;
  font-size: 12px; margin-top: 12px;
}
.season-dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }

.grid-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.link-tile {
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(23,33,82,0.06);
  cursor: pointer;
  text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 96px;
  justify-content: space-between;
  position: relative;
  transition: transform 0.12s ease;
}
.link-tile:active { transform: scale(0.97); }
.link-tile .tile-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--navy-800), var(--navy-700));
  color: var(--gold-400);
}
.link-tile .tile-icon svg { width: 19px; height: 19px; }
.link-tile .tile-title { font-weight: 700; font-size: 13.5px; color: var(--navy-900); }
.link-tile .tile-sub { font-size: 11px; color: var(--ink-soft); }

.saint-preview {
  display: flex; gap: 12px; align-items: center;
  margin-top: 10px;
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  border: 1px solid rgba(23,33,82,0.06);
}
.saint-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(150deg, var(--gold-400), var(--gold-600));
  display: flex; align-items: center; justify-content: center;
  color: var(--navy-900);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--gold-400);
}
.saint-avatar svg { width: 26px; height: 26px; }
.saint-preview .name { font-weight: 700; font-size: 14.5px; color: var(--navy-900); font-family: var(--font-display); }
.saint-preview .feast { font-size: 11.5px; color: var(--gold-600); }
.saint-preview .teaser { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 999px;
  padding: 12px 20px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: linear-gradient(150deg, var(--gold-400), var(--gold-600)); color: var(--navy-950); }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost { background: rgba(23,33,82,0.06); color: var(--navy-800); }
.btn-outline { background: transparent; border: 1.5px solid var(--gold-500); color: var(--gold-600); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Chips / tabs ---------- */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -ms-overflow-style: none; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid rgba(23,33,82,0.12);
  color: var(--navy-800);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active { background: var(--navy-900); border-color: var(--navy-900); color: var(--gold-300); }

/* ---------- Prayer list ---------- */
.prayer-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(23,33,82,0.08);
  cursor: pointer;
}
.prayer-row:last-child { border-bottom: none; }
.prayer-row .ptitle { font-weight: 600; font-size: 14px; color: var(--navy-900); }
.prayer-row .pmeta { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
.fav-btn { background: none; border: none; color: var(--gold-500); cursor: pointer; padding: 6px; }
.fav-btn svg { width: 19px; height: 19px; }

.prayer-text {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
  white-space: pre-line;
}

/* ---------- Rosary ---------- */
.bead-track {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 14px 0;
}
.bead {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(23,33,82,0.15);
  transition: all 0.2s ease;
}
.bead.big { width: 20px; height: 20px; }
.bead.done { background: var(--gold-500); box-shadow: 0 0 6px rgba(212,175,55,0.7); }
.bead.current { background: var(--navy-800); transform: scale(1.3); box-shadow: 0 0 0 3px var(--gold-300); }

.rosary-stage {
  text-align: center;
  padding: 22px 14px 26px;
}
.rosary-mystery-title { font-family: var(--font-display); font-size: 19px; color: var(--navy-900); margin-bottom: 6px; }
.rosary-step-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--gold-600); font-weight: 700; }
.rosary-count { font-size: 46px; font-weight: 800; color: var(--navy-900); margin: 8px 0; font-family: var(--font-display); }
.rosary-meditation { font-size: 14px; color: var(--ink-soft); line-height: 1.6; margin: 10px auto 0; max-width: 380px; }
.tap-circle {
  width: 168px; height: 168px; border-radius: 50%;
  margin: 18px auto 6px;
  background: radial-gradient(circle at 35% 30%, var(--navy-700), var(--navy-950));
  border: 3px solid var(--gold-500);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-200, var(--gold-300));
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px -10px rgba(10,15,38,0.5);
  user-select: none;
}
.tap-circle:active { transform: scale(0.96); }
.rosary-controls { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }

/* ---------- Calendar ---------- */
.calendar-month-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.calendar-month-head .mtitle { font-family: var(--font-display); font-size: 18px; color: var(--navy-900); }
.event-row {
  display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid rgba(23,33,82,0.08);
}
.event-row:last-child { border-bottom: none; }
.event-date-badge {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--navy-900); color: var(--gold-300);
}
.event-date-badge .d { font-size: 16px; font-weight: 800; line-height: 1; }
.event-date-badge .m { font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.5px; }
.event-row .etitle { font-weight: 700; font-size: 13.5px; color: var(--navy-900); }
.event-row .esub { font-size: 11.5px; color: var(--ink-soft); }
.event-color-tag { display: inline-flex; align-items:center; gap:5px; font-size: 10.5px; margin-top: 3px; color: var(--ink-soft); }
.event-color-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Catechism ---------- */
.catechism-topic {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; margin-bottom: 10px;
  background: var(--paper); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); border: 1px solid rgba(23,33,82,0.06);
  cursor: pointer;
}
.catechism-topic .tico {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(150deg, var(--navy-800), var(--navy-600));
  display: flex; align-items: center; justify-content: center; color: var(--gold-400);
}
.catechism-topic .tico svg { width: 22px; height: 22px; }
.catechism-topic .ttitle { font-weight: 700; font-size: 14.5px; color: var(--navy-900); }
.catechism-topic .tsub { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
.progress-pill {
  font-size: 10px; font-weight: 700; color: var(--gold-600);
  background: var(--gold-100); padding: 3px 8px; border-radius: 999px; margin-top: 4px; display: inline-block;
}

.toggle-row { display: flex; gap: 8px; margin: 14px 0; }
.toggle-btn {
  flex: 1; padding: 9px; border-radius: 10px; border: 1px solid rgba(23,33,82,0.15);
  background: var(--white); font-size: 12.5px; font-weight: 600; color: var(--navy-800); cursor: pointer;
}
.toggle-btn.active { background: var(--navy-900); color: var(--gold-300); border-color: var(--navy-900); }

.quiz-card { margin-top: 10px; }
.quiz-question { font-family: var(--font-display); font-size: 16px; color: var(--navy-900); margin-bottom: 12px; }
.quiz-option {
  display: block; width: 100%; text-align: left;
  padding: 12px 14px; margin-bottom: 8px;
  border-radius: 12px; border: 1.5px solid rgba(23,33,82,0.14);
  background: var(--white); font-size: 13.5px; color: var(--ink); cursor: pointer;
}
.quiz-option.correct { border-color: var(--season-comum); background: #eaf6ef; color: #1e5f42; }
.quiz-option.wrong { border-color: var(--season-vermelho); background: #fbecec; color: #8a2323; }
.quiz-explain { font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; background: var(--gold-100); padding: 10px 12px; border-radius: 10px; }
.quiz-progress { font-size: 12px; color: var(--ink-soft); margin-bottom: 4px; }

/* ---------- Empty / misc ---------- */
.muted { color: var(--ink-soft); font-size: 13px; }
.divider { height: 1px; background: rgba(23,33,82,0.08); margin: 16px 0; }
.badge-new { background: var(--gold-500); color: var(--navy-950); font-size: 9.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; letter-spacing: 0.3px; }
.streak-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--gold-100); margin-top: 10px; }
.streak-row svg { width: 16px; height: 16px; color: var(--gold-400); }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: var(--navy-950); color: var(--gold-200, var(--gold-300));
  padding: 10px 18px; border-radius: 999px; font-size: 13px;
  box-shadow: var(--shadow-soft); z-index: 60; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
.clickable { cursor: pointer; }

/* ---------- Modal (versículo / palavra de fé) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10,15,38,0.6);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  animation: overlayIn 0.2s ease;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
  width: 100%; max-width: 560px;
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  max-height: 86vh; overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(10,15,38,0.35);
  animation: sheetUp 0.25s ease;
  position: relative;
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(23,33,82,0.08); border: none; color: var(--navy-800);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.modal-close svg { width: 15px; height: 15px; }
.modal-kicker { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--gold-600); font-weight: 700; margin-bottom: 8px; }
.modal-verse { font-family: var(--font-display); font-size: 20px; line-height: 1.5; color: var(--navy-900); margin: 4px 0 6px; }
.modal-ref { font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.modal-message { font-size: 13.5px; color: var(--ink-soft); background: var(--gold-100); padding: 12px 14px; border-radius: 12px; margin-top: 12px; line-height: 1.5; }

.area-chip-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  margin: 14px 0 4px;
}
.area-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 10px; border-radius: 12px;
  border: 1.5px solid rgba(23,33,82,0.1);
  background: var(--white); cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--navy-800);
  text-align: left;
}
.area-chip svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--gold-600); }
.area-chip.active { background: var(--navy-900); border-color: var(--navy-900); color: var(--gold-200, var(--gold-300)); }
.area-chip.active svg { color: var(--gold-400); }

/* ---------- Month calendar grid ---------- */
.month-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 12px;
}
.month-nav .mtitle { font-family: var(--font-display); font-size: 18px; color: var(--navy-900); text-transform: capitalize; }
.month-nav-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--white); border: 1px solid rgba(23,33,82,0.12);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--navy-800);
}
.month-nav-btn svg { width: 15px; height: 15px; }
.weekday-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.weekday-row div { text-align: center; font-size: 10px; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day-cell {
  aspect-ratio: 1; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--navy-800); cursor: pointer;
  background: var(--white); border: 1px solid rgba(23,33,82,0.06);
  position: relative; gap: 2px;
}
.day-cell.empty { visibility: hidden; cursor: default; }
.day-cell.today { border: 1.5px solid var(--gold-500); font-weight: 800; }
.day-cell.selected { background: var(--navy-900); color: var(--gold-200, var(--gold-300)); }
.day-cell .mark { width: 5px; height: 5px; border-radius: 50%; background: var(--gold-500); }
.day-cell.selected .mark { background: var(--gold-400); }
.day-detail { margin-top: 14px; }

/* ---------- Bible reader ---------- */
.testament-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.testament-tab {
  flex: 1; padding: 10px; text-align: center; border-radius: 12px;
  background: var(--white); border: 1px solid rgba(23,33,82,0.12);
  font-size: 12.5px; font-weight: 700; color: var(--navy-800); cursor: pointer;
}
.testament-tab.active { background: var(--navy-900); border-color: var(--navy-900); color: var(--gold-300); }
.search-row { display: flex; gap: 8px; margin-bottom: 14px; }
.search-input {
  flex: 1; padding: 11px 14px; border-radius: 999px; border: 1px solid rgba(23,33,82,0.15);
  font-size: 13.5px; background: var(--white); color: var(--ink);
}
.search-input:focus { outline: 2px solid var(--gold-400); }
.book-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 4px; border-bottom: 1px solid rgba(23,33,82,0.08); cursor: pointer;
}
.book-row:last-child { border-bottom: none; }
.book-row .bname { font-weight: 600; font-size: 14px; color: var(--navy-900); }
.book-row .bmeta { font-size: 11px; color: var(--ink-soft); }
.chapter-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.chapter-cell {
  aspect-ratio: 1; border-radius: 10px; background: var(--white);
  border: 1px solid rgba(23,33,82,0.1); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--navy-800); cursor: pointer;
}
.chapter-cell:active { background: var(--navy-900); color: var(--gold-300); }
.bible-verse-list { font-family: var(--font-display); font-size: 17px; line-height: 1.9; color: var(--ink); }
.bible-verse-list .vnum { color: var(--gold-600); font-weight: 700; font-size: 12px; vertical-align: super; margin-right: 3px; }
.bible-loading, .bible-error { text-align: center; padding: 40px 16px; color: var(--ink-soft); font-size: 14px; }
.chapter-nav { display: flex; gap: 10px; margin-top: 18px; }

/* ---------- AI Tools ---------- */
.tool-tab-nav { position: relative; margin-bottom: 16px; }
.tool-tab-row {
  display: flex; gap: 6px; overflow-x: auto; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; touch-action: pan-x;
  -ms-overflow-style: none; scrollbar-width: none; padding: 2px 2px 4px;
}
.tool-tab-row::-webkit-scrollbar { display: none; }
.tool-tab-nav::before, .tool-tab-nav::after {
  content: ""; position: absolute; top: 0; bottom: 4px; width: 28px; pointer-events: none; z-index: 1;
}
.tool-tab-nav::before { left: 0; background: linear-gradient(90deg, var(--cream), transparent); }
.tool-tab-nav::after { right: 0; background: linear-gradient(270deg, var(--cream), transparent); }
.tool-tab-scroll-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; z-index: 2;
  background: var(--white); border: 1px solid rgba(23,33,82,0.15);
  color: var(--navy-800); display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-card);
}
.tool-tab-scroll-btn svg { width: 13px; height: 13px; }
.tool-tab-scroll-btn.left { left: 2px; }
.tool-tab-scroll-btn.right { right: 2px; }
.tool-tab {
  flex: 0 0 auto; width: 152px;
  padding: 8px 12px; border-radius: 12px;
  background: var(--white); border: 1px solid rgba(23,33,82,0.12);
  cursor: pointer; text-align: left;
}
.tool-tab .tnum { font-size: 10px; font-weight: 800; color: var(--gold-600); letter-spacing: 0.5px; }
.tool-tab .tlabel { font-size: 11.5px; font-weight: 700; color: var(--navy-800); margin-top: 2px; line-height: 1.3; white-space: normal; }
.tool-tab.active { background: var(--navy-900); border-color: var(--navy-900); }
.tool-tab.active .tnum { color: var(--gold-400); }
.tool-tab.active .tlabel { color: var(--gold-100); }

.tool-window {
  background: var(--navy-950);
  border-radius: var(--radius-lg);
  padding: 0 0 18px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
}
.tool-window-bar { display: flex; gap: 6px; padding: 12px 14px; }
.tool-window-bar span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.18); }
.tool-window-bar span:first-child { background: var(--gold-500); }
.tool-window-body { padding: 4px 18px 0; }
.tool-field { margin-bottom: 14px; }
.tool-field label { display: block; font-size: 11.5px; color: rgba(255,255,255,0.6); margin-bottom: 6px; }
.tool-field input {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; font-size: 13.5px;
}
.tool-field input::placeholder { color: rgba(255,255,255,0.35); }
.tool-field input:focus { outline: none; border-color: var(--gold-500); }
.tool-generate-btn {
  width: 100%; margin-top: 4px;
  background: linear-gradient(150deg, var(--gold-400), var(--gold-600));
  color: var(--navy-950); font-weight: 800; font-size: 13px;
  border: none; border-radius: 12px; padding: 13px; cursor: pointer;
  letter-spacing: 0.3px; text-transform: uppercase;
}

.tool-desc-card { background: var(--paper); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-card); border: 1px solid rgba(23,33,82,0.06); }
.tool-desc-kicker { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--gold-600); text-transform: uppercase; margin-bottom: 6px; }
.tool-desc-title { font-family: var(--font-display); font-size: 21px; color: var(--navy-900); margin-bottom: 8px; }
.tool-desc-sub { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 14px; }
.tool-benefit { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 9px; font-size: 13px; color: var(--navy-800); }
.tool-benefit svg { width: 16px; height: 16px; color: var(--season-comum); flex-shrink: 0; margin-top: 1px; }
.tool-result-box { background: var(--gold-100); border-radius: 12px; padding: 12px 14px; margin-top: 14px; font-size: 12.5px; color: var(--navy-900); line-height: 1.5; }
.tool-result-box strong { color: var(--gold-600); }

@media (min-width: 700px) {
  .tool-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  .tool-window { margin-bottom: 0; }
}

/* ---------- Espaço Infantil ---------- */
.kids-hero {
  background: linear-gradient(150deg, #2b6cb0, #4299e1 60%, #63b3ed);
  color: #fff; border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-soft); position: relative; overflow: hidden;
}
.kids-hero .khtitle { font-family: var(--font-display); font-size: 20px; margin-bottom: 4px; }
.kids-hero .khsub { font-size: 13px; opacity: 0.9; }

.kids-tab-row { display: flex; gap: 8px; margin: 16px 0; }
.kids-tab {
  flex: 1; padding: 11px; border-radius: 14px; text-align: center;
  background: var(--white); border: 1.5px solid rgba(23,33,82,0.1);
  font-size: 12.5px; font-weight: 700; color: var(--navy-800); cursor: pointer;
}
.kids-tab.active { background: #2b6cb0; border-color: #2b6cb0; color: #fff; }

.story-tile {
  display: flex; gap: 14px; align-items: center;
  background: var(--paper); border-radius: var(--radius-md); padding: 14px;
  box-shadow: var(--shadow-card); border: 1px solid rgba(23,33,82,0.06);
  margin-bottom: 10px; cursor: pointer;
}
.story-emoji-badge {
  width: 52px; height: 52px; border-radius: 16px; flex-shrink: 0;
  background: linear-gradient(150deg, #fbd38d, #f6ad55);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.story-tile .stitle { font-weight: 700; font-size: 14.5px; color: var(--navy-900); }
.story-tile .sage { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

.story-reader-emoji { font-size: 64px; text-align: center; margin: 6px 0 10px; }
.story-text { font-family: var(--font-display); font-size: 16px; line-height: 1.85; color: var(--ink); white-space: pre-line; }

.game-tile {
  display: flex; gap: 14px; align-items: center;
  background: linear-gradient(150deg, #fff, #fef6e4);
  border-radius: var(--radius-md); padding: 16px;
  box-shadow: var(--shadow-card); border: 1px solid rgba(23,33,82,0.06);
  margin-bottom: 12px; cursor: pointer;
}
.game-tile .gicon {
  width: 52px; height: 52px; border-radius: 16px; flex-shrink: 0;
  background: linear-gradient(150deg, #f6ad55, #dd6b20);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.game-tile .gicon svg { width: 26px; height: 26px; }
.game-tile .gtitle { font-weight: 800; font-size: 14.5px; color: var(--navy-900); }
.game-tile .gsub { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }

.memory-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.memory-stat { font-size: 12.5px; color: var(--ink-soft); }
.memory-stat strong { color: var(--navy-900); }
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
/* ---------------- Kids video embed ---------------- */
.video-embed-wrap {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius-md); overflow: hidden;
  background: #000; box-shadow: var(--shadow-card);
}
.video-embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------------- Install card ---------------- */
.install-card {
  background: var(--paper);
  border: 1.5px solid var(--gold-400);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 14px 0;
}
.install-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.install-card-title { font-weight: 800; font-size: 14.5px; color: var(--navy-900); }
.install-card-close {
  border: none; background: var(--cream); color: var(--ink-soft);
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.install-card-text { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin: 8px 0 12px; }
.install-steps { display: flex; flex-direction: column; gap: 12px; }
.install-step-group { background: var(--cream); border-radius: var(--radius-sm); padding: 10px 12px; }
.install-step-label { font-weight: 700; font-size: 13px; color: var(--gold-600); margin-bottom: 4px; }
.install-step-group ol { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink); line-height: 1.6; }

/* ---------------- Auth ---------------- */
.auth-screen {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--navy-950), var(--navy-700) 65%, var(--navy-800));
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 28px 24px;
  border: 1px solid var(--gold-300);
}
.auth-brand {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--navy-900); text-align: center;
}
.auth-sub { font-size: 13.5px; color: var(--ink-soft); text-align: center; margin: 6px 0 20px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-label { font-size: 12.5px; font-weight: 700; color: var(--navy-800); display: flex; flex-direction: column; gap: 6px; }
.auth-input {
  font-family: inherit; font-size: 15px; font-weight: 400;
  padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1.5px solid #d8d2c0; background: var(--white); color: var(--ink);
}
.auth-input:focus { outline: none; border-color: var(--gold-500); }
.auth-error {
  font-size: 12.5px; color: #9c2b2b; background: #fbeaea;
  border-radius: var(--radius-sm); padding: 9px 11px;
}
.auth-submit {
  margin-top: 4px; padding: 12px; border: none; border-radius: var(--radius-sm);
  background: linear-gradient(150deg, var(--gold-400), var(--gold-600));
  color: var(--navy-900); font-weight: 800; font-size: 15px; cursor: pointer;
}
.auth-submit:disabled { opacity: 0.7; cursor: default; }
.auth-help { font-size: 11.5px; color: var(--ink-soft); text-align: center; margin: 16px 0 0; line-height: 1.5; }

.memory-card {
  aspect-ratio: 1; border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: linear-gradient(150deg, var(--navy-800), var(--navy-950));
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease;
}
.memory-card.flipped, .memory-card.matched { background: var(--white); border: 1.5px solid rgba(23,33,82,0.1); }
.memory-card.matched { background: #eaf6ef; border-color: var(--season-comum); opacity: 0.75; }
.memory-win { text-align: center; padding: 20px; }

@media (min-width: 700px) { .memory-grid { grid-template-columns: repeat(8, 1fr); max-width: 520px; margin: 0 auto; } }

/* ---------- Responsive: tablet & desktop ---------- */
@media (min-width: 561px) and (max-width: 899px) {
  #app { max-width: 640px; }
  .grid-links { grid-template-columns: repeat(3, 1fr); }
  .area-chip-grid { grid-template-columns: repeat(3, 1fr); }
  .chapter-grid { grid-template-columns: repeat(8, 1fr); }
}

@media (min-width: 900px) {
  body { background: var(--navy-950); }
  #app {
    max-width: none; width: 100%; min-height: 100vh;
    flex-direction: row; box-shadow: none;
  }
  .app-main {
    flex: 1; display: flex; flex-direction: column;
    max-width: 720px; margin: 0 auto; min-height: 100vh;
    background: var(--cream);
    box-shadow: 0 0 60px rgba(0,0,0,0.25);
  }
  .bottom-nav {
    order: -1; position: sticky; top: 0; align-self: flex-start;
    width: 108px; height: 100vh;
    flex-direction: column; justify-content: flex-start; gap: 10px;
    padding: 28px 8px; border-top: none; border-right: 2px solid var(--gold-500);
  }
  .nav-item { flex: 0 0 auto; width: 100%; padding: 10px 4px; }
  .nav-item svg { width: 24px; height: 24px; }
  .grid-links { grid-template-columns: repeat(4, 1fr); }
  .area-chip-grid { grid-template-columns: repeat(4, 1fr); }
  .chapter-grid { grid-template-columns: repeat(8, 1fr); }
  main#view { padding: 24px 28px 60px; }
  .app-header { padding: 22px 28px 26px; }
  .modal-overlay { align-items: center; }
  .modal-sheet { border-radius: 24px; max-height: 80vh; }
}
