/* =====================================================================
   هوية الحرمين — نظام التصميم
   ===================================================================== */
@font-face { font-family: 'Haramain Arabic'; src: url('/assets/arabic-regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Haramain Arabic'; src: url('/assets/arabic-medium.ttf') format('truetype'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Haramain Arabic'; src: url('/assets/arabic-bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
/* خطُّ النسخ المرفقُ بالمنصة: مرجعٌ مضمونٌ لا يتوقَّف على جهاز العضو
   (ملاحظة ٤٢٤). ومعه Traditional Arabic بالاسم لمن كان عنده مثبَّتًا،
   فإن لم يكن نزل إلى المرفق، فإن لم يكن نزل إلى خطّ المنصة. */
@font-face { font-family: 'Haramain Naskh'; src: url('/assets/naskh-regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Haramain Naskh'; src: url('/assets/naskh-bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  /* هوية النسخة الأولى: الداكن هو الأصل، والفاتح اختياري */
  --gold: #bc9661;
  --gold-2: #b29c65;
  --ink: #1a232d;
  --panel: #1f2a37;
  --bg: #1a232d;
  --surface: #222e3b;
  --soft: #2c3846;
  --text: #ffffff;
  --muted: #c0c7ce;
  --border: #44505c;
  --field: #1a232d;
  --accent-text: #d5bd87;
  --ok: #7fc79a; --ok-bg: #1f3a2b;
  --warn: #f0c27a; --warn-bg: #3d2f18;
  --bad: #ff9a94; --bad-bg: #43201f;
  --info-bg: #2c3846;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: none;
  --font: 'Haramain Arabic', 'IBM Plex Sans Arabic', -apple-system, 'Segoe UI', Tahoma, sans-serif;
  /* أسماءٌ مرادفةٌ استُعملت في الأنماط ولم تُعرَّف، فكانت تُفسِد خاصّيتَها
     وتجعلها شفّافةً أو بلا حدّ — كلُّ var() لا قيمةَ له يُبطِل سطرَه
     عند الحساب لا عند التحليل، فلا يرِثُ ما قبلَه (إصلاح) */
  --card: var(--surface);
  --line: var(--border);
  --accent: var(--gold);
  --bg-soft: var(--soft);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #ffffff; --surface: #ffffff; --soft: #f5f4f1; --text: #1f2a37; --muted: #62686f;
  --border: #d8dadd; --field: #ffffff; --accent-text: #7b5d31;
  --ok: #2d6846; --ok-bg: #e4efe7; --warn: #9a5b12; --warn-bg: #f8ecd9; --bad: #a3322b; --bad-bg: #f7e1df; --info-bg: #eef0f3;
  --shadow: 0 1px 2px rgb(16 21 27 / 6%), 0 4px 16px rgb(16 21 27 / 5%);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.8 var(--font); }
img { max-width: 100%; }
a { color: var(--accent-text); }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--gold); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--ink); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- الترويسة (شعار الهيئة | شعار الرئاسة، ثم اسم المنصة) ---------- */
.topbar { background: var(--ink) url('/assets/pattern.png') center; color: #fff; border-bottom: 1px solid #b29c6566; }
.topbar .inner { max-width: 1440px; margin: 0 auto; min-height: 74px; padding: 10px 24px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 22px; color: #fff; text-decoration: none; }
.identity-logos { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.identity-logos img { object-fit: contain; filter: brightness(0) invert(1); }
.identity-logos .authority { width: 94px; height: 50px; }
.identity-logos .presidency { width: 75px; height: 50px; }
.identity-logos .sep { display: block; width: 1px; height: 42px; background: #b5b6b2; }
.brand-copy { border-inline-start: 1px solid #b29c6570; padding-inline-start: 22px; }
.brand-copy b { display: block; font-size: 1.15rem; color: #fff; line-height: 1.5; }
.brand-copy span { display: block; font-size: .875rem; color: #d5bd87; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .9rem; text-align: end; }
.topbar .who small { display: block; color: #d1c8b5; }
.topbar .btn { border-color: #b29c6566; color: #fff; background: #ffffff0c; border-radius: 99px; }
.topbar .btn:hover { background: rgb(255 255 255 / 10%); }
@media (max-width: 800px) {
  .topbar .inner { padding: 12px 18px; gap: 12px; }
  .brand { gap: 12px; }
  .brand-copy { border: 0; padding: 0; }
  .brand-copy b { font-size: 1rem; }
  .identity-logos .authority { width: 83px; height: 45px; }
  .identity-logos .presidency { width: 67px; height: 45px; }
  .topbar .who { display: none; }
}
@media (max-width: 520px) { .brand-copy span { display: none; } }

/* ---------- التذييل ---------- */
footer.site { background: var(--ink) url('/assets/pattern.png') center; color: #c9c5ba; border-top: 1px solid #b29c654d; font-size: .875rem; }
footer.site .inner { max-width: 1440px; margin: 0 auto; padding: 20px 24px; display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }

.env-flag { background: var(--warn-bg); color: var(--warn); text-align: center; font-size: .8rem; padding: 4px 12px; }

/* ---------- التخطيط: قائمة جانبية بعرض 225 ---------- */
.layout { max-width: 1488px; margin: 0 auto; display: grid; grid-template-columns: 225px minmax(0, 1fr); align-items: stretch; min-height: calc(100vh - 150px); }
.sidenav { background: var(--bg); border-inline-end: 1px solid var(--border); padding: 22px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidenav a { display: block; padding: 10px 14px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .9375rem; border-inline-start: 3px solid transparent; }
.sidenav a:hover { background: var(--soft); }
.sidenav a[aria-current="page"] { background: #bc966126; color: var(--accent-text); border-inline-start-color: var(--gold); font-weight: 600; }
.layout > main { padding: 28px; }
main { min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .grow { flex: 1; min-width: 220px; }
.eyebrow { color: var(--accent-text); font-size: .85rem; font-weight: 600; margin-bottom: 2px; }
@media (max-width: 650px) {
  .layout { grid-template-columns: 1fr; }
  .sidenav { flex-direction: row; flex-wrap: wrap; gap: 5px; padding: 12px; border-inline-end: 0; border-bottom: 1px solid var(--border); }
  .sidenav a { flex: 1 1 130px; font-size: .875rem; text-align: center; }
  .layout > main { padding: 18px 14px; }
}

/* ---------- البطاقات ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
:is(.grid, .grid-2, .kpis, .portal-grid) > .card { margin-top: 0; }
.card h3 { margin-bottom: 10px; }
.stack { display: grid; gap: 16px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 14px 16px; }
.kpi b { display: block; font-size: 1.8rem; line-height: 1.2; color: var(--accent-text); }
.kpi span { font-weight: 600; }
.kpi small { display: block; color: var(--muted); font-size: .8rem; }
.kpi.bad { border-top-color: var(--bad); } .kpi.bad b { color: var(--bad); }
.kpi.warn { border-top-color: var(--warn); }
.kpi.ok { border-top-color: var(--ok); }

/* ---------- الأزرار والحقول ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 9px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--soft); border-color: var(--gold); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1a232d; }
.btn.primary:hover { background: #cfad7d; }
.btn.pill { border-radius: 99px; }
.btn.danger { color: var(--bad); border-color: currentColor; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { min-height: 36px; padding: 4px 14px; font-size: .875rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
label.field { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
label.field > small { font-weight: 400; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; min-height: 46px; width: 100%; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: 2px solid color-mix(in srgb, var(--gold) 35%, transparent); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--gold); }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; cursor: pointer; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; }
.err { color: var(--bad); font-size: .88rem; }
.form-errors { background: var(--bad-bg); color: var(--bad); border-radius: var(--radius-sm); padding: 10px 14px; }
.form-errors ul { margin: 0; padding-inline-start: 18px; }

/* ---------- الشارات والجداول ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: .8rem; font-weight: 600; background: var(--info-bg); color: var(--text); white-space: nowrap; }
.badge.gold { background: #bc96612b; color: var(--accent-text); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .82rem; color: var(--muted); font-weight: 600; background: var(--soft); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; color: var(--muted); font-size: .82rem; }
/* الجداول على الشاشات الضيقة: كل صف بطاقة، وكل خلية معنونة */
@media (max-width: 720px) {
  table.responsive thead { display: none; }
  table.responsive tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  table.responsive td { display: grid; grid-template-columns: 110px 1fr; gap: 8px; border: 0; padding: 4px 12px; }
  table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; }
}
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 4px; }

/* ---------- شريط المراحل ---------- */
.stages { display: flex; gap: 6px; flex-wrap: wrap; }
.stage { flex: 1 1 120px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--soft); font-size: .85rem; min-width: 110px; }
.stage b { display: block; }
.stage .who { color: var(--muted); }
.stage.done { background: var(--ok-bg); border-color: transparent; }
.stage.active { background: var(--surface); border: 2px solid var(--gold); }
.stage.late .when { color: var(--bad); font-weight: 600; }
.progress { height: 8px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--gold); }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; }
.timer.late { color: var(--bad); }
.timer.soon { color: var(--warn); }

/* ---------- المحرر ---------- */
.editor { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--field); }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--soft); border-radius: var(--radius-sm) var(--radius-sm) 0 0; position: sticky; top: 0; z-index: 3; }
.tools button, .tools select { min-height: 32px; padding: 2px 8px; font-size: .85rem; width: auto; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-family: inherit; }
.tools button.b { font-weight: 700; } .tools button.i { font-style: italic; } .tools button.u { text-decoration: underline; } .tools button.s { text-decoration: line-through; }
.tools .color input { width: 34px; min-height: 32px; padding: 2px; border-radius: 6px; }
.tools .sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 2px; }
.editor.plain .area { min-height: 260px; padding: 14px; outline: none; line-height: 1.9; font-size: 1.02rem; }
.editor .area:empty::before { content: attr(data-placeholder); color: var(--muted); }
.editor.plain.readonly .area { background: var(--soft); }
.editor.paged { border: 0; background: transparent; }
.editor.paged .tools { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; }

.editor-foot { text-align: center; margin-top: 6px; }
.editor .area table, .lh-body table, .print-body table { border-collapse: collapse; width: 100%; margin: .5em 0; }
.editor .area td, .editor .area th, .lh-body td, .lh-body th, .print-body td, .print-body th { border: 1px solid currentColor; padding: .25em .5em; vertical-align: top; min-width: 2em; }
.lh-body th, .print-body th { background: rgb(188 150 97 / 18%); }
.lh-body hr, .print-body hr { border: 0; border-top: 1px solid #bc9661; margin: 1em 0; }
.source-text { background: var(--soft); border-radius: var(--radius-sm); padding: 14px; line-height: 2; max-height: 70vh; overflow: auto; }

/* ---------- صفحة A4 على الكليشة: مساحة كتابة ثابتة موحّدة ----------
   الصفحة 210×297مم، والكتابة داخل صندوق: أعلى 38 أسفل 32 جانبان 20 (انظر page.js).
   --pt نقطة طباعة واحدة بمقياس عرض الصفحة، فتطابق الأحجامُ الطباعةَ. */
.a4 { position: relative; width: 100%; aspect-ratio: 210 / 297; container-type: inline-size; background: #fff; color: #111; box-shadow: 0 2px 14px rgb(0 0 0 / 35%); border-radius: 2px; overflow: hidden; }
.lh-page::before { content: ''; position: absolute; inset: 0;
  /* الكليشةُ العاملة: تُضبَط عند الدخول، والمرفقةُ أصلٌ لها (ملاحظة ٤٥٨) */
  background: var(--lh-img, url('/assets/letterhead.jpg')) center / 100% 100% no-repeat;
  pointer-events: none; }
/* نافذةُ الكتابة هي نافذةُ التصدير بعينها: أعلى 38، وأسفلُها 32 للكليشة
   + 8 لشريط رقم الصفحة + 9 فسحةَ أمان = 49 (انظر BOX في page.js).
   فما يُوازنه المستخدمُ على الشاشة هو ما يخرج في PDF (ملاحظة ٤٢٣). */
.lh-body { --pt: calc(100cqw / 595.28); position: absolute; top: calc(38 / 297 * 100%); bottom: calc(49 / 297 * 100%); inset-inline: calc(20 / 210 * 100%);
  overflow-y: auto; overscroll-behavior: contain; font-size: calc(var(--pt) * 12); line-height: 1.8; scrollbar-width: thin; }
/* شريطُ رقم الصفحة: يُرى موضعُه ولا يُكتَب فيه، ولا يُطبَع من المحرر */
.lh-num { --pt: calc(100cqw / 595.28); position: absolute; top: calc(248 / 297 * 100%);
  height: calc(8 / 297 * 100%); inset-inline: calc(20 / 210 * 100%); pointer-events: none;
  display: flex; align-items: center; justify-content: center; z-index: 2;
  border-top: 1px dashed rgb(188 150 97 / 45%); }
.lh-num span { font-size: calc(var(--pt) * 7); color: rgb(107 98 87 / 75%); letter-spacing: .3px; }
.lh-body .area { min-height: 100%; outline: none; padding-bottom: 1em; }
/* أساسُ متن الطباعة: ١٢ نقطةً بتباعد ١٫٨ — تستعمله نوافذُ الطباعة
   ويستعمله المحررُ في قياسه الخفيِّ، فيتَّحد المقياسان (ملاحظة ٤٣٠) */
.print-body { --pt: 1pt; font-size: 12pt; line-height: 1.8; }
/* صندوقُ قياسٍ بمقاس الطباعة الحقيقيِّ خارجَ الشاشة: به تُحسَب فواصلُ
   صفحات المحرر كما تقع في PDF بالضبط، لا بمقاس العرض */
.lh-measure { position: absolute; visibility: hidden; pointer-events: none;
  top: -10000mm; inset-inline-start: 0; width: 170mm; z-index: -1; }
.lh-measure .area { min-height: 0; padding-bottom: 0; }
.lh-measure .lh-guides, .lh-measure .lh-num { display: none; }
.lh-body p, .print-body p { margin: 0 0 .6em; }
.lh-body h2, .print-body h2 { font-size: 1.35em; margin: .4em 0; } .lh-body h3, .print-body h3 { font-size: 1.15em; margin: .4em 0; }
.lh-body blockquote, .print-body blockquote { margin: .4em 2em; }
.a4 .area:empty::before { color: #9aa1a8; }
.editor.readonly .lh-body { cursor: default; }

/* بطاقة البيانات أعلى مساحة الترجمة: صفّان بعرض الصفحة، عرض كل عمود بحسب بيانه */
table.data-card { border-collapse: collapse; table-layout: auto; width: 100%; margin: 0 0 1.1em; font-size: calc(var(--pt, 1pt) * 11); line-height: 1.45; direction: rtl; text-align: center; user-select: none; }
table.data-card th, table.data-card td { border: 1px solid #bc9661; padding: .35em .5em; vertical-align: middle; text-align: center; }
table.data-card th { background: rgb(188 150 97 / 16%); color: #8a6835; font-weight: 700; white-space: nowrap; letter-spacing: .2px; }
table.data-card td { color: #111; }

/* عارض الأصل */
.pdf-viewer { outline: none; user-select: none; -webkit-user-select: none; }
.pdf-page { background: #fff; }
.pdf-canvas { display: block; width: 100%; height: 100%; }
.pdf-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }
.pdf-count { font-variant-numeric: tabular-nums; min-width: 110px; text-align: center; }

/* تحديد مواضع التعديل على أصل الخطبة (ملاحظة ٢٨) */
.pdf-stage { position: relative; width: 100%; height: 100%; }
.pdf-viewer.drawing .pdf-stage { cursor: crosshair; touch-action: none; }
.pdf-marks { position: absolute; inset: 0; pointer-events: none; }
.pdf-marks .mark { position: absolute; border: 2px solid var(--mark-c, #b3261e); background: color-mix(in srgb, var(--mark-c, #b3261e) 18%, transparent); border-radius: 3px; }
.pdf-marks .mark[data-kind="delete"]   { --mark-c: #b3261e; }
.pdf-marks .mark[data-kind="add"]      { --mark-c: #1f7a3d; }
.pdf-marks .mark[data-kind="rephrase"] { --mark-c: #9a6b00; }
.pdf-marks .mark[data-kind="fix"]      { --mark-c: #1b5fa8; }
.pdf-marks .mark[data-kind="other"]    { --mark-c: #5a4b8a; }
.pdf-marks .mark.draft { --mark-c: #111; border-style: dashed; }
.mark-tag { position: absolute; top: -1.35em; right: -2px; background: var(--mark-c, #b3261e); color: #fff; font-size: .68rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }

/* لوحة التعديلات المطلوبة */
.revision-box { border: 1px solid var(--gold); border-radius: 12px; padding: 14px 16px; background: color-mix(in srgb, var(--gold) 10%, transparent); }
ol.marks { margin: 10px 0 0; padding-inline-start: 1.3em; display: grid; gap: 7px; }
ol.marks li { line-height: 1.6; }
.kind-tag { display: inline-block; font-size: .78rem; font-weight: 700; color: #fff; background: var(--mark-c, #b3261e); border-radius: 4px; padding: 1px 7px; margin-inline-end: 6px; }
.kind-tag[data-kind="delete"]   { --mark-c: #b3261e; }
.kind-tag[data-kind="add"]      { --mark-c: #1f7a3d; }
.kind-tag[data-kind="rephrase"] { --mark-c: #9a6b00; }
.kind-tag[data-kind="fix"]      { --mark-c: #1b5fa8; }
.kind-tag[data-kind="other"]    { --mark-c: #5a4b8a; }
.src-page .lh-body { font-family: var(--font); }

/* مساحة العمل: عمودان متساويان بنفس مقاس الصفحة */
.workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.ws-col { min-width: 0; }
.ws-col > h3 { margin-bottom: 10px; }
@media (max-width: 980px) { .workspace { grid-template-columns: 1fr; } }
.ws-tools { position: sticky; top: 0; z-index: 5; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; background: var(--bg); }
.ws-tools .tools { position: static; border: 1px solid var(--border); border-radius: var(--radius-sm); flex: 1; min-width: 0; }
.audio-card { border: 2px solid var(--gold); }
.check-list { display: grid; gap: 10px; }
.check-list label { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check-list input { width: 20px; height: 20px; margin-top: 4px; flex: none; }

/* نسخ التسجيل الصوتي */
.take { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--field); }
.take.ok { border-color: var(--ok); }
.take audio { margin-top: 6px; }

/* ---------- الأرشيف: سطر لكل مادة ---------- */
ol.archive { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.arch-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); min-height: 52px; }
.arch-row:last-child { border-bottom: 0; }
.arch-row:hover { background: var(--soft); }
.arch-n { font-variant-numeric: tabular-nums; color: var(--accent-text); font-weight: 700; min-width: 2.6em; }
.arch-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arch-name b { margin-inline-end: 8px; }
.arch-meta { white-space: nowrap; }
.arch-badges { display: flex; gap: 4px; white-space: nowrap; }
.arch-actions { display: flex; gap: 2px; flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--accent-text); cursor: pointer; padding: 0; }
.icon-btn:hover { border-color: var(--border); background: var(--surface); }
.icon-btn.off { color: var(--border); cursor: default; }
.icon-btn.off:hover { background: transparent; border-color: transparent; }
.icon-btn .ico { display: grid; }
@media (max-width: 900px) { .arch-row { flex-wrap: wrap; } .arch-name { flex-basis: calc(100% - 4em); white-space: normal; } .arch-meta { display: none; } }

/* ---------- النوافذ والتنبيهات ---------- */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / 35%); }
dialog::backdrop { background: rgb(16 21 27 / 55%); }
dialog .dlg-body { padding: 20px; max-height: 75vh; overflow: auto; }
dialog .dlg-foot { display: flex; gap: 8px; justify-content: flex-start; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--soft); }
#toasts { position: fixed; inset-inline-start: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); border-inline-start: 4px solid var(--gold); animation: pop .2s ease-out; }
.toast.bad { border-inline-start-color: #ff6b61; }
.toast.ok { border-inline-start-color: #5fbf85; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- الموقع العام (تصميم النسخة الأولى) ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding-inline: 28px; }
.hero { padding: 28px 0 8px; }
.hero .eyebrow { color: var(--accent-text); font-weight: 700; font-size: 1rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: .3rem 0; }
.hero p { color: var(--muted); max-width: 720px; margin: 0; }
.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 28px; }
.tabs button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 9px; padding: 11px 18px; font: inherit; cursor: pointer; min-height: 44px; }
.tabs button[aria-selected="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 700; }
.tabs .tab-link { display: inline-flex; align-items: center; border: 1px dashed var(--gold); background: transparent; color: var(--accent-text); border-radius: 9px; padding: 11px 18px; min-height: 44px; text-decoration: none; }
.tabs .tab-link:hover { background: color-mix(in srgb, var(--gold) 16%, transparent); }
.public { padding-bottom: 56px; }
.public .section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.public .section-head h2 { font-size: 1.75rem; margin: 0; }
.public .section-head p { margin: 0; color: var(--muted); }
.public .card { background: linear-gradient(145deg, var(--surface), var(--panel)); border-top: 3px solid var(--gold); border-radius: 14px; padding: 22px; }
:root[data-theme="light"] .public .card { background: var(--surface); }
.public .card h3 { font-size: 1.35rem; margin: 4px 0; }
.video { position: relative; aspect-ratio: 16 / 9; background: #0d141c; border-radius: 10px; overflow: hidden; margin-top: 16px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* زر حفظ ثابت مع أدوات المحرر (ملاحظة ٣٦) */
.ws-save { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; padding-inline-start: 10px; }
.ws-save .btn { white-space: nowrap; }

/* رقائق اللغات في إسناد المادة: المختارة عليها علامة صح (ملاحظة ٢٩) */
.lang-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.lang-pills button { border: 1px solid var(--border); background: var(--soft); color: var(--text); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: .9rem; cursor: pointer; }
.lang-pills button:hover { border-color: var(--gold); color: var(--accent-text); }
.lang-pills button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 700; }
.lang-pills .tick { font-weight: 900; margin-inline-end: 5px; }
.lang-pills.chosen button { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 700; }
.lang-pills.chosen .x { margin-inline-start: 7px; font-weight: 900; opacity: .75; }

/* مشغّل الخطب: لا تحكم من داخل الفيديو، والأزرار أسفله (ملاحظة ٣٢) */
.player { margin-top: 14px; }
.vp-frame { position: relative; aspect-ratio: 16 / 9; background: #0d141c; border-radius: 10px; overflow: hidden; }
.vp-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vp-shield { position: absolute; inset: 0; cursor: pointer; background: transparent; }
.vp-poster { position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; border: 0; padding: 0; }
.vp-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.vp-poster-in { position: relative; text-align: center; padding: 16px; }
.vp-poster-title { font-weight: 700; color: #fff; }
.vp-poster-sub { color: #d8d2c6; font-size: .9rem; margin-top: 4px; }
.vp-poster-play { font-size: 2.4rem; color: var(--gold); margin-top: 8px; }
/* أزرار صغيرة متجاورة بأيقونات فقط (ملاحظتا ٤١ و٤٢) */
.vp-bar { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 10px; }
.vp-btn { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 50%; }
.vp-btn.main { width: 44px; height: 44px; background: var(--gold); border-color: var(--gold); color: var(--ink); }
.vp-btn:hover { border-color: var(--gold); color: var(--accent-text); }
.vp-btn.main:hover { color: var(--ink); filter: brightness(1.05); }
.vp-ico { display: grid; place-items: center; line-height: 0; }
.bi { display: inline-flex; align-items: baseline; gap: 6px; }
.bi .en { color: var(--muted); font-size: .82em; font-weight: 400; }
.vp-rows { margin-top: 8px; display: grid; gap: 6px; }
/* الشريطان بالطول نفسه: الصوت مثل شريط التشغيل تمامًا (ملاحظة ٥٣) */
.vp-row { display: grid; grid-template-columns: 1fr 84px; gap: 8px; align-items: center; }
.vp-volrow .vp-btn { width: 28px; height: 28px; border: 0; background: transparent; justify-self: center; }
.vp-range { width: 100%; accent-color: var(--gold); height: 20px; }
.vp-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .82rem;
  white-space: nowrap; text-align: center;
  /* الزمنُ لاتينيُّ الاتجاه ولو كانت الصفحةُ عربية (ملاحظة ٤٦٤) */
  direction: ltr; unicode-bidi: isolate; }
.vp-slot { margin-top: 10px; }
/* في الأعمدة الضيقة نكتفي بالعربية على الأزرار حتى لا تتكدّس */
.public .card { container-type: inline-size; }
@media (max-width: 560px) { .tabs .bi .en { display: none; } }

/* الأرشيف: صفّ لكل أسبوع — مكة يمينًا والمدينة يسارًا (ملاحظة ٣٣) */
.week { margin-top: 26px; }
.week-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 14px; }
.week-head h3 { margin: 0; font-size: 1.15rem; color: var(--accent-text); }
.empty-slot { display: grid; place-items: center; color: var(--muted); min-height: 160px; text-align: center; }
.section-head.sm h3 { margin: 0; font-size: 1.2rem; }
.section-head.sm p { margin: 0; color: var(--muted); font-size: .92rem; }

/* قائمة اللغات المنسدلة: مكتوبة بالعربية وباللغة نفسها */
label.field.lang-pick { margin-top: 14px; }
select.lang-select { width: 100%; min-height: 46px; font: inherit; font-size: 1rem; }
/* أرشيف الخطب: خطب المسجد الحرام معًا وخطب المسجد النبوي معًا */
.arch-group { margin-top: 30px; }
.arch-group .section-head.sm { margin-bottom: 8px; }
.arch-group .section-head.sm h3 { font-size: 1.25rem; margin: 0; }
.arch-group .section-head.sm p { margin: 0; color: var(--muted); font-size: .92rem; }
.arch-list { margin: 10px 0; }
.arch-list summary { cursor: pointer; padding: 4px 0; }
.translation-text { background: #fff; color: #222b37; border-radius: var(--radius-sm); padding: 16px; line-height: 1.9; }
@media (max-width: 760px) {
  .wrap { padding-inline: 16px; }
  .tabs { display: grid; grid-template-columns: repeat(2, 1fr); }
  .public .section-head { display: block; }
  .public .card { padding: 17px; }
}

/* ---------- صفحة الوجهات «اختر وجهتك» ---------- */
.portals { max-width: 1280px; margin: 0 auto; padding: 40px 28px 70px; }
.portal-title { text-align: center; margin-bottom: 30px; }
.portal-title h1 { font-size: 1.8rem; margin: 6px 0; }
.portal-title p { color: var(--muted); }
.portal-grid { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.portal-card { display: flex; flex-direction: column; gap: 14px; padding: 26px; border: 1px solid var(--border); border-top: 1px solid #b29c65; border-radius: 10px;
  background: linear-gradient(155deg, #ffffff08, transparent), var(--surface); }
.portal-card > .num { color: var(--accent-text); font-size: 1.4rem; line-height: 1.2; font-weight: 700; }
.portal-card h2 { font-size: 1.4rem; margin: 0; }
.portal-card .for { color: var(--muted); font-size: .875rem; }
.portal-card p { flex: 1; margin: 0; }
.portal-card .btn { border-radius: 99px; width: 100%; }
.portals .fine { text-align: center; color: var(--muted); font-size: .875rem; margin-top: 24px; }
@media (max-width: 900px) { .portal-grid { grid-template-columns: 1fr; } .portals { padding: 28px 16px; } }

/* ---------- شريط مساحة العمل ---------- */
.workspace-banner { background: var(--panel) url('/assets/pattern.png') center; border: 1px solid #b29c6550; color: #fff; border-radius: 10px; padding: 18px 22px; margin-bottom: 18px; }
.workspace-banner :is(h1, h2) { color: #fff; margin: 0; }
.workspace-banner .eyebrow { color: #d5bd87; }
.workspace-banner .btn { color: #fff; border-color: #b29c6566; background: #ffffff0c; }
.workspace-banner .sub, .workspace-banner .muted { color: #d1c8b5; }

/* ---------- المصادقة ---------- */
.auth-wrap { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(540px, 100%); border-top: 3px solid var(--gold-2); padding: 28px; }
.auth-card.wide { width: min(720px, 100%); }

/* ---------- الطباعة (حفظ PDF) ---------- */
@media print {
  .topbar, .sidenav, footer.site, .no-print, #toasts, .env-flag { display: none !important; }
  body { background: #fff; color: #000; }
  .layout { display: block; padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .print-doc { font-size: 13pt; line-height: 1.9; }
}

/* سياسة السرية وتقييم الأعضاء (ملاحظة ٥٧) */
.check.top { align-items: flex-start; font-weight: 400; }
.check.top input { margin-top: 4px; flex: none; }
.policy-text { max-height: 46vh; overflow: auto; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft, transparent); }
.policy-text section { margin-top: 14px; }
.policy-text h3 { margin: 0 0 6px; font-size: 1rem; }
.policy-text ul { margin: 0; padding-inline-start: 20px; }
.policy-text li { margin: 4px 0; line-height: 1.8; }
.stars { display: inline-flex; gap: 2px; direction: ltr; }
.stars b { font-weight: 400; color: var(--gold, #c7a24a); }
.stars b.off { opacity: .28; }
.perf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.perf-grid > div { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.perf-grid .v { font-size: 1.15rem; font-weight: 600; }
.arch-group + .arch-group { margin-top: 22px; }
.arch-group-head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.arch-group-head h3 { margin: 0; font-size: 1.02rem; }

/* شارة عدد اللغات في خطبة عرفة (ملاحظة ٦١) */
.lang-count { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--gold); color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent);
  font-size: .82rem; line-height: 1; white-space: nowrap; }
.lang-count b { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.lang-count .en { opacity: .75; font-size: .72rem; }
.lang-count.big { padding: 8px 16px; font-size: .95rem; }
.lang-count.big b { font-size: 1.6rem; }
.lang-globe { display: inline-flex; }
.live-block + .live-block { margin-top: 26px; }
.icon-btn.danger { color: var(--bad, #c0564f); }
.arch-row.is-trashed { opacity: .72; }

/* زر سياسة السرية الدائم (ملاحظة ٧٦) */
.policy-chip { display: inline-flex; align-items: center; gap: 6px; }
.policy-chip .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.policy-chip.signed { border-color: #3f9e6b; color: #7fd6a4; }
.policy-chip.signed .dot { background: #3f9e6b; }
.policy-chip.unsigned { border-color: #c0564f; color: #ff9a94; }
.policy-chip.unsigned .dot { background: #d2493f; animation: policy-pulse 1.8s ease-in-out infinite; }
@keyframes policy-pulse { 50% { opacity: .35; } }
:root[data-theme="light"] .policy-chip.signed { color: #1f6b45; }
:root[data-theme="light"] .policy-chip.unsigned { color: #a3322b; }
.policy-state { padding: 8px 12px; border-radius: 10px; font-weight: 600; }
.policy-state.signed { background: var(--ok-bg); color: var(--ok); }
.policy-state.unsigned { background: var(--bad-bg); color: var(--bad); }

/* شريط التحرير: أكبر قليلًا، في صفّين، والحفظ في آخره (ملاحظتا ٦٧ و٦٨) */
.ws-tools .tools { max-height: none; row-gap: 6px; padding: 8px; }
.ws-tools .tools button, .ws-tools .tools select { min-height: 38px; font-size: .95rem; padding: 4px 10px; }
.ws-tools .tools .color input { width: 40px; min-height: 38px; }
.tb-save { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; padding-inline-start: 10px; }
.tb-save .btn { white-space: nowrap; min-height: 38px; }

/* ساعة العد التنازلي (ملاحظة ٦٧) */
.digital-clock { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 14px;
  border-radius: 10px; background: var(--soft); border: 1px solid #2f6b4a; min-width: 178px; margin-inline-start: 6px; }
.digital-clock .dc-time { font-family: "DS-Digital", "Courier New", ui-monospace, monospace; font-size: 2rem;
  font-weight: 700; line-height: 1; letter-spacing: 1px; color: #2ecc71; font-variant-numeric: tabular-nums; direction: ltr; }
.digital-clock .dc-note { font-size: .7rem; color: var(--muted); }
.digital-clock.soon { border-color: #8a6a24; background: var(--soft); }
.digital-clock.soon .dc-time { color: #d79a1f; } .digital-clock.soon .dc-note { color: var(--muted); }
.digital-clock.late { border-color: #a3322b; background: var(--soft); }
.digital-clock.late .dc-time { color: #e0453a; } .digital-clock.late .dc-note { color: var(--bad); }
.digital-clock.done, .digital-clock.off { background: var(--soft); border-color: var(--border); }
.digital-clock.done .dc-time, .digital-clock.off .dc-time { color: var(--muted); font-size: 1.4rem; }
.digital-clock.done .dc-note, .digital-clock.off .dc-note { color: var(--muted); }
@media (max-width: 640px) { .digital-clock { min-width: 140px; } .digital-clock .dc-time { font-size: 1.6rem; } }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow: auto;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.pick-list .check { font-weight: 400; }
/* قائمة صلاحيات الحساب الإداري (ملاحظة ١٧٢) */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 4px 14px; }
.perm-grid .check { font-weight: 400; min-height: 28px; }
@media (max-width: 560px) { .perm-grid { grid-template-columns: 1fr; } }

/* المراسلات (ملاحظة ٨١) */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
  padding: 0 6px; margin-inline-start: 8px; border-radius: 999px; background: #d2493f; color: #fff;
  font-size: .72rem; font-weight: 700; }
.circular-row.pending { border-color: var(--gold); }
.circular-body p { line-height: 1.9; margin: 0 0 10px; }
/* مرفق التعميم: عرض داخل المنصة بلا تنزيل ولا طباعة (ملاحظة ٨٩) */
/* نافذة التعميم أوسع ليُقرأ المرفق */
dialog:has(.circular-doc) { width: min(920px, calc(100vw - 20px)); }
dialog:has(.circular-doc) .dlg-body { max-height: 82vh; }
.circular-doc { margin-top: 10px; }
.circular-doc .pdf-viewer { user-select: none; -webkit-user-select: none; }
.gate-note { margin-bottom: 14px; }
@media print { .circular-doc, dialog { display: none !important; } }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); }

/* الساعة على خلفية المنصة لا على أسود (ملاحظة ٨٢) */
:root:not([data-theme="light"]) .digital-clock .dc-time { color: #35e07f; }
:root:not([data-theme="light"]) .digital-clock.soon .dc-time { color: #ffc34d; }
:root:not([data-theme="light"]) .digital-clock.late .dc-time { color: #ff5b50; }

/* الحساب البنكي (ملاحظة ٨٤) */
.notice { background: var(--panel-2, rgba(127, 127, 127, .08)); border: 1px solid var(--border);
  border-inline-start: 4px solid var(--gold); border-radius: 10px; padding: 12px 14px; line-height: 1.9; }
.notice ul { margin: 8px 0 0; padding-inline-start: 20px; }
.notice li { margin-bottom: 4px; }
.notice table { font-size: .86rem; }
#intl-fields input[dir="ltr"], .field input[dir="ltr"] { letter-spacing: .04em; }

/* بياناتي وبطاقات العمل (ملاحظة ٨٥) */
.me-top { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .me-top { grid-template-columns: 1fr; } }
.photo-box { display: flex; align-items: center; justify-content: center; width: 160px; height: 240px;
  border: 1px solid var(--border); border-radius: 10px; background: rgba(127,127,127,.06); overflow: hidden; }
.photo-box.sm { width: 104px; height: 156px; }
.photo-4x6 { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted);
  font-size: .82rem; text-align: center; padding: 8px; }
.photo-empty b { font-size: 1.1rem; letter-spacing: .06em; }
.photo-pick { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.photo-rules { margin-top: 4px; font-size: .84rem; color: var(--muted); }
.photo-rules ul, ul.tight { margin: 6px 0 0; padding-inline-start: 18px; line-height: 1.8; }
.data-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0; }
@media (max-width: 640px) { .data-list { grid-template-columns: 1fr; } }
.data-list dt { font-size: .8rem; color: var(--muted); margin: 0; }
.data-list dd { margin: 2px 0 0; font-weight: 600; }
.row.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* مصمِّم بطاقة العمل (ملاحظة ٨٦) — مربّعٌ واحدٌ بلا فراغٍ بين أقسامه،
   والفواصلُ خطوطٌ رفيعةٌ لا مسافات (ملاحظة ٢٨٣) */
.cd-board h3 { margin-top: 0; }
/* البطاقةُ أعلى، فشريطُ القوائم، فإطارُ الإعدادات — بعرضٍ واحد (٤٠٠ و٤٠١) */
.cd-board { padding: 14px; }
.cd-actions { justify-content: center; margin-top: 12px; }
.card-stage-wrap { display: flex; justify-content: center; padding: 14px 0; overflow: auto;
  background: repeating-conic-gradient(rgba(127,127,127,.10) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
  border-radius: 10px; }
.card-stage { position: relative; overflow: hidden; border: 1px solid #d8cfbd; border-radius: 10px;
  flex: none;   /* البطاقةُ بمقاسها لا تُضغَط، واللوحةُ تَجري بها (ملاحظة ٣٩٥) */
  box-shadow: 0 4px 18px rgba(0,0,0,.28); direction: ltr; }
.card-stage:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.cd-item { position: absolute; direction: rtl; }
.cd-item.editable { cursor: grab; touch-action: none; }
.cd-item.editable:hover { outline: 1px dashed rgba(188,150,97,.75); }
.cd-item.sel { outline: 2px solid var(--gold); outline-offset: 1px; }
.cd-photo, .cd-item.cd-photo { border: 1px solid #ded5c5; border-radius: 3px; background: #f6f3ee;
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cd-item.cd-photo img, .cd-photo-img { width: 100%; height: 100%; object-fit: cover; }
.cd-photo-ph { font-size: .6rem; color: #a79c8c; }
/* خلفيةٌ تملأ البطاقة، وأشكالٌ، وعلامةٌ مائية (ملاحظة ٣٩٥) */
.cd-bg { position: absolute; inset: 0; pointer-events: none; }
.cd-item.cd-shape { direction: ltr; }
.cd-wm { position: absolute; direction: rtl; pointer-events: none; }
.cd-layer { align-items: center; }
.cd-layer .btn.grow { flex: 1 1 auto; text-align: start; justify-content: flex-start; }
.cd-panel { display: flex; flex-direction: column; gap: 12px; }
.cd-panel input[type="range"] { width: 100%; }
.row.tight { display: flex; align-items: center; gap: 6px; }
.row.tight input[type="range"] { flex: 1; }
.color-row { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; }
.swatch.on { outline: 2px solid var(--gold); outline-offset: 2px; }
.card-stage.view { cursor: default; }
.card-show { display: flex; flex-direction: column; align-items: center; gap: 10px; }
/* نافذة إبراز البطاقة أوسع من النوافذ المعتادة */
dialog:has(.card-show) { width: min(760px, calc(100vw - 24px)); }
.card-show .cd-item { pointer-events: none; }

/* صفحة التعريف بالمنصة /about (ملاحظة ٨٨) */
.ab-hero { text-align: center; }
.ab-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 22px; }
.ab-stat { min-width: 132px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.ab-stat b { font-size: 1.5rem; color: var(--accent-text); line-height: 1.1; }
.ab-stat span { font-size: .78rem; color: var(--muted); }
.ab-body { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 34px; }
@media (max-width: 900px) { .ab-body { grid-template-columns: 1fr; gap: 18px; } }
.ab-toc { position: sticky; top: 84px; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  background: var(--surface); }
@media (max-width: 900px) { .ab-toc { position: static; } }
.ab-toc b { display: block; margin-bottom: 8px; font-size: .84rem; color: var(--muted); }
.ab-toc ol { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; }
.ab-toc a { color: var(--text); text-decoration: none; font-size: .9rem; }
.ab-toc a:hover { color: var(--accent-text); text-decoration: underline; }
.ab-main { display: flex; flex-direction: column; gap: 26px; }
.ab-sec { scroll-margin-top: 80px; }
.ab-sec h2 { margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--gold); display: inline-block; }
.ab-sec p { line-height: 2; margin: 0 0 10px; }
.ab-list { margin: 0 0 10px; padding-inline-start: 22px; line-height: 2; }
.ab-list li { margin-bottom: 4px; }
.ab-stages { list-style: none; margin: 4px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ab-stages li { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.ab-step { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #1a232d;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.ab-stages b { display: block; }
.ab-who { font-size: .76rem; color: var(--accent-text); }
.ab-stages p { margin: 4px 0 0; line-height: 1.8; font-size: .92rem; color: var(--muted); }
.ab-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 10px; }
.ab-role { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface); }
.ab-role h3 { margin: 0 0 8px; color: var(--accent-text); font-size: 1rem; }
.ab-foot-note { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .84rem; }
@media print {
  .topbar, .ab-toc, .site-footer, footer { display: none !important; }
  .about { max-width: none; }
  .ab-body { grid-template-columns: 1fr; }
  .ab-sec { break-inside: avoid; }
  .ab-stat, .ab-role, .ab-stages li { break-inside: avoid; }
}
.ab-vm { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 6px 0 16px; }
.ab-vm-card { border: 1px solid var(--border); border-inline-start: 4px solid var(--gold); border-radius: 12px;
  padding: 16px 18px; background: var(--surface); }
.ab-vm-card p { margin: 6px 0 0; line-height: 2; font-size: 1.02rem; }
.ab-h3 { margin: 16px 0 6px; color: var(--accent-text); font-size: 1rem; }
.ab-badge { display: inline-block; margin: 0 auto 14px; padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--gold); color: var(--accent-text); background: rgba(188, 150, 97, .10);
  font-size: .82rem; font-weight: 600; }

/* دليل الإنتاج والعدّاد (ملاحظة ٩٠) */
.counter-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); gap: 14px;
  margin-bottom: 16px; }
@media (max-width: 860px) { .counter-grid { grid-template-columns: 1fr; } }
.counter-main { border: 1px solid var(--gold); border-radius: 14px; padding: 16px 18px; background: var(--surface);
  display: flex; flex-direction: column; gap: 2px; align-items: center; text-align: center; }
.counter-label { font-size: .84rem; color: var(--muted); }
.counter-num { font-size: 3rem; line-height: 1.1; color: var(--accent-text); letter-spacing: .02em;
  font-variant-numeric: tabular-nums; }
.counter-sub { font-size: .82rem; color: var(--muted); }
.counter-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.counter-cell { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; gap: 2px; }
.counter-cell b { font-size: 3rem; line-height: 1.1; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.counter-cell span { font-size: .76rem; color: var(--muted); }
/* عدّادات كل قسمٍ بوحدته، لا عدّادٌ واحد في الأعلى (ملاحظة ١٦٩) */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr)); gap: 8px; }
.stat-tile { border: 1px solid var(--border); border-radius: 12px; padding: 12px 8px; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; }
.stat-tile:first-child { border-color: var(--gold); background: rgba(188, 150, 97, .08); }
.stat-num { font-size: 1.7rem; line-height: 1.15; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.stat-tile:first-child .stat-num { font-size: 2.1rem; }
.stat-label { font-size: .76rem; color: var(--muted); }
.stat-note { font-size: .7rem; color: var(--muted); opacity: .8; }
@media (max-width: 520px) { .stat-tiles { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); } }

.prod-table tfoot .total-row td { font-weight: 700; background: rgba(188, 150, 97, .10); border-top: 2px solid var(--gold); }
.grand-total { border-color: var(--gold); font-size: 1.02rem; }
.prod-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--gold); background: rgba(188, 150, 97, .10); color: var(--text); text-decoration: none;
  font-size: .84rem; white-space: nowrap; }
.prod-chip b { color: var(--accent-text); font-size: 1rem; font-variant-numeric: tabular-nums; }
.prod-chip .sep { color: var(--muted); }

/* القائمة الجانبية مجموعاتٌ تُطوى وتُفتح (ملاحظتا ٩٢ و٢٦٨) */
.nav-group { display: block; }
.nav-group + .nav-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
/* اسمُ القسم بلونٍ مغايرٍ يميّزه عن روابطه (ملاحظة ٢٩٣) */
.nav-head { display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 7px 14px; font-size: .78rem; letter-spacing: .03em; color: var(--gold);
  font-weight: 600; border-radius: 10px; list-style: none; user-select: none; }
.nav-head::-webkit-details-marker { display: none; }
.nav-head::after { content: '‹'; margin-inline-start: auto; font-size: 1rem; line-height: 1;
  transition: transform .15s ease; color: var(--muted); }
.nav-group[open] > .nav-head::after { transform: rotate(-90deg); }
.nav-head:hover { background: var(--hover, rgba(255, 255, 255, .04)); }
.nav-group[open] > .nav-head { color: var(--gold); }
.nav-head::after { color: var(--gold); }
/* الوحدةُ الداخلية عنوانٌ باهتٌ لا مفتاحُ طيٍّ ثانٍ — فطبقتان تكفيان */
.nav-unit { display: block; padding: 8px 14px 3px; font-size: .68rem; color: var(--gold);
  opacity: .72; letter-spacing: .03em; }
@media (max-width: 900px) {
  .nav-group + .nav-group { margin-top: 4px; }
  .nav-head { padding: 9px 12px; }
}

/* رسوم صفحة التعريف (ملاحظة ٩٣) */
.fig { margin: 16px 0 18px; }
.fig-cap { margin: 8px 0 0; font-size: .8rem; color: var(--muted); text-align: center; }
.fig-flow { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.fig-node { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 14px 12px;
  background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.fig-node b { font-size: .92rem; }
.fig-node span:not(.fig-num) { font-size: .76rem; color: var(--muted); }
.fig-num { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #1a232d;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; }
.fig-node::after { content: '←'; position: absolute; inset-inline-start: -13px; top: 50%; transform: translateY(-50%);
  color: var(--gold); font-size: 1rem; }
.fig-node:last-child::after { content: none; }
@media (max-width: 720px) { .fig-node::after { content: none; } }

.fig-layers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .fig-layers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .fig-layers { grid-template-columns: 1fr; } }
.fig-layer { border: 1px solid var(--border); border-top: 3px solid var(--gold);
  border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.fig-layer b { display: block; font-size: .92rem; }
.fig-layer span { font-size: .78rem; color: var(--muted); }

.fig-svg { width: 100%; height: auto; display: block; }
.fig-svg text { font-family: var(--font); fill: var(--text); }
.fig-svg .fig-t { font-size: 15px; font-weight: 700; }
.fig-svg .fig-s { font-size: 12px; fill: var(--muted); }
.fig-svg .fig-b { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.fig-svg .fig-core { stroke: var(--gold); stroke-width: 2; }
.fig-svg .fig-country { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 7 6; }
.fig-svg .fig-country-label { font-size: 13px; fill: var(--accent-text); }
.fig-svg .fig-arrow { stroke: var(--gold); stroke-width: 2; fill: none; stroke-dasharray: 5 5; }

.fig-langs { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center; }
.fig-ring { width: 128px; height: 128px; border-radius: 50%; border: 6px solid var(--gold);
  display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface); }
.fig-ring b { font-size: 2.1rem; color: var(--accent-text); line-height: 1; }
.fig-ring span { font-size: .76rem; color: var(--muted); }
.fig-langs-body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 260px; }
.fig-chip { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; background: var(--surface);
  display: flex; gap: 10px; align-items: baseline; }
.fig-chip b { color: var(--accent-text); font-size: 1.1rem; min-width: 58px; }
.fig-chip span { font-size: .84rem; color: var(--muted); }
.fig-chip.ar b { font-size: .95rem; }

.ab-callout { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--gold);
  background: rgba(188, 150, 97, .10); border-radius: 12px; padding: 14px 16px; margin: 14px 0; }
.ab-callout p { margin: 0; line-height: 1.9; }
.ab-callout-mark { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--gold);
  color: #1a232d; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.ab-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.ab-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface); }
.ab-card h3 { margin: 0 0 8px; font-size: 1rem; color: var(--accent-text); }
.ab-card p { margin: 0; font-size: .9rem; line-height: 1.9; }
.ab-goals { list-style: none; margin: 4px 0 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.ab-goals li { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; background: var(--surface); }
.ab-goals b { display: block; margin-bottom: 4px; }
.ab-goals p { margin: 0; font-size: .88rem; line-height: 1.85; color: var(--muted); }
.ab-goal-num { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; background: var(--gold);
  color: #1a232d; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.ab-role p { margin: 0 0 8px; font-size: .9rem; line-height: 1.9; }
.ab-role p:last-child { margin-bottom: 0; }
@media print {
  .fig-node, .fig-layer, .ab-card, .ab-goals li, .ab-callout { break-inside: avoid; }
  .fig-svg { max-height: 220px; }
}

/* صفحة المبادرة: خط أكبر قليلًا لعرضها على الشاشات الكبيرة (ملاحظة ٩٤) */
.about.wide-type .ab-sec p, .about.wide-type .ab-list li { font-size: 1.06rem; line-height: 2.05; }
.about.wide-type .ab-sec h2 { font-size: 1.5rem; }
.about.wide-type .ab-h3 { font-size: 1.1rem; }
.about.wide-type .ab-card p, .about.wide-type .ab-goals p, .about.wide-type .ab-role p { font-size: .98rem; }
.about.wide-type .ab-vm-card p { font-size: 1.1rem; }
.about.wide-type .ab-stages p { font-size: 1rem; }
.about.wide-type .fig-layer b { font-size: 1rem; }
.about.wide-type .fig-layer span { font-size: .86rem; }
.about.wide-type .ab-toc a { font-size: .95rem; }
.ab-body.solo { grid-template-columns: 1fr; max-width: 940px; margin-inline: auto; }
.ab-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ab-chips li { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 14px; background: var(--surface); font-weight: 600; font-size: .92rem; }
.ab-chip-num { width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: #1a232d;
  display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; }
.cd-panel .field { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
.field-head { color: var(--muted); font-size: .84rem; }

/* تنبيه خمول الجلسة (ملاحظة ٩٧) */
dialog.idle-dlg { width: min(460px, calc(100vw - 32px)); }
dialog.idle-dlg h3 { margin: 0 0 8px; }
dialog.idle-dlg p { margin: 0 0 14px; line-height: 1.9; }
dialog.idle-dlg b { color: var(--accent-text); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------
   شؤون الفريق: تبويبات الشاشة الموحّدة وبطاقات تدقيق المستندات (ملاحظة ٩٨)
------------------------------------------------------------------- */
.tabs .tab .nav-badge { margin-inline-start: 8px; }
.staff-panel { margin-top: 4px; }
.doc-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.doc-card { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; background: var(--surface); }
.doc-card .doc-view { flex: 0 0 auto; }
.doc-card .doc-view img.photo-4x6 { width: 72px; height: 108px; object-fit: cover; border-radius: 6px; }
.doc-card .doc-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.doc-card .doc-body .row { margin-top: 4px; }
@media (max-width: 560px) { .doc-card { flex-direction: column; align-items: stretch; } }

/* ------------------------------------------------------------------
   الأصل المكتوب نصًّا يُعرض على الكليشة صفحةً صفحة كملف PDF (ملاحظة ١٠٢)
------------------------------------------------------------------- */
.text-viewer .tv-page { background: #fff; }
.text-viewer .tv-body { overflow: hidden; }
.text-viewer .tv-flow { will-change: transform; }
.text-viewer .tv-flow .src { font-family: var(--font); }
.text-viewer .tv-wm { position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 6% 8%;
  transform: rotate(-24deg); }
.text-viewer .tv-wm span { color: #b3261e; opacity: .12; font-weight: 600; white-space: nowrap;
  font-size: calc(100cqw / 30); }

/* ------------------------------------------------------------------
   التحقق بخطوتين: رمز التسجيل وخطواته (ملاحظة ١٠٣)
------------------------------------------------------------------- */
.mfa-steps { margin: 0; padding-inline-start: 1.2em; line-height: 1.9; }
.mfa-qr { display: flex; justify-content: center; padding: 14px; background: #fff; border-radius: 12px; }
.mfa-qr svg, .mfa-qr img { width: 210px; height: 210px; display: block; }
.mfa-secret code { display: inline-block; margin-top: 4px; padding: 6px 10px; border-radius: 8px;
  background: var(--surface-2, rgb(255 255 255 / 6%)); letter-spacing: 2px; word-break: break-all; }
.mfa-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* رابط خارجي في القائمة الجانبية: موقع البث العام (ملاحظة ١٠٤) */
.sidenav .nav-out { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidenav .nav-out .ext { opacity: .55; font-size: .85em; }
.sidenav .nav-out:hover .ext { opacity: 1; }

/* ------------------------------------------------------------------
   الجوال: القائمة تُطوى خلف زر وتُعرض مرتّبة بمجموعاتها (ملاحظة ١٠٦)
------------------------------------------------------------------- */
.nav-toggle { display: none; }
.nav-toggle .bars { margin-inline-end: 6px; font-size: 1.05em; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; order: -1; }
  .sidenav { display: none; }
  .sidenav.open { display: block; padding: 12px; border-bottom: 1px solid var(--border); }
  .sidenav.open .nav-group { display: block; }
  .sidenav.open .nav-head { display: flex; padding: 10px 6px; font-weight: 600; }
  .sidenav.open .nav-group + .nav-group { margin-top: 6px; padding-top: 6px;
    border-top: 1px solid var(--border); border-inline-start: 0; padding-inline-start: 0; margin-inline-start: 0; }
  .sidenav.open a { text-align: start; border-inline-start-width: 3px; min-height: 44px; display: flex; align-items: center; }
  .sidenav.open .nav-out { justify-content: space-between; }
}


/* ------------------------------------------------------------------
   لوحة المتابعة التفاعلية: مؤشرات تُضغط، ومن عنده العمل الآن (ملاحظة ١٠٧)
------------------------------------------------------------------- */
button.kpi { font: inherit; text-align: start; cursor: pointer; }
button.kpi:hover { border-color: var(--gold); transform: translateY(-1px); }
.kpi { position: relative; transition: transform .12s ease, border-color .12s ease; }
.kpi.on { border-color: var(--gold); background: #bc966114; }
.kpi .kpi-icon { position: absolute; inset-inline-end: 12px; top: 10px; font-style: normal;
  font-size: 1.1rem; opacity: .35; }
.kpi.on .kpi-icon { opacity: .8; }

.stage-row { display: block; width: 100%; text-align: start; font: inherit; color: inherit;
  background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.stage-row:hover { background: var(--soft); }
.stage-row.on { border-color: var(--gold); background: #bc966114; }

.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.who-card { text-align: start; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.who-card:hover { border-color: var(--gold); }
.who-card .who-n { background: var(--gold); color: var(--ink); border-radius: 999px;
  min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

.work-head { margin-top: 18px; }
tr.u-late > td:first-child { box-shadow: inset 3px 0 0 var(--bad, #b3261e); }
tr.u-soon > td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
tr.u-done > td:first-child { box-shadow: inset 3px 0 0 #2f6b52; }

/* ------------------------------------------------------------------
   التوقيع اليدوي: لوح الرسم وصورة التوقيع (ملاحظة ١١٠)
------------------------------------------------------------------- */
.sig-pad { position: relative; background: #fff; border: 1px dashed var(--border); border-radius: 10px; padding: 6px; }
.sig-canvas { display: block; touch-action: none; cursor: crosshair; }
.sig-pad .sig-line { position: absolute; inset-inline: 24px; bottom: 26px; border-bottom: 1px solid #d8cfbd; pointer-events: none; }
.sig-img { display: block; max-width: 260px; max-height: 90px; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 4px; object-fit: contain; }
.sig-cell .sig-img { max-width: 150px; max-height: 52px; margin-top: 4px; }

/* ------------------------------------------------------------------
   مساحة المترجم على الجوال: تبويبان بدل عمودين، وأزرار أكبر (ملاحظة ١١١)
------------------------------------------------------------------- */
.ws-tabs { display: none; }
@media (max-width: 980px) {
  .ws-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
  .ws-tabs .tab { min-height: 46px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
  .ws-tabs .tab.on { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 700; }
  .workspace[data-pane="src"] .ws-col[data-pane="tr"] { display: none; }
  .workspace[data-pane="tr"] .ws-col[data-pane="src"] { display: none; }
  .workspace .ws-col > h3 { font-size: 1rem; }
  /* أدوات التحرير تخصّ الترجمة، فتختفي في تبويب الأصل */
  .ws-wrap[data-pane="src"] > .ws-tools { display: none; }
  .ws-tools { padding-bottom: 6px; }
  .ws-tools .tools button, .ws-tools .tools select { min-height: 42px; }
}

/* ------------------------------------------------------------------
   اللغات: شبكة بطاقات مضغوطة بدل الجدول الطويل (ملاحظة ١١٣)
------------------------------------------------------------------- */
.lang-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1200px) { .lang-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .lang-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px)  { .lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lang-card { display: flex; flex-direction: column; gap: 4px; text-align: start; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; min-height: 92px; }
button.lang-card { cursor: pointer; }
button.lang-card:hover { border-color: var(--gold); }
.lang-card.off { opacity: .62; }
.lang-card.core { border-color: #bc966155; background: #bc96610d; }
.lang-card .lang-code { font-size: .72rem; color: var(--muted); letter-spacing: .06em; }
.lang-card .lang-native { font-size: .86rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* مشرفُ اللغة في بطاقتها (ملاحظة ٤٤٠) */
.lang-card .lang-sup { display: block; font-size: .76rem; line-height: 1.5;
  border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 4px; }

/* بطاقات العمل: تفاصيل الشكل تُطوى فلا تطول الشاشة (ملاحظة ١١٥) */
.cd-more { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.cd-more + .cd-more { margin-top: 8px; }
.cd-more > summary { cursor: pointer; font-weight: 600; }
.cd-more[open] > summary { margin-bottom: 10px; }

/* ------------------------------------------------------------------
   الرواتب والمستحقات (ملاحظة ١١٦)
------------------------------------------------------------------- */
.pay-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 620px) { .pay-sum { grid-template-columns: 1fr; } }
.pay-cell { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 2px; }
.pay-cell > span { font-size: .8rem; color: var(--muted); }
.pay-cell > b { font-size: 1.24rem; }
.pay-cell.warn { border-color: var(--warn); background: var(--warn-bg); }
.pay-sum + p.bad { margin-top: 0; }
table.responsive input[type="number"] { width: 100%; min-width: 88px; }

/* ------------------------------------------------------------------
   الحضور والانصراف: الجدول الأسبوعي والبصمة (ملاحظة ١١٧)
------------------------------------------------------------------- */
.btn.xs { min-height: 30px; padding: 2px 10px; font-size: .8rem; border-radius: 8px; }
.week-grid { width: 100%; border-collapse: separate; border-spacing: 6px; min-width: 860px; }
.week-grid th { font-weight: 600; font-size: .82rem; text-align: center; padding: 4px; }
.week-grid th.who { text-align: start; width: 170px; font-size: .92rem; }
.week-grid td.day { vertical-align: top; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; min-width: 104px; }
.week-grid td.day > * { display: block; width: 100%; }
.week-grid td.day > * + * { margin-top: 5px; }
.shift-chip { display: flex; flex-direction: column; gap: 2px; align-items: stretch; text-align: start; cursor: pointer; }
.shift-chip .small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shift-chip.st-present { border-color: var(--ok); }
.shift-chip.st-absent { border-color: var(--bad); }
.shift-chip.st-leave { border-color: var(--warn); }
.btn.xs.add { border-style: dashed; color: var(--muted); }
.shift-now { display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  border: 1px solid var(--gold); border-radius: 12px; padding: 12px 14px; }
.shift-now + .shift-now { margin-top: 10px; }
.next-shifts { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.next-shifts li { font-size: .9rem; border-inline-start: 3px solid var(--border); padding-inline-start: 10px; }

/* ------------------------------------------------------------------
   المراسلات: بطاقة الرسالة بحالها وتاريخها وسجل تواقيعها (ملاحظة ١١٩)
------------------------------------------------------------------- */
.circ-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 2px 0 6px; }
.circ-meta > span { white-space: nowrap; }
.circ-sign { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 2px; }
.circ-sign .progress { flex: 1; min-width: 140px; }
.circ-sign .badge { margin-inline-start: 6px; }
.circular-row.archived { opacity: .72; border-style: dashed; }
.circular-row .grow { flex: 1; }
.doc-card.waiting { border-color: var(--warn); }

/* خطأ ظاهر داخل نافذة الإرسال (ملاحظة ١١٩) */
.err-box { border: 1px solid var(--bad); background: var(--bad-bg); color: var(--bad);
  border-radius: 10px; padding: 10px 12px; }
.err-box > b { display: block; margin-bottom: 4px; }
.err-box p { margin: 2px 0; }
.err-box .muted { color: inherit; opacity: .8; }

/* كشف إنجاز الفريق: صفوف الأعضاء وأعمدة الأعمال (ملاحظة ١٢٦) */
table.matrix th, table.matrix td { text-align: center; }
table.matrix tbody td:first-child, table.matrix thead th:first-child { text-align: start; }

/* لوحة المتابعة: مراحل العمل أيقونات تُضغط، وأيقونتا الإنتاج معزولتان (ملاحظتا ١٢٨ و١٢٩) */
.stage-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 6px 0 0; }
button.stage-tile { cursor: pointer; text-align: start; }
button.stage-tile:hover { border-color: var(--gold); }
button.stage-tile.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.prod-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px;
  margin: 18px auto; padding-top: 14px; border-top: 1px dashed var(--border); }
@media (max-width: 620px) { .prod-kpis { grid-template-columns: 1fr; } }
a.prod-kpi { text-decoration: none; color: inherit; }
a.prod-kpi:hover { border-color: var(--gold); }
.small.warn { color: var(--warn); }

/* النوافذ: سبب المنع يُقرأ داخل النافذة، والحقل الإلزامي معلَّم (ملاحظة ١٣١) */
.dlg-err { margin: 0 0 12px; border: 1px solid var(--bad); background: var(--bad-bg); color: var(--bad);
  border-radius: 10px; padding: 10px 12px; font-size: .95rem; }
.dlg-toasts { position: sticky; bottom: 0; display: grid; gap: 8px; padding: 0 20px 12px; }
.req { color: var(--bad); font-weight: 700; }
.bad-field { border-color: var(--bad) !important; box-shadow: 0 0 0 1px var(--bad) inset; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* علامات وهمية في المحرر: حدّ الهوامش وحدود الصفحات — تُرى ولا تُطبع (ملاحظة ١٣٣) */
.lh-margins { position: absolute; top: calc(38 / 297 * 100%); bottom: calc(32 / 297 * 100%);
  inset-inline: calc(20 / 210 * 100%); pointer-events: none; z-index: 3;
  border: 1px dashed rgb(188 150 97 / 55%); }
.lh-margins::before, .lh-margins::after { content: ''; position: absolute; inset-inline: -8px; height: 0;
  border-top: 1px solid rgb(188 150 97 / 35%); }
.lh-margins::before { top: 0; } .lh-margins::after { bottom: 0; }
/* ارتفاعها ارتفاع الصفحة الواحدة، فتُحسب مواضع الفواصل منه: كل 100% صفحة */
.lh-guides { position: absolute; inset-inline: 0; top: 0; height: 100%; pointer-events: none; z-index: 2; }
.lh-brk { position: absolute; inset-inline: 0; height: 0; border-top: 1px dashed rgb(193 61 61 / 60%); }
.lh-brk-t { position: absolute; inset-inline-start: 0; transform: translateY(-100%);
  font-size: calc(var(--pt) * 7); color: #c13d3d; background: rgb(255 255 255 / 85%);
  padding: 0 4px; border-radius: 3px; white-space: nowrap; }
.lh-brk-t.next { inset-inline-start: auto; inset-inline-end: 0; transform: none; color: #2f6f4f; }
.editor.no-guides .lh-guides, .editor.no-guides .lh-margins,
.editor.no-guides .lh-num { display: none; }
.tools button.on { border-color: var(--gold); color: var(--gold); }
@media print { .lh-guides, .lh-margins, .lh-num { display: none !important; } }

/* الأرشيف: بطاقات الأنواع، ومسار التصفّح، ورقم التوثيق في السطر (ملاحظتا ١٣٧ و١٣٨) */
.arch-filters { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; }
.arch-tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
button.arch-tile { cursor: pointer; text-align: start; position: relative; }
button.arch-tile:hover { border-color: var(--gold); }
.arch-tile > span { display: block; }
.arch-tile .arch-tile-emoji { position: absolute; inset-inline-end: 12px; top: 10px;
  font-size: 1.25rem; line-height: 1; opacity: .5; }
.arch-tile .small.muted { font-weight: 400; margin-top: 3px; }
.arch-crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.arch-exports { align-items: center; gap: 8px; margin: 6px 0 10px; }
.arch-exports .muted { margin-inline-end: auto; }
.doc-no { display: inline-block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem;
  letter-spacing: .5px; color: var(--gold); border: 1px solid var(--border); border-radius: 6px;
  padding: 0 6px; margin-top: 2px; }

/* خدمات المبادرة: بطاقة لكل خدمة برمزها، وتشريح رقم التوثيق (ملاحظتا ١٣٤ و١٣٦) */
.ab-qr { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin: 18px 0; }
.ab-qr-card { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  color: inherit; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 18px 14px; background: var(--surface); transition: border-color .15s ease; }
.ab-qr-card:hover { border-color: var(--gold); }
.ab-qr-card .row.center { margin-top: auto; }
.ab-qr-head { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ab-qr-head b { font-size: 1rem; line-height: 1.4; }
.svc-ico { display: inline-flex; }
.ab-qr-link { display: inline-block; line-height: 0; border: 1px solid var(--gold);
  border-radius: 10px; padding: 8px; background: #fff; }
.ab-qr-card img.qr { background: #fff; border-radius: 4px; }
.ab-qr-url { font-size: .78rem; color: var(--accent-text); word-break: break-all; text-decoration: none; }
.ab-qr-url:hover { text-decoration: underline; }
.row.center { justify-content: center; }
@media print { .ab-qr-card .btn, .ab-qr + .row { display: none !important; } }
.docno-fig { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; justify-content: center; margin: 14px 0; }
.docno-seg { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 88px;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--soft); }
.docno-seg b { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.25rem; color: var(--gold); }
.docno-seg span { font-size: .8rem; color: var(--muted); }
.docno-legend b { color: var(--ink-strong, inherit); }
@media print { .ab-qr-card { break-inside: avoid; } }
/* رقم التوثيق في بطاقة البيانات: سطر واحد بأرقام لاتينية (ملاحظة ١٣٤) */
.data-card td.doc-cell { white-space: nowrap; direction: ltr; font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .3px; }

/* ملاحظة صيغ التسجيل، وختم التوثيق في الشاشة (ملاحظتا ١٤٣ و١٤٥) */
.spec-note { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: .88rem; color: var(--muted); line-height: 1.8; }
.spec-note b { color: var(--text); }
.spec-note a { margin-inline-start: 8px; white-space: nowrap; }
.small.warn { color: var(--warn); }
.small.ok { color: var(--ok); }
.take .stack { margin-top: 2px; }

/* ---------------------------------------------------------------
   شريط الكميات التعاقدية، والدليل المصطلحي، ووحدات الإنتاج
   (ملاحظات ١٤٨ و١٥٠ و١٤٧)
--------------------------------------------------------------- */
.qbar { position: relative; height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--border) 60%, transparent);
  overflow: hidden; margin: 8px 0 6px; }
.qbar-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--gold) 60%, var(--ok))); }
.qitem { gap: 4px; display: flex; flex-direction: column; }
.qitem .row.between { gap: 10px; }
.units-head { border-inline-start: 3px solid var(--gold); }

.term-card .term-ar { font-size: 1.15rem; }
.term-card table { margin-top: 4px; }
.gl-results { max-height: 52vh; overflow: auto; }
.gl-hit { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.gl-hit:last-child { border-bottom: 0; }
.gl-hit ul { margin: 4px 0 0; padding-inline-start: 18px; }
.ws-glossary { justify-content: flex-start; margin: 0 0 10px; }
.ws-glossary:empty { display: none; }

/* الأصل الصوتي ومعاينته، ولوحة فتح الدليل المصطلحي (ملاحظتا ١٥٧ و١٥٨) */
.src-audio { position: sticky; top: 8px; }
.src-audio audio { width: 100%; }
.src-audio-prev { margin-top: 8px; gap: 4px; }
.src-audio-prev audio { width: 100%; }
.gl-open { border-inline-start: 3px solid var(--gold); }
/* داخلَ اللغة ولافتةُ المقترحات: سطرٌ لا يُطيل الصفحة (ملاحظتا ٢٩٥ و٢٩٦) */
/* رفعُ الشعارات والتوقيع وتحريكُها (ملاحظتا ٢٨٢ و٢٨٣) */
.mark-prev img { max-height: 18mm; max-width: 100%; background: #fff; border: 1px solid var(--border);
  border-radius: 6px; padding: 4px; }
.mark-row { gap: 8px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; }
.mark-thumb { height: 30px; width: auto; background: #fff; border-radius: 4px; padding: 2px; }
.field.sm { font-size: .8rem; }
.field.sm input { max-width: 7.5rem; }

/* مرشَّحو المرصد: أيقوناتٌ بحجم اللفظ لا صفوفٌ تُطيل الصفحة (ملاحظة ٢٩٧) */
.cand-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.cand { display: inline-flex; align-items: stretch; border: 1px solid var(--border);
  border-radius: 999px; overflow: hidden; background: var(--card); font-size: .86rem; }
.cand.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.cand-word { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; }
.cand-n { font-size: .74rem; color: var(--muted); background: var(--bg);
  border-radius: 999px; padding: 0 5px; direction: ltr; }
.cand-act { border: 0; border-inline-start: 1px solid var(--border); background: transparent;
  color: var(--muted); cursor: pointer; padding: 0 7px; font-size: .86rem; line-height: 1; }
.cand-act:hover { background: var(--bg); color: var(--text); }
.cand-act.ghost:hover { color: var(--bad, #b00); }

.gl-langbar { padding: 10px 12px; border-inline-start: 3px solid var(--gold); gap: 8px; }
.gl-pend { padding: 8px 12px; border-inline-start: 3px solid var(--warn, var(--gold)); gap: 8px; }

/* القاعات واللقاءات (ملاحظة ١٦٣) */
.meet-card { border-inline-start: 3px solid var(--border); }
.meet-card.open { border-inline-start-color: var(--ok); }
.meet-card .sep { opacity: .5; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; }
.inv-row { min-height: 28px; }
@media (max-width: 560px) { .inv-grid { grid-template-columns: 1fr; } }

/* بطاقتا الدخول، وسطر اللقاء المنتهي (ملاحظة ١٦٧) */
.room-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
button.room-tile { cursor: pointer; text-align: center; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; min-height: 240px;
  padding: 38px 22px 30px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; color: inherit; font: inherit;
  transition: border-color .15s, transform .15s, box-shadow .15s; }
button.room-tile:hover { border-color: var(--gold); transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .07); }
.room-tile .rt-art { color: var(--gold); line-height: 0; }
.room-tile .rt-title { font-size: 1.32rem; font-weight: 700; margin-top: 4px; }
.room-tile .rt-lead { color: var(--muted); font-size: .88rem; max-width: 30ch; }
.room-tile .rt-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  justify-content: center; margin-top: 6px; font-size: .86rem; color: var(--muted); }
.room-tile .rt-meta b { color: var(--text); }
.room-tile .rt-meta .sep { opacity: .5; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.room-item { gap: 6px; }
.room-item a { overflow-wrap: anywhere; font-size: .8rem; }

.meet-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.meet-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px;
  align-items: center; padding: 7px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); }
.meet-row.off { opacity: .65; }
.meet-row .mr-title { display: flex; gap: 6px; align-items: center; min-width: 0; }
.meet-row .mr-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meet-row .mr-acts { gap: 2px; }
@media (max-width: 680px) {
  .meet-row { grid-template-columns: 1fr auto; }
  .meet-row .mr-meta { grid-column: 1 / -1; order: 3; }
}
/* قائمة العمل: سطرٌ واحد لكل عمل، وأيقوناتٌ لا أزرارٌ عريضة (ملاحظة ١٧٨) */
.work-table td { vertical-align: middle; }
.work-table .w-title { display: inline-block; max-width: 30ch; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.work-table .w-acts { gap: 2px; flex-wrap: nowrap; justify-content: flex-end; }
.work-table .icon-btn { width: 30px; height: 30px; }
@media (max-width: 900px) { .work-table .w-title { max-width: 22ch; } }

/* سطر نمط التسمية في الأرشيف — مختصر لا بطاقة (ملاحظة ١٧٦) */
.naming-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.naming-line code { max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--accent-text); font-size: .76rem; }
@media (max-width: 640px) { .naming-line code { max-width: 18ch; } }

/* بوّابة اللقاء: الدخول باسم المنصة، والجلسة في نافذتها (ملاحظتا ١٧٥ و١٧٩) */
.enter-card { border-inline-start: 3px solid var(--gold); }
.enter-btn { min-height: 46px; font-size: 1.02rem; padding-inline: 26px; }
.inv-names { columns: 2; margin: 0; padding-inline-start: 18px; }
@media (max-width: 560px) { .inv-names { columns: 1; } }

/* سطر نمط التسمية في الأرشيف — مختصر لا بطاقة (ملاحظة ١٧٦) */
.naming-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.naming-line code { max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--accent-text); font-size: .76rem; }
@media (max-width: 640px) { .naming-line code { max-width: 18ch; } }
.guide ul { margin: 0; padding-inline-start: 18px; }
.guide li { margin-bottom: 3px; }

/* محاور الاجتماع ومحضره (ملاحظتا ١٨٢ و١٨٣) */
.agenda-box { gap: 6px; }
.agenda-head { padding-inline: 4px; font-size: .74rem; }
.agenda-head > span:first-child { width: 2.1rem; }
.agenda-row { gap: 6px; align-items: flex-start; }
.agenda-row .ag-no { width: 2.1rem; flex: none; padding-top: 7px;
  text-align: center; color: var(--muted); font-size: .8rem; }
.agenda-row .grow { flex: 1 1 auto; min-width: 0; display: grid; gap: 4px;
  grid-template-columns: 2fr 1fr; }
.agenda-row .grow > :last-child { grid-column: 1 / -1; }
.agenda-row input, .agenda-row textarea { width: 100%; }
.axis-card { border-inline-start: 3px solid var(--gold); }
.axis-card > .small.muted:first-child { font-weight: 600; }
@media (max-width: 640px) {
  .agenda-row .grow { grid-template-columns: 1fr; }
  .agenda-head { display: none; }
}

/* التقرير الشهري للتكاليف التشغيلية (ملاحظة ١٩٠) */
.ops-table td[dir="ltr"], .ops-table th { white-space: nowrap; }
.ops-table .sub { display: block; font-size: .74rem; color: var(--muted); }
.ops-sum { max-width: 420px; margin-inline-start: auto; gap: 4px; }
.ops-line { padding: 3px 0; border-bottom: 1px dashed var(--border); }
.ops-line:last-of-type { border-bottom: 0; }
.ops-line.bad b { color: var(--bad); }
.ops-line.grand { border-top: 2px solid var(--gold); padding-top: 7px;
  margin-top: 4px; font-size: 1.02rem; }

/* نافذة تسليم الخطبة وكلمات أصلها (ملاحظتا ١٨٨ و١٨٩) */
.words-card, .window-card, .due-card { gap: 6px; }
.words-card input[type="number"] { max-width: 10rem; }

/* المنجز في المتابعة: سطرٌ مختصر بعلامته (ملاحظة ١٩١) */
.done-box { margin: 16px 0; }
.done-head h3 { margin: 0; }
.done-list .meet-row { align-items: center; }
.done-list .meet-row.late { border-inline-start: 3px solid var(--bad); }
.done-list .meet-row.ontime { border-inline-start: 3px solid var(--ok); }
.done-mark { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: .82rem; font-weight: 700; }
.done-mark.ok { background: var(--ok-bg); color: var(--ok); }
.done-mark.bad { background: var(--bad-bg); color: var(--bad); }

/* أساس العقد في دليل الإنتاج (ملاحظة ١٨٨) */
.contract-box { border-inline-start: 3px solid var(--gold); }
.contract-box:empty { display: none; }

/* لغاتُ المبادرة: يخدمها المتعاقد بلا مقابل (ملاحظة ١٩٤) */
.small.gold { color: var(--accent-text); }
.lang-card.init { border-color: var(--gold); background: #bc966122;
  box-shadow: inset 0 0 0 1px #bc966133; }
.init-card { border-inline-start: 3px solid var(--gold); }
.init-card .sub { display: block; font-size: .74rem; color: var(--muted); }

/* نطاق العقد: مرجعٌ منقولٌ عن العقد (ملاحظة ١٩٥) */
.scope-jump { gap: 6px; }
.scope-sec h3 { margin: 0 0 2px; }
.scope-h4 { margin: 10px 0 2px; font-size: .92rem; color: var(--accent-text); }
.scope-list { margin: 0; padding-inline-start: 18px; }
.scope-list li { margin-bottom: 4px; font-size: .9rem; line-height: 1.75; }
.scope-table th, .scope-table td { font-size: .84rem; vertical-align: top; }

/* جزاءاتُ العقد وسقفُها، ومواعيدُ النصوص (ملاحظة ١٩٧) */
.cap-card .stat { display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px;
  background: var(--bg); }
.cap-card .stat b { font-variant-numeric: tabular-nums; font-size: 1.04rem; }
.cap-card .stat b.bad { color: var(--bad); }
.meter { height: 8px; border-radius: 99px; background: var(--border);
  overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--gold);
  border-radius: 99px; transition: width .25s ease; }
.meter > span.warn { background: var(--warn); }
.meter > span.bad  { background: var(--bad); }

/* سجلُّ الورديات: الفتراتُ الثلاث والبديلُ المعتمد (ملاحظة ١٩٦) */
.cover-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px;
  align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.cover-row:last-child { border-bottom: 0; }
.cover-row b { font-variant-numeric: tabular-nums; }
.sub-badge { font-size: .72rem; color: var(--muted); display: block; }
.due-row.overdue { border-inline-start: 3px solid var(--bad); }
.due-row.soon { border-inline-start: 3px solid var(--warn); }

/* المراسلة المنتهية سطرٌ واحد، فيجتمع في الصفحة عددٌ منها (ملاحظة ١٩٩) */
.circular-row.compact { padding: 7px 12px; gap: 6px; }
.circular-row.compact .circ-line { gap: 8px; align-items: center; flex-wrap: nowrap; }
.circular-row.compact .circ-line > b { overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-weight: 600; }
.circular-row.compact .circ-when { white-space: nowrap; font-size: .74rem; }
.circular-row.compact .circ-admin { margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed var(--border); }
@media (max-width: 640px) {
  .circular-row.compact .circ-line { flex-wrap: wrap; }
  .circular-row.compact .circ-when { width: 100%; }
}

/* كشفُ بيانات الفريق: خانةٌ لكل بيان بعلامتها (ملاحظة ١٩٩) */
.mx-table th.mx-head { writing-mode: initial; font-size: .74rem; white-space: nowrap;
  text-align: center; padding-inline: 4px; }
.mx-table td.mx-cell { text-align: center; padding-inline: 4px; }
.mx-mark { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem;
  border-radius: 50%; font-size: .82rem; font-weight: 700; line-height: 1; }
.mx-mark.ok    { background: var(--ok-bg);   color: var(--ok); }
.mx-mark.warn  { background: var(--warn-bg); color: var(--warn); }
.mx-mark.bad   { background: var(--bad-bg);  color: var(--bad); }
.mx-mark.muted { background: transparent;    color: var(--muted); }
.mx-table .sub { display: block; font-size: .72rem; color: var(--muted); }
.mx-table .sub.bad { color: var(--bad); }
.mx-table tr.mx-short td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.mx-table tr.mx-done  td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
@media (max-width: 760px) {
  .mx-table td.mx-cell { text-align: start; }
}

/* مصمّم البطاقة: شريطُ أيقونات، كلُّ أيقونةٍ تفتح خياراتها (ملاحظة ١٩٩) */
.cd-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px; margin-bottom: 10px; }
.cd-tool { display: grid; gap: 2px; justify-items: center; text-align: center;
  padding: 10px 6px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg); color: inherit; cursor: pointer; font: inherit; }
.cd-tool:hover { border-color: var(--gold); }
.cd-tool.on { border-color: var(--gold); background: rgba(188, 150, 97, .10); }
.cd-tool-icon { font-size: 1.25rem; line-height: 1.1; color: var(--gold); }
.cd-tool b { font-size: .82rem; }
.cd-tool .small { font-size: .68rem; line-height: 1.35; }
.cd-tabbody h3 { margin: 0 0 4px; }
@media (max-width: 520px) {
  .cd-tools { grid-template-columns: repeat(3, 1fr); }
  .cd-tool .small { display: none; }
}

/* ------------------------------------------------------------------
   رموز الاسترداد للتحقق بخطوتين (ملاحظة ٢٠٥)
------------------------------------------------------------------- */
.mfa-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px;
  margin: 10px 0; padding-inline-start: 22px; }
.mfa-codes code { font-size: 1.05em; letter-spacing: 1.5px; padding: 4px 8px; border-radius: 8px;
  background: var(--surface-2, rgb(255 255 255 / 6%)); display: inline-block; }
.mfa-recovery { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line, rgb(255 255 255 / 10%)); }
.mfa-recovery summary { cursor: pointer; font-size: .92em; }
.mfa-recovery input { max-width: 190px; text-transform: uppercase; }
@media print {
  .mfa-codes { page-break-inside: avoid; }
}
@media (max-width: 520px) { .mfa-codes { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------
   ردهة انتظار القاعة (ملاحظة ٢٠٣)
------------------------------------------------------------------- */
.wait-dots { display: flex; gap: 8px; margin: 6px 0 2px; }
.wait-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--gold, #bc9661);
  opacity: .35; animation: waitPulse 1.2s ease-in-out infinite; }
.wait-dots span:nth-child(2) { animation-delay: .2s; }
.wait-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes waitPulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wait-dots span { animation: none; opacity: .6; } }

/* ------------------------------------------------------------------
   تبويبا الحرمين في قوائم الفرق الميدانية (ملاحظة ٢٢٠)
------------------------------------------------------------------- */
.seg-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 10px; }
.seg-tabs .btn .sub { opacity: .7; font-size: .85em; }

/* ------------------------------------------------------------------
   شريطُ التصدير أعلى الشاشة: الشهر ثم النطاق ثم الصيغة ثم الزر (ملاحظة ٢١٦)
------------------------------------------------------------------- */
.export-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  padding: 10px 12px; border-radius: 12px; background: var(--surface-2, rgb(255 255 255 / 4%)); }
.export-bar .field { margin: 0; min-width: 150px; }
.export-bar .btn { white-space: nowrap; }
@media (max-width: 560px) { .export-bar .field { min-width: 100%; } }

/* ------------------------------------------------------------------
   خريطةٌ صغيرةٌ بلا مكتبة: مربّعات OSM ودبّوسٌ ودائرةُ النطاق (ملاحظة ٢١٩)
------------------------------------------------------------------- */
.map-wrap { position: relative; overflow: hidden; border-radius: 12px;
  border: 1px solid var(--border); background: #e8e2d8; touch-action: none;
  cursor: grab; user-select: none; }
.map-wrap.dragging { cursor: grabbing; }
.map-tiles { position: absolute; inset: 0; }
.map-tile { position: absolute; width: 256px; height: 256px; pointer-events: none; }
.map-pin { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px;
  margin: -7px 0 0 -7px; border-radius: 50%; background: #c0392b;
  box-shadow: 0 0 0 3px #fff, 0 1px 4px rgb(0 0 0 / 35%); pointer-events: none; }
.map-ring { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border: 2px solid rgb(192 57 43 / 85%); background: rgb(192 57 43 / 12%);
  border-radius: 50%; pointer-events: none; }
.map-tools { position: absolute; inset-inline-end: 8px; top: 8px; display: grid; gap: 4px; }
.map-credit { position: absolute; inset-inline-start: 6px; bottom: 4px; font-size: .7rem;
  color: #333; background: rgb(255 255 255 / 75%); padding: 1px 6px; border-radius: 6px; }
.repo-item { background: var(--surface-2, rgb(255 255 255 / 4%)); }
.sig-upload input[type="file"] { font-size: .9em; }

/* عدُّ الخروج التلقائي: ظاهرٌ كبيرٌ لا يُخطئه النظر (ملاحظة ٢٢٩) */
.idle-timer { text-align: center; margin: 0 0 14px; }
.idle-count { font-size: 2.2rem; font-variant-numeric: tabular-nums;
  letter-spacing: .04em; color: var(--accent-text); }

/* اختيارُ أيام العمل (ملاحظة ٢٣٣) */
.day-picker { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.day-picker .check { gap: 6px; }

/* القادةُ وفِرقُهم (ملاحظة ٢٢٨) */
.lead-grid { display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.lead-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  background: var(--card); display: flex; flex-direction: column; gap: 6px; }
.lead-card p { margin: 0; }

/* عرضُ المادة للمشاهدة فقط، بعلامةٍ مائيةٍ باسم قارئها (ملاحظة ٢٣٢) */
.doc-view { position: relative; height: min(70vh, 620px); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; background: var(--bg-soft); }
.doc-view iframe { width: 100%; height: 100%; border: 0; }
.doc-mark { position: absolute; inset: 0; pointer-events: none;
  display: flex; flex-wrap: wrap; align-content: space-around;
  justify-content: space-around; opacity: .14; }
.doc-mark span { transform: rotate(-24deg); font-size: 1.3rem; font-weight: 700;
  white-space: nowrap; }

/* أيقوناتٌ مرسومة: تتبع لون النصِّ ومقاسَه (ملاحظة ٢٣١) */
.ico { display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-text); flex: none; }

/* أيقوناتُ أنواع المستودع (ملاحظة ٢٢٦) */
.repo-types { display: grid; gap: 10px; margin-bottom: 14px;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.repo-tile { display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: inherit; cursor: pointer; font: inherit;
  transition: border-color .15s, background .15s; }
.repo-tile:hover { border-color: var(--accent); }
.repo-tile.on { border-color: var(--accent); background: var(--accent-soft, var(--bg-soft)); }
.repo-tile b { font-size: .95rem; }
.repo-tile .sub { font-size: .78rem; color: var(--muted); }

/* رؤوسُ الأقسام والبطاقات والأدوار بأيقوناتها (ملاحظتا ٢٣٠ و٢٣١) */
.ab-sec-head { display: flex; align-items: center; gap: 10px; }
.ab-sec-head h2 { margin: 0; }
.ab-sec > .ab-sec-head { margin-bottom: 14px; }
.ab-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ab-card-head h3 { margin: 0; }
.ab-role-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ab-role-head h3 { margin: 0; }
.ab-role-num { display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--accent); color: #fff; font-size: .82rem; font-weight: 700; }

/* بطاقاتُ لغات الدليل المصطلحي (ملاحظة ٢٣٤) */
.gl-cards { display: grid; gap: 10px; margin-bottom: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gl-card { display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 10px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: inherit; cursor: pointer; font: inherit;
  text-align: center; transition: border-color .15s, background .15s; }
.gl-card:hover { border-color: var(--accent); }
.gl-card.on { border-color: var(--accent); background: var(--accent-soft, var(--bg-soft)); }
.gl-card .gl-native { font-size: .9rem; color: var(--muted); }
.gl-card .sub { font-size: .76rem; color: var(--muted); }
.gl-card .sub.warn { color: var(--warn-text, #a15c00); }
.gl-more { border-style: dashed; }

/* اختيارُ أعمدة التصدير (ملاحظة ٢٤٠) */
.col-picker { display: grid; gap: 6px 14px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  max-height: 44vh; overflow: auto; padding: 4px 2px; }
.col-pick { gap: 8px; align-items: center; }
.col-pick .badge { font-size: .7rem; }

/* لوحةُ مؤشرات البنود — ثلاثٌ في الصف (ملاحظة ٢٤١) */
.kpi-grid { display: grid; gap: 12px; margin-bottom: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-tile { border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  background: var(--card); display: flex; flex-direction: column; gap: 8px;
  border-top: 3px solid var(--line); }
.kpi-tile.is-ok   { border-top-color: var(--ok, #2e7d52); }
.kpi-tile.is-warn { border-top-color: var(--accent); }
.kpi-tile.is-bad  { border-top-color: var(--bad, #b3261e); }
.kpi-head { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.kpi-head b { font-size: .92rem; line-height: 1.5; }
.kpi-num { font-size: 1.9rem; font-weight: 700; line-height: 1.1;
  font-variant-numeric: tabular-nums; }
.kpi-unit { font-size: .8rem; font-weight: 400; color: var(--muted);
  margin-inline-start: 6px; }
.kpi-tile p { margin: 0; }
.kpi-gold .kpi-tile { border-top-color: var(--accent); }
.kpi-gold .kpi-num { color: var(--accent-text); }

/* صفُّ المستخلص الذي قُدِّم بغير الفعلي (ملاحظة ٢٤٢) */
tr.row-edited td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.gold { color: var(--accent-text); }

/* شريطُ التحديد للتصدير المجمَّع (ملاحظة ٢٣٧) */
.pick-bar { position: sticky; bottom: 0; z-index: 5; margin: 10px 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 14px; border: 1px solid var(--accent);
  border-radius: 12px; background: var(--card);
  box-shadow: 0 -4px 18px rgb(0 0 0 / .18); }
.pick-bar b { color: var(--accent-text); }

/* الدليل الإرشادي: بطاقاتُ اللغات بتصميم شاشة «اللغات» (ملاحظة ٢٤٥) */
.gl-bar { margin: 0 0 8px; flex-wrap: wrap; gap: 8px; }
.gl-grid { margin-bottom: 14px; }
.lang-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

/* ترتيبُ أعمدة التصدير بالسحب، وعمودٌ يُضاف (ملاحظة ٢٤٣) */
.col-sort { grid-template-columns: 1fr !important; max-height: 46vh; overflow: auto; }
.col-sort .col-pick { display: flex; gap: 8px; align-items: center;
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; background: var(--surface); }
.col-sort .col-pick.dragging { opacity: .5; }
.col-sort .col-pick.over { border-color: var(--accent); }
.col-grip { cursor: grab; color: var(--muted); font-size: 1rem; line-height: 1; }
.col-sort .col-pick .btn.xs { padding: 1px 6px; line-height: 1.2; }

/* منتقي الشهر من تقويم (ملاحظة ٢٤٨) */
.mp-wrap { position: relative; display: inline-block; }
.mp-pop { position: absolute; z-index: 40; inset-inline-start: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px; box-shadow: 0 10px 30px #0004; min-width: 260px; }
.mp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mp-m { font: inherit; cursor: pointer; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-soft, transparent); color: inherit; padding: 7px 4px; font-size: .85rem; }
.mp-m:hover:not(:disabled) { border-color: var(--gold); }
.mp-m.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.mp-m.has { font-weight: 700; }
.mp-m.has::after { content: '•'; margin-inline-start: 4px; color: var(--gold); }
.mp-m.on.has::after { color: #fff; }
.mp-m:disabled { opacity: .35; cursor: not-allowed; }

/* بطاقاتٌ مستطيلةٌ عرضيّة، ثلاثٌ في الصف (ملاحظة ٢٤٦ ز)
   الأيقونةُ والعنوانُ في جهة، والرقمُ في الأخرى، والشريطُ أسفلَها بعرضها. */
.kpi-tile { display: grid; gap: 4px 12px; padding: 12px 14px; min-height: 92px;
  grid-template-columns: 1fr auto; grid-template-areas: "head num" "bar bar" "sub sub" "extra extra";
  align-items: center; border-top-width: 1px; border-inline-start: 3px solid var(--line); }
.kpi-tile.is-ok   { border-top-color: var(--line); border-inline-start-color: var(--ok, #2e7d52); }
.kpi-tile.is-warn { border-top-color: var(--line); border-inline-start-color: var(--accent); }
.kpi-tile.is-bad  { border-top-color: var(--line); border-inline-start-color: var(--bad, #b3261e); }
.kpi-tile > .kpi-head { grid-area: head; }
.kpi-tile > .kpi-num  { grid-area: num; text-align: end; white-space: nowrap; font-size: 1.6rem; }
.kpi-tile > .qbar     { grid-area: bar; width: 100%; margin-top: 2px; }
.kpi-tile > p.small.muted { grid-area: sub; }
.kpi-tile > p.small.gold  { grid-area: extra; }
.kpi-gold .kpi-tile { border-top-color: var(--line); border-inline-start-color: var(--accent); }
@media (max-width: 560px) { .kpi-tile > .kpi-num { font-size: 1.35rem; } }

/* أعمالُ المستودع ببطاقاتٍ مستطيلةٍ مجموعةٍ بالنوع (ملاحظة ٢٥٣) */
.repo-group { margin-bottom: 16px; }
.repo-group-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.repo-group-head b { font-size: .98rem; }
.repo-cards { display: grid; gap: 8px; }
.repo-card { display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-inline-start: 3px solid var(--line); border-radius: 12px;
  padding: 10px 12px; background: var(--card); }
.repo-card.on { border-inline-start-color: var(--accent); background: var(--accent-soft, var(--card)); }
.repo-pick { display: flex; align-items: center; margin: 0; }
.repo-ico { color: var(--muted); display: flex; }
.repo-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.repo-title { font-size: .96rem; overflow: hidden; text-overflow: ellipsis; }
.repo-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--muted); }
.repo-langs { display: flex; flex-wrap: wrap; gap: 4px; }
.repo-langs .badge { font-size: .68rem; }
.repo-acts { gap: 6px; }
@media (max-width: 640px) {
  .repo-card { grid-template-columns: auto auto 1fr; }
  .repo-acts { grid-column: 1 / -1; justify-content: flex-end; }
}

/* عدّادُ الفقرات في شاشة الترجمة (ملاحظة ٢٥٢) */
.par-count { color: var(--muted); margin-inline-end: 10px; white-space: nowrap; }
.par-count.ok   { color: var(--ok, #2e7d52); }
.par-count.warn { color: var(--warn-text, #a15c00); font-weight: 600; }

/* بطاقةُ النسخة الاحتياطية في لوحة الأعمال (ملاحظة ٢٤٧ د) */
.backup-card { border-inline-start: 3px solid var(--ok, #2e7d52); }
.backup-card.warn { border-inline-start-color: var(--warn-text, #a15c00); }

/* ------------------------------------------------------------------
   الدليل معجمًا: المصطلحُ ومقابلُه في صفوفٍ تُقرأ كالمعاجم (ملاحظة ٢٥٦)
------------------------------------------------------------------- */
.gl-cols { column-count: 2; column-gap: 28px; column-rule: 1px solid var(--border); }
@media (max-width: 760px) { .gl-cols { column-count: 1; } }
.gl-entry { display: flex; align-items: baseline; gap: 6px; width: 100%;
  break-inside: avoid; text-align: start; font: inherit; cursor: pointer;
  background: transparent; border: 0; border-radius: 8px; padding: 7px 10px; color: var(--text); }
.gl-entry.odd { background: var(--row-alt, rgba(255, 255, 255, .035)); }
.gl-entry:hover { background: var(--hover, rgba(185, 151, 91, .12)); }
.gl-entry .gl-ar { font-weight: 700; }
.gl-entry .gl-sep { color: var(--muted); }
.gl-entry .gl-tr { color: var(--text); unicode-bidi: plaintext; }
.gl-entry .gl-dot { margin-inline-start: auto; flex: 0 0 auto; font-size: .62rem;
  color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: 0 6px; }
.gl-letter-head { break-inside: avoid; column-span: all; margin: 14px 0 6px;
  font-size: 1.05rem; font-weight: 700; color: var(--gold);
  border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.gl-letters { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 4px; }
.gl-letter { font: inherit; cursor: pointer; background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px; min-width: 30px; padding: 3px 6px; }
.gl-letter:hover { color: var(--gold); border-color: var(--gold); }
.gl-grid-table td { unicode-bidi: plaintext; }
.gl-pick { max-height: 240px; overflow: auto; border: 1px solid var(--border);
  border-radius: 10px; padding: 8px; }
.gl-hist { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
/* عددُ المصطلحات رقمٌ بارز، و«مصطلحًا» صغيرةٌ تحته (ملاحظة ٢٥٨).
   ويُقصَر على بطاقة اللغة: الاسمُ نفسُه لشارة لغات خطبة عرفة أعلاه،
   وكان يدهسها فتفقد استدارتَها ومحاذاتَها (إصلاح) */
.lang-card .lang-count { display: flex; align-items: baseline; gap: 5px; margin-top: 6px;
  padding: 0; border: 0; border-radius: 0; background: none; white-space: normal; }
.lang-card .lang-count b { font-size: 1.6rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent-text, var(--gold)); }
.lang-card .lang-count small { font-size: .72rem; color: var(--muted); }
.lang-card.native { border-color: var(--gold); }

/* ------------------------------------------------------------------
   لوحةُ الصلاحيات المفصَّلة (ملاحظة ٢٦٦)
------------------------------------------------------------------- */
.perm-wrap { display: grid; gap: 14px; max-height: 420px; overflow: auto; padding-inline-end: 4px; }
.perm-group h4 { margin: 0 0 6px; font-size: .85rem; color: var(--gold); }
/* علامةُ صحٍّ على رأس القسم تفتح الداخلَ كلَّه أو تغلقه (ملاحظة ٤٤٢) */
.perm-head { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.perm-head h4 { margin: 0; }
.perm-row { display: flex; align-items: center; gap: 8px; padding: 4px 2px; }
.perm-row.child { padding-inline-start: 18px; }
.perm-row.head { font-weight: 600; border-top: 1px solid var(--border); padding-top: 8px; }
.perm-name { flex: 1; }
.perm-name .warn { color: #c98a2e; }
.perm-tag { font-size: .68rem; border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 7px; color: var(--muted); white-space: nowrap; }
.perm-tag.ok { color: #2e9e6b; border-color: #2e9e6b; }
.perm-tag.bad { color: #c0564a; border-color: #c0564a; }

/* ------------------------------------------------------------------
   الشهادات وتسميات الأدوار (ملاحظتا ٢٦٧ و٢٧٢)
------------------------------------------------------------------- */
.cert-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border); }
.cert-row:last-child { border-bottom: 0; }
.role-row { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border);
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr); align-items: end; }
.role-row:last-child { border-bottom: 0; }
.role-base { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 700px) { .role-row { grid-template-columns: 1fr; } }
.verify-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 8px 0 0; }
.verify-grid dt { color: var(--muted); font-size: .85rem; }
.verify-grid dd { margin: 0; }
/* بصمةُ النصِّ طويلةٌ لاتينية، فتُكسَر ولا تمدُّ الصفحة (ملاحظة ٤٢٨) */
.verify-grid dd.mono { font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .78rem; word-break: break-all; }
.policy-clause { border-inline-start: 3px solid var(--gold); padding: 2px 10px;
  margin: 10px 0 0; }
.policy-clause b { display: block; color: var(--gold); margin-bottom: 2px; }
.policy-clause p { margin: 0; line-height: 1.9; }
.field.grow { flex: 1; min-width: 200px; }
.verify-ok { border-color: #2e9e6b; }
.verify-bad { border-color: #c0564a; }
.gl-task input { width: 100%; }
.gl-save { display: inline-block; min-width: 1em; color: var(--muted); }
.gl-save.ok { color: #2e9e6b; }
.gl-save.bad { color: #c0564a; }
.shift-chip.late { border-color: #c98a2e; }
.shift-chip.adhoc { border-style: dashed; }

/* صندوقُ البحث فوق قائمة الأعمال مباشرةً (ملاحظة ٢٨٧) */
.work-filter { margin: 16px 0 10px; }
.work-filter .grid { margin: 0; }

/* مستودع الترجمة: جدولُ «الجميع» صفوفُه قصيرةٌ وأيقوناتُه ظاهرة (ملاحظة ٢٨٨) */
.repo-all td, .repo-all th { padding: 4px 8px; }
.repo-all td b { font-weight: 600; }
.repo-ico.sm { display: inline-flex; vertical-align: -3px; margin-inline-end: 6px; }
.repo-view .repo-text { font-size: .86rem; color: var(--muted); max-height: 9rem;
  overflow: auto; white-space: pre-wrap; }

/* الهوية الشخصية: الصورةُ والبياناتُ متجاورتان فتُطابَقان (ملاحظة ٣٠٧) */
.id-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.id-card { padding: 12px; }
.id-card.waiting { border-inline-start: 3px solid var(--gold); }
.id-grid { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; align-items: start; }
.id-view { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.id-shot { width: 100%; height: 110px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); background: #fff; }
.id-shot.empty { display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--muted); font-size: .8rem; }
.id-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px 10px; margin: 4px 0; }
.id-facts span { display: flex; flex-direction: column; gap: 1px; }
.id-facts small { font-size: .68rem; color: var(--muted); }
.id-facts b { font-size: .84rem; }
@media (max-width: 700px) {
  .id-wrap { grid-template-columns: 1fr; }
  .id-grid { grid-template-columns: 1fr; }
}

/* اسمُ العضو يُضغط فيفتح ملفَّه (ملاحظة ٣٠١) */
.name-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 700;
  color: inherit; cursor: pointer; text-align: start; }
.name-link:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* مصمِّمُ الشهادة: اللوحةُ تُرسَم بالمولِّد نفسِه (ملاحظة ٣١٢) */
.cert-stage-wrap { display: flex; justify-content: center; padding: 10px 0;
  background: repeating-conic-gradient(rgba(127,127,127,.10) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
  border-radius: 10px; }
.cert-stage { position: relative; width: 100%; max-width: 860px; aspect-ratio: 297 / 210;
  border: 1px solid #d8cfbd; border-radius: 8px; overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,.28); background: #fff; }
.cert-stage.portrait { aspect-ratio: 210 / 297; max-width: 600px; }
.cert-frame { position: absolute; inset: 0; width: 297mm; height: 210mm; border: 0;
  transform-origin: top right; pointer-events: none; }
.cert-stage.portrait .cert-frame { width: 210mm; height: 297mm; }
.cert-handles { position: absolute; inset: 0; }
.cert-handle { position: absolute; border: 1.5px dashed transparent; border-radius: 4px;
  cursor: grab; touch-action: none; }
.cert-handle:hover { border-color: var(--gold); background: rgba(188,150,97,.12); }
.cert-handle.on { border-color: var(--gold); background: rgba(188,150,97,.2); }

/* أرشيفُ الخطب السنوي (ملاحظة ٣٠٣) */
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.year-tile { display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 18px 12px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--card); text-decoration: none; color: inherit; transition: .15s; }
.year-tile:hover { border-color: var(--gold); transform: translateY(-2px); }
/* حذفُ العام الفارغ: زرٌّ خفيٌّ يظهر عند لمس البطاقة (ملاحظة ٤٢١) */
.year-tile { position: relative; }
.year-del { position: absolute; top: 6px; inset-inline-start: 6px; border: 0; background: transparent;
  color: var(--muted); font-size: .92rem; line-height: 1; padding: 4px 6px; border-radius: 8px;
  cursor: pointer; opacity: 0; transition: .15s; }
.year-tile:hover .year-del, .year-del:focus-visible { opacity: 1; }
.year-del:hover { background: color-mix(in srgb, #b3261e 18%, transparent); color: #ff9b92; }
.year-no { font-size: 1.9rem; line-height: 1; color: var(--gold); }
.year-h { font-size: .7rem; color: var(--muted); }
.year-meta { display: flex; flex-direction: column; align-items: center; gap: 1px;
  margin-top: 8px; font-size: .72rem; color: var(--muted); }

.sec-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sec-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); cursor: pointer; font: inherit; color: inherit; }
.sec-tile.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.sec-tile.add { border-style: dashed; color: var(--muted); }
.sec-ico { display: inline-flex; }

.weeks { display: grid; gap: 10px; }
.week-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--card); }
/* رأسُ الأسبوع في بطاقة الأرشيف — مقصورٌ عليها، فاسمُه مُستعمَلٌ في
   صفحات الموقع العامّ بتنسيقٍ آخر (إصلاح) */
.week-card .week-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--border); }
.week-card .week-body { display: grid; gap: 6px; padding: 8px 12px; }
.sm-row { padding: 6px 0; }
.sm-row + .sm-row { border-top: 1px dashed var(--border); }
.sm-row.gone { opacity: .72; }
.sm-no { display: inline-block; min-width: 2.2em; color: var(--muted); font-size: .78rem;
  direction: ltr; }
.sm-title { color: var(--gold); }
/* شريطُ اللغات: سطرٌ واحدٌ يُمرَّر أفقيًّا، لا جدارٌ من الوسوم */
.lang-chips { display: flex; flex-wrap: nowrap; gap: 4px; margin-top: 2px;
  overflow-x: auto; overflow-y: hidden; padding-bottom: 2px;
  scrollbar-width: thin; }
.lang-chips > * { flex: 0 0 auto; }
.lang-chips::-webkit-scrollbar { height: 6px; }
.lang-chips::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.lang-chip { border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px;
  font-size: .74rem; background: transparent; color: var(--muted); cursor: pointer; font: inherit;
  font-size: .74rem; }
.lang-chip.on { border-color: var(--ok, #2f6b52); color: var(--text); }
.lang-chip.add { border-style: dashed; }
.lang-chip:hover { border-color: var(--gold); color: var(--text); }
.arch-text { max-height: 40vh; overflow: auto; white-space: pre-wrap; font-size: .9rem;
  line-height: 1.9; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }

/* جدولُ مراجعة الرفع الجماعي (ملاحظة ٣٠٥) */
.imp-wrap { min-width: min(92vw, 1100px); }
.scroll-x { overflow-x: auto; max-height: 56vh; overflow-y: auto; }
.imp-tbl { width: 100%; font-size: .85rem; }
.imp-tbl th, .imp-tbl td { padding: 4px 6px; vertical-align: middle; }
.imp-tbl input[type="text"], .imp-tbl input:not([type]), .imp-tbl select,
.imp-tbl input[type="date"] { width: 100%; min-width: 92px; padding: 3px 6px; font-size: .85rem; }
.imp-tbl td:nth-child(3) input { min-width: 220px; }
.imp-tbl tr.warn-row { background: color-mix(in srgb, var(--warn, #8a6d1f) 12%, transparent); }
.imp-tbl td.num { text-align: center; white-space: nowrap; }
.doc-peek { max-height: 56vh; overflow: auto; line-height: 1.9;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px; min-width: min(80vw, 760px); }

/* بطاقاتُ الأعوام: ثلاثٌ في الصفّ بأرقامها (ملاحظتا ٣٢٨ و٣٢٩) */
.year-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px; direction: rtl; }
@media (max-width: 900px) { .year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .year-grid { grid-template-columns: 1fr; } }
.year-tile { padding: 18px 16px; }
.year-tile .year-no { font-size: 2.4rem; letter-spacing: .02em; }
.year-bar { height: 6px; border-radius: 3px; background: var(--line, #2a3442);
  margin: 10px 0 12px; overflow: hidden; }
.year-bar span { display: block; height: 100%; background: var(--gold); }
.year-bar span.ok { background: var(--ok, #2f6b52); }
.year-bar span.warn { background: var(--gold); }
.year-bar span.bad { background: var(--bad, #8a3b3b); }
.year-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 6px; }
.year-stat { text-align: center; }
.year-stat b { display: block; font-size: 1.15rem; }
.year-stat span { display: block; font-size: .78rem; color: var(--muted); }
.year-stat i { display: block; font-style: normal; font-size: .7rem; }
.year-stat.bad b { color: var(--bad, #c06c6c); }
.year-stat.ok b { color: var(--ok, #6fbf96); }

/* طيُّ صفوف الحرمين (ملاحظة ٣٢٦) */
.mosque-group { border-top: 1px solid var(--border); }
.mosque-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.mosque-group.shut .mosque-head { opacity: .85; }
.fold-btn { background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--muted); cursor: pointer; width: 26px; height: 24px; line-height: 1; }
.fold-btn:hover { color: var(--text); border-color: var(--gold); }
.fold-bar { margin: 6px 0 10px; align-items: center; }

/* نافذةُ الخطبة مضغوطة (ملاحظة ٣٢١) */
.stack.tight { gap: 8px; }
.sermon-form .field { margin: 0; }
.sermon-form input, .sermon-form select, .sermon-form textarea { padding: 5px 8px; }
.sermon-form textarea { min-height: 64px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 620px) { .grid-3 { grid-template-columns: 1fr 1fr; } }

/* مقابضُ النصوص الحرّة فوق لوحة الشهادة (ملاحظة ٣٢٣) */
.cert-handle.text { border-style: solid; border-color: rgba(188,150,97,.45);
  background: rgba(188,150,97,.10); font-size: .62rem; padding: 1px 4px; }
.cert-handle.text.on { border-color: var(--gold); background: rgba(188,150,97,.25); }
.vars summary { cursor: pointer; color: var(--muted); }
.pick-list.tall { max-height: 34vh; padding: 6px 8px; border-radius: 8px; }
.pick-row { display: flex; gap: 8px; align-items: center; padding: 2px 0; }
.tpl-card { padding: 10px 12px; }

/* لوحةُ الشهادة تحفظ نسبتها ولو طال عمودُ الأدوات بجوارها */
.cert-stage-wrap { align-items: flex-start; }
.cert-stage { align-self: flex-start; }

/* الصفُّ الذي منع الاعتماد: يُظلَّل ويُقفَز إليه (ملاحظة ٣١٦) */
.imp-tbl tr.bad-row { background: color-mix(in srgb, var(--bad, #8a3b3b) 22%, transparent);
  outline: 1px solid var(--bad, #8a3b3b); }

/* ما لم يُعرَفْ مسجدُه: صفٌّ ثالثٌ موسومٌ ليُصحَّح (إصلاح ٣١٦) */
.mosque-group.nomosque { border-top: 1px solid var(--bad, #8a3b3b); }
.mosque-group.nomosque .mosque-head b { color: var(--bad, #c06c6c); }

/* الأسابيعُ مضغوطةٌ على قدر نصِّها، فتُمرَّر الخمسون بيُسر (ملاحظة ٣٢٦) */
.weeks { gap: 6px; }
.week-card .week-head { padding: 3px 8px; margin: 0; border-bottom: 0; min-height: 0;
  align-items: center; gap: 8px; font-size: .9rem; line-height: 1.5; }
.week-card .week-head .badge { padding: 0 6px; font-size: .72rem; }
.week-card .mosque-head { padding: 2px 8px; min-height: 0; gap: 6px;
  font-size: .86rem; line-height: 1.5; }
.week-card .week-body { padding: 2px 8px 4px; gap: 2px; }
.week-card .sm-row { padding: 1px 0; min-height: 0; }
.week-card .sm-row.gone { padding: 0; }
.week-card .fold-btn { width: 22px; height: 20px; font-size: .7rem; padding: 0; }
.week-card .icon-btn { padding: 1px 4px; }
.week-card .lang-chips { margin-top: 1px; }
.week-card .lang-chip { padding: 0 7px; font-size: .72rem; }
.week-card .mosque-head .btn { padding: 1px 7px; font-size: .74rem; line-height: 1.5; }
.week-card .badge { line-height: 1.5; }

/* ـــ الأسبوعُ مسجدٌ تحت مسجدٍ لا جنبَه، فيتَّسع صفُّ اللغة لأيقوناته
   الثماني (ملاحظة ٤١٥) */
.week-stack { display: grid; grid-template-columns: 1fr; gap: 0; direction: rtl; }
.week-stack > .mosque-group { border-top: 0; min-width: 0; }
.week-stack > .mosque-group + .mosque-group { border-top: 1px solid var(--border); }
/* سطرُ المسجد: العنوانُ والخطيبُ والتاريخُ والعدّاد في سطرٍ واحد */
.mosque-head .mh-mosque { flex: 0 0 auto; white-space: nowrap; }
.mosque-head .mh-title { min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.mosque-head .mh-khateeb, .mosque-head .mh-when { white-space: nowrap; flex: 0 0 auto; }
@media (max-width: 860px) {
  .mosque-head .mh-khateeb, .mosque-head .mh-when { display: none; }
}
.sm-acts { display: inline-flex; gap: 2px; flex: 0 0 auto; }
.head-acts { gap: 4px; align-items: center; flex-wrap: nowrap; }
.week-card .head-acts .icon-btn { padding: 0 3px; }
.week-card .week-stack .sm-row > .row > div:first-child { min-width: 0; }
.week-card .week-stack .sm-title,
.week-card .week-stack .sm-row b { overflow-wrap: anywhere; }

/* صفُّ الأسبوع مظلَّلٌ بلونٍ ذهبيٍّ خفيف، وصفّا الحرمين على أرضية البطاقة */
.week-card > .week-head {
  background: color-mix(in srgb, var(--gold) 22%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 45%, var(--border));
  border-inline-start: 3px solid var(--gold);
  font-weight: 600; }
.week-card > .week-head > b { color: var(--accent-text, var(--text)); }
.week-card .mosque-head { background: var(--surface); }
.week-card .mosque-group.shut { opacity: .92; }

/* ـــ الشهادات: صفٌّ مضغوطٌ، وتقسيمٌ بالنوع والسنة، وترميزٌ ظاهر (ملاحظة ٣٤٠) */
.cert-kind { margin: 14px 0 6px; font-size: 1rem; color: var(--accent-text); }
.cert-kind:first-child { margin-top: 0; }
.cert-year { border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  margin-bottom: 8px; background: var(--surface); }
.cert-year-head { display: flex; align-items: center; gap: 8px; padding: 4px 10px;
  background: color-mix(in srgb, var(--gold) 16%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 36%, var(--border)); }
.cert-rows { padding: 0 10px; }
.cert-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px;
  padding: 3px 0; border-bottom: 1px solid var(--border); min-height: 0;
  font-size: .88rem; line-height: 1.6; }
.cert-row:last-child { border-bottom: 0; }
.cert-no { flex: 0 0 auto; font-size: .74rem; }
.cert-main { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.cert-acts { flex: 0 0 auto; gap: 4px; flex-wrap: nowrap; }
.cert-acts .btn.xs { padding: 0 7px; font-size: .74rem; line-height: 1.6; }
@media (max-width: 760px) {
  .cert-row { flex-wrap: wrap; }
  .cert-main { white-space: normal; }
}

/* ـــ تنقيحُ نسخةٍ على الكليشة (ملاحظة ٣٣٨) */
.sheet-wrap { overflow: auto; padding: 8px 0; display: flex; justify-content: center; }
.ed-bar { position: sticky; top: 0; z-index: 3; background: var(--bg);
  padding: 6px 0; border-bottom: 1px solid var(--border); gap: 8px; }

/* ـــ مصمِّمُ قوالب المجمَّع (ملاحظتا ٣٣٩ و٣٥٠) */
.bd-wrap { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .62fr);
  gap: 16px; align-items: start; align-content: start; }
@media (max-width: 1100px) { .bd-wrap { grid-template-columns: 1fr; } }
/* لوحةُ الأدوات تمشي مع الصفحة، فلا يُفقَد الزرُّ عند التمرير */
@media (min-width: 1101px) {
  .bd-props { position: sticky; top: 8px; max-height: calc(100vh - 24px);
    overflow: auto; }
}
.bd-bar { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); }
.bd-bar .field.sm { margin: 0; min-width: 130px; }
.bd-sheets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* ـــ العرضُ على نسقِ الكتاب: صفحةٌ وحدَها، وصفحتان مفتوحتان (ملاحظة ٣٥٥) */
.bd-stage { display: grid; gap: 14px; }
.bd-row { display: grid; gap: 4px; }
.bd-row-label { padding-inline-start: 2px; }
.bd-spread { display: grid; gap: 10px; justify-content: center;
  grid-template-columns: minmax(0, 520px); }
.bd-spread.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px;
  justify-content: stretch; }
/* الصفحتان المفتوحتان يلتقيان عند الخيط، فيُقرَّبان ويُظلَّل ما بينهما */
.bd-spread.two .bd-sheet-wrap:first-child .bd-sheet { border-start-start-radius: 0;
  border-end-start-radius: 0;
  box-shadow: 0 2px 10px #0004, inset -8px 0 14px -10px #0007; }
.bd-spread.two .bd-sheet-wrap:last-child .bd-sheet { border-start-end-radius: 0;
  border-end-end-radius: 0;
  box-shadow: 0 2px 10px #0004, inset 8px 0 14px -10px #0007; }
@media (max-width: 640px) { .bd-spread.two { grid-template-columns: 1fr; gap: 10px; } }

/* نصٌّ حرٌّ على الصفحة المصغَّرة */
.bd-tx { position: absolute; direction: rtl; line-height: 1.6; white-space: pre-wrap;
  unicode-bidi: plaintext; }

/* صفحةُ الحقوق مصغَّرة */
.bd-colo { position: absolute; top: 12%; inset-inline: 12%; direction: rtl;
  display: flex; flex-direction: column; gap: 3%; font-size: 3.4cqw; }
.bd-colo > b { font-size: 5cqw; padding-bottom: 2%; }
.bd-rights { border: 1px solid; border-radius: 2px; padding: 3% 4%; font-size: 3cqw;
  opacity: .8; }
.bd-qr { width: 14%; aspect-ratio: 1; border: 1px solid; border-radius: 2px; opacity: .5; }

/* لوحةُ الأدوات الواحدة (ملاحظة ٣٥٥) */
.bd-pages { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.bd-pages .tab { border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 8px; padding: 5px 10px; font: inherit;
  cursor: pointer; min-height: 0; font-size: .82rem; }
.bd-pages .tab[aria-selected="true"] { background: var(--gold); border-color: var(--gold);
  color: var(--ink); font-weight: 700; }
.bd-sec { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px;
  margin-bottom: 8px; background: var(--bg); }
.bd-sec > summary { cursor: pointer; font-weight: 600; font-size: .9rem;
  color: var(--accent-text); }
.bd-sec > .stack, .bd-sec > fieldset { margin-top: 8px; }
.tx-row { border: 1px dashed var(--border); border-radius: 8px; padding: 6px; gap: 6px; }
.tx-row textarea { min-height: 44px; }
.bd-sheet-wrap { display: flex; flex-direction: column; gap: 4px; align-items: stretch;
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.bd-sheet { position: relative; overflow: hidden; border-radius: 4px;
  border: 1px solid var(--border); box-shadow: 0 2px 10px #0004;
  container-type: inline-size; }
.bd-sheet.on { outline: 2px solid var(--gold); outline-offset: 2px; }
/* الاختيارُ المباشر على الصفحة: يُضغَط العنصرُ فيُحدَّد ويُنقَل (ملاحظة ٤٤٣) */
.bd-sheet .bd-obj { cursor: move; }
.bd-sheet .bd-obj:hover { outline: 1px dashed #b9975b; outline-offset: 1px; }
.bd-sheet .bd-obj.sel { outline: 2px solid #1f7a5a; outline-offset: 1px;
  box-shadow: 0 0 0 2px #1f7a5a33; }
.bd-sel { border-color: #1f7a5a66; }
.bd-selhint { margin: 0 0 8px; }
.bd-page { position: absolute; inset: 0; overflow: hidden; }
.bd-pat { position: absolute; inset: 0; opacity: .09;
  background: radial-gradient(circle at 50% 50%, var(--g, #b9975b) 0 1px, transparent 1.6px)
    0 0/14px 14px; }
.bd-cover-bg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34%;
  object-fit: cover; }
.bd-mk { position: absolute; }
.bd-banner { position: absolute; left: 0; right: 0; margin-inline: auto; }
.bd-banner svg { width: 100%; height: auto; display: block; }
.bd-ghost { position: absolute; bottom: 0; inset-inline-end: 0; width: 55%; opacity: .12; }
.bd-stamp { position: absolute; top: 5%; inset-inline-end: 7%; text-align: end;
  direction: rtl; font-size: 3.6cqw; line-height: 1.8; font-weight: 700;
  white-space: nowrap; }
.bd-mid { position: absolute; inset-inline: 8%; text-align: center; direction: rtl; }
.bd-t1 { display: block; font-size: 8cqw; line-height: 1.35; }
.bd-t2 { display: block; font-size: 4.6cqw; font-weight: 700; margin-top: 2%;
  line-height: 1.4; }
.bd-t3 { display: block; font-size: 4cqw; margin-top: 2%; line-height: 1.5; }
.bd-t4 { display: block; font-size: 4cqw; margin-top: 3%; opacity: .8; }
.bd-rule { width: 32%; height: 2px; margin: 4% auto; opacity: .85; }
.bd-foot { position: absolute; inset-inline: 8%; bottom: 4%; display: flex;
  flex-direction: column; gap: 2px; text-align: center; font-size: 3.4cqw; opacity: .75;
  direction: rtl; }
.bd-head { position: absolute; top: 6%; inset-inline: 10%; display: flex;
  justify-content: space-between; font-size: 3.6cqw; padding-bottom: 1%; direction: rtl; }
.bd-win { position: absolute; top: 13%; inset-inline: 10%; bottom: 14%; overflow: hidden; }
/* شريطُ البسملة في نافذة الكتابة — اسمٌ خاصٌّ به لئلا يتداخل مع
   الشريط الملوَّن المضاف من الأدوات (ملاحظة ٤٥٥) */
.bd-bsmband { width: 100%; height: 9%; object-fit: cover; display: block;
  border-radius: 2px; margin-bottom: 4%; }
.bd-kh { text-align: center; font-size: 5cqw; font-weight: 700; margin-bottom: 4%; }
.bd-line { height: 2px; border-radius: 1px; opacity: .35; margin-bottom: 5%; }
.bd-orn { position: absolute; bottom: 8%; inset-inline: 22%; }
.bd-orn svg { width: 100%; height: auto; display: block; }
.bd-no { position: absolute; bottom: 3%; inset-inline: 0; display: flex; justify-content: center; }
.bd-no .pno { display: inline-flex; align-items: center; justify-content: center;
  min-width: 7cqw; height: 7cqw; font-size: 4cqw; }
.bd-no .pno.circle { border: 1px solid; border-radius: 50%; }
.bd-no .pno.ornament { border-top: 1px solid; border-bottom: 1px solid; padding: 0 2cqw; }
.bd-bsm { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; }
.bd-bsm img { width: 58%; height: auto; }
.bd-h { margin: 10px 0 8px; font-size: 1rem; color: var(--accent-text); }
.bd-props { border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  background: var(--surface); }

/* ===================================================================
   أرشيفُ الخطب: بطاقاتُ الأشهر وصفوفُ اللغات (ملاحظات ٣٥٨ و٣٦٤–٣٧٠)
   =================================================================== */

/* ـــ القسمُ يُنتقى ويُعدَّل ويُحذَف من بطاقته (ملاحظتا ٣٥٨ و٣٦٤) */
.sec-tile { position: relative; }
.sec-tile .sec-pick { display: flex; flex-direction: column; align-items: flex-start;
  gap: 2px; background: none; border: 0; padding: 0; font: inherit; color: inherit;
  cursor: pointer; text-align: start; }
.sec-tile .sec-acts { position: absolute; inset-block-start: 4px; inset-inline-end: 4px;
  display: inline-flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.sec-tile:hover .sec-acts, .sec-tile:focus-within .sec-acts { opacity: 1; }
.sec-tile .sec-acts .icon-btn { padding: 1px 4px; }

/* ـــ اثنتا عشرة بطاقةً على أشهر العام (ملاحظة ٣٦٩) */
.month-grid { display: grid; gap: 8px; margin-bottom: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1400px) { .month-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.month-tile .m-top { display: flex; align-items: center; justify-content: space-between;
  width: 100%; gap: 6px; }
.month-tile .m-ord { font-size: .72rem; color: var(--muted); }
.month-tile .m-pct { font-size: .72rem; font-weight: 700; }
.month-tile .m-pct.ok { color: var(--ok, #6fbf96); }
.month-tile .m-pct.warn { color: var(--gold); }
.month-tile .m-pct.bad { color: var(--bad, #c06c6c); }
.month-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); cursor: pointer; font: inherit; color: inherit;
  text-align: start; transition: border-color .12s, transform .12s; }
.month-tile:hover { border-color: var(--gold); transform: translateY(-1px); }
.month-tile.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset;
  background: color-mix(in srgb, var(--gold) 10%, var(--card)); }
.month-tile .m-name { font-size: 1rem; }
.month-tile .year-bar { width: 100%; margin: 2px 0; }
.month-tile .m-stats { display: flex; flex-wrap: wrap; gap: 4px; }
.month-tile .m-stats .badge { padding: 0 6px; font-size: .68rem; }
.month-head { padding: 2px 2px 6px; }
.month-head b { font-size: 1.05rem; }

/* ـــ صفٌّ لكلِّ لغة: عنوانٌ ومسجدٌ ولغةٌ ورمزُ توثيقٍ وأيقونات
      (ملاحظات ٣٦٥ و٣٦٦ و٣٧٠) */
.lang-rows { display: grid; gap: 1px; }
/* صفُّ اللغة: اسمُها ثم رقمُ التوثيق ثم الأيقونات (ملاحظة ٤١٥) */
.lang-row { display: grid; align-items: center; gap: 8px; padding: 3px 6px;
  border-radius: 6px; font-size: .82rem; line-height: 1.5; min-width: 0;
  grid-template-columns: minmax(96px, 200px) minmax(0, auto) 1fr; }
.lang-row .lr-title { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.lang-row .lr-when { font-size: .68rem; color: var(--muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.lang-row .lr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* الأيقوناتُ صفٌّ واحدٌ لا يُكسَر، فلا تنزل سطرًا تحت الصفّ (إصلاح ٣٨٨) */
.lang-row .lr-acts { flex-wrap: nowrap; white-space: nowrap; }
.lang-row .icon-btn.dim { opacity: .38; }
.lang-row .icon-btn.dim:hover { opacity: .75; }
.lang-row + .lang-row { border-top: 1px dashed var(--border); }
.lang-row.empty { opacity: .62; }
.lang-row.has { background: color-mix(in srgb, var(--ok, #2f6b52) 7%, transparent); }
.lang-row:hover { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.lang-row .lr-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.lang-row .lr-mosque, .lang-row .lr-lang { color: var(--muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.lang-row .lr-lang { color: var(--text); }
.lang-row .lr-no { white-space: nowrap; }
.lang-row .doc-no { font-size: .7rem; }
.lang-row .lr-acts { display: inline-flex; gap: 1px; justify-content: flex-end;
  flex: 0 0 auto; }
.lang-row .lr-acts .icon-btn { padding: 0 3px; }
@media (max-width: 900px) {
  .lang-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .lang-row .lr-mosque { display: none; }
}

/* ـــ شبكةُ اختيارِ لغات العام */
.check-grid { display: grid; gap: 4px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* ـــ نصوصُ الشهادة مصفوفةً بترتيبها (ملاحظة ٣٥٦) */
.cb-row { gap: 8px; padding: 5px 0; align-items: center; }
.cb-row + .cb-row { border-top: 1px dashed var(--border); }
.cb-row .cb-no { display: inline-flex; min-width: 20px; justify-content: center;
  font-size: .72rem; color: var(--muted); }
.cb-row b.small { display: block; color: var(--muted); font-weight: 600;
  margin-bottom: 2px; }
.cb-row input[type="text"], .cb-row input:not([type]) { width: 100%; }

/* ـــ كلُّ بيانٍ قسمان: عبارتُه وقيمتُه (ملاحظة ٤١٨)، وعلامةٌ واحدةٌ
   أعلى القائمة تُظهر الكلَّ أو تحجبه (ملاحظة ٤١٩) */
.cb-all { gap: 8px; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--soft); }
.cert-row2 { display: flex; flex-wrap: wrap; align-items: flex-start; }
.cert-row2 .cb-two { min-width: 0; }
.cb-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cb-pair.one { grid-template-columns: 1fr; }
.cb-pair .field.sm { margin: 0; min-width: 0; }
.cb-pair .field.sm input { max-width: none; width: 100%; }
@media (max-width: 680px) { .cb-pair { grid-template-columns: 1fr; } }

/* ـــ خططُ التدريب مربَّعاتٌ تُفتَح صفحةً لها (ملاحظة ٣٦٠) */
.plan-grid { display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.plan-tile { position: relative; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); overflow: hidden; transition: border-color .12s, transform .12s; }
.plan-tile:hover { border-color: var(--gold); transform: translateY(-1px); }
.plan-tile.off { opacity: .72; }
.plan-tile .plan-open { display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px 10px; text-decoration: none; color: inherit; }
.plan-tile .plan-title { font-size: 1.02rem; }
.plan-tile .plan-goal { margin: 2px 0 0; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; }
.plan-tile .plan-stats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.plan-tile .plan-stats .badge { padding: 0 6px; font-size: .7rem; }
.plan-tile .plan-targets, .plan-tile .plan-room { margin-top: 2px; }
.plan-tile .plan-acts { display: flex; gap: 6px; padding: 0 14px 10px; }

/* ـــ ما لم يُتحقَّق منه في الحضور يُبيَّن بلونه (ملاحظة ٣٧٥) */
.sub.bad { color: var(--bad, #c06c6c); }

/* ـــ بطاقةُ الخطة: العمودُ يمتدُّ فلا يتكوَّم النصُّ في الوسط (٣٦٠) */
.plan-head .row > .grow { flex: 1 1 auto; min-width: 0; }
.plan-head .row.wrap > .grow { min-width: 220px; }

/* ـــ لائحةُ طباعة البطاقات مقسَّمةٌ بالفرق (ملاحظة ٣٩٤) */
.pick-team + .pick-team { margin-top: 8px; border-top: 1px solid var(--border);
  padding-top: 8px; }
.pick-team-head { font-size: .9rem; padding: 2px 0; }
.pick-team-body { display: grid; gap: 2px; padding-inline-start: 18px; }


/* ـــ محطّاتُ المصمِّم: تُقلَّب كما يُقلَّب الكتاب (ملاحظتا ٣٧٧ و٣٩٢) */
.bd-steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; }
.bd-step { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font: inherit; font-size: .82rem;
  cursor: pointer; }
.bd-step.on { background: var(--gold); border-color: var(--gold); color: var(--ink);
  font-weight: 700; }
.bd-nav { margin-bottom: 8px; gap: 8px; }
.bd-station { font-size: 1rem; color: var(--accent-text); }
.bd-savebar { margin-top: 10px; gap: 8px; }

/* خلفيةٌ وأشكالٌ وشريطٌ وعلامةٌ مائيةٌ في المعاينة (ملاحظتا ٣٩٠ و٣٩١) */
.bd-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.bd-sh { position: absolute; z-index: 2; }
.bd-band { position: absolute; inset-inline: 0; z-index: 2; }
.bd-wm { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; z-index: 1; pointer-events: none; }
/* والعلامةُ المائية تُحدَّد كغيرها في المصمِّم (ملاحظة ٤٤٣) */
.bd-sheet .bd-wm.bd-obj { pointer-events: auto; }
.bd-wm img { height: auto; }

/* ـــ قوالبُ التصدير ومحرِّرُ الكليشة (ملاحظتا ٤٠٩ و٤١٢) */
.tpl-row { padding: 10px 12px; align-items: center; align-self: stretch; width: 100%; }
.lh-sheet { position: relative; width: 100%; max-width: 440px; margin: 0 auto; aspect-ratio: 210 / 297;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,.28); }
.lh-sheet .lh-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.lh-win { position: absolute; border: 2px dashed var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, transparent); }
/* شريطُ رقم الصفحة وفسحةُ الأمان: ما لا يُكتَب فيه (ملاحظة ٤٢٣) */
.lh-strip { position: absolute; border: 1px dashed rgb(188 150 97 / 55%); border-top: 0;
  display: flex; align-items: center; justify-content: center; }
.lh-strip span { font-size: .56rem; color: #6b6257; }
.lh-safe { position: absolute; border: 1px dotted rgb(188 150 97 / 35%); border-top: 0;
  background: repeating-linear-gradient(45deg, transparent 0 4px,
    rgb(188 150 97 / 10%) 4px 8px); }

/* ـــ التصديرُ المجمَّع: لغاتٌ في شبكةٍ وعدّادٌ تحتها (ملاحظة ٤١٣) */
.bulk-langs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 4px 10px; max-height: 240px; overflow: auto; padding: 6px;
  border: 1px solid var(--border); border-radius: 8px; }
.bulk-lang { margin: 0; }
.bulk-count { padding: 6px 8px; border-radius: 8px;
  background: color-mix(in srgb, var(--gold) 14%, transparent); }

/* ـــ أيقوناتُ الصفِّ: فاصلٌ قبل التعطيل والحذف، ولونٌ يُنبئ (ملاحظتا ٤٠٣ و٤٠٤) */
.row-acts { display: inline-flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.row-sep { width: 1px; align-self: stretch; min-height: 20px; margin: 0 6px;
  background: var(--border); }
.icon-btn.row-act { padding: 3px 5px; border-radius: 7px; }
.icon-btn.row-act:hover { background: color-mix(in srgb, var(--gold) 16%, transparent); }
.icon-btn.row-act.on { color: var(--ok, #2f6b52); }
.icon-btn.row-act.off { color: var(--bad, #b3261e); }
.icon-btn.row-act.warn { color: var(--warn, #8a6f3c); }
.icon-btn.row-act.danger { color: var(--bad, #b3261e); }

/* ـــ قائمةُ الطباعة: ثلاثةُ فرقٍ في صفٍّ، وأسماؤها خلف سهم (ملاحظة ٤٠٢) */
.pick-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px; align-items: start; }
.pick-team { border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--bg); }
.pick-team-head { display: flex; align-items: center; gap: 6px; padding: 7px 10px;
  background: color-mix(in srgb, var(--gold) 12%, transparent); }
.pick-team-head .check { margin: 0; flex: 1 1 auto; }
.pick-team-body { padding: 6px 10px 10px; display: grid; gap: 2px;
  max-height: 320px; overflow: auto; }
.pick-search input { width: 100%; }
.pick-team.shut .pick-team-body { display: none; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 3px; }

/* ـــ لوحةُ الإعدادات الواحدة الثابتة (ملاحظات ٤٠٠ و٤٠١ و٤١٠)
   ثلاثةُ أقسامٍ بعرضٍ واحد، والإطارُ لا يتغيّر حجمُه باختلاف القائمة. */
.uni-wrap { --uni-w: 100%; --uni-h: 420px;
  display: grid; justify-items: center; gap: 12px; }
.uni-wrap > * { width: min(100%, var(--uni-w)); }
.uni-stage { display: block; width: 100%; overflow: auto; }
.uni-bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 6px; direction: rtl; }
.uni-tool { display: grid; gap: 2px; justify-items: center; text-align: center;
  padding: 7px 4px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); cursor: pointer; min-width: 0;
  position: relative; }
.uni-tool:hover { border-color: var(--gold); }
.uni-tool.on { border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 16%, var(--surface)); }
/* مؤشِّرٌ صغيرٌ يصل القائمةَ المفتوحةَ بإطارها أسفلها */
.uni-tool.on::after { content: ''; position: absolute; bottom: -10px; inset-inline-start: 50%;
  width: 10px; height: 10px; transform: translateX(50%) rotate(45deg);
  background: color-mix(in srgb, var(--gold) 16%, var(--surface));
  border-inline-start: 1px solid var(--gold); border-top: 1px solid var(--gold); }
.uni-tool-icon { font-size: 1.15rem; line-height: 1.1; color: var(--gold); }
.uni-tool { min-height: 58px; }
.uni-tool b { font-size: .76rem; line-height: 1.2; white-space: normal; max-width: 100%;
  overflow-wrap: anywhere; }
.uni-panel { height: var(--uni-h); display: grid; grid-template-rows: auto 1fr auto;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  overflow: hidden; }
.uni-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline;
  gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--gold) 9%, var(--surface)); }
.uni-body { overflow-y: auto; overflow-x: hidden; padding: 12px;
  display: grid; align-content: start; gap: 10px; }
.uni-body > .stack, .uni-body > div { min-width: 0; }
/* حقولُ القائمة في عمودين أو ثلاثة بحسب العرض، والطويلُ يمتدّ */
.uni-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 12px; align-items: end; }
.uni-grid .wide { grid-column: 1 / -1; }
.uni-foot:empty { display: none; }
.uni-foot { display: flex; gap: 8px; padding: 8px 12px;
  border-top: 1px solid var(--border); background: var(--bg); }
@media (max-width: 900px) {
  .uni-wrap { --uni-h: 340px; }
  .uni-bar { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  .uni-tool b { font-size: .72rem; }
}
.uni-wrap.bare { --uni-h: 460px; gap: 10px; }
.uni-wrap.bare > * { width: 100%; }
.uni-wrap.bare .uni-bar { grid-auto-flow: row;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }

/* ------------------------------------------------------------------
   الحسابُ الموقَف عن العمل: يُعرَف من نظرةٍ (ملاحظتا ٤٤٩ و٤٥١)
------------------------------------------------------------------- */
tr.row-off > td { opacity: .72; }
tr.row-off { background: color-mix(in srgb, var(--bad, #b4453c) 6%, transparent); }
tr.row-off .name-link, tr.row-off > td:first-child b { text-decoration: line-through;
  text-decoration-thickness: 1px; }
.off-tag { margin-inline-start: 6px; vertical-align: middle; }
.row-acts .act-on { white-space: nowrap; }

/* شريطُ «وردَ تعديلٌ على الأصل» في شاشة العمل (ملاحظتا ٤٦٠ و٤٦١) */
.notice-bar { border-color: #b4453c; border-inline-start: 4px solid #b4453c;
  background: color-mix(in srgb, #b4453c 8%, transparent); margin-bottom: 16px; }
.notice-bar b { color: #b4453c; }
