:root {
  --ink: #17212b;
  --muted: #5f6b72;
  --paper: #fffdf8;
  --panel: #ffffff;
  --aqua: #1f9a9d;
  --leaf: #4a8d5c;
  --coral: #eb6a5b;
  --sun: #f4c747;
  --lilac: #8d74b8;
  --line: #d9e1df;
  --shadow: 0 20px 70px rgba(22, 33, 43, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}

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

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid rgba(23, 33, 43, 0.08);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--aqua));
}

nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 2vw, 28px);
  color: var(--muted);
  font-size: 0.94rem;
}

nav a:hover,
.nav-cta:hover {
  color: var(--ink);
}

.nav-cta {
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
  background: #fff;
}

.studio-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(380px, 1.08fr);
  gap: clamp(28px, 4vw, 64px);
  min-height: calc(100vh - 88px);
  padding: clamp(24px, 4vw, 58px);
  align-items: center;
  overflow: hidden;
}

.studio-panel {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--aqua);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 0.78rem;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(3.1rem, 7vw, 6.6rem);
  line-height: 0.88;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 3.25rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  letter-spacing: 0;
}

.lede {
  max-width: 620px;
  color: #3e4a52;
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  line-height: 1.55;
}

.builder {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

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

label,
fieldset {
  min-width: 0;
}

label {
  display: grid;
  gap: 8px;
  color: #2e3a42;
  font-size: 0.9rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 0 rgba(23, 33, 43, 0.03);
}

textarea {
  resize: vertical;
  min-height: 104px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(31, 154, 157, 0.28);
  outline-offset: 2px;
}

.upload-zone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 18px;
  border: 2px dashed rgba(31, 154, 157, 0.45);
  border-radius: 8px;
  background: rgba(31, 154, 157, 0.06);
  cursor: pointer;
}

.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-zone::before {
  content: "+";
  display: grid;
  flex: 0 0 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--aqua);
  font-size: 1.8rem;
  line-height: 1;
}

.upload-zone span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.cast-builder,
.story-moments {
  display: grid;
  gap: 12px;
}

.cast-intro {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cast-intro p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.secondary-button {
  min-height: 42px;
  border: 1px solid rgba(31, 154, 157, 0.34);
  border-radius: 8px;
  padding: 9px 12px;
  color: #0f686b;
  background: rgba(31, 154, 157, 0.08);
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

.secondary-button:hover {
  background: rgba(31, 154, 157, 0.14);
}

.secondary-button.is-approved {
  border-color: rgba(74, 141, 92, 0.42);
  color: #2f6b42;
  background: rgba(74, 141, 92, 0.12);
}

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

.character-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.character-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.character-avatar {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--coral);
  font-weight: 900;
}

.character-avatar.mom {
  background: var(--leaf);
}

.character-avatar.pet {
  background: var(--lilac);
}

.character-avatar.added {
  background: var(--aqua);
}

.character-head strong,
.character-head small {
  display: block;
}

.character-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.compact {
  gap: 10px;
}

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

.character-features {
  min-height: 44px;
}

.photo-drop {
  position: relative;
  min-height: 122px;
  border: 1px dashed rgba(31, 154, 157, 0.48);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(31, 154, 157, 0.06);
  cursor: pointer;
}

.photo-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.character-preview {
  display: grid;
  width: 100%;
  height: 122px;
  place-items: center;
  padding: 12px;
  color: #0f686b;
  background-position: center;
  background-size: cover;
  font-weight: 850;
  text-align: center;
}

.character-preview.has-image {
  align-items: end;
  color: #fff;
  text-shadow: 0 1px 5px rgba(23, 33, 43, 0.6);
  background-color: #d9e1df;
}

.micro-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

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

.narrative-grid textarea {
  min-height: 92px;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 9px;
  color: #2e3a42;
  font-size: 0.9rem;
  font-weight: 800;
}

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

.style-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 126px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.style-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.style-card.selected {
  border-color: var(--aqua);
  box-shadow: inset 0 0 0 2px rgba(31, 154, 157, 0.18);
}

.style-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1.7;
  border-radius: 6px;
}

