:root {
  --blue: #2d7dff;
  --blue-dark: #071944;
  --action-text: #3f73b6;
  --ink: #0b1742;
  --muted: #64749b;
  --soft: #eef6ff;
  --line: rgba(88, 130, 210, 0.22);
  --lavender: #eee9ff;
  --mint: #dffbf3;
  --sun: #ffd56a;
  --coral: #ff5d91;
  --paper: #ffffff;
  --white: #ffffff;
  --night: #06142f;
  --violet: #7662ff;
  --cyan: #49d9ff;
  --panel: #f8fbff;
  --shadow: 0 34px 90px rgba(2, 11, 34, 0.38);
  --glow: 0 0 28px rgba(73, 217, 255, 0.28);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 18% 10%, rgba(73, 217, 255, 0.36), transparent 34rem),
    radial-gradient(ellipse at 88% 8%, rgba(255, 255, 255, 0.78), transparent 30rem),
    linear-gradient(135deg, #06142f 0%, #1a2742 42%, #ebf5ff 100%);
  color: var(--ink);
  font-family:
    "DM Sans",
    "Inter",
    "Segoe UI",
    Arial,
    sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

.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;
}

button {
  border: 0;
}

.shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.phone {
  position: relative;
  width: min(430px, calc(100vw - 24px));
  height: min(941px, calc(100dvh - 24px));
  min-height: 680px;
  background: var(--white);
  border: 1px solid rgba(27, 117, 187, 0.08);
  border-radius: 34px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.screen {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
}

.screen-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 22px 20px 28px;
  width: 100%;
  overscroll-behavior: contain;
}

.screen-scroll.with-footer {
  padding-bottom: 24px;
}

.centered {
  justify-content: center;
  text-align: center;
}

.status {
  height: 34px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 0 24px 8px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.signal {
  display: flex;
  align-items: end;
  gap: 3px;
}

.signal span {
  width: 4px;
  background: currentColor;
  border-radius: 2px;
}

.signal span:nth-child(1) {
  height: 5px;
}

.signal span:nth-child(2) {
  height: 8px;
}

.signal span:nth-child(3) {
  height: 11px;
}

.battery {
  width: 24px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  position: relative;
}

.battery::before {
  content: "";
  position: absolute;
  inset: 2px;
  width: 14px;
  background: currentColor;
  border-radius: 2px;
}

.battery::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 3px;
  width: 2px;
  height: 5px;
  background: currentColor;
  border-radius: 0 2px 2px 0;
}

.appbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  z-index: 2;
}

.appbar-primary {
  display: contents;
}

.appbar-mobile-brand {
  display: none;
}

.appbar-actions {
  order: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.appbar-title {
  order: 1;
  min-width: 0;
  flex: 1;
}

.appbar-kicker {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 16px;
}

.appbar-kicker .eyebrow {
  margin: 0;
  line-height: 1;
}

.appbar-brand-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex: 0 0 16px;
  object-fit: contain;
}

.plan-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  border: 1px solid rgba(45, 125, 255, 0.22);
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  padding: 6px 9px;
  white-space: normal;
}

.plan-pill.full {
  border-color: rgba(20, 115, 76, 0.22);
  background: var(--mint);
  color: #14734c;
}

.appbar .plan-pill {
  max-width: 126px;
}

.upgrade-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  border: 1px solid rgba(47, 124, 255, 0.14);
  border-radius: 999px;
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 8px 12px;
  box-shadow: none;
}

.upgrade-pill:hover {
  transform: translateY(-1px);
}

.appbar .upgrade-pill {
  flex: 0 0 auto;
}

.account-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  min-width: 150px;
  padding: 8px;
  border: 1px solid rgba(88, 130, 210, 0.22);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 20px 46px rgba(11, 23, 66, 0.18);
}

.account-dropdown button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  text-align: left;
  padding: 9px 11px;
}

.account-dropdown button:hover {
  background: #eef6ff;
  color: var(--blue);
}

.account-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
}

.site-footer {
  display: grid;
  gap: 12px;
  margin: 34px -20px -28px;
  padding: 16px 20px 18px;
  border-top: 1px solid rgba(126, 165, 230, 0.24);
  background:
    radial-gradient(circle at 14% 0%, rgba(73, 217, 255, 0.22), transparent 11rem),
    linear-gradient(90deg, rgba(7, 25, 68, 0.98), rgba(21, 45, 104, 0.94)),
    var(--blue-dark);
  color: var(--white);
  box-shadow: 0 -18px 40px rgba(7, 25, 68, 0.22);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  visibility: hidden;
}

.screen.is-at-scroll-bottom .site-footer {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.site-footer-brand {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: 10px;
}

.site-footer-icon {
  width: 38px;
  height: auto;
  max-height: 50px;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: none;
}

.site-footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.site-footer-row {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.site-footer-row span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 800;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.site-footer button {
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer button:hover {
  color: var(--cyan);
}

.mascot-callout {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 13px;
  border: 1px solid rgba(126, 165, 230, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(248, 251, 255, 0.96), rgba(241, 247, 255, 0.98));
}

.mascot-callout img {
  width: 76px;
  height: auto;
  max-height: 98px;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: none;
}

.mascot-callout p {
  margin: 0;
  color: var(--blue-dark);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.contact-form {
  display: grid;
  gap: 14px;
}

.story-build-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
}

.story-build-steps button {
  min-height: 58px;
  border: 1px solid rgba(126, 165, 230, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
  padding: 10px 12px;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.story-build-steps b {
  display: block;
  color: var(--blue-dark);
  font-size: 12px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.story-build-steps .is-active {
  border-color: rgba(47, 124, 255, 0.14);
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
  box-shadow: none;
}

.story-build-steps button:hover {
  border-color: rgba(47, 124, 255, 0.3);
  background: rgba(241, 248, 255, 0.98);
  color: #236ef1;
  transform: translateY(-1px);
}

.story-build-steps .is-active b {
  color: #236ef1;
}

.field textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
  padding: 12px 14px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  color: var(--blue);
  font-size: 28px;
  line-height: 38px;
}

h2 {
  margin-bottom: 12px;
  color: var(--blue);
  font-size: 24px;
  line-height: 31px;
}

h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 18px;
  line-height: 24px;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.logo-wrap {
  margin: 28px auto 22px;
  width: 230px;
  display: grid;
  place-items: center;
}

.logo-mark {
  width: 108px;
  height: 78px;
  border: 3px solid var(--blue);
  border-radius: 20px;
  transform: rotate(6deg);
  position: relative;
  background: linear-gradient(145deg, #ffffff, #e8f5ff);
  box-shadow: 8px 10px 0 rgba(27, 117, 187, 0.08);
}

.logo-mark::before,
.logo-mark::after {
  content: "";
  position: absolute;
  background: var(--blue);
  border-radius: 999px;
}

.logo-mark::before {
  width: 54px;
  height: 8px;
  left: 25px;
  top: 19px;
  box-shadow: 0 18px 0 rgba(27, 117, 187, 0.75);
}

.logo-mark::after {
  width: 18px;
  height: 18px;
  right: -13px;
  top: 18px;
  background: var(--sun);
  border: 3px solid var(--blue);
}

.wordmark {
  margin-top: 14px;
  color: var(--blue);
  font-size: 43px;
  font-weight: 900;
  line-height: 0.86;
}

.tagline {
  max-width: 340px;
  margin: 30px auto 0;
  color: var(--blue);
  font-size: 13px;
  font-style: italic;
}

.lede {
  max-width: 340px;
  margin: 0 auto 22px;
  color: var(--blue);
  font-size: 18px;
}

.link-button {
  appearance: none;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

.register-link {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
}

.splash-learn-link {
  justify-self: center;
  width: auto;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.actions {
  display: grid;
  gap: 14px;
  margin: 28px 0;
}

.btn {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(47, 124, 255, 0.14);
  border-radius: 999px;
  padding: 14px 20px;
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(47, 124, 255, 0.1);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
  box-shadow: none;
}

.btn-locked,
.btn-locked:disabled,
.choice.is-locked,
.choice.is-locked:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  filter: grayscale(0.18);
}

.choice.is-locked em {
  display: block;
  margin-top: 6px;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.dictation-button:focus-visible,
.choice:focus-visible,
.cast-role-button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(255, 214, 107, 0.8);
  outline-offset: 2px;
}

.btn-secondary {
  border: 1px solid rgba(47, 124, 255, 0.14);
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
}

.btn-secondary:hover {
  box-shadow: 0 10px 24px rgba(47, 124, 255, 0.1);
}

.btn-danger {
  border: 1px solid rgba(255, 93, 145, 0.28);
  background: #fff0f5;
  color: #b42158;
}

.btn-quiet {
  border: 1px solid rgba(47, 124, 255, 0.14);
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
}

.btn.btn-quiet {
  border: 1px solid rgba(47, 124, 255, 0.14);
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
  box-shadow: none;
}

.btn-warm {
  border: 1px solid rgba(47, 124, 255, 0.14);
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
}

.btn-small {
  width: auto;
  min-height: 38px;
  padding: 9px 15px;
  font-size: 14px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue);
  cursor: pointer;
}

.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  position: relative;
  flex: 0 0 auto;
}

.icon.arrow::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  top: 4px;
  left: 4px;
}

.icon.back::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  top: 4px;
  left: 6px;
}

.icon.mic::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 12px;
  left: 5px;
  top: 1px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.icon.mic::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 8px;
  left: 3px;
  top: 9px;
  border-bottom: 2px solid currentColor;
  border-radius: 0 0 999px 999px;
  box-shadow: 4px 6px 0 -3px currentColor;
}

.icon.menu::before,
.icon.menu::after,
.icon.menu span {
  content: "";
  position: absolute;
  left: 2px;
  width: 14px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.icon.menu::before {
  top: 4px;
}

.icon.menu span {
  top: 8px;
}

.icon.menu::after {
  top: 12px;
}

.icon.close::before,
.icon.close::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 2px;
  width: 15px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.icon.close::before {
  transform: rotate(45deg);
}

.icon.close::after {
  transform: rotate(-45deg);
}

.icon.play::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 5px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}

.icon.pause::before,
.icon.pause::after {
  content: "";
  position: absolute;
  top: 3px;
  width: 4px;
  height: 12px;
  border-radius: 2px;
  background: currentColor;
}

.icon.pause::before {
  left: 4px;
}

.icon.pause::after {
  right: 4px;
}

.icon.stop::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 2px;
  background: currentColor;
}

.icon.bookmark::before {
  content: "";
  position: absolute;
  inset: 2px 4px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 1px 1px;
}

.icon.bookmark::after {
  content: "";
  position: absolute;
  left: 6px;
  bottom: 2px;
  width: 6px;
  height: 6px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  background: transparent;
}

.icon.book::before {
  content: "";
  position: absolute;
  inset: 2px 4px 2px 1px;
  border: 2px solid currentColor;
  border-radius: 4px 2px 2px 4px;
}

.icon.book::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 8px;
  width: 2px;
  background: currentColor;
  opacity: 0.45;
}

.icon.save::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon.save::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 5px;
  left: 5px;
  bottom: 4px;
  background: currentColor;
  border-radius: 2px 2px 0 0;
}

.icon.gear::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon.gear::after {
  content: "";
  position: absolute;
  inset: 7px;
  background: currentColor;
  border-radius: 50%;
  box-shadow:
    0 -8px 0 -4px currentColor,
    0 8px 0 -4px currentColor,
    8px 0 0 -4px currentColor,
    -8px 0 0 -4px currentColor;
}

.icon.user::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  left: 5px;
  top: 2px;
}

.icon.user::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 9px;
  border: 2px solid currentColor;
  border-bottom-width: 0;
  border-radius: 14px 14px 5px 5px;
  left: 1px;
  bottom: 2px;
}

.icon.logout::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 3px;
  width: 10px;
  height: 12px;
  border: 2px solid currentColor;
  border-right: 0;
  border-radius: 3px 0 0 3px;
}

.icon.logout::after {
  content: "";
  position: absolute;
  right: 1px;
  top: 8px;
  width: 12px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  box-shadow: 4px -4px 0 -2px currentColor, 4px 4px 0 -2px currentColor;
}

.login-block {
  width: min(100%, 360px);
  margin: 48px auto 0;
}

.login-block .field {
  margin-bottom: 12px;
}

