.my-slider {
  width: 80%;
  max-width: 300px;
  height: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  margin: 20px auto;
}
.my-slider .thumbnail {
  width: 115px;
  height: 85px;
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  top: -100px;
  left: -17px;
  display: none;
  transform: translate3d(0px, 50px, 0px) scale(0.1, 0.1);
  transition: transform 0.2s;
  border-radius: 5px;
}
.my-slider .thumbnail div {
  width: 100px;
  margin: 7px;
  height: 70px;
  background-color: white;
}
.my-slider .thumbnail .thumbnail-page {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  padding: 2px 8px;
  border-radius: 9px;
  pointer-events: none;
  white-space: nowrap;
}
.my-slider .ui-state-hover .thumbnail {
  display: block;
  opacity: 0;
}
.my-slider * .ui-state-active .thumbnail {
  display: block;
  opacity: 1;
  transform: scale(1, 1);
}
.my-slider .ui-widget-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.my-slider .ui-slider {
  position: relative;
  text-align: left;
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
}
.my-slider .ui-slider-handle {
  position: absolute;
  z-index: 0;
  width: 80px;
  height: 30px;
  cursor: default;
  border-radius: 5px;
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
}
.my-slider .ui-slider-horizontal {
  height: 8px;
  width: 100%;
}
.my-slider .ui-slider-horizontal .ui-slider-handle {
  margin-left: -40px;
  margin-top: -12px;
}
.my-slider .ui-slider-handle {
  border: 1px solid white;
  background-color: black;
  opacity: 0.2;
  display: block;
  transition: opacity 0.2s;
}
.my-slider .ui-state-hover {
  opacity: 0.4;
}
.my-slider .ui-state-active {
  opacity: 1;
}

.no-transition {
  transition: none;
}

.toc-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 280px;
  max-width: 80vw;
  background: #fff;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 2000;
  display: flex;
  flex-direction: column;
}

.toc-panel--open {
  transform: translateX(0);
}

.toc-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #eee;
}

.toc-panel__title {
  font-weight: normal;
  letter-spacing: 1em;
  font-size: 0.8rem;
}

.toc-panel__close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.toc-panel__tabs {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 0 14px;
  border-bottom: 1px solid #eee;
}

.toc-panel__tab {
  border: 0;
  background: transparent;
  padding: 3px 12px;
  cursor: pointer;
  opacity: 0.4;
  border-bottom: 2px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
}
.toc-panel__tab img {
  width: 28px;
  height: 28px;
}
.toc-panel__tab:hover {
  opacity: 0.7;
}
.toc-panel__tab--active {
  opacity: 1;
  border-bottom-color: #333;
}

.toc-panel__thumbs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 12px 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.toc-thumb {
  position: relative;
  flex-shrink: 0;
  border: 1px solid #ddd;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.toc-thumb:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.toc-thumb__page {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 1px 0;
  line-height: 1.4;
}

.toc-panel__list {
  list-style: none;
  margin: 0;
  padding: 8px 0 130px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
}
.toc-panel__list li {
  margin: 0;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  border-bottom: 1px solid #f5f5f5;
}
.toc-panel__list li:hover {
  background: #f7f7f7;
}
.toc-panel__list .toc__title {
  overflow: visible;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}
.toc-panel__list .toc__page {
  color: #ddd;
  font-size: 0.8em;
  font-weight: normal;
  min-width: 2.5em;
  text-align: right;
  white-space: nowrap;
  align-self: flex-start;
}

body {
  overflow: hidden;
  background-color: #fcfcfc;
  margin: 0;
  padding: 0;
}

#canvas {
  height: calc(100vh - 100px);
}

