/* HighlightPilot Radar — futuristic HUD surface */
.radar-hero { padding: 1.5rem 0 0.75rem; text-align: center; }
.radar-hero h1 { font-size: clamp(1.85rem, 4vw, 2.75rem); margin: 0.35rem 0 0.75rem; }
.radar-hero .lead { max-width: 40rem; margin-inline: auto; }
.radar-live-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  letter-spacing: 0.08em; font-weight: 700;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(56,217,255,0.35);
  border-radius: 0.35rem;
  background: linear-gradient(90deg, rgba(56,217,255,0.12), rgba(255,77,109,0.08));
  box-shadow: 0 0 24px rgba(56,217,255,0.12);
}
.radar-live-dot {
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: #ff4d6d; box-shadow: 0 0 0 0 rgba(255,77,109,0.55);
  animation: radarPulseDot 1.6s ease-out infinite;
}
.radar-live-pill.is-stale .radar-live-dot { background: #94a3b8; animation: none; box-shadow: none; }
@keyframes radarPulseDot {
  0% { box-shadow: 0 0 0 0 rgba(255,77,109,0.55); }
  70% { box-shadow: 0 0 0 10px rgba(255,77,109,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,77,109,0); }
}
@media (prefers-reduced-motion: reduce) {
  .radar-live-dot { animation: none; }
}

.radar-shell { padding-bottom: 2rem; }
.radar-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin: 0.85rem auto 0.65rem;
}
.radar-view-toggle {
  display: inline-flex;
  gap: 0.3rem;
  flex: 0 0 auto;
}
.radar-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  align-items: center;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}
.radar-filters .form-input,
.radar-filters select.form-input {
  box-sizing: border-box;
  flex: 0 1 auto;
  width: 8.25rem;
  min-width: 0;
  max-width: none;
  height: 2.15rem;
  margin: 0;
  padding: 0 1.75rem 0 0.65rem;
  font-size: 0.82rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  line-height: 1.2;
  border-radius: 0.4rem;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
#radar-search {
  width: 11.5rem;
  flex: 1 1 11.5rem;
  max-width: 16rem;
  padding-right: 0.65rem;
  background-image: none;
}
.radar-filters select.form-input:focus,
#radar-search:focus {
  outline: none;
  border-color: rgba(56, 217, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(56, 217, 255, 0.15);
}

