/* Story creation journey. The finished reader keeps its own book. */

body.page-storybook {
  --sj-world: url("images/connect-four-world.jpg");
}

body.page-storybook .home-bar.sb-nav {
  position: relative;
  z-index: 40;
  margin: 0.15rem auto 0.2rem;
  width: min(100%, 76rem);
}

body.page-storybook.sb-route-story:not(.sb-reader-immersive) {
  background: var(--sj-world) center / cover no-repeat fixed;
}

body.page-storybook.sb-route-story:not(.sb-reader-immersive)::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(49, 20, 90, 0.14)),
    var(--sj-world) center / cover no-repeat;
  transition: background 0.5s ease;
}

body.page-storybook.sb-route-story:not(.sb-reader-immersive)::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 250, 220, 0.9) 0 1.5px, transparent 2.5px);
  background-size: 140px 160px;
  animation: sj-drift 16s linear infinite;
  opacity: 0.45;
}

body[data-sj-place="undersea"].page-storybook::after {
  background-image: radial-gradient(circle, rgba(186, 230, 253, 0.95) 0 2px, transparent 3px);
}

body[data-sj-place="woods"].page-storybook::after {
  background-image: radial-gradient(circle, rgba(187, 247, 208, 0.9) 0 2px, transparent 3px);
}

body[data-sj-place="castle"].page-storybook::after {
  background-image: radial-gradient(circle, rgba(253, 230, 138, 0.95) 0 2px, transparent 3px);
}

@keyframes sj-drift {
  from { background-position: 0 0; }
  to { background-position: 40px -180px; }
}

body.page-storybook.sb-route-story:not(.sb-modal-open):not(.sb-reader-immersive)
  .sb-app:has(#sbLanding:not(.is-hidden)),
body.page-storybook.sb-route-story:not(.sb-modal-open):not(.sb-reader-immersive)
  .sb-app:has(#sbStoryJourney:not([hidden])) {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding: max(0.35rem, env(safe-area-inset-top, 0px))
    max(0.65rem, env(safe-area-inset-left, 0px))
    max(0.4rem, env(safe-area-inset-bottom, 0px))
    max(0.65rem, env(safe-area-inset-right, 0px));
}

body.page-storybook.sb-route-story:not(.sb-modal-open):not(.sb-reader-immersive)
  .sb-app:has(#sbLanding:not(.is-hidden))
  .sb-landing,
#sbStoryJourney:not([hidden]) {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

body.page-storybook .home-gear {
  font: 800 1.15rem/1 Nunito, sans-serif;
}

body.page-storybook:not(.sb-reader-immersive) .kids-fbar,
body.page-storybook.sb-route-story:not(.sb-reader-immersive) .sb-cloud-pull-fab {
  display: none !important;
}

.sj-help {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(20, 27, 77, 0.28);
}

.sj-help[hidden] { display: none !important; }

.sj-help__card {
  width: min(28rem, 100%);
  padding: 1.3rem 1.2rem 1.2rem;
  border-radius: 28px;
  background: #fffdfb;
  color: #141b4d;
  text-align: center;
  box-shadow: 0 18px 50px rgba(20, 27, 77, 0.16);
}

.sj-help__card h2 {
  margin: 0 0 0.4rem;
  font-family: Fredoka, Nunito, sans-serif;
}

.sj-help__card p { margin: 0.35rem 0; font-weight: 700; }

#sbLanding[hidden],
#sbStoryJourney[hidden],
.sj-room.is-hidden { display: none !important; }

.sj-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.sj-room {
  position: relative;
  z-index: 2;
  width: min(100%, 76rem);
  margin: 0 auto;
  padding: 0 0.35rem;
  text-align: center;
}

#sbLanding:not([hidden]) {
  display: flex;
  flex-direction: column;
}

.sj-room__kicker,
.sj-crumbs,
.sj-kicker,
.sj-status,
.sj-quiet,
.sj-quiet-note,
.sj-whisper,
.sj-portal__name {
  color: #fff;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(49, 16, 90, 0.55);
}

.sj-room__kicker,
.sj-crumbs,
.sj-kicker { margin: 0; }

.sj-room__title,
.sj-title {
  margin: 0.05rem auto 0.15rem;
  font-family: Fredoka, Nunito, sans-serif;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 2px 0 #5b21b6, 0 8px 18px rgba(49, 16, 90, 0.35);
}

.sj-title {
  width: fit-content;
  padding: 0.08rem 0.75rem 0.16rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.16);
}

.sj-crumbs { font-size: 0.92rem; }
.sj-crumbs span { opacity: 0.75; }
.sj-crumbs span[aria-current="step"] { opacity: 1; }
.sj-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
}

.sj-welcome {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.4rem;
  min-height: 0;
  padding: 0.2rem 0 0.4rem;
}

.sj-companion { margin: 0; }
.sj-companion img {
  width: min(15rem, 26vw);
  height: min(20rem, 40vh);
  object-fit: cover;
  object-position: center 16%;
  border-radius: 46% 46% 38% 38%;
  box-shadow: 0 0 0 6px #fff, 0 0 0 11px #f59e0b, 0 18px 28px rgba(49, 16, 90, 0.28);
  animation: sj-float 3.6s ease-in-out infinite;
}
.sj-companion figcaption {
  margin-top: 0.3rem;
  color: #fff;
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 1.35rem;
  text-shadow: 0 2px 8px rgba(49, 16, 90, 0.5);
}

@keyframes sj-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.sj-tome {
  position: relative;
  width: min(12.5rem, 24vw);
  height: min(16.5rem, 34vh);
  margin: 0 0 1.4rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 1000px;
  filter: drop-shadow(0 18px 16px rgba(49, 16, 90, 0.35));
}
.sj-tome__pages,
.sj-tome__cover {
  position: absolute;
  inset: 0;
  border-radius: 4px 16px 16px 4px;
}
.sj-tome__pages {
  background: repeating-linear-gradient(90deg, #fffaf2 0 3px, #e7d3b4 3px 5px);
  transform: translate(8px, 7px);
}
.sj-tome__cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 0.6rem 0.6rem 1rem;
  background:
    linear-gradient(90deg, #4c1d95 0 12px, rgba(255, 255, 255, 0.28) 12px 16px, transparent 16px),
    linear-gradient(165deg, #ddd6fe, #7c3aed 32%, #5b21b6 72%, #3b0764);
  box-shadow: inset 0 0 0 7px rgba(253, 230, 138, 0.7);
  transform-origin: left center;
  transition: transform 0.68s cubic-bezier(0.4, 0.05, 0.2, 1);
}
.sj-room.is-opening .sj-tome__cover { transform: rotateY(-158deg); }
.sj-tome__window {
  width: 74%;
  height: 58%;
  overflow: hidden;
  border-radius: 8px 14px 8px 8px;
  box-shadow: inset 0 0 0 4px #fde68a;
}
.sj-tome__window img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  display: block;
}
.sj-tome__name {
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 1.35rem;
  color: #fff;
}
.sj-sparkles {
  position: absolute;
  inset: -12px;
  pointer-events: none;
}
.sj-sparkles i {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fde68a;
  box-shadow: 0 0 8px #fff;
  animation: sj-twinkle 2.2s ease-in-out infinite;
}
.sj-sparkles i:nth-child(1) { top: 8%; left: 10%; }
.sj-sparkles i:nth-child(2) { top: 18%; right: 6%; animation-delay: 0.4s; }
.sj-sparkles i:nth-child(3) { bottom: 20%; left: 0; animation-delay: 0.8s; }
.sj-sparkles i:nth-child(4) { bottom: 8%; right: 16%; animation-delay: 1.2s; }
@keyframes sj-twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.15); }
}

