:root {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --blue: #38bdf8;
  --blue-light: #e0f2fe;
  --success: #22c55e;
  --success-soft: #dcfce7;
  --error: #dc2626;
  --error-soft: #fee2e2;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --ink: #0f172a;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --radius: 12px;
  --max: 1120px;
  --touch: 44px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  overflow-x: clip;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary-dark);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  min-height: var(--touch);
}

.nav-brand img {
  border-radius: 7px;
  width: 28px;
  height: 28px;
}

.nav-brand-sub {
  font-weight: 500;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  background: var(--bg-alt);
}

.nav-links a.active {
  color: var(--primary-dark);
  background: var(--blue-light);
}

/* ---------- API banner ---------- */

.api-banner {
  background: var(--error-soft);
  color: #991b1b;
  border-bottom: 1px solid rgba(220, 38, 38, 0.2);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.api-banner-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
  animation: pulse 1.8s ease-in-out infinite;
}

.api-banner.ok {
  background: var(--success-soft);
  color: #15803d;
  border-bottom-color: rgba(34, 197, 94, 0.2);
}

.api-banner.ok .api-banner-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  padding: 11px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  min-height: var(--touch);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--primary-dark);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-alt);
  border-color: var(--primary);
}

.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60% 90% at 75% 0%, rgba(14, 165, 233, 0.1) 0%, rgba(14, 165, 233, 0) 70%),
    radial-gradient(45% 70% at 10% 20%, rgba(56, 189, 248, 0.08) 0%, rgba(56, 189, 248, 0) 70%),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border);
  padding: 48px 16px 56px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 75%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 75%);
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.16) 0%, transparent 65%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  left: 70%;
  top: 20%;
}

.hero-inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 32px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(14, 165, 233, 0.35);
  background: rgba(224, 242, 254, 0.6);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 18px;
  min-height: var(--touch);
}

.eyebrow-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.eyebrow-dot.pulse {
  animation: pulse 1.8s ease-in-out infinite;
}

.eyebrow-dot.degraded {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18);
}

.eyebrow-dot.error {
  background: var(--error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.85;
  }
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 7vw, 52px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.06;
  color: var(--ink);
}

.hero-sub {
  margin: 0 0 24px;
  max-width: 460px;
  font-size: 16px;
  color: var(--text-secondary);
}

.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  min-width: 110px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  flex: 1 1 auto;
}