.login-block [data-login] {
  min-height: 48px;
  border-radius: var(--radius);
  padding: 13px 14px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
  text-align: left;
}

.field label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field-label-row > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.dictation-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(47, 124, 255, 0.14);
  border-radius: 999px;
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 11px;
}

.dictation-button.is-listening,
.dictation-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.dictation-status {
  min-height: 16px;
  margin: -4px 0 0;
  color: #5f7294;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbff;
  color: var(--ink);
  min-height: 48px;
  padding: 13px 14px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(111, 127, 159, 0.72);
}

.field input:disabled {
  background: #eef3fb;
  color: var(--muted);
  cursor: not-allowed;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field-inline {
  display: grid;
  grid-template-columns: 1fr 116px;
  gap: 12px;
}

.field-hint {
  margin: -2px 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.style-summary {
  display: grid;
  gap: 8px;
  padding: 14px;
  margin: 0 0 16px;
  border: 1px solid rgba(27, 117, 187, 0.18);
  border-radius: var(--radius);
  background: #f7fbff;
  text-align: left;
}

.plan-card,
.email-change {
  display: grid;
  gap: 10px;
  padding: 14px;
  margin: 0 0 16px;
  border: 1px solid rgba(27, 117, 187, 0.18);
  border-radius: var(--radius);
  background: #f7fbff;
  text-align: left;
}

.plan-card.compact {
  margin-bottom: 8px;
}

.plan-card p,
.email-change p {
  margin: 0;
  font-size: 13px;
}

.profile-section,
.password-change,
.secure-name-change {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin: 0 0 16px;
  border: 1px solid rgba(27, 117, 187, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(11, 23, 66, 0.06);
  text-align: left;
}

.password-change,
.secure-name-change {
  margin-bottom: 0;
  background: #f8fbff;
  box-shadow: none;
}

.profile-section h3,
.profile-section h4,
.password-change h4,
.secure-name-change h4,
.secure-name-change p {
  margin: 0;
}

.profile-section h3,
.password-change h4,
.secure-name-change h4 {
  color: var(--ink);
}

.profile-section.hero-unified-section {
  gap: 14px;
  background:
    radial-gradient(circle at 8% 0%, rgba(73, 217, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(241, 248, 255, 0.96));
}

.account-type-section {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 213, 106, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 255, 0.98));
}

.account-type-grid,
.feature-card-grid,
.account-billing-summary {
  display: grid;
  gap: 10px;
}

.account-type-card,
.feature-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(27, 117, 187, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.account-type-card.is-current,
.feature-card:hover {
  border-color: rgba(47, 124, 255, 0.34);
  background: #f7fbff;
}

.account-type-card strong,
.feature-card strong {
  color: var(--ink);
  font-size: 14px;
}

.account-type-card span,
.feature-card span,
.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.feature-card span {
  color: var(--blue);
  font-weight: 900;
  text-transform: uppercase;
}

.hero-unified-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.hero-fields-panel,
.hero-reference-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(27, 117, 187, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
}

.hero-reference-panel h4,
.hero-reference-panel p {
  margin: 0;
}

.hero-reference-panel h4 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.hero-unified-section > .character-panel-head {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(27, 117, 187, 0.14);
}

.button-stack {
  display: grid;
  gap: 8px;
  align-content: end;
}

.upgrade-card,
.upgrade-inline {
  align-items: start;
}

.upgrade-inline {
  display: grid;
  gap: 8px;
}

.plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.style-summary h3 {
  margin: 0;
}

.style-summary p {
  margin: 0;
}

.style-summary dl {
  display: grid;
  gap: 5px;
  margin: 2px 0 0;
}

.style-summary dt {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.style-summary dd {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.character-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin: 0 0 16px;
  border: 1px solid rgba(27, 117, 187, 0.18);
  border-radius: var(--radius);
  background: var(--white);
  text-align: left;
}

.character-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.character-panel-head h3,
.character-panel-head p,
.character-panel > p {
  margin: 0;
}

.character-badge {
  border-radius: 999px;
  background: var(--mint);
  color: #14734c;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.character-badge.muted {
  background: #eef6ff;
  color: var(--blue);
}

.character-badge.warning {
  background: #fff1cc;
  color: #8a5f00;
}

.style-refresh-callout {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(255, 213, 106, 0.62);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff8df, #fffdf4);
}

.style-refresh-callout strong {
  color: var(--ink);
}

.style-refresh-callout p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.upload-box {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px dashed rgba(27, 117, 187, 0.35);
  border-radius: var(--radius);
  background: #fbfbff;
  color: var(--ink);
  font-weight: 800;
}

  .upload-box input {
    width: 100%;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
  }

  .upload-box input::file-selector-button {
    min-height: 34px;
    margin-right: 10px;
    border: 1px solid rgba(47, 124, 255, 0.22);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff, #edf6ff);
    color: #236ef1;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    padding: 7px 11px;
  }

.upload-box small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.character-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.character-preview-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbff;
}

.character-preview-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.character-preview-grid figcaption {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.style-image-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fbff;
}

.style-image-strip figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--white);
}

.style-image-strip figure.is-current {
  border-color: rgba(27, 117, 187, 0.45);
  box-shadow: 0 0 0 3px rgba(73, 217, 255, 0.2);
}

.style-image-strip img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.style-image-strip figcaption {
  display: grid;
  gap: 6px;
  padding: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.style-image-clear {
  min-height: 28px;
  border: 1px solid rgba(27, 117, 187, 0.16);
  border-radius: 8px;
  background: #eef6ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
}

.reference-image-card,
.generated-image-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.reference-image-card p,
.generated-image-section p,
.generated-image-section h4 {
  margin: 0;
}

.generated-image-section h4 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.reference-image-card figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.reference-image-card img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}

.reference-image-card figcaption {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.character-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

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

.cast-list.compact {
  gap: 9px;
}

.cast-editor,
.cast-picker,
.cast-row {
  border: 1px solid rgba(27, 117, 187, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(11, 23, 66, 0.06);
}

.cast-editor {
  display: grid;
  gap: 12px;
  padding: 13px;
}

.cast-picker {
  display: grid;
  gap: 12px;
  margin: 18px 0 20px;
  padding: 14px;
}

.cast-picker h3,
.cast-picker p {
  margin: 0;
}

.cast-preferences-link {
  justify-self: start;
  margin-top: 2px;
  color: var(--blue);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.role-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.cast-role-actions {
  display: grid;
  gap: 10px;
}

.cast-role-actions .eyebrow {
  margin-bottom: -2px;
}

.cast-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 9px;
}

.cast-role-button {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 5px;
  border: 1px solid rgba(95, 139, 220, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  cursor: pointer;
  padding: 11px 12px;
  text-align: left;
}

.cast-role-button:hover {
  border-color: rgba(47, 124, 255, 0.42);
  box-shadow: 0 12px 24px rgba(8, 24, 61, 0.08);
  transform: translateY(-1px);
}

.cast-role-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.cast-role-button strong {
  color: var(--blue-dark);
  font-size: 14px;
  line-height: 1.2;
}

.cast-role-button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

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

.cast-row strong {
  display: block;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cast-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.cast-thumb {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--soft);
}

.use-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.use-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0 20px;
}

.social-login {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quick-traits {
  display: grid;
  gap: 8px;
  margin: 4px 0 20px;
}

.quick-traits p {
  margin: 0;
}

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

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfbff;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.social-btn:disabled {
  border-color: rgba(89, 110, 145, 0.16);
  background: #f3f6fa;
  color: #75849a;
  cursor: not-allowed;
  opacity: 0.78;
}

.social-login-status {
  margin: -2px 0 0;
  color: #66748a;
  font-weight: 650;
  text-align: center;
}

.brand-logo {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 4px 12px rgba(11, 23, 66, 0.08);
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.brand-logo.google {
  color: #4285f4;
}

.brand-logo.facebook {
  background: #1877f2;
  color: #ffffff;
  font-family: Arial, sans-serif;
  font-size: 17px;
}

.brand-logo.linkedin {
  border-radius: 5px;
  background: #0a66c2;
  color: #ffffff;
  font-size: 11px;
}

.brand-logo.x {
  background: #111111;
  color: #ffffff;
}

.intro-stack {
  padding: 22px 20px;
  text-align: center;
}

.choice-grid {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.choice {
  width: 100%;
  min-height: 104px;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--white);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.choice:hover,
.choice.is-selected {
  border-color: rgba(27, 117, 187, 0.48);
  background: #f7fbff;
}

.choice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 16px;
}

.choice span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.choice-art {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--lavender);
  color: var(--blue);
  font-weight: 900;
}

.choice:nth-child(2n) .choice-art {
  background: var(--mint);
  color: #14734c;
}

.choice:nth-child(3n) .choice-art {
  background: #fff1cc;
  color: #9c6900;
}

.product-area-grid .choice {
  min-height: 118px;
  align-items: start;
}

.product-area-grid .choice-art {
  margin-top: 2px;
}

.chip-row,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 7px 0 16px;
}

.chip,
.segment {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  padding: 9px 13px;
  cursor: pointer;
}

.chip.is-selected,
.segment.is-selected {
  border-color: rgba(47, 124, 255, 0.14);
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
}

.footer-actions {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  padding: 14px 20px 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--white) 20%);
  display: grid;
  gap: 10px;
}

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

.progress-wrap {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--coral), var(--sun));
  animation: loading 1.7s ease forwards;
}

@keyframes loading {
  from {
    width: 8%;
  }
  to {
    width: 100%;
  }
}

.generating-card {
  width: 100%;
  max-width: 340px;
  margin: auto;
}

.spark-scene {
  height: 230px;
  position: relative;
  margin-bottom: 22px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 54%, rgba(20, 115, 76, 0.13) 54%),
    linear-gradient(150deg, #dff4ff, #fff4ce 58%, #ffe4de);
  overflow: hidden;
}

.spark-scene::before {
  content: "";
  position: absolute;
  width: 118px;
  height: 118px;
  left: 24px;
  top: 34px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 174px 34px 0 -52px rgba(255, 255, 255, 0.86);
}

.spark-scene::after {
  content: "";
  position: absolute;
  width: 136px;
  height: 94px;
  right: 24px;
  bottom: 26px;
  border-radius: 70px 70px 12px 12px;
  background: var(--blue);
  transform: rotate(-5deg);
  box-shadow: -122px 20px 0 -26px var(--coral);
}

.story-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.story-card + .story-card {
  margin-top: 12px;
}

.cover {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(27, 117, 187, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.84)),
    linear-gradient(140deg, #e6f6ff 0%, #fff1ca 52%, #ffe4df 100%);
  text-align: center;
}

.cover h1 {
  margin-top: 12px;
  color: var(--ink);
  font-size: 30px;
  line-height: 36px;
}

.cover .byline {
  color: var(--blue);
  font-weight: 800;
}

.edit-cover-preview {
  min-height: 420px;
  margin-bottom: 18px;
}

.edit-cover-preview .cover-art {
  min-height: 220px;
}

.cover-art {
  min-height: 300px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 22% 20%, var(--sun) 0 32px, transparent 33px),
    radial-gradient(circle at 70% 29%, rgba(255, 255, 255, 0.9) 0 28px, transparent 29px),
    linear-gradient(180deg, #bfe8ff 0 50%, #dff6ea 50% 100%);
  position: relative;
  overflow: hidden;
}

.cover-art::before,
.cover-art::after {
  content: "";
  position: absolute;
  bottom: 44px;
  border-radius: 999px 999px 10px 10px;
}

.cover-art::before {
  width: 92px;
  height: 120px;
  left: 76px;
  background: var(--coral);
  box-shadow: 0 -38px 0 -12px var(--ink);
}

.cover-art::after {
  width: 78px;
  height: 96px;
  right: 74px;
  background: var(--blue);
  box-shadow: 0 -30px 0 -10px #fff7d4;
}

.story-summary,
.story-action-panel,
.read-aloud-panel,
.page-player,
.story-edit-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.story-summary h1,
.story-summary p,
.page-player h3,
.page-player p,
.story-edit-panel h3,
.story-edit-panel p {
  margin: 0;
}