.sj-room__actions,
.sj-desk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}
.sj-pill,
.sj-quiet,
.sj-face,
.sj-dest,
.sj-length,
.sj-idea-card,
.sj-tabs button,
.sj-tome {
  font-family: Nunito, sans-serif;
  cursor: pointer;
}
.sj-pill {
  min-height: 48px;
  min-width: 9.5rem;
  padding: 0.3rem 1.15rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.95);
  color: #3b2768;
  font-weight: 800;
  font-size: 1.02rem;
  box-shadow: 0 6px 0 rgba(253, 230, 138, 0.85), 0 10px 18px rgba(49, 16, 90, 0.16);
}
.sj-pill--primary {
  background: linear-gradient(180deg, #a78bfa, #7c3aed);
  color: #fff;
  box-shadow: 0 6px 0 #5b21b6, 0 12px 18px rgba(91, 33, 182, 0.28);
}
.sj-pill:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.sj-quiet {
  min-height: 44px;
  padding: 0.2rem 0.55rem;
  border: 0;
  background: transparent;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sj-quiet-note,
.sj-status,
.sj-whisper {
  margin: 0.25rem 0 0;
  font-size: 0.86rem;
  font-weight: 700;
}
.sj-pill:focus-visible,
.sj-quiet:focus-visible,
.sj-face:focus-visible,
.sj-dest:focus-visible,
.sj-idea-card:focus-visible,
.sj-length:focus-visible,
.sj-tome:focus-visible,
.sj-tabs button:focus-visible,
.sj-leaf textarea:focus-visible {
  outline: 3px solid #fde68a;
  outline-offset: 3px;
}

#sbStoryJourney:not([hidden]) {
  display: flex;
  flex-direction: column;
}
.sj-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sj-stage > * { flex: 1 1 auto; min-height: 0; }
.sj-stage.is-turn { animation: sj-arrive 0.4s ease; }
@keyframes sj-arrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.sj-board {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0.9rem;
  align-items: center;
  height: 100%;
}
.sj-gather {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  padding-bottom: 0.8rem;
}
.sj-gather::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0.7rem;
  height: 1.3rem;
  border-radius: 50%;
  background: rgba(49, 16, 90, 0.22);
  filter: blur(6px);
}
.sj-troupe {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.4rem;
}
.sj-hero,
.sj-pal { margin: 0; }
.sj-hero img,
.sj-pal img,
.sj-face img,
.sj-dest img,
.sj-idea-card img,
.sj-portal__art,
.sj-cover__scene {
  object-fit: cover;
  display: block;
}
.sj-hero img,
.sj-pal img,
.sj-face img { object-position: center 16%; }
.sj-hero img {
  width: min(14.5rem, 24vw);
  height: min(18.5rem, 36vh);
  border-radius: 46% 46% 36% 36%;
  box-shadow: 0 0 0 6px #fff, 0 0 0 10px #f59e0b, 0 16px 22px rgba(49, 16, 90, 0.28);
}
.sj-pal img {
  width: min(7.4rem, 13vw);
  height: min(9.6rem, 20vh);
  border-radius: 42%;
  box-shadow: 0 0 0 4px #fff, 0 0 0 7px #7c3aed;
}
.sj-hero figcaption,
.sj-pal figcaption {
  margin-top: 0.2rem;
  color: #fff;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(49, 16, 90, 0.55);
}
.sj-hero figcaption span,
.sj-pal figcaption span {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sj-hero figcaption span { color: #fde68a; }
.sj-pal figcaption span { color: #ddd6fe; }
.sj-pal.is-join,
.sj-hero.is-join { animation: sj-join 0.45s ease; }
@keyframes sj-join {
  from { opacity: 0; transform: translateY(16px) scale(0.88); }
  to { opacity: 1; transform: none; }
}
.sj-pal.is-leave,
.sj-hero.is-leave { animation: sj-leave 0.28s ease forwards; }
@keyframes sj-leave {
  to { opacity: 0; transform: translateY(14px) scale(0.82); }
}

.sj-tray {
  padding: 0.65rem 0.7rem 0.75rem;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(255, 244, 220, 0.94));
  border: 3px solid rgba(253, 230, 138, 0.95);
  box-shadow: 0 16px 32px rgba(91, 33, 182, 0.16);
  color: #3b2768;
}
.sj-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}
.sj-tabs button {
  min-height: 40px;
  padding: 0.1rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6d28d9;
  font-weight: 800;
  font-size: 0.88rem;
}
.sj-tabs button[aria-selected="true"] {
  background: linear-gradient(180deg, #8b5cf6, #6d28d9);
  color: #fff;
}
.sj-faces {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.3rem;
}
.sj-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-height: 44px;
  padding: 0.12rem;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #3b2768;
  font-weight: 800;
  font-size: 0.72rem;
}
.sj-face img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f4e9ff;
}
.sj-face.is-on img { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #7c3aed; }
.sj-face.is-star img { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #f59e0b; }
.sj-empty {
  margin: 0.8rem 0.4rem;
  color: #5b21b6;
  font-weight: 800;
}

.sj-world {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 0.75rem;
  height: 100%;
  min-height: 0;
}
.sj-portal {
  position: relative;
  height: 100%;
  min-height: 0;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.75), 0 0 0 9px rgba(253, 230, 138, 0.85), 0 16px 28px rgba(49, 16, 90, 0.22);
}
.sj-portal__art {
  width: 100%;
  height: 100%;
  object-position: center;
}
.sj-portal .sj-troupe {
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
  bottom: 2.7rem;
}
.sj-portal .sj-hero img { width: 8rem; height: 10.2rem; }
.sj-portal .sj-pal img { width: 5.3rem; height: 6.8rem; }
.sj-portal .sj-hero figcaption,
.sj-portal .sj-pal figcaption,
.sj-cover .sj-hero figcaption,
.sj-cover .sj-pal figcaption,
.sj-leaf .sj-hero figcaption,
.sj-leaf .sj-pal figcaption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.sj-portal__name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 1.3rem 0.6rem 0.45rem;
  background: linear-gradient(transparent, rgba(30, 12, 60, 0.72));
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 1.15rem;
}
.sj-picks {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  min-height: 0;
}
.sj-destinations {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}
.sj-destinations--places { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sj-dest {
  position: relative;
  height: 5.15rem;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.35);
}
.sj-dest img { position: absolute; inset: 0; width: 100%; height: 100%; }
.sj-dest strong {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 0.25rem 0.28rem;
  background: linear-gradient(transparent, rgba(30, 12, 60, 0.78));
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.05;
}
.sj-dest.is-on {
  border-color: #fde68a;
  box-shadow: 0 0 0 3px rgba(253, 230, 138, 0.45);
}

.sj-idea {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  height: 100%;
  min-height: 0;
}
.sj-storybook {
  flex: 1 1 auto;
  height: min(24rem, 48vh);
  min-height: 0;
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  filter: drop-shadow(0 16px 18px rgba(49, 16, 90, 0.28));
}
.sj-leaf { min-height: 0; overflow: hidden; }
.sj-leaf--cast {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
  padding: 0.4rem 0.35rem 0.45rem;
  border-radius: 16px 3px 3px 16px;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, 0.08), rgba(255, 246, 234, 0.55)),
    var(--sj-world) center 30% / cover;
}
.sj-leaf__where {
  margin: 0;
  color: #6d28d9;
  font-weight: 800;
  font-size: 0.85rem;
}
.sj-leaf--write {
  display: flex;
  border-radius: 3px 16px 16px 3px;
  background:
    repeating-linear-gradient(#fffaf3, #fffaf3 1.65rem, rgba(214, 180, 140, 0.55) 1.7rem),
    #fffaf3;
  box-shadow: inset 14px 0 18px rgba(91, 33, 182, 0.06);
}
.sj-leaf--write textarea {
  width: 100%;
  height: 100%;
  min-height: 8rem;
  border: 0;
  resize: none;
  background: transparent;
  padding: 0.15rem 0.9rem 0.4rem;
  color: #3b2768;
  font: 1.25rem/1.7rem "Patrick Hand", Nunito, sans-serif;
}
.sj-leaf .sj-hero img { width: 8.4rem; height: 10.6rem; }
.sj-leaf .sj-pal img { width: 5.5rem; height: 7rem; }
.sj-idea-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}
.sj-idea-card {
  position: relative;
  height: 4.4rem;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.sj-idea-card img { width: 100%; height: 100%; }
.sj-idea-card strong {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.9rem 0.3rem 0.22rem;
  background: linear-gradient(transparent, rgba(30, 12, 60, 0.78));
  color: #fff;
  font-size: 0.75rem;
}
.sj-idea-card.is-on { border-color: #f59e0b; }
.sj-idea-card--surprise {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #fde68a, #ddd6fe 55%, #c4b5fd);
  color: #5b21b6;
  font-family: Fredoka, Nunito, sans-serif;
  font-weight: 700;
  font-size: 1rem;
}
.sj-lengths {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}
.sj-length {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 44px;
  min-width: 7.5rem;
  padding: 0.25rem 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px 12px 8px 8px;
  background: rgba(255, 250, 243, 0.94);
  color: #5b21b6;
  font-weight: 800;
  font-size: 0.9rem;
}
.sj-length span { font-size: 0.72rem; font-weight: 700; }
.sj-length.is-on {
  background: linear-gradient(180deg, #fde68a, #fbbf24);
  border-color: #fff;
  color: #4c1d95;
}

.sj-finale {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.sj-cover {
  position: relative;
  width: min(24rem, 78%);
  height: min(30rem, 54vh);
  border-radius: 6px 22px 22px 6px;
  overflow: hidden;
  box-shadow:
    inset 16px 0 0 rgba(76, 29, 149, 0.28),
    0 0 0 6px rgba(253, 230, 138, 0.8),
    0 18px 32px rgba(49, 16, 90, 0.3);
}
.sj-cover__scene { width: 100%; height: 100%; }
.sj-cover .sj-troupe {
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
  bottom: 5.4rem;
}
.sj-cover .sj-hero img { width: 6.8rem; height: 8.6rem; }
.sj-cover .sj-pal img { width: 4.6rem; height: 5.8rem; }
.sj-cover figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 1.5rem 0.7rem 0.5rem;
  background: linear-gradient(transparent, rgba(30, 12, 60, 0.82));
  color: #fff;
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 1.35rem;
}
.sj-cover__idea {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 2.55rem;
  margin: 0;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  background: rgba(255, 250, 243, 0.94);
  color: #5b21b6;
  font-family: "Patrick Hand", Nunito, sans-serif;
  font-size: 1.05rem;
  line-height: 1.2;
}
.sj-charms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  max-width: 40rem;
}
.sj-charms span {
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.94);
  color: #5b21b6;
  font-weight: 800;
  font-size: 0.84rem;
  box-shadow: 0 3px 0 #fde68a;
}
.sj-whisper { max-width: 34rem; }

.sj-end-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.8rem;
}
.sj-end-actions .sb-btn { min-height: 44px; border-radius: 999px; }

