/*!
 * Open Flipbook — viewer shell styles (toolbar, panels, dialogs, lightbox)
 * The book stage itself (pages, 3D) is styled by ofb-engine.css.
 * License: GPL-2.0-or-later
 */

/* ------------------------------------------------------------------ */
/* Tokens & skins                                                      */
/* ------------------------------------------------------------------ */

.ofb-viewer,
.ofb-lightbox,
.ofb-lb {
  --ofb-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ofb-radius: 12px;
  --ofb-radius-sm: 8px;
  --ofb-gap: 2px;
  --ofb-ease: cubic-bezier(.2, .8, .2, 1);
  --ofb-dur: .22s;

  /* light skin (default) */
  --ofb-s-surface: #ffffff;
  --ofb-s-surface-2: #f2f4f7;
  --ofb-s-fg: #1b1f24;
  --ofb-s-muted: #59626e;
  --ofb-s-border: rgba(16, 24, 40, .12);
  --ofb-s-accent: #2459d6;
  --ofb-s-accent-fg: #ffffff;
  --ofb-s-accent-soft: rgba(36, 89, 214, .12);
  --ofb-s-bar-bg: rgba(255, 255, 255, .94);
  --ofb-s-bar-fg: #1b1f24;
  --ofb-s-hover: rgba(16, 24, 40, .07);
  --ofb-s-active: rgba(36, 89, 214, .14);
  --ofb-s-active-fg: #1d4fc4;
  --ofb-s-chip: rgba(255, 255, 255, .92);
  --ofb-s-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 8px 24px rgba(16, 24, 40, .14);
  --ofb-s-focus: #2459d6;
  --ofb-s-mark: #ffe066;
}

.ofb-skin-dark,
.ofb-lightbox.ofb-skin-dark {
  --ofb-s-surface: #1d2025;
  --ofb-s-surface-2: #282c33;
  --ofb-s-fg: #eceef2;
  --ofb-s-muted: #a7afba;
  --ofb-s-border: rgba(255, 255, 255, .12);
  --ofb-s-accent: #6ea2ff;
  --ofb-s-accent-fg: #0d1526;
  --ofb-s-accent-soft: rgba(110, 162, 255, .16);
  --ofb-s-bar-bg: rgba(22, 24, 28, .94);
  --ofb-s-bar-fg: #eceef2;
  --ofb-s-hover: rgba(255, 255, 255, .09);
  --ofb-s-active: rgba(110, 162, 255, .2);
  --ofb-s-active-fg: #a9c8ff;
  --ofb-s-chip: rgba(22, 24, 28, .86);
  --ofb-s-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .4);
  --ofb-s-focus: #8db7ff;
  --ofb-s-mark: #c99a00;
}