.story-action-panel,
.read-aloud-panel,
.page-player,
.story-edit-panel {
  padding: 14px;
  border: 1px solid rgba(95, 139, 220, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px rgba(11, 23, 66, 0.07);
}

.read-aloud-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.read-aloud-panel .field-hint {
  grid-column: 1 / -1;
}

.read-aloud-panel .voice-select {
  grid-column: 1 / -1;
}

.read-aloud-panel h3 {
  margin: 0;
  color: var(--ink);
}

.voice-select,
.auto-turn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.voice-select select {
  min-height: 36px;
  min-width: 148px;
  max-width: 100%;
  padding: 7px 32px 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(95, 139, 220, 0.24);
  background: #f8fbff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.auto-turn-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.read-aloud-controls {
  display: inline-flex;
  gap: 8px;
}

.story-audio-btn:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
  box-shadow: none;
}

.story-primary {
  display: grid;
  gap: 12px;
}

.page-player {
  gap: 14px;
}

.page-player-head,
.page-player-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.page-player-head .btn {
  white-space: nowrap;
}

.page-player-body {
  justify-content: flex-start;
}

.story-inline-nav {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid rgba(27, 117, 187, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -12px 30px rgba(8, 24, 61, 0.08);
  backdrop-filter: blur(12px);
}

.story-edit-panel {
  margin-top: 16px;
}

.story-edit-panel-head {
  display: grid;
  gap: 2px;
}

.reader-page {
  min-height: 100%;
  display: grid;
  align-content: start;
  gap: 12px;
  padding-bottom: 8px;
}

.cover-image {
  margin: 0;
}

.cover-image.generated {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--soft);
}

.cover-image img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.cover-image figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.chapter-illustration-block {
  display: grid;
  gap: 8px;
}

.page-image {
  margin: 0 0 12px;
}

.page-image.generated {
  min-height: 290px;
  overflow: hidden;
  border: 1px solid rgba(27, 117, 187, 0.14);
  border-radius: var(--radius);
  background: var(--soft);
}

.page-image img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.page-image figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.page-art {
  min-height: 290px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 20% 26%, var(--sun) 0 26px, transparent 27px),
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.92) 0 22px, transparent 23px),
    linear-gradient(180deg, #bfe9ff 0 60%, #dff6ea 60%);
  position: relative;
  overflow: hidden;
}

.page-art.is-loading {
  filter: saturate(0.8);
  opacity: 0.72;
}

.page-art.space {
  background:
    radial-gradient(circle at 18% 20%, #ffffff 0 2px, transparent 3px),
    radial-gradient(circle at 62% 28%, #ffffff 0 3px, transparent 4px),
    radial-gradient(circle at 84% 14%, #ffffff 0 2px, transparent 3px),
    linear-gradient(160deg, #203268, #6159a8 58%, #ffb38e);
}

.page-art.sea {
  background:
    radial-gradient(circle at 78% 18%, var(--sun) 0 26px, transparent 27px),
    linear-gradient(180deg, #bfe8ff 0 43%, #72d3d4 43% 100%);
}

.page-art.forest {
  background:
    radial-gradient(circle at 22% 23%, var(--sun) 0 25px, transparent 26px),
    linear-gradient(180deg, #d9f5ff 0 49%, #91d5a4 49%);
}

.page-art.library {
  background:
    linear-gradient(90deg, rgba(27, 117, 187, 0.16) 0 14px, transparent 14px 27px),
    linear-gradient(180deg, #fff7dc 0 62%, #e9d3b1 62%);
}

.page-art::before {
  content: "";
  position: absolute;
  width: 86px;
  height: 100px;
  left: 44px;
  bottom: 34px;
  border-radius: 999px 999px 10px 10px;
  background: var(--coral);
  box-shadow:
    0 -30px 0 -9px var(--ink),
    140px 18px 0 -16px var(--blue);
}

.page-art::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 70px;
  right: 34px;
  bottom: 42px;
  border-radius: 100px 100px 12px 12px;
  background: rgba(255, 255, 255, 0.48);
}

.page-copy {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid rgba(227, 226, 240, 0.9);
  color: var(--ink);
  font-size: 19px;
  line-height: 1.55;
  max-height: none;
  overflow: visible;
}

.page-copy p {
  margin-bottom: 14px;
  color: var(--ink);
}

.page-copy p:last-child {
  margin-bottom: 0;
}

.image-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
}

.prompt-preview {
  flex-basis: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbff;
  padding: 10px 12px;
}

.prompt-preview summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.prompt-preview p,
.image-error {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.image-error {
  flex-basis: 100%;
  color: #9b2c2c;
}

.pager,
.reader-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 0;
}

.reader-nav {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) auto minmax(96px, 1fr);
  margin: 0;
}

.reader-nav .btn:last-child {
  justify-self: end;
}

.page-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.image-status {
  display: grid;
  gap: 10px;
  padding: 13px 14px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbff;
}

.settings-actions {
  margin: 22px 0 4px;
}

.image-status div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-status strong {
  color: var(--ink);
  font-size: 14px;
}

.image-status span {
  color: var(--muted);
  font-size: 13px;
}

.mini-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--coral), var(--sun));
  transition: width 0.25s ease;
}

.mini-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.mini-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.mini-item-main {
  min-width: 0;
  flex: 1;
}

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

.mini-item-main span {
  color: var(--muted);
  font-size: 13px;
}

.mini-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.price-grid {
  display: grid;
  gap: 12px;
}

.title-with-badge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.title-with-badge h1 {
  margin-bottom: 0;
}

.price {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.plan-current-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(27, 117, 187, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eef7ff, #f5f2ff);
}

.plan-current-banner span,
.current-plan-badge {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.plan-current-banner strong {
  color: var(--blue);
  font-size: 20px;
}

.test-access-banner {
  border-color: rgba(113, 78, 255, 0.24);
  background: #f3f0ff;
}

.test-access-banner strong {
  color: #5a3fce;
}

.price-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.current-plan-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e2fff7;
  color: #086b75;
}

.price.featured {
  border-color: rgba(27, 117, 187, 0.48);
  background: #f7fbff;
}

.price strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 18px;
}

.price b {
  color: var(--blue);
  font-size: 30px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.toggle-row strong {
  display: block;
  color: var(--ink);
}

.toggle-row span {
  color: var(--muted);
  font-size: 13px;
}

.switch {
  width: 52px;
  height: 30px;
  position: relative;
  flex: 0 0 auto;
  border: 1px solid rgba(47, 124, 255, 0.14);
  border-radius: 999px;
  background: rgba(235, 246, 255, 0.95);
  cursor: pointer;
}

.switch::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 6px rgba(31, 39, 86, 0.18);
  transition: transform 0.18s ease;
}

.switch.is-on {
  background: rgba(235, 246, 255, 0.95);
}

.switch.is-on::before {
  background: #236ef1;
  transform: translateX(22px);
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 39, 86, 0.32);
  z-index: 20;
  display: flex;
  justify-content: flex-start;
}

.drawer {
  width: min(318px, 86%);
  height: 100%;
  padding: 28px 18px;
  background: var(--white);
  box-shadow: 20px 0 40px rgba(31, 39, 86, 0.18);
}

.drawer .wordmark {
  margin: 0 0 24px;
  font-size: 34px;
}

.drawer button {
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 13, 40, 0.5);
  backdrop-filter: blur(10px);
  z-index: 50;
}

.confirm-dialog {
  width: min(360px, 100%);
  padding: 20px;
  border: 1px solid rgba(215, 235, 255, 0.52);
  border-radius: 18px;
  background:
    linear-gradient(180deg, #ffffff, #eef6ff),
    var(--white);
  box-shadow:
    0 24px 70px rgba(3, 13, 40, 0.36),
    0 0 36px rgba(73, 217, 255, 0.16);
}

.confirm-dialog h3 {
  margin-bottom: 8px;
}

.confirm-dialog p {
  margin-bottom: 14px;
}

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

.empty {
  padding: 28px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  background: #fbfbff;
}

.toast {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 88px;
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  z-index: 40;
}

.phone {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.08)),
    linear-gradient(135deg, rgba(73, 217, 255, 0.34), rgba(118, 98, 255, 0.26));
  border: 1px solid rgba(215, 235, 255, 0.52);
  box-shadow:
    0 30px 90px rgba(3, 13, 40, 0.52),
    0 0 0 1px rgba(255, 255, 255, 0.26) inset,
    0 0 54px rgba(45, 125, 255, 0.22);
}

.screen {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 255, 0.98)),
    var(--panel);
}

