/* ==========================================================================
   iqstatus — Aurora Design System v3
   بنفسجي/نيلي حديث · RTL · Light+Dark · Responsive · Accessible
   ========================================================================== */

/* ---------- 1. TOKENS ---------- */
:root {
  color-scheme: light;

  /* Surfaces */
  --bg:            #fafbff;
  --bg-2:          #f3f4f9;
  --surface:       #ffffff;
  --surface-2:     #f8f9fd;
  --surface-3:     #eef0fa;
  --surface-hover: #f1f3fd;

  /* Text */
  --text:    #0f172a;
  --text-2:  #334155;
  --text-3:  #64748b;
  --text-4:  #94a3b8;

  /* Borders */
  --border:   #e6e8f0;
  --border-2: #cbd0e0;

  /* Brand */
  --primary:      #6366f1;
  --primary-600:  #4f46e5;
  --primary-400:  #818cf8;
  --primary-soft: rgba(99, 102, 241, 0.10);
  --primary-glow: rgba(99, 102, 241, 0.28);
  --on-primary:   #ffffff;

  --accent:       #06b6d4;
  --accent-soft:  rgba(6, 182, 212, 0.12);
  --accent-600:   #0891b2;

  /* States */
  --up:            #10b981;   --up-soft:       rgba(16, 185, 129, 0.12);
  --degraded:      #f59e0b;   --degraded-soft: rgba(245, 158, 11, 0.14);
  --down:          #ef4444;   --down-soft:     rgba(239, 68, 68, 0.12);
  --remote:        #3b82f6;   --remote-soft:   rgba(59, 130, 246, 0.12);
  --unknown:       #94a3b8;   --unknown-soft:  rgba(148, 163, 184, 0.18);

  /* Hero */
  --hero-a:     #1e1b4b;
  --hero-b:     #312e81;
  --hero-c:     #6366f1;
  --hero-text:  #ffffff;
  --hero-muted: rgba(255, 255, 255, 0.78);
  --hero-line:  rgba(255, 255, 255, 0.10);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.12), 0 8px 16px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 8px 32px var(--primary-glow);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Fonts */
  --font: "Cairo", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  /* Layout */
  --wrap: 1220px;
  --gutter: 20px;
  --header-h: 68px;
  --sidebar-w: 280px;

  /* Motion */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:            #0a0e1a;
  --bg-2:          #0f1420;
  --surface:       #111827;
  --surface-2:     #151c2c;
  --surface-3:     #1c2438;
  --surface-hover: #1a2235;

  --text:    #f1f5f9;
  --text-2:  #cbd5e1;
  --text-3:  #94a3b8;
  --text-4:  #64748b;

  --border:   #1f2937;
  --border-2: #334155;

  --primary:      #818cf8;
  --primary-600:  #6366f1;
  --primary-400:  #a5b4fc;
  --primary-soft: rgba(129, 140, 248, 0.15);
  --primary-glow: rgba(129, 140, 248, 0.35);
  --on-primary:   #0a0e1a;

  --accent:       #22d3ee;
  --accent-soft:  rgba(34, 211, 238, 0.15);
  --accent-600:   #06b6d4;

  --up:            #34d399;   --up-soft:       rgba(52, 211, 153, 0.16);
  --degraded:      #fbbf24;   --degraded-soft: rgba(251, 191, 36, 0.16);
  --down:          #f87171;   --down-soft:     rgba(248, 113, 113, 0.16);
  --remote:        #60a5fa;   --remote-soft:   rgba(96, 165, 250, 0.16);
  --unknown:       #64748b;   --unknown-soft:  rgba(100, 116, 139, 0.22);

  --hero-a:     #0a0e1a;
  --hero-b:     #1e1b4b;
  --hero-c:     #4f46e5;
  --hero-text:  #ffffff;
  --hero-muted: rgba(255, 255, 255, 0.75);
  --hero-line:  rgba(255, 255, 255, 0.08);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.40), 0 2px 8px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55), 0 8px 16px rgba(0, 0, 0, 0.35);
}

/* ---------- 2. RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv01";
}

a { color: var(--primary); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: var(--primary-600); }
:root[data-theme="dark"] a:hover { color: var(--primary-400); }

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 3.5vw, 2.6rem); }
h2 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h3 { font-size: 1.05rem; }

code, .mono {
  font-family: var(--mono);
  font-size: 0.86em;
  direction: ltr;
  unicode-bidi: isolate;
  font-feature-settings: "zero";
}
code {
  background: var(--surface-3);
  color: var(--text-2);
  padding: 2px 8px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
}

.skip {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 1000;
  padding: 10px 16px; background: var(--primary); color: var(--on-primary);
  border-radius: var(--r-sm); font-weight: 700;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

main.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 64px;
}

/* ---------- 3. SHELL ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- 4. TOPBAR ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.menu-btn { flex-shrink: 0; }
.menu-btn svg { transition: transform .3s var(--ease); }

.brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--text) !important;
  white-space: nowrap;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 16px var(--primary-glow);
  transition: transform .25s var(--ease-bounce);
}
.brand:hover .brand-mark { transform: scale(1.08) rotate(-5deg); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 1.08rem; font-weight: 800; }
.brand-text small { font-size: 0.72rem; color: var(--text-3); font-weight: 500; }

/* Icon buttons */
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  flex-shrink: 0;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-2);
  transition: all .18s var(--ease);
}
.icon-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ---------- 5. GLOBAL SEARCH ---------- */
.gsearch {
  position: relative; display: block;
  flex: 1 1 320px; max-width: 540px;
}
.gsearch input {
  width: 100%; height: 42px;
  padding: 0 42px 0 42px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit; font-size: 0.92rem;
  transition: all .18s var(--ease);
}
.gsearch input::placeholder { color: var(--text-4); }
.gsearch input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.gsearch input::-webkit-search-cancel-button { -webkit-appearance: none; }
.gsearch .gs-icon {
  position: absolute; inset-inline-start: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-4); pointer-events: none;
}
.gsearch .gs-kbd {
  position: absolute; inset-inline-end: 10px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--text-4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  background: var(--surface);
  pointer-events: none;
}
.gsearch input:focus ~ .gs-kbd { display: none; }

