:root {
  --ink: #24304a;
  --muted: #68718a;
  --cream: #fffaf1;
  --paper: #ffffff;
  --purple: #7155d9;
  --purple-dark: #4f36b5;
  --purple-soft: #eee9ff;
  --yellow: #ffd768;
  --yellow-soft: #fff4c9;
  --pink: #ff8ea1;
  --mint: #8be0c2;
  --blue: #7bc8ff;
  --line: #e8e8f0;
  --shadow: 0 18px 50px rgba(50, 38, 110, .12);
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
  background: var(--cream);
}

a { color: inherit; text-decoration: none; }
button, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.section-shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Baloo 2", cursive;
  font-size: 1.35rem;
  font-weight: 700;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  box-shadow: 0 8px 22px rgba(113, 85, 217, .28);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: #505972;
  font-weight: 700;
}

.desktop-nav a:hover { color: var(--purple); }

.nav-cta {
  color: white !important;
  padding: 12px 19px;
  border-radius: 999px;
  background: var(--purple);
}

.desktop-nav a.active {
  color: var(--purple);
}

.menu-button {
  display: none;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
}

.hero {
  min-height: 650px;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 60px;
  align-items: center;
  padding: 60px 0 80px;
}

.eyebrow {
  display: inline-block;
  color: var(--purple);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero h1,
.content-section h2,
.split-copy h2,
.parent-copy h2,
.section-heading h2,
.final-cta h2 {
  margin: 0;
  font-family: "Baloo 2", cursive;
  line-height: 1.04;
  letter-spacing: -.02em;
}

.hero h1 { font-size: clamp(3rem, 5.8vw, 5.8rem); }
.hero h1 span { color: var(--purple); }

.hero-text {
  max-width: 650px;
  font-size: 1.14rem;
  line-height: 1.75;
  color: var(--muted);
  margin: 22px 0 28px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform .2s ease, box-shadow .2s ease;
}

.button:hover { transform: translateY(-2px); }

.button-primary {
  color: white;
  background: var(--purple);
  box-shadow: 0 12px 30px rgba(113, 85, 217, .3);
}

.button-secondary {
  background: white;
  border: 1px solid var(--line);
}

.trust-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 25px;
  color: #68718a;
  font-size: .92rem;
  font-weight: 700;
}

.trust-row span::before {
  content: "✓";
  margin-right: 7px;
  color: var(--purple);
}

.hero-card-wrap {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
}

.story-demo-card {
  width: min(100%, 500px);
  padding: 24px;
  border-radius: 36px;
  background: white;
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
  position: relative;
  z-index: 2;
}

.demo-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.demo-top strong { display: block; }
.demo-top small { display: block; color: var(--muted); margin-top: 2px; }

.avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 1.8rem;
  background: var(--yellow-soft);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.8);
}

.turn-pill {
  margin-left: auto;
  font-size: .78rem;
  font-weight: 800;
  padding: 8px 12px;
  color: var(--purple-dark);
  background: var(--purple-soft);
  border-radius: 999px;
}

.demo-message {
  width: 88%;
  padding: 15px 17px;
  margin-top: 18px;
  border-radius: 18px;
  line-height: 1.55;
  font-weight: 700;
}

.ai-message { background: #f4f1ff; border-bottom-left-radius: 6px; }
.child-message {
  margin-left: auto;
  background: #fff0b6;
  border-bottom-right-radius: 6px;
}

.demo-reaction {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  padding: 14px;
  border-radius: 18px;
  background: #effcf7;
}

.demo-reaction span { font-size: 2rem; }
.demo-reaction p { margin: 0; color: #41645b; line-height: 1.35; }

.floating-card {
  position: absolute;
  z-index: 3;
  padding: 13px 16px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.card-one { top: 38px; right: 0; background: var(--yellow); transform: rotate(5deg); }
.card-two { bottom: 42px; left: 0; background: var(--mint); transform: rotate(-6deg); }

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  padding: 1px;
  border-radius: 24px;
  overflow: hidden;
  background: var(--line);
  box-shadow: var(--shadow);
}

.stats-band div {
  text-align: center;
  padding: 25px 12px;
  background: white;
}

.stats-band strong {
  display: block;
  color: var(--purple);
  font-family: "Baloo 2", cursive;
  font-size: 1.55rem;
}

.stats-band span { color: var(--muted); font-size: .9rem; }

.pricing-page {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 215, 104, .32), transparent 30%),
    radial-gradient(circle at 88% 16%, rgba(139, 224, 194, .24), transparent 28%),
    var(--cream);
}

.pricing-hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 60px;
  align-items: center;
  padding: 70px 0 90px;
}

.pricing-hero-copy h1,
.credit-examples-card h2 {
  margin: 0;
  font-family: "Baloo 2", cursive;
  line-height: 1.04;
  letter-spacing: -.02em;
}

.pricing-hero-copy h1 {
  max-width: 660px;
  font-size: clamp(3.2rem, 5.8vw, 5.9rem);
}

.pricing-hero-copy h1 span {
  color: var(--purple);
}

.pricing-hero-copy p {
  max-width: 660px;
  margin: 22px 0 28px;
  color: var(--muted);
  font-size: 1.14rem;
  line-height: 1.75;
}

.pricing-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.pricing-trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(113, 85, 217, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: #5a6078;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(50, 38, 110, .06);
}

.pricing-visual-card {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
}

.pricing-visual-card::before {
  content: "";
  position: absolute;
  width: 410px;
  height: 410px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(113, 85, 217, .14), rgba(255, 142, 161, .16));
  filter: blur(2px);
}

.credit-sparkle {
  position: absolute;
  top: 42px;
  right: 68px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: var(--yellow);
  box-shadow: var(--shadow);
  font-size: 2rem;
  transform: rotate(10deg);
  z-index: 3;
}

.credit-balance-card {
  position: relative;
  z-index: 2;
  width: min(100%, 390px);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 38px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
  text-align: center;
}

.credit-balance-card span,
.credit-balance-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.credit-balance-card strong {
  display: block;
  margin: 4px 0 0;
  font-family: "Baloo 2", cursive;
  font-size: 6.8rem;
  line-height: .9;
  color: var(--purple);
}

.credit-meter {
  height: 16px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--purple-soft);
}

.credit-meter i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--pink), var(--yellow));
}

.credit-mini-card {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 255px;
  padding: 16px;
  border-radius: 20px;
  background: white;
  box-shadow: 0 16px 38px rgba(50, 38, 110, .12);
}

.credit-mini-card > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: var(--purple-soft);
  font-size: 1.5rem;
}

.credit-mini-card strong,
.credit-example-list strong,
.pricing-note-grid strong {
  display: block;
}

.credit-mini-card small,
.credit-example-list small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
}

.card-story { top: 114px; left: 0; transform: rotate(-5deg); }
.card-voice { right: 0; bottom: 132px; transform: rotate(5deg); }
.card-video { left: 36px; bottom: 48px; transform: rotate(-2deg); }

.credit-how-section {
  padding: 40px 0 90px;
}

.credit-use-grid,
.pricing-note-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.credit-use-card,
.pricing-note-grid article {
  min-height: 255px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: white;
  box-shadow: 0 10px 30px rgba(50, 38, 110, .06);
}

.credit-use-card > span,
.pricing-note-grid article > span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 18px;
  background: var(--yellow-soft);
  font-size: 1.8rem;
}

.credit-use-card h3,
.pricing-note-grid h3 {
  margin: 0 0 10px;
  font-family: "Baloo 2", cursive;
  font-size: 1.45rem;
}

.credit-use-card p,
.pricing-note-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.credit-examples-section {
  padding: 20px 0 90px;
}

.credit-examples-card {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 36px;
  align-items: center;
  padding: 38px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 6% 12%, rgba(255, 215, 104, .26), transparent 30%),
    linear-gradient(135deg, white, #f8f5ff);
  border: 1px solid rgba(113, 85, 217, .12);
  box-shadow: var(--shadow);
}

.credit-examples-card h2 {
  font-size: clamp(2.3rem, 4vw, 3.8rem);
}

.credit-examples-card p {
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.06rem;
}

.credit-example-list {
  display: grid;
  gap: 14px;
}

.credit-example-list div {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(113, 85, 217, .08);
}

.credit-example-list span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #effcf7;
  font-size: 1.6rem;
}

.pricing-note-grid {
  grid-template-columns: repeat(3, 1fr);
  padding: 0 0 100px;
}

.pricing-note-grid article {
  min-height: 220px;
}

.add-credits-section {
  padding: 0 0 90px;
}

.credit-pack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.credit-pack-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: white;
  box-shadow: 0 12px 34px rgba(50, 38, 110, .07);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}

.credit-pack-card.featured-pack {
  border-color: rgba(113, 85, 217, .32);
  background:
    radial-gradient(circle at 88% 10%, rgba(255, 215, 104, .28), transparent 30%),
    linear-gradient(180deg, #ffffff, #f8f5ff);
  box-shadow: var(--shadow);
  transform: translateY(-10px);
}

.credit-pack-card:hover,
.credit-pack-card:focus-within {
  border-color: rgba(113, 85, 217, .34);
  background:
    radial-gradient(circle at 88% 10%, rgba(255, 215, 104, .26), transparent 30%),
    linear-gradient(180deg, #ffffff, #f8f5ff);
  box-shadow: var(--shadow);
  transform: translateY(-10px);
}

.credit-pack-card.featured-pack:hover,
.credit-pack-card.featured-pack:focus-within {
  transform: translateY(-14px);
}

.credit-pack-card.free-pack {
  background:
    radial-gradient(circle at 12% 12%, rgba(139, 224, 194, .22), transparent 28%),
    white;
}

.pack-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-size: .82rem;
  font-weight: 900;
}

.credit-pack-card h3 {
  margin: 22px 0 0;
  font-family: "Baloo 2", cursive;
  font-size: 2.45rem;
  line-height: 1;
}

.credit-pack-card strong {
  display: block;
  margin-top: 8px;
  color: var(--purple);
  font-size: 1.05rem;
}

.credit-pack-card p {
  margin: 18px 0 24px;
  color: var(--muted);
  line-height: 1.65;
}

.credit-pack-card .button {
  width: 100%;
  margin-top: auto;
  border: 0;
}

.credit-pack-card:hover .button,
.credit-pack-card:focus-within .button {
  color: white;
  background: var(--purple);
  box-shadow: 0 12px 30px rgba(113, 85, 217, .3);
}

.payment-method-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
  padding: 34px;
  border: 1px solid rgba(113, 85, 217, .12);
  border-radius: 30px;
  background:
    radial-gradient(circle at 100% 100%, rgba(139, 224, 194, .25), transparent 32%),
    white;
  box-shadow: 0 16px 42px rgba(50, 38, 110, .08);
}

.payment-method-card h2 {
  margin: 0;
  font-family: "Baloo 2", cursive;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.05;
}

.payment-method-card p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.payment-method-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.payment-method-grid span {
  min-height: 76px;
  display: flex;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fbfaff;
  font-weight: 900;
}

.credit-checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(36, 48, 74, .58);
  backdrop-filter: blur(10px);
}

.credit-checkout-modal.is-open {
  display: grid;
}

.credit-checkout-card {
  position: relative;
  width: min(520px, 100%);
  padding: 34px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 215, 104, .28), transparent 32%),
    radial-gradient(circle at 0 100%, rgba(139, 224, 194, .22), transparent 30%),
    white;
  box-shadow: 0 24px 70px rgba(18, 16, 55, .22);
}

.credit-checkout-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-size: 1.45rem;
  line-height: 1;
}

.checkout-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  font-size: 2rem;
  box-shadow: 0 14px 30px rgba(113, 85, 217, .28);
}

.credit-checkout-card h2 {
  margin: 0;
  font-family: "Baloo 2", cursive;
  font-size: 2.45rem;
  line-height: 1;
}

.credit-checkout-card p {
  margin: 12px 0 18px;
  color: var(--muted);
  line-height: 1.65;
}

.checkout-summary-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--line);
}

.checkout-summary-box div {
  padding: 16px;
  background: #fbfaff;
}

.checkout-summary-box span,
.checkout-summary-box strong {
  display: block;
}

.checkout-summary-box span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.checkout-summary-box strong {
  margin-top: 4px;
  font-size: 1.1rem;
}

.checkout-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.checkout-methods button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  font-weight: 900;
}

.checkout-methods button.is-selected {
  border-color: var(--purple);
  background: var(--purple-soft);
  color: var(--purple-dark);
  box-shadow: inset 0 0 0 1px rgba(113, 85, 217, .18);
}

.checkout-pay-button {
  width: 100%;
  border: 0;
}

.credit-checkout-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

