/* Midrak Material 3 - one stylesheet for midrak.net (blue brand) and ai.midrak.net (black/white brand).
   The mono palette is the app's own "Midrak M3" theme (ui/styles/themes/appearance-v2.css);
   the blue brand keeps the same surfaces and adds a blue accent. Logical properties throughout, so RTL is free. */

@font-face { font-family: "Inter"; src: url(/_shared/fonts/inter-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; src: url(/_shared/fonts/space-grotesk-latin-wght-normal.woff2) format("woff2"); font-weight: 300 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Plex Arabic"; src: url(/_shared/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; src: url(/_shared/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format("woff2"); font-weight: 500 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; src: url(/_shared/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format("woff2"); font-weight: 700 900; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

/* ───────────────────────── tokens: mono brand (ai.midrak.net) ───────────────────────── */
:root {
  color-scheme: light dark;
  --font: "Inter", "Plex Arabic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  --font-display: "Space Grotesk", "Plex Arabic", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #fcfcfe; --surface: #f3f3f6; --surface-2: #ececf0; --surface-3: #e5e5ea; --surface-4: #dcdce2; --elev: #ffffff;
  --on-bg: #1b1b1f; --on-strong: #111114; --on-dim: #46464c; --on-faint: #77777d;
  --outline: #c8c8ce; --outline-soft: #e1e1e6;
  --primary: #45464f; --on-primary: #fcfcfe; --primary-c: #e2e2ea; --on-primary-c: #1b1b1f;
  --accent-glow: rgba(69, 70, 79, .18);
  --danger: #b3261e; --danger-c: #f9dedc; --ok: #2b7a4b; --ok-c: #d9f0e2; --warn: #8a6100; --warn-c: #fbecc6;
  --scrim: rgba(10, 10, 14, .5);
  --shadow-1: 0 1px 2px rgba(20,20,30,.12), 0 1px 3px 1px rgba(20,20,30,.08);
  --shadow-2: 0 2px 6px 2px rgba(20,20,30,.1), 0 1px 2px rgba(20,20,30,.14);
  --shadow-3: 0 6px 18px 4px rgba(20,20,30,.12), 0 2px 4px rgba(20,20,30,.14);

  --r-xs: 6px; --r-s: 10px; --r-m: 14px; --r-l: 20px; --r-xl: 28px; --r-full: 999px;
  --ease: cubic-bezier(.2, 0, 0, 1); --ease-emph: cubic-bezier(.2, .8, .2, 1);
  --bar-h: 64px; --page-w: 1200px; --gut: 24px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1b1d; --surface: #202022; --surface-2: #28282b; --surface-3: #2d2d31; --surface-4: #343438; --elev: #252528;
    --on-bg: #e5e4e8; --on-strong: #f6f5f9; --on-dim: #c4c3c9; --on-faint: #909096;
    --outline: #46464b; --outline-soft: #313135;
    --primary: #d0d1d9; --on-primary: #1b1b1d; --primary-c: #3a3a40; --on-primary-c: #e5e4e8;
    --accent-glow: rgba(208, 209, 217, .14);
    --danger: #f2b8b5; --danger-c: #4a2321; --ok: #8fd5a6; --ok-c: #1c3a28; --warn: #e6c976; --warn-c: #3d3213;
    --scrim: rgba(0, 0, 0, .62);
    --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px 1px rgba(0,0,0,.25);
    --shadow-2: 0 2px 6px 2px rgba(0,0,0,.32), 0 1px 2px rgba(0,0,0,.5);
    --shadow-3: 0 6px 18px 4px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg: #1b1b1d; --surface: #202022; --surface-2: #28282b; --surface-3: #2d2d31; --surface-4: #343438; --elev: #252528;
  --on-bg: #e5e4e8; --on-strong: #f6f5f9; --on-dim: #c4c3c9; --on-faint: #909096;
  --outline: #46464b; --outline-soft: #313135;
  --primary: #d0d1d9; --on-primary: #1b1b1d; --primary-c: #3a3a40; --on-primary-c: #e5e4e8;
  --accent-glow: rgba(208, 209, 217, .14);
  --danger: #f2b8b5; --danger-c: #4a2321; --ok: #8fd5a6; --ok-c: #1c3a28; --warn: #e6c976; --warn-c: #3d3213;
  --scrim: rgba(0, 0, 0, .62);
  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px 1px rgba(0,0,0,.25);
  --shadow-2: 0 2px 6px 2px rgba(0,0,0,.32), 0 1px 2px rgba(0,0,0,.5);
  --shadow-3: 0 6px 18px 4px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.5);
}

/* ───────────────────────── tokens: blue brand (midrak.net) ─────────────────────────
   White, black and blue: neutral surfaces, a vivid blue for everything that acts. */
:root[data-brand="blue"] {
  --bg: #ffffff; --surface: #f5f7fc; --surface-2: #edf1fa; --surface-3: #e3e9f6; --surface-4: #d6dff2; --elev: #ffffff;
  --on-bg: #0b0d12; --on-strong: #000000; --on-dim: #3c4352; --on-faint: #6b7385;
  --outline: #c3cadb; --outline-soft: #e1e6f1;
  --primary: #1a5cff; --on-primary: #ffffff; --primary-c: #d9e4ff; --on-primary-c: #001a4d;
  --accent-glow: rgba(26, 92, 255, .22);
}
@media (prefers-color-scheme: dark) {
  :root[data-brand="blue"]:not([data-theme="light"]) {
    --bg: #05060a; --surface: #0b0d14; --surface-2: #11141e; --surface-3: #171b28; --surface-4: #1e2333; --elev: #0f121b;
    --on-bg: #e9ecf4; --on-strong: #ffffff; --on-dim: #b6bccd; --on-faint: #7f879b;
    --outline: #2b3144; --outline-soft: #1a1e2c;
    --primary: #6f9bff; --on-primary: #00133a; --primary-c: #12307a; --on-primary-c: #d9e4ff;
    --accent-glow: rgba(111, 155, 255, .28);
  }
}
:root[data-brand="blue"][data-theme="dark"] {
  --bg: #05060a; --surface: #0b0d14; --surface-2: #11141e; --surface-3: #171b28; --surface-4: #1e2333; --elev: #0f121b;
  --on-bg: #e9ecf4; --on-strong: #ffffff; --on-dim: #b6bccd; --on-faint: #7f879b;
  --outline: #2b3144; --outline-soft: #1a1e2c;
  --primary: #6f9bff; --on-primary: #00133a; --primary-c: #12307a; --on-primary-c: #d9e4ff;
  --accent-glow: rgba(111, 155, 255, .28);
}

/* ───────────────────────── base ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--on-bg); font: 400 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; min-height: 100vh; display: flex; flex-direction: column; }
html[lang="ar"] body { line-height: 1.85; letter-spacing: 0; }
main { flex: 1 0 auto; }
img, svg { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--primary); color: var(--on-primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--on-strong); margin: 0 0 .5em; line-height: 1.15; letter-spacing: -.02em; font-weight: 600; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 { letter-spacing: 0; line-height: 1.4; font-weight: 700; }
p { margin: 0 0 1em; }
code, kbd, pre { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface-2); padding: .12em .45em; border-radius: 6px; }
pre { background: var(--surface); border: 1px solid var(--outline-soft); border-radius: var(--r-m); padding: 16px 18px; overflow-x: auto; line-height: 1.6; direction: ltr; text-align: left; margin: 0 0 1.2em; }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--outline-soft); margin: 32px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: var(--page-w); margin-inline: auto; padding-inline: var(--gut); }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--on-dim); }
.faint { color: var(--on-faint); }
.mono { font-family: var(--mono); }
.ltr { direction: ltr; unicode-bidi: isolate; }
[hidden] { display: none !important; }

/* type scale */
.display { font-size: clamp(2.6rem, 6.4vw, 5.2rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.02; }
.headline { font-size: clamp(1.8rem, 3.6vw, 2.9rem); }
.title { font-size: 1.3rem; font-weight: 600; letter-spacing: -.01em; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--on-dim); max-width: 62ch; }
.eyebrow { font: 600 .78rem/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--primary); margin-bottom: 14px; display: inline-block; }
html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: .9rem; }
html[lang="ar"] .display { letter-spacing: 0; line-height: 1.25; }

