/*
 * Livro DIVAR 360 — camada final de física e responsividade.
 * Mantido separado para não depender da ordem dos estilos legados de perfil.
 */

.storybook-book {
  --storybook-paper: #fffaf0;
  --storybook-turn-ms: 900ms;
  isolation: isolate;
}

.storybook-book[aria-busy="true"] .storybook-page-corner,
.storybook-book[aria-busy="true"] .storybook-bookmark {
  pointer-events: none;
}

/* A folha móvel ocupa uma página inteira. Nunca comprime o conteúdo em uma faixa. */
.storybook-turn-sheet {
  position: absolute;
  z-index: 18;
  top: 13px;
  bottom: 13px;
  left: calc(50% + 1px);
  width: calc(50% - 14px);
  overflow: hidden;
  border-radius: 0 14px 14px 0;
  transform: none;
  transform-origin: left center;
  backface-visibility: hidden;
  background: var(--storybook-paper);
  box-shadow: 0 10px 24px rgba(48, 29, 19, .16);
  pointer-events: none;
  will-change: transform, opacity, filter;
}

.storybook-turn-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 5vw, 72px);
  overflow: hidden;
  color: #33264c;
  text-align: center;
  background:
    repeating-linear-gradient(0deg, rgba(105, 73, 43, .026) 0 1px, transparent 1px 4px),
    var(--storybook-paper);
  box-shadow: inset 18px 0 24px rgba(75, 52, 39, .12);
  backface-visibility: hidden;
  will-change: opacity;
}

.storybook-turn-face-back {
  display: none;
}

.storybook-book.is-past-spine .storybook-turn-face {
  visibility: hidden !important;
}

.storybook-turn-face .storybook-page-number {
  position: absolute;
  right: 30px;
  bottom: 22px;
}

.storybook-turn-face h3 {
  max-width: 92%;
  margin: 10px 0 14px;
  font: 700 clamp(30px, 3.5vw, 54px)/.98 Georgia, serif;
}

.storybook-turn-face > p:not(.storybook-kicker) {
  max-width: 390px;
  font: 400 clamp(15px, 1.3vw, 19px)/1.6 Georgia, serif;
}

.storybook-book.is-turning-forward .storybook-turn-sheet {
  display: block !important;
  animation: storyPageSweepForward var(--storybook-turn-ms) cubic-bezier(.72, 0, .22, 1) both;
}

.storybook-book.is-turning-forward .storybook-turn-face-front,
.storybook-book.is-turning-backward .storybook-turn-face-front {
  animation: storyTurnFrontVisibility var(--storybook-turn-ms) linear both !important;
}

.storybook-book.is-turning-backward .storybook-turn-sheet {
  display: block !important;
  left: 13px;
  border-radius: 14px 0 0 14px;
  transform-origin: right center;
  animation: storyPageSweepBackward var(--storybook-turn-ms) cubic-bezier(.72, 0, .22, 1) both;
}

.storybook-book.turn-from-top .storybook-turn-sheet {
  transform-origin: left top;
}

.storybook-book.turn-from-top.is-turning-backward .storybook-turn-sheet {
  transform-origin: right top;
}

@keyframes storyPageSweepForward {
  0% {
    left: calc(50% + 1px);
    width: calc(50% - 14px);
    border-radius: 0 14px 14px 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transform: translateX(0) skewY(0);
    filter: brightness(1);
    opacity: 1;
  }
  46% {
    left: 18%;
    width: 74%;
    border-radius: 10px 14px 14px 10px;
    clip-path: polygon(8% 0, 100% 0, 96% 100%, 0 96%);
    transform: translateX(-2%) skewY(-.6deg);
    filter: brightness(.94);
    opacity: 1;
  }
  54% {
    left: 10%;
    width: 72%;
    clip-path: polygon(18% 0, 100% 4%, 94% 100%, 0 92%);
    transform: translateX(-6%) skewY(.5deg);
    filter: brightness(.9);
    opacity: .78;
  }
  100% {
    left: 13px;
    width: calc(50% - 14px);
    border-radius: 14px 0 0 14px;
    clip-path: polygon(100% 0, 100% 0, 92% 100%, 86% 100%);
    transform: translateX(-22%) skewY(0);
    filter: brightness(.97);
    opacity: 0;
  }
}

@keyframes storyPageSweepBackward {
  0% {
    left: 13px;
    width: calc(50% - 14px);
    border-radius: 14px 0 0 14px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transform: translateX(0) skewY(0);
    filter: brightness(.97);
    opacity: 1;
  }
  46% {
    left: 8%;
    width: 74%;
    border-radius: 14px 10px 10px 14px;
    clip-path: polygon(0 0, 92% 0, 100% 96%, 4% 100%);
    transform: translateX(2%) skewY(.6deg);
    filter: brightness(.9);
    opacity: 1;
  }
  54% {
    left: 18%;
    width: 72%;
    clip-path: polygon(0 4%, 82% 0, 100% 92%, 6% 100%);
    transform: translateX(6%) skewY(-.5deg);
    filter: brightness(.94);
    opacity: .78;
  }
  100% {
    left: calc(50% + 1px);
    width: calc(50% - 14px);
    border-radius: 0 14px 14px 0;
    clip-path: polygon(0 0, 0 0, 14% 100%, 8% 100%);
    transform: translateX(22%) skewY(0);
    filter: brightness(1);
    opacity: 0;
  }
}

