/* ============ Okuyucu ============ */
.reader-view { position: fixed; inset: 0; overflow: hidden; }
.reader {
  position: absolute; inset: 0;
  background: var(--desk);
  color: var(--ui-ink);
  overflow: hidden;
  transition: background .6s;
  touch-action: none;
}
.stage { position: absolute; inset: 0; display: grid; place-items: center; }
.flip-host { position: relative; transition: opacity .35s; }
.flip-host .stf__wrapper { height: 100% !important; padding-bottom: 0 !important; }
.reader.rebuilding .flip-host { opacity: .4; }

.book-shadow {
  position: absolute; pointer-events: none;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,.25), 0 22px 46px -6px rgba(0,0,0,.55), 0 50px 90px -30px rgba(0,0,0,.6);
  transition: left .5s var(--ease-out), width .5s var(--ease-out), top .3s, height .3s;
}
.theme-beyaz .book-shadow { box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 22px 46px -10px rgba(40,30,20,.35); }
.stack {
  position: absolute; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--paper-edge) 0 1px, var(--paper) 1px 2.4px);
  transition: all .5s var(--ease-out);
}
.stack-l { border-radius: 3px 0 0 3px; box-shadow: -2px 2px 6px rgba(0,0,0,.25); }
.stack-r { border-radius: 0 3px 3px 0; box-shadow: 2px 2px 6px rgba(0,0,0,.25); }

.ribbon {
  position: absolute; z-index: 6; width: 24px; height: 76px; pointer-events: none;
  background: linear-gradient(90deg, #a8322a, #cf4a3c 45%, #a8322a);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%);
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.35));
  transform: scaleY(0); transform-origin: top;
  transition: transform .45s var(--ease-spring), left .3s;
}
.ribbon.in { transform: scaleY(1); }

