/* ═══════════════════════════════════════════════════════════════════════════
   Mental Health Radar — Dark dashboard theme
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ─── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --bg:          #0b1017;
  --surface:     #111925;
  --surface-2:   #172030;
  --border:      #233448;
  --text:        #daeaf8;
  --muted:       #6090b4;
  --accent:      #38bdf8;
  --accent-dim:  rgba(56, 189, 248, 0.09);
  --accent-glow: 0 0 14px rgba(56, 189, 248, 0.22);

  /* Risk level palette — v4 equal-interval bands */
  --thriving:  #4ade80;
  --stable:    #7dd3fc;
  --oecd-base: #fde68a;
  --severe:    #fb923c;
  --crisis:    #f87171;

  --radius: 8px;
  --gap: 1.25rem;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, "Cascadia Code", monospace;
}

/* ─── Reset + base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Very subtle scanline — just a hint of texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.025) 3px,
    rgba(0, 0, 0, 0.025) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Header ────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-logo {
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  display: flex;
  align-items: center;
  color: var(--accent);
  flex-shrink: 0;
}
.logo-accent { color: var(--accent); }

/* LIVE badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.14rem 0.5rem;
  background: rgba(56, 189, 248, 0.12);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: live-pulse 1.8s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 5px var(--accent); }
  50%       { opacity: 0.2; box-shadow: none; }
}

/* Header timestamp */
.header-timestamp {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Plain nav link (Dashboard) */
.nav-link {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.3rem 0.6rem;
  text-decoration: none;
  transition: color 0.15s;
}
.nav-link:hover,
.nav-link.active { color: var(--text); text-decoration: none; }

/* Modal-trigger buttons */
.nav-btn {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.32rem 0.75rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-btn:hover {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.4);
  background: var(--accent-dim);
}
.nav-btn--primary {
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.5);
  background: var(--accent-dim);
}
.nav-btn--primary:hover {
  background: rgba(56, 189, 248, 0.15);
  box-shadow: var(--accent-glow);
}

/* ─── Main layout ───────────────────────────────────────────────────────── */
main {
  flex: 1;
  padding: var(--gap) 1.5rem;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
}

/* Subtle corner accents */
.card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 16px; height: 16px;
  border-top: 1px solid rgba(56, 189, 248, 0.3);
  border-left: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius) 0 0 0;
  pointer-events: none;
}
.card::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 16px; height: 16px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
  border-right: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 0 0 var(--radius) 0;
  pointer-events: none;
}

.card-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.card-title::before {
  content: '// ';
  color: var(--accent);
  opacity: 0.6;
}

/* ─── Map ───────────────────────────────────────────────────────────────── */
.map-card {
  flex: 1;
  min-height: 380px;
}

#map-container {
  width: 100%;
  aspect-ratio: 960 / 600;
  max-height: 520px;
}

#map-container svg {
  width: 100%;
  height: 100%;
}

.state-path {
  stroke: #111925;
  stroke-width: 0.8;
  cursor: pointer;
  transition: opacity 0.15s, stroke 0.15s;
}

.state-path:hover    { opacity: 0.85; stroke: var(--text); stroke-width: 1.2; }
.state-path.selected { stroke: #fff; stroke-width: 1.8; opacity: 1; }
.state-path.dimmed   { opacity: 0.3; }

/* ─── Map legend ────────────────────────────────────────────────────────── */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ─── Tooltip ───────────────────────────────────────────────────────────── */
#map-tooltip {
  position: fixed;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 200;
  max-width: 200px;
}

#map-tooltip.visible { opacity: 1; }
#map-tooltip .tt-state { font-weight: 600; color: var(--text); }
#map-tooltip .tt-score { color: var(--muted); font-size: 0.76rem; }

/* ─── Trend section ─────────────────────────────────────────────────────── */
.trend-section canvas { height: 160px; max-height: 160px; }

/* ─── State panel (reused classes for state-info-bar) ───────────────────── */
.panel-empty {
  color: var(--muted);
  font-size: 0.875rem;
  padding: 1rem 0;
}

/* State info bar */
.state-info-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.state-info-bar.hidden { display: none; }

.state-info-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.state-info-updated {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: auto;
}

/* Domains card */
.domains-section-card { display: flex; flex-direction: column; gap: 0.4rem; }