.pricing-final-cta {
  margin-top: 0;
}

.content-section { padding: 130px 0 80px; }
.section-heading { max-width: 690px; margin-bottom: 45px; }
.section-heading.center { text-align: center; margin-inline: auto; }
.section-heading h2,
.split-copy h2,
.parent-copy h2,
.final-cta h2 { font-size: clamp(2.4rem, 4vw, 4rem); }
.section-heading p,
.split-copy > p,
.parent-copy > p {
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.08rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.step-card,
.mode-grid article {
  position: relative;
  min-height: 270px;
  padding: 28px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(50, 38, 110, .06);
}

.step-number {
  position: absolute;
  top: 20px;
  right: 22px;
  color: #c8c6d8;
  font-family: "Baloo 2", cursive;
  font-size: 1.2rem;
}

.step-icon { font-size: 2.4rem; margin: 20px 0; }
.step-card h3, .mode-grid h3 { margin: 0 0 10px; font-size: 1.3rem; }
.step-card p, .mode-grid p { color: var(--muted); line-height: 1.6; margin: 0; }

.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  padding: 120px 0;
}

.split-visual {
  min-height: 500px;
  border-radius: 42px;
  background: linear-gradient(145deg, #f0ebff, #fff7d6);
  position: relative;
  overflow: hidden;
}

.center-bubble {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 4rem;
  background: white;
  box-shadow: var(--shadow);
}

.orbit {
  position: absolute;
  border: 2px dashed rgba(113,85,217,.25);
  border-radius: 50%;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.orbit-one { width: 300px; height: 300px; }
.orbit-two { width: 440px; height: 440px; }

.idea-tag {
  position: absolute;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: var(--shadow);
  background: white;
}

.tag-a { top: 70px; left: 70px; transform: rotate(-7deg); }
.tag-b { top: 135px; right: 35px; background: var(--yellow); transform: rotate(6deg); }
.tag-c { bottom: 100px; left: 45px; background: var(--mint); transform: rotate(4deg); }
.tag-d { bottom: 48px; right: 75px; background: #ffdce3; transform: rotate(-5deg); }

.feature-list {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 20px;
}

.feature-list li { display: flex; gap: 14px; }
.feature-list li > span {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--purple-soft);
  color: var(--purple);
  font-weight: 900;
}

.feature-list strong, .feature-list small { display: block; }
.feature-list small { margin-top: 3px; color: var(--muted); line-height: 1.45; }

.parent-panel {
  display: grid;
  grid-template-columns: 1fr .9fr;
  gap: 50px;
  align-items: center;
  padding: 60px;
  border-radius: 36px;
  color: white;
  background: linear-gradient(135deg, #5b42c6, #8b5ee5);
  box-shadow: var(--shadow);
}

.parent-panel .eyebrow { color: #ffe8a0; }
.parent-copy > p { color: rgba(255,255,255,.78); }

.settings-preview {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.settings-preview span {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  font-weight: 700;
}

.parent-card {
  padding: 12px;
  border-radius: 24px;
  background: white;
  color: var(--ink);
}

.mini-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 17px;
  border-bottom: 1px solid var(--line);
}

.mini-setting:last-child { border-bottom: 0; }
.mini-setting strong, .mini-setting small { display: block; }
.mini-setting small { color: var(--muted); margin-top: 4px; }

.level-dots { display: flex; gap: 6px; }
.level-dots i {
  width: 10px; height: 10px; border-radius: 50%; background: #ddd9f2;
}
.level-dots i:nth-child(-n+2) { background: var(--purple); }
.avatar-stack { font-size: 1.5rem; letter-spacing: -6px; }
.mode-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-weight: 800;
  font-size: .85rem;
}

.modes-section { padding: 130px 0 100px; }
.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.mode-grid article { min-height: 220px; }
.mode-grid article > span { font-size: 2.6rem; display: block; margin-bottom: 20px; }

.quote-section {
  text-align: center;
  padding: 70px 20px 120px;
}

.quote-section blockquote {
  max-width: 850px;
  margin: 0 auto;
  font-family: "Baloo 2", cursive;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.2;
}

.quote-section strong { color: var(--purple); }
.quote-section p { color: var(--muted); }

.final-cta {
  padding: 70px 0;
  background: #26213c;
  color: white;
}

.final-cta-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

.eyebrow.light { color: var(--yellow); }
.button-light { background: white; color: var(--purple-dark); }

.site-footer {
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  color: var(--muted);
  font-size: .9rem;
}

.site-footer p { max-width: 520px; text-align: center; }

/* Story interaction page */
.story-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 10%, rgba(255,215,104,.35), transparent 28%),
    radial-gradient(circle at 90% 20%, rgba(123,200,255,.25), transparent 25%),
    #f9f7ff;
}

.story-app { min-height: 100vh; }

.story-header {
  min-height: 76px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.small-brand .brand-mark { width: 36px; height: 36px; border-radius: 12px; }
.story-meta { display: flex; gap: 10px; margin-left: auto; }
.meta-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  font-size: .85rem;
  font-weight: 800;
}

.header-link-chip {
  color: var(--ink);
  text-decoration: none;
}

.header-link-chip:hover {
  border-color: #cbbffc;
  color: var(--purple);
}
.icon-button {
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--purple-soft);
}

.header-link-button {
  display: grid;
  place-items: center;
  color: var(--purple-dark);
  font-weight: 900;
}

.story-main {
  width: min(1500px, 100%);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 310px 1fr;
  min-height: calc(100vh - 76px);
}

.story-sidebar {
  padding: 25px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,.55);
}

.side-card {
  padding: 20px;
  margin-bottom: 16px;
  border-radius: 20px;
  background: white;
  box-shadow: 0 10px 25px rgba(50, 38, 110, .06);
}

