/* Camada final do livro. Separada para manter a física acima dos estilos legados. */
.storybook-book {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  animation: none;
  overflow: clip;
}

/* A capa possui frente e contracapa. Assim ela nunca some ao cruzar 90 graus. */
.storybook-front-cover {
  overflow: visible;
  display: block;
  padding: 0;
  border-radius: 4px 14px 14px 4px;
  background:
    radial-gradient(circle at 50% 42%, rgba(193, 138, 78, 0.12), transparent 25%),
    repeating-linear-gradient(0deg, rgba(112, 86, 69, 0.025) 0 1px, transparent 1px 5px),
    linear-gradient(145deg, #fff7e8, #ead8bb);
  box-shadow: -12px 8px 22px rgba(28, 15, 30, 0.22);
  backface-visibility: visible;
}

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

.storybook-front-cover-face,
.storybook-front-cover-inside {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 220, 126, 0.7);
  border-radius: 4px 14px 14px 4px;
  padding: 42px;
  backface-visibility: hidden;
  box-shadow:
    inset 0 0 0 5px rgba(255, 227, 156, 0.08),
    inset 0 0 0 8px rgba(25, 11, 18, 0.28),
    -16px 8px 26px rgba(28, 15, 30, 0.34);
}

.storybook-front-cover-face {
  background:
    radial-gradient(circle at 72% 16%, rgba(255, 222, 108, 0.18), transparent 23%),
    linear-gradient(145deg, #6c3e2a, #4d2a20 54%, #2d1818);
  color: #fff1c9;
  transform: translateZ(1px);
}

.storybook-front-cover-inside {
  background:
    radial-gradient(circle at 50% 42%, rgba(193, 138, 78, 0.12), transparent 25%),
    repeating-linear-gradient(0deg, rgba(112, 86, 69, 0.025) 0 1px, transparent 1px 5px),
    linear-gradient(145deg, #fff7e8, #ead8bb);
  color: #633d2c;
  transform: rotateY(180deg) translateZ(1px);
}

.storybook-front-cover-face::before,
.storybook-front-cover-face::after,
.storybook-front-cover-inside::before,
.storybook-front-cover-inside::after {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(193, 138, 78, 0.45);
  border-radius: 5px 12px 12px 5px;
  content: "";
  pointer-events: none;
}

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

.storybook-front-cover-face > *,
.storybook-front-cover-inside > * {
  position: relative;
  z-index: 1;
}

.storybook-front-cover-face > span,
.storybook-front-cover-face > small,
.storybook-front-cover-inside > small {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.storybook-front-cover-face > strong {
  max-width: 12ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.98;
  text-align: center;
}

.storybook-front-cover-face > i,
.storybook-front-cover-inside > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(193, 138, 78, 0.72);
  border-radius: 50%;
  color: #d09224;
  font-style: normal;
}

.storybook-front-cover-inside > strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 2.65rem);
  letter-spacing: 0.08em;
}

.storybook-front-cover-inside > small {
  max-width: 25ch;
  color: #80624c;
  line-height: 1.55;
  text-align: center;
}

/* As próprias faces 3D decidem qual lado aparece. Evita a capa atravessar a
   folha quando animações de opacidade e rotação ficam fora de sincronia. */
.storybook-book.is-opening .storybook-front-cover-face,
.storybook-book.is-opening .storybook-front-cover-inside,
.storybook-book.is-closing .storybook-front-cover-face,
.storybook-book.is-closing .storybook-front-cover-inside {
  animation: none;
  opacity: 1;
}

@keyframes storyFrontCoverOpenV99 {
  0% { opacity: 1; visibility: visible; transform: rotateY(0deg); }
  99% { opacity: 1; visibility: visible; transform: rotateY(-179deg); }
  100% { opacity: 0; visibility: hidden; transform: rotateY(-180deg); }
}

@keyframes storyFrontCoverCloseV99 {
  0% { opacity: 1; visibility: visible; transform: rotateY(-179deg); }
  100% { opacity: 1; visibility: visible; transform: rotateY(0deg); }
}

.storybook-book.is-opening {
  animation: storyBookEnterPolished 1080ms cubic-bezier(0.2, 0.74, 0.2, 1) both;
}

.storybook-book.is-opening .storybook-front-cover {
  animation: storyFrontCoverOpenV99 1040ms cubic-bezier(0.4, 0.02, 0.18, 1) both;
}