.gs-list {
  position: absolute; top: calc(100% + 8px); inset-inline: 0; z-index: 400;
  list-style: none; margin: 0; padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  max-height: 400px; overflow-y: auto;
  animation: gsSlide .2s var(--ease);
}
@keyframes gsSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gs-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 0.9rem; color: var(--text);
  transition: background .12s var(--ease);
}
.gs-list li:hover,
.gs-list li[aria-selected="true"] {
  background: var(--primary-soft);
  color: var(--primary);
}
.gs-list li .gs-av {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  flex-shrink: 0;
  background: var(--surface-3); color: var(--text-2);
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 0.78rem;
  transition: all .18s var(--ease);
}
.gs-list li[aria-selected="true"] .gs-av,
.gs-list li:hover .gs-av {
  background: var(--primary);
  color: var(--on-primary);
  transform: scale(1.05);
}
.gs-list li .gs-body {
  min-width: 0; flex: 1;
  display: flex; flex-direction: column; line-height: 1.3;
}
.gs-list li .gs-name {
  font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gs-list li .gs-sub {
  font-size: 0.74rem; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  unicode-bidi: plaintext; text-align: start;
}
.gs-list li .gs-asn {
  font-family: var(--mono); font-size: 0.74rem;
  color: var(--text-3); flex-shrink: 0;
}
.gs-list li.gs-empty,
.gs-list li.gs-hint {
  cursor: default; color: var(--text-3);
  font-size: 0.86rem; justify-content: center;
}
.gs-list li.gs-empty:hover,
.gs-list li.gs-hint:hover { background: transparent; color: var(--text-3); }
.gs-list mark {
  background: var(--accent-soft);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
}

/* Page-local search */
.page-search {
  display: flex; align-items: center;
  gap: 10px; flex-wrap: wrap;
}
.page-search .search { flex: 1 1 280px; max-width: 540px; }
.page-search .count { font-size: 0.82rem; color: var(--text-3); }
[data-search-hidden] { display: none !important; }

/* ---------- 6. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-sm);
  font-size: 0.92rem; font-weight: 700; line-height: 1.2;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: all .18s var(--ease);
}
.btn svg { width: 17px; height: 17px; }
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-2);
}
.btn:active { transform: translateY(0); }
.btn:disabled {
  opacity: .55; cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; border-radius: var(--r); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  box-shadow: 0 10px 28px var(--primary-glow);
  color: #fff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.40);
  color: #fff;
}

.btn-light {
  background: #fff;
  border-color: #fff;
  color: var(--primary-600);
  font-weight: 700;
}
.btn-light:hover {
  color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* ---------- 7. HERO (Home) ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl);
  background:
    radial-gradient(1000px 500px at 85% -15%, rgba(6, 182, 212, 0.35), transparent 60%),
    radial-gradient(700px 400px at 15% 115%, rgba(168, 85, 247, 0.28), transparent 60%),
    linear-gradient(125deg, var(--hero-a) 0%, var(--hero-b) 55%, var(--hero-c) 130%);
  color: var(--hero-text);
  box-shadow: var(--shadow-lg);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--hero-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(75% 85% at 55% 45%, #000 20%, transparent 100%);
  mask-image: radial-gradient(75% 85% at 55% 45%, #000 20%, transparent 100%);
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 32px;
  align-items: center;
  padding: 52px 44px;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.20);
  font-size: 0.8rem; font-weight: 600;
  color: var(--hero-text);
  backdrop-filter: blur(8px);
}
.eyebrow .live {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.65); }
  70%  { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero h1 {
  font-size: clamp(1.85rem, 3.6vw, 2.8rem);
  margin: 18px 0 14px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, #7ee7ef, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.lead {
  font-size: 1.05rem;
  color: var(--hero-muted);
  max-width: 60ch;
  line-height: 1.75;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.hero-summary {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 24px;
}
.hero-summary .chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.84rem; font-weight: 600;
  color: var(--hero-text);
  backdrop-filter: blur(8px);
  transition: all .18s var(--ease);
}
.hero-summary .chip:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}
.hero-summary .chip i {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.hero-summary .chip b {
  font-family: var(--mono);
  font-weight: 700;
}

.hero-map { position: relative; display: grid; place-items: center; }
.hero-map svg {
  width: 100%; max-width: 380px; height: auto;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.40));
}
.hero-map .map-caption {
  position: absolute; bottom: 0; inset-inline-end: 0;
  font-size: 0.74rem; color: var(--hero-muted);
}

/* ---------- 8. IRAQ MAP ---------- */
.iq-map .land {
  fill: rgba(255, 255, 255, 0.10);
  stroke: rgba(255, 255, 255, 0.60);
  stroke-width: 1.5; stroke-linejoin: round;
}
.iq-map .city-dot { fill: #7ee7ef; stroke: #fff; stroke-width: 1.3; }
.iq-map .city-ring {
  fill: none; stroke: #7ee7ef; stroke-width: 1;
  opacity: .7;
  animation: ringPulse 3s ease-out infinite;
  transform-origin: center; transform-box: fill-box;
}
.iq-map .city-label {
  font-family: var(--font); font-size: 11px;
  font-weight: 600; fill: #fff;
}
.iq-map .city-count {
  font-family: var(--mono); font-size: 10px;
  fill: #bdf4f8; font-weight: 600;
}
.iq-map text {
  paint-order: stroke;
  stroke: rgba(15, 23, 42, 0.55);
  stroke-width: 3px; stroke-linejoin: round;
}
@keyframes ringPulse {
  0%   { transform: scale(.6); opacity: .8; }
  100% { transform: scale(2.4); opacity: 0; }
}

.map-card .iq-map .land { fill: var(--primary-soft); stroke: var(--primary); stroke-width: 1.8; }
.map-card .iq-map .city-dot { fill: var(--primary); stroke: var(--surface); }
.map-card .iq-map .city-ring { stroke: var(--primary); }
.map-card .iq-map .city-label { fill: var(--text); }
.map-card .iq-map .city-count { fill: var(--primary-600); }
.map-card .iq-map text { stroke: var(--surface); }
.map-card .iq-map { width: 100%; max-width: 440px; height: auto; margin: 0 auto; }
.map-layout {
  display: grid;
  grid-template-columns: minmax(300px, 440px) 1fr;
  gap: 28px;
  align-items: center;
}

.city-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.city-card {
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all .2s var(--ease);
}
.city-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.city-card .city-name {
  font-weight: 700;
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px;
}
.city-card .city-name b {
  font-family: var(--mono);
  color: var(--primary);
  font-size: 1.1rem;
}
.city-card .city-kinds {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px;
}

/* ---------- 9. STATS ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.stat {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  transition: all .22s var(--ease);
}
.stat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-2);
}
.stat::before {
  content: "";
  position: absolute;
  inset-inline-start: 0; top: 16px; bottom: 16px;
  width: 3px; border-radius: 3px;
  background: var(--border-2);
  transition: height .25s var(--ease);
}
.stat b {
  display: block;
  font-family: var(--mono);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat span {
  display: block;
  font-size: 0.82rem;
  color: var(--text-3);
  font-weight: 600;
  margin-top: 4px;
}
.stat.s-up::before { background: var(--up); }
.stat.s-up b { color: var(--up); }
.stat.s-degraded::before { background: var(--degraded); }
.stat.s-degraded b { color: var(--degraded); }
.stat.s-down::before { background: var(--down); }
.stat.s-down b { color: var(--down); }
.stat.s-unknown::before { background: var(--unknown); }
.stat.s-unknown b { color: var(--text-3); }
.stat.s-primary::before { background: var(--primary); }
.stat.s-primary b { color: var(--primary); }
.stat.s-accent::before { background: var(--accent); }
.stat.s-accent b { color: var(--accent); }
.stat small {
  display: block;
  font-size: 0.74rem;
  color: var(--text-4);
  margin-top: 3px;
}

/* ---------- 10. CARDS ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .2s var(--ease);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-head {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 {
  font-size: 1.15rem;
  display: flex; align-items: center; gap: 10px;
}
.card-head h2::before {
  content: "";
  width: 4px; height: 22px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
.card-head .meta {
  font-size: 0.82rem;
  color: var(--text-3);
  font-weight: 500;
}
.card-head .spacer { flex: 1; }
.card-head .link {
  font-size: 0.86rem;
  font-weight: 700;
}
.card-sub {
  font-size: 0.88rem;
  color: var(--text-3);
  margin: -6px 0 16px;
  line-height: 1.75;
}
.card.compact { padding: 18px 20px; }

.section-title { font-size: 1.25rem; margin-bottom: 4px; }
.section-title + .card-sub { margin-top: 0; }

/* ---------- 11. BADGES / DOTS / PILLS / MARKS ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.77rem; font-weight: 700;
  white-space: nowrap; line-height: 1.5;
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.s-up       { background: var(--up-soft);       color: var(--up); }
.badge.s-degraded { background: var(--degraded-soft); color: var(--degraded); }
.badge.s-down     { background: var(--down-soft);     color: var(--down); }
.badge.s-remote   { background: var(--remote-soft);   color: var(--remote); }
.badge.s-unknown  { background: var(--unknown-soft);  color: var(--text-3); }
.badge.plain::before { display: none; }
.badge.lg { font-size: 0.9rem; padding: 6px 15px; }

.dot {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  vertical-align: middle;
  position: relative;
  cursor: default;
  transition: transform .18s var(--ease-bounce);
}
.dot:hover { transform: scale(1.40); }
.dot.s-up { background: var(--up); }
.dot.s-degraded { background: var(--degraded); }
.dot.s-down {
  background: var(--down);
  box-shadow: 0 0 0 3px var(--down-soft);
  animation: dotPulse 2s infinite;
}
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--down-soft); }
  50%      { box-shadow: 0 0 0 6px transparent; }
}
.dot.s-remote { background: var(--remote); }
.dot.s-unknown {
  background: var(--unknown-soft);
  border: 1px solid var(--border-2);
}
.dots {
  display: inline-flex;
  gap: 6px; align-items: center;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 0.77rem;
  font-weight: 600;
  white-space: nowrap;
}
.pill b { font-family: var(--mono); font-weight: 700; }
.pill.primary { background: var(--primary-soft); color: var(--primary); }
.pill.accent { background: var(--accent-soft); color: var(--accent-600); }
.pill.warn { background: var(--degraded-soft); color: var(--degraded); }

.mark {
  display: inline-grid; place-items: center;
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1;
  color: #fff;
  background: var(--mark, var(--primary));
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.20);
  direction: ltr;
  transition: transform .2s var(--ease-bounce);
}
.mark:hover { transform: scale(1.10); }
.mark.sm { width: 24px; height: 24px; font-size: 0.7rem; border-radius: 8px; }
.mark.lg { width: 44px; height: 44px; font-size: 1.1rem; border-radius: var(--r); }

.node-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.node-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 3px;
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 0.75rem; font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.node-chip b { font-family: var(--mono); font-weight: 700; }

/* ---------- 12. TABLES ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r);
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.91rem;
}
thead th {
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 13px 16px;
  text-align: start;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr {
  transition: background .14s var(--ease);
}
tbody tr:hover { background: var(--surface-hover); }
tr.me {
  background: var(--primary-soft) !important;
  position: relative;
}
tr.me td:first-child { box-shadow: inset 3px 0 0 var(--primary); }

td.num, th.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: start;
}
.name {
  font-weight: 700;
  color: var(--text);
  font-size: 0.96rem;
  transition: color .15s;
}
.name:hover { color: var(--primary); }
.sub { font-size: 0.79rem; color: var(--text-3); }
.muted { color: var(--text-3); }
.small { font-size: 0.83rem; }
.tiny { font-size: 0.75rem; }
.s-down-text { color: var(--down); font-weight: 700; }
.s-up-text { color: var(--up); font-weight: 700; }
.s-degraded-text { color: var(--degraded); font-weight: 700; }
.nowrap { white-space: nowrap; }
.legend {
  display: flex; flex-wrap: wrap;
  gap: 6px 18px; align-items: center;
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--text-3);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }

th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--primary); }
th[data-sort]::after {
  content: "↕";
  margin-inline-start: 6px;
  opacity: .45;
  font-size: 0.75em;
}
th[data-sort].asc::after { content: "↑"; opacity: 1; color: var(--primary); }
th[data-sort].desc::after { content: "↓"; opacity: 1; color: var(--primary); }

/* ---------- 13. FILTER BAR ---------- */
.filterbar {
  display: flex; flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.search {
  position: relative;
  flex: 1 1 260px; max-width: 440px;
}
.search input {
  width: 100%;
  padding: 11px 42px 11px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.93rem;
  transition: all .18s var(--ease);
}
.search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  background: var(--surface);
}
.search svg {
  position: absolute; inset-inline-end: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-4); pointer-events: none;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.83rem;
  font-weight: 600;
  transition: all .18s var(--ease);
}
.chip-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.chip-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.chip-btn b {
  font-family: var(--mono);
  font-weight: 700;
  opacity: .85;
  margin-inline-start: 4px;
}
.filter-count {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-inline-start: auto;
}

/* ---------- 14. PROBE BOX ---------- */
.probe {
  position: relative; overflow: hidden;
  border: 1px solid var(--primary);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-soft) 140%);
  box-shadow: 0 12px 36px var(--primary-glow);
  padding: 22px 24px;
}
.probe::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.probe-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.probe-who { display: flex; align-items: center; gap: 14px; }
.probe-icon {
  width: 48px; height: 48px;
  border-radius: var(--r);
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.probe-icon svg { width: 24px; height: 24px; }
.probe-head strong { display: block; font-size: 1.02rem; }
.probe-head .sub { max-width: 640px; line-height: 1.65; }

#probe-out:not(:empty) { margin-top: 18px; }
.probe-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.probe-result {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all .18s var(--ease);
}
.probe-result:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.probe-result .pr-body { min-width: 0; flex: 1; }
.probe-result .pr-name { font-weight: 700; font-size: 0.88rem; }
.probe-result .pr-meta {
  font-size: 0.75rem;
  color: var(--text-3);
  line-height: 1.45;
  word-break: break-word;
}
.probe-result.fail {
  border-color: var(--down);
  background: var(--down-soft);
}
.probe-result .pr-node {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-3);
  direction: ltr; text-align: start;
  word-break: break-all;
  margin-top: 3px;
}
.probe-result .pr-ip { color: var(--primary); font-weight: 700; }
.probe-groups {
  display: flex; flex-direction: column;
  gap: 16px;
}
.probe-group {
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.probe-group h4 {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.98rem;
  margin-bottom: 6px;
}
.probe-group > .sub { margin-bottom: 12px; }
.probe-group.inside { border-inline-start: 4px solid var(--up); }
.probe-group.abroad { border-inline-start: 4px solid var(--remote); }
.probe-group.pending { border-inline-start: 4px solid var(--border-2); }
.probe-note { margin-top: 14px; font-size: 0.88rem; }
.probe-progress {
  height: 5px;
  border-radius: 5px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 16px;
}
.probe-progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .4s var(--ease);
}

