/* ==========================================================
   حصون للعلوم الشرعية — design system
   Colors are drawn from the logo: slate teal, sand gold, paper.
   ========================================================== */
@import url("https://fonts.googleapis.com/css2?family=Reem+Kufi:wght@400..700&family=Markazi+Text:wght@400..700&family=Readex+Pro:wght@300..700&family=Amiri+Quran&family=Aref+Ruqaa:wght@400;700&display=swap");

:root {
  /* teal (logo wordmark) */
  --ink-900: #1f3337;
  --ink-850: #24393d;
  --teal-800: #2b4448;
  --teal-750: #33504f;
  --teal-700: #3d5c61;
  --teal-600: #51696d;
  --teal-500: #6f8e92;
  --teal-400: #8fa3a2;
  --teal-300: #b9c6c4;
  --teal-200: #c9d6d5;
  --teal-100: #e3eae8;
  --teal-50: #eff3f1;
  /* sand (logo book) */
  --sand-700: #8a7a4e;
  --sand-600: #a08f5f;
  --sand-500: #b4a276;
  --sand-400: #c4b48a;
  --sand-300: #d6cba9;
  --sand-200: #e0d6b8;
  --sand-100: #eee8d8;
  --sand-50: #f6f2e8;
  /* paper */
  --paper: #f7f5ef;
  --paper-2: #efece3;
  --paper-3: #e9e6dc;
  --surface: #fbfaf6;
  --line: #ddd8ca;
  --line-soft: #ebe7da;
  --line-mid: #d3cdbb;
  --line-strong: #c9c3b1;
  /* text */
  --text: #1d2a2d;
  --text-2: #4a5a5c;
  --text-3: #647273;
  --text-4: #7a8585;
  /* state */
  --live: #a6452f;
  --live-bg: #f3e3dc;
  --live-ink: #8f3a26;
  --ok: #3f7a5c;
  --ok-bg: #e0ece4;
  --ok-ink: #2f6048;
  --warn-bg: #f4ead6;
  --warn-ink: #80581a;
  --warn-deep: #5f4413;

  --f-ui: "Readex Pro", system-ui, sans-serif;
  --f-display: "Reem Kufi", "Readex Pro", sans-serif;
  --f-read: "Markazi Text", "Amiri", serif;
  --f-quran: "Amiri Quran", "Amiri", serif;
  --f-ruqaa: "Aref Ruqaa", serif;

  --gutter: clamp(16px, 5vw, 72px);
  --maxw: 1440px;
  --section: clamp(64px, 9vw, 120px);
  --radius: 2px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 16px/1.6 var(--f-ui); }
img, svg { display: block; max-width: 100%; }
a { color: var(--teal-700); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--ink-900); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, figure, blockquote, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
th { font-weight: 500; text-align: right; }
:focus-visible { outline: 2px solid var(--sand-500); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- type ---------- */
.k { font-family: var(--f-display); }
.r { font-family: var(--f-read); }
.q { font-family: var(--f-quran); }
.ruq { font-family: var(--f-ruqaa); }
.display { font: 600 clamp(44px, 6vw, 86px)/1.18 var(--f-display); }
.h1 { font: 600 clamp(38px, 5vw, 64px)/1.22 var(--f-display); color: var(--ink-900); }
.h2 { font: 600 clamp(30px, 3.6vw, 52px)/1.25 var(--f-display); color: var(--ink-900); }
.h3 { font: 600 clamp(24px, 2.4vw, 38px)/1.3 var(--f-display); color: var(--ink-900); }
.h4 { font: 500 clamp(20px, 1.8vw, 24px)/1.4 var(--f-display); color: var(--ink-900); }
.lead { font: 400 clamp(20px, 1.9vw, 26px)/1.68 var(--f-read); color: var(--text-2); max-width: 44ch; }
.prose { font: 400 clamp(20px, 1.6vw, 23px)/1.95 var(--f-read); color: var(--text); max-width: 70ch; }
.prose p + p { margin-top: .9em; }
.body-r { font: 400 clamp(18px, 1.4vw, 21px)/1.7 var(--f-read); color: var(--text-2); }
.muted { color: var(--text-3); }
.small { font-size: 13.5px; }
.xs { font-size: 12.5px; }
.gold { color: var(--sand-700); }
.num { font-family: var(--f-display); color: var(--sand-600); line-height: 1; }
.kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--sand-700); }
.kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sand-500); }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section--tint { background: var(--paper-2); }
.section--dark { background: var(--ink-900); color: var(--teal-100); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.wrap-row { flex-wrap: wrap; }
.g-1 { gap: 4px; } .g-2 { gap: 8px; } .g-3 { gap: 12px; } .g-4 { gap: 16px; } .g-5 { gap: 24px; } .g-6 { gap: 32px; } .g-7 { gap: 48px; } .g-8 { gap: 64px; }
.split { display: grid; grid-template-columns: 4fr 7fr; gap: clamp(40px, 7vw, 96px); align-items: start; }
.split--even { grid-template-columns: 1fr 1fr; }
.split--wide { grid-template-columns: 7fr 5fr; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 80px); }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.cols-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 48px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 48px); }
.sec-head--rule { padding-bottom: 16px; border-bottom: 1px solid var(--ink-900); margin-bottom: 0; }
.more { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 15px; }
.more svg { transition: transform .25s var(--ease); }
.more:hover svg { transform: translateX(-4px); }
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .split, .split--even, .split--wide, .cols-2, .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .cols-4 { grid-template-columns: 1fr; } }

