/* A white and a black ring together, so the focus shows on the toolbar, the stage and a panel. */
.ft-reader :focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
  box-shadow: 0 0 0 5px #000;
}

/* A panel takes the focus when it opens; its ring sits inside its edge. */
.ft-reader .ft-panel:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
  box-shadow: -12px 0 32px rgb(0 0 0 / 28%);
}

.ft-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Reading mode covers the stage with the text alone, on a phone too. */
.ft-reader .ft-panel[data-panel='reading'] {
  width: 100%;
  font-size: 18px;
  line-height: 1.6;
}

.ft-reader .ft-panel[data-panel='reading'][data-sheet] {
  top: var(--ft-stage-top, 0);
  height: auto;
  border-radius: 0;
}

.ft-reader .ft-panel[data-panel='reading'] .ft-panel-body {
  padding: 16px max(16px, calc((100% - 42rem) / 2));
}

.ft-reading {
  margin-top: 16px;
}

.ft-reading-page h3 {
  margin: 24px 0 8px;
  font-size: 20px;
}

.ft-reading p {
  margin: 0 0 12px;
  white-space: pre-line;
  overflow-wrap: break-word;
}

/* Reduced motion: nothing slides or turns; a panel and its scrim still fade. */
@media (prefers-reduced-motion: reduce) {
  .ft-reader *,
  .ft-reader *::before,
  .ft-reader *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .ft-reader .ft-panel,
  .ft-reader .ft-scrim {
    animation: ft-fade-in 240ms ease !important;
  }

  .ft-reader .ft-panel[data-closing] {
    animation: ft-fade-out 240ms ease forwards !important;
  }
}
.ft-toolbar button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* The toast: a light pill at the foot of the stage, centred in what a side panel leaves of it. */
.ft-actions-status {
  position: absolute;
  bottom: 20px;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  max-width: calc(100% - 32px);
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: #f3f3f5;
  color: #121317;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgb(0 0 0 / 35%);
  transform: translateX(-50%);
  animation: ft-fade-in 150ms ease;
}

.ft-actions-status span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ft-actions-status svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ft-actions-status:empty {
  display: none;
}

.ft-copy-field {
  position: fixed;
  top: 0;
  left: 0;
  opacity: 0;
}

/* The Share panel: the link with Copy, the QR card, then the rows. */
.ft-share {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 4px;
}

.ft-share-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ft-share-label {
  color: color-mix(in srgb, currentColor 68%, transparent);
  font-size: 12px;
  font-weight: 600;
}

.ft-share-field {
  display: flex;
  gap: 8px;
}

.ft-share-url {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, currentColor 7%, transparent);
  color: inherit;
  font: inherit;
  font-size: 13px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 10%, transparent);
}

.ft-share-url:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 35%, transparent);
}

.ft-share-copy {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #f3f3f5;
  color: #121317;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ft-share-copy:hover {
  background: #fff;
}

.ft-share-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-radius: 12px;
  background: color-mix(in srgb, currentColor 4%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 7%, transparent);
}

.ft-share-tile {
  box-sizing: border-box;
  width: 168px;
  height: 168px;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
}

.ft-share-code {
  display: block;
  width: 100%;
  height: 100%;
  fill: #121317;
}

.ft-share-caption {
  margin: 0;
  color: color-mix(in srgb, currentColor 80%, transparent);
  font-size: 13px;
  text-align: center;
}

.ft-share-save {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, currentColor 8%, transparent);
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.ft-share-save:hover {
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.ft-share-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ft-share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.ft-share-row::after {
  content: '\2192';
  margin-left: auto;
  color: color-mix(in srgb, currentColor 55%, transparent);
}

.ft-share-row:hover {
  background: color-mix(in srgb, currentColor 5%, transparent);
}

.ft-share-row svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}
.ft-brand {
  display: flex;
  order: -1;
  flex: none;
  align-items: center;
  gap: 14px;
  min-width: 0;
  box-sizing: border-box;
  height: 52px;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid color-mix(in srgb, currentColor 7%, transparent);
  background: #0e0f12;
  color: #f3f3f5;
}