/* ---------- 15. ALERTS ---------- */
.alerts {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 8px;
}
.alerts li {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--border-2);
  font-size: 0.86rem;
}
.alerts li.lvl-critical,
.alerts li.lvl-major { border-inline-start-color: var(--down); }
.alerts li.lvl-minor,
.alerts li.lvl-warning { border-inline-start-color: var(--degraded); }
.alerts li.lvl-normal,
.alerts li.lvl-info { border-inline-start-color: var(--up); }
.alerts .lvl {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 6px;
  min-width: 68px;
  text-align: center;
}
.alerts li.lvl-critical .lvl,
.alerts li.lvl-major .lvl { background: var(--down-soft); color: var(--down); }
.alerts li.lvl-minor .lvl,
.alerts li.lvl-warning .lvl { background: var(--degraded-soft); color: var(--degraded); }
.alerts li.lvl-normal .lvl,
.alerts li.lvl-info .lvl { background: var(--up-soft); color: var(--up); }
.alerts .when {
  margin-inline-start: auto;
  color: var(--text-3);
  font-size: 0.79rem;
  font-family: var(--mono);
}

/* ---------- 16. NOTICES / EMPTY ---------- */
.notice {
  padding: 16px 18px;
  border-radius: var(--r);
  border-inline-start: 4px solid var(--border-2);
  background: var(--surface-2);
  font-size: 0.92rem;
}
.notice.danger { background: var(--down-soft); border-color: var(--down); color: var(--down); }
.notice.warn { background: var(--degraded-soft); border-color: var(--degraded); }
.notice.info { background: var(--primary-soft); border-color: var(--primary); }
.notice strong { display: block; margin-bottom: 3px; }

