/* Storybot app — calm, warm, slow. Tokens match the website. */
:root {
  --cream: #f7f1e7;
  --paper: #fffaf2;
  --ink: #23223a;
  --ink-soft: #6a6880;
  --night: #191b38;
  --night-2: #262a55;
  --apricot: #f2a25c;
  --orange: #e98345;
  --sage: #8fb6ad;
  --sage-deep: #4f8177;
  --blush: #f2b9b0;
  --butter: #f5d48a;
  --lilac: #bbb5e2;
  --sky: #a9cfe6;
  --line: rgba(35, 34, 58, 0.08);
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gut: 20px;
  --slow: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #ebe3d5;
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 12px; }

svg { fill: none; stroke: currentColor; stroke-width: 1.800; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }

.app {
  position: relative;
  width: 100%;
  max-width: 440px;
  min-height: 100dvh;
  margin-inline: auto;
  padding: calc(env(safe-area-inset-top) + 14px) 0 calc(env(safe-area-inset-bottom) + 96px);
  background:
    radial-gradient(120% 340px at 50% -60px, #fbe3c4 0%, rgba(251, 227, 196, 0) 70%),
    var(--cream);
  overflow-x: clip;
}
@media (min-width: 500px) {
  body { padding: 28px 0; }
  .app { border-radius: 44px; min-height: calc(100dvh - 56px); box-shadow: 0 30px 80px -30px rgba(25, 27, 56, 0.35); }
}

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gut); }
.device {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px 0 10px;
  background: rgba(255, 250, 242, 0.8); border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.875rem; font-weight: 500;
}
.device__icon { flex: none; width: 28px; height: 30px; }
.device__icon img { width: 100%; height: 100%; object-fit: contain; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--lilac); color: var(--night);
}
.avatar svg { width: 22px; height: 22px; }

/* Greeting */
.hello { padding: 26px var(--gut) 22px; }
.hello__eyebrow { color: var(--ink-soft); font-size: 0.9375rem; font-weight: 500; margin-bottom: 6px; }
h1 {
  font-family: var(--serif); font-weight: 400;
  font-variation-settings: 'SOFT' 100, 'opsz' 144;
  font-size: clamp(2rem, 8.6vw, 2.35rem); line-height: 1.06; letter-spacing: -0.025em;
  text-wrap: balance; max-width: 11em;
}

/* Hero */
.hero {
  position: relative; isolation: isolate;
  margin: 0 var(--gut);
  aspect-ratio: 1 / 1.240;
  border-radius: 36px; overflow: hidden;
  --hero-floor: #212249;
  background: var(--hero-floor); color: var(--paper);
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  padding: 16px;
  box-shadow: 0 24px 40px -24px rgba(25, 27, 56, 0.55);
}
.hero__art { position: absolute; inset: 0 0 auto; width: 100%; height: auto; z-index: -2; }
.hero__shade { position: absolute; inset: 52% 0 0; z-index: -1; background: linear-gradient(to bottom, rgba(31, 33, 78, 0) 0%, var(--hero-floor) 42%); }
.hero__body { width: 100%; padding: 0 6px 6px; }
.hero h2 {
  font-family: var(--serif); font-weight: 400; font-variation-settings: 'SOFT' 100, 'opsz' 144;
  font-size: 1.8rem; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance;
}
.hero__meta { margin-top: 6px; font-size: 0.9375rem; color: rgba(255, 250, 242, 0.76); }
.hero__actions { display: flex; gap: 10px; margin-top: 18px; }

.pill { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.01em; }
.pill--glass { background: rgba(25, 27, 56, 0.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--paper); }
.pill--ink { background: var(--night); color: var(--paper); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 54px; border-radius: 999px; font-weight: 600; font-size: 1rem; transition: transform 0.25s var(--slow); }
.btn:active { transform: scale(0.97); }
.btn svg { width: 22px; height: 22px; }
.btn--primary { flex: 1; background: var(--apricot); color: var(--night); }
.btn--ghost { width: 54px; background: rgba(255, 250, 242, 0.16); color: var(--paper); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* Sections */
.block { margin-top: 34px; }
.block__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 0 var(--gut); margin-bottom: 14px; }
.block h2, .custom h2 {
  font-family: var(--serif); font-weight: 450; font-variation-settings: 'SOFT' 100, 'opsz' 60;
  font-size: 1.4rem; line-height: 1.15; letter-spacing: -0.015em;
}
.block__note { color: var(--ink-soft); font-size: 0.875rem; margin-top: 2px; }
.more { flex: none; font-size: 0.875rem; font-weight: 600; color: var(--sage-deep); padding: 6px 0; }

