/* Keep navigation usable without changing the supplied magazine spreads. */
body.electronic-mode {
  height: 100vh;
  height: 100dvh;
}
body.electronic-mode #e-stage {
  overflow: auto;
  overscroll-behavior: contain;
  min-height: 0;
}
#booklet-scroll-space {
  position: relative;
}
body.electronic-mode #e-scaler {
  box-shadow: none;
}
body.electronic-mode .page {
  box-shadow: none;
}
body.electronic-mode .page:not(.active-page):not(.leaving-page) {
  display: none;
}
body.electronic-mode .fly-unit {
  will-change: auto;
}
body.electronic-mode .e-btn:focus-visible,
#booklet-contents button:focus-visible {
  outline: 2px solid #d4b27c;
  outline-offset: 2px;
}
body.electronic-mode .studio-lightbox {
  background: #141312;
  backdrop-filter: none;
}
body.electronic-mode .studio-lb-card {
  box-shadow: none;
  background: #141312;
}
body.electronic-mode .gt-matrix-overlay {
  background: #141312;
  backdrop-filter: none;
}
body.electronic-mode .gt-matrix-panel {
  box-shadow: none;
}
body.electronic-mode .gt-m-top {
  flex-wrap: wrap;
}
body.electronic-mode .gt-m-tag {
  white-space: normal;
}
body.electronic-mode .gt-matrix-close {
  min-height: 44px;
}
body.electronic-mode .e-topbar {
  backdrop-filter: none;
}
body.electronic-mode .e-pill {
  min-width: 36px;
}
img[data-media-id]:not([src]) {
  visibility: hidden;
}

#booklet-contents {
  width: min(860px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid #79674d;
  color: #faf7f2;
  background: #191715;
  font-family: Inter, sans-serif;
}
#booklet-contents::backdrop {
  background: #000c;
}
#booklet-contents[open] {
  display: flex;
  flex-direction: column;
}
#booklet-contents header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid #79674d;
}
#booklet-contents h2 {
  margin: 0;
  font-size: 23px;
}
#booklet-contents button {
  cursor: pointer;
  font: inherit;
  color: inherit;
  border: 0;
  background: transparent;
  min-height: 44px;
}
#booklet-contents .reader-close {
  border: 1px solid #79674d;
  padding: 8px 12px;
}
#booklet-contents nav {
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 20px 20px;
}
#booklet-contents nav button {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 12px;
  border-bottom: 1px solid #40372b;
  text-align: left;
  line-height: 1.4;
  font-size: 15px;
}
#booklet-contents nav span {
  color: #d4b27c;
  font-variant-numeric: tabular-nums;
}
#booklet-contents nav button:hover {
  background: #30281e;
}
#booklet-status:not([hidden]) {
  position: fixed;
  bottom: 60px;
  left: 12px;
  right: 12px;
  z-index: 900;
  background: #191715;
  color: #faf7f2;
  border: 1px solid #79674d;
  padding: 12px;
  display: flex;
  justify-content: center;
  gap: 16px;
  align-items: center;
  font:
    14px Inter,
    sans-serif;
}
#booklet-status button {
  font: inherit;
  color: inherit;
  padding: 8px;
  background: none;
  border: 1px solid #79674d;
  cursor: pointer;
}
body.electronic-mode .e-pills-wrap {
  min-width: 0;
  scrollbar-width: thin;
}

body.electronic-mode .e-pill {
  flex-shrink: 0;
  min-height: 32px;
}

@media (max-width: 1700px) {
  body.electronic-mode .e-breadcrumbs {
    display: none;
  }
  body.electronic-mode .e-pills-wrap {
    margin-inline: auto;
  }
}

@media (max-width: 1500px) {
  body.electronic-mode .e-brand-title {
    display: none;
  }
}

@media (max-width: 1100px) {
  body.electronic-mode .e-topbar {
    padding-inline: 10px;
  }
  body.electronic-mode .e-btn {
    padding-inline: 8px;
    font-size: 10px;
  }
  body.electronic-mode .gt-matrix-body {
    grid-template-columns: minmax(0, 1fr);
  }
  body.electronic-mode .gt-matrix-preview {
    display: none;
  }
  body.electronic-mode .e-controls .hide-mobile {
    display: none !important;
  }
}

@media (max-width: 900px) {
  body.electronic-mode .e-topbar {
    height: auto;
    min-height: 88px;
    padding: 8px;
    justify-content: center;
  }

  body.electronic-mode .e-brand {
    display: none;
  }

  body.electronic-mode .e-controls {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  body.electronic-mode .e-controls .matrix-btn {
    flex-basis: auto;
    justify-content: center;
  }

  body.electronic-mode .contents-btn {
    order: 0;
  }
  body.electronic-mode .matrix-btn {
    order: 1;
  }
  body.electronic-mode .zoom-btn {
    order: 2;
  }
  body.electronic-mode .prev-btn {
    order: 3;
  }
  body.electronic-mode .e-page-indicator {
    order: 4;
  }
  body.electronic-mode .next-btn {
    order: 5;
  }
  body.electronic-mode .e-btn {
    min-height: 44px;
    font-size: 11px;
    justify-content: center;
    text-transform: none;
    letter-spacing: 0;
    padding: 6px;
  }
  body.electronic-mode .e-page-indicator {
    padding-block: 9px;
  }
  body.electronic-mode .e-bottombar {
    height: 52px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  body.electronic-mode .e-pill {
    min-width: 44px;
    min-height: 44px;
  }
  body.electronic-mode .page,
  body.electronic-mode .page .fly-unit {
    transform: none !important;
    transition: none !important;
    opacity: 1 !important;
  }
  body.electronic-mode .cover-orbit-svg {
    display: none;
  }
  body.electronic-mode .studio-lb-card {
    width: calc(100vw - 16px);
    border-width: 1px;
  }
  body.electronic-mode .studio-lb-bar {
    gap: 10px;
    padding: 12px;
  }
  body.electronic-mode .studio-lb-img-wrap {
    height: 65dvh;
  }
  body.electronic-mode .studio-lb-img-wrap img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
  }
  #booklet-contents nav {
    grid-template-columns: 1fr;
    padding-inline: 8px;
  }
  #booklet-contents h2 {
    font-size: 19px;
  }
  #booklet-contents header {
    padding: 12px;
  }

  body.electronic-mode .gt-matrix-overlay {
    padding: 8px;
  }
  body.electronic-mode .gt-matrix-panel {
    width: 100%;
    max-height: 96dvh;
  }
  body.electronic-mode .gt-matrix-header {
    padding: 14px;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 12px;
  }
  body.electronic-mode .gt-matrix-h2 {
    font-size: 14px;
  }
  body.electronic-mode .gt-matrix-kicker,
  body.electronic-mode .gt-matrix-hint {
    display: none;
  }
  body.electronic-mode .gt-matrix-body {
    padding: 12px;
    min-height: 0;
  }
  body.electronic-mode .gt-matrix-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  body.electronic-mode .gt-m-tag {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.electronic-mode *,
  body.electronic-mode *::before,
  body.electronic-mode *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