/* Expand button */
.expand-domains-btn {
  align-self: flex-start;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.72rem;
  font-family: var(--mono);
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  margin-top: 0.25rem;
}
.expand-domains-btn:hover { color: var(--text); border-color: var(--accent); }
.expand-domains-btn.hidden { display: none; }

/* Collapsed rest */
.domains-rest.hidden { display: none; }

.panel-composite-score {
  font-family: var(--mono);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  margin-left: auto;
}

.panel-risk-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  background: rgba(255,255,255,0.07);
}

/* SYNDEMIC badge */
.syndemic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fde68a;
  background: rgba(253, 230, 138, 0.1);
  border: 1px solid rgba(253, 230, 138, 0.3);
  border-radius: 5px;
  padding: 0.25rem 0.5rem;
}

/* BVI modifier pill */
.bvi-pill {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.bvi-value { font-weight: 600; color: var(--text); }

/* ─── Domain bars ───────────────────────────────────────────────────────── */
.domains-section { display: flex; flex-direction: column; gap: 0.48rem; }

.domain-item {
  display: flex;
  flex-direction: column;
}

#domains-top4, #domains-rest {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem 1.5rem;
}

.domains-title {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.domains-title::before {
  content: '// ';
  color: var(--accent);
  opacity: 0.6;
}

.domain-row {
  display: grid;
  grid-template-columns: 1.5rem 1fr 2.5rem;
  align-items: center;
  gap: 0.4rem;
}

.domain-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  flex-shrink: 0;
}

.domain-name {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.domain-score-val {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  text-align: right;
}

/* ─── Top signals ───────────────────────────────────────────────────────── */
.signals-section {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}
.signals-section strong { color: var(--text); }

/* ─── State sparkline ───────────────────────────────────────────────────── */
.sparkline-section { display: flex; flex-direction: column; gap: 0.4rem; }

.sparkline-section .spark-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.sparkline-section .spark-label::before {
  content: '// ';
  color: var(--accent);
  opacity: 0.6;
}

.sparkline-section canvas { max-height: 70px; }

/* ─── Last-updated notice ───────────────────────────────────────────────── */
.last-updated {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* ─── Score denom (/100 suffix) ─────────────────────────────────────────── */
.score-denom {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--muted);
}

/* ─── Domain list rows (Image-2 style) ──────────────────────────────────── */
.domain-list-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.domain-list-row:last-child { border-bottom: none; }

.domain-list-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 0 0 230px;
  min-width: 0;
}

.domain-list-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.domain-list-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.domain-list-source {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.domain-list-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.domain-bar-track {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
}

.domain-bar-fill {
  height: 100%;
  border-radius: 1px;
}

.domain-list-score {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 2rem;
  text-align: right;
}

/* ─── Risk level helpers ────────────────────────────────────────────────── */
[data-risk="Thriving"]   { color: var(--thriving);  }
[data-risk="Stable"]     { color: var(--stable);    }
[data-risk="OECD Base"]  { color: var(--oecd-base); }
[data-risk="Severe"]     { color: var(--severe);    }
[data-risk="Crisis"]     { color: var(--crisis);    }

/* ─── Footer ────────────────────────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); text-decoration: none; }

/* ─── Modals ────────────────────────────────────────────────────────────── */
dialog.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  max-width: 700px;
  width: 95vw;
  max-height: 84vh;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.65), var(--accent-glow);
}
dialog.modal::backdrop {
  background: rgba(6, 10, 18, 0.85);
  backdrop-filter: blur(3px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-title {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 5px;
  transition: color 0.15s, border-color 0.15s;
}
.modal-close:hover { color: var(--text); border-color: var(--border); }

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: calc(84vh - 57px);
  line-height: 1.7;
}

/* Typography inside modals */
.modal-body h2 {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1.5rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.modal-body h2:first-child { margin-top: 0; }

.modal-body h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin: 1rem 0 0.35rem;
}

.modal-body p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.modal-body p strong { color: var(--text); }
.modal-body p em    { color: var(--text); font-style: normal; }
.modal-body a { color: var(--accent); }

.modal-body ul, .modal-body ol {
  padding-left: 1.5rem;
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.modal-body li { margin-bottom: 0.28rem; }

/* API endpoint rows */
.api-endpoint {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.45rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.api-endpoint code { color: var(--accent); word-break: break-all; }
.ep-method {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #0b1017;
  background: var(--accent);
  padding: 0.1rem 0.38rem;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Formula blocks */
.modal-body .formula-block,
.formula-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
  margin: 0.75rem 0;
  overflow-x: auto;
  white-space: pre;
}

/* Tables */
.domain-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 0.75rem 0;
}
.domain-table th {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.domain-table td {
  padding: 0.38rem 0.5rem;
  border-bottom: 1px solid rgba(35, 52, 72, 0.6);
  color: var(--muted);
  vertical-align: top;
}
.domain-table td:first-child { color: var(--text); }

/* ─── Static content pages ──────────────────────────────────────────────── */
.content-page {
  max-width: 760px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  line-height: 1.7;
}

.content-page h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.content-page .subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.content-page h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--accent);
}

.content-page h3 {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 1.25rem 0 0.4rem;
  color: var(--text);
}

.content-page p { margin-bottom: 0.75rem; color: var(--muted); }
.content-page p strong { color: var(--text); }

.content-page ul, .content-page ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  color: var(--muted);
}
.content-page li { margin-bottom: 0.3rem; }

