/* Environmental Quality Command Center — accent overrides (shared rules in hub-base.css) */
.eq-root {
  --hub-accent: var(--guide-color-action);
  /* Sub-domain accents (Phase 1) — anchored to --hub-accent, all AAA on --bg-1 */
  --eq-water: #0E9488;
  --eq-air:   #0891B2;
  --eq-eco:   #15803D;
}

/* ═══ Environmental Review Sub-Panel ═══════════════════════════════════════════ */

/* Launch card gradient */
.env-card--review .hydro-launch-preview { background: #7c2d12 !important; }

/* ─── Connected Permits Grid ──────────────────────────────────────────────── */
.permit-card {
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--bg-3, #F7F5F0);
  transition: background 0.15s;
}
.permit-card:hover { background: var(--bg-4, #EDEAE2); }
.permit-card-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary, #1A1A1F);
}
.permit-card-desc {
  font-size: var(--text-xxs);
  color: var(--text-secondary, #4A4A52);
  margin: 1px 0 3px;
}
.permit-card-meta {
  display: flex;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--text-tertiary, #6B6B73);
}
.permit-trigger { display: flex; align-items: center; gap: 3px; }
.permit-card-cite {
  font-size: var(--text-xs);
  color: var(--text-muted, #706F6D);
  margin-top: 2px;
}

/* Urgency badges */
.urgency-badge {
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.urgency-badge--expired { background: color-mix(in srgb, var(--guide-color-status-crit) 12%, transparent); color: var(--guide-color-status-crit); }
.urgency-badge--today   { background: color-mix(in srgb, var(--guide-color-status-crit) 15%, transparent); color: var(--guide-color-status-crit); }
.urgency-badge--soon    { background: color-mix(in srgb, var(--guide-color-ochre) 12%, transparent); color: #92400E; }
.urgency-badge--upcoming { background: color-mix(in srgb, var(--guide-color-lake) 12%, transparent); color: var(--guide-color-lake); }

/* ═══ Mobile Responsive — Environmental Quality Panels ═══════════════════ */
@media (max-width: 768px) {
  /* Env sub-panels full width */
  #env-water, #env-land, #env-air, #env-ecosystem, #env-review {
    padding: 0 4px;
  }


  /* Permit grid stack */
  .permit-card-meta { flex-wrap: wrap; }




  /* Radial gauges responsive */
  #wq-radial-gauges > div { flex-direction: column; align-items: center; }

  /* Dashboard grids */
  #env-dashboard-panel [style*="grid-template-columns:repeat(5"] { grid-template-columns: repeat(3, 1fr) !important; }
  #county-env-report-panel table { font-size: var(--text-xs); }
  #basin-impairment-panel [style*="grid-template-columns:100px"] { grid-template-columns: 80px 40px 50px 1fr !important; }
}

@media (max-width: 480px) {
  /* Extra small screens */
  #env-dashboard-panel [style*="grid-template-columns:repeat(5"] { grid-template-columns: repeat(2, 1fr) !important; }
  .permit-card-name { font-size: var(--text-xxs); }

}

/* ═══ Phase 1 — Regulatory Context Rail (right-rail) ═════════════════════ */
.eq-context-rail {
  width: auto;
  margin: var(--guide-sp-4) 0 0;
  padding: var(--guide-sp-3) var(--guide-sp-4);
  background: var(--guide-color-raised);
  border: 1px solid var(--guide-color-line);
  border-radius: var(--guide-radius-lg);
  font-size: var(--guide-fs-xs);
  color: var(--guide-color-ink);
}
/* Collapsed is the header row alone (the title stays: it is the control's label). */
.eq-context-rail.eq-rail--collapsed .eq-rail-body { display: none; }
.eq-context-rail.eq-rail--collapsed .eq-rail-head { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.eq-context-rail:not(.eq-rail--collapsed) .eq-rail-toggle i { transform: rotate(90deg); }
.eq-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
}
.eq-rail-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: var(--guide-fs-sm); }
.eq-rail-title i { width: 14px; height: 14px; }
.eq-rail-toggle { background: transparent; border: 0; cursor: pointer; padding: 2px; color: var(--text-tertiary, #6B6B73); }
.eq-rail-toggle i { width: 16px; height: 16px; transition: transform 0.2s; }
.eq-rail-section { margin-bottom: 14px; }
.eq-rail-section h4 { display: flex; align-items: center; gap: 6px; font-size: var(--guide-fs-2xs); font-weight: 700; text-transform: var(--guide-label-case, uppercase); letter-spacing: 0.05em; color: var(--text-secondary, #4A4A52); margin: 0 0 6px; }
.eq-rail-section h4 i { width: 12px; height: 12px; }
.eq-rail-tabs { display: flex; gap: 2px; margin-bottom: 6px; padding: 3px; background: var(--guide-color-paper-2); border: 1px solid var(--guide-color-line); border-radius: var(--guide-radius-md, 8px); }
.eq-rail-tab { flex: 1; font-size: var(--guide-fs-2xs); font-weight: 600; padding: 4px 6px; border-radius: var(--guide-radius-xs, 4px); border: 0; background: transparent; color: var(--guide-color-ink-soft); cursor: pointer; }
.eq-rail-tab.active { background: var(--guide-color-raised); box-shadow: var(--guide-shadow-rest); color: var(--guide-color-ink); }
.eq-rail-list { list-style: none; margin: 0; padding: 0; }
.eq-rail-item { padding: 6px 0; border-bottom: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06))); }
.eq-rail-item:last-child { border-bottom: none; }
.eq-rail-item-title { font-size: var(--guide-fs-2xs); font-weight: 600; color: var(--text-primary, #1A1A1F); display: block; }
a.eq-rail-item-title { color: var(--eq-water, #0E9488); text-decoration: none; }
a.eq-rail-item-title:hover { text-decoration: underline; }
.eq-rail-item-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; font-size: var(--guide-fs-2xs); color: var(--text-tertiary, #6B6B73); }
.eq-rail-cite { font-style: italic; }
.eq-rail-deadline { color: var(--guide-color-status-crit); font-weight: 600; }
.eq-rail-empty { font-size: var(--guide-fs-2xs); color: var(--text-tertiary, #6B6B73); padding: 6px 0; }
.eq-rail-hint { font-size: var(--guide-fs-2xs); color: var(--text-secondary, #4A4A52); line-height: 1.4; margin: 0 0 8px; }
.eq-rail-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; font-size: var(--guide-fs-2xs); font-weight: 600;
  /* The one action colour. It was --hub-accent's green fallback (var(--guide-color-moss)),
     white on it at 3.30:1, and a per-hub hue on a button (2026-11-13). */
  background: var(--guide-color-action); color: var(--guide-color-on-action);
  border: 0; border-radius: 4px; cursor: pointer;
  width: 100%; justify-content: center;
}
.eq-rail-cta:hover { background: var(--guide-color-action-hover); }
.eq-rail-cta i { width: 12px; height: 12px; }

/* ── Dark-theme overrides ── */
[data-theme="dark"] .urgency-badge--expired { background: color-mix(in srgb, var(--guide-color-status-crit) 20%, transparent); color: #F87171; }
[data-theme="dark"] .urgency-badge--today   { background: color-mix(in srgb, var(--guide-color-status-crit) 25%, transparent); color: #FCA5A5; }
[data-theme="dark"] .urgency-badge--soon    { background: color-mix(in srgb, var(--guide-color-ochre) 20%, transparent); color: #FBB72A; }
[data-theme="dark"] .urgency-badge--upcoming { background: rgba(59,130,246,0.18); color: #93C5FD; }
[data-theme="dark"] .eq-rail-deadline { color: #F87171; }
