.mslfb {
  --mslfb-ink: #142536;
  --mslfb-control: #fbfdff;
  --mslfb-border: #9aabba;
  --mslfb-accent: #166d96;
  container: mslfb / inline-size;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .65rem;
  width: 100%;
  max-width: 100%;
  margin-block: 1.5rem;
  background: transparent;
}
.mslfb *, .mslfb *::before, .mslfb *::after { box-sizing: border-box; }
.mslfb [hidden], .mslfb-status:empty, .mslfb-view:has(.mslfb-book:empty) { display: none !important; }
.mslfb-view {
  overflow: auto;
  overscroll-behavior-inline: contain;
  min-width: 0;
  max-height: min(72vh, 850px);
  padding: 10px;
  background: transparent;
}
.mslfb-book {
  display: flex;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  align-items: center;
  justify-content: center;
}
.mslfb-spread { display: flex; align-items: center; position: relative; isolation: isolate; }
.mslfb .mslfb-page {
  display: block;
  flex: none;
  max-width: none;
  margin: 0;
  background: #fff;
  box-shadow: 0 2px 10px #0004;
}
.mslfb-sheet {
  position: absolute;
  transform-style: preserve-3d;
  z-index: 2;
  pointer-events: none;
}
.mslfb-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: inset 0 0 20px #14253618, 0 2px 8px #0003;
  backface-visibility: hidden;
  overflow: hidden;
}
.mslfb-face canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.mslfb-back { transform: rotateY(180deg); }
.mslfb-status {
  align-self: center;
  max-width: 100%;
  margin: 0;
  padding: .3rem .65rem;
  border-radius: .4rem;
  background: var(--mslfb-control);
  color: var(--mslfb-ink);
  font: 400 .88rem/1.4 system-ui, sans-serif;
}
.mslfb-tools, .mslfb-group, .mslfb-extra {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .35rem;
}
.mslfb-tools, .mslfb-thumbs { font: 500 .875rem/1.2 system-ui, sans-serif; }
.mslfb :is(button, input, .mslfb-tools a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  margin: 0;
  padding: .35rem .55rem;
  border: 1px solid var(--mslfb-border);
  border-radius: .45rem;
  background: var(--mslfb-control);
  color: var(--mslfb-ink);
  box-shadow: none;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
}
.mslfb :is(button, a) { cursor: pointer; }
.mslfb :is(button, a):hover { background: #e6f2f8; color: var(--mslfb-ink); }
.mslfb button:disabled { cursor: default; color: #657484; background: #edf0f3; }
.mslfb :is(button, input, a, .mslfb-view):focus-visible { outline: 3px solid var(--mslfb-accent); outline-offset: 2px; }
.mslfb [data-page] { width: 3.3rem; text-align: center; appearance: textfield; }
.mslfb [data-page]::-webkit-inner-spin-button { appearance: none; }
.mslfb [data-total] { padding: .3rem; border-radius: .3rem; background: var(--mslfb-control); color: var(--mslfb-ink); }
.mslfb-group button, .mslfb .mslfb-more { font-size: 1.3rem; }
.mslfb button.mslfb-more { display: none; }
.mslfb-thumbs {
  display: flex;
  gap: .45rem;
  align-items: flex-start;
  overflow-x: auto;
  padding: .45rem;
  background: transparent;
}
.mslfb button.mslfb-thumb { flex: 0 0 86px; flex-direction: column; gap: .3rem; padding: .3rem; }
.mslfb-thumb[aria-current="page"] { border: 2px solid var(--mslfb-accent); background: #e6f2f8; }
.mslfb-thumb-preview { display: grid; width: 72px; height: 94px; place-items: center; background: #ebeff2; }
.mslfb-thumb-preview canvas { display: block; max-width: 100%; max-height: 100%; }
.mslfb:fullscreen, .mslfb.mslfb-screen {
  margin: 0;
  padding: clamp(8px, 2vw, 22px);
  background: #202c38;
}
.mslfb.mslfb-screen { position: fixed; inset: 0; z-index: 2147483647; width: 100%; height: 100%; }
.mslfb:fullscreen .mslfb-view, .mslfb.mslfb-screen .mslfb-view { min-height: 0; max-height: none; flex: 1 1 0; }
.mslfb:fullscreen .mslfb-thumbs, .mslfb.mslfb-screen .mslfb-thumbs { flex-shrink: 0; }
@container mslfb (width < 600px) {
  .mslfb[data-ready] .mslfb-more:not([hidden]) { display: inline-flex; }
  .mslfb[data-ready] .mslfb-extra { display: none; flex-basis: 100%; }
  .mslfb[data-ready] .mslfb-extra[data-open] { display: flex; }
  .mslfb button[data-do="layout"] { display: none; }
}
@container mslfb (width < 350px) {
  .mslfb-tools, .mslfb-group { gap: .2rem; }
  .mslfb :is(button, input) { min-width: 34px; }
  .mslfb [data-page] { width: 2.65rem; }
}
