:root {
  --red: #ff0000;
  --red-dark: #cc0000;
  --header-bg: #0b1020;
  --ink: #0f172a;
  --slate: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --maint: #f59e0b;
  --maint-soft: #fef3c7;
  --none: #e2e8f0;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 48px);
  background: var(--header-bg);
  border-bottom: 3px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-divider { width: 1px; height: 24px; background: rgba(255,255,255,.2); }
.brand-sub { color: #cbd5e1; font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.last-updated { color: #cbd5e1; font-size: .85rem; display: inline-flex; align-items: center; gap: 8px; }
.last-updated::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
}
.last-updated.live::before { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.25); }

/* Layout */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 36px) clamp(16px, 4vw, 48px) 64px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Banner */
.banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 26px 28px;
  border-radius: var(--radius);
  color: #fff;
  box-shadow: var(--shadow);
}
.banner--ok { background: linear-gradient(135deg, #16a34a, #15803d); }
.banner--maint { background: linear-gradient(135deg, #f59e0b, #d97706); }
.banner--loading { background: linear-gradient(135deg, #64748b, #475569); }
.banner--error { background: linear-gradient(135deg, #64748b, #334155); }
.banner-icon {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.22);
  display: grid; place-items: center;
}
.banner-icon::after {
  content: ""; width: 20px; height: 20px;
  background: #fff;
  -webkit-mask: var(--icon) center/contain no-repeat;
          mask: var(--icon) center/contain no-repeat;
}
.banner--ok .banner-icon::after { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E"); }
.banner--maint .banner-icon::after { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z'/%3E%3C/svg%3E"); }
.banner--loading .banner-icon::after,
.banner--error .banner-icon::after { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 7h2v6h-2zm0 8h2v2h-2z'/%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E"); }
.banner-text h1 { margin: 0 0 4px; font-size: clamp(1.15rem, 2.4vw, 1.5rem); }
.banner-text p { margin: 0; opacity: .92; font-size: .92rem; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow);
}
.stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.stat-label { color: var(--slate); font-size: .82rem; }
.stat-card--ok .stat-value { color: var(--ok); }
.stat-card--maint .stat-value { color: var(--maint); }
.stat-card--regions .stat-value { color: var(--ok); }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.card-head h2 { margin: 0; font-size: 1.05rem; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--slate); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot--ok { background: var(--ok); }
.dot--maint { background: var(--maint); }
.dot--none { background: var(--none); border: 1px solid #cbd5e1; }

/* Map */
.map-card .map { height: clamp(360px, 52vw, 560px); width: 100%; }
.jvm-tooltip {
  border-radius: 10px !important;
  padding: 10px 12px !important;
  background: #0f172a !important;
  box-shadow: 0 10px 30px rgba(15,23,42,.25) !important;
  font-family: inherit !important;
  font-size: .82rem !important;
  line-height: 1.45 !important;
}
.tt-name { font-weight: 700; display: block; margin-bottom: 3px; }
.tt-status { font-weight: 600; }
.tt-status.ok { color: #4ade80; }
.tt-status.maint { color: #fbbf24; }
.tt-meta { color: #cbd5e1; display: block; margin-top: 3px; }

/* Controls */
.card-head--controls { align-items: center; }
.controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: .9rem;
  min-width: 220px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,0,27,.12); }
.filter-group { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.filter {
  border: 0; background: transparent; cursor: pointer;
  padding: 7px 14px; border-radius: 8px; font-size: .85rem; font-weight: 600;
  color: var(--slate); transition: background .15s, color .15s;
}
.filter:hover { color: var(--ink); }
.filter.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* Country grid */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
  padding: 1px;
}
.country {
  background: var(--card);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
}
.flag { font-size: 1.5rem; line-height: 1; flex: 0 0 auto; width: 26px; text-align: center; }
.country-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.country-name { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.country-meta { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge {
  flex: 0 0 auto;
  font-size: .72rem; font-weight: 700;
  padding: 5px 10px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.badge--ok { background: var(--ok-soft); color: #15803d; }
.badge--ok::before { background: var(--ok); }
.badge--maint { background: var(--maint-soft); color: #b45309; }
.badge--maint::before { background: var(--maint); }
.badge--none { background: #f1f5f9; color: var(--slate); }
.badge--none::before { background: var(--muted); }
.no-results { padding: 30px; text-align: center; color: var(--slate); }

/* Region grid */
.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  padding: 20px 22px;
}
.region {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.region-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.region-name { font-weight: 700; font-size: .95rem; }
.region-count { color: var(--muted); font-size: .78rem; }

/* Service tag */
.svc { font-weight: 700; }
.svc--5G { color: var(--red); }

/* Footer */
.site-footer { text-align: center; padding: 28px 16px 40px; color: var(--muted); font-size: .82rem; }
.footer-support {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 14px; padding-bottom: 22px; margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.footer-support-text { color: var(--slate); font-size: .92rem; }
.help-link {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 20px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: .9rem; font-weight: 700;
  text-decoration: none; transition: background .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(255,0,0,.25);
}
.help-link:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255,0,0,.32); }
.help-link:focus-visible { outline: 3px solid rgba(255,0,0,.35); outline-offset: 2px; }
.help-icon { width: 17px; height: 17px; }
.footer-tagline { font-weight: 800; font-size: 1rem; color: var(--ink); margin: 0 0 6px; }
.footer-tagline::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--red); margin-right: 8px; vertical-align: middle; }

/* Responsive */
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .search { min-width: 0; flex: 1; }
  .controls { width: 100%; }
  .header-meta { display: none; }
}