@keyframes storyTurnFrontVisibility {
  0%, 34% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Capa com frente e guarda próprias: ela não pode atravessar a folha. */
.storybook-front-cover {
  z-index: 22;
  overflow: visible;
  color: #fff8df;
  background: transparent !important;
  box-shadow: none !important;
  transform-style: preserve-3d;
  animation-duration: 780ms !important;
}

.storybook-front-cover::before,
.storybook-front-cover::after {
  content: none !important;
}

.storybook-front-cover-face,
.storybook-front-cover-inside {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 56px;
  overflow: hidden;
  border: 2px solid #c69549;
  border-radius: 0 15px 15px 0;
  backface-visibility: hidden;
}

.storybook-front-cover-face {
  background:
    linear-gradient(135deg, rgba(255,255,255,.12), transparent 34%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 2px, transparent 2px 7px),
    #583420;
  box-shadow: inset 12px 0 22px rgba(19, 8, 3, .38), inset -8px 0 0 rgba(242, 188, 92, .12);
}

.storybook-front-cover-inside {
  color: #583420;
  background:
    repeating-linear-gradient(0deg, rgba(105, 73, 43, .025) 0 1px, transparent 1px 4px),
    #f4e6c8;
  box-shadow: inset -18px 0 28px rgba(68, 42, 21, .14);
  transform: rotateY(180deg);
}

.storybook-front-cover-face span,
.storybook-front-cover-inside strong {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.storybook-front-cover-face small,
.storybook-front-cover-inside small {
  font: 400 16px/1.5 Georgia, serif;
  text-align: center;
}

.storybook-front-cover-face strong {
  max-width: 94%;
  font: 700 clamp(38px, 4vw, 62px)/.95 Georgia, serif;
  text-align: center;
}

.storybook-front-cover-face i {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 238, 189, .62);
  border-radius: 50%;
  color: #ffe780;
  font-style: normal;
}

.storybook-book.is-opening .storybook-front-cover {
  animation-duration: 780ms !important;
}

.storybook-book.is-closing .storybook-front-cover {
  animation-duration: 780ms !important;
}

/* Marcador alinhado à lombada; no mobile ele migra para o canto da folha. */
.storybook-bookmark {
  z-index: 24;
  grid-column: 1 / -1;
  justify-self: center;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
}

.storybook-close {
  z-index: 32;
}

/* Faixas laterais inteiras detectam a intenção; só a ponta da folha é desenhada. */
.storybook-controls {
  position: absolute;
  z-index: 26;
  inset: 13px;
  display: block;
  pointer-events: none;
}

.storybook-page-corner {
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(58px, 7vw, 86px);
  min-width: 44px;
  height: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  pointer-events: auto;
}

.storybook-page-corner-back { left: 0; }
.storybook-page-corner-next { right: 0; }

.storybook-page-corner::before,
.storybook-page-corner::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 64px;
  height: 64px;
  opacity: 0;
  transition: opacity 150ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}

.storybook-page-corner-next::before {
  right: 0;
  border-radius: 48px 0 0;
  background: linear-gradient(135deg, rgba(255,250,240,0) 45%, #e8d6b8 46% 69%, #fffaf0 70%);
  box-shadow: -8px -8px 16px rgba(73, 48, 26, .12);
  transform: translate(28px, 28px) scale(.58);
}

.storybook-page-corner-back::before {
  left: 0;
  border-radius: 0 48px 0 0;
  background: linear-gradient(225deg, rgba(255,250,240,0) 45%, #e8d6b8 46% 69%, #fffaf0 70%);
  box-shadow: 8px -8px 16px rgba(73, 48, 26, .12);
  transform: translate(-28px, 28px) scale(.58);
}

.storybook-book.has-next-page:not(.is-suppressing-turn-preview) .storybook-page-corner-next:hover::before,
.storybook-book.is-previewing-forward:not(.is-suppressing-turn-preview) .storybook-page-corner-next::before,
.storybook-book.has-previous-page:not(.is-suppressing-turn-preview) .storybook-page-corner-back:hover::before,
.storybook-book.is-previewing-backward:not(.is-suppressing-turn-preview) .storybook-page-corner-back::before {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

.storybook-book.turn-from-top .storybook-page-corner::before {
  top: 0;
  bottom: auto;
  transform: translateY(-28px) scale(.58) rotate(180deg);
}

.storybook-book.turn-from-top .storybook-page-corner:hover::before {
  transform: translateY(0) scale(1) rotate(180deg);
}

@media (max-width: 720px) {
  .storybook-shell {
    width: min(100%, 520px);
  }

  .storybook-book {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    aspect-ratio: 3 / 4.3;
    padding: 13px !important;
    box-sizing: border-box;
  }

  .storybook-left-page {
    display: none !important;
  }

  .storybook-right-page {
    position: relative !important;
    inset: auto !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0;
    padding: 0;
    border-radius: 13px;
  }

  .storybook-page-stage,
  .storybook-page {
    min-height: 100%;
    height: 100%;
    min-width: 0;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
  }

  .storybook-page-stage {
    position: relative !important;
    inset: auto !important;
  }

  .storybook-page {
    position: absolute !important;
    inset: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 44px 22px 34px;
    overflow: hidden;
    text-align: center;
    transform: none !important;
  }

  .storybook-page h3 {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    font-size: clamp(1.9rem, 9.5vw, 2.35rem);
    line-height: 1.03;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .storybook-final-page h3 {
    width: min(260px, 74vw);
    max-width: min(260px, 74vw);
    font-size: 1.75rem;
    line-height: 1.02;
  }

  .storybook-page > p:last-of-type {
    width: 100%;
    max-width: 31ch;
    margin-inline: auto;
  }

  /* O miolo legado preserva a meia coluna da capa no breakpoint compacto. */
  .storybook-page > :not(.storybook-page-number),
  .storybook-blank-page::after {
    position: relative;
    left: 18vw;
  }

  .storybook-turn-sheet,
  .storybook-book.is-turning-backward .storybook-turn-sheet {
    top: 13px;
    right: 13px;
    bottom: 13px;
    left: 13px;
    grid-column: 1 / -1;
    grid-row: 1;
    width: auto;
    border-radius: 13px;
  }

  .storybook-book.is-turning-forward .storybook-turn-sheet {
    animation-name: storyPageSweepForwardMobile;
  }

  .storybook-book.is-turning-backward .storybook-turn-sheet {
    animation-name: storyPageSweepBackwardMobile;
  }

  .storybook-front-cover {
    inset: 13px;
    grid-column: 1 / -1;
    grid-row: 1;
    width: auto;
    border-radius: 13px;
    transform-origin: left center;
  }

  .storybook-front-cover-face,
  .storybook-front-cover-inside {
    border-radius: 13px;
    padding: 32px;
  }

  .storybook-bookmark {
    grid-column: auto;
    justify-self: auto;
    top: 0;
    left: auto !important;
    right: 18px !important;
    transform: none;
  }

  .storybook-page-corner {
    width: 68px;
  }

  .storybook-turn-face {
    padding: 32px 24px;
  }
}

@keyframes storyPageSweepForwardMobile {
  0% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); transform: translateX(0); opacity: 1; }
  48% { clip-path: polygon(14% 0, 100% 0, 88% 100%, 0 94%); transform: translateX(-22%); opacity: .96; }
  62% { clip-path: polygon(28% 0, 100% 5%, 76% 100%, 0 88%); transform: translateX(-48%); opacity: .66; }
  100% { clip-path: polygon(100% 0, 100% 0, 92% 100%, 88% 100%); transform: translateX(-100%); opacity: 0; }
}

@keyframes storyPageSweepBackwardMobile {
  0% { clip-path: polygon(0 0, 0 0, 12% 100%, 8% 100%); transform: translateX(100%); opacity: 0; }
  38% { clip-path: polygon(0 5%, 72% 0, 100% 88%, 24% 100%); transform: translateX(48%); opacity: .66; }
  52% { clip-path: polygon(0 0, 86% 0, 100% 94%, 12% 100%); transform: translateX(22%); opacity: .96; }
  100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); transform: translateX(0); opacity: 1; }
}

