@import url("/ds/bf-tokens.css"); /* bf-ds v2 */
/* قوّتها — مسار الحركة · ثيم نهاري هادئ (أكتوبر 2026)
   مستلهم من الرمادي الفاتح والبنفسجي واللافندر والخوخي، مع تباين محسوب للنص العربي.
   أزواج التباين الأساسية (WCAG 1.4.3): --ink على --bg ≈ 13.3:1، --ink-2 على --bg ≈ 7.2:1، حدود الحقول ≈ 3.8:1،
   --plum على --bg ≈ 9.7:1، نص --peach-ink على --peach ≈ 9:1. لا يضمن ذلك راحة كل عين. */

:root {
  color-scheme: light;
  --bg: #f1eff1;
  --bg-deep: #e8e3e9;
  --surface: #faf8fa;
  --surface-2: #f4eff5;
  --ink: #2b232d;
  --ink-2: #554b57;
  --line: #d6ccd8;
  --line-strong: #857389;
  --plum: #49354b;
  --plum-2: #5d4560;
  --plum-ink: #fbf5fb;
  --lavender: #d4afd7;
  --lavender-soft: #efe3f0;
  --peach: #ffb06b;
  --peach-soft: #ffe8d3;
  --peach-ink: #241b25;
  --ok: #2f5d45;
  --ok-soft: #e4f0e8;
  --warn: #6e4300;
  --warn-soft: #fff0d9;
  --danger: #8a2526;
  --danger-soft: #fbe7e6;
  --focus: #49354b;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(43, 35, 45, .06), 0 12px 32px rgba(73, 53, 75, .08);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --font-display: "Amiri", "IBM Plex Sans Arabic", Georgia, serif;
  --measure: 70ch;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  font-size: 100%;
}
html.text-lg { font-size: 118.75%; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 1.0625rem; line-height: 1.9; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--plum); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--plum-2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; box-shadow: 0 0 0 6px rgba(255, 176, 107, .45); }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .6em; color: var(--ink); }
h1 { font-family: var(--font-display); font-size: clamp(2.2rem, 1.6rem + 3vw, 3.7rem); line-height: 1.2; font-weight: 700; }
h2 { font-family: var(--font-display); font-size: clamp(1.55rem, 1.3rem + 1.2vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: var(--measure); }
ul, ol { padding-inline-start: 1.3em; margin: 0 0 1em; }
li { margin-bottom: .35em; }
small { font-size: .9rem; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; background: var(--plum); color: var(--plum-ink); padding: 10px 16px; border-radius: 10px; }
.skip-link:focus { top: 12px; }
[hidden] { display: none !important; }

/* ---------- Header ---------- */
.mv-header { position: sticky; top: 0; z-index: 20; background: rgba(241, 239, 241, .94); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.2) blur(8px); }
.mv-header-inner { max-width: var(--wrap); margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; gap: 14px; }
.mv-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-height: 44px; }
.mv-brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--plum); color: var(--peach); display: grid; place-items: center; flex: none; }
.mv-brand-mark svg { width: 26px; height: 26px; }
.mv-brand span { display: grid; line-height: 1.3; }
.mv-brand strong { font-size: 1.05rem; }
.mv-brand small { color: var(--ink-2); font-size: .8rem; }
.mv-nav { display: flex; gap: 2px; margin-inline-start: auto; flex-wrap: wrap; }
.mv-nav a { color: var(--ink); text-decoration: none; padding: 8px 11px; border-radius: 999px; font-size: .95rem; min-height: 40px; display: inline-flex; align-items: center; }
.mv-nav a:hover { background: var(--lavender-soft); }
.mv-nav a[aria-current="page"] { background: var(--plum); color: var(--plum-ink); }
.mv-tools { display: flex; align-items: center; gap: 8px; }
.mv-tool { font: inherit; font-size: .88rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 12px; min-height: 40px; cursor: pointer; }
.mv-tool[aria-pressed="true"] { background: var(--lavender-soft); border-color: var(--plum); }
.mv-menu { display: none; }
@media (max-width: 1060px) {
  .mv-header-inner { flex-wrap: wrap; }
  .mv-menu { display: inline-flex; margin-inline-start: auto; }
  .mv-nav { display: none; width: 100%; order: 3; flex-direction: column; padding: 6px 0 4px; }
  .mv-nav.is-open { display: flex; }
  .mv-nav a { border-radius: 12px; padding: 12px 14px; }
  .mv-tools { order: 2; }
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
main { display: block; }
.section { padding-block: clamp(36px, 6vw, 72px); }
.section + .section { border-top: 1px solid var(--line); }
.eyebrow { color: var(--plum-2); font-weight: 700; font-size: .92rem; letter-spacing: 0; margin-bottom: .5em; }
.lead { font-size: 1.18rem; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.section-head { display: grid; gap: 4px; margin-bottom: 26px; max-width: 820px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }

/* ---------- Hero ---------- */
.hero { display: grid; gap: clamp(24px, 4vw, 56px); grid-template-columns: 1.25fr .9fr; align-items: center; padding-block: clamp(36px, 7vw, 84px) clamp(28px, 5vw, 56px); }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 26px; box-shadow: var(--shadow); }
.hero-card .art { color: var(--plum); width: 100%; height: auto; display: block; margin-bottom: 12px; }
.page-hero { padding-block: clamp(30px, 6vw, 64px) 18px; max-width: 900px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.btn { font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: 999px; border: 2px solid var(--plum); background: var(--plum); color: var(--plum-ink); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--plum-2); color: var(--plum-ink); }
.btn-peach { background: var(--peach); border-color: var(--peach); color: var(--peach-ink); }
.btn-peach:hover { background: #ffa252; color: var(--peach-ink); }
.btn-quiet { background: transparent; color: var(--plum); }
.btn-quiet:hover { background: var(--lavender-soft); color: var(--plum); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-sm { min-height: 40px; padding: 6px 14px; font-size: .92rem; }
button:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .4em; }
.card > :last-child { margin-bottom: 0; }
.card-link { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.card-link:hover { border-color: var(--plum); }
.card-link b { color: var(--plum); margin-top: auto; padding-top: 10px; }
.num { display: inline-block; font-weight: 700; color: var(--plum-2); background: var(--lavender-soft); border-radius: 999px; padding: 2px 12px; font-size: .88rem; margin-bottom: 10px; }
.tag { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 11px; font-size: .84rem; font-weight: 700; border: 1px solid transparent; }
.tag-guideline { background: var(--ok-soft); color: var(--ok); border-color: #b8d3c2; }
.tag-design { background: var(--lavender-soft); color: var(--plum); border-color: #d9c2dc; }
.tag-open { background: var(--warn-soft); color: var(--warn); border-color: #ecd0a3; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 18px; }

/* ---------- Notices ---------- */
.notice { border-radius: var(--radius-sm); padding: 14px 18px; border: 1px solid var(--line); background: var(--surface-2); margin: 16px 0; }
.notice > :last-child { margin-bottom: 0; }
.notice-danger { background: var(--danger-soft); border-color: #e5b3b1; color: #4a1314; }
.notice-danger strong { color: var(--danger); }
.notice-warn { background: var(--warn-soft); border-color: #ecd0a3; }
.notice-ok { background: var(--ok-soft); border-color: #b8d3c2; }
.notice-plum { background: var(--plum); color: var(--plum-ink); border: 0; }
.notice-plum a { color: var(--peach); }
.scope { font-size: .95rem; color: var(--ink-2); }

/* ---------- Journey stepper ---------- */
.journey { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; counter-reset: step; }
.journey li { margin: 0; }
.journey a { display: grid; gap: 2px; height: 100%; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 14px; font-size: .92rem; line-height: 1.5; }
.journey a::before { counter-increment: step; content: counter(step, arabic-indic); font-weight: 700; color: var(--plum-2); background: var(--lavender-soft); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px; }
.journey a:hover { border-color: var(--plum); }
.journey a[aria-current="step"] { background: var(--plum); color: var(--plum-ink); border-color: var(--plum); }
.journey a[aria-current="step"]::before { background: var(--peach); color: var(--peach-ink); }
.journey small { color: inherit; opacity: .85; font-size: .82rem; }
@media (max-width: 1000px) { .journey { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .journey { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; }
  .journey li { flex: 0 0 128px; scroll-snap-align: start; }
}
.journey-mini { margin: 10px 0 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: .97rem; }
th, td { text-align: start; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); line-height: 1.75; }
th { background: var(--surface-2); color: var(--ink); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
caption { text-align: start; padding: 12px 14px; color: var(--ink-2); caption-side: bottom; font-size: .9rem; }

/* ---------- Details / accordions ---------- */
details.fold { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 18px; }
details.fold + details.fold { margin-top: 10px; }
details.fold summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 48px; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: "+"; font-size: 1.4rem; color: var(--plum); line-height: 1; }
details.fold[open] summary::after { content: "−"; }
details.fold[open] { padding-bottom: 16px; }

/* ---------- Exercise cards ---------- */
.ex-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); scroll-margin-top: 100px; }
.ex-card header { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.ex-card h3 { font-size: 1.25rem; }
.ex-meta { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-top: 12px; }
.ex-meta div { background: var(--surface-2); border-radius: 12px; padding: 10px 14px; }
.ex-meta dt, .ex-meta strong { display: block; color: var(--plum-2); font-weight: 700; font-size: .9rem; }
.ex-meta dd { margin: 0; }
.ex-stop { background: var(--danger-soft); border-radius: 12px; padding: 10px 14px; margin-top: 10px; color: #4a1314; }

/* ---------- Forms ---------- */
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; margin: 0 0 18px; background: var(--surface); }
legend { font-weight: 700; font-size: 1.1rem; padding: 0 8px; color: var(--ink); }
.q { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.q:last-child { border-bottom: 0; }
.q > p, .q > label.q-text, .q-text { font-weight: 600; margin-bottom: 8px; display: block; max-width: none; }
.q-hint { font-size: .9rem; color: var(--ink-2); margin: -4px 0 8px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--bg); border-radius: 999px; padding: 6px 14px; min-height: 44px; cursor: pointer; }
.choices label:has(input:checked) { background: var(--plum); color: var(--plum-ink); border-color: var(--plum); }
.choices input { accent-color: var(--plum); width: 18px; height: 18px; margin: 0; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-weight: 600; }
input[type="text"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; min-height: 46px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
.fields { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.error-text { color: var(--danger); font-weight: 700; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.q[data-invalid="true"] { background: var(--danger-soft); border-radius: 12px; padding-inline: 10px; }

/* ---------- Tabs (app pages) ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin: 8px 0 22px; }
.tabs a, .tabs button { font: inherit; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 42px; cursor: pointer; }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { background: var(--plum); color: var(--plum-ink); border-color: var(--plum); }

/* ---------- Results / status ---------- */
.result { border-radius: var(--radius); padding: 22px; border: 2px solid var(--line); background: var(--surface); margin-top: 18px; }
.result:focus { outline: none; }
.result-urgent { border-color: var(--danger); background: var(--danger-soft); }
.result-assess { border-color: #d39a3a; background: var(--warn-soft); }
.result-clarify { border-color: var(--line-strong); background: var(--surface-2); }
.result-ok { border-color: #8fb9a0; background: var(--ok-soft); }
.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.stat strong { display: block; font-size: 1.4rem; color: var(--plum); }
.stat span { color: var(--ink-2); font-size: .92rem; }
.stat .missing { color: var(--warn); font-size: 1rem; }
.row-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.row-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }

/* ---------- Page nav & footer ---------- */
.page-nav { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); margin-block: 32px; }
.page-nav a { display: grid; gap: 2px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; }
.page-nav a:hover { border-color: var(--plum); }
.page-nav span { color: var(--plum-2); font-size: .88rem; font-weight: 700; }
.mv-footer { border-top: 1px solid var(--line); background: var(--bg-deep); margin-top: 40px; }
.mv-footer .wrap { padding-block: 26px; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; font-size: .93rem; color: var(--ink-2); }
.mv-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* ---------- Body map tabs ---------- */
.region-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.region-tabs button { font: inherit; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 16px; min-height: 44px; cursor: pointer; }
.region-tabs button[aria-selected="true"] { background: var(--plum); color: var(--plum-ink); border-color: var(--plum); }
.region-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }

dialog { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 22px; max-width: min(92vw, 520px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(43, 35, 45, .45); }
.region-tabs[hidden] + [data-region-panels] .region-panel + .region-panel { margin-top: 0; }
[data-region-panels]:not(.grid-2) { display: block; }

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: no-preference) {
  .btn, .card-link, .journey a, .page-nav a { transition: background-color .15s ease, border-color .15s ease; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .btn, .tag, .journey a { border: 1px solid CanvasText; } }
.print-only { display: none; }
@media print {
  body { background: #fff; font-size: 11pt; line-height: 1.6; }
  .mv-header, .mv-footer, .page-nav, .no-print, .tabs, bayt-global-search { display: none !important; }
  .print-only { display: block; }
  .card, .ex-card, fieldset, .result, .stat { box-shadow: none; break-inside: avoid; }
  a { color: inherit; }
}


/* bf-ds v2 map: start — يولّده _unify/sync-ds.mjs؛ لا تعدّل هنا */
:root{--bg:var(--bf-bg);--bg-deep:var(--bf-surface-3);--surface:var(--bf-surface);--surface-2:var(--bf-surface-2);--ink:var(--bf-text);--ink-2:var(--bf-text-2);--line:var(--bf-border);--line-strong:var(--bf-border-strong);--plum:var(--bf-movement);--plum-2:var(--bf-primary-hover);--plum-ink:#FFFFFF;--lavender:#B9D3CF;--lavender-soft:var(--bf-movement-tint);--peach:#E9D3B0;--peach-soft:#F6EEDF;--peach-ink:var(--bf-text);--ok:var(--bf-success);--ok-soft:var(--bf-success-tint);--warn:var(--bf-warning);--warn-soft:var(--bf-warning-tint);--danger:var(--bf-danger);--danger-soft:var(--bf-danger-tint);--focus:var(--bf-primary);--radius:var(--bf-r-card);--radius-sm:var(--bf-r-control);--shadow:var(--bf-shadow-1);--font:var(--bf-font);--font-display:var(--bf-font)}
/* bf-ds v2 map: end */