.side-label {
  color: var(--purple);
  text-transform: uppercase;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.side-card h2 {
  font-family: "Baloo 2", cursive;
  margin: 7px 0 16px;
  font-size: 1.65rem;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.progress-track {
  height: 9px;
  border-radius: 999px;
  background: #ece8f8;
  overflow: hidden;
}

.progress-fill {
  width: 27%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  transition: width .35s ease;
}

.challenge-badge {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--yellow-soft);
  font-weight: 900;
}

.side-help { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.session-tool-button { border: 0; border-radius: 9px; padding: 7px 10px; background: var(--purple-soft); color: var(--purple-dark); font-weight: 800; cursor: pointer; }
.session-tool-button:hover { background: #ddd5ff; }
.flow-hero { grid-template-columns: minmax(0, 1fr) 72px minmax(0, auto); }
.flow-hero-actions { position: relative; align-self: center; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.flow-download-button { border: 0; cursor: pointer; }
.flow-generation-button { border: 0; cursor: pointer; background: var(--purple-soft); color: var(--purple-dark); }
.flow-generation-button[hidden] { display: none !important; }
.video-status-panel { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 18px; padding: 12px 16px; border-radius: 16px; background: #fff; color: var(--purple-dark); box-shadow: 0 8px 22px rgba(50,38,110,.08); }
.video-status-panel[hidden] { display: none !important; }
.video-status-button, .video-copy-button { padding: 8px 12px; border: 0; border-radius: 10px; background: var(--purple-soft); color: var(--purple-dark); font-weight: 800; text-decoration: none; cursor: pointer; }
.flow-chat-lines .room-chat-line { position: relative; }
.line-reset-button { position: absolute; top: 9px; right: 10px; border: 0; background: transparent; color: #7d5a00; font-size: 1rem; cursor: pointer; }
.download-menu { display: grid; gap: 6px; padding: 8px; margin-top: 6px; border-radius: 12px; background: #fff; box-shadow: 0 8px 24px rgba(50,38,110,.12); }
.download-menu[hidden] { display: none !important; }
.download-menu button { border: 0; background: transparent; text-align: left; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--purple-dark); font-weight: 800; }
.download-menu button:hover { background: var(--purple-soft); }
.flow-hero-actions .download-menu { position: absolute; left: 0; right: auto; top: calc(100% + 8px); z-index: 2; min-width: 190px; }
.line-reset-button { width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(90,65,0,.12); }

.ingredient-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ingredient-list span {
  padding: 8px 10px;
  border-radius: 12px;
  background: #f5f3fb;
  font-size: .82rem;
  font-weight: 800;
}

.side-link {
  width: 100%;
  border: 0;
  padding: 13px;
  border-radius: 14px;
  background: #ece7ff;
  color: var(--purple-dark);
  font-weight: 900;
}

.settings-stage {
  padding-bottom: 70px;
}

.settings-scene-header {
  align-items: flex-start;
}

.settings-card,
.story-link-card {
  padding: 24px;
  border-radius: 28px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.settings-card {
  display: grid;
  gap: 18px;
}

.settings-login-required {
  max-width: 620px;
  margin: 40px auto 0;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: white;
  box-shadow: var(--shadow);
  text-align: center;
}

.settings-login-required[hidden] {
  display: none;
}

.login-required-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: var(--purple-soft);
  font-size: 1.8rem;
}

.settings-login-required h2 {
  margin: 0 0 10px;
  font-family: "Baloo 2", cursive;
  font-size: 2.3rem;
  line-height: 1;
}

.settings-login-required p {
  max-width: 460px;
  margin: 0 auto 22px;
  color: var(--muted);
  line-height: 1.6;
}

.voice-story-stage .settings-login-required {
  position: relative;
  z-index: 1;
  margin-top: 12vh;
  border-color: rgba(255,255,255,.72);
  background:
    radial-gradient(circle at 15% 12%, rgba(255,205,85,.18), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,246,255,.92));
  box-shadow: 0 28px 70px rgba(19,20,50,.28);
}

.voice-story-stage .settings-login-required .login-required-icon {
  background: #fff6d8;
  box-shadow: 0 14px 30px rgba(247,193,77,.18);
}

.settings-field {
  display: grid;
  gap: 8px;
  margin: 0;
  min-width: 0;
  border: 0;
  padding: 0;
}

.settings-field span,
.ai-character-field legend,
.starter-field legend {
  color: var(--purple);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ai-character-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
  border: 2px solid #ece9f6;
  border-radius: 24px;
  background: rgba(250, 249, 255, .72);
}
.companion-field { position: relative; display: grid; gap: 16px; padding: 30px 20px 20px; border: 2px solid #ece9f6; border-radius: 24px; background: rgba(250, 249, 255, .72); }
.companion-field > legend { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); padding: 0 14px; margin: 0; background: #fff; color: var(--purple); font-size: 1.05rem; font-weight: 900; letter-spacing: .02em; text-transform: none; white-space: nowrap; }
.companion-field .ai-character-row { padding: 0; border: 0; border-radius: 0; background: transparent; }
.companion-instructions-field textarea { width: 100%; resize: vertical; }

.settings-theme-preview {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: 18px;
  margin-top: 2px;
}

.theme-background-section {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 30px 20px 20px;
  border: 2px solid #ece9f6;
  border-radius: 24px;
  background: rgba(250, 249, 255, .72);
}

.theme-background-section > .settings-field > span {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 14px;
  background: #fff;
  white-space: nowrap;
  color: var(--purple);
  font-size: .95rem;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: none;
}

.settings-theme-preview-picker,
.settings-theme-preview-pane { min-width: 0; }
.settings-theme-preview-pane { display: grid; gap: 8px; }

.settings-theme-preview > span,
.settings-theme-preview-picker > span,
.settings-theme-preview-pane > span {
  color: var(--purple);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.settings-theme-preview-box {
  position: relative;
  min-height: 160px;
  overflow: hidden;
  border: 2px solid #ece9f6;
  border-radius: 22px;
  background: linear-gradient(180deg, #f7f5ff, #ffffff);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.settings-theme-preview-box img {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  display: block;
}

.settings-theme-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  min-height: 360px;
  max-height: 360px;
  overflow-y: auto;
  align-content: start;
  padding: 4px;
}

.settings-theme-option {
  border: 2px solid #ece9f6;
  border-radius: 18px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 8px;
  text-align: left;
  box-shadow: 0 8px 18px rgba(50,38,110,.06);
}

.settings-theme-option img {
  width: 100%;
  height: 86px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.settings-theme-option-images {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 4px;
}

.settings-theme-option-images img {
  width: 100%;
  height: 86px;
  object-fit: cover;
  border-radius: 8px;
}

.settings-theme-option span {
  color: var(--ink);
  font-size: .82rem;
  font-weight: 800;
  text-transform: lowercase;
  word-break: break-word;
}

.settings-theme-option.is-selected {
  border-color: #b7a9f2;
  box-shadow: 0 12px 24px rgba(113,85,217,.16);
}

.settings-help { margin: -2px 0 4px; color: var(--muted); }
.settings-label-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-help-trigger {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 2px solid #dcd6f3;
  border-radius: 50%;
  background: #fff;
  color: var(--purple);
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.settings-help-trigger:hover,
.settings-help-trigger:focus {
  border-color: var(--purple);
  outline: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(32,24,67,.55);
}

.modal-backdrop.fade { opacity: 0; }
.modal-backdrop.show { opacity: 1; }
.modal-open { overflow: hidden; }

.settings-help-modal.modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px;
}

.settings-help-modal.modal.show {
  display: block;
}

.settings-help-modal .modal-dialog {
  width: min(680px, 100%);
  min-height: calc(100vh - 40px);
  display: flex;
  align-items: center;
  margin: 0 auto;
}

.settings-help-dialog {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 0;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255,214,102,.34), transparent 30%),
    radial-gradient(circle at 88% 10%, rgba(143,121,255,.22), transparent 32%),
    linear-gradient(180deg, #ffffff, #fbfaff);
  box-shadow: 0 26px 80px rgba(20,12,60,.34);
}

.settings-help-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 30px 58px 22px 28px;
  border-bottom: 1px solid #eee9fb;
}

.settings-help-hero > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #fff7de;
  font-size: 2rem;
  box-shadow: 0 14px 30px rgba(247,193,77,.22);
}

.settings-help-dialog h2 {
  margin: 0 0 4px;
  font-family: "Baloo 2", cursive;
  font-size: 1.8rem;
  line-height: 1.1;
  color: var(--ink);
}

.settings-help-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.settings-help-content {
  display: grid;
  gap: 12px;
  padding: 20px 28px 28px;
}

.settings-help-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-help-content article {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 2px solid #eee9fb;
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 10px 24px rgba(50,38,110,.06);
}

.settings-help-content article strong {
  color: var(--ink);
  font-size: 1rem;
}

.settings-help-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 2px solid #eee9fb;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.settings-help-close:hover,
.settings-help-close:focus {
  border-color: var(--purple);
  outline: 0;
}
.story-flow-field {
  position: relative;
  gap: 10px;
  padding: 30px 20px 20px;
  border: 2px solid #ece9f6;
  border-radius: 24px;
  background: rgba(250, 249, 255, .72);
}
.story-flow-field > legend {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 14px;
  background: #fff;
  white-space: nowrap;
  color: var(--purple);
  font-size: .95rem;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: none;
}
.story-flow-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.story-flow-option { display: grid; grid-template-columns: 18px 1fr; gap: 5px 10px; align-items: center; padding: 16px; border: 2px solid #ece9f6; border-radius: 18px; background: #fff; cursor: pointer; }
.story-flow-option:has(input:checked) { border-color: #b7a9f2; box-shadow: 0 10px 22px rgba(113,85,217,.12); }
.story-flow-option input { accent-color: var(--purple); }
.settings-field .story-flow-option input,
.settings-field .starter-field input[type="radio"] {
  appearance: none;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  border: 2px solid #8c8a92;
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
  justify-self: start;
}
.settings-field .story-flow-option input:checked,
.settings-field .starter-field input[type="radio"]:checked {
  border-color: var(--purple);
  background: radial-gradient(circle, var(--purple) 0 5px, #fff 6px);
}
.story-flow-option strong { color: var(--ink); }
.story-flow-option small { grid-column: 1 / -1; color: var(--muted); line-height: 1.4; }
.story-flow-details { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
.avatar-picker-trigger { min-height: 54px; display: flex; align-items: center; gap: 12px; border: 2px solid #ece9f6; border-radius: 18px; padding: 0 15px; background: #fff; font: inherit; font-weight: 800; color: var(--ink); cursor: pointer; }
.avatar-picker-trigger span:first-child { font-size: 1.8rem; }
.avatar-picker-trigger img { width: 34px; height: 34px; border-radius: 50%; }
.avatar-picker-modal[hidden] { display: none; }
.avatar-picker-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; }
.avatar-picker-backdrop { position: absolute; inset: 0; background: rgba(32,24,67,.55); }
.avatar-picker-dialog { position: relative; width: min(720px, 100%); max-height: min(780px, calc(100vh - 40px)); display: flex; flex-direction: column; padding: 28px; border-radius: 28px; background: #fff; box-shadow: 0 24px 70px rgba(20,12,60,.3); }
.avatar-picker-dialog h2 { margin: 0; font-family: "Baloo 2", cursive; font-size: 2rem; }
.avatar-picker-dialog p { margin: 4px 0 18px; color: var(--muted); }
.avatar-picker-close { position: absolute; top: 12px; right: 16px; border: 0; background: transparent; font-size: 2rem; cursor: pointer; }
.avatar-picker-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; max-height: 560px; overflow-y: auto; padding: 4px; }
.avatar-picker-option { min-height: 68px; border: 2px solid #ece9f6; border-radius: 16px; background: #faf9ff; font-size: 2rem; cursor: pointer; }
.avatar-picker-option.is-selected { border-color: var(--purple); background: var(--purple-soft); }
.avatar-picker-option img { width: 48px; height: 48px; display: block; margin: auto; }

.settings-field input,
.settings-field select {
  width: 100%;
  min-height: 54px;
  border: 2px solid #ece9f6;
  border-radius: 18px;
  padding: 0 15px;
  outline: 0;
  color: var(--ink);
  background: white;
  font: inherit;
  font-weight: 800;
}

.settings-field input:focus,
.settings-field select:focus {
  border-color: #b7a9f2;
}

.starter-field {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 2px solid #ece9f6;
  border-radius: 18px;
  background: #fff;
}

.starter-field legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  display: block;
}

.starter-field label {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 900;
}

.starter-field input {
  width: auto;
  min-height: auto;
  accent-color: var(--purple);
}

.hands-free-field {
  position: relative;
  grid-template-columns: 1fr;
  padding: 30px 20px 20px;
  border: 2px solid #ece9f6;
  border-radius: 24px;
  background: rgba(250, 249, 255, .72);
}

.hands-free-field > legend {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 14px;
  background: #fff;
  white-space: nowrap;
  color: var(--purple);
  font-size: .95rem;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: none;
}

.starter-field .hands-free-toggle {
  width: fit-content;
  min-height: 46px;
  padding-right: 18px;
}

.hands-free-options {
  display: grid;
  gap: 12px;
}

.hands-free-options[hidden] {
  display: none;
}

.hands-free-step {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(170px, 1fr) minmax(140px, .7fr) minmax(190px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 2px solid #ece9f6;
  border-radius: 18px;
  background: #fff;
}

.hands-free-step > span {
  color: var(--ink);
  font-size: .95rem;
  letter-spacing: 0;
  text-transform: none;
}

.starter-field .hands-free-step label {
  min-height: 42px;
  padding: 0 12px;
  border-width: 1px;
  border-radius: 14px;
}

.starter-field .hands-free-step .inline-number {
  justify-content: flex-start;
}

.hands-free-step input[type="number"] {
  width: 72px;
  min-height: 36px;
  padding: 0 8px;
  text-align: center;
}

.settings-submit {
  width: fit-content;
  border: 0;
}

.story-link-card {
  margin-top: 20px;
}

.story-link-card[hidden],
.story-summary-card[hidden],
#storyLinkCard[hidden] {
  display: none !important;
}

.story-summary-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: stretch;
  padding: 28px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: white;
}

.story-summary-card .scene-kicker {
  color: #fff4b8;
}

.summary-copy h2 {
  margin: 8px 0 12px;
  max-width: none;
  color: white;
  font-size: clamp(2rem, 3.2vw, 3.4rem);
  line-height: 1.02;
}

.summary-copy p {
  max-width: none;
  margin: 0 0 16px;
  color: rgba(255,255,255,.9);
  font-size: 1rem;
  line-height: 1.55;
}

.summary-preview span {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  color: white;
}

.summary-link-card {
  padding: 22px;
  border-radius: 20px;
  background: white;
  color: var(--ink);
}

.participant-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.participant-panels.single-room-panel {
  grid-template-columns: minmax(0, 640px);
  justify-content: center;
}

.participant-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 20px;
  background: white;
  color: var(--ink);
}

.participant-card .button {
  border: 0;
}

.participant-card > .button-primary {
  width: min(300px, 100%);
  justify-self: center;
}

.participant-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.summary-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.summary-row:first-child {
  grid-template-columns: auto minmax(0, 1fr);
}

.summary-row:last-child {
  border-bottom: 0;
}

.summary-action-row {
  padding: 18px 0 12px;
}

.summary-action-row a {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #0f766e;
  color: white;
  font-weight: 900;
  text-decoration: none;
}

.summary-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px auto;
  gap: 10px;
  align-items: stretch;
}

.summary-url-row[hidden] {
  display: none !important;
}

.created-room-result {
  display: grid;
  gap: 10px;
}

.voice-created-room-result {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.created-room-result[hidden] {
  display: none !important;
}

.created-room-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.created-room-row > span {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f8f6ff;
  color: var(--purple-dark);
  font-weight: 900;
}

.link-tools-row {
  grid-template-columns: minmax(0, 1fr) 48px auto auto;
}

.link-tools-row > a:first-child {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  border-radius: 14px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: .88rem;
  font-weight: 900;
  line-height: 1.25;
}

.link-tools-row button {
  border: 0;
  border-radius: 14px;
  background: #ffdf6e;
  font-size: 1.05rem;
}

.share-action {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 14px;
  background: white;
  color: var(--purple);
  border: 1px solid var(--line);
  font-size: .82rem;
  font-weight: 900;
  text-decoration: none;
}

.summary-url-row a {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  border-radius: 14px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: .88rem;
  font-weight: 900;
  line-height: 1.25;
}

.summary-url-row button {
  border: 0;
  border-radius: 14px;
  background: #ffdf6e;
  font-size: 1.05rem;
}

.enter-story-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--purple);
  color: white;
  font-weight: 900;
  text-decoration: none;
}

.summary-row strong {
  color: var(--ink);
  font-size: 1rem;
}

.summary-row span {
  justify-self: end;
  font-weight: 900;
}

.summary-row a {
  color: #0f766e;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.story-summary-card .side-help {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(255,255,255,.86);
}

.generated-link-row {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 10px;
  margin-top: 10px;
}

.generated-link-row a {
  min-width: 0;
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 0 15px;
  overflow-wrap: anywhere;
  border: 2px solid #ece9f6;
  border-radius: 18px;
  background: white;
  color: var(--purple-dark);
  font-weight: 900;
}

.generated-link-row button {
  border: 0;
  border-radius: 18px;
  background: var(--yellow);
  font-size: 1.2rem;
}

.chat-stage {
  padding: 28px 32px 240px;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}


.scene-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}

.scene-kicker { color: var(--muted); font-weight: 800; font-size: .86rem; }
.scene-header h1 {
  font-family: "Baloo 2", cursive;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1;
  margin: 5px 0 0;
}

.scene-avatars { display: flex; align-items: center; }
.scene-avatars .avatar + .versus { margin: 0 -4px; z-index: 2; }
.scene-avatars .avatar:last-child { margin-left: -4px; }
.versus {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  background: white;
  border-radius: 50%;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.child-avatar { background: #dff5ff; }

.messages { display: grid; gap: 18px; }

.message-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.child-row { justify-content: flex-end; }

.small-avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 1.45rem;
}

.message-bubble {
  max-width: min(76%, 650px);
  padding: 15px 18px;
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(50,38,110,.07);
  position: relative;
}

.message-bubble p { margin: 6px 0; line-height: 1.55; }
.ai-bubble { background: white; border-bottom-left-radius: 6px; }
.child-bubble { background: var(--yellow); border-bottom-right-radius: 6px; }
.speaker { font-size: .73rem; font-weight: 900; color: var(--purple); text-transform: uppercase; letter-spacing: .05em; }
.child-bubble .speaker { color: #7d5a00; }

.speak-button {
  position: absolute;
  right: 10px;
  top: 9px;
  border: 0;
  background: transparent;
  opacity: .55;
}

.big-reaction { font-size: 2.3rem; margin-top: 8px; }
.reaction-bubble { border: 2px solid #c9f1e3; }
.prompt-bubble { border: 2px solid #d9d1ff; }

.animated-avatar { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-5px) rotate(-3deg); }
}

.composer-wrap {
  position: fixed;
  left: calc(310px + (100vw - 310px - min(1000px, calc(100vw - 310px))) / 2);
  right: max(24px, calc((100vw - 310px - min(1000px, calc(100vw - 310px))) / 2));
  bottom: 20px;
  z-index: 12;
  max-width: 1000px;
  padding: 12px;
  border-radius: 24px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: 0 18px 45px rgba(50,38,110,.16);
}

.encouragement {
  margin: 0 0 8px 96px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 700;
}

.composer {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 10px;
  align-items: stretch;
}

.voice-control-cluster {
  position: relative;
  min-height: 100px;
}

.voice-button {
  width: 84px;
  height: 100px;
  border: 0;
  border-radius: 22px;
  color: white;
  background: linear-gradient(145deg, var(--purple), var(--pink));
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 12px 10px 40px;
}
.voice-button.recording { box-shadow: 0 0 0 4px rgba(255,142,161,.22); animation: voicePulse 1.6s ease-in-out infinite; }
.voice-button.recording .mic-icon, .voice-button.paused .mic-icon { display: none; }
.voice-button.recording .voice-label, .voice-button.paused .voice-label {
  display: block;
  color: rgba(255,255,255,.92);
  font-size: .68rem;
  line-height: 1.1;
  max-width: 64px;
}
.voice-button.paused { background: linear-gradient(145deg, #8c83b6, #b9aecb); animation: none; }
@keyframes voicePulse { 50% { transform: scale(1.03); } }
.voice-controls {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 9px;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 15;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.voice-controls .voice-status { display: none; }
.voice-controls[hidden] { display: none; }
.voice-status { margin-right: auto; color: var(--muted); font-size: .78rem; font-weight: 800; }
.voice-status i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--mint); }
.voice-status.listening i { background: var(--pink); box-shadow: 0 0 0 4px rgba(255,142,161,.16); }
.voice-control-button { width: 26px; height: 26px; border: 1px solid rgba(255,255,255,.7); border-radius: 50%; padding: 0; color: #5c3fc4; background: rgba(255,255,255,.95); box-shadow: 0 6px 14px rgba(60,42,120,.16); font-size: 0; font-weight: 900; line-height: 1; position: relative; }
.voice-control-button::before { content: ""; position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); }
.voice-control-button[aria-label="Pause listening"]::before { width: 10px; height: 11px; border-radius: 2px; background: linear-gradient(to right, currentColor 0 3px, transparent 3px 7px, currentColor 7px 10px); }
.voice-control-button[aria-label="Resume listening"]::before { width: 0; height: 0; margin-left: 1px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid currentColor; }
.voice-control-button:hover, .voice-control-button:focus-visible { border-color: white; background: white; outline: 0; transform: translateY(-1px); }
.voice-stop-button { color: #b94862; background: rgba(255,255,255,.95); border-color: rgba(255,255,255,.7); }
.voice-stop-button::before { width: 10px; height: 10px; border-radius: 3px; background: currentColor; }
.mic-icon { font-size: 1.4rem; }
.voice-label { font-size: .7rem; font-weight: 900; }

.text-input-wrap {
  position: relative;
  display: block;
  min-width: 0;
}

textarea {
  width: 100%;
  height: 100%;
  min-height: 68px;
  resize: none;
  border: 2px solid #ece9f6;
  border-radius: 18px;
  padding: 13px 52px 13px 15px;
  outline: 0;
  color: var(--ink);
  background: white;
  font-size: 1rem;
}

textarea:focus { border-color: #b7a9f2; }

.char-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: #9892aa;
  font-size: .72rem;
}

.send-button {
  border: 0;
  min-width: 150px;
  padding: 0 18px;
  border-radius: 18px;
  background: var(--yellow);
  color: #5d4100;
  font-weight: 900;
}

.idea-chips {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 9px;
  padding-left: 96px;
}

.idea-chips button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: white;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.idea-chips button:hover { color: var(--purple); border-color: #cbbffc; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(31, 25, 62, .55);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(650px, 100%);
  max-height: 80vh;
  overflow: auto;
  padding: 32px;
  border-radius: 26px;
  background: white;
  position: relative;
}

.modal-card h2 { font-family: "Baloo 2", cursive; font-size: 2.2rem; margin: 0 0 18px; }
.modal-close {
  position: absolute;
  right: 18px;
  top: 18px;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0edf8;
  font-size: 1.4rem;
}

.story-so-far { display: grid; gap: 10px; }
.story-so-far p {
  margin: 0;
  padding: 13px 15px;
  border-radius: 14px;
  background: #f8f6ff;
  line-height: 1.5;
}

.login-modal-card {
  width: min(500px, 100%);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(232,232,240,.9);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(24, 18, 54, .24);
}

.login-modal-hero {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  align-items: start;
  padding: 30px 32px 24px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(113,85,217,.08), rgba(255,255,255,0)),
    #ffffff;
  border-bottom: 1px solid var(--line);
}

.login-modal-hero h2 {
  margin: 7px 0 8px;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1.02;
}

.login-modal-hero p {
  margin: 0;
  max-width: 360px;
  color: var(--muted);
  line-height: 1.55;
}

.login-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  background: #7155d9;
  font-family: "Baloo 2", cursive;
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(113,85,217,.25);
}

.login-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: var(--purple);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-form {
  display: grid;
  gap: 18px;
  padding: 18px 28px 28px;
  background: transparent;
}

.login-form .button {
  border: 0;
  width: 100%;
  min-height: 52px;
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(113,85,217,.18);
}

.login-form .settings-field {
  gap: 9px;
}

.login-form .settings-field input {
  min-height: 56px;
  border: 2px solid #ece9f6;
  border-radius: 18px;
  background: white;
  font-size: 1.04rem;
  letter-spacing: .02em;
}

.login-form .settings-field input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(113,85,217,.12);
}

.phone-input-row {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 10px;
}

.phone-input-row select {
  min-height: 56px;
  border: 2px solid #ece9f6;
  border-radius: 18px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.login-progress {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.current-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid #e8e3fb;
  border-radius: 18px;
  background: #f8f6ff;
}

.current-user-card[hidden] {
  display: none;
}

.current-user-card span,
.current-user-card strong {
  display: block;
}

.current-user-card span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.current-user-card strong {
  margin-top: 3px;
  color: var(--ink);
}

.current-user-card .button {
  width: auto;
  min-height: 42px;
  padding: 0 16px;
  box-shadow: none;
}

.login-progress span {
  height: 4px;
  border-radius: 999px;
  background: #e8e8f0;
}

.login-progress span.is-active {
  background: var(--purple);
}

.login-step {
  display: none;
  gap: 16px;
}

.login-step.is-active {
  display: grid;
}

.otp-message {
  padding: 14px 15px;
  border-radius: 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-weight: 900;
  line-height: 1.35;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--purple);
  font-weight: 900;
  text-align: center;
}

.login-modal-card .modal-close {
  top: 18px;
  right: 18px;
  color: var(--muted);
  background: #f4f2fb;
}

.login-modal-card .modal-close:hover {
  color: var(--ink);
  background: #ece7ff;
}

.login-page-shell {
  min-height: calc(100vh - 86px);
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(360px, 440px);
  gap: 80px;
  align-items: center;
  padding: 35px 0 90px;
}

.login-page-copy h1 {
  margin: 0;
  max-width: 560px;
  font-family: "Baloo 2", cursive;
  font-size: clamp(3rem, 5vw, 5rem);
  line-height: 1;
}

.login-page-copy p {
  max-width: 520px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.login-emoji-scene {
  position: relative;
  width: min(430px, 100%);
  height: 150px;
  margin-bottom: 26px;
}

.login-emoji-card {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: white;
  box-shadow: var(--shadow);
  font-size: 2rem;
}

.login-emoji-card.card-a {
  left: 4px;
  top: 46px;
  width: 78px;
  height: 78px;
  background: #fff4c9;
  transform: rotate(-8deg);
}

.login-emoji-card.card-b {
  left: 92px;
  top: 8px;
  width: 58px;
  height: 58px;
  background: #eee9ff;
  transform: rotate(7deg);
}

.login-emoji-card.card-c {
  left: 170px;
  top: 60px;
  width: 70px;
  height: 70px;
  background: #dff5ff;
  transform: rotate(5deg);
}

.login-emoji-card.card-d {
  left: 258px;
  top: 22px;
  width: 64px;
  height: 64px;
  background: #effcf7;
  transform: rotate(-5deg);
}

.login-page-panel {
  overflow: hidden;
  border: 1px solid #e8e3fb;
  border-radius: 28px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 22px 60px rgba(50, 38, 110, .14);
}

.login-panel-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 28px 28px 18px;
  background: linear-gradient(180deg, #f8f5ff, rgba(255,255,255,0));
}

.login-panel-top h2 {
  margin: 8px 0 0;
  font-family: "Baloo 2", cursive;
  font-size: 2.2rem;
  line-height: 1;
}

.login-panel-top .login-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.profile-menu {
  position: relative;
  z-index: 40;
}

.profile-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  background: white;
  color: var(--ink);
  font-weight: 900;
}

.profile-button:hover {
  border-color: #cbbffc;
  background: #fbf9ff;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--purple);
  color: white;
  font-size: .72rem;
}

.profile-chevron {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1;
  transition: transform .2s ease;
}

.profile-button[aria-expanded="true"] .profile-chevron {
  transform: rotate(180deg);
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 50;
  min-width: 220px;
  display: none;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 18px 45px rgba(50,38,110,.16);
}

.profile-dropdown.is-open {
  display: grid;
}

.profile-dropdown-head {
  padding: 10px 11px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 900;
  border-bottom: 1px solid var(--line);
}

.profile-dropdown a,
.profile-dropdown button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 11px;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  font: inherit;
  font-weight: 800;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover {
  border-radius: 10px;
  background: #f6f3ff;
}

.my-stories-shell {
  max-width: 1160px;
  padding: 56px 24px 90px;
}

.my-stories-page .story-main {
  display: block;
}

.flow-page .story-main {
  display: block;
}

.story-login-required-page .story-main {
  display: block;
}

.my-stories-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 30px;
  padding: 34px 36px;
  overflow: hidden;
  border: 1px solid rgba(232, 227, 251, .9);
  border-radius: 30px;
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 223, 110, .36), transparent 32%),
    radial-gradient(circle at 88% 10%, rgba(223, 245, 255, .8), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,246,255,.9));
  box-shadow: 0 22px 65px rgba(50,38,110,.1);
}

.my-stories-hero h1 {
  margin: 0;
  font-family: "Baloo 2", cursive;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1;
}

.my-stories-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
}

