:root {
  --bg: #f6f4ef;
  --card: #fffdf8;
  --ink: #1f2a2e;
  --muted: #6b7478;
  --line: #ddd8cc;
  --accent: #1f5c52;
  --critique: #b04a3a;
  --repentir: #2f7d4f;
  --tazkiya: #2d5f9a;
  --neutre: #9aa0a3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14191b; --card: #1b2225; --ink: #e8e6df; --muted: #98a2a6; --line: #2d373b;
    --accent: #5fb3a2; --critique: #e0806f; --repentir: #6cc28b; --tazkiya: #7fa9e0; --neutre: #6d767a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, "Segoe UI", sans-serif; }
.top, .layout, .banner { max-width: 1200px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.top { padding-top: 24px; padding-bottom: 8px; }
h1 { font-size: 1.6rem; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 16px 0 6px; }
.sub, .muted { color: var(--muted); margin: 0; }
.banner { background: #f3e3b8; color: #4b3a0c; border-radius: 8px; padding: 8px 14px; margin: 8px auto; width: calc(100% - 32px); }
@media (prefers-color-scheme: dark) { .banner { background: #3a3220; color: #f0dca4; } }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; padding-bottom: 32px; }
.graphzone, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 4px 10px; }
.controls input[type=range] { flex: 1; min-width: 160px; accent-color: var(--accent); }
.controls output { min-width: 64px; font-variant-numeric: tabular-nums; }
button { font: inherit; background: transparent; color: var(--accent); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
button:hover { background: var(--bg); }
#graph { width: 100%; height: 480px; display: block; }
.node circle { fill: var(--card); stroke: var(--ink); stroke-width: 1.5; cursor: pointer; }
.node.sel circle { fill: var(--accent); stroke: var(--accent); }
.node text { fill: var(--ink); font-size: 12px; pointer-events: none; }
.link { fill: none; stroke-width: 2; cursor: pointer; }
.link.lifted { stroke-dasharray: 5 4; opacity: .55; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 6px 4px 0; margin: 0; font-size: .85rem; color: var(--muted); }
.legend i { display: inline-block; width: 22px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 6px; }
.panel { align-self: start; position: sticky; top: 12px; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { padding: 10px 0; border-top: 1px solid var(--line); }
.tl .when { font-variant-numeric: tabular-nums; font-weight: 600; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; border: 1px solid currentColor; margin-left: 6px; }
.tag.critique { color: var(--critique); } .tag.repentir, .tag.retractation { color: var(--repentir); } .tag.tazkiya { color: var(--tazkiya); }
.state { background: var(--bg); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.unver { color: var(--muted); font-style: italic; }
blockquote { margin: 6px 0 0; padding: 0; color: var(--ink); }
a { color: var(--accent); }
.questions, .section-title { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.section-title { margin-top: 24px; margin-bottom: 10px; }
.questions h2 { margin: 16px 0 10px; }
details.q { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0; margin-bottom: 12px; }
details.q > summary { cursor: pointer; padding: 14px 16px; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.q > summary::-webkit-details-marker { display: none; }
details.q > summary::after { content: "+"; color: var(--muted); font-weight: 400; }
details.q[open] > summary::after { content: "\2212"; }
.qbody { padding: 0 16px 16px; }
.qbody h3 { color: var(--accent); }
.cit { padding: 12px 0; border-top: 1px solid var(--line); }
.cit .qui { font-weight: 600; }
.ar { font-family: "Amiri", "Traditional Arabic", "Noto Naskh Arabic", serif; font-size: 1.3rem; line-height: 2; direction: rtl; text-align: right; margin: 6px 0; }
.fr { margin: 4px 0; }
.lbl { font-size: .8rem; color: var(--muted); }
.note { background: var(--bg); border-radius: 8px; padding: 8px 10px; margin-top: 6px; font-size: .92rem; }
.todo { color: var(--muted); padding-left: 20px; }
.lockscreen { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.lockbox { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; width: 100%; max-width: 360px; display: grid; gap: 10px; }
.lockbox h1 { font-size: 1.3rem; margin-bottom: 6px; }
.lockbox input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.lockbox button { background: var(--accent); color: #fff; border-color: var(--accent); padding: 8px; }
.lockbox button:hover { background: var(--accent); opacity: .9; }
.pwerr { color: var(--critique); margin: 0; }
[hidden] { display: none !important; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } .panel { position: static; } #graph { height: 380px; } }