.storybook {
  background:
    radial-gradient(circle at 30% 35%, #f9e49b 0 14%, transparent 15%),
    linear-gradient(135deg, #f58a68 0 36%, #68b7aa 36% 70%, #4a8d5c 70%);
}

.cinema {
  background:
    radial-gradient(circle at 70% 26%, #fff3c7 0 11%, transparent 12%),
    linear-gradient(135deg, #384f80, #dd6b65 52%, #f4c747);
}

.watercolor {
  background:
    radial-gradient(circle at 75% 36%, rgba(141, 116, 184, 0.72), transparent 31%),
    radial-gradient(circle at 31% 67%, rgba(31, 154, 157, 0.65), transparent 34%),
    #fff6df;
}

.toggle-line {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.toggle-line p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.lesson-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 14px;
}

.lesson-pill {
  display: inline-flex;
  min-width: 0;
  cursor: pointer;
}

.lesson-pill input {
  position: absolute;
  opacity: 0;
}

.lesson-pill span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  color: #3e4a52;
  background: #fff;
  font-weight: 850;
  white-space: nowrap;
}

.lesson-pill.selected span {
  border-color: var(--aqua);
  color: #0f686b;
  background: rgba(31, 154, 157, 0.1);
}

.switch {
  display: inline-block;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: relative;
  display: block;
  width: 50px;
  height: 28px;
  border-radius: 999px;
  background: #c9d4d2;
  transition: 180ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: 180ms ease;
}

.switch input:checked + span {
  background: var(--leaf);
}

.switch input:checked + span::after {
  transform: translateX(22px);
}

.preview-stage {
  position: relative;
  min-height: 650px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #dfeee9;
}

.preview-stage > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(23, 33, 43, 0.02), rgba(23, 33, 43, 0.28));
}

.book-preview {
  position: absolute;
  z-index: 2;
  right: clamp(18px, 4vw, 44px);
  bottom: clamp(18px, 4vw, 44px);
  width: min(430px, calc(100% - 36px));
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  color: #fff;
  background: rgba(23, 33, 43, 0.56);
  backdrop-filter: blur(14px);
}

.cover-band {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
}

.cover-band span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cover-band strong {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1;
}

.verse-preview p,
.sample-page p {
  margin-bottom: 8px;
}

.cast-strip,
.art-proof,
.scene-pack,
.story-thread,
.recommendations,
.story-lab,
.deliverables,
.ops-panel,
.checkout-band,
.approval-flow {
  padding: clamp(42px, 6vw, 84px) clamp(18px, 5vw, 72px);
}

.cast-strip {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) 1fr;
  gap: 28px;
  align-items: center;
  background: #f7fbfa;
  border-block: 1px solid rgba(23, 33, 43, 0.08);
}

.cast-strip h2 {
  max-width: 680px;
  margin-bottom: 0;
}

.cast-summary,
.thread-grid,
.ops-grid {
  display: grid;
  gap: 12px;
}

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

.cast-summary article,
.thread-grid article,
.ops-grid article {
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cast-summary span,
.thread-grid span {
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.cast-summary strong,
.thread-grid strong,
.ops-grid strong {
  display: block;
  margin: 9px 0 7px;
  font-size: 1.28rem;
}

.cast-summary p,
.thread-grid p,
.ops-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.story-thread {
  background: #fff;
}

.art-proof {
  background: #f9f4ea;
}

.scene-pack {
  background: #fffdf8;
}

.art-proof .section-heading p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.5;
}

.scene-pack .section-heading p:not(.eyebrow) {
  max-width: 820px;
  color: var(--muted);
  line-height: 1.5;
}

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

.scene-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.scene-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 6px;
  background: #eef3f1;
}

.scene-card span {
  color: var(--aqua);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scene-card p {
  margin: 0;
  color: #40515a;
  line-height: 1.45;
}

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

.art-proof-card {
  display: grid;
  gap: 14px;
  min-height: 310px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.art-proof-card.approved {
  border-color: rgba(74, 141, 92, 0.45);
  box-shadow: inset 0 0 0 2px rgba(74, 141, 92, 0.12);
}

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

.proof-source,
.proof-cartoon {
  display: grid;
  min-height: 150px;
  align-content: end;
  gap: 6px;
  padding: 14px;
  border-radius: 8px;
  overflow: hidden;
}

.proof-source {
  color: #40515a;
  background:
    linear-gradient(135deg, rgba(217, 225, 223, 0.9), rgba(255, 253, 248, 0.86)),
    repeating-linear-gradient(45deg, rgba(23, 33, 43, 0.08) 0 8px, transparent 8px 16px);
  border: 1px dashed rgba(23, 33, 43, 0.22);
}

.proof-source.has-source {
  color: #fff;
  background:
    linear-gradient(180deg, rgba(23, 33, 43, 0.05), rgba(23, 33, 43, 0.5)),
    url("assets/story-studio-hero.png") center / cover;
}

.proof-cartoon {
  color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--aqua));
}