.my-stories-summary-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.new-story-button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-size: .9rem;
}

.my-stories-stickers {
  display: grid;
  grid-template-columns: repeat(2, 58px);
  gap: 12px;
  align-items: center;
}

.my-stories-stickers span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: white;
  box-shadow: 0 12px 30px rgba(50,38,110,.12);
  font-size: 1.8rem;
}

.my-stories-stickers span:first-child {
  grid-row: span 2;
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background: #fff4c9;
  font-size: 2.2rem;
}

.my-stories-stickers span:nth-child(2) {
  background: #eee9ff;
  transform: rotate(7deg);
}

.my-stories-stickers span:nth-child(3) {
  background: #dff5ff;
  transform: rotate(-6deg);
}

.story-list {
  display: grid;
  gap: 16px;
}

.my-story-card,
.empty-stories {
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(520px, 1.22fr);
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.94)),
    white;
  box-shadow: 0 14px 40px rgba(50,38,110,.08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.my-story-card-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px 2px;
}

.my-story-card-header h2 {
  margin: 0 0 5px;
  font-size: 1.35rem;
}

.my-story-card:hover {
  transform: translateY(-2px);
  border-color: #cbbffc;
  box-shadow: 0 20px 55px rgba(50,38,110,.12);
}

.my-story-card.my-story-card-edited {
  border-color: #8f79ff;
  box-shadow: 0 0 0 4px rgba(143,121,255,.16), 0 20px 55px rgba(50,38,110,.16);
}

.empty-stories { grid-template-columns: auto minmax(0, 1fr) auto; }
.empty-stories h2 { white-space: nowrap; }

.my-story-settings-box,
.my-story-room-box {
  min-height: 210px;
  display: grid;
  align-items: center;
  border: 1px solid #eee9fb;
  border-radius: 20px;
  background: rgba(255,255,255,.76);
}

.my-story-settings-box {
  align-content: center;
  gap: 8px;
  padding: 18px;
  background:
    radial-gradient(circle at 85% 12%, rgba(112,85,217,.10), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.84), rgba(248,246,255,.78));
}

.my-story-room-box {
  justify-items: stretch;
  align-content: center;
  gap: 12px;
  padding: 18px;
  background:
    radial-gradient(circle at 85% 12%, rgba(116,219,190,.18), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(248,246,255,.78));
}