@media (max-width: 920px) and (orientation: landscape) {
  .storybook-dialog {
    padding: 10px;
  }

  .storybook-shell {
    width: min(94vw, 760px);
    max-height: 96dvh;
  }

  .storybook-reading-status {
    margin-bottom: 6px;
  }

  .storybook-book {
    width: 100%;
    max-height: calc(96dvh - 54px);
    aspect-ratio: 1.48 / 1;
  }

  .storybook-right-page {
    font-size: 13px;
  }

  .storybook-page h3,
  .storybook-turn-face h3 {
    font-size: clamp(26px, 5vw, 38px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .storybook-turn-sheet,
  .storybook-front-cover,
  .storybook-book {
    animation-duration: 1ms !important;
  }
}

/* Conteúdo útil já na abertura; a capa deixa de ocupar uma tela vazia. */
.storybook-page-visual {
  width: min(100%, 380px);
  max-height: 190px;
  display: block;
  margin-top: 22px;
  border: 1px solid rgba(91, 62, 101, .14);
  border-radius: 14px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 9px 18px rgba(53, 31, 64, .12);
}

.storybook-page:has(.storybook-page-visual) {
  padding-top: 22px;
}

.storybook-page:has(.storybook-page-visual) h3 {
  font-size: clamp(1.65rem, 3vw, 2.5rem);
}

.storybook-page:has(.storybook-page-visual)::after {
  display: none;
}

@media (max-width: 720px) {
  .storybook-page-visual {
    max-height: 145px;
    margin-top: 14px;
  }

  .storybook-page:has(.storybook-page-visual) {
    justify-content: center;
    padding: 34px 16px 28px;
  }
}

/* DIVAR 360: leitura previsível, sem retomada ou dobra sobreposta. */
.learning-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}

.learning-card-actions .learning-card-book-action,
.learning-card-actions .learning-card-game-action {
  display: inline-flex;
  box-sizing: border-box;
  width: auto;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 !important;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: .72rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.learning-card-actions .learning-card-book-action {
  background: #fff;
  color: #39235f;
}

.learning-card-actions .learning-card-book-action:hover,
.learning-card-actions .learning-card-book-action:focus-visible {
  background: #fff7fb;
  text-decoration: none;
}

.storybook-book.is-cover-only {
  grid-template-columns: minmax(0, 1fr) !important;
}

.storybook-book.is-cover-only .storybook-left-page {
  display: grid !important;
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  width: min(100%, 560px) !important;
  max-width: 560px !important;
  height: 100% !important;
  justify-self: center;
  border-radius: 14px !important;
}

.storybook-book.is-cover-only .storybook-right-page {
  display: none !important;
}

.storybook-book.is-cover-spread .storybook-left-page {
  display: block !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: auto !important;
  max-width: none !important;
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 241, 194, .34), transparent 26%),
    repeating-linear-gradient(92deg, rgba(89, 54, 31, .025) 0 2px, transparent 2px 7px),
    linear-gradient(145deg, #f2e1bd, #d8bb8c) !important;
  box-shadow: inset -24px 0 36px rgba(76, 46, 28, .15) !important;
}

.storybook-book.is-cover-spread .storybook-right-page {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: auto !important;
}

.storybook-book.is-cover-spread .storybook-left-page::before,
.storybook-book.is-cover-spread .storybook-left-page::after {
  inset: 20px !important;
  width: auto !important;
  height: auto !important;
  border: 1px solid rgba(123, 79, 42, .34) !important;
  border-radius: 12px 3px 3px 12px !important;
  opacity: 1 !important;
}

.storybook-book.is-cover-spread .storybook-left-page::after {
  inset: 28px !important;
  border-style: double !important;
  border-width: 3px !important;
  opacity: .58 !important;
}

/* A capa decorativa antiga duplicava a capa editorial durante a abertura. */
.storybook-front-cover,
.storybook-turn-sheet {
  display: none !important;
}

.storybook-page-corner {
  top: 50% !important;
  bottom: auto !important;
  width: 46px !important;
  min-width: 46px !important;
  height: 64px !important;
  min-height: 64px !important;
  max-height: 64px !important;
  overflow: hidden !important;
  border: 1px solid rgba(78, 51, 112, .26) !important;
  border-radius: 16px !important;
  padding: 0 !important;
  background: rgba(255, 250, 240, .92) !important;
  box-shadow: 0 8px 20px rgba(47, 26, 73, .16) !important;
  color: #4b2d70 !important;
  opacity: .9 !important;
  transform: translateY(-50%) !important;
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

.storybook-page-corner-back { left: 8px; }
.storybook-page-corner-next { right: 8px; }

.storybook-page-corner::before {
  content: none !important;
}

.storybook-page-corner::after {
  content: none !important;
}

.storybook-page-corner > span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: currentColor;
  font: 900 2rem/1 Arial, sans-serif;
}

.storybook-page-corner:hover,
.storybook-page-corner:focus-visible {
  background: #fff;
  opacity: 1;
  transform: translateY(-50%) scale(1.04) !important;
}

.storybook-page-corner:disabled {
  opacity: 0 !important;
  pointer-events: none;
}

.storybook-book.is-page-entering-forward .storybook-page.is-active,
.storybook-book.is-page-entering-forward .storybook-previous-page:not([hidden]) {
  animation: storyPageEnterForward 260ms ease-out both;
}

.storybook-book.is-page-entering-backward .storybook-page.is-active,
.storybook-book.is-page-entering-backward .storybook-previous-page:not([hidden]) {
  animation: storyPageEnterBackward 260ms ease-out both;
}

@keyframes storyPageEnterForward {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes storyPageEnterBackward {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 720px) {
  .learning-card-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
    width: 100%;
    gap: 6px;
  }

  .learning-card-actions .learning-card-book-action,
  .learning-card-actions .learning-card-game-action {
    width: 100%;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    padding-inline: 6px;
    font-size: .67rem;
  }

  .storybook-book.is-cover-only .storybook-left-page {
    width: 100% !important;
    max-width: none !important;
  }

  .storybook-page {
    padding-inline: 52px !important;
  }

  .storybook-page > :not(.storybook-page-number),
  .storybook-blank-page::after {
    left: 0 !important;
  }

  .storybook-page h3 {
    max-width: 100% !important;
    font-size: clamp(1.65rem, 8vw, 2.05rem) !important;
    overflow-wrap: normal;
  }

  .storybook-page-corner {
    width: 44px !important;
    min-width: 44px !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    border-radius: 14px;
  }

  .storybook-page-corner-back { left: 4px; }
  .storybook-page-corner-next { right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .storybook-book.is-page-entering-forward .storybook-page.is-active,
  .storybook-book.is-page-entering-forward .storybook-previous-page:not([hidden]),
  .storybook-book.is-page-entering-backward .storybook-page.is-active,
  .storybook-book.is-page-entering-backward .storybook-previous-page:not([hidden]) {
    animation: none;
  }
}

/* v136: capa física real e virada iniciada pela dobra inferior. */
.storybook-book.is-cover-only .storybook-left-page,
.storybook-book.is-cover-only .storybook-right-page,
.storybook-book.is-cover-only .storybook-bookmark {
  visibility: hidden !important;
}

.storybook-front-cover {
  position: absolute !important;
  z-index: 22 !important;
  top: 13px !important;
  right: auto !important;
  bottom: 13px !important;
  left: 50% !important;
  display: block !important;
  width: min(560px, calc(100% - 26px)) !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 10px 20px 20px 10px !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(0) perspective(1800px) rotateY(-179deg);
  transform-origin: left center;
  transform-style: preserve-3d;
  backface-visibility: visible;
  will-change: transform, opacity, filter;
}

.storybook-book.is-cover-only .storybook-front-cover,
.storybook-book.is-opening-cover .storybook-front-cover,
.storybook-book.is-closing-cover .storybook-front-cover {
  opacity: 1;
  visibility: visible;
}

/* A entrada do modal só aproxima o livro. A capa permanece fechada. */
.storybook-book.is-cover-only.is-opening .storybook-front-cover,
.storybook-book.is-cover-only:not(.is-opening-cover) .storybook-front-cover {
  animation: none !important;
  transform: translateX(-50%) perspective(1800px) rotateY(0deg);
}

.storybook-front-cover-face,
.storybook-front-cover-inside {
  border: 2px solid #c99b4e !important;
  border-radius: 10px 20px 20px 10px !important;
  padding: clamp(34px, 6vw, 68px) !important;
  box-shadow:
    inset 0 0 0 6px rgba(255, 230, 166, .08),
    inset 0 0 0 10px rgba(30, 12, 8, .26),
    inset 14px 0 26px rgba(25, 9, 5, .36),
    0 24px 44px rgba(20, 10, 28, .32) !important;
}

.storybook-front-cover-face::before,
.storybook-front-cover-face::after,
.storybook-front-cover-inside::before,
.storybook-front-cover-inside::after {
  position: absolute;
  border: 1px solid rgba(255, 215, 125, .48);
  border-radius: 7px 16px 16px 7px;
  content: "";
  pointer-events: none;
}

.storybook-front-cover-face::before,
.storybook-front-cover-inside::before { inset: 19px; }

.storybook-front-cover-face::after,
.storybook-front-cover-inside::after {
  inset: 28px;
  border-width: 3px;
  border-style: double;
  opacity: .58;
}

.storybook-front-cover-face {
  background:
    radial-gradient(circle at 70% 17%, rgba(255, 222, 142, .17), transparent 23%),
    repeating-linear-gradient(93deg, rgba(255,255,255,.024) 0 2px, transparent 2px 7px),
    linear-gradient(145deg, #72452d, #4b281d 56%, #281416) !important;
}

.storybook-front-cover-face > span {
  font-size: clamp(.85rem, 1.4vw, 1.05rem) !important;
  letter-spacing: .22em !important;
}

.storybook-front-cover-face > strong {
  max-width: 10ch !important;
  font-size: clamp(2.8rem, 6vw, 5rem) !important;
  letter-spacing: -.025em;
}

.storybook-front-cover-face > i {
  width: 62px !important;
  height: 62px !important;
  font-size: 1.35rem;
}

.storybook-book.is-opening-cover .storybook-front-cover {
  animation: storyLeatherCoverOpen 900ms cubic-bezier(.42, 0, .58, 1) both !important;
}

.storybook-book.is-closing-cover .storybook-front-cover {
  animation: storyLeatherCoverClose 900ms cubic-bezier(.42, 0, .58, 1) both !important;
}

.storybook-book.is-opening-cover .storybook-front-cover-face {
  animation: storyCoverFrontOut 900ms linear both !important;
}

.storybook-book.is-opening-cover .storybook-front-cover-inside {
  animation: storyCoverInsideIn 900ms linear both !important;
}

.storybook-book.is-closing-cover .storybook-front-cover-face {
  animation: storyCoverFrontIn 900ms linear both !important;
}

.storybook-book.is-closing-cover .storybook-front-cover-inside {
  animation: storyCoverInsideOut 900ms linear both !important;
}

@keyframes storyLeatherCoverOpen {
  0% {
    opacity: 1;
    transform: translateX(-50%) perspective(1800px) rotateY(0deg);
    filter: drop-shadow(0 20px 22px rgba(19, 8, 25, .35));
  }
  48% {
    opacity: 1;
    transform: translateX(-24%) perspective(1800px) rotateY(-86deg);
    filter: drop-shadow(-28px 24px 20px rgba(19, 8, 25, .42));
  }
  52% {
    opacity: 1;
    transform: translateX(-20%) perspective(1800px) rotateY(-94deg);
  }
  99% {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) perspective(1800px) rotateY(-179deg);
  }
  100% {
    opacity: 0;
    visibility: hidden;
    transform: translateX(0) perspective(1800px) rotateY(-180deg);
  }
}

@keyframes storyLeatherCoverClose {
  0% {
    opacity: 1;
    transform: translateX(0) perspective(1800px) rotateY(-179deg);
  }
  48% {
    transform: translateX(-20%) perspective(1800px) rotateY(-94deg);
    filter: drop-shadow(-28px 24px 20px rgba(19, 8, 25, .42));
  }
  52% { transform: translateX(-24%) perspective(1800px) rotateY(-86deg); }
  100% {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) perspective(1800px) rotateY(0deg);
  }
}

@keyframes storyCoverFrontOut {
  0%, 49% { opacity: 1; visibility: visible; }
  51%, 100% { opacity: 0; visibility: hidden; }
}

@keyframes storyCoverInsideIn {
  0%, 49% { opacity: 0; visibility: hidden; }
  51%, 100% { opacity: 1; visibility: visible; }
}

@keyframes storyCoverFrontIn {
  0%, 49% { opacity: 0; visibility: hidden; }
  51%, 100% { opacity: 1; visibility: visible; }
}

@keyframes storyCoverInsideOut {
  0%, 49% { opacity: 1; visibility: visible; }
  51%, 100% { opacity: 0; visibility: hidden; }
}

/* A área clicável continua confortável, mas somente a dobra da folha aparece. */
.storybook-page-corner {
  top: auto !important;
  bottom: 13px !important;
  width: 92px !important;
  min-width: 60px !important;
  height: 92px !important;
  min-height: 60px !important;
  max-height: none !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: transparent !important;
  opacity: 1 !important;
  transform: none !important;
}

.storybook-page-corner > span { display: none !important; }

.storybook-page-corner-back { left: 13px !important; }
.storybook-page-corner-next { right: 13px !important; }

.storybook-book.is-cover-only .storybook-page-corner-next {
  right: max(13px, calc(50% - 280px)) !important;
}

.storybook-page-corner::before,
.storybook-page-corner::after {
  position: absolute !important;
  right: 0;
  bottom: 0;
  display: block;
  width: 72px;
  height: 72px;
  content: "" !important;
  opacity: .88;
  pointer-events: none;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), opacity 160ms ease !important;
  transform-origin: right bottom;
}