.conpane {
  display: block;
  height: 100px;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.btns {
  display: flex;
  justify-content: center;
  list-style-type: none;
  padding: 0;
  margin: 0;
  opacity: 0.6;
  transition: all 0.5s;
}
.btns:hover {
  opacity: 1;
}

.btns__item {
  display: flex;
  justify-content: center;
  align-items: center;
}
.btns__item.btns__btn {
  cursor: pointer;
  border-radius: 50%;
  transition: 0.2s all;
}
.btns__item.btns__btn:hover {
  background-color: #ddd;
}

.btns__img {
  width: 2.5rem;
  height: auto;
}
@media (max-width: 768px) {
  .btns__img {
    width: 2.2rem;
  }
}

.btns__page {
  font-size: 1.2rem;
  padding: 0 1rem;
}

.book-viewport .container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 922px;
  height: 600px;
  margin: auto;
}
.book-viewport .book {
  width: 922px;
  height: 600px;
  left: -461px;
  top: -300px;
}
.book-viewport .page {
  width: 461px;
  height: 600px;
  background-color: white;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.book-viewport .page img {
  user-select: none;
  margin: 0;
}
.book-viewport .zoomer .region {
  display: none;
}
.book-viewport .zoom-in .even .gradient,
.book-viewport .zoom-in .odd .gradient {
  display: none;
}
.book-viewport .zoom-in .next-button,
.book-viewport .zoom-in .previous-button {
  display: none;
}
.book-viewport .loader {
  background-image: url(../img/loader.gif);
  width: 22px;
  height: 22px;
  position: absolute;
  top: 280px;
  left: 219px;
}
.book-viewport .shadow {
  transition: box-shadow 0.5s;
  box-shadow: 0 0 20px #ccc;
}
.book-viewport .next-button,
.book-viewport .previous-button {
  width: 22px;
  height: 600px;
  position: absolute;
  top: 0;
}
.book-viewport .next-button {
  right: -22px;
  border-radius: 0 15px 15px 0;
}
.book-viewport .previous-button {
  left: -22px;
  border-radius: 15px 0 0 15px;
}
.book-viewport .previous-button-hover,
.book-viewport .next-button-hover {
  background-color: rgba(0, 0, 0, 0.2);
}
.book-viewport .previous-button-hover,
.book-viewport .previous-button-down {
  background-image: url(../img/arrows.png);
  background-position: -4px 284px;
  background-repeat: no-repeat;
}
.book-viewport .previous-button-down,
.book-viewport .next-button-down {
  background-color: rgba(0, 0, 0, 0.4);
}
.book-viewport .next-button-hover,
.book-viewport .next-button-down {
  background-image: url(../img/arrows.png);
  background-position: -38px 284px;
  background-repeat: no-repeat;
}

.book .region {
  display: block;
  position: absolute;
  overflow: hidden;
  background: #0066FF;
  box-shadow: 0 0 4px 4px #0066FF;
  opacity: 0;
  border-radius: 5px;
  cursor: pointer;
  transition: opacity 0.2s ease-out;
}
.book .region:hover {
  opacity: 0.3;
}
.book .region.zoom {
  opacity: 0.01;
}
.book .region.zoom:hover {
  opacity: 0.2;
}
.book .page {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}
.book .even .gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(90deg, rgba(0, 0, 0, 0) 95%, rgba(0, 0, 0, 0.1) 100%);
}
.book .odd .gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(-90deg, rgba(0, 0, 0, 0) 95%, rgba(0, 0, 0, 0.05) 100%);
}

.animated {
  transition: margin-left 0.5s;
}

.thumbnails {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 140px;
  z-index: 1;
}
.thumbnails > div {
  width: 1050px;
  height: 100px;
  margin: 20px auto;
}
.thumbnails ul {
  margin: 0;
  padding: 0;
  text-align: center;
  transform: scale3d(0.5, 0.5, 1);
  transition: transform ease-in-out 100ms;
}
.thumbnails li {
  list-style: none;
  display: inline-block;
  margin: 0 5px;
  box-shadow: 0 0 10px #ccc;
  transition: -webkit-transform 60ms;
}
.thumbnails li span {
  display: none;
}
.thumbnails .current {
  box-shadow: 0 0 10px red;
}
.thumbnails .thumb-hover {
  transform: scale3d(1.3, 1.3, 1);
  box-shadow: 0 0 10px #666;
}
.thumbnails .thumb-hover span {
  position: absolute;
  bottom: -30px;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 30px;
  font: bold 15px arial;
  line-height: 30px;
  color: #666;
  display: block;
  cursor: default;
}
.thumbnails img {
  float: left;
}

.thumbanils-touch ul {
  transform: none;
}

.thumbnails-hover ul {
  transform: scale3d(0.6, 0.6, 1);
}

.thumbanils-touch .thumb-hover {
  transform: none;
}

.pin {
  position: absolute;
  background-image: url(../img/maparrow.svg);
  background-size: cover;
  display: none;
  transition: all 0.5s ease-in;
  transform: translate(-50%, -100%) scale(1);
}

.pin--fire {
  transform: translate(-50%, -100%) scale(20);
  transition: all 0.5s ease-in;
}

.pin--crosshair.pin {
  background-image: url(../img/crosshair.svg);
  transform: translate(-50%, -50%) scale(1);
}
.pin--crosshair.pin--fire {
  transform: translate(-50%, -50%) scale(20);
}

