/* © 2026 محمد فليان — جميع الحقوق محفوظة. تصميم وتطوير المنصة: محمد فليان. يُمنع نسخ الكود أو تعديله أو إعادة استخدامه دون إذن خطي من المطوّر. */
:root {
  --navy: #0c4a6e;
  --blue: #0284c7;
  --blue-d: #0369a1;
  --green: #047857;
  --gold: #ca8a04;
  --text: #334155;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --side: 400px;
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); overflow: hidden; }

/* ===== هيكل التطبيق: شريط علوي + لوحة جانبية + خريطة ===== */
.app {
  height: 100%; height: 100dvh;
  display: grid;
  grid-template-columns: var(--side) 1fr;
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "top top" "tabs map" "side map";
}
.panel { display: contents; }
.topbar { grid-area: top; }
.tabs { grid-area: tabs; }
.side { grid-area: side; }
.map-wrap { grid-area: map; position: relative; min-height: 0; }
#map { position: absolute; inset: 0; }

/* ===== التبويبات ===== */
.tabs { display: flex; background: #fff; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 6px; border: 0; border-bottom: 3px solid transparent; background: none;
  font: inherit; font-size: .9rem; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap;
  transition: color .15s, border-color .15s, background-color .15s;
}
.tab:hover { color: var(--navy); background: #f8fafc; }
.tab[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--blue); }
.tab.map-only { display: none; }

