.document-reader {
  margin: 18px 0;
  border: 1px solid #c7d4e6;
  border-radius: 14px;
  background: #fff;
  color: #24354e;
  overflow: clip;
  scroll-margin-block-start: 90px;
}
.document-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 11px 15px;
  background: #f8faff;
  border-bottom: 1px solid #dce4ef;
}
.document-heading h3 {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
  overflow-wrap: anywhere;
  min-width: 0;
}
.document-state {
  grid-column: 1;
  font-size: 12px;
  color: #60718a;
  overflow-wrap: anywhere;
}
.document-state:empty {
  display: none;
}
.document-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}
.document-menu {
  position: relative;
  margin: 0;
  border: 0;
  padding: 0;
}
.document-menu > summary {
  list-style: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.document-menu > summary::-webkit-details-marker {
  display: none;
}
.document-menu > summary:hover,
.document-menu[open] > summary {
  background: #e9eff8;
}
.document-menu-items {
  position: absolute;
  right: 0;
  top: 40px;
  z-index: 20;
  min-width: 175px;
  padding: 6px;
  background: #fff;
  border: 1px solid #c7d4e6;
  border-radius: 11px;
  box-shadow: 0 8px 28px #1d355324;
}
.document-menu-items button,
.document-menu-items a,
.document-menu-items span {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #253c5e;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.document-menu-items button:hover,
.document-menu-items a:hover {
  background: #edf2fa;
}
.document-menu-items span {
  color: #61728b;
}
.document-stage {
  position: relative;
  background: #f2f5fa;
  outline-offset: 3px;
}
.document-stage-limited:focus-visible {
  outline: 2px solid #527399;
  outline-offset: -2px;
}
.document-visual {
  padding: 10px;
  overflow-x: auto;
}
.document-page {
  position: relative;
  margin: 0;
  width: 100%;
  background: #fff;
  box-shadow: 0 1px 5px #18324c12;
}
.document-page img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  margin: 0;
  user-select: none;
  -webkit-user-drag: none;
}
.document-image-trigger {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}
.document-image-trigger:focus-visible {
  outline: 2px solid var(--accent, #285ca4);
  outline-offset: 3px;
}
.document-image-crop {
  display: block;
  position: relative;
  width: 100%;
  overflow: hidden;
  background: white;
}
.document-image-crop > img {
  position: absolute;
  display: block;
  height: auto;
  max-width: none;
}
.document-zoom {
  width: min(76rem, calc(100% - 2rem));
  max-height: 92dvh;
  max-width: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d2dce8;
  border-radius: 12px;
  background: #fff;
}
.document-zoom::backdrop {
  background: #142930b3;
}
.document-zoom > header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid #d2dce8;
}
.document-zoom > header > :last-child {
  margin-inline-start: auto;
}
.document-zoom output {
  min-width: 4ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.document-zoom-gesture {
  display: none;
  color: #4a6073;
  font-size: 0.875rem;
}
@media (pointer: fine) and (min-width: 720px) {
  .document-zoom-gesture {
    display: inline;
  }
}
.document-zoom-viewport {
  height: min(72dvh, calc(92dvh - 5.5rem), 45rem);
  padding: 0.8rem;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: #eef2f5;
}
.document-zoom-image {
  margin-inline: auto;
  cursor: grab;
  user-select: none;
}
.document-zoom-image.is-grabbing {
  cursor: grabbing;
}
.document-zoom-image > img {
  display: block;
  width: 100%;
  height: auto;
}
.document-page-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 16px;
  font-size: 13px;
  color: #586c86;
}
.document-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  pointer-events: none;
}
.document-edge-previous {
  left: 0;
}
.document-edge-next {
  right: 0;
}
.document-arrow {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #ffffffbf;
  border-radius: 50%;
  background: #ffffffb8;
  color: #23468b;
  box-shadow: 0 3px 16px #15355626;
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  opacity: 0;
  transition:
    opacity 0.14s ease,
    background 0.14s ease;
  cursor: pointer;
}
.document-arrow .icon {
  width: 24px;
  height: 24px;
  margin: 0;
  opacity: 0.9;
}
.document-lesson-arrow {
  gap: 0;
  align-content: center;
  background: #214681;
  border-color: #214681;
  color: #fff;
  font-size: 0.625rem;
  line-height: 1.05;
  text-decoration: none;
  opacity: 1;
}
.document-stage-limited .document-arrow {
  width: 44px;
  height: 44px;
}
.document-lesson-arrow .icon {
  width: 17px;
  height: 17px;
  opacity: 1;
}
.document-lesson-arrow small {
  font: inherit;
  color: inherit;
}
.document-stage:hover .document-arrow,
.document-stage:focus-within .document-arrow {
  opacity: 0.9;
}
.document-arrow:hover {
  background: #ffffffed;
  box-shadow: 0 4px 18px #15355635;
}
.document-stage :is(.document-lesson-arrow:hover, .document-lesson-arrow:focus-visible) {
  background: #183969;
  color: #fff;
  opacity: 1;
}
.document-stage-limited .document-position {
  white-space: nowrap;
}
.document-arrow[aria-disabled='true'] {
  cursor: default;
}
.document-stage:hover .document-arrow[aria-disabled='true'],
.document-stage:focus-within .document-arrow[aria-disabled='true'] {
  opacity: 0.2;
}
.document-position {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 4px 11px;
  border: 1px solid #ffffff9c;
  border-radius: 99px;
  background: #ffffffb8;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12px;
  line-height: 1.5;
  color: #42546f;
  box-shadow: 0 1px 8px #17304712;
  pointer-events: none;
}
.document-warning {
  font-size: 12px;
  line-height: 1.7;
  padding: 9px 14px;
  margin: 0;
  background: #fff9ef;
  color: #775a2e;
  border-bottom: 1px solid #ecdfc9;
}
.document-fallback {
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.document-fallback p {
  flex-basis: 100%;
  margin: 0 0 5px;
  line-height: 1.7;
}
.document-page-text {
  padding: 16px;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.8;
}
.document-range-fields {
  min-width: 0;
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid #d2dce8;
  border-radius: 7px;
}
#modal:has(.document-settings-form) {
  width: min(36rem, calc(100% - 24px));
}
.document-range-fields legend {
  padding-inline: 4px;
  font-weight: 600;
}
.document-range-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.document-range-fields .help {
  margin: 8px 0 0;
}
.document-delivery-settings {
  margin-block: 10px;
}
.document-delivery-settings summary {
  cursor: pointer;
}
.document-format-note {
  margin: 0;
  padding: 7px 13px;
  border: 0;
  font-size: 0.8rem;
  color: #425a73;
  background: #f6f8fb;
}
.document-format-note summary {
  cursor: pointer;
}
.document-format-note p {
  margin: 6px 0 0;
}
@supports not (backdrop-filter: blur(1px)) {
  .document-arrow:not(.document-lesson-arrow),
  .document-position {
    background: #fffffff0;
  }
}
@media (max-width: 700px) {
  .document-heading {
    padding: 9px 11px;
    gap: 7px;
  }
  .document-heading h3 {
    font-size: 14px;
  }
  .document-state {
    font-size: 11px;
  }
  .document-visual {
    padding: 6px;
  }
  .document-stage {
    padding-bottom: 56px;
  }
  .document-edge {
    width: 52px;
    top: auto;
    bottom: 4px;
    height: 48px;
  }
  .document-arrow {
    opacity: 0.85;
    width: 42px;
    height: 42px;
    border-color: #96a9be;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .document-arrow[aria-disabled='true'] {
    opacity: 0.18;
  }
  .document-stage-limited .document-lesson-arrow {
    background: #214681;
    border-color: #214681;
    color: #fff;
  }
  .document-position {
    bottom: 16px;
    font-size: 12px;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
@media (hover: none), (pointer: coarse) {
  .document-arrow {
    opacity: 0.85;
  }
  .document-arrow[aria-disabled='true'] {
    opacity: 0.18;
  }
}
@media (prefers-reduced-motion: reduce) {
  .document-arrow {
    transition: none;
  }
}
@media (forced-colors: active) {
  .document-arrow,
  .document-position {
    background: Canvas;
    color: CanvasText;
    border: 1px solid ButtonText;
  }
  .document-arrow {
    opacity: 1;
  }
}
@media print {
  .document-reader {
    display: none !important;
  }
}
