/* pro.css — professional pass (2026-11-20). Loaded after style.css, before look-*.css.
   Undo the whole pass: copy web_snapshots/before_pro_20261120 back over web/. */

/* ---------- icons ---------- */
.ic { width: 1.15em; height: 1.15em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.ic-fill { fill: currentColor; stroke: none; }
svg[width="0"] { width: 0 !important; height: 0 !important; }

/* ---------- base rhythm ---------- */
body { line-height: 1.75; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1040px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
h1, h2, h3 { letter-spacing: 0; }
.skip { position: absolute; top: -60px; right: 12px; z-index: 200; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 10px; }
.skip:focus { top: 10px; }
.muted .ic { opacity: .8; margin-inline-end: 4px; }

/* ---------- header ---------- */
.top { box-shadow: 0 1px 0 var(--line); border-bottom: 0; }
.top-in { height: 64px; gap: 16px; }
.logo { width: 36px; height: 36px; border-radius: 11px; }
.logo .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.top-search { height: 42px; max-width: 560px; }
.top-search .go .ic { width: 19px; height: 19px; }
.top-nav { gap: 4px; }
.top-nav .nav-txt { padding: 8px 10px; border-radius: 10px; font-weight: 500; }
.top-nav .nav-txt:hover, .top-nav .nav-txt.on { background: var(--bg-2); text-decoration: none; color: var(--ink); }
.top-nav a.saved-link { font-weight: 600; height: 40px; }
.top-nav a.saved-link.on { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.theme { width: 40px; height: 40px; border-radius: 12px; }
.theme .ic { width: 20px; height: 20px; }
.saved-n { background: var(--brand); color: var(--brand-ink); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 12px; font-weight: 500; font-size: .93rem; line-height: 1; white-space: nowrap; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: var(--brand-ink); }
.btn-primary.on { background: color-mix(in srgb, var(--accent) 16%, var(--card)); border-color: var(--accent); color: var(--accent); }
.btn-primary.on .ic { fill: currentColor; }
.link-btn { border: 0; background: none; color: var(--brand); cursor: pointer; font: 600 .9rem var(--ui); padding: 4px 6px; border-radius: 8px; }
.link-btn:hover { background: var(--bg-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip .ic { width: 16px; height: 16px; }
.chip-ghost { background: none !important; border-style: dashed !important; }

/* ---------- home ---------- */
.big-search { min-height: 62px; }
.big-search > .ic { width: 22px; height: 22px; margin: 0 14px; color: var(--muted); }
.big-search .mic { margin-inline-end: 4px; }
.mine-head .seg button[hidden] { display: none; }
.wmeta { font-size: .78rem; color: var(--muted); margin-top: auto; }
.wthumb-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.wplay .ic { width: 12px; height: 12px; margin-inline-end: 4px; vertical-align: -1px; }
.wcard { gap: 6px; }
.wx .ic { width: 14px; height: 14px; stroke-width: 2.4; }

/* ---------- results ---------- */
.res { padding: 18px 20px; }
.res-title { margin: 8px 0 6px; }
.res-act { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .88rem; }
.res-act a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.res-act .ic { width: 14px; height: 14px; }
.act-play { color: var(--brand); }
html[data-dens="compact"] .res-act { display: none; }
.share-res { height: 32px; padding: 0 12px; }
.more summary .ic { width: 16px; height: 16px; }
.related h2 .ic { color: var(--accent); }
.sugg a { display: flex; align-items: center; gap: 8px; }
.sugg a .ic { width: 14px; height: 14px; color: var(--muted); }
.sugg a.sh { color: var(--ink-2); }
.sugg .sugg-all { display: flex; align-items: center; gap: 8px; }

/* ---------- video page ---------- */
.vpage { padding-top: 20px; }
.back { display: inline-flex; margin-bottom: 10px; font-weight: 500; }
.player { border-radius: 16px; }
.lite .play { width: 72px; height: 72px; margin: -36px 0 0 -36px; }
.lite .play .ic { width: 30px; height: 30px; margin-left: 4px; color: #fff; }
.lite .from { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.lite .from .ic { width: 12px; height: 12px; }
.noplayer { display: flex; gap: 8px; align-items: center; justify-content: center; }
.resume { margin: 10px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9rem; }
.resume[hidden] { display: none; }
.v-head { margin: 16px 0 22px; }
.v-head h1 { margin: 8px 0 14px; }
.actions { gap: 8px; }
.speed { margin-top: 14px; gap: 6px; }
.speed .muted { margin-inline-end: 4px; }
.speed button { height: 30px; min-width: 46px; border-radius: 9px; }
.tr { padding: 0; overflow: clip; }
.tr-head { padding: 14px 18px; margin: 0; border-bottom: 1px solid var(--line); top: 64px; }
.tr-head h2 { display: inline-flex; align-items: center; gap: 8px; }
.tr-head h2 .ic { color: var(--brand); }
.tr-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.find { height: 40px; max-width: 340px; }
.find .ic { width: 17px; height: 17px; color: var(--muted); }
.note { display: flex; gap: 8px; align-items: flex-start; margin: 14px 18px; }
.note .ic { margin-top: 4px; color: var(--accent); }
.paras { padding: 0 10px 14px; }
.para { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 10px; border-radius: 12px; transition: background .2s; }
.para + .para { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.para .txt { margin: 0; }
.para .time { margin-top: 6px; }
.para.cur { box-shadow: inset -3px 0 0 var(--accent); }
.ptools { display: flex; flex-direction: column; gap: 2px; opacity: 0; transition: opacity .15s; }
.para:hover .ptools, .para.cur .ptools, .ptools:focus-within { opacity: 1; }
@media (hover: none) { .ptools { opacity: .55; flex-direction: row; } .para { grid-template-columns: auto minmax(0, 1fr); } .ptools { grid-column: 2; justify-content: flex-start; } }
.moment { opacity: 1; width: 32px; height: 32px; margin: 0; }
.moment .ic { width: 17px; height: 17px; }
.moment.star.on .ic { fill: currentColor; }
/* the «follow» toggle as a switch */
.follow { gap: 8px; }
.follow input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-toggle { width: 36px; height: 20px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; flex-shrink: 0; }
.sw-toggle::after { content: ""; position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.follow input:checked + .sw-toggle { background: var(--brand); }
.follow input:checked + .sw-toggle::after { transform: translateX(-16px); }
.follow input:focus-visible + .sw-toggle { outline: 2.5px solid var(--brand); outline-offset: 2px; }
.mini-x .ic { width: 14px; height: 14px; stroke-width: 2.6; }

/* wide screens: player + details stay beside the transcript */
@media (min-width: 1100px) {
  .is-video .wrap.vpage { max-width: 1320px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 32px; align-items: start; }
  .is-video .v-main { position: sticky; top: 84px; }
  .is-video .v-sticky { max-height: calc(100vh - 100px); overflow: auto; scrollbar-width: thin; padding-bottom: 6px; }
  .is-video .tr-head { top: 64px; }
  .is-video .player.mini { position: absolute; inset: 0; width: auto; box-shadow: none; animation: none; }
}

/* ---------- library page ---------- */
.page-head h1 { display: flex; align-items: center; gap: 10px; font: 700 1.8rem var(--display); margin: 0 0 4px; }
.page-head h1 .ic { color: var(--brand); }
.lib-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.lib-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.lib-tabs .ic { width: 16px; height: 16px; }
.lib-clear { height: 32px; padding: 0 12px; }
.lib-clear .ic { width: 14px; height: 14px; }
.hrow a { display: flex; align-items: center; gap: 10px; }
.hrow a .ic { color: var(--muted); width: 16px; height: 16px; }
.lib-empty { padding: 28px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); background: var(--card); }

/* ---------- dialogs ---------- */
.prefs .x { display: grid; place-items: center; }
.prefs .x .ic { width: 16px; height: 16px; }
.keylist { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 6px 0 4px; align-items: center; }
.keylist dt { white-space: nowrap; font-size: .88rem; color: var(--ink-2); }
.keylist dd { margin: 0; }
kbd { display: inline-block; min-width: 26px; padding: 2px 7px; border-radius: 7px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--bg); font: 600 .82rem var(--ui); text-align: center; }

/* ---------- tip ---------- */
.tip { padding: 16px 18px; }
.tip-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.tip-h .ic { color: var(--accent); }
.tip ul { margin: 0; padding-inline-start: 20px; }
.tip li { margin: 2px 0; }

/* ---------- footer ---------- */
.foot { text-align: start; padding: 34px 0 26px; margin-top: 30px; background: var(--card); border-top: 1px solid var(--line); }
.foot-in { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: flex-start; }
.foot-brand .brand-name { display: inline !important; }
.foot-brand p { margin: 8px 0 0; font-size: .9rem; max-width: 340px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .92rem; }
.foot-links a { color: var(--ink-2); }
.foot-links a:hover { color: var(--brand); }
.foot-note { display: flex; gap: 8px; align-items: center; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .86rem; color: var(--muted); }
.foot-note .ic { color: var(--accent); }
@media (hover: none) { .hide-touch { display: none; } }

/* ---------- phone bottom bar ---------- */
.bnav { display: none; }
@media (max-width: 760px) {
  .bnav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bnav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: var(--muted); font-size: .7rem; font-weight: 600; border-radius: 12px; }
  .bnav a:hover { text-decoration: none; }
  .bnav a.on { color: var(--brand); }
  .bnav a.on .ic { background: color-mix(in srgb, var(--brand) 12%, transparent); }
  .bnav .ic { width: 44px; height: 28px; padding: 4px 12px; border-radius: 999px; }
  .bn-dot { position: absolute; top: 4px; left: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
  .bn-dot[hidden] { display: none; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .totop { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .tip { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .player.mini { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .top-nav .theme { width: 36px; height: 36px; }
  .top-nav .saved-link { display: none !important; }       /* «مكتبتي» lives in the bottom bar on phones */
  .foot { padding-bottom: 20px; }
  .actions .btn { height: 38px; padding: 0 12px; }
  .actions .btn span { font-size: .88rem; }
  .tr-head { top: 62px; padding: 10px 12px; }
  .tr-tools { justify-content: flex-start; }
  .find { max-width: none; }
  .para { gap: 10px; padding: 10px 4px; }
}

/* ---------- dark-look header colours for new elements ---------- */
.look-library .top-nav .nav-txt, .look-ocean .top-nav .nav-txt { color: #efe2bd; }
.look-library .top-nav .nav-txt:hover, .look-ocean .top-nav .nav-txt:hover,
.look-library .top-nav .nav-txt.on, .look-ocean .top-nav .nav-txt.on { background: rgba(255, 255, 255, .08); color: #fff; }
.look-library .foot, .look-ocean .foot { background: var(--deep, var(--navy)); }
.look-library .foot-links a, .look-ocean .foot-links a { color: rgba(243, 230, 196, .8); }
.look-library .foot-note, .look-ocean .foot-note { border-top-color: rgba(255, 255, 255, .1); color: rgba(243, 230, 196, .6); }
.look-library .foot-brand .brand-name, .look-ocean .foot-brand .brand-name { color: #f3e6c4; }

/* ---------- phones: compact result header + small thumbnails beside the text ---------- */
@media (max-width: 760px) {
  .rh-title { font-size: 1.08rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  /* thumbnail beside meta + title only; snippets use the full width */
  body.look-modern .res, body.look-ocean .res { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 12px; align-items: start; }
  body.look-modern .res-body, body.look-ocean .res-body { display: contents; }
  body.look-modern .thumb, body.look-ocean .thumb { width: 112px; border-radius: 10px; grid-row: span 2; }
  body.look-modern .res-meta, body.look-ocean .res-meta, body.look-modern .res-title, body.look-ocean .res-title { grid-column: 2; }
  body.look-modern .snip, body.look-ocean .snip, body.look-modern .res-act, body.look-ocean .res-act { grid-column: 1 / -1; }
  .res { padding: 14px; }
  .res-title { font-size: 1.02rem; }
}

/* ---------- filters: one labelled row per filter, options wrap (no sideways scrolling) ---------- */
.filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.frow { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.fl { min-width: 74px; font-size: .85rem; font-weight: 700; color: var(--muted); }
.fopts { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.fopts a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); font-size: .9rem; line-height: 1.5; white-space: nowrap; }
.fopts a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.fopts a.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.fopts a small { color: inherit; opacity: .7; font-weight: 400; }
.filters .more { border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.filters .more summary { align-self: flex-start; border: 0; padding: 2px 0; }
.filters .clear { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: .86rem; font-weight: 600; }
.filters .clear .ic { width: 14px; height: 14px; }
@media (max-width: 560px) {
  .filters { padding: 10px 12px; }
  .frow { flex-direction: column; align-items: stretch; gap: 5px; }
  .fl { min-width: 0; }
  .fopts a { padding: 5px 12px; font-size: .88rem; }
}

/* ---------- video: «مواضع الكلمة / النص كاملاً» ---------- */
.view-sw { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.view-sw[hidden] { display: none; }
.view-sw button { border: 0; background: none; color: var(--ink-2); padding: 5px 12px; border-radius: 9px; cursor: pointer; font: 500 .88rem var(--ui); white-space: nowrap; }
.view-sw button.on { background: var(--card); color: var(--brand); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.view-sw small { opacity: .75; }
.gap-note { text-align: center; color: var(--muted); font-size: .85rem; padding: 4px 0; letter-spacing: .3em; }

/* ---------- overlap fixes found by the checker (2026-11-20) ---------- */
/* narrow phones: give the header search more room (light/dark stays in ⚙ settings) */
@media (max-width: 420px) {
  .top-in { gap: 8px; }
  .top-nav .theme { width: 34px; height: 34px; }          /* light/dark back beside ⚙ (user 2026-11-21) */
  .top-search input { padding-inline: 10px 4px; }
  .top-search .mic { width: 30px; height: 30px; }
}
/* video: the find bar never runs off the screen */
.find { min-width: 0; }
.find input { min-width: 0; width: 100%; }
.find #find-n { flex-shrink: 0; }
@media (max-width: 760px) {
  .tr-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .tr-head h2 { font-size: 1.1rem; }
  .view-sw { align-self: flex-start; }
  .tr-tools { flex-direction: column; align-items: stretch; gap: 8px; }
  .find { max-width: none; width: 100%; }
  .follow { align-self: flex-start; }
}
/* library tabs: 2×2 on phones instead of sliding sideways */
@media (max-width: 560px) {
  .lib-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 100%; overflow: visible; }
  .lib-tabs button { justify-content: center; padding: 8px 6px; font-size: .88rem; }
  .lib-bar { flex-wrap: wrap; }
}

/* highlights: a band in the middle of the line, so highlighted words on two lines never touch */
.snip b, .rel-s b, .para mark, .res-title mark {
  background: linear-gradient(to bottom, transparent 14%, var(--mark) 14%, var(--mark) 88%, transparent 88%);
  color: var(--mark-ink); padding: 0 1px; border-radius: 0; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.res-title mark { background: none; color: inherit; border-bottom: 2px solid var(--accent); }
/* tall Arabic fonts need taller lines (content box ≈ 1.7–2em) */
body.look-modern .snip, body.look-ocean .snip, body.look-minimal .snip, body.look-modern .rel-s, body.look-ocean .rel-s, body.look-minimal .rel-s { line-height: 2.05; }
body.look-manuscript .snip, body.look-manuscript .rel-s { line-height: 2.25; }
body.look-manuscript .res-title { line-height: 1.95; }
body.look-manuscript .snip b, body.look-manuscript .para mark { background: none; color: var(--brand); border-bottom: 2px solid var(--accent); padding: 0; }

/* find bar: the input shrinks, the counter and ▲▼ stay inside the box */
.find { flex: 1 1 260px; max-width: 420px; min-width: 200px; }
.find input { flex: 1 1 auto; width: auto; min-width: 40px; }
.find-nav { flex-shrink: 0; }
.tr-tools { flex-wrap: wrap; row-gap: 8px; }
@media (min-width: 761px) and (max-width: 1099px) { .tr-head { flex-wrap: wrap; } .tr-tools { flex-basis: 100%; justify-content: flex-start; } }
@media (min-width: 1100px) { .is-video .tr-head { flex-wrap: wrap; } .is-video .tr-tools { flex-basis: 100%; justify-content: flex-start; } }
@media (max-width: 760px) { .find { min-width: 0; max-width: none; flex-basis: auto; } }
.prose li { line-height: 2; margin: 6px 0; }
.prose p { line-height: 1.95; }
body.look-minimal .tr-head { padding-inline: 0; }
@media (max-width: 760px) { body.look-minimal .tr-head { flex-wrap: wrap; } body.look-minimal .tr-head > * { max-width: 100%; } }
/* the search input must not push its box wider than the screen (its default width is ~20 characters) */
.find input { width: 0; flex: 1 1 0; min-width: 0; }
.tr-head > *, .tr-tools > * { min-width: 0; max-width: 100%; }
@media (max-width: 760px) { .tr-tools .find { flex: 0 0 auto; width: 100%; } }

/* phones: the transcript header is tall (switch + find + follow), so it scrolls away instead of covering the text */
@media (max-width: 760px) { .tr-head { position: static; } }

/* ---------- font-size / compact fixes (checker, all prefs) ---------- */
.res-title { line-height: 1.7; }
html[data-dens="compact"] .res-title { margin: 6px 0 4px; }
body.look-minimal .res-title { line-height: 1.75; margin-top: 8px; }
.stat b { font-size: clamp(1.25rem, 6.2vw, 2rem) !important; overflow-wrap: anywhere; }
/* header: icons only when space is tight (tablets, big fonts) */
@media (max-width: 980px) { .top-nav .nav-txt { display: none; } .top-nav a.saved-link .lbl { display: none; } .top-nav a.saved-link { padding: 6px 8px; } }
html[data-fs="xl"] .top-nav .nav-txt, html[data-fs="l"] .top-nav .nav-txt { display: none; }
html[data-fs="xl"] .top-nav a.saved-link .lbl { display: none; }
/* boxes grow with the text instead of a fixed height */
.btn, .theme, .speed button, .top-search, .find, .lib-clear, .share-res { height: auto; min-height: 40px; }
.speed button { min-height: 30px; }
.share-res, .lib-clear { min-height: 32px; }
.top-search { min-height: 42px; }
.find { min-height: 40px; }
.btn { padding-block: 6px; }
.tag { line-height: 1.6; white-space: nowrap; }

/* ---------- Telegram fallback ---------- */
.player-wrap.tg-mode { aspect-ratio: auto; }
.player-wrap.tg-mode .player { position: relative; inset: auto; background: var(--card); border: 1px solid var(--line); box-shadow: none; aspect-ratio: auto; }
.tg-note { display: flex; gap: 8px; align-items: center; padding: 10px 14px; font-size: .88rem; color: var(--ink-2); background: var(--bg-2); border-bottom: 1px solid var(--line); }
.tg-note .ic { color: #229ed9; }
.tg-embed { padding: 8px; min-height: 120px; }
.tg-embed iframe { width: 100% !important; min-width: 0 !important; }
.tg-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 18px; text-align: center; }
.tg-box > .ic { width: 42px; height: 42px; color: #229ed9; }
.tg-box p { margin: 0; }

/* ================= round 1 ================= */
/* reading mode */
.read-btn { min-height: 34px; padding: 4px 12px; font-size: .86rem; }
.read-btn.on { border-color: var(--brand); color: var(--brand); }
body.reading .v-main { display: none; }
body.reading .wrap.vpage { display: block; max-width: 860px; }
body.reading .para { font-size: 1.22em; line-height: 2.2; }
body.reading .ptools { opacity: .35; }
body.reading .tr { border-radius: 18px; }
/* home: popular + latest */
.chips.popular { margin-top: 10px; }
.sec-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sec-head h2 { margin: 0; display: inline-flex; align-items: center; gap: 8px; font: 700 1.35rem var(--display); }
.sec-head h2 .ic { color: var(--accent); }
.latest { margin-top: 40px; }
.latest .wmeta { display: flex; align-items: center; gap: 6px; }
.latest .wmeta .tag { font-size: .7rem; padding: 0 8px; }
/* library backup */
.backup { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.backup .btn { cursor: pointer; }
/* motion-sensitive visitors: no animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
}

/* ================= round 2 ================= */
.fopts a.zero { opacity: .45; }
.more-hits { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--brand); font: 600 .88rem var(--ui); cursor: pointer; padding: 0; }
.more-hits .ic { width: 14px; height: 14px; }
.more-hits.busy { opacity: .5; cursor: progress; }
.snip.extra { animation: fadein .25s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
/* where the word occurs in the video */
.hitmap { margin: 12px 2px 4px; }
.hitmap[hidden] { display: none; }
.hm-track { position: relative; height: 12px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.hm-dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px -6px 0 0; border-radius: 50%; border: 2px solid var(--card); background: var(--accent); cursor: pointer; padding: 0; transition: transform .12s; }
.hm-dot:hover, .hm-dot:focus-visible { transform: scale(1.45); z-index: 2; }
.hm-lbl { display: block; margin-top: 6px; font-size: .82rem; color: var(--muted); }
/* slow search notice */
.loadmsg { position: fixed; top: 74px; left: 50%; transform: translate(-50%, -8px); z-index: 95; display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 999px; background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .9rem; opacity: 0; pointer-events: none; transition: .2s; }
.loadmsg.show { opacity: 1; transform: translate(-50%, 0); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* home strips: a wrapping grid, never sliding sideways */
.latest .mine-list, .mine .mine-list { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); overflow: visible; scroll-snap-type: none; }
@media (max-width: 560px) { .latest .mine-list, .mine .mine-list { grid-template-columns: 1fr 1fr; gap: 10px; } .wcard { padding: 6px; } .wtitle { font-size: .85rem; } }

/* ================= round 3 ================= */
.rel-videos { margin-top: 28px; }
.rel-videos .mine-list { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); overflow: visible; }
.rel-videos .wmeta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rel-videos .wmeta .tag { font-size: .7rem; padding: 0 8px; }
@media (min-width: 1100px) { .is-video .rel-videos { grid-column: 1 / -1; } }
@media (max-width: 560px) { .rel-videos .mine-list { grid-template-columns: 1fr 1fr; gap: 10px; } }
body.reading .rel-videos { display: none; }
.forms { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: .8rem; color: var(--muted); }
.forms b { font-weight: 600; color: var(--ink-2); background: var(--bg-2); border-radius: 6px; padding: 0 6px; }

/* ================= round 4 ================= */
.series-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -4px 0 14px; padding: 9px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); color: var(--ink-2); font-size: .9rem; }
.series-link:hover { text-decoration: none; border-color: var(--brand); }
.series-link .ic { color: var(--brand); }
.series-link .go { margin-inline-start: auto; color: var(--brand); font-weight: 600; white-space: nowrap; }
.series-page { padding-top: 24px; padding-bottom: 50px; max-width: 900px; }
.series-find { max-width: none; margin: 4px 0 16px; background: var(--card); }
.eps { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.eps li[hidden] { display: none; }
.eps li + li { border-top: 1px solid var(--line); }
.eps a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; color: var(--ink); }
.eps a:hover { background: var(--bg-2); text-decoration: none; }
.ep-n { flex-shrink: 0; min-width: 44px; text-align: center; font: 700 .9rem var(--ui); color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); border-radius: 8px; padding: 2px 6px; font-variant-numeric: tabular-nums; }
.ep-t { flex: 1; min-width: 0; line-height: 1.6; }
.ep-m { display: flex; gap: 8px; align-items: center; flex-shrink: 0; font-size: .8rem; color: var(--muted); }
.series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.series-card[hidden] { display: none; }
.series-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.series-card:hover { border-color: var(--brand); text-decoration: none; }
.sc-n { grid-row: span 2; font: 700 1.4rem var(--display); color: var(--brand); min-width: 48px; text-align: center; }
.sc-t { font-weight: 600; line-height: 1.5; }
.sc-m { font-size: .78rem; }
.home-series { margin-top: 40px; }
.home-series .sec-head .mine-all { margin-inline-start: auto; }
@media (max-width: 560px) { .series-grid { grid-template-columns: 1fr; } .eps a { gap: 10px; padding: 10px 12px; } .ep-m span:first-child { display: none; } }
/* notes on saved items */
.snote { display: flex; gap: 6px; align-items: flex-start; font-size: .88rem; color: var(--ink); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 8px; padding: 6px 8px; line-height: 1.7; }
.snote .ic { margin-top: 4px; color: var(--accent); }
.note-btn { border: 0; background: none; color: var(--brand); font: 600 .82rem var(--ui); cursor: pointer; padding: 4px 8px; align-self: flex-start; }
.note-ed { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px 8px; }
.note-ed textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: .92rem/1.7 var(--ui); color: var(--ink); background: var(--bg); resize: vertical; }
.note-ed > div { display: flex; gap: 8px; align-items: center; }
.wwrap { display: flex; flex-direction: column; }
/* about page */
.feat { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 14px 0; padding: 0; list-style: none; }
.feat li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 0; line-height: 1.75; }
.feat b { display: flex; align-items: center; gap: 6px; color: var(--ink); margin-bottom: 2px; }
.feat .ic { color: var(--brand); }

/* ================= round 5 ================= */
/* brand colours on «فتح» buttons */
.ic-yt { color: #ff0033; }
.ic-tg { color: #229ed9; }
/* pager: more numbers + go to page */
.pager .pg-arrow { font-weight: 600; }
@media (max-width: 560px) { .pager a.far { display: none; } .pager { gap: 4px; } .pager a, .pager span { min-width: 36px; padding: 6px 9px; } }
.pg-jump { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; font-size: .9rem; }
.pg-jump label { display: inline-flex; align-items: center; gap: 8px; }
.pg-jump input { width: 74px; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font: 600 .95rem var(--ui); background: var(--card); color: var(--ink); }
.pg-jump .btn { min-height: 34px; padding: 4px 14px; }
/* help page */
.help-page { padding-top: 24px; padding-bottom: 50px; max-width: 860px; }
.help-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 18px; }
.help-toc a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-size: .9rem; }
.help-toc a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.help-sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; margin-bottom: 14px; scroll-margin-top: 80px; }
.help-sec h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font: 700 1.25rem var(--display); }
.hn { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); font-size: 1rem; flex-shrink: 0; }
.help-sec li { line-height: 2; margin: 4px 0; color: var(--ink-2); }
.help-sec .chip { vertical-align: middle; }
/* report dialog */
.tr-foot { margin: 6px 18px 16px; }
.tr-foot .ic { width: 15px; height: 15px; vertical-align: -2px; }
.report-dlg { width: min(560px, calc(100vw - 24px)); }
.rep-k { flex: 1; min-width: 140px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 11px; cursor: pointer; font-size: .92rem; }
.rep-k:has(input:checked) { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.rep-k input { accent-color: var(--brand); }
.rep-l { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.rep-l textarea, .rep-l input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font: 400 .95rem/1.8 var(--read); color: var(--ink); background: var(--bg); }
.rep-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
/* did you mean + save from results */
.didyou { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 600; }
.res-save { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: var(--ink-2); font: 600 .88rem var(--ui); cursor: pointer; padding: 0; }
.res-save .ic { width: 15px; height: 15px; }
.res-save.on { color: var(--accent); }
.res-save.on .ic { fill: currentColor; }
.actions .btn span { white-space: nowrap; }

/* ================= round 6: readability (contrast ≥ 4.5:1 for small text) ================= */
/* light themes: darker grey for secondary text */
html body.look-library { --muted: #6b6350; }
html body.look-modern { --muted: #5d697c; --brand: #047857; --brand-2: #065f46; --lesson: #047857; --fatwa: #c2410c; }
html body.look-manuscript { --muted: #6b563c; }
html body.look-ocean { --muted: #56677f; --fatwa: #b7400b; }
html body.look-desert { --muted: #73604d; --brand: #9c4524; --brand-2: #873a1d; --fatwa: #9c4524; --lesson: #5a6830; }
html body.look-minimal { --muted: #5f6672; }
.look-library .time { color: #7f6020; border-color: color-mix(in srgb, #7f6020 45%, transparent); }
/* bugs: text the same colour as its background */
.look-night .btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.look-night .btn-primary.on { background: rgba(212, 175, 55, .14); color: #e7c75a; }
body.look-minimal .tag { color: var(--lesson) !important; }
body.look-minimal .tag.k-fatwa { color: var(--fatwa) !important; }
body.look-minimal .tag.k-doc { color: var(--doc) !important; }
.res.kb { outline: 2.5px solid var(--brand); outline-offset: 3px; }
body.look-night .btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
body.look-night .btn-primary.on { background: rgba(212, 175, 55, .14); color: #e7c75a; }
body.look-library .time { color: #7f6020; }
.fopts a.on small, .seg a.on small { opacity: 1; color: inherit; }

/* ================= round 9 ================= */
.neg-note { margin: -6px 0 10px; font-size: .88rem; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.neg-note b { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; text-decoration: line-through; color: var(--ink-2); }
.jump { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .88rem; flex-wrap: wrap; }
.jump label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.jump input { width: 96px; text-align: center; border: 1px solid var(--line); border-radius: 9px; padding: 5px 8px; font: 600 .9rem var(--ui); background: var(--card); color: var(--ink); direction: ltr; }
.jump .btn { min-height: 32px; padding: 3px 12px; }
.tdiv { display: flex; align-items: center; gap: 10px; margin: 6px 10px; color: var(--muted); font-size: .78rem; font-weight: 600; }
.tdiv[hidden] { display: none; }
.tdiv::before, .tdiv::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.saved-only { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.saved-only[hidden] { display: none; }
.saved-only button[data-f] { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 3px 12px; font: 500 .85rem var(--ui); cursor: pointer; }
.saved-only button[data-f].on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.wwrap[hidden] { display: none; }

/* ================= round 10 ================= */
.more-para { display: block; margin: -2px 0 6px; padding: 0; border: 0; background: none; color: var(--muted); font: 600 .8rem var(--ui); cursor: pointer; }
.more-para:hover { color: var(--brand); }
.snip.full .txt { background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 8px; padding: 2px 6px; }
.res-share { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: var(--ink-2); font: 600 .88rem var(--ui); cursor: pointer; padding: 0; }
.res-share .ic { width: 15px; height: 15px; }
html[data-dens="compact"] .more-para { display: none; }
.selbar { position: fixed; z-index: 96; display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: #111; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.selbar[hidden] { display: none; }
.selbar button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: #fff; font: 600 .85rem var(--ui); padding: 7px 10px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.selbar button:hover { background: rgba(255, 255, 255, .14); }
.selbar .ic { width: 15px; height: 15px; }

/* ================= round 11 ================= */
.hm-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.hm-row .hm-lbl { margin: 0; }
.hm-play { min-height: 32px; padding: 3px 12px; font-size: .85rem; }
.hm-play .ic { width: 13px; height: 13px; }
.hm-play.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.hm-times { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.hm-t { border: 1px solid var(--line); background: var(--card); color: var(--brand); border-radius: 7px; padding: 1px 8px; font: 600 .78rem var(--ui); cursor: pointer; direction: ltr; font-variant-numeric: tabular-nums; }
.hm-t:hover { border-color: var(--brand); }
.fsq { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.fsq button { border: 0; background: var(--card); color: var(--ink-2); padding: 4px 10px; font: 700 .85rem var(--ui); cursor: pointer; }
.fsq button + button { border-inline-start: 1px solid var(--line); font-size: 1rem; }
.fsq button:hover { color: var(--brand); }

/* ================= round 12 ================= */
.asked { margin: -6px 0 10px; font-size: .9rem; }
.asked b { color: var(--ink); background: var(--bg-2); border-radius: 8px; padding: 0 8px; }
.exact { font-size: .75rem; font-weight: 700; color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); border-radius: 999px; padding: 0 8px; }
.act-spots { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--accent) !important; }
.act-spots .ic { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.hm-play.invite { animation: invite 1.4s ease-in-out infinite; border-color: var(--accent); color: var(--accent); }
@keyframes invite { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
.asked { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; line-height: 1.9; }

/* ================= round 13 ================= */
.hm-forms { margin: 8px 0 0; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.hm-forms b { color: var(--ink-2); background: var(--bg-2); border-radius: 6px; padding: 0 7px; font-weight: 600; }
.refine { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 8px; }
.refine input[name=add] { flex: 1; min-width: 160px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font: 500 .92rem var(--ui); background: var(--bg); color: var(--ink); }
.refine .btn { min-height: 34px; padding: 4px 14px; }
.refine input[name=add] { width: 0; flex: 1 1 0; min-width: 0; }
.filters, .filters > * { min-width: 0; max-width: 100%; }

/* ================= round 14 ================= */
.qimg-dlg { width: min(520px, calc(100vw - 24px)); }
#qimg-out { display: block; width: 100%; aspect-ratio: 1; border-radius: 12px; margin: 6px 0 10px; box-shadow: 0 8px 26px rgba(0, 0, 0, .25); background: var(--bg-2); }
.qimg-opts { display: flex; gap: 8px; justify-content: center; margin-bottom: 4px; }
.qimg-opts button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.qimg-opts button.on { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
html.save-data .thumb img, html.save-data .wthumb img { display: none; }
html.save-data .thumb, html.save-data .wthumb { background: var(--bg-2); }

/* ================= round 15 ================= */
.backrow { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.backrow .back { margin: 0; }
.resnav { display: inline-flex; align-items: center; gap: 10px; font-size: .88rem; font-weight: 600; }
.resnav[hidden] { display: none; }
.res.was-open { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.qclear { flex-shrink: 0; border: 0; background: none; color: var(--muted); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.qclear[hidden] { display: none; }
.qclear:hover { background: var(--bg-2); color: var(--ink); }
.qclear .ic { width: 14px; height: 14px; }
.look-library .top-search .qclear, .look-ocean .top-search .qclear { color: rgba(243, 230, 196, .7); }

/* ================= round 16 ================= */
/* smooth page-to-page transition (Chrome / Edge; others just navigate) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
/* shimmer while a thumbnail loads (the image covers it) */
.wthumb, .thumb { background: linear-gradient(100deg, var(--bg-2) 30%, color-mix(in srgb, var(--card) 70%, var(--bg-2)) 50%, var(--bg-2) 70%) var(--bg-2); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.wthumb:has(img[data-ok]), .thumb:has(img[data-ok]) { animation: none; background: var(--bg-2); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .wthumb, .thumb { animation: none; } }
/* phones: the bottom bar steps aside while you scroll down to read */
@media (max-width: 760px) { .bnav { transition: transform .22s ease; } .bnav.away { transform: translateY(110%); } }

/* ================= round 17 ================= */
.vtopics { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 2px; font-size: .88rem; }
.vtopics .chip { cursor: pointer; font: 500 .86rem var(--ui); padding: 3px 11px; }

/* ================= round 19 ================= */
.print-head { display: none; }
@media print {
  @page { margin: 14mm 12mm; }
  .bnav, .backrow, .resnav, .vtopics, .hitmap, .resume, .view-sw, .fsq, .ptools, .related, .rel, .qclear, .selbar, .skip, .v-head .actions, .tr-head .find, .print-btn, .mini, .tip { display: none !important; }
  .print-head { display: block; font: 500 10pt/1.6 var(--ui, sans-serif); color: #333; border-bottom: 1px solid #999; padding-bottom: 6px; margin-bottom: 12px; }
  .print-head span { color: #666; }
  html body, html body .card, html body .tr, html body .para { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .vpage, .v-main { display: block !important; max-width: none !important; }
  .v-sticky { position: static !important; }
  .player-wrap { display: none !important; }
  .para { font-size: 12pt; line-height: 1.9; page-break-inside: avoid; }
  .para mark { background: #ffe58a !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000 !important; text-decoration: none !important; }
}

/* ================= round 21 ================= */
.paras.long > .para { content-visibility: auto; contain-intrinsic-size: auto 300px; }
@media print { .paras.long > .para { content-visibility: visible; } }

/* ================= round 22 ================= */
.fotd { margin-top: 26px; }
.fotd-card { display: grid; gap: 6px; padding: 18px 20px; border-radius: var(--radius, 16px); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; border-inline-start: 4px solid var(--accent); transition: transform .15s, box-shadow .15s; }
.fotd-card:hover { text-decoration: none; transform: translateY(-1px); }
.fotd-k { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font: 700 .85rem var(--ui); }
.fotd-k .ic { width: 16px; height: 16px; }
.fotd-t { font-size: 1.12rem; line-height: 1.6; color: var(--brand); overflow-wrap: anywhere; }
.fotd-x { color: var(--ink-2); line-height: 1.9; overflow-wrap: anywhere; }
.fotd-go { color: var(--brand); font-weight: 600; font-size: .92rem; }
.foot-upd { font-size: .85em; }
.sh-row { display: flex; align-items: center; }
.sh-row .sh { flex: 1 1 0; min-width: 0; }
.sh-x { flex-shrink: 0; border: 0; background: none; color: var(--muted); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.sh-x:hover { background: var(--bg-2); color: var(--ink); }
.sh-x .ic { width: 13px; height: 13px; }
.sugg-more { display: block; text-align: center; font-size: .85rem; padding: 8px; color: var(--muted); }

/* ================= round 23 ================= */
.follow-q.on { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.follow-q.on svg { fill: currentColor; }
.follows { margin-top: 24px; }
.follows[hidden] { display: none; }
.fol-list { display: flex; flex-wrap: wrap; gap: 8px; }
.fol { display: inline-flex; align-items: center; max-width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding-inline-start: 14px; }
.fol a { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; color: var(--ink); padding: 6px 0; font-weight: 600; }
.fol a:hover { text-decoration: none; color: var(--brand); }
.fol-n { flex-shrink: 0; background: var(--accent); color: #fff; font: 700 .72rem/1 var(--ui); padding: 4px 8px; border-radius: 999px; }
.fol-n[hidden] { display: none; }
.fol.has-new { border-color: var(--accent); }
.fol-x { flex-shrink: 0; border: 0; background: none; color: var(--muted); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.fol-x:hover { color: var(--ink); background: var(--bg-2); }
.fol-x .ic { width: 12px; height: 12px; }

/* ================= round 24 ================= */
.saved-page .follows { margin: 0 0 22px; }

/* ================= round 25 ================= */
.thumb, .wthumb { position: relative; }
.wbar { position: absolute; inset-inline: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, .35); pointer-events: none; }
.wbar i { display: block; height: 100%; background: #e53935; }
.wseen { position: absolute; top: 6px; inset-inline-start: 6px; background: rgba(0, 0, 0, .72); color: #fff; font: 600 .68rem/1 var(--ui); padding: 4px 7px; border-radius: 6px; pointer-events: none; }
.endcard { display: grid; gap: 6px; margin: 10px 0; padding: 14px 16px; border: 1px solid var(--accent); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.endcard .ec-t { font-weight: 700; color: var(--brand); overflow-wrap: anywhere; }
.endcard .ec-row { display: flex; flex-wrap: wrap; gap: 8px; }
.endcard .ec-go b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .25); margin-inline-start: 6px; font-size: .8rem; }

/* ================= round 26 (user 2026-11-20: «ضبط كل شي، لا تخلي شي متداخل») ================= */
/* the hero leaves room for the pulled-up numbers box — not needed when «مكتبتي» comes first */
.look-library .hero:has(+ .mine:not([hidden])), .look-desert .hero:has(+ .mine:not([hidden])), .look-ocean .hero:has(+ .mine:not([hidden])) { padding-bottom: 56px; }
/* search box: field · × · mic · ابحث — each in its own space, never glued */
.big-search, .top-search { gap: 4px; }
.big-search .qclear, .top-search .qclear { background: none; color: var(--muted); width: 30px; height: 30px; padding: 0; }
.big-search .qclear:hover, .top-search .qclear:hover { background: var(--bg-2); color: var(--ink); }
.big-search .mic { position: relative; background: none; color: var(--muted); width: 42px; height: 42px; margin-inline: 4px 6px; padding: 0; }
.big-search .mic::before { content: ""; position: absolute; inset-inline-start: -4px; top: 9px; bottom: 9px; width: 1px; background: var(--line); }
.big-search .mic:hover { background: var(--bg-2); color: var(--brand); }
.big-search .mic.rec, .top-search .mic.rec { color: #fff; background: #e11d48; }
.top-search .mic { background: none; padding: 0; }
/* home: «بحثت سابقاً» sits a clear line below the «جرّب» suggestions */
.hero .chips.recent { margin-top: 30px; }
/* «ضيّق»: label · field · أضف on one line, the hint fits the field */
.refine { flex-wrap: nowrap; }
.refine input[name=add]::placeholder { color: var(--muted); opacity: 1; }
/* floating mini player: a small × on its top corner, inside the frame (the frame clips anything outside) */
.player.mini .mini-x { top: 6px; right: 6px; width: 26px; height: 26px; background: rgba(0, 0, 0, .72); border: 1px solid rgba(255, 255, 255, .35); }
.player.mini .mini-x:hover { background: #000; }
/* «بحوث تتابعها»: one tidy pill per search; the «+N جديدة» badge never squeezes the words */
.fol { gap: 2px; min-height: 40px; }
.fol a { flex-wrap: wrap; row-gap: 4px; line-height: 1.5; }
.fol-n { white-space: nowrap; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.sec-head h2 { margin: 0; }
/* «مكتبتي»: five tabs wrap (no sideways scroll); on phones the fifth takes the whole last row */
.lib-tabs { flex-wrap: wrap; overflow: visible; }
@media (max-width: 760px) { .lib-tabs button:last-child:nth-child(odd) { grid-column: 1 / -1; } }
/* «بلاغاتي» cards */
.rcard .rhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.rst { font: 700 .76rem/1.2 var(--ui); padding: 3px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.rst.st-new { color: var(--muted); }
.rst.st-done { color: #15803d; }
.rst.st-rej { color: #b91c1c; }
.always-dark .rst.st-done, [data-theme=dark] .rst.st-done { color: #4ade80; }
.always-dark .rst.st-rej, [data-theme=dark] .rst.st-rej { color: #f87171; }
.rnote { font-style: italic; }
.admin-reps { border-style: dashed; }
/* the one-time tip never sits on the floating mini player (or its ×) */
body:has(.player.mini) .tip { display: none; }

/* ================= round 27 (user 2026-11-20) ================= */
/* thumbnails in the results for every look (only «حديث» and «بحري» had them) */
.res.has-thumb { display: flex; gap: 18px; align-items: flex-start; }
.res.has-thumb .res-body { flex: 1; min-width: 0; }
.res.has-thumb .thumb { display: block; position: relative; flex-shrink: 0; width: 200px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; align-self: flex-start; }
.res.has-thumb .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res.has-thumb .thumb .dur { position: absolute; bottom: 6px; left: 6px; background: rgba(0, 0, 0, .78); color: #fff; font: 600 .76rem var(--ui); padding: 1px 7px; border-radius: 6px; direction: ltr; }
html[data-dens="compact"] .res.has-thumb .thumb { width: 150px; }
@media (max-width: 760px) {
  .res.has-thumb { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 12px; row-gap: 0; align-items: start; }
  .res.has-thumb .res-body { display: contents; }
  .res.has-thumb .thumb { width: 112px; border-radius: 10px; grid-row: span 2; }
  .res.has-thumb .res-meta, .res.has-thumb .res-title { grid-column: 2; }
  .res.has-thumb .res-body > :not(.res-meta):not(.res-title) { grid-column: 1 / -1; }
  .res.has-thumb .thumb .dur { font-size: .7rem; padding: 0 5px; bottom: 4px; left: 4px; }
}
/* help page: three big steps + plain-language questions */
.help-page .page-head { margin-bottom: 22px; }
.lead-help { font-size: 1.08rem; line-height: 2; color: var(--ink-2); margin: 8px 0 0; }
.help-start { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 32px; }
.help-start h2, .help-h { font: 700 1.3rem var(--display); margin: 0 0 14px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.step { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); line-height: 1.8; }
.step b { font-size: 1.05rem; color: var(--ink); }
.step > span:not([class]) { color: var(--ink-2); font-size: .95rem; }
.step-n { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink, #fff); font: 700 1.15rem var(--ui); }
.demo-box, .demo-snip, .demo-play { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-size: .9rem; color: var(--ink); }
.demo-box .ic { color: var(--muted); }
.demo-snip .time { flex-shrink: 0; }
.demo-snip mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }
.demo-play { justify-content: center; font-weight: 700; color: var(--brand); }
.try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; color: var(--muted); }
.help-sub { margin: -6px 0 16px; }
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq-group { font: 700 1.05rem var(--ui); color: var(--brand); margin: 22px 0 2px; }
.faq-group:first-child { margin-top: 0; }
.faq-q { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.faq-q summary { cursor: pointer; padding: 14px 16px; font-weight: 700; line-height: 1.7; list-style: none; display: flex; align-items: center; gap: 10px; }
.faq-q summary::-webkit-details-marker { display: none; }
.faq-q summary::before { content: "+"; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); color: var(--brand); font-weight: 700; }
.faq-q[open] summary::before { content: "−"; }
.faq-q[open] summary { border-bottom: 1px solid var(--line); }
.faq-q > p, .faq-q > ul { margin: 0; padding: 14px 18px 16px; line-height: 2; color: var(--ink-2); }
.faq-q > ul { padding-inline-start: 36px; }
.faq-q li + li { margin-top: 6px; }
.faq-q .chip { vertical-align: middle; }
.help-end { margin-top: 30px; padding: 16px; border-radius: 12px; border: 1px dashed var(--line); color: var(--ink-2); line-height: 2; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } .help-start { padding: 16px; } }
/* breathing room everywhere (user 2026-11-20: «لازم مسافة بين كل شي وشي… عمم ذا على الموقع كله») */
.chips, .rel-words, .vtopics, .res-meta, .res-act, .fol-list, .backup, .help-toc, .try, .didyou, .rh-title, .frow, .fopts { row-gap: 10px; }
.rel-words, .vtopics, .fol-list, .backup { column-gap: 8px; }
.follow-q { margin-inline-start: 8px; }
.find-nav { gap: 6px; }
.saved-page .page-head { margin-bottom: 28px; }
.saved-page .backup { margin-top: 16px; }
.saved-page .follows { margin: 0 0 30px; }
.saved-page .follows .sec-head { margin-bottom: 12px; }
.follows .sec-head { margin-bottom: 12px; }
.lib-bar { margin: 6px 0 14px; }
/* phones: thumbnail beside the tags; the title gets the full width under them (big title fonts no longer squeeze) */
@media (max-width: 760px) {
  .res.has-thumb .thumb { grid-row: 1; }
  .res.has-thumb .res-meta { grid-column: 2; align-self: center; }
  .res.has-thumb .res-title { grid-column: 1 / -1; margin-top: 10px; }
}
/* the tags line never touches the title under it (was 2–4px in «حديث») */
.res .res-meta + .res-title { margin-top: 10px; }
/* video page: «اذهب إلى» and the next section keep their distance */
.jump { margin-bottom: 18px; }
.rel-videos { margin-top: 26px; }
/* «hidden» always hides — a class with display:flex (e.g. .chips) was showing an empty «بحثت سابقاً:» row */
[hidden] { display: none !important; }
/* page numbers that wrap to a second line keep their distance */
.pager { row-gap: 10px; }
/* the site logo (user's «الكشّاف» emblem, recoloured per look — static/brand/<look>/) replaces the drawn magnifier */
.logo.logo-img { background: none !important; border: 0 !important; padding: 0 !important; width: 40px; height: 40px; border-radius: 22% !important;
  overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); flex-shrink: 0; }
.logo.logo-img img { width: 100%; height: 100%; display: block; }
.logo.logo-img::before, .logo.logo-img::after { display: none !important; }
/* settings → «الأيقونة»: small tiles of every icon + «مثل الشكل» */
.opts.icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.opts.icons button { padding: 5px; min-height: 0; display: grid; place-items: center; }
.opts.icons button img { width: 34px; height: 34px; display: block; border-radius: 22%; }
.opts.icons .ic-auto { grid-column: span 3; font-size: .88rem; }
.opts.icons button.on { outline: 2px solid var(--brand); outline-offset: 1px; }
.pl small { font-weight: 400; color: var(--muted); margin-inline-start: 6px; font-size: .8em; }
.pref-note { margin: 8px 0 0; font-size: .8rem; line-height: 1.7; color: var(--muted); }
.opts.icons button { width: 100%; min-width: 0; height: auto; justify-content: center; }
.opts.icons { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); }
/* settings → «تغيير الأيقونة» button, and the icon picker window */
.icon-pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: 600 .95rem var(--ui); cursor: pointer; text-align: start; }
.icon-pick:hover { border-color: var(--brand); }
.icon-pick img { width: 34px; height: 34px; border-radius: 22%; flex-shrink: 0; }
.icon-pick small { margin-inline-start: auto; color: var(--muted); font-weight: 500; }
.icons-dlg .prefs-in { max-width: 420px; }
.icon-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.icon-list button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: 500 .95rem var(--ui); cursor: pointer; text-align: start; min-width: 0; }
.icon-list button:hover { border-color: var(--brand); }
.icon-list button.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--card)); color: var(--brand); font-weight: 700; }
.icon-list img, .il-same { width: 40px; height: 40px; border-radius: 22%; flex-shrink: 0; }
.il-same { display: grid; place-items: center; background: var(--bg-2); color: var(--muted); font: 700 1.2rem var(--ui); }
.icon-list span { overflow-wrap: anywhere; }