/* ---------- icons ---------- */
.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.i--fill { fill: currentColor; stroke: none; }
.i-sm { width: 15px; height: 15px; } .i-lg { width: 22px; height: 22px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; font: 500 15px/1 var(--f-ui); border: 1px solid transparent; border-radius: var(--radius); background: transparent; white-space: nowrap; transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn--primary { background: var(--teal-700); color: var(--paper); }
.btn--primary:hover { background: var(--teal-800); color: var(--paper); }
.btn--outline { border-color: var(--line-strong); color: var(--ink-900); }
.btn--outline:hover { border-color: var(--teal-700); color: var(--ink-900); background: var(--surface); }
.btn--sand { background: var(--sand-500); color: var(--ink-900); }
.btn--sand:hover { background: var(--sand-400); color: var(--ink-900); }
.btn--light { border-color: var(--teal-600); color: var(--paper); }
.btn--light:hover { border-color: var(--sand-500); color: var(--paper); }
.btn--danger { border-color: #e2c3b7; color: var(--live-ink); }
.btn--danger:hover { background: var(--live-bg); color: var(--live-ink); }
.btn--ghost { color: var(--text-2); }
.btn--ghost:hover { background: var(--paper-2); color: var(--ink-900); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn--lg { min-height: 52px; padding: 0 28px; font-size: 16px; }
.btn--block { width: 100%; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); color: var(--teal-700); border-radius: var(--radius); transition: border-color .2s var(--ease); }
.icon-btn:hover { border-color: var(--teal-700); }
.icon-btn .ping { position: absolute; top: 8px; left: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--live); }

/* ---------- tags ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; font: 500 12px/1 var(--f-ui); border-radius: var(--radius); background: var(--teal-100); color: var(--teal-800); white-space: nowrap; }
.tag--sand { background: var(--sand-100); color: #6f6139; }
.tag--live { background: var(--live-bg); color: var(--live-ink); }
.tag--ok { background: var(--ok-bg); color: var(--ok-ink); }
.tag--warn { background: var(--warn-bg); color: var(--warn-ink); }
.tag--neutral { background: #ebe8df; color: var(--text-2); }
.tag--paper { background: var(--paper); color: var(--text-2); border: 1px solid var(--line); }
.tag--count { height: 20px; padding: 0 7px; font-size: 11px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex-shrink: 0; }
.dot--pulse { animation: pulse 1.8s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- motifs ---------- */
.crenel { height: 14px; background: linear-gradient(90deg, currentColor 50%, transparent 0) 0 0 / 28px 100% repeat-x; }
.crenel--bottom { position: absolute; inset-inline: 0; bottom: 0; color: var(--paper); }
.crenel--top { position: absolute; inset-inline: 0; top: 0; color: var(--paper); }
.crenel--above { position: absolute; inset-inline: 0; top: -14px; color: var(--ink-900); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.rule-gold { flex-grow: 1; height: 1px; background: var(--sand-300); }

/* ---------- panels ---------- */
.panel { border: 1px solid var(--line); background: var(--surface); }
.panel--pad { padding: clamp(18px, 2vw, 24px); }
.panel--dark { position: relative; background: var(--ink-900); color: var(--teal-100); padding: clamp(24px, 3vw, 36px); }
.panel--dark .h4, .panel--dark h2, .panel--dark h3 { color: var(--paper); }
.panel--teal { position: relative; background: var(--teal-100); padding: 32px 28px 28px; }
.panel--sand { background: var(--sand-50); border: 1px solid var(--sand-200); padding: 20px 24px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; font-size: 14px; line-height: 1.6; }
.notice--warn { background: var(--warn-bg); color: var(--warn-deep); }
.notice--ok { background: var(--ok-bg); color: var(--ok-ink); }
.notice--info { background: var(--teal-50); color: var(--teal-800); border: 1px solid var(--teal-200); }

/* ---------- lists ---------- */
.list-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--ink-900); }
.list-title h2, .list-title h3 { font: 600 20px/1.4 var(--f-display); color: var(--ink-900); }
.li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); color: var(--text); }
.li:last-child { border-bottom: 0; }
a.li:hover { color: var(--ink-900); background: linear-gradient(to left, var(--paper-2), transparent); }
.li-title { font-weight: 500; font-size: 14.5px; line-height: 1.55; }
.li-meta { font-size: 12.5px; color: var(--text-3); }
.date-chip { width: 46px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; border: 1px solid var(--line); align-self: flex-start; }
.date-chip span:first-child { width: 100%; text-align: center; font-size: 11px; color: var(--text-3); background: var(--paper-2); }
.date-chip span:last-child { font: 400 18px/1.5 var(--f-display); }
.date-chip--strong { border-color: var(--ink-900); }
.date-chip--strong span:first-child { background: var(--ink-900); color: var(--paper); }
.file-ico { width: 34px; height: 40px; flex-shrink: 0; display: grid; place-items: center; font-size: 10px; font-weight: 600; background: var(--live-bg); color: var(--live-ink); }
.file-ico--book { background: var(--teal-100); color: var(--teal-800); }
.file-ico--audio { background: var(--sand-100); color: #6f6139; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-weight: 500; font-size: 15px; }
.label .req { color: var(--live); }
.label .opt { color: var(--text-3); font-weight: 400; }
.hint { font-size: 13px; color: var(--text-3); }
.err { font-size: 13px; color: var(--live); }
.input, .select, .textarea { width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 16px; color: var(--text); border-radius: var(--radius); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.input--sm, .select--sm { min-height: 40px; font-size: 14px; padding: 0 12px; }
.textarea { padding: 14px 16px; line-height: 1.75; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--teal-700); box-shadow: 0 0 0 3px var(--teal-100); }
.input[aria-invalid="true"] { border-color: var(--live); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23647273' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; padding-left: 40px; }
.search { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text-3); border-radius: var(--radius); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 14px; color: var(--text); min-width: 0; }
.search kbd { font: 11px var(--f-ui); border: 1px solid var(--line); padding: 1px 6px; color: var(--text-4); }
.search--lg { min-height: 58px; padding: 0 0 0 0; border-color: var(--line-strong); }
.search--lg label { display: flex; align-items: center; gap: 12px; padding: 0 18px; flex-grow: 1; min-width: 0; }
.search--lg input { font-size: 17px; }
.search--lg .btn { min-height: 58px; border-radius: 0; }
.choice { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 16px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 15px; transition: border-color .2s var(--ease), background .2s var(--ease); }
.choice:has(input:checked) { border-color: var(--teal-700); background: var(--teal-50); }
.choice input, .check input { accent-color: var(--teal-700); width: 18px; height: 18px; margin: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.6; cursor: pointer; }
.check input { margin-top: 3px; }
.fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.fieldset + .fieldset { padding-top: 32px; border-top: 1px solid var(--line); }
.legend { display: flex; gap: 12px; align-items: center; padding: 0; font: 400 26px/1.3 var(--f-display); color: var(--ink-900); }
.step-num { width: 32px; height: 32px; display: inline-grid; place-items: center; background: var(--ink-900); color: var(--paper); font-size: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 11px; transition: background .2s var(--ease); pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--teal-700); }
.switch input:checked + span::after { transform: translateX(-16px); }

/* ---------- tabs / segmented ---------- */
.tabs { display: flex; gap: clamp(18px, 2.5vw, 32px); border-bottom: 1px solid var(--line); font-size: 15px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; gap: 8px; align-items: center; padding: 12px 0; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-2); white-space: nowrap; }
.tab:hover { color: var(--ink-900); }
.tab[aria-selected="true"] { border-bottom-color: var(--ink-900); color: var(--ink-900); font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line-mid); font-size: 14px; background: var(--surface); }
.seg button { min-height: 36px; padding: 0 16px; border: 0; background: transparent; color: var(--text-2); }
.seg button + button { border-right: 1px solid var(--line-mid); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--ink-900); color: var(--paper); }
.tab-panel[hidden] { display: none; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { font-size: 14px; }
.table thead th { padding: 12px 10px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.table tbody tr { border-top: 1px solid var(--line); transition: background .15s; }
.table tbody tr:last-child { border-bottom: 1px solid var(--line); }
.table tbody tr:hover { background: var(--paper-2); }
.table td { padding: 14px 10px; vertical-align: middle; }
.table .strong { font-weight: 500; }
.cell-stack { display: flex; flex-direction: column; gap: 2px; }
.cell-stack small { font-size: 12.5px; color: var(--text-3); }
.table--check td:first-child, .table--check th:first-child { width: 36px; }

/* ---------- progress ---------- */
.meter { display: block; height: 4px; background: var(--teal-100); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--teal-700); }
.meter--sand > span { background: var(--sand-500); }
.meter--thin { height: 3px; }
.meter--thick { height: 8px; }

/* ---------- avatars ---------- */
.avatar { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; background: var(--teal-700); color: var(--paper); font: 400 17px/1 var(--f-display); }
.avatar--sm { width: 32px; height: 32px; font-size: 14px; }
.avatar--sand { background: var(--sand-500); color: var(--ink-900); }
.avatar--soft { background: var(--teal-100); color: var(--teal-700); font-family: var(--f-ruqaa); }
.avatar--lg { width: 64px; height: 64px; font-size: 26px; }
.avatar--xl { width: 96px; height: 96px; font-size: 40px; }

/* ---------- pagination ---------- */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 32px; font-size: 14px; flex-wrap: wrap; }
.pager-nums { display: flex; gap: 4px; }
.pager-nums a, .pager-nums span { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; gap: 6px; align-items: center; justify-content: center; border: 1px solid var(--line); color: var(--text); }
.pager-nums span { border-color: transparent; color: var(--text-3); }
.pager-nums a[aria-current] { background: var(--ink-900); border-color: var(--ink-900); color: var(--paper); }

