.bv-reader-navigation {
  display: grid !important;
  grid-template-columns: repeat(4, max-content);
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
}

.viewer-controls-shell .bv-reader-navigation > .bv-btn {
  min-width: 72px;
  height: 38px;
  padding-inline: 12px;
}

.viewer-controls-shell .bv-reader-navigation > #pageJump {
  width: 64px !important;
  min-width: 64px;
  height: 38px;
}

#viewer .viewer-stack {
  position: relative !important;
}

.bv-reader-progress-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px 24px;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  height: 28px;
  margin: 0;
  padding: 0 5px;
  box-sizing: border-box;
  border: 0;
  border-top: 1px solid rgba(55, 64, 73, 0.15);
  background: rgba(246, 242, 232, 0.28);
  box-shadow: 0 -1px 6px rgba(25, 29, 33, 0.035);
  opacity: 0.84;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition:
    height 160ms ease,
    padding 160ms ease,
    background-color 160ms ease,
    opacity 160ms ease;
  isolation: isolate;
}

.bv-reader-progress-strip.is-expanded {
  grid-template-columns: minmax(0, 1fr) 38px 28px;
  height: 42px;
  padding: 3px 6px;
  background: rgba(246, 242, 232, 0.52);
  opacity: 1;
}

.bv-reader-progress-strip.is-hidden {
  display: none;
}

#viewer .bv-reader-bookmark {
  width: 30px;
  min-width: 30px !important;
  height: 30px;
  min-height: 30px !important;
  display: inline-grid;
  place-items: center;
  justify-self: end;
  padding: 0 !important;
  border: 1px solid rgba(81, 88, 91, 0.34) !important;
  border-bottom: 1px solid rgba(81, 88, 91, 0.34) !important;
  border-radius: 5px;
  background: rgba(255, 253, 247, 0.52) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--bv-text-muted, #55606f);
  text-transform: none !important;
  transform: none !important;
  transition:
    width 160ms ease,
    height 160ms ease,
    background-color 140ms ease,
    color 140ms ease;
}

#viewer .bv-reader-progress-strip.is-expanded .bv-reader-bookmark {
  width: 36px;
  height: 36px;
}

.bv-reader-bookmark__icon {
  width: 17px;
  height: 17px;
  display: block;
  overflow: visible;
}

.bv-reader-bookmark__icon path {
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linejoin: round;
  transition: fill 140ms ease, stroke 140ms ease;
}

#viewer .bv-reader-bookmark[aria-pressed="true"] {
  color: #fff8e8 !important;
  border-color: rgba(75, 99, 71, 0.72) !important;
  background: rgba(75, 99, 71, 0.88) !important;
}

#viewer .bv-reader-bookmark[aria-pressed="true"] .bv-reader-bookmark__icon path {
  fill: currentColor;
  stroke: currentColor;
}

#viewer .bv-reader-progress-hide,
#viewer .bv-reader-progress-restore {
  display: inline-grid;
  place-items: center;
  margin: 0;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-bottom: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  text-transform: none !important;
  transform: none !important;
  color: rgba(58, 65, 70, 0.66);
  font: 700 15px/1 "Courier Prime", monospace;
  cursor: pointer;
}

#viewer .bv-reader-progress-hide {
  width: 22px;
  min-width: 22px;
  height: 24px;
  justify-self: end;
  border-radius: 5px;
}

#viewer .bv-reader-progress-strip.is-expanded .bv-reader-progress-hide {
  width: 26px;
  height: 30px;
}

#viewer .bv-reader-progress-hide:hover,
#viewer .bv-reader-progress-hide:focus-visible,
#viewer .bv-reader-progress-restore:hover,
#viewer .bv-reader-progress-restore:focus-visible {
  color: #2f3c34;
  background: rgba(75, 99, 71, 0.10) !important;
  outline: 1px solid rgba(75, 99, 71, 0.26);
  outline-offset: 1px;
}

