* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  --gutter: clamp(14px, 3.5vw, 50px);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  color: #193748;
  background: #edf2f5;
  font: 16px/1.5 var(--wd-ui-font, spellman, sans-serif);
}
[hidden] { display: none !important; }
header { flex: none; background: #fff; border-top: 3px solid #16769e; }
.reader-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 2.5vw, 34px);
  max-width: 1260px;
  margin: auto;
  padding: 14px var(--gutter);
}
.reader-brand { display: flex; align-items: center; }
.reader-brand img { display: block; width: 86px; height: auto; }
h1 { margin: 0; padding-inline-start: clamp(14px, 2.3vw, 30px); border-inline-start: 1px solid #d1dfe5; font-size: clamp(20px, 2.15vw, 30px); line-height: 1.25; overflow-wrap: anywhere; }
.reader-back { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; color: #126888; font-weight: 600; text-decoration: none; }
.reader-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.reader-toolbar { flex: none; border-block: 1px solid #d0dce2; background: #f8fafb; }
.reader-tools { width: min(calc(100% - 2 * var(--gutter)), 860px); margin: auto; padding-block: 4px; min-height: 48px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: #345364; }
#reader-picker, .reader-actions { display: flex; align-items: center; gap: 6px; }
.reader-actions { margin-inline-start: auto; gap: 14px; }
.reader-download { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 5px 14px; border-radius: 4px; color: #fff; background: #0075a5; font-weight: 600; text-decoration: none; white-space: nowrap; }
.reader-download:hover { background: #005b80; }
.reader-tools select, .reader-tools button { font: inherit; color: inherit; cursor: pointer; }
.reader-tools select { max-width: 100%; padding: 5px 4px; border: 0; background: transparent; }
#reader-zoom { display: flex; align-items: center; }
#reader-zoom button { width: 38px; height: 34px; border: 1px solid #c4d4dc; border-radius: 4px; background: white; color: #135977; font-size: 22px; line-height: 1; }
#reader-zoom button:hover:enabled { background: #e7f1f5; }
#reader-zoom button:disabled { opacity: .4; cursor: default; }
#reader-zoom output { min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
:is(a, button, select, main):focus-visible { outline: 2px solid #007eaf; outline-offset: 2px; }
#reader-scroll { flex: 1; min-height: 0; overflow: auto; padding: clamp(10px, 2vw, 26px) var(--gutter); scrollbar-gutter: stable both-edges; }
#reader-scroll:focus-visible { outline-offset: -2px; }
#reader-pages { --zoom: 1; width: min(calc(100% * var(--zoom)), calc(860px * var(--zoom))); margin-inline: auto; }
figure { position: relative; margin: 0 0 12px; }
figure img { display: block; width: 100%; height: auto; background: white; box-shadow: 0 0 0 1px #d2dce1, 0 2px 7px rgb(23 56 77 / 8%); }
figcaption { padding: 8px 0 5px; color: #506572; font-size: 14px; text-align: center; }
.reader-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 600px) {
  body { --gutter: 10px; }
  .reader-heading { gap: 8px 12px; grid-template-columns: 1fr auto; padding: 6px 14px 10px; }
  .reader-brand img { width: 62px; }
  h1 { grid-column: 1 / -1; grid-row: 2; border: 0; padding: 0; }
  .reader-back { grid-column: 2; grid-row: 1; min-height: 40px; font-size: 15px; }
  .reader-tools { min-height: 46px; }
  .reader-actions { gap: 6px; }
  .reader-download { min-height: 44px; padding-inline: 10px; }
  #reader-zoom button, .reader-tools select { min-width: 44px; min-height: 44px; }
  #reader-zoom button { border: 0; background: transparent; }
  #reader-zoom output { min-width: 43px; }
}
@media (max-width: 380px) {
  #reader-picker > span { display: none; }
  .reader-tools { column-gap: 4px; }
  .reader-actions { gap: 4px; }
  .reader-download { padding-inline: 7px; }
}
@media print {
  body { display: block; height: auto; background: white; }
  header, .reader-toolbar, figcaption { display: none; }
  #reader-scroll { display: block; overflow: visible; padding: 0; }
  #reader-pages { width: 100%; }
  figure { margin: 0; break-inside: avoid; }
  figure + figure { break-before: page; }
  figure img { box-shadow: none; }
}
