.pdffb {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  background: #3a3f47;
  border-radius: 8px;
  padding: 16px 12px 10px;
  margin: 1.5em 0;
  outline: none;
  overscroll-behavior-x: contain;   /* yatay kaydırmada sayfadan geri gitmeyi önler */
}
.pdffb *, .pdffb *::before, .pdffb *::after { box-sizing: border-box; }
.pdffb:focus-visible { box-shadow: 0 0 0 3px #7aa7ff; }
.pdffb-stage { position: relative; width: 100%; min-height: 200px; z-index: 1; }
.pdffb-book {
  width: 100%;
  margin: 0 auto;
  touch-action: pan-y;
}
.pdffb-page { background: #fff; overflow: hidden; }
.pdffb-page canvas {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}
.pdffb-loading {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  color: #e6e6e6; font: 15px/1.4 system-ui, sans-serif; text-align: center; padding: 1em;
}
.pdffb .pdffb-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px; margin-top: 12px;
  position: relative; z-index: 20;   /* düğmeler her zaman kitabın üstünde, tıklanabilir */
}
.pdffb .pdffb-bar button,
.pdffb .pdffb-bar a {
  background: #555c66; color: #fff; border: 0; border-radius: 6px;
  padding: 6px 12px; margin: 0; cursor: pointer;
  font: 15px/1.2 system-ui, sans-serif; text-decoration: none; box-shadow: none;
}
.pdffb .pdffb-bar button:hover,
.pdffb .pdffb-bar a:hover { background: #6d7580; }
.pdffb-info {
  color: #f0f0f0; min-width: 100px; text-align: center;
  font: 14px/1.2 system-ui, sans-serif;
}
.pdffb:fullscreen {
  display: flex; flex-direction: column; justify-content: center;
  border-radius: 0; margin: 0; padding: 16px;
}
@media (max-width: 600px) {
  .pdffb { padding: 8px 4px 8px; border-radius: 4px; }
}
.pdffb-title { margin: 0 0 .6em; }
.pdffb-msg { padding: 1.5em; background: #f4f4f4; border-radius: 8px; text-align: center; }

/* ---------- Okuma sayfası: geri bağlantısı ---------- */
.pdffb-back {
  display: inline-block; margin: 0 0 .8em;
  padding: 7px 14px; border-radius: 6px;
  background: #3a3f47; color: #fff !important; text-decoration: none !important;
  font: 500 15px/1.2 system-ui, sans-serif;
}
.pdffb-back:hover { background: #555c66; }

/* ---------- Açılır pencere ---------- */
html.pdffb-lock, html.pdffb-lock body { overflow: hidden !important; }
.pdffb-pop {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; flex-direction: column;
  background: rgba(12, 13, 16, .9);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: pdffbFade .2s ease-out;
}
@keyframes pdffbFade { from { opacity: 0; } to { opacity: 1; } }
.pdffb-pop-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; color: #fff;
}
.pdffb-pop-title {
  flex: 1; min-width: 0; text-align: center;
  font: 600 17px/1.3 system-ui, sans-serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pdffb-pop .pdffb-pop-back,
.pdffb-pop .pdffb-pop-close {
  flex: none; margin: 0; border: 0; box-shadow: none; cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff; border-radius: 6px;
  padding: 9px 14px; font: 500 15px/1.2 system-ui, sans-serif;
}
.pdffb-pop .pdffb-pop-close { width: 40px; padding: 9px 0; font-size: 17px; }
.pdffb-pop .pdffb-pop-back:hover,
.pdffb-pop .pdffb-pop-close:hover { background: rgba(255,255,255,.26); }
.pdffb-pop .pdffb-pop-back:focus-visible,
.pdffb-pop .pdffb-pop-close:focus-visible { outline: 2px solid #7aa7ff; outline-offset: 2px; }
.pdffb-pop-body {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 0 16px 12px;
}
.pdffb-pop-body .pdffb { margin: 0; width: 100%; background: transparent; padding-top: 0; }
.pdffb-pop-msg { color: #ddd; font: 15px/1.4 system-ui, sans-serif; text-align: center; padding: 1em; }
@media (max-width: 600px) {
  .pdffb-pop-head { padding: 8px 10px; gap: 8px; }
  .pdffb-pop-title { font-size: 14px; }
  .pdffb-pop-body { padding: 0 4px 8px; }
}
@media (prefers-reduced-motion: reduce) { .pdffb-pop { animation: none; } }
