body.nc-pdf-page { margin: 0; padding: 0; }
/* All rules are scoped to the viewer so the existing theme keeps its styles. */
.nc-pdf {
  --nc-green: #005221;
  --nc-green-light: #edf4ef;
  --nc-border: #dce3de;
  --nc-text: #24382c;
  --nc-pdf-top: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  height: calc(100vh - var(--nc-pdf-top));
  height: calc(100dvh - var(--nc-pdf-top));
  min-height: 360px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--nc-text);
  background: #f0f2f0;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color-scheme: light;
  isolation: isolate;
}
.nc-pdf *, .nc-pdf *::before, .nc-pdf *::after { box-sizing: border-box; }
.nc-pdf [hidden] { display: none !important; }
/* Compact control groups; all action icons use the same button style. */
.nc-pdf .nc-pdf__toolbar {
  display: grid;
  grid-template-columns: minmax(46px, 1fr) auto auto minmax(134px, 1fr) auto;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
  min-height: 66px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--nc-border);
  background: #fff;
  z-index: 3;
}
.nc-pdf__controls { display: contents; }
.nc-pdf__sidebar-toggle { grid-column: 1; justify-self: start; }
.nc-pdf__navigation { grid-column: 2; }
.nc-pdf__view-controls { grid-column: 3; }
.nc-pdf__actions { grid-column: 4; justify-self: end; }
.nc-pdf__shop-top { grid-column: 5; }
.nc-pdf .nc-pdf__shop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 10px;
  min-height: 48px;
  max-width: 100%;
  margin: 0;
  padding: 12px 22px;
  border: 1px solid #005728;
  border-radius: 999px;
  color: #fff;
  background: #005728;
  box-shadow: none;
  font: 700 14px/1.5 "Open Sans", Arial, sans-serif;
  letter-spacing: normal;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.nc-pdf__shop svg { display: block; width: 19px; height: 19px; flex-shrink: 0; }