/* ---------- crumbs ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px 10px; font-size: 14px; color: var(--text-3); }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--ink-900); }
.crumbs .sep { color: #b8b19c; }
.crumbs [aria-current] { color: var(--text); font-weight: 500; }
.crumbs--light, .crumbs--light a { color: var(--teal-400); }
.crumbs--light [aria-current] { color: var(--teal-100); }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; z-index: 90; display: flex; gap: 10px; align-items: center; padding: 14px 20px; background: var(--ink-900); color: var(--paper); font-size: 14.5px; box-shadow: 0 12px 32px rgb(31 51 55 / .25); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: transform .35s var(--ease), opacity .35s var(--ease); }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.toast .i { color: var(--sand-500); }

/* ==========================================================
   PUBLIC SITE CHROME
   ========================================================== */
.topbar { background: var(--ink-900); color: var(--teal-300); font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 38px; }
.topbar a { color: var(--teal-300); }
.topbar .accent { color: var(--sand-300); }
.site-header { position: sticky; top: 0; z-index: 50; background: rgb(247 245 239 / .97); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 88px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand svg { width: 46px; height: 46px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font: 700 30px/1 var(--f-ruqaa); color: var(--teal-700); }
.brand-sub { font-size: 12px; color: var(--sand-700); margin-top: 5px; }
.brand--light .brand-name { color: var(--paper); }
.brand--light .brand-sub { color: var(--sand-300); }
.brand--sm svg { width: 38px; height: 38px; }
.brand--sm .brand-name { font-size: 25px; }
.site-nav { display: flex; gap: clamp(16px, 2vw, 28px); align-items: center; }
.site-nav a { padding: 8px 0; color: var(--text-2); font-size: 15px; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink-900); }
.site-nav a[aria-current="page"] { color: var(--ink-900); font-weight: 500; border-bottom-color: var(--sand-500); }
.header-actions { display: flex; gap: 10px; align-items: center; }
.nav-toggle { display: none; }
.mobile-nav { display: none; }
@media (max-width: 1180px) {
  .site-nav { display: none; }
  .nav-toggle { display: inline-grid; }
  .mobile-nav { display: block; position: fixed; inset: 0; z-index: 60; background: var(--paper); padding: 20px var(--gutter) 32px; overflow-y: auto; transform: translateX(100%); visibility: hidden; transition: transform .4s var(--ease), visibility .4s; }
  .mobile-nav.is-open { transform: none; visibility: visible; }
  .mobile-nav nav { display: flex; flex-direction: column; margin-top: 28px; border-top: 1px solid var(--ink-900); }
  .mobile-nav nav a { padding: 18px 0; border-bottom: 1px solid var(--line); font: 400 22px/1.3 var(--f-display); color: var(--ink-900); }
  .mobile-nav nav a[aria-current="page"] { color: var(--sand-700); }
}
@media (max-width: 640px) {
  .topbar .hide-sm, .header-actions .hide-sm { display: none; }
  .site-header .wrap { min-height: 68px; }
  .brand svg { width: 38px; height: 38px; }
  .brand-name { font-size: 25px; }
}
.site-footer { position: relative; margin-top: 14px; background: var(--ink-900); color: var(--teal-300); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 48px; padding-block: 72px 48px; }
.footer-grid h2 { font: 500 15px/1.4 var(--f-ui); color: var(--paper); margin-bottom: 14px; }
.footer-grid a { color: var(--teal-300); }
.footer-grid a:hover { color: var(--paper); }
.footer-col { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.footer-about { font: 400 20px/1.7 var(--f-read); color: var(--teal-200); max-width: 34ch; }
.footer-bottom { border-top: 1px solid var(--teal-750); }
.footer-bottom .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 22px; font-size: 13px; color: var(--teal-400); }
.footer-bottom a { color: var(--teal-400); }
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- page head (inner pages) ---------- */
.page-head { padding-block: clamp(40px, 6vw, 80px) clamp(32px, 5vw, 64px); border-bottom: 1px solid var(--line); }
.page-head .h1 { margin-block: 18px 14px; }
.page-head--dark { position: relative; background: var(--ink-900); border: 0; padding-bottom: clamp(56px, 7vw, 88px); }
.page-head--dark .h1 { color: var(--paper); }
.page-head--dark .lead { color: var(--teal-200); }

/* ==========================================================
   HOME
   ========================================================== */