.my-story-kicker {
  display: block;
  margin: 0 0 6px;
  color: var(--purple);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.my-story-room-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.my-story-room-heading .my-story-kicker {
  margin-bottom: 0;
}

.create-room-heading-button {
  margin-left: auto;
  padding: 8px 12px;
  font-size: .78rem;
}

.my-story-room-box > strong {
  color: var(--ink);
  font-size: 1.16rem;
}


.my-story-card h2,
.empty-stories h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.my-story-card p,
.empty-stories p {
  margin: 0;
  color: var(--muted);
}

.my-story-main {
  min-width: 0;
}

.my-story-settings-inner {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #eee9fb;
  border-radius: 16px;
  background: rgba(255,255,255,.78);
}

.settings-item-person {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.settings-item-person strong,
.settings-item-person span {
  display: block;
}

.settings-item-person strong {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-item-person span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
}

.my-story-line {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.35;
}

.my-story-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eee9ff;
  font-size: 1.45rem;
  box-shadow: inset 0 0 0 1px rgba(113,85,217,.08);
}

.my-story-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.my-story-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.my-story-card-meta span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f8f6ff;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
}

.story-date {
  display: grid;
  gap: 3px;
  text-align: right;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
  white-space: nowrap;
}

.story-date small {
  color: #9892aa;
  font-size: .76rem;
  font-weight: 800;
}

.story-date-inline {
  display: block;
  margin: 0;
  color: #7a748d;
  font-size: .86rem;
  font-weight: 900;
}

.my-story-settings-actions,
.my-story-room-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.my-story-settings-actions {
  margin-top: 0;
  flex-wrap: wrap;
}

.my-story-settings-actions .icon-action-button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  border: 1px solid #e3def8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(50,38,110,.06);
}

.my-story-room-actions {
  justify-content: center;
}


.my-story-room-list {
  display: grid;
  gap: 10px;
}

.my-story-room-item {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #eee9fb;
  border-radius: 16px;
  background: rgba(255,255,255,.78);
}

.room-item-person {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.room-item-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  position: relative;
}

.room-action-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid #eee9fb;
  border-radius: 16px;
  background: rgba(255,255,255,.78);
}

.story-action-group {
  background: rgba(255,249,232,.78);
  border-color: #f3e5bd;
}

.room-action-label {
  padding: 0 4px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.room-item-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eee9ff;
  font-size: 1.45rem;
}

.room-item-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.room-item-main {
  min-width: 0;
}

.room-item-main strong,
.room-item-main span {
  display: block;
}

.room-item-main strong {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-item-main span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
}

.room-session-status {
  display: inline-flex;
  width: max-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: .72rem;
  font-weight: 900;
  justify-self: end;
}

.room-story-count {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #ded6ff;
  border-radius: 999px;
  background: #f8f6ff;
  color: var(--purple);
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}

.story-download-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 0;
  border-radius: 18px;
  background: #f4f4f5;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.story-download-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 5;
  min-width: 210px;
  padding: 14px;
  border: 1px solid #eee9fb;
  border-radius: 16px;
  background: white;
  box-shadow: 0 18px 38px rgba(47,38,96,.14);
}

.story-download-menu button {
  width: 100%;
  padding: 12px 10px;
  border: 0;
  background: transparent;
  color: var(--purple-dark);
  text-align: left;
  font: inherit;
  font-weight: 900;
}

.story-video-button,
.story-eye-button,
.story-download-icon-button,
.room-edit-button,
.room-delete-button {
  width: 42px;
  height: 42px;
  border: 1px solid #e3def8;
  border-radius: 14px;
  background: #fff;
  color: var(--purple);
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(50,38,110,.06);
}

.room-delete-button {
  color: #c45d72;
}

.story-chat-modal-card {
  max-height: min(760px, calc(100vh - 60px));
  padding: 28px;
  border: 0;
  border-radius: 28px;
  background: linear-gradient(180deg, #fff, #fbf9ff);
  overflow: hidden;
}

.story-chat-modal .room-chat-lines {
  max-height: min(560px, calc(100vh - 210px));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 42px 8px 12px;
}

.story-chat-modal .room-chat-line {
  position: relative;
  width: auto;
  max-width: min(720px, calc(100% - 42px));
  margin-left: 0;
  margin-right: 0;
}

.story-chat-modal .room-chat-line.is-user {
  padding-right: 44px;
}

.story-chat-modal .room-chat-line.is-user .line-reset-button {
  top: -14px;
  right: -14px;
  z-index: 3;
}

.story-chat-modal .flow-line-avatar {
  position: static;
  float: left;
  margin: 0 10px 6px 0;
}

.story-chat-modal .room-chat-line.is-user .flow-line-avatar {
  position: absolute;
  top: 50%;
  right: -46px;
  transform: translateY(-50%);
  float: none;
  margin: 0;
  z-index: 1;
}

.story-chat-modal .modal-close,
.story-video-modal .modal-close {
  top: 22px;
  right: 22px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f3f0ff;
  font-size: 1.4rem;
  line-height: 1;
}

.story-video-modal-card {
  padding: 30px;
  border: 0;
  border-radius: 28px;
  background:
    radial-gradient(circle at 90% 0%, rgba(116,219,190,.18), transparent 34%),
    linear-gradient(180deg, #fff, #fbf9ff);
}

.story-video-modal-card h2 {
  margin: 6px 0 18px;
  color: var(--ink);
}

.story-video-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.story-video-modal-actions .button,
.video-status-button,
.video-copy-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #e3def8;
  border-radius: 14px;
  background: #fff;
  color: var(--purple);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
}

.video-status-panel {
  padding: 16px;
  border: 1px solid #eee9fb;
  border-radius: 18px;
  background: #fff;
}

.video-status-panel strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.video-status-panel p {
  margin: 0 0 12px;
  color: var(--muted);
}

.mock-video-upgrade {
  display: grid;
  gap: 16px;
}

.mock-video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mock-video-card {
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border: 1px solid #eee9fb;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(255,205,85,.18), transparent 34%),
    linear-gradient(180deg, #fff, #fbfaff);
  box-shadow: 0 10px 24px rgba(50,38,110,.06);
}

.mock-video-card video {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
  border: 0;
  border-radius: 14px;
  background: #17142a;
}

.mock-video-upgrade-note {
  padding: 16px;
  border-radius: 18px;
  background: #f6f2ff;
}

.mock-video-upgrade-note p {
  margin-bottom: 0;
}

.sessions-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid #7055d9;
  border-radius: 16px;
  background: #7055d9;
  color: white;
  font-weight: 900;
  white-space: nowrap;
  text-decoration: none;
}
.story-action-text-button,
.story-share-button,
.create-room-inline-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid #d7f1e8;
  border-radius: 16px;
  background: #f3fffb;
  color: #108b72;
  font: inherit;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.story-action-text-button:hover,
.story-share-button:hover,
.create-room-inline-button:hover,
.sessions-button:hover {
  border-color: #21b394;
  transform: translateY(-1px);
}

.story-flow-button {
  background: #f3fffb;
  border-color: #d7f1e8;
  color: #108b72;
  text-decoration: none;
}

.story-clone-button {
  background: #fff9e8 !important;
  border-color: #f1e0b3 !important;
  color: #a87300 !important;
}
.story-edit-button {
  background: #f3fffb !important;
  border-color: #cfeee4 !important;
  color: #108b72 !important;
}
.story-share-button {
  background: #effcf8 !important;
  border-color: #cfeee4 !important;
  color: #108b72 !important;
}
.story-delete-button { width: 42px; height: 42px; padding: 0; border: 1px solid #e3def8; border-radius: 14px; background: #fff; color: #c45d72; font-size: 1rem; cursor: pointer; box-shadow: 0 5px 14px rgba(50,38,110,.06); }
.story-delete-button i,
.story-clone-button i,
.story-edit-button i,
.story-share-button i,
.rooms-plus i { font-size: 1rem; line-height: 1; }

.create-room-inline-button {
  background: #7055d9;
  border-color: #7055d9;
  color: white;
}

.create-room-heading-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid #7055d9;
  border-radius: 14px;
  background: linear-gradient(135deg, #7055d9, #8b6bea);
  color: #fff;
  font: inherit;
  font-size: .8rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(112,85,217,.20);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.create-room-inline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: .8rem;
}

.create-room-heading-button:hover {
  border-color: #5f46c8;
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(112,85,217,.28);
}

.create-room-heading-button:focus-visible {
  outline: 3px solid rgba(112,85,217,.25);
  outline-offset: 3px;
}
.share-icon-action { width: 54px; min-width: 54px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 0; }
.share-icon-action svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.story-delete-button:hover { border-color: #f0b7c3; background: #fff5f7; transform: translateY(-1px); }

.sessions-button span {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eee9ff;
  color: var(--purple);
  font-size: .78rem;
}

.room-share-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(31,25,62,.52);
  backdrop-filter: blur(6px);
}

.room-share-modal.is-open {
  display: flex;
}

.room-share-dialog {
  width: min(620px, 100%);
  position: relative;
  overflow: hidden;
  padding: 30px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255,214,91,.26), transparent 34%),
    radial-gradient(circle at 100% 12%, rgba(116,219,190,.18), transparent 32%),
    white;
  box-shadow: 0 28px 80px rgba(24,18,54,.24);
}

.room-share-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.room-share-hero-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(145deg, #7355d9, #f0769b);
  color: white;
  box-shadow: 0 14px 28px rgba(113,82,220,.20);
  font-size: 1.5rem;
}

.room-share-dialog h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 1.7rem;
}

.room-share-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #f9f7ff;
  color: var(--ink);
  font-size: 1.2rem;
}

.room-share-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #eee8fa;
  border-radius: 16px;
  background: rgba(255,255,255,.78);
  color: #5f6570;
  font-size: .98rem;
  font-weight: 800;
  word-break: break-all;
}

.room-share-preview {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #eee8fa;
  border-radius: 22px;
  background: rgba(251,249,255,.82);
}

.room-share-preview img {
  width: 132px;
  height: 132px;
  padding: 10px;
  border-radius: 18px;
  background: white;
  box-shadow: 0 12px 26px rgba(50,38,110,.10);
}

.room-share-actions {
  display: grid;
  gap: 10px;
}

.room-share-option {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #d7f1e8;
  border-radius: 18px;
  background: #f3fffb;
  color: #12a98d;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.room-share-option > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: white;
  box-shadow: 0 8px 18px rgba(18,169,141,.10);
}

.room-share-option strong {
  font-size: 1rem;
}

.room-share-option small {
  grid-column: 2;
  margin-top: -8px;
  color: #6f7480;
  font-size: .9rem;
  font-weight: 600;
}

@media (max-width: 620px) {
  .room-share-preview { grid-template-columns: 1fr; justify-items: center; }
  .room-share-link { width: 100%; }
}

.sessions-button .rooms-plus {
  background: var(--purple);
  color: white;
  cursor: pointer;
}

.sessions-button .rooms-plus:hover {
  background: var(--purple-dark);
}

.story-action-modal,
.story-chat-modal,
.story-video-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  overflow-y: auto;
  padding: 28px 16px;
  background: rgba(31, 25, 62, .55);
  backdrop-filter: blur(6px);
}

.story-action-modal.show,
.story-chat-modal.show,
.story-video-modal.show {
  display: block;
}

.story-action-modal .modal-dialog,
.story-chat-modal .modal-dialog,
.story-video-modal .modal-dialog {
  width: min(1050px, 100%);
  margin: 0 auto;
}

.story-action-modal .modal-content,
.story-chat-modal .modal-content,
.story-video-modal .modal-content {
  position: relative;
  box-shadow: 0 28px 80px rgba(24, 18, 54, .24);
}

.story-action-modal .modal-close,
.story-chat-modal .modal-close,
.story-video-modal .modal-close {
  z-index: 2;
  color: var(--ink);
}

.compact-session-modal .modal-dialog {
  width: min(760px, 100%);
}

.session-list-card {
  position: relative;
  padding: 32px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 223, 110, .26), transparent 28%),
    radial-gradient(circle at 90% 0%, rgba(223, 245, 255, .65), transparent 32%),
    white;
  box-shadow: 0 28px 80px rgba(24, 18, 54, .24);
}

.session-list-card h2 {
  margin: 6px 0 18px;
  font-family: "Baloo 2", cursive;
  font-size: 2rem;
  line-height: 1;
}

.session-list {
  display: grid;
  gap: 12px;
}

.session-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 10px 28px rgba(50,38,110,.06);
}

.session-main-cell {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.session-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #eee9ff;
  font-size: 1.65rem;
}

.session-info {
  min-width: 0;
}

.session-title-row {
  display: block;
}

.session-title-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-title-main strong {
  color: var(--ink);
  font-size: 1rem;
}

.session-title-main span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: .72rem;
  font-weight: 900;
}

.story-video-modal-actions button[hidden] {
  display: none !important;
}