/* ───────────────────────── app bar ───────────────────────── */
.appbar { position: sticky; inset-block-start: 0; z-index: 50; height: var(--bar-h); background: color-mix(in oklab, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px); border-block-end: 1px solid transparent; transition: border-color .2s var(--ease), background .2s var(--ease); }
.appbar.scrolled { border-block-end-color: var(--outline-soft); background: color-mix(in oklab, var(--bg) 92%, transparent); }
.appbar .container { display: flex; align-items: center; gap: 8px; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--on-strong); font-weight: 700; letter-spacing: -.01em; text-decoration: none !important; }
.brand svg { height: 26px; width: auto; color: var(--on-strong); }
.brand small { font: 500 .72rem/1 var(--font); color: var(--on-faint); padding: 4px 8px; border: 1px solid var(--outline); border-radius: var(--r-full); }
.nav { display: flex; gap: 2px; margin-inline-start: 18px; }
.nav a { color: var(--on-dim); padding: 8px 14px; border-radius: var(--r-full); font-weight: 500; font-size: .94rem; text-decoration: none; transition: background .15s var(--ease), color .15s var(--ease); }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-3); color: var(--on-strong); }
.spacer { flex: 1; }
.icon-btn.menu-btn { display: none; }
@media (max-width: 860px) {
  .nav { display: none; position: fixed; inset: var(--bar-h) 0 auto 0; flex-direction: column; background: var(--bg); padding: 12px var(--gut) 20px; border-block-end: 1px solid var(--outline-soft); margin: 0; box-shadow: var(--shadow-3); }
  .nav.open { display: flex; }
  .nav a { padding: 14px 12px; font-size: 1.05rem; }
  .icon-btn.menu-btn { display: inline-flex; }
  .brand small { display: none; }
}