body.page-storybook.sj-type-lg .sb-flip-text__highlight,
body.page-storybook.sj-type-lg .sb-flip-spread__inner--has-art:not(.sb-flip-spread__inner--art-facing) .sb-flip-text__highlight {
  font-size: clamp(1.2rem, 3.4vw, 1.55rem);
}
body.page-storybook.sj-type-xl .sb-flip-text__highlight,
body.page-storybook.sj-type-xl .sb-flip-spread__inner--has-art:not(.sb-flip-spread__inner--art-facing) .sb-flip-text__highlight {
  font-size: clamp(1.4rem, 4vw, 1.85rem);
}

@media (max-width: 1100px) {
  body.page-storybook.sb-route-story:not(.sb-modal-open):not(.sb-reader-immersive)
    .sb-app:has(#sbLanding:not(.is-hidden)),
  body.page-storybook.sb-route-story:not(.sb-modal-open):not(.sb-reader-immersive)
    .sb-app:has(#sbStoryJourney:not([hidden])) {
    max-height: none;
    overflow: visible;
  }
  #sbStoryJourney:not([hidden]),
  .sj-stage,
  .sj-world,
  .sj-idea,
  .sj-board,
  .sj-finale {
    height: auto;
    overflow: visible;
  }
  .sj-world { grid-template-columns: 1fr; }
  .sj-portal { height: 18rem; }
}

@media (max-width: 800px) {
  .sj-welcome { gap: 0.6rem; align-items: flex-end; }
  .sj-companion img { width: 8rem; height: 10.5rem; animation: none; }
  .sj-tome { width: 7.4rem; height: 10rem; margin-bottom: 0.4rem; }
  .sj-tome__name { font-size: 0.95rem; }
  .sj-board { grid-template-columns: 1fr; }
  .sj-gather { height: auto; padding-bottom: 0.2rem; }
  .sj-hero img { width: 8rem; height: 10.2rem; }
  .sj-pal img { width: 4.6rem; height: 6rem; }
  .sj-faces { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sj-destinations,
  .sj-destinations--places,
  .sj-idea-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sj-dest { height: 7.2rem; }
  .sj-storybook { grid-template-columns: 1fr; }
  .sj-leaf--cast { border-radius: 16px 16px 3px 3px; min-height: 11rem; }
  .sj-leaf--write { border-radius: 3px 3px 16px 16px; }
  .sj-leaf--write textarea { min-height: 8.5rem; }
  .sj-idea-card { height: 6.2rem; }
  .sj-lengths { flex-direction: column; align-items: stretch; }
  .sj-cover { width: min(18rem, 100%); height: 20rem; }
  .sj-portal { height: 16rem; }
  .sj-portal .sj-hero img { width: 4.8rem; height: 6.2rem; }
  .sj-portal .sj-pal img { width: 3.3rem; height: 4.2rem; }
}

#sbStoryJourney.sj-on-stars .sj-title {
  background: transparent;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}

.sj-stars {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  gap: 0.15rem;
}

.sj-gather--live {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  padding-bottom: 0;
}

.sj-gather--live::before { content: none; }

.sj-gather--live .sj-troupe {
  height: 100%;
  align-items: flex-end;
  gap: 0.1rem;
}

.sj-stars .sj-live,
.sj-stars .sj-token {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
}

.sj-stars .sj-feet { position: relative; }

.sj-stars .sj-live.sj-hero .sj-cutout {
  height: min(56vh, 36rem);
  width: auto;
}
.sj-stars .sj-live.sj-pal .sj-cutout {
  height: min(42vh, 26rem);
  width: auto;
}

.sj-stars .sj-cutout {
  max-width: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  object-fit: contain;
  object-position: center bottom;
}

.sj-stars .sj-live::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 0.1rem;
  height: 0.7rem;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(64, 102, 34, 0.46), transparent 72%);
  filter: blur(3px);
  pointer-events: none;
}

.sj-stars .sj-live[data-who="wondii-maya"] .sj-cutout { transform: translateY(2.5%); }
.sj-stars .sj-live[data-who="wondii-leo"] .sj-cutout { transform: translateY(6.4%); }

.sj-stars .sj-live figcaption,
.sj-stars .sj-token figcaption {
  position: absolute;
  top: 0.15rem;
  left: 50%;
  z-index: 2;
  margin: 0;
  transform: translateX(-50%);
  padding: 0.12rem 0.55rem 0.16rem;
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.92);
  color: #3b2768;
  font-size: 0.78rem;
  line-height: 1.15;
  text-shadow: none;
  white-space: nowrap;
  box-shadow: 0 4px 0 rgba(253, 230, 138, 0.85);
}

.sj-stars .sj-token figcaption {
  position: static;
  transform: none;
  margin-bottom: 0.28rem;
}