.storybook-book.is-closing .storybook-front-cover {
  animation: storyFrontCoverCloseV99 940ms cubic-bezier(0.4, 0.02, 0.18, 1) both;
}

@keyframes storyBookEnterPolished {
  0% { opacity: 0; transform: perspective(1700px) rotateX(5deg) scale(0.96) translateY(15px); }
  24%, 100% { opacity: 1; }
  100% { transform: perspective(1700px) rotateX(0) scale(1) translateY(0); }
}

.storybook-book .storybook-left-page,
.storybook-book .storybook-right-page {
  clip-path: none !important;
}

.storybook-page-number,
.storybook-previous-page .storybook-page-number {
  top: auto;
  bottom: 18px;
  color: #806f80;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  font-variant-numeric: oldstyle-nums;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.storybook-page-number {
  right: 30px;
  left: auto;
}

.storybook-previous-page .storybook-page-number {
  right: auto;
  left: 30px;
}

.storybook-controls {
  position: absolute;
  z-index: 11;
  inset: 13px;
  display: block;
  padding: 0;
  border: 0;
  pointer-events: none;
}

.storybook-controls .storybook-page-corner {
  position: absolute;
  top: 0;
  bottom: auto;
  width: 64px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
  text-shadow: none;
}

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

.storybook-controls .storybook-page-corner::before,
.storybook-controls .storybook-page-corner::after {
  position: absolute;
  top: auto;
  bottom: 12px;
  width: 60px;
  height: 96px;
  border: 0;
  border-radius: 0;
  content: "";
  opacity: 0.22;
  transition: opacity 180ms ease, transform 240ms cubic-bezier(0.2, 0.72, 0.18, 1), filter 180ms ease;
}

.storybook-controls .storybook-page-corner::before {
  z-index: 1;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), transparent 44%),
    linear-gradient(145deg, #fffaf0, #ead8b9 72%, #9a704b 73% 100%);
  box-shadow: none;
  filter: none;
}

.storybook-controls .storybook-page-corner::after {
  z-index: 0;
  background: rgba(48, 29, 48, 0.23);
  box-shadow: none;
  filter: blur(6px);
}

.storybook-controls .storybook-page-corner-next::before,
.storybook-controls .storybook-page-corner-next::after {
  right: 0;
  left: auto;
  clip-path: path("M 60 0 L 60 96 C 47 76 25 59 0 48 C 25 37 47 20 60 0 Z");
  transform: scaleX(0.14);
  transform-origin: right center;
}

.storybook-controls .storybook-page-corner-back::before,
.storybook-controls .storybook-page-corner-back::after {
  right: auto;
  left: 0;
  clip-path: path("M 0 0 L 0 96 C 13 76 35 59 60 48 C 35 37 13 20 0 0 Z");
  transform: scaleX(0.14);
  transform-origin: left center;
}

.storybook-controls .storybook-page-corner:disabled {
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
}

.storybook-controls .storybook-page-corner:disabled::before,
.storybook-controls .storybook-page-corner:disabled::after {
  opacity: 0;
}

.storybook-book.is-turning-forward .storybook-page-corner::before,
.storybook-book.is-turning-forward .storybook-page-corner::after,
.storybook-book.is-turning-backward .storybook-page-corner::before,
.storybook-book.is-turning-backward .storybook-page-corner::after {
  opacity: 0 !important;
}

.storybook-book.is-suppressing-turn-preview .storybook-page-corner::before,
.storybook-book.is-suppressing-turn-preview .storybook-page-corner::after {
  opacity: 0 !important;
}

.storybook-controls .storybook-page-corner:focus-visible {
  outline: 0;
}

