/* =========================================================
   Blue AI — Design System
   RTL · Light / Dark · Mobile-first
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --font: 'Alexandria', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --font-head: 'Alexandria', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-read: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --bg: #F6F8FC;
  --bg-soft: #EEF2F9;
  --surface: #FFFFFF;
  --surface-2: #F8FAFD;
  --border: #E4E9F2;
  --border-2: #D2DAE7;
  --text: #0D1730;
  --text-2: #4A5672;
  --text-3: #7C879F;

  --primary: #1B2CD8;
  --primary-hover: #1422AE;
  --primary-soft: #ECEEFF;
  --primary-text: #1B2CD8;
  --ring: rgba(27, 44, 216, .28);
  --mint: #13D98C;
  --mint-soft: #E3FBF0;
  --sun: #FFD60A;
  --ink: #0E0B0D;
  --lav: #F1EFFF;
  --sky: #E9F9FD;

  --success: #0F9D6B;  --success-soft: #E5F6EE;
  --warn: #A86A12;     --warn-soft: #FFF4DE;
  --danger: #D23434;   --danger-soft: #FDECEC;

  --navy: #0E0B0D;
  --navy-2: #1A1619;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --sh-1: 0 1px 2px rgba(13, 23, 48, .06), 0 1px 1px rgba(13, 23, 48, .03);
  --sh-2: 0 6px 20px -6px rgba(13, 23, 48, .12), 0 2px 4px rgba(13, 23, 48, .04);
  --sh-3: 0 30px 70px -24px rgba(13, 23, 48, .35);

  --container: 1180px;
  --nav-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090F1F;  --bg-soft: #0D1428;  --surface: #111930;  --surface-2: #151E37;
    --border: #212B46;  --border-2: #2C3757;
    --text: #E8EDF8;  --text-2: #A6B1C9;  --text-3: #74809B;
    --primary: #5263FF;  --primary-hover: #6C7BFF;  --primary-soft: rgba(82, 99, 255, .16);  --primary-text: #9DA7FF;  --lav: #17162B;  --sky: #0F2128;  --mint-soft: rgba(19, 217, 140, .14);
    --ring: rgba(74, 123, 255, .4);
    --success: #34C48D; --success-soft: rgba(52, 196, 141, .13);
    --warn: #E5A43B;    --warn-soft: rgba(229, 164, 59, .13);
    --danger: #F06464;  --danger-soft: rgba(240, 100, 100, .13);
    --sh-1: 0 1px 2px rgba(0, 0, 0, .3);
    --sh-2: 0 8px 24px -8px rgba(0, 0, 0, .5);
    --sh-3: 0 30px 70px -24px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #090F1F;  --bg-soft: #0D1428;  --surface: #111930;  --surface-2: #151E37;
  --border: #212B46;  --border-2: #2C3757;
  --text: #E8EDF8;  --text-2: #A6B1C9;  --text-3: #74809B;
  --primary: #5263FF;  --primary-hover: #6C7BFF;  --primary-soft: rgba(82, 99, 255, .16);  --primary-text: #9DA7FF;  --lav: #17162B;  --sky: #0F2128;  --mint-soft: rgba(19, 217, 140, .14);
  --ring: rgba(74, 123, 255, .4);
  --success: #34C48D; --success-soft: rgba(52, 196, 141, .13);
  --warn: #E5A43B;    --warn-soft: rgba(229, 164, 59, .13);
  --danger: #F06464;  --danger-soft: rgba(240, 100, 100, .13);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .3);
  --sh-2: 0 8px 24px -8px rgba(0, 0, 0, .5);
  --sh-3: 0 30px 70px -24px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
.ic { display: inline-block; flex-shrink: 0; vertical-align: middle; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.3; font-weight: 600; letter-spacing: -.01em; }
ul, ol { padding: 0; list-style: none; }
code, pre { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--primary); color: #fff; }

.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 200; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: var(--r-sm); }
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.container-sm { max-width: 760px; }
.section { padding-block: 96px; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.sec-head { max-width: 680px; margin: 0 auto 56px; text-align: center; }
.sec-head h2 { font-size: clamp(28px, 4vw, 40px); margin-block: 14px 14px; }
.sec-head p { color: var(--text-2); font-size: 18px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--primary-text);
  background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  padding: 5px 12px; border-radius: 99px;
}
.eyebrow-dark { color: #BFD0FF; background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.center { text-align: center; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand-name { font-family: var(--font-head); font-size: 20px; font-weight: 600; letter-spacing: -.02em; direction: ltr; }
.brand-name b { color: var(--primary); font-weight: 700; }
a:hover .brand { text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding-inline: 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; line-height: 1; white-space: nowrap;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s;
  text-decoration: none !important; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn .ic { margin-block: -2px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(13, 23, 48, .15), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-2); box-shadow: var(--sh-1); }
.btn-outline:hover { border-color: var(--text-3); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-white { background: #fff; color: #0B1430; }
.btn-white:hover { background: #E9EEFF; }
.btn-glass { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .18); }
.btn-glass:hover { background: rgba(255, 255, 255, .14); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { height: 38px; padding-inline: 18px; font-size: 14px; }
.btn-xs { height: 30px; padding-inline: 12px; font-size: 13px; }
.btn-lg { height: 52px; padding-inline: 30px; font-size: 16px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  color: var(--text-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: inline-block; }
:root[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: inline-block; }
  :root:not([data-theme="light"]) .only-light { display: none; }
}

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s, background .2s;
}
.nav[data-scrolled] { border-bottom-color: var(--border); }
.nav-in { height: 100%; display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-inline-start: 12px; }
.nav-links > a, .nav-link {
  color: var(--text-2); font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 10px;
}
.nav-links > a:hover, .nav-link:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.nav-links > a[aria-current] { color: var(--text); }
.nav-act { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.nav-burger, .nav-mobile-act { display: none; }

/* شريط التنقل فوق الهيرو الغامق */
.nav-dark:not([data-scrolled]) { background: transparent; }
.nav-dark:not([data-scrolled]) .brand, .nav-dark:not([data-scrolled]) .nav-links > a,
.nav-dark:not([data-scrolled]) .nav-link, .nav-dark:not([data-scrolled]) .icon-btn { color: #DCE4F7; }
.nav-dark:not([data-scrolled]) .nav-links > a:hover, .nav-dark:not([data-scrolled]) .nav-link:hover,
.nav-dark:not([data-scrolled]) .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-dark:not([data-scrolled]) .brand-name b { color: #8EAFFF; }

@media (max-width: 920px) {
  .hide-sm { display: none !important; }
  .nav-burger { display: inline-grid; }
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0; margin: 0; padding: 16px 20px 24px;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--sh-2);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .2s;
  }
  .nav-links > a { padding: 12px; font-size: 16px; color: var(--text) !important; }
  .nav[data-open] .nav-links { transform: none; opacity: 1; visibility: visible; }
  .nav[data-open] { background: var(--surface) !important; }
  .nav[data-open] .brand, .nav[data-open] .icon-btn { color: var(--text) !important; }
  .nav-mobile-act { display: grid; gap: 10px; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
}

/* ---------- Hero (فاتح، نص + معاينة جنب بعض) ---------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: 72px 88px;
  background:
    radial-gradient(700px 420px at 12% 18%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 65%),
    radial-gradient(520px 360px at 95% 90%, rgba(20, 184, 166, .10), transparent 65%),
    var(--bg);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 10%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 60% 70% at 20% 40%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 20% 40%, #000 20%, transparent 70%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.2; font-weight: 700; margin-block: 20px 18px; letter-spacing: -.02em; }
.hero h1 .grad { background: linear-gradient(90deg, var(--primary), #14B8A6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--text-2); max-width: 560px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.hero-tags li { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); box-shadow: var(--sh-1); }
.hero-tags .ic { color: var(--primary-text); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-trust { display: flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--text-3); font-size: 14px; }
.hero-trust .ic { color: var(--success); }
.hero-visual { position: relative; min-width: 0; }
.hero-copy { min-width: 0; }
.hero-visual::before { content: ""; position: absolute; inset: 8% -4% -6% 6%; border-radius: 32px; background: linear-gradient(135deg, var(--primary), #14B8A6); opacity: .12; transform: rotate(-3deg); }

/* ---------- Product mockup ---------- */
.mock {
  position: relative; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--sh-3); overflow: hidden;
}
.mock-bar { display: flex; align-items: center; gap: 14px; height: 42px; padding-inline: 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mock-dots { display: flex; gap: 6px; direction: ltr; }
.mock-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); }
.mock-url { flex: 1; max-width: 260px; margin-inline: auto; height: 24px; border-radius: 7px; background: var(--bg-soft); color: var(--text-3); font-size: 12px; display: grid; place-items: center; direction: ltr; }
.mock-tabs { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.mock-tabs::-webkit-scrollbar { display: none; }
.mock-tab {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding-inline: 11px; border-radius: 99px;
  font-size: 13px; font-weight: 500; color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; transition: .15s;
}
.mock-tab:hover { color: var(--text); border-color: var(--border-2); }
.mock-tab[aria-selected="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.mock-chat { padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 16px; min-height: 330px; }
.mock-q { align-self: flex-start; max-width: 85%; background: var(--primary); color: #fff; padding: 11px 15px; border-radius: 16px 16px 16px 4px; font-size: 14.5px; }
.mock-a { display: flex; gap: 10px; align-items: flex-start; }
.mock-a-body { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; padding: 14px 16px; font-size: 14px; line-height: 1.85; white-space: pre-line; min-height: 180px; color: var(--text); }
.mock-a-body.typing::after { content: ""; display: inline-block; width: 7px; height: 15px; background: var(--primary); margin-inline-start: 2px; vertical-align: -2px; animation: blink 1s steps(2) infinite; }
.mock-input { margin: 0 22px 20px; display: flex; align-items: center; gap: 10px; height: 46px; border: 1px solid var(--border-2); border-radius: 13px; padding-inline: 14px 6px; color: var(--text-3); font-size: 14px; }
.mock-input span { flex: 1; }
.mock-input i { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); display: grid; place-items: center; color: #fff; }
@keyframes blink { 50% { opacity: 0; } }

.float-card { position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-2); font-size: 13px; line-height: 1.4; animation: floaty 6s ease-in-out infinite; }
.float-card strong { display: block; font-size: 13.5px; }
.float-card small { color: var(--text-3); }
.fc-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.fc-ic.ok { background: var(--success-soft); color: var(--success); }
.fc-1 { inset-inline-end: -22px; top: 92px; }
.fc-2 { inset-inline-start: -26px; bottom: 54px; animation-delay: -3s; }
@keyframes floaty { 50% { transform: translateY(-8px); } }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .hero-copy { text-align: center; }
  .hero .lead { margin-inline: auto; }
  .hero-tags, .hero-cta, .hero-trust { justify-content: center; }
  .hero-visual { max-width: 620px; margin-inline: auto; width: 100%; }
}
@media (max-width: 600px) {
  .hero { padding-block: 40px 56px; }
  .float-card { display: none; }
  .mock-chat { padding: 16px; min-height: 0; }
  .mock-input { margin: 0 16px 16px; }
  .hero-trust { flex-wrap: wrap; font-size: 13px; }
}

/* ---------- شريط المهن ---------- */
.prof-strip { padding-block: 34px; border-block: 1px solid var(--border); background: var(--surface); }
.prof-strip p { text-align: center; color: var(--text-3); font-size: 14px; font-weight: 500; margin-bottom: 18px; }
.prof-strip-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 34px; }
.prof-strip-row a { display: inline-flex; align-items: center; gap: 9px; color: var(--text-2); font-weight: 600; font-size: 15px; opacity: .85; transition: .15s; }
.prof-strip-row a:hover { color: var(--primary-text); opacity: 1; text-decoration: none; }
.prof-strip-row .ic { color: var(--primary-text); }