#viewer .bv-reader-progress-restore {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 13;
  width: 38px;
  height: 20px;
  min-height: 0 !important;
  margin: 0;
  transform: translateX(-50%) !important;
  border-radius: 6px 6px 0 0;
  background: rgba(246, 242, 232, 0.32) !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

#viewer .bv-reader-progress-restore[hidden] {
  display: none !important;
}

.bv-reader-progress {
  display: grid;
  grid-template-columns: 38px minmax(120px, 1fr) 34px;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--bv-text-muted, #55606f);
  font: 700 10px/1 "Courier Prime", monospace;
}

.bv-reader-progress-strip.is-expanded .bv-reader-progress {
  grid-template-columns: 42px minmax(120px, 1fr) max-content;
  gap: 9px;
  font-size: 11px;
}

.bv-reader-progress__percent {
  text-align: right;
  opacity: 0.78;
}

.bv-reader-progress__total {
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  opacity: 0.78;
}

.bv-reader-progress-strip.is-expanded .bv-reader-progress__percent,
.bv-reader-progress-strip.is-expanded .bv-reader-progress__total {
  opacity: 1;
}

.bv-reader-progress__rail {
  position: relative;
  min-width: 0;
  height: 24px;
  transition: height 160ms ease;
}

.bv-reader-progress-strip.is-expanded .bv-reader-progress__rail {
  height: 34px;
}

.bv-reader-progress__heat {
  position: absolute;
  inset: 9px 0 auto;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(55, 64, 73, 0.14);
  opacity: 0.82;
  pointer-events: none;
  transition: height 160ms ease, top 160ms ease, opacity 160ms ease;
}

.bv-reader-progress-strip.is-expanded .bv-reader-progress__heat {
  top: 13px;
  height: 8px;
  opacity: 1;
}

#viewer .bv-reader-progress__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 24px;
  min-height: 0 !important;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  cursor: pointer;
  touch-action: none;
  transition: height 160ms ease;
}

#viewer .bv-reader-progress-strip.is-expanded .bv-reader-progress__range {
  height: 34px;
}

#viewer .bv-reader-progress__range::-webkit-slider-runnable-track {
  height: 2px;
  background: rgba(44, 53, 61, 0.38);
}

#viewer .bv-reader-progress__range::-moz-range-track {
  height: 2px;
  background: rgba(44, 53, 61, 0.38);
}

#viewer .bv-reader-progress__range::-webkit-slider-thumb {
  width: 10px;
  height: 10px;
  margin-top: -4px;
  border: 2px solid #f7f3e9;
  border-radius: 50%;
  background: var(--bv-accent-primary, #526fe5);
  box-shadow: 0 1px 4px rgba(22, 25, 29, 0.32);
  appearance: none;
  -webkit-appearance: none;
  transition: width 140ms ease, height 140ms ease, margin 140ms ease;
}

#viewer .bv-reader-progress__range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid #f7f3e9;
  border-radius: 50%;
  background: var(--bv-accent-primary, #526fe5);
  box-shadow: 0 1px 4px rgba(22, 25, 29, 0.32);
  transition: width 140ms ease, height 140ms ease;
}

#viewer .bv-reader-progress-strip.is-expanded .bv-reader-progress__range::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -6px;
}

#viewer .bv-reader-progress-strip.is-expanded .bv-reader-progress__range::-moz-range-thumb {
  width: 14px;
  height: 14px;
}

.bv-reader-progress__markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bv-reader-progress__marker {
  position: absolute;
  top: 3px;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
  transition: top 160ms ease, height 160ms ease;
}

.bv-reader-progress-strip.is-expanded .bv-reader-progress__marker {
  top: 7px;
  height: 24px;
}

.bv-reader-progress__marker::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 3px;
  width: 2px;
  height: 11px;
  border-radius: 2px;
  background: #2f3c34;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.68);
  transition: height 160ms ease;
}

