
  :root {
    --rn-ink: #221711;
    --rn-muted: #745f50;
    --rn-paper: #fffaf1;
    --rn-paper-deep: #f5ead7;
    --rn-line: rgba(75, 49, 29, 0.16);
    --rn-accent: #9c542e;
    --rn-accent-2: #1f6f73;
    --rn-shadow: 0 24px 80px rgba(42, 28, 18, 0.22);
  }

  .rn-book-brand{
    display: none;
  }
  body.rn-storybook-ready {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--rn-ink);
    background:
      radial-gradient(circle at top left, rgba(31, 111, 115, 0.16), transparent 32rem),
      linear-gradient(135deg, #efe3cf 0%, #f9f0df 42%, #d7e4df 100%);
    font-family: Georgia, "Times New Roman", serif;
  }

  body.rn-storybook-ready #wrapper,
  body.rn-storybook-ready #page-content-wrapper,
  body.rn-storybook-ready #containerNHelpDivId,
  body.rn-storybook-ready #mainContainer,
  body.rn-storybook-ready #tutorialDivId,
  body.rn-storybook-ready .songContainer {
    width: 100% !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.rn-storybook-ready .curvedBox,
  body.rn-storybook-ready .songDeltsNImg {
    display: none !important;
  }

  .rn-storybook {
    min-height: 100vh;
    padding: clamp(18px, 4vw, 52px);
    box-sizing: border-box;
  }

  .rn-storybook,
  .rn-storybook * {
    box-sizing: border-box;
  }

  .rn-book-shell {
    width: min(1180px, 100%);
    min-width: 0;
    margin: 0 auto;
  }

  .rn-book-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    color: var(--rn-muted);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .rn-book-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
  }

  /* .rn-book-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  } */

  .rn-book-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--rn-line);
    border-radius: 50%;
    background: rgba(255, 250, 241, 0.72);
    color: var(--rn-accent);
    font-weight: 700;
  }

  .rn-book-progress {
    white-space: nowrap;
  }

  .rn-voice-select {
    width: 100%;
    border: 1px solid rgba(83, 55, 34, 0.22);
    border-radius: 8px;
    padding: 11px 12px;
    background: rgba(255, 250, 241, 0.82);
    color: var(--rn-ink);
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
  }

  .rn-speed-range {
    width: 100%;
    accent-color: var(--rn-accent-2);
  }

  .rn-speed-value {
    color: var(--rn-accent);
    font-weight: 700;
  }

  .rn-settings-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(31, 23, 16, 0.48);
    backdrop-filter: blur(4px);
  }

  .rn-settings-backdrop.show {
    display: flex;
  }

  .rn-settings-modal {
    width: min(460px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(83, 55, 34, 0.22);
    border-radius: 16px;
    padding: 24px;
    background: var(--rn-paper);
    box-shadow: 0 24px 70px rgba(42, 28, 18, 0.32);
    color: var(--rn-ink);
    font-family: Arial, Helvetica, sans-serif;
  }

  .rn-settings-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
  }

  .rn-settings-header h2 {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: 0;
  }

  .rn-settings-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(83, 55, 34, 0.22);
    border-radius: 50%;
    background: rgba(255, 250, 241, 0.72);
    color: var(--rn-ink);
    cursor: pointer;
    font-weight: 700;
  }

  .rn-setting-group {
    margin-bottom: 20px;
  }

  .rn-setting-group:last-child {
    margin-bottom: 0;
  }

  .rn-setting-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--rn-muted);
    font-size: 0.86rem;
    font-weight: 700;
  }

  .rn-book {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: clamp(560px, calc(100vh - 150px), 760px);
    touch-action: pan-y;
    user-select: none;
    border: 1px solid rgba(83, 55, 34, 0.22);
    border-radius: 8px;
    background:
      linear-gradient(90deg, rgba(88, 59, 38, 0.1), transparent 9%, transparent 91%, rgba(88, 59, 38, 0.1)),
      linear-gradient(135deg, var(--rn-paper), var(--rn-paper-deep));
    box-shadow: var(--rn-shadow);
  }

  .rn-book::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      linear-gradient(90deg, transparent calc(50% - 1px), rgba(85, 58, 38, 0.18) 50%, transparent calc(50% + 1px)),
      radial-gradient(circle at 50% 45%, rgba(80, 48, 25, 0.1), transparent 11rem);
    opacity: 0.7;
  }

  .rn-story-page {
    position: absolute;
    inset: 0;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    grid-template-rows: minmax(0, 1fr);
    gap: clamp(22px, 5vw, 58px);
    align-items: stretch;
    padding: clamp(28px, 5vw, 70px);
    box-sizing: border-box;
    opacity: 0;
    transform: translateX(28px) scale(0.985);
    transition: opacity 280ms ease, transform 280ms ease;
    pointer-events: none;
  }

  .rn-story-page.is-active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
  }

  .rn-book.is-swiping .rn-story-page {
    transition-duration: 160ms;
  }

  .rn-page-art {
    display: grid;
    place-items: center;
    height: 100%;
    min-width: 0;
    min-height: 0;
  }

  .rn-image-frame {
    position: relative;
    overflow: hidden;
    width: min(100%, 560px);
    height: min(52vh, 460px);
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: auto;
    border: 12px solid #fff8e9;
    border-radius: 6px;
    background:
      radial-gradient(circle at center, rgba(255, 250, 241, 0.8), rgba(226, 208, 180, 0.72)),
      #eadbc4;
    box-shadow: 0 18px 42px rgba(57, 36, 21, 0.22);
  }

  .rn-image-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(255, 250, 241, 0.42);
  }

  .rn-page-copy {
    position: relative;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    align-content: stretch;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: clamp(8px, 2vw, 22px);
    padding-top: clamp(82px, 12vh, 132px);
  }

  .rn-page-kicker {
    grid-row: 1;
    margin: 0 0 14px;
    color: var(--rn-accent);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .rn-page-title {
    grid-row: 2;
    margin: 0 0 16px;
    color: var(--rn-ink);
    font-size: clamp(2.0rem, 3vw, 3.2rem);
    line-height: 0.98;
    font-weight: 700;
    letter-spacing: 0;
    overflow-wrap: anywhere;
  }

  .rn-page-text {
    grid-row: 3;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    color: var(--rn-ink);
    font-size: clamp(1.2rem, 1.8vw, 1.85rem);
    line-height: 1.48;
    overflow-wrap: anywhere;
  }

  .rn-page-text p {
    margin: 0 0 0.92em;
  }

  .rn-page-text p:last-child {
    margin-bottom: 0;
  }

  .rn-page-text blockquote {
    margin: 0 0 1em;
    padding: 0 0 0 18px;
    border-left: 3px solid rgba(156, 84, 46, 0.48);
    color: #4b382c;
    font-style: italic;
  }

  .rn-story-sentence,
  .rn-page-title {
    border-radius: 5px;
    transition: background-color 180ms ease, box-shadow 180ms ease;
  }

  .rn-story-sentence.is-narrating,
  .rn-page-title.is-narrating {
    background: rgba(255, 220, 126, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 220, 126, 0.28);
  }

  .rn-page-number {
    grid-row: 4;
    align-self: flex-end;
    justify-self: end;
    margin-top: 0;
    padding-top: 18px;
    color: rgba(65, 43, 28, 0.55);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.78rem;
  }

  .rn-book-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
  }

  .rn-book-button {
    min-width: 112px;
    border: 1px solid rgba(83, 55, 34, 0.22);
    border-radius: 999px;
    padding: 12px 18px;
    background: rgba(255, 250, 241, 0.76);
    color: var(--rn-ink);
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    transition: transform 160ms ease, background 160ms ease;
  }

  .rn-narration-button {
    min-width: 96px;
    padding: 9px 14px;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .rn-book-button:hover,
  .rn-book-button:focus-visible {
    background: #fffaf1;
    transform: translateY(-1px);
  }

  .rn-book-button:disabled {
    cursor: default;
    opacity: 0.38;
    transform: none;
  }

  .rn-book-dots {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    min-width: 0;
  }

  .rn-book-dot {
    width: 8px;
    height: 8px;
    border: 0;
    border-radius: 50%;
    background: rgba(76, 52, 35, 0.28);
    padding: 0;
    cursor: pointer;
  }

  .rn-book-dot.is-active {
    width: 24px;
    border-radius: 999px;
    background: var(--rn-accent-2);
  }

  @media (max-width: 760px) {
    .rn-storybook {
      min-height: 100svh;
      padding: 10px 8px 12px;
    }

    .rn-book {
      height: calc(100svh - 118px);
      min-height: 620px;
      border-radius: 8px;
    }

    .rn-book::before {
      background: none;
    }

    .rn-story-page {
      position: absolute;
      display: grid;
      grid-template-columns: 1fr;
      grid-template-rows: minmax(210px, 38%) minmax(0, 1fr);
      gap: 20px;
      min-height: 0;
      padding: 20px 18px 18px;
    }

    .rn-story-page.is-active {
      display: grid;
    }

    .rn-image-frame {
      width: 100%;
      height: 100%;
      max-height: none;
      border-width: 8px;
      aspect-ratio: auto;
    }

    .rn-page-copy {
      display: grid;
      grid-template-rows: auto auto minmax(0, 1fr) auto;
      align-content: stretch;
      min-height: 0;
      padding: 0 8px 0;
    }

    .rn-page-art {
      height: 100%;
      min-height: 0;
    }

    .rn-page-title {
      font-size: clamp(1.8rem, 4vw, 2.0rem);
    }

    .rn-page-text {
      min-height: 0;
      max-height: 100%;
      font-size: clamp(1.12rem, 4vw, 1.45rem);
      line-height: 1.5;
    }

    .rn-page-number {
      align-self: end;
      justify-self: end;
      margin-top: 8px;
      padding-top: 0;
    }

    .rn-book-topbar {
      align-items: flex-start;
      flex-wrap: wrap;
      font-size: 0.68rem;
    }

    /* .rn-book-actions {
      flex-direction: row-reverse;
      align-items: flex-end;
      gap: 8px;
      margin-left: auto;
    } */

    .rn-book-controls {
      gap: 10px;
    }

    .rn-book-button {
      min-width: 86px;
      padding: 11px 13px;
    }

    .rn-book-dots {
      gap: 5px;
    }
  }