/* ---------- Stats band ---------- */
.stats-band {
  border-radius: var(--r-xl); padding: 44px 32px; color: #fff;
  background: radial-gradient(500px 260px at 0% 100%, rgba(20, 184, 166, .35), transparent 60%), linear-gradient(120deg, #1D47D6, #2F64F5);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center;
}
.stats-band strong { display: block; font-family: var(--font-head); font-size: clamp(30px, 4vw, 42px); font-weight: 700; line-height: 1.1; }
.stats-band span { color: #D6E1FF; font-size: 15px; }
@media (max-width: 760px) { .stats-band { grid-template-columns: 1fr 1fr; padding: 32px 18px; gap: 28px 12px; } }

/* ---------- Professions ---------- */
.prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.prof {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px;
  transition: border-color .2s, box-shadow .2s, transform .2s; color: var(--text); text-decoration: none !important;
}
.prof:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: var(--sh-2); transform: translateY(-2px); }
.prof-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.prof h3 { font-size: 18px; }
.prof p { color: var(--text-2); font-size: 14.5px; line-height: 1.65; }
.prof-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.prof-tags span { font-size: 12.5px; padding: 3px 9px; border-radius: 99px; background: var(--bg-soft); color: var(--text-2); }
.prof-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--border); font-size: 14px; }
.prof-foot strong { font-family: var(--font-head); color: var(--text); }
.prof-foot .go { color: var(--primary-text); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.prof-cta { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; background: linear-gradient(150deg, var(--primary), #1C3BB0); color: #fff; border: 0; }
.prof-cta p { color: #D7E1FF; }
.prof-cta .prof-ic { background: rgba(255, 255, 255, .15); color: #fff; }

/* ---------- Features ---------- */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; }
.feat { background: var(--surface); padding: 34px 30px; }
.feat-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); margin-bottom: 18px; }
.feat h3 { font-size: 18px; margin-bottom: 8px; }
.feat p { color: var(--text-2); font-size: 15px; }
@media (max-width: 900px) { .feat-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .feat-grid { grid-template-columns: 1fr; } .feat { padding: 26px 22px; } }

/* ---------- Showcase (split) ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.split h2 { font-size: clamp(26px, 3.4vw, 36px); margin-block: 14px; }
.split > div > p { color: var(--text-2); font-size: 17px; }
.check-list { display: grid; gap: 14px; margin-top: 26px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; }
.check-list .ic { color: var(--success); margin-top: 4px; }
.check-list strong { display: block; }
.check-list span { color: var(--text-2); font-size: 15px; }
.tpl-demo { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 24px; box-shadow: var(--sh-2); }
.tpl-demo-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.tpl-demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tpl-chip { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r); font-weight: 500; font-size: 14.5px; background: var(--surface-2); }
.tpl-chip .ic { color: var(--primary-text); }
.tpl-demo-input { margin-top: 14px; padding: 14px 16px; border-radius: var(--r); border: 1.5px solid var(--primary); background: var(--primary-soft); font-size: 14.5px; line-height: 1.8; }
.tpl-demo-input mark { background: color-mix(in srgb, var(--primary) 22%, transparent); color: var(--primary-text); border-radius: 4px; padding: 0 4px; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); gap: 40px; } }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.step-n { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; background: var(--text); color: var(--surface); margin-bottom: 18px; }
.step h3 { font-size: 18px; margin-bottom: 6px; }
.step p { color: var(--text-2); font-size: 15px; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Pricing ---------- */
.seg-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 28px; }
.seg-pick a {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding-inline: 14px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 500; font-size: 14.5px; text-decoration: none;
}
.seg-pick a:hover { color: var(--text); border-color: var(--border-2); }
.seg-pick a[aria-current] { background: var(--text); color: var(--surface); border-color: var(--text); }
.period { display: flex; width: max-content; margin: 0 auto 40px; padding: 4px; border-radius: 99px; background: var(--bg-soft); border: 1px solid var(--border); }
.period button { height: 38px; padding-inline: 20px; border-radius: 99px; font-weight: 600; font-size: 14.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; }
.period button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.period .save { font-size: 12px; font-weight: 600; color: var(--success); background: var(--success-soft); padding: 2px 8px; border-radius: 99px; }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 30px; }
.plan-star { border: 2px solid var(--primary); box-shadow: 0 20px 50px -20px color-mix(in srgb, var(--primary) 50%, transparent); }
.plan-badge { position: absolute; top: -13px; inset-inline-start: 28px; background: var(--primary); color: #fff; font-size: 12.5px; font-weight: 600; padding: 4px 12px; border-radius: 99px; }
.plan h3 { font-size: 20px; }
.plan-desc { color: var(--text-2); font-size: 14.5px; margin-top: 4px; }
.plan-price { margin-block: 22px 6px; display: flex; align-items: baseline; gap: 6px; }
.plan-price strong { font-family: var(--font-head); font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.plan-price span { color: var(--text-2); font-size: 15px; }
.plan-note { color: var(--text-3); font-size: 13.5px; min-height: 22px; }
.plan-note s { opacity: .8; }
.plan .btn { margin-block: 22px 24px; }
.plan-feat { display: grid; gap: 12px; padding-top: 22px; border-top: 1px solid var(--border); }
.plan-feat li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.plan-feat .ic { color: var(--primary-text); margin-top: 4px; }
.plans [data-y] { display: none; }
.plans[data-period="yearly"] [data-m] { display: none; }
.plans[data-period="yearly"] [data-y] { display: initial; }
@media (max-width: 960px) { .plans { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; } }

.trial-band { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 28px; padding: 22px 26px; border-radius: var(--r-lg); background: var(--surface); border: 1px dashed var(--border-2); }
.trial-band strong { font-family: var(--font-head); font-size: 17px; }
.trial-band p { color: var(--text-2); font-size: 15px; }

.compare { width: 100%; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td { padding: 14px 16px; text-align: start; border-bottom: 1px solid var(--border); }
.compare thead th { font-family: var(--font-head); font-size: 15px; color: var(--text); }
.compare td:not(:first-child), .compare th:not(:first-child) { text-align: center; }
.compare tbody th { font-weight: 500; color: var(--text-2); }
.compare .ic.yes { color: var(--success); margin-inline: auto; }
.compare .ic.no { color: var(--text-3); margin-inline: auto; opacity: .6; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); transition: border-color .2s; }
.faq details[open] { border-color: var(--border-2); box-shadow: var(--sh-1); }
.faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; cursor: pointer; font-weight: 600; font-size: 16.5px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--text-3); transition: transform .2s; }
.faq details[open] summary .ic { transform: rotate(180deg); }
.faq details > div { padding: 0 22px 20px; color: var(--text-2); }