.scroller {
  display: flex; overflow-x: auto; scroll-snap-type: x proximity;
  padding: 2px var(--gut) 6px; scroll-padding-inline: var(--gut);
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.scroller::-webkit-scrollbar { display: none; }
.scroller > li { flex: none; scroll-snap-align: start; }

/* Topics */
.topics { gap: 12px; }
.topic { display: grid; justify-items: center; gap: 8px; width: 80px; text-align: center; }
.topic img { width: 76px; height: 76px; border-radius: 28px; object-fit: cover; transition: transform 0.3s var(--slow); }
.topic:active img { transform: scale(0.94); }
.topic span { font-size: 0.8125rem; font-weight: 500; line-height: 1.2; }

/* Story cards */
.stories { gap: 14px; }
.story { display: block; width: 156px; }
.story__cover { position: relative; display: block; border-radius: 28px; overflow: hidden; aspect-ratio: 1; background: var(--butter); transition: transform 0.3s var(--slow); }
.story:active .story__cover { transform: scale(0.97); }
.story__cover img { width: 100%; height: 100%; object-fit: cover; }
.story__play {
  position: absolute; right: 10px; bottom: 10px;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); color: var(--night);
  box-shadow: 0 6px 14px -6px rgba(25, 27, 56, 0.5);
}
.story__play svg { width: 18px; height: 18px; fill: currentColor; stroke: none; margin-left: 1px; }
.story__title { display: block; margin-top: 10px; font-weight: 600; font-size: 0.9375rem; line-height: 1.25; letter-spacing: -0.005em; }
.story__meta { display: block; margin-top: 3px; font-size: 0.8125rem; color: var(--ink-soft); }

/* Custom story teaser */
.custom {
  position: relative; overflow: hidden;
  margin: 36px var(--gut) 0; padding: 22px 20px;
  border-radius: 32px; background: var(--lilac); color: var(--night);
  display: grid; grid-template-columns: 1fr 92px; align-items: center; gap: 12px;
}
.custom h2 { margin-top: 12px; }
.custom p { margin-top: 6px; font-size: 0.875rem; line-height: 1.4; color: rgba(25, 27, 56, 0.78); }
.custom__art { position: relative; width: 92px; height: 110px; }
.custom__art svg { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; fill: var(--paper); stroke: none; }
.blob { position: absolute; border-radius: 50%; }
.blob--a { width: 92px; height: 92px; left: 0; top: 9px; background: var(--night-2); }
.blob--b { width: 30px; height: 30px; right: -4px; top: 0; background: var(--butter); }
.blob--c { width: 20px; height: 20px; left: 0; bottom: 0; background: var(--apricot); }