.empty {
  text-align: center;
  padding: 44px 24px;
  color: var(--text-3);
  font-size: 0.94rem;
  border: 2px dashed var(--border-2);
  border-radius: var(--r);
}
.empty svg {
  width: 40px; height: 40px;
  margin: 0 auto 12px;
  color: var(--text-4);
}

/* ---------- 17. PAGE HERO ---------- */
.page-hero {
  display: flex; align-items: flex-start;
  gap: 20px; flex-wrap: wrap;
  padding: 30px 32px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  position: relative; overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute; inset-inline-start: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
.page-hero .hero-icon {
  width: 58px; height: 58px;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  color: var(--primary);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.page-hero .hero-icon svg { width: 28px; height: 28px; }
.page-hero h1 { font-size: 1.55rem; }
.page-hero p {
  color: var(--text-3);
  font-size: 0.94rem;
  max-width: 75ch;
  margin-top: 6px;
  line-height: 1.75;
}
.page-hero .hero-body { flex: 1; min-width: 280px; }
.page-hero .hero-stats {
  display: flex; gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 18px;
}
.hero-stat {
  padding: 12px 16px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--border);
  min-width: 130px;
  transition: all .18s var(--ease);
}
.hero-stat:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.hero-stat b {
  display: block;
  font-family: var(--mono);
  font-size: 1.4rem;
  color: var(--primary);
  font-weight: 700;
  direction: ltr; unicode-bidi: isolate;
  text-align: start;
}
.hero-stat span {
  font-size: 0.78rem;
  color: var(--text-3);
  font-weight: 600;
}

.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.83rem;
  color: var(--text-3);
  margin-bottom: -8px;
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--primary); }

/* ISP hero */
.isp-hero {
  display: flex; flex-direction: column;
  flex-wrap: nowrap; align-items: stretch;
  gap: 16px;
}
.isp-hero .top-row {
  display: flex; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.isp-hero .avatar {
  width: 64px; height: 64px;
  border-radius: var(--r-lg);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-weight: 700; font-size: 1.2rem;
  box-shadow: 0 8px 22px var(--primary-glow);
}
.isp-hero h1 {
  font-size: 1.6rem;
  display: flex; align-items: center;
  gap: 14px; flex-wrap: wrap;
}
.isp-hero .meta {
  font-size: 0.88rem;
  color: var(--text-3);
  margin-top: 4px;
}
.isp-hero .meta code { font-size: 0.82rem; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.fact {
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all .18s var(--ease);
}
.fact:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.fact b {
  display: block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  direction: ltr; unicode-bidi: isolate;
  text-align: start;
}
.fact span {
  font-size: 0.78rem;
  color: var(--text-3);
  font-weight: 600;
}
.siblings {
  display: flex; flex-wrap: wrap;
  gap: 8px; align-items: center;
  font-size: 0.83rem;
  color: var(--text-3);
}

/* ---------- 18. CDN CARDS ---------- */
.cdn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}
.cdn-card {
  position: relative;
  padding: 16px 18px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  gap: 12px;
  transition: all .2s var(--ease);
}
.cdn-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.cdn-card.s-down { border-color: var(--down); }
.cdn-card.s-degraded { border-color: var(--degraded); }
.cdn-card .cc-head {
  display: flex; align-items: center; gap: 12px;
}
.cdn-card .cc-head .cc-name { flex: 1; min-width: 0; }
.cdn-card .cc-name b { display: block; font-size: 0.94rem; }
.cdn-card .cc-name small {
  display: block;
  font-size: 0.73rem;
  color: var(--text-3);
  direction: ltr; text-align: start;
}
.cdn-card .cc-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.cdn-card .cc-metric span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-4);
  font-weight: 600;
}
.cdn-card .cc-metric b {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.94rem;
  direction: ltr;
  display: inline-block;
}
.cdn-card .cc-node {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
  direction: ltr; text-align: start;
  word-break: break-all;
}
.cdn-card .cc-note {
  font-size: 0.78rem;
  color: var(--text-3);
  line-height: 1.55;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

/* ---------- 19. CAPACITY ---------- */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.cap-card {
  padding: 18px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  gap: 12px;
  transition: all .2s var(--ease);
}
.cap-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.cap-card .cap-head {
  display: flex; align-items: center; gap: 12px;
}
.cap-card .cap-head b { font-size: 0.98rem; }
.cap-card .cap-head small {
  display: block;
  font-size: 0.73rem;
  color: var(--text-3);
}
.cap-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.cap-numbers div {
  text-align: center;
  padding: 10px 4px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}
.cap-numbers b {
  display: block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.15rem;
  direction: ltr;
}
.cap-numbers span {
  font-size: 0.7rem;
  color: var(--text-3);
  font-weight: 600;
}
.cap-est {
  display: flex; align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.cap-est b {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
  direction: ltr;
}
.cap-est span {
  font-size: 0.74rem;
  color: var(--text-3);
}
.bar {
  height: 8px;
  border-radius: 6px;
  background: var(--surface-3);
  overflow: hidden;
}
.bar i {
  display: block; height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  min-width: 3px;
  transition: width 1s var(--ease);
}
.bar.accent i {
  background: linear-gradient(90deg, var(--accent), #22d3ee);
}
.bar.thin { height: 5px; }
.cap-cities { display: flex; flex-wrap: wrap; gap: 6px; }

.cap-table td.kind-cell { min-width: 160px; }
.cap-table .kc {
  display: flex; flex-direction: column;
  gap: 4px;
}
.cap-table .kc b {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
}
.cap-table .kc span {
  font-size: 0.73rem;
  color: var(--text-3);
}
.cap-table .kc .kc-n {
  font-size: 0.83rem;
  color: var(--text);
  white-space: nowrap;
}
.cap-table .kc .kc-est {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.82rem;
}
.cap-table .kc.none { color: var(--text-4); }
.cap-table .company {
  display: flex; align-items: center;
  gap: 12px;
}
.cap-table .company .avatar {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  font-family: var(--mono);
  font-weight: 700; font-size: 0.82rem;
  flex-shrink: 0;
}
.cap-table .company b { display: block; font-size: 0.94rem; }
.cap-table .company small {
  display: block;
  font-size: 0.73rem;
  color: var(--text-3);
  font-family: var(--mono);
  direction: ltr; text-align: start;
}
.cap-total { min-width: 180px; }
.cap-total b {
  font-family: var(--mono);
  font-weight: 700;
  direction: ltr;
  display: inline-block;
}
.cap-total .bar { margin-top: 8px; }
.rank {
  font-family: var(--mono);
  color: var(--text-4);
  font-size: 0.82rem;
}

.assumptions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.assumption {
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; gap: 12px;
  align-items: flex-start;
  transition: all .18s var(--ease);
}
.assumption:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.assumption b { display: block; font-size: 0.9rem; }
.assumption span {
  font-size: 0.79rem;
  color: var(--text-3);
  line-height: 1.6;
}

/* ---------- 20. NODES / IXP / TRANSIT ---------- */
.kind-head {
  display: flex; align-items: center; gap: 14px;
}
.kind-head .mark {
  width: 40px; height: 40px;
  font-size: 0.95rem;
  border-radius: var(--r-sm);
}
.kind-head h2 {
  display: flex; flex-direction: column;
  gap: 2px; line-height: 1.25;
}
.kind-head h2::before { display: none; }
.kind-head small {
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 500;
}

.node-groups {
  display: flex; flex-direction: column;
  gap: 18px;
}
.node-group h3 {
  font-size: 0.95rem;
  display: flex; align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.node-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}
.node-item {
  display: flex; align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  transition: all .18s var(--ease);
}
.node-item:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.node-item .host {
  font-family: var(--mono);
  font-size: 0.78rem;
  direction: ltr; text-align: start;
  word-break: break-all;
  flex: 1;
}
.node-item .ip {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-3);
  direction: ltr;
}
.node-item.stale { opacity: .55; }

.ixp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.ixp-card {
  padding: 16px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: center;
  transition: all .18s var(--ease);
}
.ixp-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.ixp-card .ixp-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
}
.ixp-card .ixp-speed {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  direction: ltr;
}
.ixp-card .sub { margin-top: 4px; }

.share {
  display: inline-flex; align-items: center;
  gap: 10px;
}
.share .bar { width: 72px; }
.share b {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.87rem;
}

.network-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.network-chip {
  display: inline-flex; align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  transition: all .18s var(--ease);
}
.network-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.network-chip.static:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
  color: var(--text);
}
.network-chip .count {
  background: var(--primary);
  color: var(--on-primary);
  padding: 0 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
}
.network-chip .asn {
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.75rem;
}