.radar-stage {
  position: relative;
  border-radius: 0.85rem;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(56,217,255,0.10), transparent 55%),
    radial-gradient(ellipse at 18% 12%, rgba(56,217,255,0.14), transparent 40%),
    radial-gradient(ellipse at 82% 88%, rgba(255,77,109,0.12), transparent 42%),
    linear-gradient(165deg, #070b14 0%, #0d1524 48%, #0a101c 100%);
  border: 1px solid rgba(56,217,255,0.28);
  box-shadow:
    0 0 0 1px rgba(255,77,109,0.08) inset,
    0 0 60px rgba(56,217,255,0.08),
    0 24px 60px rgba(2,6,23,0.45);
  min-height: 420px;
}
html[data-theme="light"] .radar-stage {
  background:
    radial-gradient(ellipse at 50% 45%, rgba(56,217,255,0.14), transparent 55%),
    radial-gradient(ellipse at 20% 10%, rgba(56,217,255,0.18), transparent 42%),
    radial-gradient(ellipse at 80% 90%, rgba(255,77,109,0.10), transparent 40%),
    linear-gradient(165deg, #0c1524, #121c30 50%, #0e1626);
}
html[data-theme="dark"] .radar-stage {
  border-color: rgba(56,217,255,0.32);
}

/* HUD chrome */
.radar-hud-frame {
  pointer-events: none;
  position: absolute; inset: 0; z-index: 2;
}
.radar-hud-frame::before,
.radar-hud-frame::after {
  content: "";
  position: absolute;
  width: 2.25rem; height: 2.25rem;
  border: 2px solid rgba(56,217,255,0.55);
  box-shadow: 0 0 12px rgba(56,217,255,0.25);
}
.radar-hud-frame::before {
  top: 0.65rem; left: 0.65rem;
  border-right: 0; border-bottom: 0;
}
.radar-hud-frame::after {
  top: 0.65rem; right: 0.65rem;
  border-left: 0; border-bottom: 0;
}
.radar-hud-corners {
  pointer-events: none;
  position: absolute; inset: 0; z-index: 2;
}
.radar-hud-corners::before,
.radar-hud-corners::after {
  content: "";
  position: absolute;
  width: 2.25rem; height: 2.25rem;
  border: 2px solid rgba(255,77,109,0.4);
}
.radar-hud-corners::before {
  bottom: 0.65rem; left: 0.65rem;
  border-right: 0; border-top: 0;
}
.radar-hud-corners::after {
  bottom: 0.65rem; right: 0.65rem;
  border-left: 0; border-top: 0;
}

.radar-scanlines {
  pointer-events: none;
  position: absolute; inset: 0; z-index: 3;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(2, 6, 23, 0.12) 2px,
    rgba(2, 6, 23, 0.12) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.45;
}
.radar-vignette {
  pointer-events: none;
  position: absolute; inset: 0; z-index: 3;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(2,6,23,0.55) 100%);
}
.radar-hud-readout {
  pointer-events: none;
  position: absolute; z-index: 4;
  top: 0.85rem; left: 50%; transform: translateX(-50%);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(56,217,255,0.85);
  text-shadow: 0 0 12px rgba(56,217,255,0.45);
  white-space: nowrap;
}
.radar-hud-legend {
  pointer-events: none;
  position: absolute; z-index: 4;
  right: 1rem; bottom: 1rem;
  display: flex; flex-direction: column; gap: 0.25rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.65rem; letter-spacing: 0.08em;
  color: rgba(148,163,184,0.9);
}
.radar-hud-legend .radar-hud-axis {
  letter-spacing: 0.1em;
  color: rgba(56,217,255,0.85);
  margin-bottom: 0.15rem;
}
.radar-hud-legend span {
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.radar-hud-legend i {
  width: 0.55rem; height: 0.55rem; border-radius: 50%; display: inline-block;
}
.radar-hud-legend .c-calm { background: #38d9ff; box-shadow: 0 0 8px #38d9ff; }
.radar-hud-legend .c-warming { background: #34d399; box-shadow: 0 0 8px #34d399; }
.radar-hud-legend .c-active { background: #facc15; box-shadow: 0 0 8px #facc15; }
.radar-hud-legend .c-hot { background: #fb923c; box-shadow: 0 0 8px #fb923c; }
.radar-hud-legend .c-extreme { background: #f43f5e; box-shadow: 0 0 8px #f43f5e; }

#radar-canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; position: relative; z-index: 1; }
#radar-canvas:active { cursor: grabbing; }
.radar-empty {
  position: absolute; inset: auto 1rem 1rem; text-align: center; pointer-events: none; z-index: 5;
  color: rgba(226,232,240,0.9);
}
.radar-hover {
  position: absolute; z-index: 6; pointer-events: none;
  min-width: 12.5rem; max-width: 17rem; padding: 0.8rem 0.9rem;
  border-radius: 0.35rem;
  background: linear-gradient(160deg, rgba(8,14,28,0.96), rgba(12,20,36,0.94));
  color: #e2e8f0;
  font-size: 0.85rem; line-height: 1.35;
  border: 1px solid rgba(56,217,255,0.35);
  box-shadow: 0 0 24px rgba(56,217,255,0.15), 0 16px 40px rgba(0,0,0,0.45);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.radar-hover strong {
  display: block; font-size: 0.95rem; margin-bottom: 0.35rem;
  letter-spacing: 0.04em; color: #f8fafc;
}
.radar-hover .heat {
  color: #ff7aa2; font-weight: 700; letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(255,77,109,0.45);
}

.radar-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.radar-table th, .radar-table td { padding: 0.65rem 0.5rem; text-align: left; border-bottom: 1px solid rgba(148,163,184,0.25); }
.radar-table tbody tr { cursor: pointer; }
.radar-table tbody tr:hover { background: rgba(56,217,255,0.08); }
.radar-table .heat-cell { font-weight: 700; }
.table-scroll { overflow-x: auto; }

.radar-panel {
  position: fixed; top: 0; right: 0; width: min(100%, 24rem); height: 100%;
  z-index: 80;
  background: linear-gradient(180deg, #0c1524, #101a2c);
  color: #e2e8f0;
  box-shadow: -12px 0 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(56,217,255,0.2);
  padding: 1.25rem; overflow-y: auto;
}
html[data-theme="dark"] .radar-panel { background: linear-gradient(180deg, #0a1220, #101a2c); }
.radar-panel-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  border: 0; background: transparent; font-size: 1.1rem; cursor: pointer; color: inherit;
}
.radar-backdrop {
  position: fixed; inset: 0; background: rgba(2,6,23,0.55); z-index: 70;
}
.radar-panel .radar-metric-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; margin: 1rem 0;
}
.radar-panel .radar-metric {
  padding: 0.65rem; border-radius: 0.35rem;
  background: rgba(56,217,255,0.08);
  border: 1px solid rgba(56,217,255,0.18);
}
.radar-panel .radar-metric span { display: block; font-size: 0.75rem; opacity: 0.75; letter-spacing: 0.06em; text-transform: uppercase; }
.radar-panel .radar-metric strong { font-size: 1.05rem; }
.radar-spark { width: 100%; height: 48px; margin: 0.5rem 0 1rem; }
.radar-avatar {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #334155;
  box-shadow: 0 0 0 2px rgba(56,217,255,0.45), 0 0 16px rgba(56,217,255,0.25);
}

.radar-home {
  margin: 2rem auto; max-width: 40rem;
}
.radar-home-list { list-style: none; padding: 0; margin: 1rem 0; }
.radar-home-list li {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: 0.65rem 0; border-bottom: 1px solid rgba(148,163,184,0.2);
}
.radar-home-list .meta { font-size: 0.9rem; opacity: 0.8; }

@media (max-width: 960px) {
  .radar-toolbar {
    flex-wrap: wrap;
    align-items: stretch;
  }
  .radar-view-toggle { width: 100%; }
  .radar-filters {
    width: 100%;
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .radar-filters .form-input,
  .radar-filters select.form-input {
    flex: 1 1 calc(25% - 0.45rem);
    width: auto;
    min-width: 7.5rem;
  }
  #radar-search {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .radar-filters .form-input,
  .radar-filters select.form-input {
    flex: 1 1 calc(50% - 0.45rem);
    min-width: 0;
  }
  .radar-stage { min-height: 360px; }
  .radar-hud-legend { display: none; }
  .radar-hud-readout { font-size: 0.58rem; top: 0.55rem; }
  .radar-panel {
    top: auto; bottom: 0; height: min(78vh, 32rem); width: 100%;
    border-radius: 1rem 1rem 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .radar-scanlines { opacity: 0.25; }
}