.session-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.session-meta-row span {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 12px;
  background: white;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.session-actions-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.session-actions-row a,
.session-actions-row button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  text-decoration: none;
}

.icon-action-button {
  width: 40px;
  min-width: 40px;
  padding: 0 !important;
  font-size: 1rem !important;
}

.session-date {
  display: grid;
  gap: 3px;
  min-width: 118px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 900;
  text-align: right;
}

.session-date small {
  color: #9892aa;
  font-size: .74rem;
}

.session-enter-button {
  background: var(--purple) !important;
  border-color: var(--purple) !important;
  color: white !important;
}

.session-delete-button {
  color: #b42318 !important;
}

.session-list-item.is-delete-pending {
  opacity: .62;
}

.story-lines-button {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid #d8d0ff;
  border-radius: 12px;
  background: #f8f6ff;
  color: var(--purple);
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  text-align: left;
}

.story-lines-button:hover {
  background: #eee9ff;
}

.room-chat-panel {
  margin: 4px 0 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #fbf9ff);
  box-shadow: 0 14px 36px rgba(50,38,110,.1);
}

.room-chat-panel[hidden] {
  display: none;
}

.room-chat-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.room-chat-head strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
}

.room-chat-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eee9ff;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
}

.room-chat-lines {
  display: grid;
  gap: 10px;
  max-height: 310px;
  overflow: auto;
}

.room-chat-line {
  width: min(82%, 560px);
  padding: 16px 20px;
  border-radius: 20px;
  border: 1px solid rgba(79,54,181,.08);
  box-shadow: 0 10px 24px rgba(50,38,110,.07);
  transition: transform .2s ease, box-shadow .2s ease;
}
.room-chat-line:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(50,38,110,.11); }
.flow-line-avatar { position: absolute; top: 14px; left: -48px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: #eee9ff; font-size: 1.35rem; }
.room-chat-line.is-user .flow-line-avatar { left: auto; right: -48px; background: #fff4c9; }

.flow-line-avatar img,
.avatar img,
.voice-title-avatar img,
.voice-line-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.room-chat-line span {
  display: block;
  margin-bottom: 4px;
  color: var(--purple);
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.room-chat-line p {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
  font-size: 1rem;
}

.room-chat-line.is-user {
  justify-self: end;
  background: var(--yellow);
  border-bottom-right-radius: 7px;
  border-color: rgba(125,90,0,.12);
}

.room-chat-line.is-ai {
  justify-self: start;
  background: linear-gradient(135deg, #f8f6ff, #f0ecff);
  border-bottom-left-radius: 7px;
}
.prompt-bubble .speaker { display: block; }
.ai-reaction { display: flex; width: fit-content; align-items: center; gap: 10px; margin: 9px 0 12px; padding-left: 10px; border-left: 4px solid var(--yellow); color: #c05b35; }
.ai-reaction .big-reaction { font-size: 1.8rem; line-height: 1; }
.ai-reaction strong { font-family: "Baloo 2", cursive; font-size: 1.2rem; line-height: 1.1; font-weight: 700; }
.thinking-bubble { background: #f8f6ff; border-bottom-left-radius: 7px; }
.thinking-bubble p { color: var(--muted); font-weight: 800; }
.thinking-dots { display: inline-flex; gap: 4px; margin-left: 4px; vertical-align: middle; }
.thinking-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--purple); animation: thinkingPulse 1.2s infinite ease-in-out; }
.thinking-dots i:nth-child(2) { animation-delay: .15s; }
.thinking-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes thinkingPulse { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.flow-stage {
  max-width: 980px;
  width: min(100% - 32px, 980px);
  padding-bottom: 90px;
}

.flow-topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.back-story-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.flow-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 223, 110, .26), transparent 30%),
    radial-gradient(circle at 92% 10%, rgba(223, 245, 255, .72), transparent 34%),
    white;
  box-shadow: 0 18px 55px rgba(50,38,110,.08);
}

.flow-hero h1 {
  margin: 4px 0 8px;
  font-family: "Baloo 2", cursive;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.flow-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.flow-sticker {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: #eee9ff;
  font-size: 2.2rem;
}

.flow-chat-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 18px 48px rgba(50,38,110,.1);
}

.flow-chat-lines {
  max-height: none;
  overflow: visible;
}

.session-note {
  margin: -2px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8f6ff;
  color: var(--purple-dark);
  font-size: .86rem;
  font-weight: 900;
}

.session-note[hidden] {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

@media (max-width: 980px) {
  .desktop-nav { display: none; }
  .menu-button { display: block; }
  .hero, .split-section, .parent-panel { grid-template-columns: 1fr; }
  .pricing-hero { grid-template-columns: 1fr; min-height: auto; gap: 30px; }
  .pricing-visual-card { min-height: 470px; }
  .credit-use-grid { grid-template-columns: repeat(2, 1fr); }
  .credit-examples-card { grid-template-columns: 1fr; }
  .credit-pack-grid { grid-template-columns: 1fr; }
  .credit-pack-card.featured-pack { transform: none; }
  .payment-method-card { grid-template-columns: 1fr; }
  .pricing-note-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 35px; }
  .steps-grid, .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-band { grid-template-columns: repeat(2, 1fr); }
  .site-footer { flex-direction: column; text-align: center; padding: 40px 0; }
  .story-main { grid-template-columns: 1fr; }
  .story-sidebar { display: none; }
  .composer-wrap { left: 20px; right: 20px; }
  .story-summary-card { grid-template-columns: 1fr; }
  .my-stories-hero { grid-template-columns: 1fr; }
  .my-stories-stickers { justify-content: start; }
  .my-story-card { grid-template-columns: 1fr; }
  .my-story-room-box { justify-items: start; }
  .my-story-room-actions { justify-content: flex-start; }
  .my-story-flow-box { justify-items: start; }
  .my-story-flow-actions { justify-content: flex-start; }
  .room-item-actions { flex-wrap: wrap; }
}

@media (max-width: 680px) {
  .section-shell, .site-header { width: min(100% - 24px, 1180px); }
  .hero { gap: 20px; min-height: auto; }
  .pricing-hero { padding: 36px 0 60px; }
  .pricing-hero-copy h1 { font-size: 3.1rem; }
  .pricing-hero-copy p { font-size: 1rem; }
  .pricing-visual-card { min-height: auto; display: grid; gap: 14px; place-items: stretch; }
  .pricing-visual-card::before,
  .credit-sparkle { display: none; }
  .credit-balance-card,
  .credit-mini-card {
    position: relative;
    inset: auto;
    width: 100%;
    transform: none;
  }
  .credit-balance-card { padding: 28px 22px; }
  .credit-balance-card strong { font-size: 5.5rem; }
  .credit-use-grid,
  .pricing-note-grid { grid-template-columns: 1fr; }
  .credit-how-section,
  .add-credits-section,
  .credit-examples-section,
  .pricing-note-grid { padding-bottom: 70px; }
  .credit-examples-card { padding: 24px 18px; border-radius: 24px; }
  .credit-example-list div { grid-template-columns: 1fr; }
  .credit-pack-card,
  .payment-method-card { padding: 24px 18px; border-radius: 24px; }
  .payment-method-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 3rem; }
  .hero-card-wrap { min-height: 450px; }
  .floating-card { font-size: .82rem; }
  .steps-grid, .mode-grid, .stats-band { grid-template-columns: 1fr; }
  .content-section, .split-section, .modes-section { padding: 80px 0; }
  .parent-panel { padding: 30px 22px; }
  .final-cta-inner { flex-direction: column; align-items: flex-start; }
  .story-meta { display: none; }
  .story-header { padding: 10px 14px; }
  .chat-stage { padding: 20px 14px 260px; }
  .settings-theme-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-theme-preview { grid-template-columns: 1fr; }
  .story-flow-options, .story-flow-details { grid-template-columns: 1fr; }
  .avatar-picker-grid { grid-template-columns: repeat(4, 1fr); }
  .settings-theme-preview-box,
  .settings-theme-preview-box img { min-height: 120px; }
  .ai-character-row { grid-template-columns: 1fr; }
  .scene-header { align-items: flex-start; }
  .scene-avatars { display: none; }
  .message-bubble { max-width: 84%; }
  .composer-wrap { bottom: 10px; left: 10px; right: 10px; padding: 9px; }
  .composer { grid-template-columns: 76px 1fr; }
  .voice-control-cluster { min-height: 92px; }
  .voice-button { width: 76px; height: 92px; border-radius: 20px; }
  .voice-controls { left: 8px; right: 8px; bottom: 8px; gap: 6px; }
  .voice-control-button { width: 26px; height: 26px; }
  .send-button { grid-column: 1 / -1; min-height: 46px; }
  .idea-chips { padding-left: 0; overflow-x: auto; flex-wrap: nowrap; }
  .encouragement { margin-left: 0; }
  .story-summary-card { padding: 24px 18px; border-radius: 22px; }
  .summary-copy h2 { font-size: 2rem; }
  .summary-link-card { padding: 18px; border-radius: 20px; }
  .summary-row { grid-template-columns: 1fr; align-items: start; }
  .summary-row:first-child { grid-template-columns: 1fr; }
  .summary-row span { justify-self: start; }
  .summary-url-row { grid-template-columns: 1fr; }
  .summary-url-row button { min-height: 46px; }
  .created-room-row,
  .link-tools-row { grid-template-columns: 1fr; }
  .link-tools-row button,
  .share-action,
  .enter-story-link { min-height: 46px; }
  .participant-panels { grid-template-columns: 1fr; }
  .participant-fields { grid-template-columns: 1fr; }
  .login-page-shell { grid-template-columns: 1fr; gap: 26px; padding-top: 30px; }
  .phone-input-row { grid-template-columns: 1fr; }
  .my-story-card,
  .empty-stories {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }
  .my-story-settings-box,
  .my-story-room-item {
    grid-template-columns: 1fr;
  }
  .my-story-room-item {
    justify-items: start;
  }
  .my-stories-shell { padding: 22px 14px 70px; }
  .my-stories-hero { padding: 24px 20px; border-radius: 24px; }
  .my-stories-stickers { grid-template-columns: repeat(3, 48px); }
  .my-stories-stickers span,
  .my-stories-stickers span:first-child {
    grid-row: auto;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 1.45rem;
  }
  .story-date { white-space: normal; }
  .sessions-button { width: 100%; }
  .session-list-card { padding: 24px 18px; }
  .session-list-item { grid-template-columns: 1fr; }
  .session-main-cell { grid-template-columns: 48px minmax(0, 1fr); }
  .session-avatar { width: 48px; height: 48px; border-radius: 16px; font-size: 1.4rem; }
  .session-date { text-align: left; }
  .session-actions-row { justify-content: flex-start; }
  .session-meta-row { grid-template-columns: 1fr; }
  .flow-topbar { flex-direction: column; }
  .flow-topbar .button,
  .back-story-button { width: 100%; }
  .flow-hero { grid-template-columns: 1fr; padding: 24px 20px; }
  .flow-sticker { width: 56px; height: 56px; border-radius: 18px; font-size: 1.7rem; }
}

@media (max-width: 600px) {
  .settings-stage,
  .my-stories-shell {
    padding-inline: 12px;
  }

  .settings-card,
  .my-story-card,
  .my-story-settings-box,
  .my-story-room-box {
    border-radius: 18px;
  }

  .settings-card {
    padding: 22px 16px;
  }

  .story-flow-option {
    padding: 14px;
    border-radius: 16px;
  }

  .story-flow-details,
  .starter-field {
    gap: 10px;
  }

  .my-stories-hero {
    padding: 20px 16px;
  }

  .my-stories-summary-row,
  .my-story-room-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .new-story-button,
  .create-room-heading-button,
  .create-room-inline-button {
    width: 100%;
    justify-content: center;
  }

  .my-story-settings-box,
  .my-story-room-box {
    min-height: 0;
    padding: 16px;
  }

  .my-story-settings-inner,
  .my-story-room-item {
    padding: 10px;
    border-radius: 14px;
  }

  .room-item-person {
    width: 100%;
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .room-item-avatar,
  .my-story-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 1.3rem;
  }

  .room-session-status {
    align-self: start;
  }

  .room-item-actions,
  .room-action-group {
    width: 100%;
  }

  .room-action-group {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .room-action-group .sessions-button {
    width: auto;
    flex: 0 0 auto;
  }

  .room-action-label {
    flex: 0 0 auto;
  }
}

.story-loading {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

body.story-writing-hidden .text-input-wrap {
  display: none;
}

.story-is-loading .chat-stage {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
  max-width: none;
  padding-bottom: 28px;
}

.story-is-loading .story-main {
  display: block;
  width: 100%;
}

.story-is-loading .story-sidebar,
.story-is-loading .scene-header,
.story-is-loading .composer-wrap {
  display: none !important;
}

.voice-story-page .story-app,
.voice-story-page .story-main {
  min-height: 100vh;
}

.voice-story-page {
  background: #2d315b;
  overflow-x: hidden;
}

.voice-story-page .story-app,
.voice-story-page .story-main {
  background: #2d315b;
}

.voice-story-page .story-main {
  display: block;
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.story-is-loading .voice-story-stage {
  visibility: hidden;
}

.story-is-loading .voice-story-shell {
  visibility: hidden;
}

.voice-story-stage {
  min-height: 100vh;
  width: 100%;
  margin-left: 0;
  padding: 42px 18px;
  background:
    radial-gradient(circle at 12% 16%, rgba(255,220,126,.9) 0 1px, transparent 2px) 0 0 / 190px 150px,
    radial-gradient(circle at 74% 12%, rgba(255,255,255,.85) 0 1px, transparent 2px) 0 0 / 230px 180px,
    radial-gradient(ellipse at 50% 88%, rgba(238,178,111,.35) 0 14%, transparent 38%),
    radial-gradient(ellipse at 50% 5%, rgba(255,223,143,.30), transparent 34%),
    radial-gradient(ellipse at 82% 38%, rgba(126,177,226,.24), transparent 30%),
    linear-gradient(180deg, #2d315b 0%, #4d4a78 48%, #8b6c62 100%);
  position: relative;
  overflow: hidden;
}

.voice-story-stage.has-bg-theme {
  background-attachment: fixed;
  background-color: transparent;
  background-position: center top;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  animation: storyBackgroundMotion 14s ease-in-out infinite alternate;
}

@keyframes storyBackgroundMotion {
  from { background-position: 48% 48%; }
  to { background-position: 52% 52%; }
}

.voice-story-stage.has-bg-theme::before {
  display: none;
}

/* Tone down bright theme artwork without dimming the story controls. */
.voice-story-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(20, 18, 45, .22);
}

.voice-story-stage.has-bg-theme::after {
  display: none !important;
}

.voice-story-stage.has-bg-theme .voice-story-shell::before,
.voice-story-stage.has-bg-theme .voice-story-shell::after {
  display: none;
}

.voice-story-stage::before,
.voice-story-stage::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.voice-story-stage::before {
  animation: roomFloorGlow 9s ease-in-out infinite alternate;
}

.voice-story-stage::before,
.voice-story-stage::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.voice-story-stage::before {
  left: 0;
  right: 0;
  bottom: 0;
  height: 190px;
  background:
    linear-gradient(180deg, rgba(145,99,62,.08), rgba(145,99,62,.16)),
    #d8ad7c;
  border-top: 1px solid rgba(255,226,170,.30);
  box-shadow: inset 0 18px 45px rgba(72,42,43,.16);
}

.voice-story-stage::after {
  content: "📚 ✨ 🌙";
  right: 34px;
  bottom: 28px;
  color: rgba(38,48,82,.16);
  font-size: 2.2rem;
  letter-spacing: 14px;
}


.voice-story-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.voice-story-shell::before,
.voice-story-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.voice-story-shell::before {
  width: 170px;
  height: 170px;
  right: 34px;
  top: 64px;
  border: 10px solid rgba(255,255,255,.55);
  border-radius: 42px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.42) 1px, transparent 1px) 50% / 50% 100%,
    linear-gradient(180deg, rgba(255,255,255,.50) 1px, transparent 1px) 50% / 100% 50%,
    linear-gradient(145deg, rgba(180,233,255,.50), rgba(255,255,255,.34));
  box-shadow: 0 24px 48px rgba(74,60,130,.10);
  animation: windowGlow 7s ease-in-out infinite alternate;
}

.voice-story-shell::after {
  width: 118px;
  height: 118px;
  right: 66px;
  bottom: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,222,122,.75) 0 26px, transparent 27px),
    linear-gradient(180deg, transparent 54px, rgba(122,85,47,.28) 55px 60px, transparent 61px),
    radial-gradient(circle at 50% 52%, rgba(255,246,216,.60), rgba(255,246,216,.08) 62%, transparent 64%);
  opacity: .55;
  animation: moonFloat 8s ease-in-out infinite;
}