.hero { position: relative; background: var(--ink-900); color: var(--teal-100); }
.hero .wrap { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(40px, 6vw, 72px); align-items: center; padding-block: clamp(56px, 8vw, 96px) clamp(80px, 10vw, 136px); }
.hero-copy { display: flex; flex-direction: column; gap: 30px; }
.hero .kicker { color: var(--sand-300); }
.hero .display { color: var(--paper); }
.hero .lead { color: var(--teal-200); max-width: 36ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 18px; padding-top: 26px; border-top: 1px solid var(--teal-750); font-size: 14px; color: var(--teal-300); }
.hero-facts span { display: inline-flex; gap: 8px; align-items: center; }
.arch { position: relative; width: min(440px, 100%); aspect-ratio: 440 / 560; justify-self: end; }
.arch > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.arch-verse { position: absolute; inset-inline: 17%; top: 37%; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: clamp(20px, 2.4vw, 32px) 22px; background: var(--ink-900); border: 1px solid #6f6a52; text-align: center; opacity: 0; transform: translateY(12px); animation: rise .9s .35s var(--ease) forwards; }
.arch-verse p { font: 400 clamp(21px, 2vw, 27px)/2.1 var(--f-quran); color: var(--sand-100); }
.arch-verse span { font-size: 13px; color: var(--sand-500); }
.arch .draw { stroke-dasharray: 1800; stroke-dashoffset: 1800; animation: draw 2.2s .1s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { to { opacity: 1; transform: none; } }
.hero-copy > * { opacity: 0; transform: translateY(14px); animation: rise .8s var(--ease) forwards; }
.hero-copy > *:nth-child(2) { animation-delay: .08s; } .hero-copy > *:nth-child(3) { animation-delay: .16s; } .hero-copy > *:nth-child(4) { animation-delay: .24s; } .hero-copy > *:nth-child(5) { animation-delay: .32s; }
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .arch { justify-self: center; width: min(380px, 100%); }
}
.ledger { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.ledger > div { display: flex; flex-direction: column; gap: 8px; padding: 36px 28px; }
.ledger > div + div { border-right: 1px solid var(--line); }
.ledger > div:first-child { padding-right: 0; }
.ledger dt { font-size: 13px; color: var(--text-3); }
.ledger dd { margin: 0; font: 400 clamp(22px, 2vw, 28px)/1.3 var(--f-display); color: var(--ink-900); }
.ledger .note { font: 400 19px/1.5 var(--f-read); color: var(--text-2); }
@media (max-width: 960px) {
  .ledger { grid-template-columns: 1fr 1fr; }
  .ledger > div { padding: 24px 16px; }
  .ledger > div:nth-child(odd) { padding-right: 0; border-right: 0; }
  .ledger > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
.subject-list li { display: grid; grid-template-columns: 72px 1fr 210px; gap: 24px; padding: 30px 0; border-top: 1px solid var(--line); }
.subject-list li:last-child { border-bottom: 1px solid var(--line); }
.subject-list .num { font-size: 44px; }
.subject-list .name { font: 400 clamp(24px, 2.2vw, 30px)/1.3 var(--f-display); color: var(--ink-900); }
.subject-list .texts { font-size: 13.5px; color: var(--text-3); }
.subject-list .teacher { font-size: 13.5px; color: var(--text-2); padding-top: 10px; }
@media (max-width: 760px) {
  .subject-list li { grid-template-columns: 44px 1fr; gap: 16px; padding: 22px 0; }
  .subject-list .num { font-size: 30px; }
  .subject-list .teacher { grid-column: 2; padding-top: 0; }
}
.hadith { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--sand-300); display: flex; flex-direction: column; gap: 10px; }
.hadith blockquote { font: 400 26px/1.6 var(--f-read); color: var(--teal-700); }
.hadith figcaption { font-size: 13px; color: var(--text-3); }
.years { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-mid); background: var(--paper); }
.year { display: flex; flex-direction: column; gap: 22px; padding: clamp(24px, 3vw, 40px); }
.year + .year { border-right: 1px solid var(--line-mid); }
.year-term { display: flex; flex-direction: column; gap: 6px; padding-top: 18px; border-top: 1px solid #e4dfd0; }
.year-term span { font-size: 13px; color: var(--sand-700); }
.year-term p { font: 400 19px/1.6 var(--f-read); }
@media (max-width: 960px) { .years { grid-template-columns: 1fr; } .year + .year { border-right: 0; border-top: 1px solid var(--line-mid); } }
.portrait { display: flex; flex-direction: column; gap: 12px; color: inherit; }
.portrait svg { width: 100%; height: auto; }
.portrait svg path:first-child { transition: fill .3s var(--ease); }
.portrait:hover svg path:first-child { fill: var(--teal-200); }
.portrait .name { font: 400 22px/1.35 var(--f-display); color: var(--ink-900); }
.portrait .role { font-size: 14px; color: var(--sand-700); }
.fatwa-row { display: flex; flex-direction: column; gap: 8px; padding: 20px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.fatwa-row:hover { background: var(--paper-2); color: var(--text); }
.fatwa-row .title { font: 500 clamp(20px, 1.7vw, 23px)/1.45 var(--f-read); }
.fatwa-row .meta { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--text-3); }
.video-feature { position: relative; display: block; min-height: 330px; background: var(--ink-900); color: var(--paper); overflow: hidden; }
.video-feature:hover { color: var(--paper); }
.video-feature .pattern { position: absolute; top: 0; bottom: 0; left: 0; width: 38%; }
.video-feature .copy { position: relative; display: flex; flex-direction: column; gap: 12px; max-width: 58%; padding: 40px; }
.video-feature .copy .t { font: 400 clamp(24px, 2.4vw, 34px)/1.3 var(--f-display); }
.video-feature .play { position: absolute; left: 19%; top: 50%; translate: -50% -50%; width: 72px; height: 72px; border-radius: 50%; background: var(--sand-500); color: var(--ink-900); display: grid; place-items: center; transition: transform .3s var(--ease); }
.video-feature:hover .play { transform: scale(1.08); }
.video-feature .dur { position: absolute; right: 40px; bottom: 32px; }
@media (max-width: 560px) { .video-feature .copy { max-width: 100%; padding: 28px 20px 100px; } .video-feature .pattern { width: 100%; height: 40%; top: auto; } .video-feature .play { left: 50%; top: auto; bottom: 16px; translate: -50% 0; } .video-feature .dur { right: 20px; bottom: 36px; } }
.thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--teal-800); color: var(--sand-300); overflow: hidden; }
.thumb svg.pat { position: absolute; inset: 0; width: 100%; height: 100%; }
.thumb .ttl { position: absolute; inset-inline: 16px; top: 14px; font: 400 17px/1.35 var(--f-display); color: var(--paper); }
.thumb .dur { position: absolute; left: 10px; bottom: 10px; background: var(--ink-900); color: var(--teal-100); }
.thumb .bar { position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--teal-600); }
.thumb .bar span { display: block; height: 100%; background: var(--sand-500); }
.thumb .play-dot { width: 48px; height: 48px; border-radius: 50%; background: rgb(180 162 118 / .95); color: var(--ink-900); display: grid; place-items: center; transition: transform .3s var(--ease); }
a:hover .thumb .play-dot { transform: scale(1.1); }
.news { display: grid; grid-template-columns: 2fr 1fr 1fr; border-top: 1px solid var(--line-mid); }
.news article { display: flex; flex-direction: column; gap: 14px; padding: 32px 32px 8px; }
.news article:first-child { padding-right: 0; padding-left: 48px; }
.news article + article { border-right: 1px solid var(--line-mid); }
.news h3 a { color: var(--ink-900); }
.news h3 a:hover { color: var(--teal-700); }
@media (max-width: 960px) { .news { grid-template-columns: 1fr; } .news article, .news article:first-child { padding: 24px 0; } .news article + article { border-right: 0; border-top: 1px solid var(--line-mid); } }
.steps { border-top: 1px solid var(--ink-900); }
.steps li { display: flex; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.steps .num { font-size: 22px; width: 28px; flex-shrink: 0; }

/* ---------- about / program ---------- */
.principles li { display: grid; grid-template-columns: 64px 1fr; gap: 24px; }
.principles li + li { margin-top: 48px; }
.principles .num { font-size: 40px; }
.matrix { min-width: 980px; background: var(--paper); border: 1px solid var(--line-mid); font-size: 15px; }
.matrix thead tr { background: var(--ink-900); color: var(--paper); }
.matrix th.y { padding: 18px 24px 6px; font: 500 21px/1.3 var(--f-display); border-right: 1px solid var(--teal-700); }
.matrix th.s { padding: 6px 24px 16px; font-weight: 400; font-size: 13px; color: var(--teal-300); }
.matrix th.s.first { border-right: 1px solid var(--teal-700); }
.matrix th.subj { padding: 18px 24px; width: 180px; font-size: 14px; color: var(--sand-300); vertical-align: bottom; }
.matrix tbody tr { border-top: 1px solid var(--line); }
.matrix td { padding: 20px 24px; font: 400 19px/1.5 var(--f-read); border-right: 1px solid var(--line-soft); }
.matrix td.first { border-right-color: var(--line-mid); }
.matrix td.subj { font: 400 21px/1.3 var(--f-display); color: var(--ink-900); border-right: 0; }
.matrix tbody tr:hover td { background: var(--sand-50); }
.weeks { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 3px; height: 44px; }
.weeks span { background: var(--teal-200); }
.weeks .w-start { background: var(--teal-700); } .weeks .w-mid { background: var(--sand-500); } .weeks .w-final { background: var(--ink-900); }
.weight { display: flex; height: 56px; border: 1px solid var(--line-mid); font-size: 14px; font-weight: 500; }
.weight span { display: grid; place-items: center; }
.faq-item { border-bottom: 1px solid var(--line-mid); }
.faq-q { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; padding: 24px 0; border: 0; background: none; text-align: right; font: 400 clamp(19px, 1.7vw, 22px)/1.4 var(--f-display); color: var(--ink-900); }
.faq-q .i { color: var(--sand-700); transition: transform .3s var(--ease); }
.faq-q[aria-expanded="true"] .i { transform: rotate(45deg); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.faq-a > div { overflow: hidden; }
.faq-a p { padding-bottom: 24px; font: 400 20px/1.7 var(--f-read); color: var(--text-2); max-width: 62ch; }
.faq-q[aria-expanded="true"] + .faq-a { grid-template-rows: 1fr; }
.teacher-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 20px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }

/* ---------- article ---------- */
.article-body { font: 400 clamp(20px, 1.6vw, 23px)/1.95 var(--f-read); max-width: 68ch; }
.article-body p + p { margin-top: 1em; }
.article-body h2 { font: 600 28px/1.4 var(--f-display); color: var(--ink-900); margin: 1.6em 0 .6em; }
.pullquote { margin: 1.4em 0; padding: 28px 0; border-block: 1px solid var(--sand-300); font: 500 clamp(24px, 2.4vw, 30px)/1.55 var(--f-read); color: var(--teal-700); }

/* ---------- auth ---------- */
.auth { display: grid; grid-template-columns: 5fr 6fr; min-height: calc(100vh - 38px); }
.auth-art { position: relative; background: var(--ink-900); color: var(--teal-100); padding: clamp(32px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; overflow: hidden; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: clamp(32px, 5vw, 64px) var(--gutter); }
.auth-card { width: min(460px, 100%); display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-art { min-height: 280px; } }

/* ==========================================================
   FATWA
   ========================================================== */
.fatwa-layout { display: grid; grid-template-columns: 272px minmax(0, 1fr) 320px; gap: clamp(32px, 4vw, 56px); align-items: start; padding-block: 64px 120px; }
@media (max-width: 1200px) { .fatwa-layout { grid-template-columns: 240px minmax(0, 1fr); } .fatwa-layout > aside:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; } }
@media (max-width: 860px) { .fatwa-layout { grid-template-columns: 1fr; padding-block: 32px 80px; } .fatwa-layout > aside:last-child { grid-template-columns: 1fr; } .cat-nav { display: none; } .cat-nav.is-open { display: flex; } }
.cat-toggle { display: none; }
@media (max-width: 860px) { .cat-toggle { display: inline-flex; } }
.cat-nav { display: flex; flex-direction: column; font-size: 15px; }
.cat-nav > a, .cat-nav .cat-open > a { display: flex; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid #e4dfd0; color: var(--text); }
.cat-nav a span:last-child { color: var(--text-4); font-size: 13px; }
.cat-nav a:hover { background: var(--paper-2); }
.cat-sub { display: flex; flex-direction: column; margin-right: 10px; padding: 4px 22px 10px 0; border-right: 1px solid var(--sand-300); font-size: 14px; }
.cat-sub a { display: flex; justify-content: space-between; padding: 8px 10px; color: var(--text-2); }
.cat-sub a[aria-current] { background: var(--teal-100); color: var(--ink-900); font-weight: 500; }
.fatwa-item { display: grid; grid-template-columns: 88px 1fr; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.fatwa-item .no { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--text-4); padding-top: 6px; }
.fatwa-item .no b { font: 400 17px/1.2 var(--f-display); color: var(--sand-700); }
.fatwa-item h3 a { font: 600 clamp(21px, 1.8vw, 25px)/1.4 var(--f-read); color: var(--ink-900); }
.fatwa-item h3 a:hover { color: var(--teal-700); }
.fatwa-item p { font: 400 19px/1.6 var(--f-read); color: var(--text-2); max-width: 66ch; }
.fatwa-item .meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 13px; color: var(--text-3); }
.fatwa-item .meta span { display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 560px) { .fatwa-item { grid-template-columns: 1fr; gap: 8px; } .fatwa-item .no { flex-direction: row; gap: 6px; } }
mark { background: var(--sand-100); color: inherit; padding: 0 2px; }
.fatwa-read { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(40px, 6vw, 96px); padding-block: 48px 120px; align-items: start; }
@media (max-width: 1060px) { .fatwa-read { grid-template-columns: 1fr; } }
.q-block { background: var(--paper-2); padding: clamp(24px, 3vw, 36px) clamp(20px, 3vw, 40px); display: flex; flex-direction: column; gap: 14px; }
.q-block p { font: 400 clamp(20px, 1.6vw, 23px)/1.85 var(--f-read); }
.answer { font-size: clamp(20px, 1.6vw, 23px); }
.answer .prose { font-size: inherit; }
.answer .ayah { padding: 8px 0; text-align: center; font: 400 1.1em/2 var(--f-quran); color: var(--teal-800); }
.answer .ayah small, .answer .ref { font: 400 14px var(--f-ui); color: var(--sand-700); }
.answer .hadith-t { color: var(--teal-800); }
.answer blockquote { padding: 24px 28px; border: 1px solid var(--sand-300); background: var(--sand-50); }
.fs-ctrl { display: flex; align-items: center; border: 1px solid var(--line-strong); height: 36px; }
.fs-ctrl button { width: 40px; height: 34px; border: 0; background: transparent; }
.fs-ctrl span { width: 1px; height: 18px; background: var(--line-strong); }
.stages li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid #e4dfd0; font-size: 15px; }
.stages li:last-child { border-bottom: 0; }

/* ==========================================================
   APP SHELL (student + admin)
   ========================================================== */
.app { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 24px 16px; background: var(--paper-2); border-left: 1px solid var(--line); scrollbar-width: thin; }
.sidebar .brand { padding: 0 8px 22px; }
.side-group { font-size: 12px; color: var(--text-4); padding: 18px 12px 6px; }
.side-link { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: var(--radius); color: var(--text-2); font-size: 14.5px; transition: background .15s, color .15s; }
.side-link span:not(.tag) { flex-grow: 1; }
.side-link:hover { background: #e8e5da; color: var(--ink-900); }
.side-link[aria-current="page"] { background: var(--teal-100); color: var(--ink-900); font-weight: 500; }
.side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.term-card { margin: 0 4px 8px; padding: 14px; border: 1px solid var(--line); background: var(--paper); display: flex; flex-direction: column; gap: 4px; }
.sidebar--admin { background: var(--ink-900); border-left: 0; }
.sidebar--admin .side-group { color: #7f9594; }
.sidebar--admin .side-link { color: var(--teal-300); }
.sidebar--admin .side-link:hover { background: var(--teal-800); color: var(--paper); }
.sidebar--admin .side-link[aria-current="page"] { background: var(--teal-750); color: var(--paper); }
.sidebar--admin .side-foot { border-top-color: var(--teal-750); }
.appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; padding: 0 clamp(16px, 3.5vw, 48px); background: rgb(247 245 239 / .97); border-bottom: 1px solid var(--line); }
.appbar .search { width: min(320px, 30vw); }
.appbar-actions { display: flex; gap: 14px; align-items: center; }
.user-chip { display: flex; align-items: center; gap: 10px; color: inherit; }
.user-chip b { display: block; font-size: 14px; font-weight: 500; }
.user-chip small { display: block; font-size: 12px; color: var(--text-3); }
.side-toggle { display: none; }
.main { padding: clamp(20px, 3vw, 36px) clamp(16px, 3.5vw, 48px) 64px; display: flex; flex-direction: column; gap: clamp(24px, 3vw, 36px); min-width: 0; }
.main--admin { padding-inline: clamp(16px, 3vw, 40px); }
.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap; }
.page-title h1 { font: 600 clamp(28px, 2.6vw, 36px)/1.3 var(--f-display); color: var(--ink-900); }
.page-title p { font-size: 15px; color: var(--text-3); margin-top: 4px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(24px, 3vw, 40px); align-items: start; }
.side-col { display: flex; flex-direction: column; gap: 32px; }
.scrim { display: none; }
.bottom-tabs { display: none; }
@media (max-width: 1200px) { .two-col { grid-template-columns: 1fr; } .side-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } }
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; right: 0; z-index: 70; width: 290px; transform: translateX(100%); visibility: hidden; transition: transform .35s var(--ease), visibility .35s; }
  .app.is-open .sidebar { transform: none; visibility: visible; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgb(31 51 55 / .4); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .app.is-open .scrim { opacity: 1; pointer-events: auto; }
  .side-toggle { display: inline-grid; }
  .appbar .crumbs { display: none; }
}
@media (max-width: 760px) {
  .appbar .search, .user-chip .who { display: none; }
  .app--student .main { padding-bottom: 104px; }
  .bottom-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; inset-inline: 0; bottom: 0; z-index: 40; min-height: 72px; padding-bottom: env(safe-area-inset-bottom); background: var(--paper); border-top: 1px solid var(--line); }
  .bottom-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px; color: var(--text-3); }
  .bottom-tabs a[aria-current="page"] { color: var(--ink-900); font-weight: 500; }
  .bottom-tabs .i { width: 21px; height: 21px; }
}

