/* Renkler Berxwedan Nûçe kimliğiyle uyumlu: koyu zemin, altın vurgu, kırmızı ayrıntı. */
:root {
  --bg: #f8f4ec;
  --surface: #ffffff;
  --surface-2: #efe7da;
  --text: #1f1811;
  --muted: #6f6152;
  --accent: #8f5d14;
  --on-accent: #ffffff;
  --accent-2: #15803d;
  --brand-red: #c8151f;
  --border: #e3d8c6;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 16px rgba(60, 40, 20, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0907;
    --surface: #17130f;
    --surface-2: #221c16;
    --text: #f4ede2;
    --muted: #a99a87;
    --accent: #d9ad62;
    --on-accent: #1a1206;
    --accent-2: #4ade80;
    --brand-red: #e3192b;
    --border: #33291f;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0907; --surface: #17130f; --surface-2: #221c16; --text: #f4ede2;
  --muted: #a99a87; --accent: #d9ad62; --on-accent: #1a1206; --accent-2: #4ade80;
  --brand-red: #e3192b; --border: #33291f;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans", system-ui, sans-serif;
  line-height: 1.5;
  padding-bottom: 120px;
}
[dir="rtl"], .rtl { font-family: "Noto Naskh Arabic", "Noto Sans", serif; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.brand-logo { width: 36px; height: 36px; display: block; border-radius: 9px; box-shadow: 0 0 0 1px rgba(214,170,100,.35); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text small { font-size: .58rem; font-weight: 600; letter-spacing: .14em; color: var(--muted); }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .92rem; }
.nav a.active { background: var(--surface-2); color: var(--text); }
.lang { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.lang button { border: 0; background: transparent; padding: 4px 10px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.lang button.active { background: var(--accent); color: var(--on-accent); }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px; outline: none; }

/* hero + filters */
.hero h1 { margin: 0 0 4px; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.hero p { margin: 0 0 20px; color: var(--muted); }
.search {
  width: 100%; padding: 12px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.chip {
  border: 1px solid var(--border); background: var(--surface);
  padding: 5px 12px; border-radius: 999px; font-size: .88rem;
}
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-sep { width: 1px; background: var(--border); margin: 0 4px; }

h2.section { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 36px 0 14px; display: flex; align-items: center; gap: 8px; }
h2.section::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--brand-red); flex: none; }

/* grid + cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.card {
  display: block; text-decoration: none; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .15s ease;
}
.card:hover { transform: translateY(-2px); }
.card-body { padding: 10px 12px 12px; }
.card-title { font-weight: 700; font-size: .95rem; line-height: 1.3; }
.card-author { color: var(--muted); font-size: .85rem; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.badge { font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 600; }
.badge.mine { background: color-mix(in srgb, var(--accent-2) 18%, transparent); color: var(--accent-2); }

.cover {
  aspect-ratio: 1; display: grid; place-items: center; color: #fff;
  font-weight: 700; font-size: 2.4rem; letter-spacing: .02em; position: relative;
  background: linear-gradient(140deg, var(--c1), var(--c2));
}
.cover-book {
  container-type: inline-size; overflow: hidden;
  background:
    radial-gradient(120% 90% at 30% 15%, color-mix(in srgb, var(--c1) 55%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--c2) 60%, #0b0907), #0b0907);
  color: #f4ede2;
}
.cover-book::before { content: ""; position: absolute; inset: 7%; border: 1px solid rgba(217,173,98,.55); border-radius: 4px; pointer-events: none; }
.cover-book::after { content: ""; position: absolute; inset: calc(7% + 4px); border: 1px solid rgba(217,173,98,.22); border-radius: 2px; pointer-events: none; }
.cover-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5cqw; padding: 10cqw 15% 0; }
.cover-title { font-family: Georgia, "Noto Naskh Arabic", "Times New Roman", serif; font-weight: 700; font-size: clamp(1rem, 10.5cqw, 2.2rem); line-height: 1.12; letter-spacing: 0; text-wrap: balance; }
.cover-title[dir="rtl"], .cover-author[dir="rtl"] { font-family: "Noto Naskh Arabic", serif; }
.cover-title.long { font-size: clamp(.9rem, 8.4cqw, 1.8rem); }
.cover-rule { width: 18cqw; height: 2px; background: #d9ad62; border-radius: 2px; }
.cover-author { font-size: clamp(.7rem, 5.6cqw, 1.05rem); font-weight: 600; color: #d9ad62; letter-spacing: .02em; }
.cover-year { font-size: clamp(.6rem, 4.2cqw, .8rem); font-weight: 600; color: rgba(244,237,226,.55); letter-spacing: .18em; }
.cover-type { position: absolute; top: 11%; inset-inline-start: 50%; transform: translateX(-50%); font-size: clamp(.55rem, 4cqw, .7rem); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: rgba(244,237,226,.6); white-space: nowrap; }
.cover-sm { width: 48px; height: 48px; aspect-ratio: auto; border-radius: 8px; font-size: 1rem; flex: none; }

.progress-bar { height: 4px; background: var(--surface-2); }
.progress-bar span { display: block; height: 100%; background: var(--accent); }

/* detail */
.detail { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
.detail .cover { border-radius: var(--radius); box-shadow: var(--shadow); font-size: 3.5rem; }
.detail h1 { margin: 0; font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.2; }
.detail .author { color: var(--muted); margin: 4px 0 12px; font-size: 1.05rem; }
.detail .desc { max-width: 60ch; }
.note { font-size: .85rem; color: var(--muted); background: var(--surface-2); padding: 8px 12px; border-radius: 10px; display: inline-block; }
.btn {
  border: 0; background: var(--accent); color: var(--on-accent); font-weight: 700;
  padding: 10px 20px; border-radius: 999px; text-decoration: none; display: inline-block;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: transparent; color: #dc2626; border: 1px solid currentColor; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }

.chapters { list-style: none; padding: 0; margin: 20px 0 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.chapters li { border-top: 1px solid var(--border); display: flex; align-items: center; }
.chapters li > button { flex: 1; }
.chapters .dl { padding: 12px 16px; text-decoration: none; color: var(--muted); }
.chapters .dl:hover { color: var(--accent); }
.btn.ghost.on { color: var(--accent); border-color: var(--accent); }
.badge.fav { color: var(--accent); }
.hint { color: var(--muted); font-size: .8rem; margin-top: 40px; text-align: center; }
.field input:disabled, .field select:disabled { opacity: .6; }
.install-btn {
  border: 1px solid var(--accent); color: var(--accent); background: transparent;
  border-radius: 999px; padding: 4px 12px; font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.icon-btn:disabled { opacity: .3; cursor: default; }
.sleep-left { font-variant-numeric: tabular-nums; color: var(--accent); min-width: 3ch; }
.player-info { text-decoration: none; }

/* reader: metinle eş zamanlı okuma */
.reader-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.reader-titles { flex: 1; min-width: 0; display: grid; gap: 4px; }
.reader-titles select { justify-self: start; max-width: 100%; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.reader-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.reader {
  font-size: var(--fs, 1.25rem); line-height: 1.7; max-width: 46rem; margin: 16px auto 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
}
.reader .line {
  margin: 0; padding: 8px 12px; border-radius: 10px; cursor: pointer; color: var(--muted);
  transition: background .25s ease, color .25s ease;
}
.reader .line:hover { background: var(--surface-2); }
.reader .line.past { color: var(--text); opacity: .75; }
.reader .line.active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); opacity: 1; }
.reader .tr { display: block; font-family: "Noto Sans", system-ui, sans-serif; font-size: .68em; font-style: italic; color: var(--muted); margin-top: 2px; }
.reader.hide-tr .tr { display: none; }
.reader .src { white-space: pre-line; }
.source { font-size: .8rem; color: var(--muted); max-width: 46rem; margin: 12px auto 0; }
.source a { color: var(--accent); }
.reader.syncing .line { cursor: default; }
.sync-bar {
  position: sticky; top: 64px; z-index: 5; max-width: 46rem; margin: 0 auto;
  background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow);
}
.sync-bar p { margin: 0 0 10px; font-size: .9rem; }
.sync-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sync-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.text-form { margin: 24px auto 0; max-width: 46rem; }
/* stüdyo */
.studio-step { max-width: 46rem; margin: 0 auto 8px; transition: opacity .2s; }
.studio-step.dim { opacity: .45; pointer-events: none; }
.studio-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.studio-row select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); max-width: 100%; }
.check { display: flex; gap: 8px; align-items: center; font-size: .88rem; color: var(--muted); }
.meter { position: relative; height: 14px; border-radius: 7px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.meter-fill { height: 100%; width: 0; transition: width .05s linear; background: var(--muted); }
.meter-fill.low { background: #ca8a04; }
.meter-fill.ok { background: #16a34a; }
.meter-fill.hot { background: #ea580c; }
.meter-fill.clip { background: #dc2626; }
.meter-hold { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); }
.meter-mark { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--text) 30%, transparent); }
.meter-read { font-size: .8rem; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.file-import { margin-top: 12px; font-size: .9rem; }
.file-import summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.file-import input { margin-top: 8px; }
.prompter {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; white-space: pre-line; min-height: 220px;
  display: grid; align-content: center; gap: 14px;
}
.pr-prev, .pr-next { color: var(--muted); font-size: 1rem; opacity: .7; }
.pr-cur { font-size: clamp(1.3rem, 3.5vw, 1.9rem); line-height: 1.6; font-weight: 600; }
.studio-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.studio-bar .rec-time { font-size: 1.4rem; min-width: 4ch; }
body.studio-busy .rec-time { color: #dc2626; }
.verdict.good, .report .good { color: #16a34a; }
.verdict.warn, .report .warn { color: #ca8a04; }
.verdict.bad, .report .bad { color: #dc2626; }
.report { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-bottom: 12px; }
.report th, .report td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: .9rem; }
.report td.good, .report td.warn, .report td.bad { font-weight: 700; }
.ab { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.ab label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.ab audio, .existing audio { width: 100%; }
.existing { display: grid; gap: 8px; max-width: 46rem; margin: 0 auto 12px; }
.voice-note { margin-bottom: 4px; }
a.chip { text-decoration: none; display: inline-block; }
.guide { display: grid; gap: 14px; max-width: 46rem; }
.guide section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.guide h2 { margin: 0 0 6px; font-size: 1.02rem; }
.guide p { margin: 0; color: var(--muted); }
@media (max-width: 720px) { .ab { grid-template-columns: 1fr; } }
.field textarea { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font: inherit; resize: vertical; }
.chapters li:first-child { border-top: 0; }
.chapters button {
  width: 100%; display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 16px; border: 0; background: transparent; text-align: start;
}
.chapters button:hover { background: var(--surface-2); }
.chapters .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.chapters .playing { color: var(--accent); font-weight: 700; }
.chapters .time { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.chapters .ch-progress { grid-column: 2 / 4; height: 3px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.chapters .ch-progress span { display: block; height: 100%; background: var(--accent); }

.back { display: inline-block; margin-bottom: 16px; color: var(--muted); text-decoration: none; }

/* upload */
.form { max-width: 560px; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; }
.field input, .field select {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
}
.tabs { display: flex; gap: 8px; }
.recorder { padding: 16px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface); display: grid; gap: 12px; }
.rec-time { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rec-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #dc2626; margin-inline-end: 8px; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.error { color: #dc2626; font-size: .9rem; }
.empty { color: var(--muted); padding: 32px 0; text-align: center; }

/* player */
.player {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 16px; align-items: center;
  padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}
.player-info { display: flex; gap: 10px; align-items: center; min-width: 0; }
.player-text { min-width: 0; }
.player-title, .player-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-title { font-weight: 700; font-size: .92rem; }
.player-sub { color: var(--muted); font-size: .8rem; }
.player-controls { display: grid; gap: 4px; }
.buttons { display: flex; justify-content: center; align-items: center; gap: 14px; }
.icon-btn { border: 0; background: transparent; font-size: .85rem; font-weight: 700; color: var(--muted); padding: 4px 6px; }
.play-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); font-size: 1rem; }
.seek { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.seek input { flex: 1; accent-color: var(--accent); }
.player-extra { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.player { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.speed { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.speed select { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 2px 4px; }

@media (max-width: 720px) {
  .detail { grid-template-columns: 1fr; }
  .detail .cover { max-width: 200px; }
  .player { grid-template-columns: 1fr auto; gap: 8px; }
  .player-controls { grid-column: 1 / -1; grid-row: 2; }
  .player-extra { grid-row: 1; grid-column: 2; }
  .player-extra .speed > span:first-child { display: none; }
  .buttons { gap: 8px; }
  body { padding-bottom: 150px; }
  .topbar { gap: 8px; padding: 10px 12px; }
  .brand-text { display: none; }
  .nav a { padding: 6px 8px; font-size: .85rem; white-space: nowrap; }
  .lang { flex: none; }
}

.stale-notice{position:fixed;left:50%;transform:translateX(-50%);bottom:140px;z-index:50;
  display:flex;gap:.75rem;align-items:center;max-width:calc(100% - 32px);padding:.6rem .8rem;border-radius:12px;
  background:var(--surface);color:var(--text,inherit);border:1px solid var(--accent,#f59e0b);box-shadow:0 6px 24px rgba(0,0,0,.25);font-size:.9rem}

.soon { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.soon li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.soon li span { color: var(--text); font-weight: 600; }
.soon small { font-size: .8rem; }

.site-footer { max-width: 1100px; margin: 48px auto 0; padding: 24px 16px 32px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; color: var(--muted); font-size: .85rem; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer nav { display: flex; gap: 16px; }
.site-footer small { flex-basis: 100%; font-size: .75rem; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .12em; font-size: .75rem; }
.footer-brand img { border-radius: 6px; }
.about { max-width: 680px; }
.about-logo { border-radius: 16px; display: block; margin: 8px 0 16px; }
.about .lead { font-size: 1.05rem; line-height: 1.6; }
.about p { line-height: 1.65; }