@keyframes windowGlow {
  from { box-shadow: 0 24px 48px rgba(74,60,130,.10), 0 0 22px rgba(180,233,255,.12); }
  to { box-shadow: 0 24px 48px rgba(74,60,130,.10), 0 0 42px rgba(180,233,255,.30); }
}

@keyframes moonFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

@keyframes roomFloorGlow {
  from { opacity: .82; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .voice-story-stage::before,
  .voice-story-shell::before,
  .voice-story-shell::after { animation: none; }
}

.voice-story-stage::after {
  content: "";
  width: 170px;
  height: 210px;
  left: 28px;
  top: 92px;
  right: auto;
  bottom: auto;
  border-radius: 10px;
  background:
    repeating-linear-gradient(90deg, #7044a6 0 12px, #f5bd4b 12px 23px, #4da88f 23px 35px, #d85f7e 35px 47px, #e8d7a1 47px 57px, transparent 57px 70px) 18px 15px / 134px 48px no-repeat,
    repeating-linear-gradient(90deg, #d85f7e 0 10px, #4c73b4 10px 23px, #e4b34f 23px 34px, #8254ad 34px 47px, transparent 47px 66px) 22px 81px / 128px 48px no-repeat,
    repeating-linear-gradient(90deg, #4da88f 0 13px, #e8d7a1 13px 23px, #d85f7e 23px 35px, #7044a6 35px 48px, transparent 48px 69px) 17px 147px / 135px 48px no-repeat,
    linear-gradient(#6d4638 0 12px, transparent 12px 66px, #6d4638 66px 78px, transparent 78px 132px, #6d4638 132px 144px, transparent 144px 198px, #6d4638 198px 210px),
    linear-gradient(90deg, #744a39 0 12px, transparent 12px 158px, #744a39 158px);
  box-shadow: inset 0 0 0 5px #8c5b43, 0 20px 35px rgba(20,16,42,.28);
  opacity: .9;
  filter: drop-shadow(0 18px 28px rgba(20,16,42,.22));
  font-size: 0;
  letter-spacing: 0;
}

.voice-story-intro {
  text-align: center;
  margin: 0 auto 22px;
}

.voice-story-intro h1 {
  margin: 6px 0 8px;
  color: #fff8e8;
  text-shadow: 0 4px 18px rgba(14,16,48,.55);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.voice-turn-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin: 8px auto 10px;
}

.voice-turn-title-row h1 {
  margin: 0;
}

.voice-story-intro p,
.voice-story-intro .scene-kicker {
  color: #fff4d4;
  text-shadow: 0 2px 10px rgba(14,16,48,.55);
}

.voice-title-person {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.voice-title-avatar {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #e9e3f8;
  border-radius: 34px;
  font-size: 3.25rem;
  box-shadow: 0 22px 44px rgba(47,38,96,.15);
  position: relative;
}

.voice-title-avatar::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 40px;
  border: 1px solid rgba(255,255,255,.78);
  pointer-events: none;
}

.voice-title-teller {
  background: linear-gradient(145deg, #fff6d8, #f0eaff);
}

.voice-title-ai {
  background: linear-gradient(145deg, #e7fff8, #f2ecff);
}

.voice-title-name {
  max-width: 130px;
  padding: 7px 12px;
  border: 1px solid #ebe5f7;
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(47,38,96,.08);
}

.voice-story-intro p {
  margin: 0;
  color: #f8f2e8;
  font-weight: 800;
}

.voice-story-grid {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(420px, 1fr);
  gap: 24px;
  align-items: start;
}

.voice-writing-hidden .voice-story-grid {
  grid-template-columns: minmax(300px, 420px) minmax(420px, 1fr);
}

.voice-writing-hidden.voice-wake-debug-open .voice-story-grid {
  grid-template-columns: minmax(300px, 420px) minmax(420px, 1fr);
}

.voice-session-done .voice-story-grid {
  grid-template-columns: minmax(0, 1fr);
}

.voice-session-done .voice-writing-card,
.voice-session-done .voice-messages {
  min-width: 0;
}

.voice-session-done .voice-messages {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: visible;
  max-height: none;
}

.voice-session-done .voice-line,
.voice-session-done .voice-line-bubble,
.voice-session-done .voice-line-bubble p {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.voice-session-done .voice-left-column,
.voice-session-done .voice-text-form,
.voice-session-done .voice-flow-helper,
.voice-session-done .voice-pencil-button {
  display: none !important;
}

.voice-left-column {
  display: grid;
  gap: 14px;
  align-content: start;
}

.voice-writing-hidden .voice-text-form {
  display: none;
}

.voice-flow-helper {
  margin: -6px 0 0;
  padding: 10px 14px;
  border: 1px solid #eee9fb;
  border-radius: 14px;
  background: #f8f6ff;
  color: var(--purple-dark);
  font-size: .88rem;
  font-weight: 900;
  line-height: 1.35;
}

.voice-flow-helper[hidden] {
  display: none !important;
}

.voice-auto-pending .voice-story-grid {
  display: none;
}

.voice-auto-pending .voice-story-intro {
  min-height: 58vh;
  display: grid;
  align-content: center;
}

.voice-story-card {
  border: 1px solid #e9e5f3;
  border-radius: 20px;
  background: rgba(255,255,255,.91);
  box-shadow: 0 24px 60px rgba(19,20,50,.24), 0 2px 0 rgba(255,255,255,.5) inset;
  backdrop-filter: blur(10px);
}

.voice-writing-card {
  border-color: rgba(255,255,255,.75);
  box-shadow: 0 24px 60px rgba(19,20,50,.24), inset 0 1px 0 rgba(255,255,255,.95);
}

.voice-writing-card {
  min-height: 320px;
  padding: 26px 28px 28px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.90)),
    radial-gradient(circle at 100% 0, rgba(255,205,85,.16), transparent 30%),
    radial-gradient(circle at 0 100%, rgba(116,219,190,.12), transparent 32%);
}

.voice-writing-hidden:not(.voice-has-chat) .voice-writing-card {
  min-height: 180px;
}

.voice-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 900;
}

.voice-card-topline span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.voice-card-topline i {
  font-style: normal;
}

.voice-pencil-button {
  min-width: 68px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #ebe6f6;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #fbf9ff);
  color: #6f55d9;
  font: inherit;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(50,38,110,.10);
}

.story-text-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  color: var(--muted);
  font-weight: 900;
}

.story-text-topline span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.story-toggle-button {
  min-width: 68px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #ebe6f6;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #fbf9ff);
  color: #6f55d9;
  font: inherit;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(50,38,110,.10);
}

.voice-messages {
  overflow: auto;
  min-height: 230px;
  max-height: min(52vh, 620px);
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 16px;
  border: 1px solid #ebe7f5;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(251,250,255,.96), rgba(255,252,246,.96)) padding-box,
    linear-gradient(135deg, rgba(112,85,217,.20), rgba(255,205,85,.18)) border-box;
}

.voice-writing-card { min-height: 0; }

.voice-empty-story {
  min-height: 200px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}
.voice-read-more { display: block; margin: 0 auto 12px; padding: 8px 16px; border: 0; border-radius: 999px; background: #eee9ff; color: var(--purple-dark); font: inherit; font-weight: 900; cursor: pointer; box-shadow: 0 6px 14px rgba(50,38,110,.10); }
.voice-read-more[hidden] { display: none !important; }
.voice-read-more:hover { background: #e2d9ff; }

.voice-empty-story span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #fff6d8;
  box-shadow: 0 10px 24px rgba(247,193,77,.18);
  font-size: 1.6rem;
}

.voice-line {
  display: flex;
  gap: 10px;
  margin: 0 0 14px;
  align-items: flex-end;
}

.voice-line[hidden],
.voice-line-hidden {
  display: none !important;
}

.voice-line-arriving {
  animation: voiceLineArrive .65s ease both;
}

@keyframes voiceLineArrive {
  from {
    opacity: 0;
    transform: translate(-18px, -18px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

.voice-user-line {
  flex-direction: row-reverse;
}

.voice-line-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f1ecff;
  flex: 0 0 auto;
  font-size: 1.35rem;
  box-shadow: 0 10px 22px rgba(47,38,96,.10);
}

.voice-line-bubble {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 18px;
  background: #f7f5ff;
  color: var(--ink);
}

.voice-line-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.voice-total-turns { margin-left: auto; opacity: .75; font-size: .8em; white-space: nowrap; }

.voice-user-line .voice-line-bubble {
  background: #fff4c9;
}

.voice-line-bubble span,
.voice-line-meta span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
}

.voice-line-bubble p {
  margin: 0;
  line-height: 1.45;
}

.voice-reaction {
  color: #7d60d8;
  margin: 0 0 5px;
}

.voice-line-speaker {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #6f55d9;
  position: relative;
  box-shadow: 0 8px 16px rgba(60,42,120,.10);
  flex: 0 0 auto;
}

.voice-line-speaker::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 9px;
  width: 7px;
  height: 10px;
  background: currentColor;
  clip-path: polygon(0 30%, 42% 30%, 100% 0, 100% 100%, 42% 70%, 0 70%);
}

.voice-line-speaker::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 8px;
  width: 8px;
  height: 12px;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 0 12px 12px 0;
}

.voice-action-card {
  align-self: start;
  min-height: 340px;
  height: auto;
  padding: 30px 24px 34px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 24px;
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,247,255,.94)),
    radial-gradient(circle at top right, rgba(255,205,85,.24), transparent 36%),
    radial-gradient(circle at 8% 12%, rgba(112,85,217,.10), transparent 32%);
  box-shadow: 0 20px 45px rgba(47,38,96,.12), inset 0 1px 0 rgba(255,255,255,.9);
}

.voice-action-card::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -52px;
  bottom: -58px;
  border-radius: 50%;
  background: rgba(118,219,190,.16);
}

.voice-action-card::after {
  content: "🪄";
  position: absolute;
  right: 28px;
  top: 28px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #eee8fa;
  border-radius: 50%;
  background: rgba(255,255,255,.88);
  box-shadow: 0 10px 20px rgba(60,42,120,.08);
}

.voice-card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #eee8fa;
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(80,58,150,.06);
  position: relative;
  z-index: 1;
}

.voice-transcript-toggle {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  margin-left: 4px;
  border: 1px solid #e4dcfb;
  border-radius: 50%;
  background: #fff;
  color: var(--purple);
  box-shadow: 0 6px 14px rgba(80,58,150,.08);
  cursor: pointer;
}

.voice-transcript-toggle.is-active {
  color: #fff;
  background: var(--purple);
  border-color: var(--purple);
}

.voice-card-status {
  min-height: 24px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
  position: relative;
  z-index: 1;
}

.voice-card-status:empty,
.voice-story-intro p:empty {
  display: none;
}

.voice-main-stack {
  position: relative;
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
  margin-top: 2px;
  z-index: 1;
}

.voice-ai-playing .voice-main-stack,
.voice-ai-playing .voice-hidden-listener,
.voice-ai-playing .voice-countdown-card,
.voice-ai-playing .voice-thinking-timer {
  display: none;
}

.voice-main-mic {
  width: 148px;
  height: 148px;
  position: relative;
  border: 0;
  border-radius: 34px;
  color: white;
  background: linear-gradient(145deg, #7255dc 0%, #c468b8 56%, #ff7fa2 100%);
  box-shadow: 0 22px 42px rgba(132,87,222,.34), 0 0 0 10px rgba(255,255,255,.52), 0 0 55px rgba(255,117,177,.22);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 22px 22px 58px;
}

.voice-main-mic::after {
  content: "";
  position: absolute;
  inset: -18px;
  border: 1px solid rgba(255,223,143,.42);
  border-radius: 42px;
  pointer-events: none;
  animation: magicRing 4s ease-in-out infinite;
}

@keyframes magicRing {
  0%, 100% { opacity: .25; transform: scale(.96); }
  50% { opacity: .8; transform: scale(1.04); }
}

.voice-main-mic.is-listening {
  animation: voicePulse 1.6s ease-in-out infinite;
}

.voice-main-mic.is-paused {
  background: linear-gradient(145deg, #8c83b6, #b9aecb);
}

.voice-main-mic-icon {
  width: 11px;
  height: 15px;
  border-radius: 7px 7px 6px 6px;
  border: 2px solid white;
  position: relative;
  flex: 0 0 auto;
}

.voice-main-mic-icon::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 10px;
  left: 50%;
  top: 8px;
  border: 2px solid white;
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: transparent;
  transform: translateX(-50%);
}

.voice-main-mic-icon::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 6px;
  left: 50%;
  top: 19px;
  border-radius: 999px;
  background: white;
  box-shadow: -5px 6px 0 -1px white, 5px 6px 0 -1px white;
  transform: translateX(-50%);
}

.voice-main-label {
  font-size: .92rem;
  font-weight: 900;
  line-height: 1;
}

.voice-playback-panel {
  width: 100%;
  min-height: 250px;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 18px;
  border: 1px solid #eee8fa;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(251,249,255,.92)),
    radial-gradient(circle at top left, rgba(255,205,85,.20), transparent 40%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.voice-playback-panel[hidden] {
  display: none !important;
}

.voice-playback-label {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff6d8;
  color: var(--ink);
  font-size: .76rem;
  font-weight: 900;
}

.voice-playback-panel p {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.5;
}

.voice-playback-panel p::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 3px;
  border-radius: 999px;
  background: #7255dc;
  vertical-align: -2px;
  animation: voiceCaretBlink .8s steps(2, start) infinite;
}

@keyframes voiceCaretBlink {
  50% { opacity: 0; }
}

.voice-playback-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.voice-playback-controls button {
  width: 38px;
  height: 38px;
  border: 1px solid #e8e2f5;
  border-radius: 50%;
  background: white;
  color: #6547d3;
  position: relative;
  box-shadow: 0 10px 20px rgba(60,42,120,.10);
}

.voice-playback-controls button::before,
.voice-playback-controls button::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

#voicePlaybackStop::before {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #b94862;
}

#voicePlaybackResume[aria-label="Pause answer"]::before {
  width: 12px;
  height: 14px;
  background: linear-gradient(to right, currentColor 0 4px, transparent 4px 8px, currentColor 8px 12px);
}