.nc-pdf .nc-pdf__shop:hover { color: #fff; background: #004520; border-color: #004520; }
.nc-pdf .nc-pdf__shop:active { background: #00391b; }
.nc-pdf__shop-bottom { margin-top: 20px; text-align: center; }
.nc-pdf__view-controls { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nc-pdf__actions, .nc-pdf__group {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0;
  min-width: 0;
  border: 1px solid #e3e9e5;
  border-radius: 11px;
  background: #f6f8f6;
}
.nc-pdf .nc-pdf__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--nc-green);
  background: transparent;
  box-shadow: none;
  font: 600 13px/1 "Open Sans", Arial, sans-serif;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.nc-pdf .nc-pdf__button svg { display: block; width: 20px; height: 20px; flex-shrink: 0; pointer-events: none; }
@media (hover: hover) {
  .nc-pdf .nc-pdf__button:hover:not(:disabled),
  .nc-pdf .nc-pdf__scale:hover { background: #e7efe9; }
}
.nc-pdf .nc-pdf__button:active:not(:disabled) { background: #dce9df; }
.nc-pdf .nc-pdf__button[aria-expanded="true"] { background: var(--nc-green-light); }
.nc-pdf .nc-pdf__button:disabled { opacity: .3; cursor: default; }
.nc-pdf .nc-pdf__counter {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding-inline: 2px 6px;
  color: #617367;
  font-size: 12px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.nc-pdf .nc-pdf__page-input {
  width: 36px;
  height: 32px;
  min-height: 0;
  margin: 0;
  padding: 0 2px;
  border: 1px solid #e0e7e2;
  border-radius: 7px;
  color: var(--nc-text);
  background: #fff;
  box-shadow: none;
  font: 400 16px/1.5 "Open Sans", Arial, sans-serif;
  text-align: center;
  appearance: textfield;
}
.nc-pdf__page-input::-webkit-inner-spin-button, .nc-pdf__page-input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.nc-pdf__select { position: relative; flex: 1 1 auto; min-width: 0; }
.nc-pdf .nc-pdf__scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 116px;
  height: 44px;
  min-height: 0;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-inline: 1px solid #e3e9e5;
  border-radius: 0;
  color: var(--nc-text);
  background: transparent;
  box-shadow: none;
  font: 600 13px/1.5 "Open Sans", Arial, sans-serif;
  text-align: start;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.nc-pdf__scale svg { display: block; width: 16px; height: 16px; color: #617367; transition: transform .15s; }
.nc-pdf__scale[aria-expanded="true"] svg { transform: rotate(180deg); }
.nc-pdf .nc-pdf__scale-list {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 50%;
  z-index: 4;
  width: max(100%, 180px);
  max-height: min(340px, calc(100dvh - 150px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
  border: 1px solid var(--nc-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 32px rgb(21 46 30 / 14%);
  transform: translateX(-50%);
  scrollbar-width: thin;
}
.nc-pdf .nc-pdf__scale-option {
  position: relative;
  display: block;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 10px 34px 10px 12px;
  border: 0;
  border-radius: 7px;
  color: var(--nc-text);
  background: transparent;
  box-shadow: none;
  font: 400 13px/1.5 "Open Sans", Arial, sans-serif;
  text-align: start;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  appearance: none;
}
.nc-pdf .nc-pdf__scale-option:is(:hover, .is-active) { background: #f1f5f2; }
.nc-pdf .nc-pdf__scale-option[aria-selected="true"] { color: var(--nc-green); background: var(--nc-green-light); font-weight: 600; }
.nc-pdf__scale-option[aria-selected="true"]::after { content: ""; position: absolute; top: 15px; inset-inline-end: 15px; width: 6px; height: 10px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.nc-pdf :is(button, a, input, [tabindex]):focus-visible { outline: 2px solid var(--nc-green); outline-offset: 2px; }
.nc-pdf__workspace { position: relative; display: flex; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.nc-pdf__sidebar { flex: 0 0 192px; width: 192px; min-height: 0; overflow-y: auto; border-inline-end: 1px solid var(--nc-border); background: #fff; overscroll-behavior: contain; z-index: 2; }
.nc-pdf__sidebar-heading { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 18px; background: #fff; font-weight: 600; z-index: 1; }
.nc-pdf__thumbnail-list { display: grid; gap: 12px; padding: 4px 14px 20px; }
.nc-pdf .nc-pdf__thumbnail { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin: 0; padding: 10px; border: 1px solid #e3e9e5; border-radius: 10px; color: #617367; background: #f6f8f6; box-shadow: none; font: 400 12px/1.4 "Open Sans", Arial, sans-serif; cursor: pointer; }
.nc-pdf .nc-pdf__thumbnail[aria-current="page"] { border-color: var(--nc-green); color: var(--nc-green); background: var(--nc-green-light); box-shadow: inset 0 0 0 1px var(--nc-green); }
.nc-pdf__thumbnail-preview { display: block; width: 100%; background: #fff; box-shadow: 0 1px 5px rgb(21 46 30 / 12%); }
.nc-pdf__thumbnail-preview canvas { display: block; width: 100%; height: 100%; }
.nc-pdf__stage { flex: 1 1 auto; min-width: 0; min-height: 0; padding: 24px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; -webkit-overflow-scrolling: touch; }
.nc-pdf .nc-pdf__stage:focus-visible { outline-offset: -3px; }
.nc-pdf__page { position: relative; margin-inline: auto; background: #fff; box-shadow: 0 2px 16px rgb(21 46 30 / 12%); }
.nc-pdf__page > canvas { display: block; width: 100%; height: 100%; max-width: none; }
.nc-pdf .nc-pdf__status {
  position: absolute;
  inset-inline: 16px;
  bottom: 16px;
  z-index: 2;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 0 auto;
  padding: 10px 18px;
  border: 1px solid var(--nc-border);
  border-radius: 6px;
  color: var(--nc-text);
  background: #fff;
  box-shadow: 0 2px 10px rgb(21 46 30 / 6%);
  text-align: center;
  pointer-events: none;
}
.nc-pdf .nc-pdf__empty, .nc-pdf .nc-pdf__fallback { margin: auto; padding: 32px; text-align: center; }
.nc-pdf .nc-pdf__sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.nc-pdf:fullscreen { width: 100%; height: 100%; min-height: 0; }
/* PDF.js text layer, scoped and adapted from the upstream viewer (Apache-2.0). */
.nc-pdf .textLayer {
  position: absolute;
  inset: 0;
  overflow: clip;
  color-scheme: only light;
  text-align: initial;
  line-height: 1;
  letter-spacing: normal;
  word-spacing: normal;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  forced-color-adjust: none;
  transform-origin: 0 0;
  --min-font-size: 1;
  --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
  --min-font-size-inv: calc(1 / var(--min-font-size));
}
.nc-pdf .textLayer :is(span, br) { position: absolute; color: transparent; white-space: pre; cursor: text; transform-origin: 0 0; -webkit-user-select: text; user-select: text; }
.nc-pdf .textLayer > :not(.markedContent), .nc-pdf .textLayer .markedContent span:not(.markedContent) {
  z-index: 1;
  --font-height: 0;
  font-size: calc(var(--text-scale-factor) * var(--font-height));
  --scale-x: 1;
  --rotate: 0deg;
  transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
}
.nc-pdf .textLayer .markedContent { display: contents; }
.nc-pdf .textLayer[data-main-rotation="90"] { transform: rotate(90deg) translateY(-100%); }
.nc-pdf .textLayer[data-main-rotation="180"] { transform: rotate(180deg) translate(-100%, -100%); }
.nc-pdf .textLayer[data-main-rotation="270"] { transform: rotate(270deg) translateX(-100%); }
.nc-pdf .textLayer ::selection { background: rgb(0 82 33 / 25%); }
@media (min-width: 761px) and (max-width: 1000px) {
  .nc-pdf .nc-pdf__toolbar { gap: 8px; padding-inline: 12px; }
  .nc-pdf__shop-top .nc-pdf__shop { padding-inline: 18px; }
}
@media (max-width: 760px) {
  .nc-pdf { min-height: 300px; }
  .nc-pdf .nc-pdf__toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 4px;
    padding: 6px 8px;
  }
  .nc-pdf__sidebar-toggle { grid-area: 1 / 1; }
  .nc-pdf__navigation { grid-area: 1 / 2; justify-self: center; }
  .nc-pdf__actions { grid-area: 1 / 3; justify-self: end; }
  .nc-pdf__view-controls { grid-area: 2 / 1 / 3 / -1; }
  .nc-pdf__shop-top { grid-area: 3 / 1 / 4 / -1; padding-top: 4px; }
  .nc-pdf__shop-top .nc-pdf__shop, .nc-pdf__shop-bottom .nc-pdf__shop { display: flex; width: 100%; }
  .nc-pdf__zoom { flex: 1 1 auto; }
  .nc-pdf .nc-pdf__scale { width: 100%; }
  .nc-pdf .nc-pdf__scale-list { width: 100%; min-width: 180px; }
  .nc-pdf .nc-pdf__scale-option { min-height: 44px; padding-block: 12px; }
  .nc-pdf__stage { padding: 12px; }
  .nc-pdf__sidebar { position: absolute; inset-block: 0; inset-inline-start: 0; box-shadow: 6px 0 24px rgb(21 46 30 / 12%); }
}
@media (max-width: 374px) {
  .nc-pdf :is(.nc-pdf__sidebar-toggle, .nc-pdf__navigation, .nc-pdf__actions) .nc-pdf__button { width: 36px; min-width: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .nc-pdf__scale svg { transition: none; }
}
