/* Dossier flipbook lightbox */
html.fb-lock { overflow: hidden; }
dialog.fb { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(0, 24, 66, .94); color: #fff; font-family: 'Inter', system-ui, sans-serif; overflow: hidden; }
dialog.fb::backdrop { background: rgba(0, 12, 36, .7); }
dialog.fb[open] { display: flex; animation: fb-in .22s ease-out; }
@keyframes fb-in { from { opacity: 0; } to { opacity: 1; } }
.fb-shell { flex: 1; min-width: 0; display: flex; flex-direction: column; max-width: 1600px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
.fb-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 10px; }
.fb-title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.fb-actions { display: flex; gap: 8px; flex-shrink: 0; }
.fb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 6px; background: transparent; color: #fff; font: 600 12px/1 'Inter', system-ui, sans-serif; cursor: pointer; text-decoration: none; }
.fb-btn:hover { background: rgba(255, 255, 255, .12); }
.fb-dl { background: #CE1126; border-color: #CE1126; }
.fb-dl:hover { background: #e0162d; }
.fb-btn:focus-visible, .fb-nav:focus-visible, .fb-range:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.fb-stage { position: relative; flex: 1; min-height: 0; }
.fb-view { position: absolute; inset: 0; overflow: hidden; perspective: 2600px; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.fb-book { position: absolute; left: 50%; top: 50%; width: calc(var(--pw, 400px) * 2); height: var(--ph, 560px); transform: translate(calc(-50% + var(--shift, 0px)), -50%); transform-style: preserve-3d; transition: transform .56s cubic-bezier(.45, .05, .25, 1); }
.fb-book[data-mode="single"] { width: var(--pw, 400px); }
.fb-slot { position: absolute; top: 0; width: var(--pw, 400px); height: 100%; }
.fb-left { left: 0; }
.fb-right { left: var(--pw, 400px); }
.fb-book[data-mode="single"] .fb-left { display: none; }
.fb-book[data-mode="single"] .fb-right { left: 0; }
.fb-page { position: relative; width: 100%; height: 100%; background: #fff; box-shadow: 0 10px 34px rgba(0, 0, 0, .45); overflow: hidden; }
.fb-page img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.fb-page::after, .fb-face::after { content: ''; position: absolute; top: 0; bottom: 0; width: 9%; pointer-events: none; }
.fb-book[data-mode="double"] .fb-left .fb-page::after, .fb-back::after { right: 0; background: linear-gradient(to left, rgba(0, 0, 0, .22), transparent); }
.fb-book[data-mode="double"] .fb-right .fb-page::after, .fb-front::after { left: 0; background: linear-gradient(to right, rgba(0, 0, 0, .22), transparent); }
.fb-book[data-mode="single"] .fb-page::after { display: none; }
.fb-slot.is-empty .fb-page { display: none; }
.fb-leaf { position: absolute; top: 0; width: var(--pw, 400px); height: 100%; transform-style: preserve-3d; will-change: transform; pointer-events: none; }
.fb-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #fff; overflow: hidden; }
.fb-shade { position: absolute; inset: 0; opacity: 0; pointer-events: none; z-index: 1; background: linear-gradient(to right, rgba(0, 18, 50, .55), rgba(0, 18, 50, 0) 70%); }
.fb-back .fb-shade { background: linear-gradient(to left, rgba(0, 18, 50, .55), rgba(0, 18, 50, 0) 70%); }
.fb-face img { display: block; width: 100%; height: 100%; object-fit: contain; }
.fb-face .fb-page { box-shadow: none; }
.fb-face::after { z-index: 2; }
.fb-back { transform: rotateY(180deg); }
.fb-book[data-mode="single"] .fb-front::after { display: none; }
.fb-status { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; font-size: 14px; text-align: center; padding: 20px; pointer-events: none; }
.fb-status[hidden] { display: none; }
.fb-status.is-error { pointer-events: auto; }
.fb-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: fb-spin .8s linear infinite; }
.fb-status.is-error .fb-spin { display: none; }
@keyframes fb-spin { to { transform: rotate(360deg); } }
.fb-foot { display: flex; align-items: center; gap: 14px; padding-top: 10px; }
.fb-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fb-range { width: min(520px, 100%); accent-color: #CE1126; margin: 0; }
.fb-count { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: #d8e2f0; font-variant-numeric: tabular-nums; }
.fb-nav { width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .08); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0 0 4px; }
.fb-nav:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
.fb-nav:disabled { opacity: .3; cursor: default; }
@media (max-width: 640px) {
  .fb-lbl { display: none; }
  .fb-btn { width: 44px; padding: 0; font-size: 18px; }
  .fb-title { font-size: 13px; }
  .fb-nav { width: 44px; height: 44px; }
}
@media (max-height: 460px) {
  .fb-bar { padding-bottom: 4px; }
  .fb-foot { padding-top: 4px; }
  .fb-mid { flex-direction: row; justify-content: center; gap: 14px; }
  .fb-btn, .fb-nav { height: 36px; min-height: 36px; }
  .fb-nav { width: 36px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.fb[open] { animation: none; }
  .fb-book { transition: none; }
}