.ofb-skin-gradient {
  --ofb-s-accent: #5b45d6;
  --ofb-s-accent-soft: rgba(91, 69, 214, .12);
  --ofb-s-bar-bg: linear-gradient(115deg, #26296b 0%, #4f3a9c 52%, #0e6f8f 100%);
  --ofb-s-bar-fg: #ffffff;
  --ofb-s-hover: rgba(255, 255, 255, .14);
  --ofb-s-active: rgba(255, 255, 255, .24);
  --ofb-s-active-fg: #ffffff;
  --ofb-s-chip: linear-gradient(115deg, rgba(38, 41, 107, .92), rgba(79, 58, 156, .92) 52%, rgba(14, 111, 143, .92));
  --ofb-s-focus: #ffd166;
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

.ofb-flipbook {
  display: block;
  position: relative;
  max-width: 100%;
}

.ofb-flipbook--inline {
  width: 100%;
}

.ofb-viewer {
  position: relative;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  height: 480px;
  min-height: 220px;
  overflow: hidden;
  font-family: var(--ofb-font);
  font-size: 14px;
  line-height: 1.4;
  color: var(--ofb-s-fg);
  background: var(--ofb-bg-layers, none), var(--ofb-bg, rgb(81, 85, 88));
  -webkit-tap-highlight-color: transparent;
  container: ofb / inline-size;
  isolation: isolate;
}

.ofb-viewer *,
.ofb-viewer *::before,
.ofb-viewer *::after,
.ofb-lightbox *,
.ofb-lb * {
  box-sizing: border-box;
}

.ofb-viewer [hidden],
.ofb-lightbox [hidden],
.ofb-lb [hidden] {
  display: none !important;
}

.ofb-viewer:focus {
  outline: none;
}

.ofb-viewer :focus-visible,
.ofb-lightbox :focus-visible,
.ofb-lb :focus-visible {
  outline: 2px solid var(--ofb-s-focus);
  outline-offset: 2px;
}

.ofb-icon {
  display: block;
  flex: none;
  width: 1em;
  height: 1em;
  pointer-events: none;
}

html.ofb-noscroll,
html.ofb-noscroll body {
  overflow: hidden !important;
}

.ofb-print-frame {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Body & stage                                                        */
/* ------------------------------------------------------------------ */

.ofb-body {
  position: relative;
  grid-row: 2;
  grid-column: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.ofb-top-over .ofb-body {
  grid-row: 1 / 3;
}

.ofb-bottom-over .ofb-body {
  grid-row: 2 / 4;
}

.ofb-top-over.ofb-bottom-over .ofb-body,
.ofb-hide-menu .ofb-body {
  grid-row: 1 / 4;
}

.ofb-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Toolbars                                                            */
/* ------------------------------------------------------------------ */

.ofb-bar {
  position: relative;
  z-index: 6;
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin: var(--ofb-bar-margin, 0);
  padding: var(--ofb-bar-pad, 4px 6px);
  color: var(--ofb-btn-color, var(--ofb-ui-fg, var(--ofb-s-bar-fg)));
  background: var(--ofb-bar-bg, var(--ofb-ui-bg, var(--ofb-s-bar-bg)));
  box-shadow: var(--ofb-bar-shadow, none);
}

.ofb-bar--top {
  grid-row: 1;
  align-self: start;
  --ofb-bar-bg: var(--ofb-top-bg);
  --ofb-bar-shadow: var(--ofb-top-shadow, 0 1px 0 var(--ofb-s-border));
  --ofb-bar-margin: var(--ofb-top-margin);
  --ofb-bar-pad: var(--ofb-top-pad);
}

.ofb-bar--bottom {
  grid-row: 3;
  align-self: end;
  --ofb-bar-bg: var(--ofb-bottom-bg);
  --ofb-bar-shadow: var(--ofb-bottom-shadow, 0 -1px 0 var(--ofb-s-border));
  --ofb-bar-margin: var(--ofb-bottom-margin);
  --ofb-bar-pad: var(--ofb-bottom-pad);
}

.ofb-zone {
  display: flex;
  align-items: center;
  gap: var(--ofb-gap);
  min-width: 0;
  padding: 3px;
  overflow: hidden;
}

.ofb-zone--left {
  flex: 1 1 0;
  justify-content: flex-start;
}

.ofb-zone--center {
  flex: 0 1 auto;
  justify-content: center;
}

.ofb-zone--right {
  flex: 1 1 0;
  justify-content: flex-end;
}

.ofb-bar--no-center .ofb-zone--left,
.ofb-bar--no-center .ofb-zone--right {
  flex: 1 1 auto;
}

.ofb-zone--empty {
  padding: 0;
}

.ofb-align-left .ofb-bar--no-center .ofb-zone--left,
.ofb-align-left .ofb-zone--center {
  justify-content: flex-start;
}

.ofb-align-right .ofb-zone--center {
  justify-content: flex-end;
}

/* bar over the book: floats above the stage */
.ofb-top-over .ofb-bar--top,
.ofb-bottom-over .ofb-bar--bottom {
  box-shadow: var(--ofb-bar-shadow-over, var(--ofb-s-shadow));
}

/* transparent bar: each group becomes a pill */
.ofb-top-transparent .ofb-bar--top,
.ofb-bottom-transparent .ofb-bar--bottom {
  background: transparent;
  box-shadow: none;
  padding: 8px 10px;
  pointer-events: none;
}

.ofb-top-transparent .ofb-bar--top .ofb-zone,
.ofb-bottom-transparent .ofb-bar--bottom .ofb-zone {
  flex-basis: auto;
  pointer-events: none;
}

.ofb-top-transparent .ofb-bar--top .ofb-zone:not(.ofb-zone--empty),
.ofb-bottom-transparent .ofb-bar--bottom .ofb-zone:not(.ofb-zone--empty) {
  flex: 0 1 auto;
  padding: 3px;
  border-radius: 999px;
  background: var(--ofb-bar-bg, var(--ofb-ui-bg, var(--ofb-s-chip)));
  box-shadow: var(--ofb-s-shadow);
  pointer-events: auto;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.ofb-top-transparent .ofb-bar--top .ofb-zone--left,
.ofb-bottom-transparent .ofb-bar--bottom .ofb-zone--left {
  margin-right: auto;
}

.ofb-top-transparent .ofb-bar--top .ofb-zone--right,
.ofb-bottom-transparent .ofb-bar--bottom .ofb-zone--right {
  margin-left: auto;
}

.ofb-top-transparent .ofb-bar--top.ofb-bar--no-center .ofb-zone--right:not(.ofb-zone--empty),
.ofb-bottom-transparent .ofb-bar--bottom.ofb-bar--no-center .ofb-zone--right:not(.ofb-zone--empty) {
  flex-shrink: 1;
}

/* floating bar: compact pill detached from the edges */
.ofb-top-floating .ofb-bar--top,
.ofb-bottom-floating .ofb-bar--bottom {
  justify-self: center;
  width: max-content;
  max-width: calc(100% - 24px);
  margin: var(--ofb-bar-margin, 10px auto);
  border-radius: 999px;
  box-shadow: var(--ofb-s-shadow);
}

.ofb-align-left.ofb-top-floating .ofb-bar--top,
.ofb-align-left.ofb-bottom-floating .ofb-bar--bottom {
  justify-self: start;
  margin-left: 12px;
}

.ofb-align-right.ofb-top-floating .ofb-bar--top,
.ofb-align-right.ofb-bottom-floating .ofb-bar--bottom {
  justify-self: end;
  margin-right: 12px;
}

.ofb-top-floating .ofb-bar--top .ofb-zone,
.ofb-bottom-floating .ofb-bar--bottom .ofb-zone {
  flex: 0 1 auto;
}

/* the floating close button of the lightbox sits in the top-right corner */
.ofb-has-close .ofb-bar--top {
  padding-right: calc(var(--ofb-close-size, 22px) + 2 * var(--ofb-close-pad, 9px) + 2 * var(--ofb-close-margin, 12px));
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.ofb-btn {
  appearance: none;
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: var(--ofb-btn-margin, 0);
  padding: var(--ofb-btn-pad-v, 9px) var(--ofb-btn-pad-h, 9px);
  border: var(--ofb-btn-border, 0);
  border-radius: var(--ofb-btn-radius, 10px);
  font: inherit;
  font-size: var(--ofb-btn-size, 18px);
  line-height: 1;
  color: inherit;
  background: var(--ofb-btn-bg, transparent);
  box-shadow: var(--ofb-btn-shadow, none);
  cursor: pointer;
  user-select: none;
  transition: background-color var(--ofb-dur) var(--ofb-ease), color var(--ofb-dur) var(--ofb-ease), opacity var(--ofb-dur) var(--ofb-ease), transform .12s var(--ofb-ease);
}

.ofb-btn .ofb-icon {
  filter: var(--ofb-btn-filter, none);
}

.ofb-btn:hover:not(:disabled) {
  color: var(--ofb-btn-color-hover, inherit);
  background-color: var(--ofb-s-hover);
}

.ofb-btn:active:not(:disabled) {
  transform: scale(.94);
}

.ofb-btn:disabled {
  opacity: .38;
  cursor: default;
}

.ofb-btn.ofb-is-active,
.ofb-btn[aria-pressed="true"],
.ofb-btn[aria-expanded="true"] {
  color: var(--ofb-btn-color-hover, var(--ofb-s-active-fg));
  background-color: var(--ofb-s-active);
}

.ofb-skin-gradient .ofb-bar .ofb-btn.ofb-is-active,
.ofb-skin-gradient .ofb-bar .ofb-btn[aria-pressed="true"],
.ofb-skin-gradient .ofb-bar .ofb-btn[aria-expanded="true"] {
  color: var(--ofb-btn-color-hover, #fff);
}

.ofb-btn__text {
  font-size: 14px;
}

.ofb-btn--ghost {
  --ofb-btn-pad-v: 8px;
  --ofb-btn-pad-h: 8px;
  --ofb-btn-size: 18px;
  --ofb-btn-bg: transparent;
  --ofb-btn-border: 0;
  --ofb-btn-shadow: none;
  --ofb-btn-margin: 0;
  color: var(--ofb-s-muted);
}

.ofb-btn--ghost:hover:not(:disabled) {
  color: var(--ofb-s-fg);
}

.ofb-btn--sm {
  --ofb-btn-pad-v: 6px;
  --ofb-btn-pad-h: 6px;
  --ofb-btn-size: 16px;
}

/* current page field */
.ofb-pageinfo {
  display: inline-flex;
  flex: none;
  align-items: baseline;
  gap: 4px;
  margin: var(--ofb-cp-mv, 0) var(--ofb-cp-mh, 4px);
  padding: 0 10px;
  height: calc(var(--ofb-btn-size, 18px) + 2 * var(--ofb-btn-pad-v, 9px));
  align-items: center;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: background-color var(--ofb-dur) var(--ofb-ease);
}

.ofb-pageinfo:hover,
.ofb-pageinfo:focus-within {
  background: var(--ofb-s-hover);
}

/* Class doubled (0,2,0): themes like Avada style input[type="text"] (0,1,1)
   with height, padding and width:100%, which hid the page number. */
.ofb-pageinfo__input.ofb-pageinfo__input {
  width: 3ch;
  min-width: 2ch;
  max-width: 12ch;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px dashed currentColor;
  border-radius: 0;
  margin: 0;
  height: auto;
  min-height: 0;
  line-height: normal;
  box-shadow: none;
  appearance: none;
  font: inherit;
  font-weight: 600;
  text-align: center;
  color: inherit;
  background: transparent;
  opacity: .95;
}

.ofb-pageinfo__input.ofb-pageinfo__input:focus {
  outline: none;
  border-bottom-style: solid;
}

.ofb-pageinfo__total {
  opacity: .72;
}

/* inline search field */
.ofb-searchfield {
  display: inline-flex;
  flex: none;
  align-items: center;
  margin: 0 4px;
  padding-left: 12px;
  border-radius: 999px;
  background: var(--ofb-s-hover);
}

.ofb-searchfield__input.ofb-searchfield__input {
  width: 140px;
  min-width: 0;
  padding: 7px 0;
  border: 0;
  border-radius: 0;
  margin: 0;
  height: auto;
  min-height: 0;
  line-height: normal;
  box-shadow: none;
  appearance: none;
  font: inherit;
  color: inherit;
  background: transparent;
}

.ofb-searchfield__input::placeholder {
  color: inherit;
  opacity: .65;
}

.ofb-searchfield__input.ofb-searchfield__input:focus {
  outline: none;
}

.ofb-searchfield:focus-within {
  outline: 2px solid var(--ofb-s-focus);
  outline-offset: 1px;
}

/* ------------------------------------------------------------------ */
/* Side arrows                                                         */
/* ------------------------------------------------------------------ */

.ofb-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  --ofb-btn-size: var(--ofb-arrow-size, 26px);
  --ofb-btn-pad-v: var(--ofb-arrow-pad, 10px);
  --ofb-btn-pad-h: var(--ofb-arrow-pad, 10px);
  --ofb-btn-radius: var(--ofb-arrow-radius, 999px);
  --ofb-btn-border: var(--ofb-arrow-border, 0);
  --ofb-btn-filter: var(--ofb-arrow-filter, none);
  --ofb-btn-margin: 0;
  --ofb-btn-shadow: none;
  color: var(--ofb-arrow-color, #fff);
  background: var(--ofb-arrow-bg, rgba(12, 14, 18, .32));
  transform: translateY(-50%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.ofb-arrow:hover:not(:disabled) {
  color: var(--ofb-arrow-color-hover, #fff);
  background: var(--ofb-arrow-bg-hover, rgba(12, 14, 18, .55));
}

.ofb-arrow:active:not(:disabled) {
  transform: translateY(-50%) scale(.94);
}

.ofb-arrow--left {
  left: var(--ofb-arrow-margin, 12px);
}

.ofb-arrow--right {
  right: var(--ofb-arrow-margin, 12px);
}

.ofb-is-loading .ofb-arrow {
  visibility: hidden;
}

/* ------------------------------------------------------------------ */
/* Logo & note markers                                                 */
/* ------------------------------------------------------------------ */

.ofb-logo {
  z-index: 5;
  display: block;
  line-height: 0;
}

.ofb-logo__img {
  display: block;
  max-width: 160px;
  max-height: 56px;
  width: auto;
  height: auto;
}

.ofb-note-marker {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  --ofb-btn-size: 16px;
  --ofb-btn-pad-v: 7px;
  --ofb-btn-pad-h: 7px;
  --ofb-btn-radius: 999px;
  --ofb-btn-margin: 0;
  color: #3d2c00;
  background: #ffd25a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.ofb-note-marker:hover:not(:disabled) {
  color: #3d2c00;
  background: #ffc21a;
}

.ofb-note-marker__count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  color: #fff;
  background: #c2410c;
}

/* ------------------------------------------------------------------ */
/* Overlay layer: menu, tooltip, toast                                 */
/* ------------------------------------------------------------------ */

.ofb-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  grid-row: 1 / 4;
  grid-column: 1;
  overflow: hidden;
  pointer-events: none;
}

.ofb-layer > * {
  pointer-events: auto;
}

.ofb-menu {
  position: absolute;
  min-width: 210px;
  max-width: calc(100% - 16px);
  max-height: calc(100% - 16px);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--ofb-s-border);
  border-radius: var(--ofb-radius);
  color: var(--ofb-s-fg);
  background: var(--ofb-s-surface);
  box-shadow: var(--ofb-s-shadow);
  animation: ofb-pop var(--ofb-dur) var(--ofb-ease);
}

.ofb-menu__item {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--ofb-radius-sm);
  font: inherit;
  font-size: 14px;
  text-align: left;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.ofb-menu__item .ofb-icon {
  font-size: 18px;
  color: var(--ofb-s-muted);
}

.ofb-menu__item:hover:not(:disabled),
.ofb-menu__item:focus-visible {
  background: var(--ofb-s-hover);
}

.ofb-menu__item.ofb-is-active .ofb-icon,
.ofb-menu__item[aria-checked="true"] .ofb-icon {
  color: var(--ofb-s-accent);
}

.ofb-menu__item[aria-checked="true"]::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--ofb-s-accent);
}

.ofb-menu__item:disabled {
  opacity: .45;
  cursor: default;
}

.ofb-menu__label {
  flex: 1 1 auto;
  white-space: nowrap;
}

.ofb-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 50;
  max-width: 240px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: #fff;
  background: rgba(17, 19, 23, .92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
  transition: opacity .14s ease, visibility 0s linear .14s;
}

.ofb-tooltip.ofb-is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity .14s ease;
}

.ofb-toast {
  position: absolute;
  left: 50%;
  bottom: 72px;
  z-index: 45;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: rgba(17, 19, 23, .9);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity var(--ofb-dur) var(--ofb-ease), transform var(--ofb-dur) var(--ofb-ease);
  pointer-events: none !important;
}

.ofb-toast.ofb-is-open {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------------ */
/* Preloader                                                           */
/* ------------------------------------------------------------------ */

.ofb-preloader {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 16px;
  transition: opacity .3s ease;
}

.ofb-preloader.ofb-is-hidden {
  opacity: 0;
  pointer-events: none;
}

.ofb-preloader__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(260px, 100%);
  padding: 20px 22px;
  border-radius: var(--ofb-radius);
  color: var(--ofb-s-fg);
  background: var(--ofb-s-surface);
  box-shadow: var(--ofb-s-shadow);
  text-align: center;
}

.ofb-preloader__text {
  margin: 0;
  font-size: 13px;
  color: var(--ofb-s-muted);
}

.ofb-preloader--error .ofb-preloader__text {
  color: var(--ofb-s-fg);
}

.ofb-preloader__icon {
  font-size: 30px;
  color: #d0402b;
}

.ofb-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--ofb-s-accent-soft);
  border-top-color: var(--ofb-s-accent);
  border-radius: 50%;
  animation: ofb-spin .8s linear infinite;
}

.ofb-progress {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ofb-s-surface-2);
}

.ofb-progress__fill {
  height: 100%;
  background: var(--ofb-s-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .2s ease;
}

/* ------------------------------------------------------------------ */
/* Side panels                                                         */
/* ------------------------------------------------------------------ */

.ofb-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  width: min(320px, 100%);
  color: var(--ofb-s-fg);
  background: var(--ofb-s-surface);
  box-shadow: var(--ofb-s-shadow);
  opacity: 0;
  transform: translateX(-16px);
  transition: transform var(--ofb-dur) var(--ofb-ease), opacity var(--ofb-dur) var(--ofb-ease);
}

.ofb-panel--search,
.ofb-panel--bookmarks,
.ofb-panel--notes {
  left: auto;
  right: 0;
  transform: translateX(16px);
}

.ofb-panel--thumbs {
  width: min(calc(2 * var(--ofb-thumb-w, 130px) + 64px), 100%);
}

.ofb-panel.ofb-is-open {
  opacity: 1;
  transform: none;
}

.ofb-panel__header {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--ofb-s-border);
}