/* ===== اللوحة الجانبية ===== */
.side { background: #fff; border-left: 1px solid var(--line); overflow: hidden; min-height: 0; display: flex; flex-direction: column; }
.pane { display: none; padding: 14px 16px; overflow-y: auto; flex: 1; min-height: 0; }
.app[data-tab="dash"] .pane[data-pane="dash"],
.app[data-tab="data"] .pane[data-pane="data"],
.app[data-tab="about"] .pane[data-pane="about"],
.app[data-tab="sources"] .pane[data-pane="sources"],
.app[data-tab="guide"] .pane[data-pane="guide"] { display: block; }
.app[data-tab="search"] .pane[data-pane="search"] { display: flex; flex-direction: column; }

.sec-hd { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; border-bottom: 2px solid var(--blue-d); padding-bottom: 8px; margin: 18px 0 10px; }
.pane > .sec-hd:first-child { margin-top: 2px; }
.sec-hd h2 { margin: 0; font-size: 1.02rem; color: var(--ink); border-right: 5px solid var(--blue-d); padding-right: 8px; }
.hint { font-size: .78rem; color: var(--muted); }
.muted { color: var(--text); font-size: .9rem; line-height: 1.8; margin: 0 0 14px; }
.loading, .err { padding: 20px; text-align: center; color: var(--muted); }
.err { color: #b91c1c; }

/* ===== الكروت ===== */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.card {
  position: relative; overflow: hidden; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 8px 12px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 3px; background: var(--c); transform: scaleX(0); transform-origin: right; transition: transform .3s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(15,23,42,.10); border-color: var(--c); }
.card:hover::before { transform: scaleX(1); }
.icon { width: 36px; height: 36px; margin: 0 auto 6px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; background: var(--bg-c); }
.num { font-size: 1.7rem; font-weight: 800; color: var(--c); line-height: 1.15; font-variant-numeric: tabular-nums; }
.label { margin-top: 2px; font-size: .86rem; font-weight: 600; color: var(--text); }
.c1 { --c: #0284c7; --bg-c: #e0f2fe; }
.c2 { --c: #047857; --bg-c: #d1fae5; }
.c3 { --c: #ca8a04; --bg-c: #fef9c3; }
.c4 { --c: #7c3aed; --bg-c: #ede9fe; }

/* ===== الشارت ===== */
.chart { display: flex; flex-direction: column; gap: 2px; }
.bar {
  display: grid; grid-template-columns: 8.6em 1fr 2.4em; align-items: center; gap: 8px;
  width: 100%; padding: 5px 6px; border: 0; border-radius: 8px; background: transparent;
  font: inherit; color: var(--text); text-align: right; cursor: pointer; transition: background-color .15s;
}
.bar:hover, .bar:focus-visible { background: #f0f9ff; outline: none; }
.bar.on { background: #e0f2fe; }
.bar .nm { font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .tr { display: block; height: 12px; border-radius: 6px; background: #f1f5f9; overflow: hidden; }
.bar .fl { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--blue); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.bar.gz .fl { background: var(--green); }
.bar.on .fl { background: var(--navy); }
.bar .vl { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; font-size: .92rem; }
.legend-note { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: .78rem; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--blue); }

/* ===== البحث ===== */
.fld { display: block; margin-bottom: 12px; }
.fld span { display: block; font-size: .85rem; font-weight: 700; color: var(--navy); margin-bottom: 5px; }
.fld input, .fld select {
  width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 9px;
  font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
}
.fld input:focus, .fld select:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.res-hd { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); padding: 2px 2px 6px; border-bottom: 1px solid var(--line); }
.link { border: 0; background: none; color: var(--blue-d); font: inherit; font-weight: 700; cursor: pointer; padding: 2px 4px; }
.link:hover { text-decoration: underline; }
.results { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.results li button {
  display: block; width: 100%; text-align: right; border: 0; border-bottom: 1px solid #f1f5f9; background: none;
  padding: 8px 6px; font: inherit; cursor: pointer; border-radius: 6px;
}
.results li button:hover, .results li button:focus-visible { background: #f0f9ff; outline: none; }
.results li button.on { background: #e0f2fe; }
.results .n { display: block; font-weight: 700; color: var(--ink); font-size: .95rem; }
.results .s { display: block; font-size: .8rem; color: var(--muted); margin-top: 1px; }
.results .empty { padding: 16px 4px; color: var(--muted); font-size: .9rem; }

/* ===== البيانات ===== */
.dl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dl li { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
.dl li:hover { border-color: #bae6fd; box-shadow: 0 4px 14px rgba(15,23,42,.06); }
.dl li > div { flex: 1; min-width: 0; }
.dl b { display: block; font-size: .95rem; color: var(--ink); }
.dl small { color: var(--muted); font-size: .8rem; }
.ic { flex: none; width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 800; color: #fff; }
.ic.pdf { background: #b91c1c; }
.ic.xls { background: #107c41; }
.ic.gdb { background: var(--ink); }
.btn { flex: none; padding: 8px 16px; border-radius: 8px; background: var(--blue-d); color: #fff; text-decoration: none; font-weight: 700; font-size: .88rem; transition: background-color .2s, transform .2s; }
.btn:hover { background: var(--navy); transform: translateY(-1px); }
.foot { margin: 22px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); text-align: center; }

/* ===== من نحن ===== */
.about p { margin: 0 0 10px; color: var(--text); font-size: .9rem; line-height: 1.9; text-align: justify; }
.about strong { color: var(--navy); }
.team { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.team li { position: relative; padding: 9px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); border-right: 3px solid var(--blue); }
.team.tech li { border-right-color: var(--green); }
.team b { display: block; font-size: .93rem; color: var(--ink); }
.team span { display: block; font-size: .8rem; color: var(--muted); margin-top: 1px; }
.team em { position: absolute; top: 9px; left: 10px; font-style: normal; font-size: .7rem; font-weight: 700; color: #854d0e; background: #fef9c3; padding: 1px 8px; border-radius: 999px; }

/* ===== أسماء التبويبات: كاملة على الحاسوب، مختصرة على الموبايل ===== */
.tab b { font-weight: inherit; }
.tab .ls { display: none; }
}

/* ===== الدليل: الفهرس ===== */
.gtoc { display: flex; flex-direction: column; gap: 3px; }
.gtoc button { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: right; border: 0; background: none; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: .9rem; color: var(--text); cursor: pointer; }
.gtoc button:hover { background: #f0f9ff; }
.gtoc button.sec { font-weight: 700; color: var(--ink); }
.gtoc button.gov { padding-right: 20px; font-size: .86rem; }
.gtoc button small { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .78rem; }
.gtoc button.on { background: #fef9c3; color: #854d0e; font-weight: 800; box-shadow: inset -3px 0 0 var(--gold); }
.gtoc-h { margin: 10px 0 2px; padding: 0 10px 4px; font-size: .8rem; font-weight: 800; color: var(--navy); border-bottom: 1px solid var(--line); }
.gpdf { display: block; margin-top: 14px; padding: 9px 12px; border-radius: 10px; border: 1px solid #bae6fd; background: #f0f9ff; color: var(--blue-d); font-weight: 700; font-size: .88rem; text-align: center; text-decoration: none; }
.gpdf:hover { background: #e0f2fe; }

/* ===== الدليل: القارئ ===== */
.reader { position: absolute; z-index: 7; display: flex; flex-direction: column; background: #fff; overflow: hidden; }
.reader[hidden] { display: none; }
.rd-hd { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 3px solid var(--gold); background: linear-gradient(120deg, #082f49, #0c4a6e 60%, #075985); color: #fff; }
.rd-t { flex: 1; min-width: 0; }
.rd-t span { display: block; font-size: .76rem; color: #facc15; font-weight: 700; }
.rd-t h2 { margin: 0; font-size: 1.2rem; line-height: 1.35; }
.rd-t small { display: block; font-size: .78rem; color: #bae6fd; }
.rd-act { display: flex; gap: 8px; flex: none; }
.rd-btn { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: .82rem; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.rd-btn:hover { background: rgba(255,255,255,.2); }
.rd-back { display: none; border: 0; background: rgba(255,255,255,.12); color: #fff; border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.rd-body { flex: 1; overflow-y: auto; padding: 16px 22px 26px; }
.rd-body[hidden] { display: none; }
.rd-doc { max-width: 820px; }
.rd-doc p { margin: 0 0 12px; line-height: 2; color: var(--text); text-align: justify; }
.rd-doc h3 { margin: 18px 0 8px; font-size: 1.02rem; color: var(--navy); border-right: 4px solid var(--gold); padding-right: 8px; }
.rd-doc ul { margin: 0 0 12px; padding-right: 22px; line-height: 1.9; color: var(--text); }
.rd-sign { margin-top: 18px; text-align: left; line-height: 1.8; }
.rd-sign b { display: block; font-size: 1.05rem; color: var(--navy); }
.rd-sign span { color: var(--muted); }
.rd-q { width: 100%; margin-bottom: 10px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 9px; font: inherit; font-size: .92rem; }
.rd-q:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
.rd-scroll { overflow-x: auto; }
.rd-tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.rd-tbl th { position: sticky; top: 0; background: var(--navy); color: #fff; font-weight: 700; padding: 8px 9px; text-align: right; white-space: nowrap; }
.rd-tbl td { padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rd-tbl tbody tr:nth-child(even) td { background: #f8fafc; }
.rd-tbl tbody tr:hover td { background: #fffbeb; }
.rd-tbl td.ar { font-weight: 700; font-size: .95rem; color: var(--ink); }
.rd-tbl td.cd { color: #854d0e; font-weight: 700; font-variant-numeric: tabular-nums; }
.rd-tbl td.en { direction: ltr; text-align: left; color: var(--text); }
.rd-tbl td.nt { color: var(--text); font-size: .82rem; }
.rd-tbl td.pn { width: 1%; white-space: nowrap; }
.rd-small { max-width: 560px; }
.bd { display: inline-block; min-width: 20px; margin-left: 3px; padding: 1px 5px; border-radius: 6px; background: #e0f2fe; color: var(--blue-d); font-style: normal; font-weight: 800; font-size: .74rem; text-align: center; }
.pin { border: 1px solid #fde68a; background: #fef9c3; color: #854d0e; border-radius: 7px; padding: 3px 9px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pin:hover { background: #fde68a; }
.rd-leg { margin-top: 12px; padding: 8px 12px; border-radius: 9px; background: #f8fafc; font-size: .8rem; color: var(--text); line-height: 2; }
.rd-leg span { margin-left: 12px; white-space: nowrap; }
.rd-leg .rd-leg-note { display: block; margin: 2px 0 0; font-weight: 700; color: var(--navy); }
.rd-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.rd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-chip { border: 1px solid #cbd5e1; background: #fff; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .82rem; font-weight: 700; color: var(--text); cursor: pointer; }
.rd-chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.rd-sel { padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-size: .85rem; background: #fff; }
.rd-count { margin: -4px 0 8px; font-size: .8rem; color: var(--muted); }
.rd-note { margin-top: 10px; font-size: .8rem; color: var(--muted); }

/* ===== بطاقة التجمع: الحد الجغرافي المعتمد ===== */
.loc-bnd { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.06); border-right: 3px solid #38bdf8; }
.loc-bnd > span { display: block; font-size: .74rem; color: #7dd3fc; font-weight: 700; margin-bottom: 3px; }
.loc-bnd .bd-i { display: inline-flex; align-items: center; margin-left: 10px; font-size: .84rem; color: #e0f2fe; white-space: nowrap; }
.loc-bnd .bd { background: rgba(56,189,248,.2); color: #e0f2fe; }

/* ===== popup ===== */
.pp { width: 100%; border-collapse: collapse; font-family: var(--font); direction: rtl; }
.pp th, .pp td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; text-align: right; vertical-align: top; font-size: .9rem; }
.pp th { color: var(--navy); font-weight: 700; white-space: nowrap; width: 38%; background: #f8fafc; }
.pp td { color: var(--ink); }
.esri-popup__main-container, .esri-popup__header-title { font-family: var(--font); }

/* ===== شاشات متوسطة ===== */
@media (max-width: 1100px) { .topbar p { display: none; } }

/* ===== موبايل: تبويب الخريطة + اللوحة فوق الخريطة ===== */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; grid-template-areas: "top" "tabs" "map"; }
  .side { grid-area: map; z-index: 3; border: 0; }
  .app[data-tab="map"] .side { display: none; }
  .tab.map-only { display: flex; }
  .tab { flex-direction: column; gap: 2px; font-size: .78rem; padding: 7px 2px; }
  .tab span { font-size: 1.05rem; }
  .tabs { border-left: 0; }
}

/* =====================================================================
   الهوية المشتركة (حاسوب + موبايل): هيدر كحلي/ذهبي، أزرار، توزيع جغرافي، بطاقة المحافظة، شارت متدرّج
   ===================================================================== */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 12px 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(202,138,4,.18), transparent 38%),
    radial-gradient(circle at 88% 120%, rgba(2,132,199,.35), transparent 45%),
    linear-gradient(120deg, #082f49 0%, #0c4a6e 55%, #075985 100%);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 6px 24px rgba(2,6,23,.35);
  position: relative; z-index: 6;
}
.topbar::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(to right, rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 28px 28px; }
.brand { position: relative; z-index: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.logo { flex: none; width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #facc15, #ca8a04); box-shadow: 0 4px 14px rgba(202,138,4,.45); font-size: 22px; }
.topbar h1 { margin: 0; color: #fff; font-size: 1.35rem; font-weight: 700; line-height: 1.3; }
.topbar h1 b { color: #facc15; }
.topbar p { margin: 2px 0 0; font-size: .88rem; color: #bae6fd; opacity: .9; }

.actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; flex: none; }
.live { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #e0f2fe; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2s infinite; }
.live small { color: #7dd3fc; font-weight: 500; }
.live small:not(:empty)::before { content: "·"; margin-left: 6px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.6); } 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.act { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; transition: background-color .2s, transform .2s, box-shadow .2s; white-space: nowrap; }
.act:hover:not(:disabled) { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.act:disabled { opacity: .5; cursor: default; }
.act.primary { background: linear-gradient(135deg, #facc15, #ca8a04); border-color: transparent; color: #422006; box-shadow: 0 4px 14px rgba(202,138,4,.35); }
.act.primary:hover:not(:disabled) { background: linear-gradient(135deg, #fde047, #eab308); }
.act.primary.on { background: #fff; color: #b91c1c; }
.act.icon-only { width: 38px; padding: 0; justify-content: center; font-size: 1.1rem; }

/* التوزيع الجغرافي */
.regions { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, #f0f9ff, #ecfdf5); border: 1px solid #e0f2fe; }
.regions .rg { display: flex; justify-content: space-between; align-items: baseline; }
.regions .rg div { display: flex; flex-direction: column; }
.regions .rg div:last-child { text-align: left; align-items: flex-end; }
.regions .rg b { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.regions .rg span { font-size: .8rem; color: var(--text); font-weight: 600; }
.regions .wb b { color: var(--blue); }
.regions .gz b { color: var(--green); }
.regions .split { display: flex; height: 8px; margin-top: 10px; border-radius: 4px; overflow: hidden; gap: 2px; }
.regions .split i { display: block; height: 100%; background: var(--blue); transition: flex-grow 1s ease; }
.regions .split i + i { background: var(--green); }

/* بطاقة المحافظة فوق الخريطة */
.spot {
  display: block; position: absolute; z-index: 4;
  padding: 18px 20px 16px; border-radius: 18px; color: #fff;
  background: linear-gradient(145deg, rgba(8,47,73,.94), rgba(12,74,110,.92));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(250,204,21,.35); border-top: 3px solid var(--gold);
  box-shadow: 0 24px 50px rgba(2,6,23,.4);
  animation: spotIn .45s cubic-bezier(.2,.8,.2,1);
}
.spot[hidden] { display: none; }
@keyframes spotIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.spot-x { position: absolute; top: 10px; left: 12px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: rgba(255,255,255,.1); color: #fff; font-size: 1.1rem; cursor: pointer; }
.spot-x:hover { background: rgba(255,255,255,.2); }
.spot-k { font-size: .78rem; color: #facc15; font-weight: 700; }
.spot-name { font-size: 1.7rem; font-weight: 800; line-height: 1.25; margin: 2px 0 14px; }
.spot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.spot-grid div { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 9px 12px; }
.spot-grid b { display: block; font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.spot-grid span { font-size: .78rem; color: #bae6fd; }
/* جدول بطاقة المحافظة: العنوان يمين والرقم يسار */
.spot-tbl { border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); }
.spot-tbl .tr { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 14px; background: rgba(255,255,255,.05); border-bottom: 1px solid rgba(255,255,255,.07); }
.spot-tbl .tr:nth-child(odd) { background: rgba(255,255,255,.08); }
.spot-tbl .tr:last-child { border-bottom: 0; }
.spot-tbl .tr > span { color: #bae6fd; font-size: .86rem; }
.spot-tbl .tr > b { flex: none; font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.spot-tbl .tr > b small { margin-right: 5px; font-size: .75rem; font-weight: 600; color: #bae6fd; }
.spot-tbl .tr.hl { background: rgba(250,204,21,.12); }
.spot-tbl .tr.hl > b { color: #facc15; font-size: 1.35rem; }
.spot-tour { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: .78rem; color: #bae6fd; }
.spot-tour[hidden] { display: none; }
.spot-tour i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.15); overflow: hidden; }
.spot-tour em { display: block; height: 100%; width: 0; background: #facc15; }

/* بطاقة التجمع (بدل الـ popup) — نفس أسلوب بطاقة المحافظة */
.loc .spot-k span:not(:empty) { margin-right: 8px; padding: 1px 8px; border-radius: 999px; background: rgba(250,204,21,.14); color: #fde68a; font-weight: 600; font-variant-numeric: tabular-nums; }
.loc .spot-name { margin-bottom: 4px; }
.loc-sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 12px; font-size: .86rem; color: #bae6fd; }
.chip { border: 1px solid rgba(250,204,21,.45); background: rgba(250,204,21,.1); color: #fde68a; border-radius: 999px; padding: 3px 12px; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; transition: background-color .2s; }
.chip:hover { background: rgba(250,204,21,.25); }
.spot-grid.g3 { grid-template-columns: repeat(3, 1fr); }
.spot-grid.g3 b { font-size: 1.25rem; white-space: nowrap; }
.loc-notes { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.06); border-right: 3px solid var(--gold); font-size: .84rem; line-height: 1.7; color: #e0f2fe; }
.loc-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.loc-nav span { font-size: .78rem; color: #7dd3fc; font-variant-numeric: tabular-nums; }
.nav-b { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; border-radius: 9px; padding: 6px 12px; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; transition: background-color .2s; }
.nav-b:hover:not(:disabled) { background: rgba(255,255,255,.18); }
.nav-b:disabled { opacity: .35; cursor: default; }
/* لما تكون بطاقة التجمع ظاهرة، بطاقة المحافظة تنخفي (بترجع بعد الإغلاق) */
.map-wrap.has-loc #spot { display: none; }

/* تلميح المحافظة عند المرور (الحاسوب فقط — ما في ماوس على الموبايل) */
.tip { display: block; position: absolute; z-index: 4; pointer-events: none; transform: translate(-50%, calc(-100% - 14px));
  padding: 7px 12px; border-radius: 10px; background: rgba(8,47,73,.95); color: #fff; font-size: .88rem; font-weight: 600; white-space: nowrap;
  box-shadow: 0 8px 20px rgba(2,6,23,.3); }
.tip[hidden] { display: none; }
.tip b { color: #facc15; margin-right: 6px; }

/* الشارت المتدرّج */
.bar .tr { height: 10px; }
.bar .fl { background: linear-gradient(90deg, #38bdf8, var(--blue)); }
.bar.gz .fl { background: linear-gradient(90deg, #34d399, var(--green)); }
.bar.on .fl { background: linear-gradient(90deg, #facc15, var(--gold)); }
.bar.on { background: #fef9c3; }

/* =====================================================================
   ترتيب الحاسوب: لوحة زجاجية عائمة فوق خريطة بعرض الشاشة
   ===================================================================== */
@media (min-width: 761px) {
  :root { --side: 392px; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; grid-template-areas: "top" "map"; }
  .panel {
    grid-area: map; justify-self: start; align-self: stretch;
    width: var(--side); margin: 16px; z-index: 5; min-height: 0;
    display: flex; flex-direction: column; overflow: hidden;
    background: rgba(255,255,255,.88);
    -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid rgba(255,255,255,.7); border-radius: 18px;
    box-shadow: 0 24px 60px rgba(2,6,23,.28), 0 2px 6px rgba(2,6,23,.08);
  }
  .tabs { background: transparent; border: 0; border-bottom: 1px solid rgba(15,23,42,.08); padding: 6px 6px 0; }
  .tab { border-radius: 10px 10px 0 0; }
  .side { background: transparent; border: 0; flex: 1; }
  .pane { padding: 16px 18px; }
  .card { background: rgba(255,255,255,.9); }
  .spot { left: 20px; bottom: 34px; width: 360px; }
  .spot.loc { width: 360px; }
  .reader { top: 16px; bottom: 16px; left: 16px; right: calc(var(--side) + 32px); border-radius: 16px; box-shadow: 0 24px 60px rgba(2,6,23,.45); }
  /* 6 تبويبات (مع المصادر): الأيقونة فوق الاسم حتى يتسعوا بعرض اللوحة */
  .tab { flex-direction: column; padding: 8px 2px 7px; font-size: .78rem; gap: 2px; }
  .tab span { font-size: 1.05rem; line-height: 1.1; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  :root { --side: 340px; }
  .tab { font-size: .72rem; padding: 8px 0 7px; }
  .tab .lf { display: none; }
  .tab .ls { display: inline; }
  .live { display: none; }
  .act b { display: none; }
  .spot { width: 320px; }
}

/* =====================================================================
   ترتيب الموبايل: نفس الهوية بحجم مضغوط
   ===================================================================== */
@media (max-width: 760px) {
  .topbar { padding: 8px 12px; gap: 10px; }
  .brand { gap: 10px; }
  .logo { width: 36px; height: 36px; font-size: 17px; border-radius: 11px; }
  .topbar h1 { font-size: 1.02rem; }
  .live, #fsBtn { display: none; }
  .act { height: 36px; padding: 0 12px; font-size: .82rem; }
  .act b { display: none; }
  .act.primary { width: 40px; padding: 0; justify-content: center; }

  /* التبويب الفعّال بلون ذهبي تحت الهيدر الكحلي */
  .tab[aria-selected="true"] { border-bottom-color: var(--gold); }

  /* بطاقة المحافظة: أسفل الخريطة بعرض الشاشة، وتظهر فقط على تبويب الخريطة */
  .spot { left: 10px; right: 10px; bottom: 26px; padding: 12px 14px 12px; border-radius: 16px; }
  .app:not([data-tab="map"]) .spot { display: none; }
  .spot-x { top: 8px; left: 10px; }
  .spot-name { font-size: 1.25rem; margin: 0 0 10px; }
  .spot-tbl .tr { padding: 6px 12px; }
  .spot-tbl .tr > span { font-size: .78rem; }
  .spot-tbl .tr > b { font-size: .98rem; }
  .spot-tbl .tr.hl > b { font-size: 1.15rem; }
  .spot-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .spot-grid div { padding: 7px 6px; text-align: center; border-radius: 10px; }
  .spot-grid b { font-size: 1.05rem; }
  .spot-grid span { font-size: .68rem; }
  .spot-tour { margin-top: 8px; }
  .spot-grid.g3 { grid-template-columns: repeat(3, 1fr); }
  .spot-grid.g3 b { font-size: 1rem; }
  .loc-sub { margin-bottom: 8px; font-size: .8rem; }
  .loc-notes { margin-top: 8px; font-size: .78rem; max-height: 4.6em; overflow-y: auto; }
  .loc-nav { margin-top: 8px; padding-top: 8px; }
  .nav-b { padding: 5px 10px; font-size: .78rem; }
  /* أدوات الخريطة السفلية (Powered by Esri) بأسفل الشاشة، مش فوق البطاقة */
  .map-wrap .esri-ui { bottom: 0 !important; }
  .map-wrap.card-open .esri-scale-bar { display: none; }
  .tip { display: none !important; }
  .tab .lf { display: none; }
  .tab .ls { display: inline; }
  .reader { inset: 0; }
  .rd-hd { padding: 10px 12px; gap: 8px; }
  .rd-back { display: inline-block; }
  .rd-act .rd-btn.x { display: none; }
  .rd-t h2 { font-size: 1rem; }
  .rd-body { padding: 12px 12px 20px; }
  .rd-tbl.rd-gov thead, .rd-tbl.rd-annex thead { display: none; }
  .rd-tbl.rd-gov tr, .rd-tbl.rd-annex tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin-bottom: 8px; padding: 8px 10px; border: 1px solid var(--line); border-right: 3px solid var(--blue); border-radius: 10px; background: #fff; }
  .rd-tbl.rd-gov tr[hidden], .rd-tbl.rd-annex tr[hidden] { display: none; }
  .rd-tbl.rd-gov td, .rd-tbl.rd-annex td { padding: 0; border: 0; background: none !important; }
  .rd-tbl td.en { text-align: right; font-size: .8rem; color: var(--muted); }
  .rd-tbl td.cd { grid-column: 2; grid-row: 1; }
  .rd-tbl td.nt:empty, .rd-tbl td.bnd:empty { display: none; }
  .rd-tbl td.pn { grid-column: 2; }
  .rd-tbl td.nt, .rd-tbl td.gv, .rd-tbl td.ty { grid-column: 1 / -1; }
}

/* ===== دليل الاستخدام (الجولة الإرشادية) ===== */
.hp-block { position: fixed; inset: 0; z-index: 9000; background: transparent; }
.hp-block.dim { background: rgba(2,6,23,.62); }
.hp-hole { position: fixed; z-index: 9001; border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(2,6,23,.62), 0 0 0 3px #facc15, 0 0 28px 6px rgba(250,204,21,.5); transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease; }
.hp-hole[hidden] { display: none; }
.hp-card { position: fixed; z-index: 9002; width: 350px; max-width: calc(100vw - 16px); background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(2,6,23,.5); transition: left .35s ease, top .35s ease, opacity .2s; }
.hp-card.busy { opacity: .0; pointer-events: none; }
.hp-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: 430px; }
.hp-h { position: relative; padding: 12px 16px 12px 52px; color: #fff; background: linear-gradient(120deg, #082f49, #0c4a6e 60%, #075985); border-bottom: 3px solid #facc15; }
.hp-x { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font: inherit; font-size: 1.35rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.hp-x:hover { background: #dc2626; border-color: #dc2626; }
.hp-k { font-size: .74rem; font-weight: 800; color: #facc15; }
.hp-h h3 { margin: 2px 0 0; font-size: 1.05rem; line-height: 1.4; }
.hp-b { padding: 12px 16px 4px; font-size: .87rem; line-height: 1.9; color: var(--text); }
.hp-b ul { margin: 0; padding-right: 18px; }
.hp-b small { display: block; margin-top: 6px; color: var(--muted); font-size: .8rem; }
.hp-hero { font-size: 2.4rem; text-align: center; line-height: 1.3; }
.hp-f { display: flex; align-items: center; gap: 8px; padding: 10px 16px 14px; }
.hp-dots { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.hp-dots i { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; }
.hp-dots i.on { width: 18px; border-radius: 4px; background: var(--navy); }
.hp-f button { border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 9px; padding: 6px 12px; font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; white-space: nowrap; }
.hp-f .hp-next { background: #facc15; border-color: #facc15; color: #082f49; }
.hp-f .skip { border: 0; color: var(--muted); font-weight: 700; padding: 6px 4px; }
@media (max-width: 760px) {
  .hp-card, .hp-card.center { width: auto; left: 8px !important; right: 8px; }
  .hp-card.center { width: auto; transform: translateY(-50%); }
}

/* ===== مصادر البيانات ===== */
.src-intro { margin: 0 0 12px; font-size: .84rem; line-height: 1.8; color: var(--muted); }
.srcs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: s; }
.srcs li { counter-increment: s; position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 10px 14px 10px 40px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--line); }
.srcs li::after { content: counter(s); position: absolute; left: 10px; top: 10px; width: 20px; height: 20px; border-radius: 50%; background: var(--navy); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; }
.srcs b { display: block; font-size: .9rem; color: var(--ink); line-height: 1.5; }
.srcs span { display: block; margin-top: 2px; font-size: .8rem; color: var(--muted); line-height: 1.6; }
