/* =========================================================
   كم يعيش؟ — الهوية البصرية والتنسيق
   الهوية: لون واحد (أخضر زمردي عميق) + درجات رمادية مائلة للأخضر.
   خط العناوين: Noto Kufi Arabic (رسمي) — خط النصوص: IBM Plex Sans Arabic (مريح).
   الافتراضي فاتح. الداكن فقط لما الزائر يختاره (data-theme="dark").
   كل الألوان هنا فوق: غيّر --brand ويتغير لون الموقع كله.
   ========================================================= */

:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-2: #f1f5f3;
  --text: #13201b;
  --muted: #5b6b64;
  --border: #e2e8e5;
  --border-strong: #cbd5d0;

  --brand: #0b6b50;        /* لون الهوية */
  --brand-hover: #095a43;
  --brand-deep: #064a37;
  --brand-ink: #ffffff;    /* النص فوق لون الهوية */
  --brand-soft: #e6f2ed;
  --brand-softer: #f2f8f5;

  --ok: #15803d;   --ok-soft: #e7f5ec;
  --warn: #b45309; --warn-soft: #fcf2e2;
  --bad: #b91c1c;  --bad-soft: #fcebeb;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 27, .05);
  --shadow: 0 1px 2px rgba(16, 32, 27, .04), 0 8px 24px rgba(16, 32, 27, .06);
  --shadow-lg: 0 24px 60px rgba(16, 32, 27, .16);

  --font-display: "Noto Kufi Arabic", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0c1311;
  --surface: #131c19;
  --surface-2: #18231f;
  --text: #e5ece9;
  --muted: #97a6a0;
  --border: #22302b;
  --border-strong: #2f403a;
  --brand: #3dbe92;
  --brand-hover: #56cda3;
  --brand-deep: #0f3a2d;
  --brand-ink: #04241a;
  --brand-soft: #123129;
  --brand-softer: #0f2420;
  --ok: #4ade80;   --ok-soft: #11301c;
  --warn: #fbbf24; --warn-soft: #33270f;
  --bad: #f87171;  --bad-soft: #3a1616;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- الأساسيات ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.45; margin: 0 0 .5em; text-wrap: balance; font-weight: 700; }
h2 { font-size: clamp(1.4rem, 2.8vw, 1.9rem); }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.container { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-soft); }

/* أيقونات الخط الموحّد */
.ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* ---------- الشعار ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.logo-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none; }
.logo-svg { width: 100%; height: 100%; display: block; }
.logo-shield { fill: var(--brand); transition: fill .25s var(--ease); }
.logo-check { fill: none; stroke: var(--brand-ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- الشريط العلوي ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 68px; }
.nav { display: flex; align-items: center; gap: 22px; font-size: .95rem; }
.nav a:not(.btn) { color: var(--muted); transition: color .15s; position: relative; }
.nav a:not(.btn):hover, .nav a.active { color: var(--text); }
.nav a.active::after { content: ""; position: absolute; inset-inline: 0; bottom: -23px; height: 2px; background: var(--brand); border-radius: 2px; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 18px; min-height: 42px;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .1s var(--ease), box-shadow .15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-ok { background: var(--ok-soft); color: var(--ok); }
.btn-ok:hover { filter: brightness(.97); }
.btn-bad { background: var(--bad-soft); color: var(--bad); }
.btn-bad:hover { filter: brightness(.97); }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .88rem; }
.btn-lg { padding: 13px 26px; min-height: 52px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.link-danger { background: none; border: 0; color: var(--bad); font: inherit; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 6px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; justify-self: center; }
.link-btn:hover { text-decoration: underline; }
.icon-btn {
  background: var(--surface-2); border: 1px solid var(--border); width: 36px; height: 36px; border-radius: 10px;
  cursor: pointer; color: var(--text); display: inline-grid; place-items: center; flex: none; transition: background-color .15s;
}
.icon-btn:hover { background: var(--border); }
.theme-btn {
  width: 38px; height: 38px; flex: none; border-radius: 10px; cursor: pointer; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); display: inline-grid; place-items: center; transition: border-color .15s, background-color .15s;
}
.theme-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.theme-btn .ic { width: 18px; height: 18px; }

/* ---------- البطاقات والشارات ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge-active  { background: var(--ok-soft);   color: var(--ok); }
.badge-soon    { background: var(--warn-soft); color: var(--warn); }
.badge-expired { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-none    { background: var(--brand-soft); color: var(--brand); }
.bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .6s var(--ease); }
.bar-soon span { background: var(--warn); }
.bar-expired span, .bar-none span { background: var(--border-strong); }
.cat {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand); display: grid; place-items: center;
}
.cat .ic { width: 22px; height: 22px; stroke-width: 1.7; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .88rem; }
.tile-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px; }
.tile-ic .ic { width: 24px; height: 24px; }

/* ---------- شريط الإعلان ---------- */
.announce { background: var(--brand); color: var(--brand-ink); text-align: center; padding: 9px 16px; font-weight: 500; font-size: .93rem; }

/* ---------- الصفحة الرئيسية ---------- */
.hero {
  position: relative; overflow: hidden; padding: 64px 0 72px;
  background:
    radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 70%),
    radial-gradient(700px 380px at 0% 110%, color-mix(in srgb, var(--brand) 6%, transparent), transparent 70%),
    var(--surface);
  border-bottom: 1px solid var(--border);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero-grid > div { min-width: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; background: var(--brand-soft); color: var(--brand);
  font-weight: 600; font-size: .84rem; padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.4; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--brand); display: inline-block; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 36em; margin-bottom: 30px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { display: flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--muted); font-size: .9rem; }