/* Tab bar — solid night sky with a rolling-hill top edge, docked to the bottom */
.tabs {
  position: fixed; z-index: 10;
  left: 0; right: 0; bottom: 0; margin-inline: auto;
  width: min(100%, 440px);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding: 4px 10px calc(env(safe-area-inset-bottom) + 8px);
  background: var(--night);
}
.tabs::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: calc(100% - 2px); height: 16px;
  background: var(--night);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 440 14' preserveAspectRatio='none'%3E%3Cpath d='M0 14V4C50 0 90 0 140 4s90 5 140 0 100-5 160 0V14z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 440 14' preserveAspectRatio='none'%3E%3Cpath d='M0 14V4C50 0 90 0 140 4s90 5 140 0 100-5 160 0V14z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  pointer-events: none;
}
.tab:nth-child(1) { --tab: var(--apricot); }
.tab:nth-child(2) { --tab: var(--sage); }
.tab:nth-child(3) { --tab: var(--lilac); }
.tab:nth-child(4) { --tab: var(--butter); }
.tab {
  position: relative;
  display: grid; justify-items: center; gap: 3px;
  padding: 9px 4px 7px; border-radius: 18px;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.01em;
  color: #b4b3cc;
  transition: background 0.35s var(--slow), color 0.35s var(--slow), transform 0.25s var(--slow);
}
.tab svg { width: 24px; height: 24px; transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.tab:hover { color: var(--paper); }
.tab:active { transform: scale(0.94); }
.tab.is-active { color: var(--night); background: var(--tab); }
.tab.is-active svg { stroke-width: 2.100; transform: translateY(-2px) rotate(-6deg) scale(1.08); }
.tab.is-active::after {
  content: ''; position: absolute; top: -9px; left: 50%; width: 6px; height: 6px; margin-left: -3px;
  border-radius: 50%; background: var(--tab);
}

/* Device view: pre-order status */
.view[hidden] { display: none; }
.pill--sage { background: #dcebe6; color: var(--sage-deep); }
/* Order ticket */
.ticket {
  position: relative; margin: 0 var(--gut); padding: 30px 22px 30px; color: var(--night);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.1  0 0 0 0 0.2  0 0 0 .32 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), linear-gradient(162deg, #ab9ff2 0%, #dca5e8 34%, #ffa9a2 66%, #ffd47e 100%);
  /* Scalloped top and bottom edges */
  -webkit-mask: radial-gradient(circle 8px at 50% 0, #0000 97%, #000) top / 26px 51% repeat-x,
                radial-gradient(circle 8px at 50% 100%, #0000 97%, #000) bottom / 26px 51% repeat-x;
          mask: radial-gradient(circle 8px at 50% 0, #0000 97%, #000) top / 26px 51% repeat-x,
                radial-gradient(circle 8px at 50% 100%, #0000 97%, #000) bottom / 26px 51% repeat-x;
  border-radius: 18px;
}
.ticket__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ticket__brand { padding: 5px 10px 4px; background: var(--night); color: var(--paper); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.04em; line-height: 1; }
.ticket__no { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; }
.ticket__art { display: block; width: 74%; height: auto; margin: 18px auto 10px; filter: drop-shadow(0 14px 18px rgba(25, 27, 56, 0.25)); }
.ticket__status { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.ticket__status svg { width: 16px; height: 16px; stroke-width: 2.6; }
.ticket__title { margin-top: 4px; font-weight: 600; font-size: 2.3rem; line-height: 0.95; letter-spacing: -0.035em; text-transform: uppercase; text-wrap: balance; }
/* Tear line with a notch cut on each side */
.ticket__tear { position: relative; height: 2px; margin: 22px -22px 18px; background: repeating-linear-gradient(90deg, rgba(25, 27, 56, 0.55) 0 7px, #0000 7px 13px); background-clip: content-box; padding: 0 22px; }
.ticket__tear::before, .ticket__tear::after { content: ''; position: absolute; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; background: var(--cream); }
.ticket__tear::before { left: -13px; }
.ticket__tear::after { right: -13px; }
.ticket__facts { margin: 0; display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.ticket__facts dt { font-weight: 600; font-size: 1rem; }
.ticket__facts dd { margin: 0; font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.8; }
.ticket__facts div:last-child { text-align: right; }
.ticket__code { margin-top: 20px; padding: 10px 12px 8px; background: var(--paper); border-radius: 6px; }
.ticket__bars {
  display: block; height: 46px;
  background:
    repeating-linear-gradient(90deg, #0000 0 17px, var(--paper) 17px 20px, #0000 20px 31px),
    repeating-linear-gradient(90deg, #0000 0 23px, var(--night) 23px 26px, #0000 26px 41px),
    repeating-linear-gradient(90deg, var(--night) 0 2px, #0000 2px 5px, var(--night) 5px 6px, #0000 6px 9px, var(--night) 9px 12px, #0000 12px 14px);
}
.ticket__codeno { display: block; margin-top: 6px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; text-align: center; }

.steps { list-style: none; margin: 0 var(--gut); padding: 0; }
.step { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 14px; padding-bottom: 22px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ''; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: #e3dacb; }
.step:last-child::before { display: none; }
.step.is-done::before { background: var(--sage); }
.step__mark { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--cream); box-shadow: inset 0 0 0 2px #e3dacb; }
.step__mark svg { width: 18px; height: 18px; stroke-width: 2.400; }
.step.is-done .step__mark { background: var(--sage); color: var(--paper); box-shadow: none; }
.step.is-now .step__mark { background: var(--apricot); box-shadow: 0 0 0 6px #fbe1c8; }
.step.is-now .step__mark::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); }
.step h3 { margin: 4px 0 0; font-size: 1rem; font-weight: 600; }
.step p { margin-top: 2px; font-size: 0.875rem; line-height: 1.4; color: var(--ink-soft); }
.step:not(.is-done):not(.is-now) h3 { color: var(--ink-soft); }

.help {
  margin: 36px var(--gut) 0; padding: 22px 20px; border-radius: 32px; background: var(--butter); color: var(--night);
  display: grid; gap: 14px;
}
.help h2 { font-family: var(--serif); font-weight: 450; font-variation-settings: 'SOFT' 100, 'opsz' 60; font-size: 1.3rem; line-height: 1.15; }
.btn--night { background: var(--night); color: var(--paper); height: 50px; }

/* Product page: gallery, benefits, comparison, buy bar */
.po-gallery-wrap { margin-top: 18px; }
.po-gallery {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 var(--gut); scroll-padding-inline: var(--gut); scrollbar-width: none;
}
.po-gallery::-webkit-scrollbar { display: none; }
.po-slide {
  position: relative; isolation: isolate; flex: none; width: 90%; aspect-ratio: 1 / 1.300; scroll-snap-align: start;
  border-radius: 36px; overflow: hidden; background: var(--night); color: var(--paper);
  display: flex; align-items: flex-end;
}
.po-slide img { position: absolute; inset: 0 0 auto; z-index: -2; width: 100%; height: auto; }
.po-slide::after { content: ''; position: absolute; inset: 52% 0 0; z-index: -1; background: linear-gradient(to bottom, rgba(25, 27, 56, 0), var(--night) 52%); }
.po-slide__text { padding: 20px 22px 22px; }
.po-slide h2 { font-family: var(--serif); font-weight: 400; font-variation-settings: 'SOFT' 100, 'opsz' 144; font-size: 1.55rem; line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
.po-slide p { margin-top: 6px; font-size: 0.9375rem; line-height: 1.4; color: rgba(255, 250, 242, 0.82); }
.po-dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.po-dots i { width: 6px; height: 6px; border-radius: 999px; background: #d9cfbe; transition: width 0.35s var(--slow), background 0.35s var(--slow); }
.po-dots i.on { width: 20px; background: var(--apricot); }

.po-head { padding: 22px var(--gut) 0; }
.po-head h1 { max-width: none; }
.po-head__text { margin-top: 8px; color: var(--ink-soft); line-height: 1.45; }

.po-benefits { margin: 26px var(--gut) 0; display: grid; gap: 18px; }
.po-benefits li { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: start; }
.po-benefit__icon { width: 48px; height: 48px; border-radius: 18px; display: grid; place-items: center; background: var(--butter); color: var(--night); }
.po-benefits li:nth-child(2) .po-benefit__icon { background: var(--sage); }
.po-benefits li:nth-child(3) .po-benefit__icon { background: var(--blush); }
.po-benefits li:nth-child(4) .po-benefit__icon { background: var(--lilac); }
.po-benefit__icon svg { width: 24px; height: 24px; }
.po-benefits h3 { margin: 2px 0 0; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.po-benefits p { margin-top: 2px; font-size: 0.9375rem; line-height: 1.4; color: var(--ink-soft); }

.po-compare { margin: 0 var(--gut); padding: 6px 0 8px 18px; border-radius: 32px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.po-compare table { width: 100%; border-collapse: collapse; }
.po-compare thead th { padding: 14px 6px 10px; width: 84px; font-size: 0.8125rem; font-weight: 600; line-height: 1.2; color: var(--ink-soft); vertical-align: bottom; }
.po-compare thead th.is-us { color: var(--night); }
.po-compare tbody th { padding: 12px 10px 12px 0; text-align: left; font-weight: 500; font-size: 0.9375rem; line-height: 1.3; border-top: 1px solid var(--line); }
.po-compare td { padding: 0; text-align: center; border-top: 1px solid var(--line); }
.po-compare thead td { border: 0; }
.po-compare .is-us { background: #fbe8d6; border-top-color: transparent; }
.po-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; vertical-align: middle; }
.po-mark svg { width: 16px; height: 16px; stroke-width: 2.600; }
.po-mark--yes { background: var(--sage-deep); color: var(--paper); }
.po-mark--no { color: #b3ab9c; }

.po-bar {
  /* Separate navy card floating just above the tab bar's wave. */
  position: fixed; z-index: 9; left: 0; right: 0; margin-inline: auto; width: min(100% - 24px, 416px);
  bottom: calc(var(--tabs-h, 78px) + 26px);
  padding: 10px 10px 10px 22px; border-radius: 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--night); color: var(--paper);
  box-shadow: 0 12px 28px -14px rgba(25, 27, 56, 0.55);
}
#view-preorder { padding-bottom: 110px; }
.po-bar p { display: grid; line-height: 1.15; }
.po-bar p span { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #b4b3cc; }
.po-bar p strong { font-family: var(--serif); font-weight: 450; font-variation-settings: 'SOFT' 100, 'opsz' 60; font-size: 1.6rem; letter-spacing: -0.01em; }
.po-bar .btn { flex: none; height: 50px; padding: 0 28px; }

/* Pre-order page */
.po-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.po-plus h2, .po-sum h2 { font-family: var(--serif); font-weight: 450; font-variation-settings: 'SOFT' 100, 'opsz' 60; font-size: 1.4rem; line-height: 1.15; letter-spacing: -0.015em; }
.po-price { flex: none; font-size: 1.375rem; font-weight: 600; }

.po-covers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 var(--gut); }
.po-cover {
  position: relative; display: grid; gap: 2px; padding: 12px 14px 14px; border-radius: 28px;
  background: var(--paper); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.25s var(--slow), background 0.25s var(--slow), transform 0.25s var(--slow);
}
.po-cover:active { transform: scale(0.97); }
.po-cover input, .po-switch input { position: absolute; opacity: 0; pointer-events: none; }
.po-cover img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; margin-bottom: 6px; }
.po-cover__name { font-weight: 600; }
.po-cover__price { font-size: 0.875rem; color: var(--ink-soft); }
.po-cover__check {
  position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--cream); color: transparent; box-shadow: inset 0 0 0 2px #e3dacb;
  transition: background 0.25s var(--slow), color 0.25s var(--slow);
}
.po-cover__check svg { width: 16px; height: 16px; stroke-width: 2.600; }
.po-cover:has(input:checked) { background: #fbe8d6; box-shadow: inset 0 0 0 2px var(--apricot); }
.po-cover:has(input:checked) .po-cover__check { background: var(--apricot); color: var(--night); box-shadow: none; }
.po-cover:has(input:focus-visible), .po-switch:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 3px; }

.pill--apricot { background: var(--apricot); color: var(--night); }
.po-plus { margin: 34px var(--gut) 0; padding: 22px 20px 20px; border-radius: 32px; background: var(--night); color: var(--paper); }
.po-plus h2 { margin-top: 14px; font-size: 1.6rem; }
.po-plus__lede { margin-top: 6px; font-size: 0.9375rem; color: rgba(255, 250, 242, 0.76); }
.po-plus__list { margin-top: 14px; display: grid; gap: 10px; }
.po-plus__list li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 0.9375rem; line-height: 1.4; }
.po-plus__list svg { width: 22px; height: 22px; color: var(--apricot); stroke-width: 2.400; }
.po-switch {
  position: relative; display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 14px;
  margin-top: 20px; padding: 14px 16px; border-radius: 22px; background: rgba(255, 250, 242, 0.1); cursor: pointer;
  transition: background 0.25s var(--slow);
}
.po-switch b { display: block; font-weight: 600; }
.po-switch small { display: block; margin-top: 2px; font-size: 0.8125rem; line-height: 1.35; color: rgba(255, 250, 242, 0.72); }
.po-switch__track { width: 52px; height: 32px; border-radius: 999px; background: rgba(255, 250, 242, 0.28); position: relative; transition: background 0.25s var(--slow); }
.po-switch__track::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); transition: transform 0.3s var(--slow); }
.po-switch:has(input:checked) { background: rgba(242, 162, 92, 0.2); }
.po-switch:has(input:checked) .po-switch__track { background: var(--apricot); }
.po-switch:has(input:checked) .po-switch__track::after { transform: translateX(20px); }

.po-sum { margin: 34px var(--gut) 0; padding: 22px 20px 20px; border-radius: 32px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.po-lines { margin: 14px 0 0; display: grid; gap: 8px; }
.po-lines div, .po-total { display: flex; justify-content: space-between; gap: 16px; }
.po-lines dt { color: var(--ink-soft); }
.po-lines dd { margin: 0; font-weight: 500; }
.po-total { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-weight: 600; font-size: 1.125rem; }
.po-sum__note { margin-top: 8px; font-size: 0.8125rem; color: var(--ink-soft); }

/* Profile sheet */
.sheet {
  position: fixed; inset: auto 0 0; margin: 0 auto;
  width: min(100%, 440px); max-width: none; max-height: none;
  border: 0; border-radius: 28px 28px 0 0;
  padding: 20px var(--gut) calc(env(safe-area-inset-bottom) + 28px);
  background: var(--paper); color: var(--ink);
}
.sheet[open] { animation: sheet-up 0.4s var(--slow); }
.sheet::backdrop { background: rgba(25, 27, 56, 0.45); }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sheet h2 { font-family: var(--serif); font-weight: 450; font-variation-settings: 'SOFT' 100, 'opsz' 60; font-size: 1.5rem; letter-spacing: -0.015em; }
.sheet__close { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--cream); }
.sheet__close svg { width: 20px; height: 20px; }
.langs { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.langs legend { padding: 0; margin-bottom: 10px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.lang {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px;
  background: var(--cream); font-weight: 600; cursor: pointer;
  box-shadow: inset 0 0 0 2px transparent; transition: box-shadow 0.25s var(--slow), background 0.25s var(--slow);
}
.lang input { position: absolute; opacity: 0; pointer-events: none; }
.lang__flag { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; letter-spacing: 0.04em; background: var(--lilac); color: var(--night); }
.lang:has(input:checked) { background: #fbe8d6; box-shadow: inset 0 0 0 2px var(--apricot); }
.lang:has(input:checked) .lang__flag { background: var(--apricot); }
.lang:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Accounts, story flow, player, Pro */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Buttons */
.btn--block { display: flex; width: 100%; flex: none; }
.btn--quiet { height: 44px; padding: 0 14px; background: none; color: var(--sage-deep); font-size: 0.9375rem; }
.btn--danger { color: #b4513f; }
.btn[disabled] { opacity: 0.4; cursor: default; pointer-events: none; }
.custom__cta { height: 44px; margin-top: 14px; padding: 0 20px; font-size: 0.9375rem; }

/* Forms */
.field { display: grid; gap: 6px; margin-top: 14px; }
.field > span { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-soft); }
.field input, .field select, .field__area {
  width: 100%; height: 52px; padding: 0 18px; border: 0; border-radius: 18px;
  background: var(--cream); color: var(--ink); font: 400 1rem/1.3 var(--sans); font-size: max(16px, 1rem);
  box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow 0.25s var(--slow), background 0.25s var(--slow);
  -webkit-appearance: none; appearance: none;
}
.field input::placeholder, .field__area::placeholder { color: #a29fb2; }
.field input:focus, .field select:focus, .field__area:focus { outline: 0; background: var(--paper); box-shadow: inset 0 0 0 2px var(--apricot); }
.field select {
  padding-right: 40px;
  background: var(--cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323223a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.500l6 6 6-6'/%3E%3C/svg%3E") right 14px center / 20px no-repeat;
}
.field__area { display: block; height: auto; min-height: 150px; padding: 16px 18px; margin-top: 14px; line-height: 1.5; resize: vertical; }
.field__hint { margin-top: 6px; font-size: 0.8125rem; color: var(--ink-soft); }
.form__error { margin-top: 12px; padding: 10px 14px; border-radius: 16px; background: #fbe3dc; color: #8f3a29; font-size: 0.9375rem; line-height: 1.35; }
.form__info { margin-top: 12px; padding: 10px 14px; border-radius: 16px; background: #dcebe6; color: #365f56; font-size: 0.9375rem; line-height: 1.35; }
.form__error[hidden], .form__info[hidden], .toast[hidden], .consent[hidden] { display: none; }

/* Sheets */
.sheet { max-height: calc(100dvh - 20px); overflow-y: auto; }
.auth__lede, .pro__lede { color: var(--ink-soft); line-height: 1.45; margin-bottom: 14px; }
.auth__google { display: flex; justify-content: center; min-height: 44px; margin-bottom: 4px; }
.auth__or { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; font-size: 0.8125rem; color: var(--ink-soft); }
.auth__or::before, .auth__or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth__form .btn { margin-top: 18px; }
.auth__links { display: grid; justify-items: center; margin-top: 8px; }

.sheet--night { background: var(--night); color: var(--paper); }
.sheet--night .sheet__close { background: rgba(255, 250, 242, 0.12); color: var(--paper); }
.sheet--night .pro__lede { color: rgba(255, 250, 242, 0.76); }
.pro__price { font-family: var(--serif); font-weight: 450; font-variation-settings: 'SOFT' 100, 'opsz' 60; font-size: 2rem; letter-spacing: -0.02em; color: var(--apricot); }
.sheet--night .po-plus__list { margin: 14px 0 22px; }

/* Account block */
.acct { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.acct__who { display: grid; line-height: 1.3; }
.acct__who span { font-size: 0.875rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.acct__plan { margin-top: 8px; font-size: 0.9375rem; color: var(--ink-soft); }
.acct__btns { display: grid; gap: 10px; margin-top: 16px; justify-items: stretch; }
.acct__btns .btn--quiet { justify-self: center; }

/* Player */
.player__cover { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 32px; background: var(--butter); }
.player h2 { margin: 18px 0 14px; line-height: 1.15; text-wrap: balance; }
.player audio { display: block; width: 100%; }

/* Toast and consent: floating cards above the tab bar */
.toast, .consent {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabs-h, 78px) + 26px);
}
.toast {
  width: max-content; max-width: min(calc(100% - 32px), 400px);
  padding: 13px 20px; border-radius: 999px; background: var(--night); color: var(--paper);
  font-size: 0.9375rem; font-weight: 500; line-height: 1.3; text-align: center;
  box-shadow: 0 12px 28px -14px rgba(25, 27, 56, 0.55);
  opacity: 0; transition: opacity 0.4s var(--slow), transform 0.4s var(--slow); transform: translate(-50%, 8px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.consent {
  width: min(calc(100% - 24px), 416px); padding: 16px 16px 14px 20px; border-radius: 26px;
  background: var(--paper); box-shadow: 0 0 0 1px var(--line), 0 14px 32px -14px rgba(25, 27, 56, 0.4);
}
.consent p { font-size: 0.875rem; line-height: 1.4; }
.consent div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.consent .btn { flex: none; height: 44px; padding: 0 20px; font-size: 0.9375rem; }
.consent .btn--quiet { padding: 0 14px; }
.app:has(.consent:not([hidden])) { padding-bottom: calc(env(safe-area-inset-bottom) + 260px); }

/* Create flow */
#view-create { padding-bottom: 20px; }
.flow { padding: 0 var(--gut); }
.flow--script { padding-bottom: 110px; }
.flow__head { display: flex; align-items: center; gap: 14px; padding-top: 14px; }
.flow__back { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 250, 242, 0.8); box-shadow: inset 0 0 0 1px var(--line); }
.flow__back svg { width: 20px; height: 20px; }
.flow__dots { flex: 1; display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.flow__dots li { flex: 1; height: 6px; border-radius: 999px; background: #e3dacb; transition: background 0.5s var(--slow); }
.flow__dots li.is-done { background: var(--sage); }
.flow__dots li.is-now { background: var(--apricot); }
.flow__step { flex: none; font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); }
.flow__title { margin-top: 24px; max-width: none; font-size: clamp(1.7rem, 7.4vw, 2rem); }
.flow__lede { margin-top: 8px; color: var(--ink-soft); line-height: 1.45; }
.flow__sub { margin: 26px 0 10px; font-family: var(--serif); font-weight: 450; font-variation-settings: 'SOFT' 100, 'opsz' 60; font-size: 1.25rem; letter-spacing: -0.01em; }
.flow__row { display: flex; gap: 12px; align-items: flex-end; }
.field--grow { flex: 1; min-width: 0; }
.field--age { width: 96px; flex: none; }
.flow__next { margin-top: 26px; }
.flow--script .hello__eyebrow { margin-top: 22px; margin-bottom: 0; }
.flow--script .flow__title { margin-top: 4px; }

/* Mic */
.flow__mic { display: grid; justify-items: center; margin-top: 22px; }
.mic { display: grid; justify-items: center; gap: 10px; font-size: 0.9375rem; font-weight: 600; text-align: center; }
.mic__ico { position: relative; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--apricot); color: var(--night); transition: transform 0.3s var(--slow), background 0.4s var(--slow); }
.mic__ico svg { width: 34px; height: 34px; }
.mic:active .mic__ico { transform: scale(0.95); }
.mic.is-rec .mic__ico { background: var(--orange); animation: mic-pulse 2.2s var(--slow) infinite; }
.mic[disabled] .mic__ico { opacity: 0.5; }
.mic--small { flex: none; }
.mic--small .mic__ico { width: 52px; height: 52px; background: var(--lilac); }
.mic--small .mic__ico svg { width: 24px; height: 24px; }
.mic--small.is-rec .mic__ico { background: var(--orange); }
@keyframes mic-pulse { 0% { box-shadow: 0 0 0 0 rgba(233, 131, 69, 0.45); } 70%, 100% { box-shadow: 0 0 0 22px rgba(233, 131, 69, 0); } }

/* Chips, cast, length */
.chips { display: grid; gap: 10px; margin-top: 18px; }
.chip, .castcard {
  position: relative; display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; border-radius: 22px; background: var(--paper); text-align: left; line-height: 1.35; font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.3s var(--slow), background 0.3s var(--slow), transform 0.25s var(--slow);
}
.chip:active, .castcard:active { transform: scale(0.98); }
.chip svg, .castcard__tick { width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: var(--cream); color: transparent; box-shadow: inset 0 0 0 2px #e3dacb; stroke-width: 2.600; transition: background 0.3s var(--slow), color 0.3s var(--slow); }
.castcard__tick svg { width: 100%; height: 100%; stroke-width: 2.600; }
.chip[aria-pressed="true"], .castcard[aria-pressed="true"] { background: #fbe8d6; box-shadow: inset 0 0 0 2px var(--apricot); }
.chip[aria-pressed="true"] svg, .castcard[aria-pressed="true"] .castcard__tick { background: var(--apricot); color: var(--night); box-shadow: none; }
.castcard { margin-top: 18px; }
.castcard b { display: block; font-weight: 600; }
.castcard small { display: block; margin-top: 1px; font-size: 0.8125rem; color: var(--ink-soft); font-weight: 400; }

.cast { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; margin-top: 18px; }
.cast__btn { display: grid; justify-items: center; gap: 8px; }
.cast__img { display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--butter); border: 3px solid var(--cream); box-shadow: 0 0 0 2px transparent; transition: box-shadow 0.3s var(--slow), transform 0.3s var(--slow); }
.cast__img img { width: 100%; height: 100%; object-fit: cover; }
.cast__btn:active .cast__img { transform: scale(0.95); }
.cast__btn[aria-pressed="true"] .cast__img { box-shadow: 0 0 0 3px var(--apricot); }
.cast__name { font-size: 0.8125rem; font-weight: 500; }
.cast__btn[aria-pressed="true"] .cast__name { font-weight: 600; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border-radius: 24px; background: #ece3d3; }
.seg__opt { display: grid; gap: 1px; padding: 10px 4px; border-radius: 19px; text-align: center; transition: background 0.3s var(--slow), box-shadow 0.3s var(--slow); }
.seg__opt b { font-weight: 600; font-size: 0.9375rem; }
.seg__opt small { font-size: 0.75rem; color: var(--ink-soft); }
.seg__opt[aria-checked="true"] { background: var(--paper); box-shadow: 0 6px 14px -8px rgba(25, 27, 56, 0.4); }

/* Waiting: a slow moon, no spinner */
.wait { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 64px 12px 24px; }
.wait h1 { margin-top: 18px; max-width: 12em; font-size: 1.7rem; }
.wait p { color: var(--ink-soft); line-height: 1.45; max-width: 18em; }
.wait__moon { display: block; width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle at 36% 32%, #fff3cf, var(--butter) 62%, var(--apricot)); animation: moon 3.8s ease-in-out infinite; }
@keyframes moon { 0%, 100% { transform: scale(0.92); opacity: 0.8; box-shadow: 0 0 0 0 rgba(245, 212, 138, 0.5); } 50% { transform: scale(1.04); opacity: 1; box-shadow: 0 0 0 26px rgba(245, 212, 138, 0); } }

/* Script */
.paper { margin-top: 18px; padding: 24px 22px; border-radius: 28px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); font-family: var(--serif); font-variation-settings: 'SOFT' 50, 'opsz' 14; font-size: 1.125rem; line-height: 1.7; }
.paper p + p { margin-top: 1em; }
.revise__row { display: flex; gap: 10px; align-items: center; }
.revise__row input { flex: 1; min-width: 0; height: 52px; padding: 0 18px; border: 0; border-radius: 18px; background: var(--cream); font: 400 1rem var(--sans); font-size: max(16px, 1rem); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.revise__row input:focus { outline: 0; background: var(--paper); box-shadow: inset 0 0 0 2px var(--apricot); }
.revise__go { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.revise__go small { font-size: 0.8125rem; color: var(--ink-soft); }
.revise__go .btn { height: 46px; padding: 0 22px; font-size: 0.9375rem; }
.flow__bar { align-items: center; }
.flow__hint { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em; color: #b4b3cc; }
.flow__bar-end { display: grid; justify-items: end; gap: 6px; margin-left: auto; }
.flow__bar .btn { flex: none; height: 50px; padding: 0 24px; }
.form__error--bar { margin: 0; padding: 6px 12px; font-size: 0.8125rem; }

/* Making and ready */
.making { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 56px 8px 24px; }
.making h1 { margin-top: 14px; max-width: 12em; font-size: 1.8rem; }
.making p { color: var(--ink-soft); line-height: 1.45; max-width: 20em; }
.making__name { font-family: var(--serif); font-size: 1.125rem; color: var(--ink) !important; }
.making__cover { width: 220px; aspect-ratio: 1; border-radius: 44px; overflow: hidden; background: var(--butter); display: grid; place-items: center; box-shadow: 0 24px 40px -24px rgba(25, 27, 56, 0.45); }
.making__cover img { width: 100%; height: 100%; object-fit: cover; }
.making__cover.is-pulse { animation: cover-pulse 3.8s ease-in-out infinite; }
@keyframes cover-pulse { 0%, 100% { transform: scale(0.97); opacity: 0.85; } 50% { transform: scale(1); opacity: 1; } }
.making__btns { display: grid; gap: 8px; justify-items: center; margin-top: 18px; width: 100%; }
.making__btns .btn--primary { width: 100%; flex: none; }

/* Our stories */
.ours__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 var(--gut); }
.ours__left { font-size: 0.875rem; font-weight: 500; color: var(--ink-soft); }
.ours__top .btn { height: 46px; padding: 0 22px; font-size: 0.9375rem; }
.ours__list { display: grid; gap: 10px; padding: 18px var(--gut) 0; }
.ours__row { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 8px; border-radius: 26px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.ours__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; text-align: left; border-radius: 20px; }
.ours__main img { flex: none; width: 64px; height: 64px; border-radius: 20px; object-fit: cover; background: var(--butter); }
.ours__main span { display: grid; min-width: 0; line-height: 1.3; }
.ours__main b { font-weight: 600; font-size: 0.9375rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ours__main small { margin-top: 2px; font-size: 0.8125rem; color: var(--ink-soft); }
.ours__main small.is-pending { color: var(--sage-deep); font-weight: 600; }
.ours__del { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-soft); }
.ours__del svg { width: 20px; height: 20px; }
.ours__none, .ours__empty { margin: 22px var(--gut) 0; padding: 24px 22px; border-radius: 28px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); color: var(--ink-soft); line-height: 1.45; }
.ours__empty { display: grid; gap: 16px; justify-items: start; }
.ours__empty .btn { height: 46px; padding: 0 22px; font-size: 0.9375rem; }

@media (prefers-reduced-motion: reduce) {
  .wait__moon, .making__cover.is-pulse, .mic.is-rec .mic__ico { animation: none !important; }
  .toast { transition: none !important; }
}