.sj-stars figcaption span {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sj-stars .sj-hero figcaption span { color: #b45309; }
.sj-stars .sj-pal figcaption span { color: #6d28d9; }

.sj-locket {
  width: 7.2rem;
  height: 7.2rem;
  padding: 0.28rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #f5f3ff, #c4b5fd 48%, #6d28d9 82%);
  box-shadow: 0 8px 0 rgba(76, 29, 149, 0.16), 0 14px 18px rgba(49, 16, 90, 0.16);
}

.sj-stars .sj-hero .sj-locket {
  width: 9rem;
  height: 9rem;
  background: radial-gradient(circle at 35% 28%, #fff7d6, #f6c453 46%, #c2410c 80%);
  box-shadow: 0 8px 0 rgba(154, 52, 18, 0.16), 0 14px 18px rgba(49, 16, 90, 0.16);
}

.sj-locket img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: none;
  object-fit: cover;
  object-position: center 16%;
  background: radial-gradient(circle at 50% 40%, #fff, #efe4ff 72%);
}

.sj-stand {
  display: block;
  width: 3.1rem;
  height: 0.72rem;
  margin-top: 0.28rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff6d8, #e7c27a 55%, #c48a3a);
  box-shadow: 0 0.42rem 0 rgba(62, 98, 32, 0.28);
}

.sj-picker {
  flex: 0 0 auto;
  width: min(100%, 46rem);
  margin: 0 auto;
  padding: 0.28rem 0.5rem 0.34rem;
  border-radius: 28px;
  background: rgba(255, 252, 248, 0.78);
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 22px rgba(49, 16, 90, 0.12);
  backdrop-filter: blur(8px);
}

.sj-stars .sj-tabs {
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 0.25rem;
  margin-bottom: 0.15rem;
  overflow-x: auto;
}

.sj-stars .sj-tabs button {
  flex: 0 0 auto;
  min-height: 36px;
  font-size: 0.8rem;
}

.sj-stars .sj-faces {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.2rem;
  overflow-x: auto;
  justify-content: flex-start;
  padding: 0.12rem 0.05rem 0.2rem;
}

.sj-stars .sj-face {
  flex: 0 0 4.2rem;
  width: 4.2rem;
  gap: 0.08rem;
  font-size: 0.68rem;
  color: #3b2768;
}

.sj-stars .sj-face img {
  width: 3.35rem;
  height: 3.35rem;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 16%;
  background: radial-gradient(circle at 50% 40%, #fff, #efe4ff 72%);
}

.sj-stars .sj-empty,
.sj-legend {
  margin: 0.35rem 0.2rem 0.15rem;
  color: #5b21b6;
  font-size: 0.82rem;
  font-weight: 800;
}

.sj-legend {
  margin-top: 0.05rem;
  margin-bottom: 0;
  color: #6d28d9;
  font-size: 0.72rem;
}

@media (max-width: 1100px) {
  #sbStoryJourney.sj-on-stars .sj-stage,
  #sbStoryJourney.sj-on-stars .sj-stars {
    height: auto;
    min-height: 0;
  }
  .sj-stars .sj-live.sj-hero .sj-cutout { height: 46vh; }
  .sj-stars .sj-live.sj-pal .sj-cutout { height: 34vh; }
}

@media (max-width: 800px) {
  #sbStoryJourney.sj-on-stars .sj-title { margin-bottom: 0; font-size: 1.55rem; }
  #sbStoryJourney.sj-on-stars .sj-crumbs { font-size: 0.78rem; }
  .sj-stars .sj-live.sj-hero .sj-cutout { height: 30vh; max-width: 44vw; }
  .sj-stars .sj-live.sj-pal .sj-cutout { height: 23vh; max-width: 30vw; }
  .sj-picker { padding: 0.18rem 0.4rem 0.2rem; }
  .sj-stars .sj-tabs { gap: 0.15rem; }
  .sj-stars .sj-tabs button {
    min-height: 34px;
    padding: 0.08rem 0.42rem;
    font-size: 0.7rem;
  }
  .sj-stars .sj-hero .sj-locket { width: 6.4rem; height: 6.4rem; }
  .sj-locket { width: 4.6rem; height: 4.6rem; }
  .sj-picker { width: 100%; border-radius: 22px; }
  .sj-stars .sj-live figcaption,
  .sj-stars .sj-token figcaption { font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
  body.page-storybook.sb-route-story:not(.sb-reader-immersive)::before,
  body.page-storybook.sb-route-story:not(.sb-reader-immersive)::after,
  .sj-pill,
  .sj-face img,
  .sj-dest,
  .sj-tome__cover,
  .sj-companion img {
    transition: none;
    animation: none;
  }
  .sj-stage.is-turn,
  .sj-pal.is-join,
  .sj-hero.is-join,
  .sj-pal.is-leave,
  .sj-hero.is-leave,
  .sj-sparkles i,
  .sj-room.is-opening .sj-tome__cover {
    animation: none;
    transform: none;
  }
}

/* Shared creation shell. The world is the page. Choices sit in a compact dock. */

body.page-storybook.sb-route-story:not(.sb-reader-immersive)::before {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.34) 0%, rgba(255, 253, 248, 0.04) 26%, rgba(41, 34, 70, 0.08) 100%),
    var(--sj-world) center / cover no-repeat;
  transition: background 0.38s ease;
}

body.page-storybook.sb-route-story:not(.sb-reader-immersive)::after {
  content: none;
  animation: none;
}

#sbLanding .sj-tome {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
}

@media (min-width: 901px) {
  body.page-storybook.sb-route-story:not(.sb-modal-open)
    .sb-app:has(#sbLanding:not(.is-hidden))
    #sbLanding:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(17rem, 24rem) minmax(0, 1fr);
    grid-template-rows: 1fr auto auto auto;
    column-gap: 1.25rem;
    align-items: end;
    width: min(100%, 90rem);
    min-height: 0;
    height: auto;
    overflow: auto;
    text-align: left;
  }
}

body.page-storybook.sb-route-story:not(.sb-modal-open):not(.sb-reader-immersive)
  .sb-app:has(#sbLanding:not([hidden]):not(.is-hidden)) {
  max-height: none;
  overflow: auto;
}

#sbLanding .sj-room__copy { grid-column: 1; grid-row: 1; align-self: end; padding-bottom: 0.8rem; }
#sbLanding .sj-welcome {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  justify-content: center;
  min-height: 0;
}
#sbLanding #sbError { grid-column: 1; grid-row: 2; }
#sbLanding #sbError:not([hidden]) ~ .sj-room__actions { grid-row: 3; }
#sbLanding #sbError:not([hidden]) ~ .sj-quiet-note { grid-row: 4; }
#sbLanding .sj-room__actions {
  grid-column: 1;
  grid-row: 2;
  flex-direction: column;
  align-items: stretch;
}
#sbLanding .sj-quiet-note { grid-column: 1; grid-row: 3; align-self: start; margin: 0.35rem 0 0; }
#sbLanding .sb-landing__split { grid-column: 1 / -1; grid-row: 4; margin-top: 1.5rem; }

#sbLanding .sj-room__kicker,
#sbLanding .sj-quiet-note {
  color: #292246;
  text-shadow: none;
}

#sbLanding .sj-room__title {
  color: #292246;
  text-shadow: none;
  background: rgba(255, 253, 248, 0.86);
  border-radius: 18px;
  padding: 0.15rem 0.7rem 0.25rem;
  width: fit-content;
}

#sbLanding .sj-room__actions .sj-pill,
#sbLanding .sj-room__actions .sj-quiet {
  width: 100%;
}

#sbLanding .sj-companion { display: flex; flex-direction: column; align-items: center; text-align: center; }
#sbLanding .sj-quiet {
  color: #5b21b6;
  text-shadow: none;
  background: rgba(255, 253, 248, 0.92);
  border-radius: 999px;
}
#sbLanding .sj-companion img,
#sbLanding .sj-companion img.is-cutout {
  width: auto;
  height: min(58vh, 620px);
  max-width: min(40vw, 420px);
  object-fit: contain;
  object-position: center bottom;
  border-radius: 0;
  box-shadow: none;
  animation: none;
  background: transparent;
  filter: drop-shadow(0 14px 12px rgba(41, 34, 70, 0.16));
  transform: translateY(2.5%);
}
#sbLanding .sj-companion figcaption {
  color: #292246;
  text-shadow: none;
  background: rgba(255, 253, 248, 0.9);
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.08rem 0.7rem;
  border-radius: 999px;
}

#sbStoryJourney.sj-shell:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(26rem, 34vw);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  column-gap: 1rem;
  row-gap: 0.25rem;
  width: min(100%, 92rem);
  height: 100%;
  text-align: left;
  overflow: hidden;
}

#sbStoryJourney.sj-shell .sj-crumbs {
  grid-column: 1 / -1;
  grid-row: 1;
  color: #292246;
  text-shadow: none;
}
#sbStoryJourney.sj-shell .sj-crumbs span[aria-current="step"] {
  background: rgba(255, 253, 248, 0.9);
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
}
#sbStoryJourney.sj-shell .sj-title {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  color: #292246;
  text-shadow: none;
  background: rgba(255, 253, 248, 0.9);
}
#sbStoryJourney.sj-shell .sj-stage {
  grid-column: 1 / -1;
  grid-row: 3;
  min-height: 0;
  height: auto;
  overflow: visible;
}
#sbStoryJourney.sj-shell .sj-status {
  grid-column: 1;
  grid-row: 4;
  margin: 0;
}
#sbStoryJourney.sj-shell .sj-status:not(:empty) {
  color: #292246;
  text-shadow: none;
  background: rgba(255, 253, 248, 0.9);
  border-radius: 12px;
  padding: 0.3rem 0.65rem;
  width: fit-content;
}
#sbStoryJourney.sj-shell .sj-desk-actions {
  grid-column: 2;
  grid-row: 5;
  justify-content: flex-end;
}

#sbStoryJourney.sj-shell .sj-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(26rem, 34vw);
  column-gap: 1rem;
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

