/* v0.10.0 — focused Option 2 PDF reader. */
body.figma-final.reading-mode .shell {
  margin: 0;
  padding: 0;
  height: 100dvh;
}
body.figma-final.reading-mode #main {
  padding: 0;
  margin: 0;
  max-width: none;
  height: 100dvh;
  overflow: hidden;
}
.ebook-header {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
}
.ebook-header strong {
  font:
    600 1rem/1.4 'Be Vietnam Pro',
    sans-serif;
  margin-right: auto;
}
.ebook-home {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  color: var(--navy);
}
.ebook-header .ebook-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--orange);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
}
.reader-workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  height: calc(100dvh - 144px);
  background: #eeeef1;
  min-height: 0;
}
.reader-workspace.contents-open {
  grid-template-columns: 300px minmax(0, 1fr);
}
.ebook-index {
  min-width: 0;
  height: 100%;
  background: #fff;
  border-right: 1px solid var(--line);
  overflow: hidden;
  color: var(--navy);
}
.ebook-index[hidden] {
  display: none;
}
.ebook-index-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  height: 48px;
  padding: 8px 14px 8px 64px;
  border-bottom: 1px solid var(--line);
}
body.figma-final #main .ebook-index-head h2 {
  font:
    600 1rem/1.5 'Be Vietnam Pro',
    sans-serif;
  margin: 0;
  color: var(--navy);
}
.ebook-index-head button,
.ebook-index-float,
.ebook-dock button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  flex: 0 0 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  box-sizing: border-box;
}
.ebook-index-float {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 3;
  box-shadow: 0 3px 12px #150f3d12;
}
.ebook-index-links {
  height: calc(100% - 49px);
  overflow: auto;
  padding: 12px 12px 24px;
  overscroll-behavior: contain;
}
.ebook-index-links a,
.ebook-index-links summary {
  display: block;
  color: var(--navy);
  font-size: 0.875rem;
  line-height: 1.65;
  padding: 10px 12px;
  text-decoration: none;
  cursor: pointer;
  border-radius: 4px;
}
.ebook-index-links summary {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  font-weight: 600;
  list-style: none;
}
.ebook-index-links summary::-webkit-details-marker {
  display: none;
}
.ebook-index-links summary .ui-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}
.ebook-index-links details[open] > summary .ui-icon {
  transform: rotate(180deg);
}
.ebook-index-links details > a {
  padding-left: 24px;
  font-size: 0.8125rem;
}
.ebook-index-links a:hover,
.ebook-index-links summary:hover {
  background: #150f3d08;
}
.ebook-index-links a.selected {
  background: #f0612414;
  color: var(--navy);
  box-shadow: inset 2px 0 var(--orange);
}
.ebook-viewport {
  position: relative;
  min-width: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  padding: 12px 16px;
  box-sizing: border-box;
}
.ebook-stack {
  position: relative;
  min-width: 0;
  max-width: none;
  margin: 0 auto;
}
.ebook-page {
  position: relative;
  margin: 0 0 16px;
  background: #fff;
  box-shadow: 0 2px 14px #150f3d16;
}
.ebook-page img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}
.ebook-page figcaption {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 0.625rem;
  color: var(--navy);
  background: #ffffffe8;
  padding: 1px 4px;
  border-radius: 3px;
  pointer-events: none;
}
.ebook-dock {
  position: fixed;
  z-index: 50;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: calc(100% - 24px);
  height: 56px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 6px 24px #150f3d14;
  border-radius: 10px;
  box-sizing: border-box;
  color: var(--navy);
}
.ebook-dock button:hover:not(:disabled),
.ebook-index-head button:hover,
.ebook-index-float:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: #f061240a;
}
.ebook-dock button:active:not(:disabled) {
  background: #f0612418;
}
.ebook-dock button:disabled {
  opacity: 0.35;
  cursor: default;
}
.ebook-dock .ui-icon {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
}
.ebook-dock #previous-page .ui-icon {
  transform: rotate(90deg);
}
.ebook-dock #next-page .ui-icon {
  transform: rotate(-90deg);
}
.ebook-page-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  white-space: nowrap;
}
body.figma-final .ebook-page-field input {
  width: 46px;
  height: 40px;
  min-height: 40px;
  padding: 0 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.875rem;
  text-align: center;
  color: var(--navy);
  background: #fff;
  appearance: textfield;
  -moz-appearance: textfield;
}
.ebook-page-field input::-webkit-inner-spin-button,
.ebook-page-field input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ebook-dock-divider {
  height: 24px;
  width: 1px;
  background: var(--line);
  margin-inline: 3px;
}
#ebook-zoom-label {
  min-width: 43px;
  text-align: center;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.ebook-dock #mobile-ebook-index {
  display: none;
}
@media (max-width: 1000px) and (min-width: 761px) {
  .reader-workspace.contents-open {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .ebook-header {
    height: 64px;
    padding: 0 12px;
    gap: 8px;
  }
  .ebook-header strong {
    font-size: 0.8125rem;
    max-width: 180px;
  }
  .ebook-header .ebook-download {
    font-size: 0.75rem;
    padding-inline: 10px;
    white-space: nowrap;
  }
  .ebook-header .ebook-download .ui-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }
  .reader-workspace,
  .reader-workspace.contents-open {
    grid-template-columns: minmax(0, 1fr);
    height: calc(100dvh - 118px - env(safe-area-inset-bottom, 0px));
  }
  .ebook-index-float {
    display: none;
  }
  .ebook-dock {
    gap: 3px;
    padding: 6px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100% - 12px);
    height: 54px;
  }
  .ebook-dock #mobile-ebook-index {
    display: grid;
  }
  .ebook-dock #ebook-zoom-label {
    display: none;
  }
  .ebook-dock-divider {
    margin-inline: 0;
  }
  .ebook-page-field {
    gap: 3px;
    font-size: 0.75rem;
  }
  body.figma-final .ebook-page-field input {
    width: 38px;
    font-size: 0.875rem;
  }
  .ebook-index {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: min(65dvh, 560px);
    z-index: 60;
    border: 1px solid var(--line);
    border-radius: 14px 14px 8px 8px;
    box-shadow: 0 -8px 35px #150f3d24;
    animation: ebook-sheet-in 0.22s ease-out;
  }
  .ebook-index-head {
    padding-left: 20px;
  }
  .ebook-index-links {
    height: calc(100% - 49px);
  }
  .ebook-index-links a,
  .ebook-index-links summary {
    font-size: 1rem;
  }
  .ebook-index-links details > a {
    font-size: 0.9375rem;
  }
}
@media (max-width: 360px) {
  .ebook-dock {
    gap: 2px;
    padding: 4px;
    max-width: calc(100% - 8px);
  }
  .ebook-dock-divider {
    display: none;
  }
  .ebook-page-field > span:last-child {
    display: none;
  }
  .ebook-header {
    gap: 4px;
    padding: 0 8px;
  }
  .ebook-home {
    width: 32px;
    flex-basis: 32px;
  }
  .ebook-header strong {
    font-size: 0.75rem;
  }
  .ebook-header .ebook-download {
    padding-inline: 8px;
  }
}
@keyframes ebook-sheet-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ebook-index {
    animation: none;
  }
}
/* Keep legacy mobile navigation selectors out of the dedicated reader chrome. */
body.luxury-site.option-two.figma-final.reading-mode .shell > header {
  display: none !important;
}
body.figma-final.reading-mode #main .ebook-index {
  display: flex;
  flex-direction: column;
  gap: 0;
}
body.figma-final.reading-mode #main .ebook-index[hidden] {
  display: none;
}
body.figma-final.reading-mode #main .ebook-index-links {
  flex: 1;
  min-height: 0;
}
@media (max-width: 760px) {
  body.figma-final.reading-mode #main .ebook-index-float {
    display: none;
  }
}
