/* ============================================================
   Okuma Ayarları / Erişilebilirlik — "Aa" düğmesi + panel + temalar
   Bileşen: app/Views/frontend/layouts/reader-tools.php · Mantık: reader.js
   ------------------------------------------------------------
   html.rt-on            → sayfada okuma gövdesi var, araç etkin
   html[data-rt-theme]   → night | sepia | contrast  (yoksa gündüz)
   html[data-rt-sized]   → yazı boyutu değişti (iç sabit boyutlar devralınır)
   html[data-rt-lh]      → wide | xwide            html[data-rt-align] → start | justify
   html[data-rt-font]    → readable | serif | dyslexic
   html[data-rt-width]   → narrow                  html[data-rt-links] → vurgulu bağlantı
   .rt-text   = okunan metin gövdesi (boyut/hizalama/yazı tipi buna)
   .rt-surface / .rt-ink / .rt-ink-c = reader.js'in tema için işaretlediği
   açık zeminler / koyu yazılar / koyu renkli yazılar (renkli düğme ve
   etiketler işaretlenmez → bozulmaz)
   ============================================================ */

/* Vurgu rengi: site rengi ya da erişilebilirlik mavisi (Ayarlar → Erişilebilirlik → Düğme rengi) */
:root{ --rt-accent:var(--primary,#be1e2d); }
html.rt-blue{ --rt-accent:#1565c0; }

/* ── Düğme (kenar sekmesi) ───────────────────────────────── */
/* Akıllı düğme — 3 kademe (reader.js yönetir):
     .rt-ext   → "Aa  Okuma ayarları" (ilk gelişte kısa ipucu / masaüstünde üzerine gelince)
     (yalın)   → "Aa"
     .rt-peek  → kenarda ince şerit (okurken)
   Aşağı kaydırdıkça birer kademe küçülür; yukarı kaydırma / kenara dokunma /
   fareyi kenara yaklaştırma geri açar. Panel açıkken (masaüstü) "Aa" → "×". */
.rt-fab{
    position:fixed; top:50%; z-index:1035;
    min-width:46px; height:54px; padding:0; border:0; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    background:#fff; color:var(--rt-accent);
    box-shadow:0 8px 26px rgba(30,20,10,.18), 0 1px 3px rgba(30,20,10,.12);
    transition:transform .45s cubic-bezier(.2,.9,.3,1.2), opacity .35s ease, padding .35s cubic-bezier(.2,.9,.3,1), box-shadow .3s;
    -webkit-tap-highlight-color:transparent;
}
/* yön fiziksel: "Aa" hep ekran kenarında, etiket içeride (RTL'de de) */
.rt-fab{ direction:ltr; }
.rt-fab--right{ flex-direction:row-reverse; }
/* telefonda dikey sürüklenebilir (reader.js): parmak altında hafif büyür */
.rt-fab{ touch-action:none; -webkit-user-select:none; user-select:none; }
.rt-fab.rt-drag{ scale:1.08; box-shadow:0 16px 36px rgba(30,20,10,.3), 0 2px 6px rgba(30,20,10,.15); }
.rt-fab__label{ max-width:0; overflow:hidden; white-space:nowrap; opacity:0; font-size:.82rem; font-weight:700; letter-spacing:.01em; unicode-bidi:plaintext;
    transition:max-width .4s cubic-bezier(.2,.9,.3,1), opacity .25s ease, margin .4s cubic-bezier(.2,.9,.3,1); }
.rt-fab.rt-ext{ padding:0 16px 0 14px; box-shadow:0 12px 32px rgba(30,20,10,.22), 0 1px 3px rgba(30,20,10,.12); }
.rt-fab--right.rt-ext{ padding:0 14px 0 16px; }
.rt-fab.rt-ext .rt-fab__label{ max-width:170px; opacity:1; transition-delay:0s, .1s, 0s; }
.rt-fab--left.rt-ext  .rt-fab__label{ margin-left:8px; }
.rt-fab--right.rt-ext .rt-fab__label{ margin-right:8px; }
@media (hover:hover) and (pointer:fine){
    html:not(.rt-open) .rt-fab.rt-in:not(.rt-peek):hover{ padding:0 16px 0 14px; }
    html:not(.rt-open) .rt-fab--right.rt-in:not(.rt-peek):hover{ padding:0 14px 0 16px; }
    html:not(.rt-open) .rt-fab.rt-in:not(.rt-peek):hover .rt-fab__label{ max-width:170px; opacity:1; }
    html:not(.rt-open) .rt-fab--left.rt-in:not(.rt-peek):hover  .rt-fab__label{ margin-left:8px; }
    html:not(.rt-open) .rt-fab--right.rt-in:not(.rt-peek):hover .rt-fab__label{ margin-right:8px; }
}
/* panel açık → "Aa" dönerek "×"e dönüşür */
.rt-fab__x{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:1.05rem;
    opacity:0; transform:rotate(-90deg) scale(.4); transition:opacity .22s ease, transform .35s cubic-bezier(.2,.9,.3,1.3); pointer-events:none; }
html.rt-open .rt-fab__x{ opacity:1; transform:none; }
html.rt-open .rt-fab__aa{ opacity:0; transform:rotate(90deg) scale(.4); }
html.rt-open .rt-fab__label{ max-width:0; opacity:0; margin:0; }
html.rt-open .rt-fab{ padding:0; z-index:1046; }   /* masaüstünde panelin yanında kapat düğmesi */
.rt-fab[hidden]{ display:none; }
.rt-fab--left { left:0;  border-radius:0 16px 16px 0; transform:translate(-110%,-50%); }
.rt-fab--right{ right:0; border-radius:16px 0 0 16px; transform:translate(110%,-50%); }
.rt-fab__aa{ font-family:Georgia,"Times New Roman",serif; font-weight:700; font-size:1.18rem; letter-spacing:-.02em; line-height:1; }
.rt-fab__dot{ position:absolute; top:8px; width:7px; height:7px; border-radius:50%; background:var(--secondary,#c9a227);
    box-shadow:0 0 0 2px #fff; opacity:0; transition:opacity .2s; }
.rt-fab--left  .rt-fab__dot{ right:7px; }
.rt-fab--right .rt-fab__dot{ left:7px; }
html.rt-custom .rt-fab__dot{ opacity:1; }      /* ayar değiştirilmiş → küçük nokta */

/* görünür: kenardan "sihirli" kayarak gelir */
.rt-fab.rt-in{ transform:translate(0,-50%); opacity:1; }
/* okurken kenara çekilir: ince şerit kalır, dokununca/yukarı kayınca geri gelir */
.rt-fab--left.rt-in.rt-peek { transform:translate(-56%,-50%); }
.rt-fab--right.rt-in.rt-peek{ transform:translate(56%,-50%); }
/* çekik hâlde "Aa" yarım görünmesin → yerine küçük ok (›) */
.rt-fab.rt-gone{ display:none !important; }
/* simge: erişilebilirlik / göz (Bootstrap Icons) ya da "Aa" */
.rt-fab__aa .bi{ display:block; font-size:1.5rem; line-height:1; }
.rt-fab--i-eye .rt-fab__aa .bi{ font-size:1.4rem; }
.rt-fab__aa{ display:inline-block; transition:opacity .2s, transform .35s cubic-bezier(.2,.9,.3,1.3); }
.rt-fab__dot{ transition:opacity .2s; }
.rt-fab.rt-peek .rt-fab__aa, .rt-fab.rt-peek .rt-fab__dot{ opacity:0; }
.rt-fab::before{ content:""; position:absolute; top:50%; width:7px; height:7px; margin-top:-4px; opacity:0; transition:opacity .2s;
    border-top:2px solid currentColor; border-right:2px solid currentColor; }
.rt-fab--left::before { right:7px; transform:rotate(45deg); }
.rt-fab--right::before{ left:7px;  transform:rotate(-135deg); }
.rt-fab.rt-peek::before{ opacity:1; }
/* kenar şeridi: çekilmiş hâlde de beyaz zeminde fark edilsin */
.rt-fab--left { border-right:3px solid var(--rt-accent); }
.rt-fab--right{ border-left:3px solid var(--rt-accent); }
.rt-fab.rt-in:hover, .rt-fab.rt-in:focus-visible{ transform:translate(0,-50%); }
.rt-fab:focus-visible{ outline:3px solid var(--secondary,#c9a227); outline-offset:2px; }
.rt-fab.rt-in:not(.rt-peek):not(.rt-pulsed)::after{ /* ilk gelişte bir kez nabız */
    content:""; position:absolute; inset:0; border-radius:inherit; box-shadow:0 0 0 0 color-mix(in srgb,var(--rt-accent) 45%,transparent);
    animation:rtPulse 1.6s ease-out 1; pointer-events:none; }
@keyframes rtPulse{ to{ box-shadow:0 0 0 14px transparent; } }
/* okuma odağı (çift dokunma) diğer yüzen öğelerle birlikte gizler */
html.reading-focus .rt-fab{ opacity:0 !important; pointer-events:none !important; }
/* sesli okuma sürerken nokta "kalp atışı" gibi atar — düğme çekik olsa da görünür */
html.rt-tts-on .rt-fab__dot{ opacity:1; background:var(--rt-accent); animation:rtBeat 1.1s ease-in-out infinite; }
@keyframes rtBeat{ 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.55); } }
/* kademe değişiminde küçük "esneme" (kenara çekilip geri gelirken canlı dursun) */
.rt-fab.rt-bump{ animation:rtBump .42s cubic-bezier(.2,.9,.3,1.4); }
@keyframes rtBump{ 40%{ scale:1.08; } }

/* ── Panel ───────────────────────────────────────────────── */
.rt-backdrop{ position:fixed; inset:0; z-index:1040; background:rgba(15,10,6,.38); opacity:0; transition:opacity .25s; }
.rt-backdrop.rt-show{ opacity:1; }
.rt-backdrop[hidden], .rt-panel[hidden]{ display:none; }
.rt-panel:focus{ outline:none; }
.rt-panel{
    position:fixed; z-index:1045; top:50%; width:340px; max-height:min(82vh,640px);
    display:flex; flex-direction:column; overflow:hidden;
    background:#fff; color:#1f1d1a; border-radius:18px;
    box-shadow:0 24px 60px rgba(25,15,5,.28), 0 2px 8px rgba(25,15,5,.12);
    font-family:var(--font-body, system-ui, -apple-system, "Segoe UI", sans-serif); font-size:14px; line-height:1.4;
    opacity:0; transition:opacity .2s ease, transform .38s cubic-bezier(.2,.9,.3,1.12);
}
/* masaüstü: düğmenin yanından "büyüyerek" açılır, kapanırken düğmeye geri çekilir */
.rt-panel--left { left:58px;  transform:translate(-22px,-50%) scale(.86); transform-origin:0 50%; }
.rt-panel--right{ right:58px; transform:translate(22px,-50%) scale(.86);  transform-origin:100% 50%; }
.rt-panel.rt-show{ opacity:1; transform:translate(0,-50%) scale(1); }
/* içerik grupları sırayla yükselir */
.rt-panel.rt-show .rt-panel__body > *, .rt-panel.rt-show .rt-panel__foot{ animation:rtRise .42s cubic-bezier(.2,.9,.3,1) both; }
.rt-panel.rt-show .rt-panel__body > :nth-child(2){ animation-delay:.03s; }
.rt-panel.rt-show .rt-panel__body > :nth-child(3){ animation-delay:.06s; }
.rt-panel.rt-show .rt-panel__body > :nth-child(4){ animation-delay:.09s; }
.rt-panel.rt-show .rt-panel__body > :nth-child(5){ animation-delay:.12s; }
.rt-panel.rt-show .rt-panel__body > :nth-child(6){ animation-delay:.15s; }
.rt-panel.rt-show .rt-panel__body > :nth-child(n+7), .rt-panel.rt-show .rt-panel__foot{ animation-delay:.18s; }
@keyframes rtRise{ from{ opacity:0; transform:translateY(10px); } }
.rt-panel__head{ display:flex; align-items:center; gap:10px; padding:14px 14px 10px 18px; border-bottom:1px solid #f0ebe3; position:relative; }
.rt-panel__grip{ display:none; }
.rt-panel__title{ flex:1; margin:0; font-size:1rem; font-weight:800; color:inherit; display:flex; align-items:center; gap:8px; }
.rt-panel__title i{ color:var(--rt-accent); font-size:1.15rem; }
.rt-x{ width:34px; height:34px; border:0; border-radius:50%; background:#f4f1ec; color:#5a554e; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.rt-x:hover{ background:#ebe5dc; }
.rt-panel__body{ padding:12px 18px 6px; overflow-y:auto; overscroll-behavior:contain; }
.rt-panel__foot{ padding:10px 18px 14px; border-top:1px solid #f0ebe3; }

.rt-group{ border:0; margin:0 0 14px; padding:0; min-width:0; }
.rt-group legend, .rt-label, .rt-sub legend{ float:none; width:auto; padding:0; margin:0 0 7px; font-size:.72rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:#8a8378; }
.rt-sub{ border:0; margin:0; padding:0; min-width:0; }

/* tema kartları (2×2) */
.rt-themes{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.rt-theme{ display:flex; align-items:center; gap:9px; padding:9px 10px; border-radius:12px; border:2px solid #ece6dc; background:#fff; color:#2b2722;
    font-weight:600; font-size:.86rem; cursor:pointer; text-align:start; transition:border-color .15s, box-shadow .15s; }
.rt-sw{ width:30px; height:30px; flex:0 0 30px; border-radius:9px; display:inline-flex; align-items:center; justify-content:center; font-size:1rem; box-shadow:inset 0 0 0 1px rgba(0,0,0,.08); }
.rt-theme--day .rt-sw{ background:#fff; color:#d48a00; }
.rt-theme--night .rt-sw{ background:#1b1e24; color:#f1d77a; }
.rt-theme--sepia .rt-sw{ background:#f4e9d2; color:#8a5a20; }
.rt-theme--contrast .rt-sw{ background:#000; color:#ffe14d; }

/* parça seçiciler */
.rt-seg{ display:flex; gap:4px; padding:3px; background:#f4f1ec; border-radius:11px; }
.rt-seg--wrap{ flex-wrap:wrap; }
.rt-seg button{ flex:1 1 auto; min-height:36px; padding:6px 10px; border:0; border-radius:8px; background:transparent; color:#4a453f;
    font-size:.82rem; font-weight:600; cursor:pointer; white-space:nowrap; display:inline-flex; align-items:center; justify-content:center; gap:5px; }
.rt-seg button:hover{ background:rgba(255,255,255,.7); }
.rt-f-readable{ font-family:-apple-system,"Segoe UI",Roboto,"Noto Sans",Arial,sans-serif !important; }
.rt-f-serif{ font-family:Georgia,"Times New Roman","Noto Serif",serif !important; }
.rt-f-dyslexic{ font-family:"Atkinson Hyperlegible",Verdana,sans-serif !important; }

/* seçili durum (tema, seg) */
.rt-theme[aria-pressed="true"]{ border-color:var(--rt-accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--rt-accent) 14%,transparent); }
.rt-seg button[aria-pressed="true"]{ background:#fff; color:var(--rt-accent); box-shadow:0 1px 4px rgba(0,0,0,.1); }
.rt-panel button:focus-visible, .rt-switch input:focus-visible + .rt-switch__ui{ outline:3px solid var(--secondary,#c9a227); outline-offset:2px; }

/* yazı boyutu */
.rt-stepper{ display:flex; align-items:center; gap:8px; }
.rt-stepper button{ flex:0 0 auto; min-width:58px; height:42px; border-radius:11px; border:2px solid #ece6dc; background:#fff; color:#2b2722; font-weight:800; font-size:1rem; cursor:pointer; }
.rt-stepper button:disabled{ opacity:.35; cursor:default; }
.rt-stepper__val{ flex:1; text-align:center; font-weight:800; font-size:1.05rem; color:var(--rt-accent); }

.rt-row{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.rt-switch{ display:inline-flex; align-items:center; gap:9px; font-size:.84rem; font-weight:600; color:#3a352f; cursor:pointer; padding-bottom:6px; }
.rt-switch input{ position:absolute; opacity:0; width:1px; height:1px; }
.rt-switch__ui{ width:40px; height:23px; border-radius:30px; background:#d9d2c7; position:relative; transition:background .2s; flex:0 0 40px; }
.rt-switch__ui::after{ content:""; position:absolute; top:3px; left:3px; width:17px; height:17px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition:transform .2s; }
.rt-switch input:checked + .rt-switch__ui{ background:var(--rt-accent); }
.rt-switch input:checked + .rt-switch__ui::after{ transform:translateX(17px); }
[dir="rtl"] .rt-switch input:checked + .rt-switch__ui::after{ transform:translateX(-17px); }
[dir="rtl"] .rt-switch__ui::after{ left:auto; right:3px; }

.rt-reset{ width:100%; min-height:40px; border:0; border-radius:11px; background:#f4f1ec; color:#4a453f; font-weight:700; font-size:.86rem; cursor:pointer;
    display:inline-flex; align-items:center; justify-content:center; gap:7px; }
.rt-reset:hover{ background:#ebe5dc; }

/* Telefon: alttan kayan çekmece */
@media (max-width:767.98px){
    .rt-fab{ min-width:40px; height:50px; }
    .rt-fab__aa{ font-size:1.05rem; }
    .rt-fab__aa .bi{ font-size:1.32rem; }
    .rt-panel, .rt-panel--left, .rt-panel--right{
        left:0; right:0; top:auto; bottom:0; width:auto; max-height:84vh;
        border-radius:22px 22px 0 0; transform:translateY(100%);
        padding-bottom:env(safe-area-inset-bottom,0px);
    }
    .rt-panel.rt-show{ transform:translateY(0); }
    .rt-panel{ transition:opacity .2s ease, transform .42s cubic-bezier(.2,.9,.3,1.04); }
    html.rt-open .rt-fab{ opacity:0; pointer-events:none; }   /* telefonda çekmece kendi kapat düğmesini taşır */
    .rt-panel__grip{ display:block; position:absolute; top:6px; left:50%; width:40px; height:4px; margin-left:-20px; border-radius:4px; background:#ddd5ca; }
    .rt-panel__head{ padding-top:18px; }
}
@media (prefers-reduced-motion:reduce){
    .rt-fab, .rt-panel, .rt-backdrop, .rt-fab *{ transition:none !important; }
    .rt-fab.rt-in::after, .rt-fab, .rt-fab__dot, .rt-panel *{ animation:none !important; }
}
@media print{ .rt-fab, .rt-panel, .rt-backdrop{ display:none !important; } }

/* Panel, gece temasında kendisi de koyu */
html[data-rt-theme="night"] .rt-panel{ background:#1d2027; color:#e4e7ec; }
html[data-rt-theme="night"] .rt-panel__head, html[data-rt-theme="night"] .rt-panel__foot{ border-color:#2c3038; }
html[data-rt-theme="night"] :is(.rt-x,.rt-seg,.rt-reset){ background:#2a2e36; color:#d4d8de; }
html[data-rt-theme="night"] :is(.rt-theme,.rt-stepper button){ background:#23262d; border-color:#343944; color:#e4e7ec; }
html[data-rt-theme="night"] .rt-seg button{ color:#c5cad2; }
html[data-rt-theme="night"] .rt-seg button[aria-pressed="true"]{ background:#3a3f49; color:#fff; }
html[data-rt-theme="night"] .rt-switch{ color:#d4d8de; }
html[data-rt-theme="night"] .rt-fab{ background:#23262d; color:#f1d77a; }
html[data-rt-theme="contrast"] .rt-fab{ background:#000; color:#ffe14d; box-shadow:0 0 0 2px #ffe14d; }

/* ============================================================
   OKUMA AYARLARI — yalnız .rt-text (okunan metin) üzerinde
   ============================================================ */
/* Yazı boyutu: gövde boyutu JS ile ayarlanır; değiştiyse editörden gelen
   sabit iç boyutlar (span 12pt vb.) devralınır, başlıklar orantılı kalır */
html[data-rt-sized] .rt-text :is(p,li,span,div,td,th,blockquote,a,strong,em,b,i,u,font,small,label,dd,dt,figcaption){ font-size:inherit !important; }
html[data-rt-sized] .rt-text h1{ font-size:1.75em !important; }
html[data-rt-sized] .rt-text h2{ font-size:1.5em !important; }
html[data-rt-sized] .rt-text h3{ font-size:1.3em !important; }
html[data-rt-sized] .rt-text h4{ font-size:1.15em !important; }
html[data-rt-sized] .rt-text :is(h5,h6){ font-size:1.05em !important; }

/* Satır aralığı */
html[data-rt-lh="wide"]  .rt-text, html[data-rt-lh="wide"]  .rt-text :not(h1,h2,h3,h4,h5,h6){ line-height:2.15 !important; }
html[data-rt-lh="xwide"] .rt-text, html[data-rt-lh="xwide"] .rt-text :not(h1,h2,h3,h4,h5,h6){ line-height:2.5 !important; }
html[data-rt-lh] .rt-text p{ margin-bottom:1.1em; }

/* Hizalama ("start" = dilin başına: Türkçede sol, Arapçada sağ) */
html[data-rt-align="start"]   .rt-text :is(p,li,div,blockquote,td,span){ text-align:start !important; }
html[data-rt-align="justify"] .rt-text :is(p,li,div,blockquote){ text-align:justify !important; -webkit-hyphens:auto; hyphens:auto; }

/* Yazı tipi (ikonlar ve Arapça ayet/yazılar korunur) */
html[data-rt-font] .rt-text, html[data-rt-font] .rt-text :not(i[class*="bi-"]):not([lang="ar"]):not([lang="ar"] *):not([dir="rtl"]):not([dir="rtl"] *){ font-family:var(--rt-ff) !important; }
html[data-rt-font="readable"]{ --rt-ff:-apple-system,"Segoe UI",Roboto,"Noto Sans",Arial,sans-serif; }
html[data-rt-font="serif"]   { --rt-ff:Georgia,"Times New Roman","Noto Serif",serif; }
html[data-rt-font="dyslexic"]{ --rt-ff:"Atkinson Hyperlegible",Verdana,Tahoma,sans-serif; }
html[data-rt-font="dyslexic"] .rt-text{ letter-spacing:.02em; word-spacing:.06em; }

/* Satır genişliği: uzun metinde satırlar kısalır, göz kolay izler */
html[data-rt-width="narrow"] .rt-text{ max-width:64ch; margin-left:auto !important; margin-right:auto !important; }

/* Bağlantıları vurgula */
html[data-rt-links] .rt-text a{ text-decoration:underline !important; text-decoration-thickness:2px !important; text-underline-offset:3px;
    background:color-mix(in srgb,var(--secondary,#c9a227) 22%,transparent) !important; border-radius:3px; padding:0 2px; }

/* ============================================================
   TEMALAR — sayfa zemini + işaretlenmiş yüzey/yazılar
   ============================================================ */
html.rt-on[data-rt-theme] body{ transition:background-color .3s; }

/* GECE */
html.rt-on[data-rt-theme="night"] body{ background:#121419 !important; }
html[data-rt-theme="night"] .rt-surface{ background-color:#1b1e25 !important; border-color:#2c3039 !important; box-shadow:none !important; }
html[data-rt-theme="night"] .rt-ink{ color:#dde1e8 !important; }
html[data-rt-theme="night"] .rt-ink-c{ color:var(--rt-c) !important; }
html[data-rt-theme="night"] .rt-text :is(h1,h2,h3,h4,h5,h6){ color:#f3f5f8 !important; }
html[data-rt-theme="night"] .rt-text a{ color:#8fb8ff !important; }
html[data-rt-theme="night"] .rt-text :is(img,video){ filter:brightness(.9); }
html[data-rt-theme="night"] .rt-text :is(blockquote){ border-color:#3a3f4a !important; }
html[data-rt-theme="night"] .rt-text :is(table,td,th,hr){ border-color:#343944 !important; }

/* SEPYA */
html.rt-on[data-rt-theme="sepia"] body{ background:#eee3cb !important; }
html[data-rt-theme="sepia"] .rt-surface{ background-color:#f8f0de !important; border-color:#e3d5b6 !important; }
html[data-rt-theme="sepia"] .rt-ink{ color:#3b2f22 !important; }
html[data-rt-theme="sepia"] .rt-text a{ color:#8a4b14 !important; }
html[data-rt-theme="sepia"] .rt-text :is(img,video){ filter:sepia(.12); }

/* YÜKSEK KONTRAST (az görenler için: siyah zemin, beyaz yazı, sarı vurgu) */
html.rt-on[data-rt-theme="contrast"] body{ background:#000 !important; }
html[data-rt-theme="contrast"] .rt-surface{ background-color:#000 !important; border-color:#fff !important; box-shadow:none !important; }
html[data-rt-theme="contrast"] :is(.rt-ink,.rt-ink-c){ color:#fff !important; }
html[data-rt-theme="contrast"] .rt-text :is(h1,h2,h3,h4,h5,h6){ color:#ffe14d !important; }
html[data-rt-theme="contrast"] .rt-text a{ color:#ffe14d !important; text-decoration:underline !important; }
html[data-rt-theme="contrast"] .rt-text{ font-weight:500; }

/* ============================================================
   SESLİ OKUMA — "Dinle" bölümü + oynatıcı + okunan paragraf vurgusu
   ============================================================ */
.rt-listen__row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.rt-play{ display:inline-flex; align-items:center; gap:7px; min-height:42px; padding:0 18px; border:0; border-radius:12px;
    background:var(--rt-accent); color:#fff; font-weight:800; font-size:.9rem; cursor:pointer; box-shadow:0 6px 16px color-mix(in srgb,var(--rt-accent) 30%,transparent); }
.rt-play i{ font-size:1.15rem; }
.rt-play:hover{ filter:brightness(1.06); }
.rt-play.rt-playing{ background:#2b2722; }
.rt-seg--speed{ flex:1 1 170px; }
.rt-seg--speed button{ padding:6px 4px; font-variant-numeric:tabular-nums; }
.rt-note{ margin:8px 0 0; font-size:.76rem; color:#9a6a00; }
.rt-note[hidden], .rt-listen[hidden]{ display:none; }

.rt-player{
    position:fixed; z-index:1036; left:50%; bottom:calc(20px + env(safe-area-inset-bottom,0px));
    transform:translate(-50%, 140%); opacity:0;
    display:flex; align-items:center; gap:8px; width:min(92vw,420px); padding:8px 8px 8px 10px;
    background:#1f1d1b; color:#fff; border-radius:18px; box-shadow:0 14px 40px rgba(0,0,0,.35);
    transition:transform .35s cubic-bezier(.2,.9,.3,1.15), opacity .25s;
    font-family:var(--font-body, system-ui, sans-serif);
}
.rt-player[hidden]{ display:none; }
.rt-player.rt-show{ transform:translate(-50%,0); opacity:1; }
.rt-player__btn{ flex:0 0 auto; min-width:42px; height:42px; border:0; border-radius:12px; background:rgba(255,255,255,.1); color:#fff;
    display:inline-flex; align-items:center; justify-content:center; font-size:1.2rem; font-weight:800; cursor:pointer; }
.rt-player__btn:hover{ background:rgba(255,255,255,.18); }
.rt-player__toggle{ background:var(--rt-accent); }
.rt-player__toggle:hover{ background:var(--rt-accent); filter:brightness(1.1); }
.rt-player__rate{ font-size:.82rem; font-variant-numeric:tabular-nums; min-width:48px; }
.rt-player__info{ flex:1; min-width:0; display:flex; flex-direction:column; gap:6px; }
.rt-player__label{ font-size:.8rem; font-weight:700; color:#e8e4dd; display:inline-flex; align-items:center; gap:6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rt-player__bar{ height:4px; border-radius:4px; background:rgba(255,255,255,.15); overflow:hidden; }
.rt-player__fill{ display:block; height:100%; width:0; background:var(--secondary,#c9a227); transition:width .3s; }
.rt-player button:focus-visible{ outline:3px solid var(--secondary,#c9a227); outline-offset:2px; }
@media (max-width:1199.98px){   /* alt menü varken onun üstünde dursun */
    body:has(.mobile-bottom-nav) .rt-player{ bottom:calc(92px + env(safe-area-inset-bottom,0px)); }
}
@media (max-width:767.98px){ html.rt-open .rt-player{ opacity:0; pointer-events:none; } }   /* telefonda çekmece açıkken çakışmasın */

/* Okunan paragraf */
.rt-speaking{ background:color-mix(in srgb,var(--secondary,#c9a227) 20%,transparent) !important; border-radius:6px;
    box-shadow:0 0 0 6px color-mix(in srgb,var(--secondary,#c9a227) 20%,transparent); transition:background .2s; }
html[data-rt-theme="night"] .rt-speaking{ background:rgba(241,215,122,.14) !important; box-shadow:0 0 0 6px rgba(241,215,122,.14); }
html[data-rt-theme="contrast"] .rt-speaking{ background:#333 !important; box-shadow:0 0 0 3px #ffe14d; }
@media (prefers-reduced-motion:reduce){ .rt-player{ transition:none !important; } }
@media print{ .rt-player{ display:none !important; } }
/* Telefonda panel açıkken diğer yüzen düğmeler çekmecenin üstüne binmesin */
@media (max-width:767.98px){
    html.rt-open :is(.wa-float-wrap,.scroll-top-btn),
    html.rt-tts-on :is(.wa-float-wrap,.scroll-top-btn){ opacity:0 !important; pointer-events:none !important; }
}

/* ── Ses seçimi (cihazda birden çok uygun ses varsa) ─────── */
.rt-voices{ display:flex; align-items:center; gap:10px; margin-top:10px; }
.rt-voices__lbl{ font-size:.72rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:#8a8378; flex:0 0 auto; }
.rt-voices .rt-seg{ flex:1; }
.rt-voices .rt-seg button{ gap:6px; }
.rt-voices__nat{ font-size:.66rem; font-weight:700; padding:1px 6px; border-radius:20px; background:color-mix(in srgb,var(--rt-accent) 12%,transparent); color:var(--rt-accent); }
html[data-rt-theme="night"] .rt-voices__lbl{ color:#9aa0aa; }