/* ───────────────────────── buttons ───────────────────────── */
.btn, .icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font: 600 .95rem/1 var(--font); letter-spacing: .01em; text-decoration: none !important; user-select: none; -webkit-tap-highlight-color: transparent; transition: border-radius .2s var(--ease-emph), box-shadow .2s var(--ease), background .15s var(--ease), transform .1s var(--ease); isolation: isolate; }
.btn { height: 44px; padding-inline: 24px; border-radius: var(--r-full); }
.btn.lg { height: 54px; padding-inline: 32px; font-size: 1.02rem; }
.btn.sm { height: 34px; padding-inline: 16px; font-size: .85rem; }
.btn::before, .icon-btn::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity .15s var(--ease); z-index: -1; }
.btn:hover::before, .icon-btn:hover::before { opacity: .08; }
.btn:active::before, .icon-btn:active::before { opacity: .14; }
.btn:active { border-radius: var(--r-m); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn-filled { background: var(--primary); color: var(--on-primary); }
.btn-filled:hover { box-shadow: var(--shadow-1); }
.btn-tonal { background: var(--primary-c); color: var(--on-primary-c); }
.btn-outlined { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1px var(--outline); }
.btn-text { background: transparent; color: var(--primary); padding-inline: 14px; }
.btn-danger { background: var(--danger); color: var(--bg); }
.btn-danger-text { background: transparent; color: var(--danger); }
.btn svg { width: 20px; height: 20px; flex: none; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-full); background: transparent; color: var(--on-dim); }
.icon-btn:hover { color: var(--on-strong); }
.icon-btn svg { width: 22px; height: 22px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn .spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────────────────── surfaces ───────────────────────── */
.card { background: var(--surface); border-radius: var(--r-l); padding: 24px; position: relative; }
.card.elevated { background: var(--elev); box-shadow: var(--shadow-1); }
.card.outlined { background: transparent; box-shadow: inset 0 0 0 1px var(--outline-soft); }
.card.link { display: block; color: inherit; text-decoration: none !important; transition: transform .25s var(--ease-emph), background .2s var(--ease), box-shadow .25s var(--ease); }
.card.link:hover { background: var(--surface-2); transform: translateY(-3px); box-shadow: var(--shadow-2); }
.card h3 { font-size: 1.25rem; margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card .ico { width: 48px; height: 48px; border-radius: var(--r-m); background: var(--primary-c); color: var(--on-primary-c); display: grid; place-items: center; margin-bottom: 18px; }
.card .ico svg { width: 26px; height: 26px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 900px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } :root { --gut: 16px; } }
.section { padding-block: clamp(56px, 9vw, 112px); }
.section.tight { padding-block: clamp(32px, 5vw, 64px); }
.section-head { max-width: 760px; margin-bottom: 44px; }
.section-head.center { margin-inline: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding-inline: 14px; border-radius: var(--r-s); box-shadow: inset 0 0 0 1px var(--outline); color: var(--on-dim); font-size: .85rem; font-weight: 500; background: transparent; }
.chip.tonal { background: var(--surface-3); box-shadow: none; }
.chip svg { width: 16px; height: 16px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--r-full); font-size: .8rem; font-weight: 600; background: var(--primary-c); color: var(--on-primary-c); }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* ───────────────────────── forms ───────────────────────── */
.field { position: relative; margin-bottom: 18px; }
.field input, .field textarea, .field select { width: 100%; height: 56px; padding: 22px 16px 8px; background: transparent; color: var(--on-bg); font: 400 1rem var(--font); border: 1px solid var(--outline); border-radius: var(--r-xs); outline: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.field select { padding-block: 16px 6px; }
.field label { position: absolute; inset-inline-start: 16px; top: 17px; color: var(--on-faint); pointer-events: none; transition: all .15s var(--ease); font-size: 1rem; transform-origin: left top; background: transparent; }
html[dir="rtl"] .field label { transform-origin: right top; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.field input:focus + label, .field input:not(:placeholder-shown) + label, .field select + label { top: 8px; font-size: .74rem; color: var(--on-faint); }
.field input:focus + label { color: var(--primary); }
.field.err input { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.field .hint { font-size: .8rem; color: var(--on-faint); padding: 6px 16px 0; }
.field .reveal-pw { position: absolute; inset-inline-end: 6px; top: 8px; }
.field input[type="password"], .field input[type="email"], .field input[dir="ltr"] { direction: ltr; text-align: start; }
html[dir="rtl"] .field input[type="password"], html[dir="rtl"] .field input[type="email"] { text-align: right; }
.code-input input { font: 700 1.8rem/1 var(--mono); letter-spacing: .5em; text-align: center; height: 72px; padding-block: 8px; direction: ltr; }
.divider { display: flex; align-items: center; gap: 14px; color: var(--on-faint); font-size: .85rem; margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--outline-soft); }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-m); background: var(--surface-2); color: var(--on-bg); font-size: .92rem; margin-bottom: 18px; }
.banner.error { background: var(--danger-c); color: var(--danger); }
.banner.ok { background: var(--ok-c); color: var(--ok); }
.banner.warn { background: var(--warn-c); color: var(--warn); }
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.banner p { margin: 0; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 2; }
.switch span { position: absolute; inset: 0; background: var(--surface-4); border-radius: var(--r-full); box-shadow: inset 0 0 0 2px var(--outline); transition: all .2s var(--ease); }
.switch span::after { content: ""; position: absolute; inset-block-start: 8px; inset-inline-start: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--outline); transition: all .2s var(--ease-emph); }
.switch input:checked + span { background: var(--primary); box-shadow: none; }
.switch input:checked + span::after { width: 24px; height: 24px; inset-block-start: 4px; inset-inline-start: 24px; background: var(--on-primary); }