.ofb-panel__title {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  color: inherit;
}

.ofb-panel__title .ofb-icon {
  font-size: 18px;
  color: var(--ofb-s-accent);
}

.ofb-panel__title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ofb-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px;
  scrollbar-width: thin;
}

.ofb-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.ofb-empty {
  margin: 8px 4px;
  padding: 0;
  font-size: 13px;
  color: var(--ofb-s-muted);
  list-style: none;
}

/* thumbnails */
.ofb-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--ofb-thumb-w, 130px), 100%), 1fr));
  gap: 14px 12px;
  margin: 0;
  padding: 2px;
  list-style: none;
}

.ofb-thumb {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.ofb-thumb__frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--ofb-page-ratio, .7071);
  overflow: hidden;
  border-radius: 4px;
  background: var(--ofb-s-surface-2);
  box-shadow: 0 0 0 1px var(--ofb-s-border), 0 2px 6px rgba(16, 24, 40, .1);
  transition: box-shadow var(--ofb-dur) var(--ofb-ease), transform var(--ofb-dur) var(--ofb-ease);
}

.ofb-thumb:not(.ofb-is-loaded):not(.ofb-is-failed) .ofb-thumb__frame {
  background: linear-gradient(100deg, var(--ofb-s-surface-2) 30%, var(--ofb-s-hover) 50%, var(--ofb-s-surface-2) 70%) 0 0 / 300% 100%;
  animation: ofb-shimmer 1.4s linear infinite;
}