.status {
  color: rgba(255, 255, 255, 0.88);
  background: linear-gradient(90deg, var(--blue-dark), #152d68);
}

.appbar {
  border-bottom: 1px solid rgba(126, 165, 230, 0.24);
  background:
    linear-gradient(90deg, rgba(7, 25, 68, 0.98), rgba(21, 45, 104, 0.94)),
    var(--blue-dark);
  color: var(--white);
  box-shadow: 0 12px 28px rgba(7, 25, 68, 0.18);
}

.appbar h2,
.appbar .eyebrow {
  color: var(--white);
}

.appbar .eyebrow {
  opacity: 0.72;
}

h1,
h2 {
  color: var(--blue-dark);
  letter-spacing: 0;
}

h1 {
  font-weight: 900;
}

h3 {
  color: var(--ink);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.screen > .appbar .icon-btn:hover,
.icon-btn:hover {
  background: rgba(73, 217, 255, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    var(--glow);
}

.logo-wrap {
  width: min(260px, 80vw);
}

.logo-mark {
  width: 116px;
  height: 92px;
  border-color: rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  background: linear-gradient(145deg, #4bd7ff, #7464ff 72%, #f25c92);
  box-shadow:
    0 18px 44px rgba(45, 125, 255, 0.32),
    0 0 34px rgba(73, 217, 255, 0.42);
}

.logo-mark::before {
  width: 54px;
  height: 6px;
  left: 28px;
  top: 25px;
  background: var(--blue-dark);
  box-shadow: 0 20px 0 rgba(7, 25, 68, 0.76);
}

.logo-mark::after {
  right: -18px;
  top: 24px;
  background: var(--white);
  border-color: var(--blue-dark);
}

.wordmark {
  color: var(--blue-dark);
  text-shadow: 0 8px 22px rgba(45, 125, 255, 0.2);
}

.tagline,
.lede,
.link-button {
  color: var(--blue);
}

.btn {
  border: 1px solid rgba(47, 124, 255, 0.14);
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
  box-shadow: none;
}

.btn:hover {
  box-shadow: 0 10px 24px rgba(47, 124, 255, 0.1);
}

.btn-secondary {
  border-color: rgba(47, 124, 255, 0.14);
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
  box-shadow: none;
}

.btn-quiet {
  border-color: rgba(47, 124, 255, 0.14);
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
  box-shadow: none;
}

.btn-warm {
  border-color: rgba(47, 124, 255, 0.14);
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
}

.field input,
.field textarea,
.field select,
.prompt-preview,
.image-status,
.empty,
.mini-item,
.price,
.style-summary,
.character-panel,
.choice,
.page-copy {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px rgba(11, 23, 66, 0.07);
}

.field input,
.field textarea,
.field select {
  color: var(--ink);
}

.choice {
  min-height: 108px;
}

.choice:hover,
.choice.is-selected {
  border-color: rgba(45, 125, 255, 0.42);
  background: linear-gradient(180deg, #ffffff, #f2f8ff);
  box-shadow:
    0 16px 34px rgba(45, 125, 255, 0.14),
    0 0 24px rgba(73, 217, 255, 0.15);
}

.style-summary,
.character-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(242, 248, 255, 0.94)),
    var(--white);
}

.character-badge {
  background: linear-gradient(135deg, var(--mint), #bff5ff);
  color: #075f68;
}

.character-badge.muted {
  background: #eaf3ff;
  color: var(--blue);
}

.upload-box {
  border-color: rgba(45, 125, 255, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(236, 246, 255, 0.92)),
    var(--soft);
}

.character-preview-grid figure {
  border-color: rgba(88, 130, 210, 0.28);
  background: var(--white);
  box-shadow: 0 14px 30px rgba(11, 23, 66, 0.08);
}

.cover {
  border-color: rgba(255, 255, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(7, 25, 68, 0.1), rgba(255, 255, 255, 0.78)),
    linear-gradient(135deg, #eaf7ff 0%, #dff5ff 38%, #f5eaff 72%, #fff0d1 100%);
  box-shadow:
    0 18px 46px rgba(11, 23, 66, 0.13),
    inset 0 0 0 1px rgba(255, 255, 255, 0.52);
}

.cover-art,
.page-art {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.52),
    0 18px 44px rgba(45, 125, 255, 0.16);
}

.cover-art {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(160deg, #081a49 0%, #1365c7 42%, #43d8ff 70%, #ffd56a 100%);
}

.page-image.generated {
  border-color: rgba(88, 130, 210, 0.24);
  background: var(--soft);
  box-shadow: 0 18px 44px rgba(11, 23, 66, 0.12);
}

.page-art {
  background:
    radial-gradient(ellipse at 35% 24%, rgba(255, 255, 255, 0.92), transparent 25%),
    linear-gradient(160deg, #dff8ff 0%, #7ae0ff 48%, #bdb1ff 100%);
}

.page-art.space {
  background:
    radial-gradient(circle at 18% 20%, #ffffff 0 2px, transparent 3px),
    radial-gradient(circle at 62% 28%, #ffffff 0 3px, transparent 4px),
    radial-gradient(circle at 84% 14%, #ffffff 0 2px, transparent 3px),
    linear-gradient(160deg, #06142f, #264aa7 58%, #ff80a8);
}

.page-art.sea {
  background:
    radial-gradient(ellipse at 78% 18%, rgba(255, 255, 255, 0.86), transparent 18%),
    linear-gradient(180deg, #dff8ff 0 43%, #4bd7ff 43% 100%);
}

.page-art.forest {
  background:
    radial-gradient(ellipse at 22% 23%, rgba(255, 255, 255, 0.9), transparent 20%),
    linear-gradient(180deg, #dff8ff 0 49%, #7ee2b8 49%);
}

.page-art.library {
  background:
    linear-gradient(90deg, rgba(45, 125, 255, 0.16) 0 14px, transparent 14px 27px),
    linear-gradient(180deg, #f5f9ff 0 62%, #cfe2ff 62%);
}

.image-note {
  flex-basis: 100%;
  margin: 8px 0 0;
  color: #315879;
  font-size: 13px;
  line-height: 1.45;
}

.footer-actions {
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0), rgba(248, 251, 255, 0.96) 26%),
    rgba(248, 251, 255, 0.96);
}

.drawer-backdrop {
  background: rgba(3, 13, 40, 0.46);
  backdrop-filter: blur(8px);
}

.drawer {
  background:
    linear-gradient(180deg, #ffffff, #eef6ff),
    var(--white);
  box-shadow: 24px 0 60px rgba(3, 13, 40, 0.26);
}

.toast {
  background: linear-gradient(135deg, var(--blue-dark), #193b91);
  box-shadow: var(--glow);
}

@media (max-height: 780px) {
  .phone {
    min-height: calc(100dvh - 16px);
  }

  .logo-wrap {
    margin-top: 14px;
    transform: scale(0.9);
  }

  .login-block {
    margin-top: 28px;
  }
}

@media (min-width: 720px) {
  .shell {
    padding: 20px;
  }

  .phone {
    width: min(920px, calc(100vw - 40px));
    height: min(940px, calc(100dvh - 40px));
    border-radius: 28px;
  }

  .screen-scroll {
    max-width: 820px;
    margin: 0 auto;
    padding-left: 28px;
    padding-right: 28px;
  }

  .appbar {
    padding-left: 28px;
    padding-right: 28px;
  }

  .footer-actions {
    width: min(820px, calc(100% - 56px));
    margin: 0 auto;
  }

  .cover {
    min-height: 560px;
  }

  .style-image-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .account-type-grid,
  .feature-card-grid,
  .account-billing-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .shell {
    padding: 28px;
  }

  .phone {
    width: min(1360px, calc(100vw - 56px));
    height: min(900px, calc(100dvh - 56px));
    border-radius: 22px;
  }

  .screen-scroll {
    max-width: 1080px;
    padding: 28px 32px 32px;
  }

  .product-area-grid,
  .feature-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .screen:has(.reader-page) .screen-scroll,
  .screen:has(.cover) .screen-scroll {
    max-width: 1240px;
  }

  .screen:has(.reader-page) .footer-actions,
  .screen:has(.cover) .footer-actions {
    width: min(1240px, 100%);
  }

  .reader-page {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 16px;
  }

  .story-primary {
    display: grid;
    grid-template-columns: minmax(520px, 1fr) minmax(380px, 0.72fr);
    align-items: start;
    column-gap: 32px;
  }

  .story-primary-text-only {
    display: block;
    max-width: 820px;
    margin: 0 auto;
  }

  .reader-page .page-image {
    grid-column: 1;
  }

  .reader-page .image-tools {
    grid-column: 1;
  }

  .reader-page .page-copy {
    grid-column: 2;
    grid-row: 1;
  }

  .reader-page .story-primary-text-only .page-copy {
    grid-column: auto;
    grid-row: auto;
  }

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

  .style-summary,
  .character-panel {
    padding: 18px;
  }
}

@media (max-width: 460px) {
  .shell {
    padding: 0;
  }

  .phone {
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .footer-actions {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .appbar .plan-pill {
    max-width: 96px;
    font-size: 10px;
    padding-inline: 7px;
  }

  .mini-item {
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: start;
  }

  .mini-item .choice-art {
    width: 46px;
    height: 46px;
  }

  .mini-item-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .mini-item-actions .btn {
    flex: 1 1 120px;
  }
}

@media (max-width: 680px) {
  .hero-unified-grid {
    grid-template-columns: 1fr;
  }

  .hero-fields-panel,
  .hero-reference-panel {
    padding: 12px;
  }
}

@media print {
  body {
    background: var(--white);
  }

  .shell {
    display: block;
    min-height: auto;
    padding: 0;
  }

  .phone {
    width: 100%;
    height: auto;
    min-height: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .status,
  .appbar,
  .footer-actions,
  .pager,
  .drawer-backdrop {
    display: none;
  }

  body[data-print-mode="coloring"] .page-image img,
  body[data-print-mode="coloring"] .cover-art,
  body[data-print-mode="coloring"] .page-art {
    filter: grayscale(1) contrast(1.85) brightness(1.12);
  }

  body[data-print-mode="coloring"] .page-image,
  body[data-print-mode="coloring"] .cover,
  body[data-print-mode="coloring"] .page-copy {
    border-color: #111;
    background: #fff;
    box-shadow: none;
  }
}

@media screen {
  :root {
    --blue: #2f7cff;
    --blue-2: #21b8ff;
    --blue-dark: #071944;
    --ink: #08183d;
    --muted: #6f7f9f;
    --soft: #edf6ff;
    --line: rgba(95, 139, 220, 0.22);
    --lavender: #ebe8ff;
    --mint: #dffbf6;
    --sun: #ffbd4a;
    --coral: #ff5d91;
    --paper: #ffffff;
    --white: #ffffff;
    --night: #04112f;
    --violet: #7464ff;
    --cyan: #49d9ff;
    --panel: #f6faff;
    --shadow: 0 38px 110px rgba(4, 17, 47, 0.46);
    --glow: 0 0 28px rgba(73, 217, 255, 0.28);
    --radius: 8px;
  }

  html {
    background: #07112d;
    overflow-x: hidden;
  }

  body {
    min-width: 320px;
    overflow-x: hidden;
    background:
      radial-gradient(circle at 13% 8%, rgba(73, 217, 255, 0.48), transparent 19rem),
      radial-gradient(circle at 84% 8%, rgba(255, 255, 255, 0.68), transparent 22rem),
      radial-gradient(circle at 53% 88%, rgba(87, 214, 201, 0.18), transparent 26rem),
      linear-gradient(135deg, #06142f 0%, #1c2c48 48%, #eaf4ff 100%);
    color: var(--ink);
    font-family:
      "Segoe UI Variable",
      "Inter",
      "DM Sans",
      "Segoe UI",
      Arial,
      sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
  }

  body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
      linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 100% 42px, 42px 100%;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82), transparent 88%);
  }

  body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 45%, rgba(2, 9, 30, 0.38) 100%);
  }

  .shell {
    position: relative;
    padding: clamp(14px, 3vw, 30px);
  }

  .phone {
    width: min(430px, calc(100vw - 28px));
    border: 1px solid rgba(223, 240, 255, 0.5);
    border-radius: 30px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(73, 217, 255, 0.08)),
      rgba(8, 24, 61, 0.2);
    box-shadow:
      var(--shadow),
      0 0 0 1px rgba(255, 255, 255, 0.24) inset,
      0 0 68px rgba(73, 217, 255, 0.22);
  }

  .screen {
    background:
      radial-gradient(circle at 8% 0%, rgba(73, 217, 255, 0.08), transparent 17rem),
      linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  }

  .screen-scroll {
    padding: 24px 20px 30px;
    scrollbar-width: thin;
    scrollbar-color: rgba(47, 124, 255, 0.16) transparent;
  }

  .screen-scroll::-webkit-scrollbar {
    width: 5px;
  }

  .screen-scroll::-webkit-scrollbar-track {
    background: transparent;
  }

  .screen-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(47, 124, 255, 0.14);
  }

  .screen:has(.logo-wrap) {
    background:
      radial-gradient(circle at 18% 8%, rgba(73, 217, 255, 0.32), transparent 15rem),
      radial-gradient(circle at 82% 14%, rgba(116, 100, 255, 0.28), transparent 16rem),
      linear-gradient(160deg, #071944 0%, #10285d 54%, #dceeff 100%);
  }

  .screen:has(.logo-wrap) .screen-scroll {
    color: var(--white);
  }

  .screen:has(.logo-wrap) .lede,
  .screen:has(.logo-wrap) .tagline,
  .screen:has(.logo-wrap) .eyebrow {
    color: rgba(255, 255, 255, 0.78);
  }

  .screen:has(.logo-wrap) h1,
  .screen:has(.logo-wrap) h2,
  .screen:has(.logo-wrap) h3 {
    color: var(--white);
  }

  .screen:has(.logo-wrap) .login-block {
    padding: 18px;
    border: 1px solid rgba(223, 240, 255, 0.2);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.1);
    box-shadow:
      0 24px 60px rgba(0, 9, 35, 0.22),
      inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
  }

  .screen:has(.logo-wrap) .social-login {
    color: rgba(255, 255, 255, 0.72);
  }

  .screen:has(.logo-wrap) .social-btn {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
  }

  .screen:has(.logo-wrap) .brand-logo {
    box-shadow: 0 8px 18px rgba(0, 9, 35, 0.2);
  }

  .appbar {
    min-height: 70px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background:
      linear-gradient(90deg, rgba(4, 17, 47, 0.98), rgba(12, 36, 91, 0.96)),
      var(--blue-dark);
    box-shadow:
      0 16px 36px rgba(4, 17, 47, 0.22),
      inset 0 -1px 0 rgba(73, 217, 255, 0.08);
  }

  .appbar-title h2 {
    margin: 3px 0 0;
    color: var(--white);
    font-size: 19px;
    line-height: 1.18;
    font-weight: 900;
  }

  .eyebrow {
    margin-bottom: 5px;
    color: #3f73b6;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .appbar .eyebrow {
    color: rgba(166, 221, 255, 0.78);
  }

  h1 {
    margin-bottom: 10px;
    color: var(--ink);
    font-size: clamp(25px, 4vw, 32px);
    font-weight: 900;
    line-height: 1.12;
  }

  h2 {
    color: var(--ink);
    font-size: 21px;
    font-weight: 900;
    line-height: 1.18;
  }

  h3 {
    color: var(--ink);
    font-size: 17px;
    font-weight: 900;
    line-height: 1.22;
  }

  p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
  }

  .link-button {
    color: var(--cyan);
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .logo-wrap {
    width: min(276px, 80vw);
    margin: 26px auto 24px;
  }

  .logo-mark {
    width: 118px;
    height: 92px;
    border: 4px solid rgba(255, 255, 255, 0.84);
    border-radius: 26px;
    background:
      radial-gradient(circle at 22% 12%, rgba(255, 255, 255, 0.46), transparent 24%),
      linear-gradient(145deg, #4bd7ff 0%, #7464ff 72%, #ff5d91 100%);
    box-shadow:
      0 18px 44px rgba(47, 124, 255, 0.34),
      0 0 42px rgba(73, 217, 255, 0.42);
  }

  .logo-mark::before {
    width: 55px;
    height: 26px;
    left: 28px;
    top: 31px;
    border: 5px solid var(--blue-dark);
    border-top: 0;
    border-left-color: transparent;
    border-right-color: transparent;
    border-radius: 0 0 42px 42px;
    background: transparent;
    box-shadow:
      -18px -14px 0 -10px var(--blue-dark),
      18px -14px 0 -10px var(--blue-dark);
  }

  .logo-mark::after {
    width: 22px;
    height: 22px;
    right: -22px;
    top: 24px;
    border: 4px solid var(--blue-dark);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow:
      -122px 144px 0 -8px rgba(255, 255, 255, 0.8),
      -112px 140px 0 -8px var(--blue-dark);
  }

  .wordmark {
    color: #06142f;
    font-size: 42px;
    font-weight: 950;
    line-height: 0.86;
    text-shadow:
      0 1px 0 rgba(255, 255, 255, 0.36),
      0 16px 34px rgba(47, 124, 255, 0.28);
  }

  .screen:has(.logo-wrap) .wordmark {
    color: rgba(5, 18, 54, 0.95);
    -webkit-text-stroke: 1px rgba(190, 232, 255, 0.22);
    text-shadow:
      0 1px 0 rgba(255, 255, 255, 0.32),
      0 0 20px rgba(73, 217, 255, 0.7),
      0 16px 34px rgba(47, 124, 255, 0.28);
  }

  .lede {
    font-size: 16px;
    line-height: 1.45;
  }

  .tagline {
    font-size: 13px;
    font-style: normal;
    font-weight: 800;
  }

  .btn,
  .icon-btn,
  .choice,
  .chip,
  .segment,
  .switch {
    transition:
      transform 0.18s ease,
      box-shadow 0.18s ease,
      border-color 0.18s ease,
      background 0.18s ease;
  }

  .btn {
    min-height: 50px;
    border: 1px solid rgba(47, 124, 255, 0.14);
    border-radius: 999px;
    background: rgba(235, 246, 255, 0.95);
    box-shadow: none;
    color: #236ef1;
    font-size: 14px;
    font-weight: 900;
  }

  .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(47, 124, 255, 0.1);
  }

  .btn:disabled {
    transform: none;
    box-shadow: none;
  }

  .btn-saved:disabled {
    border-color: rgba(95, 139, 220, 0.16);
    background: linear-gradient(180deg, #e9eef7, #dfe7f2);
    color: #71809f;
    cursor: not-allowed;
    opacity: 1;
  }

  .btn-secondary {
    border-color: rgba(47, 124, 255, 0.14);
    background: rgba(235, 246, 255, 0.95);
    color: #236ef1;
    box-shadow: none;
  }

  .btn-danger {
    border-color: rgba(255, 93, 145, 0.32);
    background: linear-gradient(180deg, #fff6fa, #ffeaf2);
    color: #b42158;
    box-shadow: 0 10px 24px rgba(180, 33, 88, 0.08);
  }

  .btn-quiet {
    border-color: rgba(47, 124, 255, 0.14);
    background: rgba(235, 246, 255, 0.95);
    color: #236ef1;
    box-shadow: none;
  }

  .btn-warm {
    border-color: rgba(47, 124, 255, 0.14);
    background: rgba(235, 246, 255, 0.95);
    color: #236ef1;
  }

  .btn-small {
    min-height: 38px;
    padding: 9px 13px;
    border-radius: 9px;
    font-size: 13px;
  }

  .icon-btn {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.06),
      0 10px 24px rgba(4, 17, 47, 0.16);
  }

  .icon-btn:hover {
    background: rgba(73, 217, 255, 0.16);
    box-shadow:
      0 0 26px rgba(73, 217, 255, 0.18),
      inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  }

  .field {
    gap: 7px;
    margin-bottom: 16px;
  }

  .field > span,
  .field-label-row > span,
  .upload-box > span {
    color: #1a2c5d;
    font-size: 12px;
    font-weight: 900;
  }

  .screen:has(.logo-wrap) .field > span,
  .screen:has(.logo-wrap) .field-label-row > span {
    color: rgba(255, 255, 255, 0.82);
  }

  .field input,
  .field textarea,
  .field select {
    min-height: 48px;
    border: 1px solid rgba(95, 139, 220, 0.25);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
      0 12px 30px rgba(8, 24, 61, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.88);
    color: var(--ink);
    font-size: 14px;
  }

  .field textarea {
    min-height: 108px;
  }

  .field input::placeholder,
  .field textarea::placeholder {
    color: rgba(111, 127, 159, 0.72);
  }

  .field input:disabled {
    background: #edf3fb;
  }

  .field-hint {
    color: #7585a5;
    font-size: 12px;
    line-height: 1.45;
  }

  .plan-pill,
  .character-badge {
    min-height: 28px;
    border: 1px solid rgba(73, 217, 255, 0.28);
    border-radius: 999px;
    background: rgba(226, 248, 255, 0.94);
    color: #126ca9;
    font-size: 11px;
    font-weight: 900;
  }

  .plan-pill.full,
  .character-badge {
    border-color: rgba(87, 214, 201, 0.34);
    background: linear-gradient(135deg, #e0fff7, #e5f8ff);
    color: #086b75;
  }

  .character-badge.muted {
    border-color: rgba(47, 124, 255, 0.22);
    background: #edf6ff;
    color: #236ef1;
  }

  .character-badge.warning {
    border-color: rgba(255, 189, 74, 0.44);
    background: #fff5d8;
    color: #7a5200;
  }

  .upgrade-pill {
    min-height: 31px;
    border-radius: 999px;
    border-color: rgba(47, 124, 255, 0.14);
    background: rgba(235, 246, 255, 0.95);
    color: #236ef1;
    box-shadow: none;
    font-size: 12px;
  }

  .upgrade-requirements {
    display: grid;
    gap: 7px;
    align-items: start;
    margin-top: 8px;
    padding: 11px 12px;
    border: 1px solid rgba(255, 189, 74, 0.34);
    border-radius: var(--radius);
    background:
      radial-gradient(circle at 10% 0%, rgba(255, 189, 74, 0.18), transparent 52%),
      linear-gradient(180deg, #fffaf0, #f7fbff);
  }

  .upgrade-requirements p {
    margin: 0;
    color: #5e6882;
    font-size: 12px;
    line-height: 1.45;
  }

  .upgrade-tag {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 24px;
    border: 1px solid rgba(255, 189, 74, 0.38);
    border-radius: 999px;
    background: linear-gradient(135deg, #fff5d8, #eaf7ff);
    color: #835300;
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
    padding: 6px 9px;
  }

  .choice,
  .story-card,
  .mini-item,
  .price,
  .plan-card,
  .email-change,
  .profile-section,
  .password-change,
  .secure-name-change,
  .style-summary,
  .character-panel,
  .cast-editor,
  .cast-picker,
  .cast-row,
  .page-copy,
  .prompt-preview,
  .image-status,
  .empty {
    border: 1px solid rgba(95, 139, 220, 0.22);
    border-radius: var(--radius);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 255, 0.96));
    box-shadow:
      0 16px 38px rgba(8, 24, 61, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  .choice {
    min-height: 106px;
    padding: 14px;
  }

  .choice:hover,
  .choice.is-selected {
    border-color: rgba(47, 124, 255, 0.48);
    background:
      radial-gradient(circle at 18% 20%, rgba(73, 217, 255, 0.12), transparent 38%),
      linear-gradient(180deg, #ffffff, #f0f7ff);
  }

  .choice strong,
  .mini-item-main strong,
  .price strong,
  .toggle-row strong {
    color: var(--ink);
    font-size: 15px;
    font-weight: 900;
  }

  .choice span,
  .mini-item-main span,
  .toggle-row span {
    color: var(--muted);
    font-size: 13px;
  }

  .choice-art,
  .cast-thumb {
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    background:
      radial-gradient(ellipse at 50% 82%, rgba(87, 214, 201, 0.34), transparent 48%),
      linear-gradient(145deg, #eef9ff, #dfebff);
    box-shadow:
      0 12px 24px rgba(47, 124, 255, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
    color: #0a2a6b;
    font-size: 17px;
  }

  .choice:nth-child(2n) .choice-art {
    background:
      radial-gradient(ellipse at 50% 82%, rgba(255, 93, 145, 0.24), transparent 48%),
      linear-gradient(145deg, #f7f3ff, #e8e4ff);
    color: #4936c9;
  }

  .choice:nth-child(3n) .choice-art {
    background:
      radial-gradient(ellipse at 50% 82%, rgba(255, 189, 74, 0.28), transparent 48%),
      linear-gradient(145deg, #fff9e8, #e9f8ff);
    color: #9a5d00;
  }

  .chip,
  .segment {
    min-height: 38px;
    border-color: rgba(95, 139, 220, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #496181;
    font-size: 13px;
    font-weight: 850;
  }

  .chip.is-selected,
  .segment.is-selected {
    border-color: rgba(47, 124, 255, 0.14);
    background: rgba(235, 246, 255, 0.95);
    color: #236ef1;
    box-shadow: none;
  }

  .upload-box {
    border: 1px dashed rgba(47, 124, 255, 0.36);
    border-radius: var(--radius);
    background:
      radial-gradient(circle at 12% 0%, rgba(73, 217, 255, 0.1), transparent 45%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(239, 247, 255, 0.95));
  }

  .character-preview-grid figure {
    border-radius: var(--radius);
    background: #ffffff;
  }

  .style-image-strip {
    border-color: rgba(95, 139, 220, 0.2);
    background:
      radial-gradient(circle at 12% 0%, rgba(73, 217, 255, 0.1), transparent 42%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(239, 247, 255, 0.95));
  }

  .style-image-strip figure {
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(8, 24, 61, 0.08);
  }

  .style-image-strip figure.is-current {
    border-color: rgba(73, 217, 255, 0.72);
    box-shadow:
      0 0 0 3px rgba(73, 217, 255, 0.18),
      0 14px 24px rgba(47, 124, 255, 0.13);
  }

  .reference-image-card,
  .generated-image-section {
    border-color: rgba(95, 139, 220, 0.2);
    background:
      radial-gradient(circle at 8% 0%, rgba(87, 214, 201, 0.1), transparent 42%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(240, 248, 255, 0.96));
  }

  .reference-image-card figure {
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(8, 24, 61, 0.08);
  }

  .style-image-clear {
    border-color: rgba(47, 124, 255, 0.22);
    background: linear-gradient(135deg, #eef7ff, #f5f2ff);
    color: #236ef1;
  }

  .style-refresh-callout {
    border-color: rgba(255, 189, 74, 0.48);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff8e3, #fffdf7);
  }

  .toggle-row {
    padding: 15px 0;
  }

  .switch {
    width: 52px;
    height: 30px;
    background: #d8e3f1;
  }

  .switch.is-on {
    background: rgba(235, 246, 255, 0.95);
  }

  .cover,
  .page-image.generated,
  .page-art,
  .cover-art,
  .spark-scene {
    border-radius: var(--radius);
  }

  .cover {
    border: 1px solid rgba(255, 255, 255, 0.34);
    background:
      radial-gradient(circle at 78% 22%, rgba(255, 189, 74, 0.38), transparent 18rem),
      radial-gradient(circle at 18% 18%, rgba(73, 217, 255, 0.34), transparent 16rem),
      linear-gradient(145deg, #071944 0%, #173d91 54%, #eef8ff 100%);
    box-shadow:
      0 26px 70px rgba(8, 24, 61, 0.22),
      inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    color: var(--white);
  }

  .cover h1,
  .cover h2,
  .cover h3 {
    color: var(--white);
    text-shadow: 0 12px 24px rgba(4, 17, 47, 0.28);
  }

  .cover p,
  .cover .eyebrow,
  .cover .byline {
    color: rgba(255, 255, 255, 0.78);
  }

  .cover-art,
  .page-art {
    background:
      radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.9) 0 28px, transparent 29px),
      radial-gradient(circle at 78% 26%, rgba(255, 189, 74, 0.88) 0 26px, transparent 27px),
      linear-gradient(160deg, #071944 0%, #236ef1 46%, #49d9ff 73%, #fff3d1 100%);
    box-shadow:
      0 20px 46px rgba(8, 24, 61, 0.18),
      inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  }

  .page-art::before,
  .cover-art::before {
    background: linear-gradient(180deg, var(--coral), #ff8eb2);
    box-shadow:
      0 -30px 0 -9px #071944,
      140px 18px 0 -16px var(--blue);
  }

  .page-art::after,
  .cover-art::after {
    background: rgba(255, 255, 255, 0.48);
    box-shadow: 0 12px 30px rgba(255, 255, 255, 0.08);
  }

  .page-art.space {
    background:
      radial-gradient(circle at 18% 20%, #ffffff 0 2px, transparent 3px),
      radial-gradient(circle at 62% 28%, #ffffff 0 3px, transparent 4px),
      radial-gradient(circle at 84% 14%, #ffffff 0 2px, transparent 3px),
      linear-gradient(160deg, #06142f, #2445aa 58%, #ff5d91);
  }

  .page-art.sea {
    background:
      radial-gradient(ellipse at 78% 18%, rgba(255, 255, 255, 0.86), transparent 18%),
      linear-gradient(180deg, #dff8ff 0 43%, #21b8ff 43% 100%);
  }

  .page-art.forest {
    background:
      radial-gradient(ellipse at 22% 23%, rgba(255, 255, 255, 0.9), transparent 20%),
      linear-gradient(180deg, #dff8ff 0 49%, #57d6c9 49%);
  }

  .page-art.library {
    background:
      linear-gradient(90deg, rgba(47, 124, 255, 0.16) 0 14px, transparent 14px 27px),
      linear-gradient(180deg, #f5f9ff 0 62%, #cfe2ff 62%);
  }

  .page-image.generated {
    border-color: rgba(95, 139, 220, 0.22);
    background: #eaf4ff;
    box-shadow: 0 22px 52px rgba(8, 24, 61, 0.16);
  }

  .page-copy {
    padding: 18px;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.58;
  }

  .page-copy p {
    color: var(--ink);
    font-size: inherit;
  }

  .image-tools {
    gap: 9px;
  }

  .prompt-preview summary {
    color: #236ef1;
    font-size: 13px;
    font-weight: 900;
  }

  .prompt-preview p,
  .image-note,
  .image-error {
    font-size: 13px;
  }

  .image-note {
    color: #315879;
  }

  .image-error {
    color: #a33046;
  }

  .image-status strong {
    color: var(--ink);
    font-weight: 900;
  }

  .mini-progress {
    background: rgba(95, 139, 220, 0.18);
  }

  .mini-progress span,
  .progress-bar {
    background: linear-gradient(90deg, var(--blue), var(--cyan), var(--violet), var(--coral));
  }

  .spark-scene {
    background:
      radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.92) 0 34px, transparent 35px),
      radial-gradient(circle at 77% 28%, rgba(255, 93, 145, 0.74) 0 30px, transparent 31px),
      linear-gradient(160deg, #071944 0%, #236ef1 52%, #49d9ff 100%);
    box-shadow: 0 20px 50px rgba(8, 24, 61, 0.16);
  }

  .spark-scene::before {
    background: var(--sun);
    box-shadow:
      174px 34px 0 -52px rgba(255, 255, 255, 0.86),
      238px 92px 0 -56px rgba(116, 100, 255, 0.62);
  }

  .spark-scene::after {
    background: var(--blue);
    box-shadow: -122px 20px 0 -26px var(--coral);
  }

  .footer-actions {
    padding: 14px 20px 22px;
    background:
      linear-gradient(180deg, rgba(246, 250, 255, 0), rgba(246, 250, 255, 0.96) 28%),
      rgba(246, 250, 255, 0.96);
    box-shadow: 0 -18px 34px rgba(8, 24, 61, 0.05);
  }

  .reader-nav {
    grid-template-columns: minmax(92px, 1fr) auto minmax(92px, 1fr);
  }

  .page-count {
    color: #5b6f92;
    font-size: 12px;
    font-weight: 900;
  }

  .drawer-backdrop,
  .confirm-backdrop {
    background: rgba(4, 17, 47, 0.58);
    backdrop-filter: blur(12px);
  }

  .drawer {
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    background:
      radial-gradient(circle at 20% 6%, rgba(73, 217, 255, 0.18), transparent 14rem),
      linear-gradient(180deg, #071944, #102a66);
    box-shadow: 28px 0 74px rgba(4, 17, 47, 0.36);
  }

  .drawer .wordmark {
    color: var(--white);
    text-shadow: 0 16px 34px rgba(73, 217, 255, 0.24);
  }

  .drawer .btn-quiet {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
  }

  .drawer .btn-secondary {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.92);
  }

  .confirm-dialog {
    border-radius: var(--radius);
    background:
      radial-gradient(circle at 20% 0%, rgba(73, 217, 255, 0.12), transparent 14rem),
      linear-gradient(180deg, #ffffff, #eff7ff);
  }

  .toast {
    left: 20px;
    right: 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: linear-gradient(135deg, #071944, #236ef1);
    box-shadow:
      0 18px 42px rgba(4, 17, 47, 0.28),
      0 0 28px rgba(73, 217, 255, 0.18);
    font-size: 13px;
  }

  .price.featured,
  .price.active {
    border-color: rgba(47, 124, 255, 0.45);
    box-shadow:
      0 20px 48px rgba(47, 124, 255, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  .price b {
    color: #236ef1;
    font-size: 30px;
    font-weight: 950;
  }

  .empty {
    border-style: dashed;
    background: rgba(255, 255, 255, 0.72);
  }

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

  .save-state {
    margin: -2px 0 0;
    color: #70809f;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
  }

  .character-panel .cast-list {
    gap: 20px;
    padding-top: 4px;
  }

  .character-panel .cast-editor {
    position: relative;
    border-left: 4px solid rgba(47, 124, 255, 0.22);
  }

  .character-panel .cast-editor + .cast-editor::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -11px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(47, 124, 255, 0.28), rgba(73, 217, 255, 0.18), transparent);
  }

  @media (min-width: 720px) {
    .phone {
      width: min(940px, calc(100vw - 44px));
      border-radius: 24px;
    }

    .screen-scroll {
      max-width: 840px;
      padding: 28px 30px 34px;
    }

    .appbar {
      padding-left: 28px;
      padding-right: 28px;
    }

    .footer-actions {
      width: min(840px, calc(100% - 60px));
      margin: 0 auto;
    }

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

    .style-image-strip {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  @media (min-width: 1100px) {
    .phone {
      width: min(1380px, calc(100vw - 64px));
      height: min(900px, calc(100dvh - 56px));
      border-radius: 18px;
    }

    .screen-scroll {
      max-width: 1100px;
      padding: 30px 34px 36px;
    }

    .screen:has(.reader-page) .screen-scroll,
    .screen:has(.cover) .screen-scroll {
      max-width: 1260px;
    }

    .reader-page {
      grid-template-columns: 1fr;
    }

    .story-primary {
      grid-template-columns: minmax(540px, 1fr) minmax(400px, 0.72fr);
      column-gap: 34px;
    }

    .screen:has(.reader-page) .footer-actions,
    .screen:has(.cover) .footer-actions {
      width: min(1260px, calc(100% - 68px));
    }
  }

  @media (max-width: 460px) {
    .phone {
      border-radius: 0;
    }

    .appbar {
      min-height: 64px;
      padding-inline: 14px;
    }

    .appbar-title h2 {
      font-size: 17px;
    }

    .screen-scroll {
      padding: 22px 16px 28px;
    }

    .btn {
      min-height: 48px;
      padding-inline: 14px;
    }

    .choice {
      grid-template-columns: 48px 1fr;
      min-height: 96px;
      padding: 12px;
    }

    .choice-art,
    .cast-thumb {
      width: 48px;
      height: 48px;
    }

    .footer-row {
      grid-template-columns: 1fr;
    }

    .read-aloud-panel {
      grid-template-columns: 1fr;
    }

    .page-player-head,
    .page-player-body,
    .voice-select {
      align-items: stretch;
      flex-direction: column;
    }

    .voice-select select,
    .page-player-head .btn {
      width: 100%;
    }

    .read-aloud-controls {
      justify-content: stretch;
    }

    .story-audio-btn {
      flex: 1 1 0;
    }

    .reader-nav {
      grid-template-columns: 1fr;
    }

    .reader-nav .btn:last-child {
      justify-self: stretch;
    }
  }
}

.logo-wrap.logo-wrap-full {
  width: min(252px, 60vw);
  margin: 20px auto 20px;
}

.drawer-logo {
  display: block;
  width: 100%;
  max-width: 250px;
  height: auto;
  margin: 0 0 22px;
  border-radius: 8px;
  filter: drop-shadow(0 14px 28px rgba(73, 217, 255, 0.2));
}

.learn-logo-panel {
  width: min(58%, 360px);
  margin: 0 auto 22px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.learn-logo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.info-stack {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.price-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.price-actions .btn {
  flex: 1 1 128px;
}

.enterprise-price {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 255, 0.96));
}

@media (min-width: 720px) {
  .learn-logo-panel {
    width: min(42%, 320px);
  }
}

@media (min-width: 1100px) {
  .learn-logo-panel {
    width: min(30%, 300px);
  }

  .enterprise-price {
    grid-column: 1 / -1;
  }
}

.splash-logo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  filter:
    drop-shadow(0 18px 34px rgba(18, 52, 120, 0.26))
    drop-shadow(0 0 22px rgba(73, 217, 255, 0.22));
}

.story-audio-btn {
  border: 1px solid rgba(47, 124, 255, 0.14);
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
  box-shadow: none;
}

.story-audio-btn:hover {
  background: rgba(235, 246, 255, 0.95);
  color: #236ef1;
  box-shadow: 0 10px 24px rgba(47, 124, 255, 0.1);
}

.story-audio-btn:disabled {
  border-color: rgba(95, 139, 220, 0.16);
  background: rgba(235, 245, 255, 0.9);
  color: var(--muted);
  box-shadow: none;
}

.btn:not(.btn-danger):not(.btn-saved),
.btn-secondary:not(.btn-danger):not(.btn-saved),
.btn-quiet,
.btn.btn-quiet,
.btn-warm,
.upgrade-pill,
.story-audio-btn,
.story-audio-btn:hover,
.character-badge.muted,
.chip.is-selected,
.segment.is-selected,
.style-image-clear,
.upload-box input::file-selector-button {
  color: var(--action-text);
}

@media (max-width: 420px) {
  .logo-wrap.logo-wrap-full {
    width: min(231px, 60vw);
    margin-top: 14px;
  }
}

.hero-story-section,
.reusable-cast-section,
.preference-style-section,
.book-defaults-section,
.preference-switches-section {
  border-left-width: 4px;
  border-left-style: solid;
}

.hero-story-section {
  border-left-color: rgba(73, 217, 255, 0.42);
}

.reusable-cast-section {
  border-left-color: rgba(87, 214, 201, 0.4);
  background:
    radial-gradient(circle at 92% 0%, rgba(87, 214, 201, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 252, 251, 0.94));
}

.preference-style-section {
  border-left-color: rgba(108, 99, 255, 0.34);
  background:
    radial-gradient(circle at 90% 0%, rgba(108, 99, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 245, 255, 0.94));
}

.book-defaults-section {
  border-left-color: rgba(255, 180, 162, 0.5);
  background:
    radial-gradient(circle at 92% 0%, rgba(255, 180, 162, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 245, 0.94));
}

.preference-switches-section {
  border-left-color: rgba(255, 213, 106, 0.58);
  background:
    radial-gradient(circle at 92% 0%, rgba(255, 213, 106, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 252, 239, 0.95));
}

/* Responsive Storieze product shell */
@media screen {
  :root {
    --brand-navy: #07163b;
    --brand-blue: #0878f9;
    --brand-cyan: #21c8f6;
    --brand-violet: #714eff;
    --brand-pink: #f63d93;
    --brand-gold: #ffba33;
    --app-bg: #f4f7fc;
    --surface: #ffffff;
    --surface-muted: #edf4ff;
    --surface-strong: #e4edfb;
    --text: #0b1738;
    --text-muted: #64718d;
    --control-line: #d9e2f0;
    --control-line-strong: #b9c9e2;
    --radius: 8px;
    --shadow-soft: 0 10px 28px rgba(11, 29, 68, 0.08);
  }

  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--app-bg);
  }

  body {
    min-width: 320px;
    color: var(--text);
    font-family: "Segoe UI Variable", "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 15px;
  }

  body::before,
  body::after {
    display: none;
  }

  h1,
  h2,
  h3,
  h4,
  p,
  button,
  input,
  textarea,
  select {
    letter-spacing: 0;
  }

  h1 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: clamp(27px, 3vw, 38px);
    font-weight: 800;
    line-height: 1.15;
  }

  h2 {
    color: var(--text);
    font-weight: 800;
  }

  h3,
  h4 {
    color: var(--text);
    font-weight: 750;
  }

  p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.55;
  }

  .shell {
    min-height: 100dvh;
    display: block;
    padding: 0;
    background: var(--app-bg);
  }

  .phone {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: var(--app-bg);
    box-shadow: none;
  }

  .screen {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
    background: var(--app-bg);
  }

  .app-workspace {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
      linear-gradient(90deg, rgba(8, 120, 249, 0.035), transparent 24%),
      var(--app-bg);
  }

  .screen-scroll {
    width: 100%;
    max-width: 1320px;
    min-height: 0;
    margin: 0 auto;
    overflow: auto;
    padding: clamp(24px, 3vw, 42px) clamp(18px, 4vw, 56px) 56px;
    overscroll-behavior: contain;
    scrollbar-color: rgba(8, 120, 249, 0.25) transparent;
    scrollbar-width: thin;
  }

  .screen-scroll::-webkit-scrollbar {
    width: 8px;
  }

  .screen-scroll::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 99px;
    background: rgba(8, 120, 249, 0.26);
    background-clip: padding-box;
  }

  .appbar {
    position: relative;
    flex: 0 0 auto;
    min-height: 68px;
    gap: 12px;
    padding: 10px clamp(16px, 3vw, 36px);
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--brand-navy);
    box-shadow: none;
  }

  .appbar::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-cyan) 34%, var(--brand-violet) 62%, var(--brand-pink) 82%, var(--brand-gold));
  }

  .appbar-title h2 {
    margin: 2px 0 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 750;
  }

  .appbar-kicker {
    gap: 7px;
  }

  .appbar-brand-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .appbar .eyebrow {
    margin: 0;
    color: #a8dfff;
    font-size: 10px;
    font-weight: 800;
  }

  .appbar .icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
  }

  .appbar .icon-btn:hover {
    background: rgba(33, 200, 246, 0.15);
    box-shadow: none;
  }

  .appbar .upgrade-pill {
    min-height: 34px;
    border: 0;
    background: var(--brand-gold);
    color: #332000;
    font-weight: 800;
  }

  .appbar .plan-pill {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.1);
    color: #dbeeff;
  }

  .desktop-nav {
    display: none;
  }

  .page-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--control-line);
  }

  .page-intro > div {
    max-width: 760px;
  }

  .page-intro p {
    margin: 0;
    font-size: 15px;
  }

  .page-intro .eyebrow,
  .screen-scroll > .eyebrow,
  .character-panel-head .eyebrow {
    margin: 0 0 7px;
    color: #0871d7;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .home-primary-action {
    flex: 0 0 auto;
    min-width: 176px;
  }

  .btn {
    min-height: 46px;
    padding: 11px 18px;
    border: 1px solid #086be0;
    border-radius: var(--radius);
    background: #0878f9;
    box-shadow: 0 7px 16px rgba(8, 120, 249, 0.18);
    color: #ffffff;
    font-size: 14px;
    font-weight: 750;
  }

  .btn:hover {
    transform: translateY(-1px);
    border-color: #005dc8;
    background: #066fe9;
    box-shadow: 0 9px 20px rgba(8, 120, 249, 0.23);
  }

  .btn-secondary,
  .btn-quiet,
  .btn.btn-quiet,
  .btn-warm,
  .story-audio-btn {
    border-color: var(--control-line-strong);
    background: #ffffff;
    box-shadow: none;
    color: #1c5ea8;
  }

  .btn-secondary:hover,
  .btn-quiet:hover,
  .btn.btn-quiet:hover,
  .btn-warm:hover,
  .story-audio-btn:hover {
    border-color: #8db2df;
    background: #eef6ff;
    box-shadow: none;
    color: #154f91;
  }

  .btn-danger {
    border-color: #f1b6c9;
    background: #fff4f7;
    box-shadow: none;
    color: #a82052;
  }

  .btn-small {
    min-height: 38px;
    padding: 8px 13px;
  }

  .choice-grid {
    gap: 16px;
  }

  .choice,
  .story-card,
  .mini-item,
  .price,
  .plan-card,
  .account-type-card,
  .feature-card,
  .cast-editor,
  .cast-picker,
  .cast-row,
  .page-copy,
  .prompt-preview,
  .image-status,
  .empty {
    border: 1px solid var(--control-line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: none;
  }

  .product-area-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .product-area-grid .choice {
    position: relative;
    min-height: 132px;
    padding: 20px 46px 20px 20px;
    border-color: transparent;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
  }

  .product-area-grid .choice::after {
    content: "\203A";
    position: absolute;
    top: 50%;
    right: 20px;
    color: #8a9ab8;
    font-size: 28px;
    line-height: 1;
    transform: translateY(-50%);
  }

  .product-area-grid .choice:hover {
    border-color: rgba(8, 120, 249, 0.28);
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(11, 29, 68, 0.12);
  }

  .choice strong,
  .mini-item-main strong,
  .price strong,
  .toggle-row strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 750;
  }

  .choice span,
  .mini-item-main span,
  .toggle-row span {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
  }

  .choice-art,
  .cast-thumb {
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 8px;
    background: #e6f3ff;
    box-shadow: none;
    color: #0871d7;
  }

  .choice:nth-child(2n) .choice-art {
    background: #f2eaff;
    color: #6645d8;
  }

  .choice:nth-child(3n) .choice-art {
    background: #fff1d1;
    color: #8d5b00;
  }

  .choice:nth-child(4n) .choice-art {
    background: #ffe6f0;
    color: #b32661;
  }

  .profile-section,
  .character-panel,
  .style-summary,
  .email-change,
  .password-change,
  .secure-name-change,
  .story-action-panel,
  .read-aloud-panel,
  .story-edit-panel {
    border: 0;
    border-left: 3px solid #73bdfb;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
  }

  .hero-story-section,
  .reusable-cast-section,
  .preference-style-section,
  .book-defaults-section,
  .preference-switches-section {
    border-left-width: 3px;
    background: #ffffff;
  }

  .hero-story-section {
    border-left-color: var(--brand-cyan);
  }

  .reusable-cast-section {
    border-left-color: #43c6a3;
  }

  .preference-style-section {
    border-left-color: var(--brand-violet);
  }

  .book-defaults-section {
    border-left-color: var(--brand-pink);
  }

  .preference-switches-section {
    border-left-color: var(--brand-gold);
  }

  .field > span,
  .field-label-row > span,
  .upload-box > span {
    color: #263755;
    font-size: 12px;
    font-weight: 750;
  }

  .field input,
  .field textarea,
  .field select {
    min-height: 46px;
    border: 1px solid var(--control-line-strong);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: none;
    color: var(--text);
  }

  .field input:focus,
  .field textarea:focus,
  .field select:focus {
    border-color: var(--brand-blue);
    outline: 3px solid rgba(8, 120, 249, 0.13);
  }

  .chip,
  .segment {
    min-height: 36px;
    border: 1px solid var(--control-line-strong);
    border-radius: 999px;
    background: #ffffff;
    color: #52627d;
  }

  .chip.is-selected,
  .segment.is-selected {
    border-color: #77aef1;
    background: #eaf4ff;
    color: #075dad;
  }

  .footer-actions {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 12px clamp(18px, 4vw, 56px) max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--control-line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -6px 20px rgba(11, 29, 68, 0.05);
    backdrop-filter: blur(10px);
  }

  .site-footer {
    border-radius: var(--radius);
    background: var(--brand-navy);
  }

  .drawer {
    border: 0;
    background: var(--brand-navy);
    box-shadow: 18px 0 48px rgba(3, 12, 34, 0.28);
  }

  .drawer-logo {
    max-width: 200px;
    border-radius: 0;
    filter: none;
  }

  .drawer .btn-quiet {
    border: 0;
    background: transparent;
    color: #e8f4ff;
    box-shadow: none;
  }

  .drawer .btn-quiet:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
  }

  .account-dropdown {
    border: 1px solid var(--control-line);
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(11, 29, 68, 0.16);
  }

  .screen-onboarding {
    display: block;
    overflow: auto;
    background: var(--brand-navy);
  }

  .screen-onboarding .app-workspace {
    min-height: 100dvh;
    overflow: visible;
  }

  .screen-onboarding .screen-scroll {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .auth-brand {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: clamp(40px, 6vw, 88px);
    background:
      radial-gradient(circle at 18% 16%, rgba(33, 200, 246, 0.2), transparent 22rem),
      radial-gradient(circle at 82% 22%, rgba(246, 61, 147, 0.15), transparent 20rem),
      var(--brand-navy);
    color: #ffffff;
  }

  .auth-brand-inner {
    width: min(100%, 660px);
  }

  .auth-brand .splash-logo {
    width: min(100%, 480px);
    height: auto;
    margin: 0 0 28px;
    border-radius: 0;
    filter: none;
  }

  .auth-promise {
    max-width: 560px;
    margin: 0 0 26px;
    color: #ffffff;
    font-size: clamp(24px, 3vw, 40px);
    font-weight: 750;
    line-height: 1.18;
  }

  .auth-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 36px;
  }

  .auth-highlights span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: #dcecff;
    font-size: 12px;
    font-weight: 650;
  }

  .auth-brand .tagline {
    max-width: 500px;
    margin: 0;
    color: #91b3d5;
    font-size: 13px;
    font-weight: 650;
    text-align: left;
  }

  .auth-panel-wrap {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: clamp(30px, 5vw, 72px);
    background: #f7f9fd;
  }

  .screen-onboarding .login-block {
    width: min(100%, 440px);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text);
    text-align: left;
    backdrop-filter: none;
  }

  .screen-onboarding .login-block h1 {
    margin-bottom: 8px;
    color: var(--text);
    font-size: clamp(30px, 3vw, 42px);
  }

  .screen-onboarding .login-block .eyebrow {
    color: #0871d7;
  }

  .login-intro {
    margin: 0 0 28px;
    font-size: 15px;
  }

  .auth-login-button {
    width: 100%;
    margin-top: 2px;
  }

  .register-prompt {
    margin: 16px 0 24px;
    text-align: center;
  }

  .register-prompt .link-button,
  .auth-links .link-button {
    color: #0869cd;
  }

  .screen-onboarding .social-login {
    color: #75809a;
  }

  .screen-onboarding .social-btn {
    min-height: 44px;
    border: 1px solid var(--control-line);
    border-radius: var(--radius);
    background: #ffffff;
    color: #263755;
  }

  .auth-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
  }

  .learn-logo-panel {
    width: min(240px, 45%);
    margin: 0 0 28px;
  }

  .learn-logo {
    border-radius: 0;
  }

  .cover {
    border: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
  }

  .page-image.generated,
  .page-art,
  .cover-art,
  .spark-scene {
    border-radius: var(--radius);
  }

  .page-copy {
    padding: clamp(20px, 3vw, 34px);
    font-size: clamp(17px, 1.5vw, 20px);
    line-height: 1.65;
  }
}

@media screen and (min-width: 680px) {
  .product-area-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choice-grid,
  .price-grid,
  .account-type-grid,
  .feature-card-grid,
  .account-billing-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (min-width: 1080px) {
  .screen:not(.screen-onboarding) {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .desktop-nav {
    grid-column: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
    padding: 22px 16px 18px;
    background:
      radial-gradient(circle at 12% 2%, rgba(33, 200, 246, 0.13), transparent 13rem),
      var(--brand-navy);
    color: #ffffff;
  }

  .app-workspace {
    grid-column: 2;
  }

  .desktop-brand {
    width: 100%;
    min-height: 62px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    text-align: left;
  }

  .desktop-brand img {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    object-fit: contain;
  }

  .desktop-brand span {
    min-width: 0;
    display: grid;
    gap: 1px;
  }

  .desktop-brand strong {
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
  }

  .desktop-brand small {
    color: #8eb5d9;
    font-size: 10px;
  }

  .desktop-nav > nav {
    display: grid;
    gap: 21px;
    padding-top: 22px;
  }

  .desktop-nav-group {
    display: grid;
    gap: 4px;
  }

  .desktop-nav-label {
    margin: 0 10px 6px;
    color: #6f94ba;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .desktop-nav-item {
    width: 100%;
    min-height: 42px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 7px;
    background: transparent;
    color: #bdd0e5;
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
    text-align: left;
  }

  .desktop-nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
  }

  .desktop-nav-item.is-active {
    background: #ffffff;
    color: #0b2855;
    font-weight: 750;
  }

  .nav-symbol {
    position: relative;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: currentColor;
  }

  .nav-symbol::before {
    content: "";
    width: 7px;
    height: 7px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
  }

  .desktop-nav-item.is-active .nav-symbol {
    border-color: #b8d8ff;
    background: #e7f3ff;
    color: #0871d7;
  }

  .nav-symbol-spark::before,
  .nav-symbol-info::before {
    border-radius: 50%;
  }

  .nav-symbol-book::before,
  .nav-symbol-publish::before {
    width: 9px;
    height: 7px;
    border-radius: 1px;
  }

  .nav-symbol-voice::before {
    width: 3px;
    height: 9px;
    border-radius: 3px;
  }

  .desktop-nav-foot {
    display: grid;
    gap: 3px;
    margin-top: auto;
    padding: 16px 10px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.11);
  }

  .desktop-nav-foot span {
    color: #ffffff;
    font-size: 12px;
    font-weight: 750;
  }

  .desktop-nav-foot small {
    color: #7f9fbe;
    font-size: 11px;
  }

  .appbar [data-menu] {
    display: none;
  }

  .appbar-kicker {
    display: none;
  }

  .appbar-title h2 {
    margin: 0;
    font-size: 20px;
  }

  .product-area-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .screen-scroll {
    max-width: 1380px;
    padding: 40px clamp(38px, 4vw, 64px) 64px;
  }

  .screen:has(.reader-page) .screen-scroll,
  .screen:has(.cover) .screen-scroll {
    max-width: 1420px;
  }

  .screen:has(.reader-page) .footer-actions,
  .screen:has(.cover) .footer-actions {
    width: 100%;
    max-width: none;
  }
}

@media screen and (max-width: 1079px) {
  .appbar .plan-pill {
    max-width: 112px;
  }
}

@media screen and (max-width: 820px) {
  .screen-onboarding .screen-scroll {
    grid-template-columns: 1fr;
  }

  .auth-brand,
  .auth-panel-wrap {
    min-height: auto;
  }

  .auth-brand {
    padding: 38px 24px 42px;
  }

  .auth-brand .splash-logo {
    width: min(76vw, 360px);
    margin-bottom: 18px;
  }

  .auth-promise {
    max-width: 560px;
    font-size: 28px;
  }

  .auth-highlights {
    margin-bottom: 22px;
  }

  .auth-panel-wrap {
    padding: 42px 24px 54px;
  }

  .page-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-primary-action {
    width: 100%;
  }
}

@media screen and (max-width: 520px) {
  .appbar {
    min-height: 62px;
    padding: 9px 12px;
  }

  .appbar-title h2 {
    font-size: 16px;
  }

  .appbar .plan-pill {
    display: none;
  }

  .screen-scroll {
    padding: 24px 16px 48px;
  }

  .product-area-grid,
  .choice-grid,
  .price-grid,
  .account-type-grid,
  .feature-card-grid,
  .account-billing-summary {
    grid-template-columns: 1fr;
  }

  .product-area-grid .choice {
    min-height: 106px;
    padding: 15px 42px 15px 14px;
  }

  .page-intro {
    margin-bottom: 20px;
    padding-bottom: 20px;
  }

  .auth-brand {
    padding: 20px 20px 24px;
  }

  .auth-brand .splash-logo {
    width: min(66vw, 250px);
    margin-bottom: 12px;
  }

  .auth-promise {
    margin-bottom: 14px;
    font-size: 21px;
  }

  .auth-highlights {
    gap: 6px;
    margin-bottom: 14px;
  }

  .auth-highlights span {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .auth-brand .tagline {
    font-size: 11px;
    line-height: 1.4;
  }

  .auth-panel-wrap {
    padding: 30px 20px 44px;
  }

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

  .footer-actions {
    padding-inline: 16px;
  }
}

.preference-style-section .style-summary {
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.preference-switches-section .toggle-row {
  background: rgba(255, 255, 255, 0.7);
}

.story-step-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin: 0 0 18px;
  border: 1px solid rgba(27, 117, 187, 0.18);
  border-left-width: 4px;
  border-left-style: solid;
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(11, 23, 66, 0.06);
  text-align: left;
}

.story-step-section .field:last-child,
.story-step-section .field-hint:last-child,
.story-step-section .quick-traits:last-child {
  margin-bottom: 0;
}

.story-step-hero {
  border-left-color: rgba(73, 217, 255, 0.42);
  background:
    radial-gradient(circle at 92% 0%, rgba(73, 217, 255, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 248, 255, 0.94));
}

.story-step-cast {
  border-left-color: rgba(87, 214, 201, 0.4);
  background:
    radial-gradient(circle at 92% 0%, rgba(87, 214, 201, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 252, 251, 0.94));
}

.story-step-details {
  border-left-color: rgba(108, 99, 255, 0.34);
  background:
    radial-gradient(circle at 92% 0%, rgba(108, 99, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 245, 255, 0.94));
}

.story-step-setting {
  border-left-color: rgba(255, 180, 162, 0.5);
  background:
    radial-gradient(circle at 92% 0%, rgba(255, 180, 162, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 245, 0.94));
}

.story-step-moral {
  border-left-color: rgba(255, 213, 106, 0.58);
  background:
    radial-gradient(circle at 92% 0%, rgba(255, 213, 106, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 252, 239, 0.95));
}

.story-step-section .cast-row,
.story-step-section .quick-traits {
  background: rgba(255, 255, 255, 0.68);
}

/* Final product-shell alignment and contrast fixes */
@media screen {
  .page-intro > div {
    min-width: 0;
    flex: 1 1 auto;
  }

  .home-primary-action {
    width: auto;
    color: #ffffff;
  }

  .btn:not(.btn-secondary):not(.btn-quiet):not(.btn-danger):not(.btn-saved):not(.btn-locked),
  .auth-login-button,
  .home-primary-action {
    color: #ffffff;
  }

  .story-step-section {
    gap: 14px;
    padding: 18px;
    border: 0;
    border-left: 3px solid #73bdfb;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
  }

  .story-step-hero {
    border-left-color: var(--brand-cyan);
  }

  .story-step-cast {
    border-left-color: #43c6a3;
  }

  .story-step-details {
    border-left-color: var(--brand-violet);
  }

  .story-step-setting {
    border-left-color: var(--brand-pink);
  }

  .story-step-moral {
    border-left-color: var(--brand-gold);
  }

  .preference-style-section .style-summary,
  .preference-switches-section .toggle-row,
  .story-step-section .cast-row,
  .story-step-section .quick-traits {
    background: #f8faff;
  }

  .site-footer {
    width: auto;
    margin: 34px 0 -48px;
  }
}

@media screen and (min-width: 1080px) {
  .desktop-nav > nav {
    gap: 14px;
    padding-top: 16px;
  }

  .desktop-nav-group {
    gap: 2px;
  }

  .desktop-nav-item {
    min-height: 38px;
    padding-block: 6px;
  }

  .desktop-nav-label {
    margin-bottom: 4px;
  }
}

/* Guided story-creation flow */
@media screen {
  .story-build-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 26px;
  }

  .story-build-steps button {
    min-height: 62px;
    padding: 10px 12px;
    border-color: var(--control-line);
    background: #ffffff;
    color: var(--text-muted);
  }

  .story-build-steps button:hover {
    border-color: #9bc3ef;
    background: #f4f9ff;
  }

  .story-build-steps button.is-active {
    border-color: #99c8f4;
    background: #eaf5ff;
    color: #075cac;
    box-shadow: none;
  }

  .story-build-steps button b {
    color: inherit;
  }

  .story-step-heading,
  .story-cast-subhead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
  }

  .story-step-heading > .character-badge {
    width: fit-content;
    flex: 0 0 auto;
  }

  .story-step-heading h3,
  .story-cast-subhead h3,
  .story-cast-subsection h3 {
    margin: 0;
  }

  .story-step-heading p,
  .story-cast-subhead p,
  .story-cast-subsection p {
    margin-top: 6px;
  }

  .story-cast-builder {
    gap: 18px;
  }

  .story-character-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid #dce8f6;
    border-radius: var(--radius);
    background: #f8fbff;
  }

  .story-character-card.is-hero {
    border-color: #b9ddf7;
    background: #f4faff;
  }

  .story-character-summary {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
  }

  .story-character-summary strong {
    display: block;
    color: var(--text);
    font-size: 16px;
    font-weight: 780;
  }

  .story-character-summary span:not(.story-role-badge):not(.choice-art) {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
  }

  .story-role-badge {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border: 1px solid #98ccef;
    border-radius: 999px;
    background: #e6f5ff;
    color: #075cac;
    font-size: 11px;
    font-weight: 800;
  }

  .story-character-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .story-character-fields .field,
  .story-cast-builder > .field {
    margin-bottom: 0;
  }

  .story-field-note {
    margin: -4px 0 0;
  }

  .story-character-card .quick-traits {
    padding: 14px;
    border-radius: var(--radius);
    background: #ffffff;
  }

  .story-character-card .quick-traits .chip-row {
    margin-bottom: 0;
  }

  .story-cast-divider {
    height: 1px;
    margin: 2px 0;
    background: var(--control-line);
  }

  .story-cast-subsection {
    display: grid;
    gap: 14px;
  }

  .story-cast-subsection .cast-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .story-cast-subsection .cast-row {
    border: 1px solid var(--control-line);
    background: #ffffff;
  }

  .story-review-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 26px 0 18px;
  }

  .story-review-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--control-line);
    border-top: 3px solid var(--brand-cyan);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
  }

  .story-review-idea {
    border-top-color: var(--brand-pink);
  }

  .story-review-format {
    border-top-color: var(--brand-gold);
  }

  .story-review-card-head {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  .review-number {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #e9f5ff;
    color: #075cac;
    font-size: 13px;
    font-weight: 850;
  }

  .story-review-card h3,
  .story-review-card .eyebrow {
    margin: 0;
  }

  .story-review-card dl {
    display: grid;
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    gap: 10px 12px;
    margin: 0;
  }

  .story-review-card dt {
    color: #33425d;
    font-size: 12px;
    font-weight: 780;
  }

  .story-review-card dd {
    min-width: 0;
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .story-review-card .link-button {
    width: fit-content;
    margin-top: auto;
    color: #0767c2;
  }

  .generation-note {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: var(--brand-navy);
  }

  .generation-note strong {
    color: #ffffff;
    font-size: 14px;
  }

  .generation-note p {
    margin: 0;
    color: #aac4df;
    font-size: 13px;
  }
}

@media screen and (max-width: 900px) {
  .story-review-grid {
    grid-template-columns: 1fr;
  }

  .story-cast-subsection .cast-list {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 560px) {
  .story-build-steps {
    gap: 6px;
  }

  .story-build-steps button {
    min-height: 58px;
    padding: 8px;
    font-size: 11px;
  }

  .story-build-steps button b {
    font-size: 10px;
  }

  .story-step-heading,
  .story-cast-subhead {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .story-character-card {
    padding: 14px;
  }

  .story-character-summary {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .story-character-fields {
    grid-template-columns: 1fr;
  }

  .story-review-card {
    padding: 16px;
  }

  .story-review-card dl {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .story-review-card dd {
    margin-bottom: 9px;
  }

  .generation-note {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Compact mobile and tablet app header */
@media screen and (max-width: 1079px) {
  .appbar {
    display: block;
    min-height: 0;
    padding: 9px clamp(16px, 3vw, 28px) 10px;
  }

  .appbar-primary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 40px;
  }

  .appbar-primary > [data-menu] {
    grid-column: 1;
    justify-self: start;
  }

  .appbar-mobile-brand {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
  }

  .appbar-mobile-brand img {
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
  }

  .appbar-actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .appbar-title {
    margin-top: 5px;
    padding-top: 7px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .appbar-title .appbar-kicker {
    display: none;
  }

  .appbar-title h2 {
    margin: 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 750;
    line-height: 1.25;
  }
}

@media screen and (max-width: 520px) {
  .appbar {
    min-height: 0;
    padding: 8px 16px 9px;
  }

  .appbar-title h2 {
    font-size: 15px;
  }
}
