/* RewPad tasarım sistemi. Marka: elektrik moru #8038F4, fuşya #F02B9B, camgöbeği #00C5E8, gece #150B30.
   Metin içindeki renkler (--primary, --accent-ink, --cyan-ink) WCAG AA kontrastı için markanın koyu/açık tonlarıdır;
   saf marka renkleri düğme zeminleri, geçişler ve vurgularda kullanılır. */
:root {
  --purple: #8038F4; --purple-dark: #6421D6; --fuchsia: #F02B9B; --cyan: #00C5E8; --ink-dark: #150B30;
  --grad: linear-gradient(120deg, #8038F4 0%, #C21E7F 100%);
  --grad-brand: linear-gradient(110deg, #8038F4 0%, #F02B9B 60%, #00C5E8 100%);
  --bg: #FFFFFF; --surface: #F8F5FF; --card: #FFFFFF; --line: #E9E2F7; --ink: #150B30; --muted: #544B70;
  --primary: #6B21E8; --chip: #F1EBFE; --chip-ink: #4C1D95; --field: #FFFFFF;
  --accent-ink: #C21E7F; --cyan-ink: #0E7490;
  --danger: #B42318; --danger-bg: #FEF3F2; --ok: #067647; --ok-bg: #ECFDF3; --logo-bg: #150B30;
  --shadow: 0 1px 2px rgba(21, 11, 48, .04), 0 6px 20px rgba(21, 11, 48, .06);
  --shadow-hover: 0 2px 4px rgba(21, 11, 48, .06), 0 14px 32px rgba(128, 56, 244, .14);
  --hero-bg: radial-gradient(120% 140% at 0% 0%, #F3ECFF 0%, rgba(243, 236, 255, 0) 55%), radial-gradient(90% 120% at 100% 0%, #FFE8F4 0%, rgba(255, 232, 244, 0) 55%), radial-gradient(80% 100% at 60% 100%, #E3F9FD 0%, rgba(227, 249, 253, 0) 60%), #FFFFFF;
  --tint-p: #F3ECFF; --tint-f: #FFEAF5; --tint-c: #E3F8FC;
  --skeleton: linear-gradient(90deg, #F1EBFE 0%, #F8F5FF 50%, #F1EBFE 100%);
  --radius: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #150B30; --surface: #1C1140; --card: #211548; --line: #35286B; --ink: #F5F2FF; --muted: #C0B7DE;
  --primary: #B79CFF; --chip: #2A1D5C; --chip-ink: #EDE7FF; --field: #1A1039;
  --accent-ink: #FF6CC0; --cyan-ink: #5BE0F5;
  --danger: #FDA29B; --danger-bg: #3A1420; --ok: #75E0A7; --ok-bg: #0F2E22; --logo-bg: #241848;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 36px rgba(128, 56, 244, .28);
  --hero-bg: radial-gradient(120% 140% at 0% 0%, rgba(128, 56, 244, .32) 0%, rgba(128, 56, 244, 0) 55%), radial-gradient(90% 120% at 100% 0%, rgba(240, 43, 155, .22) 0%, rgba(240, 43, 155, 0) 55%), radial-gradient(80% 100% at 60% 100%, rgba(0, 197, 232, .14) 0%, rgba(0, 197, 232, 0) 60%), #1A0F3A;
  --tint-p: rgba(128, 56, 244, .18); --tint-f: rgba(240, 43, 155, .16); --tint-c: rgba(0, 197, 232, .14);
  --skeleton: linear-gradient(90deg, #2A1D5C 0%, #35286B 50%, #2A1D5C 100%);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #150B30; --surface: #1C1140; --card: #211548; --line: #35286B; --ink: #F5F2FF; --muted: #C0B7DE;
  --primary: #B79CFF; --chip: #2A1D5C; --chip-ink: #EDE7FF; --field: #1A1039;
  --accent-ink: #FF6CC0; --cyan-ink: #5BE0F5;
  --danger: #FDA29B; --danger-bg: #3A1420; --ok: #75E0A7; --ok-bg: #0F2E22; --logo-bg: #241848;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 36px rgba(128, 56, 244, .28);
  --hero-bg: radial-gradient(120% 140% at 0% 0%, rgba(128, 56, 244, .32) 0%, rgba(128, 56, 244, 0) 55%), radial-gradient(90% 120% at 100% 0%, rgba(240, 43, 155, .22) 0%, rgba(240, 43, 155, 0) 55%), radial-gradient(80% 100% at 60% 100%, rgba(0, 197, 232, .14) 0%, rgba(0, 197, 232, 0) 60%), #1A0F3A;
  --tint-p: rgba(128, 56, 244, .18); --tint-f: rgba(240, 43, 155, .16); --tint-c: rgba(0, 197, 232, .14);
  --skeleton: linear-gradient(90deg, #2A1D5C 0%, #35286B 50%, #2A1D5C 100%);
  color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); }
a:hover { color: var(--purple-dark); }
:root[data-theme="dark"] a:hover { color: #DDD6FE; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] a:hover { color: #DDD6FE; } }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Üst menü */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .in { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 22px; letter-spacing: -0.5px; }
.brand span { color: var(--primary); }
.brand svg rect.bg { fill: var(--logo-bg); }
.nav { display: flex; gap: 18px; font-weight: 600; font-size: 15px; }
.nav a { color: var(--ink); text-decoration: none; }
.spacer { flex: 1; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
.theme-icon-dark, .theme-icon-light { display: none; }
:root[data-theme="light"] .theme-icon-dark, :root[data-theme="system"] .theme-icon-dark { display: inline; }
:root[data-theme="dark"] .theme-icon-light { display: inline; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .theme-icon-dark { display: none; }
  :root[data-theme="system"] .theme-icon-light { display: inline; }
}
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--chip); color: var(--chip-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.avatar.lg { width: 96px; height: 96px; font-size: 36px; }

/* Düğmeler */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; border: 1.5px solid transparent; }
.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #150B30; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .btn-danger { color: #150B30; } }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; min-height: 44px; font: inherit; font-weight: 600; color: var(--primary); cursor: pointer; text-decoration: underline; }

/* Ana içerik */
main { flex: 1; width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 32px 20px 56px; }
.auth-wrap { max-width: 480px; margin: 0 auto; padding: 40px 20px 56px; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.card + .card { margin-top: 20px; }
.card.tint { background: var(--surface); }
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.5px; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0 0 12px; }
.lead { color: var(--muted); margin: 0 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-weight: 600; font-size: 14px; }
.input, textarea.input, select.input { width: 100%; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--field); color: var(--ink); font: inherit; }
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { border-color: var(--purple); outline: none; box-shadow: 0 0 0 3px rgba(128, 56, 244, .25); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.hint { font-size: 13px; color: var(--muted); }
.error { font-size: 14px; color: var(--danger); font-weight: 600; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--purple); flex-shrink: 0; }
.check label { font-size: 15px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.birth-date { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.birth-date legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; }
.date3 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.5fr) minmax(0, 1.2fr); gap: 8px; }
.date3 select { min-width: 0; padding-inline: 10px 4px; text-overflow: ellipsis; }
.honeypot { display: none !important; }
.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; font-weight: 600; font-size: 15px; }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.divider { text-align: center; color: var(--muted); font-size: 14px; margin: 20px 0 0; }
.legal-box { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 14px 16px; font-size: 14px; color: var(--muted); }
.legal-box strong { color: var(--ink); }

/* Hesap düzeni */
.account { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.account-nav { flex: 1 1 220px; max-width: 260px; display: flex; flex-direction: column; gap: 4px; }
.account-nav a { display: flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; }
.account-nav a[aria-current="page"] { background: var(--chip); color: var(--chip-ink); }
.account-body { flex: 999 1 560px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--chip-ink); background: var(--chip); padding: 5px 10px; border-radius: 999px; }
.bar { width: 36px; height: 5px; border-radius: 3px; margin-bottom: 12px; }
.bar.p { background: var(--purple); } .bar.f { background: var(--fuchsia); } .bar.c { background: var(--cyan); }
.empty { border: 1.5px dashed var(--line); border-radius: 14px; padding: 18px; color: var(--muted); font-size: 15px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-scroll { overflow-x: auto; }
.legal-text { font-family: var(--serif); font-size: 18px; line-height: 1.75; white-space: pre-line; }

.site-footer { border-top: 1px solid var(--line); }
.site-footer .in { max-width: 1200px; margin: 0 auto; padding: 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-footer a { color: var(--muted); text-decoration: none; display: inline-block; padding: 6px 0; }

/* Ana sayfa (Aşama 2 geçici) */
.hero { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; }
.hero h1 { font-size: clamp(44px, 7vw, 68px); line-height: 1; letter-spacing: -2px; }
.hero .y { color: var(--primary); } .hero .p { color: var(--fuchsia); }

@media (max-width: 640px) {
  .nav { display: none; }
  .row2, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 20px; }
  .account-nav { max-width: none; flex-direction: row; overflow-x: auto; flex-basis: 100%; }
  .account-nav a { white-space: nowrap; }
  h1 { font-size: 26px; }
}
.grid2 > .card + .card { margin-top: 0; }

/* ===== Aşama 3: eserler, yazar paneli, okuma ekranı ===== */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.alert-warn { background: #FFF7E6; color: #7A4A00; }
:root[data-theme="dark"] .alert-warn { background: #33240A; color: #FFD58A; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .alert-warn { background: #33240A; color: #FFD58A; } }

.sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.icon-btn.sm { width: 36px; height: 36px; min-height: 36px; padding: 0; font-weight: 700; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.continue { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); margin-bottom: 8px; }
.continue:hover { border-color: var(--purple); color: var(--ink); }

.cover { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.cover-empty { display: flex; flex-direction: column; justify-content: space-between; padding: 14px; background: var(--chip); color: var(--chip-ink); font-family: var(--serif); font-weight: 700; font-size: 18px; line-height: 1.2; overflow: hidden; word-break: break-word; }
.cover-empty small { font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: .5px; text-transform: uppercase; opacity: .8; }
.cover-sm { width: 96px; flex-shrink: 0; }
.cover-sm.cover-empty { font-size: 13px; padding: 8px; }
.cover-lg { width: 260px; flex-shrink: 0; }

.writer-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.story-row { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.story-row:last-child { border-bottom: 0; }
.story-row-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.story-title { font-family: var(--serif); font-size: 19px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.story-edit { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }

.chapter-list .num, .toc .num { width: 32px; height: 32px; border-radius: 50%; background: var(--chip); color: var(--chip-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }

.row-actions { display: flex; gap: 6px; align-items: center; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-check span { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: 999px; background: var(--chip); color: var(--chip-ink); font-weight: 600; font-size: 14px; cursor: pointer; border: 1.5px solid transparent; }
.chip-check input:checked + span { background: var(--purple); color: #fff; }
.chip-check input:focus-visible + span { outline: 3px solid var(--cyan); outline-offset: 2px; }

.story-head { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.story-head-body { flex: 1 1 360px; min-width: 0; }
.story-h1 { font-family: var(--serif); font-size: clamp(32px, 5vw, 48px); line-height: 1.1; margin: 12px 0 8px; }
.story-summary { font-family: var(--serif); font-size: 18px; line-height: 1.7; white-space: pre-line; margin: 0; max-width: 680px; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.toc a { display: flex; align-items: center; gap: 12px; min-height: 52px; color: var(--ink); text-decoration: none; font-weight: 600; flex: 1 1 260px; }

/* Editör */

/* Okuma ekranı: göz yormayan, menüsüz, tek sütun */
body.reader { --r-bg: #FFFFFF; --r-ink: #1F1A2E; --r-muted: #5A5468; --r-line: #E9E5F2; --r-accent: #6B21E8; background: var(--r-bg); color: var(--r-ink); }
:root[data-reader-theme="sepia"] body.reader { --r-bg: #F4ECDD; --r-ink: #3B2F22; --r-muted: #6E5D49; --r-line: #E2D5BE; --r-accent: #8A4B12; }
:root[data-reader-theme="night"] body.reader { --r-bg: #150B30; --r-ink: #E8E3F5; --r-muted: #ACA4C8; --r-line: #2F2458; --r-accent: #C4B5FD; color-scheme: dark; }
body.reader a { color: var(--r-accent); }
/* Okuma temasındaki yorum, ipucu ve ikincil metinler de temanın renklerini kullanır (gece/sepya kontrastı). */
body.reader .muted, body.reader .hint, body.reader summary, body.reader .small.muted { color: var(--r-muted); }
:root[data-reader-theme="night"] body.reader { --ink: #E8E3F5; --muted: #ACA4C8; --line: #2F2458; --bg: #150B30; --surface: #1A1137; --field: #1A1137; --chip: #2B1B5E; --chip-ink: #E9E3FF; }
:root[data-reader-theme="sepia"] body.reader { --muted: #6E5D49; --line: #E2D5BE; --bg: #F4ECDD; --surface: #EFE4D0; --field: #FBF6EC; }
/* "auto": okur tema seçmemiş ve site teması "sistem" → cihazın gece moduna uyulur. */
@media (prefers-color-scheme: dark) {
  :root[data-reader-theme="auto"] body.reader { --r-bg: #150B30; --r-ink: #E8E3F5; --r-muted: #ACA4C8; --r-line: #2F2458; --r-accent: #C4B5FD; color-scheme: dark;
    --ink: #E8E3F5; --muted: #ACA4C8; --line: #2F2458; --bg: #150B30; --surface: #1A1137; --field: #1A1137; --chip: #2B1B5E; --chip-ink: #E9E3FF; }
}
body.reader .btn-outline { color: var(--r-ink); border-color: var(--r-line); }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 20; }
.progress div { height: 100%; width: 0; background: var(--purple); }
.reader-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; background: var(--r-bg); border-bottom: 1px solid var(--r-line); }
.reader-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; text-decoration: none; color: var(--r-ink) !important; font-weight: 600; min-width: 0; }
.reader-back-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.reader-btn { min-width: 44px; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--r-line); background: transparent; color: var(--r-ink); font: inherit; font-weight: 700; cursor: pointer; }
.settings-panel { position: sticky; top: 61px; z-index: 9; background: var(--r-bg); border-bottom: 1px solid var(--r-line); padding: 14px 16px; }
.settings-panel form { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.set-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border: 0; padding: 0; margin: 0; }
.set-label { font-weight: 700; font-size: 14px; float: left; float: inline-start; }
.set-controls { display: flex; align-items: center; gap: 8px; }
.set-controls input[type=range] { width: 120px; accent-color: var(--purple); }
.set-out { font-size: 13px; color: var(--r-muted); width: 32px; }
.seg { display: flex; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 10px; border: 1.5px solid var(--r-line); font-weight: 600; font-size: 14px; cursor: pointer; }
.seg input:checked + span { border-color: var(--purple); box-shadow: inset 0 0 0 1px var(--purple); }
.seg input:focus-visible + span { outline: 3px solid var(--cyan); outline-offset: 2px; }
.themes .t-day span { background: #FFFFFF; color: #1F1A2E; }
.themes .t-sepia span { background: #F4ECDD; color: #3B2F22; }
.themes .t-night span { background: #150B30; color: #E8E3F5; }
.reader-main { max-width: 680px; margin: 0 auto; padding: 40px 20px 64px; }
.reader-kicker { color: var(--r-muted); font-size: 14px; margin: 0 0 8px; }
.reader-title { font-family: var(--serif); font-size: clamp(28px, 5vw, 40px); line-height: 1.15; margin: 0 0 6px; }
.reader-author { color: var(--r-muted); margin: 0 0 32px; }
.reader-note { background: #FFF7E6; color: #7A4A00; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.reader-text { font-family: var(--serif); font-size: var(--r-size, 20px); line-height: var(--r-leading, 1.75); overflow-wrap: break-word; hyphens: auto; }
.reader-text p { margin: 0 0 1.1em; }
.reader-text h2, .reader-text h3 { font-family: var(--sans); margin: 1.6em 0 .6em; }
.reader-text blockquote { margin: 1.2em 0; padding-inline-start: 1em; border-inline-start: 3px solid var(--r-line, var(--line)); font-style: italic; }
.reader-text hr { border: 0; text-align: center; margin: 2em 0; }
.reader-text hr::after { content: "✻ ✻ ✻"; color: var(--r-muted, var(--muted)); letter-spacing: .6em; }
:root[data-size="1"] .reader-text { --r-size: 16px; }
:root[data-size="2"] .reader-text { --r-size: 18px; }
:root[data-size="3"] .reader-text { --r-size: 20px; }
:root[data-size="4"] .reader-text { --r-size: 23px; }
:root[data-size="5"] .reader-text { --r-size: 26px; }
:root[data-leading="1"] .reader-text { --r-leading: 1.5; }
:root[data-leading="2"] .reader-text { --r-leading: 1.75; }
:root[data-leading="3"] .reader-text { --r-leading: 2.05; }
.reader-nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--r-line); }
.reader-end { color: var(--r-muted); font-style: italic; }
.reader-foot { margin-top: 32px; font-size: 13px; color: var(--r-muted); }

@media (max-width: 640px) {
  .cover-lg { width: 180px; }
  .story-head { gap: 20px; }
  .reader-main { padding-top: 24px; }
  .settings-panel { top: 61px; }
}

/* ===== Aşama 4: sosyal, keşfet, kütüphane, bildirimler ===== */
.nav a[aria-current="page"] { color: var(--primary); }
.bell { position: relative; text-decoration: none; }
.bell-count { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #D01A82; color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: 999px; background: var(--chip); color: var(--chip-ink); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.genre-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 20px; }
.hero-search { display: flex; gap: 8px; max-width: 520px; }
.hero-search .input { flex: 1; }
.featured { flex: 1 1 480px; min-width: 0; display: flex; gap: 22px; align-items: center; }
.cover-feat { width: 200px; flex-shrink: 0; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 14px; }
.section-head h2 { margin: 0; }
.home > section, .home > .panels { margin-top: 32px; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); min-width: 0; }
.tile-title { font-family: var(--serif); font-weight: 700; font-size: 16px; line-height: 1.25; }
.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.panels .card + .card { margin-top: 0; }
.chapter-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.chapter-row:last-child { border-bottom: 0; }
.cover-xs { width: 44px; flex-shrink: 0; border-radius: 6px; }
.cover-xs.cover-empty { font-size: 0; padding: 0; }
.cover-xs.cover-empty * { display: none; }
.authors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.author-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); text-align: center; }
.empty-state { border: 1.5px dashed var(--line); border-radius: 14px; padding: 16px; }
.ghosts { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ghost { aspect-ratio: 2 / 3; border: 1.5px dashed var(--line); border-radius: 10px; background: var(--surface); }
.ghost-avatar { aspect-ratio: 1; border-radius: 50%; max-width: 72px; }
.ghost-row { aspect-ratio: auto; height: 44px; grid-column: 1 / -1; }
.empty-title { font-weight: 700; margin: 0 0 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 20px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; color: var(--muted); font-weight: 700; text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--purple); }
.tabs .count { font-size: 12px; background: var(--chip); color: var(--chip-ink); padding: 2px 8px; border-radius: 999px; }
.library-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.library-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.library-actions form { display: flex; gap: 6px; align-items: center; }
.input.sm { min-height: 36px; padding: 4px 10px; width: auto; }
.meter { height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; max-width: 360px; }
.meter span { display: block; height: 100%; background: var(--purple); }
.social-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.social-bar form, .lib-form { display: inline-flex; gap: 6px; align-items: center; }
/* Kitaplık ve okuma listesi formları: dar ekranda ya da uzun çeviride (de, fr, ar) taşmak yerine alt satıra geçer; düğme metni tek satır (H11). */
.lib-form { flex-wrap: wrap; max-width: 100%; min-width: 0; }
.lib-form .btn { flex: 0 0 auto; white-space: nowrap; }
.lib-form[data-list-add] select.input, .lib-form[data-list-new] .input { flex: 1 1 8rem; width: auto; min-width: 7rem; max-width: 11rem; text-overflow: ellipsis; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.report { margin-top: 10px; font-size: 14px; }
.report summary { cursor: pointer; color: var(--muted); display: inline-flex; min-height: 32px; align-items: center; }
.report form { margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-width: 420px; }
.report-reasons { border: 0; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 4px; }
.comments h2 { margin-bottom: 14px; }
.comment-form { margin-bottom: 20px; }
.comment { padding: 14px 0; border-top: 1px solid var(--line); }
.comment.reply { margin-inline-start: 28px; padding-bottom: 6px; border-top: 0; border-inline-start: 2px solid var(--line); padding-inline-start: 14px; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.comment-head a { color: inherit; text-decoration: none; }
.comment-body { margin: 8px 0; white-space: pre-line; overflow-wrap: anywhere; }
.comment-gone { font-style: italic; margin: 0; }
.comment-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: flex-start; font-size: 14px; }
.inline-form summary { cursor: pointer; color: var(--primary); font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.inline-form form { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; min-width: min(420px, 80vw); }
.note { display: flex; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.note:last-child { border-bottom: 0; }
.note-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: transparent; }
.note.unread .note-dot { background: var(--fuchsia); }
.note.unread { font-weight: 500; }

.reader-social { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 40px; color: var(--r-muted); }
.reader-comments { margin-top: 40px; }
.reader .input { background: transparent; color: var(--r-ink); border-color: var(--r-line); }
.reader .comment, .reader .comment.reply { border-color: var(--r-line); }
.reader .report form { background: transparent; border-color: var(--r-line); }

/* Mobil alt sekmeler */
.tabbar { display: none; }
@media (max-width: 640px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bg); border-top: 1px solid var(--line); padding: 4px 2px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--primary); font-weight: 800; }
  .tabbar svg { width: 24px; height: 24px; }
  body { padding-bottom: 68px; }
  .hide-sm { display: none !important; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles.four, .authors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panels { grid-template-columns: minmax(0, 1fr); }
  .featured { flex-direction: column; align-items: flex-start; }
  .cover-feat { width: 150px; }
  .comment.reply { margin-inline-start: 12px; }
}
body.reader a.btn-primary, body.reader .btn-primary { color: #FFFFFF; }
.library-cover, .tile, .story-row { text-decoration: none; }

/* ---- Aşama 5: denetim ve yönetim ---- */
.badge-warn { background: color-mix(in srgb, #F59E0B 18%, transparent); color: #92400E; }
.badge-danger { background: color-mix(in srgb, #EF4444 15%, transparent); color: #B91C1C; }
[data-theme="dark"] .badge-warn { color: #FCD34D; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .badge-warn { color: #FCD34D; } }
[data-theme="dark"] .badge-danger { color: #FCA5A5; }
.badge-danger a { color: inherit; text-decoration: underline; }
.mod-item { border-top: 1px solid var(--line); padding: 14px 0; }
.mod-item:first-of-type { border-top: 0; }
.mod-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mod-banner { border: 1px solid var(--line); border-inline-start: 4px solid #F59E0B; border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; background: var(--card); }
.mod-banner.danger { border-inline-start-color: #EF4444; }
.mod-banner p { margin: 4px 0; }
.admin h1 { font-size: 26px; margin: 0 0 12px; }
.admin h2 { font-size: 18px; margin: 0 0 10px; }

.stat { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; color: var(--ink); text-decoration: none; background: var(--bg); }
.stat b { font-size: 26px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
a.stat:hover { border-color: var(--violet, #8038F4); }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.tabs a { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600; }
.tabs a[aria-current="page"] { background: var(--chip); color: var(--chip-ink); border-color: transparent; }

.decision { display: flex; flex-direction: column; gap: 8px; }
.decision .btn { align-self: flex-start; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.nowrap { white-space: nowrap; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }

.cover-preview { border-radius: 10px; border: 1px solid var(--line); }
.alert-error { border: 1px solid #EF4444; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; color: #B91C1C; }
.lang-form { display: flex; align-items: center; gap: 6px; }
.lang-form .input.sm { min-height: 36px; padding: 4px 10px; width: auto; }
.cookie-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; box-shadow: 0 -4px 16px rgba(21, 11, 48, .08); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--line); font-size: 14px; }
.cookie-bar p { margin: 0; flex: 1 1 260px; }
.cookie-bar form { display: flex; gap: 8px; }
.cookie-bar form .btn { white-space: nowrap; }
@media (max-width: 640px) { .cookie-bar { bottom: calc(64px + env(safe-area-inset-bottom)); padding: 10px 14px; font-size: 13px; } }

/* ---- Güvenli hazır kapak şablonları (yalnızca CSS; görsel dosya yok) ---- */
.cover-tpl { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 16px 14px; overflow: hidden; aspect-ratio: 2 / 3; border-radius: 10px; color: #fff; isolation: isolate; word-break: break-word; }
.cover-tpl .tpl-title { position: relative; z-index: 1; font-family: var(--serif); font-weight: 800; font-size: 20px; line-height: 1.15; }
.cover-tpl .tpl-author { position: relative; z-index: 1; font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: .4px; opacity: .85; }
.cover-tpl .tpl-mark { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.tpl-gece { background: radial-gradient(circle at 75% 20%, #2B1B5E 0, #150B30 60%); }
.tpl-gece .tpl-mark { background-image: radial-gradient(#00C5E8 1px, transparent 1.5px), radial-gradient(#F02B9B 1px, transparent 1.5px); background-size: 38px 38px, 57px 57px; background-position: 0 0, 19px 27px; opacity: .55; }
.tpl-elektrik { background: linear-gradient(160deg, #8038F4 0%, #4C1D95 55%, #150B30 100%); }
.tpl-elektrik .tpl-mark { background: linear-gradient(115deg, transparent 46%, #00C5E8 46.5%, #00C5E8 48%, transparent 48.5%), linear-gradient(115deg, transparent 58%, rgba(240,43,155,.8) 58.5%, rgba(240,43,155,.8) 59.5%, transparent 60%); }
.tpl-fusya { background: linear-gradient(180deg, #F02B9B 0%, #9D174D 100%); }
.tpl-fusya .tpl-mark { background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.22) 0 22%, transparent 22.5%), radial-gradient(circle at 50% 35%, transparent 0 30%, rgba(255,255,255,.15) 30.5% 31.5%, transparent 32%); }
.tpl-camgobegi { background: linear-gradient(200deg, #00C5E8 0%, #0E7490 70%, #150B30 100%); }
.tpl-camgobegi .tpl-mark { background: repeating-linear-gradient(0deg, transparent 0 22px, rgba(255,255,255,.12) 22px 23px); }
.tpl-sayfa { background: #FBF7EF; color: #150B30; border: 1px solid #E6E0F4; }
.tpl-sayfa .tpl-mark { background: linear-gradient(90deg, transparent 12%, #8038F4 12% 13.5%, transparent 13.5%), linear-gradient(0deg, transparent 0 18%, transparent 18%); }
.tpl-sayfa .tpl-title { color: #150B30; }
.tpl-cizgi { background: #150B30; }
.tpl-cizgi .tpl-mark { background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(128,56,244,.55) 14px 16px, transparent 16px 30px, rgba(0,197,232,.35) 30px 31px); }
.cover-sm.cover-tpl .tpl-title { font-size: 12px; } .cover-sm.cover-tpl { padding: 8px; } .cover-sm.cover-tpl .tpl-author { display: none; }
.cover-xs.cover-tpl * { display: none; }

.legal-inline { margin: 8px 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.legal-inline summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.legal-scroll { max-height: 260px; overflow: auto; margin-top: 8px; font-size: 14px; }
.policy-summary ul { margin: 6px 0 0; padding-inline-start: 18px; }
.policy-summary li { margin: 4px 0; }

/* ---- RTL (Arapça arayüz) ve karışık yönlü metin ----
   Arayüz yönü <html dir> ile, KULLANICI İÇERİĞİNİN yönü içeriğin kendisinden belirlenir:
   Arapça arayüzde Türkçe eser soldan sağa, Türkçe arayüzde Arapça eser sağdan sola okunur. */
.comment-body, .story-title, .reader-title, .clamp, .tile-title, .note, .cover-empty span, .tpl-title, .legal-text, .admin-preview { unicode-bidi: plaintext; }
.reader-text[dir="rtl"], .reader-text[dir="rtl"] p { text-align: right; }
[dir="rtl"] .brand { flex-direction: row; }
[dir="rtl"] .reader-back svg, [dir="rtl"] .chev { transform: scaleX(-1); }
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"], [dir="rtl"] input[name="username"], [dir="rtl"] input[type="password"] { direction: ltr; text-align: right; }
[dir="rtl"] .num, [dir="rtl"] .stat b { unicode-bidi: isolate; }
bdi { unicode-bidi: isolate; }

/* ---- Mobil editör: klavye açıkken araç çubuğu klavyenin üstünde, alt sekme çubuğu gizli ---- */
@media (max-width: 640px) {
  
  
  
  
  
  
  
  
  
  
  body.writing .tabbar { display: none; }
  body.writing main { padding-bottom: 0; }
}

/* ---- Dokunmatik ekranlar: tüm dokunma hedefleri en az 44 × 44 px (WCAG 2.5.5 / Apple HIG / Material) ---- */
@media (pointer: coarse), (max-width: 640px) {
  .btn, .btn.sm, .chip, .icon-btn, .icon-btn.sm, .tabs a, .account-nav a, .btn-link, summary, .lang-form .input.sm, select.input, .input.sm { min-height: 44px; }
  .icon-btn, .icon-btn.sm { min-width: 44px; width: 44px; height: 44px; }
  .report summary { min-height: 44px; }
  .btn.sm, .chip { display: inline-flex; align-items: center; }
  .btn-link { display: inline-flex; align-items: center; padding: 0 6px; }
  .chip-check span { min-height: 44px; display: inline-flex; align-items: center; }
  .segmented label, .report-reasons label, fieldset label { min-height: 44px; display: flex; align-items: center; gap: 8px; }
  .check { min-height: 44px; }
}
.brand-logo { height: 40px; width: 40px; display: block; border-radius: 10px; flex-shrink: 0; }
@media (max-width: 640px) { .brand-logo { height: 36px; width: 36px; } }
/* Tam logo kendi açık zemininde gelir: gündüz ve gece aynı görünsün diye yuvarlatılmış "plaka" içinde gösterilir. */
.brand-plate { display: flex; justify-content: center; margin: 0 auto 20px; }
.brand-plate .brand-full { width: 200px; height: auto; border-radius: 22px; background: #FDFDFD; box-shadow: 0 1px 0 var(--line), 0 8px 28px rgba(128, 56, 244, .14); }
@media (max-width: 640px) { .brand-plate .brand-full { width: 156px; border-radius: 18px; } .brand-plate { margin-bottom: 14px; } }
/* Menüdeki yazı, onaylı logodaki "RewPad" yazısının renkleriyle: Rew koyu, Pad mor→fuşya. */
.brand b { font-weight: 800; }
.brand b span { background: linear-gradient(90deg, var(--purple), var(--fuchsia)); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="dark"] .brand b span { background-image: linear-gradient(90deg, #A78BFA, #F472B6); }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .brand b span { background-image: linear-gradient(90deg, #A78BFA, #F472B6); } }
@media (max-width: 640px) {
  .cookie-bar { gap: 6px; padding-top: 8px; padding-bottom: 8px; font-size: 13px; }
  .cookie-bar p { flex-basis: 100%; line-height: 1.35; }
  .cookie-bar form { width: 100%; }
  .cookie-bar form .btn { flex: 1 1 0; }
}

/* Yönetim tabloları telefonda: sütunlar ezilmesin, tablo yatay kaydırılsın (sayfa taşmaz). */
@media (max-width: 640px) {
  /* Aşama 8: kaydırma tablonun kendisinde değil, klavyeyle odaklanabilen .table-scroll bölgesinde (axe: scrollable-region-focusable) */
  .admin table.list td, .admin table.list th { min-width: 96px; }
}
@media (forced-colors: active) { .brand b span { color: LinkText; background: none; } }

.footer-brand { display: inline-flex; align-items: center; gap: 8px; }
.footer-brand .brand-logo { width: 28px; height: 28px; border-radius: 7px; }
/* Kapaklar gece zemininde kaybolmasın: ince kenar + hafif gölge (gerçek kapak görselleri ve şablonlar). */
.cover-tpl { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 6px 18px rgba(21, 11, 48, .18); }
:root[data-theme="dark"] .cover, :root[data-theme="dark"] .cover-tpl { box-shadow: inset 0 0 0 1px rgba(196, 181, 253, .22), 0 8px 22px rgba(0, 0, 0, .45); }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .cover, :root[data-theme="system"] .cover-tpl { box-shadow: inset 0 0 0 1px rgba(196, 181, 253, .22), 0 8px 22px rgba(0, 0, 0, .45); } }

/* =====================================================================
   Tasarım 2.0 (25 Ekim 2026) — modern, canlı, mobil öncelikli.
   Yalnızca görünüm: işlevler, adresler ve form alanları aynı kaldı.
   Renkler tokenlardan gelir; gündüz/gece için ayrı kural yazılmaz.
   ===================================================================== */

/* ---- Temel yüzeyler ---- */
body { background: var(--bg); -webkit-font-smoothing: antialiased; }
.site-header { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(140%) blur(8px); }
.nav a { padding: 8px 12px; border-radius: 999px; transition: background-color .18s var(--ease), color .18s var(--ease); }
.nav a:hover { background: var(--chip); color: var(--chip-ink); }
.nav a[aria-current="page"] { background: var(--tint-p); color: var(--primary); }
.card { background: var(--card); border-color: var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.card.tint { background: var(--surface); box-shadow: none; }
h1, h2, h3 { color: var(--ink); }
.wrap { padding-top: 24px; }

/* ---- Düğmeler: hafif geçişler ---- */
.btn { transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease), filter .18s var(--ease); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--purple); box-shadow: 0 4px 14px rgba(128, 56, 244, .28); }
.btn-primary:hover { background: var(--purple-dark); box-shadow: 0 6px 18px rgba(128, 56, 244, .36); }
.btn-grad { background: var(--grad); }
.btn-grad:hover { background: var(--grad); filter: brightness(1.07) saturate(1.05); transform: translateY(-1px); }
.btn-outline { background: var(--card); }
.btn-outline:hover { border-color: var(--purple); color: var(--primary); }
.btn-lg { min-height: 52px; padding: 13px 26px; font-size: 16px; }
.icon-btn { background: var(--card); transition: border-color .18s var(--ease), background-color .18s var(--ease); }
.icon-btn:hover { border-color: var(--purple); }
.input { transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.input:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(128, 56, 244, .18); }

/* ---- Etiketler ---- */
.badge { letter-spacing: .4px; }
.badge-f { background: var(--tint-f); color: var(--accent-ink); }

.status-published { background: var(--ok-bg); color: var(--ok); }
.status-draft { background: var(--chip); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.status-scheduled { background: var(--tint-c); color: var(--cyan-ink); }
.status-hidden { background: color-mix(in srgb, #F59E0B 18%, transparent); color: #B45309; }
:root[data-theme="dark"] .status-hidden { color: #FCD34D; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .status-hidden { color: #FCD34D; } }
.chip { transition: background-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease); }
.chip:hover { box-shadow: inset 0 0 0 1.5px currentColor; }
.chip-p { background: var(--tint-p); color: var(--primary); }
.chip-f { background: var(--tint-f); color: var(--accent-ink); }
.chip-c { background: var(--tint-c); color: var(--cyan-ink); }
.genre-strip { scrollbar-width: none; margin-bottom: 16px; }
.genre-strip::-webkit-scrollbar { display: none; }

/* ---- Ana sayfa: kahraman alanı ---- */
.hero-band { position: relative; background: var(--hero-bg); border: 1px solid var(--line); border-radius: 28px; padding: 40px; gap: 32px; overflow: hidden; }
.hero-copy { flex: 1 1 420px; min-width: 0; }
.hero h1 { font-size: clamp(46px, 7.4vw, 76px); letter-spacing: -2.5px; margin-bottom: 14px; }
.hero .y { color: var(--primary); }
.hero .p { background: linear-gradient(95deg, var(--fuchsia) 0%, var(--purple) 70%, var(--cyan) 130%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-inline-end: .06em; }
.hero-lead { font-size: 18px; max-width: 520px; color: var(--muted); }
.hero-search { max-width: 540px; }
.hero-search .input { min-height: 52px; border-radius: 999px; padding-inline: 20px; background: var(--card); box-shadow: var(--shadow); }
.hero-search .btn { min-height: 52px; padding-inline: 24px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.featured { flex: 1 1 440px; min-width: 0; display: flex; gap: 24px; align-items: center; padding: 22px; border-radius: 22px; background: color-mix(in srgb, var(--card) 82%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(6px); }
.featured-cover { flex-shrink: 0; display: block; transition: transform .25s var(--ease); }
.featured-cover:hover { transform: translateY(-3px) rotate(-.6deg); }
.cover-feat { width: 200px; box-shadow: var(--shadow-hover); }
.featured-body { min-width: 0; }
.featured-title { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; margin: 10px 0 4px; }
.featured-author { margin: 0 0 6px; font-weight: 600; }
.featured-empty { display: block; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .hero .y { color: var(--primary); } }

/* ---- Bölüm başlıkları ve renkli ayrıştırma ---- */
.home > section, .home > .panels { margin-top: 36px; }
.section-head h2 { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; letter-spacing: -.3px; }
.section-head h2::before { content: ""; width: 6px; height: 22px; border-radius: 3px; background: var(--purple); flex-shrink: 0; }
.accent-p .section-head h2::before { background: linear-gradient(180deg, var(--purple), #B07CFF); }
.accent-f .section-head h2::before { background: linear-gradient(180deg, var(--fuchsia), #FF8BCB); }
.accent-c .section-head h2::before { background: linear-gradient(180deg, var(--cyan), #7FE7F7); }
.accent-ok .section-head h2::before { background: linear-gradient(180deg, #12B76A, #6CE9A6); }
.section-head > a { font-weight: 700; text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--chip); color: var(--chip-ink); }
.section-head > a:hover { background: var(--tint-p); color: var(--primary); }
.panels { grid-auto-flow: dense; gap: 22px; }
.panels .panel.accent-f, .panels .panel.accent-ok { grid-column: 1 / -1; }
.panels .panel.accent-f .tiles.four, .panels .panel.accent-ok .tiles.four { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }

/* ---- Eser kartları (kapak + ad + yazar + tür + durum) ---- */
.tiles { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px 18px; }
.tile { gap: 4px; }
.tile-cover { display: block; border-radius: 12px; transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
.tile-cover .cover { border-radius: 12px; box-shadow: var(--shadow); }
.tile:hover .tile-cover { transform: translateY(-4px); }
.tile:hover .tile-cover .cover { box-shadow: var(--shadow-hover); }
.tile:focus-visible { outline: none; }
.tile:focus-visible .tile-cover { outline: 3px solid var(--cyan); outline-offset: 3px; }
.tile-title { margin-top: 8px; font-size: 16px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tile-author { color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; color: var(--muted); font-size: 12.5px; }
.tile-genre { color: var(--primary); font-weight: 700; }
.tile-status { display: inline-flex; align-items: center; gap: 5px; }
.tile-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--fuchsia); }
.tile-status.is-done::before { background: #12B76A; }
.chapter-row { border-radius: 12px; padding: 10px 8px; margin: 0 -8px; transition: background-color .15s var(--ease); }
.chapter-row:hover { background: var(--surface); }
.author-card { background: var(--surface); border-color: transparent; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.author-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.empty-state { background: var(--surface); border-color: var(--line); }

/* ---- Kapak iskeleti: görsel gelene kadar yumuşak ışıltı ---- */
img.cover { background: var(--skeleton); background-size: 200% 100%; }
img.cover:not(.is-loaded) { animation: rp-shimmer 1.3s linear infinite; }
@keyframes rp-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---- Keşfet ---- */
.discover-form { display: flex; flex-direction: column; gap: 14px; margin: 8px 0 6px; }
.search-box { position: relative; display: flex; gap: 10px; align-items: center; max-width: 760px; }
.search-box .input-lg { flex: 1; min-height: 56px; border-radius: 999px; padding-inline: 50px 20px; font-size: 17px; background: var(--card); box-shadow: var(--shadow); }
.search-box .search-icon { position: absolute; inset-inline-start: 18px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box .btn { min-height: 56px; padding-inline: 26px; }
.filter-panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.filter-panel > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 20px; font-weight: 700; cursor: pointer; color: var(--ink); }
.filter-panel > summary::-webkit-details-marker { display: none; }
.filter-panel > summary svg { width: 20px; height: 20px; color: var(--primary); }
.filter-panel > summary::after { content: ""; margin-inline-start: auto; width: 9px; height: 9px; border-inline-end: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s var(--ease); }
.filter-panel[open] > summary::after { transform: rotate(-135deg); }
.filter-panel .count { font-size: 12px; background: var(--purple); color: #fff; padding: 2px 9px; border-radius: 999px; }
.filter-panel .filters { padding: 4px 20px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; align-items: end; }
.filter-panel .filters .field:has(> #sort) { grid-column: span 2; }   /* "Son güncellenen" dar sütuna sığmaz */
.filter-actions { display: flex; gap: 8px; align-items: flex-end; }
.results { padding-top: 8px; padding-bottom: 8px; }
.results .cover-sm, .profile-works .cover-sm { width: 112px; }
.story-row { border-radius: 12px; transition: background-color .15s var(--ease); }
.story-row:hover { background: var(--surface); }
.story-row .cover { box-shadow: var(--shadow); }

/* ---- Roman detay ---- */
.story-hero { background: var(--hero-bg); border: 1px solid var(--line); border-radius: 28px; padding: 32px; gap: 36px; }
.story-hero-cover { flex-shrink: 0; }
.story-hero .cover-lg { width: 280px; border-radius: 14px; box-shadow: var(--shadow-hover); }
.story-h1 { letter-spacing: -.5px; margin: 14px 0 10px; }
.story-author { margin: 0 0 14px; }
.story-author a { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; color: var(--ink); padding: 4px 14px 4px 4px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); }
.story-author a:hover { color: var(--primary); }
[dir="rtl"] .story-author a { padding: 4px 4px 4px 14px; }
.facts-row { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts-row li { font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--card); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.facts-row li.is-genre { background: var(--tint-p); color: var(--primary); box-shadow: none; }
.story-summary { color: var(--ink); }
.story-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.story-ctas .btn-lg { min-width: 220px; }
.social-bar { padding-top: 16px; border-top: 1px solid var(--line); }
.toc li { border-color: var(--line); }
.toc a { border-radius: 12px; padding-inline: 8px; margin-inline: -8px; transition: background-color .15s var(--ease); min-height: 56px; }
.toc a:hover { background: var(--surface); }
.toc a.is-here { background: var(--tint-p); color: var(--primary); }
.toc a.is-here .num { background: var(--purple); color: #fff; }

/* ---- Kütüphane ---- */
.library-row { align-items: center; gap: 22px; }
.library-row + .library-row { margin-top: 16px; }
.cover-md { width: 120px; flex-shrink: 0; box-shadow: var(--shadow); }
.cover-md.cover-tpl .tpl-title { font-size: 14px; } .cover-md.cover-tpl { padding: 10px; } .cover-md.cover-tpl .tpl-author { display: none; }
.library-title { margin: 0 0 4px; font-family: var(--serif); font-size: 21px; }
.library-title a { color: inherit; text-decoration: none; }
.library-title a:hover { color: var(--primary); }
.progress-line { display: flex; align-items: center; gap: 12px; max-width: 460px; }
.meter-lg { flex: 1; height: 10px; border-radius: 6px; max-width: none; }
.meter-lg span, .meter span { background: var(--grad-brand); border-radius: inherit; }
.progress-pct { font-variant-numeric: tabular-nums; color: var(--primary); min-width: 44px; }
.tabs .count { font-variant-numeric: tabular-nums; }

/* ---- Yazar paneli ---- */

.writer-row { gap: 22px; transition: box-shadow .2s var(--ease), border-color .2s var(--ease); }
.writer-row:hover { box-shadow: var(--shadow-hover); }

/* ---- Yazar profili ---- */
.profile-wrap { max-width: 980px; }
.profile-card { padding: 0; overflow: hidden; }
.profile-banner { height: 108px; background: var(--grad-brand); opacity: .9; }
.profile-main { display: flex; flex-wrap: wrap; gap: 18px 24px; align-items: flex-end; padding: 0 28px 24px; }
.avatar.xl { width: 116px; height: 116px; font-size: 44px; margin-top: -58px; border: 5px solid var(--card); box-shadow: var(--shadow); background: var(--tint-p); color: var(--primary); }
.profile-info { flex: 1 1 280px; min-width: 0; padding-top: 12px; }
.profile-info h1 { margin: 0; overflow-wrap: anywhere; }
.profile-bio { margin: 12px 0 0; white-space: pre-line; max-width: 620px; }
.profile-stats { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.profile-stats li { font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--surface); color: var(--muted); }
.profile-actions { padding-bottom: 4px; }
.profile-works { margin-top: 28px; }
.works-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

/* ---- Alt sekmeler: seçili sekme renkli kapsül ---- */
@media (max-width: 640px) {
  .tabbar { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(150%) blur(10px); box-shadow: 0 -6px 20px rgba(21, 11, 48, .06); }
  .tabbar a { position: relative; transition: color .18s var(--ease); }
  .tabbar svg { box-sizing: content-box; padding: 3px 16px; border-radius: 999px; transition: background-color .18s var(--ease); }
  .tabbar a[aria-current="page"] svg { background: var(--tint-p); }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -4px; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 3px 3px; background: var(--grad-brand); }

  /* Mobil yerleşim */
  .wrap { padding: 16px 16px 40px; }
  .hero-band { padding: 24px 18px; border-radius: 24px; gap: 22px; }
  .hero h1 { letter-spacing: -1.6px; }
  .hero-lead { font-size: 16px; }
  .featured { padding: 16px; gap: 16px; flex-direction: row; align-items: flex-start; }
  .cover-feat { width: 116px; }
  .featured-title { font-size: 20px; }
  .featured .clamp { -webkit-line-clamp: 3; }
  .home > section, .home > .panels { margin-top: 28px; }
  .section-head h2 { font-size: 19px; }

  /* Yatay kaydırılan roman rafları */
  .rail { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding: 4px 16px 10px; scroll-padding-inline: 16px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .rail::-webkit-scrollbar { display: none; }
  .rail > .tile { flex: 0 0 42%; scroll-snap-align: start; }
  .card .rail { margin-inline: -20px; padding-inline: 20px; scroll-padding-inline: 20px; }
  .panels .panel.accent-f .tiles.four.rail, .panels .panel.accent-ok .tiles.four.rail { display: flex; }
  .tiles:not(.rail) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }

  .search-box .input-lg { min-height: 52px; font-size: 16px; }
  .search-box .btn { min-height: 52px; padding-inline: 18px; }
  .filter-panel .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px 16px 16px; }
  .filter-actions { grid-column: 1 / -1; }
  .filter-actions .btn { flex: 1; }
  /* Uzun seçenekler ("Son güncellenen", "Tercih ettiğim diller") iki sütuna sığmaz: dil ve sıralama tam satır. */
  .filter-panel .filters .field:has(> #dil), .filter-panel .filters .field:has(> #sort) { grid-column: 1 / -1; }
  .results .cover-sm, .profile-works .cover-sm { width: 92px; }

  .story-hero { padding: 20px 16px; border-radius: 24px; gap: 18px; flex-direction: column; align-items: center; }
  .story-hero .story-head-body { width: 100%; }
  .story-hero .cover-lg { width: 200px; }
  .story-h1 { text-align: center; }
  .story-hero .badges, .story-author, .facts-row { justify-content: center; text-align: center; }
  .story-ctas .btn-lg { flex: 1 1 100%; }

  .library-row { gap: 14px; align-items: flex-start; }
  .cover-md { width: 92px; }
  .library-title { font-size: 18px; }
  .library-actions { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }

  .writer-row { gap: 14px; align-items: flex-start; }
  .writer-row .cover-md { width: 84px; }
  
  
  

  .profile-main { padding: 0 18px 20px; }
  .avatar.xl { width: 96px; height: 96px; font-size: 36px; margin-top: -48px; }
  .profile-banner { height: 84px; }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Okuma ekranı: telefonda okuma çubuğu (masaüstünde gizli) ---- */
.reader-dock { display: none; }
@media (max-width: 640px) {
  body.reader { padding-bottom: 76px; }
  .reader-dock { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--r-bg) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--r-line); transition: transform .25s var(--ease); }
  .reader-dock.is-hidden { transform: translateY(110%); }
  .reader-dock a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; border-radius: 12px; color: var(--r-ink) !important; text-decoration: none; font-weight: 700; font-size: 14px; }
  .reader-dock a.is-next { color: var(--r-accent) !important; }
  .reader-dock svg { width: 20px; height: 20px; }
  .reader-dock a:active { background: color-mix(in srgb, var(--r-ink) 8%, transparent); }
}

/* ---- Azaltılmış hareket tercihi ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .tile:hover .tile-cover, .featured-cover:hover, .author-card:hover, .btn-grad:hover { transform: none; }
}
.profile-main > .avatar.xl { position: relative; z-index: 1; }
.featured-cover, .library-cover, .tile { text-decoration: none; color: inherit; }
/* Boş bölümler tam genişlik kaplamasın (gereksiz boşluk): içerik yoksa yarım sütun. */
.panels .panel.accent-f:has(> .empty-state), .panels .panel.accent-ok:has(> .empty-state) { grid-column: auto; }
/* Okuma ekranında düğmeler okuma temasının zeminini kullanır (gece/sepya kontrastı). */
body.reader .btn-outline, body.reader .icon-btn { background: transparent; }
body.reader { --card: var(--r-bg); }

/* ---- Düzeltmeler (25 Ekim 2026, onay sonrası) ---- */
/* 1) Giriş/kayıt ekranında tam onaylı logo: her zaman görünür, sabit boy, sıkışmaz. */
.brand-mark { display: contents; }
.brand-plate { display: flex; justify-content: center; margin: 0 auto 22px; }
.brand-plate picture { display: block; line-height: 0; }
.brand-plate .brand-full { display: block; width: 220px; max-width: 70vw; height: auto; aspect-ratio: 577 / 573; border-radius: 24px; background: #FDFDFD; }
@media (max-width: 640px) { .brand-plate .brand-full { width: 172px; border-radius: 20px; } }

/* 2) Masaüstünde ana sayfa ve keşfet biraz daha geniş (1200 → 1360 px). Okuma ekranı 680 px olarak kalır. */
.is-wide .wrap, .is-wide .site-header .in, .is-wide .site-footer .in { max-width: 1360px; }

/* 3) Mobil: sabit alt menü ve güvenli ekran alanları (çentik, ana ekran çubuğu).
   Alt menü yüksekliği = 4 + 52 + 6 px + alt güvenli alan; sayfa sonu en az bu kadar boşluk bırakır. */
:root { --tabbar-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); --safe-t: env(safe-area-inset-top, 0px); }
.site-header .in { padding-left: max(20px, var(--safe-l)); padding-right: max(20px, var(--safe-r)); }
.site-header { padding-top: var(--safe-t); }
@media (max-width: 640px) {
  .site-header .in { padding-left: max(16px, var(--safe-l)); padding-right: max(16px, var(--safe-r)); }
  .tabbar { padding: 4px max(2px, var(--safe-r)) calc(6px + var(--safe-b)) max(2px, var(--safe-l)); }
  body { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); }
  .site-footer .in { padding-bottom: 16px; }
  .cookie-bar { bottom: calc(var(--tabbar-h) + var(--safe-b)); padding-left: max(14px, var(--safe-l)); padding-right: max(14px, var(--safe-r)); }
  .wrap { padding-left: max(16px, var(--safe-l)); padding-right: max(16px, var(--safe-r)); }
  /* Sayfa içindeki yapışkan/sabit öğeler alt menünün altında kalmasın */
  
  body.reader { padding-bottom: calc(76px + var(--safe-b)); }
  .reader-dock { padding-left: max(8px, var(--safe-l)); padding-right: max(8px, var(--safe-r)); }
  .reader-top { padding-top: max(8px, var(--safe-t)); }
  
}

/* ---- İki adımlı doğrulama (Aşama 6 / İP1) ---- */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.otp-input { font-size: 22px; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; direction: ltr; }
.setup-steps { margin: 0 0 18px; padding-inline-start: 22px; display: grid; gap: 6px; }
.two-factor-setup { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin: 4px 0 20px; }
/* QR kodu her temada açık zemin ister (tarayıcılar koyu zeminde okuyamayabilir). */
.qr-box { background: #fff; border-radius: 14px; padding: 10px; line-height: 0; box-shadow: var(--shadow); flex: none; }
.qr-box svg { width: 200px; height: 200px; display: block; }
.setup-key { min-width: 0; flex: 1 1 240px; }
.secret-key { font-size: 17px; font-weight: 700; letter-spacing: 1px; word-break: break-all; background: var(--tint-p); color: var(--ink); padding: 10px 12px; border-radius: 10px; margin: 6px 0 8px; user-select: all; }
.recovery-codes { list-style: none; margin: 16px 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.recovery-codes li { font-size: 17px; font-weight: 700; letter-spacing: 1px; text-align: center; padding: 10px; border-radius: 10px; background: var(--tint-c); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-row form { margin: 0; }
.recovery-box { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.recovery-box summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.recovery-box form { margin-top: 10px; }
@media (max-width: 420px) {
  .recovery-codes { grid-template-columns: minmax(0, 1fr); }
  .qr-box { margin-inline: auto; }
}

/* ---- Mobil giriş ve iki adımlı doğrulama: alt menü yok, küçük logo (Aşama 6 / İP1 düzeltmesi) ---- */
@media (max-width: 640px) {
  body.no-tabbar { padding-bottom: calc(var(--safe-b) + 16px); }
  body.no-tabbar .cookie-bar { bottom: var(--safe-b); }
  .auth-wrap.auth-compact { padding-top: 10px; padding-bottom: 32px; }
  .brand-plate--compact { margin-bottom: 10px; }
  .brand-plate--compact .brand-full { width: 72px; border-radius: 12px; }
  .auth-compact .card { padding: 18px; }
  .auth-compact h1 { font-size: 24px; margin-bottom: 6px; }
  .auth-compact .lead { font-size: 15px; line-height: 1.45; margin-bottom: 14px; }
}

/* ---- Aşama 2: Okumaya Devam Et, Kitaplığım, eşitleme bildirimi ---- */
.continue-section { margin: 0 0 28px; }
.continue-section .guest-note { margin: -6px 0 12px; }
.continue-rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; position: relative; }
.continue-card { position: relative; display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.continue-cover { flex: none; line-height: 0; }
.continue-cover .cover-sm { width: 84px; border-radius: 10px; }
.continue-body { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; }
.continue-title { margin: 0; font-size: 17px; line-height: 1.25; }
.continue-title a { color: var(--ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.continue-author, .continue-when { margin: 0; }
.continue-where { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-body .meter { max-width: none; }
.continue-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 4px; }
.continue-actions form { margin: 0; }
.continue-empty { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; background: var(--tint-p); border-radius: 16px; padding: 14px 18px; margin: 0 0 24px; }
.continue-empty h2 { margin: 0; font-size: 18px; }
.continue-empty p { margin: 0; flex: 1 1 260px; }
.lib-status { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; margin: 8px 0 0; }
.lib-status form, .undo-form { margin: 0; display: inline; }
.undo-form .btn-link { margin-inline-start: 10px; font-weight: 700; color: inherit; text-decoration: underline; }
.reader-finish { margin: 28px 0 8px; text-align: center; }
.import-conflicts { margin: 16px 0; border-color: var(--purple); }
.import-conflicts h2 { margin: 0 0 6px; font-size: 18px; }
.conflict-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.conflict-item { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 12px; background: var(--tint-p); }
.sync-toast { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: min(560px, calc(100% - 24px));
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 14px; border-radius: 14px; background: var(--ink-dark); color: #fff; box-shadow: 0 10px 30px rgba(21, 11, 48, .3); font-size: 15px; }
.sync-toast span { flex: 1 1 200px; }
.sync-close { background: transparent; border: 0; color: inherit; font-size: 24px; line-height: 1; min-width: 44px; min-height: 44px; cursor: pointer; }
@media (max-width: 640px) {
  .continue-rail { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding: 2px 16px 10px; scroll-padding-inline: 16px; scrollbar-width: none; }
  .continue-rail::-webkit-scrollbar { display: none; }
  .continue-card { flex: 0 0 86%; scroll-snap-align: start; }
  .continue-cover .cover-sm { width: 72px; }
}
@media (prefers-reduced-motion: reduce) { .continue-rail { scroll-behavior: auto; } }

/* ===== EPUB içe aktarma (Aşama 3) ===== */

/* Ülke doğrulanamadığında gizlenen eserler için açıklama (Aşama 3 ülke düzeltmesi) */
.continue-note { margin: 10px 0 0; }

/* Okuma ekranı "Dinle" düğmesi (panel stilleri css/listen.css) */
.listen-btn { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; }

@media (max-width:420px){.header-actions{gap:6px}.header-actions .btn{padding:0 10px;font-size:14px}.site-header:has(.btn-login) .brand b{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}}
@media (max-width:360px){.site-header .in{gap:6px}.header-actions{gap:4px}.header-actions .btn{padding:0 8px;font-size:13px}}