details.fold > summary {
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-2);
  padding: 4px 0;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before {
  content: "▸";
  color: var(--primary);
  transition: transform .22s var(--ease);
  display: inline-block;
  font-size: 1.1em;
}
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary:hover { color: var(--primary); }
details.fold > .fold-body {
  margin-top: 14px;
  animation: foldOpen .25s var(--ease);
}
@keyframes foldOpen {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Node table */
.node-table .host { font-size: 0.82rem; word-break: break-all; }
.node-table .node-code {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  direction: ltr;
  display: inline-block;
}
.node-table .node-host {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-3);
  direction: ltr;
  text-align: start;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.node-table td { vertical-align: top; }
.node-table .badge { margin-top: 3px; }
.node-table tr.s-down td:first-child { box-shadow: inset 3px 0 0 var(--down); }
.node-table tr.s-down { background: var(--down-soft); }
.node-table tr.s-degraded td:first-child { box-shadow: inset 3px 0 0 var(--degraded); }
.node-group h3 .pill { font-weight: 600; }

/* International */
.intl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.intl-box {
  padding: 18px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  gap: 6px;
}
.intl-box.wide { grid-column: 1 / -1; }
.intl-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: .02em;
}
.intl-big {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--primary);
  line-height: 1.2;
}
.intl-big.muted {
  color: var(--text-4);
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 700;
}
.gateways {
  display: flex; flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.gw-hop {
  display: flex; align-items: flex-start;
  gap: 12px; flex-wrap: wrap;
}
.gw-hop-label {
  min-width: 140px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-2);
  padding-top: 4px;
}
.gw-list { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.gw {
  display: inline-flex; align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all .15s var(--ease);
}
.gw:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.gw b {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text-3);
  flex-shrink: 0;
}
.gw .gw-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gw-list.col {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.gw.down { border-color: var(--down); color: var(--down); }
.gw .dot { width: 8px; height: 8px; }

.pdb-level {
  display: inline-flex; align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--primary);
  direction: ltr;
}
.pdb-level.none {
  color: var(--text-4);
  font-family: var(--font);
  font-weight: 500;
}

@media (max-width: 768px) {
  .intl-grid { grid-template-columns: 1fr; }
  .gw-hop-label { min-width: 0; width: 100%; padding-top: 0; }
}

/* ---------- 21. TOOLS ---------- */
.tabs {
  display: flex; flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.tab {
  flex: 1 1 auto;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.tab:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: #fff;
  box-shadow: 0 6px 18px var(--primary-glow);
}

.gauges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.gauge {
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  gap: 6px;
  transition: all .22s var(--ease);
}
.gauge.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  transform: scale(1.02);
}
.gauge .g-label {
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--text-3);
}
.gauge .g-value {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 2.3rem;
  line-height: 1.1;
  color: var(--primary);
  direction: ltr;
  font-variant-numeric: tabular-nums;
}
.gauge .g-unit {
  font-family: var(--mono);
  font-size: 0.79rem;
  color: var(--text-3);
}
.gauge .bar { margin: 8px 0 4px; }
.gauge .g-sub {
  font-size: 0.74rem;
  color: var(--text-3);
  min-height: 1.2em;
}

.tool-form {
  display: flex; gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tool-form .search input {
  direction: ltr;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.92rem;
}
.node-speed td { vertical-align: top; }
.node-speed .bar.thin { max-width: 130px; }
#speed-nodes .node-group { margin-top: 14px; }
#speed-nodes .node-group h3 {
  display: flex; align-items: center;
  gap: 10px;
  font-size: 0.98rem;
  margin-bottom: 10px;
}
.select {
  height: 42px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
}
.trace-table td { vertical-align: top; }
.gw.abroad {
  border-color: var(--border-2);
  color: var(--text-2);
}
.gw.abroad::before { content: "🌍"; margin-inline-end: 2px; }

