.hm-cat {
  --cat-ink:#17334b;
  --cat-accent:#b91d28;
  --cat-border:#dbe3e8;
  --cat-rail:clamp(48px,5.1vw,76px);
  width:min(1140px,calc(100% - 32px));
  margin:20px auto 26px;
  border:1px solid var(--cat-border);
  border-radius:15px;
  background:#fff;
  box-shadow:0 12px 34px #17334b18;
  overflow:hidden;
  color:var(--cat-ink);
}
.hm-cat * { box-sizing:border-box }
.hm-cat-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 15px;
  background:#fff;
  border-bottom:1px solid var(--cat-border);
}
.hm-cat-heading,.hm-cat-controls { display:flex;align-items:center;gap:8px;min-width:0 }
.hm-cat-brand { color:#c91520;font-size:14px;font-weight:750;letter-spacing:.045em;white-space:nowrap }
.hm-cat-language {
  border:1px solid #dce5ea;
  border-radius:100px;
  padding:3px 7px;
  color:#536877;
  font-size:10px;
  font-weight:650;
  white-space:nowrap;
}
.hm-cat-count { text-align:center;font-size:13px;font-weight:650;white-space:nowrap }
.hm-cat-action {
  appearance:none;
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:7px;
  flex:none;
  min-height:38px;
  padding:0 10px;
  border:1px solid #d2dce2;
  border-radius:9px;
  background:#fff;
  color:var(--cat-ink);
  font:inherit;
  font-size:12px;
  font-weight:650;
  text-decoration:none;
  white-space:nowrap;
  cursor:pointer;
  transition:background .16s,border-color .16s;
}
.hm-cat-action:hover { background:#f1f5f7;border-color:#a7b9c6 }
.hm-cat-action:focus-visible,.hm-cat-arrow:focus-visible { outline:3px solid #3482ad;outline-offset:2px }
.hm-cat-zoom { width:38px;padding:0 }
.hm-cat-download { background:var(--cat-ink);border-color:var(--cat-ink);color:#fff!important }
.hm-cat-download:hover { background:#264d6a;border-color:#264d6a }
.hm-cat-icon { display:block;width:19px;height:19px;flex:none }
.hm-cat-pdf-icon { width:22px;height:22px }
.hm-cat-fullscreen [data-collapse],.hm-cat-fullscreen[aria-pressed="true"] [data-expand] { display:none }
.hm-cat-fullscreen[aria-pressed="true"] [data-collapse] { display:block }

.hm-cat-display {
  position:relative;
  display:grid;
  grid-template-columns:var(--cat-rail) minmax(0,1fr) var(--cat-rail);
  grid-template-areas:"back stage forward";
  align-items:stretch;
  height:min(clamp(247px,calc(100vh - 250px),650px),var(--cat-height-limit,650px));
  height:min(clamp(247px,calc(100svh - 250px),650px),var(--cat-height-limit,650px));
  background:#e8edf0;
}
.hm-cat-arrow {
  appearance:none;
  position:relative;
  z-index:1;
  align-self:center;
  justify-self:center;
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  padding:0;
  border:1px solid #a8141e;
  border-radius:50%;
  background:var(--cat-accent);
  color:#fff;
  box-shadow:0 3px 12px #77202c25;
  cursor:pointer;
  transition:background .16s,box-shadow .16s;
}
.hm-cat-prev { grid-area:back }
.hm-cat-next { grid-area:forward }
.hm-cat-display.has-adjacent-arrows .hm-cat-arrow {
  position:absolute;
  grid-area:auto;
  top:50%;
  transform:translateY(-50%);
}
.hm-cat-display.has-adjacent-arrows .hm-cat-prev { left:var(--cat-arrow-inset) }
.hm-cat-display.has-adjacent-arrows .hm-cat-next { right:var(--cat-arrow-inset) }
.hm-cat-arrow:hover:not(:disabled) { background:#971521;box-shadow:0 3px 16px #77202c40 }
.hm-cat-arrow:disabled { background:#d7e0e6;color:#667e8e;border-color:#bccbd4;box-shadow:none;cursor:default }
.hm-cat-arrow svg { width:24px;height:24px }
.hm-cat-stage {
  grid-area:stage;
  position:relative;
  container-type:size;
  min-width:0;
  min-height:0;
  padding:11px 4px;
  overflow:hidden;
  outline:none;
  touch-action:pan-y;
}
.hm-cat-stage:focus-visible { box-shadow:inset 0 0 0 2px #7aa7c6 }
.hm-cat-book { display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:0 }
.hm-cat-page {
  display:block;
  flex:none;
  width:auto;
  height:auto;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  background:#fff;
  box-shadow:0 5px 18px #0d1d4229;
}
.hm-cat-book.is-spread .hm-cat-page { max-width:50% }
@supports (width:1cqh) {
  .hm-cat-page { width:min(100cqw,70.71cqh) }
  .hm-cat-book.is-spread .hm-cat-page { width:min(50cqw,70.71cqh) }
}
.hm-cat-stage.is-zoomed {
  --cat-zoom-page:max(380px,106cqh);
  overflow:auto;
  touch-action:auto;
}
.hm-cat-stage.is-zoomed .hm-cat-book {
  width:max(100%,var(--cat-zoom-page));
  height:auto;
  min-height:100%;
  align-items:flex-start;
}
.hm-cat-stage.is-zoomed .hm-cat-book.is-spread { width:max(100%,calc(2 * var(--cat-zoom-page))) }
.hm-cat-stage.is-zoomed .hm-cat-page { width:var(--cat-zoom-page);max-width:none;max-height:none }
.hm-cat-error {
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  max-width:280px;
  padding:12px 16px;
  border-radius:9px;
  background:#fff;
  color:#9a1b24;
  text-align:center;
  box-shadow:0 5px 20px #0002;
}
.hm-cat-bottom {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:8px 14px;
  background:#fff;
  border-top:1px solid var(--cat-border);
  color:#526976;
  font-size:12px;
}
.hm-cat-jump { display:flex;align-items:center;gap:6px;white-space:nowrap }
.hm-cat-jump input {
  width:50px;height:31px;
  padding:3px 5px;
  border:1px solid #c3d3dc;
  border-radius:7px;
  background:#fff;
  color:var(--cat-ink);
  text-align:center;
  font:inherit;
}
.hm-cat-jump input::-webkit-inner-spin-button,.hm-cat-jump input::-webkit-outer-spin-button { appearance:none;margin:0 }
.hm-cat-intro { width:min(1050px,calc(100% - 36px));margin:0 auto 50px;color:#405262;line-height:1.7 }
.hm-cat-intro .hm-rich { width:100%;max-width:none }

html.hm-cat-screen-open { overflow:hidden }
.hm-cat-overlay {
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  max-width:none;
  max-height:none;
  margin:0;
  padding:0;
  border:0;
  background:#e8edf0;
  overflow:hidden;
  z-index:2147483000;
}
.hm-cat-overlay::backdrop { background:#e8edf0 }
.hm-cat.is-fullscreen {
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  width:100%;
  height:100%;
  max-width:none;
  max-height:none;
  margin:0;
  border:0;
  border-radius:0;
  box-shadow:none;
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.hm-cat.is-fullscreen .hm-cat-display { height:auto;min-height:0 }
.hm-cat.is-fullscreen .hm-cat-arrow { width:48px;height:48px }

@media (max-width:700px) {
  .hm-cat {
    --cat-rail:44px;
    width:calc(100% - 16px);
    margin:14px auto 20px;
    border-radius:12px;
  }
  .hm-cat-toolbar { gap:7px;padding:9px }
  .hm-cat-heading,.hm-cat-controls { gap:5px }
  .hm-cat-brand { font-size:11px }
  .hm-cat-language { display:none }
  .hm-cat-count { font-size:11px }
  .hm-cat-action { min-height:36px;padding:0 7px;font-size:11px;gap:4px }
  .hm-cat-zoom { width:34px;padding:0 }
  .hm-cat-action .hm-cat-icon { width:17px;height:17px }
  .hm-cat-display {
    height:min(clamp(239px,calc(100vh - 236px),440px),var(--cat-height-limit,440px));
    height:min(clamp(239px,calc(100svh - 236px),440px),calc(141.42vw - 132px),var(--cat-height-limit,440px));
  }
  .hm-cat-arrow,.hm-cat.is-fullscreen .hm-cat-arrow { width:36px;height:36px }
  .hm-cat-arrow svg { width:20px;height:20px }
  .hm-cat-stage { padding:8px 2px }
  .hm-cat-stage.is-zoomed { --cat-zoom-page:max(380px,91cqh) }
  .hm-cat-bottom { padding:7px 8px;gap:8px }
  .hm-cat-bottom>span { max-width:64%;line-height:1.3;font-size:11px }
  .hm-cat-intro { margin-bottom:28px }
  .hm-cat-fullscreen .hm-cat-action-label { display:none }
}
@media (max-width:365px) {
  .hm-cat-download .hm-cat-action-label { display:none }
}
@media (max-height:500px) and (orientation:landscape) {
  .hm-cat.is-fullscreen .hm-cat-bottom>span { display:none }
  .hm-cat.is-fullscreen .hm-cat-bottom { justify-content:end }
}
@media (prefers-reduced-motion:reduce) {
  .hm-cat-action,.hm-cat-arrow { transition:none }
}

/* Catalog title and chrome leave the first page more room in normal viewing. */
main#main>.hm-page-title {
  padding:12px max(25px,50% - 608px) 11px;
}
main#main>.hm-page-title::after {
  left:max(25px,50% - 608px);
  right:max(25px,50% - 608px);
}
main#main>.hm-page-title h1 {
  font-size:clamp(23px,2.4vw,32px);
  line-height:1.2;
}
.hm-cat:not(.is-fullscreen) {
  width:min(1220px,calc(100% - 26px));
  margin-top:10px;
}
.hm-cat:not(.is-fullscreen) .hm-cat-toolbar { padding-block:8px }
.hm-cat:not(.is-fullscreen) .hm-cat-display {
  height:min(clamp(260px,calc(100vh - 184px),760px),var(--cat-height-limit,760px));
  height:min(clamp(260px,calc(100svh - 184px),760px),var(--cat-height-limit,760px));
}
@media (max-width:700px) {
  main#main>.hm-page-title { padding:9px 10px }
  main#main>.hm-page-title::after { left:10px;right:10px }
  .hm-cat:not(.is-fullscreen) {
    --cat-rail:36px;
    width:calc(100% - 12px);
    margin-top:8px;
  }
  .hm-cat:not(.is-fullscreen) .hm-cat-display {
    height:min(clamp(239px,calc(100vh - 162px),520px),calc(141.42vw - 110px),var(--cat-height-limit,520px));
    height:min(clamp(239px,calc(100svh - 162px),520px),calc(141.42vw - 110px),var(--cat-height-limit,520px));
  }
}

.hm-cat-title {
  margin:0;
  color:#b91d28;
  font-size:clamp(15px,1.45vw,21px);
  font-weight:700;
  line-height:1.15;
  white-space:nowrap;
}
.hm-cat.has-catalog-title:not(.is-fullscreen) .hm-cat-brand { display:none }
.hm-cat.is-fullscreen .hm-cat-title {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip-path:inset(50%);
}
.hm-cat:not(.is-fullscreen) { width:min(1240px,calc(100% - 20px));margin-top:12px }
.hm-cat:not(.is-fullscreen) .hm-cat-display {
  height:min(clamp(260px,calc(100vh - 110px),820px),var(--cat-height-limit,820px));
  height:min(clamp(260px,calc(100svh - 110px),820px),var(--cat-height-limit,820px));
}
@media(max-width:700px) {
  .hm-cat-title { font-size:13px }
  .hm-cat:not(.is-fullscreen) { --cat-rail:30px;width:calc(100% - 8px);margin-top:9px }
  .hm-cat:not(.is-fullscreen) .hm-cat-stage { padding-inline:0 }
  .hm-cat:not(.is-fullscreen) .hm-cat-arrow { width:32px;height:32px }
  .hm-cat:not(.is-fullscreen) .hm-cat-display {
    height:min(clamp(239px,calc(100vh - 120px),540px),calc(141.42vw - 84px),var(--cat-height-limit,540px));
    height:min(clamp(239px,calc(100svh - 120px),540px),calc(141.42vw - 84px),var(--cat-height-limit,540px));
  }
}

/* Expanded pages grow in document flow. The viewing rail scrolls horizontally if needed. */
.hm-cat { overflow:visible;overflow:clip }
.hm-cat:not(.is-fullscreen) .hm-cat-display {
  --cat-fit-height:min(clamp(260px,calc(100svh - 110px),820px),var(--cat-height-limit,820px));
  height:var(--cat-fit-height);
}
.hm-cat.is-fullscreen .hm-cat-display { --cat-fit-height:var(--cat-screen-fit-height,620px) }
.hm-cat-stage { --cat-stage-inset:22px }
.hm-cat:not(.is-fullscreen) .hm-cat-display.is-expanded,
.hm-cat.is-fullscreen .hm-cat-display.is-expanded { height:auto; min-height:0 }
.hm-cat-display.is-expanded .hm-cat-stage {
  --cat-scaled-width:calc(min(100cqw / var(--cat-page-count,1),(var(--cat-fit-height) - var(--cat-stage-inset)) * .7071) * var(--cat-zoom));
  container-type:inline-size;
  overflow-x:auto;
  overflow-y:visible;
  touch-action:pan-x pan-y;
}
.hm-cat-display.is-expanded .hm-cat-stage .hm-cat-book {
  align-items:flex-start;
  width:max(100%,calc(var(--cat-scaled-width) * var(--cat-page-count,1)));
  height:auto;
  min-height:0;
}
.hm-cat-display.is-expanded .hm-cat-stage .hm-cat-page {
  width:var(--cat-scaled-width);
  height:auto;
  max-width:none;
  max-height:none;
}
.hm-cat-display.is-expanded .hm-cat-arrow {
  position:sticky;
  top:calc(48svh - 20px);
  align-self:start;
  margin-top:clamp(70px,24svh,220px);
}
.hm-cat.is-fullscreen { overflow:hidden }
.hm-cat.is-fullscreen.has-magnification { display:block;overflow-y:auto }
.hm-cat.is-fullscreen.has-magnification .hm-cat-toolbar {
  position:sticky;top:0;z-index:4;
}

.hm-cat-bottom {
  position:sticky;
  bottom:0;
  z-index:3;
  min-height:46px;
  padding:6px 13px;
  gap:10px;
  box-shadow:0 -4px 12px #17334b14;
}
.hm-cat-zoom-dock {
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
  white-space:nowrap;
  color:#17334b;
}
.hm-cat-zoom-dock label { font-size:12px;font-weight:700 }
.hm-cat-zoom-dock input[type=range] {
  width:clamp(70px,15vw,188px);
  min-width:42px;
  height:25px;
  margin:0;
  padding:0;
  flex:0 1 auto;
  accent-color:#b91d28;
  cursor:pointer;
}
.hm-cat-zoom-step,.hm-cat-zoom-fit {
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:none;
  height:34px;
  padding:0 8px;
  border:1px solid #c9d6df;
  border-radius:7px;
  background:#fff;
  color:#17334b;
  font:inherit;
  font-size:12px;
  font-weight:650;
  cursor:pointer;
}
.hm-cat-zoom-step { width:34px;padding:0 }
.hm-cat-zoom-step .hm-cat-icon { width:15px;height:15px }
.hm-cat-zoom-step:hover:not(:disabled),.hm-cat-zoom-fit:hover:not(:disabled) { background:#f0f5f8;border-color:#a7b9c6 }
.hm-cat-zoom-step:disabled,.hm-cat-zoom-fit:disabled { opacity:.5;cursor:default }
.hm-cat-zoom-value { min-width:35px;text-align:center;font-weight:700;font-variant-numeric:tabular-nums }
.hm-cat-zoom-step:focus-visible,.hm-cat-zoom-fit:focus-visible,.hm-cat-zoom-dock input:focus-visible {
  outline:2px solid #3482ad;
  outline-offset:2px;
}
@media(max-width:700px) {
  .hm-cat:not(.is-fullscreen) .hm-cat-display {
    --cat-fit-height:min(clamp(239px,calc(100svh - 120px),540px),calc(141.42vw - 84px),var(--cat-height-limit,540px));
    height:var(--cat-fit-height);
  }
  .hm-cat-stage { --cat-stage-inset:16px }
  .hm-cat-bottom { padding:5px 7px;gap:5px }
  .hm-cat-zoom-dock { gap:4px }
  .hm-cat-zoom-dock label { font-size:10px }
  .hm-cat-zoom-dock input[type=range] { width:clamp(42px,15vw,115px) }
  .hm-cat-zoom-step,.hm-cat-zoom-fit { height:32px;font-size:10px }
  .hm-cat-zoom-step { width:29px }
  .hm-cat-zoom-fit { padding:0 4px }
  .hm-cat-zoom-value { min-width:29px;font-size:11px }
  .hm-cat-jump { gap:3px }
  .hm-cat-jump input { width:32px }
  .hm-cat-jump label { display:none }
}
@media(max-width:350px) {
  .hm-cat-zoom-dock label { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%) }
}
