/* Scoped to the prebuilt reader; do not change the instant reader layout. */
html.prebuilt-page, .prebuilt-page body { min-width: 0; }
.prebuilt-page .reading-pane, .prebuilt-page .character-pane { min-width: 0; }
.prebuilt-page .playback-panel p { overflow-wrap: anywhere; margin: 9px 0; }
.prebuilt-page .playback-panel select, .prebuilt-page #restart {
  color: var(--text); background: var(--panel-raised); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 8px;
}
/* Foreground avatar over a single full-width reading surface.
   The transparent stage never intercepts scrolling or sentence clicks. */
.prebuilt-page .vtuber-shell { display: block; position: relative; height: 100dvh; }
.prebuilt-page .reading-pane { height: 100%; width: 100%; border: 0; padding: 24px clamp(16px, 3vw, 48px) 160px; }
.prebuilt-page .character-pane { display: block; position: fixed; z-index: 5; right: 0; bottom: 0; width: min(62vw, 680px); height: 82dvh; background: transparent; pointer-events: none; }
.prebuilt-page .live2d-stage { width: 100%; height: 100%; background: transparent; pointer-events: none; }
.prebuilt-page .playback-panel { position: fixed; z-index: 6; left: 16px; bottom: max(12px, env(safe-area-inset-bottom)); width: 300px; max-width: calc(100vw - 32px); max-height: 65dvh; overflow-y: auto; pointer-events: auto; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: rgba(35, 33, 31, .94); box-shadow: 0 4px 24px #0005; }
.prebuilt-page .reader-settings summary { cursor: pointer; padding: 10px 4px 2px; font-size: 13px; color: var(--muted); }
.prebuilt-page body:has(#hide-character:checked) .live2d-stage { visibility: hidden; }
@media (max-width: 760px) {
  .prebuilt-page .reading-pane { padding: 16px 16px 150px; }
  .prebuilt-page .character-pane { width: 65vw; height: 55dvh; }
  .prebuilt-page .playback-panel { width: 230px; left: 10px; max-height: 60dvh; }
}
.prebuilt-page #mouth-strength { max-width: 55%; vertical-align: middle; }
.prebuilt-page .chapter-navigation { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.prebuilt-page .chapter-navigation select { flex: 1; min-width: 100px; max-width: 100%; }
.prebuilt-page .chapter-navigation button, .prebuilt-page .chapter-navigation select { color: var(--text); background: var(--panel-raised); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.prebuilt-page .chapter-navigation button:disabled { opacity: .4; }
@media (max-width: 760px) {
  .prebuilt-page .sentences { font-size: 18px; line-height: 1.85; }
  .prebuilt-page .chapter-header { padding: 20px 0 16px; }
}