.cinema-proof {
  background: linear-gradient(135deg, #384f80, #dd6b65 54%, #f4c747);
}

.watercolor-proof {
  color: var(--ink);
  background:
    radial-gradient(circle at 70% 26%, rgba(141, 116, 184, 0.7), transparent 26%),
    radial-gradient(circle at 30% 72%, rgba(31, 154, 157, 0.55), transparent 33%),
    #fff6df;
}

.proof-source span,
.proof-cartoon span {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.proof-source strong,
.proof-cartoon strong {
  font-size: 2rem;
  line-height: 1;
}

.art-proof-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.proof-checklist {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(31, 154, 157, 0.2);
  border-radius: 8px;
  color: #40515a;
  background: rgba(31, 154, 157, 0.05);
  font-size: 0.82rem;
  line-height: 1.35;
  list-style: none;
}

.proof-checklist strong {
  color: #2e3a42;
}

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

.approve-art-button,
.revision-art-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 9px 11px;
  font-weight: 850;
  cursor: pointer;
}

.approve-art-button {
  border: 1px solid rgba(74, 141, 92, 0.36);
  color: #2f6b42;
  background: rgba(74, 141, 92, 0.1);
}

.revision-art-button {
  border: 1px solid rgba(235, 106, 91, 0.36);
  color: #9f3f35;
  background: rgba(235, 106, 91, 0.08);
}

.approval-status {
  color: #40515a;
  font-weight: 850;
}

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

.thread-grid article {
  position: relative;
  overflow: hidden;
}

.thread-grid article::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(244, 199, 71, 0.22);
}

.section-heading {
  max-width: 880px;
  margin-bottom: 28px;
}

.age-grid,
.offer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.age-grid article,
.offer-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.age-grid article {
  min-height: 205px;
  padding: 22px;
}

.age-grid span {
  color: var(--coral);
  font-weight: 850;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.age-grid h3 {
  margin: 11px 0 9px;
  font-size: 1.7rem;
}

.age-grid p,
.offer-card p,
.checkout-band p,
.approval-flow span,
.story-lab > div > p {
  color: var(--muted);
  line-height: 1.5;
}

.story-lab {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1fr);
  gap: clamp(26px, 5vw, 76px);
  align-items: center;
  background: #fff7e3;
}