.pin--mappin.pin {
  background-image: url(../img/mappin.svg);
  transform: translate(-50%, -100%) scale(1);
}
.pin--mappin.pin--fire {
  transform: translate(-50%, -100%) scale(20);
}

.pin--blink {
  animation: aniBlink 1s ease-in infinite;
}

@keyframes aniBlink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
.exit-message {
  position: absolute;
  top: 10px;
  left: 0;
  width: 100%;
  height: 40px;
  z-index: 10000;
}
.exit-message > div {
  width: 140px;
  height: 30px;
  margin: auto;
  background: rgba(0, 0, 0, 0.5);
  text-align: center;
  font: 12px arial;
  line-height: 30px;
  color: white;
  border-radius: 10px;
}

.zoom-icon {
  position: absolute;
  z-index: 1000;
  width: 22px;
  height: 22px;
  top: 10px;
  right: 10px;
  background-image: url(../img/zoom-icons.png);
  background-size: 88px 22px;
}

.zoom-icon-in {
  background-position: 0 0;
  cursor: pointer;
}
.zoom-icon-in.zoom-icon-in-hover {
  background-position: -22px 0;
  cursor: pointer;
}

.zoom-icon-out {
  background-position: -44px 0;
}
.zoom-icon-out.zoom-icon-out-hover {
  background-position: -66px 0;
  cursor: pointer;
}

.searchbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: 768px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
  transform: translate(-50%, 100%);
  transition: transform 0.25s ease;
  border-radius: 5px 5px 0 0;
  z-index: 3000;
}
.searchbar.searchbar--open {
  transform: translate(-50%, 0);
}

.searchbar__form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  flex-wrap: nowrap;
}

.searchbar__input {
  flex: 1 1 auto;
  font-size: 1rem;
  padding: 6px 10px;
  border-radius: 5px;
  border-width: 1px;
  min-width: 0;
  width: auto;
}

.searchbar__mode {
  font-size: 0.9rem;
}

.searchbar__submit,
.searchbar__close {
  padding: 6px 10px;
  font-size: 0.95rem;
  user-select: none;
}

.searchbar__submit {
  background-color: #000000;
  color: #ffffff;
  border: none;
  cursor: pointer;
  border-radius: 3px;
  flex: 0 0 auto;
}

.searchbar__close {
  cursor: pointer;
  background-color: transparent;
  border: none;
  flex: 0 0 auto;
}

@media (max-width: 480px) {
  .searchbar__form {
    gap: 6px;
    padding: 8px 10px;
  }
  .searchbar__submit, .searchbar__close {
    padding: 6px 8px;
  }
}
.audiobar {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: 768px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
  transform: translate(-50%, 100%);
  transition: transform 0.25s ease;
  border-radius: 5px 5px 0 0;
  z-index: 3000;
}
.audiobar.audiobar--open {
  transform: translate(-50%, 0);
}

.audiobar__inner {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
}

.audiobar__audio {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.audiobar__close {
  cursor: pointer;
  background-color: transparent;
  border: none;
  padding: 6px 10px;
  font-size: 0.95rem;
  user-select: none;
  flex: 0 0 auto;
}

@media (max-width: 480px) {
  .audiobar__inner {
    gap: 6px;
    padding: 8px 10px;
  }
  .audiobar__close {
    padding: 6px 8px;
  }
}
.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  z-index: 4000;
}

.search-modal--open {
  display: block;
}

.search-modal__dialog {
  position: absolute;
  top: 8vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 92vw);
  --search-dlg-h: 84vh;
  max-height: var(--search-dlg-h);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
@media (max-width: 768px) {
  .search-modal__dialog {
    top: 6vh;
    --search-dlg-h: 75vh;
  }
}

.search-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
}

.search-modal__title {
  font-weight: bold;
}

.search-modal__close {
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.search-modal__body {
  padding: 8px 0;
  overflow: auto;
  max-height: calc(var(--search-dlg-h) - 48px);
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-results li {
  padding: 10px 14px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
}

.search-results li:hover {
  background: #f7f7f7;
}

.search-result__title {
  color: #ddd;
  font-weight: normal;
  font-size: 0.8em;
  margin-right: 0.5em;
}

.search-result__page {
  color: #ddd;
  font-size: 0.8em;
  margin-left: 0.25em;
}

.search-result__snippet {
  color: #333;
  font-size: 0.95rem;
  line-height: 1.6;
}

.search-result__snippet mark {
  background: #ffec99;
}

.debugmode .book .region {
  opacity: 0.5;
}
.debugmode .book .region:hover {
  opacity: 0.7;
}