/* MADAR Network — الموقع الرسمي. خطوط النظام فقط (سياسة أمان الموقع تمنع الخطوط الخارجية). */
:root {
  /* أسود عميق + أزرق ياقوتي/ملكي (طلب المالك: فخامة) */
  --bg: #030407;
  --bg-2: #07090f;
  --panel: rgba(12, 16, 26, 0.78);
  --panel-solid: #0a0e17;
  --line: rgba(110, 140, 220, 0.12);
  --line-2: rgba(110, 140, 220, 0.24);
  --text: #eef3fc;
  --muted: #8e9ab0;
  --teal: #5aa9ff;
  --blue: #3d7bff;
  --indigo: #1d4ed8;
  --gold: #ffc857;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --grad: linear-gradient(120deg, #7cc0ff, var(--blue) 50%, var(--indigo));
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI", system-ui, -apple-system, "Tahoma", "Noto Sans Arabic", "Geeza Pro", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; word-break: break-all; }

/* خلفية: وهج ومدارات خفيفة */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(29, 78, 216, 0.28), transparent 60%),
    radial-gradient(700px 480px at -10% 30%, rgba(61, 123, 255, 0.10), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(29, 78, 216, 0.14), transparent 60%),
    var(--bg); }
.sky::before, .sky::after { content: ""; position: absolute; border: 1px solid rgba(120, 160, 255, 0.10); border-radius: 50%; }
.sky::before { width: 1100px; height: 420px; top: 60px; right: -320px; transform: rotate(-18deg); }
.sky::after { width: 1500px; height: 560px; top: 20px; right: -520px; transform: rotate(-18deg); border-color: rgba(90, 169, 255, 0.06); }

.wrap { width: min(1160px, 100% - 40px); margin: 0 auto; }

