/* Narrateurs : soulignement, carte au survol, index, pages /sanad et /rawi */
.rw { cursor: help; border-bottom: 1px dotted var(--green-2, #2f7a68); color: inherit; }
.rw:not(.rw-i):not(.rw-u):hover { color: var(--green, #1f5f50); background: var(--soft, #f3efe4); border-radius: 3px; }
.rw-q { border-bottom-style: dashed; border-bottom-color: var(--gold, #b58a3c); }
.rw-u { border-bottom-color: var(--muted, #999); }
.rw-i { border-bottom: none; color: var(--green, #1f5f50); font-weight: 600; }
.rwc { position: absolute; z-index: 9999; background: var(--paper, #fffdf8); color: var(--ink, #222); border: 1px solid var(--line, #e3dccb);
  border-radius: 14px; box-shadow: 0 12px 34px rgba(0, 0, 0, .18); padding: 14px 16px 12px; font-size: 14px; line-height: 1.7; text-align: right; }
.rwc[hidden] { display: none; }
.rwc-r { color: var(--muted, #888); font-size: 12px; }
.rwc-n { font-weight: 700; font-size: 16px; margin: 4px 0 2px; line-height: 1.5; }
.rwc-k { color: var(--muted, #888); font-size: 13px; }
.rwc-m { color: var(--ink2, #555); font-size: 13px; margin: 3px 0; }
.rwc-v { margin: 5px 0; font-size: 13.5px; }
.rwc-t { margin: 4px 0; }
.rwc-a { margin: 6px 0; font-size: 13px; display: grid; gap: 3px; }
.rwc-a a { color: var(--green, #1f5f50); }
.rwc-x { color: var(--muted, #888); font-size: 13px; margin: 6px 0 0; }
.rwc-go { display: block; border-top: 1px solid var(--line, #e3dccb); margin-top: 8px; padding-top: 8px; color: var(--green, #1f5f50); font-weight: 600; text-decoration: none; }
.rw-tw { color: var(--gold, #b58a3c); }
.rwb { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .78em; font-weight: 600; white-space: nowrap; background: #eee; color: #444; }
.rwb.t-ok { background: #e2f1e8; color: #1d6b41; } .rwb.t-mid { background: #e8eff8; color: #2a5a8c; }
.rwb.t-low { background: #fbf1dc; color: #8a5a10; } .rwb.t-bad { background: #fbe3e1; color: #a2302a; }
.rwb.t-na { background: #eee; color: #888; } .rwb.t-warn { background: #fdecea; color: #b03a2e; font-weight: 500; }
[data-theme="dark"] .rwb.t-ok { background: #1f3a2b; color: #9bd7b2; } [data-theme="dark"] .rwb.t-mid { background: #1f2d40; color: #a8c6ea; }
[data-theme="dark"] .rwb.t-low { background: #3d3020; color: #f0c98a; } [data-theme="dark"] .rwb.t-bad, [data-theme="dark"] .rwb.t-warn { background: #45211f; color: #f3a59d; }
[data-theme="dark"] .rwb.t-na { background: #333; color: #aaa; }
.hd-sn { text-decoration: none; }
/* index */
.rwi { border: 1px solid var(--line, #e3dccb); border-radius: 14px; padding: 14px; margin: 0 0 18px; background: var(--paper, #fffdf8); }
.rwi-h { margin: 0 0 4px; font-size: 18px; }
.rwi-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.rwi-q { flex: 1 1 260px; padding: 9px 12px; border: 1px solid var(--line, #ddd); border-radius: 10px; background: var(--field, #fff); color: inherit; font: inherit; }
.rwi-tabs, .rwi-l { display: flex; flex-wrap: wrap; gap: 4px; }
.rwi-tabs button, .rwi-l button { border: 1px solid var(--line, #ddd); background: transparent; color: inherit; border-radius: 8px; padding: 5px 10px; cursor: pointer; font: inherit; }
.rwi-l button { padding: 2px 8px; min-width: 30px; }
.rwi-tabs button.on, .rwi-l button.on { background: var(--green, #1f5f50); color: #fff; border-color: transparent; }
.rwi-th, .rwi-r { display: grid; grid-template-columns: 1fr 110px 110px 60px; gap: 8px; align-items: center; }
.rwi-th { font-size: 12px; color: var(--muted, #888); margin-top: 12px; padding: 0 8px; }
.rwi-list { max-height: 520px; overflow: auto; margin-top: 4px; }
.rwi-r { padding: 8px; border-bottom: 1px solid var(--line, #eee); text-decoration: none; color: inherit; }
.rwi-r:hover { background: var(--hover, #f6f1e6); }
.rwi-n { display: flex; flex-direction: column; } .rwi-n small { font-size: 12px; }
.rwi-c { color: var(--muted, #888); font-size: 13px; text-align: left; }
@media (max-width: 640px) { .rwi-th, .rwi-r { grid-template-columns: 1fr 80px 80px; } .rwi-c, .rwi-th span:last-child { display: none; } }
/* pages /sanad et /rawi */
.sn { display: grid; grid-template-columns: 1fr 190px; gap: 26px; max-width: 1180px; margin: 0 auto; padding: 18px 14px 60px; }
.sn-side { position: sticky; top: 12px; align-self: start; font-size: .85em; border-inline-start: 1px solid var(--line, #e3dccb); padding-inline-start: 14px; }
.sn-side b { display: block; margin-bottom: 6px; } .sn-side a { display: block; color: var(--ink2, #555); text-decoration: none; padding: 4px 0; }
.sn-side a:hover { color: var(--green, #1f5f50); }
@media (max-width: 860px) { .sn { grid-template-columns: 1fr; } .sn-side { display: none; } }
.sn-crumb { font-size: .8em; color: var(--muted, #888); margin-bottom: 10px; } .sn-crumb a { color: inherit; }
.sn-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line, #e3dccb); padding-bottom: 10px; margin-bottom: 16px; }
.sn-bar .btns { display: flex; gap: 4px; } .sn-bar a.bt { color: var(--ink, #222); min-width: 28px; text-align: center; } .sn-bar button, .sn-bar a.bt { border: 1px solid var(--line, #ddd); background: transparent; color: inherit; border-radius: 8px; padding: 4px 10px; cursor: pointer; font: inherit; text-decoration: none; }
.sn-matn { position: relative; padding: 10px 0 20px; }
.sn-num { position: absolute; left: 0; top: 0; font-size: 72px; color: var(--line, #e3dccb); font-weight: 700; line-height: 1; pointer-events: none; }
.sn-ch { color: var(--muted, #888); font-size: .85em; margin-bottom: 8px; }
.sn-txt { font-size: 1.45em; line-height: 2.1; font-family: 'Amiri', 'Scheherazade New', serif; }
.sn-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sn-sec { margin: 30px 0 0; scroll-margin-top: 12px; }
.sn-sec > h2 { font-size: 1.2em; display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line, #e3dccb); padding-bottom: 6px; }
.sn-sec > h2 small { font-size: .7em; color: var(--muted, #888); font-weight: 400; }
.sn-box { border: 1px solid var(--line, #e3dccb); border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: var(--paper, #fffdf8); }
.sn-box h3 { margin: 0 0 6px; font-size: 1em; }
.sn-box ul { margin: 6px 0 0; padding-inline-start: 18px; font-size: .92em; color: var(--ink2, #555); }
.sn-note { font-size: .82em; color: var(--muted, #888); }
.sn-chain { list-style: none; margin: 0; padding: 0; }
.sn-chain li { display: grid; grid-template-columns: 34px 1fr 70px; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line, #eee); position: relative; }
.sn-chain .i { width: 22px; height: 22px; border: 2px solid var(--muted, #999); border-radius: 50%; margin-top: 4px; background: var(--paper, #fff); }
.sn-chain li:not(:last-child) .i::after { content: ''; position: absolute; top: 40px; bottom: -12px; width: 2px; background: var(--line, #ddd); margin-inline-start: 8px; }
.sn-chain .nm { font-size: 1.15em; font-weight: 700; color: var(--green, #1f5f50); text-decoration: none; }
.sn-chain .lq { color: var(--muted, #888); font-size: .82em; margin-inline-start: 6px; }
.sn-chain .ev { font-size: .88em; margin-top: 4px; color: var(--ink2, #555); }
.sn-chain .d { font-size: .8em; color: var(--muted, #888); text-align: left; } .sn-chain .d b { display: block; font-size: 1.2em; color: var(--ink, #222); }
.sn-chain .pill { display: inline-block; border: 1px solid var(--line, #ddd); border-radius: 999px; padding: 0 8px; font-size: 12px; margin-inline-end: 4px; }
.sn-bk { margin: 12px 0; } .sn-bk h4 { color: #a2302a; margin: 0 0 4px; font-size: 1em; }
[data-theme="dark"] .sn-bk h4 { color: #f3a59d; }
.sn-bk .lnk { display: inline-block; margin: 2px 0 2px 12px; font-size: .92em; color: var(--green-2, #2f7a68); text-decoration: none; }
.sn-bk .lnk small { color: var(--muted, #888); }
.sn-bk .x { font-size: 1em; line-height: 1.9; margin: 4px 0 10px; padding: 8px 10px; border-inline-start: 3px solid var(--line, #ddd); }
.sn-tabs { display: flex; gap: 4px; margin: 8px 0; flex-wrap: wrap; } .sn-tabs button { border: 1px solid var(--line, #ddd); background: transparent; color: inherit; border-radius: 8px; padding: 3px 10px; cursor: pointer; font: inherit; font-size: 13px; }
.sn-tabs button.on { background: var(--green, #1f5f50); color: #fff; border-color: transparent; }
details.sn-cmp { border: 1px solid var(--line, #e3dccb); border-radius: 10px; margin: 6px 0; padding: 0 12px; background: var(--paper, #fffdf8); }
details.sn-cmp summary { cursor: pointer; padding: 10px 0; display: flex; justify-content: space-between; font-weight: 600; }
.sn-diff { font-size: 1.05em; line-height: 2; padding: 6px 0 12px; } .sn-diff ins { background: #e2f1e8; text-decoration: none; } .sn-diff del { background: #fbe3e1; }
[data-theme="dark"] .sn-diff ins { background: #1f3a2b; } [data-theme="dark"] .sn-diff del { background: #45211f; }
.sn-kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: .95em; } .sn-kv dt { color: var(--muted, #888); } .sn-kv dd { margin: 0; }
.sn-chips { display: flex; flex-wrap: wrap; gap: 6px; } .sn-chips a { border: 1px solid var(--line, #ddd); border-radius: 999px; padding: 2px 12px; font-size: .88em; color: inherit; text-decoration: none; }
.rp-h { font-size: 1.6em; margin: 4px 0; } .rp-sub { color: var(--muted, #888); }
.rp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } @media (max-width: 720px) { .rp-two { grid-template-columns: 1fr; } }
.rp-two .sn-box h3 { display: flex; justify-content: space-between; gap: 8px; }
.rp-src { white-space: pre-line; font-size: 1em; line-height: 1.9; max-height: 260px; overflow: auto; }
.rp-list { display: flex; flex-wrap: wrap; gap: 6px; } .rp-list a { border: 1px solid var(--line, #ddd); border-radius: 10px; padding: 3px 10px; font-size: .9em; color: inherit; text-decoration: none; }
.rp-list a small { color: var(--muted, #888); }
.rp-pick { position: relative; } .rp-pick .rwi-list { position: absolute; z-index: 20; inset-inline: 0; background: var(--paper, #fff); border: 1px solid var(--line, #ddd); border-radius: 10px; max-height: 300px; }
.rp-cmp { width: 100%; border-collapse: collapse; font-size: .95em; } .rp-cmp th, .rp-cmp td { border: 1px solid var(--line, #e3dccb); padding: 8px; vertical-align: top; text-align: right; }
.rp-cmp th { background: var(--soft, #f3efe4); width: 150px; }

.rw-size { position: fixed; z-index: 50; bottom: 16px; left: 16px; display: flex; gap: 2px; background: var(--paper, #fffdf8); border: 1px solid var(--line, #e3dccb);
  border-radius: 12px; padding: 4px; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.rw-size button { border: 0; background: transparent; color: var(--ink, #222); font: 600 15px/1 "Inter", system-ui, sans-serif; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.rw-size button:hover { background: var(--hover, #f3efe4); }
.rwi .rwb, .rwc .rwb { font-size: 12px; }

.hd-pg { background: #e8eff8; color: #2a5a8c; border-radius: 6px; padding: 0 7px; font-size: 12px; margin-inline-start: 6px; white-space: nowrap; }
[data-theme="dark"] .hd-pg { background: #1f2d40; color: #a8c6ea; }
.hd-sh { margin-top: 8px; } .hd-shd { border: 1px solid var(--line, #e3dccb); border-radius: 10px; margin: 6px 0; padding: 0 12px; }
.hd-shd summary { cursor: pointer; padding: 8px 0; font-size: 14px; } .hd-shd p { font-size: 1.05em; line-height: 1.9; }
.hd-shd { max-height: 460px; overflow: auto; }

#hd-mode, #tf-mode { padding: 0 10px; border: 1px solid var(--line, #ddd); border-radius: 10px; background: var(--field, #fff); color: inherit; font: inherit; }

.ad-ref { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted, #8a8a8a); border-top: 1px dashed var(--line, #e3dccb); padding-top: 5px; }
.ad-res .ad-ref .bt, .ad-ref span { display: inline !important; }
.ad-ref .bt { color: var(--green, #1f5f50); font-weight: 600; }
.bt { background: none !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; }