/* ───────────────────────── lists, avatar, dialog, toast ───────────────────────── */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 16px; padding: 14px 4px; border-block-end: 1px solid var(--outline-soft); }
.list-item:last-child { border-block-end: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; color: var(--on-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .s { font-size: .85rem; color: var(--on-faint); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-c); color: var(--on-primary-c); display: inline-grid; place-items: center; font-weight: 700; flex: none; overflow: hidden; font-size: .95rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xl { width: 96px; height: 96px; font-size: 2rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.2rem; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--on-faint); flex: none; }
.status-dot.online { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in oklab, var(--ok) 25%, transparent); }
.status-dot.recent { background: var(--warn); }
.dialog-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .18s var(--ease); }
.dialog { background: var(--elev); border-radius: var(--r-xl); padding: 28px; width: min(480px, 100%); box-shadow: var(--shadow-3); animation: rise .25s var(--ease-emph); max-height: 90vh; overflow: auto; }
.dialog h3 { font-size: 1.4rem; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.toast { position: fixed; inset-block-end: 24px; inset-inline: 0; margin-inline: auto; width: max-content; max-width: calc(100vw - 32px); background: var(--on-strong); color: var(--bg); padding: 14px 22px; border-radius: var(--r-s); box-shadow: var(--shadow-3); z-index: 200; font-size: .95rem; animation: rise .25s var(--ease-emph); }
.tabs { display: flex; gap: 4px; border-block-end: 1px solid var(--outline-soft); margin-bottom: 28px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; color: var(--on-dim); font: 600 .95rem var(--font); padding: 14px 18px; cursor: pointer; position: relative; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--primary); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; inset-inline: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }
.tabs button:hover { color: var(--on-strong); }