.bv-reader-progress-strip.is-expanded .bv-reader-progress__marker::before {
  height: 15px;
}

.bv-reader-progress__bubble {
  position: absolute;
  bottom: 25px;
  z-index: 5;
  max-width: min(250px, 80vw);
  transform: translateX(-50%);
  padding: 6px 8px;
  border: 1px solid rgba(57, 65, 71, 0.22);
  border-radius: 7px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 4px 14px rgba(25, 29, 33, 0.16);
  color: #30363c;
  white-space: nowrap;
  font-size: 11px;
}

.bv-reader-progress-strip.is-expanded .bv-reader-progress__bubble {
  bottom: 34px;
}

.bv-reader-progress-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10020;
  transform: translateX(-50%);
  padding: 9px 13px;
  border: 1px solid rgba(62, 72, 66, 0.24);
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 0 6px 20px rgba(25, 29, 33, 0.18);
  color: #30363c;
  font: 700 12px/1.25 "Courier Prime", monospace;
}

.bv-reader-progress-toast--error {
  color: #842f2f;
}

.bv-card__reading-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 7px;
  color: var(--bv-text-muted, #5d6874);
  font: 700 11px/1.35 "Courier Prime", monospace;
}

@media (max-width: 760px) {
  .bv-reader-navigation {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .viewer-controls-shell .bv-reader-navigation > .bv-btn {
    min-width: 0;
    min-height: 42px;
    height: 42px;
    padding-inline: 8px;
  }

  .viewer-controls-shell .bv-reader-navigation > #pageJump {
    width: 100% !important;
    min-width: 0;
    height: 42px;
  }

  .bv-reader-progress-strip {
    grid-template-columns: minmax(0, 1fr) 38px 30px;
    height: 30px;
    gap: 3px;
    margin-top: 3px;
    padding: 0 2px;
  }

  .bv-reader-progress-strip.is-expanded {
    grid-template-columns: minmax(0, 1fr) 44px 34px;
    height: 44px;
    padding: 3px 3px;
  }

  .bv-reader-progress {
    grid-template-columns: 34px minmax(82px, 1fr) 28px;
    gap: 4px;
  }

  .bv-reader-progress-strip.is-expanded .bv-reader-progress {
    grid-template-columns: 38px minmax(82px, 1fr) max-content;
    gap: 5px;
  }

  .bv-reader-bookmark {
    width: 36px;
    height: 36px;
    min-height: 36px;
  }

  #viewer .bv-reader-progress-strip.is-expanded .bv-reader-bookmark {
    width: 42px;
    height: 42px;
  }

  #viewer .bv-reader-progress-hide {
    width: 28px;
    min-width: 28px;
    height: 28px;
  }

  #viewer .bv-reader-progress-strip.is-expanded .bv-reader-progress-hide {
    width: 32px;
    height: 38px;
  }

  .bv-reader-progress-restore {
    width: 42px;
    height: 24px;
  }
}

@media (max-width: 520px) {
  .bv-reader-progress-strip.is-expanded .bv-reader-progress__total {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@supports not (backdrop-filter: blur(5px)) {
  .bv-reader-progress-strip {
    background: rgba(246, 242, 232, 0.58);
  }

  .bv-reader-progress-strip.is-expanded {
    background: rgba(246, 242, 232, 0.72);
  }

  .bv-reader-progress-restore {
    background: rgba(246, 242, 232, 0.58);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bv-reader-progress-strip,
  .bv-reader-bookmark,
  .bv-reader-progress__rail,
  .bv-reader-progress__heat,
  .bv-reader-progress__range,
  #viewer .bv-reader-progress__range::-webkit-slider-thumb,
  #viewer .bv-reader-progress__range::-moz-range-thumb,
  .bv-reader-progress__marker,
  .bv-reader-progress__marker::before {
    transition-duration: 1ms !important;
  }
}
