.dbsf, .dbsf * { box-sizing: border-box; }
.dbsf { --dbsf-accent: #ac9153; position: relative; color: #202124; background: #eeece5; border: 0; border-radius: 0; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; width: 100%; max-width: 1600px; margin: 0 auto; overflow: hidden; isolation: isolate; }
.dbsf [hidden] { display: none !important; }
.dbsf:focus-visible { outline: 2px solid var(--dbsf-accent); outline-offset: -2px; }
.dbsf .dbsf-sr-only, .dbsf-footer { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.dbsf-stage { min-height: 320px; height: min(84svh,1000px); position: relative; display: flex; align-items: center; justify-content: center; padding: 24px 16px 88px; background: radial-gradient(ellipse at 50% 35%,#f9f8f4,#e9e6de); overflow: hidden; }
.dbsf-book { width: 100%; height: 100%; margin: auto; }
.dbsf-page { background: #fff; overflow: hidden; box-shadow: inset 0 0 0 1px #0000000f; position: relative; }
.dbsf-page img { display: block; width: 100%; height: 100%; object-fit: contain; max-width: none; padding: 0; margin: 0; border: 0; user-select: none; -webkit-user-drag: none; }
.dbsf-page-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #8c877c; }
.dbsf-page[data-loaded="true"] .dbsf-page-placeholder { display: none; }
.dbsf-loading { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #656156; padding: 20px; max-width: 480px; line-height: 1.6; }
.dbsf-spinner { width: 20px; height: 20px; border: 2px solid #d9d2c1; border-top-color: #5c5442; border-radius: 50%; animation: dbsf-spin .8s linear infinite; flex: 0 0 auto; }
@keyframes dbsf-spin { to { transform: rotate(360deg); } }
.dbsf-hud { position: absolute; z-index: 200; left: 24px; right: 24px; bottom: 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; pointer-events: none; }
.dbsf-navigation, .dbsf-toolbar { display: flex; align-items: center; gap: 3px; padding: 5px; background: #f6f5f1ed; color: #353632; border: 0; border-radius: 9px; box-shadow: 0 3px 18px #0002; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); pointer-events: auto; }
.dbsf button, .dbsf .dbsf-pdf-link { appearance: none; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; margin: 0; border: 0; background: transparent; color: inherit; border-radius: 6px; padding: 8px; font: 500 13px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; text-decoration: none; cursor: pointer; width: 40px; height: 40px; min-height: 40px; box-shadow: none; transition: background .15s,color .15s; }
.dbsf button svg, .dbsf .dbsf-pdf-link svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dbsf button:hover:not(:disabled), .dbsf .dbsf-pdf-link:hover { background: #0000000c; color: #111; }
.dbsf button:focus-visible, .dbsf a:focus-visible, .dbsf input:focus-visible { outline: 2px solid #856923; outline-offset: 1px; }
.dbsf button:disabled { opacity: .28; cursor: default; }
.dbsf-jump, .dbsf-jump label { display: flex; align-items: center; gap: 3px; margin: 0; font-size: 12px; white-space: nowrap; }
.dbsf .dbsf-page-input { appearance: textfield; color: #292a26; background: transparent; border: 0; border-radius: 4px; text-align: center; width: 34px; height: 36px; padding: 4px 0; margin: 0; font: 500 13px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.dbsf-page-input::-webkit-inner-spin-button, .dbsf-page-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.dbsf-total { min-width: 34px; padding-right: 5px; color: #767771; font-size: 12px; }
.dbsf .dbsf-sound-on { display: none; }
.dbsf [data-action="sound"][aria-pressed="true"] .dbsf-sound-on { display: inline; }
.dbsf [data-action="sound"][aria-pressed="true"] .dbsf-sound-off { display: none; }
.dbsf [data-action="sound"][aria-pressed="true"], .dbsf [data-copied="true"] { color: #80642c; background: #ac91531a; }
.dbsf .dbsf-copy-fallback { position: absolute; right: 0; bottom: 60px; width: min(340px,100%); padding: 12px; background: #fff; color: #222; border: 1px solid #ccc; border-radius: 6px; }
.dbsf:fullscreen { max-width: none; height: 100svh; }
.dbsf:fullscreen .dbsf-stage { height: 100%; min-height: 0; }
.dbsf-zoom-dialog { width: min(1100px,96vw); height: 94svh; max-width: 96vw; max-height: 94svh; border: 0; border-radius: 8px; padding: 0; background: #181818; color: #eee; }
.dbsf-zoom-dialog::backdrop { background: #000d; }
.dbsf-zoom-dialog[open] { display: flex; flex-direction: column; }
.dbsf-zoom-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 12px; background: #f6f5f1; color: #353632; font-size: 12px; }
.dbsf-zoom-toolbar button { width: auto; min-width: 40px; }
.dbsf-zoom-toolbar label { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.dbsf-zoom-toolbar input { width: 90px; }
.dbsf-zoom-scroll { flex: 1; overflow: auto; min-height: 0; padding: 20px; }
.dbsf-zoom-scroll canvas { display: block; width: 100%; max-width: none; height: auto; margin: auto; background: #fff; box-shadow: 0 2px 20px #0002; }
body.dbsf-standalone { background: #eceae5; margin: 0; padding: 0; color: #202124; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.dbsf-shell { max-width: none; margin: 0 auto; padding: 0; }
.dbsf-standalone .dbsf-shell > .dbsf { max-width: none; }
.dbsf-standalone .dbsf-shell > .dbsf .dbsf-stage { height: calc(100svh - var(--wp-admin--admin-bar--height,0px)); min-height: 360px; }
.dbsf-standalone .dbsf-back { position: absolute; z-index: 220; top: calc(12px + var(--wp-admin--admin-bar--height,0px)); left: 16px; padding: 6px 10px; font-size: 11px; color: #76736b; text-decoration: none; background: #eceae5cc; border-radius: 5px; }
.dbsf-description { max-width: 850px; margin: 28px auto; padding: 0 24px; line-height: 1.7; }
.dbsf[data-mode="coverflow"] { background: #000; color: #eee; }
.dbsf[data-mode="coverflow"] .dbsf-stage { background: #000; }
.dbsf[data-mode="coverflow"] .dbsf-loading { color: #c9c6bf; }
.dbsf-coverflow { position: relative; perspective: 1400px; transform-style: preserve-3d; touch-action: pan-y; overflow: visible; }
.dbsf-coverflow .dbsf-page { position: absolute; left: 50%; top: 50%; border: 0; background: #fff; box-shadow: 0 0 18px #fff2,0 12px 24px #0008; transform-origin: center; transition: transform 600ms cubic-bezier(.2,.7,.25,1),filter 600ms; cursor: pointer; }
.dbsf .dbsf-gallery-prev, .dbsf .dbsf-gallery-next { position: absolute; z-index: 150; top: 46%; transform: translateY(-50%); width: 44px; height: 60px; padding: 0; font-size: 44px; font-weight: 300; background: transparent; color: #fffb; border: 0; text-shadow: 0 1px 8px #000; }
.dbsf .dbsf-gallery-prev:hover:not(:disabled), .dbsf .dbsf-gallery-next:hover:not(:disabled) { background: #ffffff12; color: #fff; }
.dbsf-gallery-prev { left: 8px; }.dbsf-gallery-next { right: 8px; }
body.dbsf-dark { background: #000; }body.dbsf-dark .dbsf-back { color: #bbb; background: #0008; }
@media (max-width: 640px) {
    .dbsf-stage { padding: 28px 8px 80px; height: 76svh; }
    .dbsf-hud { left: 12px; right: 12px; bottom: 14px; gap: 8px; flex-wrap: wrap; }
    .dbsf button, .dbsf .dbsf-pdf-link { width: 36px; height: 36px; min-height: 36px; padding: 7px; }
    .dbsf button svg, .dbsf .dbsf-pdf-link svg { width: 21px; height: 21px; }
    .dbsf-navigation, .dbsf-toolbar { gap: 0; padding: 4px; }
    .dbsf[data-mode="coverflow"] .dbsf-navigation > button { display: none; }
    .dbsf .dbsf-page-input { width: 31px; height: 36px; }
    .dbsf .dbsf-gallery-prev, .dbsf .dbsf-gallery-next { width: 36px; height: 48px; font-size: 38px; }
    .dbsf-gallery-prev { left: 0; }.dbsf-gallery-next { right: 0; }
    .dbsf-zoom-toolbar { gap: 6px; }.dbsf-zoom-toolbar label { margin-left: 0; }
    .dbsf-standalone .dbsf-back { left: 8px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .dbsf-spinner { animation: none; }.dbsf button, .dbsf-coverflow .dbsf-page { transition: none; } }

/* Reading styles share one PDF, link, toolbar and sound control. */
.dbsf-cardflip { position: relative; perspective: 1400px; transform-style: preserve-3d; touch-action: pan-y; }
.dbsf-cardflip .dbsf-page { position: absolute; left: 50%; top: 50%; background: #fff; backface-visibility: hidden; box-shadow: 0 16px 40px #29251b35,0 2px 7px #29251b18; transform-origin: center; }
.dbsf[data-mode="cards"] .dbsf-stage { background: radial-gradient(ellipse at 50% 40%,#f8f7f3,#dfdcd3); }
.dbsf[data-mode="cards"] .dbsf-gallery-prev,.dbsf[data-mode="cards"] .dbsf-gallery-next { color: #423d31; text-shadow: none; }
.dbsf[data-mode="cards"] .dbsf-gallery-prev:hover:not(:disabled),.dbsf[data-mode="cards"] .dbsf-gallery-next:hover:not(:disabled) { color: #111; background: #0000000b; }
.dbsf[data-mode="magazine"] .dbsf-stage { background: #e8e7e2; }
.dbsf[data-mode="magazine"] .stf__item { box-shadow: 0 3px 12px #0002; }
.dbsf[data-mode="magazine"] .stf__item::after { content: ''; position: absolute; top: 0; bottom: 0; width: 12px; pointer-events: none; }
.dbsf[data-mode="magazine"] .stf__item.--left::after { right: 0; background: linear-gradient(90deg,transparent,#00000016); }
.dbsf[data-mode="magazine"] .stf__item.--right::after { left: 0; background: linear-gradient(90deg,#00000012,transparent); }
.dbsf[data-mode="book"] { background: #1b1c19; color: #eee; }
.dbsf[data-mode="book"] .dbsf-stage { background: radial-gradient(ellipse at 50% 45%,#42423b,#1b1c19 78%); }
.dbsf[data-mode="book"] .dbsf-loading { color: #d7d4ca; }
.dbsf[data-mode="book"] .stf__item { box-shadow: 1px 1px #e7e1d4,2px 2px #bab4a6,3px 3px #eee8db,4px 4px #aaa395,5px 5px #eee8db,7px 8px #171612,10px 16px 25px #0007; }
.dbsf[data-mode="book"] .dbsf-cover { outline: 3px solid #282720; outline-offset: 1px; }
.dbsf[data-mode="book"] .stf__item::after { content: ''; position: absolute; top: 0; bottom: 0; width: 32px; pointer-events: none; }
.dbsf[data-mode="book"] .stf__item.--left::after { right: 0; background: linear-gradient(90deg,transparent,#00000008 45%,#00000040); }
.dbsf[data-mode="book"] .stf__item.--right::after { left: 0; background: linear-gradient(90deg,#00000038,#00000008 55%,transparent); }
.dbsf-standalone .dbsf-shell > .dbsf:fullscreen .dbsf-stage { height: 100svh; }
@media (max-width: 640px) {
    .dbsf[data-mode="cards"] .dbsf-navigation > button { display: none; }
    .dbsf[data-mode="book"] .dbsf-stage,.dbsf[data-mode="magazine"] .dbsf-stage { padding-bottom: 124px; }
    .dbsf[data-mode="book"] .dbsf-hud,.dbsf[data-mode="magazine"] .dbsf-hud { justify-content: center; }
}