/* ---- Araç çubukları ---- */
.rd-bar {
  position: absolute; left: 50%; z-index: 12;
  width: min(calc(100% - 20px), 980px);
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--ui-bg) 84%, transparent);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--ui-line);
  box-shadow: 0 14px 40px -16px rgba(0,0,0,.5);
  color: var(--ui-ink);
  transition: transform .45s var(--ease-out), opacity .35s;
}
.rd-bar .icon-btn { color: var(--ui-ink); }
.rd-bar .icon-btn:hover { background: color-mix(in srgb, var(--ui-ink) 10%, transparent); }
.rd-bar .icon-btn.active { color: #d9483a; }
.rd-bar .icon-btn.active svg { fill: currentColor; }
.rd-top { top: calc(var(--safe-top) + 10px); transform: translateX(-50%); }
.rd-bottom { bottom: calc(var(--safe-bottom) + 10px); transform: translateX(-50%); flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 18px 10px; }
.reader.ui-hidden .rd-top { transform: translate(-50%, calc(-100% - 30px)); opacity: 0; pointer-events: none; }
.reader.ui-hidden .rd-bottom { transform: translate(-50%, calc(100% + 30px)); opacity: 0; pointer-events: none; }
.rd-heading { flex: 1; min-width: 0; padding: 0 6px; }
.rd-title { font-family: var(--font-display); font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-chapter { font-size: 12.5px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-chapter:empty { display: none; }
.rd-tools { display: flex; gap: 2px; }

.rd-slider-wrap { position: relative; padding: 4px 0; }
.rd-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px; background: transparent; cursor: pointer; margin: 0;
}
.rd-slider::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--ui-ink) 22%, transparent); }
.rd-slider::-moz-range-track { height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--ui-ink) 22%, transparent); }
.rd-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); margin-top: -8px; box-shadow: 0 2px 8px rgba(0,0,0,.4); border: 3px solid var(--ui-bg); }
.rd-slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--ui-bg); }
.rd-preview {
  position: absolute; bottom: 38px; left: var(--x, 50%);
  transform: translateX(-50%) translateY(8px) scale(.9);
  min-width: 90px; max-width: 200px; padding: 8px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  background: var(--ui-bg); border: 1px solid var(--ui-line); box-shadow: 0 10px 30px -10px rgba(0,0,0,.6);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease-out);
}
.rd-preview.in { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.rd-preview canvas { width: 90px; height: auto; border-radius: 3px; }
.rd-preview b { font-size: 14px; }
.rd-preview span { font-size: 11.5px; opacity: .7; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rd-meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; opacity: .8; flex-wrap: wrap; }
.rd-pct { font-weight: 700; }
.rd-eta { margin-left: auto; }
.rd-today { padding-left: 12px; border-left: 1px solid var(--ui-line); }
.rd-today:empty { display: none; }
@media (max-width: 560px) { .rd-eta { margin-left: 0; } .rd-today { display: none; } }

.idle-pill {
  position: absolute; left: 50%; bottom: calc(var(--safe-bottom) + 16px); z-index: 11;
  transform: translate(-50%, 20px); opacity: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 99px;
  background: color-mix(in srgb, var(--ui-bg) 88%, transparent); color: var(--ui-ink);
  border: 1px solid var(--ui-line); font-size: 12.5px;
  pointer-events: none; transition: all .4s var(--ease-out);
}
.reader.is-idle.ui-hidden .idle-pill { opacity: .85; transform: translate(-50%, 0); }

.rd-loading {
  position: absolute; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px;
  background: var(--desk);
  color: var(--ui-ink);
  transition: opacity .7s ease, visibility .7s;
}
.rd-loading.done { opacity: 0; visibility: hidden; }
.rd-loading-text { font-family: var(--font-display); font-size: 18px; opacity: .85; }

/* ---- Okuyucu panelleri ---- */
.reader-sheet .sheet-head h2 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-seg { width: 100%; margin-bottom: 12px; }
.nav-seg button { flex: 1; }
.nav-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow: auto; margin: 0 -8px; }
.nav-item { display: flex; align-items: center; gap: 12px; justify-content: space-between; text-align: left; padding: 12px 16px; border-radius: 12px; transition: background .2s; width: 100%; }
.nav-item:hover { background: var(--surface-2); }
.nav-item span { flex: 1; min-width: 0; }
.nav-item small { color: var(--faint); font-variant-numeric: tabular-nums; }
.nav-item.current { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-weight: 600; }
.nav-item.bm { padding: 4px 4px 4px 0; }
.bm-go { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; padding: 8px 12px 8px 16px; border-radius: 12px; }
.add-bm { margin: 0 8px 8px; align-self: flex-start; }
.empty-note { padding: 20px 16px; }

.appearance h3 { font-size: 20px; margin-bottom: 16px; }
.theme-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 20px; }
@media (max-width: 420px) { .theme-swatches { grid-template-columns: repeat(3, 1fr); } }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.sw-page {
  width: 100%; aspect-ratio: 3/4; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-read); font-size: 20px;
  border: 2px solid var(--line);
  transition: transform .25s var(--ease-spring), border-color .2s;
}
.swatch:hover .sw-page { transform: translateY(-3px); }
.swatch.active .sw-page { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.swatch.active { color: var(--text); font-weight: 600; }
.typo { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.typo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.typo-row > span:first-child { font-weight: 550; font-size: 14px; }
.toggle-row { padding-top: 14px; border-top: 1px solid var(--line); cursor: pointer; }
.stepper { display: flex; align-items: center; gap: 4px; padding: 2px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.stepper b { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
.stepper .icon-btn { width: 38px; height: 38px; }
.aa { font-family: var(--font-read); font-weight: 600; }
.aa.small { font-size: 14px; }
.aa.big { font-size: 21px; }

.finish { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.finish-emoji { font-size: 60px; animation: pop .8s var(--ease-spring) both; }
@keyframes pop { from { transform: scale(0) rotate(-30deg); } }
.finish .mini-stats { width: 100%; margin-top: 14px; }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 900; pointer-events: none; }
