/* Meta Origin — مدير التراخيص على الموبايل.
   الألوان من الكتالوج الموحّد (themes.gen.css: data-skin + data-mode، متغيرات بتباين محسوب) والاستايل data-style.
   شكل التطبيق data-look: desktop = زي مدير التراخيص على الكمبيوتر · bank = زي تطبيقات البنوك · ios = بسيط زي آيفون. */
@font-face { font-family: 'Cairo'; src: url('fonts/Cairo-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cairo'; src: url('fonts/Cairo-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Cairo'; src: url('fonts/Cairo-Bold.ttf') format('truetype'); font-weight: 700 800; font-display: swap; }

:root {
  /* قبل ما الثيم يتحمّل (لوتس البنفسجي — نفس مدير التراخيص) */
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #fafafa; --border: #ececf1; --text: #1f1f2e; --muted: #6f6f7a;
  --primary: #7c3aed; --primary-text: #7c3aed; --on-primary: #ffffff; --primary-soft: #f3e8ff;
  --danger: #b42318; --warn-bg: #fff4d6; --warn-text: #6b4600; --ok: #157a3c; --info-bg: #e5effa; --info-text: #1d4f8a;
  --font: 'Cairo', system-ui, sans-serif; --radius: 10px;

  --r: calc(var(--radius) + 4px);
  --r-lg: calc(var(--radius) + 10px);
  --ok-bg: color-mix(in srgb, var(--ok) 10%, var(--surface));
  --ok-text: color-mix(in srgb, var(--ok) 80%, var(--text));
  --bad: var(--danger);
  --bad-bg: color-mix(in srgb, var(--danger) 10%, var(--surface));
  --bad-text: color-mix(in srgb, var(--danger) 82%, var(--text));
  /* الهيدر الملوّن: لون الثيم متدرّج — appearance.js بيحسب الطرف التاني (أغمق أو أفتح حسب لون الكلام، تباين ≥ 4.5) */
  --hero: var(--primary);
  --on-hero: var(--on-primary);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px rgba(15, 23, 42, .06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
:root[data-mode="dark"] { --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font); background: var(--bg) var(--bg-image, none) fixed; color: var(--text);
  font-size: 15.5px; line-height: 1.6; overscroll-behavior-y: none; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary-text); text-decoration: none; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.mono { font-family: ui-monospace, 'SF Mono', Consolas, monospace; letter-spacing: .03em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; vertical-align: -4px; }

/* ================= الشريط اللي فوق ================= */
.top {
  position: sticky; top: 0; z-index: 5; background: var(--hero); color: var(--on-hero);
  padding: calc(12px + var(--safe-t)) 18px 14px; display: flex; align-items: center; gap: 12px;
  border-radius: 0 0 22px 22px; box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 30%, transparent);
}
.top .logo { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .95); padding: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.top h1 { font-size: 17px; margin: 0; flex: 1; font-weight: 800; line-height: 1.3; }
.top .sub { font-size: 12.5px; opacity: .88; display: block; font-weight: 500; }
.top .tbtn { width: 38px; height: 38px; border-radius: 12px; border: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--on-hero) 18%, transparent); color: inherit; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.dot.ok { background: #22c55e; } .dot.pending { background: #f59e0b; } .dot.bad { background: #ef4444; }

/* ملخص (شكل البنوك) */
.hero-stats { display: none; }
.hello { display: none; }

main { padding: 16px 16px calc(96px + var(--safe-b)); max-width: 640px; margin: 0 auto; animation: rise .22s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ================= شريط التبويبات ================= */
.tabs {
  /* فوق كل حاجة في الصفحة (المحتوى في شكل البنوك طالع فوق الهيدر بـ z-index 6) — وطبقة لوحدها عشان Safari على الآيفون */
  position: fixed; bottom: 0; inset-inline: 0; z-index: 15; transform: translateZ(0); display: flex; gap: 4px; background: var(--surface);
  border-top: 1px solid var(--border); padding: 6px 8px calc(6px + var(--safe-b)); box-shadow: 0 -6px 20px rgba(15, 23, 42, .05);
}
.tabs button {
  flex: 1; border: 0; background: none; padding: 6px 2px; font-size: 11.5px; color: var(--muted); font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 14px; position: relative;
}
.tabs button .ic { width: 23px; height: 23px; }
.tabs button.on { color: var(--primary-text); background: var(--primary-soft); }
.tabs .badge {
  position: absolute; top: 2px; inset-inline-end: calc(50% - 22px); background: #f59e0b; color: #111; border-radius: 9px;
  font-size: 10px; min-width: 17px; height: 17px; line-height: 17px; padding: 0 4px; font-weight: 800;
}

/* ================= الكروت والخانات ================= */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 17px; margin: 0 0 8px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card h3 { font-size: 15px; margin: 14px 0 6px; font-weight: 700; }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.card-title .ti { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.card-title h2 { margin: 0; flex: 1; }
label.f { display: block; font-weight: 700; font-size: 13.5px; margin: 14px 0 6px; color: var(--text); }
.in, select.in, textarea.in {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--r); background: var(--surface-2);
  outline: none; min-height: 48px; transition: border-color .15s, box-shadow .15s;
}
.in:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); background: var(--surface); }
.in.bad { border-color: var(--bad); }
.in.good { border-color: var(--ok); }
.row { display: flex; gap: 8px; align-items: stretch; }
.row > .grow { flex: 1; min-width: 0; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.err { color: var(--bad); font-weight: 700; font-size: 14px; margin-top: 8px; }
.err:empty { display: none; }
.okmsg { color: var(--ok); font-weight: 700; font-size: 14px; margin-top: 8px; }

.btn {
  border: 0; border-radius: var(--r); padding: 12px 18px; font-weight: 700; background: var(--primary); color: var(--on-primary);
  min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 28%, transparent); transition: transform .08s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; box-shadow: none; }
.btn.block { width: 100%; margin-top: 14px; }
.btn.light { background: var(--primary-soft); color: var(--primary-text); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--primary-text); border: 1.5px solid var(--border); box-shadow: none; }
.btn.danger { background: var(--bad-bg); color: var(--bad-text); box-shadow: none; }
.btn.green { background: #16a34a; color: #fff; }
.btn.sm { min-height: 38px; padding: 7px 12px; font-size: 13.5px; }
.icon-btn { min-width: 52px; padding: 0 12px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  border: 1.5px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 8px 16px; min-height: 42px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.seg button.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.checks label { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.checks input { width: 20px; height: 20px; accent-color: var(--primary); }

/* ================= البرامج ================= */
.progs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.prog {
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-lg); padding: 16px 10px 14px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 124px; box-shadow: var(--shadow);
}
.prog img, .prog .ph { width: 48px; height: 48px; border-radius: 14px; object-fit: contain; }
.prog .ph, .ph { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; }
.prog b { font-size: 14px; line-height: 1.4; }
.prog small { color: var(--muted); font-size: 11.5px; }
.prog.off { opacity: .5; }
.chosen { display: flex; align-items: center; gap: 12px; }
.chosen img, .chosen .ph { width: 42px; height: 42px; border-radius: 12px; }

/* ================= القوايم ================= */
.item { display: flex; gap: 12px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: 0; }
.item > img, .item > .ph { width: 42px; height: 42px; border-radius: 12px; flex: none; object-fit: contain; }
.item .grow { flex: 1; min-width: 0; }
.item b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.item[data-i] { cursor: pointer; }
.tag { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok-text); }
.tag.warn { background: var(--warn-bg); color: var(--warn-text); }
.tag.bad { background: var(--bad-bg); color: var(--bad-text); }
.tag.info { background: var(--info-bg); color: var(--info-text); }
.empty { text-align: center; color: var(--muted); padding: 18px 8px; }
.empty .ic { width: 34px; height: 34px; display: block; margin: 0 auto 6px; opacity: .55; }

/* ================= الترخيص ================= */
.keybox {
  direction: ltr; text-align: left; font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; word-break: break-all;
  background: var(--surface-2); border: 1.5px dashed color-mix(in srgb, var(--primary) 55%, var(--border)); border-radius: var(--r); padding: 12px; user-select: all;
}
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.actions .btn { padding: 10px 6px; font-size: 13.5px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.facts span { color: var(--muted); }

/* ================= النوافذ ================= */
.sheet-bg { position: fixed; inset: 0; background: rgba(2, 6, 23, .5); backdrop-filter: blur(2px); z-index: 40; display: flex; align-items: flex-end; animation: fade .18s ease; }
.sheet {
  background: var(--surface); width: 100%; max-width: 640px; margin: 0 auto; border-radius: 26px 26px 0 0;
  padding: 18px 18px calc(20px + var(--safe-b)); max-height: 92vh; overflow: auto; animation: up .24s cubic-bezier(.2, .8, .2, 1);
}
.sheet h2 { font-size: 18px; margin: 4px 0 10px; font-weight: 800; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--border); margin: -6px auto 12px; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.toast {
  position: fixed; inset-inline: 16px; bottom: calc(96px + var(--safe-b)); z-index: 60; background: #111827; color: #fff;
  border-radius: 14px; padding: 13px 16px; text-align: center; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: up .2s ease;
}

/* ================= الكاميرا ================= */
.cam { position: fixed; inset: 0; background: #000; z-index: 50; display: flex; flex-direction: column; color: #fff; }
.cam video { flex: 1; width: 100%; object-fit: cover; min-height: 0; }
.cam .frame { position: absolute; inset-inline: 7%; top: 32%; height: 22%; border: 3px solid #fff; border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .45); pointer-events: none; }
.cam .frame.qr { top: 22%; height: 0; padding-bottom: 86%; inset-inline: 7%; }
.cam .bar { position: absolute; top: calc(10px + var(--safe-t)); inset-inline: 12px; display: flex; gap: 8px; align-items: center; }
.cam .bar .t { flex: 1; font-weight: 700; text-shadow: 0 1px 3px #000; }
.cam .bottom { position: absolute; bottom: 0; inset-inline: 0; padding: 14px 14px calc(16px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .75) 30%); }
.cam .status { text-align: center; font-weight: 600; min-height: 1.5em; text-shadow: 0 1px 3px #000; }
.cam .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .5); }
.cam .row .btn { flex: 1; }

/* ================= الترحيب والدخول ================= */
.page-hero { background: var(--hero); color: var(--on-hero); padding: calc(34px + var(--safe-t)) 20px 70px; text-align: center; border-radius: 0 0 34px 34px; }
.page-hero img { width: 86px; height: 86px; border-radius: 24px; background: #fff; padding: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.page-hero h1 { font-size: 23px; margin: 14px 0 2px; font-weight: 800; }
.page-hero .muted { color: inherit; opacity: .85; }
.page-body { margin-top: -48px; padding: 0 16px calc(24px + var(--safe-b)); max-width: 520px; margin-inline: auto; }
.hero { text-align: center; padding: 28px 8px 8px; }
.steps { padding-inline-start: 22px; margin: 6px 0; }
.steps li { margin: 7px 0; }
.person { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.person:last-child { border-bottom: 0; }
.person img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; background: var(--bg); }
.person .grow { flex: 1; }
.phones a { display: inline-block; margin: 3px 6px 0 0; }

/* ================= المظهر ================= */
.looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.look { border: 2px solid var(--border); border-radius: var(--r); padding: 8px; background: var(--surface-2); text-align: center; font-size: 12.5px; font-weight: 700; }
.look.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.look .mini { height: 74px; border-radius: 10px; background: var(--bg); overflow: hidden; margin-bottom: 6px; position: relative; border: 1px solid var(--border); }
.look .mini i { position: absolute; display: block; border-radius: 5px; }
.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sw { border: 2px solid var(--border); border-radius: 12px; padding: 6px 4px; background: var(--surface); font-size: 11px; text-align: center; line-height: 1.3; }
.sw.on { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.sw .c { display: flex; height: 22px; border-radius: 7px; overflow: hidden; margin-bottom: 4px; }
.sw .c span { flex: 1; }

/* ================= شكل البنوك (bank) ================= */
:root[data-look="bank"] .top { flex-wrap: wrap; padding-bottom: 66px; border-radius: 0 0 32px 32px; position: relative; }
:root[data-look="bank"] .hello { display: block; width: 100%; font-size: 22px; font-weight: 800; margin-top: 8px; }
:root[data-look="bank"] .hello small { display: block; font-size: 13px; font-weight: 500; opacity: .85; }
:root[data-look="bank"] .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 12px; }
:root[data-look="bank"] .stat { background: color-mix(in srgb, var(--on-hero) 14%, transparent); border-radius: 18px; padding: 10px 8px; text-align: center; border: 1px solid color-mix(in srgb, var(--on-hero) 22%, transparent); }
:root[data-look="bank"] .stat b { display: block; font-size: 22px; line-height: 1.2; }
:root[data-look="bank"] .stat span { font-size: 11.5px; opacity: .9; }
:root[data-look="bank"] main { margin-top: -50px; position: relative; z-index: 6; }
:root[data-look="bank"] .card, :root[data-look="bank"] .prog { border-radius: 24px; border-color: transparent; box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
:root[data-look="bank"] .tabs { margin: 0 12px calc(10px + var(--safe-b)); inset-inline: 0; bottom: 0; border-radius: 24px; border: 1px solid var(--border); padding: 6px; box-shadow: 0 10px 30px rgba(15, 23, 42, .14); }
:root[data-look="bank"] main { padding-bottom: calc(110px + var(--safe-b)); }

/* ================= البسيط زي آيفون (ios) ================= */
:root[data-look="ios"] .top {
  background: color-mix(in srgb, var(--bg) 82%, transparent); color: var(--text); box-shadow: none; border-radius: 0;
  backdrop-filter: saturate(1.8) blur(18px); -webkit-backdrop-filter: saturate(1.8) blur(18px); border-bottom: 1px solid var(--border);
}
:root[data-look="ios"] .top .logo { width: 32px; height: 32px; border-radius: 9px; box-shadow: none; border: 1px solid var(--border); }
:root[data-look="ios"] .top .tbtn { background: var(--surface); color: var(--primary-text); border: 1px solid var(--border); }
:root[data-look="ios"] .dot { box-shadow: none; }
:root[data-look="ios"] .page-title { display: block; }
:root[data-look="ios"] .card, :root[data-look="ios"] .prog { border: 0; box-shadow: none; border-radius: 14px; }
:root[data-look="ios"] .btn { box-shadow: none; border-radius: 12px; }
:root[data-look="ios"] .tabs {
  background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: saturate(1.8) blur(18px); -webkit-backdrop-filter: saturate(1.8) blur(18px); box-shadow: none;
}
:root[data-look="ios"] .tabs button.on { background: none; }
:root[data-look="ios"] .page-hero { background: none; color: var(--text); }
:root[data-look="ios"] .page-hero img { box-shadow: 0 6px 18px rgba(0, 0, 0, .1); border: 1px solid var(--border); }
:root[data-look="ios"] .page-body { margin-top: 0; }
.page-title { display: none; font-size: 30px; font-weight: 800; margin: 2px 4px 12px; letter-spacing: -.01em; }

/* ================= زي لوحة التحميلات (site) — 2026-10-30، الشكل الافتراضي =================
   نفس شكل https://metaorigin-licenses.meta-origin-eg.workers.dev/dl وموقع البرامج: خلفية #0b0f19، كروت #111827، أزرق #3b82f6، إضاءة فوق.
   ألوانه ثابتة (الثيم والنهاري/الليلي بيتطبّقوا على باقي الأشكال بس) — المحدِّد أقوى من themes.gen.css عشان يكسب. */
:root[data-look="site"]:not([data-x])[data-skin][data-mode] {
  --bg: #0b0f19; --bg-image: none; --surface: #111827; --surface-2: #0f172a; --border: #1f2937; --text: #f3f4f6; --muted: #9ca3af;
  --primary: #3b82f6; --primary-text: #60a5fa; --on-primary: #ffffff; --primary-soft: rgba(59, 130, 246, .14);
  --danger: #f87171; --warn-bg: rgba(251, 191, 36, .12); --warn-text: #fbbf24; --ok: #34d399; --info-bg: rgba(59, 130, 246, .12); --info-text: #93c5fd;
  --font: 'Cairo', system-ui, sans-serif; --radius: 12px; --hero: rgba(11, 15, 25, .82); --on-hero: #f3f4f6;
  --shadow: 0 10px 25px -12px rgba(0, 0, 0, .6); color-scheme: dark;
}
:root[data-look="site"] body { background: #0b0f19; }
:root[data-look="site"] body::before {
  content: ""; position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: 100%; height: 340px; filter: blur(60px); z-index: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(59, 130, 246, .16), rgba(59, 130, 246, .05), transparent);
}
:root[data-look="site"] #app { position: relative; z-index: 1; }
:root[data-look="site"] .top {
  background: rgba(11, 15, 25, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 0; box-shadow: none;
  border-bottom: 1px solid rgba(31, 41, 55, .7); flex-wrap: wrap;
}
:root[data-look="site"] .top .logo { background: #111827; border: 1px solid #1f2937; padding: 2px; box-shadow: none; }
:root[data-look="site"] .top h1 { color: #fff; font-weight: 900; }
:root[data-look="site"] .top .sub { color: #9ca3af; }
:root[data-look="site"] .top .tbtn { background: #1f2937; border: 1px solid #374151; color: #fff; }
:root[data-look="site"] .dot { box-shadow: 0 0 0 3px rgba(255, 255, 255, .08); }
:root[data-look="site"] .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; margin-top: 4px; }
:root[data-look="site"] .stat { background: #111827; border: 1px solid #1f2937; border-radius: 16px; padding: 8px 6px; text-align: center; }
:root[data-look="site"] .stat b { display: block; font-size: 20px; font-weight: 900; line-height: 1.2; color: #60a5fa; }
:root[data-look="site"] .stat span { font-size: 11px; color: #9ca3af; font-weight: 600; }
:root[data-look="site"] .page-title { display: block; font-size: 24px; font-weight: 900; margin: 4px 4px 12px; color: #fff; }
:root[data-look="site"] .card { border-radius: 20px; border-color: #1f2937; box-shadow: none; }
:root[data-look="site"] .card h2 .ic, :root[data-look="site"] .card-title .ti { color: #60a5fa; }
:root[data-look="site"] .prog { border-radius: 20px; box-shadow: none; transition: transform .2s, border-color .2s, box-shadow .2s; }
:root[data-look="site"] .prog:active, :root[data-look="site"] .prog.on { border-color: #3b82f6; box-shadow: 0 10px 25px -8px rgba(59, 130, 246, .35); }
:root[data-look="site"] .btn { border-radius: 12px; box-shadow: 0 8px 22px -8px rgba(59, 130, 246, .7); }
:root[data-look="site"] .btn.light { background: #1f2937; color: #fff; border: 1px solid #374151; box-shadow: none; }
:root[data-look="site"] .btn.ghost { border-color: #374151; color: #e5e7eb; }
:root[data-look="site"] .btn.danger { background: rgba(248, 113, 113, .1); color: #f87171; border: 1px solid rgba(248, 113, 113, .35); }
:root[data-look="site"] .btn.green { background: #25d366; box-shadow: 0 8px 22px -8px rgba(37, 211, 102, .6); }
:root[data-look="site"] .in, :root[data-look="site"] select.in, :root[data-look="site"] textarea.in { background: #0f172a; border-color: #374151; border-width: 1px; }
:root[data-look="site"] .in:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .25); background: #0f172a; }
:root[data-look="site"] .seg button { background: #111827; border-color: #374151; border-width: 1px; }
:root[data-look="site"] .seg button.on { background: #3b82f6; border-color: #3b82f6; box-shadow: 0 6px 18px -8px rgba(59, 130, 246, .8); }
:root[data-look="site"] .tag.ok { background: rgba(52, 211, 153, .12); color: #34d399; border: 1px solid rgba(52, 211, 153, .3); }
:root[data-look="site"] .tag.warn { border: 1px solid rgba(251, 191, 36, .3); }
:root[data-look="site"] .tag.bad { background: rgba(248, 113, 113, .12); color: #f87171; border: 1px solid rgba(248, 113, 113, .3); }
:root[data-look="site"] .tag.info { border: 1px solid rgba(59, 130, 246, .3); }
:root[data-look="site"] .tag:not(.ok):not(.warn):not(.bad):not(.info) { background: #1f2937; color: #d1d5db; }
:root[data-look="site"] .item { border-bottom-color: #1f2937; }
:root[data-look="site"] .keybox { background: #0f172a; border-color: rgba(59, 130, 246, .45); }
:root[data-look="site"] .tabs {
  margin: 0 12px calc(10px + var(--safe-b)); inset-inline: 0; bottom: 0; border-radius: 18px; padding: 5px; gap: 3px;
  background: rgba(17, 24, 39, .92); border: 1px solid #1f2937; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
:root[data-look="site"] .tabs button { color: #9ca3af; border-radius: 13px; }
:root[data-look="site"] .tabs button.on { background: #3b82f6; color: #fff; box-shadow: 0 6px 18px -8px rgba(59, 130, 246, .8); }
:root[data-look="site"] main { padding-bottom: calc(110px + var(--safe-b)); }
:root[data-look="site"] .sheet { background: #111827; border: 1px solid #1f2937; border-bottom: 0; }
:root[data-look="site"] .sheet-bg { background: rgba(0, 0, 0, .6); }
:root[data-look="site"] .toast { background: #1f2937; border: 1px solid #374151; }
:root[data-look="site"] .page-hero { background: none; color: #f3f4f6; padding-bottom: 40px; }
:root[data-look="site"] .page-hero img { background: #111827; border: 1px solid #1f2937; box-shadow: 0 0 35px -5px rgba(59, 130, 246, .45); }
:root[data-look="site"] .page-hero h1 { font-weight: 900; }
:root[data-look="site"] .page-hero .muted { color: #9ca3af; opacity: 1; }
:root[data-look="site"] .look.on, :root[data-look="site"] .sw.on { border-color: #3b82f6; }
/* كارت «لوحة التحميلات» في تبويب أونلاين */
.dlcard { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; width: 100%; text-align: start; font: inherit; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: 0 0 30px -12px color-mix(in srgb, var(--primary) 60%, transparent); }
.dlcard .ti { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.dlcard b { display: block; font-size: 15px; } .dlcard small { color: var(--muted); font-size: 12.5px; }

/* ================= تصميم الكمبيوتر (data-wide) — 2026-10-30 =================
   على شاشة عريضة (≥ 1000px) أو لما المستخدم يختاره من الزرار اللي فوق: التبويبات بقت قايمة جانبية، والمحتوى عريض، والبرامج شبكة،
   والنوافذ في النص بدل ما تطلع من تحت. boot.js / layout() في app.js بيحطّوا data-wide على <html>. */
:root[data-wide] { --side: 250px; }
:root[data-wide] .tabs {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; inset-inline-end: auto; width: var(--side); margin: 0; transform: none;
  flex-direction: column; justify-content: flex-start; gap: 6px; padding: calc(84px + var(--safe-t)) 14px 20px; border-radius: 0;
  background: var(--surface); border: 0; border-inline-end: 1px solid var(--border); box-shadow: none; z-index: 20;
}
:root[data-wide] .tabs::before {
  content: "Meta Origin"; position: absolute; top: 24px; inset-inline: 22px; font-size: 20px; font-weight: 900; color: var(--text); letter-spacing: .02em; direction: ltr; text-align: end;
}
:root[data-wide] .tabs button { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 16px; font-size: 14.5px; border-radius: 14px; text-align: start; }
:root[data-wide] .tabs button .ic { width: 21px; height: 21px; }
:root[data-wide] .tabs button > span { display: flex; align-items: center; gap: 8px; flex: 1; }
:root[data-wide] .tabs .badge { position: static; margin-inline-start: auto; }
:root[data-wide] .tabs button:not(.on):hover { background: var(--primary-soft); color: var(--text); }
:root[data-wide] .top { margin-inline-start: var(--side); padding: 16px 32px; border-radius: 0; flex-wrap: nowrap; }
:root[data-wide] .top h1 { flex: none; }
:root[data-wide] .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 190px)); gap: 10px; width: auto; margin: 0 auto 0 0; }
:root[data-wide][dir="rtl"] .hero-stats { margin: 0 0 0 auto; }
:root[data-wide] .hello { display: none; }
:root[data-wide] .stat { padding: 8px 14px; display: flex; align-items: baseline; gap: 10px; justify-content: center; }
:root[data-wide] main { margin-inline-start: var(--side); max-width: none; padding: 28px 40px 48px; margin-top: 0 !important; }
:root[data-wide] main > * { max-width: 1240px; margin-inline: auto; }
:root[data-wide] .page-title { display: block; font-size: 28px; font-weight: 900; margin-bottom: 18px; }
:root[data-wide] .progs { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
:root[data-wide] .prog { min-height: 150px; padding: 22px 12px 18px; cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s; }
:root[data-wide] .prog:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--primary) 45%, transparent); }
:root[data-wide] .prog img, :root[data-wide] .prog .ph { width: 58px; height: 58px; }
:root[data-wide] .prog b { font-size: 15px; }
:root[data-wide] .card { padding: 22px 24px; }
:root[data-wide] #view > .card, :root[data-wide] #view > form.card { max-width: 1240px; }
:root[data-wide] .actions { grid-template-columns: repeat(6, minmax(0, 1fr)); }
:root[data-wide] .item { padding: 14px 6px; }
:root[data-wide] .sheet-bg { align-items: center; justify-content: center; padding: 24px; }
:root[data-wide] .sheet { border-radius: 24px; max-width: 620px; max-height: 86vh; border: 1px solid var(--border); padding: 22px 24px 24px; }
:root[data-wide] .sheet .grab { display: none; }
:root[data-wide] .toast { inset-inline: auto; inset-inline-end: 32px; bottom: 28px; max-width: 420px; }
:root[data-wide] .page-body { max-width: 560px; }
.tbtn.layout .ic { width: 20px; height: 20px; }