.ofb-thumb__img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.ofb-thumb__label {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ofb-s-muted);
}

.ofb-thumb:hover .ofb-thumb__frame {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--ofb-s-border), 0 6px 14px rgba(16, 24, 40, .16);
}

.ofb-thumb.ofb-is-current .ofb-thumb__frame {
  box-shadow: 0 0 0 2px var(--ofb-s-accent), 0 4px 12px rgba(16, 24, 40, .16);
}

.ofb-thumb.ofb-is-current .ofb-thumb__label {
  font-weight: 650;
  color: var(--ofb-s-accent);
}

/* table of contents */
.ofb-toc {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ofb-toc__item {
  margin: 0;
}

.ofb-toc__row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.ofb-toc__toggle,
.ofb-toc__spacer {
  flex: none;
  width: 28px;
  height: 28px;
}

.ofb-toc__toggle {
  appearance: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  font-size: 16px;
  color: var(--ofb-s-muted);
  background: transparent;
  cursor: pointer;
}

.ofb-toc__toggle .ofb-icon {
  transition: transform var(--ofb-dur) var(--ofb-ease);
}

.ofb-toc__toggle[aria-expanded="true"] .ofb-icon {
  transform: rotate(90deg);
}

.ofb-toc__toggle:hover {
  color: var(--ofb-s-fg);
  background: var(--ofb-s-hover);
}

.ofb-toc__link {
  appearance: none;
  display: flex;
  flex: 1 1 auto;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  text-align: left;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.ofb-toc--sub {
  padding-left: 16px;
}

.ofb-toc__link:hover:not(:disabled) {
  background: var(--ofb-s-hover);
}

.ofb-toc__link:disabled {
  cursor: default;
  color: var(--ofb-s-muted);
}

.ofb-toc__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ofb-toc__page {
  flex: none;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ofb-s-muted);
}

/* forms */
.ofb-input.ofb-input {
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
  margin: 0;
  line-height: normal;
  padding: 9px 12px;
  border: 1px solid var(--ofb-s-border);
  border-radius: var(--ofb-radius-sm);
  font: inherit;
  font-size: 14px;
  color: var(--ofb-s-fg);
  background: var(--ofb-s-surface);
  transition: border-color var(--ofb-dur), box-shadow var(--ofb-dur);
}

.ofb-input.ofb-input:focus {
  outline: none;
  border-color: var(--ofb-s-accent);
  box-shadow: 0 0 0 3px var(--ofb-s-accent-soft);
}

textarea.ofb-input.ofb-input {
  resize: vertical;
  min-height: 72px;
}

.ofb-form-error {
  margin: 8px 0 0;
  font-size: 13px;
  color: #c0341d;
}

.ofb-skin-dark .ofb-form-error {
  color: #ff8a73;
}

.ofb-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--ofb-s-border);
  border-radius: var(--ofb-radius-sm);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  color: var(--ofb-s-fg);
  background: var(--ofb-s-surface);
  cursor: pointer;
  transition: background-color var(--ofb-dur), border-color var(--ofb-dur), opacity var(--ofb-dur);
}