.hero-note .ic { color: var(--brand); }

/* جوال تجريبي يعرض شكل التطبيق */
.device-wrap { position: relative; display: grid; place-items: center; padding: 10px 0; }
.device {
  position: relative; width: 280px; max-width: 100%; aspect-ratio: 9 / 18.5; border-radius: 40px;
  background: #0d1412; padding: 10px; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, .06) inset;
}
.device::before { content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 84px; height: 22px; border-radius: 12px; background: #0d1412; z-index: 2; }
.device-screen {
  height: 100%; border-radius: 31px; overflow: hidden; background: var(--bg);
  padding: 46px 12px 14px; display: grid; gap: 10px; align-content: start;
}
.ds-head { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-display); font-weight: 700; font-size: .95rem; }
.ds-head .logo-mark { width: 24px; height: 24px; }
.ds-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ds-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; font-size: .7rem; color: var(--muted); }
.ds-stat b { display: block; font-size: 1.1rem; color: var(--text); font-family: var(--font-display); line-height: 1.3; }
.ds-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; display: grid; gap: 7px; }
.ds-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ds-row .cat { width: 32px; height: 32px; border-radius: 9px; }
.ds-row .cat .ic { width: 17px; height: 17px; }
.ds-row b { font-size: .78rem; display: block; line-height: 1.4; }
.ds-row small { font-size: .66rem; color: var(--muted); display: block; line-height: 1.3; }
.ds-card .badge { font-size: .62rem; padding: 1px 7px; }
.ds-card .bar { height: 4px; }
.float-card {
  position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 10px 14px; display: flex; align-items: center; gap: 10px; font-size: .82rem; max-width: 220px;
  animation: float 6s ease-in-out infinite;
}
.float-card .tile-ic { width: 34px; height: 34px; border-radius: 10px; margin: 0; }
.float-card .tile-ic .ic { width: 18px; height: 18px; }
.float-card b { display: block; font-size: .85rem; }
.float-card small { color: var(--muted); }
.fc-1 { top: 18%; inset-inline-end: -4px; }
.fc-2 { bottom: 14%; inset-inline-start: -8px; animation-delay: -3s; }
.fc-warn .tile-ic { background: var(--warn-soft); color: var(--warn); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* شريط الثقة */
.trust-strip { border-bottom: 1px solid var(--border); background: var(--surface); }
.trust-strip .container { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 34px; padding-top: 18px; padding-bottom: 18px; }
.ts-item { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; font-weight: 500; }
.ts-item .ic { color: var(--brand); width: 20px; height: 20px; }

.section { padding: 76px 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { text-align: center; max-width: 38em; margin: 0 auto 40px; }
.section-head p { margin: 0; }
.kicker { display: block; color: var(--brand); font-weight: 600; font-size: .85rem; margin-bottom: 8px; letter-spacing: .02em; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; counter-reset: step; }
.step { padding: 26px; position: relative; box-shadow: var(--shadow-sm); }
.step .num {
  position: absolute; top: 22px; inset-inline-end: 22px; font-family: var(--font-display); font-weight: 700;
  font-size: 2rem; line-height: 1; color: var(--brand-soft);
}
.step p { margin: 0; }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature { padding: 26px; box-shadow: none; transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.feature:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); transform: translateY(-3px); box-shadow: var(--shadow); }
.feature p { margin: 0; }
.f-icon { display: grid; place-items: center; }

.trust {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: center;
  background: linear-gradient(150deg, var(--brand), var(--brand-deep)); color: #fff;
  border-radius: 24px; padding: 44px; position: relative; overflow: hidden;
}
.trust::after { content: ""; position: absolute; width: 340px; height: 340px; inset-inline-start: -90px; bottom: -160px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.trust h2 { color: #fff; }
.trust p { margin: 0; color: rgba(255, 255, 255, .85); }
.trust a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; position: relative; z-index: 1; }
.checks li { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); padding: 11px 14px; border-radius: 12px; font-weight: 500; display: flex; gap: 10px; align-items: center; }
.checks li .ic { color: #fff; flex: none; }
:root[data-theme="dark"] .trust { background: linear-gradient(150deg, var(--brand-deep), #0a2a21); }

.soon { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.soon-item { padding: 24px; box-shadow: none; }
.soon-item .badge { margin-bottom: 12px; }
.soon-item p { margin: 0; }

.narrow { max-width: 780px; }
.faq { display: grid; gap: 10px; }
.faq details { padding: 0 20px; box-shadow: none; transition: border-color .2s; }
.faq details[open] { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.faq summary { cursor: pointer; font-weight: 600; padding: 18px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 10px; height: 10px; flex: none; border-inline-end: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(45deg); transition: transform .2s var(--ease); margin-top: -4px; }
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.faq details p { margin: 0 0 18px; }

.final-cta { text-align: center; }
.cta-band {
  background: linear-gradient(150deg, var(--brand), var(--brand-deep)); color: #fff; border-radius: 24px;
  padding: 52px 24px; text-align: center; display: grid; justify-items: center; gap: 6px;
}
.cta-band h2 { color: #fff; margin: 0; }
.cta-band p { color: rgba(255, 255, 255, .85); margin: 0 0 18px; }
.cta-band .btn-primary { background: #fff; color: var(--brand-deep); }
.cta-band .btn-primary:hover { background: #eef6f2; }
:root[data-theme="dark"] .cta-band { background: linear-gradient(150deg, var(--brand-deep), #0a2a21); }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 30px 0; font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-brand { display: grid; gap: 4px; }
.footer-brand .logo { font-size: 1rem; }
.footer-brand .logo-mark { width: 26px; height: 26px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); transition: color .15s; }
.footer-links a:hover { color: var(--text); }

/* ---------- الصفحات الداخلية ---------- */
.page { padding-top: 34px; padding-bottom: 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { font-size: 1.75rem; margin: 0; }
.page-head p { margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 16px 18px; box-shadow: none; }
.stat .n { font-family: var(--font-display); font-size: 1.65rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: .88rem; }
.stat.warn .n { color: var(--warn); }
.stat.bad .n { color: var(--bad); }
.stat.ok .n { color: var(--ok); }

.alert { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; font-weight: 500; }
.alert .ic { margin-top: 4px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.pcard { padding: 18px; display: grid; gap: 12px; cursor: pointer; transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); box-shadow: var(--shadow-sm); animation: rise .35s var(--ease) both; }
.pcard:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow); }
.pcard-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pcard-title { display: grid; min-width: 0; }
.pcard-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-title small { color: var(--muted); }
.pcard-meta, .w-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .9rem; flex-wrap: wrap; }
.status { font-weight: 600; font-size: .88rem; display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-working { color: var(--ok); }
.status-broken { color: var(--bad); }
.inv-tag { color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
/* حركة دخول خفيفة بدون شفافية: لو ما اشتغلت الحركة لأي سبب، البطاقة تبقى ظاهرة */
@keyframes rise { from { transform: translateY(6px); } to { transform: none; } }

.empty { text-align: center; padding: 52px 20px; border: 1.5px dashed var(--border-strong); border-radius: 18px; background: var(--surface); display: grid; justify-items: center; gap: 4px; }
.empty .big { width: 72px; height: 72px; border-radius: 22px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 10px; }
.empty .big .ic { width: 34px; height: 34px; stroke-width: 1.5; }
.empty .big .logo-mark { width: 40px; height: 40px; }
.empty h2 { margin: 0; font-size: 1.3rem; }
.empty p { max-width: 30em; }
.note { text-align: center; color: var(--muted); font-size: .86rem; margin-top: 28px; display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
.loading::before { content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- البحث والتصفية ---------- */
.toolbar { display: grid; gap: 10px; margin: 6px 0 18px; }
.search {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; transition: border-color .15s, box-shadow .15s;
}
.search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip-btn {
  flex: none; font: inherit; font-size: .88rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px; background: var(--surface); color: var(--muted); border: 1px solid var(--border); transition: all .15s var(--ease);
}
.chip-btn:hover { color: var(--text); border-color: var(--border-strong); }
.chip-btn.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.checkin {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--brand-softer); border: 1px solid var(--brand-soft); border-radius: 12px; padding: 10px 16px; margin-bottom: 10px;
}
.checkin > span { display: inline-flex; gap: 8px; align-items: center; }
.checkin > span .ic { color: var(--brand); }
.checkin .act-row { flex: none; }

/* ---------- النوافذ المنبثقة ---------- */
dialog {
  border: 0; padding: 0; border-radius: 20px;
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog[open] { animation: dlg-in .22s var(--ease); }
dialog::backdrop { background: rgba(8, 16, 13, .5); backdrop-filter: blur(2px); }
@keyframes dlg-in { from { transform: translateY(10px) scale(.985); } to { transform: none; } }
.dlg { padding: 22px; display: grid; gap: 16px; }
.dlg-head { display: flex; align-items: center; gap: 12px; }
.dlg-head h2 { font-size: 1.2rem; margin: 0; }
.dlg-head p { margin: 0; font-size: .9rem; }
.dlg-head .grow { flex: 1; min-width: 0; }
.dlg-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* ---------- النماذج ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: .9rem; }
.field input, .field select, .field textarea, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:hover, .field select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--border-strong)); }
.field input:focus, .field select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.hint { font-size: .8rem; color: var(--muted); margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { margin-top: 5px; width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
.check a { color: var(--brand); text-decoration: underline; }

.facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 0; }
.facts div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.facts dt { font-size: .78rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.facts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts-wide { width: 100%; }
.facts dd[dir="ltr"], .usage-row b[dir="ltr"] { text-align: right; }

.tip { border-radius: 12px; padding: 12px 14px; font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; }
.tip > .ic { margin-top: 4px; }
.tip-warn { background: var(--warn-soft); color: var(--warn); }
.tip-info { background: var(--brand-softer); color: var(--brand); border: 1px solid var(--brand-soft); }

.ask-box { background: var(--surface-2); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.ask-box h3 { margin: 0; }
.act-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { position: relative; padding: 0 22px 14px 0; border-inline-start: 2px solid var(--border); margin-inline-start: 6px; }
.timeline li:last-child { border-color: transparent; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }
.timeline li.ev-ok::before { border-color: var(--ok); }
.timeline li.ev-broken::before { border-color: var(--bad); background: var(--bad); }
.timeline li.ev-repaired::before { border-color: var(--brand); background: var(--brand-soft); }
.timeline .when { font-size: .8rem; color: var(--muted); display: block; }

/* ---------- الفاتورة ---------- */
.upload {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px;
  border: 1.5px dashed var(--border-strong); border-radius: 12px; cursor: pointer; color: var(--muted); text-align: center;
  transition: border-color .15s, color .15s, background-color .15s;
}
.upload > span { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.upload:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-softer); }
.upload small { font-weight: 400; font-size: .8rem; }
.upload input { display: none; }
.inv-preview { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 12px; padding: 10px; }
.inv-preview img, .inv-preview .pdf { width: 56px; height: 56px; flex: none; border-radius: 8px; object-fit: cover; background: var(--surface); display: grid; place-items: center; color: var(--brand); }
.inv-preview .pdf .ic { width: 26px; height: 26px; }
.inv-preview .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.inv-img { display: block; width: 100%; max-height: 280px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.inv-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.inv-actions input { display: none; }

/* ---------- حقل مدة الضمان ---------- */
.warranty-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.quick-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-chips button { font: inherit; font-size: .8rem; cursor: pointer; padding: 4px 11px; border-radius: 999px; background: var(--surface); color: var(--muted); border: 1px solid var(--border); transition: all .15s; }
.quick-chips button:hover { color: var(--text); border-color: var(--border-strong); }
.quick-chips button.on { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.w-preview { margin: 0; border-radius: 10px; padding: 8px 12px; font-size: .9rem; background: var(--brand-softer); color: var(--brand); border: 1px solid var(--brand-soft); font-weight: 500; }
.w-preview.expired { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.w-preview.none { background: var(--surface-2); color: var(--muted); border-color: transparent; }

/* ---------- رسالة التأكيد السريعة ---------- */
.toast {
  position: fixed; inset-inline: 16px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); margin: 0 auto; max-width: 440px; z-index: 60;
  background: #13201b; color: #fff; padding: 12px 18px; border-radius: 14px; text-align: center; font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease);
}
:root[data-theme="dark"] .toast { background: #e5ece9; color: #0c1311; }
.toast.show { opacity: 1; transform: none; }
.toast-bad { background: var(--bad) !important; color: #fff !important; }

/* ---------- صفحة الدخول ---------- */
.auth-body { min-height: 100vh; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-brand {
  background: linear-gradient(160deg, var(--brand), var(--brand-deep)); color: #fff;
  padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; position: relative; overflow: hidden;
}
.auth-brand::after { content: ""; position: absolute; width: 420px; height: 420px; inset-inline-end: -140px; bottom: -160px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.auth-brand .logo { color: #fff; font-size: 1.3rem; }
.auth-brand .logo-shield { fill: #fff; }
.auth-brand .logo-check { stroke: var(--brand-deep); }
.auth-brand h2 { color: #fff; font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin-bottom: 14px; }
.auth-brand p { color: rgba(255, 255, 255, .85); max-width: 26em; }
.auth-points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: 10px; align-items: center; }
.auth-points .ic { width: 20px; height: 20px; flex: none; }
.auth-brand small { color: rgba(255, 255, 255, .7); position: relative; z-index: 1; display: inline-flex; gap: 6px; align-items: center; }
:root[data-theme="dark"] .auth-brand { background: linear-gradient(160deg, var(--brand-deep), #0a2a21); }
.auth-wrap { width: 100%; max-width: 470px; margin: 0 auto; padding: 40px 16px; display: grid; gap: 18px; align-content: center; position: relative; }
.auth-logo { justify-content: center; font-size: 1.3rem; }
.auth-card { padding: 26px; display: grid; gap: 16px; }
.auth-card h1 { font-size: 1.3rem; margin: 0; }
.auth-form { display: grid; gap: 14px; }
.auth-form p { margin: 0; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.tab { font: inherit; font-weight: 600; border: 0; border-radius: 9px; padding: 9px; cursor: pointer; background: transparent; color: var(--muted); transition: all .15s var(--ease); }
.tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.form-msg { border-radius: 10px; padding: 10px 14px; font-size: .92rem; font-weight: 500; }
.form-msg-bad { background: var(--bad-soft); color: var(--bad); }
.form-msg-ok { background: var(--ok-soft); color: var(--ok); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; padding: 6px; color: var(--muted); display: grid; place-items: center; }
.pw-eye:hover { color: var(--text); }
.phone-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px; }
.phone-row select { padding-inline: 8px; }
.big-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; justify-self: center; }
.big-icon .ic { width: 30px; height: 30px; }
#v-check, #v-setup { text-align: center; }
.theme-btn-float { position: absolute; top: 24px; inset-inline-start: 16px; }

/* ---------- صفحة حسابي ---------- */
.settings { max-width: 780px; }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.s-card { padding: 22px; margin-bottom: 16px; box-shadow: none; display: grid; gap: 14px; justify-items: start; }
.s-head { display: flex; gap: 14px; align-items: flex-start; width: 100%; }
.s-head > .tile-ic { margin: 0; flex: none; }
.s-head h2 { font-size: 1.1rem; margin-bottom: 2px; }
.s-head p { margin: 0; }
.s-status { margin: 0; font-size: .95rem; }
.s-danger { border-color: color-mix(in srgb, var(--bad) 30%, var(--border)); }
.s-danger .tile-ic { background: var(--bad-soft); color: var(--bad); }
.s-admin { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); background: var(--brand-softer); }
.install-steps { margin: 0; padding-inline-start: 20px; color: var(--muted); display: grid; gap: 4px; }
.usage { width: 100%; display: grid; gap: 8px; }
.usage-row { display: flex; justify-content: space-between; gap: 10px; font-size: .95rem; }
.s-form { width: 100%; display: grid; gap: 12px; }
.is-busy { opacity: .6; pointer-events: none; }
.seg { display: inline-grid; grid-auto-flow: column; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { font: inherit; font-weight: 600; border: 0; border-radius: 9px; padding: 8px 16px; cursor: pointer; background: transparent; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }

/* ---------- الخصوصية ---------- */
.prose { max-width: 740px; margin: 0 auto; }
.prose h1 { font-size: 1.75rem; margin-bottom: 4px; }
.prose h2 { font-size: 1.15rem; margin-top: 30px; }
.prose ul { padding-inline-start: 20px; }
.prose li { margin-bottom: 6px; }
.prose a, .note a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- تقرير سجل المنتج ---------- */
.report-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.report-hint { margin-bottom: 18px; }
.report { max-width: 800px; margin: 0 auto; padding: 32px; display: grid; gap: 22px; }
.report h2 { font-size: 1.05rem; margin: 0; }
.report-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 2px solid var(--brand); }
.report-meta { display: grid; text-align: end; }
.report-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.report-title > div { flex: 1; min-width: 0; }
.report-title h1 { font-size: 1.55rem; margin: 0; }
.report-title p { margin: 0; }
.report-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.report-sum div { border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; display: grid; }
.report-sum b { font-family: var(--font-display); font-size: 1.5rem; color: var(--brand); }
.report-sum span { color: var(--muted); font-size: .85rem; }
.report-inv { max-height: 520px; }
.report-foot { margin: 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted); }

/* ---------- السوق ---------- */
.market-hero { padding: 30px 0 10px; }
.market-hero h1 { font-size: clamp(1.55rem, 3.4vw, 2.1rem); margin: 0 0 4px; }
.mcard { overflow: hidden; cursor: pointer; display: grid; transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); animation: rise .35s var(--ease) both; }
.mcard:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); transform: translateY(-3px); box-shadow: var(--shadow); }
.mcard-img { aspect-ratio: 4 / 3; background: var(--brand-softer); color: var(--brand); display: grid; place-items: center; overflow: hidden; max-width: 100%; }
.mcard-img .ic { width: 56px; height: 56px; stroke-width: 1.2; opacity: .8; }
.mcard-img img { width: 100%; height: 100%; object-fit: cover; }
.mcard-body { padding: 14px 16px 16px; display: grid; gap: 8px; }
.mcard-body b { font-size: 1.05rem; }
.mcard-price { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--brand); }
.mcard-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .8rem; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: .78rem; }
.pill-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 12px; gap: 6px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: center; border-radius: 12px; background: var(--surface-2); }
.price-big { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--brand); }
.photo-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-pick .ph { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.photo-pick .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick .ph button { position: absolute; top: 4px; inset-inline-end: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; display: grid; place-items: center; }
.photo-pick .ph button .ic { width: 14px; height: 14px; }
.photo-pick .add { width: 84px; height: 84px; border-radius: 10px; border: 1.5px dashed var(--border-strong); display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: all .15s; }
.photo-pick .add:hover { border-color: var(--brand); color: var(--brand); }
.photo-pick .add input { display: none; }
.listing-box { border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.listing-box h3 { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.listing-box h3 .ic { color: var(--brand); }

/* ---------- لوحة المدير ---------- */
.admin { max-width: 1200px; }
.admin-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 0; margin-bottom: 22px; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.admin-tabs button {
  flex: none; font: inherit; font-weight: 600; cursor: pointer; padding: 11px 14px; border: 0; background: none; display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s;
}
.admin-tabs button:hover { color: var(--text); }
.admin-tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 16px; box-shadow: none; display: grid; gap: 2px; }
.kpi .n { text-align: right; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: .86rem; }
.kpi .s { color: var(--ok); font-size: .8rem; font-weight: 600; }
.panel { padding: 18px; margin-bottom: 16px; box-shadow: none; display: grid; gap: 12px; min-width: 0; }
.panel h2 { font-size: 1.05rem; margin: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: .8rem; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--brand-softer); }
.tbl input, .tbl select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 5px 8px; min-width: 0; }
.tbl input[type="number"] { width: 110px; }
.bars { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); align-items: end; gap: 3px; height: 130px; padding-top: 8px; border-bottom: 1px solid var(--border); }
.bars span { background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; transition: filter .15s; }
.bars span:hover { filter: brightness(1.2); }
.bars-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.hbar { display: grid; grid-template-columns: 130px minmax(0, 1fr) 60px; align-items: center; gap: 10px; font-size: .9rem; }
.hbar > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.hbar > span:first-child .ic { color: var(--brand); }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar .track span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.hbar .v { text-align: end; color: var(--muted); font-variant-numeric: tabular-nums; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: 0; }
.switch-row b { display: inline-flex; align-items: center; gap: 8px; }
.switch-row b .ic { color: var(--brand); }
.switch-row p { margin: 2px 0 0; font-size: .88rem; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; cursor: pointer; transition: background .2s; }
.switch span::before { content: ""; position: absolute; width: 22px; height: 22px; top: 3px; inset-inline-start: 3px; background: #fff; border-radius: 50%; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(-20px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.ce-section { border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; background: var(--surface); }
.ce-section > summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.ce-section > summary::-webkit-details-marker { display: none; }
.ce-section > summary::after { content: ""; width: 9px; height: 9px; border-inline-end: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(45deg); transition: transform .2s; }
.ce-section[open] > summary::after { transform: rotate(-135deg); }
.ce-body { display: grid; gap: 12px; padding-bottom: 16px; }
.ce-item { border: 1px dashed var(--border-strong); border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
.ce-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.ce-item-head .act-row button { padding: 2px 8px; min-height: 30px; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.icon-pick button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.sticky-save { position: sticky; bottom: 12px; z-index: 5; display: flex; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); flex-wrap: wrap; }
.field-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.field-inline .field { min-width: 150px; flex: 1; }
.status-pill { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.st-active { background: var(--ok-soft); color: var(--ok); }
.st-paused { background: var(--warn-soft); color: var(--warn); }
.st-sold { background: var(--brand-soft); color: var(--brand); }
.st-removed { background: var(--bad-soft); color: var(--bad); }

/* ---------- الطباعة: دائماً فاتح ---------- */
@media print {
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #fff; --surface: #fff; --surface-2: #f4f6f5; --text: #111; --muted: #555; --border: #d5d9df; --border-strong: #c3cac6;
    --brand: #0b6b50; --brand-ink: #fff; --brand-soft: #e6f2ed; --brand-softer: #f2f8f5;
    --ok: #15803d; --bad: #b91c1c; --ok-soft: #fff; --bad-soft: #fff; --shadow: none; --shadow-sm: none;
  }
  .no-print, .site-header, .site-footer, .toast { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; }
  .report { border: 0; padding: 0; max-width: none; }
  .report-inv { break-inside: avoid; max-height: 640px; }
}

/* ---------- تقليل الحركة لمن يفضّل ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- الشاشات المتوسطة ---------- */
@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}

/* ---------- الجوال ---------- */
@media (max-width: 760px) {
  .hero { padding: 36px 0 44px; }
  .hero-grid, .steps, .features, .trust { grid-template-columns: 1fr; }
  .hero-grid { gap: 36px; }
  .device { width: 250px; }
  .fc-1 { inset-inline-end: 0; top: 10%; }
  .fc-2 { inset-inline-start: 0; }
  .float-card { max-width: 180px; font-size: .76rem; padding: 8px 10px; }
  .trust { padding: 28px 22px; }
  .cta-band { padding: 38px 18px; }
  .nav { gap: 12px; }
  .nav .hide-sm { display: none; }
  .nav a.active::after { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-3 .stat { padding: 12px; }
  .stats-3 .stat .n { font-size: 1.25rem; }
  .row2, .facts { grid-template-columns: 1fr; }
  .facts-3 { grid-template-columns: 1fr 1fr; }
  .report { padding: 20px; }
  .section { padding: 52px 0; }
  .header-inner { height: 62px; }
  .trust-strip .container { justify-content: flex-start; gap: 10px 22px; }
}