@media (hover: hover) and (pointer: fine) {
  .storybook-book.is-previewing-forward .storybook-page-corner-next::before,
  .storybook-book.is-previewing-forward .storybook-page-corner-next::after,
  .storybook-controls .storybook-page-corner-next:focus-visible::before,
  .storybook-controls .storybook-page-corner-next:focus-visible::after,
  .storybook-controls .storybook-page-corner-next:hover:not(:disabled)::before,
  .storybook-controls .storybook-page-corner-next:hover:not(:disabled)::after {
    opacity: 1;
    transform: rotateY(-12deg) scaleX(0.72);
    filter: drop-shadow(-7px 7px 8px rgba(53, 35, 46, 0.25));
  }

  .storybook-book.is-previewing-backward .storybook-page-corner-back::before,
  .storybook-book.is-previewing-backward .storybook-page-corner-back::after,
  .storybook-controls .storybook-page-corner-back:focus-visible::before,
  .storybook-controls .storybook-page-corner-back:focus-visible::after,
  .storybook-controls .storybook-page-corner-back:hover:not(:disabled)::before,
  .storybook-controls .storybook-page-corner-back:hover:not(:disabled)::after {
    opacity: 1;
    transform: rotateY(12deg) scaleX(0.72);
    filter: drop-shadow(7px 7px 8px rgba(53, 35, 46, 0.25));
  }
}