.sj-scene {
  position: relative;
  min-height: 0;
  height: 100%;
}

.sj-scene .sj-troupe {
  position: absolute;
  left: 8%;
  right: 4%;
  bottom: 8%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.2rem;
  pointer-events: none;
}

body[data-sj-place="bedroom"] .sj-scene .sj-troupe { bottom: 9%; }
body[data-sj-place="woods"] .sj-scene .sj-troupe { bottom: 11%; }
body[data-sj-place="castle"] .sj-scene .sj-troupe { bottom: 12%; }
body[data-sj-place="undersea"] .sj-scene .sj-troupe { bottom: 4%; }

.sj-scene figure {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.sj-scene .sj-feet,
.sj-scene .sj-locket { order: 1; }
.sj-scene .sj-stand { order: 2; }
.sj-scene figcaption { order: 3; }

.sj-scene .sj-feet { display: flex; align-items: flex-end; justify-content: center; }
.sj-scene .sj-cutout,
.sj-scene .sj-locket img {
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.sj-scene .sj-cutout {
  display: block;
  width: auto;
  max-width: 34vw;
  object-fit: contain;
  object-position: center bottom;
}
.sj-scene .sj-hero .sj-cutout { height: min(48vh, 520px); }
body[data-sj-place="bedroom"] .sj-scene .sj-hero .sj-cutout { height: min(44vh, 460px); }
body[data-sj-place="undersea"] .sj-scene .sj-hero .sj-cutout { height: min(38vh, 400px); }
body[data-sj-place="undersea"] .sj-scene .sj-pal .sj-cutout { height: min(30vh, 320px); }
.sj-scene .sj-pal .sj-cutout { height: min(38vh, 400px); max-width: 24vw; }
.sj-scene .sj-troupe:has(figure:nth-child(4)) .sj-hero .sj-cutout { height: min(40vh, 430px); }
.sj-scene .sj-troupe:has(figure:nth-child(4)) .sj-pal .sj-cutout { height: min(30vh, 320px); }
.sj-scene .sj-live[data-who="wondii-maya"] .sj-cutout { transform: translateY(2.5%); }
.sj-scene .sj-live[data-who="wondii-leo"] .sj-cutout { transform: translateY(6.4%); }

.sj-scene .sj-feet { position: relative; display: flex; align-items: flex-end; justify-content: center; }
.sj-scene .sj-feet::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 1%;
  height: 0.42rem;
  background: radial-gradient(ellipse, rgba(46, 110, 52, 0.34), transparent 72%);
  filter: blur(2px);
  pointer-events: none;
}
body[data-sj-place="bedroom"] .sj-scene .sj-feet::after {
  background: radial-gradient(ellipse, rgba(120, 80, 60, 0.28), transparent 72%);
}
body[data-sj-place="woods"] .sj-scene .sj-feet::after,
body[data-sj-place="castle"] .sj-scene .sj-feet::after {
  background: radial-gradient(ellipse, rgba(70, 90, 40, 0.32), transparent 72%);
}
body[data-sj-place="undersea"] .sj-scene .sj-feet::after {
  height: 0.32rem;
  background: radial-gradient(ellipse, rgba(112, 86, 46, 0.28), rgba(56, 140, 150, 0.08) 70%, transparent 78%);
}
.sj-scene .sj-live::after { content: none; }

.sj-scene figcaption {
  position: relative;
  z-index: 1;
  margin-top: -0.2rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  color: #292246;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}
.sj-scene figcaption span { margin-right: 0.2rem; }

.sj-scene .sj-locket {
  width: 7.2rem;
  height: 7.2rem;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fffdf8;
  box-shadow: 0 10px 18px rgba(41, 34, 70, 0.18);
  background: #fff;
}
.sj-scene .sj-hero .sj-locket { width: 9rem; height: 9rem; }
.sj-scene .sj-locket img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  border-radius: 0;
  box-shadow: none;
}
.sj-scene .sj-stand {
  display: block;
  width: 3.4rem;
  height: 0.4rem;
  margin: 0.2rem auto 0;
  border-radius: 999px;
  background: #f6c45d;
}

.sj-dock {
  align-self: center;
  max-height: 100%;
  overflow: auto;
  margin: 0.2rem 0;
  padding: 0.85rem 0.9rem 0.95rem;
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 12px 28px rgba(41, 34, 70, 0.12);
  color: #292246;
}

.sj-dock .sj-kicker,
.sj-dock .sj-legend,
.sj-dock .sj-empty,
.sj-dock .sj-whisper {
  color: #5b21b6;
  text-shadow: none;
}
.sj-dock .sj-kicker { margin: 0.55rem 0 0.35rem; }
.sj-dock .sj-kicker:first-child { margin-top: 0; }
.sj-dock .sj-whisper { margin: 0.7rem 0 0; font-size: 0.86rem; line-height: 1.35; color: #292246; }
.sj-dock .sj-legend,
.sj-dock .sj-empty { margin: 0.45rem 0 0; font-size: 0.8rem; }

.sj-places {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.sj-place {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-height: 48px;
  padding: 0.35rem;
  border: 2px solid transparent;
  border-radius: 14px;
  background: #f7f1ff;
  color: #292246;
  font-family: Nunito, sans-serif;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.sj-place:nth-child(5) { grid-column: 1 / -1; }
.sj-place:nth-child(6) { grid-column: 1 / -1; }
.sj-place img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
}
.sj-place.is-on {
  border-color: #7c3aed;
  background: #fff;
  box-shadow: 0 0 0 3px #7c3aed, 0 12px 20px rgba(91, 33, 182, 0.16);
}
.sj-check {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.35rem;
  text-align: center;
}

.sj-chips,
.sj-suggests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.sj-chip,
.sj-suggest,
.sj-dock .sj-tabs button {
  min-height: 44px;
  padding: 0.25rem 0.7rem;
  border: 2px solid transparent;
  border-radius: 999px;
  background: #f1eafb;
  color: #292246;
  font-family: Nunito, sans-serif;
  font-weight: 800;
  cursor: pointer;
}
.sj-suggest {
  border-radius: 14px;
  text-align: left;
  font-size: 0.86rem;
  line-height: 1.3;
}
.sj-chip.is-on,
.sj-suggest.is-on,
.sj-dock .sj-tabs button[aria-selected="true"] {
  border-color: #7c3aed;
  background: #fff;
}
.sj-dock .sj-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.45rem;
}
.sj-dock .sj-faces {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.3rem;
  overflow: visible;
}
.sj-dock .sj-face {
  width: auto;
  min-height: 44px;
  gap: 0.05rem;
  padding: 0.2rem 0.1rem;
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #292246;
  font-size: 0.68rem;
}
.sj-dock .sj-face img {
  width: 3rem;
  height: 3rem;
  box-shadow: none;
}
.sj-dock .sj-face.is-on,
.sj-dock .sj-face.is-star {
  border-color: #7c3aed;
  background: #fff;
}
.sj-dock .sj-face.is-on img,
.sj-dock .sj-face.is-star img { box-shadow: none; }
.sj-role {
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 800;
  color: #5b21b6;
}

.sj-write { display: block; }
.sj-write textarea {
  width: 100%;
  min-height: 6.2rem;
  margin-top: 0.3rem;
  padding: 0.7rem 0.75rem;
  border: 2px solid #e4d8f8;
  border-radius: 14px;
  background: #fff;
  color: #292246;
  font: 700 1rem/1.4 Nunito, sans-serif;
  resize: vertical;
}
.sj-dock .sj-lengths {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}
.sj-dock .sj-length {
  min-width: 0;
  border-radius: 14px;
  border: 2px solid transparent;
  background: #f1eafb;
  color: #292246;
}
.sj-dock .sj-length.is-on {
  border-color: #7c3aed;
  background: #fff;
  color: #292246;
}

.sj-summary { margin: 0; }
.sj-summary div {
  display: grid;
  grid-template-columns: 6.4rem minmax(0, 1fr);
  gap: 0.35rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid rgba(124, 58, 237, 0.14);
}
.sj-summary dt { margin: 0; font-size: 0.75rem; font-weight: 800; color: #6d28d9; }
.sj-summary dd { margin: 0; font-weight: 800; color: #292246; }

.sj-place:focus-visible,
.sj-chip:focus-visible,
.sj-suggest:focus-visible,
.sj-dock .sj-face:focus-visible,
.sj-dock .sj-tabs button:focus-visible,
.sj-dock .sj-length:focus-visible,
.sj-pill:focus-visible,
.sj-quiet:focus-visible,
.sj-write textarea:focus-visible {
  outline: 3px solid #292246;
  outline-offset: 2px;
}

@media (max-width: 900px) {
  #sbLanding:not([hidden]):not(.is-hidden) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
  }
  #sbLanding .sj-room__copy,
  #sbLanding .sj-welcome,
  #sbLanding .sj-room__actions,
  #sbLanding .sj-quiet-note,
  #sbLanding .sb-landing__split { grid-column: auto; grid-row: auto; }
  #sbLanding .sj-welcome { min-height: 16rem; height: 17.5rem; order: 2; }
  #sbLanding .sj-room__copy { order: 1; }
  #sbLanding .sj-room__actions { order: 3; }
  #sbLanding .sj-quiet-note { order: 4; }
  #sbLanding .sb-landing__split { order: 5; }
  #sbLanding .sj-companion img,
  #sbLanding .sj-companion img.is-cutout {
    height: 240px;
    max-width: 70vw;
  }

  #sbStoryJourney.sj-shell:not([hidden]) {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  #sbStoryJourney.sj-shell .sj-layout {
    display: flex;
    flex-direction: column;
    height: auto;
  }
  #sbStoryJourney.sj-shell .sj-scene {
    height: 280px;
    flex: 0 0 280px;
  }
  #sbStoryJourney.sj-shell .sj-desk-actions { justify-content: stretch; }
  #sbStoryJourney.sj-shell .sj-desk-actions .sj-pill { flex: 1 1 auto; }
  .sj-scene .sj-feet { display: flex; align-items: flex-end; justify-content: center; }
  .sj-scene .sj-cutout { height: 210px; max-width: 42vw; }
  .sj-scene .sj-pal .sj-cutout { height: 150px; max-width: 26vw; }
  .sj-scene .sj-troupe { left: 0; right: 0; bottom: 2%; transform-origin: center bottom; }
  .sj-scene .sj-troupe:has(figure:nth-child(3)) { transform: scale(0.86); }
  .sj-scene .sj-troupe:has(figure:nth-child(4)) { transform: scale(0.72); }
  body[data-sj-place="undersea"] .sj-scene .sj-troupe { bottom: 1%; }
  body[data-sj-place="bedroom"] .sj-scene .sj-troupe { bottom: 4%; }
  body[data-sj-place="undersea"] .sj-scene,
  body[data-sj-place="bedroom"] .sj-scene,
  body[data-sj-place="woods"] .sj-scene,
  body[data-sj-place="castle"] .sj-scene,
  body[data-sj-place="library"] .sj-scene {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    background-image: var(--sj-world);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center 62%;
  }
  body[data-sj-place="undersea"] .sj-scene {
    height: 320px;
    flex-basis: 320px;
    background-position: center bottom;
  }
  body[data-sj-place="bedroom"] .sj-scene { background-position: center 70%; }
  body[data-sj-place="woods"] .sj-scene,
  body[data-sj-place="castle"] .sj-scene { background-position: center 74%; }
  #sbStoryJourney.sj-shell .sj-crumbs {
    font-size: 0.68rem;
    white-space: nowrap;
  }
  .sj-dock { max-height: none; }
  .sj-summary dd { overflow-wrap: anywhere; }
}

