/* حارس العقارب – نظام التصميم */
@font-face { font-family: "Cairo"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url("fonts/cairo-arabic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url("fonts/cairo-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #060b16; --bg2: #08101f; --surface: #0c1527; --surface2: #101c33; --surface3: #15233d;
  --line: rgba(148, 163, 184, .11); --line2: rgba(148, 163, 184, .2);
  --ink: #eaf1fb; --ink2: #b9c5d8; --muted: #8394ad;
  --mint: #3be8c3; --mint-d: #0fbf98; --teal: #12a982; --red: #e5484d; --sos: #ef4444;
  --amber: #f5b301; --orange: #f97316; --blue: #38bdf8;
  --r: 18px; --r-sm: 12px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 40px -18px rgba(0, 0, 0, .7);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font: 15.5px/1.75 "Cairo", "Segoe UI", Tahoma, sans-serif; font-weight: 500;
  background: var(--bg); background-image:
    radial-gradient(900px 480px at 100% -5%, rgba(59, 232, 195, .07), transparent 60%),
    radial-gradient(900px 600px at -10% 20%, rgba(56, 120, 248, .08), transparent 60%);
  background-attachment: fixed; min-height: 100vh; }
svg { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
a { color: var(--mint); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.35; font-weight: 800; }
h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
h2 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
h2 small { color: var(--muted); font-weight: 600; font-size: .78rem; }
p { margin: .4em 0; }
.muted { color: var(--muted); font-size: .88rem; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.err { color: #ff9b9b; min-height: 1.4em; margin: 6px 0 0; }
.ok { color: var(--mint); min-height: 1.4em; margin: 6px 0 0; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; border-radius: 8px; }

/* ---------- الرأس ---------- */
.top { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 18px; height: 70px; padding: 0 22px;
  background: rgba(6, 11, 22, .82); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.logo { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: var(--mint);
  background: radial-gradient(circle at 50% 40%, rgba(59, 232, 195, .18), rgba(59, 232, 195, .02) 70%);
  border: 1.5px solid rgba(59, 232, 195, .7); box-shadow: 0 0 22px rgba(59, 232, 195, .35), inset 0 0 14px rgba(59, 232, 195, .18); }
.logo svg { width: 28px; height: 28px; filter: drop-shadow(0 0 6px rgba(59, 232, 195, .8)); }
.logo.sm { width: 34px; height: 34px; } .logo.sm svg { width: 20px; height: 20px; }
.brand-t { display: flex; flex-direction: column; line-height: 1.1; }
.brand-t b { font-size: 1.18rem; font-weight: 900; }
.brand-t small { color: var(--mint); font-size: .74rem; font-weight: 700; letter-spacing: .4px; }
.topnav { display: flex; gap: 2px; margin-inline-start: auto; }
.topnav a { display: inline-flex; align-items: center; gap: 7px; color: var(--ink2); padding: 8px 13px; border-radius: 10px; font-size: .9rem; font-weight: 600; transition: color .15s, background .15s; }
.topnav a svg { width: 17px; height: 17px; opacity: .85; }
.topnav a:hover { color: var(--ink); background: rgba(148, 163, 184, .07); }
.topnav a.on { color: var(--mint); background: rgba(59, 232, 195, .09); box-shadow: inset 0 0 0 1px rgba(59, 232, 195, .35); }
.top-act { display: flex; gap: 10px; align-items: center; }
.demo { background: #3b2f05; color: #fde68a; text-align: center; padding: 6px 16px; font-size: .88rem; }

main { max-width: 1240px; margin: 0 auto; padding: 22px 22px 48px; }
.view { display: none; } .view.on { display: block; animation: rise .35s cubic-bezier(.2, .7, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-h { margin-bottom: 16px; } .page-h h1 { margin-bottom: 2px; }

/* ---------- عناصر عامة ---------- */
.card { position: relative; background: linear-gradient(180deg, var(--surface2), var(--surface)); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 18px 16px; box-shadow: var(--shadow); }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.narrow { max-width: 430px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > label { flex: 1 1 150px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
label { display: block; margin: 10px 0; font-size: .86rem; color: var(--muted); font-weight: 600; }
input, select { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line2);
  background: var(--bg2); color: var(--ink); font: inherit; font-weight: 600; }
input::placeholder { color: #4d5d78; }
input:focus, select:focus { outline: none; border-color: rgba(59, 232, 195, .6); box-shadow: 0 0 0 3px rgba(59, 232, 195, .15); }
input[type=range] { padding: 0; accent-color: var(--mint); border: 0; background: none; }
input[type=checkbox] { width: auto; display: inline; margin: 0; accent-color: var(--mint); }
details summary { cursor: pointer; color: var(--ink2); margin: 10px 0; font-weight: 700; font-size: .9rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 10px 18px;
  background: linear-gradient(180deg, #4af0cc, var(--mint-d)); color: #032a21; font: inherit; font-weight: 800; cursor: pointer;
  transition: transform .12s, filter .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); } .btn:active { transform: translateY(1px) scale(.99); }
.btn.ghost { background: rgba(255, 255, 255, .03); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px rgba(59, 232, 195, .5); color: var(--mint); }
.btn.sos { background: linear-gradient(180deg, #f75a5a, #d92d2d); color: #fff; box-shadow: 0 10px 26px -10px rgba(239, 68, 68, .9), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.pill { border-radius: 999px; padding: 9px 18px; }
.btn.lg { padding: 13px 22px; font-size: 1rem; }
.btn.sm { padding: 6px 12px; font-size: .82rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.ok-b { background: rgba(18, 169, 130, .14); color: var(--mint); box-shadow: inset 0 0 0 1px rgba(59, 232, 195, .45); }
.btn.no-b { background: rgba(229, 72, 77, .12); color: #ff9b9b; box-shadow: inset 0 0 0 1px rgba(229, 72, 77, .5); }
.install-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--mint); border: 1px solid rgba(59, 232, 195, .45);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; }
.install-btn[hidden] { display: none; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.status:empty { display: none; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); }
.status.good { background: rgba(18, 169, 130, .14); color: var(--mint); }
.status.good::before { animation: pulse 1.8s infinite; }
.status.bad { background: rgba(229, 72, 77, .14); color: #ff9b9b; }
.status.warnp { background: rgba(245, 179, 1, .14); color: var(--amber); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }
code { background: var(--bg2); padding: 2px 8px; border-radius: 6px; font-family: ui-monospace, monospace; color: var(--mint); }
.warn { background: rgba(229, 72, 77, .1); border: 1px solid rgba(229, 72, 77, .35); color: #ffd1d1; padding: 10px 14px; border-radius: 12px; margin: 12px 0; }

/* ---------- البطل ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; border-radius: 24px; border: 1px solid var(--line2); min-height: 380px;
  background: #0a1430; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); }
.hero-photo { position: absolute; inset: 0 auto 0 0; width: 64%; height: 100%; object-fit: cover; object-position: 50% 62%; z-index: -2; }
.hero-shade { position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(270deg, #070e1f 0%, #070e1f 36%, rgba(7, 14, 31, .82) 48%, rgba(7, 14, 31, .25) 70%, rgba(7, 14, 31, .05) 100%),
              linear-gradient(0deg, rgba(6, 11, 22, .6), transparent 40%); }
.hero-in { display: grid; grid-template-columns: 170px minmax(0, 520px); gap: 26px; padding: 40px 38px; min-height: 380px; align-items: center; }
.hero-side { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.emblem { color: var(--mint); }
.emblem svg { width: 104px; height: 104px; filter: drop-shadow(0 0 10px rgba(59, 232, 195, .9)) drop-shadow(0 0 28px rgba(59, 232, 195, .55)); animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { filter: drop-shadow(0 0 14px rgba(59, 232, 195, 1)) drop-shadow(0 0 40px rgba(59, 232, 195, .7)); } }
.feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; align-self: stretch; }
.feats li { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .95rem; }
.feats i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--mint);
  background: rgba(59, 232, 195, .08); border: 1px solid rgba(59, 232, 195, .45); box-shadow: 0 0 14px rgba(59, 232, 195, .2); }
.feats i svg { width: 18px; height: 18px; }
.hero h1 { font-size: clamp(1.7rem, 3.3vw, 2.45rem); font-weight: 900; line-height: 1.3; text-shadow: 0 2px 20px rgba(0, 0, 0, .5); }
.hero p { color: var(--ink2); font-size: 1rem; margin: 12px 0 20px; max-width: 46ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- البطاقات الرقمية ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0; }
.tile { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface2), var(--surface)); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.tile::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 160px; height: 160px; border-radius: 50%; background: var(--c); opacity: .07; filter: blur(10px); }
.tile i { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.tile i svg { width: 28px; height: 28px; }
.tile b { display: block; font-size: 2rem; line-height: 1.05; font-weight: 900; color: var(--c); }
.tile span { display: block; color: var(--ink2); font-size: .86rem; font-weight: 600; }
.tile span small { color: var(--muted); font-size: .75rem; }
.tile em { display: flex; align-items: center; gap: 4px; font-style: normal; font-size: .76rem; font-weight: 700; margin-top: 3px; color: var(--muted); }
.tile em.good { color: var(--mint); } .tile em.bad { color: #ff9b9b; }
.t-red { --c: #ff5c61; } .t-amber { --c: var(--amber); } .t-green { --c: var(--mint); } .t-blue { --c: var(--blue); }

/* ---------- الشبكة الثلاثية ---------- */
.grid3 { display: grid; grid-template-columns: 1.3fr 1fr .85fr; gap: 16px; }
.chart-box { position: relative; height: 230px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink2); font-size: .8rem; font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.c-det { background: var(--teal); } .c-st { background: var(--red); }
.tbl-view summary { font-size: .8rem; color: var(--muted); margin: 8px 0 0; }
.tbl-view table { margin-top: 6px; }

.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th, .tbl td { text-align: start; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { color: var(--muted); font-weight: 700; font-size: .76rem; }
.tbl tbody tr { transition: background .15s; } .tbl tbody tr:hover { background: rgba(148, 163, 184, .04); }
.tbl td[dir=ltr] { text-align: right; }
.tbl.compact td, .tbl.compact th { padding: 8px 4px; }
.tbl .rank { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--surface3); font-size: .75rem; font-weight: 800; color: var(--ink2); }
.tbl .n-det { color: var(--mint); font-weight: 800; } .tbl .n-st { color: #ff7a7e; font-weight: 800; }
.tbl-scroll { overflow-x: auto; }

/* حالة الجهاز */
.dev-mini { display: grid; gap: 2px; font-size: .88rem; }
.dev-mini > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.dev-mini span { color: var(--muted); font-weight: 600; }
.dev-mini b { font-weight: 800; }
.bars { display: inline-flex; gap: 3px; align-items: end; height: 16px; }
.bars i { width: 4px; background: var(--surface3); border-radius: 2px; }
.bars i.on { background: var(--mint); box-shadow: 0 0 6px rgba(59, 232, 195, .6); }
.dot-on { display: inline-flex; align-items: center; gap: 6px; color: var(--mint); }
.dot-on::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 14px 6px; color: var(--muted); font-size: .88rem; }
.empty svg { width: 46px; height: 46px; color: #24365a; }

/* معرض الكشوف */
#home-gal { margin-top: 16px; }
.dets { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.det { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 8px; display: grid; gap: 8px; transition: border-color .2s, transform .2s; }
.det:hover { border-color: rgba(59, 232, 195, .35); transform: translateY(-2px); }
.det.yes { border-color: rgba(59, 232, 195, .55); } .det.no { opacity: .5; }
.det img, .noimg { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 11px; background: #000; display: block; }
.det .when { position: absolute; top: 15px; right: 15px; background: rgba(4, 8, 16, .75); backdrop-filter: blur(6px); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.det .meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); padding: 0 4px; }
.det .row { gap: 6px; } .det .row .btn { flex: 1; }
.noimg { display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.gal-empty { position: relative; overflow: hidden; border-radius: 16px; min-height: 200px; display: grid; place-items: center; text-align: center; padding: 24px; border: 1px dashed var(--line2); }
.gal-empty img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .32; z-index: 0; }
.gal-empty > div { position: relative; z-index: 1; display: grid; gap: 10px; justify-items: center; }
.gal-empty b { font-size: 1.05rem; }

/* ---------- بلاغ طارئ ---------- */
.sos-wrap { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.sos-card { position: relative; overflow: hidden; border-radius: 24px; padding: 22px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #ff6b5e 0%, #e53935 40%, #9f1a1a 100%); box-shadow: 0 24px 50px -22px rgba(229, 57, 53, .8); }
.sos-card::after { content: ""; position: absolute; inset: auto auto -60px -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.sos-top { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.sos-top h1 { font-size: 1.7rem; font-weight: 900; } .sos-top p { margin: 0; opacity: .92; font-weight: 600; }
.sos-ic { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: rgba(255, 255, 255, .18); animation: ring 1.6s infinite; }
.sos-ic svg { width: 30px; height: 30px; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .5); } 100% { box-shadow: 0 0 0 18px rgba(255, 255, 255, 0); } }
.call-big { position: relative; z-index: 1; margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 14px; background: #fff; color: #d32f2f;
  border-radius: 18px; padding: 14px; box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .5); transition: transform .15s; }
.call-big:active { transform: scale(.98); }
.call-big svg { width: 32px; height: 32px; }
.call-big b { display: block; font-size: 1.5rem; font-weight: 900; line-height: 1.15; } .call-big small { color: #8a2b2b; font-weight: 700; }
.dd { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dd-card { background: #fff; color: #18202e; border-radius: 18px; padding: 14px; box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .7); }
.dd-card h2 { font-size: 1rem; margin-bottom: 8px; }
.dd-card h2 i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; }
.dd-card h2 i svg { width: 16px; height: 16px; }
.do h2 { color: #0e8f6c; } .do h2 i { background: #12a982; }
.dont h2 { color: #c62828; } .dont h2 i { background: #e5484d; }
.dd-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dd-card li { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; font-weight: 600; line-height: 1.5; padding: 6px 8px; border-radius: 10px; }
.do li { background: #effaf6; } .dont li { background: #fdf0f0; }
.dd-card li svg { width: 17px; height: 17px; margin-top: 2px; }
.do li svg { color: #12a982; } .dont li svg { color: #e5484d; }
.age-card h2 { justify-content: center; margin-bottom: 12px; }
.ages { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.age { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 10px; border-radius: 16px; border: 2px solid transparent;
  background: #fff; color: #18202e; font: inherit; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.age svg { width: 42px; height: 42px; color: #334155; margin-bottom: 4px; }
.age b { font-size: 1.15rem; font-weight: 900; } .age small { color: #64748b; font-weight: 700; }
.age:hover { transform: translateY(-2px); }
.age.sel { border-color: var(--mint); box-shadow: 0 0 0 4px rgba(59, 232, 195, .25); }
#sting-out h3 { margin: 16px 0 8px; font-size: 1rem; }
.fac { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; margin-top: 8px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); }
.fac-i { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.fac-i > svg { color: #ff5c61; width: 24px; height: 24px; margin-top: 2px; }
.fac-i b { display: block; font-size: .92rem; } .fac-i span { display: block; }
.fac .row { flex-wrap: nowrap; }

/* ---------- الخريطة ---------- */
.map-card { background: linear-gradient(180deg, var(--surface2), var(--surface)); border: 1px solid var(--line); border-radius: 24px; padding: 16px; box-shadow: var(--shadow); }
.map-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.map-head h1 { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; } .map-head h1 svg { color: var(--mint); }
.map-ctl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sel { position: relative; margin: 0; }
.sel select { appearance: none; -webkit-appearance: none; margin: 0; padding: 8px 14px 8px 34px; border-radius: 999px; background: var(--bg2); min-width: 150px; font-size: .86rem; }
.sel svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.chk { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 7px 12px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line2); color: var(--ink2); cursor: pointer; font-size: .84rem; }
.map-wrap { position: relative; }
#map { height: min(66vh, 620px); min-height: 400px; border-radius: 18px; border: 1px solid var(--line2); background: #0a1120; }
.leaflet-container { font-family: inherit; background: #0a1120; }
.leaflet-container svg { width: auto; height: auto; vertical-align: baseline; }
.leaflet-bar a { background: var(--surface2); color: var(--ink); border-color: var(--line2) !important; }
.leaflet-bar a:hover { background: var(--surface3); }
.leaflet-control-attribution { background: rgba(6, 11, 22, .7) !important; color: var(--muted) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--ink2); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface2); color: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.leaflet-popup-content { font-family: inherit; margin: 10px 14px; }
.leaflet-tooltip { background: var(--surface2); color: var(--ink); border: 1px solid var(--line2); font-family: inherit; font-weight: 700; box-shadow: none; }
.glow-dot { filter: drop-shadow(0 0 4px rgba(59,232,195,.55)); }
.map-legend { position: absolute; top: 12px; right: 12px; z-index: 500; background: rgba(8, 14, 27, .88); backdrop-filter: blur(8px); border: 1px solid var(--line2);
  border-radius: 14px; padding: 10px 14px; display: grid; gap: 5px; font-size: .8rem; font-weight: 600; }
.map-legend b { font-size: .84rem; margin-bottom: 2px; }
.map-legend span { display: flex; align-items: center; gap: 8px; color: var(--ink2); }
.map-legend i { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.map-info { position: absolute; bottom: 14px; right: 12px; z-index: 500; background: rgba(8, 14, 27, .92); border: 1px solid var(--line2); border-radius: 14px; padding: 10px 14px; font-size: .84rem; min-width: 200px; }
.map-info b { display: block; font-size: 1rem; margin-bottom: 4px; }
.map-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.map-stats > div { display: flex; align-items: center; gap: 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.map-stats i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; }
.map-stats i svg { width: 22px; height: 22px; }
.map-stats span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.map-stats b { display: block; color: var(--ink); font-size: 1.35rem; font-weight: 900; line-height: 1.1; }
.c-amber { color: var(--amber); background: rgba(245, 179, 1, .12); } .c-green { color: var(--mint); background: rgba(59, 232, 195, .12); }
.c-blue { color: var(--blue); background: rgba(56, 189, 248, .12); } .c-teal { color: #5eead4; background: rgba(94, 234, 212, .12); }
.c-red { color: #ff6b6b; background: rgba(229, 72, 77, .12); }

/* ---------- الأجهزة واللوحة ---------- */
.login-card { margin: 10px auto 0; text-align: center; }
.login-card label { text-align: start; }
.login-ic { display: grid; place-items: center; width: 56px; height: 56px; margin: 4px auto 6px; border-radius: 16px; color: var(--mint); background: rgba(59, 232, 195, .1); }
.login-ic svg { width: 28px; height: 28px; }
.dev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.kv { display: grid; gap: 2px; margin: 4px 0 14px; }
.kv > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv span { color: var(--muted); display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.kv span svg { width: 16px; height: 16px; }
#settings h2 { margin-bottom: 6px; }
.switch { display: flex; align-items: center; gap: 10px; color: var(--ink); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-ui { width: 42px; height: 24px; border-radius: 999px; background: var(--surface3); position: relative; transition: background .2s; flex: none; }
.sw-ui::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + .sw-ui { background: var(--mint-d); }
.switch input:checked + .sw-ui::after { transform: translateX(-18px); }
.switch input:focus-visible + .sw-ui { outline: 2px solid var(--mint); outline-offset: 2px; }

/* ---------- التوعية ---------- */
.info-hero { display: grid; grid-template-columns: 1fr 1.1fr; gap: 0; overflow: hidden; border-radius: 24px; border: 1px solid var(--line2); background: var(--surface); }
.info-hero img { width: 100%; height: 100%; min-height: 260px; object-fit: cover; }
.info-hero > div { padding: 30px; align-self: center; }
.info-hero p { color: var(--ink2); }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px; }
.card.info > i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; margin-bottom: 10px; }
.card.info > i svg { width: 24px; height: 24px; }
.card.info p, .dots { color: var(--ink2); margin: 8px 0 0; }
.dots { padding-inline-start: 1.1em; } .dots li { margin: 3px 0; }

dialog { background: var(--surface2); color: var(--ink); border: 1px solid var(--line2); border-radius: 20px; max-width: 440px; width: calc(100% - 32px); padding: 20px; }
dialog::backdrop { background: rgba(2, 5, 12, .7); backdrop-filter: blur(3px); }
.file { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px dashed var(--line2); border-radius: 12px; color: var(--ink2); cursor: pointer; }
.file input { margin: 0; padding: 0; border: 0; background: none; width: auto; flex: 1; min-width: 0; font-size: .8rem; }

footer { max-width: 1240px; margin: 10px auto 0; padding: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.foot-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; } .foot-brand b { color: var(--ink); font-size: 1.05rem; }
footer .credits { font-size: .74rem; opacity: .8; }

/* ---------- شريط التطبيق (الهاتف) ---------- */
.tabbar { display: none; }

@media (max-width: 1120px) {
  .topnav a { padding: 8px 9px; font-size: .84rem; } .topnav a svg { display: none; }
  .grid3 { grid-template-columns: 1fr 1fr; } .grid3 > .card:first-child { grid-column: 1 / -1; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .topnav, .top-act .pill { display: none; }
  .top { height: 62px; padding: 0 14px; } .top-act { margin-inline-start: auto; }
  main { padding: 12px 12px 110px; }
  .hero { min-height: 0; border-radius: 20px; }
  .hero-photo { position: relative; inset: auto; width: 100%; height: 210px; display: block; }
  .hero-shade { background: linear-gradient(0deg, #070e1f 0%, #070e1f 52%, rgba(7, 14, 31, .1) 76%); }
  .hero-in { grid-template-columns: 1fr; padding: 0 18px 20px; margin-top: -70px; min-height: 0; gap: 14px; }
  .hero-side { flex-direction: row; justify-content: space-between; align-items: center; order: 2; }
  .emblem { display: none; }
  .feats { grid-auto-flow: column; justify-content: space-between; }
  .feats li { flex-direction: column; gap: 4px; font-size: .8rem; }
  .hero h1 { font-size: 1.55rem; }
  .hero-actions .btn { flex: 1 1 auto; }
  .tiles { gap: 10px; }
  .tile { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }
  .tile i { width: 42px; height: 42px; border-radius: 12px; } .tile i svg { width: 22px; height: 22px; }
  .tile b { font-size: 1.65rem; }
  .grid3, .two, .dev-grid, .info-grid, .info-hero { grid-template-columns: 1fr; }
  .map-card { padding: 10px; border-radius: 20px; }
  .map-head h1 { font-size: 1.1rem; }
  #map { height: 58vh; min-height: 340px; }
  .map-legend { top: 8px; right: 8px; padding: 8px 10px; font-size: .74rem; }
  .map-stats { grid-template-columns: 1fr 1fr; }
  .dd-card { padding: 11px; } .dd-card li { font-size: .8rem; padding: 5px 6px; } .dd-card h2 { font-size: .92rem; }
  .sos-top h1 { font-size: 1.45rem; }
  .hot-t th:nth-child(3), .hot-t td:nth-child(3) { display: none; }
  footer { padding-bottom: 100px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 1100;
    background: rgba(8, 13, 26, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: .7rem; font-weight: 700; padding: 4px 0; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--mint); }
  .tabbar .tab-sos { color: #ffb4b4; }
  .tabbar .tab-sos span { display: grid; place-items: center; width: 54px; height: 54px; margin-top: -28px; border-radius: 50%; color: #fff;
    background: linear-gradient(180deg, #f75a5a, #c62828); box-shadow: 0 8px 22px -6px rgba(239, 68, 68, .9); border: 4px solid var(--bg); }
  .tabbar .tab-sos.on span { box-shadow: 0 0 0 4px rgba(239, 68, 68, .3), 0 8px 22px -6px rgba(239, 68, 68, .9); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- اللغات ---------- */
.lang { display: flex; background: rgba(148, 163, 184, .08); border: 1px solid var(--line2); border-radius: 999px; padding: 3px; gap: 2px; }
.lang button { font: inherit; font-size: .78rem; font-weight: 800; color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 4px 9px; cursor: pointer; min-width: 34px; line-height: 1.4; }
.lang button[aria-pressed="true"] { background: var(--mint); color: #032a21; }
.lang button:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; }
.card.info.wide { grid-column: 1 / -1; }
.c-violet { color: #a78bfa; background: rgba(167, 139, 250, .12); }
.dots li .li-ic { width: 1.1em; height: 1.1em; vertical-align: -0.2em; margin-inline-end: 6px; color: var(--mint); }
.card.info.wide .dots { list-style: none; padding-inline-start: 0; }
/* اتجاه من اليسار إلى اليمين (الفرنسية والإنجليزية) */
html[dir=ltr] .fl { transform: scaleX(-1); }
html[dir=ltr] .tbl td[dir=ltr] { text-align: left; }
html[dir=ltr] .det .when { right: auto; left: 15px; }
html[dir=ltr] .sel svg { left: auto; right: 12px; }
html[dir=ltr] .sel select { padding: 8px 34px 8px 14px; }
html[dir=ltr] .sw-ui::after { right: auto; left: 3px; }
html[dir=ltr] .switch input:checked + .sw-ui::after { transform: translateX(18px); }
html[dir=ltr] .hero-shade { background: linear-gradient(90deg, #070e1f 0%, #070e1f 36%, rgba(7, 14, 31, .82) 48%, rgba(7, 14, 31, .25) 70%, rgba(7, 14, 31, .05) 100%),
  linear-gradient(0deg, rgba(6, 11, 22, .6), transparent 40%); }
@media (min-width: 821px) { html[dir=ltr] .hero-photo { inset: 0 0 0 auto; } }
@media (max-width: 820px) {
  html[dir=ltr] .hero-shade { background: linear-gradient(0deg, #070e1f 0%, #070e1f 52%, rgba(7, 14, 31, .1) 76%); }
  .lang button { padding: 4px 7px; min-width: 30px; }
}