/* الترويسة */
header.top { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); background: rgba(6, 10, 19, 0.72); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; height: 70px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.brand img { height: 34px; width: auto; }
nav.main { display: flex; align-items: center; gap: 6px; }
.nav-link { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-size: 14.5px; transition: color .2s, background .2s; }
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-dl { padding: 9px 16px; border-radius: 11px; background: var(--grad); color: #ffffff; font-weight: 700; font-size: 14.5px; }
.lang { position: relative; }
.lang-btn { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; }
.lang-btn:hover { color: var(--text); }
.lang-menu { position: absolute; inset-inline-end: 0; top: 46px; min-width: 160px; padding: 6px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.lang-menu button { display: block; width: 100%; text-align: start; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.lang-menu button:hover, .lang-menu button.active { background: rgba(61, 123, 255, 0.14); }
.menu-btn { display: none; }

/* البطل */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 72px 0 40px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--muted); font-size: 13px; }
.pill .live { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
h1 { font-size: clamp(38px, 5.4vw, 64px); line-height: 1.08; margin: 18px 0 16px; letter-spacing: -0.5px; }
h1 .grad, .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
[dir="rtl"] h1 { letter-spacing: 0; line-height: 1.25; }
[dir="rtl"] h1 br { display: none; }
[dir="rtl"] h1 [data-i="h1a"]::after { content: " "; }
.lead { font-size: 18.5px; color: var(--muted); max-width: 620px; margin: 0 0 28px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 22px; border-radius: 14px; font-weight: 700; font-size: 16px; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--grad); color: #ffffff; box-shadow: 0 12px 36px rgba(61, 123, 255, 0.35); }
.btn.ghost { border-color: var(--line-2); color: var(--text); background: rgba(255, 255, 255, 0.03); }
.btn svg { width: 20px; height: 20px; }
.cta-note { margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.cta-note a { color: var(--blue); }
.hero-art { position: relative; display: grid; place-items: center; min-height: 360px; }
.hero-art::before { content: ""; position: absolute; width: min(420px, 90%); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 45% 40%, rgba(29, 78, 216, 0.30), rgba(3, 4, 7, 0) 68%); }
.hero-logo { position: relative; width: min(480px, 96%); animation: float 7s ease-in-out infinite; }
.hero-logo img { display: block; width: 100%; filter: drop-shadow(0 24px 60px rgba(29, 78, 216, 0.35)); }
.hero-logo .orbit { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.orbit .sun-still { display: none; }
@media (prefers-reduced-motion: reduce) { .orbit .sun-move { display: none; } .orbit .sun-still { display: inline; } }
@keyframes float { 50% { transform: translateY(-12px); } }

/* الشريط الحي */
.live-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--line); margin: 10px 0 70px; }
.live-strip > div { background: var(--panel-solid); padding: 18px 20px; }
.live-strip .k { font-size: 12.5px; color: var(--muted); }
.live-strip .v { font-size: 24px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.live-strip .v.good { color: var(--good); } .live-strip .v.warn { color: var(--warn); } .live-strip .v.bad { color: var(--bad); }
.live-strip .sub { font-size: 12px; color: var(--muted); }
.live-strip a { color: var(--blue); font-size: 12.5px; }

/* الأقسام */
section.block { padding: 30px 0 70px; }
.eyebrow { color: var(--teal); font-weight: 700; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; }
[dir="rtl"] .eyebrow { letter-spacing: 0; }
h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.2; margin: 8px 0 14px; }
.section-lead { color: var(--muted); max-width: 700px; margin: 0 0 34px; font-size: 17px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; backdrop-filter: blur(6px); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step .n { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(61, 123, 255, 0.14); color: var(--blue); font-weight: 800; }
.step h3, .feature h3 { margin: 14px 0 6px; font-size: 18.5px; }
.step p, .feature p { margin: 0; color: var(--muted); font-size: 15px; }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(61, 123, 255, 0.12); }
.feature .ic svg { width: 22px; height: 22px; fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* التحميل */
.dl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.dl { display: flex; flex-direction: column; gap: 10px; }
.dl .os { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.dl .os svg { width: 26px; height: 26px; fill: currentColor; }
.dl .meta { color: var(--muted); font-size: 13.5px; flex: 1; }
.dl .btn { width: 100%; padding: 12px 16px; font-size: 15px; }
.dl.recommended { border-color: rgba(61, 123, 255, 0.55); box-shadow: 0 0 0 1px rgba(61, 123, 255, 0.25), var(--shadow); }
.dl .tag { align-self: flex-start; font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: rgba(61, 123, 255, 0.16); color: var(--blue); font-weight: 700; }
.dl.soon { opacity: .6; }
.dl.soon .btn { cursor: default; }
details.verify { margin-top: 18px; }
details.verify summary, details.qa summary { cursor: pointer; list-style: none; }
details.verify summary::-webkit-details-marker, details.qa summary::-webkit-details-marker { display: none; }
details.verify summary { color: var(--blue); font-weight: 600; font-size: 14.5px; }
details.verify .body { margin-top: 12px; color: var(--muted); font-size: 14px; }
details.verify .body p { margin: 8px 0; }

/* الأسئلة */
.faq { display: grid; gap: 12px; max-width: 860px; }
details.qa { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; }
details.qa summary { font-weight: 700; font-size: 16.5px; display: flex; justify-content: space-between; gap: 16px; }
details.qa summary::after { content: "+"; color: var(--blue); font-size: 22px; line-height: 1; }
details.qa[open] summary::after { content: "−"; }
details.qa p { color: var(--muted); margin: 12px 0 0; font-size: 15px; }

/* التواصل والتذييل */
.contact { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.contact p { margin: 0; color: var(--muted); }
.contact-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn.social { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: rgba(61, 123, 255, 0.08); color: var(--text); }
.btn.social:hover { border-color: var(--blue); }
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 13.5px; }
footer .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }
footer .links { display: flex; gap: 18px; flex-wrap: wrap; }
footer a:hover { color: var(--text); }

/* صفحة الحالة */
.status-hero { padding: 56px 0 26px; }
.state-banner { display: flex; align-items: center; gap: 18px; padding: 24px 26px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.state-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.state-banner.good .state-dot { background: var(--good); box-shadow: 0 0 0 6px rgba(52, 211, 153, .15); }
.state-banner.warn .state-dot { background: var(--warn); box-shadow: 0 0 0 6px rgba(251, 191, 36, .15); }
.state-banner.bad .state-dot { background: var(--bad); box-shadow: 0 0 0 6px rgba(248, 113, 113, .15); }
.state-banner h1 { font-size: clamp(24px, 3vw, 32px); margin: 0; }
.state-banner p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0; }
.metric .k { color: var(--muted); font-size: 13px; }
.metric .v { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; }
.metric .s { color: var(--muted); font-size: 12.5px; }
.chart-card h3 { margin: 0 0 12px; font-size: 16px; }
.chart { width: 100%; height: 150px; }
.chart path.area { fill: rgba(61, 123, 255, 0.14); } .chart path.line { fill: none; stroke: var(--blue); stroke-width: 2; }
.chart path.line2 { fill: none; stroke: var(--teal); stroke-width: 2; stroke-dasharray: 4 3; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-inline-end: 6px; }
.explain { color: var(--muted); font-size: 14.5px; }
.explain h3 { color: var(--text); font-size: 16px; margin: 0 0 6px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; }
  .hero-art { min-height: 220px; order: -1; }
  .hero-logo { width: min(340px, 90%); }
  .grid3, .grid4, .dl-grid, .metrics { grid-template-columns: 1fr 1fr; }
  .live-strip { grid-template-columns: 1fr 1fr; }
  nav.main .nav-link { display: none; }
}
@media (max-width: 600px) {
  .grid3, .grid4, .dl-grid, .metrics { grid-template-columns: 1fr; }
  .top .wrap { height: 62px; }
  .brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ===== المستكشف ===== */
.ex-card { margin-top: 16px; }
.ex-card h3 { margin: 0 0 12px; }
.ex-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ex-head h3 { margin: 0; }
.ex-search { flex: 1 1 260px; max-width: 380px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 9px 12px; font: inherit; font-size: 14px; }
.ex-search:focus { outline: none; border-color: var(--blue); }
.ex-scroll { overflow-x: auto; }
.ex-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ex-table th { text-align: start; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ex-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); vertical-align: top; }
.ex-table tbody tr:hover { background: rgba(61, 123, 255, 0.05); }
.ex-n { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.ex-addr { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.ex-ops { color: var(--teal); }
.ex-muted { color: var(--muted); }
.ex-ok { color: #3ddc97; white-space: nowrap; }
.ex-wait { color: #f5b942; white-space: nowrap; }
.ex-note { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* ===== المستكشف (تصميم المستكشفات) ===== */
.xp-hero { padding: 40px 0 8px; }
.xp-h1 { font-size: clamp(26px, 3.4vw, 38px); margin: 6px 0 18px; }
.xp-search { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 8px 16px; max-width: 760px; }
.xp-search svg { color: var(--muted); flex: none; }
.xp-search input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font: inherit; font-size: 15px; padding: 8px 4px; }
.xp-search input:focus { outline: none; }
.xp-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61, 123, 255, 0.15); }
.xp-search .btn { padding: 10px 20px; font-size: 14px; }
.xp-hint { color: #f5b942; font-size: 13.5px; min-height: 20px; margin: 8px 4px 0; }
.xp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.xp-stat { display: flex; gap: 14px; align-items: center; padding: 18px 20px; }
.xp-stat .k { color: var(--muted); font-size: 12.5px; }
.xp-stat .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 2px 0; }
.xp-stat .s { color: var(--muted); font-size: 12px; }
.xp-ic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(61, 123, 255, 0.12); color: var(--blue); }
.xp-ic.ok { background: rgba(61, 220, 151, 0.12); color: #3ddc97; }
.xp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.xp-panel { padding: 0; overflow: hidden; }
.xp-panel-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.xp-panel-h h3 { margin: 0; font-size: 16px; }
.xp-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #3ddc97; }
.xp-live i { width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6); animation: xp-pulse 1.8s infinite; }
@keyframes xp-pulse { 70% { box-shadow: 0 0 0 8px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }
.xp-list { display: flex; flex-direction: column; }
.xp-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 20px; background: none; border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.xp-row:hover { background: rgba(61, 123, 255, 0.06); }
.xp-row.xp-static { cursor: default; }
.xp-row.xp-static:hover { background: none; }
.xp-box { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, 0.05); color: var(--muted); font-size: 12px; font-weight: 800; }
.xp-box.op { color: var(--teal); background: rgba(90, 169, 255, 0.1); }
.xp-mid { flex: 1; min-width: 0; }
.xp-line { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.xp-sub { margin-top: 3px; font-size: 13px; }
.xp-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.xp-link { color: var(--blue); font-weight: 700; font-variant-numeric: tabular-nums; }
.xp-op { color: var(--text); font-weight: 600; }
.xp-muted { color: var(--muted); }
.xp-small { font-size: 12px; }
.xp-mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; color: var(--teal); unicode-bidi: isolate; }
.xp-wrap { word-break: break-all; }
.xp-pill { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.xp-pill.ok { color: #3ddc97; background: rgba(61, 220, 151, 0.12); }
.xp-pill.wait { color: #f5b942; background: rgba(245, 185, 66, 0.12); }
.xp-more { width: 100%; padding: 13px; background: none; border: 0; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; }
.xp-more:hover { background: rgba(61, 123, 255, 0.06); }
.xp-empty, .xp-note { color: var(--muted); font-size: 13px; padding: 16px 20px; margin: 0; }
.xp-detail { padding: 0; margin-bottom: 16px; border-color: rgba(61, 123, 255, 0.45); }
.xp-close { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; }
.xp-dl { display: grid; grid-template-columns: 180px 1fr; gap: 0; margin: 0; }
.xp-dl dt, .xp-dl dd { padding: 13px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); margin: 0; }
.xp-dl dt { color: var(--muted); font-size: 13.5px; }
.xp-opline { padding: 3px 0; }
.xp-who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.xp-av { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; }
.xp-voters { display: flex; flex-direction: column; }
.xp-vrow { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 14px; align-items: center; padding: 13px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.xp-share { display: flex; align-items: center; gap: 10px; }
.xp-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.xp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7cc0ff, var(--blue)); }
@media (max-width: 900px) { .xp-stats { grid-template-columns: repeat(2, 1fr); } .xp-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .xp-stats { grid-template-columns: 1fr; } .xp-dl { grid-template-columns: 1fr; } .xp-dl dt { border-bottom: 0; padding-bottom: 2px; } .xp-vrow { grid-template-columns: 1fr; gap: 6px; } }