/* ---------- CTA ---------- */
.cta {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 64px 32px; text-align: center; color: #fff;
  background: radial-gradient(600px 300px at 90% 0%, rgba(111, 227, 240, .25), transparent 60%), linear-gradient(135deg, #1C3FD0, #0B1638);
}
.cta h2 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 12px; }
.cta p { color: #C6D2F2; font-size: 17px; margin-bottom: 28px; }
.cta .hero-cta { margin-top: 0; }

/* ---------- Footer ---------- */
.footer { background: var(--surface); border-top: 1px solid var(--border); padding-top: 64px; margin-top: 96px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; }
.footer-brand p { color: var(--text-2); font-size: 15px; margin-block: 14px 18px; max-width: 320px; }
.footer h3 { font-size: 14.5px; margin-bottom: 14px; }
.footer ul { display: grid; gap: 10px; }
.footer ul a { color: var(--text-2); font-size: 14.5px; }
.footer ul a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 48px; padding-block: 22px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 13.5px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
.wa-float { position: fixed; inset-inline-start: 20px; bottom: 20px; z-index: 40; width: 54px; height: 54px; border-radius: 50%; background: #25D366; color: #fff; display: grid; place-items: center; box-shadow: 0 10px 28px -6px rgba(37, 211, 102, .6); transition: transform .2s; }
.wa-float:hover { transform: scale(1.06); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: 16px; inset-inline: 0; z-index: 300; display: grid; justify-items: center; gap: 8px; padding-inline: 16px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 520px; width: max-content;
  padding: 12px 12px 12px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--sh-2); font-size: 15px; animation: toast-in .3s ease;
}
.toast-ok .ic:first-child { color: var(--success); }
.toast-err .ic:first-child { color: var(--danger); }
.toast-info .ic:first-child { color: var(--primary); }
.toast-x { color: var(--text-3); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; }
.toast-x:hover { background: var(--bg-soft); }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field > label, .label { font-weight: 600; font-size: 14.5px; }
.field .hint { color: var(--text-3); font-size: 13px; font-weight: 400; }
.input, .form input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]), .form select, .form textarea {
  width: 100%; height: 46px; padding-inline: 14px; border-radius: var(--r); border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text); font-size: 15.5px; transition: border-color .15s, box-shadow .15s;
}
.form textarea { height: auto; padding-block: 12px; resize: vertical; }
.form select { appearance: none; -webkit-appearance: none; padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237C879F' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center; }
.form input:hover, .form select:hover, .form textarea:hover { border-color: var(--text-3); }
.form input:focus, .form select:focus, .form textarea:focus, .input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.form input[dir="ltr"] { text-align: left; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-start: 46px !important; }
.pw-wrap button { position: absolute; inset-inline-start: 4px; top: 4px; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; color: var(--text-3); }
.pw-wrap button:hover { color: var(--text); background: var(--bg-soft); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: end; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: 14.5px; }
.alert .ic { margin-top: 3px; }
.alert-err { background: var(--danger-soft); color: var(--danger); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-info { background: var(--primary-soft); color: var(--primary-text); }
.alert-ok { background: var(--success-soft); color: var(--success); }
.alert ul { display: grid; gap: 2px; }

/* اختيار المهنة في التسجيل */
.seg-radio { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.seg-radio label { position: relative; cursor: pointer; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio span {
  display: flex; align-items: center; gap: 10px; height: 48px; padding-inline: 12px; border-radius: var(--r);
  border: 1px solid var(--border-2); background: var(--surface); font-size: 14.5px; font-weight: 500; transition: .15s;
}
.seg-radio span .ic { color: var(--text-3); }
.seg-radio label:hover span { border-color: var(--text-3); }
.seg-radio input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); box-shadow: 0 0 0 1px var(--primary); }
.seg-radio input:checked + span .ic { color: var(--primary-text); }
.seg-radio input:focus-visible + span { box-shadow: 0 0 0 4px var(--ring); }

/* ---------- Auth ---------- */
.auth-body { background: var(--surface); }
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; min-height: 100dvh; }
.auth-form { display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 64px); }
.auth-top { display: flex; align-items: center; justify-content: space-between; }
.auth-card { width: 100%; max-width: 420px; margin: auto; padding-block: 40px; }
.auth-card h1 { font-size: 30px; margin-bottom: 6px; }
.auth-sub { color: var(--text-2); margin-bottom: 28px; }
.auth-alt { margin-top: 22px; text-align: center; color: var(--text-2); font-size: 15px; }
.auth-legal { text-align: center; color: var(--text-3); font-size: 13px; }
.auth-aside {
  position: relative; overflow: hidden; color: #fff; margin: 12px; border-radius: 24px;
  background: radial-gradient(700px 400px at 100% 0%, rgba(59, 108, 255, .55), transparent 60%),
              radial-gradient(500px 300px at 0% 100%, rgba(38, 200, 220, .2), transparent 60%), #0A1230;
  display: flex; align-items: center;
}
.auth-aside::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: linear-gradient(180deg, #000, transparent); -webkit-mask-image: linear-gradient(180deg, #000, transparent);
}
.auth-aside-in { position: relative; padding: 56px; max-width: 560px; }
.auth-aside h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.3; margin-block: 20px 28px; }
.auth-points { display: grid; gap: 14px; color: #C6D2F2; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; }
.auth-points .ic { color: #6FE3F0; margin-top: 4px; }
.auth-preview { margin-top: 40px; padding: 18px; border-radius: 18px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(8px); display: grid; gap: 14px; }
.ap-q { display: flex; align-items: center; gap: 8px; align-self: start; width: max-content; max-width: 100%; background: #2D5BFF; padding: 10px 14px; border-radius: 14px 14px 14px 4px; font-size: 14.5px; }
.ap-a { display: flex; gap: 10px; }
.ap-a > div { flex: 1; display: grid; gap: 8px; padding-top: 4px; }
.sk { display: block; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .16); }
.w90 { width: 90%; } .w75 { width: 75%; } .w60 { width: 60%; }
@media (max-width: 960px) { .auth { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* ---------- Generic cards / page ---------- */
.page-head { padding-block: 56px 28px; }
.page-head h1 { font-size: clamp(28px, 4vw, 38px); }
.page-head p { color: var(--text-2); margin-top: 6px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head h2 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.card-head h2 .ic { color: var(--text-3); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.meter { height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #5B8CFF); transition: width .4s; }
.meter.warn > span { background: var(--warn); }
.meter.full > span { background: var(--danger); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding-inline: 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--bg-soft); color: var(--text-2); white-space: nowrap; }
.badge-primary { background: var(--primary-soft); color: var(--primary-text); }
.badge-ok, .s-active { background: var(--success-soft); color: var(--success); }
.badge-warn, .s-pending { background: var(--warn-soft); color: var(--warn); }
.badge-err, .s-cancelled { background: var(--danger-soft); color: var(--danger); }
.s-expired { background: var(--bg-soft); color: var(--text-3); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: start; font-weight: 600; font-size: 13px; color: var(--text-3); background: var(--surface-2); padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { font-variant-numeric: tabular-nums; }
.cell-user { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.cell-user strong { display: block; font-weight: 600; }
.cell-user small { color: var(--text-3); font-size: 13px; }
.avatar { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); font-weight: 700; font-size: 14px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.inline { display: inline; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty-state .ic { margin: 0 auto 14px; color: var(--text-3); }
.empty-state h3 { color: var(--text); font-size: 18px; margin-bottom: 6px; }

/* ---------- Checkout ---------- */
.checkout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.summary-list { display: grid; gap: 14px; }
.summary-list div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.summary-list dt { color: var(--text-2); }
.summary-list dd { font-weight: 600; text-align: end; }
.summary-total { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: baseline; }
.summary-total strong { font-family: var(--font-head); font-size: 30px; }
.pay-steps { display: grid; gap: 0; }
.pay-step { display: grid; grid-template-columns: 40px 1fr; gap: 16px; position: relative; padding-bottom: 28px; }
.pay-step:last-child { padding-bottom: 0; }
.pay-step::before { content: ""; position: absolute; inset-inline-start: 19px; top: 44px; bottom: 4px; width: 2px; background: var(--border); }
.pay-step:last-child::before { display: none; }
.pay-step .step-n { margin: 0; width: 40px; height: 40px; }
.pay-step h3 { font-size: 17px; margin-bottom: 4px; }
.pay-step p { color: var(--text-2); font-size: 15px; }
.copy-box { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 6px 6px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px dashed var(--border-2); }
.copy-box code { flex: 1; font-size: 15.5px; font-weight: 600; direction: ltr; text-align: left; overflow-wrap: anywhere; }
.order-ref { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-weight: 700; background: var(--primary-soft); color: var(--primary-text); padding: 4px 12px; border-radius: 8px; direction: ltr; }
@media (max-width: 860px) { .checkout { grid-template-columns: 1fr; } }

/* ---------- Prose (privacy) ---------- */
.prose h2 { font-size: 22px; margin-block: 36px 12px; }
.prose p, .prose li { color: var(--text-2); font-size: 16.5px; }
.prose ul { list-style: disc; padding-inline-start: 22px; display: grid; gap: 6px; margin-top: 8px; }

/* =========================================================
   App (Dashboard / Chat)
   ========================================================= */
.app-body { height: 100vh; height: 100dvh; overflow: hidden; background: var(--bg); }
.app { display: grid; grid-template-columns: 280px 1fr; height: 100%; }
.side { display: flex; flex-direction: column; background: var(--surface); border-inline-end: 1px solid var(--border); min-height: 0; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px; }
.side-new { margin: 4px 14px 10px; }
.side-search { margin: 0 14px 8px; position: relative; }
.side-search input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); padding-inline: 36px 12px; font-size: 14px; }
.side-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.side-search .ic { position: absolute; inset-inline-start: 11px; top: 10px; color: var(--text-3); }
.side-label { padding: 12px 18px 6px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.convs { flex: 1; overflow-y: auto; padding: 0 10px 10px; min-height: 0; }
.conv { position: relative; display: flex; align-items: center; border-radius: 10px; }
.conv a { flex: 1; min-width: 0; padding: 9px 10px; color: var(--text-2); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.conv:hover { background: var(--bg-soft); }
.conv:hover a { color: var(--text); }
.conv.is-on { background: var(--primary-soft); }
.conv.is-on a { color: var(--primary-text); font-weight: 600; }
.conv .icon-btn { width: 30px; height: 30px; margin-inline-end: 4px; opacity: 0; color: var(--text-3); }
.conv:hover .icon-btn, .conv .icon-btn:focus-visible, .conv .icon-btn[data-armed="1"] { opacity: 1; }
.conv .icon-btn[data-armed="1"] { color: var(--danger); background: var(--danger-soft); width: auto; padding-inline: 8px; font-size: 12.5px; font-weight: 600; }
.side-foot { border-top: 1px solid var(--border); padding: 14px; display: grid; gap: 12px; }
.quota-card { padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.quota-row { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; margin-bottom: 8px; }
.quota-row strong { font-weight: 600; }
.quota-card .meter { height: 6px; }
.quota-card p { font-size: 12.5px; color: var(--text-3); margin-top: 8px; }
.quota-card .btn { margin-top: 10px; }
.user-menu { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r); }
.user-menu > div { flex: 1; min-width: 0; line-height: 1.35; }
.user-menu strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu small { color: var(--text-3); font-size: 12.5px; }
.user-links { display: flex; gap: 2px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.main-top { display: flex; align-items: center; gap: 10px; height: 60px; padding-inline: 18px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); }
.main-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; min-width: 0; }
.main-title .prof-ic { width: 32px; height: 32px; border-radius: 9px; }
.main-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-top-act { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.side-open, .side-close { display: none; }
.model-pick { display: flex; padding: 3px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--border); }
.model-pick label { position: relative; cursor: pointer; }
.model-pick input { position: absolute; opacity: 0; }
.model-pick span { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding-inline: 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.model-pick input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.model-pick input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.model-lock { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding-inline: 10px; border-radius: 10px; font-size: 13px; color: var(--text-3); border: 1px dashed var(--border-2); text-decoration: none !important; }
.model-lock:hover { color: var(--primary-text); border-color: var(--primary); }

.thread { flex: 1; overflow-y: auto; min-height: 0; scroll-behavior: smooth; }
.thread-in { max-width: 820px; margin-inline: auto; padding: 32px 22px 24px; display: flex; flex-direction: column; gap: 26px; }

.welcome { text-align: center; padding-top: 4vh; }
.welcome-ic { width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.welcome h2 { font-size: clamp(24px, 3vw, 30px); margin-bottom: 8px; }
.welcome > p { color: var(--text-2); }
.tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 28px; text-align: start; }
.tpl { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); text-align: start; transition: .15s; }
.tpl:hover { border-color: var(--primary); box-shadow: var(--sh-2); transform: translateY(-1px); }
.tpl strong { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.tpl strong .ic { color: var(--primary-text); }
.tpl span { color: var(--text-3); font-size: 13px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-lock { margin-top: 24px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); padding: 10px 16px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); }
.disclaimer { display: inline-flex; align-items: flex-start; gap: 8px; margin-top: 28px; padding: 12px 16px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); font-size: 13.5px; text-align: start; max-width: 640px; }
.disclaimer .ic { margin-top: 3px; }

.msg { display: flex; gap: 14px; }
.msg-user { justify-content: flex-end; }
.msg-user .msg-body { max-width: 80%; background: var(--primary); color: #fff; padding: 12px 16px; border-radius: 18px 18px 18px 6px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; }
.msg-ai .msg-av { flex-shrink: 0; margin-top: 2px; }
.msg-ai .msg-col { flex: 1; min-width: 0; }
.msg-ai .msg-body { font-size: 15.5px; line-height: 1.9; overflow-wrap: anywhere; }
.msg-tools { display: flex; gap: 4px; margin-top: 8px; opacity: 0; transition: opacity .15s; }
.msg-ai:hover .msg-tools, .msg-ai:focus-within .msg-tools, .msg-ai:last-child .msg-tools { opacity: 1; }
.msg-tools button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding-inline: 10px; border-radius: 8px; font-size: 13px; color: var(--text-3); }
.msg-tools button:hover { background: var(--bg-soft); color: var(--text); }
.msg-err .msg-body { color: var(--danger); background: var(--danger-soft); padding: 12px 16px; border-radius: var(--r); font-size: 15px; }
.msg-err .msg-body .btn { margin-top: 10px; }
.typing { display: inline-flex; gap: 5px; padding: 12px 0; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); animation: dot 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.streaming > :last-child::after { content: ""; display: inline-block; width: 7px; height: 1.05em; background: var(--primary); margin-inline-start: 3px; vertical-align: -3px; animation: blink 1s steps(2) infinite; }

/* Markdown */
.md > * + * { margin-top: 12px; }
.md h3, .md h4 { font-size: 17px; margin-top: 22px; }
.md h3:first-child, .md h4:first-child { margin-top: 0; }
.md ul, .md ol { padding-inline-start: 22px; display: grid; gap: 4px; }
.md ul { list-style: disc; }
.md ol { list-style: decimal; }
.md li::marker { color: var(--text-3); }
.md strong { font-weight: 700; color: var(--text); }
.md code { font-size: .88em; background: var(--bg-soft); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; direction: ltr; unicode-bidi: isolate; }
.md pre { position: relative; background: #0D1526; color: #E3E9F6; border-radius: var(--r); padding: 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.7; direction: ltr; text-align: left; }
.md pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.md blockquote { border-inline-start: 3px solid var(--primary); padding: 4px 14px; color: var(--text-2); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.md hr { border: 0; border-top: 1px solid var(--border); }
.md table { border-collapse: collapse; width: 100%; font-size: 14.5px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 8px 12px; text-align: start; }
.md th { background: var(--surface-2); font-weight: 600; }

.composer-wrap { padding: 0 22px 18px; }
.composer {
  max-width: 820px; margin-inline: auto; display: flex; align-items: flex-end; gap: 10px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 18px; padding: 10px 10px 10px 10px;
  box-shadow: var(--sh-2); transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring), var(--sh-2); }
.composer textarea { flex: 1; border: 0; outline: 0; background: transparent; resize: none; min-height: 28px; max-height: 240px; padding: 6px 8px; font-size: 15.5px; line-height: 1.7; }
.composer .send { width: 42px; height: 42px; padding: 0; border-radius: 12px; flex-shrink: 0; }
.composer .send .ic { transform: scaleX(-1); }
.composer-note { max-width: 820px; margin: 8px auto 0; display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--text-3); }
.counter.over { color: var(--danger); }

.no-plan { flex: 1; display: grid; place-items: center; padding: 24px; }
.no-plan .card { max-width: 480px; text-align: center; padding: 40px 32px; }
.no-plan .welcome-ic { background: var(--warn-soft); color: var(--warn); }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(300px, 86vw); z-index: 60; transform: translateX(100%); transition: transform .25s; box-shadow: var(--sh-3); }
  .side.is-open { transform: none; }
  .side-open, .side-close { display: inline-grid; }
  .thread-in { padding: 22px 16px; }
  .composer-wrap { padding: 0 12px 12px; }
  .msg-user .msg-body { max-width: 90%; }
  .composer-note .hide-m { display: none; }
  .main-title small { display: none; }
}
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(5, 10, 25, .45); opacity: 0; visibility: hidden; transition: .2s; }
.side.is-open ~ .scrim, .shell-side.is-open ~ .shell-main ~ .scrim, body[data-side-open] .scrim { opacity: 1; visibility: visible; }

/* =========================================================
   Admin shell
   ========================================================= */
.admin-body { background: var(--bg); }
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.shell-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-inline-end: 1px solid var(--border); padding: 18px 14px; }
.shell-brand { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 14px; }
.shell-close, .shell-open { display: none; }
.shell-label { font-size: 12px; font-weight: 600; color: var(--text-3); padding: 18px 10px 6px; }
.shell-nav { display: grid; gap: 2px; }
.shell-nav a { display: flex; align-items: center; gap: 12px; height: 40px; padding-inline: 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14.5px; text-decoration: none; }
.shell-nav a:hover { background: var(--bg-soft); color: var(--text); }
.shell-nav a[aria-current] { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.shell-nav a .badge { margin-inline-start: auto; }
.shell-user { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 12px 8px 0; border-top: 1px solid var(--border); }
.shell-user > div { min-width: 0; line-height: 1.4; }
.shell-user strong { display: block; font-size: 14px; }
.shell-user small { color: var(--text-3); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; }
.shell-main { min-width: 0; }
.shell-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 64px; padding-inline: 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.shell-top h1 { font-size: 19px; }
.shell-top-act { margin-inline-start: auto; }
.shell-content { padding: 28px; max-width: 1280px; }
.shell-content > * + * { margin-top: 24px; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .shell-side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; z-index: 60; transform: translateX(100%); transition: transform .25s; box-shadow: var(--sh-3); }
  .shell-side.is-open { transform: none; }
  .shell-close, .shell-open { display: inline-grid; }
  .shell-content { padding: 18px 16px; }
  .shell-top { padding-inline: 16px; }
}

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-2); font-size: 14px; font-weight: 500; }
.kpi-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.kpi-ic.ok { background: var(--success-soft); color: var(--success); }
.kpi-ic.warn { background: var(--warn-soft); color: var(--warn); }
.kpi strong { display: block; font-family: var(--font-head); font-size: 30px; font-weight: 700; margin-top: 12px; line-height: 1.1; }
.kpi small { color: var(--text-3); font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.search-box { position: relative; flex: 1; max-width: 420px; }
.search-box input { width: 100%; height: 42px; border-radius: var(--r); border: 1px solid var(--border-2); background: var(--surface); padding-inline: 40px 14px; }
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.search-box .ic { position: absolute; inset-inline-start: 13px; top: 12px; color: var(--text-3); }
.grant { display: flex; gap: 6px; flex-wrap: wrap; }
.grant select { height: 32px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); padding-inline: 8px; font-size: 13px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 70px; gap: 12px; align-items: center; font-size: 14px; padding-block: 6px; }
.bar-row .meter { height: 10px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (max-width: 600px) {
  .section { padding-block: 64px; }
  .sec-head { margin-bottom: 36px; }

  .card { padding: 20px; }
  .plan { padding: 24px; }
  .seg-radio { grid-template-columns: 1fr; }
  .footer { margin-top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   Landing (الرئيسية) — أبيض/أسود/أزرق ملكي + أخضر نعناعي وأصفر
   ========================================================= */
.chat-font, .md, .msg-body, .composer textarea, .mock-a-body { font-family: var(--font-read); }

.btn-mint { background: var(--mint); color: var(--ink); }
.btn-mint:hover { background: #0FC07B; }
.btn-ink { background: var(--primary); color: #fff; }
.btn-ink:hover { background: var(--primary-hover); }
.btn-sun { background: var(--sun); color: var(--ink); font-weight: 600; }
.btn-sun:hover { background: #F5C800; }
.btn-line { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-line:hover { border-color: #fff; background: rgba(255, 255, 255, .06); }

/* النافبار أبيض دايمًا زي المرجع */
.nav { background: color-mix(in srgb, var(--surface) 92%, transparent); border-bottom-color: var(--border); }
.nav-links > a { font-size: 14.5px; }

/* ---------- Hero أسود ---------- */
.h-hero { position: relative; overflow: hidden; background: var(--ink); color: #fff; padding-block: 72px 80px; text-align: center; }
.h-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 380px at 50% 62%, rgba(27, 44, 216, .38), transparent 70%);
}
.h-hero > .container { position: relative; }
.h-tag { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .28); font-size: 14.5px; color: #E9E9F2; }
.h-tag .ic { color: var(--mint); }
.h-hero h1 { font-weight: 400; font-size: clamp(30px, 4.6vw, 52px); line-height: 1.45; margin-top: 26px; letter-spacing: 0; }
.h-hero h1 b { font-weight: 600; color: #fff; }
.h-hero h1 .hl { color: var(--mint); font-weight: 600; }

.h-stage { position: relative; display: grid; grid-template-columns: 1fr 300px 1fr; align-items: center; gap: 28px; margin-top: 46px; }
.h-pills { display: grid; gap: 30px; }
.h-pills-r { justify-items: end; }
.h-pills-l { justify-items: start; }
.h-pills-r .h-pill:nth-child(2) { margin-inline-end: 70px; }
.h-pills-l .h-pill:nth-child(2) { margin-inline-start: 60px; }
.h-pills-l .h-pill:nth-child(3) { margin-inline-start: 20px; }
.h-pill {
  display: inline-flex; align-items: center; gap: 9px; height: 46px; padding-inline: 18px 20px; border-radius: 99px;
  border: 1.5px solid currentColor; background: rgba(255, 255, 255, .02); font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: background .2s, transform .2s, box-shadow .2s; cursor: pointer;
}
.h-pill:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .06); }
.h-pill[aria-selected="true"] { background: currentColor; box-shadow: 0 8px 30px -6px currentColor; }
.h-pill[aria-selected="true"] span, .h-pill[aria-selected="true"] .ic { color: var(--ink); }
.h-pill.c1 { color: #FF5C93; } .h-pill.c2 { color: #13D98C; } .h-pill.c3 { color: #39D5F2; }
.h-pill.c4 { color: #FFD60A; } .h-pill.c5 { color: #EDEDF5; } .h-pill.c6 { color: #A99BFF; } .h-pill.c7 { color: #FF9F45; }

/* الموبايل */
.phone {
  position: relative; width: 300px; height: 610px; margin-inline: auto; border-radius: 46px; padding: 11px;
  background: #1D1A1C; border: 2px solid #4A4549; box-shadow: 0 0 0 7px #0A080A, 0 40px 90px -20px rgba(27, 44, 216, .65);
}
.phone::before { content: ""; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 92px; height: 26px; border-radius: 20px; background: #000; z-index: 3; }
.phone-screen { height: 100%; border-radius: 36px; overflow: hidden; background: #fff; color: #0E0B0D; display: flex; flex-direction: column; text-align: start; }
.phone-head { display: flex; align-items: center; gap: 10px; padding: 52px 16px 12px; background: #F4F4F8; border-bottom: 1px solid #E7E7EE; }
.phone-head strong { font-size: 14px; display: block; line-height: 1.3; }
.phone-head small { font-size: 11.5px; color: #13A86E; display: flex; align-items: center; gap: 5px; }
.phone-head small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #13D98C; }
.phone-chat { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; justify-content: flex-end; }
.phone .mock-q { align-self: flex-start; max-width: 88%; background: var(--primary); color: #fff; padding: 9px 12px; border-radius: 14px 14px 14px 4px; font-size: 13px; line-height: 1.6; }
.phone .mock-a-body { align-self: flex-end; width: 94%; background: #F2F2F7; border: 0; border-radius: 4px 14px 14px 14px; padding: 11px 13px; font-size: 12.5px; line-height: 1.8; white-space: pre-line; color: #1A1A22; min-height: 210px; max-height: 300px; overflow: hidden; }
.phone .mock-a-body.typing::after { content: ""; display: inline-block; width: 6px; height: 13px; background: var(--primary); margin-inline-start: 2px; vertical-align: -2px; animation: blink 1s steps(2) infinite; }
.phone-input { margin: 0 12px 14px; display: flex; align-items: center; gap: 8px; height: 40px; border-radius: 99px; border: 1px solid #E2E2EA; padding-inline: 14px 4px; font-size: 12px; color: #9A9AA8; }
.phone-input span { flex: 1; }
.phone-input i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: var(--ink); }
.phone-input i .ic { transform: scaleX(-1); }

.h-powered { display: inline-flex; align-items: center; gap: 10px; margin-top: 46px; font-size: 20px; font-weight: 500; color: #fff; }
.h-powered .ic { color: var(--mint); }
.h-sub { margin-top: 14px; font-size: clamp(17px, 2vw, 21px); color: #E2E2EC; }
.h-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.h-note { margin-top: 14px; color: #BDBDC9; font-size: 14.5px; }

@media (max-width: 1080px) {
  .h-stage { grid-template-columns: 1fr; }
  .h-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; order: 2; }
  .h-pills-l { order: 3; margin-top: -18px; }
  .h-pills .h-pill { margin: 0 !important; height: 40px; font-size: 14px; padding-inline: 14px 16px; }
  .phone { order: 1; }
}
@media (max-width: 420px) {
  .phone { width: 272px; height: 560px; }
  .h-hero { padding-block: 48px 60px; }
}

/* ---------- شريط الاستخدامات المتحرك ---------- */
.h-trust { padding-block: 80px 70px; background: var(--surface); text-align: center; overflow: hidden; }
.h-trust h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 500; line-height: 1.6; }
.marquee { margin-top: 44px; display: grid; gap: 18px; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-row { display: flex; gap: 18px; width: max-content; animation: slide 46s linear infinite; }
.marquee-row.rev { animation-direction: reverse; animation-duration: 52s; }
.marquee:hover .marquee-row { animation-play-state: paused; }
.use-chip { display: inline-flex; align-items: center; gap: 12px; height: 64px; padding-inline: 18px 24px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 500; font-size: 15px; white-space: nowrap; }
.use-chip .uc-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.use-chip small { display: block; font-size: 12px; color: var(--text-3); font-weight: 400; }
@keyframes slide { to { transform: translateX(50%); } }

/* ---------- قسم الأزرق والأسود المائل ---------- */
.h-diag { position: relative; overflow: hidden; color: #fff; padding-block: 96px 110px;
  background:
    linear-gradient(155deg, transparent 0 38%, var(--ink) 38% 62%, transparent 62%),
    radial-gradient(140% 90% at 85% 115%, #231E21 0 45%, transparent 45.2%),
    #0A10B5;
}
.h-diag .sec-head { max-width: 900px; }
.h-diag .sec-head h2 { color: #fff; font-weight: 500; line-height: 1.6; }
.h-diag .sec-head p { color: #D3D6FF; }
.h-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; max-width: 1220px; margin-inline: auto; }
.h-card { background: #fff; color: #0E0B0D; border-radius: 22px; padding: 30px 36px 26px; display: flex; flex-direction: column; min-height: 290px; }
.h-card .h-card-ic { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: #fff; margin-bottom: 18px; }
.h-card h3 { font-size: 22px; font-weight: 600; margin-bottom: 14px; }
.h-card p { color: #3B3840; font-size: 16px; line-height: 1.85; }
.h-card a { margin-top: auto; padding-top: 22px; font-size: 13.5px; color: #0E0B0D; text-decoration: underline; text-underline-offset: 4px; align-self: flex-end; }
@media (max-width: 820px) { .h-cards { grid-template-columns: 1fr; gap: 18px; } .h-card { min-height: 0; padding: 26px 24px; } }

/* ---------- كروت المهن (بنفسجي فاتح) ---------- */
.h-prof { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.h-prof-card { display: flex; flex-direction: column; gap: 10px; padding: 26px 24px 22px; border-radius: 20px; background: var(--lav); color: var(--text); text-decoration: none !important; transition: transform .2s, box-shadow .2s; }
.h-prof-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.h-prof-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; margin-bottom: 6px; }
.h-prof-card h3 { font-size: 19px; font-weight: 600; }
.h-prof-card p { color: var(--text-2); font-size: 14.5px; line-height: 1.75; flex: 1; }
.h-prof-card .go { font-size: 13.5px; color: var(--text); text-decoration: underline; text-underline-offset: 4px; display: flex; justify-content: space-between; align-items: center; }
.h-prof-card .go b { text-decoration: none; font-weight: 600; color: var(--primary-text); }
.h-prof-card.cta { background: var(--primary); color: #fff; }
.h-prof-card.cta p { color: #D9DCFF; }
.h-prof-card.cta .h-prof-ic { background: var(--mint); color: var(--ink); }
.h-prof-card.cta .go { color: #fff; }
@media (max-width: 1000px) { .h-prof { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .h-prof { grid-template-columns: 1fr; } }

/* ---------- قسم سماوي فاتح ---------- */
.h-sky { background: var(--sky); }
.h-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.h-step { background: var(--surface); border-radius: 22px; padding: 30px; border: 1px solid var(--border); }
.h-step-n { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 600; font-size: 18px; margin-bottom: 18px; }
.h-step h3 { font-size: 19px; font-weight: 600; margin-bottom: 8px; }
.h-step p { color: var(--text-2); font-size: 15px; }
.h-step .tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.h-step .tpl-chips span { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; background: var(--sky); color: #0B7287; }
@media (max-width: 860px) { .h-steps { grid-template-columns: 1fr; } }

/* ---------- ليه تختار (كروت سودا) ---------- */
.sec-head h2 .brand-word { color: var(--primary-text); }
.h-why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.h-why-card { background: var(--ink); color: #fff; border-radius: 22px; padding: 30px 32px; }
.h-why-card .ic { color: var(--mint); margin-bottom: 18px; }
.h-why-card h3 { font-size: 21px; font-weight: 600; margin-bottom: 14px; }
.h-why-card p { color: #D5D3DA; font-size: 15.5px; line-height: 1.85; }
:root[data-theme="dark"] .h-why-card { background: var(--surface-2); border: 1px solid var(--border); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .h-why-card { background: var(--surface-2); border: 1px solid var(--border); } }
@media (max-width: 900px) { .h-why { grid-template-columns: 1fr; } }

/* ---------- الأسعار في الرئيسية ---------- */
.plan-star { border-color: var(--primary); }
.plan-badge { background: var(--mint); color: var(--ink); }

/* ---------- CTA الأخير ---------- */
.h-final { background: var(--ink); color: #fff; border-radius: 28px; padding: 64px 28px; text-align: center; position: relative; overflow: hidden; }
.h-final::before { content: ""; position: absolute; inset: auto -10% -60% -10%; height: 120%; background: radial-gradient(closest-side, rgba(27, 44, 216, .55), transparent); }
.h-final > * { position: relative; }
.h-final h2 { font-size: clamp(26px, 3.6vw, 40px); font-weight: 500; }
.h-final p { color: #CFCFDA; margin-top: 12px; font-size: 17px; }

/* ---------- الفوتر غامق ---------- */
.footer { background: var(--ink); color: #fff; border-top: 0; }
.footer .brand { color: #fff; }
.footer .brand-name b { color: #8E98FF; }
.footer-brand p, .footer ul a { color: #B9B6C0; }
.footer ul a:hover { color: #fff; }
.footer h3 { color: #fff; }
.footer-bottom { border-top-color: rgba(255, 255, 255, .1); color: #8F8C96; }
.footer .btn-outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); box-shadow: none; }

/* =========================================================
   v3 — هوية Blue AI الخاصة (هيرو كحلي مقسوم، bento، كروت ملونة)
   ========================================================= */

/* ---------- Hero كحلي مقسوم ---------- */
.h-hero {
  text-align: start; padding-block: 76px 84px;
  background:
    radial-gradient(700px 460px at 18% 40%, rgba(82, 110, 255, .45), transparent 65%),
    radial-gradient(520px 360px at 100% 0%, rgba(110, 231, 249, .16), transparent 60%),
    linear-gradient(160deg, #0B1340 0%, #0A0F2E 100%);
}
.h-hero::before {
  background: none;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 55% 70% at 20% 45%, #000 15%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 55% 70% at 20% 45%, #000 15%, transparent 70%);
}
.h-split { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: center; }
.h-tag { border: 0; background: rgba(255, 255, 255, .08); color: #DCE2FF; font-size: 13.5px; padding: 7px 14px; }
.h-tag .ic { color: #7DE3F9; }
.h-hero h1 { font-weight: 600; font-size: clamp(34px, 4.4vw, 54px); line-height: 1.22; margin-top: 22px; letter-spacing: -.01em; }
.h-hero h1 .hl { background: linear-gradient(90deg, #8FA3FF, #6EE7F9); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.h-hero .h-sub { color: #C3CAEE; font-size: clamp(16.5px, 1.6vw, 18.5px); max-width: 560px; margin-top: 18px; line-height: 1.9; }
.h-pick-label { margin-top: 30px; font-size: 13.5px; color: #8E99CC; font-weight: 500; }
.h-hero .h-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; max-width: 600px; }
.h-hero .h-pill {
  height: 38px; padding-inline: 12px 14px; gap: 7px; font-size: 14px; font-weight: 500;
  color: #E4E8FB; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .13); border-radius: 12px; box-shadow: none; margin: 0;
}
.h-hero .h-pill:hover { background: rgba(255, 255, 255, .12); transform: none; }
.h-hero .h-pill[aria-selected="true"] { background: #fff; color: #0B1340; border-color: #fff; box-shadow: 0 10px 26px -10px rgba(0, 0, 0, .6); }
.h-hero .h-pill.c1 .ic { color: #FF7AA8; } .h-hero .h-pill.c2 .ic { color: #34E0A1; } .h-hero .h-pill.c3 .ic { color: #5EDCF5; }
.h-hero .h-pill.c4 .ic { color: #FFCF40; } .h-hero .h-pill.c5 .ic { color: #C7CEEA; } .h-hero .h-pill.c6 .ic { color: #B3A6FF; } .h-hero .h-pill.c7 .ic { color: #FFA65C; }
.h-hero .h-pill[aria-selected="true"].c5 .ic { color: #475569; }
.h-hero .h-cta { justify-content: flex-start; margin-top: 32px; }
.h-hero .h-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #AAB3DD; font-size: 14px; margin-top: 16px; }
.h-hero .h-note .ic { color: #34E0A1; }
.h-hero .h-note > span { opacity: .4; margin-inline: 4px; }

.h-device { position: relative; display: grid; place-items: center; padding-block: 10px; }
.h-device::before { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(110, 231, 249, .22), transparent 65%); }
.h-device .phone { box-shadow: 0 0 0 7px #070B22, 0 50px 90px -25px rgba(0, 0, 0, .75); background: #151A36; border-color: #2E3560; }
.h-device .phone-input i { background: var(--primary); color: #fff; }
.h-float { position: absolute; z-index: 4; display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 14px; background: #fff; color: #0E0B0D; box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .5); font-size: 13px; line-height: 1.4; animation: floaty 6s ease-in-out infinite; }
.h-float strong { display: block; font-size: 13.5px; }
.h-float small { color: #6B7280; }
.hf-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: #ECEEFF; color: var(--primary); }
.hf-ic.ok { background: #E3FBF0; color: #0E9F6E; }
.hf-1 { top: 70px; inset-inline-end: 4%; }
.hf-2 { bottom: 90px; inset-inline-start: 2%; animation-delay: -3s; }

@media (max-width: 1000px) {
  .h-split { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .h-copy { text-align: center; }
  .h-hero .h-sub, .h-hero .h-pills { margin-inline: auto; }
  .h-hero .h-pills, .h-hero .h-cta, .h-hero .h-note { justify-content: center; }
}
@media (max-width: 560px) {
  .h-hero { padding-block: 44px 56px; }
  .h-float { display: none; }
  .h-hero .h-pill { height: 36px; font-size: 13.5px; }
}

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 20px; }
.bento-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 28px; transition: box-shadow .2s, transform .2s; }
.bento-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.bento-big { grid-row: span 2; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--surface), var(--primary-soft)); }
.bento-wide { grid-column: span 2; display: flex; align-items: center; gap: 20px; }
.bento-wide .bento-ic { margin-bottom: 0; }
.bento-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); margin-bottom: 18px; flex-shrink: 0; }
.bento-ic.c-mint { background: var(--mint-soft); color: #0E9F6E; }
.bento-ic.c-amber { background: var(--warn-soft); color: var(--warn); }
.bento-ic.c-violet { background: #F1ECFF; color: #7C3AED; }
.bento-card h3 { font-size: 19px; font-weight: 600; margin-bottom: 8px; }
.bento-card p { color: var(--text-2); font-size: 15px; line-height: 1.85; }
.bento-tpl { margin-top: auto; padding-top: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bento-tpl > span { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; font-weight: 500; }
.bento-tpl > span .ic { color: var(--primary-text); }
.bento-input { grid-column: 1 / -1; margin-top: 4px; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--primary); background: var(--surface); font-size: 14px; line-height: 1.8; font-family: var(--font-read); }
.bento-input mark { background: var(--primary-soft); color: var(--primary-text); border-radius: 4px; padding: 0 4px; }
.bento-avatars { margin-inline-start: auto; display: flex; }
.bento-avatars span { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 15px; color: #fff; border: 3px solid var(--surface); margin-inline-start: -10px; }
.bento-avatars span:nth-child(1) { background: #1B2CD8; } .bento-avatars span:nth-child(2) { background: #0E9F6E; }
.bento-avatars span:nth-child(3) { background: #E0457B; } .bento-avatars span:nth-child(4) { background: #CA8A04; }
.bento-avatars span:nth-child(5) { background: var(--bg-soft); color: var(--text-2); }
@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr; }
  .bento-big, .bento-wide { grid-row: auto; grid-column: auto; }
  .bento-wide { flex-wrap: wrap; }
  .bento-avatars { margin-inline-start: 10px; }
}

/* ---------- المهن: لون لكل مهنة ---------- */
.h-prof-card { --pc: var(--primary); background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--pc); }
.h-prof-card .h-prof-ic { background: color-mix(in srgb, var(--pc) 13%, transparent); color: var(--pc); border-radius: 14px; }
.h-prof-card .go b { color: var(--pc); }
.p-c1 { --pc: #E0457B; } .p-c2 { --pc: #0E9F6E; } .p-c3 { --pc: #0891B2; } .p-c4 { --pc: #C28100; }
.p-c5 { --pc: #475569; } .p-c6 { --pc: #7C3AED; } .p-c7 { --pc: #EA580C; }
.h-prof-card.cta { border: 0; }
.h-prof-card.cta .h-prof-ic { background: rgba(255, 255, 255, .16); color: #fff; }

/* ---------- الخطوات بخط واصل ---------- */
.h-sky { background: var(--surface); border-block: 1px solid var(--border); }
.h-steps { position: relative; }
.h-steps::before { content: ""; position: absolute; top: 52px; inset-inline: 12%; border-top: 2px dashed var(--border-2); }
.h-step { position: relative; background: var(--bg); text-align: center; }
.h-step-n { margin-inline: auto; width: 46px; height: 46px; box-shadow: 0 0 0 6px var(--bg); }
.h-step .tpl-chips { justify-content: center; }
.h-step .tpl-chips span { background: var(--primary-soft); color: var(--primary-text); }
@media (max-width: 860px) { .h-steps::before { display: none; } }

/* ---------- ليه Blue AI: كروت فاتحة ---------- */
.h-why-card, :root[data-theme="dark"] .h-why-card { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.h-why-card p { color: var(--text-2); }
.h-why-card > .ic { width: 52px; height: 52px; padding: 12px; border-radius: 15px; background: var(--primary-soft); color: var(--primary-text); }
.h-why-card:nth-child(2) > .ic { background: var(--mint-soft); color: #0E9F6E; }
.h-why-card:nth-child(3) > .ic { background: var(--warn-soft); color: var(--warn); }

/* ---------- CTA وفوتر كحلي ---------- */
.h-final { background: linear-gradient(135deg, #1B2CD8 0%, #0B1340 100%); }
.h-final::before { background: radial-gradient(closest-side, rgba(110, 231, 249, .3), transparent); }
.footer { background: #0A0F2E; }
.plan-badge { background: var(--primary); color: #fff; }

/* ---------- الدفع الإلكتروني ---------- */
.pay-result { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin-inline: auto; }
.pay-result.ok { background: var(--success-soft); color: var(--success); }
.pay-result.warn { background: var(--warn-soft); color: var(--warn); }
.pay-result.err { background: var(--danger-soft); color: var(--danger); }
.pay-options { display: grid; gap: 12px; }
.pay-option { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--r-lg); border: 1.5px solid var(--border); background: var(--surface); }
.pay-option.main { border-color: var(--primary); background: var(--primary-soft); }
.pay-option .po-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--surface); color: var(--primary-text); flex-shrink: 0; box-shadow: var(--sh-1); }
.pay-option > div { flex: 1; min-width: 0; }
.pay-option strong { display: block; font-size: 16px; }
.pay-option small { color: var(--text-2); font-size: 13.5px; }
.pay-or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13.5px; margin-block: 22px 18px; }
.pay-or::before, .pay-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.secure-note { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--text-3); font-size: 13px; margin-top: 12px; }

/* اختيار المهنة في صفحة الحساب */
.seg-radio-3 { grid-template-columns: repeat(3, 1fr); }
.seg-radio label.is-locked { cursor: not-allowed; }
.seg-radio label.is-locked span { opacity: .55; background: var(--surface-2); }
.seg-radio .lock-ic { margin-inline-start: auto; color: var(--text-3); }
@media (max-width: 760px) { .seg-radio-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .seg-radio-3 { grid-template-columns: 1fr; } }
.seg-switch { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding-inline: 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: var(--primary-text); background: var(--primary-soft); text-decoration: none !important; white-space: nowrap; }
.seg-switch:hover { background: var(--primary); color: #fff; }

/* ---------- صفحة الطباعة / PDF ---------- */
.print-body { background: var(--bg-soft); }
.print-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.sheet { width: min(210mm, 100% - 24px); margin: 24px auto 48px; background: #fff; color: #0D1730; padding: 18mm 18mm 14mm; box-shadow: var(--sh-2); border-radius: 6px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 14px; margin-bottom: 22px; border-bottom: 2px solid #1B2CD8; }
.sheet-head h1 { font-size: 22px; line-height: 1.5; color: #0D1730; }
.sheet-head p { color: #7C879F; font-size: 13px; margin-top: 4px; }
.sheet-head .brand { color: #0D1730; flex-shrink: 0; }
.sheet-body { font-size: 15px; line-height: 2; }
.sheet-body h2 { font-size: 19px; margin-top: 22px; }
.sheet-body h3 { font-size: 16.5px; margin-top: 18px; }
.sheet-body table { display: table; }
.sheet-body pre { background: #F1F3F8; color: #0D1730; border: 1px solid #E1E5EE; white-space: pre-wrap; }
.sheet-foot { margin-top: 30px; padding-top: 10px; border-top: 1px solid #E4E9F2; color: #9AA3B5; font-size: 12px; text-align: center; }
@page { size: A4; margin: 14mm; }
@media print {
  .no-print { display: none !important; }
  .print-body { background: #fff; }
  .sheet { width: auto; margin: 0; padding: 0; box-shadow: none; border-radius: 0; }
  .sheet-body h2, .sheet-body h3 { break-after: avoid; }
  .sheet-body pre, .sheet-body table, .sheet-body blockquote { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* أزرار التصدير تحت الرد */
.msg-tools .tool-sep { width: 1px; height: 18px; background: var(--border); margin-inline: 2px; align-self: center; }
.msg-tools a { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding-inline: 10px; border-radius: 8px; font-size: 13px; color: var(--text-3); text-decoration: none !important; }
.msg-tools a:hover { background: var(--bg-soft); color: var(--text); }
.msg-tools a .doc-badge { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; color: #fff; background: #2B579A; }
.msg-tools a .doc-badge.pdf { background: #D93025; }

/* =========================================================
   لوحة العميل (Client shell) — ألوان باستيل زي المرجع
   ========================================================= */
.cs-body {
  --c-blue: #3B82F6; --c-purple: #8B5CF6; --c-pink: #EC4899; --c-orange: #F97316;
  --c-green: #10B981; --c-teal: #14B8A6; --c-indigo: #6366F1; --c-amber: #F59E0B; --c-red: #EF4444;
  --cs-bg: #F5F7FB; --cs-line: #E8ECF3;
  background: var(--cs-bg);
}
:root[data-theme="dark"] .cs-body { --cs-bg: var(--bg); --cs-line: var(--border); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cs-body { --cs-bg: var(--bg); --cs-line: var(--border); } }

/* ألوان مساعدة: .tone-blue وغيرها بتحدد --tc */
.tone-blue { --tc: var(--c-blue); } .tone-purple { --tc: var(--c-purple); } .tone-pink { --tc: var(--c-pink); }
.tone-orange { --tc: var(--c-orange); } .tone-green { --tc: var(--c-green); } .tone-teal { --tc: var(--c-teal); }
.tone-indigo { --tc: var(--c-indigo); } .tone-amber { --tc: var(--c-amber); } .tone-red { --tc: var(--c-red); }

.cs { display: grid; grid-template-columns: 286px minmax(0, 1fr); min-height: 100vh; }

/* ---------- القايمة الجانبية ---------- */
.cs-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-inline-end: 1px solid var(--cs-line); padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; }
.cs-brand { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 14px; border-bottom: 1px solid var(--cs-line); }
.cs-close { display: none; }
.cs-label { font-size: 12px; font-weight: 600; color: var(--text-3); padding-inline: 8px; }
.cs-nav { display: grid; gap: 4px; }
.cs-nav a { position: relative; display: flex; align-items: center; gap: 12px; height: 44px; padding-inline: 14px; border-radius: 12px; color: var(--text-2); font-weight: 500; font-size: 14.5px; text-decoration: none !important; transition: background .15s, color .15s; }
.cs-nav a .ic { color: var(--text-3); }
.cs-nav a:hover { background: var(--bg-soft); color: var(--text); }
.cs-nav a[aria-current] { background: color-mix(in srgb, var(--c-blue) 11%, var(--surface)); color: #2563EB; font-weight: 600; }
.cs-nav a[aria-current] .ic { color: #2563EB; }
.cs-nav a .cnt { margin-inline-start: auto; font-size: 12px; font-weight: 600; color: var(--text-3); }
.cs-nav a .new { margin-inline-start: auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; color: #fff; background: var(--c-red); }

.cs-promo { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; color: #fff; text-decoration: none !important;
  background: linear-gradient(135deg, #8B5CF6, #6D28D9); box-shadow: 0 12px 26px -12px rgba(109, 40, 217, .7); }
.cs-promo .ic { color: #FDE68A; flex-shrink: 0; }
.cs-promo strong { display: block; font-size: 14.5px; }
.cs-promo small { display: block; font-size: 12px; color: #E4DAFF; }
.cs-promo > span:last-child { margin-inline-start: auto; background: #FDE047; color: #422006; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.cs-promo:hover { filter: brightness(1.05); }

.cs-group { border: 1px solid var(--cs-line); border-radius: 16px; padding: 8px; background: var(--surface); }
.cs-group-head { display: flex; align-items: center; gap: 10px; height: 42px; padding-inline: 12px; margin-bottom: 4px; border-radius: 11px; font-weight: 700; font-size: 14.5px;
  background: color-mix(in srgb, var(--tc) 12%, var(--surface)); color: color-mix(in srgb, var(--tc) 75%, var(--text)); border-inline-start: 3px solid var(--tc); }
.cs-group-head .ic { color: var(--tc); }
.cs-group .cs-nav a { height: 40px; font-size: 14px; }
.cs-group .cs-nav a.danger, .cs-group .cs-nav a.danger .ic { color: var(--c-red); }
.cs-group .cs-nav a.warn, .cs-group .cs-nav a.warn .ic { color: #D97706; }
.cs-group .cs-nav a.ok .ic { color: #16A34A; }

.cs-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid var(--cs-line); background: var(--surface-2); }
.cs-user > div { flex: 1; min-width: 0; line-height: 1.35; }
.cs-user strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-user small { color: var(--text-3); font-size: 12px; }
.cs-user .avatar { width: 40px; height: 40px; background: linear-gradient(135deg, #DBEAFE, #EDE9FE); color: #4338CA; }
.cs-side-note { text-align: center; font-size: 11.5px; color: var(--text-3); }
.cs-side-note b { color: #D97706; }

/* ---------- الشريط العلوي ---------- */
.cs-main { min-width: 0; display: flex; flex-direction: column; }
.cs-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px 28px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--cs-line); }
.cs-hello h1 { font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cs-hello p { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.cs-top-act { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.cs-sq { position: relative; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; border: 1px solid var(--cs-line); background: var(--surface); color: var(--text-2); text-decoration: none !important; }
.cs-sq:hover { background: var(--bg-soft); color: var(--text); }
.cs-sq.theme-toggle { color: #F59E0B; }
.cs-sq .dot { position: absolute; top: 7px; inset-inline-end: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--c-red); border: 2px solid var(--surface); }
.cs-search { position: relative; }
.cs-search input { width: 260px; height: 40px; border-radius: 11px; border: 1px solid var(--cs-line); background: var(--surface-2); padding-inline: 38px 12px; font-size: 14px; color: var(--text); }
.cs-search input:focus { outline: none; border-color: var(--c-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-blue) 25%, transparent); }
.cs-search .ic { position: absolute; inset-inline-start: 12px; top: 11px; color: var(--text-3); }
.cs-burger { display: none; }
.cs-content { padding: 24px 28px 40px; display: grid; gap: 22px; max-width: 1400px; width: 100%; align-content: start; }

/* ---------- شريط الرصيد (خوخي) ---------- */
.cs-banner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 22px; border-radius: 18px;
  background: linear-gradient(90deg, #FFF5EE, #FDECEC); border: 1px solid #F9DCCB; }
:root[data-theme="dark"] .cs-banner { background: linear-gradient(90deg, #2A1D17, #2A1A1D); border-color: #4A3026; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cs-banner { background: linear-gradient(90deg, #2A1D17, #2A1A1D); border-color: #4A3026; } }
.cs-banner-ic { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #FB923C, #F43F5E); box-shadow: 0 10px 20px -10px #F43F5E; flex-shrink: 0; }
.cs-banner-val small { display: block; font-size: 12.5px; color: var(--text-3); }
.cs-banner-val strong { font-size: 26px; font-weight: 700; color: #EA580C; font-variant-numeric: tabular-nums; }
.cs-banner-val strong span { font-size: 14px; font-weight: 500; color: var(--text-2); }
.cs-banner-meter { flex: 1; min-width: 180px; max-width: 360px; }
.cs-banner-meter .meter { height: 8px; background: color-mix(in srgb, #F97316 15%, var(--surface)); }
.cs-banner-meter .meter > span { background: linear-gradient(90deg, #FB923C, #F43F5E); }
.cs-banner-meter p { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.cs-plan { margin-inline-start: auto; text-align: end; }
.cs-plan strong { display: inline-flex; align-items: center; gap: 6px; color: #D97706; font-size: 15px; }
.cs-plan small { display: flex; align-items: center; gap: 5px; justify-content: flex-end; font-size: 12px; color: var(--text-3); margin-top: 4px; }
.cs-plan small .ic { color: var(--c-green); }
.cs-plan a { font-size: 12.5px; font-weight: 600; }

/* ---------- كروت الأرقام ---------- */
.cs-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.cs-stat { background: var(--surface); border: 1px solid var(--cs-line); border-radius: 18px; padding: 20px 22px; display: grid; grid-template-columns: 1fr auto; transition: box-shadow .2s, transform .2s; }
.cs-stat:hover { box-shadow: 0 14px 30px -18px rgba(15, 23, 42, .25); transform: translateY(-2px); }
.cs-stat-ic { grid-column: 1; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 13%, var(--surface)); }
.cs-pill { grid-column: 2; align-self: start; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding-inline: 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; color: color-mix(in srgb, var(--tc) 80%, var(--text)); background: color-mix(in srgb, var(--tc) 12%, var(--surface)); white-space: nowrap; }
.cs-stat strong { grid-column: 1 / -1; font-size: 30px; font-weight: 700; margin-top: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cs-stat > span:last-child { grid-column: 1 / -1; color: var(--text-2); font-size: 14px; margin-top: 4px; }

/* ---------- عناوين الأقسام ---------- */
.cs-sec-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cs-sec-head h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.cs-sec-head h2 .ic { color: var(--c-blue); align-self: center; }
.cs-sec-head p { color: var(--text-3); font-size: 13px; }
.cs-sec-head a { margin-inline-start: auto; font-size: 13.5px; font-weight: 600; }

/* ---------- كروت الأقسام / القوالب ---------- */
.cs-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.cs-tile { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 18px; text-decoration: none !important; color: var(--text); text-align: start;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 9%, var(--surface)), var(--surface) 75%); border: 1px solid color-mix(in srgb, var(--tc) 22%, var(--cs-line)); transition: transform .2s, box-shadow .2s, border-color .2s; }
.cs-tile:hover { transform: translateY(-3px); border-color: var(--tc); box-shadow: 0 16px 30px -18px color-mix(in srgb, var(--tc) 70%, transparent); }
.cs-tile-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 70%, #fff), var(--tc)); box-shadow: 0 8px 18px -8px var(--tc); margin-bottom: 4px; }
.cs-tile h3 { font-size: 16px; font-weight: 700; }
.cs-tile p { font-size: 12.5px; color: var(--text-3); line-height: 1.7; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cs-tile-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--tc) 25%, var(--cs-line)); font-size: 12.5px; font-weight: 600; color: var(--tc); }
.cs-chips { display: flex; gap: 4px; }
.cs-chips i { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-style: normal; }
.cs-chips i:nth-child(1) { background: var(--c-purple); } .cs-chips i:nth-child(2) { background: var(--c-blue); }
.cs-chips i:nth-child(3) { background: var(--c-green); } .cs-chips i:nth-child(4) { background: var(--c-orange); }

/* ---------- آخر المحادثات + النشاط ---------- */
.cs-two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.cs-card { background: var(--surface); border: 1px solid var(--cs-line); border-radius: 18px; padding: 20px 22px; }
.cs-card > .cs-sec-head { margin-bottom: 14px; }
.cs-list { display: grid; }
.cs-list a { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--cs-line); color: var(--text); text-decoration: none !important; border-radius: 10px; }
.cs-list a:last-child { border-bottom: 0; }
.cs-list a:hover { background: var(--surface-2); }
.cs-list .li-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, var(--surface)); flex-shrink: 0; }
.cs-list .li-txt { flex: 1; min-width: 0; }
.cs-list .li-txt strong { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-list .li-txt small { color: var(--text-3); font-size: 12.5px; }
.cs-list .chev { color: var(--text-3); }
.cs-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; direction: ltr; }
.cs-bars div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.cs-bars span { width: 100%; max-width: 22px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #A78BFA, #6366F1); min-height: 4px; }
.cs-bars span.zero { background: var(--bg-soft); }
.cs-bars small { font-size: 10.5px; color: var(--text-3); }
.cs-bars-sum { display: flex; justify-content: space-between; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.cs-bars-sum b { color: var(--text); }

/* ---------- كارت النصايح (بنفسجي فاتح) ---------- */
.cs-tips { position: relative; overflow: hidden; border-radius: 20px; padding: 24px 26px; border: 1px solid #E4DCFF;
  background: radial-gradient(500px 220px at 0% 100%, rgba(167, 139, 250, .28), transparent 60%), linear-gradient(120deg, #F6F2FF, #EEF2FF); }
:root[data-theme="dark"] .cs-tips { background: linear-gradient(120deg, #1E1A33, #161C33); border-color: #2E2850; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cs-tips { background: linear-gradient(120deg, #1E1A33, #161C33); border-color: #2E2850; } }
.cs-tips h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.cs-tips h2 .play { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #6366F1, #3B82F6); }
.cs-tips > p { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }
.cs-tips ol { margin-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cs-tips li { background: color-mix(in srgb, var(--surface) 85%, transparent); border-radius: 14px; padding: 14px 16px; font-size: 13.5px; color: var(--text-2); line-height: 1.75; }
.cs-tips li b { display: block; color: var(--text); font-size: 14.5px; margin-bottom: 2px; }

/* ---------- صفحات جوه اللوحة (حسابي) ---------- */
.cs-content .card { border-radius: 18px; border-color: var(--cs-line); }
.cs-content .card + .card { margin-top: 0; }
.cs-content .grid-2 { margin-top: 0 !important; }

/* ---------- موبايل ---------- */
@media (max-width: 1200px) { .cs-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cs-two { grid-template-columns: minmax(0, 1fr); } .cs-search input { width: 200px; } }
@media (max-width: 960px) {
  .cs { grid-template-columns: minmax(0, 1fr); }
  .cs-side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 290px; z-index: 60; transform: translateX(100%); transition: transform .25s; box-shadow: var(--sh-3); }
  .cs-side.is-open { transform: none; }
  .cs-burger, .cs-close { display: grid; }
  .cs-top { padding: 10px 16px; min-height: 64px; }
  .cs-content { padding: 18px 16px 32px; }
  .cs-search { display: none; }
  .cs-tips ol { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .cs-stats { gap: 12px; }
  .cs-stat { padding: 16px; }
  .cs-stat strong { font-size: 24px; margin-top: 12px; }
  .cs-hello h1 { font-size: 17px; }
  .cs-hello p { display: none; }
  .cs-plan { margin-inline-start: 0; text-align: start; }
  .cs-plan small { justify-content: flex-start; }
  .cs-top-act .hide-xs { display: none; }
}
.side-home { display: flex; align-items: center; gap: 8px; margin: 0 14px 6px; padding: 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-2); text-decoration: none !important; }
.side-home:hover { background: var(--bg-soft); color: var(--text); }
.plan-feat li.off { color: var(--text-3); }
.plan-feat li.off span { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-3) 50%, transparent); }
.plan-feat li.off .ic { color: var(--text-3); opacity: .6; }

/* ---------- قراءة الصور (OCR) في الشات ---------- */
.composer .attach { flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--text-3); transition: background .15s, color .15s; }
.composer .attach:hover { background: var(--primary-soft); color: var(--primary-text); }
.composer .attach:disabled { opacity: .5; cursor: progress; }
.composer.is-drop { border-color: var(--primary); border-style: dashed; background: var(--primary-soft); }
.ocr-bar { max-width: 820px; margin: 0 auto 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border-2); font-size: 14px; color: var(--text-2); box-shadow: var(--sh-1); }
.ocr-bar > span:not(.ocr-acts):not(.spin):not(.ok-ic) { flex: 1; min-width: 180px; }
.ocr-bar b { color: var(--text); font-weight: 600; }
.ocr-bar > button[data-ocr-close] { width: 28px; height: 28px; border-radius: 8px; font-size: 18px; line-height: 1; color: var(--text-3); }
.ocr-bar > button[data-ocr-close]:hover { background: var(--bg-soft); color: var(--text); }
.ocr-bar.is-ok { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); background: var(--success-soft); }
.ocr-bar.is-err { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: var(--danger-soft); color: var(--danger); }
.ocr-bar .ok-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--success); color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.ocr-bar .spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; flex-shrink: 0; }
.ocr-acts { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.ocr-acts button { height: 32px; padding-inline: 12px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--surface); border: 1px solid var(--border-2); color: var(--text); }
.ocr-acts button:hover { border-color: var(--primary); color: var(--primary-text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- لوحة الإدارة بنفس شكل لوحة العميل ---------- */
.admin-cs .kpis { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.admin-cs .kpi { --tc: var(--c-blue); background: var(--surface); border: 1px solid var(--cs-line); border-radius: 18px; padding: 20px 22px; transition: box-shadow .2s, transform .2s; }
.admin-cs .kpi:hover { box-shadow: 0 14px 30px -18px rgba(15, 23, 42, .25); transform: translateY(-2px); }
.admin-cs .kpis .kpi:nth-child(6n+1) { --tc: var(--c-purple); }
.admin-cs .kpis .kpi:nth-child(6n+2) { --tc: var(--c-green); }
.admin-cs .kpis .kpi:nth-child(6n+3) { --tc: var(--c-orange); }
.admin-cs .kpis .kpi:nth-child(6n+4) { --tc: var(--c-blue); }
.admin-cs .kpis .kpi:nth-child(6n+5) { --tc: var(--c-pink); }
.admin-cs .kpis .kpi:nth-child(6n+6) { --tc: var(--c-teal); }
.admin-cs .kpi-top { font-size: 14px; color: var(--text-2); }
.admin-cs .kpi-ic, .admin-cs .kpi-ic.ok, .admin-cs .kpi-ic.warn { width: 46px; height: 46px; border-radius: 13px; color: var(--tc); background: color-mix(in srgb, var(--tc) 13%, var(--surface)); }
.admin-cs .kpi strong { font-size: 30px; margin-top: 14px; }
.admin-cs .kpi small { display: inline-flex; margin-top: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; color: color-mix(in srgb, var(--tc) 80%, var(--text)); background: color-mix(in srgb, var(--tc) 11%, var(--surface)); }
.admin-cs .card { border-radius: 18px; border-color: var(--cs-line); }
.admin-cs .card-head h2 .ic { color: var(--c-blue); }
.admin-cs .table th { background: color-mix(in srgb, var(--c-blue) 5%, var(--surface)); }
.admin-cs .bar-row .meter > span { background: linear-gradient(90deg, #A78BFA, #6366F1); }
.admin-cs .alert-info { background: color-mix(in srgb, var(--c-blue) 10%, var(--surface)); color: #1D4ED8; border: 1px solid color-mix(in srgb, var(--c-blue) 22%, transparent); }
.admin-cs .alert-warn { border: 1px solid color-mix(in srgb, var(--c-amber) 30%, transparent); }
.admin-cs .alert-err { border: 1px solid color-mix(in srgb, var(--c-red) 25%, transparent); }
.admin-cs .seg-pick a[aria-current] { background: #2563EB; border-color: #2563EB; color: #fff; }
.admin-cs .search-box input { border-radius: 12px; border-color: var(--cs-line); }
.admin-cs .grid-2 { gap: 18px; }
.admin-cs .grid-2 > .card { margin-top: 0; }
.admin-cs .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .admin-cs .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .admin-cs .kpis { grid-template-columns: minmax(0, 1fr); } }

/* ---------- الشعار الجديد ---------- */
.brand { gap: 10px; }
.brand .logo-mark { border-radius: 24%; box-shadow: 0 6px 14px -6px rgba(18, 87, 230, .55); }
.brand-name { font-weight: 800; letter-spacing: -.03em; color: #0E1B3F; }
.brand-name b { font-weight: 800; background: linear-gradient(180deg, #1E8BFF, #0B4FE0); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="dark"] .brand-name { color: #EAF0FF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-name { color: #EAF0FF; } }
.footer .brand-name, .sheet-head .brand-name { color: inherit; }
.footer .brand-name b { background: linear-gradient(180deg, #7CC4FF, #4C8DFF); -webkit-background-clip: text; background-clip: text; }

/* ---------- صفحة «قراءة الصور» ---------- */
.scan { display: grid; gap: 22px; }
.scan-top { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: stretch; }
.scan-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; min-height: 300px; padding: 30px 20px; border-radius: 20px; cursor: pointer;
  border: 2px dashed color-mix(in srgb, var(--c-teal) 45%, var(--cs-line)); background: linear-gradient(160deg, color-mix(in srgb, var(--c-teal) 8%, var(--surface)), var(--surface) 70%); transition: border-color .2s, background .2s, transform .2s; }
.scan-drop:hover, .scan-drop.is-over { border-color: var(--c-teal); background: color-mix(in srgb, var(--c-teal) 12%, var(--surface)); }
.scan-drop.is-over { transform: scale(1.01); }
.scan-drop.is-off { cursor: not-allowed; opacity: .6; }
.scan-drop.is-busy { pointer-events: none; opacity: .7; }
.scan-drop-ic { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2DD4BF, #0D9488); box-shadow: 0 14px 28px -12px #0D9488; margin-bottom: 6px; }
.scan-drop strong { font-size: 19px; font-weight: 700; color: var(--text); }
.scan-drop small { font-size: 13.5px; color: var(--text-3); max-width: 420px; }
.scan-drop-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
.scan-side { display: grid; gap: 14px; align-content: start; }
.scan-note { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-3); line-height: 1.7; padding: 4px 6px; }
.scan-note .ic { color: var(--c-green); margin-top: 3px; }

.scan-result.is-loading .scan-text textarea { background: repeating-linear-gradient(90deg, var(--surface-2) 0 40%, var(--bg-soft) 50%, var(--surface-2) 60% 100%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.scan-body { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; margin-top: 14px; }
.scan-body:has(.scan-preview[hidden]) { grid-template-columns: minmax(0, 1fr); }
.scan-preview { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--cs-line); background: var(--surface-2); align-self: start; max-height: 420px; }
.scan-preview img { width: 100%; height: 100%; object-fit: contain; max-height: 420px; }
.scan-text textarea { width: 100%; min-height: 260px; max-height: 520px; resize: vertical; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--cs-line); background: var(--surface-2); color: var(--text); font-family: var(--font-read); font-size: 15px; line-height: 1.9; }
.scan-text textarea:focus { outline: none; border-color: var(--c-teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-teal) 25%, transparent); }
.scan-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.scan-tools .doc-badge { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; color: #fff; background: #2B579A; }
.scan-tools .doc-badge.pdf { background: #D93025; }
.scan-acts { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--cs-line); }
.scan-acts > p { font-weight: 700; margin-bottom: 12px; }
.scan-act-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.scan-act-tiles .cs-tile { align-items: center; text-align: center; padding: 16px 12px; cursor: pointer; font: inherit; }
.scan-act-tiles .cs-tile h3 { font-size: 14.5px; }
.scan-act-tiles .cs-tile-ic { width: 42px; height: 42px; margin-bottom: 2px; }
.scan-row { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--cs-line); }
.scan-row:last-child { border-bottom: 0; }
.scan-row > a { flex: 1; min-width: 0; border-bottom: 0 !important; }
.scan-row .icon-btn { color: var(--text-3); }
.scan-row .icon-btn:hover { color: var(--danger); background: var(--danger-soft); }
@media (max-width: 960px) { .scan-top { grid-template-columns: minmax(0, 1fr); } .scan-side { grid-template-columns: 1fr 1fr; } .scan-note { grid-column: 1 / -1; } .scan-body { grid-template-columns: minmax(0, 1fr); } .scan-preview { max-height: 260px; } }

/* ---------- لوحة الإدارة: الأجزاء الجديدة ---------- */
a.cs-stat { color: var(--text); text-decoration: none !important; }
.trend { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--bg-soft); color: var(--text-2); }
.trend.up { background: var(--success-soft); color: var(--success); }
.trend.down { background: var(--danger-soft); color: var(--danger); }
.cs-banner-meter .trend + p { margin-top: 8px; }
.cs-bars-30 { gap: 3px; }
.cs-bars-30 span { max-width: 14px; }
.cs-bars span.rev { background: linear-gradient(180deg, #34D399, #10B981); }

.dist { display: grid; gap: 10px; }
.dist-row { display: grid; grid-template-columns: 30px minmax(90px, 160px) 1fr 40px; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; font-size: 14px; }
.dist-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 13%, var(--surface)); font-size: 12px; font-weight: 700; }
.dist-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist-bar { height: 10px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.dist-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 60%, #fff), var(--tc)); }
.dist-row b { text-align: left; font-variant-numeric: tabular-nums; }
a.dist-row:hover .dist-name { color: var(--tc); }
.tier-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--cs-line); }
.tier-split > div { padding: 12px; border-radius: 14px; text-align: center; background: color-mix(in srgb, var(--tc) 10%, var(--surface)); }
.tier-split strong { display: block; font-size: 24px; color: var(--tc); line-height: 1.2; }
.tier-split span { font-size: 12.5px; color: var(--text-2); }

.health { display: grid; gap: 8px; }
.health-row { display: grid; grid-template-columns: 12px minmax(120px, 190px) 1fr; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--cs-line); font-size: 14px; }
.health-row .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-green) 20%, transparent); }
.health-row.is-warn .dot { background: var(--c-amber); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-amber) 22%, transparent); }
.health-row.is-err .dot { background: var(--c-red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-red) 22%, transparent); }
.health-row span { color: var(--text-2); font-size: 13px; }
.health-row.is-warn span { color: #B45309; }
.health-row.is-err span { color: var(--danger); }

.exp-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--cs-line); }
.exp-row:last-child { border-bottom: 0; }
.exp-row > a:first-child { flex: 1; min-width: 0; border-bottom: 0 !important; }
.cs-list .li-ic { font-size: 13px; font-weight: 700; }

.user-head { align-items: center; }
.user-head .cs-banner-val { display: grid; gap: 2px; }
.user-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.user-head .cs-plan { display: flex; gap: 8px; }
.mini-h { font-size: 14.5px; font-weight: 700; margin: 20px 0 10px; }
@media (max-width: 560px) { .dist-row { grid-template-columns: 28px 1fr 34px; } .dist-bar { grid-column: 2 / -1; grid-row: 2; } .health-row { grid-template-columns: 12px 1fr; } .health-row span { grid-column: 2; } }
.admin-cs .cs-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .admin-cs .cs-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- تقارير الأشعة ---------- */
.rad { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.rad-note strong { color: inherit; }
.rad-label { font-weight: 600; font-size: 14.5px; margin: 6px 0 10px; }
.rad-exams { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rad-exam { cursor: pointer; }
.rad-exam input { position: absolute; opacity: 0; pointer-events: none; }
.rad-exam span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; text-align: center; font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--cs-line); background: var(--surface); color: var(--text-2); transition: .15s; }
.rad-exam span i { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, var(--surface)); }
.rad-exam:hover span { border-color: color-mix(in srgb, var(--tc) 50%, var(--cs-line)); }
.rad-exam input:checked + span { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 9%, var(--surface)); color: var(--text); box-shadow: 0 8px 18px -12px var(--tc); }
.rad-exam input:checked + span i { background: var(--tc); color: #fff; }
.rad-exam input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 30%, transparent); }
.rad-fields { margin-top: 18px; }
.rad-fields textarea { font-family: var(--font-read); direction: ltr; text-align: left; line-height: 1.8; }
.rad-fields textarea:placeholder-shown { direction: rtl; text-align: right; }
.rad-quick { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.rad-opts { align-items: center; }
.rad-lang { width: max-content; }
.rad-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.rad-check input { width: 18px; height: 18px; accent-color: var(--c-blue); }
.rad-out { position: sticky; top: 92px; min-height: 420px; }
.rad-empty { display: grid; place-items: center; gap: 12px; text-align: center; padding: 60px 20px; color: var(--text-3); }
.rad-empty-ic { width: 70px; height: 70px; border-radius: 20px; display: grid; place-items: center; color: var(--c-blue); background: color-mix(in srgb, var(--c-blue) 10%, var(--surface)); }
.rad-report { margin-top: 12px; padding: 18px 20px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--cs-line); font-family: var(--font-read); font-size: 15px; line-height: 1.9; max-height: 640px; overflow-y: auto; }
.rad-report .typing { padding: 4px 0; }
#rad-tools { margin-top: 12px; }
.btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .8s linear infinite; }
@media (max-width: 1100px) { .rad { grid-template-columns: minmax(0, 1fr); } .rad-out { position: static; } }
@media (max-width: 560px) { .rad-exams { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rad-tasks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rad-tasks .cs-tile[aria-current] { border-color: var(--tc); border-width: 2px; box-shadow: 0 14px 28px -16px var(--tc); }
.rad-tasks .cs-tile p { -webkit-line-clamp: 2; }
.rad-common { margin-top: 14px; }
#rad-report-in { font-family: var(--font-read); line-height: 1.8; }
@media (max-width: 900px) { .rad-tasks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.admin-cs .cs-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1200px) { .admin-cs .cs-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .admin-cs .cs-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.new-user { display: grid; gap: 16px; }

/* ---------- كود الخصم ---------- */
.coupon-form { display: flex; gap: 8px; margin-top: 16px; }
.coupon-form input { flex: 1; min-width: 0; height: 38px; border-radius: 10px; border: 1px dashed var(--border-2); background: var(--surface-2); padding-inline: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.coupon-form input:focus { outline: none; border-style: solid; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.coupon-err { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--danger); font-size: 13.5px; }
.coupon-ok { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--success-soft); color: var(--success); font-size: 13.5px; font-weight: 600; }
.coupon-ok a { margin-inline-start: auto; font-weight: 500; color: var(--text-3); }
.coupon-line dd, .coupon-line dt { color: var(--success) !important; font-weight: 600; }
.coupon-line dt { display: inline-flex; align-items: center; gap: 6px; }
.old-price { font-size: 16px; color: var(--text-3); font-weight: 500; margin-inline-end: 6px; }
.offer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; padding: 10px 16px; text-align: center; font-size: 14.5px; font-weight: 600; color: #fff; background: linear-gradient(90deg, #1B2CD8, #7C3AED); }
.offer-bar code { background: rgba(255,255,255,.18); border: 1px dashed rgba(255,255,255,.6); padding: 2px 10px; border-radius: 8px; font-family: var(--font-mono); font-weight: 700; letter-spacing: .05em; }
.offer-bar small { opacity: .85; font-weight: 500; }
.offer-bar a { color: #FDE68A; text-decoration: underline; }
.row-off td { opacity: .55; }
.price-in { display: flex; align-items: center; gap: 6px; }
.price-in input { width: 110px; height: 40px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); padding-inline: 10px; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.price-in input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.price-in span { color: var(--text-3); font-size: 13px; }
.yearly-hint { display: block; margin-top: 4px; font-size: 12px; }
.prices-form { display: grid; gap: 16px; }
.bento-tpl > span small { margin-inline-start: auto; font-size: 11.5px; font-weight: 500; color: var(--text-3); background: var(--bg-soft); padding: 1px 8px; border-radius: 99px; }

/* ---------- مستعرض القوالب في الرئيسية ---------- */
.tplx { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 26px; overflow: hidden; box-shadow: var(--sh-2); margin-bottom: 20px; }
.tplx-side { padding: 28px 22px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border-inline-end: 1px solid var(--border); }
.tplx-side h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.tplx-side > p { color: var(--text-2); font-size: 14px; line-height: 1.8; margin-bottom: 18px; }
.tplx-tabs { display: grid; gap: 6px; }
.tplx-tab { --pc: var(--primary); display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 14px; text-align: start; color: var(--text-2); font-weight: 600; font-size: 14.5px; border: 1.5px solid transparent; transition: background .18s, border-color .18s, color .18s, transform .18s; }
.tplx-tab:hover { background: color-mix(in srgb, var(--pc) 7%, var(--surface)); color: var(--text); }
.tplx-tab[aria-selected="true"] { background: color-mix(in srgb, var(--pc) 11%, var(--surface)); border-color: color-mix(in srgb, var(--pc) 45%, transparent); color: var(--text); transform: translateX(-4px); }
.tplx-tab-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, var(--surface)); transition: .18s; }
.tplx-tab[aria-selected="true"] .tplx-tab-ic { background: var(--pc); color: #fff; box-shadow: 0 8px 16px -8px var(--pc); }
.tplx-tab-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tplx-tab-n { font-size: 12px; font-weight: 700; min-width: 26px; height: 22px; padding-inline: 7px; border-radius: 99px; display: grid; place-items: center; color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, var(--surface)); }

.tplx-stage { position: relative; padding: 26px 28px; min-width: 0; }
.tplx-panel { --pc: var(--primary); animation: tplx-in .35s ease; }
@keyframes tplx-in { from { opacity: 0; transform: translateY(8px); } }
.tplx-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; margin-bottom: 18px; color: #fff;
  background: radial-gradient(260px 120px at 0% 100%, rgba(255, 255, 255, .22), transparent 70%), linear-gradient(120deg, var(--pc), color-mix(in srgb, var(--pc) 70%, #0B1340)); }
.tplx-head-ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); flex-shrink: 0; }
.tplx-head h4 { font-size: 18px; font-weight: 700; }
.tplx-head p { font-size: 13.5px; opacity: .9; }
.tplx-count { margin-inline-start: auto; font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 99px; background: rgba(255, 255, 255, .2); white-space: nowrap; }
.tplx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tplx-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 16px; text-align: start; border: 1.5px solid var(--border); background: var(--surface); transition: border-color .18s, transform .18s, box-shadow .18s; }
.tplx-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--pc) 50%, var(--border)); box-shadow: 0 12px 24px -16px var(--pc); }
.tplx-card[aria-pressed="true"] { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 6%, var(--surface)); }
.tplx-card-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, var(--surface)); }
.tplx-card strong { font-size: 15px; }
.tplx-card-txt { font-family: var(--font-read); font-size: 12.5px; color: var(--text-3); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tplx mark { background: color-mix(in srgb, var(--pc) 14%, transparent); color: color-mix(in srgb, var(--pc) 85%, var(--text)); border-radius: 5px; padding: 0 3px; font-weight: 600; }
.tplx-compose { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 12px 12px 12px 14px; border-radius: 18px; border: 1.5px solid var(--pc); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pc) 12%, transparent); }
.tplx-av { flex-shrink: 0; margin-top: 2px; }
.tplx-typed { flex: 1; min-height: 52px; font-family: var(--font-read); font-size: 15px; line-height: 1.85; color: var(--text); }
.tplx-typed.typing::after { content: ""; display: inline-block; width: 2px; height: 1.1em; background: var(--pc); margin-inline-start: 2px; vertical-align: -3px; animation: blink 1s steps(2) infinite; }
.tplx-send { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; align-self: flex-end; color: #fff; background: var(--pc); }
.tplx-send .ic { transform: scaleX(-1); }
.tplx-hint { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--text-3); }

.bento-row { grid-template-columns: 1fr 1fr 1.6fr; }
.bento-row .bento-wide { grid-column: auto; }
@media (max-width: 980px) {
  .tplx { grid-template-columns: minmax(0, 1fr); }
  .tplx-side { border-inline-end: 0; border-bottom: 1px solid var(--border); padding: 22px 18px; }
  .tplx-tabs { display: flex; overflow-x: auto; scrollbar-width: none; gap: 8px; padding-bottom: 2px; }
  .tplx-tabs::-webkit-scrollbar { display: none; }
  .tplx-tab { width: auto; flex-shrink: 0; transform: none !important; }
  .tplx-stage { padding: 20px 16px; }
  .bento-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) { .tplx-head { flex-wrap: wrap; } .tplx-count { margin-inline-start: 0; } }
.tplx .p-c1 { --pc: #E0457B; } .tplx .p-c2 { --pc: #0E9F6E; } .tplx .p-c3 { --pc: #0891B2; } .tplx .p-c4 { --pc: #C28100; }
.tplx .p-c5 { --pc: #475569; } .tplx .p-c6 { --pc: #7C3AED; } .tplx .p-c7 { --pc: #EA580C; }
.admin-cs .table td.num { white-space: nowrap; }
#coupon-form.is-editing { border: 2px solid var(--c-blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-blue) 14%, transparent); }
#coupon-form { scroll-margin-top: 90px; }

/* ---------- مسافات أقل بين الأقسام ---------- */
.section { padding-block: 56px; }
.sec-head { margin-bottom: 32px; }
.sec-head h2 { margin-block: 10px 8px; }
.h-trust { padding-block: 48px 44px; }
.marquee { margin-top: 28px; }
.footer { margin-top: 56px; padding-top: 48px; }
.footer-bottom { margin-top: 32px; }
.h-final { padding: 48px 24px; }
@media (max-width: 600px) {
  .section { padding-block: 40px; }
  .sec-head { margin-bottom: 24px; }
  .h-trust { padding-block: 36px 32px; }
  .footer { margin-top: 40px; }
}

/* ---------- مسافات أقل في باقي الصفحات (اللوحات، الحساب، الدفع، الدخول) ---------- */
.cs-content { padding: 18px 24px 32px; gap: 16px; }
.cs-top { min-height: 66px; padding-block: 10px; }
.cs-banner { padding: 14px 18px; }
.cs-stats, .admin-cs .kpis { gap: 14px; }
.cs-stat { padding: 16px 18px; }
.cs-stat strong { margin-top: 12px; }
.cs-two { gap: 14px; }
.cs-tiles { gap: 12px; }
.cs-tile { padding: 16px; }
.cs-card { padding: 18px 20px; }
.cs-card > .cs-sec-head { margin-bottom: 10px; }
.cs-side { gap: 10px; padding: 14px 14px 12px; }
.scan, .scan-top, .rad { gap: 14px; }
.scan-drop { min-height: 250px; }
.tier-split { margin-top: 14px; padding-top: 12px; }
.mini-h { margin: 14px 0 8px; }

.page-head { padding-block: 28px 16px; }
.card { padding: 20px 22px; }
.card + .card { margin-top: 14px; }
.card-head { margin-bottom: 12px; }
.checkout, .grid-2 { gap: 14px; }
.plan .btn { margin-block: 16px 18px; }
.plan-price { margin-block: 16px 4px; }
.plan-feat { gap: 9px; padding-top: 16px; }
.trial-band { margin-top: 18px; padding: 16px 20px; }

.auth-card { padding-block: 24px; }
.auth-card h1 { margin-bottom: 4px; }
.auth-sub { margin-bottom: 18px; }
.auth .form { gap: 14px; }
.auth-aside-in { padding: 40px; }
.auth-aside h2 { margin-block: 16px 20px; }
.auth-preview { margin-top: 28px; }

.thread-in { padding-block: 22px 18px; gap: 20px; }
.welcome { padding-top: 2vh; }
.tpls { margin-top: 20px; }

@media (max-width: 960px) {
  .cs-content { padding: 14px 14px 26px; gap: 12px; }
  .cs-stats, .cs-two, .cs-tiles { gap: 10px; }
}
@media (max-width: 600px) {
  .page-head { padding-block: 20px 12px; }
  .card, .cs-card { padding: 16px; }
  .cs-stat { padding: 14px; }
}

/* ---------- تعديل الباقات ---------- */
.plans-edit { display: grid; gap: 14px; }
.tier-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.tier-card { border-top: 4px solid var(--tc); display: grid; gap: 12px; }
.tier-card .form { gap: 10px; }
.tier-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tier-card-head .cs-tile-ic { width: 40px; height: 40px; margin: 0; }
.tier-card-head strong { display: block; font-size: 17px; }
.tier-card-head small { color: var(--text-3); font-size: 12.5px; }
.tier-star { margin-inline-start: auto; cursor: pointer; }
.tier-star input { position: absolute; opacity: 0; }
.tier-star span { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--text-3); border: 1px dashed var(--border-2); }
.tier-star input:checked + span { color: #92400E; background: #FEF3C7; border: 1px solid #FCD34D; }
.tier-star input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.tier-preview { padding-top: 12px; border-top: 1px dashed var(--cs-line); }
.tier-preview > p { font-size: 12.5px; font-weight: 600; color: var(--text-3); margin-bottom: 8px; }
.tier-preview .plan-feat { padding-top: 0; border-top: 0; gap: 6px; }
.tier-preview .plan-feat li { font-size: 13.5px; }
.plans-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.plans-actions .btn { margin-inline-start: auto; }
.plans-actions a { margin-inline: 3px; padding: 2px 8px; border-radius: 99px; }
.plans-actions a.is-on { background: var(--primary-soft); font-weight: 600; }
@media (max-width: 1100px) { .tier-cards { grid-template-columns: minmax(0, 1fr); } }
