/* Provider status legend — sticky bar across all Lattice dashboards.
   Calm green when everything is fresh, amber when a fetch failed but a
   cache is still serviceable, red when a provider has no data at all. */

.lps-bar {
  position: sticky;
  top: var(--lps-top, 0);
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px;
  font: 11px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #94a3b8;
  background: #11141a;
  border-bottom: 1px solid rgba(80, 96, 128, 0.18);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.lps-bar[data-state="degraded"] {
  background: linear-gradient(90deg, rgb(52, 37, 18), #11141a 60%);
  border-bottom-color: rgba(245, 158, 11, 0.35);
}
.lps-bar[data-state="error"] {
  background: linear-gradient(90deg, rgb(55, 19, 26), #11141a 60%);
  border-bottom-color: rgba(248, 113, 113, 0.45);
}
.lps-bar[data-state="empty"] { opacity: 0.6; }

.lps-toggle {
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 4px;
  border-radius: 4px;
  color: #64748b;
  transition: color 0.15s, background 0.15s;
}
.lps-toggle:hover { color: #cbd5e1; background: rgba(255,255,255,0.04); }
.lps-toggle .lps-caret { font-size: 9px; opacity: 0.7; }

.lps-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.lps-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #94a3b8;
  white-space: nowrap;
  cursor: help;
  transition: background 0.15s;
}
.lps-pill:hover { background: rgba(255, 255, 255, 0.07); }
.lps-pill .lps-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.lps-pill .lps-detail {
  color: #64748b;
  font-size: 10px;
}

.lps-pill[data-status="ok"] {
  color: #cbd5e1;
  background: rgba(52, 211, 153, 0.06);
  border-color: rgba(52, 211, 153, 0.22);
}
.lps-pill[data-status="ok"] .lps-dot {
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.65);
}
.lps-pill[data-status="ok"] .lps-detail { color: #6ee7b7; opacity: 0.9; }

.lps-pill[data-status="stale"] {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.07);
  border-color: rgba(251, 191, 36, 0.25);
}
.lps-pill[data-status="stale"] .lps-dot { animation: lps-pulse 1.7s ease-in-out infinite; }

.lps-pill[data-status="error"] {
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.32);
}
.lps-pill[data-status="error"] .lps-dot { animation: lps-pulse 1s ease-in-out infinite; box-shadow: 0 0 6px rgba(248,113,113,0.6); }

.lps-pill[data-status="off_hours"] {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.22);
}
.lps-pill[data-status="off_hours"] .lps-dot {
  background: #94a3b8;
  box-shadow: none;
}
.lps-pill[data-status="off_hours"] .lps-detail { color: #94a3b8; opacity: 0.85; }

.lps-pill[data-status="unknown"] { color: #64748b; opacity: 0.7; }

@keyframes lps-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.32; }
}

.lps-meta {
  padding-left: 12px;
  color: #64748b;
  font-size: 10px;
  white-space: nowrap;
}

/* SPY/QQQ/IWM eyebrow — injected by index-cards.js into this bar so we
   share a sticky row instead of stacking a second one. */
.lps-indices {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.lps-idx {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  white-space: nowrap;
  cursor: help;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s;
}
.lps-idx:hover { background: rgba(255, 255, 255, 0.07); }
.lps-idx-sym   { font-weight: 600; color: #cbd5e1; font-size: 10.5px; letter-spacing: 0.02em; }
.lps-idx-price { color: #cbd5e1; font-size: 11px; }
.lps-idx-pct   { font-size: 10.5px; }
.lps-idx-open  { font-size: 9.5px; opacity: 0.85; margin-left: -2px; }
.lps-idx-key   { color: #64748b; margin-right: 2px; font-size: 9px; letter-spacing: 0.04em; }
.lps-idx-pct.ic-up,  .lps-idx-open.ic-up   { color: #34d399; }
.lps-idx-pct.ic-down, .lps-idx-open.ic-down { color: #f87171; }
.lps-idx-pct.ic-flat, .lps-idx-open.ic-flat { color: #94a3b8; }

@media (max-width: 720px) {
  .lps-bar { padding: 6px 10px; gap: 6px; }
  .lps-meta { display: none; }
  .lps-pill .lps-detail { display: none; }
  .lps-idx-price { display: none; }
}
