/* E-Kitap Sunucum v2 — mobil/tablet öncelikli tasarım */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/inter-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/inter-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #eef0f3; --text: #111827; --muted: #5b6270; --line: #e5e7eb;
  --primary: #0f6b6b; --primary-2: #14919b; --primary-soft: #e0f2f1; --on-primary: #fff;
  --accent: #6d5dfc; --accent-soft: #ece9ff;
  --hot-1: #ff3d7f; --hot-2: #ff8a4c; --gold: #f5b301; --danger: #be123c; --ok: #10b981;
  --r-lg: 22px; --r-md: 16px; --r-sm: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 20px rgba(16,24,40,.07);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.18);
  --tab-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --rail-w: 0px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12111f; --surface: #1c1a30; --surface-2: #26243f; --text: #f3f4f6; --muted: #a1a1b5; --line: #2e2c4a;
    --primary: #2dd4bf; --primary-2: #14b8a6; --primary-soft: rgba(45,212,191,.14); --on-primary: #052e2b;
    --accent: #8b7dff; --accent-soft: rgba(139,125,255,.16); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; min-height: 100vh; min-height: 100dvh; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

.ic { width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle; }
.ic.sm { width: 18px; height: 18px; } .ic.lg { width: 28px; height: 28px; } .ic.xl { width: 34px; height: 34px; }

/* ---------- Gezinme: alt sekme çubuğu (telefon) / sol ray (tablet yatay, masaüstü) ---------- */
.tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; justify-content: space-around; align-items: stretch; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 500; position: relative; }
.tabbar a.on { color: var(--primary); }
.tabbar a.on::after { content: ''; position: absolute; bottom: 6px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tabbar a.on span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tabbar .tb-brand { display: none; }
body.has-tabs { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 12px); }
@media (min-width: 1000px) {
  :root { --rail-w: 92px; }
  .tabbar { top: 0; right: auto; width: var(--rail-w); height: auto; flex-direction: column; justify-content: flex-start; gap: 6px; padding: 18px 0; border-top: 0; border-right: 1px solid var(--line); }
  .tabbar a { flex: none; height: 66px; margin: 0 10px; border-radius: 16px; }
  .tabbar a:hover { background: var(--surface-2); }
  .tabbar a.on { background: var(--primary-soft); }
  .tabbar a.on span { position: static; width: auto; height: auto; overflow: visible; clip: auto; } .tabbar a.on::after { display: none; }
  .tabbar .tb-brand { display: flex; color: var(--primary); margin-bottom: 14px; height: 52px; }
  .tabbar .tb-brand .ic { width: 30px; height: 30px; }
  body.has-tabs { padding-bottom: 24px; padding-left: var(--rail-w); }
}

.page { max-width: 1180px; margin: 0 auto; padding: calc(18px + var(--safe-t)) 18px 24px; }
@media (min-width: 700px) { .page { padding-left: 32px; padding-right: 32px; } }
.page-title { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 16px; }
.section-h { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; }
.section-h h2 { font-size: 19px; font-weight: 700; }
.section-h a { color: var(--muted); display: flex; }

/* ---------- Ortak öğeler ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; border: 0;
  background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform .1s, filter .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.hot { background: linear-gradient(90deg, var(--hot-1), var(--hot-2)); color: #fff; box-shadow: 0 8px 22px rgba(255,61,127,.3); }
.btn.teal { background: linear-gradient(90deg, #138f96, #20c3b2); color: #fff; box-shadow: 0 8px 22px rgba(20,145,155,.3); }
.btn.ghost { background: transparent; }
.btn.outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: inherit; flex: none; touch-action: manipulation; }
.iconbtn:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.iconbtn.on { color: var(--primary); background: var(--primary-soft); }
.iconbtn.filled { background: var(--surface); box-shadow: var(--shadow); }

.searchbox { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; border-radius: 16px; background: var(--surface-2); color: var(--muted); }
.searchbox input { flex: 1; border: 0; background: none; outline: 0; font: inherit; font-size: 16px; color: var(--text); min-width: 0; }
.searchbox input::placeholder { color: var(--muted); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; scroll-padding: 18px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 38px; padding: 0 16px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; border: 0; white-space: nowrap; }
.chip.on { background: var(--text); color: var(--bg); box-shadow: none; }
.chip .n { color: var(--muted); font-size: 12px; } .chip.on .n { color: inherit; opacity: .7; }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 2px 12px; font-weight: 600; color: var(--muted); white-space: nowrap; border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-color: var(--primary); }

.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.bar { height: 6px; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }

/* Kapaklar */
.cv { display: block; width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 10px; background: var(--surface-2);
  box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 10px 24px rgba(0,0,0,.14); }
.cv-ph { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 14% 12%; color: #fff; overflow: hidden;
  background: linear-gradient(160deg, hsl(var(--h) 45% 38%), hsl(calc(var(--h) + 40) 50% 18%)); }