body[data-sj-place="bedroom"].page-storybook.sb-route-story:not(.sb-reader-immersive)::before {
  background-image:
    linear-gradient(180deg, rgba(255, 253, 248, 0.28) 0%, rgba(255, 253, 248, 0.04) 24%, rgba(41, 34, 70, 0.05) 100%),
    var(--sj-world);
  background-repeat: no-repeat;
  background-size: auto, cover;
  background-position: center center, center 78%;
}

body[data-sj-place="woods"].page-storybook.sb-route-story:not(.sb-reader-immersive)::before,
body[data-sj-place="castle"].page-storybook.sb-route-story:not(.sb-reader-immersive)::before {
  background-image:
    linear-gradient(180deg, rgba(255, 253, 248, 0.28) 0%, rgba(255, 253, 248, 0.04) 24%, rgba(41, 34, 70, 0.08) 100%),
    var(--sj-world);
  background-repeat: no-repeat;
  background-size: auto, cover;
  background-position: center center, center 72%;
}

body[data-sj-place="undersea"].page-storybook.sb-route-story:not(.sb-reader-immersive)::before {
  background-image:
    linear-gradient(180deg, rgba(255, 253, 248, 0.12) 0%, rgba(8, 40, 70, 0.05) 30%, rgba(8, 40, 70, 0.14) 100%),
    var(--sj-world);
  background-repeat: no-repeat;
  background-size: auto, cover;
  background-position: center center, center bottom;
}

@media (max-width: 900px) and (max-height: 540px) {
  #sbStoryJourney.sj-shell .sj-stage,
  #sbStoryJourney.sj-shell .sj-stage > * {
    flex: 0 0 auto;
    height: auto;
  }
  #sbStoryJourney.sj-shell .sj-scene {
    height: 56px;
    flex: 0 0 56px;
  }
  .sj-scene .sj-hero .sj-cutout,
  .sj-scene .sj-pal .sj-cutout { height: 48px; }
  #sbStoryJourney .sj-suggests,
  #sbStoryJourney .sj-kicker { display: none; }
  #sjJourneyTitle { margin: 0.1rem 0 0.2rem; font-size: 1.05rem; }
  .sj-write textarea { min-height: 3.2rem; max-height: 4.4rem; }
  .sj-dock { padding-top: 0.4rem; padding-bottom: 0.45rem; }
}

@media (max-width: 360px) {
  #sbStoryJourney.sj-shell .sj-crumbs { font-size: 0.58rem; }
}

#sbLanding .sj-companion,
#sbLanding .sj-tome { display: none !important; }
#sbLanding .sj-teasers {
  width: min(100%, 36rem);
  margin-left: auto;
  padding: 0.75rem 0.8rem 0.85rem;
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 12px 28px rgba(41, 34, 70, 0.12);
  color: #292246;
}
#sbLanding .sj-teasers > p {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5b21b6;
}
#sbLanding .sj-teasers > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}
#sbLanding .sj-teasers figure { margin: 0; }
#sbLanding .sj-teasers img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
}
#sbLanding .sj-teasers figcaption {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}
#sbLanding .sj-room__title { font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.05; }
#sbLanding .sj-welcome { min-height: 0 !important; height: auto !important; }

