/* risk-map.css — AIC Jurisdiction Risk Map
   Severity colour tokens from base.css. Zero dark-mode overrides needed —
   [data-theme="dark"] block in base.css already remaps all --crit / --mod / --ok tokens.

   ARCHITECTURE NOTE (C6 / FE-AUDIT-2026-06-11):
   This file is intentionally separate from components.css. Rationale:
   — Used only by dashboard.html and risk-map.html (feature-scoped, not global)
   — 130 lines of cohesive grid/cell/filter-bar rules — logically bounded
   — Separate file avoids bloating components.css with feature-specific layout
   — All values are CSS vars (no hardcoded hex) — no token-promotion debt
   If risk-map is retired, this file can be removed without touching components.css. */

/* ── Grid layout ────────────────────────────────────────────── */
.rm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}

/* ── Individual cell ────────────────────────────────────────── */
.jband {
  position: relative;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
  outline: none;
  user-select: none;
}
.jband:hover, .jband:focus-visible {
  background: var(--card-hover);
  border-color: var(--acc);
  transform: translateY(-1px);
  box-shadow: var(--elev-2, 0 2px 8px rgba(0,0,0,0.15));
}

/* Band left-edge accent bar */
.jband::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 6px 0 0 6px;
}
.jband[data-band="ELEVATED"]::before,
.jband[data-band="CRITICAL"]::before  { background: var(--crit); }
.jband[data-band="MODERATE"]::before  { background: var(--mod); }
.jband[data-band="LOW"]::before       { background: var(--ok); }
.jband[data-band="UNKNOWN"]::before   { background: var(--line); }

/* Band chip inside cell */
.jband__band {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 3px;
  margin-bottom: 6px;
  display: inline-block;
}
.jband[data-band="ELEVATED"] .jband__band,
.jband[data-band="CRITICAL"]  .jband__band {
  background: var(--crit-b); color: var(--red);
}
.jband[data-band="MODERATE"] .jband__band {
  background: var(--mod-b); color: var(--text-muted);
}
.jband[data-band="LOW"] .jband__band {
  background: var(--ok-b); color: var(--green);
}
.jband[data-band="UNKNOWN"] .jband__band {
  background: var(--line-subtle); color: var(--text-faint);
}

.jband__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}

.jband__meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Filter bar ─────────────────────────────────────────────── */
#rm-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-right: 12px;
}
.rm-band-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.rm-band-btn:hover { background: var(--card-hover); color: var(--text); }
.rm-band-btn--active {
  background: var(--acc); color: var(--bg); border-color: var(--acc);
}
[data-theme="dark"] .rm-band-btn--active { color: var(--bg); }

/* ── Mobile table fallback ──────────────────────────────────── */
/* Desktop: show grid, hide table */
.rm-table-wrap { display: none; }

/* Mobile (≤768px): hide grid, show table */
@media (max-width: 768px) {
  .rm-grid { display: none; }
  .rm-table-wrap { display: block; }
  /* Note: full responsive layer (sticky header, swipe, etc.) is owned by BRIEF-AIC-MOBILE */
}

/* ── Fade-in for cells ──────────────────────────────────────── */
.jband {
  animation: jband-in 0.15s ease both;
}
@keyframes jband-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .jband { animation: none; }
}