/* ---------- student dashboard ---------- */
.next-live { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 24px 40px; align-items: center; padding: clamp(22px, 3vw, 32px) clamp(20px, 3vw, 36px); background: var(--ink-900); color: var(--teal-100); overflow: hidden; }
.next-live .pat { position: absolute; left: 0; top: 0; width: 260px; height: 100%; }
.next-live > div { position: relative; }
.next-live .t { font: 400 clamp(22px, 2.2vw, 30px)/1.35 var(--f-display); color: var(--paper); }
.next-live .actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 900px) { .next-live { grid-template-columns: 1fr; } }
.stat-strip { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); border: 1px solid var(--line); background: var(--surface); }
.stat-strip > * { display: flex; flex-direction: column; gap: 6px; padding: 18px 22px; color: inherit; }
.stat-strip > * + * { border-right: 1px solid var(--line); }
.stat-strip .lbl { font-size: 13px; color: var(--text-3); }
.stat-strip .val { font-size: 26px; font-weight: 600; color: var(--ink-900); line-height: 1.2; }
.stat-strip .sub { font-size: 12.5px; color: var(--text-3); }
.stat-strip .up { color: var(--ok-ink); } .stat-strip .warn { color: var(--warn-ink); }
@media (max-width: 1100px) { .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat-strip > * { border-bottom: 1px solid var(--line); } .stat-strip > *:nth-child(odd) { border-right: 0; } }
.ring { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: var(--teal-100); }
.ring .val { stroke: var(--teal-700); stroke-dasharray: 0 100; transition: stroke-dasharray 1.2s var(--ease); }
.resume { display: grid; grid-template-columns: 150px 1fr; gap: 16px; color: var(--text); }
.resume .thumb { aspect-ratio: auto; height: 88px; }