.staff-review-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  max-width: 620px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid rgba(31, 154, 157, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.staff-review-panel span {
  display: block;
  color: var(--aqua);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.staff-review-panel strong {
  display: block;
  margin-top: 4px;
}

.sample-page {
  position: relative;
  min-height: 470px;
  padding: clamp(26px, 4vw, 48px);
  overflow: hidden;
  border: 1px solid rgba(23, 33, 43, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(255, 253, 248, 0.72)),
    url("assets/story-studio-hero.png") center / cover;
  box-shadow: var(--shadow);
}

.sample-page h3 {
  max-width: 520px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.sample-page p {
  max-width: 590px;
  font-size: clamp(1.02rem, 1.7vw, 1.3rem);
  line-height: 1.7;
}

.watermark {
  position: absolute;
  top: 28px;
  right: -70px;
  rotate: 18deg;
  color: rgba(235, 106, 91, 0.18);
  font-size: clamp(1.2rem, 3vw, 2.3rem);
  font-weight: 900;
  pointer-events: none;
}

.lesson-box {
  max-width: 620px;
  margin-top: 24px;
  padding: 18px;
  border-left: 6px solid var(--leaf);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.lesson-box ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #40515a;
}

.lesson-box li + li {
  margin-top: 7px;
}

.deliverables {
  background: #fff;
}

.ops-panel {
  background: #eef6f4;
}

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

.ops-grid article {
  min-height: 184px;
  border-color: rgba(31, 154, 157, 0.2);
}

.ops-grid strong {
  color: #17484b;
}

.offer-card {
  position: relative;
  min-height: 228px;
  padding: 20px;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

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

.offer-card input {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 22px;
  height: 22px;
  accent-color: var(--aqua);
}

.offer-card span {
  display: block;
  width: calc(100% - 32px);
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 850;
  text-transform: uppercase;
}

.offer-card strong {
  display: block;
  margin: 18px 0 12px;
  font-size: 2.3rem;
  line-height: 1;
}

.offer-card.active {
  border-color: var(--aqua);
  box-shadow: inset 0 0 0 2px rgba(31, 154, 157, 0.18);
}

.checkout-band {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 430px);
  gap: 28px;
  align-items: center;
  color: #fff;
  background: linear-gradient(135deg, #184247, #225c52 48%, #8d512d);
}

.checkout-band .eyebrow,
.checkout-band p {
  color: rgba(255, 255, 255, 0.78);
}

.checkout-band h2 {
  max-width: 780px;
}

.checkout-box {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(12px);
}

.total-line {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  margin-bottom: 18px;
}

.total-line span {
  color: rgba(255, 255, 255, 0.74);
}

.total-line strong {
  font-size: 2.8rem;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: var(--sun);
  font-weight: 900;
  cursor: pointer;
}

.primary-button:hover {
  filter: brightness(1.03);
}

#proofStatus {
  margin: 14px 0 0;
  font-size: 0.92rem;
}

.approval-flow {
  background: #f7fbfa;
}

.flow-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.flow-list li {
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flow-list strong {
  display: block;
  margin-bottom: 11px;
}

.proof-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 33, 43, 0.62);
}

.proof-modal[hidden] {
  display: none;
}

.proof-document {
  position: relative;
  width: min(760px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  overflow: auto;
  padding: clamp(22px, 4vw, 44px);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.proof-document img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 8px;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.modal-watermark {
  top: 52%;
  right: auto;
  left: 10%;
  z-index: 2;
  rotate: -16deg;
  color: rgba(235, 106, 91, 0.24);
  font-size: clamp(2rem, 8vw, 5.6rem);
}

.modal-gates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.modal-gates div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.modal-gates span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.modal-gates strong {
  display: block;
  margin-top: 5px;
}

.approval-stamp {
  display: inline-flex;
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid rgba(74, 141, 92, 0.4);
  border-radius: 8px;
  color: #2f6b42;
  background: rgba(74, 141, 92, 0.1);
  font-weight: 800;
}

.approval-stamp.ready {
  color: #17484b;
  background: rgba(244, 199, 71, 0.18);
}

@media (max-width: 1060px) {
  .studio-shell,
  .cast-strip,
  .story-lab,
  .checkout-band {
    grid-template-columns: 1fr;
  }

  .preview-stage {
    min-height: 520px;
  }

  .age-grid,
  .offer-grid,
  .cast-grid,
  .cast-summary,
  .scene-grid,
  .proof-grid,
  .thread-grid,
  .ops-grid,
  .flow-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1061px) {
  .studio-shell {
    height: calc(100vh - 88px);
    min-height: 620px;
    max-height: 820px;
  }

  .studio-panel {
    max-height: 100%;
    overflow: auto;
    padding-right: 8px;
    scrollbar-width: thin;
  }

  .preview-stage {
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  nav {
    display: none;
  }

  .nav-cta {
    padding-inline: 12px;
  }

  .studio-shell {
    padding-inline: 16px;
  }

  .form-grid,
  .likeness-grid,
  .style-grid,
  .cast-grid,
  .cast-summary,
  .scene-grid,
  .proof-grid,
  .thread-grid,
  .ops-grid,
  .narrative-grid,
  .age-grid,
  .offer-grid,
  .flow-list {
    grid-template-columns: 1fr;
  }

  .cast-intro {
    grid-template-columns: 1fr;
  }

  .staff-review-panel,
  .approval-actions {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.7rem, 13vw, 3.5rem);
  }

  .preview-stage {
    min-height: 430px;
  }

  .book-preview {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
  }
}

@media (max-width: 460px) {
  .brand span:last-child {
    display: none;
  }

  .nav-cta {
    font-size: 0.88rem;
  }

  h1 {
    font-size: clamp(2.45rem, 12.5vw, 3.2rem);
  }

  .cover-band strong {
    font-size: clamp(1.32rem, 6.5vw, 1.72rem);
  }

  .cast-strip,
  .art-proof,
  .story-thread,
  .recommendations,
  .story-lab,
  .deliverables,
  .ops-panel,
  .checkout-band,
  .approval-flow {
    padding-inline: 16px;
  }

  .total-line {
    display: grid;
  }

  .modal-gates {
    grid-template-columns: 1fr;
  }
}

.draft-tools { padding: 18px; margin: 20px 0; border: 1px solid #d8cbb8; border-radius: 16px; }
.draft-tools p { line-height: 1.5; }
.draft-tools button, .draft-tools input { margin: 8px 12px 8px 0; max-width: 100%; }
/* Keep visually hidden selection controls inside their labels on phones. */
.style-card, .switch, .lesson-pill { position: relative; }
.style-card input, .switch input, .lesson-pill input { width: 1px; height: 1px; padding: 0; }
.sample-page { overflow: hidden; }
.family-library { padding: 76px max(24px, 5vw); background: #f4eee3; }
.family-library .section-heading { max-width: 740px; margin: 0 auto 42px; text-align: center; }
.family-books { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 36px; max-width: 1220px; margin: auto; }
.family-cover { display: block; position: relative; width: 100%; aspect-ratio: 3/4; overflow: hidden; border: 0; border-radius: 3px 14px 14px 3px; padding: 0; color: white; background: #183e39; box-shadow: -7px 6px 0 #d5c9b5, 0 22px 30px #30281926; text-align: left; transition: transform .2s; }
.family-cover:hover { transform: translateY(-7px) rotate(-1deg); }
.family-cover img { width: 100%; height: 100%; object-fit: cover; }
.family-cover::after { content:''; position: absolute; inset: 0; background: linear-gradient(transparent 30%,#122d29eb 100%); box-shadow: inset 8px 0 10px #0004; }
.slate .family-cover::after { background: linear-gradient(transparent 30%,#102544f5 100%); }
.hosei .family-cover::after { background: linear-gradient(transparent 30%,#643326ef 100%); }
.cover-type { position:absolute; z-index:1; inset:auto 25px 28px; display:grid; gap:12px; }
.cover-type small { font-size:12px; text-transform:uppercase; letter-spacing:.18em; color:#f5df9a; }
.cover-type strong { font-family:Georgia,serif; font-size:clamp(27px,3vw,43px); line-height:1.08; }
.cover-type > span { font-size:11px; letter-spacing:.08em; }
.family-book-caption { padding: 24px 0 0; }
.family-book-caption h3 { margin:0 0 8px; font-size:23px; }
.family-book-caption p { min-height:48px; line-height:1.5; color:#62625c; }
.family-open { background:none; border:0; border-bottom:1px solid #a99c7e; padding:8px 0; color:#253d34; font-weight:700; }
.family-sample-note { text-align:center; color:#6c6c62; font-size:12px; margin:38px 0 0; }
.family-reader { width:min(960px,94vw); max-height:92dvh; padding:0; border:0; border-radius:16px; background:#fbf6e9; color:#223c35; box-shadow:0 30px 100px #0005; }
.family-reader::backdrop { background:#10251ee0; }
.family-reader header, .family-reader footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 24px; }
.family-reader header h2 { font-size:15px; margin:0; }
.family-reader button { border:1px solid #d7d0be; border-radius:8px; background:#fffaf0; color:#223c35; padding:10px 14px; }
.family-reader button:disabled { opacity:.4; cursor:default; }
.reader-spread { display:grid; grid-template-columns:1fr 1fr; }
.reader-art img { width:100%; height:100%; max-height:520px; object-fit:cover; display:block; }
.reader-page { padding:clamp(24px,4vw,50px); box-shadow:inset 12px 0 18px #554c3210; display:flex; flex-direction:column; justify-content:center; }
.reader-page h3 { font:clamp(27px,3vw,40px)/1.1 Georgia,serif; margin:15px 0; }
#readerCopy { font:18px/1.8 Georgia,serif; }
.reader-imprint { font-size:9px; letter-spacing:.15em; margin-top:28px; color:#8d897b; }
@media(max-width:700px) { .family-books { grid-template-columns:1fr; gap:42px; max-width:370px; } .reader-spread { grid-template-columns:1fr; } .reader-art img { max-height:230px; } .family-reader header,.family-reader footer { padding:14px; } .reader-page { padding:24px; } #readerCopy { font-size:16px; } }
@media(prefers-reduced-motion:reduce) { .family-cover { transition:none; } }
.family-cover img { height:auto; aspect-ratio:1; object-fit:contain; position:absolute; top:0; left:0; }
.family-cover::after { background:linear-gradient(transparent 40%,#183e39 77%); }
.slate .family-cover { background:#102544; }
.slate .family-cover::after { background:linear-gradient(transparent 40%,#102544 77%); }
.hosei .family-cover { background:#643326; }
.hosei .family-cover::after { background:linear-gradient(transparent 40%,#643326 77%); }
.reader-art { background:#e6dcc9; display:flex; align-items:center; }
.reader-art img { height:auto; object-fit:contain; }
.family-library { scroll-margin-top:100px; }
.carter .family-cover img { object-fit:cover; }

.story-mode { display:inline-block; font-size:12px; font-weight:700; color:#395d51; background:#e3eadc; padding:6px 10px; border-radius:20px; width:fit-content; }
#readerCopy.rhyming-copy { white-space:pre-line; line-height:1.9; }