.ft-logo-link {
  display: flex;
  flex: none;
  border-radius: 4px;
}

.ft-logo-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.ft-logo {
  display: block;
  flex: none;
  width: auto;
  max-width: 160px;
  height: 32px;
  object-fit: contain;
}

.ft-brand-divider {
  flex: none;
  width: 1px;
  height: 18px;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.ft-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: color-mix(in srgb, currentColor 66%, transparent);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The slot of the search control; the search feature fills it. */
.ft-brand-search {
  display: flex;
  flex: none;
  align-items: center;
  min-width: 0;
}

/* A short frame: a slim band, as tall as the toolbar row. */
@media (max-height: 320px) {
  .ft-brand {
    gap: 10px;
    height: 32px;
    padding: 0 4px 0 12px;
  }

  .ft-logo { height: 20px; }
  .ft-title { font-size: 12px; }
}

@media (max-width: 600px) {
  .ft-brand {
    gap: 10px;
    padding: 0 6px 0 16px;
  }

  .ft-title {
    font-size: 12px;
  }
}
.ft-contents {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ft-contents .ft-contents {
  padding-left: 16px;
}

/* A row: the page number in its column, then the title. The colours come off the chrome text. */
.ft-bookmark {
  display: flex;
  gap: 12px;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, currentColor 85%, transparent);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ft-bookmark-page {
  flex: none;
  width: 22px;
  color: color-mix(in srgb, currentColor 55%, transparent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ft-bookmark-title {
  flex: 1;
  min-width: 0;
}

.ft-bookmark:hover:not(:disabled) {
  background: color-mix(in srgb, currentColor 5%, transparent);
  color: inherit;
}

/* The row whose page is in view. */
.ft-bookmark[aria-current] {
  background: color-mix(in srgb, currentColor 9%, transparent);
  color: inherit;
  font-weight: 600;
}

.ft-bookmark[aria-current] .ft-bookmark-page {
  color: inherit;
}

/* A bookmark with no output page. */
.ft-bookmark:disabled {
  color: color-mix(in srgb, currentColor 55%, transparent);
  cursor: default;
}
html,
body {
  height: 100%;
  margin: 0;
}

.ft-reader {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  /* Clip, not hidden: a sheet rising from below the frame must not scroll the reader when it takes the focus. */
  overflow: clip;
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Neutral dark chrome: tools left, navigation centre, actions right. Publisher colours come inline. */
.ft-toolbar {
  display: grid;
  order: 2;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  flex: none;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
  height: 56px;
  padding: 0 14px;
  border-top: 1px solid color-mix(in srgb, currentColor 7%, transparent);
  background: #0e0f12;
  color: #f3f3f5;
}

.ft-toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.ft-toolbar-group--end { justify-content: flex-end; }

/* A hairline between the bands of the start group. */
.ft-toolbar-separator {
  flex: none;
  width: 1px;
  height: 20px;
  margin: 0 6px;
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.ft-toolbar button,
.ft-brand button,
.ft-toolbar .ft-download {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.ft-toolbar button:hover:not(:disabled),
.ft-brand button:hover,
.ft-toolbar .ft-download:hover { background: color-mix(in srgb, currentColor 8%, transparent); }

.ft-toolbar button:active:not(:disabled),
.ft-brand button:active { background: color-mix(in srgb, currentColor 14%, transparent); }

/* The control of an open panel. */
.ft-toolbar button[aria-pressed='true'] {
  background: color-mix(in srgb, currentColor 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 10%, transparent);
}

.ft-toolbar button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ft-toolbar svg,
.ft-brand button svg,
.ft-side-arrow svg,
.ft-panel-close svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.ft-toolbar button svg,
.ft-brand button svg { opacity: 0.85; }

.ft-toolbar button:hover:not(:disabled) svg,
.ft-toolbar button[aria-pressed='true'] svg,
.ft-brand button:hover svg { opacity: 1; }

.ft-control-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .ft-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 4px;
    height: auto;
    padding: 4px 8px;
  }

  .ft-toolbar-group--centre {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-content: center;
  }

  .ft-toolbar-group--start { grid-column: 1; grid-row: 2; }
  .ft-toolbar-group--end { grid-column: 2; grid-row: 2; }
}

@media (pointer: coarse) {
  .ft-toolbar button,
  .ft-brand button,
  .ft-toolbar .ft-download { width: 44px; height: 44px; }
}

/* Phone: two rows of 44 targets, the start tools a little tighter; the pinch replaces Reset zoom. */
@media (max-width: 600px) {
  .ft-toolbar { padding: 4px 6px 10px; }
  .ft-toolbar-group { gap: 0; }
  .ft-toolbar-separator { margin: 0 2px; }
  .ft-toolbar button,
  .ft-brand button,
  .ft-toolbar .ft-download { width: 44px; height: 44px; }
  .ft-toolbar-group--start button { width: 40px; }
  .ft-toolbar button[data-control='zoom-reset'] { display: none; }
}

/* A tiny frame inside a host page: the five navigation controls must still fit one row. */
@media (max-width: 320px) {
  .ft-toolbar { padding-inline: 2px; }
  .ft-toolbar button,
  .ft-toolbar .ft-download { width: 34px; }
}

/* A short frame, such as a phone-width box in a host page: one row of the page controls and
   fullscreen, so the pages keep most of the height. Fullscreen opens every other tool. */
@media (max-height: 320px) {
  .ft-toolbar {
    display: flex;
    gap: 2px;
    height: 36px;
    padding: 0 4px;
  }

  .ft-toolbar-group--start { display: none; }
  .ft-toolbar-group--centre { flex: 1; justify-content: center; }
  .ft-toolbar-group--end { flex: none; }
  .ft-toolbar-group--end > :not([data-control='fullscreen'], [data-control='search'], .ft-download) { display: none; }

  .ft-toolbar button,
  .ft-brand button,
  .ft-toolbar .ft-download { width: 30px; height: 30px; }
}

/* Too narrow for the whole row: previous, next and the page number remain. */
@media (max-height: 320px) and (max-width: 300px) {
  .ft-toolbar button:is([data-control='first'], [data-control='last']) { display: none; }
}

/* The stage: a soft radial light over the publisher's colour, which stays on background-color. */
.ft-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background-color: #2a2b2f;
  background-image: radial-gradient(
    ellipse 70% 65% at 50% 46%,
    rgb(255 255 255 / 7.5%) 0%,
    transparent 55%,
    rgb(0 0 0 / 19%) 100%
  );
}

/* A page of the book, in either engine. */
.ft-page {
  display: block;
  flex: none;
  max-width: 100%;
  max-height: 100%;
  background: #fff center / 100% 100% no-repeat;
  box-shadow: 0 24px 48px -12px rgb(0 0 0 / 55%), 0 4px 12px rgb(0 0 0 / 30%);
}

/* The gutter: shading along the inner edge of each page of a spread, under the link layer. */
.ft-stage [data-side]::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ft-stage [data-side='left']::after {
  background: linear-gradient(to left, rgb(0 0 0 / 26%) 0%, rgb(0 0 0 / 8%) 3.5%, transparent 10%);
}

.ft-stage [data-side='right']::after {
  background: linear-gradient(to right, rgb(0 0 0 / 22%) 0%, rgb(0 0 0 / 6%) 3%, transparent 8%);
}

/* A side panel over the stage alone; the core sets the stage edges on the reader. */
.ft-panel {
  position: absolute;
  top: var(--ft-stage-top, 0);
  right: 0;
  bottom: var(--ft-stage-bottom, 0);
  z-index: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(340px, 100%);
  overflow: auto;
  border-left: 1px solid color-mix(in srgb, currentColor 8%, transparent);
  background: #17181b;
  color: #f3f3f5;
  box-shadow: -12px 0 32px rgb(0 0 0 / 28%);
  animation: ft-panel-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ft-panel[data-closing] {
  animation: ft-panel-out 240ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  pointer-events: none;
}

.ft-panel[hidden] {
  display: none;
}

@keyframes ft-panel-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}

@keyframes ft-panel-out {
  to {
    opacity: 0;
    transform: translateX(16px);
  }
}

/* The panel itself scrolls, so the focus it takes scrolls it; the header stays at the top. */
.ft-panel-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  height: 52px;
  padding: 0 10px 0 20px;
  border-bottom: 1px solid color-mix(in srgb, currentColor 7%, transparent);
  background: inherit;
}

.ft-panel-title {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ft-panel-close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, currentColor 70%, transparent);
  font: inherit;
  cursor: pointer;
}

.ft-panel-close svg {
  width: 18px;
  height: 18px;
}

.ft-panel-close:hover {
  background: color-mix(in srgb, currentColor 8%, transparent);
  color: inherit;
}

.ft-panel-body {
  flex: 1 0 auto;
  padding: 16px 16px 20px;
}

/* The bottom sheet of a narrow frame, over a scrim; the core marks the panel as a sheet. */
.ft-scrim {
  position: absolute;
  top: var(--ft-stage-top, 0);
  right: 0;
  bottom: var(--ft-stage-bottom, 0);
  left: 0;
  z-index: 1;
  background: rgb(0 0 0 / 45%);
  animation: ft-fade-in 280ms ease;
}

.ft-scrim[hidden] {
  display: none;
}

.ft-panel[data-sheet] {
  top: auto;
  left: 0;
  width: 100%;
  height: calc((100% - var(--ft-stage-top, 0px) - var(--ft-stage-bottom, 0px)) * 0.72);
  border-left: 0;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 32px rgb(0 0 0 / 28%);
  animation: ft-sheet-in 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ft-panel[data-sheet][data-closing] {
  animation: ft-sheet-out 280ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.ft-panel-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 36px;
  height: 4px;
  margin-left: -18px;
  border-radius: 2px;
  background: color-mix(in srgb, currentColor 25%, transparent);
}

.ft-panel[data-sheet] .ft-panel-handle,
.ft-panel[data-sheet] .ft-panel-header {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.ft-panel[data-sheet] .ft-panel-header {
  height: 48px;
  padding: 0 4px 0 20px;
}

.ft-panel[data-sheet] .ft-panel-close {
  width: 44px;
  height: 44px;
}

@keyframes ft-sheet-in {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
}

@keyframes ft-sheet-out {
  to {
    opacity: 0;
    transform: translateY(100%);
  }
}

@keyframes ft-fade-in {
  from {
    opacity: 0;
  }
}

@keyframes ft-fade-out {
  to {
    opacity: 0;
  }
}
/* The reader is exactly as large as its frame, whatever the frame is, and the frame never scrolls. */
html,
body {
  width: 100%;
  overflow: hidden;
}

.ft-reader {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.ft-toolbar,
.ft-stage {
  min-width: 0;
}

/* Inside a host page a vertical swipe belongs to the browser, which scrolls the host page. */
.ft-reader[data-embedded] .ft-stage {
  touch-action: pan-y pinch-zoom;
}
/* One container per page, laid over the page; only its links take the pointer. */
.ft-links {
  position: absolute;
  pointer-events: none;
}

.ft-link {
  position: absolute;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.ft-link:hover,
.ft-link:focus-visible {
  background: rgb(0 90 255 / 15%);
}

.ft-link:focus-visible {
  outline: 2px solid #005aff;
  outline-offset: 1px;
}

.ft-link--disabled {
  cursor: default;
  pointer-events: none;
}
/* A horizontal swipe turns the page; the vertical pan and the pinch stay with the browser. */
.ft-stage {
  touch-action: pan-y pinch-zoom;
}

/* The counter is a pill: the view in bold over the input, then "/ 8" in faint text. The chrome colours tint it. */
.ft-page-field {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  gap: 4px;
  min-width: 84px;
  height: 32px;
  margin: 0 6px;
  padding: 0 10px;
  border-radius: 8px;
  background: color-mix(in srgb, currentColor 7%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 10%, transparent);
  color: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ft-page-field:focus-within {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 35%, transparent);
}

/* The input and the view share one cell: the input asks for 3ch and then fills a cell the view made wider. */
.ft-page-view {
  display: inline-grid;
  align-items: center;
}

.ft-page-view > * { grid-area: 1 / 1; }

.ft-page-field input {
  box-sizing: border-box;
  width: 3ch;
  min-width: 100%;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: center;
  caret-color: currentColor;
  outline: none;
}

.ft-page-display {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

.ft-page-count {
  color: color-mix(in srgb, currentColor 58%, transparent);
  white-space: nowrap;
}

/* The view covers the input until the input is focused or holds a refused entry. */
.ft-page-field input:not(:focus, [aria-invalid='true']) { opacity: 0; }
.ft-page-field input:is(:focus, [aria-invalid='true']) + .ft-page-display { visibility: hidden; }

.ft-page-field input[aria-invalid='true'] {
  border-style: dashed;
}

.ft-page-message {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
}

.ft-page-message:empty {
  display: none;
}

/* Side arrows: circles of frosted stage, 20 from the stage edge, level with its middle. */
.ft-side-arrow {
  position: absolute;
  top: var(--ft-stage-middle, 50%);
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 50%;
  background: rgb(14 15 18 / 50%);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ft-side-arrow--previous { left: 20px; }
.ft-side-arrow--next { right: 20px; }
.ft-side-arrow svg { width: 22px; height: 22px; }
.ft-side-arrow:disabled { opacity: 0.25; cursor: default; }

.ft-side-arrow:hover:not(:disabled) {
  border-color: rgb(255 255 255 / 24%);
  background: rgb(14 15 18 / 80%);
}

.ft-side-arrow[hidden] { display: none; }

/* The side arrows carry the boundary state: on the cover the toolbar First and Previous, and on the last
   view Next and Last, sit at the 35% of a disabled control. They stay buttons that turn nowhere, so a
   tap past the end is a tap and no more. */
.ft-reader:has(.ft-side-arrow--previous:disabled) .ft-toolbar button:is([data-control='first'], [data-control='previous']),
.ft-reader:has(.ft-side-arrow--next:disabled) .ft-toolbar button:is([data-control='next'], [data-control='last']) {
  opacity: 0.35;
  cursor: not-allowed;
}

/* An open panel narrows the stage and the pages reach under the arrows; the toolbar still turns the page. */
.ft-panel[data-panel] ~ .ft-side-arrow { display: none; }

/* Narrow pages already use the full width; navigation stays in the bottom bar, and the counter grows for a thumb. */
@media (max-width: 600px) {
  .ft-side-arrow { display: none; }

  .ft-page-field {
    min-width: 76px;
    height: 34px;
    border-radius: 9px;
  }

  .ft-page-field input { min-height: 34px; }
}

@media (max-height: 320px) {
  .ft-side-arrow { display: none; }

  .ft-page-field {
    min-width: 64px;
    height: 28px;
  }

  .ft-page-field input { min-height: 28px; }
}
/* The StPageFlip engine: the book sits centred in the stage and is sized by the engine. */
.ft-flip {
  position: absolute;
  inset: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ft-flip-book {
  flex: none;
}

/* StPageFlip gives its wrapper a height only when it sizes the book itself. */
.ft-flip-book .stf__wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.ft-flip-page {
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 48px -12px rgb(0 0 0 / 55%), 0 4px 12px rgb(0 0 0 / 30%);
}

/* Resting sheets cast outward, not onto the opposite page at the spine.
   The gutter already supplies that shading and stays consistent during a grab. */
.ft-flip-book--spread .ft-flip-page.--simple.--left {
  clip-path: inset(-96px 0 -96px -96px);
}

.ft-flip-book--spread .ft-flip-page.--simple.--right {
  clip-path: inset(-96px -96px -96px 0);
}

/* The soft front stays rectangular under the fold. Its resting shadow must not
   remain behind: StPageFlip draws the moving crease and reverse-face shadows.
   Hard covers actually rotate, so their moving shadow remains intact. */
.ft-flip-page--lifting.--simple {
  box-shadow: none;
}

/* One page wide, the page turned back comes in over the page's left edge, not from the
   unseen page StPageFlip keeps beyond it. */
.ft-flip-book--back-over-edge .stf__block {
  clip-path: inset(-100vmax -100vmax -100vmax 0);
}

/* No receiving sheet beyond either closed cover. Keep the crease shadow on the
   moving reverse face without projecting a page-shaped shadow into the void. */
.ft-flip-book--empty-under-fold .stf__outerShadow {
  display: none !important;
}

/* Keep only the unturned front face. Otherwise antialiasing of the decorative
   sheet exposes a hairline of the full rectangular page underneath it. */
.ft-flip-book--empty-under-fold .ft-flip-page--lifting.--simple {
  clip-path: var(--ft-front-clip) !important;
}

.ft-flip-image,
.ft-flip-image.ft-page {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff center / 100% 100% no-repeat;
  box-shadow: none;
}

/* Centering is driven by the page-turn frames, so the fold and its hinge share one clock. */
.ft-flip-book {
  cursor: default;
}

.ft-flip-book--dragging {
  cursor: grabbing;
}

/* Decorative space underneath closed covers; never a reader page or navigation target. */
.ft-flip-blank {
  background: var(--ft-book-background);
  box-shadow: none;
  pointer-events: none;
}

/* Mixed page shapes are fitted into individual leaves without stretching their images. */
.ft-flip-leaf:not(.ft-flip-blank) {
  background: #fff;
}

.ft-flip-leaf .ft-page-frame,
.ft-flip-leaf .ft-flip-image {
  max-width: none;
  max-height: none;
}

/* Distant jumps: independent curls layered around the same spine. */
.ft-riffle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  isolation: isolate;
}

.ft-riffle-base,
.ft-riffle-sheet {
  position: absolute;
  inset: 0;
}

.ft-riffle-face {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 28px -10px rgb(0 0 0 / 35%);
}

.ft-riffle-back {
  transform-origin: 0 0;
}

.ft-riffle-back::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(0 0 0 / 18%), transparent 35%, rgb(0 0 0 / 6%));
}

.ft-riffle-blank {
  background: transparent;
  box-shadow: none;
}

.ft-riffle-blank::after {
  display: none;
}
/* The control in the slot of the header: a field-style button that opens the panel. */
.ft-brand .ft-brand-search button {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  width: 280px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  background: color-mix(in srgb, currentColor 6%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 8%, transparent);
  color: color-mix(in srgb, currentColor 66%, transparent);
  font-size: 13px;
  text-align: left;
  cursor: text;
}

.ft-brand .ft-brand-search button:hover {
  background: color-mix(in srgb, currentColor 9%, transparent);
  color: color-mix(in srgb, currentColor 85%, transparent);
}

.ft-brand .ft-brand-search button svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.6;
}

.ft-search-placeholder {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* While the panel is open the slot is the live field; the control stays as its icon. */
.ft-brand .ft-search-live {
  display: flex;
  flex: none;
  gap: 8px;
  align-items: center;
  box-sizing: border-box;
  width: 280px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  background: color-mix(in srgb, currentColor 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 28%, transparent);
}

.ft-brand .ft-search-live:focus-within {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 45%, transparent);
}

.ft-brand .ft-search-live button,
.ft-brand .ft-search-live button:hover,
.ft-brand .ft-search-live button[aria-pressed='true'] {
  width: 24px;
  height: 34px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: inherit;
}

.ft-brand .ft-search-live .ft-search-placeholder {
  display: none;
}

.ft-search-field {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.ft-search-field::placeholder {
  color: color-mix(in srgb, currentColor 60%, transparent);
}

/* The ring of the live field shows the focus; the field itself draws none. */
.ft-reader .ft-search-field:focus-visible {
  outline: none;
  box-shadow: none;
}

.ft-search-field::-webkit-search-cancel-button {
  appearance: none;
}

.ft-search-count {
  flex: none;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, currentColor 66%, transparent);
}

.ft-search-count:empty {
  display: none;
}

/* Phone: the closed slot is an icon button; the live field takes the room of the title. */
@media (max-width: 600px) {
  .ft-brand .ft-brand-search button {
    gap: 0;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: inherit;
  }

  .ft-brand .ft-brand-search button svg {
    width: 21px;
    height: 21px;
    stroke-width: 1.5;
  }

  .ft-brand .ft-brand-search .ft-search-placeholder {
    display: none;
  }

  .ft-brand .ft-search-live {
    flex: 1;
    width: auto;
  }

  .ft-brand .ft-search-live button {
    width: 24px;
    height: 34px;
  }

  .ft-brand .ft-search-live button svg {
    width: 17px;
    height: 17px;
  }

  .ft-brand:has(.ft-search-live) .ft-brand-divider,
  .ft-brand:has(.ft-search-live) .ft-title {
    display: none;
  }
}

/* The panel body: the status line, then the results. */
.ft-search-status,
.ft-search-unavailable {
  margin: 0 0 12px;
  font-size: 12px;
  color: #a6a8b0;
}

.ft-search-status:empty {
  display: none;
}

.ft-search-query {
  color: #fff;
  font-weight: 600;
}

.ft-search-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ft-search-result {
  display: flex;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ft-search-result:hover,
.ft-search-result:focus-visible {
  background: color-mix(in srgb, currentColor 7%, transparent);
}

/* The result of the page the reader is on. */
.ft-search-result[aria-current] {
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.ft-search-thumbnail {
  flex: none;
  width: 40px;
  height: 52px;
  background: #fff center / cover no-repeat;
  box-shadow: 0 1px 4px rgb(0 0 0 / 40%);
}

.ft-search-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ft-search-page {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.ft-search-snippet {
  font-size: 13px;
  line-height: 1.45;
  color: #c4c6cc;
  overflow-wrap: anywhere;
}

.ft-search-snippet mark {
  padding: 0 2px;
  border-radius: 2px;
  background: rgb(250 204 21 / 28%);
  color: #ffe27a;
}

/* A short phone-width frame: the closed slot fits the slim band. */
@media (max-height: 320px) and (max-width: 600px) {
  .ft-brand .ft-brand-search button {
    width: 30px;
    height: 30px;
  }
}
/* The slide engine: one view fills the stage and its pages sit centred, side by side. */
.ft-view {
  position: absolute;
  inset: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ft-page-frame {
  position: relative;
  display: block;
  flex: none;
  max-width: 100%;
  max-height: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .ft-view--forward {
    animation: ft-slide-forward 0.25s ease-out;
  }

  .ft-view--backward {
    animation: ft-slide-backward 0.25s ease-out;
  }
}

@keyframes ft-slide-forward {
  from {
    opacity: 0;
    transform: translateX(10%);
  }
}

@keyframes ft-slide-backward {
  from {
    opacity: 0;
    transform: translateX(-10%);
  }
}
/* The groups of the panel: the views of a spread layout, two to a row. */
.ft-thumbnails {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ft-thumbnail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, currentColor 65%, transparent);
  font: inherit;
  cursor: pointer;
}

.ft-thumbnail:hover,
.ft-thumbnail[aria-current] {
  color: inherit;
}

/* The pages of the group side by side; the wrapper carries the ring of the current group. */
.ft-thumbnail-pages {
  display: flex;
  padding: 3px;
  border-radius: 5px;
}

.ft-thumbnail-pages img {
  display: block;
  width: 68px;
  height: 88px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 35%);
}

.ft-thumbnail-label {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ft-thumbnail[aria-current] .ft-thumbnail-pages {
  box-shadow: 0 0 0 2px currentColor;
}

.ft-thumbnail[aria-current] .ft-thumbnail-pages img {
  box-shadow: none;
}

.ft-thumbnail[aria-current] .ft-thumbnail-label {
  font-weight: 600;
}

/* Single pages, three to a row: a narrow frame, or a layout of one page at a time. The margins
   take back the padding of the panel body so the grid keeps its own. */
.ft-thumbnails[data-grouping='page'] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 14px;
  margin: -12px -16px -20px;
  padding: 4px 20px 24px;
}

.ft-thumbnails[data-grouping='page'] .ft-thumbnail {
  gap: 6px;
}

.ft-thumbnails[data-grouping='page'] .ft-thumbnail-pages {
  display: block;
  width: 100%;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.ft-thumbnails[data-grouping='page'] .ft-thumbnail-pages img {
  width: 100%;
  height: auto;
}

/* The ring stands off the page by the colour of the panel. */
.ft-thumbnails[data-grouping='page'] .ft-thumbnail[aria-current] .ft-thumbnail-pages img {
  border-radius: 2px;
  box-shadow:
    0 0 0 2px #17181b,
    0 0 0 4px #fff;
}
/*
 * A fitted page leaves the vertical pan to the browser, so the page or the host page still scrolls;
 * the pinch comes to the reader, which zooms the page.
 */
.ft-reader .ft-stage {
  touch-action: pan-y;
}

/* A zoomed page is panned by drag in every direction, also inside a host page. */
.ft-reader .ft-stage.ft-stage--zoomed,
.ft-reader[data-embedded] .ft-stage.ft-stage--zoomed {
  touch-action: none;
}

.ft-stage--zoomed {
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

/* After a double-click the view glides to its new size; the a11y sheet stills it under reduced motion. */
.ft-stage--settling .ft-view {
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* The level pill over the top of the zoomed stage: the level, a hint and Fit page. */
.ft-zoom-pill {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  height: 34px;
  padding: 0 6px 0 14px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 17px;
  background: rgb(14 15 18 / 78%);
  color: #f3f3f5;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  cursor: default;
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: ft-fade-in 150ms ease;
}

.ft-zoom-pill[hidden],
.ft-zoom-map[hidden] {
  display: none;
}

.ft-zoom-level {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ft-zoom-divider {
  width: 1px;
  height: 14px;
  background: rgb(255 255 255 / 18%);
}

.ft-zoom-hint {
  color: #b4b6bd;
}

.ft-zoom-fit {
  height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: rgb(255 255 255 / 14%);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;
  cursor: pointer;
}

.ft-zoom-fit:hover {
  background: rgb(255 255 255 / 22%);
}

.ft-zoom-fit:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* A phone has no room for the hint beside the level and the button. */
@media (max-width: 600px) {
  .ft-zoom-divider,
  .ft-zoom-hint {
    display: none;
  }
}

/* The mini-map at the bottom right: the thumbnails of the shown pages, the width following their shape. */
.ft-zoom-map {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 1;
  width: 96px;
  height: 125px;
  border-radius: 6px;
  overflow: hidden;
  background: #17181b;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 18%), 0 8px 20px rgb(0 0 0 / 40%);
  cursor: pointer;
  touch-action: none;
  animation: ft-fade-in 150ms ease;
}

.ft-zoom-map-pages {
  display: flex;
  width: 100%;
  height: 100%;
}

.ft-zoom-map-page {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  object-fit: fill;
  opacity: 0.55;
  pointer-events: none;
}

/* The part of the pages the stage shows; the shadow dims the rest. */
.ft-zoom-map-view {
  position: absolute;
  border-radius: 2px;
  box-shadow: 0 0 0 1.5px #fff, 0 0 0 999px rgb(0 0 0 / 35%);
  pointer-events: none;
}