/* ---------- subject page ---------- */
.term-switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px clamp(16px, 3.5vw, 48px); background: var(--paper-2); border-bottom: 1px solid var(--line); font-size: 14px; }
.year-tabs { display: flex; gap: 4px; }
.year-tabs button { min-height: 34px; padding: 0 14px; border: 1px solid transparent; background: transparent; color: var(--text-2); border-radius: var(--radius); display: inline-flex; gap: 6px; align-items: center; }
.year-tabs button[aria-selected="true"] { border-color: var(--line-strong); background: var(--paper); color: var(--ink-900); font-weight: 500; }
.year-tabs button:disabled { color: #a3aaa8; cursor: not-allowed; }
.course-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 40px; flex-wrap: wrap; }
.course-head h1 { font: 600 clamp(34px, 3.4vw, 46px)/1.2 var(--f-display); color: var(--ink-900); }
.unit { border: 1px solid var(--line); background: var(--surface); }
.unit--current { border-color: var(--ink-900); }
.unit-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 16px 20px; border: 0; background: transparent; text-align: right; }
.unit-head .t { display: flex; gap: 14px; align-items: center; font-weight: 500; }
.unit-head .t .k { font-size: 19px; font-weight: 400; color: var(--ink-900); }
.unit-head .chev { color: var(--sand-700); transition: transform .3s var(--ease); }
.unit-head[aria-expanded="false"] .chev { transform: rotate(90deg); }
.unit-body { border-top: 1px solid var(--line); }
.unit-body[hidden] { display: none; }
.lesson { display: grid; grid-template-columns: 36px 1fr 150px 100px 150px; gap: 16px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); color: var(--text); font-size: 14.5px; }
.lesson:last-child { border-bottom: 0; }
a.lesson:hover { background: var(--paper-2); color: var(--text); }
.lesson--now { background: var(--teal-50); }
.lesson--future { color: var(--text-3); }
.unit--locked { border-style: dashed; border-color: var(--line-strong); color: var(--text-3); }
@media (max-width: 860px) { .lesson { grid-template-columns: 28px 1fr auto; } .lesson .c-date, .lesson .c-dur { display: none; } }

