/* charts-fleet-strip.css — Cross-EA fleet snapshot strip.
 * Sits immediately below .charts-topbar and shows per-family aggregated
 * counts (instances · open · blocked) for every family present in the
 * rail's instance list. Token-driven; mirrors the explainer card's
 * data-fam color palette so users learn the family colors once. */

.charts-fleet-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-card);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-main);
  /* Subtle inner top highlight keeps the strip readable as a band. */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.cfs-strip-label {
  font: 10px/1 var(--font-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, var(--text-sub));
  margin-right: 2px;
  padding-right: 8px;
  border-right: 1px solid var(--border-card);
  align-self: stretch;
  display: inline-flex;
  align-items: center;
}

.cfs-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(127, 127, 127, 0.06);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  white-space: nowrap;
  line-height: 1.4;
}

.cfs-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-dim, #8e8e93);
}

.cfs-chip[data-fam="rb"]   .cfs-chip-dot { background: var(--purple, #bf5af2); }
.cfs-chip[data-fam="gl"]   .cfs-chip-dot { background: var(--yellow, #ffcc00); }
.cfs-chip[data-fam="gs"]   .cfs-chip-dot { background: var(--accent, #0a84ff); }
.cfs-chip[data-fam="nn"]   .cfs-chip-dot { background: var(--profit, #52ca74); }
.cfs-chip[data-fam="util"] .cfs-chip-dot { background: var(--text-dim, #8e8e93); }
.cfs-chip[data-fam="x"]    .cfs-chip-dot { background: var(--text-dim, #8e8e93); }

.cfs-chip-label {
  font-weight: 600;
  color: var(--text-main);
}

.cfs-chip-counts {
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
}

.cfs-chip-counts .cfs-sep {
  margin: 0 4px;
  opacity: 0.5;
}

.cfs-chip[data-blocked="1"] {
  border-color: color-mix(in srgb, var(--loss, #ff453a) 50%, var(--border-card));
}

.cfs-chip-blocked {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--loss, #ff453a) 18%, transparent);
  color: var(--loss, #ff453a);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 10px;
}

/* Tablet: collapse word labels, keep numeric counts visible. */
@media (max-width: 768px) {
  .charts-fleet-strip {
    padding: 5px 10px;
    gap: 6px;
  }
  .cfs-chip-label-words { display: none; }
  .cfs-chip-counts-words { display: none; }
  /* Lift tap target above iOS HIG comfortable floor without growing the strip. */
  .cfs-chip {
    min-height: 24px;
    padding: 4px 10px;
  }
}

/* Phone: strip too tight to be useful — hide entirely. */
@media (max-width: 480px) {
  .charts-fleet-strip { display: none !important; }
}

/* ─── Light-mode overrides ──────────────────────────────────────────────
 * Tokens auto-flip; only fixed-alpha decorations need explicit inversion. */
:root.light .charts-fleet-strip {
  /* Inset top highlight from white→dark; border-bottom slightly stronger
     so the band is still visible against the light glass shell. */
  box-shadow: inset 0 1px 0 rgba(15, 15, 30, 0.03);
  border-bottom-color: rgba(15, 15, 30, 0.10);
}
:root.light .cfs-chip {
  background: rgba(15, 15, 30, 0.035);
}

/* ════════════════════════════════════════════════════════════════════════
   Charts declutter 2026-06-02 — fleet snapshot relocated INTO the left rail
   (top of the instance list) instead of a full-width band over the chart.
   In the ~228px rail it becomes a compact single-column summary so it reads
   as a "fleet overview" header above the filter + instance list.
   ──────────────────────────────────────────────────────────────────────── */
.charts-shell .charts-rail-left .charts-fleet-strip {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 3px;
  padding: 6px 6px 7px;
  margin: 0 0 6px;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  background: var(--surface-2, var(--bg-card));
  font-size: 11px;
  box-shadow: none;
}
.charts-shell .charts-rail-left .charts-fleet-strip .cfs-strip-label {
  border-right: 0;
  padding: 0 2px 3px;
  margin: 0;
  align-self: flex-start;
}
.charts-shell .charts-rail-left .charts-fleet-strip .cfs-chip {
  width: 100%;
  justify-content: flex-start;
  gap: 6px;
  padding: 3px 7px;
  border-radius: 6px;
}
.charts-shell .charts-rail-left .charts-fleet-strip .cfs-chip-counts {
  margin-left: auto;
  white-space: nowrap;
}