.storybook-page-corner::before {
  border-radius: 58px 0 0;
  background: linear-gradient(135deg, transparent 45%, #ddc59d 46% 68%, #fffaf0 69%);
  box-shadow: -10px -9px 18px rgba(65, 39, 24, .2);
  clip-path: polygon(18% 100%, 100% 18%, 100% 100%);
  transform: translate(31px, 31px) scale(.56);
}

.storybook-page-corner::after {
  width: 42px;
  height: 42px;
  border-right: 2px solid rgba(89, 48, 32, .28);
  border-bottom: 2px solid rgba(89, 48, 32, .28);
  transform: translate(14px, 14px);
}

.storybook-page-corner-back::before,
.storybook-page-corner-back::after {
  right: auto;
  left: 0;
  transform-origin: left bottom;
}

.storybook-page-corner-back::before {
  border-radius: 0 58px 0 0;
  background: linear-gradient(225deg, transparent 45%, #ddc59d 46% 68%, #fffaf0 69%);
  clip-path: polygon(0 18%, 82% 100%, 0 100%);
  transform: translate(-31px, 31px) scale(.56);
}

.storybook-page-corner-back::after {
  border-right: 0;
  border-left: 2px solid rgba(89, 48, 32, .28);
  transform: translate(-14px, 14px);
}

.storybook-book.is-cover-only .storybook-page-corner-next::before {
  background: linear-gradient(135deg, transparent 45%, #ae7a43 46% 68%, #71432c 69%);
  box-shadow: -10px -9px 18px rgba(22, 8, 7, .38);
}

.storybook-book.is-cover-only .storybook-page-corner-next::after {
  border-color: rgba(255, 221, 143, .46);
}

.storybook-book.has-next-page:not(.is-suppressing-turn-preview) .storybook-page-corner-next::before,
.storybook-book.has-next-page:not(.is-suppressing-turn-preview) .storybook-page-corner-next::after,
.storybook-book.has-previous-page:not(.is-suppressing-turn-preview) .storybook-page-corner-back::before,
.storybook-book.has-previous-page:not(.is-suppressing-turn-preview) .storybook-page-corner-back::after {
  animation: none !important;
}

.storybook-page-corner:focus-visible::before,
.storybook-book.is-previewing-forward .storybook-page-corner-next::before,
.storybook-book.is-previewing-backward .storybook-page-corner-back::before {
  opacity: 1;
  animation: none !important;
  transform: translate(0, 0) scale(1) !important;
}

.storybook-page-corner:focus-visible::after {
  opacity: 1;
  animation: none !important;
  transform: translate(0, 0) !important;
}

.storybook-page-corner:focus-visible {
  outline: 3px solid #ffd852 !important;
  outline-offset: -8px;
}

@media (hover: hover) and (pointer: fine) {
  .storybook-page-corner:hover::before {
    opacity: 1;
    animation: none !important;
    transform: translate(0, 0) scale(1) !important;
  }

  .storybook-page-corner:hover::after {
    opacity: 1;
    animation: none !important;
    transform: translate(0, 0) !important;
  }
}

/* v139: folha física de meia largura, com frente e verso reais. */
.storybook-turn-sheet {
  position: absolute !important;
  z-index: 20 !important;
  top: 13px !important;
  bottom: 13px !important;
  right: auto !important;
  left: 50% !important;
  display: none !important;
  width: calc(50% - 13px) !important;
  overflow: visible !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none;
  transform: rotateY(0deg);
  transform-origin: left center !important;
  transform-style: preserve-3d !important;
  -webkit-transform-style: preserve-3d !important;
  will-change: transform, filter;
}

.storybook-turn-sheet[hidden] {
  display: none !important;
}

.storybook-turn-face {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  overflow: hidden !important;
  border: 1px solid rgba(148, 115, 82, .13);
  border-radius: 3px 14px 14px 3px !important;
  background:
    radial-gradient(circle at 24% 14%, rgba(244, 194, 79, .12), transparent 28%),
    repeating-linear-gradient(0deg, rgba(105, 73, 43, .026) 0 1px, transparent 1px 4px),
    var(--storybook-paper) !important;
  box-shadow: inset 18px 0 28px rgba(75, 52, 39, .1) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  transform-style: flat !important;
  animation: none !important;
  visibility: visible !important;
}

.storybook-turn-face-front {
  transform: rotateY(0deg) translateZ(1px) !important;
}

.storybook-turn-face-back {
  display: flex !important;
  border-radius: 14px 3px 3px 14px !important;
  box-shadow: inset -18px 0 28px rgba(75, 52, 39, .1) !important;
  transform: rotateY(180deg) translateZ(1px) !important;
}

.storybook-turn-face.is-paper-back::after {
  width: 44%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(103, 76, 53, .16), transparent);
}

.storybook-book.is-turning-page-forward .storybook-turn-sheet,
.storybook-book.is-turning-page-backward .storybook-turn-sheet {
  display: block !important;
}

.storybook-book.is-turning-page-forward .storybook-turn-sheet {
  left: 50% !important;
  transform-origin: left center !important;
  animation: storyPhysicalPageForward 900ms cubic-bezier(.52, .02, .2, 1) both !important;
}

.storybook-book.is-turning-page-backward .storybook-turn-sheet {
  right: 50% !important;
  left: 13px !important;
  width: auto !important;
  transform-origin: right center !important;
  animation: storyPhysicalPageBackward 900ms cubic-bezier(.52, .02, .2, 1) both !important;
}

@keyframes storyPhysicalPageForward {
  0% { transform: rotateY(0deg) skewY(0); filter: drop-shadow(0 0 0 transparent); }
  14% { transform: rotateY(-9deg) skewY(-.35deg); filter: drop-shadow(-8px 6px 8px rgba(44, 27, 39, .14)); }
  47% { transform: rotateY(-86deg) skewY(-.7deg); filter: drop-shadow(-28px 10px 18px rgba(44, 27, 39, .3)); }
  53% { transform: rotateY(-94deg) skewY(.7deg); filter: drop-shadow(-28px 10px 18px rgba(44, 27, 39, .3)); }
  86% { transform: rotateY(-171deg) skewY(.35deg); filter: drop-shadow(-8px 6px 8px rgba(44, 27, 39, .14)); }
  100% { transform: rotateY(-180deg) skewY(0); filter: drop-shadow(0 0 0 transparent); }
}

@keyframes storyPhysicalPageBackward {
  0% { transform: rotateY(0deg) skewY(0); filter: drop-shadow(0 0 0 transparent); }
  14% { transform: rotateY(9deg) skewY(.35deg); filter: drop-shadow(8px 6px 8px rgba(44, 27, 39, .14)); }
  47% { transform: rotateY(86deg) skewY(.7deg); filter: drop-shadow(28px 10px 18px rgba(44, 27, 39, .3)); }
  53% { transform: rotateY(94deg) skewY(-.7deg); filter: drop-shadow(28px 10px 18px rgba(44, 27, 39, .3)); }
  86% { transform: rotateY(171deg) skewY(-.35deg); filter: drop-shadow(8px 6px 8px rgba(44, 27, 39, .14)); }
  100% { transform: rotateY(180deg) skewY(0); filter: drop-shadow(0 0 0 transparent); }
}

@media (max-width: 720px) {
  .storybook-front-cover {
    inset: 7px auto 7px 50% !important;
    width: calc(100% - 14px) !important;
  }

  .storybook-front-cover-face,
  .storybook-front-cover-inside {
    padding: 30px !important;
  }

  .storybook-front-cover-face > strong {
    font-size: clamp(2.5rem, 14vw, 4.1rem) !important;
  }

  .storybook-book.is-cover-only .storybook-page-corner-next,
  .storybook-page-corner-next { right: 7px !important; }
  .storybook-page-corner-back { left: 7px !important; }

  .storybook-page-corner {
    bottom: 7px !important;
    width: 82px !important;
    height: 82px !important;
  }

  .storybook-turn-sheet {
    top: 7px !important;
    right: auto !important;
    bottom: 7px !important;
    left: 7px !important;
    width: calc(100% - 14px) !important;
  }

  .storybook-book.is-turning-page-forward .storybook-turn-sheet {
    right: auto !important;
    left: 7px !important;
    width: calc(100% - 14px) !important;
    transform-origin: left center !important;
  }

  .storybook-book.is-turning-page-backward .storybook-turn-sheet {
    right: 7px !important;
    left: 7px !important;
    width: auto !important;
    transform-origin: right center !important;
  }

  .storybook-book.is-cover-spread .storybook-left-page {
    display: none !important;
  }

  .storybook-book.is-cover-spread .storybook-right-page {
    grid-column: 1 !important;
    width: 100% !important;
  }

  /* Neutraliza a antiga seta circular móvel sem perder a área de toque. */
  html body .storybook-dialog .storybook-controls .storybook-page-corner::before {
    inset: auto 0 0 auto !important;
    display: block !important;
    width: 68px !important;
    height: 68px !important;
    border: 0 !important;
    border-radius: 54px 0 0 !important;
    background: linear-gradient(135deg, transparent 45%, #ddc59d 46% 68%, #fffaf0 69%) !important;
    box-shadow: -9px -8px 16px rgba(65, 39, 24, .2) !important;
    clip-path: polygon(18% 100%, 100% 18%, 100% 100%) !important;
    filter: none !important;
    opacity: .94 !important;
    transform: translate(24px, 24px) scale(.64) !important;
  }

  html body .storybook-dialog .storybook-controls .storybook-page-corner::after {
    inset: auto 0 0 auto !important;
    display: block !important;
    width: 38px !important;
    height: 38px !important;
    border-right: 2px solid rgba(89, 48, 32, .28) !important;
    border-bottom: 2px solid rgba(89, 48, 32, .28) !important;
    background: transparent !important;
    opacity: .9 !important;
    transform: translate(12px, 12px) !important;
  }

  html body .storybook-dialog .storybook-controls .storybook-page-corner-back::before,
  html body .storybook-dialog .storybook-controls .storybook-page-corner-back::after {
    right: auto !important;
    left: 0 !important;
    transform-origin: left bottom !important;
  }

  html body .storybook-dialog .storybook-controls .storybook-page-corner-back::before {
    border-radius: 0 54px 0 0 !important;
    background: linear-gradient(225deg, transparent 45%, #ddc59d 46% 68%, #fffaf0 69%) !important;
    clip-path: polygon(0 18%, 82% 100%, 0 100%) !important;
    transform: translate(-24px, 24px) scale(.64) !important;
  }

  html body .storybook-dialog .storybook-controls .storybook-page-corner-back::after {
    border-right: 0 !important;
    border-left: 2px solid rgba(89, 48, 32, .28) !important;
    transform: translate(-12px, 12px) !important;
  }

  html body .storybook-dialog .storybook-book.is-cover-only .storybook-page-corner-next::before {
    background: linear-gradient(135deg, transparent 45%, #ae7a43 46% 68%, #71432c 69%) !important;
    box-shadow: -9px -8px 16px rgba(22, 8, 7, .38) !important;
  }

  html body .storybook-dialog .storybook-book.is-cover-only .storybook-page-corner-next::after {
    border-color: rgba(255, 221, 143, .46) !important;
  }
}

@media (max-width: 480px) {
  .storybook-reading-status {
    margin-right: 104px !important;
  }

  .storybook-reading-status > span:last-child {
    display: none;
  }
}

/* O foco acompanha a dobra; evita o quadrado amarelo em volta da área invisível. */
html body .storybook-dialog .storybook-controls .storybook-page-corner:focus-visible {
  outline: none !important;
}

html body .storybook-dialog .storybook-controls .storybook-page-corner:focus-visible::before {
  filter: drop-shadow(0 0 2px #ffd852) drop-shadow(0 0 5px rgba(255, 216, 82, .92)) !important;
}

/* v140: a folha acompanha o ponteiro; clique e teclado continuam como fallback. */
.storybook-page-corner {
  cursor: grab !important;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.storybook-book.is-dragging-book,
.storybook-book.is-dragging-book .storybook-page-corner {
  cursor: grabbing !important;
}

.storybook-book.is-dragging-book .storybook-page-corner::before,
.storybook-book.is-dragging-book .storybook-page-corner::after {
  animation: none !important;
}

.storybook-book.is-dragging-page-forward .storybook-turn-sheet,
.storybook-book.is-dragging-page-backward .storybook-turn-sheet {
  display: block !important;
  animation: none !important;
  transition: none !important;
  filter: drop-shadow(var(--story-drag-shadow)) !important;
  transform: perspective(1800px)
    translateY(var(--story-drag-lift))
    rotateY(var(--story-drag-angle))
    skewY(var(--story-drag-skew)) !important;
}

.storybook-book.is-dragging-page-forward .storybook-turn-sheet {
  right: auto !important;
  left: 50% !important;
  width: calc(50% - 13px) !important;
  transform-origin: left center !important;
}

.storybook-book.is-dragging-page-backward .storybook-turn-sheet {
  right: 50% !important;
  left: 13px !important;
  width: auto !important;
  transform-origin: right center !important;
}

.storybook-book.is-dragging-page-forward.turn-from-top .storybook-turn-sheet {
  transform-origin: left top !important;
}

.storybook-book.is-dragging-page-forward.turn-from-bottom .storybook-turn-sheet {
  transform-origin: left bottom !important;
}

.storybook-book.is-dragging-page-backward.turn-from-top .storybook-turn-sheet {
  transform-origin: right top !important;
}

.storybook-book.is-dragging-page-backward.turn-from-bottom .storybook-turn-sheet {
  transform-origin: right bottom !important;
}

.storybook-book.is-dragging-book .storybook-turn-face::before {
  position: absolute;
  z-index: 20;
  inset: 0;
  content: "";
  opacity: var(--story-drag-curl);
  pointer-events: none;
}

.storybook-book.is-dragging-page-forward .storybook-turn-face-front::before,
.storybook-book.is-dragging-page-backward .storybook-turn-face-back::before {
  background:
    linear-gradient(90deg, transparent 58%, rgba(255, 255, 255, .7) 82%, rgba(111, 74, 48, .22) 100%),
    radial-gradient(circle at 100% 100%, rgba(255, 246, 217, .88), transparent 34%);
}

.storybook-book.is-dragging-page-backward .storybook-turn-face-front::before,
.storybook-book.is-dragging-page-forward .storybook-turn-face-back::before {
  background:
    linear-gradient(270deg, transparent 58%, rgba(255, 255, 255, .62) 82%, rgba(111, 74, 48, .2) 100%),
    radial-gradient(circle at 0 100%, rgba(255, 246, 217, .82), transparent 34%);
}

.storybook-book.is-dragging-cover-forward .storybook-front-cover,
.storybook-book.is-dragging-cover-backward .storybook-front-cover {
  opacity: 1 !important;
  visibility: visible !important;
  animation: none !important;
  transition: none !important;
  filter: drop-shadow(var(--story-drag-shadow)) !important;
  transform: translateX(var(--story-drag-cover-shift))
    perspective(1800px)
    translateY(var(--story-drag-lift))
    rotateY(var(--story-drag-angle))
    skewY(var(--story-drag-skew)) !important;
}

.storybook-book.is-dragging-cover-forward .storybook-front-cover-face,
.storybook-book.is-dragging-cover-forward .storybook-front-cover-inside,
.storybook-book.is-dragging-cover-backward .storybook-front-cover-face,
.storybook-book.is-dragging-cover-backward .storybook-front-cover-inside {
  animation: none !important;
}

.storybook-book.is-drag-settling .storybook-turn-sheet,
.storybook-book.is-drag-settling .storybook-front-cover {
  transition:
    transform var(--story-drag-settle-ms) cubic-bezier(.2, .74, .18, 1),
    filter var(--story-drag-settle-ms) ease !important;
}

.storybook-book.is-dragging-book .storybook-page-corner::before {
  opacity: calc(1 - var(--story-drag-progress)) !important;
  transform: translate(0, 0) scale(.92) !important;
}

.storybook-book.is-dragging-book .storybook-page-corner::after {
  opacity: calc(1 - var(--story-drag-progress)) !important;
  transform: translate(0, 0) !important;
}

@media (max-width: 720px) {
  .storybook-book {
    touch-action: pan-y pinch-zoom;
  }

  .storybook-book.is-dragging-page-forward .storybook-turn-sheet,
  .storybook-book.is-dragging-page-backward .storybook-turn-sheet {
    right: 7px !important;
    left: 7px !important;
    width: auto !important;
  }

  .storybook-book.is-dragging-cover-forward .storybook-front-cover,
  .storybook-book.is-dragging-cover-backward .storybook-front-cover {
    width: calc(100% - 14px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .storybook-book.is-opening-cover .storybook-front-cover,
  .storybook-book.is-closing-cover .storybook-front-cover,
  .storybook-book.is-turning-page-forward .storybook-turn-sheet,
  .storybook-book.is-turning-page-backward .storybook-turn-sheet,
  .storybook-page-corner::before,
  .storybook-page-corner::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* Em telas baixas, centralizar conteúdo maior que a folha cortava seu início. */
@media (max-height: 600px) {
  .storybook-dialog .storybook-page {
    overflow-y: auto;
    overflow-x: hidden;
    align-content: safe center;
    justify-content: safe center;
    scrollbar-width: thin;
    scrollbar-color: #b62e72 transparent;
  }

  .storybook-dialog .storybook-page > :not(.storybook-page-number) {
    flex-shrink: 0;
  }
}