.storybook-close {
  position: absolute;
  z-index: 14;
  top: 1px;
  right: 8px;
  width: auto;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #c18a4e;
  border-radius: 6px 6px 14px 14px;
  padding: 0 13px 0 10px;
  background: linear-gradient(145deg, #77482f, #4b291f);
  box-shadow: inset 0 0 0 2px rgba(255, 225, 166, 0.1), 0 8px 18px rgba(31, 18, 34, 0.3);
  color: #fff1c9;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
}

.storybook-close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.storybook-close:hover {
  background: linear-gradient(145deg, #8d5938, #5c3023);
  transform: translateY(-2px);
}

.storybook-close:disabled {
  opacity: 0;
  pointer-events: none;
}

.storybook-turn-face-back {
  background:
    radial-gradient(circle at 50% 48%, rgba(182, 46, 114, 0.035), transparent 25%),
    repeating-linear-gradient(0deg, rgba(112, 86, 69, 0.023) 0 1px, transparent 1px 5px),
    #fffaf0;
}

.storybook-turn-face-back::after {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(126, 83, 50, 0.16);
  border-radius: 50%;
  color: rgba(126, 83, 50, 0.22);
  content: "✦";
  font-size: 0.85rem;
}

.storybook-book.is-closing {
  animation: storyBookExitPolished 1140ms cubic-bezier(0.46, 0.04, 0.58, 1) both;
}

.storybook-dialog.is-closing .storybook-reading-status {
  opacity: 0;
  transform: translateY(-7px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.storybook-dialog.is-closing .storybook-bookmark {
  opacity: 0;
  transform: translateX(-50%) translateY(-72px);
  transition: opacity 180ms ease, transform 260ms ease;
}

.storybook-book.is-opening .storybook-bookmark {
  animation: storyBookmarkEnter 420ms 720ms cubic-bezier(0.2, 0.72, 0.18, 1) both;
}

@keyframes storyBookExitPolished {
  0%, 82% {
    opacity: 1;
    transform: perspective(1700px) rotateX(0) scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: perspective(1700px) rotateX(5deg) scale(0.94) translateY(18px);
  }
}

@keyframes storyBookmarkEnter {
  from { opacity: 0; transform: translateX(-50%) translateY(-58px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.storybook-bookmark:focus-visible {
  outline: 0;
}

.storybook-bookmark:focus-visible .storybook-bookmark-seal svg {
  filter: drop-shadow(0 0 2px #ffd852) drop-shadow(0 0 5px #ffd852) drop-shadow(0 5px 5px rgba(49, 27, 27, 0.24));
}

@media (max-width: 720px) {
  .storybook-book {
    grid-template-columns: 1fr;
  }

  .storybook-controls {
    inset: 0 9px 9px;
  }

  .storybook-controls .storybook-page-corner {
    top: calc(100% - 509px);
    bottom: auto;
    width: 54px;
    height: 500px;
  }

  .storybook-controls .storybook-page-corner::before,
  .storybook-controls .storybook-page-corner::after {
    top: auto;
    bottom: 9px;
    width: 54px;
    height: 86px;
    clip-path: polygon(100% 0, 100% 100%, 0 50%);
  }

  .storybook-controls .storybook-page-corner-back::before,
  .storybook-controls .storybook-page-corner-back::after {
    clip-path: polygon(0 0, 100% 50%, 0 100%);
  }

  .storybook-page-number,
  .storybook-previous-page .storybook-page-number {
    bottom: 14px;
  }

  .storybook-page-number { right: 22px; left: auto; }
  .storybook-previous-page .storybook-page-number { right: auto; left: 22px; }

  .storybook-close {
    position: fixed;
    top: 12px;
    right: 12px;
  }
}

/* v104: física única do livro, papel contínuo e leitura responsiva. */
.storybook-book {
  --storybook-paper: #fffaf0;
  --storybook-paper-edge: #eadfcf;
  overflow: hidden;
  isolation: isolate;
}

.storybook-left-page,
.storybook-right-page,
.storybook-page,
.storybook-previous-page,
.storybook-turn-face {
  background-color: var(--storybook-paper);
}

.storybook-front-cover {
  z-index: 10;
  pointer-events: none;
}

.storybook-turn-sheet {
  z-index: 9;
}

.storybook-turn-face-back::after {
  content: none;
}

.storybook-book.is-turning-forward .storybook-turn-sheet,
.storybook-book.is-turning-backward .storybook-turn-sheet {
  animation-duration: 900ms !important;
}

.storybook-controls .storybook-page-corner::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), transparent 48%),
    linear-gradient(145deg, var(--storybook-paper), var(--storybook-paper-edge));
}

.storybook-controls .storybook-page-corner::after {
  background: rgba(52, 32, 58, 0.18);
}

.storybook-bookmark {
  right: 42px;
  left: auto;
  transform: none;
}

.storybook-book.is-opening .storybook-bookmark {
  animation-name: storyBookmarkCornerEnter;
}

.storybook-dialog.is-closing .storybook-bookmark {
  transform: translateY(-72px);
}

.storybook-close {
  border-radius: 8px 8px 14px 14px;
}

@media (max-width: 720px) {
  .storybook-dialog {
    width: calc(100% - 12px);
    max-height: calc(100dvh - 12px);
    overflow: hidden;
  }

  .storybook-shell {
    padding: 48px 6px 6px;
  }

  .storybook-reading-status {
    top: 11px;
    right: 58px;
    left: 12px;
  }

  .storybook-book {
    min-height: 0;
    height: calc(100dvh - 72px);
    grid-template-columns: minmax(0, 1fr);
    border-radius: 12px;
  }

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

  .storybook-book > .storybook-right-page {
    grid-column: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
  }

  .storybook-page-stage,
  .storybook-page {
    min-height: 0;
    height: 100%;
  }

  .storybook-page {
    padding: 42px 28px 48px;
  }

  .storybook-front-cover,
  .storybook-turn-sheet,
  .storybook-book.is-turning-forward .storybook-turn-sheet,
  .storybook-book.is-turning-backward .storybook-turn-sheet {
    inset: 9px;
    width: auto;
    height: auto;
  }

  .storybook-book.is-turning-forward .storybook-turn-sheet {
    transform-origin: left center;
  }

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

  .storybook-bookmark {
    top: 0;
    right: 14px;
    left: auto;
    height: 94px;
    transform: none;
  }

  .storybook-bookmark-cord {
    height: 48px;
  }

  .storybook-bookmark-seal {
    top: 42px;
  }

  .storybook-close {
    position: absolute;
    top: 5px;
    right: 7px;
  }

  .storybook-controls {
    inset: 9px;
  }

  .storybook-controls .storybook-page-corner {
    top: 0;
    width: 58px;
    height: 100%;
  }

  .storybook-controls .storybook-page-corner::before,
  .storybook-controls .storybook-page-corner::after {
    top: auto;
    bottom: 0;
    width: 58px;
    height: 78px;
  }

  .storybook-page-number {
    right: 22px;
    bottom: 14px;
  }
}

@media (max-width: 900px) and (max-height: 500px) {
  .storybook-dialog {
    width: calc(100% - 8px);
    max-height: calc(100dvh - 8px);
  }

  .storybook-shell {
    padding: 36px 5px 5px;
  }

  .storybook-book {
    height: calc(100dvh - 45px);
  }

  .storybook-page,
  .storybook-turn-face {
    padding: 26px 24px 34px;
  }

  .storybook-page h3,
  .storybook-turn-face h3 {
    font-size: clamp(1.45rem, 5vw, 2.1rem);
  }

  .storybook-blank-page::after {
    height: 42px;
    margin-top: 12px;
  }

  .storybook-close {
    height: 32px;
  }
}

/* v103: uma única física para capa e páginas, com frente e verso contínuos. */
.storybook-book {
  perspective: 2200px;
  perspective-origin: 50% 46%;
  transform-style: preserve-3d;
}

.storybook-front-cover,
.storybook-turn-sheet {
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.storybook-front-cover-face,
.storybook-front-cover-inside,
.storybook-turn-face {
  isolation: isolate;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  transform-style: flat;
  -webkit-transform-style: flat;
}

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

.storybook-front-cover-inside,
.storybook-turn-face-back {
  transform: rotateY(180deg) translateZ(1px);
}

.storybook-turn-face-back {
  justify-content: center;
}

.storybook-book.is-opening {
  animation: storyBookEnterV103 1380ms cubic-bezier(0.18, 0.72, 0.18, 1) both;
}

.storybook-book.is-opening .storybook-front-cover {
  animation: storyFrontCoverOpenV103 1320ms cubic-bezier(0.42, 0.02, 0.18, 1) both;
}

.storybook-book.is-closing {
  animation: storyBookExitV103 1380ms cubic-bezier(0.42, 0.02, 0.2, 1) both;
}

.storybook-book.is-closing .storybook-front-cover {
  animation: storyFrontCoverCloseV103 1320ms cubic-bezier(0.42, 0.02, 0.18, 1) both;
}

@keyframes storyFrontCoverOpenV103 {
  0% { opacity: 1; visibility: visible; transform: rotateY(0deg); }
  49% { opacity: 1; visibility: visible; transform: rotateY(-88deg); }
  50% { opacity: 1; visibility: visible; transform: rotateY(-90deg); }
  99.5% { opacity: 1; visibility: visible; transform: rotateY(-179deg); }
  100% { opacity: 0; visibility: hidden; transform: rotateY(-180deg); }
}

@keyframes storyFrontCoverCloseV103 {
  0% { opacity: 1; visibility: visible; transform: rotateY(-179deg); }
  50% { opacity: 1; visibility: visible; transform: rotateY(-90deg); }
  100% { opacity: 1; visibility: visible; transform: rotateY(0deg); }
}

@keyframes storyBookEnterV103 {
  0% { opacity: 0; transform: perspective(2200px) rotateX(4deg) scale(0.965) translateY(14px); }
  16%, 100% { opacity: 1; }
  100% { transform: perspective(2200px) rotateX(0) scale(1) translateY(0); }
}

@keyframes storyBookExitV103 {
  0%, 82% { opacity: 1; transform: perspective(2200px) rotateX(0) scale(1) translateY(0); }
  100% { opacity: 0; transform: perspective(2200px) rotateX(4deg) scale(0.955) translateY(16px); }
}

.storybook-book.is-turning-forward .storybook-turn-sheet {
  right: 13px;
  left: 50%;
  width: auto;
  transform-origin: left center;
  animation: storySheetForwardV103 900ms cubic-bezier(0.42, 0.03, 0.2, 1) both !important;
}

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

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

@keyframes storySheetForwardV103 {
  0% { transform: rotateY(0deg); filter: drop-shadow(0 0 0 transparent); }
  46% { transform: rotateY(-78deg); filter: drop-shadow(-20px 9px 15px rgba(42, 26, 50, 0.28)); }
  50% { transform: rotateY(-90deg); filter: drop-shadow(-28px 10px 18px rgba(42, 26, 50, 0.3)); }
  54% { transform: rotateY(-102deg); filter: drop-shadow(-20px 9px 15px rgba(42, 26, 50, 0.28)); }
  100% { transform: rotateY(-180deg); filter: drop-shadow(0 0 0 transparent); }
}

@keyframes storySheetBackwardV103 {
  0% { transform: rotateY(0deg); filter: drop-shadow(0 0 0 transparent); }
  46% { transform: rotateY(78deg); filter: drop-shadow(20px 9px 15px rgba(42, 26, 50, 0.28)); }
  50% { transform: rotateY(90deg); filter: drop-shadow(28px 10px 18px rgba(42, 26, 50, 0.3)); }
  54% { transform: rotateY(102deg); filter: drop-shadow(20px 9px 15px rgba(42, 26, 50, 0.28)); }
  100% { transform: rotateY(180deg); filter: drop-shadow(0 0 0 transparent); }
}

/* A face que termina a virada repete o conteúdo da folha. Isso impede o verso
   vazio e mantém a leitura orientada até a folha pousar no outro lado. */
.storybook-book.is-turning-forward .storybook-turn-face-front,
.storybook-book.is-turning-backward .storybook-turn-face-front {
  animation: storyTurnFrontVisibilityV103 900ms linear both;
}

.storybook-book.is-turning-forward .storybook-turn-face-back,
.storybook-book.is-turning-backward .storybook-turn-face-back {
  animation: storyTurnBackVisibilityV103 900ms linear both;
}

@keyframes storyTurnFrontVisibilityV103 {
  0%, 49.8% { opacity: 1; }
  50.2%, 100% { opacity: 0; }
}

@keyframes storyTurnBackVisibilityV103 {
  0%, 49.8% { opacity: 0; }
  50.2%, 100% { opacity: 1; }
}

@media (max-width: 720px) {
  .storybook-book.is-turning-forward .storybook-turn-sheet,
  .storybook-book.is-turning-backward .storybook-turn-sheet {
    right: 9px;
    left: 9px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .storybook-book.is-opening,
  .storybook-book.is-closing,
  .storybook-book.is-turning-forward .storybook-turn-sheet,
  .storybook-book.is-turning-backward .storybook-turn-sheet,
  .storybook-turn-face {
    animation: none !important;
  }
}

@media (max-width: 480px) {
  .storybook-close {
    width: 42px;
    padding: 0;
  }

  .storybook-close span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .storybook-book,
  .storybook-front-cover,
  .storybook-turn-sheet,
  .storybook-bookmark-cord,
  .storybook-bookmark-seal {
    animation: none !important;
    transition: none !important;
  }
}

/* v102: cantos físicos, marcador fora da lombada e retomada sem atravessar a capa. */
.storybook-front-cover {
  z-index: 12;
}

.storybook-bookmark {
  top: 0;
  right: 54px;
  left: auto;
  height: 118px;
  transform: none;
}

.storybook-bookmark-cord {
  height: 68px;
}

.storybook-bookmark-seal {
  top: 60px;
}

.storybook-dialog.is-closing .storybook-bookmark {
  transform: translateY(-72px);
}

.storybook-book.is-opening .storybook-bookmark {
  animation: storyBookmarkCornerEnter 420ms 1060ms cubic-bezier(0.2, 0.72, 0.18, 1) both;
}

@keyframes storyBookmarkCornerEnter {
  from { opacity: 0; transform: translateY(-58px); }
  to { opacity: 1; transform: translateY(0); }
}

.storybook-controls .storybook-page-corner.is-top-corner::before,
.storybook-controls .storybook-page-corner.is-top-corner::after {
  top: 12px;
  bottom: auto;
}

.storybook-controls .storybook-page-corner-next.is-top-corner::before,
.storybook-controls .storybook-page-corner-next.is-top-corner::after {
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  transform-origin: right top;
}

.storybook-controls .storybook-page-corner-back.is-top-corner::before,
.storybook-controls .storybook-page-corner-back.is-top-corner::after {
  clip-path: polygon(0 0, 100% 0, 0 100%);
  transform-origin: left top;
}

.storybook-controls .storybook-page-corner-next.is-bottom-corner::before,
.storybook-controls .storybook-page-corner-next.is-bottom-corner::after {
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  transform-origin: right bottom;
}

.storybook-controls .storybook-page-corner-back.is-bottom-corner::before,
.storybook-controls .storybook-page-corner-back.is-bottom-corner::after {
  clip-path: polygon(0 0, 100% 100%, 0 100%);
  transform-origin: left bottom;
}

.storybook-book.is-turning-forward .storybook-turn-sheet,
.storybook-book.is-turning-backward .storybook-turn-sheet {
  animation-duration: 760ms;
}

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

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

.storybook-book.turn-from-bottom.is-turning-forward .storybook-turn-sheet {
  transform-origin: left bottom;
}

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

@media (max-width: 720px) {
  .storybook-bookmark {
    top: 0;
    right: 22px;
    left: auto;
    height: 98px;
  }

  .storybook-bookmark-cord {
    height: 52px;
  }

  .storybook-bookmark-seal {
    top: 45px;
  }

  .storybook-controls .storybook-page-corner.is-top-corner::before,
  .storybook-controls .storybook-page-corner.is-top-corner::after {
    top: 9px;
    bottom: auto;
  }
}

/* v104 final: estas regras precisam prevalecer sobre v102/v103 acima. */
.storybook-book {
  --storybook-paper: #fffaf0;
  --storybook-paper-edge: #eadfcf;
  overflow: hidden;
  isolation: isolate;
}

.storybook-front-cover { z-index: 10; pointer-events: none; }
.storybook-turn-sheet { z-index: 9; }
.storybook-turn-face-back::after { content: none; }

.storybook-book.is-turning-forward .storybook-turn-sheet,
.storybook-book.is-turning-backward .storybook-turn-sheet {
  animation-duration: 900ms !important;
}

.storybook-controls .storybook-page-corner::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), transparent 48%),
    linear-gradient(145deg, var(--storybook-paper), var(--storybook-paper-edge));
}

.storybook-controls .storybook-page-corner::after {
  background: rgba(52, 32, 58, 0.18);
}

.storybook-bookmark {
  right: 42px;
  left: auto;
  transform: none;
}

.storybook-book.is-opening .storybook-bookmark { animation-name: storyBookmarkCornerEnter; }
.storybook-dialog.is-closing .storybook-bookmark { transform: translateY(-72px); }

@media (max-width: 720px) {
  .storybook-dialog {
    width: calc(100% - 12px);
    max-height: calc(100dvh - 12px);
    overflow: hidden;
  }

  .storybook-shell { padding: 48px 6px 6px; }
  .storybook-reading-status { top: 11px; right: 58px; left: 12px; }

  .storybook-book {
    min-height: 0;
    height: calc(100dvh - 72px);
    grid-template-columns: minmax(0, 1fr);
    border-radius: 12px;
  }

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

  .storybook-book > .storybook-right-page {
    grid-column: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
  }

  .storybook-page-stage,
  .storybook-page { min-height: 0; height: 100%; }
  .storybook-page { padding: 42px 28px 48px; }

  .storybook-front-cover,
  .storybook-turn-sheet,
  .storybook-book.is-turning-forward .storybook-turn-sheet,
  .storybook-book.is-turning-backward .storybook-turn-sheet {
    inset: 9px;
    width: auto;
    height: auto;
  }

  .storybook-book.is-turning-forward .storybook-turn-sheet { transform-origin: left center; }
  .storybook-book.is-turning-backward .storybook-turn-sheet { transform-origin: right center; }

  .storybook-bookmark {
    top: 0;
    right: 14px;
    left: auto;
    height: 94px;
    transform: none;
  }

  .storybook-bookmark-cord { height: 48px; }
  .storybook-bookmark-seal { top: 42px; }
  .storybook-close { position: absolute; top: 5px; right: 7px; }
  .storybook-controls { inset: 9px; }

  .storybook-controls .storybook-page-corner {
    top: 0;
    width: 58px;
    height: 100%;
  }

  .storybook-controls .storybook-page-corner::before,
  .storybook-controls .storybook-page-corner::after {
    top: auto;
    bottom: 0;
    width: 58px;
    height: 78px;
  }

  .storybook-page-number { right: 22px; bottom: 14px; }
}

@media (max-width: 900px) and (max-height: 500px) {
  .storybook-dialog { width: calc(100% - 8px); max-height: calc(100dvh - 8px); }
  .storybook-shell { padding: 36px 5px 5px; }
  .storybook-book { height: calc(100dvh - 45px); }
  .storybook-page,
  .storybook-turn-face { padding: 26px 24px 34px; }
  .storybook-page h3,
  .storybook-turn-face h3 { font-size: clamp(1.45rem, 5vw, 2.1rem); }
  .storybook-blank-page::after { height: 42px; margin-top: 12px; }
  .storybook-close { height: 32px; }
}

/* v105: a capa nunca mostra o verso espelhado sobre as folhas. */
.storybook-book.is-opening {
  animation: storyBookEnterV103 1260ms cubic-bezier(0.18, 0.72, 0.18, 1) both;
}

.storybook-book.is-opening .storybook-front-cover {
  animation: storyFrontCoverOpenV105 1200ms cubic-bezier(0.42, 0.02, 0.18, 1) both;
}

.storybook-book.is-closing {
  animation: storyBookExitV103 1260ms cubic-bezier(0.42, 0.02, 0.2, 1) both;
}

.storybook-book.is-closing .storybook-front-cover {
  animation: storyFrontCoverCloseV105 1200ms cubic-bezier(0.42, 0.02, 0.18, 1) both;
}

@keyframes storyFrontCoverOpenV105 {
  0% { opacity: 1; visibility: visible; transform: rotateY(0deg); }
  72% { opacity: 1; visibility: visible; transform: rotateY(-78deg); }
  84% { opacity: 0.72; visibility: visible; transform: rotateY(-88deg); }
  85%, 100% { opacity: 0; visibility: hidden; transform: rotateY(-89deg); }
}

@keyframes storyFrontCoverCloseV105 {
  0%, 14% { opacity: 0; visibility: hidden; transform: rotateY(-89deg); }
  15% { opacity: 0.72; visibility: visible; transform: rotateY(-88deg); }
  28% { opacity: 1; visibility: visible; transform: rotateY(-78deg); }
  100% { opacity: 1; visibility: visible; transform: rotateY(0deg); }
}

.storybook-book.is-opening .storybook-front-cover-inside,
.storybook-book.is-closing .storybook-front-cover-inside {
  opacity: 0 !important;
  visibility: hidden;
}

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

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

@keyframes storyCoverInkOutV105 {
  0%, 64% { opacity: 1; }
  76%, 100% { opacity: 0; }
}

@keyframes storyCoverInkInV105 {
  0%, 24% { opacity: 0; }
  38%, 100% { opacity: 1; }
}

@media (max-width: 720px) {
  .storybook-front-cover {
    right: 9px;
    left: 9px;
    width: auto;
    transform-origin: left center;
  }
}

@media (max-width: 900px) and (max-height: 500px) {
  .storybook-dialog { overflow: hidden; }
  .storybook-shell { height: calc(100dvh - 8px); min-height: 0; }
  .storybook-book {
    min-height: 0 !important;
    height: calc(100dvh - 72px) !important;
  }
  .storybook-left-page,
  .storybook-right-page,
  .storybook-page-stage,
  .storybook-page,
  .storybook-previous-page { min-height: 0; height: 100%; }
  .storybook-page,
  .storybook-previous-page,
  .storybook-turn-face { padding: 20px 22px 28px; }
  .storybook-page h3,
  .storybook-previous-page h3,
  .storybook-turn-face h3 { font-size: clamp(1.3rem, 4vw, 1.8rem); }
  .storybook-blank-page::after { height: 28px; margin-top: 8px; }
}

/* DIVAR 360 v114: controles explícitos para leitura em telas pequenas. */
@media (max-width: 720px) {
  html body .storybook-dialog .storybook-controls .storybook-page-corner,
  html body .storybook-dialog .storybook-controls .storybook-page-corner:hover:not(:disabled),
  html body .storybook-dialog .storybook-controls .storybook-page-corner.is-top-corner,
  html body .storybook-dialog .storybook-controls .storybook-page-corner.is-bottom-corner {
    top: auto;
    bottom: 0;
    width: 48px;
    height: 48px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: linear-gradient(180deg, #f13a8a, #b51769);
    box-shadow: 0 4px 0 #721443, 0 8px 18px rgba(52, 27, 95, 0.24);
    opacity: 1;
  }

  html body .storybook-dialog .storybook-controls .storybook-page-corner::before,
  html body .storybook-dialog .storybook-controls .storybook-page-corner.is-top-corner::before,
  html body .storybook-dialog .storybook-controls .storybook-page-corner.is-bottom-corner::before,
  html body .storybook-book.is-turning-forward .storybook-page-corner::before,
  html body .storybook-book.is-turning-backward .storybook-page-corner::before,
  html body .storybook-book.is-suppressing-turn-preview .storybook-page-corner::before {
    inset: 0;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 0;
    background: none;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
    clip-path: none !important;
    filter: none !important;
  }

  html body .storybook-dialog .storybook-controls .storybook-page-corner::after {
    display: none !important;
  }

  html body .storybook-dialog .storybook-controls .storybook-page-corner-back::before {
    content: "‹";
  }

  html body .storybook-dialog .storybook-controls .storybook-page-corner-next::before {
    content: "›";
  }

  html body .storybook-dialog .storybook-controls .storybook-page-corner:disabled {
    opacity: 0.32;
    box-shadow: none;
  }
}
