@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&family=Cairo:wght@400;600;700;800&display=swap');

.tibr-reader-open-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:54px;
  margin-top:14px;
  padding:0 20px;
  border-radius:16px;
  background:linear-gradient(135deg,#052b1e,#0b4d35);
  color:#fff!important;
  text-decoration:none!important;
  font-weight:900;
  box-shadow:0 14px 28px rgba(5,43,30,.22);
}

.tibr-reader-box{
  font-family:Tajawal,Cairo,Arial,sans-serif;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin:35px 0;
  padding:24px;
  border-radius:26px;
  background:radial-gradient(circle at top right,rgba(212,175,55,.16),transparent 30%),linear-gradient(135deg,var(--tibr-reader-primary),var(--tibr-reader-secondary));
  border:1px solid rgba(212,175,55,.35);
  color:#fff;
  box-shadow:0 20px 55px rgba(5,43,30,.12);
}

.tibr-reader-box span{color:var(--tibr-reader-gold-light);font-weight:900}
.tibr-reader-box h2{margin:8px 0;color:#fff;font-size:28px;font-weight:900}
.tibr-reader-box p{margin:0;color:rgba(255,255,255,.78);font-weight:700}
.tibr-reader-box a{
  min-height:52px;display:flex;align-items:center;justify-content:center;gap:10px;padding:0 24px;border-radius:16px;
  background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
  color:#1d1708!important;text-decoration:none!important;font-weight:900;white-space:nowrap;
}

.tibr-book-specs{
  font-family:Tajawal,Cairo,Arial,sans-serif;
  margin:22px 0;
  padding:18px;
  border:1px solid rgba(5,43,30,.12);
  border-radius:8px;
  background:linear-gradient(180deg,#fff,#fbf8ef);
  box-shadow:0 12px 30px rgba(5,43,30,.07);
  color:#13241c;
}

.tibr-book-specs-head{
  margin-bottom:14px;
}

.tibr-book-specs-head span{
  display:block;
  color:#b8922a;
  font-weight:900;
  font-size:13px;
}

.tibr-book-specs-head h2{
  margin:4px 0 0;
  color:#052b1e;
  font-size:22px;
  font-weight:900;
  line-height:1.35;
}

.tibr-book-specs dl{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin:0;
}

.tibr-book-specs dl > div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:46px;
  padding:10px 12px;
  border-radius:7px;
  background:#fff;
  border:1px solid rgba(5,43,30,.09);
}

.tibr-book-specs dt,
.tibr-book-specs dd{
  margin:0;
  line-height:1.5;
}

.tibr-book-specs dt{
  color:#647268;
  font-weight:800;
  white-space:nowrap;
}

.tibr-book-specs dd{
  color:#052b1e;
  font-weight:900;
  text-align:left;
}

.tibr-reader-fullscreen-body{margin:0!important;background:#07110d!important;overflow:hidden}

html.tibr-reader-lock-scroll,
body.tibr-reader-lock-scroll{
  overflow:hidden !important;
  height:100% !important;
  position:fixed !important;
  width:100% !important;
}

.tibr-reader{
  --reader-bg:#07110d;
  --reader-panel:rgba(7,20,14,.78);
  --reader-soft:rgba(255,255,255,.075);
  --reader-line:rgba(212,175,55,.24);
  font-family:Tajawal,Cairo,Arial,sans-serif;
  direction:rtl;
  color:#fff;
  user-select:none;
  background:#07110d;
  -webkit-text-size-adjust:100%;
}

.tibr-reader.reader-light{
  --reader-bg:#fff8e9;
  --reader-panel:rgba(255,255,255,.82);
  --reader-soft:rgba(5,43,30,.07);
  --reader-line:rgba(212,175,55,.32);
  color:#102018;
}

.tibr-reader *{
  box-sizing:border-box;
  user-select:none;
  -webkit-user-select:none;
}

.tibr-reader.is-fullscreen{
  width:100vw;
  height:100vh;
  overflow:hidden;
  background:
    radial-gradient(circle at 100% 0%,rgba(212,175,55,.18),transparent 32%),
    radial-gradient(circle at 0% 100%,rgba(11,77,53,.22),transparent 28%),
    linear-gradient(135deg,#020806,#052b1e 55%,#03160f);
}

.tibr-reader.reader-light.is-fullscreen{
  background:
    radial-gradient(circle at 100% 0%,rgba(212,175,55,.20),transparent 32%),
    linear-gradient(135deg,#fff,#fff8e9);
}

.tibr-reader-header{
  height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:12px 22px;
  border-bottom:1px solid var(--reader-line);
  background:rgba(0,0,0,.24);
  backdrop-filter:blur(18px);
  position:relative;
  z-index:20;
}

.reader-light .tibr-reader-header{
  background:rgba(255,255,255,.72);
}

.reader-brand{
  display:flex;
  align-items:center;
  gap:15px;
  min-width:0;
}

.reader-back{
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 16px;
  border-radius:14px;
  background:var(--reader-soft);
  border:1px solid var(--reader-line);
  color:var(--tibr-reader-gold-light)!important;
  text-decoration:none!important;
  font-weight:900;
  white-space:nowrap;
}

.reader-light .reader-back{color:var(--tibr-reader-primary)!important}

.reader-title-wrap{min-width:0}
.reader-title-wrap span{
  color:var(--tibr-reader-gold-light);
  font-weight:900;
  font-size:13px;
}
.reader-light .reader-title-wrap span{color:var(--tibr-reader-primary)}

.reader-title-wrap h1{
  margin:3px 0 0;
  color:#fff;
  font-size:21px;
  font-weight:900;
  line-height:1.4;
  max-width:52vw;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.reader-light .reader-title-wrap h1{color:#102018}

.reader-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.reader-actions button{
  min-width:42px;
  height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--reader-line);
  border-radius:13px;
  background:var(--reader-soft);
  color:#fff;
  font-weight:900;
  cursor:pointer;
  transition:.18s ease;
}

.reader-light .reader-actions button{color:#102018;background:#fff}

.reader-actions button:hover{
  transform:translateY(-1px);
  background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
  color:#1e1707;
}

.reader-actions button.is-active{
  background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
  color:#1e1707;
}

.reader-actions button svg{
  width:20px;
  height:20px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
  pointer-events:none;
}

.tibr-reader-viewer{
  position:relative;
  height:calc(100vh - 76px);
  display:grid;
  grid-template-columns:190px 1fr;
  overflow:hidden;
  touch-action:pan-y;
  -webkit-tap-highlight-color:transparent;
}

.reader-progress{
  position:absolute;
  top:0;
  right:0;
  left:0;
  height:4px;
  background:rgba(255,255,255,.10);
  z-index:10;
}

.reader-progress-bar{
  display:block;
  width:0%;
  height:100%;
  background:linear-gradient(90deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
  transition:width .25s ease;
}

.reader-sidebar{
  padding:18px;
  background:var(--reader-panel);
  border-left:1px solid var(--reader-line);
  backdrop-filter:blur(18px);
  display:flex;
  flex-direction:column;
  gap:14px;
  overflow:auto;
}

.reader-side-card{
  padding:15px;
  border-radius:18px;
  border:1px solid var(--reader-line);
  background:var(--reader-soft);
}

.reader-side-card strong{
  color:var(--tibr-reader-gold-light);
  font-size:16px;
}

.reader-light .reader-side-card strong{color:var(--tibr-reader-primary)}

.reader-side-card p{
  margin:6px 0 0;
  color:rgba(255,255,255,.68);
  line-height:1.7;
  font-size:13px;
}

.reader-light .reader-side-card p{color:#61706a}

.reader-sidebar button,
.reader-floating-nav{
  border:0;
  border-radius:16px;
  background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
  color:#1e1707;
  font-weight:900;
  cursor:pointer;
  transition:.18s ease;
}

.reader-sidebar button{
  min-height:48px;
  padding:0 10px;
  font-size:14px;
}

.reader-sidebar button:hover,
.reader-floating-nav:hover{
  transform:translateY(-1px);
  filter:saturate(1.08);
}

.reader-sidebar button:disabled,
.reader-floating-nav:disabled{
  opacity:.42;
  cursor:not-allowed;
  transform:none;
}

.reader-page-number{
  min-height:82px;
  border-radius:18px;
  background:var(--reader-soft);
  border:1px solid var(--reader-line);
  color:#fff;
  font-weight:900;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.reader-light .reader-page-number{color:#102018;background:#fff}

.reader-page-number span{
  font-size:12px;
  color:rgba(255,255,255,.60);
}

.reader-light .reader-page-number span{color:#718078}

.reader-page-number div{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}

.reader-page-input{
  width:58px;
  height:34px;
  border:1px solid var(--reader-line);
  border-radius:10px;
  background:rgba(255,255,255,.10);
  color:#fff;
  font-weight:900;
  text-align:center;
  outline:none;
}

.reader-light .reader-page-input{
  background:#fff;
  color:#102018;
}

.reader-page-number em{
  font-style:normal;
  color:rgba(255,255,255,.55);
}

.reader-light .reader-page-number em{color:#66746d}

.reader-page-number strong{
  color:var(--tibr-reader-gold-light);
  font-size:20px;
}

.reader-light .reader-page-number strong{color:var(--tibr-reader-primary)}

.reader-quick-help{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  padding:12px;
  border-radius:16px;
  background:rgba(255,255,255,.055);
  color:rgba(255,255,255,.66);
}

.reader-light .reader-quick-help{
  background:#fff;
  color:#66746d;
}

.reader-quick-help span{
  color:var(--tibr-reader-gold-light);
  font-weight:900;
}

.reader-locked-small{
  margin-top:auto;
  padding:14px;
  border-radius:18px;
  background:var(--reader-soft);
  border:1px solid var(--reader-line);
  text-align:center;
}

.reader-locked-small strong{color:var(--tibr-reader-gold-light)}
.reader-light .reader-locked-small strong{color:var(--tibr-reader-primary)}
.reader-locked-small p{color:rgba(255,255,255,.72);font-size:13px;line-height:1.7}
.reader-light .reader-locked-small p{color:#607068}
.reader-locked-small a{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  border-radius:12px;
  background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
  color:#1d1708!important;
  text-decoration:none!important;
  font-weight:900;
}

.reader-stage{
  position:relative;
  overflow:hidden;
  padding:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  touch-action:pan-y;
}

.reader-loading{
  position:absolute;
  inset:0;
  z-index:5;
  display:flex;
  flex-direction:column;
  gap:14px;
  align-items:center;
  justify-content:center;
  color:var(--tibr-reader-gold-light);
  font-weight:900;
}

.reader-spinner{
  width:50px;
  height:50px;
  border-radius:50%;
  border:4px solid rgba(255,255,255,.14);
  border-top-color:var(--tibr-reader-gold);
  animation:tibrSpin .8s linear infinite;
}

@keyframes tibrSpin{to{transform:rotate(360deg)}}

.reader-canvas-shell{
  position:relative;
  touch-action:pan-y;
  -webkit-overflow-scrolling:touch;
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}

.reader-book.reader-single-page{
  position:relative;
  width:100%;
  height:100%;
  max-width:min(900px, 94%);
  margin:auto;
  perspective:1800px;
  display:none;
}

.reader-book.reader-single-page.is-ready{
  display:flex!important;
  align-items:center;
  justify-content:center;
}

.reader-book-shadow{
  display:none;
}

.reader-light .reader-book-shadow{
  background:rgba(5,43,30,.12);
}

.reader-page-single{
  position:relative;
  z-index:2;
  width:auto;
  height:auto;
  max-width:860px;
  border-radius:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:#fdf8ec;
  border:1px solid rgba(212,175,55,.28);
  box-shadow:0 2px 10px rgba(0,0,0,.12);
  transition:transform .24s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
  will-change:transform, opacity;
  transform:translateZ(0);
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
}

.reader-book.is-lock-page .reader-page-single{
  opacity:.18;
  transform:scale(.985);
}

.reader-book.is-dragging .reader-page-single{
  transform:translateX(var(--reader-drag-x, 0)) scale(.992);
  opacity:var(--reader-drag-opacity, 1);
  transition:none;
}

/* LTR page-turn motion:
   Next page: the new page enters from the LEFT and settles toward center.
   Previous page: the new page enters from the RIGHT and settles toward center. */
.reader-book.turning-next .reader-page-single{
  transform:translateX(42px) scale(.982);
  opacity:.72;
}

.reader-book.turning-prev .reader-page-single{
  transform:translateX(-42px) scale(.982);
  opacity:.72;
}

.reader-book.entering-next-prep .reader-page-single{
  transform:translateX(-42px) scale(.985);
  opacity:.72;
  transition:none;
}

.reader-book.entering-next-active .reader-page-single{
  transform:translateX(0) scale(1);
  opacity:1;
  transition:transform .23s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
}

.reader-book.entering-prev-prep .reader-page-single{
  transform:translateX(42px) scale(.985);
  opacity:.72;
  transition:none;
}

.reader-book.entering-prev-active .reader-page-single{
  transform:translateX(0) scale(1);
  opacity:1;
  transition:transform .23s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
}

.reader-page canvas{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  pointer-events:none;
  display:block;
}


/* Anti-mirroring fix for PDF canvas: RTL is for the interface only, not the rendered PDF page. */
.reader-canvas-shell,
.reader-book,
.reader-page,
.reader-page-single{
  direction:ltr !important;
  unicode-bidi:isolate !important;
}

.reader-page canvas{
  direction:ltr !important;
  unicode-bidi:isolate !important;
  transform:none !important;
  -webkit-transform:none !important;
  backface-visibility:visible !important;
  -webkit-backface-visibility:visible !important;
  image-rendering:auto;
}

.reader-search-highlight-layer{
  position:absolute;
  left:50%;
  top:50%;
  z-index:5;
  transform:translate(-50%, -50%);
  pointer-events:none;
}

.reader-search-highlight{position:absolute;display:block;background:transparent!important;border:none!important;box-shadow:none!important;pointer-events:none;}
.reader-search-highlight::after{content:"";position:absolute;left:-2px;right:-2px;bottom:-3px;height:3px;background:linear-gradient(90deg,rgba(212,175,55,.85),rgba(228,188,76,.95));border-radius:999px;}
.reader-search-highlight.active::after{height:4px;box-shadow:0 0 10px rgba(212,175,55,.35);}

@keyframes tibrSearchMark{
  0%{transform:scale(.92);opacity:0}
  45%{transform:scale(1.04);opacity:1}
  100%{transform:scale(1);opacity:1}
}

.reader-watermark{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:6;
  display:flex;
  align-items:center;
  justify-content:center;
  transform:rotate(-28deg);
  color:rgba(5,43,30,.13);
  font-size:34px;
  font-weight:900;
  text-align:center;
  white-space:nowrap;
}

.reader-floating-nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  z-index:8;
  width:56px;
  height:72px;
  font-size:34px;
  box-shadow:0 16px 34px rgba(0,0,0,.22);
}

.reader-floating-prev{right:14px}
.reader-floating-next{left:14px}

.reader-mobile-controls{display:none}
.reader-page-picker{display:none}

.reader-lock{
  position:absolute;
  inset:24px;
  z-index:10;
  padding:18px;
  border-radius:24px;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.48);
  border:1px solid rgba(212,175,55,.35);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}

.reader-lock.is-visible{
  display:flex;
}

.reader-lock-card{
  max-width:720px;
  margin:auto;
  text-align:center;
  padding:26px;
  border-radius:26px;
  background:linear-gradient(180deg,rgba(5,43,30,.90),rgba(8,25,18,.90));
  border:1px solid rgba(212,175,55,.26);
  box-shadow:0 24px 54px rgba(0,0,0,.24);
}

.reader-lock-icon{
  width:64px;
  height:64px;
  margin:0 auto 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:22px;
  background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
  color:#1d1708;
  font-size:28px;
}

.reader-lock-card h2{
  margin:0;
  color:#fff;
  font-size:26px;
  font-weight:900;
}

.reader-lock-card p{
  color:rgba(255,255,255,.78);
  line-height:1.8;
  font-weight:700;
  margin:8px auto 14px;
}

.reader-lock-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  flex-wrap:wrap;
}

.reader-lock-actions a{
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 26px;
  border-radius:16px;
  background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
  color:#1d1708!important;
  text-decoration:none!important;
  font-weight:900;
}

.reader-lock-actions span{
  color:#fff;
  font-size:18px;
  font-weight:900;
}

@media print{
  .tibr-reader{display:none!important}
}

@media(max-width:1100px){
  .tibr-reader-viewer{
    grid-template-columns:1fr;
    grid-template-rows:1fr auto;
  }

  .reader-sidebar{
    display:none;
  }

  .reader-stage{
    padding:16px;
  }

  .reader-floating-nav{
    display:none;
  }

  .reader-mobile-controls{
    display:grid;
    grid-template-columns:64px 1fr 64px;
    gap:10px;
    align-items:center;
    padding:10px 12px;
    border-top:1px solid var(--reader-line);
    background:var(--reader-panel);
    backdrop-filter:blur(18px);
  }

  .reader-mobile-controls button{
    height:48px;
    border:0;
    border-radius:16px;
    background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
    color:#1d1708;
    font-size:28px;
    font-weight:900;
  }

  .reader-mobile-page{
    height:48px;
    border-radius:16px;
    border:1px solid var(--reader-line);
    background:var(--reader-soft);
    display:flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    color:#fff;
    font-weight:900;
    font-family:inherit;
    cursor:pointer;
  }

  .reader-mobile-page svg{
    width:16px;
    height:16px;
    margin-right:5px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .reader-mobile-controls .reader-mobile-page{
    border:1px solid var(--reader-line);
    background:var(--reader-soft);
    color:#fff;
    font-size:inherit;
  }

  .reader-light .reader-mobile-page{
    background:#fff;
    color:#102018;
  }

  .reader-light .reader-mobile-controls .reader-mobile-page{
    background:#fff;
    color:#102018;
  }

  .reader-mobile-page small{
    color:rgba(255,255,255,.5);
  }

  .reader-light .reader-mobile-page small{
    color:#66746d;
  }
}

@media(max-width:768px){
  .tibr-reader.is-fullscreen{
    height:100dvh;
  }

  .tibr-reader-header{
    height:auto;
    min-height:92px;
    padding:9px 10px;
    flex-direction:column;
    align-items:stretch;
    gap:8px;
  }

  .reader-brand{
    justify-content:space-between;
    gap:10px;
  }

  .reader-back{
    min-height:38px;
    padding:0 11px;
    font-size:12px;
    order:2;
  }

  .reader-title-wrap{
    order:1;
    max-width:calc(100% - 85px);
  }

  .reader-title-wrap h1{
    font-size:15px;
    max-width:100%;
  }

  .reader-title-wrap span{
    font-size:11px;
  }

  .reader-actions{
    justify-content:center;
    gap:6px;
  }

  .reader-actions button{
    min-width:38px;
    height:38px;
    font-size:13px;
  }

  .reader-actions .reader-fit{
    display:none;
  }

  .tibr-reader-viewer{
    height:calc(100dvh - 92px);
  }

  .reader-stage{
    padding:10px;
  }

  .reader-book.reader-single-page{
    max-width:100%;
  }

  .reader-page-single{
    border-radius:18px;
    box-shadow:0 18px 40px rgba(0,0,0,.28);
  }

  .reader-watermark{
    font-size:20px;
  }

  .reader-lock{
    position:absolute;
    right:10px;
    left:10px;
    top:10px;
    bottom:74px;
    padding:12px;
    border-radius:18px;
  }

  .reader-lock-card{
    padding:18px 14px;
    border-radius:20px;
  }

  .reader-lock-icon{
    width:48px;
    height:48px;
    font-size:22px;
    border-radius:16px;
  }

  .reader-lock-card h2{
    font-size:20px;
  }

  .reader-lock-card p{
    font-size:13px;
    line-height:1.6;
  }

  .reader-lock-actions a{
    width:100%;
  }

  .reader-mobile-controls{
    grid-template-columns:54px 1fr 54px;
    padding:8px;
    gap:8px;
  }

  .reader-mobile-controls button,
  .reader-mobile-page{
    height:44px;
    border-radius:14px;
  }

  .tibr-reader-box{
    flex-direction:column;
    align-items:stretch;
  }

  .tibr-reader-box a{
    width:100%;
  }
}

@media(max-width:420px){
  .reader-title-wrap h1{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
}


/* ===== Responsive Clean Controls v3.1 ===== */

/* Keep reader simple: only theme + fullscreen in top actions */
.reader-actions{
  flex-shrink:0;
}

.reader-actions button{
  min-width:44px;
}

.reader-stage{
  padding:clamp(10px, 2vw, 26px);
}

.reader-book.reader-single-page{
  max-width:min(920px, 96%);
}

.reader-page-single{
  max-width:900px;
}

/* Desktop large */
@media(min-width:1300px){
  .tibr-reader-header{
    height:78px;
    padding-inline:28px;
  }

  .tibr-reader-viewer{
    height:calc(100vh - 78px);
    grid-template-columns:200px 1fr;
  }

  .reader-stage{
    padding:28px;
  }

  .reader-book.reader-single-page{
    max-width:min(980px, 94%);
  }

  .reader-page-single{
    max-width:940px;
  }
}

/* Laptop */
@media(min-width:901px) and (max-width:1299px){
  .tibr-reader-header{
    height:72px;
    padding:10px 18px;
  }

  .tibr-reader-viewer{
    height:calc(100vh - 72px);
    grid-template-columns:176px 1fr;
  }

  .reader-sidebar{
    padding:14px;
    gap:11px;
  }

  .reader-side-card{
    padding:12px;
  }

  .reader-stage{
    padding:18px;
  }

  .reader-floating-nav{
    width:48px;
    height:64px;
    font-size:28px;
  }

  .reader-floating-prev{right:10px}
  .reader-floating-next{left:10px}
}

/* Tablet */
@media(min-width:769px) and (max-width:1100px){
  .tibr-reader-header{
    height:70px;
    padding:10px 16px;
  }

  .tibr-reader-viewer{
    height:calc(100vh - 70px) !important;
    grid-template-rows:1fr 66px;
  }

  .reader-stage{
    padding:14px;
  }

  .reader-book.reader-single-page{
    max-width:92%;
  }

  .reader-mobile-controls{
    height:66px;
    grid-template-columns:70px 1fr 70px;
    padding:9px 16px;
  }

  .reader-mobile-controls button,
  .reader-mobile-page{
    height:48px;
  }

  .reader-actions button{
    min-width:42px;
    height:40px;
  }
}

/* Mobile */
@media(max-width:768px){
  .tibr-reader-header{
    min-height:76px !important;
    height:76px !important;
    flex-direction:row !important;
    align-items:center !important;
    padding:8px 10px !important;
  }

  .reader-brand{
    flex:1;
    min-width:0;
  }

  .reader-back{
    min-width:42px;
    width:42px;
    height:42px;
    min-height:42px;
    padding:0 !important;
    font-size:0 !important;
    border-radius:14px;
  }

  .reader-back::before{
    content:"←";
    font-size:18px;
  }

  .reader-title-wrap{
    max-width:calc(100vw - 150px) !important;
  }

  .reader-title-wrap span{
    font-size:10px !important;
  }

  .reader-title-wrap h1{
    font-size:14px !important;
    line-height:1.4 !important;
  }

  .reader-actions{
    gap:6px !important;
  }

  .reader-actions button{
    min-width:42px !important;
    width:42px !important;
    height:42px !important;
    border-radius:14px !important;
    font-size:16px !important;
  }

  .tibr-reader-viewer{
    height:calc(100dvh - 76px) !important;
    grid-template-rows:1fr 62px;
  }

  .reader-stage{
    padding:8px !important;
  }

  .reader-book.reader-single-page{
    max-width:100%;
    width:100%;
    height:100%;
  }

  .reader-page-single{
    width:100%;
    height:100%;
    border-radius:16px !important;
  }

  .reader-mobile-controls{
    height:62px;
    grid-template-columns:54px 1fr 54px;
    padding:8px 10px;
  }

  .reader-mobile-controls button,
  .reader-mobile-page{
    height:44px;
    border-radius:14px;
  }

  .reader-mobile-page{
    font-size:15px;
  }

  .reader-page-picker{
    position:absolute;
    inset:0;
    z-index:90;
    display:flex;
    justify-content:center;
    align-items:flex-end;
    pointer-events:none;
    opacity:0;
    visibility:hidden;
    transition:opacity .2s ease, visibility .2s ease;
  }

  .reader-page-picker.is-active{
    pointer-events:auto;
    opacity:1;
    visibility:visible;
  }

  .reader-page-picker-backdrop{
    position:absolute;
    inset:0;
    border:0;
    background:rgba(2,8,6,.60);
    backdrop-filter:blur(3px);
    -webkit-backdrop-filter:blur(3px);
  }

  .reader-page-picker-sheet{
    position:relative;
    z-index:1;
    width:100%;
    max-height:min(62vh, 520px);
    display:flex;
    flex-direction:column;
    gap:14px;
    padding:15px 14px max(15px, env(safe-area-inset-bottom));
    border-radius:24px 24px 0 0;
    background:#071b13;
    border-top:1px solid rgba(212,175,55,.36);
    box-shadow:0 -20px 48px rgba(0,0,0,.36);
    transform:translateY(22px);
    transition:transform .22s ease;
  }

  .reader-page-picker.is-active .reader-page-picker-sheet{
    transform:translateY(0);
  }

  .reader-page-picker-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
  }

  .reader-page-picker-head span{
    display:block;
    color:var(--tibr-reader-gold-light);
    font-size:11px;
    font-weight:800;
  }

  .reader-page-picker-head strong{
    display:block;
    color:#fff;
    font-size:20px;
    font-weight:900;
  }

  .reader-page-picker-close{
    width:42px;
    height:42px;
    border:1px solid var(--reader-line);
    border-radius:14px;
    background:var(--reader-soft);
    color:#fff;
    font:700 26px/1 Arial,sans-serif;
  }

  .reader-page-picker-current{
    min-height:54px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border:1px solid rgba(212,175,55,.24);
    border-radius:16px;
    background:rgba(212,175,55,.08);
    color:rgba(255,255,255,.72);
    font-weight:700;
  }

  .reader-page-picker-current strong{
    min-width:38px;
    text-align:center;
    color:var(--tibr-reader-gold-light);
    font-size:24px;
    font-weight:900;
  }

  .reader-page-picker-current small{
    color:rgba(255,255,255,.68);
    font-size:13px;
  }

  .reader-page-jump{
    display:flex;
    flex-direction:column;
    gap:7px;
  }

  .reader-page-jump label{
    color:#fff;
    font-size:13px;
    font-weight:800;
  }

  .reader-page-jump div{
    display:grid;
    grid-template-columns:minmax(0, 1fr) 92px;
    gap:8px;
    direction:rtl;
  }

  .reader-page-jump-input{
    min-width:0;
    height:46px;
    padding:0 14px;
    border:1px solid rgba(212,175,55,.28);
    border-radius:13px;
    background:rgba(255,255,255,.075);
    color:#fff;
    font-family:inherit;
    font-size:16px;
    font-weight:800;
    text-align:right;
    outline:none;
    user-select:text;
    -webkit-user-select:text;
  }

  .reader-page-jump-input:focus{
    border-color:var(--tibr-reader-gold);
    box-shadow:0 0 0 2px rgba(212,175,55,.14);
  }

  .reader-page-jump-input::placeholder{
    color:rgba(255,255,255,.48);
  }

  .reader-page-jump button{
    height:46px;
    border:0;
    border-radius:13px;
    background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
    color:#142219;
    font-family:inherit;
    font-size:14px;
    font-weight:900;
  }

  .reader-page-jump-status{
    min-height:17px;
    color:rgba(255,255,255,.56);
    font-size:11px;
    font-weight:700;
  }

  .reader-page-picker-grid{
    overflow:auto;
    -webkit-overflow-scrolling:touch;
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:8px;
    padding-bottom:2px;
  }

  .reader-page-choice{
    min-height:62px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:2px;
    border:1px solid rgba(255,255,255,.11);
    border-radius:14px;
    background:rgba(255,255,255,.045);
    color:#fff;
    font-family:inherit;
  }

  .reader-page-gap{
    min-height:62px;
    display:grid;
    place-items:center;
    color:rgba(255,255,255,.54);
    font-size:21px;
    font-weight:900;
  }

  .reader-page-choice strong{
    font-size:19px;
    line-height:1.15;
    font-weight:900;
  }

  .reader-page-choice small{
    font-size:10px;
    color:rgba(255,255,255,.58);
    font-weight:700;
  }

  .reader-page-choice.is-current{
    color:#102018;
    background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
    border-color:transparent;
  }

  .reader-page-choice.is-current small{
    color:rgba(20,32,24,.68);
  }

  .reader-page-choice.is-purchase{
    grid-column:span 2;
    color:var(--tibr-reader-gold-light);
    border-color:rgba(212,175,55,.3);
  }

  .reader-choice-lock{
    display:block;
    width:15px;
    height:13px;
    position:relative;
    border:2px solid currentColor;
    border-radius:3px;
  }

  .reader-choice-lock:before{
    content:"";
    position:absolute;
    width:8px;
    height:8px;
    left:50%;
    top:-9px;
    transform:translateX(-50%);
    border:2px solid currentColor;
    border-bottom:0;
    border-radius:8px 8px 0 0;
  }

  .reader-light .reader-page-picker-sheet{
    background:#fffaf1;
    color:#102018;
  }

  .reader-light .reader-page-picker-head strong,
  .reader-light .reader-page-picker-close{
    color:#102018;
  }

  .reader-light .reader-page-picker-current{
    color:#506258;
  }

  .reader-light .reader-page-jump label{
    color:#102018;
  }

  .reader-light .reader-page-jump-input{
    background:#fff;
    color:#102018;
    border-color:rgba(5,43,30,.14);
  }

  .reader-light .reader-page-jump-input::placeholder,
  .reader-light .reader-page-jump-status{
    color:#65766d;
  }

  .reader-light .reader-page-choice{
    color:#102018;
    border-color:rgba(5,43,30,.12);
    background:#fff;
  }

  .reader-light .reader-page-choice small{
    color:#65766d;
  }

  .reader-light .reader-page-gap{
    color:#65766d;
  }

  .reader-light .reader-page-choice.is-current{
    background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
  }

  .reader-progress{
    height:3px;
  }

  .reader-lock{
    right:8px !important;
    left:8px !important;
    bottom:70px !important;
    padding:10px !important;
  }

  .reader-lock-card p{
    display:none;
  }

  .reader-lock-icon{
    width:44px !important;
    height:44px !important;
    font-size:20px !important;
    margin-bottom:7px !important;
  }

  .reader-lock-card h2{
    font-size:18px !important;
    margin-bottom:8px !important;
  }
}

/* Small mobile */
@media(max-width:390px){
  .reader-title-wrap{
    max-width:calc(100vw - 135px) !important;
  }

  .reader-title-wrap h1{
    font-size:13px !important;
  }

  .reader-actions button{
    min-width:38px !important;
    width:38px !important;
    height:38px !important;
  }

  .reader-back{
    min-width:38px;
    width:38px;
    height:38px;
    min-height:38px;
  }

  .reader-mobile-controls{
    grid-template-columns:48px 1fr 48px;
    gap:7px;
  }
}


/* ===== Desktop UX + Cart CTA v3.2 ===== */

/* Better desktop reading proportions */
@media(min-width:1101px){
  .tibr-reader.is-fullscreen{
    display:flex;
    flex-direction:column;
  }

  .tibr-reader-header{
    height:74px !important;
    flex:0 0 74px;
  }

  .tibr-reader-viewer{
    height:calc(100vh - 74px) !important;
    grid-template-columns:210px minmax(0,1fr);
  }

  .reader-sidebar{
    padding:16px;
    gap:12px;
  }

  .reader-stage{
    padding:24px 34px;
    min-width:0;
  }

  .reader-canvas-shell{
    max-width:100%;
    max-height:100%;
  }

  .reader-book.reader-single-page{
    width:100%;
    height:100%;
    max-width:min(880px, 72vw);
  }

  .reader-page-single{
    max-width:880px;
    max-height:100%;
  }

  .reader-floating-prev{
    right:24px;
  }

  .reader-floating-next{
    left:24px;
  }
}

/* Wide screens */
@media(min-width:1500px){
  .tibr-reader-viewer{
    grid-template-columns:230px minmax(0,1fr);
  }

  .reader-book.reader-single-page{
    max-width:min(980px, 66vw);
  }

  .reader-page-single{
    max-width:980px;
    max-height:100%;
  }

  .reader-stage{
    padding:28px 46px;
  }
}

/* Medium desktop/laptop */
@media(min-width:1101px) and (max-width:1350px){
  .tibr-reader-viewer{
    grid-template-columns:185px minmax(0,1fr);
  }

  .reader-book.reader-single-page{
    max-width:min(780px, 74vw);
  }

  .reader-page-single{
    max-width:780px;
    max-height:100%;
  }

  .reader-side-card p,
  .reader-quick-help{
    display:none;
  }
}

/* Make the add to cart CTA more direct */
.reader-lock-actions a,
.reader-locked-small a{
  position:relative;
}

.reader-lock-actions a::before,
.reader-locked-small a::before{
  content:"🛒";
  margin-left:8px;
}

/* ===== Force Fullscreen Reader v3.3 ===== */
.tibr-reader.is-fullscreen{
  position:fixed;
  inset:0;
  z-index:999999;
  width:100vw !important;
  height:100vh !important;
  height:var(--tibr-reader-viewport-height, 100dvh) !important;
}

.tibr-reader.is-fullscreen-smooth{
  animation:tibrReaderFullscreenIn .22s ease both;
}

@keyframes tibrReaderFullscreenIn{
  from{opacity:.96;transform:scale(.985)}
  to{opacity:1;transform:scale(1)}
}

.tibr-reader.is-ios-fullscreen{
  top:0 !important;
  right:0 !important;
  bottom:0 !important;
  left:0 !important;
  width:100vw !important;
  height:100vh !important;
  height:var(--tibr-reader-viewport-height, 100dvh) !important;
  max-width:none !important;
  max-height:none !important;
  border-radius:0 !important;
  transform:none !important;
  -webkit-overflow-scrolling:touch;
}

@media(max-width:768px){
  .tibr-reader.is-fullscreen .tibr-reader-header{
    padding-top:max(8px, env(safe-area-inset-top)) !important;
    min-height:calc(76px + env(safe-area-inset-top)) !important;
    height:calc(76px + env(safe-area-inset-top)) !important;
  }

  .tibr-reader.is-fullscreen .tibr-reader-viewer{
    height:calc(var(--tibr-reader-viewport-height, 100dvh) - 76px - env(safe-area-inset-top)) !important;
  }

  .tibr-reader.is-fullscreen .reader-mobile-controls{
    height:calc(62px + env(safe-area-inset-bottom));
    padding-bottom:max(8px, env(safe-area-inset-bottom));
  }

  .reader-page-single{
    box-shadow:none;
  }
}

.reader-fullscreen-prompt{
  position:fixed;
  inset:0;
  z-index:1000000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(2,8,6,.72);
  backdrop-filter:blur(12px);
}

.reader-fullscreen-card{
  width:min(430px, 94vw);
  text-align:center;
  padding:28px;
  border-radius:28px;
  background:
    radial-gradient(circle at top right,rgba(212,175,55,.18),transparent 36%),
    linear-gradient(135deg,#052b1e,#03160f);
  border:1px solid rgba(212,175,55,.38);
  box-shadow:0 30px 80px rgba(0,0,0,.35);
  color:#fff;
}

.reader-fullscreen-icon{
  width:74px;
  height:74px;
  margin:0 auto 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:24px;
  background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
  color:#1d1708;
  font-size:32px;
  font-weight:900;
}

.reader-fullscreen-icon svg{
  width:32px;
  height:32px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.reader-fullscreen-card h2{
  margin:0;
  font-size:25px;
  font-weight:900;
  color:#fff;
}

.reader-fullscreen-card p{
  margin:12px 0 20px;
  color:rgba(255,255,255,.78);
  line-height:1.8;
  font-weight:700;
}

.reader-fullscreen-card button{
  width:100%;
  min-height:52px;
  border:0;
  border-radius:16px;
  background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
  color:#1d1708;
  font-size:16px;
  font-weight:900;
  cursor:pointer;
}

@media(max-width:768px){
  .reader-fullscreen-card{
    padding:22px;
    border-radius:24px;
  }

  .reader-fullscreen-card h2{
    font-size:21px;
  }
}


/* ===== PDF Search v3.4 ===== */
.reader-search-panel{
  position:absolute;
  top:86px;
  left:22px;
  z-index:100;
  width:min(430px, calc(100vw - 44px));
  max-height:calc(100vh - 120px);
  display:none;
  flex-direction:column;
  gap:12px;
  padding:16px;
  border-radius:22px;
  background:rgba(3,22,15,.94);
  border:1px solid rgba(212,175,55,.32);
  box-shadow:0 24px 60px rgba(0,0,0,.32);
  backdrop-filter:blur(18px);
}

.reader-search-panel.active{
  display:flex;
}

.reader-search-box{
  display:grid;
  grid-template-columns:minmax(0,1fr) 92px 46px;
  gap:8px;
  direction:rtl;
}

.reader-search-input{
  height:44px;
  border:1px solid rgba(212,175,55,.28);
  border-radius:14px;
  background:rgba(255,255,255,.08);
  color:#fff;
  padding:0 13px;
  outline:none;
  font-weight:800;
  font-family:inherit;
  direction:rtl;
  text-align:right;
  font-size:16px;
  line-height:1.5;
  user-select:text;
  -webkit-user-select:text;
}

.reader-search-input::placeholder{
  color:rgba(255,255,255,.55);
}

.reader-search-run,
.reader-search-close{
  height:44px;
  border:0;
  border-radius:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-family:inherit;
  font-weight:900;
  line-height:1;
  white-space:nowrap;
  cursor:pointer;
}

.reader-search-run{
  min-width:92px;
  padding:0 18px;
  background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold));
  color:#1d1708;
  font-size:16px;
}

.reader-search-close{
  background:rgba(255,255,255,.08);
  color:#fff;
  font-size:24px;
}

.reader-search-status{
  color:rgba(255,255,255,.72);
  font-size:13px;
  font-weight:800;
  line-height:1.7;
}

.reader-search-results{
  display:grid;
  gap:8px;
  overflow:auto;
  max-height:360px;
  padding-left:3px;
}

.reader-search-result{
  text-align:right;
  border:1px solid rgba(212,175,55,.20);
  border-radius:16px;
  background:rgba(255,255,255,.07);
  color:#fff;
  padding:12px;
  cursor:pointer;
  font-family:inherit;
}

.reader-search-result:hover{
  background:rgba(212,175,55,.13);
}

.reader-search-result strong{
  display:block;
  color:var(--tibr-reader-gold-light);
  margin-bottom:5px;
}

.reader-search-result span{
  display:block;
  color:rgba(255,255,255,.72);
  font-size:14px;
  line-height:1.8;
  direction:rtl;
  unicode-bidi:plaintext;
  word-break:normal;
}

.reader-search-toggle{
  background:linear-gradient(135deg,var(--tibr-reader-gold-light),var(--tibr-reader-gold)) !important;
  color:#1d1708 !important;
}

@media(max-width:768px){
  .reader-search-panel{
    top:84px;
    left:10px;
    right:10px;
    width:auto;
    max-height:calc(100dvh - 160px);
    padding:12px;
    border-radius:18px;
  }

  .reader-search-box{
    grid-template-columns:minmax(0,1fr) 84px 42px;
  }

  .reader-search-run{
    min-width:84px;
    padding:0 14px;
    font-size:15px;
  }

  .reader-search-results{
    max-height:300px;
  }
}

/* ===== My Account Library v3.4.4 ===== */
.tibr-account-library{
  color:#102018;
}

.tibr-account-library h2{
  margin:0 0 18px;
  font-size:26px;
  font-weight:900;
  color:var(--tibr-reader-primary);
}

.tibr-library-empty{
  padding:18px;
  border:1px solid rgba(5,43,30,.12);
  border-radius:8px;
  background:#fff;
  font-weight:800;
}

.tibr-library-grid{
  display:grid;
  gap:14px;
}

.tibr-library-book{
  display:grid;
  grid-template-columns:94px minmax(0, 1fr);
  gap:16px;
  align-items:center;
  padding:14px;
  border:1px solid rgba(5,43,30,.12);
  border-radius:8px;
  background:#fff;
  box-shadow:0 8px 22px rgba(5,43,30,.06);
}

.tibr-library-cover{
  display:block;
  aspect-ratio:3 / 4;
  overflow:hidden;
  border-radius:6px;
  background:#f4efe3;
}

.tibr-library-cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.tibr-library-content{
  display:grid;
  gap:8px;
}

.tibr-library-content h3{
  margin:0;
  color:var(--tibr-reader-primary);
  font-size:18px;
  font-weight:900;
}

.tibr-library-content p{
  margin:0;
  color:#5f6f68;
  font-weight:800;
}

.tibr-library-progress{
  position:relative;
  width:100%;
  height:12px;
  margin-top:2px;
  overflow:hidden;
  border-radius:999px;
  background:rgba(5,43,30,.22) !important;
  box-shadow:inset 0 1px 3px rgba(5,43,30,.18);
}

.tibr-library-progress-fill{
  position:absolute;
  right:0;
  top:0;
  display:block;
  width:0;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#052b1e,#0b4d35) !important;
  transition:width .9s cubic-bezier(.2,.8,.2,1);
}

.tibr-library-progress-fill::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  transform:translateX(100%);
  animation:tibrLibraryProgressShine 1.35s ease-in-out infinite;
}

@keyframes tibrLibraryProgressShine{
  0%{transform:translateX(100%)}
  100%{transform:translateX(-100%)}
}

.tibr-library-content strong{
  color:var(--tibr-reader-secondary);
  font-weight:900;
  transition:color .25s ease;
}

.tibr-library-book.is-progress-ready .tibr-library-content strong{
  color:var(--tibr-reader-primary);
}

.tibr-library-continue{
  justify-self:start;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:0 18px;
  border-radius:6px;
  background:var(--tibr-reader-primary);
  color:#fff !important;
  text-decoration:none !important;
  font-weight:900;
}

@media(max-width:600px){
  .tibr-book-specs{
    padding:14px;
    margin:18px 0;
  }

  .tibr-book-specs-head h2{
    font-size:19px;
  }

  .tibr-book-specs dl{
    grid-template-columns:1fr;
  }

  .tibr-book-specs dl > div{
    align-items:flex-start;
    flex-direction:column;
    gap:4px;
  }

  .tibr-book-specs dd{
    text-align:right;
  }

  .tibr-library-book{
    grid-template-columns:72px minmax(0, 1fr);
    gap:12px;
    padding:12px;
  }

  .tibr-library-content h3{
    font-size:16px;
  }
}


.reader-native-pdf-fallback{
  width:100%;
  min-height:70vh;
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:16px;
  box-sizing:border-box;
}
.reader-native-pdf-message{
  background:rgba(255,255,255,.92);
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  padding:14px 16px;
  color:#1f2937;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
}
.reader-native-pdf-message strong{display:block;margin-bottom:4px}
.reader-native-pdf-message p{margin:0;line-height:1.7}
.reader-native-pdf-frame{
  width:100%;
  min-height:72vh;
  border:0;
  border-radius:18px;
  background:#fff;
  box-shadow:0 18px 50px rgba(0,0,0,.14);
}
.reader-native-pdf-link{margin:0;text-align:center}
.reader-native-pdf-link a{font-weight:700;text-decoration:none}
.tibr-reader-viewer.is-native-pdf-fallback .reader-sidebar,
.tibr-reader-viewer.is-native-pdf-fallback .reader-mobile-controls,
.tibr-reader-viewer.is-native-pdf-fallback .reader-progress{opacity:.45;pointer-events:none}