@media (max-width: 768px) {
  .gauges {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .gauge .g-value { font-size: 1.7rem; }
  .tab {
    flex: 1 1 45%;
    font-size: 0.87rem;
    padding: 10px 10px;
  }
}

/* ---------- 22. FOOTER ---------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 32px;
  padding: 44px var(--gutter) 28px;
}
.footer-grid h4 {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  margin-bottom: 12px;
}
.footer-grid ul {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}
.footer-grid a { color: var(--text-2); }
.footer-grid a:hover { color: var(--primary); }
.footer-about p {
  font-size: 0.88rem;
  color: var(--text-3);
  line-height: 1.8;
  margin-top: 12px;
  max-width: 48ch;
}
.footer-bottom {
  display: flex; flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 18px var(--gutter) 24px;
  border-top: 1px solid var(--border);
  font-size: 0.79rem;
  color: var(--text-4);
}

/* ---------- 23. UTILITIES ---------- */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; }
.center { text-align: center; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.hide { display: none !important; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- 24. RESPONSIVE ---------- */
@media (min-width: 1024px) {
}

@media (max-width: 1023.98px) {
}

@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .hero-inner { grid-template-columns: 1fr; padding: 36px 28px; }
  .hero-map { order: -1; }
  .hero-map svg { max-width: 240px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  html { font-size: 15px; }
  :root { --gutter: 16px; --header-h: 60px; }
  main.page { gap: 18px; padding-top: 20px; }

  .topbar-brand .brand-text small { display: none; }
  .topbar-cta { display: none; }
  .topbar-search { flex: 1 1 120px; }
  .topbar-search input {
    padding-inline-end: 12px;
    font-size: 0.88rem;
  }
  .gs-kbd { display: none; }

  .hero-inner { padding: 28px 22px; }
  .hero-map { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat b { font-size: 1.5rem; }
  .card { padding: 18px; }
  .page-hero { padding: 22px 20px; }
  .filter-count { width: 100%; margin: 0; }

  /* Tables → stacked cards */
  .table-wrap.stack { border: none; overflow: visible; }
  .table-wrap.stack thead { display: none; }
  .table-wrap.stack tbody tr {
    display: block;
    margin-bottom: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-xs);
  }
  .table-wrap.stack tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    text-align: start;
  }
  .table-wrap.stack tbody td:last-child { border-bottom: none; }
  .table-wrap.stack tbody td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-4);
    letter-spacing: .04em;
  }
  .table-wrap.stack tbody td.full { display: block; }
  .table-wrap.stack tbody td.full::before {
    display: block;
    margin-bottom: 6px;
  }
  tr.me td:first-child { box-shadow: none; }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 32px;
  }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 1.65rem; }
  .probe-results { grid-template-columns: 1fr; }
  .cap-numbers { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 25. MOTION & PRINT ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
@media print {
  .topbar, .probe, .site-footer,
  .btn, .filterbar, .page-search { display: none !important; }
  .shell { padding: 0 !important; }
  body { background: #fff; }
  .card, .stat, .page-hero { box-shadow: none; }
  .hero { background: #1e1b4b; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- 26. SCROLLBAR ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 10px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ---------- on-demand company scan ---------- */
.scan-box {
  margin: 16px 0 20px;
  padding: 16px 18px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.scan-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.scan-head .sub { margin-top: 4px; max-width: 62ch; }
#scan-btn.busy { background: var(--down); border-color: var(--down); }  /* it stops the scan while running */
.scan-run { margin-top: 16px; }
.scan-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.scan-stat {
  flex: 1 1 120px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
}
.scan-stat b { display: block; font-size: 1.4rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.scan-stat span { font-size: .78rem; color: var(--text-3); }
.scan-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: .85rem; color: var(--text-2); }
.scan-progress .bar { flex: 1 1 140px; height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.scan-progress .bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--primary); transition: width .3s ease; }
.scan-table { font-size: .85rem; }
.scan-table tbody { display: block; max-height: 320px; overflow-y: auto; }
.scan-table thead, .scan-table tbody tr { display: table; width: 100%; table-layout: fixed; }
.scan-table .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; background: var(--text-4); }
.scan-table tr.s-up .dot { background: var(--up); }
.scan-table tr.s-down .dot { background: var(--down); }
.scan-table tr.s-down td { color: var(--down); }
.scan-row > td { padding: 0 0 14px; background: var(--surface-2); }
.scan-row .scan-run { margin: 0; padding: 14px 16px; }
.isps td [data-scan-asn] { white-space: nowrap; }

/* ==========================================================================
   Company page — the subscriber's half: a scorecard, then services, with the
   infrastructure detail folded away underneath.
   ========================================================================== */
.scorecard { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; margin-top: 20px; }
.sc-headline { display: flex; gap: 16px; align-items: flex-start; }
.sc-big {
  flex: none; min-width: 92px; padding: 12px 14px;
  border-radius: var(--r-lg); background: var(--primary-soft); color: var(--primary);
  font-size: 2.4rem; font-weight: 800; line-height: 1; text-align: center;
}
.sc-big span { display: block; margin-top: 4px; font-size: .74rem; font-weight: 600; opacity: .8; }
.sc-headline strong { display: block; font-size: 1rem; }
.sc-headline p { margin: 4px 0 6px; font-size: .82rem; color: var(--text-3); line-height: 1.6; }
.sc-rank { font-size: .8rem; color: var(--text-2); }
.sc-rank b { color: var(--primary); font-size: 1rem; }
.sc-bars { align-self: center; }
.sc-bar { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 10px; margin-bottom: 9px; font-size: .8rem; }
.sc-bar > span { color: var(--text-3); }
.sc-bar .bar { height: 7px; border-radius: 99px; background: var(--border); overflow: hidden; }
.sc-bar .bar i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.sc-bar .bar i.ok { background: var(--up); }
.sc-bar .bar i.warn { background: var(--degraded); }
.sc-bar > b { min-width: 62px; font-size: .78rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
@media (max-width: 780px) { .scorecard { grid-template-columns: 1fr; gap: 16px; } }

.svc-list { display: flex; flex-direction: column; gap: 8px; }
.svc {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
}
.svc.in { border-inline-start: 4px solid var(--up); }
.svc.out { border-inline-start: 4px solid var(--degraded); }
.svc-mark { flex: none; }
.svc-t { flex: 1; min-width: 0; }
.svc-t > b { display: block; font-size: .95rem; }
.svc-note { display: block; font-size: .76rem; color: var(--text-4); margin-top: 1px; }
.svc-facts { display: block; margin-top: 5px; font-size: .82rem; color: var(--text-2); }
.svc-facts b.ltr { font-size: .95rem; color: var(--text); }
.svc-tag { flex: none; font-size: .76rem; font-weight: 600; padding: 4px 11px; border-radius: 99px; white-space: nowrap; }
.svc-tag.ok { background: var(--up-soft); color: var(--up); }
.svc-tag.warn { background: var(--degraded-soft); color: var(--degraded); }
.svc-intl {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin-top: 14px; padding: 14px 16px; border-radius: var(--r);
  border: 1px dashed var(--border-2); background: var(--surface-2);
}
.svc-intl-facts { display: flex; gap: 20px; flex-wrap: wrap; font-size: .82rem; color: var(--text-2); }
.svc-intl-facts b { font-size: 1.05rem; color: var(--text); }

details.tech { margin: 22px 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
details.tech > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; cursor: pointer; list-style: none;
}
details.tech > summary::-webkit-details-marker { display: none; }
.tech-t b { display: block; font-size: .98rem; }
.tech-t span { font-size: .8rem; color: var(--text-4); }
.tech-open { font-size: .82rem; font-weight: 600; color: var(--primary); white-space: nowrap; }
details.tech[open] > summary { border-bottom: 1px solid var(--border); }
details.tech[open] .tech-open::before { content: "أغلق "; }
details.tech[open] .tech-open { font-size: 0; }
details.tech[open] .tech-open::before { font-size: .82rem; }
.tech-body { padding: 4px 14px 14px; }
.tech-body > .card:first-child { margin-top: 14px; }

/* company list: services instead of infrastructure */
.svc-cell { white-space: nowrap; }
.svc-score { font-size: 1.05rem; font-variant-numeric: tabular-nums; margin-inline-end: 8px; }
.svc-score span { font-size: .78rem; color: var(--text-4); font-weight: 500; }

/* /nodes — what the country caches, per service */
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.country-card { padding: 14px 15px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.cc-head { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; }
.cc-head b { display: block; font-size: .9rem; }
.cc-head small { font-size: .72rem; color: var(--text-4); }
.cc-numbers { display: flex; gap: 16px; }
.cc-numbers b { display: block; font-size: 1.35rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cc-numbers span { font-size: .72rem; color: var(--text-4); }
.cc-cities { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }


/* ---------- company logos (data/logos, fetched from each company's own site) ---------- */
.clogo {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  height: 32px; min-width: 32px; max-width: 72px; padding: 3px 4px;
  border-radius: var(--r-xs); background: #fff; border: 1px solid var(--border);
  vertical-align: middle;
}
.clogo img { height: 100%; width: auto; max-width: 100%; object-fit: contain; display: block; }
.clogo.letters {
  background: var(--primary-soft); color: var(--primary); border-color: transparent;
  font-family: var(--mono); font-weight: 700; font-size: .78rem; text-transform: uppercase;
}
.clogo.sm { height: 26px; min-width: 26px; max-width: 56px; padding: 2px 3px; font-size: .68rem; }
.clogo.lg { height: 64px; min-width: 64px; max-width: 160px; padding: 6px 8px; border-radius: var(--r-lg); font-size: 1.2rem; }
.clogo.lg.letters { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.name-with-logo { display: inline-flex; align-items: center; gap: 10px; }
.gs-list li .gs-av.gs-logo { background: #fff; padding: 3px; overflow: hidden; }
.gs-list li .gs-av.gs-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }


/* ==========================================================================
   Navigation: a top bar with the sections and a "الفحوصات" dropdown on wide
   screens, a menu panel under the bar on phones. No sidebar.
   ========================================================================== */
.topnav { display: flex; align-items: center; gap: 4px; margin-inline-start: 6px; }
.topnav > a, .topnav .dropdown > button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--r-sm);
  font: inherit; font-size: .92rem; font-weight: 600; color: var(--text-2);
  background: none; border: 0; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.topnav > a:hover, .topnav .dropdown > button:hover { background: var(--surface-2); color: var(--text); }
.topnav > a.active, .topnav .dropdown > button.active { color: var(--primary); background: var(--primary-soft); }
.topnav .chev { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.dropdown { position: relative; }
.dropdown.open > button .chev { transform: rotate(180deg); }
.dropdown .menu {
  position: absolute; inset-inline-start: 0; top: calc(100% + 6px); z-index: 120;
  min-width: 290px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .18);
  display: none;
}
.dropdown.open .menu { display: block; }
.dropdown .menu a {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--text); text-decoration: none;
}
.dropdown .menu a:hover, .dropdown .menu a.active { background: var(--primary-soft); }
.dropdown .menu .mi { width: 34px; height: 34px; border-radius: var(--r-xs); display: grid; place-items: center; background: var(--surface-2); color: var(--primary); flex-shrink: 0; }
.dropdown .menu .mi svg { width: 18px; height: 18px; }
.dropdown .menu b { display: block; font-size: .9rem; }
.dropdown .menu small { display: block; font-size: .74rem; color: var(--text-4); }

.mobile-menu { border-top: 1px solid var(--border); background: var(--surface); }
.mobile-menu .wrap { padding-top: 8px; padding-bottom: 12px; }
.mm-title { font-size: .72rem; color: var(--text-4); padding: 10px 12px 4px; text-transform: uppercase; letter-spacing: .04em; }
.mm-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
.mm-group a { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; }
.mm-group a svg { width: 18px; height: 18px; color: var(--primary); }
.mm-group a:hover, .mm-group a.active { background: var(--primary-soft); }
.menu-btn { display: none; }
@media (max-width: 1023px) {
  .topnav { display: none; }
  .menu-btn { display: inline-flex; }
  .topbar-cta { display: none; }
}

/* the home page is a hub: one door per section */
.doors { display: flex; flex-direction: column; gap: 14px; }
.doors-title { margin: 0; font-size: 1.15rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tiles.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 18px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none;
  transition: transform .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.tile:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: 0 12px 30px var(--primary-glow); }
.tile-ic { width: 42px; height: 42px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 4px; }
.tile-ic svg { width: 22px; height: 22px; }
.tile b { font-size: 1.02rem; }
.tile > span:last-child { font-size: .82rem; color: var(--text-3); line-height: 1.55; }

/* a check on its own page: one column, nothing beside it */
main.page.narrow { max-width: 820px; }
.tool-hero .hero-body p { max-width: 62ch; }
.plain-list { margin: 0; padding: 0 18px; line-height: 1.8; font-size: .9rem; color: var(--text-2); }
.plain-list b { color: var(--text); }

/* ---------- caches page: who hosts the nodes, and each node's state ---------- */
.hosts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.host-d { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.host-d[open] { border-color: var(--primary); }
.host-row {
  display: grid; grid-template-columns: 34px auto minmax(0, 1fr) auto auto 24px;
  align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none;
}
.host-row::-webkit-details-marker { display: none; }
.host-row:hover { background: var(--surface-2); }
.host-rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); font-weight: 700; font-size: .8rem; font-variant-numeric: tabular-nums; }
.host-name { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.host-name .name { font-size: .98rem; }
.host-kinds { display: flex; flex-wrap: wrap; gap: 4px; }
.host-total { text-align: center; line-height: 1.1; }
.host-total b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.host-total small { font-size: .7rem; color: var(--text-4); }
.host-state { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.host-state .st { font-style: normal; font-size: .76rem; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.host-state .st b { font-variant-numeric: tabular-nums; }
.host-state .on { background: var(--up-soft); color: var(--up); }
.host-state .off { background: var(--down-soft); color: var(--down); }
.host-state .flaky { background: var(--degraded-soft); color: var(--degraded); }
.host-state .none { background: var(--surface-2); color: var(--text-4); }
.host-chev { color: var(--text-4); transition: transform .2s var(--ease); }
.host-chev svg { width: 18px; height: 18px; }
.host-d[open] .host-chev { transform: rotate(180deg); }
.host-body { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.host-summary { font-size: .84rem; color: var(--text-2); padding: 10px 0 8px; }
.nstate { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .84rem; white-space: nowrap; }
.nstate i { width: 9px; height: 9px; border-radius: 50%; background: var(--text-4); }
.nstate.up { color: var(--up); } .nstate.up i { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.nstate.down { color: var(--down); } .nstate.down i { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
.nstate.degraded { color: var(--degraded); } .nstate.degraded i { background: var(--degraded); }
.nstate.unknown { color: var(--text-3); }
@media (max-width: 720px) {
  .host-row { grid-template-columns: 30px auto minmax(0, 1fr) 24px; }
  .host-total, .host-state { grid-column: 2 / span 2; justify-content: flex-start; text-align: start; }
  .host-total { display: flex; align-items: baseline; gap: 5px; }
}

/* one line per node: state, what it is and where, address, response, last seen */
.nlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nline {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: .86rem;
}
.ntitle { min-width: 0; display: flex; flex-direction: column; }
.ntitle b { font-size: .88rem; }
.ntitle small { font-size: .74rem; color: var(--text-4); }
.nip { font-size: .8rem; color: var(--text-2); direction: ltr; }
.nrtt { font-variant-numeric: tabular-nums; font-size: .82rem; color: var(--text-2); min-width: 52px; text-align: end; direction: ltr; }
.nago { font-size: .74rem; color: var(--text-4); white-space: nowrap; }
@media (max-width: 720px) {
  .nline { grid-template-columns: 104px minmax(0, 1fr); row-gap: 4px; }
  .nip, .nrtt, .nago { grid-column: 2; text-align: start; min-width: 0; }
  .nrtt::before { content: "الاستجابة "; color: var(--text-4); font-weight: 400; }
}

/* a node that opens to its details (technical sections) */
.nd-list { display: flex; flex-direction: column; gap: 4px; }
.nd { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); overflow: hidden; }
.nd[open] { border-color: var(--primary); background: var(--surface); }
.nd-row {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) auto auto 20px; align-items: center; gap: 12px;
  padding: 8px 12px; cursor: pointer; list-style: none; font-size: .86rem;
}
.nd-row::-webkit-details-marker { display: none; }
.nd-row:hover { background: var(--surface-3, var(--surface-2)); }
.nd-name { min-width: 0; display: flex; flex-direction: column; }
.nd-name b { font-size: .88rem; }
.nd-name small { font-size: .74rem; color: var(--text-4); }
.nd-chev { color: var(--text-4); transition: transform .2s var(--ease); }
.nd-chev svg { width: 16px; height: 16px; }
.nd[open] .nd-chev { transform: rotate(180deg); }
.nd-body {
  margin: 0; padding: 6px 14px 12px; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 22px; font-size: .84rem;
}
.nd-body > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); align-items: baseline; }
.nd-body dt { color: var(--text-4); font-size: .76rem; }
.nd-body dd { margin: 0; min-width: 0; }
.nd-body .break { word-break: break-all; direction: ltr; text-align: end; font-size: .8rem; }
@media (max-width: 720px) {
  .nd-row { grid-template-columns: 104px minmax(0, 1fr) 20px; row-gap: 4px; }
  .nd-row .nip, .nd-row .nrtt { grid-column: 2; text-align: start; }
  .nd-body > div { grid-template-columns: 1fr; gap: 2px; }
}

/* a kind of node as a group that opens to its nodes (same shape as the hosts list) */
.grp-list { display: flex; flex-direction: column; gap: 8px; }
.grp { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.grp[open] { border-color: var(--primary); }
.grp-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto 24px;
  align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none;
}
.grp-row::-webkit-details-marker { display: none; }
.grp-row:hover { background: var(--surface-2); }
.grp-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.grp-name b { font-size: .98rem; }
.grp-name small { font-size: .76rem; color: var(--text-4); }
.grp-body { padding: 8px 12px 12px; border-top: 1px solid var(--border); }
@media (max-width: 720px) {
  .grp-row { grid-template-columns: auto minmax(0, 1fr) 24px; }
  .grp-row .host-total, .grp-row .host-state { grid-column: 2; justify-content: flex-start; }
  .grp-row .host-total { display: flex; align-items: baseline; gap: 5px; }
}

/* ---------- compare page: every company opens to its whole picture ---------- */
.cmp-row { grid-template-columns: 34px auto minmax(0, 1fr) auto auto auto auto 24px; }
.cmp-score { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.cmp-intl { text-align: center; line-height: 1.1; }
.cmp-intl b { display: block; font-size: .95rem; }
.cmp-intl small { font-size: .68rem; color: var(--text-4); }
.cmp-body { padding: 12px 14px 14px; }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.cmp-box { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); padding: 12px 14px; min-width: 0; }
.cmp-box h4 { margin: 0 0 10px; font-size: .9rem; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cmp-box h4 .sub { font-weight: 400; }
.cmp-svcs, .cmp-kinds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cmp-svcs li, .cmp-kinds li { display: flex; align-items: center; gap: 9px; font-size: .84rem; }
.cmp-svcs li .t, .cmp-kinds li .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cmp-svcs li small, .cmp-kinds li small { font-size: .74rem; color: var(--text-4); }
.cmp-svcs li.out b { color: var(--text-3); font-weight: 500; }
.cmp-dl { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: .84rem; }
.cmp-dl > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.cmp-dl dt { color: var(--text-4); font-size: .76rem; }
.cmp-dl dd { margin: 0; min-width: 0; }
.cmp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cmp-body .sc-bar { grid-template-columns: 104px 1fr auto; }
@media (max-width: 1100px) {
  .cmp-row { grid-template-columns: 30px auto minmax(0, 1fr) 24px; }
  .cmp-row .cmp-score, .cmp-row .host-total, .cmp-row .cmp-intl, .cmp-row .host-state { grid-column: 2 / span 2; justify-content: flex-start; text-align: start; }
  .cmp-row .host-total, .cmp-row .cmp-intl { display: flex; align-items: baseline; gap: 5px; }
  .cmp-dl > div { grid-template-columns: 1fr; gap: 2px; }
}

.scan-inline { margin-top: 12px; }
.scan-inline .scan-run { margin: 0; }


/* ---------- companies page: every company a row that opens, services named in full ---------- */
.legend-line { font-size: .8rem; color: var(--text-3); margin: 10px 0 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lg-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 5px; border-radius: 99px;
  font-size: .76rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.lg-chip.on { background: var(--up-soft); color: var(--up); }
.lg-chip.off { background: var(--surface-2); color: var(--text-4); border-color: var(--border); }
.lg-chip.off .mark { filter: grayscale(1); opacity: .55; }
.co-row { grid-template-columns: auto minmax(180px, 1fr) minmax(0, 2fr) auto auto 24px; }
.co-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.co-title .name { font-size: .98rem; }
.co-svcs { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.co-body { padding: 12px 14px 14px; }
.co-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; }
.co-scan { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--primary); border-radius: var(--r); background: linear-gradient(135deg, var(--surface) 0%, var(--primary-soft) 140%); }
.co-scan-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.co-scan-head .sub { margin-top: 4px; max-width: 60ch; }
.scan-list { margin-top: 4px; max-height: 420px; overflow-y: auto; padding-inline-end: 2px; }
.nline.is-new { border: 1px solid var(--primary); }
@media (max-width: 1100px) {
  .co-row { grid-template-columns: auto minmax(0, 1fr) 24px; row-gap: 6px; }
  .co-row .co-svcs, .co-row .host-total, .co-row .host-state { grid-column: 2; }
  .co-row .host-total { display: flex; align-items: baseline; gap: 5px; text-align: start; }
  .co-row .host-state { justify-content: flex-start; }
  .co-grid { grid-template-columns: 1fr; }
}

/* ---------- company cards: their own colour, apart from the page in both themes ----------
   A cyan wash, from the accent the map dots and the brand mark already use, so the companies
   read as one family of cards on every list (الشركات، الكاشات، قارن) without competing with the
   indigo that marks actions and the current page. */
:root {
  --co-bg: #e2f3fa;
  --co-bg-hover: #d3ecf6;
  --co-border: #a6d8e8;
  --co-open: #f1f9fc;
}
:root[data-theme="dark"] {
  --co-bg: #0d2637;
  --co-bg-hover: #123044;
  --co-border: #204f66;
  --co-open: #0a1c29;
}
.grp.co, .host-d, .grp.cmp { background: var(--co-bg); border-color: var(--co-border); }
.grp.co > summary:hover, .host-d > .host-row:hover, .grp.cmp > summary:hover { background: var(--co-bg-hover); }
.grp.co[open], .host-d[open], .grp.cmp[open] { border-color: var(--accent); box-shadow: 0 8px 28px var(--accent-soft); }
.grp.co > .grp-body, .host-d > .host-body, .grp.cmp > .grp-body { background: var(--co-open); border-top-color: var(--co-border); }
.grp.co .host-rank, .host-d .host-rank, .grp.cmp .host-rank { background: var(--accent-soft); color: var(--accent-600); }
:root[data-theme="dark"] .grp.co .host-rank, :root[data-theme="dark"] .host-d .host-rank, :root[data-theme="dark"] .grp.cmp .host-rank { color: var(--accent); }

.subscription-form { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; margin-top:16px; }
.subscription-form label { display:flex; flex-direction:column; gap:5px; color:var(--text-3); font-size:.82rem; }
.subscription-form input { width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:var(--r-sm); background:var(--surface); color:var(--text); font:inherit; }
.subscription-actions { display:flex; align-items:end; gap:8px; flex-wrap:wrap; }
.subscription-compare { margin:8px 0; padding-inline-start:22px; }
