/* Polices hébergées localement (aucun appel à Google Fonts, licences OFL dans assets/fonts) */
@font-face { font-family: "Amiri Quran"; font-style: normal; font-weight: 400; font-display: block; src: url("fonts/amiri-quran-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Scheherazade New"; font-style: normal; font-weight: 400; font-display: block; src: url("fonts/scheherazade-new-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: "Noto Naskh Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/noto-naskh-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: "Noto Naskh Arabic"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("fonts/noto-naskh-arabic-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }

/* Bayān : style clair et sobre */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #667085;
  --line: #e6e8ec;
  --line-2: #f0f2f5;
  --accent: #0f7b5f;
  --accent-2: #e8f4ef;
  --accent-ink: #0a5c47;
  --gold: #a86f00;
  --gold-bg: #fdf3dc;
  --red: #c0362c;
  --red-bg: #fdecea;
  --blue: #1a5fd0;
  --blue-bg: #e9f0fd;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --ar-size: 32px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-quran: "Amiri Quran", "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --font-ar: "Noto Naskh Arabic", "Amiri Quran", "Segoe UI", serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[lang="ar"] { font-family: var(--font-ar); }
body.qf-sch { --font-quran: "Scheherazade New", "Amiri Quran", serif; }
body.qf-naskh { --font-quran: "Noto Naskh Arabic", "Amiri Quran", serif; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .86em; }
code { background: var(--line-2); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small, small { font-size: 13px; }
.right { text-align: end; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 24px; padding-bottom: 48px; min-height: 70vh; }

/* Barre du haut */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a { color: var(--muted); padding: 8px 12px; border-radius: 999px; font-weight: 500; }
.mainnav a:hover { background: var(--line-2); color: var(--text); text-decoration: none; }
.mainnav a.on { color: var(--accent-ink); background: var(--accent-2); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.langs { display: flex; background: var(--line-2); border-radius: 999px; padding: 3px; }
.langs a { padding: 4px 10px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 600; }
.langs a.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.langs a:hover { text-decoration: none; }
.icon-btn.menu-btn { display: none; }

/* Cartes et sections repliables */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.fold { padding: 0; }
.fold > .fold-head { display: flex; align-items: center; gap: 8px; }
.fold-toggle { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: none; border: 0; padding: 16px 20px; font: inherit; font-weight: 600; font-size: 16px; color: var(--text); cursor: pointer; text-align: start; border-radius: var(--radius); }
.fold-toggle:hover { background: #fafbfc; }
.fold-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fold-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fold-title svg { color: var(--accent); }
.chev { color: var(--muted); transition: transform .25s ease; flex: none; }
.fold.is-open > .fold-head .chev { transform: rotate(180deg); }
.fold-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
.fold.is-open > .fold-body { grid-template-rows: 1fr; }
.fold-inner { overflow: hidden; min-height: 0; }
.card.fold > .fold-body > .fold-inner { padding: 0 20px; }
.card.fold.is-open > .fold-body > .fold-inner { padding-bottom: 20px; }
.count { background: var(--line-2); color: var(--muted); border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 600; }

/* Boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; line-height: 1.2; transition: background .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-light { background: #fff; color: var(--text); border-color: var(--line); }
.btn-light:hover { background: var(--line-2); }
.btn-danger-light { background: #fff; color: var(--red); border-color: #f2c9c5; }
.btn-danger-light:hover { background: var(--red-bg); }
.btn-ms { background: #fff; color: #1f1f1f; border: 1px solid #8c8c8c; border-radius: 6px; width: 100%; padding: 11px; }
.btn-ms:hover { background: #f3f3f3; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn-row.end { justify-content: flex-end; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--line-2); color: var(--text); text-decoration: none; }
.icon-btn.on { color: var(--accent); }
.icon-btn.on svg path { fill: currentColor; }
.icon-btn.playing { color: var(--accent); background: var(--accent-2); }
.input { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; padding: 9px 12px; font: inherit; color: var(--text); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
textarea.input { resize: vertical; }
.input-xs { width: 80px; }
.input-sm { width: 190px; padding: 6px 10px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.stack > * + * { margin-top: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input, .switch input { accent-color: var(--accent); width: 16px; height: 16px; }
.switch { display: flex; align-items: center; gap: 10px; margin: 8px 0; cursor: pointer; }
.details { margin: 10px 0; }
.details summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); margin-bottom: 8px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 2px 0; }

/* Alertes, étiquettes */
.alert { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; border: 1px solid; }
.alert-ok { background: var(--accent-2); border-color: #bfe2d4; color: var(--accent-ink); }
.alert-err { background: var(--red-bg); border-color: #f2c9c5; color: #8e241c; }
.alert-warn { background: var(--gold-bg); border-color: #f0dca8; color: #6b4700; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; background: var(--line-2); color: var(--muted); vertical-align: middle; }
.tag-gold { background: var(--gold-bg); color: var(--gold); }
.tag-green { background: var(--accent-2); color: var(--accent-ink); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-blue { background: var(--blue-bg); color: var(--blue); }

/* Accueil */
.hero { text-align: center; padding: 36px 0 28px; }
.hero h1 { font-size: 40px; letter-spacing: -.02em; margin: 0 0 6px; line-height: 1.2; }
.hero-ar { font-family: var(--font-quran); color: var(--accent); font-weight: 400; margin-inline-start: 6px; }
.lead { color: var(--muted); font-size: 17px; margin: 0 0 24px; }
.searchbar { display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: var(--shadow-lg); }
[dir="rtl"] .searchbar { padding: 6px 18px 6px 6px; }
.searchbar svg { color: var(--muted); flex: none; }
.searchbar input { flex: 1; border: 0; outline: none; font: inherit; font-size: 16px; background: none; min-width: 0; }
.searchbar-flat { box-shadow: none; max-width: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { max-width: 320px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.surah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.surah-item, .juz-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; }
.surah-item:hover, .juz-item:hover { border-color: #b8dccd; box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.num { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-2); color: var(--accent-ink); font-weight: 700; font-size: 13px; }
.si-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.si-main strong { font-weight: 600; }
.si-main small, .juz-item small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.si-ar { font-family: var(--font-quran); font-size: 20px; color: var(--accent-ink); }
.juz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.recent-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.recent-list a { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 10px; background: var(--line-2); color: var(--text); }
.recent-list a:hover { background: var(--accent-2); text-decoration: none; }
.goto { display: flex; gap: 8px; }
.goto .input { max-width: 140px; }

/* Lecteur */
.page-title { font-size: 28px; letter-spacing: -.02em; margin: 4px 0 16px; }
.section-title { font-size: 20px; margin: 28px 0 12px; }
.crumbs { color: var(--muted); font-size: 14px; margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.surah-head { text-align: center; padding: 24px 20px 20px; background: linear-gradient(180deg, #fff, #fbfdfc); }
.surah-head h1 { margin: 4px 0; font-size: 28px; letter-spacing: -.02em; }
.sh-ar { font-family: var(--font-quran); font-size: 34px; color: var(--accent-ink); margin: 0; line-height: 1.8; }
.basmala { font-family: var(--font-quran); font-size: 30px; margin: 16px 0 4px; line-height: 2; }
.sh-nav { display: flex; justify-content: space-between; gap: 8px; }
.sh-nav-bottom { margin-top: 24px; flex-wrap: wrap; }
[dir="rtl"] .flip { display: inline-block; transform: scaleX(-1); }
.settings-grid { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 16px; align-items: end; margin-bottom: 8px; }
.settings-grid .switch { margin-bottom: 18px; }
.tf-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tf-group { display: flex; flex-direction: column; gap: 6px; background: var(--line-2); border-radius: 12px; padding: 12px; }
.tf-group strong { font-size: 13px; color: var(--muted); }

.ayah { padding: 16px 20px 6px; scroll-margin-top: 80px; }
.ayah:target, .ayah.flash { box-shadow: 0 0 0 3px var(--accent-2), var(--shadow); border-color: #b8dccd; }
.ayah-top { display: flex; align-items: center; gap: 8px; }
.ayah-key { font-size: 13px; font-weight: 700; color: var(--accent-ink); background: var(--accent-2); border-radius: 999px; padding: 3px 10px; }
.ayah-key:hover { text-decoration: none; }
.ayah-actions { margin-inline-start: auto; display: flex; gap: 2px; }
.ayah-ar { font-family: var(--font-quran); font-size: var(--ar-size); line-height: 2.2; text-align: right; margin: 10px 0 6px; color: #111; word-spacing: 2px; }
.ayah-ar-sm { font-size: 26px; }
.ayah-ar-lg { font-size: calc(var(--ar-size) + 6px); }
.ayah-end { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; font-size: .58em; border: 1.5px solid var(--accent); color: var(--accent-ink); border-radius: 50%; margin-inline: 4px; font-family: var(--font-ar); line-height: 1; vertical-align: middle; }
.ayah-tr { color: #3a4048; font-size: 16px; margin: 0 0 10px; }
.hide-tr .ayah-tr { display: none; }
.tafsir-fold { border-top: 1px solid var(--line-2); margin: 6px -20px 0; }
.tafsir-fold .fold-toggle { padding: 10px 20px; font-size: 14px; color: var(--accent-ink); border-radius: 0 0 var(--radius) var(--radius); }
.tafsir-fold.is-open .fold-toggle { border-radius: 0; }
.tafsir-fold .fold-inner { padding: 0 20px; }
.tafsir-fold.is-open .fold-inner { padding-bottom: 16px; }
.tf-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.tf-tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tf-tab.on { background: var(--accent-2); border-color: #b8dccd; color: var(--accent-ink); }
.tafsir-text { font-size: 15.5px; line-height: 1.75; color: #2b3036; }
.tafsir-text p { margin: 0 0 .8em; }
.tafsir-text.is-ar, .tf-pane.is-ar { font-family: var(--font-ar); font-size: 19px; line-height: 2; text-align: right; }
.q-cite { font-family: var(--font-quran); color: var(--accent-ink); }
.tf-note { background: var(--gold-bg); color: #6b4700; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; font-family: var(--font); text-align: start; }
.tafsir-src { font-size: 12px; margin: 6px 0 0; }
.tafsir-card .fold-inner { font-size: 15px; }
.tr-list { display: flex; flex-direction: column; gap: 14px; }
.tr-item { border-inline-start: 3px solid var(--accent-2); padding-inline-start: 14px; }
.tr-item p { margin: 4px 0 0; font-size: 16px; }
.tr-name { font-size: 13px; font-weight: 600; color: var(--muted); }
.skeleton { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--line-2), #e9ecf0, var(--line-2)); background-size: 200% 100%; animation: sk 1.2s infinite; margin: 10px 0; }
.skeleton:nth-child(2) { width: 85%; }
.skeleton:nth-child(3) { width: 60%; }
@keyframes sk { to { background-position: -200% 0; } }

/* Recherche */
.result { display: block; padding: 12px 0; border-bottom: 1px solid var(--line-2); color: var(--text); }
.result:last-child { border-bottom: 0; }
.result:hover { text-decoration: none; background: #fbfcfd; }
.result-ref { display: block; font-size: 13px; font-weight: 600; color: var(--accent-ink); margin-bottom: 4px; }
.result-ar { display: block; font-family: var(--font-quran); font-size: 24px; line-height: 2; }
.result-text { display: block; }
.result-text.is-ar { font-size: 18px; line-height: 1.9; }
mark { background: #fff1b8; color: inherit; border-radius: 3px; padding: 0 2px; }
.empty { text-align: center; color: var(--muted); padding: 32px; }

/* Favoris */
.bm-list .card { padding: 16px 20px; }
.bm-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Tableaux, admin */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--accent-ink); border-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { margin: 0; display: flex; flex-direction: column; gap: 2px; padding: 16px; }
.stat span { font-size: 13px; color: var(--muted); }
.stat strong { font-size: 24px; letter-spacing: -.02em; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.kv li:last-child { border: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
.log li { padding: 6px 0; }
.progress { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress .bar { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .3s; }
.progress-sm { height: 6px; margin: 2px 0 4px; min-width: 120px; }
.prog-cell { min-width: 150px; }
.sticky-actions { position: sticky; bottom: 12px; background: rgba(246, 247, 249, .9); backdrop-filter: blur(8px); padding: 10px; border-radius: 999px; }
.intro p { margin: 0 0 6px; }
.howto { background: var(--blue-bg); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; font-size: 14px; }
.howto ol { margin: 8px 0; padding-inline-start: 20px; }
.howto li { margin: 4px 0; }
code.copy { cursor: copy; }
.modal { position: fixed; inset: 0; background: rgba(16, 24, 40, .4); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal-card { width: min(520px, 100%); box-shadow: var(--shadow-lg); }
.modal-card h2 { margin-top: 0; font-size: 20px; }

.block-check { display: flex; align-items: flex-start; margin: 8px 0; }
.block-check input { margin-top: 4px; }
.zip-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; background: var(--line-2); border-radius: 10px; margin: 8px 0; }
.zip-row .btn-row { margin: 0; }
.plain-ol { padding-inline-start: 20px; margin: 0 0 10px; }
.mirror-status { margin-top: 12px; }

pre.code { background: #0f1720; color: #e6edf3; border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: 13px; }
pre.code code { background: none; color: inherit; padding: 0; word-break: normal; }
.bullets { margin: 0; padding-inline-start: 18px; }
.bullets li { margin: 6px 0; }
#swagger .swagger-ui .info { margin: 10px 0; }
#swagger .swagger-ui .scheme-container { box-shadow: none; padding: 10px 0; }
#swagger .swagger-ui, #swagger .swagger-ui .opblock-tag { font-family: var(--font); }
.key-reveal { background: var(--accent-2); border: 1px dashed var(--accent); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }

/* Connexion */
.auth-box { max-width: 420px; margin: 40px auto; text-align: center; padding: 32px; }
.auth-box h1 { margin: 12px 0 4px; font-size: 24px; }
.auth-box form { text-align: start; margin-top: 16px; }
.sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0 4px; }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Installation */
.install-wrap { max-width: 720px; margin: 40px auto; padding: 0 20px; }
.install-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.install-brand div { display: flex; flex-direction: column; line-height: 1.3; }
.install-brand strong { font-size: 20px; }
.install h1 { font-size: 22px; margin-top: 0; }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; counter-reset: st; flex-wrap: wrap; }
.steps li { counter-increment: st; font-size: 13px; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }
.steps li::before { content: counter(st) ". "; }
.steps li.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.checks { list-style: none; padding: 0; }
.checks li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.checks .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.checks .ok .dot { background: var(--accent); }
.checks .ko .dot { background: var(--red); }
.checks .ko { color: var(--red); }

/* Pied de page, notification */
.footer { border-top: 1px solid var(--line); background: #fff; padding: 22px 0; font-size: 13px; color: var(--muted); }
.footer p { margin: 4px 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1f2328; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 820px) {
  .icon-btn.menu-btn { display: inline-grid; }
  .mainnav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 10px 16px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); }
  .mainnav.open { display: flex; }
  .topbar-in { justify-content: space-between; }
  .grid-2, .settings-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .ayah-ar { font-size: calc(var(--ar-size) - 4px); }
  .inline-form { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .footer, .ayah-actions, .tafsir-fold .fold-toggle, .reader-settings, .sh-nav { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; }
}
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; margin: 6px 0 18px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.bar-col span { width: 100%; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar-col small { color: var(--muted); font-size: 11px; }