/* ---------- player ---------- */
.player { background: var(--ink-900); color: var(--teal-100); }
.player-stage { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; }
.slide { width: 74%; padding: clamp(20px, 3.4vw, 40px) clamp(20px, 4vw, 48px); background: var(--paper); color: var(--text); display: flex; flex-direction: column; gap: 16px; }
.slide ol { list-style: arabic-indic; padding-right: 24px; font: 400 clamp(16px, 1.7vw, 22px)/1.8 var(--f-read); }
.player-badges { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; }
.player-badges .tag { background: var(--teal-800); color: var(--teal-100); }
.pip { position: absolute; bottom: 16px; left: 16px; width: 18%; aspect-ratio: 16 / 9; background: var(--teal-800); border: 1px solid var(--teal-600); display: grid; place-items: center; color: var(--teal-400); font-size: 12px; }
.player-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(31 51 55 / .35); opacity: 0; transition: opacity .25s var(--ease); border: 0; color: var(--paper); }
.player.is-paused .player-overlay { opacity: 1; }
.player-overlay span { width: 76px; height: 76px; border-radius: 50%; background: var(--sand-500); color: var(--ink-900); display: grid; place-items: center; }
.controls { padding: 12px 20px 16px; display: flex; flex-direction: column; gap: 10px; }
.scrub { position: relative; height: 16px; cursor: pointer; }
.scrub .track, .scrub .fill { position: absolute; top: 6px; height: 4px; }
.scrub .track { inset-inline: 0; background: var(--teal-700); }
.scrub .fill { right: 0; background: var(--sand-500); }
.scrub .mark { position: absolute; top: 4px; width: 2px; height: 8px; background: var(--ink-900); }
.scrub .knob { position: absolute; top: 1px; width: 14px; height: 14px; margin-right: -7px; border-radius: 50%; background: var(--paper); }
.ctrl-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; flex-wrap: wrap; }
.ctrl-row button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; min-height: 32px; border: 1px solid var(--teal-600); background: transparent; color: var(--teal-100); padding: 0 10px; font-size: 12.5px; }
.ctrl-row button.bare { border: 0; width: 36px; padding: 0; display: grid; place-items: center; color: var(--paper); }
.ctrl-row button[aria-pressed="true"] { background: var(--teal-700); }
.chapters li { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; padding: 13px 8px; border-bottom: 1px solid var(--line-soft); font-size: 15px; cursor: pointer; transition: background .15s; }
.chapters li:hover { background: var(--paper-2); }
.chapters li.done { color: var(--text-3); }
.chapters li.now { background: var(--teal-100); color: var(--ink-900); font-weight: 500; }
.chapters .ts { color: var(--text-3); font-variant-numeric: tabular-nums; }
.note-item { display: flex; flex-direction: column; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.note-item .at { font-size: 12.5px; color: var(--teal-700); font-weight: 500; }
.note-item p { font: 400 18px/1.6 var(--f-read); }

/* ---------- attendance ---------- */
.att-summary { display: grid; grid-template-columns: 260px 1fr; gap: 24px 48px; align-items: center; padding: 28px 32px; }
.att-summary .big { font: 400 52px/1.1 var(--f-display); color: var(--ink-900); }
.att-summary > div:first-child { padding-left: 40px; border-left: 1px solid var(--line); }
@media (max-width: 860px) { .att-summary { grid-template-columns: 1fr; } .att-summary > div:first-child { border: 0; padding: 0; } }
.stackbar { display: flex; height: 14px; gap: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 14px; color: var(--text-2); }
.legend span { display: inline-flex; gap: 8px; align-items: center; }
.legend i { width: 12px; height: 12px; display: inline-block; }
.c-P { background: var(--teal-700); } .c-L { background: var(--sand-500); } .c-E { background: var(--teal-200); } .c-A { background: var(--live); } .c-U { border: 1px solid var(--line-mid); }
.att-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 80px 150px; gap: 24px; align-items: center; padding: 16px 8px; border-bottom: 1px solid var(--line-soft); }
.att-row:hover { background: var(--paper-2); }
.att-cells { display: grid; grid-template-columns: repeat(32, minmax(0, 1fr)); gap: 3px; }
.att-cells span { height: 22px; position: relative; }
.att-cells span[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); right: 50%; transform: translateX(50%); z-index: 5; padding: 6px 10px; background: var(--ink-900); color: var(--paper); font-size: 12px; white-space: nowrap; }
@media (max-width: 1100px) { .att-row { grid-template-columns: 1fr auto; } .att-cells { grid-column: 1 / -1; order: 3; } .att-row .note { display: none; } }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.cal > div { min-height: 118px; padding: 8px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.cal .dow { min-height: 0; padding: 10px 8px; background: var(--paper-2); font-size: 12.5px; color: var(--text-3); }
.cal .d { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); }
.cal .d b { font-weight: 500; color: var(--text); }
.cal .muted-day { background: var(--paper); }
.cal .today { box-shadow: inset 0 0 0 2px var(--teal-700); }
.cal .ev { padding: 3px 6px; background: var(--teal-100); color: var(--teal-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev--exam { background: var(--ink-900); color: var(--paper); }
.cal .ev--task { background: var(--warn-bg); color: var(--warn-ink); }
.cal .ev--event { background: var(--sand-100); color: #6f6139; }
@media (max-width: 760px) { .cal > div { min-height: 72px; padding: 4px; } .cal .ev { font-size: 0; height: 6px; padding: 0; } }

/* ---------- bars ---------- */
.hbars { position: relative; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.hbar { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; }
.hbar .b { height: 18px; background: var(--line-soft); }
.hbar .b span { display: block; height: 100%; background: var(--teal-700); transform-origin: right; animation: grow 1s var(--ease) both; }
.hbar .b span.low { background: var(--sand-500); }
.hbar .v { text-align: left; font-weight: 500; }
@keyframes grow { from { transform: scaleX(0); } }
.vbars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 12px; border-bottom: 1px solid var(--line-mid); }
.vbars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; font-size: 12px; color: var(--text-3); }
.vbars div span { width: 100%; max-width: 36px; background: var(--teal-700); transform-origin: bottom; animation: growY 1s var(--ease) both; }
@keyframes growY { from { transform: scaleY(0); } }

/* ---------- admin fatwa queue ---------- */
.queue { display: grid; grid-template-columns: 400px minmax(0, 1fr); border: 1px solid var(--line); background: var(--surface); min-height: 820px; }
.queue-list { display: flex; flex-direction: column; border-left: 1px solid var(--line); min-width: 0; }
.q-item { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 16px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: right; color: var(--text); transition: background .15s; }
.q-item:hover { background: var(--paper-2); }
.q-item[aria-selected="true"] { background: var(--teal-100); }
.q-item .top { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.q-item .t { font-weight: 500; font-size: 14.5px; line-height: 1.55; }
.q-item[aria-selected="true"] .t { font-weight: 600; }
.q-item .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.editor-pane { display: flex; flex-direction: column; min-width: 0; }
.stepper { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.stepper li { display: flex; gap: 6px; align-items: center; color: var(--text-4); }
.stepper li.done { color: var(--ok-ink); }
.stepper li.now { color: var(--ink-900); font-weight: 600; }
.stepper li.now::before { content: ""; width: 8px; height: 8px; background: var(--sand-500); }
.stepper .ln { width: 18px; height: 1px; background: var(--line-strong); }
.rte { border: 1px solid var(--line-strong); background: var(--paper); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.rte-bar button { min-width: 34px; height: 32px; border: 0; background: transparent; display: inline-grid; place-items: center; padding: 0 8px; font-size: 13px; border-radius: var(--radius); }
.rte-bar button:hover { background: var(--paper-2); color: var(--ink-900); }
.rte-bar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.rte-body { min-height: 300px; padding: 20px 24px; font: 400 19.5px/1.9 var(--f-read); outline: 0; }
.rte-body p + p { margin-top: 12px; }
.pane-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--paper); }
@media (max-width: 1180px) { .queue { grid-template-columns: 1fr; } .queue-list { border-left: 0; border-bottom: 1px solid var(--line); max-height: 420px; overflow-y: auto; } }

/* ---------- admin misc ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.bulk { display: none; align-items: center; gap: 12px; padding: 10px 14px; background: var(--ink-900); color: var(--paper); font-size: 14px; }
.bulk.is-on { display: flex; }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; z-index: 80; width: min(480px, 100%); background: var(--paper); border-right: 1px solid var(--line); box-shadow: 16px 0 48px rgb(31 51 55 / .15); display: flex; flex-direction: column; transform: translateX(-100%); visibility: hidden; transition: transform .4s var(--ease), visibility .4s; }
.drawer.is-open { transform: none; visibility: visible; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 24px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; flex-grow: 1; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }
.drawer-scrim { position: fixed; inset: 0; z-index: 75; background: rgb(31 51 55 / .35); opacity: 0; pointer-events: none; transition: opacity .3s; }
.drawer-scrim.is-on { opacity: 1; pointer-events: auto; }
.tree li { border-bottom: 1px solid var(--line-soft); }
.tree-row { display: grid; grid-template-columns: 1fr 120px 120px 110px 40px; gap: 16px; align-items: center; padding: 12px 14px; font-size: 14px; }
.tree-row--head { font-size: 12.5px; color: var(--text-3); }
@media (max-width: 900px) { .tree-row { grid-template-columns: 1fr auto; } .tree-row .opt { display: none; } }
.mini-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.screens-map a { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--text); font-size: 15px; }
.screens-map a:hover { color: var(--ink-900); }
.screens-map a span:last-child { color: var(--text-4); font-size: 13px; direction: ltr; }

/* ---------- layout variants ---------- */
.split--portrait { grid-template-columns: 320px 1fr; }
.split--contact { grid-template-columns: 5fr 7fr; }
.split--form { grid-template-columns: 7fr 4fr; }
.years--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.news-grid article { display: flex; flex-direction: column; gap: 12px; padding-top: 22px; border-top: 1px solid var(--line-mid); }
.news-grid h2 a { color: var(--ink-900); }
@media (max-width: 960px) { .years--4 { grid-template-columns: 1fr 1fr; } .years--4 .year:nth-child(3) { border-right: 0; } }
@media (max-width: 860px) { .split--portrait, .split--contact, .split--form { grid-template-columns: 1fr; } .faq-nav { display: none; } }
@media (max-width: 560px) { .years--4 { grid-template-columns: 1fr; } }
.live-room { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
@media (max-width: 1000px) { .live-room { grid-template-columns: 1fr; } .live-room > .stack { border-right: 0 !important; border-top: 1px solid var(--teal-750); } }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
.form-grid--3 { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 900px) { .form-grid--3 { grid-template-columns: 1fr; } }
.table-wrap > .table { min-width: 640px; }

/* ---------- hero fits the first screen: topbar + header + hero = 100vh ---------- */
:root { --chrome-h: 127px; }
@media (max-width: 640px) { :root { --chrome-h: 107px; } }
.hero { display: flex; min-height: calc(100vh - var(--chrome-h)); min-height: calc(100svh - var(--chrome-h)); }
.hero .wrap { flex: 1; align-content: center; padding-block: clamp(28px, 5vh, 64px) clamp(44px, 7vh, 80px); }
.hero-copy { gap: clamp(14px, 2.6vh, 28px); }
.hero .display { font-size: min(clamp(40px, 6vw, 86px), 10vh); }
.hero .lead { font-size: min(clamp(19px, 1.9vw, 26px), 3.1vh); }
.hero-facts { margin-top: clamp(4px, 1.5vh, 18px); padding-top: clamp(14px, 2.4vh, 26px); }
.hero .btn--lg { min-height: min(52px, 6vh); }
.arch { height: min(560px, calc(100svh - var(--chrome-h) - 130px)); width: auto; aspect-ratio: 440 / 560; }
.arch-verse p { font-size: min(clamp(20px, 2vw, 27px), 3.2vh); }
@media (max-width: 960px) { .arch { display: none; } }
@media (max-height: 640px) { .hero-facts { display: none; } }

/* ---------- footer platform switcher ---------- */
.platforms { border-top: 1px solid var(--teal-750); }
.platforms .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding-block: 24px; }
.platforms-label { font: 400 20px/1.4 var(--f-display); color: var(--paper); }
.platforms-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.platforms-nav .btn { color: var(--teal-100); }
.platforms-nav .btn:hover { background: var(--teal-800); color: var(--paper); }
@media (max-width: 640px) { .platforms-nav .btn { flex: 1 1 calc(50% - 10px); } }

/* ---------- message threads ---------- */
.thread { display: flex; flex-direction: column; min-height: 100%; }
.thread[hidden] { display: none; }
.msg { display: flex; flex-direction: column; gap: 6px; max-width: 78%; padding: 14px 18px; background: var(--paper-2); align-self: flex-end; }
.msg p { font: 400 18px/1.7 var(--f-read); }
.msg--me { align-self: flex-start; background: var(--teal-100); }
@media (max-width: 640px) { .msg { max-width: 100%; } }

/* ---------- CMS editor (admin/content) ---------- */
.ed-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px; gap: 28px; align-items: start; }
.ed-toc { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.ed-toc a { padding: 8px 12px; color: var(--text-2); border-radius: var(--radius); }
.ed-toc a:hover { background: var(--paper-2); color: var(--ink-900); }
.ed-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 20px; }
.ed-sec { border: 1px solid var(--line); background: var(--surface); scroll-margin-top: 96px; }
.ed-sec + .ed-sec { margin-top: 20px; }
.ed-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.ed-head h3 { font: 400 19px/1.4 var(--f-display); color: var(--ink-900); }
.ed-head .meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-3); }
.ed-body { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.rep { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--paper); }
.rep-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 36px; gap: 12px; align-items: start; padding: 14px; border-bottom: 1px solid var(--line-soft); }
.rep-row:last-of-type { border-bottom: 0; }
.rep-row .grip { color: var(--text-4); padding-top: 10px; cursor: grab; }
.rep-fields { display: grid; gap: 10px; grid-template-columns: repeat(var(--c, 1), minmax(0, 1fr)); }
.rep-add { display: flex; justify-content: center; padding: 10px; border-top: 1px dashed var(--line-strong); }
.mini-label { font-size: 12.5px; color: var(--text-3); margin-bottom: -4px; }
.matrix-edit { min-width: 900px; }
.matrix-edit td, .matrix-edit th { padding: 6px; border: 1px solid var(--line); }
.matrix-edit th { background: var(--paper-2); font-size: 12.5px; color: var(--text-2); text-align: center; }
.matrix-edit input { width: 100%; min-height: 36px; border: 0; background: transparent; font-size: 14px; padding: 0 6px; }
.matrix-edit input:focus { outline: 2px solid var(--teal-200); background: var(--surface); }
.chip-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-pick label { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; cursor: pointer; }
.chip-pick label:has(input:checked) { border-color: var(--teal-700); background: var(--teal-50); }
.chip-pick input { accent-color: var(--teal-700); }
.dirty-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sand-500); display: inline-block; }
@media (max-width: 1280px) { .ed-layout { grid-template-columns: minmax(0, 1fr) 260px; } .ed-toc { display: none; } }
@media (max-width: 960px) { .ed-layout { grid-template-columns: 1fr; } .ed-side { position: static; } .rep-fields { grid-template-columns: 1fr !important; } }
.ed-layout--2 { grid-template-columns: minmax(0, 1fr) 280px; }
.fg-21 { grid-template-columns: 2fr 1fr; } .fg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rep-fields[data-tl] { grid-template-columns: 120px 1fr; }
@media (max-width: 960px) { .ed-layout--2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .fg-21, .fg-3, .fg-4 { grid-template-columns: 1fr; } }