.ofb-action .ofb-icon {
  font-size: 17px;
}

.ofb-action:hover:not(:disabled) {
  background: var(--ofb-s-surface-2);
}

.ofb-action--primary {
  border-color: transparent;
  color: var(--ofb-s-accent-fg);
  background: var(--ofb-s-accent);
}

.ofb-action--primary:hover:not(:disabled) {
  background: var(--ofb-s-accent);
  filter: brightness(1.08);
}

.ofb-action:disabled {
  opacity: .5;
  cursor: default;
}

/* search */
.ofb-search__form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ofb-search__status {
  margin: 10px 2px 8px;
  font-size: 12.5px;
  color: var(--ofb-s-muted);
}

.ofb-search__status:empty {
  display: none;
}

.ofb-results {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ofb-result {
  appearance: none;
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  text-align: left;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.ofb-result:hover {
  background: var(--ofb-s-hover);
}

.ofb-result__thumb {
  flex: none;
  width: 44px;
  aspect-ratio: var(--ofb-page-ratio, .7071);
  overflow: hidden;
  border-radius: 3px;
  background: var(--ofb-s-surface-2);
  box-shadow: 0 0 0 1px var(--ofb-s-border);
}

.ofb-result__thumb > * {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.ofb-result__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ofb-result__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ofb-result__page {
  font-weight: 650;
}

.ofb-result__count {
  font-size: 12px;
  color: var(--ofb-s-muted);
}

.ofb-result__snippet {
  font-size: 13px;
  color: var(--ofb-s-muted);
  overflow-wrap: anywhere;
}

.ofb-viewer mark,
.ofb-lightbox mark {
  padding: 0 1px;
  border-radius: 2px;
  color: inherit;
  background: var(--ofb-s-mark);
}

.ofb-skin-dark mark {
  color: #fff;
}

/* bookmarks */
.ofb-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ofb-list__row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 10px;
}

.ofb-list__row:hover {
  background: var(--ofb-s-hover);
}

.ofb-list__main {
  appearance: none;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 0;
  font: inherit;
  text-align: left;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.ofb-list__main .ofb-icon {
  font-size: 17px;
  color: var(--ofb-s-accent);
}

/* notes */
.ofb-notes__form {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.ofb-notes__bar {
  display: flex;
  gap: 8px;
}

.ofb-notes__page.ofb-notes__page {
  flex: 1 1 auto;
  width: auto;
}

.ofb-notes {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ofb-note {
  padding: 10px 12px;
  border: 1px solid var(--ofb-s-border);
  border-left: 3px solid #f5b70a;
  border-radius: 10px;
  background: var(--ofb-s-surface);
}

.ofb-note.ofb-is-current {
  background: var(--ofb-s-accent-soft);
}

.ofb-note--t2 {
  border-left-color: #2fa36b;
}

.ofb-note--t3 {
  border-left-color: #7c5cff;
}

.ofb-note__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.ofb-note__head > .ofb-btn {
  margin-left: auto;
}

.ofb-note__page {
  appearance: none;
  padding: 0;
  border: 0;
  font: inherit;
  font-weight: 650;
  color: var(--ofb-s-accent);
  background: none;
  cursor: pointer;
}

.ofb-note__page:hover {
  text-decoration: underline;
}

.ofb-note__date {
  font-size: 12px;
  color: var(--ofb-s-muted);
}

.ofb-note__text {
  margin: 4px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ofb-badge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .02em;
  color: var(--ofb-s-accent);
  background: var(--ofb-s-accent-soft);
}

/* ------------------------------------------------------------------ */
/* Modal dialogs                                                       */
/* ------------------------------------------------------------------ */

.ofb-modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 12, 16, .48);
  opacity: 0;
  transition: opacity .16s ease;
}

.ofb-modal.ofb-is-open {
  opacity: 1;
}

.ofb-modal__dialog {
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  max-height: 100%;
  overflow: hidden;
  border-radius: 16px;
  color: var(--ofb-s-fg);
  background: var(--ofb-s-surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  transform: translateY(8px) scale(.98);
  transition: transform .2s var(--ofb-ease);
}

.ofb-modal.ofb-is-open .ofb-modal__dialog {
  transform: none;
}

.ofb-modal__dialog:focus {
  outline: none;
}

.ofb-modal__header {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 4px 20px;
}

.ofb-modal__title {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.3;
  color: inherit;
}

.ofb-modal__title .ofb-icon {
  font-size: 20px;
  color: var(--ofb-s-accent);
}

.ofb-modal__close {
  margin-left: auto;
}

.ofb-modal__content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px 20px 18px;
}

.ofb-modal__text {
  margin: 0 0 12px;
  color: var(--ofb-s-muted);
}

.ofb-modal__actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 18px;
}

.ofb-password .ofb-form-error {
  margin: -4px 0 10px;
}

/* choice dialog (print / download) */
.ofb-choices {
  display: grid;
  gap: 8px;
}

.ofb-choice {
  appearance: none;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ofb-s-border);
  border-radius: 12px;
  font: inherit;
  text-align: left;
  color: inherit;
  background: var(--ofb-s-surface);
  cursor: pointer;
  transition: border-color var(--ofb-dur), background-color var(--ofb-dur);
}

.ofb-choice .ofb-icon {
  grid-row: 1 / 3;
  font-size: 22px;
  color: var(--ofb-s-accent);
}

.ofb-choice__label {
  font-weight: 600;
}

.ofb-choice__hint {
  font-size: 12.5px;
  color: var(--ofb-s-muted);
}

.ofb-choice:hover {
  border-color: var(--ofb-s-accent);
  background: var(--ofb-s-accent-soft);
}

/* share */
.ofb-share__row {
  display: flex;
  gap: 8px;
}

.ofb-share__url.ofb-share__url {
  flex: 1 1 auto;
  font-size: 13px;
  color: var(--ofb-s-muted);
}

.ofb-share__copy {
  flex: none;
}

.ofb-share__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.ofb-share__net {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--ofb-s-border);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 550;
  color: inherit;
  text-decoration: none;
  background: var(--ofb-s-surface);
  transition: border-color var(--ofb-dur), background-color var(--ofb-dur);
}

