.ai-heatmap-shell {
  --ai-primary: #00f6ff;
  --ai-secondary: #3fff9b;
  --ai-danger: #ff3d7f;
  --ai-background: #030711;
  --ai-card: rgba(6, 12, 24, 0.9);
  --ai-border: rgba(0, 246, 255, 0.18);
  --ai-text: #e7fbff;
  --ai-muted: #8cb0c0;
  color: var(--ai-text);
  background:
    radial-gradient(circle at top left, rgba(0, 246, 255, 0.06), transparent 30%),
    radial-gradient(circle at right center, rgba(63, 255, 155, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(3, 7, 17, 1), rgba(2, 4, 10, 1));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 26px;
  padding: 24px;
  box-shadow: 0 18px 70px rgba(0,0,0,0.35);
  overflow: hidden;
}

.ai-heatmap-app,
.ai-heatmap-app * {
  box-sizing: border-box;
}

.ai-heatmap-app {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ai-heatmap-header {
  margin-bottom: 18px;
}

.ai-heatmap-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ai-primary);
  border: 1px solid rgba(0, 246, 255, 0.3);
  background: rgba(0, 246, 255, 0.08);
  box-shadow: 0 0 18px rgba(0, 246, 255, 0.12) inset;
}

.ai-heatmap-title {
  margin: 14px 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.ai-heatmap-subtitle {
  margin: 0;
  max-width: 880px;
  color: var(--ai-muted);
  font-size: 15px;
}

.ai-heatmap-main {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.ai-heatmap-map-panel,
.ai-panel {
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: 22px;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.ai-heatmap-map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
}

.ai-badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-badge,
.ai-system-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--ai-text);
  font-size: 13px;
}

.ai-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--ai-secondary);
  box-shadow: 0 0 0 0 rgba(63, 255, 155, 0.7);
  animation: aiPulseDot 1.9s infinite;
}

@keyframes aiPulseDot {
  0% { box-shadow: 0 0 0 0 rgba(63,255,155,0.55); }
  70% { box-shadow: 0 0 0 12px rgba(63,255,155,0); }
  100% { box-shadow: 0 0 0 0 rgba(63,255,155,0); }
}

.ai-heatmap-map-frame {
  position: relative;
  min-height: 620px;
  background: #02050c;
}

.ai-heatmap-map {
  position: absolute;
  inset: 0;
}

.ai-grid-overlay,
.ai-radar-overlay,
.ai-scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.ai-grid-overlay {
  background-image:
    linear-gradient(rgba(0, 246, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 246, 255, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mix-blend-mode: screen;
  opacity: 0.22;
}

.ai-radar-overlay {
  background:
    radial-gradient(circle at center, rgba(0, 246, 255, 0.18), rgba(0, 246, 255, 0.04) 20%, transparent 55%),
    conic-gradient(from 0deg, transparent 0deg 250deg, rgba(0, 246, 255, 0.14) 300deg, transparent 340deg);
  mix-blend-mode: screen;
  animation: aiRadarSpin 9s linear infinite;
  transform-origin: center center;
  opacity: 0.65;
}

.ai-radar-overlay.is-hidden {
  display: none;
}

@keyframes aiRadarSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ai-scanline {
  background: linear-gradient(180deg, transparent, rgba(0, 246, 255, 0.06), transparent);
  height: 30%;
  animation: aiScanline 6s linear infinite;
}

@keyframes aiScanline {
  0% { transform: translateY(-40%); }
  100% { transform: translateY(250%); }
}

.ai-map-status {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 4;
  max-width: 430px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(2, 8, 18, 0.86);
  border: 1px solid rgba(0, 246, 255, 0.14);
  color: var(--ai-muted);
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.24);
}

.ai-heatmap-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-panel {
  padding: 18px;
}

.ai-panel h3 {
  margin: 0 0 14px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.ai-panel--muted p {
  margin: 0;
  color: var(--ai-muted);
  font-size: 13px;
  line-height: 1.6;
}

.ai-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ai-stat-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.ai-stat-card--wide {
  grid-column: 1 / -1;
}

.ai-stat-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ai-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ai-stat-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.3;
  word-break: break-word;
}

.ai-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.ai-activity-feed::-webkit-scrollbar {
  width: 8px;
}

.ai-activity-feed::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
}

.ai-feed-item {
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--ai-text);
  font-size: 13px;
  line-height: 1.5;
}

.ai-feed-time {
  display: inline-block;
  margin-right: 8px;
  color: var(--ai-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.ai-cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-cta-button {
  display: block;
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--ai-text);
  font-weight: 600;
  background: linear-gradient(180deg, rgba(0, 246, 255, 0.12), rgba(255,255,255,0.03));
  border: 1px solid rgba(0, 246, 255, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ai-cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(0, 246, 255, 0.08);
  border-color: rgba(0, 246, 255, 0.35);
}

.ai-pulse-marker {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--ai-primary);
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 0 0 0 rgba(0, 246, 255, 0.55);
  animation: aiPulseMarker 1.8s infinite;
}

.ai-pulse-marker.ai-pulse-marker--danger {
  background: var(--ai-danger);
  box-shadow: 0 0 0 0 rgba(255, 61, 127, 0.45);
}

@keyframes aiPulseMarker {
  0% { box-shadow: 0 0 0 0 rgba(0,246,255,0.45); }
  70% { box-shadow: 0 0 0 18px rgba(0,246,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,246,255,0); }
}

.ai-heatmap-shell .maplibregl-control-container .maplibregl-ctrl-group {
  background: rgba(3, 10, 20, 0.88);
  border: 1px solid rgba(0, 246, 255, 0.18);
  box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

.ai-heatmap-shell .maplibregl-ctrl button {
  filter: hue-rotate(130deg) saturate(1.4);
}

@media (max-width: 1100px) {
  .ai-heatmap-main {
    grid-template-columns: 1fr;
  }

  .ai-heatmap-map-frame {
    min-height: 520px;
  }
}

@media (max-width: 640px) {
  .ai-heatmap-shell {
    padding: 16px;
    border-radius: 18px;
  }

  .ai-heatmap-map-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-stat-grid {
    grid-template-columns: 1fr;
  }

  .ai-heatmap-map-frame {
    min-height: 460px;
  }
}