#sbStoryJourney.sj-v3.sj-shell:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
#sbStoryJourney.sj-v3 .sj-stage { display: flex; flex: 1 1 auto; min-height: 0; }
#sbStoryJourney.sj-v3 .sj-layout {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
#sbStoryJourney.sj-v3 .sj-scene { flex: 1 1 auto; min-height: 8rem; background: none; }
#sbStoryJourney.sj-v3 .sj-dock {
  width: min(100% - 1rem, 76rem);
  max-height: min(48vh, 26rem);
  margin: 0 auto 0.35rem;
  border-radius: 26px;
}
#sbStoryJourney.sj-v3 .sj-desk-actions { justify-content: flex-end; }
#sbStoryJourney.sj-v3 .sj-picked-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}
#sbStoryJourney.sj-v3 .sj-picked { display: flex; gap: 0.45rem; overflow-x: auto; }
#sbStoryJourney.sj-v3 .sj-medal {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.8rem;
  color: #292246;
  font-size: 0.72rem;
  font-weight: 800;
}
#sbStoryJourney.sj-v3 .sj-medal img {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 16%;
  border: 2px solid #fff;
}
#sbStoryJourney.sj-v3 .sj-medal.is-star img { box-shadow: 0 0 0 2px #f6c45d; }
#sbStoryJourney.sj-v3 .sj-medal em { font-style: normal; font-size: 0.62rem; color: #5b21b6; }
#sbStoryJourney.sj-v3 .sj-dock .sj-faces {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.15rem 0.1rem 0.45rem;
}
#sbStoryJourney.sj-v3 .sj-dock .sj-face {
  flex: 0 0 8.4rem;
  width: 8.4rem;
  min-height: 10.4rem;
  padding: 0.55rem 0.4rem 0.6rem;
  border-radius: 20px;
  border: 3px solid transparent;
  background: #f4efff;
}
#sbStoryJourney.sj-v3 .sj-dock .sj-face img {
  width: 6.4rem;
  height: 6.4rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 16%;
}
#sbStoryJourney.sj-v3 .sj-dock .sj-face.is-star,
#sbStoryJourney.sj-v3 .sj-dock .sj-face.is-on { animation: sj-pick 0.32s ease; }
#sbStoryJourney.sj-v3 .sj-dock .sj-face.is-star {
  border-color: #f6c45d;
  background: #fffaf0;
  box-shadow: 0 8px 16px rgba(246, 196, 93, 0.35);
}
#sbStoryJourney.sj-v3 .sj-dock .sj-face.is-on:not(.is-star) {
  border-color: #7c3aed;
  background: #fff;
  box-shadow: 0 8px 16px rgba(124, 58, 237, 0.18);
}
@keyframes sj-pick {
  from { transform: scale(0.94); }
  to { transform: none; }
}
.sj-inspires { display: flex; gap: 0.5rem; overflow-x: auto; flex-wrap: nowrap; }
.sj-inspire {
  flex: 0 0 9rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-height: 6.4rem;
  padding: 0.35rem;
  border: 2px solid transparent;
  border-radius: 16px;
  background: #f4efff;
  color: #292246;
  font-family: Nunito, sans-serif;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.sj-inspire img { width: 100%; height: 3.5rem; object-fit: cover; border-radius: 10px; }
.sj-inspire.is-on { border-color: #7c3aed; background: #fff; }
.sj-inspire--more {
  align-items: center;
  justify-content: center;
  background: #fff;
  border-style: dashed;
  border-color: #c4b5fd;
  color: #5b21b6;
}
.sj-journal textarea {
  min-height: 8.75rem;
  border-radius: 18px;
  border: 2px solid #e4d4f8;
  padding: 0.45rem 0.8rem 0.55rem 1.15rem;
  line-height: 1.75rem;
  background-color: #fffdf8;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(1.75rem - 1px),
    rgba(124, 58, 237, 0.16) 1.75rem
  );
  background-attachment: local;
  box-shadow: inset 10px 0 0 #f3e8ff;
}

@media (max-width: 900px) {
  #sbLanding .sj-welcome { order: 2; height: auto !important; min-height: 0 !important; width: 100%; min-width: 0; }
  #sbLanding .sj-teasers { width: 100%; max-width: 100%; min-width: 0; margin-left: 0; margin-right: 0; box-sizing: border-box; }
  #sbLanding .sj-teasers > p { letter-spacing: 0; white-space: normal; }
  #sbLanding .sj-teasers > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
    overflow: visible;
  }
  #sbLanding .sj-teasers img { aspect-ratio: 16 / 10; height: auto; }
  #sbStoryJourney.sj-v3.sj-shell:not([hidden]) { height: auto; max-height: none; overflow: visible; }
  #sbStoryJourney.sj-v3 .sj-stage { flex: 0 0 auto; height: auto; }
  #sbStoryJourney.sj-v3 .sj-scene {
    height: 3.25rem !important;
    min-height: 0;
    flex: 0 0 3.25rem;
  }
  #sbStoryJourney .sj-places {
    display: flex;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    gap: 0.55rem;
  }
  #sbStoryJourney .sj-place { flex: 0 0 12.5rem; }
  #sbStoryJourney .sj-place:nth-child(5) { grid-column: auto; }
  #sbStoryJourney.sj-v3 .sj-dock { width: 100%; max-width: 100%; max-height: none; box-sizing: border-box; }
  #sbStoryJourney.sj-v3 .sj-picked-head { flex-wrap: wrap; align-items: flex-start; }
  #sbStoryJourney.sj-v3 .sj-picked-head .sj-kicker { flex: 1 1 9rem; min-width: 0; }
  #sbStoryJourney.sj-v3 .sj-picked { flex: 1 0 auto; margin-left: auto; overflow: visible; }
  #sbStoryJourney.sj-v3 .sj-medal { flex: 0 0 auto; }
  #sbStoryJourney.sj-v3 .sj-medal strong,
  #sbStoryJourney.sj-v3 .sj-medal em { white-space: nowrap; }
  #sbStoryJourney.sj-v3 .sj-dock .sj-face { flex-basis: 7rem; width: 7rem; min-height: 8.8rem; }
  #sbStoryJourney.sj-v3 .sj-dock .sj-face img { width: 5.2rem; height: 5.2rem; }
  .sj-book { grid-template-columns: 1fr; }
}
@media (min-width: 768px) and (max-width: 1100px) {
  #sbStoryJourney.sj-v3 .sj-dock { width: min(100% - 1rem, 44rem); }
  #sbLanding .sj-teasers { width: min(100%, 28rem); }
}