.ofb-share__net .ofb-icon {
  font-size: 20px;
  color: var(--ofb-net, var(--ofb-s-accent));
}

.ofb-share__net:hover {
  border-color: var(--ofb-net, var(--ofb-s-accent));
  background: var(--ofb-s-surface-2);
}

.ofb-share__net--whatsapp { --ofb-net: #1f9e52; }
.ofb-share__net--twitter { --ofb-net: #34383d; }
.ofb-share__net--facebook { --ofb-net: #2f62c9; }
.ofb-share__net--pinterest { --ofb-net: #c92233; }
.ofb-share__net--linkedin { --ofb-net: #1a6aa8; }
.ofb-share__net--reddit { --ofb-net: #e0480f; }
.ofb-share__net--digg { --ofb-net: #2b2b2b; }
.ofb-share__net--email { --ofb-net: #6b5bd6; }

.ofb-skin-dark .ofb-share__net--twitter,
.ofb-skin-dark .ofb-share__net--digg {
  --ofb-net: #e6e8eb;
}

/* spotlight (image zoom) */
.ofb-modal--dark {
  background: rgba(6, 7, 9, .86);
}

.ofb-modal__dialog.ofb-modal--spotlight {
  width: auto;
  max-width: 100%;
  color: #f2f3f5;
  background: transparent;
  box-shadow: none;
}

.ofb-modal--spotlight .ofb-modal__header {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 0;
}

.ofb-modal--spotlight .ofb-modal__close {
  color: #fff;
  background: rgba(0, 0, 0, .45);
  border-radius: 999px;
}

.ofb-modal--spotlight .ofb-modal__content {
  padding: 0;
}

.ofb-spotlight {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.ofb-spotlight__img {
  display: block;
  max-width: 100%;
  max-height: calc(var(--ofb-spot-max, 100cqh) - 120px);
  max-height: 70vh;
  border-radius: 6px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .5);
}

.ofb-spotlight figcaption {
  max-width: 60ch;
  text-align: center;
}

.ofb-spotlight__title {
  display: block;
  font-size: 16px;
}

.ofb-spotlight__desc {
  margin: 6px 0 0;
  color: rgba(242, 243, 245, .8);
}

/* ------------------------------------------------------------------ */
/* Lightbox trigger (thumbnail on the page)                            */
/* ------------------------------------------------------------------ */

.ofb-flipbook--lightbox {
  display: block;
  max-width: 100%;
}

/* [open_flipbook id="all" | category | author] listing */
.ofb-gallery {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px;
}

.ofb-lb {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  font-family: var(--ofb-font);
  color: inherit;
}

.ofb-lb__thumb,
.ofb-lb__textlink {
  appearance: none;
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  text-decoration: none;
  background: none;
  cursor: pointer;
}

.ofb-lb__frame {
  position: relative;
  display: block;
  max-width: 100%;
  overflow: hidden;
  border-radius: 6px;
  background: #e9ecf0;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .12), 0 10px 26px rgba(16, 24, 40, .2);
  transition: transform .25s var(--ofb-ease), box-shadow .25s var(--ofb-ease);
}

.ofb-lb__img {
  display: block;
  max-width: 100%;
  width: auto;
  height: var(--ofb-lb-h, 300px);
  object-fit: contain;
}

.ofb-lb__frame--placeholder {
  width: calc(var(--ofb-lb-h, 300px) * .7071);
  max-width: 100%;
  height: var(--ofb-lb-h, 300px);
}

.ofb-lb__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 40px;
  color: #8a94a3;
  background: linear-gradient(100deg, #e9ecf0 30%, #f5f6f8 50%, #e9ecf0 70%) 0 0 / 300% 100%;
  animation: ofb-shimmer 1.4s linear infinite;
}

.ofb-lb__thumb:hover .ofb-lb__frame,
.ofb-lb__thumb:focus-visible .ofb-lb__frame {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(16, 24, 40, .12), 0 18px 36px rgba(16, 24, 40, .26);
}

.ofb-lb__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 18px;
  color: #fff;
  background: rgba(12, 14, 18, .55);
  opacity: 0;
  transform: scale(.9);
  transition: opacity .2s ease, transform .2s var(--ofb-ease);
}

.ofb-lb__thumb:hover .ofb-lb__badge,
.ofb-lb__thumb:focus-visible .ofb-lb__badge {
  opacity: 1;
  transform: none;
}

.ofb-lb__info {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 26px 12px 10px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0));
}

.ofb-lb__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
}

.ofb-lb__title {
  font-size: 15px;
  font-weight: 650;
}

.ofb-lb__date {
  font-size: 12.5px;
  opacity: .7;
}

.ofb-lb__desc {
  font-size: 14px;
}

.ofb-lb__textlink {
  color: #2459d6;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ */
/* Lightbox overlay                                                    */
/* ------------------------------------------------------------------ */

.ofb-lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--ofb-z, 100000);
  background: var(--ofb-lb-layers, none), var(--ofb-lb-bg, rgb(81, 85, 88));
  opacity: 0;
  transition: opacity var(--ofb-dur) var(--ofb-ease);
}

.ofb-lightbox.ofb-is-open {
  opacity: 1;
}

.ofb-lightbox--offscreen {
  visibility: hidden;
  pointer-events: none;
}

.ofb-lightbox__frame {
  position: absolute;
  inset: 0;
}

.ofb-lightbox .ofb-viewer {
  height: 100% !important;
  background: transparent;
}

.ofb-lightbox__close {
  position: absolute;
  top: var(--ofb-close-margin, 12px);
  right: var(--ofb-close-margin, 12px);
  z-index: 40;
  --ofb-btn-size: var(--ofb-close-size, 22px);
  --ofb-btn-pad-v: var(--ofb-close-pad, 9px);
  --ofb-btn-pad-h: var(--ofb-close-pad, 9px);
  --ofb-btn-radius: var(--ofb-close-radius, 999px);
  --ofb-btn-border: var(--ofb-close-border, 0);
  --ofb-btn-filter: var(--ofb-close-filter, none);
  --ofb-btn-margin: 0;
  color: var(--ofb-close-color, #fff);
  background: var(--ofb-close-bg, rgba(12, 14, 18, .45));
}

.ofb-lightbox__close:hover:not(:disabled) {
  color: var(--ofb-close-color-hover, #fff);
  background: var(--ofb-close-bg-hover, rgba(12, 14, 18, .7));
}

/* a dialog inside the lightbox has its own close button: avoid two stacked crosses */
.ofb-lightbox:has(.ofb-modal) .ofb-lightbox__close {
  visibility: hidden;
}

/* ------------------------------------------------------------------ */
/* Fullscreen                                                          */
/* ------------------------------------------------------------------ */

.ofb-mode-fullscreen {
  position: fixed;
  top: var(--ofb-fs-top, 0);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--ofb-z, 99990);
  width: auto;
  height: auto;
}

.ofb-viewer:fullscreen,
.ofb-lightbox:fullscreen {
  width: 100%;
  height: 100% !important;
}

.ofb-viewer:-webkit-full-screen {
  width: 100%;
  height: 100% !important;
}

.ofb-viewer.ofb-is-pseudo-fs,
.ofb-lightbox.ofb-is-pseudo-fs {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@container ofb (max-width: 560px) {
  .ofb-panel,
  .ofb-panel--thumbs {
    width: 100%;
  }

  .ofb-panel.ofb-panel--peek {
    top: auto;
    height: 55%;
    border-radius: 16px 16px 0 0;
  }

  .ofb-thumbs {
    grid-template-columns: repeat(auto-fill, minmax(min(96px, 100%), 1fr));
  }

  .ofb-arrow {
    --ofb-btn-size: min(var(--ofb-arrow-size, 26px), 22px);
    --ofb-btn-pad-v: 8px;
    --ofb-btn-pad-h: 8px;
  }

  .ofb-arrow--left {
    left: 6px;
  }

  .ofb-arrow--right {
    right: 6px;
  }

  .ofb-bar {
    padding-left: 2px;
    padding-right: 2px;
    gap: 0;
  }

  .ofb-btn {
    --ofb-btn-pad-h: 8px;
  }

  .ofb-pageinfo {
    padding: 0 6px;
    margin-left: 0;
    margin-right: 0;
  }

  .ofb-searchfield__input.ofb-searchfield__input {
    width: 96px;
  }

  .ofb-logo__img {
    max-width: 96px;
    max-height: 36px;
  }

  .ofb-toast {
    bottom: 64px;
  }
}

@container ofb (max-width: 360px) {
  .ofb-btn {
    --ofb-btn-pad-h: 6px;
    --ofb-btn-pad-v: 8px;
  }

  .ofb-panel__body {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .ofb-modal {
    align-items: end;
    padding: 0;
  }

  .ofb-modal__dialog {
    width: 100%;
    max-height: 92%;
    border-radius: 18px 18px 0 0;
  }

  .ofb-modal__dialog.ofb-modal--spotlight {
    align-self: center;
    border-radius: 0;
  }

  .ofb-modal--dark {
    align-items: center;
  }

  .ofb-share__row {
    flex-direction: column;
  }
}

@media (pointer: coarse) {
  .ofb-btn {
    min-width: 40px;
    min-height: 40px;
  }

  .ofb-tooltip {
    display: none;
  }
}

@media (forced-colors: active) {
  .ofb-btn,
  .ofb-action,
  .ofb-thumb__frame {
    border: 1px solid ButtonText;
  }

  .ofb-btn[aria-pressed="true"],
  .ofb-thumb.ofb-is-current .ofb-thumb__frame {
    outline: 2px solid Highlight;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ofb-viewer *,
  .ofb-viewer *::before,
  .ofb-viewer *::after,
  .ofb-lightbox,
  .ofb-lightbox *,
  .ofb-lb * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .ofb-spinner {
    animation: ofb-spin 1.6s linear infinite !important;
  }
}

@media print {
  .ofb-bar,
  .ofb-arrow,
  .ofb-layer,
  .ofb-panel,
  .ofb-lightbox__close {
    display: none !important;
  }
}

/* ------------------------------------------------------------------ */
/* Keyframes                                                           */
/* ------------------------------------------------------------------ */

@keyframes ofb-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ofb-pop {
  from {
    opacity: 0;
    transform: translateY(4px) scale(.98);
  }
}

@keyframes ofb-shimmer {
  to {
    background-position: -300% 0;
  }
}

.ofb-lb__text--action {
  cursor: pointer;
}