/* ---------- responsive hardening ---------- */
.two-col > *, .split > *, .cols-2 > *, .cols-3 > *, .cols-4 > *, .queue > *, .ed-layout > *, .fatwa-layout > *, .fatwa-read > *, .main > * { min-width: 0; }
.input, .select, .textarea { max-width: 100%; }
.filters > * { max-width: 100%; }
@media (max-width: 760px) {
  .page-title { align-items: flex-start; }
  .page-title > .row, .page-title > .btn, .page-title > .search, .page-title > .seg { width: 100%; }
  .page-title > .row { flex-wrap: wrap; }
  .filters .select, .filters .search { width: 100% !important; }
  .seg { max-width: 100%; overflow-x: auto; }
  .seg button { white-space: nowrap; }
  .appbar { min-height: 60px; }
}

/* ---------- tables become stacked rows on phones ---------- */
@media (max-width: 640px) {
  .table-wrap > .table { min-width: 0; }
  .table thead { display: none; }
  .table tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 14px 2px; }
  .table td { padding: 0; font-size: 13.5px; }
  .table td:first-child { flex-basis: 100%; font-size: 14.5px; }
  .table td:empty { display: none; }
  .table--check td:first-child { flex-basis: auto; }
  .table--check td:nth-child(2) { flex: 1 1 75%; }
  .table .meter { width: 90px !important; }
}
@media (max-width: 640px) {
  .player-stage { aspect-ratio: auto; min-height: 250px; padding: 22px 0; }
  .slide { width: 90%; padding: 16px 18px; gap: 10px; }
  .slide ol { font-size: 16px; line-height: 1.75; }
  .player-badges { display: none; }
  .ctrl-row { gap: 8px; }
}