#voicePlaybackResume[aria-label="Resume answer"]::before {
  border-left: 13px solid currentColor;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  margin-left: 2px;
}

#voicePlaybackReplay::before {
  width: 16px;
  height: 16px;
  border: 3px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
}

#voicePlaybackReplay::after {
  width: 0;
  height: 0;
  margin: -9px 0 0 5px;
  border-left: 7px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transform: rotate(20deg);
}

.voice-text-form {
  width: 100%;
  display: grid;
  gap: 10px;
}

.voice-text-wrap {
  position: relative;
}

.voice-text-wrap textarea {
  min-height: 120px;
  border-color: #d8cffc;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.voice-send-button {
  min-height: 50px;
  border: 0;
  box-shadow: 0 12px 26px rgba(113,82,220,.22);
}

.voice-control-row {
  position: absolute;
  left: 50%;
  bottom: 13px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.voice-start-row {
  position: absolute;
  left: 50%;
  bottom: 13px;
  transform: translateX(-50%);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 18px rgba(60,42,120,.12);
  pointer-events: none;
}

.voice-main-mic.is-listening + .voice-start-row,
.voice-main-mic.is-paused + .voice-start-row {
  display: none;
}

.voice-start-icon {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-left: 13px solid #6547d3;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}

.voice-control-row[hidden] {
  display: none !important;
}

.voice-round-control {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  background: rgba(255,255,255,.96);
  color: #6547d3;
  position: relative;
  box-shadow: 0 8px 18px rgba(60,42,120,.12);
}

.voice-round-control::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.voice-round-control[aria-label="Pause listening"]::before {
  width: 11px;
  height: 13px;
  background: linear-gradient(to right, currentColor 0 4px, transparent 4px 7px, currentColor 7px 11px);
}

.voice-round-control[aria-label="Resume listening"]::before {
  border-left: 12px solid currentColor;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  margin-left: 2px;
}

.voice-stop-control {
  color: #b94862;
}

.voice-stop-control::before {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: currentColor;
}

.voice-countdown-card,
.voice-hidden-listener,
.voice-thinking-timer {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.94);
  text-align: center;
  color: #6f6888;
  font-weight: 800;
}

.voice-countdown-card strong,
.voice-hidden-listener strong,
.voice-thinking-timer strong {
  display: block;
  margin-top: 4px;
  color: #3f365b;
  font-size: 1.6rem;
}

.voice-hidden-listener small {
  display: block;
  margin-top: 4px;
  color: #7c7397;
}

.voice-card-status,
.voice-countdown-card span {
  color: #6f6888;
}

.wake-transcript-card {
  display: grid;
  gap: 8px;
  min-height: 0;
  padding: 18px;
  color: var(--muted);
  font-weight: 900;
}

.wake-transcript-card[hidden] {
  display: none !important;
}

.wake-transcript-card textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fbfaff;
  font-size: .85rem;
}

@media (max-width: 760px) {
  .mock-video-grid { grid-template-columns: 1fr; }
  .settings-help-hero { grid-template-columns: 1fr; padding-right: 54px; }
  .settings-help-grid { grid-template-columns: 1fr; }
  .hands-free-step { grid-template-columns: 1fr; }
  .voice-story-stage { padding: 24px 12px; }
  .voice-story-grid { grid-template-columns: 1fr; }
  .voice-writing-hidden.voice-wake-debug-open .voice-story-grid { grid-template-columns: 1fr; }
  .voice-writing-card,
  .voice-action-card { min-height: auto; }
  .voice-main-stack { width: 132px; height: 132px; }
  .voice-main-mic { width: 132px; height: 132px; border-radius: 32px; padding-bottom: 52px; }
  .voice-control-row { bottom: 10px; }
  .voice-turn-title-row { gap: 10px; }
  .voice-title-avatar { width: 58px; height: 58px; border-radius: 20px; font-size: 1.75rem; }
  .voice-title-avatar::after { inset: -4px; border-radius: 24px; }
  .voice-title-name { max-width: 76px; font-size: .68rem; padding: 6px 8px; }
  .voice-story-stage::after,
  .voice-story-shell::before,
  .voice-story-shell::after { display: none; }
}

@media (max-width: 600px) {
  .voice-story-stage {
    padding: 14px 10px 26px;
  }

  .voice-story-shell {
    gap: 14px;
  }

  .voice-story-intro {
    gap: 10px;
  }

  .voice-story-intro h1 {
    font-size: clamp(1.8rem, 10vw, 2.55rem);
    line-height: .95;
  }

  .voice-turn-title-row {
    grid-template-columns: 54px minmax(0, 1fr) 54px;
    align-items: start;
  }

  .voice-title-person {
    min-width: 0;
  }

  .voice-title-avatar {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    font-size: 1.45rem;
  }

  .voice-title-name {
    max-width: 54px;
    padding: 5px 6px;
    font-size: .62rem;
  }

  .voice-story-grid {
    gap: 14px;
  }

  .voice-left-column {
    gap: 10px;
  }

  .voice-action-card,
  .voice-writing-card {
    padding: 16px;
    border-radius: 18px;
  }

  .voice-main-stack {
    width: 108px;
    height: 108px;
  }

  .voice-main-mic {
    width: 108px;
    height: 108px;
    border-radius: 26px;
    padding: 18px 16px 42px;
  }

  .voice-main-mic::after {
    inset: -10px;
    border-radius: 32px;
  }

  .voice-control-row {
    bottom: 6px;
    gap: 8px;
  }

  .voice-round-control {
    width: 34px;
    height: 34px;
  }

  .voice-card-topline {
    min-height: 34px;
  }

  .voice-pencil-button {
    min-width: 54px;
    min-height: 32px;
    padding-inline: 10px;
  }

  .voice-text-form {
    gap: 10px;
  }

  .voice-text-wrap textarea {
    min-height: 132px;
    padding: 16px 16px 36px;
    font-size: 1rem;
  }

  .voice-send-button {
    min-height: 54px;
    border-radius: 18px;
  }

  .voice-flow-helper {
    padding: 9px 12px;
    border-radius: 12px;
    font-size: .82rem;
  }

  .voice-messages {
    min-height: 180px;
    max-height: 46vh;
    padding: 12px;
    border-radius: 16px;
  }

  .voice-line {
    gap: 8px;
    margin-bottom: 12px;
  }

  .voice-line-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 1.25rem;
  }

  .voice-line-bubble {
    padding: 14px;
    border-radius: 16px;
  }

  .voice-line-bubble p {
    font-size: .98rem;
  }

  .voice-user-line {
    padding-right: 0;
  }

  .voice-session-done .voice-messages {
    max-height: none;
  }
}

.story-is-loading .messages {
  min-height: calc(100vh - 132px);
  width: 100%;
  place-items: center;
}

.story-is-loading .story-loading {
  min-height: 0;
}

.loading-icon {
  font-size: 42px;
  animation: storyPulse 1s ease-in-out infinite;
}

@keyframes storyPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.55;
  }

  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}
