/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../node_modules/.pnpm/next@15.5.15_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!../../node_modules/.pnpm/next@15.5.15_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./src/app/globals.css ***!
  \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
:root {
  --bg: #0b0b14;
  --bg-card: #14142a;
  --ink: #f5f0e1;
  --ink-soft: #c2bca8;
  --accent: #f3a953;
  --accent-soft: #d68b3a;
  --danger: #c75551;
  --good: #6aaa64;
  --radius: 14px;
  /* Player/book theme */
  --paper: #f3ead4;
  --paper-shade: #e6dab9;
  --paper-ink: #2a1f10;
  --paper-ink-soft: #6b5a3a;
  --binding: #6b3a18;
  --vt-duration: 420ms;
  --vt-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  height: 100%;
}

body { min-height: 100vh; min-height: 100dvh; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font: inherit;
  background: var(--accent);
  color: #1a1209;
  border: 0;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink-soft); }
button.danger { background: var(--danger); color: white; }
button.good { background: var(--good); color: white; }

input, textarea, select {
  font: inherit;
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid #2a2a44;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }

.container { max-width: 720px; margin: 0 auto; padding: 1.5rem; }
.card { background: var(--bg-card); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1rem; }
.muted { color: var(--ink-soft); font-size: 0.9rem; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 0.75rem; align-items: center; }
.row > * { flex: 1 1; }
h1, h2, h3 { font-weight: 700; line-height: 1.2; margin-bottom: 0.5rem; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; color: var(--ink-soft); }

/* ── Landing page ────────────────────────────────────────────────── */
.landing { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }
.landing section { padding: 3.5rem 0; border-bottom: 1px solid #1c1c34; }
.landing section:last-of-type { border-bottom: 0; }
.landing h1 {
  font-size: clamp(1.9rem, 5.5vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  max-width: 22ch;
}
.landing h2 {
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}
.landing .lede {
  font-size: clamp(1.05rem, 2.3vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 1.25rem 0 1.75rem;
  line-height: 1.55;
}
.landing .badge {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(243, 169, 83, 0.12);
  color: var(--accent);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(243, 169, 83, 0.3);
  margin-bottom: 1.25rem;
}
.landing .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.landing button.big {
  padding: 0.95rem 1.6rem;
  font-size: 1.05rem;
}

/* Hero */
.landing .hero {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 2.5rem;
  gap: 2.5rem;
  align-items: center;
  padding-top: 1.5rem;
}
@media (min-width: 880px) {
  .landing .hero { grid-template-columns: 1.1fr 1fr; gap: 3.5rem; }
}
.landing .hero-image {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
  background: var(--bg-card);
  aspect-ratio: 880 / 1184;
  max-height: 70vh;
}
.landing .hero-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.landing .hero-image::after {
  content: 'Theo, page 1';
  position: absolute;
  bottom: 0.9rem; left: 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  background: rgba(0,0,0,0.55);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: #fff;
}

/* Differentiator strip */
.landing .strip {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 1.25rem;
  gap: 1.25rem;
}
@media (min-width: 720px) {
  .landing .strip { grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
}
.landing .strip article {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid #1c1c34;
}
.landing .strip h3 {
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.landing .strip p { color: var(--ink-soft); font-size: 0.95rem; }

/* Sample carousel */
.landing .carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 320px);
  grid-gap: 1rem;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  margin: 0 -1.25rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  scrollbar-width: thin;
}
.landing .carousel figure {
  scroll-snap-align: start;
  background: var(--bg-card);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #1c1c34;
}
.landing .carousel img {
  width: 100%;
  aspect-ratio: 880 / 1184;
  object-fit: cover;
  display: block;
}
.landing .carousel figcaption {
  padding: 1rem 1.1rem 1.2rem;
  font-size: 0.94rem;
  line-height: 1.45;
  color: var(--ink);
  border-top: 1px solid #1c1c34;
}

/* How it works */
.landing .how ol {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 1rem;
  gap: 1rem;
  counter-reset: step;
}
@media (min-width: 720px) {
  .landing .how ol { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}
.landing .how li {
  background: var(--bg-card);
  padding: 1.25rem 1.4rem 1.25rem 3.4rem;
  border-radius: var(--radius);
  position: relative;
  counter-increment: step;
  border: 1px solid #1c1c34;
}
.landing .how li::before {
  content: counter(step);
  position: absolute;
  left: 1.1rem; top: 1.15rem;
  width: 1.7rem; height: 1.7rem;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1209;
  font-weight: 700;
  display: grid; place-items: center;
  font-size: 0.95rem;
}
.landing .how li b { display: block; margin-bottom: 0.25rem; }
.landing .how li span { color: var(--ink-soft); font-size: 0.95rem; }

/* Deep dive (same face) */
.landing .dive p { font-size: 1.05rem; max-width: 60ch; color: var(--ink-soft); line-height: 1.6; }

/* Coming soon */
.landing .roadmap {
  background: linear-gradient(135deg, rgba(243,169,83,0.08), rgba(106,170,100,0.05));
  border-radius: 22px;
  padding: 2.5rem 2rem;
  border: 1px solid rgba(243,169,83,0.2);
  margin: 1.5rem 0;
}
.landing .roadmap p { font-size: 1.05rem; color: var(--ink); max-width: 60ch; line-height: 1.6; }
.landing .roadmap p strong { color: var(--accent); }

/* Trust */
.landing .trust { background: var(--bg-card); border-radius: 22px; padding: 2.5rem 2rem; border: 0; }
.landing .trust p { font-size: 1.02rem; max-width: 64ch; line-height: 1.65; }

/* FAQ */
.landing .faq details {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  margin-bottom: 0.6rem;
  border: 1px solid #1c1c34;
}
.landing .faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.landing .faq summary::after {
  content: '+';
  color: var(--accent);
  font-size: 1.4rem;
  transition: transform 0.2s;
}
.landing .faq details[open] summary::after { transform: rotate(45deg); }
.landing .faq details[open] { background: #181830; }
.landing .faq p { margin-top: 0.7rem; color: var(--ink-soft); line-height: 1.55; }

/* Final CTA */
.landing .final {
  text-align: center;
  padding: 4rem 0 3rem;
}
.landing .final h2 { margin-bottom: 1.4rem; }
.landing .final p { color: var(--ink-soft); margin-top: 0.9rem; font-size: 0.92rem; }

/* Footer */
.landing footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 2rem 0 1rem;
  border-top: 1px solid #1c1c34;
  margin-top: 1rem;
}

/* ── Story Player v2 ────────────────────────────────────────────────── */

.player-root {
  position: fixed;
  inset: 0;
  background: #050309;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Subtle cosmic-night radial — frames the page card without competing */
.player-root::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(243,169,83,0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* The page card — the "book unit" */
.page-card {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 60% 40%;
  background: var(--paper);
  /* Subtle paper grain via layered gradients */
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(243,234,212,0.5), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(230,218,185,0.6), transparent 50%),
    repeating-linear-gradient(
      45deg,
      rgba(107,90,58,0.012) 0,
      rgba(107,90,58,0.012) 1px,
      transparent 1px,
      transparent 3px
    );
  color: var(--paper-ink);
  view-transition-name: story-page;
  z-index: 1;
}

/* Soft binding shadow at the left edge of every page */
.page-binding,
.cover-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 22px;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.32) 0%,
    rgba(0,0,0,0.18) 30%,
    rgba(0,0,0,0.06) 70%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* Story page image — Next.js Image fills via position:absolute; wrapper supplies the box */
.page-image {
  position: relative;
  /* Paper-warm fallback so a momentary uncached frame doesn't flash navy.
     Matches the page-card paper tone so the seam between text panel and
     image fallback is invisible during view-transition snapshot capture. */
  background:
    radial-gradient(ellipse at 30% 20%, rgba(243,234,212,0.7), rgba(230,218,185,0.85) 60%),
    var(--paper-shade);
  overflow: hidden;
}
.page-image img {
  object-fit: cover;
  /* Soft fade so a cache miss feels graceful instead of a hard pop */
  animation: page-image-fade-in 280ms ease-out both;
}
@keyframes page-image-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .page-image img { animation: none; }
}
.page-image::after {
  /* Soft inner shadow at the bottom edge so image meets text gracefully */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 80%, rgba(0,0,0,0.15));
  pointer-events: none;
  z-index: 1;
}

/* Story page text panel */
.page-text {
  padding: 1.75rem 1.5rem 5.5rem 2rem;
  font-family: 'Iowan Old Style', 'Palatino', 'Palatino Linotype', Georgia, serif;
  font-size: clamp(1.05rem, 4vw, 1.45rem);
  line-height: 1.55;
  text-wrap: pretty;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-y: auto;
  color: var(--paper-ink);
  position: relative;
}

.page-text p:first-child {
  margin-bottom: 1rem;
}

.page-number {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--paper-ink-soft);
  text-align: center;
  margin-top: auto;
  padding-top: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: italic;
}

/* Phrase highlight — soft warm pill that breathes in and out */
.phrase {
  border-radius: 4px;
  padding: 0 2px;
  margin: 0 -2px;
  transition: background-color 220ms ease, color 220ms ease;
  background-color: transparent;
}
.phrase.active {
  background-color: rgba(243,169,83,0.32);
  color: #1a1209;
}
.phrase .word {
  cursor: pointer;
  border-radius: 3px;
  -webkit-tap-highlight-color: rgba(243,169,83,0.4);
}
.phrase .word:active {
  background-color: rgba(243,169,83,0.5);
}

/* Cover + Back cover — share styling */
.page-card.cover,
.page-card.back-cover {
  display: grid;
  grid-template-rows: 1fr;
  background: linear-gradient(180deg, #2d1b0d 0%, #1a0f06 100%);
  color: var(--paper);
}
.cover-inner {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  padding: 2.5rem 2rem;
  grid-gap: 1.25rem;
  gap: 1.25rem;
  max-width: 30rem;
  margin: 0 auto;
}
.cover-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(243,169,83,0.85);
  margin-bottom: 0.25rem;
}
.cover-title {
  font-family: 'Iowan Old Style', 'Palatino', Georgia, serif;
  font-size: clamp(2rem, 7vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #f3ead4;
  text-wrap: balance;
}
.cover-title strong {
  color: var(--accent);
  font-weight: 700;
}
.cover-starring {
  font-size: 1.05rem;
  color: rgba(243,234,212,0.75);
  font-style: italic;
}
.cover-starring strong {
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}
.cover-medallion {
  width: clamp(140px, 38vw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(243,169,83,0.4);
  box-shadow: 0 18px 50px -10px rgba(0,0,0,0.6);
  margin: 0.75rem 0;
}
.cover-medallion img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover-cta {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: rgba(243,234,212,0.55);
}

/* Tap zones — invisible buttons over the page */
.tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: transparent;
  border: 0;
  padding: 0;
  z-index: 3;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.tap-zone:disabled { cursor: default; }
.tap-zone.left   { left: 0;   width: 30%; }
.tap-zone.centre { left: 30%; width: 40%; }
.tap-zone.right  { left: 70%; width: 30%; right: 12px; } /* edge bleed for iOS forward-swipe */

/* Chrome — top + bottom — fades out after 3s of no interaction */
.chrome-top,
.chrome-bottom {
  position: absolute;
  left: 0; right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  padding-top: max(0.65rem, env(safe-area-inset-top));
  transition: opacity 320ms ease, transform 320ms ease;
}
.chrome-top { top: 0; }
.chrome-top button.icon {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  padding: 0;
}
.chrome-top .page-counter {
  flex: 1 1;
  text-align: center;
  font-family: 'Iowan Old Style', 'Palatino', Georgia, serif;
  font-style: italic;
  font-size: 0.92rem;
  color: rgba(245,240,225,0.7);
  letter-spacing: 0.03em;
}
.chrome-bottom {
  bottom: 0;
  padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
  justify-content: center;
}
.player-root.chrome-hidden .chrome-top {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}
.player-root.chrome-hidden .chrome-bottom {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

/* Tuck-in dim overlay */
.player-root::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  pointer-events: none;
  transition: background-color 1200ms ease;
  z-index: 4;
}
.player-root.dimmed::after {
  background: rgba(0,0,0,0.32);
}

/* Settings popover */
.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: backdrop-in 220ms ease;
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.settings-panel {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 1.4rem;
  width: min(100%, 440px);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border: 1px solid #2a2a44;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
  animation: panel-in 280ms var(--vt-ease);
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.settings-panel header h3 { margin: 0; }
.settings-panel section { display: flex; flex-direction: column; gap: 0.6rem; }
.settings-panel section .row > button { flex: 1 1; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid #1f1f3a;
  cursor: pointer;
}
.toggle-row:last-child { border-bottom: 0; }
.toggle {
  width: 2.6rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #2a2a44;
  position: relative;
  transition: background-color 160ms ease;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 1.1rem; height: 1.1rem;
  border-radius: 50%;
  background: #f5f0e1;
  transition: transform 180ms var(--vt-ease);
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(1.1rem); }

/* ── View Transitions: page slide-and-crossfade ──────────────────────── */
@supports (view-transition-name: a) {
  ::view-transition-old(story-page),
  ::view-transition-new(story-page) {
    animation-duration: var(--vt-duration);
    animation-timing-function: var(--vt-ease);
    animation-fill-mode: both;
    will-change: transform, opacity;
  }
  /* Forward direction (next page) */
  html[data-vt-direction="forward"]::view-transition-old(story-page) {
    animation-name: vt-page-out-left;
  }
  html[data-vt-direction="forward"]::view-transition-new(story-page) {
    animation-name: vt-page-in-right;
  }
  /* Backward direction (prev page) */
  html[data-vt-direction="backward"]::view-transition-old(story-page) {
    animation-name: vt-page-out-right;
  }
  html[data-vt-direction="backward"]::view-transition-new(story-page) {
    animation-name: vt-page-in-left;
  }
}

@keyframes vt-page-out-left {
  to { transform: translateX(-7%); opacity: 0; }
}
@keyframes vt-page-in-right {
  from { transform: translateX(7%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes vt-page-out-right {
  to { transform: translateX(7%); opacity: 0; }
}
@keyframes vt-page-in-left {
  from { transform: translateX(-7%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Reduced-motion: cross-fade only, no slide */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(story-page),
  ::view-transition-new(story-page) {
    animation-duration: 200ms !important;
    animation-timing-function: linear !important;
    animation-name: vt-fade-out, vt-fade-in !important;
  }
}

.player-root.reduce-motion ~ * ::view-transition-old(story-page),
html:has(.player-root.reduce-motion)::view-transition-old(story-page) {
  animation-duration: 200ms !important;
  animation-timing-function: linear !important;
  animation-name: vt-fade-out !important;
}
html:has(.player-root.reduce-motion)::view-transition-new(story-page) {
  animation-duration: 200ms !important;
  animation-timing-function: linear !important;
  animation-name: vt-fade-in !important;
}

@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Loading overlay — covers the cover/page until first 2 images are ready */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #1a0f06 0%, #0b0612 100%);
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: loading-fade-in 200ms ease-out;
}
.loading-overlay[data-leaving="true"] {
  animation: loading-fade-out 320ms ease-in forwards;
}
@keyframes loading-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes loading-fade-out { to { opacity: 0; visibility: hidden; } }

.loading-card {
  display: grid;
  justify-items: center;
  grid-gap: 1rem;
  gap: 1rem;
  text-align: center;
  max-width: 24rem;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(243, 169, 83, 0.2);
  border-top-color: var(--accent);
  animation: loading-spin 900ms linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }

.loading-title {
  font-family: 'Iowan Old Style', 'Palatino', Georgia, serif;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.loading-progress {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner { animation-duration: 1800ms; }
  .loading-overlay { animation: none; }
}

/* ── Login / auth ────────────────────────────────────────────────── */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: start center;
  padding: 2.5rem 1.25rem 4rem;
  background:
    radial-gradient(circle at 30% -10%, rgba(243, 169, 83, 0.10), transparent 55%),
    radial-gradient(circle at 110% 110%, rgba(122, 90, 200, 0.10), transparent 50%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 24rem;
  background: var(--bg-card);
  border: 1px solid #1f1f3a;
  border-radius: 22px;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55);
}
.auth-back {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
  text-decoration: none;
}
.auth-back:hover { color: var(--accent); text-decoration: none; }
.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
}
.auth-sub {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 0;
  gap: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #25254a;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 1.25rem;
}
.auth-tab {
  background: transparent;
  color: var(--ink-soft);
  border: 0;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab.is-active {
  background: var(--accent);
  color: #1a1209;
}
.auth-tab.is-active:hover { color: #1a1209; }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-field { display: flex; flex-direction: column; gap: 0.4rem; }
.auth-field > span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.auth-field input {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #2a2a44;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border-radius: 12px;
  transition: border-color 160ms ease, background 160ms ease;
}
.auth-field input:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.35);
}
.auth-field input::placeholder { color: rgba(194, 188, 168, 0.45); }

.auth-cta {
  width: 100%;
  padding: 0.95rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  margin-top: 0.25rem;
}
.auth-cta:disabled { opacity: 0.55; cursor: progress; }

.auth-hint {
  text-align: center;
  font-size: 0.82rem;
  margin: 0;
}
.auth-error {
  margin: 0;
  padding: 0.65rem 0.85rem;
  background: rgba(199, 85, 81, 0.12);
  border: 1px solid rgba(199, 85, 81, 0.4);
  border-radius: 10px;
  color: #f1a5a3;
  font-size: 0.88rem;
}
.auth-sent { display: flex; flex-direction: column; gap: 0.75rem; align-items: stretch; text-align: left; }
.auth-sent p { margin: 0; }

@media (min-width: 480px) {
  .auth { padding-top: 4rem; }
}

/* ── Top nav ──────────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #1c1c34;
  background: rgba(11, 11, 20, 0.85);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
          backdrop-filter: saturate(140%) blur(8px);
  position: -webkit-sticky;
  position: sticky; top: 0; z-index: 50;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.nav-brand:hover { color: var(--accent); text-decoration: none; }
.nav-spacer { flex: 1 1; }
.nav-link {
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
}
.nav-link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); text-decoration: none; }
.nav-cta-link {
  display: inline-block;
  padding: 0.55rem 1rem;
  background: var(--accent);
  color: #1a1209;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}
.nav-cta-link:hover { background: var(--accent-soft); color: #1a1209; text-decoration: none; }
.nav-signout { margin: 0; }
.nav-cta {
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  border-radius: 10px;
}

/* ── Account settings ─────────────────────────────────────────────── */
.account {
  max-width: 32rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.account h1 {
  font-size: 1.75rem;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
}
.account .lede { color: var(--ink-soft); margin: 0 0 2rem; font-size: 0.95rem; }
.account-section {
  background: var(--bg-card);
  border: 1px solid #1f1f3a;
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.account-section h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  font-weight: 700;
}
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  font-size: 0.95rem;
}
.account-row + .account-row { border-top: 1px solid #1f1f3a; }
.account-row .key { color: var(--ink-soft); }
.account-row .val { color: var(--ink); font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.85rem; word-break: break-all; }
.account-danger {
  border-color: rgba(199, 85, 81, 0.3);
}
.account-danger h2 { color: #f1a5a3; }
.account-danger p { color: var(--ink-soft); font-size: 0.9rem; margin: 0 0 0.85rem; }

/* ── Dashboard ────────────────────────────────────────────────────── */
.dash {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}
.dash-hero {
  display: grid;
  grid-gap: 1.25rem;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  align-items: end;
  background: linear-gradient(135deg, rgba(243, 169, 83, 0.10), rgba(122, 90, 200, 0.08) 60%, transparent);
  border: 1px solid rgba(243, 169, 83, 0.2);
  border-radius: 22px;
  padding: 2rem 1.5rem;
  margin-bottom: 2rem;
}
@media (min-width: 720px) {
  .dash-hero { grid-template-columns: 1fr auto; padding: 2.5rem 2rem; }
}
.dash-greet { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 0.4rem; }
.dash-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}
.dash-sub { color: var(--ink-soft); margin: 0; max-width: 48ch; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.dash-actions .btn { padding: 0.85rem 1.25rem; }
.btn.primary { background: var(--accent); color: #1a1209; border: 0; border-radius: 12px; font-weight: 600; box-shadow: 0 12px 30px -12px rgba(243, 169, 83, 0.5); }
.btn.primary:hover { background: var(--accent-soft); text-decoration: none; }

.dash-section { margin: 2.5rem 0; }
.dash-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.dash-section-head h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin: 0;
}
.link-cta {
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}
.link-cta:hover { color: var(--accent-soft); text-decoration: underline; }

/* ── Library grid ─────────────────────────────────────────────────── */
.lib-grid {
  display: grid;
  grid-gap: 1rem;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px) { .lib-grid { grid-template-columns: repeat(4, 1fr); } }
.lib-card {
  background: var(--bg-card);
  border: 1px solid rgba(244, 236, 216, 0.06);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 200ms ease, border-color 200ms ease;
  display: block;
}
.lib-card:hover {
  transform: translateY(-3px);
  border-color: rgba(243, 169, 83, 0.4);
  text-decoration: none;
}
.lib-cover {
  position: relative;
  aspect-ratio: 768 / 1024;
  background: var(--bg);
  overflow: hidden;
}
.lib-badge {
  position: absolute;
  top: 0.55rem; right: 0.55rem;
  background: rgba(0, 0, 0, 0.7);
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
}
.lib-badge.is-private { color: #ffb3b3; background: rgba(120, 30, 30, 0.85); }
.lib-meta { padding: 0.85rem 1rem 1rem; }
.lib-meta h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
  letter-spacing: -0.005em;
}
.lib-meta .muted { font-size: 0.82rem; margin: 0; }

/* ── Children grid ────────────────────────────────────────────────── */
.kid-grid {
  display: grid;
  grid-gap: 1rem;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .kid-grid { grid-template-columns: repeat(2, 1fr); } }
.kid-card {
  background: var(--bg-card);
  border: 1px solid rgba(244, 236, 216, 0.06);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.kid-avatar {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(243, 169, 83, 0.15);
  border: 1px solid rgba(243, 169, 83, 0.3);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.kid-initial {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}
.kid-info { flex: 1 1; min-width: 0; }
.kid-info h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.15rem; }
.kid-info .muted { font-size: 0.85rem; margin: 0 0 0.6rem; }
.kid-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }

.dash-empty {
  background: var(--bg-card);
  border: 1px solid rgba(244, 236, 216, 0.06);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.dash-empty p { max-width: 48ch; }

/* ── Quick links ──────────────────────────────────────────────────── */
.dash-quick {
  display: grid;
  grid-gap: 0.75rem;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .dash-quick { grid-template-columns: repeat(3, 1fr); } }
.quick-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg-card);
  border: 1px solid rgba(244, 236, 216, 0.06);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 200ms ease;
}
.quick-card:hover { border-color: rgba(243, 169, 83, 0.3); text-decoration: none; }
.quick-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(243, 169, 83, 0.12);
  border: 1px solid rgba(243, 169, 83, 0.3);
  display: grid; place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.quick-card h3 { font-size: 0.95rem; margin: 0 0 0.1rem; font-weight: 700; }
.quick-card .muted { font-size: 0.8rem; margin: 0; }

