.flipbook-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: rgba(15, 18, 22, 0.94);
  user-select: none;
  -webkit-user-select: none;
}
.flipbook-modal.is-open {
  display: flex;
}

body.flipbook-open {
  overflow: hidden;
}

.flipbook-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
}
.flipbook-toolbar .flipbook-title {
  position: absolute;
  left: 16px;
  max-width: 45%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #f2f2f2;
  font-size: 15px;
}
.flipbook-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  line-height: 1;
}
.flipbook-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
.flipbook-btn.flipbook-close {
  position: absolute;
  right: 16px;
}
.flipbook-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.flipbook-btn--text {
  width: auto;
  padding: 0 12px;
  font-size: 14px;
}
.flipbook-count,
.flipbook-percent {
  color: #f2f2f2;
  font-size: 14px;
  min-width: 56px;
  text-align: center;
}
.flipbook-sep {
  color: rgba(255, 255, 255, 0.35);
  margin: 0 4px;
}

.flipbook-stage {
  flex: 1 1 auto;
  /* always scrollable: a page fitted to width can be taller than the viewport */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  text-align: center;
  cursor: grab;
}
.flipbook-stage.is-panning {
  cursor: grabbing;
}

.flipbook-zoom {
  display: inline-block;
}

.flipbook-book {
  margin: 0 auto;
}
.flipbook-book canvas {
  display: block;
}

.flipbook-loading {
  color: #ddd;
  font-size: 15px;
  text-align: center;
}

@media (max-width: 767px) {
  .flipbook-stage {
    padding: 8px;
    align-items: flex-start;
  }
  .flipbook-toolbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 12px;
  }
  .flipbook-toolbar .flipbook-title {
    display: none;
  }
  .flipbook-controls {
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
  }
  .flipbook-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .flipbook-btn--text {
    padding: 0 8px;
    font-size: 13px;
  }
  .flipbook-count,
  .flipbook-percent {
    min-width: auto;
    font-size: 13px;
  }
  .flipbook-sep {
    display: none;
  }
  /* close leaves the absolute corner and joins the row so nothing overlaps */
  .flipbook-btn.flipbook-close {
    position: static;
  }
  .flipbook-btn[data-act="zoom-reset"] {
    display: none;
  }
}