/* ─── Loading spinner ───────────────────────────────────────────────────── */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-header { padding: 0.6rem 1rem; gap: 0.4rem; }
  main { padding: var(--gap) 1rem; }
  .site-logo { font-size: 0.95rem; }
  .site-nav { gap: 0.3rem; }
  .nav-btn { font-size: 0.75rem; padding: 0.28rem 0.5rem; }
  .live-badge { display: none; }
}

/* ─── Domain sparkline ──────────────────────────────────────────────────── */
.domain-spark {
  grid-column: 1 / -1;
  height: 40px;
  margin-top: 0.1rem;
}
.domain-spark svg polyline {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── Signal attribution ────────────────────────────────────────────────── */
.domain-attribution {
  grid-column: 1 / -1;
  font-size: 0.66rem;
  color: var(--muted);
  margin-top: -0.1rem;
  margin-bottom: 0.25rem;
  padding-left: 0.1rem;
}

/* ─── BVI description ───────────────────────────────────────────────────── */
.bvi-desc {
  font-size: 0.68rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.2rem;
}

/* ─── Hero Card ──────────────────────────────────────────────────────────── */
.hero-card { padding: 1.25rem; }

.hero-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.hero-metric { flex: 0 0 auto; }

.hero-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.hero-label::before { content: '// '; color: var(--accent); opacity: 0.6; }

.hero-number-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.hero-number {
  font-family: var(--mono);
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
}

.hero-denom {
  font-family: var(--mono);
  font-size: 1.25rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.hero-risk-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 5px;
}

.hero-stats {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-stats .stat-highlight { color: var(--text); font-weight: 600; }

/* Alert Level Band Bar */
.hero-alert { flex: 1; min-width: 260px; }

.alert-band-bar {
  display: flex;
  gap: 3px;
  margin-top: 0.4rem;
}

.alert-band {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 0.45rem 0.2rem;
  border-radius: 4px;
  border: 1px solid transparent;
  color: var(--muted);
  background: var(--surface-2);
  opacity: 0.4;
  transition: opacity 0.25s, background 0.25s, border-color 0.25s;
  cursor: default;
}

.alert-band.active {
  opacity: 1;
  color: #0b1017;
  border-color: transparent;
}

/* ─── Signals Grid ───────────────────────────────────────────────────────── */
.signals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.signal-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.signal-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.signal-icon {
  display: flex;
  align-items: center;
  color: var(--accent);
  flex-shrink: 0;
}

.signal-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.signal-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.signal-live-badge--live {
  color: var(--accent);
  border: 1px solid var(--accent);
  background: rgba(56, 189, 248, 0.1);
}

.signal-live-badge--stale {
  color: var(--muted);
  border: 1px solid var(--border);
  background: transparent;
}

.signal-live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: live-pulse 1.8s ease-in-out infinite;
}

.signal-live-badge--stale .signal-live-dot {
  animation: none;
}

.signal-desc {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
}

.signal-meta {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: auto;
}