/* ───────────────────────── footer ───────────────────────── */
.footer { border-block-start: 1px solid var(--outline-soft); background: var(--surface); padding-block: 48px 36px; margin-block-start: 40px; }
.footer .cols { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.footer h4 { font: 600 .82rem var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--on-faint); margin-bottom: 14px; }
html[lang="ar"] .footer h4 { letter-spacing: 0; text-transform: none; font-size: .95rem; }
.footer a { display: block; color: var(--on-dim); padding: 5px 0; font-size: .94rem; }
.footer a:hover { color: var(--on-strong); }
.footer .brand svg { height: 30px; }
.footer .fine { margin-block-start: 36px; padding-block-start: 22px; border-block-start: 1px solid var(--outline-soft); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--on-faint); font-size: .85rem; }
@media (max-width: 760px) { .footer .cols { grid-template-columns: 1fr 1fr; } .footer .cols > :first-child { grid-column: 1 / -1; } }

/* a page written once per language (the legal pages): the wrong one is not drawn */
html[lang="ar"] .lang-en, html[lang="en"] .lang-ar { display: none; }
.legal { max-width: 780px; }
.legal h2 { font-size: 1.35rem; margin-top: 2.2em; }
.legal ul { padding-inline-start: 1.3em; } .legal li { margin-bottom: .45em; }
.legal .stamp { color: var(--on-faint); font-size: .9rem; }

/* ───────────────────────── motion ───────────────────────── */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease-emph); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
.no-js .reveal { opacity: 1; transform: none; }

/* ───────────────────────── logo (drawn from the brand SVG, tinted by the text colour) ───────────────────────── */
.logo, .mark { display: inline-block; background: currentColor; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.logo { -webkit-mask-image: url(/_shared/logo.svg); mask-image: url(/_shared/logo.svg); aspect-ratio: 5946 / 1620; }
.mark { -webkit-mask-image: url(/_shared/mark.svg); mask-image: url(/_shared/mark.svg); aspect-ratio: 2012.8 / 1304.3; }
.brand .mark { height: 22px; }
.menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 240px; background: var(--elev); border-radius: var(--r-m); box-shadow: var(--shadow-3), inset 0 0 0 1px var(--outline-soft); padding: 8px; z-index: 60; animation: rise .18s var(--ease-emph); }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--r-s); background: none; border: 0; color: var(--on-bg); font: 500 .94rem var(--font); cursor: pointer; text-decoration: none !important; text-align: start; }
.menu a:hover, .menu button:hover { background: var(--surface-3); }
.menu .who { padding: 12px 14px 10px; border-block-end: 1px solid var(--outline-soft); margin-bottom: 6px; }
.menu .who b { display: block; color: var(--on-strong); } .menu .who span { font-size: .82rem; color: var(--on-faint); word-break: break-all; }
.menu svg { width: 20px; height: 20px; color: var(--on-faint); }
.has-menu { position: relative; }