.stat-chip-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat-chip-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.last-check {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ---------- Probe card ---------- */

.probe-card {
  width: 100%;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 24px 48px -24px rgba(2, 132, 199, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.probe-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.probe-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
}

.probe-dot.ok {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.probe-dot.degraded {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18);
}

.probe-dot.error {
  background: var(--error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

.probe-dot.pulse {
  animation: pulse 1.8s ease-in-out infinite;
}

.probe-sparkline {
  height: 56px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  margin-bottom: 12px;
}

.probe-sparkline svg {
  width: 100%;
  height: 100%;
  display: block;
}

.probe-sparkline polyline {
  vector-effect: non-scaling-stroke;
}

.probe-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---------- Sections ---------- */

.section {
  padding: 52px 16px;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section-kicker {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}

.section h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.025em;
  text-align: center;
  color: var(--ink);
}

.section-sub {
  margin: 0 auto 32px;
  max-width: 520px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
}

/* ---------- Services ---------- */

.services-status {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 36px 0;
  margin: 0;
}

.services-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.service-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.service-card:hover {
  border-color: rgba(14, 165, 233, 0.35);
  box-shadow: 0 8px 24px -16px rgba(2, 132, 199, 0.28);
}

.service-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.service-main h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.service-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.service-detail {
  color: var(--text-muted);
}

.service-latency {
  font-variant-numeric: tabular-nums;
}

.service-sparkline {
  height: 44px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 6px;
}

.service-sparkline svg {
  width: 100%;
  height: 100%;
  display: block;
}

.service-sparkline polyline,
.service-sparkline circle {
  vector-effect: non-scaling-stroke;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.operational {
  background: var(--success-soft);
  color: #15803d;
}

.status-pill.degraded {
  background: var(--amber-soft);
  color: #92400e;
}

.status-pill.down {
  background: var(--error-soft);
  color: #991b1b;
}

.status-pill.unknown {
  background: var(--bg-alt);
  color: var(--text-muted);
}

/* ---------- Traffic ---------- */

.traffic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.traffic-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.traffic-card h3 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chart-wrap {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.chart-svg {
  width: 100%;
  height: auto;
  max-height: 320px;
  display: block;
  max-width: 100%;
}

.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: rgba(14, 165, 233, 0.1);
  stroke: none;
}

.chart-axis {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.chart-dot {
  fill: var(--primary);
  r: 3;
}

.chart-bar {
  fill: var(--primary);
  opacity: 0.9;
}

.chart-bar:hover {
  opacity: 1;
  fill: var(--primary-dark);
}

.chart-bar.dim {
  fill: var(--blue-light);
  opacity: 0.55;
}

.chart-label {
  font-size: 10px;
  fill: var(--text-muted);
  font-weight: 500;
}

.chart-tick {
  font-size: 10px;
  fill: var(--text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.bar-chart {
  width: 100%;
  height: auto;
  display: block;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bar-row:last-child {
  margin-bottom: 0;
}

.bar-label {
  width: 32px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  flex: 1;
  height: 10px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  min-width: 2px;
}

.bar-value {
  width: 44px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.traffic-link {
  text-align: center;
  margin-top: 18px;
}

.traffic-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
}

.traffic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 420px;
}

.traffic-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.traffic-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: middle;
}

.traffic-table tr:last-child td {
  border-bottom: none;
}

.table-empty {
  text-align: center;
  color: var(--text-muted);
}

.country-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.country-flag {
  font-size: 16px;
  line-height: 1;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}

.trend-up {
  color: var(--success);
}

.trend-down {
  color: var(--error);
}

.trend-stable {
  color: var(--text-muted);
}

.trend svg {
  width: 12px;
  height: 12px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-dot.up {
  color: var(--success);
}

.status-dot.down {
  color: var(--error);
}

.status-dot.stable {
  color: var(--text-muted);
}

/* ---------- Locations page ---------- */

.location-hero {
  padding: 32px 16px 24px;
}

.location-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.location-hero p {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 15px;
}

.window-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}

.window-tabs::-webkit-scrollbar {
  display: none;
}

.window-tab {
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  min-height: var(--touch);
  padding: 8px 16px;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.window-tab:hover {
  border-color: var(--primary);
  color: var(--ink);
}

.window-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.location-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.search-field {
  position: relative;
  flex: 1 1 100%;
  min-width: 0;
}

.search-field input {
  width: 100%;
  min-height: var(--touch);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.search-field input:focus {
  border-color: var(--primary);
  outline: none;
}

.sort-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
}

.sort-field select {
  min-height: var(--touch);
  padding: 10px 32px 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background:
    var(--bg)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23475569' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  appearance: none;
  cursor: pointer;
}

.sort-field select:focus {
  border-color: var(--primary);
  outline: none;
}

.refresh-hint {
  color: var(--text-muted);
  font-size: 12.5px;
  flex: 1 1 auto;
  text-align: right;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.kpi-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.kpi-card .kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kpi-card .kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.kpi-card .kpi-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.chart-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.chart-card h3 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chart-card .updated {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
}

.country-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.country-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.country-card:hover {
  border-color: rgba(14, 165, 233, 0.35);
  box-shadow: 0 8px 24px -16px rgba(2, 132, 199, 0.28);
}

.country-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.country-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.country-card-title .country-flag {
  font-size: 20px;
}

.country-card-name {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.country-card-count {
  text-align: right;
}

.country-card-count .count {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.country-card-count .trend {
  font-size: 12.5px;
  margin-top: 2px;
}

.country-share {
  margin-bottom: 12px;
}

.country-share-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.country-share-bar {
  height: 8px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
}

.country-share-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  min-width: 2px;
}

.country-mini-chart {
  margin-top: 14px;
}

.country-mini-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.country-mini-chart svg {
  width: 100%;
  height: auto;
  max-height: 96px;
  display: block;
}

.country-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 0;
}

/* ---------- Report form ---------- */

.report-inner {
  max-width: 620px;
}

.report-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.report-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.report-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-field .optional {
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.report-field input,
.report-field select,
.report-field textarea {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-alt);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  min-height: var(--touch);
}

.report-field input:hover,
.report-field select:hover,
.report-field textarea:hover {
  border-color: #cbd5e1;
}

.report-field input:focus,
.report-field select:focus,
.report-field textarea:focus {
  border-color: var(--primary);
  background: var(--bg);
  outline: none;
}

.report-field textarea {
  resize: vertical;
  min-height: 100px;
}

.report-grid .report-field {
  margin-bottom: 0;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.report-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.report-note.success {
  color: #15803d;
}

/* ---------- Footer ---------- */

.footer {
  background: #0b1220;
  color: #cbd5e1;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 16px 24px;
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand img {
  border-radius: 7px;
  width: 26px;
  height: 26px;
}

.footer-brand > div {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.footer-name {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}

.footer-tag {
  font-size: 12px;
  color: #94a3b8;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  text-decoration: none;
  color: #94a3b8;
  font-weight: 500;
  font-size: 13px;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  padding-top: 18px;
}

.footer-bottom p {
  margin: 0;
  color: #64748b;
  font-size: 12.5px;
}

/* ---------- Entrance ---------- */

.hero-in {
  animation: hero-in 0.7s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

.hero-visual.hero-in {
  animation-delay: 0.15s;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .eyebrow-dot.pulse,
  .probe-dot.pulse,
  .api-banner-dot {
    animation: none;
  }

  .hero-in {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ---------- Responsive (mobile-first up) ---------- */

@media (min-width: 480px) {
  .stat-chip {
    min-width: 130px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 640px) {
  .nav-inner {
    padding: 0 24px;
    min-height: 60px;
    flex-wrap: nowrap;
  }

  .nav-brand {
    font-size: 17px;
  }

  .nav-brand img {
    width: 30px;
    height: 30px;
  }

  .hero {
    padding: 72px 24px 80px;
  }

  .hero h1 {
    font-size: clamp(40px, 5vw, 52px);
  }

  .hero-sub {
    font-size: 17px;
  }

  .stat-chips {
    gap: 12px;
  }

  .stat-chip {
    padding: 14px 18px;
  }

  .stat-chip-value {
    font-size: 22px;
  }

  .probe-card {
    max-width: 340px;
    margin-left: auto;
    padding: 18px;
  }

  .section {
    padding: 72px 24px;
  }

  .section-sub {
    font-size: 16px;
    margin-bottom: 40px;
  }

  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .service-card {
    padding: 18px 20px;
  }

  .traffic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 32px;
  }

  .traffic-card {
    padding: 20px;
  }

  .report-form {
    padding: 24px;
  }

  .report-grid {
    grid-template-columns: 1fr 1fr;
  }

  .country-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .location-hero {
    padding: 48px 24px 32px;
  }

  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .search-field {
    flex: 1 1 auto;
    min-width: 220px;
  }

  .location-controls {
    flex-wrap: nowrap;
  }

  .footer-inner {
    padding: 40px 24px 28px;
  }

  .footer-top {
    align-items: center;
    gap: 24px;
  }

  .footer-links {
    gap: 22px;
  }
}

@media (min-width: 860px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 48px;
  }

  .hero-copy {
    text-align: left;
  }

  .hero-sub {
    margin-left: 0;
    margin-right: 0;
  }

  .stat-chips {
    justify-content: flex-start;
  }

  .country-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .country-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- Mobile table as cards ---------- */

@media (max-width: 639px) {
  .traffic-table-wrap {
    overflow-x: visible;
    border: none;
    background: transparent;
  }

  .traffic-table,
  .traffic-table thead,
  .traffic-table tbody,
  .traffic-table th,
  .traffic-table td,
  .traffic-table tr {
    display: block;
    width: 100%;
  }

  .traffic-table thead {
    display: none;
  }

  .traffic-table tr {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
  }

  .traffic-table td {
    border: none;
    padding: 6px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .traffic-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
  }

  .traffic-table td.table-empty {
    justify-content: center;
  }

  .traffic-table td.table-empty::before {
    content: none;
  }
}