.cv-ph b { font-size: clamp(11px, 2.6vw, 16px); line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cv-ph small { font-size: 11px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Kitap rafı (yatay kaydırılan) */
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: 128px; gap: 16px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 4px 18px 10px; scroll-snap-type: x proximity; }
.shelf::-webkit-scrollbar { display: none; }
@media (min-width: 700px) { .shelf { grid-auto-columns: 150px; margin: 0 -32px; padding-left: 32px; padding-right: 32px; } .chips { margin: 0 -32px; padding-left: 32px; padding-right: 32px; } }
.bk { scroll-snap-align: start; display: block; position: relative; }
.bk .t { font-weight: 600; font-size: 14px; margin-top: 10px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bk .a { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.bk .bar { position: absolute; left: 8px; right: 8px; height: 4px; margin-top: -12px; background: rgba(255,255,255,.35); }
.bk .badge-audio { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px); }
.bk .badge-audio .ic { width: 15px; height: 15px; }
.bk .ai-dot { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; animation: pulse 1.4s infinite; }
.bk .ai-dot .ic { width: 14px; height: 14px; }
@keyframes pulse { 50% { opacity: .45; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 22px 14px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 26px 20px; } }

/* "Devam edenler" listesi */
.cont { display: grid; gap: 14px; }
@media (min-width: 760px) { .cont { grid-template-columns: 1fr 1fr; } }
.cont-card { display: grid; grid-template-columns: 92px 1fr auto; gap: 16px; padding: 12px; align-items: center; }
.cont-card .cv { border-radius: 10px; }
.cont-card h3 { font-size: 16px; font-weight: 700; }
.cont-card .meta { font-size: 13px; color: var(--muted); margin: 10px 0 12px; }
.cont-card .bar { margin-top: 10px; }
.cont-card .actions { align-self: start; }

/* ---------- Ana sayfa ---------- */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hello h1 { font-size: 28px; font-weight: 800; }
.hello p { margin: 2px 0 0; color: var(--muted); }
.avatar { width: 46px; height: 46px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--primary-2)); color: #fff; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 22px; color: #fff; margin-top: 20px; display: grid; grid-template-columns: 1fr 118px; gap: 18px; align-items: center;
  background: radial-gradient(120% 140% at 0% 0%, #7c6cff 0%, #5b3fd6 45%, #2d1d72 100%); box-shadow: 0 18px 40px rgba(91,63,214,.35); }
.hero .bgcv { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(30px) saturate(1.4); opacity: .55; transform: scale(1.3); }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,12,60,.85), rgba(20,12,60,.35)); }
.hero > * { position: relative; z-index: 1; }
.hero .k { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .8; font-weight: 600; }
.hero h2 { font-size: 22px; font-weight: 800; margin: 6px 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero p { margin: 0 0 14px; opacity: .85; font-size: 14px; }
.hero .cv { transform: rotate(4deg); box-shadow: 0 16px 30px rgba(0,0,0,.4); }
.hero .btn { background: #fff; color: #2d1d72; height: 42px; }
.hero .prog { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 14px; }
.hero .prog .bar { flex: 1; background: rgba(255,255,255,.25); } .hero .prog .bar i { background: #fff; }
.two { display: grid; gap: 14px; margin-top: 14px; }
@media (min-width: 760px) { .two { grid-template-columns: 1.2fr 1fr; } .hero { margin-top: 24px; grid-template-columns: 1fr 140px; padding: 28px 32px; } }
.goal { padding: 18px; display: flex; gap: 16px; align-items: center; }
.ring { --p: 0; width: 76px; height: 76px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--accent-soft) 0); }
.ring > span { width: 60px; height: 60px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 17px; }
.goal h3, .goal .h3 { font-size: 16px; font-weight: 700; margin: 0; }
.goal p { margin: 2px 0 10px; color: var(--muted); font-size: 13px; }
.days { display: flex; gap: 6px; }
.days span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.days span.on { background: var(--accent); color: #fff; }
.days span.today { box-shadow: 0 0 0 2px var(--accent); }
.stat-mini { padding: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stat-mini b { display: block; font-size: 22px; font-weight: 800; }
.stat-mini span { font-size: 12px; color: var(--muted); }
.genres { display: grid; grid-auto-flow: column; grid-auto-columns: 74px; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px; }
.genres::-webkit-scrollbar { display: none; }
@media (min-width: 700px) { .genres { margin: 0 -32px; padding: 2px 32px; } }
.genre { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; text-align: center; }
.genre i { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: hsl(var(--h) 75% 55%);
  box-shadow: 0 6px 16px hsl(var(--h) 75% 50% / .35); }
.genre span { line-height: 1.15; }
.authors { display: grid; grid-auto-flow: column; grid-auto-columns: 84px; gap: 14px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px; }
.authors::-webkit-scrollbar { display: none; }
.author { text-align: center; font-size: 12.5px; font-weight: 500; }
.author .avatar { width: 72px; height: 72px; margin: 0 auto 8px; font-size: 20px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { width: 54px; height: 54px; color: var(--primary); opacity: .8; }
.empty h3 { color: var(--text); margin: 14px 0 6px; font-size: 18px; }

/* FAB */
.fab { position: fixed; z-index: 35; right: 20px; bottom: calc(var(--tab-h) + var(--safe-b) + 18px); width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #4f46e5); color: #fff; box-shadow: 0 12px 28px rgba(79,70,229,.45); display: grid; place-items: center; }
.fab .ic { width: 28px; height: 28px; }
@media (min-width: 1000px) { .fab { bottom: 28px; right: 32px; } }

/* Yükleme listesi */
.uploads { position: fixed; z-index: 45; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 90px); display: grid; gap: 8px; max-width: 460px; margin-left: auto; }
.up { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 10px 14px; font-size: 13px; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; }
.up .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.up .bar { grid-column: 1 / -1; height: 4px; }
.up.done .state { color: var(--ok); } .up.failed .state { color: var(--danger); }
.drop-overlay { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--accent) 18%, transparent); border: 3px dashed var(--accent); display: none;
  align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: var(--accent); pointer-events: none; }
.drop-overlay.show { display: flex; }

/* ---------- Alt panel (bottom sheet) ve pencereler ---------- */
dialog.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 640px; max-height: 92dvh; border-radius: 26px 26px 0 0;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; }
dialog.sheet[open] { animation: sheetIn .26s cubic-bezier(.2,.8,.25,1); }
dialog.sheet::backdrop { background: rgba(8,10,20,.45); backdrop-filter: blur(2px); }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 700px) { dialog.sheet { margin: auto; border-radius: 26px; } }
.sheet-in { padding: 10px 20px calc(20px + var(--safe-b)); max-height: 92dvh; overflow: auto; }
.grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { font-size: 19px; font-weight: 800; margin-bottom: 14px; }
.menu-list { display: grid; }
.menu-list button, .menu-list a { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border: 0; background: none; text-align: left; cursor: pointer; font-size: 15.5px; font-weight: 500; border-radius: 12px; }
.menu-list button:hover, .menu-list a:hover { background: var(--surface-2); }
.menu-list .ic { color: var(--muted); }
.menu-list .danger, .menu-list .danger .ic { color: var(--danger); }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 6px 4px; }
.field input, .field textarea, .field select, input.inp { width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--surface-2); border: 1.5px solid transparent; border-radius: 14px; padding: 12px 14px; outline: 0; }
.field input:focus, .field textarea:focus, .field select:focus, input.inp:focus { border-color: var(--primary); background: var(--surface); }
.field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; font-weight: 500; }
.switch input { appearance: none; width: 50px; height: 30px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: .2s; flex: none; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .2s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { left: 23px; }
.switch small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; height: 40px; border: 0; border-radius: 11px; background: none; cursor: pointer; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper b { min-width: 46px; text-align: center; font-size: 17px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 24px); transform: translateX(-50%) translateY(20px); background: #111827; color: #fff;
  padding: 12px 18px; border-radius: 14px; opacity: 0; pointer-events: none; transition: all .22s; z-index: 100; max-width: 90vw; font-size: 14px; box-shadow: var(--shadow-lg); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.error { background: var(--danger); }
.alert { background: #fee2e2; color: #991b1b; padding: 12px 14px; border-radius: 14px; }
.success { background: #d1fae5; color: #065f46; padding: 12px 14px; border-radius: 14px; }
.install-warn { background: #fef3c7; color: #92400e; padding: 8px 18px; font-size: 13px; text-align: center; }

/* ---------- Giriş / kurulum ---------- */
body.auth { display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(130% 90% at 20% 0%, #2a7f86 0%, #123b4a 40%, #0d1424 100%); }
.auth-card { width: min(400px, 100%); background: var(--surface); border-radius: 28px; padding: 30px 24px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.auth-card.wide { width: min(560px, 100%); }
.auth-logo { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; color: #fff; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--primary-2), var(--accent)); }
.auth-logo .ic { width: 32px; height: 32px; }
.auth-card h1 { font-size: 24px; font-weight: 800; margin-bottom: 20px; }
.checks { list-style: none; padding: 0; font-size: 14px; }
.checks .ok { color: var(--ok); } .checks .bad { color: var(--danger); }

/* ---------- Kitap detay ---------- */
body.detail { background: var(--surface); }
.dt-hero { position: relative; padding: calc(10px + var(--safe-t)) 10px 0; min-height: 330px; color: #fff; overflow: hidden; }
.dt-hero .bgcv { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(36px) saturate(1.3) brightness(.7); }
.dt-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,30,40,.65), rgba(10,30,40,.25)); }
.dt-hero > * { position: relative; }
.dt-top { display: flex; align-items: center; gap: 4px; }
.dt-top .ttl { flex: 1; text-align: center; font-weight: 700; font-size: 17px; }
.dt-cover { width: 168px; margin: 18px auto -120px; position: relative; z-index: 2; }
.dt-cover .cv { border-radius: 8px; box-shadow: 0 24px 50px rgba(0,0,0,.45); }
.dt-sheet { position: relative; background: var(--surface); border-radius: 32px 32px 0 0; margin-top: -40px; padding: 140px 22px 30px; max-width: 760px; margin-left: auto; margin-right: auto; }
.dt-sheet h1 { text-align: center; font-size: 26px; font-weight: 800; }
.dt-author { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; color: var(--muted); font-weight: 500; }
.dt-author .avatar { width: 28px; height: 28px; font-size: 11px; }
.dt-genre { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.dt-genre span { font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.tile { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); text-align: center; padding: 12px 6px; }
.tile span, .tile dt { display: block; font-size: 12.5px; color: var(--muted); }
.tile b, .tile dd { font-size: 17px; font-weight: 700; margin: 0; }
.about h3, .about .h3 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.about p { margin: 0; color: var(--muted); line-height: 1.6; white-space: pre-line; }
.about p.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.about .more { border: 0; background: none; color: var(--primary); font-weight: 600; padding: 6px 0; cursor: pointer; }
.dt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 4px; }
.dt-actions .btn { height: 52px; font-size: 16px; }
.dt-actions .btn:only-child { grid-column: 1 / -1; }
.dt-sub { display: flex; justify-content: center; gap: 22px; margin: 12px 0 22px; flex-wrap: wrap; }
.dt-sub button, .dt-sub a { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--text); }
.dt-sub .on { color: var(--primary); }
.dt-sub #favBtn.on { color: #e11d48; }
.btn.danger-fill { background: var(--danger); color: #fff; border-color: var(--danger); }
.ai-banner { display: flex; gap: 12px; align-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 16px; padding: 12px 14px; margin-top: 18px; font-size: 13.5px; }
.ai-banner .ic { flex: none; }
.ai-banner button { margin-left: auto; }
.dt-progress { margin-top: 16px; font-size: 13px; color: var(--muted); }
.dt-progress .bar { margin-top: 6px; }
@media (min-width: 900px) {
  .dt-wrap { display: grid; grid-template-columns: 320px 1fr; gap: 48px; max-width: 1100px; margin: 0 auto; padding: 40px 32px; }
  body.detail .dt-hero { min-height: 0; padding: 0; border-radius: 28px; padding: 30px; }
  .dt-cover { width: 100%; margin: 20px 0 0; }
  .dt-sheet { margin: 0; padding: 20px 0; border-radius: 0; max-width: none; }
  .dt-sheet h1, .dt-author, .dt-genre { text-align: left; justify-content: flex-start; }
  .dt-sheet h1 { font-size: 34px; }
}

/* ---------- Notlar ---------- */
.note-card { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; border-left: 4px solid var(--c); }
.note-card blockquote, .note-item blockquote, .excerpt { margin: 8px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--c, #ffd54f); color: var(--muted); font-style: italic; }
.note-card p { margin: 6px 0 0; }
.nhead { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); gap: 10px; }
.book-head { display: flex; align-items: center; gap: 12px; margin: 26px 0 12px; }
.book-head img, .book-head .cv { width: 40px; border-radius: 6px; }
.book-head .cv-ph { height: 58px; flex: none; font-size: 0; }
.book-head .cv-ph * { display: none; }
.book-head b { font-size: 16px; }

/* ---------- Profil ---------- */
.prof-head { display: flex; align-items: center; gap: 16px; margin: 8px 0 20px; }
.prof-head .avatar { width: 68px; height: 68px; font-size: 24px; }
.prof-head h1 { font-size: 24px; font-weight: 800; }
.panel { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 18px 18px; margin-bottom: 16px; }
.panel h2 { font-size: 17px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel h2 .ic { color: var(--primary); }
.users { display: grid; gap: 4px; }
.users .u { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.users .u .avatar { width: 38px; height: 38px; font-size: 14px; }
.users .u > div:not(.avatar) { flex: 1; }
.scan { margin-top: 12px; font-size: 13px; color: var(--muted); }
.scan .bar { margin: 8px 0; }
.drive-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 10px 0 12px; }
.drive-stats > div { background: var(--soft, rgba(127,127,127,.08)); border-radius: 12px; padding: 10px 12px; }
.drive-stats b { display: block; font-size: 17px; font-weight: 800; }
.drive-stats span { font-size: 12px; color: var(--muted); }
.drive-policy { margin-top: 6px; }
.drive-acct small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.aiprog { display: grid; gap: 6px; margin-top: 10px; max-height: 220px; overflow: auto; font-size: 13px; }

/* ================= OKUYUCU ================= */
body.reader { height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none; --paper: #fbf6ea; --ink: #2b2a27; --chrome: #fbf6ea; --foot-h: 64px; --bar-h: 56px;
  background: var(--paper); color: var(--ink); }
body.reader[data-rtheme=light] { --paper: #ffffff; --ink: #1f2937; --chrome: #ffffff; }
body.reader[data-rtheme=sepia] { --paper: #fbf6ea; --ink: #2b2a27; --chrome: #fbf6ea; }
body.reader[data-rtheme=dark] { --paper: #121212; --ink: #d6d3cd; --chrome: #181818; --surface: #1f1f22; --surface-2: #2a2a2e; --line: #34343a; --text: #e5e5e5; --muted: #9a9aa2; color-scheme: dark; }
body.reader[data-rtheme=sepia], body.reader[data-rtheme=light] { --surface: #fff; --surface-2: #f1ede4; --line: #e7e0d0; --text: #1f2937; --muted: #78716c; color-scheme: light; }
.rbar { position: fixed; top: 0; left: 0; right: 0; z-index: 30; padding: calc(4px + var(--safe-t)) 6px 4px; display: flex; align-items: center; gap: 2px;
  background: var(--chrome); transition: transform .25s, opacity .25s; }
.rbar .rtitle { margin: 0; flex: 1; min-width: 0; text-align: center; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .8; padding: 0 6px; }
.rprog { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 31; background: transparent; }
.rprog i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .3s; }
.rmain { position: fixed; inset: 0; top: var(--bar-h); bottom: var(--foot-h); } /* boyut animasyonu yok: her karede sayfa yeniden dizilmesin */
.viewer { position: absolute; inset: 0; }
.rfoot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 6px 16px calc(8px + var(--safe-b)); background: var(--chrome);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 10px; transition: transform .25s, opacity .25s; }
.rfoot .pos { grid-column: 1 / -1; text-align: center; font-size: 13px; font-weight: 600; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfoot .pos input { width: 56px; text-align: center; font: inherit; border: 0; background: var(--surface-2); color: inherit; border-radius: 8px; padding: 2px 4px; }
.rfoot input[type=range] { width: 100%; accent-color: var(--primary); }
body.chrome-hidden .rbar { transform: translateY(-110%); opacity: 0; }
body.chrome-hidden .rfoot { transform: translateY(110%); opacity: 0; }
body.chrome-hidden .rmain { top: 0; bottom: 0; }
body.chrome-hidden .pen-fab { transform: translateY(80px) scale(.8); opacity: 0; pointer-events: none; }
.loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); z-index: 5; padding: 20px; text-align: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* Kalem düğmesi ve araç paleti */
.pen-fab { position: fixed; right: 16px; bottom: calc(var(--foot-h) + 14px); z-index: 32; width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--text); color: var(--paper); box-shadow: var(--shadow-lg); display: grid; place-items: center; transition: transform .25s, opacity .25s, background .2s; }
body.inking .pen-fab { background: var(--primary); color: #fff; }
.palette { position: fixed; z-index: 33; left: 50%; transform: translateX(-50%); bottom: calc(var(--foot-h) + 14px); display: none; align-items: center; gap: 4px;
  background: var(--surface); color: var(--text); padding: 6px; border-radius: 22px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 96px); overflow-x: auto; scrollbar-width: none; }
.palette::-webkit-scrollbar { display: none; }
body.inking .palette { display: flex; }
body.chrome-hidden .palette { bottom: 14px; }
body.chrome-hidden.inking .pen-fab { transform: none; opacity: 1; pointer-events: auto; bottom: 14px; }
.palette .iconbtn { width: 40px; height: 40px; }
.palette .iconbtn.active { background: var(--primary-soft); color: var(--primary); }
.palette .sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; flex: none; }
.swatches { display: inline-flex; gap: 6px; align-items: center; padding: 0 2px; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6), 0 0 0 1px var(--line); cursor: pointer; padding: 0; flex: none; }
.sw.on { box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 2px var(--text); }
.wdots { display: inline-flex; gap: 2px; }
.wdots button { width: 32px; height: 40px; border: 0; background: none; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.wdots button i { display: block; border-radius: 50%; background: currentColor; }
.wdots button.on { background: var(--surface-2); }

/* Kenar çubuğu (içindekiler, notlar, arama) */
.sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(360px, 88vw); z-index: 50; background: var(--surface); color: var(--text); transform: translateX(-105%); transition: transform .25s;
  display: flex; flex-direction: column; padding-top: var(--safe-t); box-shadow: var(--shadow-lg); }
body.sb-open .sidebar { transform: none; }
.sb-scrim { position: fixed; inset: 0; z-index: 49; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .25s; }
body.sb-open .sb-scrim { opacity: 1; pointer-events: auto; }
.sb-head { display: flex; align-items: center; padding: 8px 8px 0 18px; }
.sb-head b { flex: 1; font-size: 18px; }
.stabs { display: flex; gap: 18px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.stabs button { padding: 12px 0; background: none; border: 0; border-bottom: 2.5px solid transparent; color: var(--muted); font-weight: 600; cursor: pointer; margin-bottom: -1px; }
.stabs button.active { color: var(--text); border-bottom-color: var(--primary); }
.spane { display: none; overflow: auto; flex: 1; padding: 12px 14px calc(20px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.spane.active { display: block; }
.spane ul { list-style: none; margin: 0; padding: 0; }
.spane li a { display: block; padding: 10px; border-radius: 10px; font-size: 14.5px; }
.spane li a:hover { background: var(--surface-2); }
.note-item { padding: 12px 6px; border-bottom: 1px solid var(--line); font-size: 14px; }
.note-item p { margin: 4px 0; }
.note-item .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.nact { display: flex; gap: 14px; margin-top: 4px; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font: inherit; font-weight: 600; font-size: 13px; }
.ink-pages { display: flex; flex-wrap: wrap; gap: 6px; }
.ink-pages .chip { height: 30px; padding: 0 12px; }
.search-form { display: flex; gap: 8px; margin-bottom: 8px; }
.search-form .searchbox { flex: 1; height: 44px; }
.sres { display: block; padding: 10px 6px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.sres b { display: block; font-size: 12px; color: var(--muted); }
.sres mark { background: #fde68a; color: #000; border-radius: 3px; }

/* Ayarlar paneli (A/A) */
.themes { display: flex; gap: 14px; }
.themes button { width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.themes button.on { box-shadow: 0 0 0 3px var(--primary); }
.themes [data-t=light] { background: #fff; color: #111; } .themes [data-t=sepia] { background: #f4ecd8; color: #433422; } .themes [data-t=dark] { background: #121212; color: #ddd; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row > span { font-weight: 600; }

/* PDF sayfaları */
.pdf-viewer { overflow: auto; -webkit-overflow-scrolling: touch; padding: 10px 0 30px; background: color-mix(in srgb, var(--paper) 80%, #888 20%); }
body.reader[data-rtheme=dark] .pdf-viewer { background: #0b0b0b; }
.pdf-viewer .page { position: relative; margin: 0 auto 12px; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.18); }
.pdf-viewer .page canvas.pdf { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pdf-viewer .page .pnum { display: none; }
.textLayer { position: absolute; text-align: initial; inset: 0; overflow: clip; opacity: 1; line-height: 1; text-size-adjust: none; -webkit-text-size-adjust: none;
  forced-color-adjust: none; transform-origin: 0 0; caret-color: CanvasText; z-index: 2; }
.textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) { z-index: 1; }
.textLayer span.markedContent { top: 0; height: 0; }
.textLayer ::selection { background: rgba(20,145,155,.3); }
.textLayer br::selection { background: transparent; }
.textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: 0; cursor: default; user-select: none; }
.textLayer.selecting .endOfContent { top: 0; }
.textLayer span.search-hit { background: rgba(249, 115, 22, .45); border-radius: 2px; }
.hl-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hl { position: absolute; opacity: .45; mix-blend-mode: multiply; border-radius: 2px; }
.hl.has-note { box-shadow: inset 0 -2px 0 rgba(0,0,0,.45); }
.page-marks { position: absolute; top: 6px; right: 6px; z-index: 6; display: flex; flex-direction: column; gap: 6px; }
.page-marks .mark { border: 0; background: var(--surface); color: var(--primary); border-radius: 50%; box-shadow: var(--shadow); width: 32px; height: 32px; cursor: pointer; padding: 0; display: grid; place-items: center; }
.page-marks .mark .ic { width: 16px; height: 16px; }
.page-marks .mark.bookmark { color: var(--danger); }
body.reader[data-rtheme=dark] .pdf-viewer .page { background: #1a1a1a; }
/* PDF sayfalarının tema rengi çizim sırasında tuvale uygulanır (reader-pdf.js tintCanvas) */
body.reader[data-rtheme=dark] .hl { mix-blend-mode: screen; opacity: .35; }

body.inking .textLayer { user-select: none; -webkit-user-select: none; pointer-events: none; }
.pdf-viewer.paged { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; padding: 0; overscroll-behavior-x: contain; scrollbar-width: none; }
.pdf-viewer.paged::-webkit-scrollbar { display: none; }
.pdf-viewer.paged .slot { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: auto; display: flex; align-items: safe center; justify-content: safe center; padding: 8px 0; }
.pdf-viewer.paged .page { margin: auto; flex: none; }

/* Çizim katmanları */
.ink-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.ink-layer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ink-layer.drawing { pointer-events: auto; touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ink-layer.drawing.eraser, .ink-svg.drawing.eraser { cursor: cell; }
.ink-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 5; }
.ink-svg.drawing { pointer-events: auto; touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ink-svg .mk { mix-blend-mode: multiply; }
body.reader[data-rtheme=dark] .ink-svg .mk { mix-blend-mode: screen; }

/* EPUB */
.epub-viewer { overflow: hidden; background: var(--paper); }
.epub-stage { position: absolute; inset: 0; padding: 12px 22px; }
.epub-viewer.scrolled .epub-stage { padding: 0 8px; }
@media (min-width: 900px) { .epub-viewer.paged .epub-stage { padding: 24px 6vw; } }

/* Seçim menüsü */
.selmenu { position: fixed; left: 50%; bottom: calc(var(--foot-h) + 16px); transform: translateX(-50%); z-index: 40; display: flex; gap: 6px; align-items: center;
  background: var(--surface); color: var(--text); padding: 8px; border-radius: 20px; box-shadow: var(--shadow-lg); max-width: 96vw; }
.selmenu .sw { width: 32px; height: 32px; }
body.chrome-hidden .selmenu { bottom: 16px; }
#noteDialog textarea { width: 100%; font: inherit; font-size: 16px; background: var(--surface-2); color: var(--text); border: 0; border-radius: 14px; padding: 12px; min-height: 140px; margin: 6px 0 14px; outline: 0; }
.sheet-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.sheet-actions .spacer { flex: 1; }

/* ================= SESLİ KİTAP ================= */
body.player { background: #0e1c22; color: #f1f5f9; min-height: 100dvh; overflow-x: hidden; }
.pl-bg { position: fixed; inset: -60px; background-size: cover; background-position: center; filter: blur(50px) saturate(1.2) brightness(.45); z-index: 0; }
.pl-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,28,34,.4), rgba(14,28,34,.95)); }
.pl { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(8px + var(--safe-t)) 22px calc(18px + var(--safe-b)); }
.pl-top { display: flex; align-items: center; }
.pl-top .ttl { flex: 1; text-align: center; font-weight: 700; font-size: 17px; }
.pl-art { margin: 22px auto 10px; width: min(72vw, 300px); aspect-ratio: 1; border-radius: 50%; padding: 10px; position: relative;
  background: conic-gradient(from 180deg, rgba(245,179,1,.0), rgba(245,179,1,.6), rgba(255,255,255,.05)); box-shadow: 0 30px 70px rgba(0,0,0,.5); }
.pl-art img, .pl-art .cv-ph { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; aspect-ratio: 1; display: flex; }
.pl-art .cv-ph { align-items: center; justify-content: center; text-align: center; padding: 18%; }
body.player.playing .pl-art img { animation: spinSlow 40s linear infinite; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.pl-info { text-align: center; margin-top: 18px; }
.pl-info h1 { font-size: 24px; font-weight: 800; }
.pl-info p { margin: 6px 0 0; color: rgba(241,245,249,.72); font-size: 14px; }
.pl-info .chap { margin-top: 8px; font-size: 13px; color: var(--gold); font-weight: 600; }
.wave { display: flex; align-items: center; gap: 2px; height: 56px; margin: 22px 0 4px; cursor: pointer; touch-action: none; }
.wave i { flex: 1; border-radius: 2px; background: rgba(255,255,255,.28); min-height: 3px; transition: background .2s; }
.wave i.on { background: #f5e6b8; }
.times { display: flex; justify-content: space-between; font-size: 12.5px; color: rgba(241,245,249,.72); font-variant-numeric: tabular-nums; }
.ctrls { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.ctrls .iconbtn { width: 52px; height: 52px; color: #fff; }
.ctrls .iconbtn .ic { width: 26px; height: 26px; }
.skip { position: relative; }
.skip small { position: absolute; font-size: 9px; font-weight: 800; top: 50%; left: 50%; transform: translate(-50%, -38%); }
.play { width: 78px !important; height: 78px !important; background: #fff !important; color: #0e1c22 !important; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.play .ic { width: 32px !important; height: 32px !important; }
.pl-row { display: flex; align-items: center; justify-content: space-around; margin-top: auto; padding-top: 18px; }
.pl-row button { background: none; border: 0; color: rgba(241,245,249,.85); font-weight: 700; font-size: 15px; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 10px; border-radius: 12px; }
.pl-row button.on { color: var(--gold); }
.tracklist { display: grid; }
.track { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.track .num { width: 28px; text-align: center; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.track .tt { flex: 1; min-width: 0; }
.track .tt b { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .tt span { font-size: 12px; color: var(--muted); }
.track.cur b, .track.cur .num { color: var(--primary); }
.opt-list { display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); }
.opt-list button { height: 48px; border-radius: 14px; border: 0; background: var(--surface-2); color: var(--text); font-weight: 700; cursor: pointer; }
.opt-list button.on { background: var(--primary); color: var(--on-primary); }
.mini-player { position: fixed; z-index: 36; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 10px); max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 8px; border-radius: 18px; background: #0e1c22; color: #fff; box-shadow: var(--shadow-lg); }
.mini-player img, .mini-player .cv { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; aspect-ratio: 1; }
@media (min-width: 1000px) { .mini-player { bottom: 20px; left: calc(var(--rail-w) + 20px); } }
.pdf-only, .epub-only { }
body.fmt-epub .pdf-only, body.fmt-pdf .epub-only { display: none !important; }

/* Dar ekranlarda hedef kartı taşmasın */
html, body { overflow-x: clip; }
.goal > div:not(.ring) { min-width: 0; flex: 1; }
.days { gap: 4px; flex-wrap: nowrap; }
.days span { width: auto; flex: 1 1 0; max-width: 32px; height: auto; aspect-ratio: 1; font-size: 10.5px; }
@media (max-width: 420px) { .goal { padding: 16px 14px; gap: 12px; } .ring { width: 64px; height: 64px; } .ring > span { width: 50px; height: 50px; font-size: 15px; } }

/* Detay: kapak beyaz panelin üstüne taşsın */
@media (max-width: 899px) {
  .dt-hero { min-height: 0; overflow: visible; background: #1d3a44; }
  .dt-hero .bgcv { inset: 0; }
  /* Telefonda Oku/Dinle düğmeleri kaydırmadan görünsün diye kapak ve kutular daha derli toplu */
  .dt-cover { width: 118px; margin: 6px auto -64px; }
  .dt-sheet { padding-top: 80px; }
  .dt-sheet h1 { font-size: 23px; line-height: 1.2; }
  .tiles { margin: 14px 0 0; gap: 8px; }
  .tile { padding: 8px 6px; }
  .tile b, .tile dd { font-size: 16px; }
}

/* Telefonda kalem paleti iki satır, kalem düğmesine çarpmaz */
@media (max-width: 600px) {
  .palette { left: 10px; right: 76px; max-width: none; transform: none; flex-wrap: wrap; justify-content: center; row-gap: 2px; overflow: visible; }
  .palette .sep { display: none; }
  .palette #btnUndo, .palette #btnRedo { order: 1; }
  .palette .swatches, .palette .wdots { order: 2; }
  .palette .swatches { margin-right: 8px; }
}

/* ===================== v2.1: erişilebilirlik ===================== */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 1000; background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 700; transition: top .15s; }
.skip-link:focus { top: calc(10px + var(--safe-t)); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.bk:focus-visible .cv, .bk:focus-visible img { outline: 3px solid var(--accent); outline-offset: 3px; }
.switch input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wave:focus-visible { outline: 3px solid #fff; outline-offset: 6px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
/* Büyük yazı: tüm arayüz rem/px karışık olduğu için kök ölçekleme kullanılır */
html.a11y-large body:not(.reader) { zoom: 1.18; }
@supports not (zoom: 1) { html.a11y-large body:not(.reader) { font-size: 118%; } }
/* Yüksek kontrast */
html.a11y-contrast { --muted: #2b2f36; --line: #6b7280; --surface-2: #e3e6ea; }
html.a11y-contrast .muted, html.a11y-contrast .bk .a, html.a11y-contrast .tabbar a { color: var(--text) !important; }
html.a11y-contrast .btn.outline, html.a11y-contrast .chip, html.a11y-contrast .card, html.a11y-contrast .panel, html.a11y-contrast .tile { box-shadow: inset 0 0 0 2px var(--text); }
html.a11y-contrast .searchbox, html.a11y-contrast .field input, html.a11y-contrast .field textarea { border: 2px solid var(--text); }
@media (prefers-color-scheme: dark) { html.a11y-contrast { --muted: #e5e7eb; --line: #9ca3af; --bg: #000; --surface: #0b0b0b; --surface-2: #1a1a1a; --text: #fff; } }
@media (prefers-contrast: more) { :root { --muted: #2b2f36; } }

/* Paylaşım */
.dt-shared { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.share-users { display: grid; margin: 4px 0 10px; border-top: 1px solid var(--line); }
.share-users .switch { border-bottom: 1px solid var(--line); }

/* ===================== Metin görünümü ===================== */
body.textview { --paper: #fbf6ea; --ink: #2b2a27; background: var(--paper); color: var(--ink); --tv-fs: 1; padding-bottom: calc(90px + var(--safe-b)); }
body.textview[data-rtheme=light] { --paper: #fff; --ink: #1f2937; }
body.textview[data-rtheme=dark] { --paper: #121212; --ink: #e2dfd9; --surface: #1f1f22; --surface-2: #2a2a2e; --line: #34343a; --text: #eee; --muted: #a8a8b0; color-scheme: dark; }
.tv-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; padding: calc(6px + var(--safe-t)) 8px 6px; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
.tv-bar .iconbtn { color: var(--ink); }
.tv-sel { flex: 1; min-width: 0; }
.tv-sel select { width: 100%; font: inherit; font-weight: 600; color: var(--ink); background: transparent; border: 0; padding: 10px 6px; text-overflow: ellipsis; }
.tv-main { max-width: 42em; margin: 0 auto; padding: 18px 20px 30px; }
.tv-article { font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif; font-size: calc(19px * var(--tv-fs)); line-height: 1.7; outline: none; overflow-wrap: break-word; }
body.tv-spacious .tv-article { line-height: 2.1; letter-spacing: .02em; word-spacing: .08em; }
.tv-article p { margin: 0 0 1em; }
.tv-article h1, .tv-article h2, .tv-article h3 { font-family: 'Inter', system-ui, sans-serif; line-height: 1.3; margin: 1.4em 0 .6em; }
.tv-article h1 { font-size: 1.5em; } .tv-article h2 { font-size: 1.25em; } .tv-article h3 { font-size: 1.1em; }
.tv-article img { max-width: 100%; height: auto; display: block; margin: 1em auto; border-radius: 6px; }
.tv-article a { color: var(--primary); text-decoration: underline; }
.tv-article blockquote { margin: 1em 0; padding-left: 1em; border-left: 3px solid color-mix(in srgb, var(--ink) 25%, transparent); }
.tv-article table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.tv-article td, .tv-article th { border: 1px solid var(--line); padding: 4px 8px; }
.tv-head .tv-book { margin: 0 0 4px !important; font-weight: 600; line-height: 1.4; font-family: 'Inter', system-ui, sans-serif; font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.tv-chapter { margin-top: .4em !important; }
.tv-page { font-size: .8em !important; color: var(--muted); font-weight: 600; margin: 2em 0 .8em !important; border-top: 1px solid var(--line); padding-top: 1em; }
.tv-article .speaking { background: color-mix(in srgb, #ffd54f 45%, transparent); border-radius: 4px; box-shadow: 0 0 0 4px color-mix(in srgb, #ffd54f 45%, transparent); }
body.textview[data-rtheme=dark] .tv-article .speaking { background: rgba(255, 213, 79, .18); box-shadow: 0 0 0 4px rgba(255, 213, 79, .18); }
.tv-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 30px; }
.tv-pager .btn { color: var(--ink); }
.tts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); z-index: 30; display: flex; align-items: center; gap: 4px;
  background: var(--text); color: var(--paper); padding: 6px 10px; border-radius: 999px; box-shadow: var(--shadow-lg); }
.tts .iconbtn { color: inherit; width: 46px; height: 46px; }
.tts .play { background: var(--hot-1); color: #fff; }
body.tts-on .tts .play { background: var(--primary); }
.tts select { font: inherit; font-weight: 700; font-size: 14px; color: inherit; background: transparent; border: 0; padding: 8px 4px; }
.tts select option { color: #111; }
.set-link { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); font-weight: 600; }
.set-link span { flex: 1; } .set-link small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.bk .badge-shared { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; }
.bk .badge-shared .ic { width: 15px; height: 15px; }
.track-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 0; }
.track-btn .tt b { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-btn .tt span { display: block; font-size: 12px; color: var(--muted); }

/* ===================== v2.2: Hafif mod (eski / yavaş cihazlar) ===================== */
/* html.lite: animasyon, bulanıklık, gölge ve büyük filtreler kapanır; düz renkler kullanılır */
html.lite *, html.lite *::before, html.lite *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
html.lite * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html.lite .bgcv, html.lite .pl-bg, html.lite .hero .bgcv { display: none !important; }
html.lite .card, html.lite .panel, html.lite .tile, html.lite .bk .cv, html.lite .bk img, html.lite .cv, html.lite .btn, html.lite .fab, html.lite .pen-fab,
html.lite .palette, html.lite .dt-cover .cv, html.lite .pl-art, html.lite .play, html.lite .tts, html.lite dialog.sheet, html.lite .pdf-viewer .page, html.lite .chip { box-shadow: none !important; }
html.lite .card, html.lite .panel, html.lite .tile { border: 1px solid var(--line); }
html.lite .tabbar { background: var(--surface); }
html.lite .dt-hero { background: #1d3a44; }
html.lite dialog.sheet::backdrop { background: rgba(8,10,20,.5); }
html.lite .shelf, html.lite .chips, html.lite .genres, html.lite .authors { scroll-snap-type: none; }
html.lite .pdf-viewer { background: var(--paper); }
html.lite .pdf-viewer .page { border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); }
html.lite .tv-bar { background: var(--paper); }
/* Uzun listelerde ekran dışındaki kartların çizimini ertele */
.grid .bk, .cont-card { content-visibility: auto; contain-intrinsic-size: auto 260px; }
.perf-row { flex-wrap: wrap; gap: 8px; }
.perf-row > span small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.perf-row .seg { min-width: 240px; }
.alert a { color: inherit; text-decoration: underline; font-weight: 700; }

/* Çizim konumları (Notlarım ve okuyucu kenar çubuğu) */
.ink-h { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 28px 0 6px; }
.ink-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.ink-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-align: center; }
.ink-card:hover, .ink-card:focus-visible { border-color: var(--primary); }
.ink-card span { display: flex; flex-direction: column; font-size: 13px; line-height: 1.25; }
.ink-card small { color: var(--muted); font-size: 12px; }
.ink-thumb { width: 70px; height: 96px; display: block; }
.ink-thumb.shape { width: 96px; height: 64px; }
.ink-thumb .pg { fill: #fff; stroke: var(--line); }
.spane .ink-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }

.dt-sticky { display: none; }
@media (max-width: 899px) {
  .dt-sticky { position: fixed; z-index: 39; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b)); padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--line);
    grid-template-columns: 1fr 1fr; gap: 10px; }
  .dt-sticky.show { display: grid; }
  .dt-sticky .btn { height: 46px; }
  .dt-sticky .btn:only-child { grid-column: 1 / -1; }
}

/* Kitap asistanı (v2.5) */
.ai-sheet .sheet-in { display: flex; flex-direction: column; gap: 12px; }
.ai-head { display: flex; align-items: center; justify-content: space-between; }
.ai-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.ai-log { display: flex; flex-direction: column; gap: 10px; }
.ai-log:empty { display: none; }
.ai-msg { border-radius: 14px; padding: 10px 14px; line-height: 1.55; font-size: 15px; }
.ai-msg.q { align-self: flex-end; background: var(--primary); color: #fff; max-width: 85%; font-weight: 600; }
.ai-msg.a { background: var(--card, rgba(127,127,127,.08)); border: 1px solid var(--line); }
.ai-msg.a:empty { display: none; }
.ai-msg h4 { font-size: 15px; font-weight: 800; margin: 10px 0 4px; }
.ai-msg h4:first-child { margin-top: 0; }
.ai-msg p { margin: 4px 0; }
.ai-msg ul { margin: 4px 0; padding-left: 20px; }
.ai-msg li { margin: 2px 0; }
.ai-tag { display: inline-block; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.25); border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.ai-err { color: #c2410c; font-weight: 600; }
.ai-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin: 0; }
.ai-status .spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; flex: none; }
.ai-form { position: sticky; bottom: calc(-20px - var(--safe-b)); background: var(--surface); padding: 8px 0 calc(20px + var(--safe-b)); margin-bottom: calc(-20px - var(--safe-b)); border-top: 1px solid var(--line); }
.ai-form textarea { width: 100%; resize: vertical; min-height: 56px; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: inherit; }
.ai-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.ai-spoil { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.ai-spoil small { flex-basis: 100%; color: var(--muted); font-weight: 400; font-size: 12px; }
.ai-msg { scroll-margin-top: 12px; }