.sj-preview__flag {
  margin: 0 0 0.55rem;
  color: #5b21b6;
  font-size: 0.82rem;
  font-weight: 800;
}
.sj-book {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: stretch;
  overflow: hidden;
  border-radius: 10px 18px 18px 10px;
  background: #fffdf8;
  box-shadow: inset 14px 0 0 #5b21b6, 0 14px 26px rgba(41, 34, 70, 0.14);
}
.sj-book__cover {
  position: relative;
  margin: 0.75rem 0.45rem 0.75rem 1.35rem;
  border-radius: 12px;
  overflow: hidden;
  background: #efe7ff;
}
.sj-book__cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
}
.sj-book__cast {
  display: flex;
  gap: 0.35rem;
  padding: 0.4rem 0.45rem 0.15rem;
}
.sj-book__place {
  margin: 0;
  padding: 0.15rem 0.5rem 0.45rem;
  color: #292246;
  font-size: 0.82rem;
  font-weight: 800;
}
.sj-book__page {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.35rem;
  min-width: 0;
  margin: 0.75rem 0.8rem 0.75rem 0.2rem;
  padding: 0.85rem 0.75rem 0.9rem 0.85rem;
  border-radius: 12px;
  background: #fffdf8;
}
.sj-ready__kind,
.sj-ready__length {
  margin: 0;
  color: #5b21b6;
  font-size: 0.82rem;
  font-weight: 800;
}
.sj-ready__idea {
  margin: 0;
  color: #292246;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.7rem;
}
.sj-preview .sj-whisper { margin: 0.65rem 0 0; }
.sj-saved-card {
  padding: 1rem 1.05rem 1.1rem;
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: inset 14px 0 0 #5b21b6, 0 14px 26px rgba(41, 34, 70, 0.14);
}
.sj-saved-card h2 {
  margin: 0 0 0.35rem;
  color: #292246;
  font-size: 1.35rem;
}
.sj-saved-note {
  margin: 0.35rem 0 0.8rem;
  color: #292246;
  line-height: 1.45;
}
.sj-illustration-meter {
  margin: 0.8rem 0 0.9rem;
}
.sj-illustration-count,
.sj-illustration-step {
  margin: 0.2rem 0;
  color: #292246;
  line-height: 1.4;
}
.sj-illustration-count,
.sj-illustration-step.is-current {
  font-weight: 800;
}
.sj-illustration-bar {
  height: 0.7rem;
  margin: 0.45rem 0;
  border-radius: 999px;
  background: #efe7ff;
  overflow: hidden;
}
.sj-illustration-bar span {
  display: block;
  height: 100%;
  background: #5b21b6;
}
.sj-progress {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.sj-progress li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  background: #f6f1ff;
  color: #292246;
}
.sj-progress li.is-done { background: #efe7ff; }
.sj-progress li.is-running { background: #efe7ff; }
.sj-progress li.is-blocked,
.sj-progress li.is-stopped { background: #fff4e8; }
.sj-progress li.is-ready { background: #e7f6ee; }
.sj-progress li.is-waiting span,
.sj-progress li.is-running span,
.sj-progress li.is-blocked span,
.sj-progress li.is-stopped span,
.sj-progress li.is-ready span,
.sj-progress li.is-done span {
  color: #5b21b6;
  font-weight: 800;
}
@media (max-width: 700px) {
  .sj-book { grid-template-columns: 1fr; }
  .sj-book__cover { margin-right: 0.75rem; }
  #sbStoryJourney.sj-v3.sj-on-review .sj-scene { display: none !important; }
  #sbStoryJourney.sj-v3.sj-on-review .sj-book__cover img { aspect-ratio: 16 / 9; }
}
@media (max-width: 360px) {
  #sbStoryJourney.sj-v3 .sj-desk-actions { flex-wrap: nowrap; gap: 0.4rem; }
  #sbStoryJourney.sj-v3 .sj-desk-actions .sj-pill {
    min-width: 0;
    padding: 0.3rem 0.55rem;
    font-size: 0.92rem;
  }
  #sbStoryJourney.sj-v3 .sj-desk-actions .sj-pill:not(.sj-pill--primary) { flex: 0 0 auto; }
  #sbStoryJourney.sj-v3 .sj-desk-actions .sj-pill--primary { flex: 1 1 auto; }
}
.sj-length-row { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }

@media (min-width: 901px) {
  body.page-storybook.sb-route-story:not(.sb-modal-open)
    .sb-app:has(#sbLanding:not(.is-hidden))
    #sbLanding:not([hidden]) {
    grid-template-columns: minmax(20rem, 24rem) minmax(30rem, 42rem);
    grid-template-rows: auto auto auto;
    align-content: center;
    align-items: center;
    justify-content: center;
    column-gap: 2rem;
    row-gap: 0.55rem;
    width: min(100% - 2rem, 72rem);
    margin-inline: auto;
  }
  #sbLanding .sj-room__copy {
    align-self: end;
    padding-bottom: 0.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }
  #sbLanding .sj-room__kicker {
    background: rgba(255, 253, 248, 0.9);
    border-radius: 14px;
    padding: 0.35rem 0.7rem;
  }
  #sbLanding .sj-welcome {
    grid-row: 1 / span 3;
    align-self: center;
    width: 100%;
    min-width: 0;
  }
  #sbLanding .sj-teasers {
    width: 100%;
    max-width: none;
    margin: 0;
  }
  #sbLanding .sj-teasers > div {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.7rem;
  }
  #sbLanding .sj-teasers figure { grid-column: span 2; }
  #sbLanding .sj-teasers figure:nth-child(4),
  #sbLanding .sj-teasers figure:nth-child(5) { grid-column: span 3; }
  #sbLanding .sj-room__actions { align-self: start; }
  #sbLanding .sj-quiet-note { margin-top: 0.1rem; }
  #sbLanding .sb-landing__split {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  #sbStoryJourney.sj-v3.sj-shell:not([hidden]) {
    flex: 1 1 auto;
    justify-content: center;
    gap: 0.6rem;
    width: min(100% - 2.5rem, 66rem);
    height: auto;
    max-height: 100%;
    margin-inline: auto;
    overflow: auto;
    text-align: center;
  }
  #sbStoryJourney.sj-v3.sj-shell.sj-on-world:not([hidden]) { width: min(100% - 2.5rem, 68rem); }
  #sbStoryJourney.sj-v3.sj-shell.sj-on-idea:not([hidden]) { width: min(100% - 2.5rem, 48rem); }
  #sbStoryJourney.sj-v3.sj-shell.sj-on-review:not([hidden]) { width: min(100% - 2.5rem, 48rem); }
  #sbStoryJourney.sj-v3 .sj-crumbs,
  #sbStoryJourney.sj-v3 .sj-title { margin: 0 auto; }
  #sbStoryJourney.sj-v3 .sj-stage,
  #sbStoryJourney.sj-v3 .sj-layout {
    display: block;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
  }
  #sbStoryJourney.sj-v3 .sj-scene { display: none; }
  #sbStoryJourney.sj-v3 .sj-dock {
    width: 100%;
    max-width: 100%;
    max-height: none;
    margin: 0;
    overflow: visible;
    text-align: left;
  }
  #sbStoryJourney.sj-v3 .sj-desk-actions {
    width: 100%;
    margin: 0;
    justify-content: flex-end;
  }
  #sbStoryJourney.sj-v3 .sj-status { margin: 0; align-self: start; }

  #sbStoryJourney.sj-on-world .sj-where { display: block; height: auto; }
  #sbStoryJourney.sj-on-world .sj-places {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
  }
  #sbStoryJourney.sj-on-world .sj-place { min-width: 0; }
  #sbStoryJourney.sj-on-world .sj-place:nth-child(5) { grid-column: auto; flex: none; }
  #sbStoryJourney.sj-on-world .sj-chips { margin-top: 0.15rem; }

  #sbStoryJourney.sj-on-idea .sj-journal {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(13rem, 0.85fr);
    gap: 0.65rem 0.8rem;
    align-items: stretch;
  }
  #sbStoryJourney.sj-on-idea .sj-write { grid-column: 1; grid-row: 1; }
  #sbStoryJourney.sj-on-idea .sj-inspires {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: stretch;
    overflow: visible;
  }
  #sbStoryJourney.sj-on-idea .sj-inspire {
    flex: none;
    width: auto;
    min-height: 0;
  }
  #sbStoryJourney.sj-on-idea .sj-length-row { grid-column: 1 / -1; }
  #sbStoryJourney.sj-on-idea .sj-journal textarea { min-height: 8.75rem; }
}

@media (max-width: 900px) and (max-height: 540px) {
  #sbStoryJourney.sj-v3 .sj-scene {
    height: 0 !important;
    min-height: 0 !important;
    flex: 0 0 0 !important;
  }
  #sbStoryJourney.sj-v3 .sj-journal textarea {
    min-height: 3.2rem;
    max-height: 4.2rem;
  }
  #sbStoryJourney.sj-v3 .sj-dock { margin-bottom: 0; padding-bottom: 0.3rem; }
  #sbStoryJourney.sj-v3 .sj-desk-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin-top: 0;
    padding: 0.2rem 0 0.15rem;
    background: rgba(255, 253, 248, 0.94);
  }
  #sbStoryJourney.sj-v3 .sj-desk-actions .sj-pill { min-height: 44px; padding-top: 0.35rem; padding-bottom: 0.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  body.page-storybook.sb-route-story:not(.sb-reader-immersive)::before,
  .sj-place,
  .sj-chip,
  .sj-suggest,
  .sj-inspire,
  .sj-face,
  #sbLanding .sj-companion img {
    transition: none;
    animation: none;
  }
}

.sj-author {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.85rem;
  text-align: left;
}
.sj-author span,
.sj-author__note,
.sj-quote {
  color: #3a3152;
  font-size: 0.92rem;
  line-height: 1.4;
}
.sj-author input {
  width: 100%;
  min-height: 44px;
  border: 2px solid #e4d8f8;
  border-radius: 14px;
  padding: 0.55rem 0.8rem;
  font: 700 1rem/1.3 Nunito, sans-serif;
  color: #292246;
  background: #fff;
}
.sj-quote { margin: 0.75rem 0 0; font-weight: 800; }
.sj-approve {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-top: 0.75rem;
  text-align: left;
  font-weight: 800;
  color: #292246;
}
.sj-approve input { width: 1.15rem; height: 1.15rem; margin-top: 0.15rem; }
.sj-own {
  display: block;
  margin: 0.8rem 0 0.2rem;
  text-align: left;
  font-weight: 800;
  color: #292246;
}
.sj-own span { display: block; margin-bottom: 0.35rem; }
.sj-own input {
  width: 100%;
  min-height: 44px;
  border: 2px solid #e4d8f8;
  border-radius: 14px;
  padding: 0.55rem 0.8rem;
  font: 700 1rem/1.3 Nunito, sans-serif;
  color: #292246;
  background: #fff;
}
.sj-brief {
  margin: 0.9rem 0 0;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  background: #f7f2ff;
  text-align: left;
}
.sj-brief div { margin: 0.35rem 0; }
.sj-brief dt {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6d6284;
}
.sj-brief dd {
  margin: 0.1rem 0 0;
  font-weight: 800;
  color: #292246;
}
.sj-brief__note {
  margin: 0.7rem 0 0;
  font-size: 0.86rem;
  font-weight: 800;
  color: #6d6284;
}
.sj-brief__choice {
  margin: 0.7rem 0 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: #292246;
}
.sj-brief-update {
  display: block;
  width: 100%;
  margin: 0.8rem 0 0;
  min-height: 44px;
  border: 2px solid #e4d8f8;
  border-radius: 14px;
  background: #fff;
  font: 800 0.95rem/1.3 Nunito, sans-serif;
  color: #292246;
  text-align: left;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
}
.sj-brief-update strong,
.sj-brief-update span { display: block; }
.sj-brief-update span {
  margin-top: 0.2rem;
  font-weight: 700;
  color: #6d6284;
}
