/* RCRAData Dashboard — styles.css */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Fixed brand colour for the "Data" half of the wordmark — matches the website.
     NOT a theme token: no [data-theme] rule may override it. Unreadable on white
     (~1.7:1), so never use it on light letterheads, PDFs or emails. */
  --brand-lime: #B9D142;
  --navy:   #1a2744;
  --epa-blue:#1a3a5c;
  --blue:   #2563eb;
  --blue-lt:#eff6ff;
  --green:  #16a34a;
  --amber:  #d97706;
  --red:    #dc2626;
  --gray-50:#f8fafc;
  --gray-100:#f1f5f9;
  --gray-200:#e2e8f0;
  --gray-400:#94a3b8;
  --gray-600:#475569;
  --gray-900:#0f172a;
  --shadow:  0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --radius:  6px;
  /* Extended tokens — resolve undefined references in EM partials */
  --color-text-primary:         var(--epa-blue);
  --color-text-secondary:       var(--gray-600);
  --color-text-tertiary:        var(--gray-400);
  --color-background-primary:   #ffffff;
  --color-background-secondary: var(--gray-50);
  --color-border-secondary:     var(--gray-200);
  --color-border-tertiary:      var(--gray-100);
  --border-radius-lg:           8px;
  --gray-300:                   #cbd5e1;
  --gray-500:                   #64748b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.5;
}

/* ---- Nav ---- */
nav {
  background: var(--navy);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 1100;
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  flex: 1;
  margin-left: 32px;
}
/* Tighter spacing for the secondary right-side nav group (Quick Lookup,
   Portfolio, My Views, Admin, Audit, API, user/sign-out). #qhl-nav-btn keeps
   its inline margin-left:auto to push the group to the far right; each item
   after it cancels 22px of the .nav-links 32px gap → 10px between them. */
#qhl-nav-btn ~ * { margin-left: -22px; }
.nav-api-docs { margin-left: auto; }
.nav-dd-api-link {
  display: block;
  padding: 8px 20px;
  font-size: 13px;
  color: #1a3a5c !important;
  text-decoration: none;
  font-family: sans-serif;
  font-weight: 600;
}
.nav-dd-api-link:hover {
  background: rgb(195, 217, 239);
  color: #1a3a5c !important;
}
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
nav .brand {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  letter-spacing: .3px;
}
nav .brand span { color: #60a5fa; }
.brand,
.brand:hover,
.brand:focus,
.brand:active {
  opacity: 1 !important;
  background: none !important;
  filter: none !important;
  text-decoration: none !important;
  transition: none !important;
}
.brand img {
  opacity: 1 !important;
  filter: none !important;
  transition: none !important;
}
.brand img:hover {
  opacity: 1 !important;
  filter: none !important;
}
/* Brand lockup (2026-10-16): Ron's four-element artwork + live "RCRAData" text.
   The old LogoWhite.png had the wordmark baked in; the new artwork has none.
   Scoped above `nav .brand span` (blue accent) so the wordmark stays white. */
.brand .brand-mark { display: block; flex: none; }
nav .brand .brand-wordmark {
  color: #fff;
  font-family: 'Nunito Wordmark', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1;
  margin-left: 10px;
  white-space: nowrap;
}
/* Two-tone wordmark: "RCRA" white, "Data" brand lime (same on every theme). */
nav .brand .brand-wordmark .brand-wordmark-data,
.landing-hero-wordmark .brand-wordmark-data,
.auth-brand .brand-wordmark-data { color: var(--brand-lime); }
nav a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color .15s, background .15s, opacity .15s;
}
nav a:hover { color: #fff; opacity: 1; background: rgba(255,255,255,.1); }
nav a.active { color: #fff !important; opacity: 1; font-weight: 600; border-bottom: 2px solid rgba(255,255,255,0.7); }

/* ---- Nav dropdown ---- */
.nav-dropdown { position: relative; display: flex; align-items: center; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #dbe8f4;
  border-radius: 6px;
  min-width: 210px;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  z-index: 1200;
  padding: 4px 0;
  border: 1px solid rgba(26,58,92,.15);
}
.nav-dropdown-menu.open { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: 8px 20px;
  color: #1f2937 !important;
  font-size: 13px;
  text-decoration: none;
  border-radius: 0;
  background: none;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover { color: #1a3a5c !important; background: #c3d9ef; }
.nav-dropdown-menu a.dd-link-featured { color: var(--color-primary, #1e3a5f) !important; font-weight: 700; }
.nav-dropdown-menu a.dd-link-featured:hover { background: var(--color-bg-subtle, #eff6ff); }
.nav-dropdown > a.dd-open { color: #fff; }
.nav-dropdown-menu .dd-section-label {
  display: block;
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #4b6a8a;
  cursor: default;
}
.nav-dropdown-menu .dd-section-label:first-child { padding-top: 6px; }
.nav-dropdown-menu .dd-divider {
  border: none;
  border-top: 1px solid rgba(26,58,92,.2);
  margin: 4px 0;
}
.nav-dropdown-menu .dd-placeholder {
  display: block;
  padding: 8px 20px;
  font-size: 12px;
  color: #475569;
  font-style: italic;
  cursor: default;
}

/* ---- Layout ---- */
.page { max-width: 1200px; margin: 0 auto; padding: 28px 24px; }
h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: var(--gray-600); }
.subtitle { color: var(--gray-600); margin-bottom: 24px; font-size: 13px; }

/* ---- Stat cards ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--blue);
}
.stat-card.green  { border-color: var(--green); }
.stat-card.amber  { border-color: var(--amber); }
.stat-card.navy   { border-color: var(--navy); }
.stat-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-400); margin-bottom: 6px; }
.stat-card .label.preserve-case { text-transform: none; letter-spacing: .2px; font-size: 12px; font-weight: 600; }
.stat-card .value { font-size: 26px; font-weight: 700; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-card .sub   { font-size: 12px; color: var(--gray-400); margin-top: 2px; }

/* ---- Cards ---- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.card-title {
  /* 12 px matches the per-tab inline overrides every EM (and most BR)
     partial was setting. The platform's actual stat-card label size
     is 12 px — making it the default lets us drop those overrides. */
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- "Top N of M" display-cap disclosure chip (macros/cap_note.html) ----
   The ONE shared caption style for a capped table's true total. Amber
   disclosure token (#92400e on #fef3c7) — noticeable at a glance, NOT the
   muted slate-400/500 one-off captions it replaces, and NOT alarming red. */
.cap-note {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 1px 9px;
  white-space: nowrap;
  vertical-align: middle;
}

/* ---- Forms ---- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 12px;
  background: #fff;
  border-radius: var(--radius);
  padding: 8px 12px;
  box-shadow: var(--shadow);
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--gray-600); font-weight: 600; }
.field input, .field select {
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  height: 30px;
  background: #fff;
  color: var(--gray-900);
  outline: none;
  transition: border-color .15s;
  min-width: 130px;
}
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.field input[type="checkbox"] { height: auto; width: 16px; min-width: unset; margin-top: 6px; cursor: pointer; }
.filter-group-label {
  width: 100%; margin-top: 2px; margin-bottom: 0;
  font-size: 11px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: #6b7280;
  border-bottom: 1px solid var(--gray-200); padding-bottom: 2px;
  display: flex; align-items: center;
}

/* Status pill toggle buttons */
.status-pill {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 20px;
  border: 1px solid var(--gray-300); background: var(--gray-50);
  font-size: 12px; font-weight: 500; color: var(--gray-600);
  cursor: pointer; user-select: none;
  transition: border-color .15s, background .15s, color .15s;
}
.status-pill input[type="radio"] { position:absolute; opacity:0; width:0; height:0; }
.status-pill:has(input:checked) { border-color:#1a3a5c; background:#dbe8f4; color:#1a3a5c; font-weight:600; }
.status-pill-active:has(input:checked)   { border-color:#065f46; background:#d1fae5; color:#065f46; }
.status-pill-inactive:has(input:checked) { border-color:#991b1b; background:#fee2e2; color:#991b1b; }

/* Field hint (partial match / format note under inputs) */
.field-hint { font-size:11px; color:#6b7280; margin-top:3px; display:flex; align-items:center; gap:3px; }
.field-hint::before { content:"ⓘ"; font-size:10px; }

/* Filter panel footer row */
.filter-footer {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--gray-200);
}
.clear-filters-link { font-size:12px; color:var(--gray-400); text-decoration:none; }
.clear-filters-link:hover { color:var(--gray-600); text-decoration:underline; }

/* Color-coded search section header variants */
.fgl-core     { background:#eff6ff; border-left:3px solid #1a3a5c; border-bottom:none; padding:4px 8px; border-radius:0 4px 4px 0; color:#1a3a5c; margin-bottom:2px; }
.fgl-location { background:#f0fdf4; border-left:3px solid #065f46; border-bottom:none; padding:4px 8px; border-radius:0 4px 4px 0; color:#065f46; margin-bottom:2px; }
.fgl-role     { background:#f5f3ff; border-left:3px solid #5b21b6; border-bottom:none; padding:4px 8px; border-radius:0 4px 4px 0; color:#5b21b6; margin-bottom:2px; }
.fgl-activity { background:#fffbeb; border-left:3px solid #92400e; border-bottom:none; padding:4px 8px; border-radius:0 4px 4px 0; color:#92400e; margin-bottom:2px; }
.fgl-status   { background:#f8fafc; border-left:3px solid #475569; border-bottom:none; padding:4px 8px; border-radius:0 4px 4px 0; color:#475569; margin-bottom:2px; }
.fgl-mmc      { background:#f0fdfa; border-left:3px solid #0f766e; border-bottom:none; padding:4px 8px; border-radius:0 4px 4px 0; color:#0f766e; margin-bottom:2px; }
.fgl-data     { background:#f5f3ff; border-left:3px solid #4f46e5; border-bottom:none; padding:4px 8px; border-radius:0 4px 4px 0; color:#3730a3; margin-bottom:2px; }

/* Search text input with brand-blue focus ring */
.search-input { height:30px; border:1px solid #d1d5db; border-radius:6px; padding:0 10px; font-size:13px; background:#fff; transition:border-color .15s,box-shadow .15s; }
.search-input:focus { outline:none; border-color:#1a3a5c; box-shadow:0 0 0 3px rgba(26,58,92,.1); }

/* ── Typeahead inline dropdown (Facility Name, EPA ID, Owner, NAICS) ── */
.ta-dropdown {
  position:absolute; left:0; top:100%;
  background:#fff; border:1px solid #d1d5db; border-radius:6px;
  box-shadow:0 6px 20px rgba(0,0,0,.10);
  z-index:1000; max-height:280px; overflow-y:auto; overflow-x:hidden;
  margin-top:2px; font-size:12px;
  /* min-width matches input; max-width grows for long names but capped */
  min-width:100%; width:max-content; max-width:520px;
}
.ta-row {
  padding:6px 10px; cursor:pointer; border-bottom:1px solid #f1f5f9;
  transition:background-color .1s;
  display:flex; align-items:center; gap:10px;
  white-space:nowrap; overflow:hidden;
}
.ta-row:last-child { border-bottom:none; }
.ta-row:hover, .ta-row.ta-row-sel { background:#eff6ff; }
.ta-row-name {
  font-weight:600; color:#111827; line-height:1.3;
  flex:1; min-width:0;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.ta-row-meta {
  font-size:11px; color:#6b7280; font-family:monospace;
  flex-shrink:0;
  white-space:nowrap;
}
.ta-alt {
  display:inline-block; margin-left:6px; padding:1px 5px;
  background:#f5f3ff; color:#7c3aed;
  border-radius:3px; font-size:10px; font-weight:600;
}
.ta-empty { padding:10px 12px; color:#9ca3af; font-style:italic; text-align:center; }
/* Green border flash when typeahead populates linked fields */
.ta-flash {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16,185,129,.18) !important;
  transition: border-color .2s ease-out, box-shadow .2s ease-out;
}
/* Inline alias-match note shown below the Name+ID row */
.ta-alias-note {
  font-size:11px; color:#6b21a8; background:#f5f3ff;
  border:1px solid #ddd6fe; border-radius:4px;
  padding:3px 9px; margin-top:4px;
  display:inline-flex; align-items:center; gap:4px;
}

/* Role filter checkbox labels — highlight whole label when checked */
.role-checkbox-label { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:6px; cursor:pointer; border:1px solid transparent; font-size:13px; font-weight:500; color:var(--gray-600); transition:all .15s; }
.role-checkbox-label:has(input:checked) { background:#f0f4f8; border-color:#1a3a5c; }

/* Activity & Compliance pill toggles — also base for Role, Generator Status, Facility Status */
.activity-pill { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:12px; font-size:12px; font-weight:500; cursor:pointer; border:1px solid #d1d5db; background:#f9fafb; color:#374151; transition:all .15s; user-select:none; }
.activity-pill input[type="checkbox"],
.activity-pill input[type="radio"] { position:absolute; opacity:0; width:0; height:0; }
.activity-pill:has(input:checked) { background:#fffbeb; border-color:#92400e; color:#92400e; font-weight:600; }
/* Role pill — neutral slate highlight when checked (the role icon inside
   the pill carries the role color; the pill itself stays neutral so the
   five role colors aren't drowned out by a sixth tint). */
.activity-pill.role-pill:has(input:checked) { background:#f1f5f9; border-color:#475569; color:#0f172a; font-weight:600; }
.activity-pill.mmc-pill:has(input:checked)  { background:#1a3a5c; border-color:#1a3a5c; color:#fff;    font-weight:600; }
/* Facility Status variants — higher specificity overrides amber default */
.activity-pill.status-pill-all:has(input:checked)      { background:#dbe8f4; border-color:#1a3a5c; color:#1a3a5c; font-weight:600; }
.activity-pill.status-pill-active:has(input:checked)   { background:#d1fae5; border-color:#065f46; color:#065f46; font-weight:600; }
.activity-pill.status-pill-inactive:has(input:checked) { background:#fee2e2; border-color:#991b1b; color:#991b1b; font-weight:600; }
/* Data Availability pill — indigo highlight */
.activity-pill.data-pill:has(input:checked) { background:#ede9fe; border-color:#4f46e5; color:#3730a3; font-weight:600; }

/* Section divider between search filter groups */
.search-section-divider { height:1px; width:100%; background:linear-gradient(to right,#e5e7eb,transparent); margin:1px 0; }
.col-selector-wrap {
  width: 100%; margin-top: 8px; margin-bottom: 0;
  background: var(--gray-100); border: 1px solid var(--gray-200);
  border-radius: 6px; padding: 8px 10px 6px;
}
.col-selector-label {
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gray-500);
  margin-bottom: 6px;
}
.col-selector-row {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.col-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 6px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  background: #fff;
  font-size: 12px; font-weight: 500; color: var(--gray-500);
  cursor: pointer; user-select: none;
  transition: background .1s, border-color .1s, color .1s;
}
.col-toggle input[type="checkbox"] {
  width: 13px; height: 13px; min-width: unset;
  margin: 0; cursor: pointer; accent-color: var(--blue);
}
.col-toggle.active {
  background: #eff6ff; border-color: #93c5fd; color: #1e40af;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  height: 34px;
  text-decoration: none;
  transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn-primary   { background: var(--blue); color: #fff; }
.btn-secondary { background: var(--gray-100); color: var(--gray-900); border: 1px solid var(--gray-200); }
.btn-danger    { background: var(--red); color: #fff; }
.btn-success   { background: var(--green); color: #fff; }
.btn-sm { height: 28px; padding: 4px 10px; font-size: 12px; }

/* Apply-button polish — used on every BR filter form's submit button.
   Sky-blue pill matching the EM Nearby Search button silhouette but
   in a distinct hue so BR / EM controls read as separate modules at
   a glance. Hover darkens for tactile feedback. Note: leaves no
   leading glyph; the "Apply" label is enough now that the pill shape
   reads unambiguously as an action button. */
.btn-apply {
  background: #0284c7;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 4px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.btn-apply:hover { background: #0369a1; opacity: 1; }

/* Reset-years link — paired with .btn-apply on BR sub-tab filter
   bars. Styled as a muted link (not a button) so it never competes
   visually with Apply. ↺ glyph cues the rewind action. */
.btn-reset-years {
  font-size: 12px;
  color: #6b7280;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px dashed #9ca3af;
  padding: 0 1px;
  transition: color .15s, border-color .15s;
}
.btn-reset-years::before {
  content: "↺";
  margin-right: 3px;
  font-size: 13px;
  opacity: .8;
}
.btn-reset-years:hover {
  color: #374151;
  border-bottom-color: #6b7280;
}

/* ============================================================
 * BR Data Quality — confidence meter, grade card, magbox boxes
 * ============================================================ */

/* Letter-grade card at the top of BR DQ. Letter fills 60px square
   on the left; explanation runs alongside. Border + bg are set
   inline per-grade so the grade colors come straight from the
   handler dict and stay in sync with the F/D/C/B/A palette. */
.dq-grade-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  margin-bottom: 1.25rem;
  border: 1px solid;
  border-left-width: 5px;
  border-radius: 6px;
}
.dq-grade-letter {
  font-size: 60px;
  font-weight: 800;
  line-height: 1;
  min-width: 60px;
  text-align: center;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
}
.dq-grade-body { flex: 1; }
.dq-grade-label {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dq-grade-explain {
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}

/* Confidence meter — replaces the plain HTML range. The bar is a
   green→amber→red gradient sitting underneath an invisible range
   input so the native thumb still handles drag. A thumb label
   floats above the track and snaps to the slider value. */
.dq-meter-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 1.25rem;
}
.dq-meter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.dq-meter-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dq-meter-live {
  font-size: 12px;
  color: #6b7280;
}
.dq-meter-live strong {
  color: #1a3a5c;
  font-size: 15px;
  font-weight: 700;
  margin-right: 2px;
}

.dq-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.dq-preset {
  flex: 1;
  min-width: 130px;
  background: #f3f4f6;
  border: 1px solid var(--gray-200);
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .15s, border-color .15s, color .15s;
}
.dq-preset span {
  font-weight: 400;
  font-size: 11px;
  color: #9ca3af;
  margin-left: 8px;
}
.dq-preset:hover { background: #e5e7eb; }
.dq-preset.active {
  background: #1a3a5c;
  color: #fff;
  border-color: #1a3a5c;
}
.dq-preset.active span { color: rgba(255,255,255,0.75); }

.dq-meter-bar-wrap {
  position: relative;
  height: 36px;
  margin: 0 0 4px;
}
.dq-meter-bar {
  position: absolute;
  left: 0; right: 0; top: 14px;
  height: 8px;
  border-radius: 4px;
  /* Red (aggressive, k=3) → amber (recommended, k=20) → green
     (conservative, k=100). Inverted because more flags is less
     calm — the green end is where the user has a clean facility. */
  background: linear-gradient(to right, #c0392b 0%, #c0392b 8%, #EF9F27 18%, #16a34a 50%, #16a34a 100%);
}
.dq-meter-slider {
  position: absolute;
  left: 0; right: 0; top: 8px;
  width: 100%;
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.dq-meter-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #1a3a5c;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.dq-meter-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #1a3a5c;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.dq-meter-thumb-label {
  position: absolute;
  top: -2px;
  font-size: 11px;
  font-weight: 700;
  color: #1a3a5c;
  background: #fff;
  border: 1px solid #1a3a5c;
  padding: 1px 6px;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
  transition: left .08s ease-out;
}
.dq-meter-thumb-label.dq-recommended {
  background: #EAF3DE;
  color: #27500A;
  border-color: #27500A;
}
/* Solid indicator dot pinned to the gradient bar — JS sets `left`
   on every slider drag tick. Color shifts with position
   (red→amber→green→teal) via dotColorForK(), so users on clean
   facilities still see motion + a color change as they explore. */
.dq-meter-indicator-dot {
  position: absolute;
  top: 11px;
  left: calc(17.5% - 7px);   /* ~k=20 default; JS overrides on init */
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #16a34a;
  border: 2px solid #16a34a;
  box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0,0,0,0.35);
  pointer-events: none;
  transition: left .08s ease-out, background .15s, border-color .15s;
  z-index: 1;
}
.dq-meter-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #9ca3af;
  margin-top: 6px;
}

/* Live breakdown summary — appears under the preset chips. Single
   row of "High: N · Medium: N · Low: N" with colored dots cuing
   each level. Counts update via JS on every slider drag. */
.dq-meter-breakdown {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #6b7280;
  margin: 8px 0 12px;
  padding: 4px 0;
}
.dq-bd-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dq-bd-item strong {
  color: #1f2937;
  font-weight: 700;
  font-size: 13px;
}
.dq-bd-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 1px;
}
.dq-bd-high   .dq-bd-dot { background: #c0392b; }
.dq-bd-medium .dq-bd-dot { background: #EF9F27; }
.dq-bd-low    .dq-bd-dot { background: #9ca3af; }
.dq-bd-sep { color: #d1d5db; }

/* Inline mini-bar chart — three rows of label + horizontal bar +
   count. Bar fills animate width via CSS transition as JS sets
   `style.width = "N%"` on each slider tick. Always above the fold
   so users see flag-count motion without scrolling. */
.dq-meter-minibars {
  margin-top: 4px;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 6px;
}
.dq-mb-row {
  display: grid;
  grid-template-columns: 60px 1fr 36px 50px;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.dq-mb-row:last-child { margin-bottom: 0; }
.dq-mb-label {
  font-size: 11px;
  font-weight: 600;
  color: #4b5563;
  text-align: right;
}
.dq-mb-track {
  height: 12px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.dq-mb-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .15s ease-out;
  min-width: 0;
}
.dq-mb-num {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.dq-mb-of {
  font-size: 10px;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}

/* Clean-data note shown below the meter when no IQR outliers exist
   at any sensitivity AND no magnitude/duplicate/blank flags exist —
   so the user understands why dragging the slider has no visible
   effect on count cards or detail rows. */
.dq-meter-cleanote {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 3px solid #16a34a;
  border-radius: 4px;
  color: #166534;
  font-size: 12px;
  line-height: 1.45;
}

/* Bold live count below the slider — replaces the prior H/M/L
   mini-bar chart and breakdown text. Color flips red when anything
   is flagged, green when zero, so the "is anything wrong?" question
   reads at a glance. JS (applyKToCounts) keeps it in sync. */
.dq-bigcount {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  transition: background .2s, color .2s;
}
.dq-bigcount-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
  align-self: center;
  transition: background .2s, box-shadow .2s;
}
.dq-bigcount strong {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.dq-bigcount-label {
  font-size: 13px;
  font-weight: 600;
}
.dq-bigcount[data-flagged="true"] {
  background: #fef2f2;
  color: #991b1b;
}
.dq-bigcount[data-flagged="true"] .dq-bigcount-dot {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.2);
}
.dq-bigcount[data-flagged="false"] {
  background: #f0fdf4;
  color: #166534;
}
.dq-bigcount[data-flagged="false"] .dq-bigcount-dot {
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,0.2);
}

/* Caption above the scatter chart title — one short paragraph in
   subdued italic so users reading the page top-to-bottom hit the
   "what am I looking at" answer before the title. */
.dq-scatter-caption {
  font-size: 12.5px;
  color: #6b7280;
  font-style: italic;
  line-height: 1.5;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--gray-200);
}

/* "Toggle Nearby (25 mi)" button — pinned top-right of every map
   so it never collides with Leaflet's bottom-left basemap toggle
   or our bottom-right compliance legend. Active state flips to
   the navy palette so users can see the layer is on at a glance.
   Each toggle JS function adds .active to the button on layer-on
   and removes it on layer-off; the .map-nearby-legend overlay
   below appears in concert. */
.map-nearby-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1000;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.95);
  color: #1a3a5c;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background .12s, color .12s, border-color .12s, box-shadow .12s;
}
.map-nearby-toggle:hover {
  background: #f8fafc;
  border-color: #1a3a5c;
}
.map-nearby-toggle.active {
  background: #1a3a5c;
  color: #fff;
  border-color: #0f1f33;
  box-shadow: 0 1px 4px rgba(26, 58, 92, 0.4);
}
.map-nearby-toggle.active:hover {
  background: #0f1f33;
}

/* Generator-status legend that appears when a Toggle Nearby layer
   is on. Sits directly under the toggle button; same top-right
   anchor so users see exactly what each color means without
   scrolling. JS shows/hides via display:none/flex. */
.map-nearby-legend {
  position: absolute;
  top: 40px;
  right: 8px;
  z-index: 1000;
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 5px 9px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  color: #4b5563;
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: calc(100% - 16px);
}
.map-nearby-legend.active { display: inline-flex; }
.map-nearby-legend .gs-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
}
.map-nearby-legend .gs-lqg  { background: #dc2626; }
.map-nearby-legend .gs-sqg  { background: #d97706; }
.map-nearby-legend .gs-vsqg { background: #16a34a; }
.map-nearby-legend .gs-other { background: #94a3b8; }

/* Search-within-table filter input. Sits directly above a
   data-table; typing in real-time hides non-matching rows via
   table_filter.js. Counter span on the right shows "X of Y
   matching" when a query is active. */
.dq-table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 6px;
  padding: 0 4px;
}
.dq-table-search-input {
  flex: 0 1 320px;
  font-size: 12px;
  padding: 5px 10px 5px 28px;
  border: 1px solid var(--gray-200);
  border-radius: 5px;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
  background-repeat: no-repeat;
  background-position: 8px center;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.dq-table-search-input:focus {
  border-color: #1a3a5c;
  box-shadow: 0 0 0 3px rgba(26,58,92,0.12);
}
.dq-table-search-count {
  font-size: 11px;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

/* ================================================================
 * Reported-vs-Estimated dumbbell chart
 *
 * Each row is one flagged outlier. The track spans the chart width;
 * a colored "reported" dot and a green "estimated" dot sit at log-
 * scale positions computed server-side. The IQR band marks the
 * facility's typical range so the user can read "this is where the
 * value should fall."
 *
 * The slider toggles `data-active` on each row; CSS handles the
 * collapse animation (height + opacity + translate).
 * ================================================================ */

/* Title block above the chart card body — heading + subtitle. */
.dq-chart-header { margin-bottom: 12px; }
.dq-chart-h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1a3a5c;
  margin: 0 0 4px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.dq-chart-h3-meta {
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
  font-style: italic;
}
.dq-chart-subtitle {
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}

/* Dumbbell chart layout */
.dq-db-titlerow {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  margin: 12px 0 6px;
}
.dq-db-titlemeta {
  font-size: 11px;
  color: #6b7280;
}
.dq-db-titlemeta strong { color: #1f2937; font-weight: 700; }

/* X-axis decade marks — sit above the rows. Each mark is positioned
   absolutely along a horizontal track. */
.dq-db-axis {
  position: relative;
  height: 18px;
  margin: 4px 0 6px;
  border-bottom: 1px dashed var(--gray-200);
}
.dq-db-axis-mark {
  position: absolute;
  top: 0;
  font-size: 10px;
  color: #9ca3af;
  transform: translateX(-50%);
  white-space: nowrap;
}
.dq-db-axis-mark sup { font-size: 8px; }

/* List of dumbbell rows */
.dq-db-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dq-db-row {
  padding: 8px 4px;
  border-bottom: 1px solid #f3f4f6;
  transition: opacity .25s ease, transform .25s ease,
              max-height .3s ease, padding .3s ease, margin .3s ease;
  opacity: 1;
  max-height: 200px;
  overflow: hidden;
}
.dq-db-row[data-active="0"] {
  opacity: 0;
  transform: translateX(40px);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-bottom-width: 0;
  pointer-events: none;
}

.dq-db-rowhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}
.dq-db-rowtag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dq-db-rowtag strong { font-size: 13px; color: #1f2937; }
.dq-db-conf-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dq-db-conf-high   { background: #fee2e2; color: #991b1b; }
.dq-db-conf-medium { background: #fef3c7; color: #92400e; }
.dq-db-conf-low    { background: #f3f4f6; color: #374151; }
.dq-db-likely {
  font-size: 11px;
  color: #6b7280;
  font-style: italic;
  text-align: right;
  flex: 1 1 auto;
  min-width: 200px;
}

/* The track itself — relative-positioned rail; dots and ticks are
   absolute children. Height is generous enough for the 14px dots
   plus the IQR band underneath. */
.dq-db-track {
  position: relative;
  height: 28px;
  margin: 6px 0;
}
.dq-db-iqr-band {
  position: absolute;
  top: 11px;
  height: 6px;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 3px;
  min-width: 2px;
}
.dq-db-tick {
  position: absolute;
  top: 6px;
  width: 2px;
  height: 16px;
}
.dq-db-tick-median {
  background: #4b5563;
  transform: translateX(-1px);
}
.dq-db-line {
  position: absolute;
  top: 13px;
  height: 2px;
  background: repeating-linear-gradient(
    to right,
    #9ca3af 0 4px,
    transparent 4px 8px
  );
  min-width: 1px;
}
.dq-db-dot {
  position: absolute;
  top: 7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  transform: translateX(-7px);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
  cursor: help;
}
.dq-db-dot-est { background: #16a34a; box-shadow: 0 0 0 1px #166534; }
.dq-db-dot-rep { background: #dc2626; }
.dq-db-dot-high   { background: #dc2626; box-shadow: 0 0 0 1px #7f1d1d; }
.dq-db-dot-medium { background: #ea580c; box-shadow: 0 0 0 1px #7c2d12; }
.dq-db-dot-low    { background: #fbbf24; box-shadow: 0 0 0 1px #78350f; }

.dq-db-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}
.dq-db-meta strong { color: #1f2937; font-weight: 700; }
.dq-db-rep-val { color: #dc2626 !important; }
.dq-db-est-val { color: #16a34a !important; }
.dq-db-est-note { font-weight: 400; color: #9ca3af; font-size: 10.5px; }
.dq-db-mediannote { color: #9ca3af; font-style: italic; }
.dq-db-sep { color: #d1d5db; }
.dq-db-factor { padding: 1px 6px; border-radius: 8px; font-size: 11px; }
.dq-db-factor.sev-mild    { background: #fef3c7; color: #92400e; }
.dq-db-factor.sev-severe  { background: #fee2e2; color: #991b1b; }
.dq-db-factor.sev-extreme { background: #7f1d1d; color: #fff; }

/* "All clear at current k" panel inside the dumbbell view — shown
   by JS when no rows are active at the chosen sensitivity. */
.dq-db-empty-msg {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 12px 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #16a34a;
  border-radius: 6px;
  font-size: 13px;
  color: #166534;
  line-height: 1.45;
}
.dq-db-empty-check { font-size: 22px; color: #16a34a; }

/* Top-of-card "all values within range" banner for facilities
   with zero baseline outliers (PAD case). */
.dq-clean-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 14px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #16a34a;
  border-radius: 6px;
  font-size: 13px;
  color: #166534;
  line-height: 1.45;
}
.dq-clean-check { font-size: 22px; color: #16a34a; }

/* Dumbbell-mode legend swatches */
.dq-ocl-est { background: #16a34a; }
.dq-ocl-rep { background: #dc2626; }
.dq-ocl-iqrband {
  display: inline-block;
  width: 18px; height: 6px;
  background: rgba(34, 197, 94, 0.25);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 2px;
  vertical-align: middle;
}

/* Sensitivity Scatter chart card — title meta line, in-chart
   legend overlay (top-left of the canvas), log-scale annotation,
   and footer scale labels (relocated from above the slider). */
.dq-scatter-title-meta {
  font-size: 11px;
  font-weight: 400;
  color: #6b7280;
}
.dq-scatter-title-meta strong { color: #1f2937; font-weight: 700; }

/* DQ scatter / dumbbell legend — rendered BELOW the chart in normal
   document flow. Previously absolute-positioned over the canvas; that
   crowded the plot area on small heights and rendered unpredictably
   when the same class was reused on the dumbbell card (whose nearest
   positioned ancestor wasn't the canvas wrapper). Static flex row
   centered below the chart is immune to all of that. */
.dq-scatter-onchart-legend {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: #374151;
}
.dq-scatter-onchart-legend > div {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dq-ocl-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
}
.dq-ocl-gray  { background: rgba(156,163,175,0.55); }
.dq-ocl-color {
  background: linear-gradient(135deg, #fbbf24 0 33%, #ea580c 33% 66%, #dc2626 66% 100%);
}

/* Log-scale annotation directly under the canvas. */
.dq-scatter-lognote {
  margin: 8px 0 0;
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
}

/* Sensitivity-scale labels relocated from above the slider to here
   so the slider can sit visually closer to the chart it controls.
   Subtle, with directional arrows pointing back up to the slider. */
.dq-scatter-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--gray-200);
  font-size: 11px;
  color: #9ca3af;
}
.dq-scatter-footer-l { text-align: left; }
.dq-scatter-footer-r { text-align: right; }

/* Magnitude / mass-balance / duplicate / blank-description boxes.
   Each lives inside the Magnitude & Integrity Checks card and is
   color-keyed by severity via inline border-left. */
.dq-magbox {
  background: #fff;
  border-radius: 4px;
  padding: 10px 12px;
  margin-top: 12px;
  border: 1px solid var(--gray-200);
}
.dq-magbox-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #1f2937;
}
.dq-magbox-icon {
  font-size: 18px;
  line-height: 1;
}
.dq-magbox-count {
  color: #6b7280;
  font-size: 12px;
  font-weight: 400;
}

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }

/* Grid/flex items default to `min-width: auto`, which means a track can NEVER shrink
   below its content's min-content width. So a single wide child (a data table, a long
   unbreakable code) silently drags the whole grid past its container — the container
   doesn't clip it, it just gets pushed. Measured live on the facility eManifest → PCB
   sub-tab: a `1fr 2fr` grid blew out to 1212px inside a 1152px column at EVERY viewport
   (1024/1280/1440), because the 8-column PCB table forced its track to 1005px instead
   of the 759px 2fr should give. `min-width: 0` restores the ability to shrink, so the
   table scrolls inside its own .table-wrap instead of shoving the layout.
   Apply to any grid whose cells can contain a table or other wide content. */
.grid-fit > * { min-width: 0; }
/* Numeric-cell utilities — extracted from per-cell inline styles in
   the EM Summary results partial. The partial has ~2,000 quantity
   cells per page; collapsing the inline `text-align:right;
   font-variant-numeric:tabular-nums` (50 bytes × 2k = ~100 KB) and
   the empty-cell `color:var(--gray-300)` (32 bytes × 1.5k = ~30 KB)
   into single classes drops the partial from ~492 KB → ~360 KB on
   a typical 50-row, 2019–2026 quarterly+yearly query. */
.ems-qty   { text-align: right; font-variant-numeric: tabular-nums; }
.ems-empty { color: var(--gray-300); }
/* Receiver / Generator name cells: long facility names wrap inside a
   bounded width instead of stretching the table. Repeated on every
   row of EM Summary results — class extraction saves ~85 chars × 50
   rows = ~4 KB per response. */
.ems-name-cell { max-width: 260px; min-width: 160px; white-space: normal; word-break: break-word; line-height: 1.3; }

/* ── Reusable frozen-left-column pattern (2026-07-20) ──────────────────────────
   The app's FIRST sticky-column mechanism. For any wide table inside a
   .table-wrap { overflow-x:auto } scroll box: apply `.stick-col` (+ a position
   class) to BOTH the <th> and the <td> of each column that should stay pinned on
   the left while the remaining columns scroll horizontally. Position classes set
   the `left` offset: `.stick-1` = leftmost (left:0), `.stick-2` = second
   (left = the first column's width, via --stick-1w). Add `.stick-last` to the
   rightmost frozen column for the drop-shadow divider.
   RULES this pattern enforces:
   - Sticky cells MUST carry a solid background — a transparent sticky cell lets the
     scrolling content show through underneath. Provided here: white body cells,
     gray-50 header cells (matching the normal <th> bg).
   - z-index layers the frozen header corner (3) above frozen body cells (2) above
     the normal scrolling cells (auto). This also makes the pattern forward-compatible
     with a VERTICAL sticky header: a table that adds `thead th { position:sticky; top:0 }`
     gets a correct frozen corner for free (the thead .stick-col already wins on z-index).
   - The per-column `left` offsets require each frozen column to have a FIXED width
     (a fully generic auto-measured version would need JS to read rendered widths and
     is not worth it for 2-column freezes). Set the widths + --stick-1w per table.
   First adopted by BR+EM Search's Facility Reconciliation table (.brem-recon); other
   wide tables (e.g. EM National Receivers Report) can adopt the same three classes. */
.table-wrap .stick-col { position: sticky; z-index: 2; background: #fff; }
.table-wrap thead .stick-col { z-index: 3; background: var(--gray-50); }
.table-wrap .stick-1 { left: 0; }
.table-wrap .stick-2 { left: var(--stick-1w, 130px); }
.table-wrap .stick-last { box-shadow: 5px 0 6px -4px rgba(15, 23, 42, .18); }

/* BR+EM Facility Reconciliation — table-specific frozen-column widths + the flagged
   row highlight moved off the inline <tr> style so the frozen cells inherit it too.
   border-collapse:separate avoids the Chrome bug where scrolling content paints over a
   sticky cell's edge under border-collapse:collapse; visually identical here because
   the cells only use a bottom border (no merged left/right borders to lose). */
.brem-recon { --stick-1w: 120px; border-collapse: separate; border-spacing: 0; }
.brem-recon .stick-1 { min-width: 120px; max-width: 120px; }
.brem-recon .stick-2 { min-width: 180px; max-width: 180px; }
.brem-recon tr.brem-flagged td { background: #fef2f2; }   /* flagged row incl. frozen cells */
/* subtle divider at the Generation / Receipt block boundary */
.brem-recon th.brem-block-start, .brem-recon td.brem-block-start { border-left: 2px solid var(--gray-200); }
/* Compact delta cell (one cell = a BR-vs-EM block): abbreviated labels above a
   two-segment proportional bar, gap % below. Full precision on the cell's title hover. */
.recon-delta { min-width: 158px; padding: 6px 12px; vertical-align: middle; }
.rd-labels { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; line-height: 1.15; margin-bottom: 3px; white-space: nowrap; }
.rd-labels .rd-br { color: #1a3a5c; font-weight: 600; }
.rd-labels .rd-em { color: #047857; font-weight: 600; }  /* readable emerald matching the #10b981 bar */
.rd-track { position: relative; height: 8px; border-radius: 3px; overflow: hidden; }
.rd-overlay { position: absolute; top: 0; left: 0; height: 100%; }
.rd-gap { font-size: 11px; margin-top: 3px; text-align: right; }
.rd-gap .rd-gap-null { color: #94a3b8; }

/* BR+EM By-Waste-Code table (.brem-wc): every row is a flagged facility, so the pale-orange
   #fff7ed goes on EVERY td (incl. the frozen sticky cells). The td.stick-col selector is
   needed to out-specify `.table-wrap .stick-col`'s white default on the frozen cells. */
.brem-wc tbody td { background: #fff7ed; }
.brem-wc tbody td.stick-col { background: #fff7ed; }
/* Waste-codes column rendered as pill badges (was a plain 340px comma-string, ~48% truncated).
   Pills wrap inside a bounded width so showing more codes grows row HEIGHT, not column WIDTH;
   up to 10 shown (covers the median-10 case), then a "+N more" badge; full list on the cell's
   title= hover (same disclosure mechanism as the delta cell). */
.wc-cell { max-width: 220px; line-height: 1.6; }
.wc-pill { display: inline-block; font-family: monospace; font-size: 10px; color: #374151;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 3px; padding: 0 5px; margin: 1px 3px 1px 0; }
.wc-more { display: inline-block; font-size: 10px; font-weight: 600; color: #92400e;
  background: #fde68a; border: 1px solid #f59e0b; border-radius: 3px; padding: 0 6px; margin: 1px 0; cursor: help; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--gray-600);
  border-bottom: 2px solid var(--gray-200);
  background: var(--gray-50);
}
td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-900);
}
tr:hover td { background: var(--blue-lt); }
tr.row-selected td { background: #dbeafe !important; outline: 2px solid var(--blue); outline-offset: -2px; }
tr.row-selected-multi td { background: #e0f2fe !important; }
.table-empty { padding: 32px; text-align: center; color: var(--gray-400); }
td a { color: var(--blue); text-decoration: none; }
td a:hover { text-decoration: underline; }

/* ---- Pivot table ---- */
.pivot-table th { white-space: nowrap; font-size: 10px; padding: 6px 8px; }
.pivot-table td { padding: 7px 8px; font-size: 12px; }
.pivot-table thead tr:first-child th[colspan] { text-align: center; color: #fff; border-bottom: 1px solid #2c5f8a; }
.pivot-table thead tr:last-child th { text-align: right; }
.pivot-table thead tr:last-child th:nth-child(-n+7) { text-align: left; }

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--gray-600);
}
.pagination a {
  padding: 4px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  color: var(--blue);
  text-decoration: none;
}
.pagination a:hover { background: var(--blue-lt); }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-lqg  { background: #fee2e2; color: #991b1b; }
.badge-sqg  { background: #fef3c7; color: #92400e; }
.badge-vsqg { background: #dcfce7; color: #166534; }
.badge-n    { background: var(--gray-100); color: var(--gray-600); }
.badge-Y    { background: #fee2e2; color: #991b1b; }
.badge-N    { background: #dcfce7; color: #166534; }

/* ---- BR data-type color classes (used on new Biennial Report sub-tabs) ---- */
.br-inbound   { background:#E1F5EE; color:#085041; }
.br-outbound  { background:#FAECE7; color:#712B13; }
.br-intl      { background:#EEEDFE; color:#3C3489; }
.br-mmc       { background:#FAEEDA; color:#633806; }
.br-year      { background:#E6F1FB; color:#0C447C; }
.br-onsite    { background:#EAF3DE; color:#27500A; }
.br-offsite   { background:#FFF3E0; color:#7C3500; }
.br-hw        { background:#FEE2E2; color:#991B1B; }
.br-nhw       { background:#F3F4F6; color:#374151; }
/* BREM quantity-analysis notable-variance row highlight */
.brem-notable-row { background:#fff7ed; border-left:3px solid #f59e0b; }
/* Current cycle pill highlight — green outline on code/MMC pills */
.current-code { outline:2px solid #16a34a; outline-offset:2px; }
/* Source-distinction pills for waste codes and MMCs */
.pill-generated { background:#EAF3DE; color:#27500A; border:1px solid #C0DD97; }
.pill-received  { background:#E1F5EE; color:#085041; border:1px solid #9FE1CB; }
.pill-both      { background:#E6F1FB; color:#0C447C; border:1px solid #B5D4F4; }
.pill-current   { outline:2px solid #16a34a; outline-offset:2px; }
.pill-match     { outline:2px solid #f59e0b !important; outline-offset:2px; }

/* ---- Merlin context chip — facility profile tabs ---- */
.merlin-ctx-chip {
  position: sticky;
  top: 56px;
  float: right;
  z-index: 100;
  margin: -4px 0 8px 12px;
  clear: right;
}
.merlin-ctx-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1a2744;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px 12px 5px 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.merlin-ctx-btn:hover {
  background: #243660;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.merlin-ctx-btn:active {
  transform: translateY(0);
}

/* ---- Merlin facility insight pill — next to role badges (outlined/subtle) ---- */
.merlin-insight-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: #1a2744;
  border: 1.5px solid #1a2744;
  border-radius: 20px;
  padding: 3px 10px 3px 7px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 8px;
}
.merlin-insight-btn:hover {
  background: #1a2744;
  color: #fff;
}
.merlin-insight-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---- eManifest color classes ---- */
.em-generator  { background:#FAECE7; color:#712B13; border:1px solid #F5C4B3; }
.em-receiver   { background:#E1F5EE; color:#085041; border:1px solid #9FE1CB; }
.em-transporter{ background:#EEEDFE; color:#3C3489; border:1px solid #CECBF6; }
.em-pcb        { background:#FAEEDA; color:#633806; border:1px solid #FAC775; }
.em-export     { background:#EAF3DE; color:#27500A; border:1px solid #C0DD97; }
.em-rejection  { background:#FCEBEB; color:#791F1F; border:1px solid #F7C1C1; }
.em-pending    { background:#E6F1FB; color:#0C447C; border:1px solid #B5D4F4; }
.em-signed     { background:#EAF3DE; color:#27500A; border:1px solid #C0DD97; }
.em-corrected  { background:#FAEEDA; color:#633806; border:1px solid #FAC775; }

/* MMC chip — toggleable pill used in the national Receivers Report
   filter panel. Active state borrows the .em-corrected MMC-amber
   palette; inactive state strikes through to make the in/out distinction
   immediately legible when the user toggles a few chips off after the
   "all selected" default. */
.mmc-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: pointer;
  user-select: none;
  transition: background .12s, color .12s, border-color .12s;
  text-decoration: line-through;
}
.mmc-chip-active {
  background: #FAEEDA;
  color: #633806;
  border-color: #FAC775;
  text-decoration: none;
}
.mmc-chip:hover {
  border-color: var(--gray-400);
}

/* ---- EM Stat Card system ----
   Shared 4-column stat-card pattern across every EM sub-tab. All
   stat cards now use `.em-stat-card` plus one `.accent-*` modifier
   instead of an inline flex+min-height+border-left declaration.
   This makes the per-tab min-height inconsistency (80/88/90/100 px
   was found in inline overrides) impossible at the partial layer.
   Accent palette intentionally aligns with the Flow Map's role
   colours (generator green / receiver red) — distinct from the
   `.em-generator`/`.em-receiver` BADGE classes above, which keep
   their own background/text palette. */
.em-stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 88px;
  margin-bottom: 0;
  border-left: 4px solid transparent;
}
.em-stat-card.accent-generator   { border-left-color: #1D9E75; }
.em-stat-card.accent-receiver    { border-left-color: #dc2626; }
.em-stat-card.accent-transporter { border-left-color: #3C3489; }
.em-stat-card.accent-pcb         { border-left-color: #633806; }
.em-stat-card.accent-rejection   { border-left-color: #791F1F; }
.em-stat-card.accent-pending     { border-left-color: #0C447C; }
.em-stat-card.accent-onsite      { border-left-color: #27500A; }
.em-stat-card.accent-warning     { border-left-color: #c2410c; }
.em-stat-card.accent-success     { border-left-color: var(--green); }
.em-stat-card.accent-amber       { border-left-color: var(--amber); }
.em-stat-card.accent-neutral     { border-left-color: #1a3a5c; }
.em-stat-card.accent-muted       { border-left-color: #E5E7EB; }
.em-stat-card.accent-gray        { border-left-color: var(--gray-600); }

/* Section header label — 11px uppercase tracked text with a 3px
   EM-green left accent. Matches the Reports filter-panel section
   headers (#filter-panel-body .filter-group-label) but as a
   standalone utility so other EM sub-tabs (Data Quality, future)
   can group their major sections under a consistent banner. */
.em-section-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #374151;
  border-left: 3px solid #065f46;
  padding: 2px 8px;
  margin: 0 0 8px 0;
}

/* Waste-code health risk badges — replaces dynamic server-supplied
   inline `style="background:...;color:..."` with class-based styling.
   Letter maps to EPA waste-code prefix: P=acute hazardous, U=toxic,
   F=non-specific source, K=specific source, D=characteristic. */
.health-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  margin-right: 2px;
}
.health-p { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.health-u { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.health-f { background: #fefce8; color: #854d0e; border: 1px solid #fef08a; }
.health-k { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.health-d { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.health-unknown { background: var(--gray-100); color: var(--gray-600); }

/* ---- Compliance Risk Badge ---- */
.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.risk-green  { background: #dcfce7; color: #166534; }
.risk-yellow { background: #fef3c7; color: #92400e; }
.risk-red    { background: #fee2e2; color: #991b1b; }

/* ---- Environmental Liability Score (Tell 16) ---- */
.liability-badge { display:inline-flex; align-items:center; gap:6px;
  padding:6px 12px; border-radius:6px; font-weight:600; flex-shrink:0;
  margin-left:auto; cursor:pointer; position:relative; }
/* ⚠️ THE z-index HERE IS LOAD-BEARING — do not drop it when touching the hover.
   `filter` on any non-`none` value CREATES A STACKING CONTEXT (CSS Filter
   Effects). Because this filter is applied on :hover — the same hover that
   reveals the ::after tooltip — the tooltip's own `z-index:9999` gets confined
   INSIDE the badge's new stacking context and stops competing with the rest of
   the page. The badge itself then sits at z-index:auto, so any later-in-DOM
   positioned element (the tab bar's buttons are position:relative, and their
   info_tip ⓘ glyphs are positioned too) paints straight through the tooltip's
   text. Measured in Chromium: the ⓘ buttons and the tab labels rendered on top
   of the tooltip mid-sentence, garbling it.

   Raising the BADGE's own level fixes it, because the tooltip travels with its
   stacking context. 200 clears the page-content band (.merlin-ctx-chip 100,
   .sr-params-bar 90, sticky table cells 2-3) while staying far below the nav
   (1100) and every modal (9000+), so the tooltip can never cover the chrome.
   Applied only while open, so the badge's resting stacking order is unchanged.

   This is NOT specific to the Biennial Report tab — it is whatever content
   happens to sit under the 280px tooltip. Any hover-filter + absolutely
   positioned child is the same trap; see also .risk-badge if it ever gains one. */
.liability-badge:hover,
.liability-badge:focus-within { filter:brightness(1.05); z-index:200; }
.liability-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1f2937;
    color: #f9fafb;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: normal;
    width: 280px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    text-align: left;
}
.liability-badge:hover::after {
    opacity: 1;
}
.liability-red    { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }
.liability-orange { background:#ffedd5; color:#c2410c; border:1px solid #fb923c; }
.liability-amber  { background:#fef9c3; color:#854d0e; border:1px solid #fde047; }
.liability-green  { background:#dcfce7; color:#166534; border:1px solid #86efac; }
.liability-blue   { background:#eff6ff; color:#1e40af; border:1px solid #93c5fd; }
.liability-score  { font-size:1.4em; font-weight:700; }

.liability-breakdown { margin-top:8px; width:100%; max-width:100%; margin-left:0; align-self:stretch; }
.liability-breakdown > summary { display:none; }
.liability-components { display:flex; flex-direction:column; gap:6px;
  width:100%; margin-top:6px; padding:10px; background:#f9fafb; border-radius:6px; }
.liability-component { display:flex; align-items:center; gap:8px; }
.lc-label { font-size:12px; color:#6b7280;
  white-space:nowrap; width:auto; min-width:220px; flex-shrink:0; }
.lc-bar { height:8px; background:#e5e7eb; border-radius:4px; overflow:hidden; flex:1; }
.lc-fill { height:100%; border-radius:4px; transition:width 0.3s; }
.lc-pts { font-size:12px; font-weight:600; text-align:right; flex-shrink:0; min-width:50px; }

/* ---- Red Flag Panel (Tell 16) ---- */
.red-flag-panel { margin:12px 0; padding:12px 16px;
  background:#fff7ed; border:1px solid #fed7aa;
  border-left:4px solid #ea580c; border-radius:6px; }
.rfp-header { font-weight:600; color:#c2410c; margin-bottom:8px; }
.rfp-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}
.rfp-toggle:hover { opacity: 0.85; }
.rfp-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rfp-chevron {
    margin-left: auto;
    font-size: 11px;
    color: #c2410c;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.rfp-list { margin:0; padding-left:20px; }
.rfp-item { color:#7c2d12; font-size:14px; margin-bottom:4px; }
.rfp-footer { font-size:12px; color:#9a3412; margin-top:8px; }
.rfp-footer a { color:#9a3412; }

/* ---- Active/Inactive Status Badge ---- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.status-active   { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.status-inactive { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ---- Handler Role Badges ---- */
.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: white;
  margin-right: 3px;
  cursor: default;
  flex-shrink: 0;
}
/* Colorblind-safe map-optimized role palette. Used everywhere role
   badges render (Facility Search filter, search-result cards, facility
   profile, map pin popups). CT shares R's blue because Commercial TSD
   is a receiver variant. */
.role-generator   { background: #E63946; }   /* G  vivid red */
.role-receiver    { background: #2196F3; }   /* R  bright blue */
.role-transporter { background: #FF9800; }   /* T  orange */
.role-transfer    { background: #9C27B0; }   /* TF purple */
.role-commercial  { background: #2196F3; }   /* CT same as receiver */
.role-other       { background: #00BCD4; }   /* Other cyan */
.role-badges-cell { display: flex; align-items: center; flex-wrap: nowrap; gap: 1px; }

/* ---- Facility Header ---- */
.facility-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-bottom: 20px;
}
.facility-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}
.facility-name-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.facility-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.facility-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.facility-header-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.facility-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 0 1 auto;
}

/* ---- Detail grid ---- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px 24px;
  margin-bottom: 8px;
}
.detail-item .dk { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--gray-400); margin-bottom: 2px; }
.detail-item .dv { font-size: 14px; font-weight: 500; }

/* ---- Module Snapshot grid (Summary tab) ---- */
.snap-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: space-between;
}
.snap-legend {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 400;
}
.snap-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.snap-legend-item:not(:last-child)::after {
  content: "·";
  margin-left: 14px;
  color: var(--gray-400, #9ca3af);
  font-weight: 700;
}
/* Auto-fit responsive grid: 5 cols at full width, reflowing to fewer as the
   available width shrinks (laptop widths / sidebar-narrowed content) without
   hard breakpoints. minmax(200px,1fr) keeps each card at a readable minimum
   (below which "Financial Assurance" / "Corrective Action" labels become
   unreadable), so cards never squeeze below 200px or overflow the container.
   Replaces the old fixed repeat(5,1fr) + 1280/820/540 media-query steps. */
.snap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.snap-missing {
  color: var(--gray-400); font-style: italic;
}

/* Contact freshness badge — Contact Information card title shows
   how recently EPA received the registration submission this contact
   came from. Colors come from _contact_currency() in router.py
   (green/yellow/red palette). */
.contact-currency-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
  border-radius: 999px;
  vertical-align: middle;
}

/* Compliance Evaluations table badges — Violation Type severity,
   Return-to-Compliance status, and Sampling indicator. */
.ce-vtype-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}
.ce-vtype-class1 { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.ce-vtype-class2 { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.ce-vtype-minor  { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.ce-rtc-resolved { color: #166534; font-weight: 600; }
.ce-rtc-open {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.ce-sampling-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: #ccfbf1;
  color: #115e59;
  border: 1px solid #5eead4;
}
.ce-appeal-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  white-space: nowrap;
}

/* Permitting tab — capacity-type letter badge (M=Maximum, A=Average, etc.) */
.pm-cap-type-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  vertical-align: middle;
  cursor: help;
}
/* Permit type — Standardized vs Site-Specific */
.pm-permit-type-badge {
  display: inline-block;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2px;
  border-radius: 8px;
  white-space: nowrap;
  cursor: help;
}
.pm-permit-standardized {
  background: #dcfce7; color: #166534; border: 1px solid #86efac;
}
.pm-permit-site-specific {
  background: #e0e7ff; color: #3730a3; border: 1px solid #a5b4fc;
}
/* Permit timeline — slipped badge for events that completed >90 days
   past their original schedule. Also re-used by the Corrective Action
   Event Timeline for the same purpose. */
.pm-slip-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  white-space: nowrap;
  cursor: help;
}

/* Corrective Action — release pathway pills on Areas of Concern table.
   Per-medium colors: Air red, Groundwater blue, Soil brown, SW teal. */
.ca-rel-pill {
  display: inline-block;
  padding: 1px 7px;
  margin-right: 3px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  white-space: nowrap;
  cursor: help;
}
.ca-rel-air  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.ca-rel-gw   { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.ca-rel-soil { background: #f5e8d3; color: #7c4a1c; border: 1px solid #d6b88a; }
.ca-rel-sw   { background: #ccfbf1; color: #115e59; border: 1px solid #5eead4; }

/* Financial Assurance — expired mechanism badge (red), pairs with the
   amber .pm-slip-badge for "Expires Nd" within 90 days. */
.fa-expired-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  white-space: nowrap;
  cursor: help;
}

/* Enforcement Actions card-per-row layout — eliminates the
   horizontal scroll the wide table forced. Matches the WIETS / BR
   sub-tab disclosure pattern. */
.ce-card-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ce-card {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.ce-card[open] {
  border-color: #94a3b8;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.ce-card > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 9px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  user-select: none;
}
.ce-card > summary::-webkit-details-marker { display: none; }
.ce-card > summary::before {
  content: "›";
  display: inline-block;
  width: 12px;
  font-size: 16px;
  line-height: 1;
  color: #94a3b8;
  transition: transform .12s ease;
  flex-shrink: 0;
}
.ce-card[open] > summary::before { transform: rotate(90deg); }
.ce-card > summary:hover {
  background: #f8fafc;
}
.ce-card-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--gray-700);
  font-weight: 600;
  white-space: nowrap;
}
.ce-card-agency {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
}
.ce-card-penalty {
  font-weight: 600;
  color: #1a3a5c;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ce-card-disposition {
  font-size: 12px;
  color: var(--gray-600);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 10px;
}
.ce-card-muted { color: var(--gray-400); }
.ce-card-body {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--gray-200);
  background: #fafafa;
}
.ce-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 18px;
}
.ce-card-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ce-card-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--gray-400);
  font-weight: 600;
  white-space: nowrap;
}
.ce-card-value {
  font-size: 13px;
  color: var(--gray-700);
  font-variant-numeric: tabular-nums;
}

/* Expandable regulatory citations on the Violations table — see
   ce_citation join in facility_violations(). One <details>/<summary>
   per violation row; native HTML disclosure widget so no JS required. */
.ce-cite-expand { margin: 0; }
.ce-cite-expand > summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  white-space: nowrap;
  user-select: none;
}
.ce-cite-expand > summary::-webkit-details-marker { display: none; }
.ce-cite-expand[open] > summary {
  background: #1a3a5c;
  color: #fff;
  border-color: #1a3a5c;
}
.ce-cite-expand > summary:hover {
  border-color: #1a3a5c;
}
.ce-cite-detail {
  margin-top: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  background: #fafafa;
}
.ce-cite-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
}
.ce-cite-table th,
.ce-cite-table td {
  padding: 4px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}
.ce-cite-table thead th {
  background: #f3f4f6;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: #6b7280;
}
.ce-cite-table tbody tr:last-child td { border-bottom: none; }
.ce-cite-citation {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  white-space: nowrap;
}
.ce-cite-citation a {
  color: #1a3a5c;
  text-decoration: none;
  border-bottom: 1px dotted #94a3b8;
}
.ce-cite-citation a:hover { border-bottom-style: solid; }
.ce-cite-link-icon {
  font-size: 9px;
  color: #94a3b8;
  margin-left: 1px;
}
.ce-cite-owner {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #6b7280;
}
/* Citation-type colored badges — solid backgrounds, white text. */
.ce-cite-type {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
  cursor: help;
}
.ce-cite-type-fr { background: #0d9488; color: #fff; }   /* teal   — Federal Regulation */
.ce-cite-type-sr { background: #2563eb; color: #fff; }   /* blue   — State Regulation */
.ce-cite-type-ss { background: #7c3aed; color: #fff; }   /* purple — State Statute */
.ce-cite-type-pc { background: #d97706; color: #fff; }   /* amber  — Permit Condition */
.ce-cite-type-fs { background: #1e3a8a; color: #fff; }   /* navy   — Federal Statute */
.ce-cite-type-oc { background: #6b7280; color: #fff; }   /* gray   — Other Code */

/* Client-side table paginator — used by tables tagged data-paginate.
   See dashboard/static/js/table_paginate.js. */
.rcra-paginator {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 0 2px;
  font-size: 12px;
  color: var(--gray-500);
}
.rcra-paginator-count { margin-right: auto; }
.rcra-paginator-btn {
  font-size: 12px;
  padding: 3px 10px;
  border: 1px solid var(--gray-300);
  background: #fff;
  color: var(--gray-700);
  border-radius: 4px;
  cursor: pointer;
}
.rcra-paginator-btn:hover:not([disabled]) {
  border-color: #1a3a5c;
  color: #1a3a5c;
}
.rcra-paginator-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
/* Rows-per-page selector — opt-in via data-paginate-selector (canonical
   Tables/Lists component, 2026-07-09). */
.rcra-paginator-size {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gray-500);
}
.rcra-paginator-size > span {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-size: 10px;
}
.rcra-paginator-size select {
  font-size: 12px;
  padding: 2px 6px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  background: #fff;
  color: var(--gray-700);
  cursor: pointer;
}

/* eManifest supplement provenance badge — Site Info tab. Indicates
   that a value was filled in from the most recent em_manifest row
   because the matching HD field was empty. */
.em-supplement-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .2px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  white-space: nowrap;
  vertical-align: middle;
}
.snap-card {
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--gray-300);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 110px;
  /* Grid items default to min-width:auto, which lets long content (dollar
     amounts, "Financial Assurance" labels) push the track wider than its
     share and blow out the grid. min-width:0 lets the card shrink to its
     track so the auto-fit minmax governs sizing instead. */
  min-width: 0;
  transition: box-shadow .12s ease, border-color .12s ease;
}
.snap-card.snap-clickable { cursor: pointer; }
/* No transform on hover — `transform` creates a containing block for
   position:fixed descendants, which would re-anchor the info-tip popup
   to the card and shoot it off-screen. Use border-color + shadow only. */
.snap-card.snap-clickable:hover {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  border-color: #94a3b8;
}
.snap-card.snap-clickable:focus { outline: 2px solid #1a3a5c; outline-offset: 1px; }
.snap-card.snap-green  { border-left-color: #16a34a; }
.snap-card.snap-amber  { border-left-color: #d97706; }
.snap-card.snap-red    { border-left-color: #dc2626; }
.snap-card.snap-gray   { border-left-color: #d1d5db; background: #fafafa; }
.snap-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 13px; color: var(--gray-700);
}
.snap-dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block; flex: 0 0 9px;
}
.snap-dot-green  { background: #16a34a; }
.snap-dot-amber  { background: #d97706; }
.snap-dot-red    { background: #dc2626; }
.snap-dot-gray   { background: #9ca3af; }
.snap-title { line-height: 1.2; }
.snap-stats {
  font-size: 12px; color: var(--gray-600); line-height: 1.5;
}
.snap-stats strong { color: #111; font-weight: 600; }
.snap-empty {
  font-size: 12px; color: var(--gray-400); font-style: italic;
  padding-top: 4px;
}
/* Floating hover popup (2-second delay) */
.snap-hover-popup {
  position: absolute;
  max-width: 280px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
  font-size: 12px; line-height: 1.5;
  color: var(--gray-700);
  z-index: 9000;
  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.snap-hover-popup.visible {
  opacity: 1;
  transform: translateY(0);
}
.snap-hover-popup.snap-hover-below { transform: translateY(2px); }
.snap-hover-popup.visible.snap-hover-below { transform: translateY(0); }
.snap-hover-title {
  font-weight: 600; color: #111; margin-bottom: 4px; font-size: 13px;
}
.snap-hover-desc { color: var(--gray-600); }
.snap-hover-use {
  color: #1e40af; font-weight: 500;
  margin-top: 6px; padding-top: 6px;
  border-top: 1px solid #e5e7eb;
}

/* ---- Section tabs (facility page) ---- */
.tabs {
  display: flex;
  flex-wrap: nowrap;          /* keep all tabs on one row */
  gap: 1px;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
  height: 54px;               /* tightened so all 13 single-line tabs fit at 1280px */
  overflow-x: auto;           /* fall back to scroll if viewport is narrower than expected */
  overflow-y: hidden;         /* horizontal scroll arrows handle x-overflow; vertical scrollbar should never appear */
}
.tab-btn {
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-700);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: background .15s, color .15s, box-shadow .15s;
  /* position:relative anchors the active state's downward-pointing
     ::after notch (border-trick triangle) so it visually connects
     the active tab to the sub-tab bar's top-border rail. */
  position: relative;
  /* Two-line labels use explicit <br> in the markup. Both lines
     left-align inside the tab; the flex container vertically centers
     the label span. */
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  white-space: nowrap;
  min-height: 44px;
  line-height: 1.2;
  flex: 0 0 auto;             /* let each tab take only the width it needs */
}
.tab-btn .tab-label { text-align: left; }
.tab-btn .tab-label .info-tip-btn { vertical-align: baseline; margin-left: 3px; }
/* Shrink the ⓘ on tabs so it adds minimal width (preserves the
   CLAUDE.md tooltip convention — present, just less prominent). */
.tab-btn .info-tip-btn { font-size: 9px; opacity: 0.6; margin-left: 2px; }
.tab-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.tab-btn.active {
  background: #1a3a5c;
  color: #fff;
  font-weight: 700;
  /* Subtle elevation so the active tab reads as raised over the
     sibling tabs and the sub-tab bar below. */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20);
}
.tab-btn.active:hover { background: #1a3a5c; color: #fff; }
.tab-btn.active .info-tip-btn { color: #fff; opacity: 0.9; }

/* Downward-pointing notch at the bottom-center of the active tab.
   Border-trick triangle (transparent left/right, solid top in the
   tab's module color) — visually points to the sub-tab bar's
   top-border rail below, so the two levels read as connected.
   Default color is the navy fallback; per-module overrides below. */
.tab-btn.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 0;
  height: 0;
  border-left:  8px solid transparent;
  border-right: 8px solid transparent;
  border-top:   8px solid #1a3a5c;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Module-aware active backgrounds. Each .tab-btn carries
   data-module= matching its CLAUDE.md palette entry; the active
   state renders in that module's color so users get visual
   continuity between the tab they're in and the data they're
   viewing. The plain .tab-btn.active rule above is the navy
   fallback; module-specific selectors below override. */
.tab-btn[data-module="overview"].active   { background: #1a3a5c; }   /* neutral navy — Summary dashboard */
.tab-btn[data-module="hd"].active         { background: #475569; }   /* slate — Site Info / Handler */
.tab-btn[data-module="compliance"].active { background: #7c3aed; }   /* violet — Compliance & Enforcement */
.tab-btn[data-module="pm"].active         { background: #0e7490; }   /* teal — Permitting */
.tab-btn[data-module="ca"].active         { background: #991b1b; }   /* red — Corrective Action */
.tab-btn[data-module="fa"].active         { background: #6d28d9; }   /* deep purple — Financial Assurance */
.tab-btn[data-module="br"].active         { background: #1a3a5c; }   /* navy — Biennial Report */
.tab-btn[data-module="brem"].active       {
  /* Two-tone split — navy (BR) on the left half, forest green
     (EM) on the right — visually signals this tab bridges both
     modules. The hard 50/50 stop avoids a soft blend that would
     muddy the identity of either color. */
  background: linear-gradient(to right, #1a3a5c 50%, #065f46 50%);
}
.tab-btn[data-module="brem"].active:hover {
  background: linear-gradient(to right, #1a3a5c 50%, #065f46 50%);
}
.tab-btn[data-module="em2"].active        { background: #065f46; }   /* green — eManifest */
.tab-btn[data-module="wiets"].active      { background: #92400e; }   /* amber — WIETS */
.tab-btn[data-module="history"].active    { background: #1f2937; }   /* gray-900 — Site History */
/* Notch color matches the tab's module color so the downward
   triangle reads as part of the same colored shape. */
/* BR↔EM notch sits at the bottom-center of the split-color tab,
   right at the seam between the navy and green halves. Using the
   midpoint color #0f4c65 (a desaturated teal blending navy +
   green) lets it read as belonging to both halves rather than
   pulling toward one. CSS borders can't carry gradients, so the
   midpoint is the cleanest available approximation. */
.tab-btn[data-module="brem"].active::after       { border-top-color: #0f4c65; }
.tab-btn[data-module="hd"].active::after         { border-top-color: #475569; }
.tab-btn[data-module="compliance"].active::after { border-top-color: #7c3aed; }
.tab-btn[data-module="pm"].active::after         { border-top-color: #0e7490; }
.tab-btn[data-module="ca"].active::after         { border-top-color: #991b1b; }
.tab-btn[data-module="fa"].active::after         { border-top-color: #6d28d9; }
.tab-btn[data-module="em2"].active::after        { border-top-color: #065f46; }
.tab-btn[data-module="wiets"].active::after      { border-top-color: #92400e; }
.tab-btn[data-module="history"].active::after    { border-top-color: #1f2937; }
/* :hover override per module so the active background sticks
   instead of flashing the default navy on mouseover. */
.tab-btn[data-module="hd"].active:hover         { background: #475569; }
.tab-btn[data-module="compliance"].active:hover { background: #7c3aed; }
.tab-btn[data-module="pm"].active:hover         { background: #0e7490; }
.tab-btn[data-module="ca"].active:hover         { background: #991b1b; }
.tab-btn[data-module="fa"].active:hover         { background: #6d28d9; }
.tab-btn[data-module="em2"].active:hover        { background: #065f46; }
.tab-btn[data-module="wiets"].active:hover      { background: #92400e; }
.tab-btn[data-module="history"].active:hover    { background: #1f2937; }

/* Chevron on tabs that have sub-tabs (BR, BR↔EM, eManifest, WIETS).
   Subtle visual cue that there's a second level of navigation
   nested inside. Only renders on tabs marked data-has-subtabs. */
.tab-btn[data-has-subtabs] .tab-label::after {
  content: " ▾";
  font-size: 9px;
  margin-left: 4px;
  opacity: 0.55;
  position: relative;
  top: -1px;
}
.tab-btn[data-has-subtabs].active .tab-label::after {
  opacity: 0.85;
}

/* ---- Map containers ---- */
#map { height: 600px; border-radius: var(--radius); box-shadow: var(--shadow); }
.dual-map-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.map-panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.map-panel-header {
  padding: 12px 16px;
  background: var(--epa-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.map-panel-filters {
  padding: 10px 14px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.map-panel-filters select, .map-panel-filters input[type="range"] {
  font-size: 12px;
  height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  background: #fff;
}
.map-panel-filters label { color: var(--gray-600); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.map-container { height: 380px; position: relative; }
/* Prevent Leaflet maps from overlapping the sticky nav bar.
   nav z-index:1100 beats Leaflet controls (z-index:1000) in the root stacking context.
   (.leaflet-container has no position so cannot establish its own stacking context.) */
.map-note { padding: 6px 14px; font-size: 11px; color: var(--gray-400); background: var(--gray-50); border-top: 1px solid var(--gray-200); }
.map-fullscreen-btn {
  background: white;
  border: 2px solid rgba(0,0,0,0.2);
  border-radius: 4px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 5px rgba(0,0,0,0.4);
  line-height: 1;
}
.map-fullscreen-btn:hover { background: #f4f4f4; }
.map-fullscreen-active {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  /* Sits above the manifest modal overlay (#manifest-modal-overlay
     uses z-index:10001) so a fullscreened map clicked from inside the
     popup renders on top — overlay disappears behind it as expected. */
  z-index: 10002 !important;
  /* Neutralise the manifest-detail bleed margins (margin-left:-24px /
     margin-right:-24px on the route-map div) and the rounded-bleed
     shape, otherwise the fixed-position map renders 24px offscreen
     to the left with rounded corners clipping into the viewport. */
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
}
/* Keep map controls panel scrollable and above Leaflet panes when fullscreen */
.map-fullscreen-active .map-controls {
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  z-index: 10003;
}
/* Apply border-radius to leaflet-container for maps that have overlay divs inside them
   (overflow:hidden removed from the outer div to allow overlays to render correctly) */
#flow-map .leaflet-container,
#em-flow-map .leaflet-container,
#em-pcb-map .leaflet-container,
#em-rej-map .leaflet-container,
#em-shipping-map .leaflet-container { border-radius: 6px; }
#received-map .leaflet-container { border-radius: 4px; }

/* ---- Module description box ---- */
.module-desc {
  background: #f0f4f8;
  border-left: 4px solid var(--epa-blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 13px;
}
.module-desc-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.module-desc p { color: var(--gray-600); line-height: 1.6; }
.plain-english-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--epa-blue);
  border: 1.5px solid var(--epa-blue);
  border-radius: 20px;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
  align-self: flex-start;
}
.plain-english-btn:hover {
  background: var(--epa-blue);
  color: #fff;
}

/* Manifest detail popup — fullscreen state. The inner card
   (#manifest-modal-content) carries its dimensions inline (88vw /
   82vh / 920px max-width). When the user clicks the ⛶ toggle next to
   the close button, we add .manifest-fullscreen which overrides those
   inline styles to fill the viewport. !important is required because
   the base values live in a style="" attribute, not a CSS rule. The
   overlay (#manifest-modal-overlay) already covers the full viewport,
   so only the card needs to grow. */
.manifest-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

/* ---- Modal ---- */
/* Unified download pill (BR Generation Waste Stream Detail + reusable). */
.download-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #1e3a5f;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease;
}
.download-pill:hover { background: #2c5282; }

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.55);
  z-index: 11000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 32px 36px 28px;
  max-width: 580px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: var(--gray-100);
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--gray-600);
  line-height: 1;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-900); }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; color: var(--epa-blue); padding-right: 32px; }
.modal-body { font-size: 14px; color: var(--gray-600); line-height: 1.75; }

/* ---- HTMX loading indicator ---- */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator { display: inline-block; }

/* ---- Premium Report observations: async load spinner ---- */
.obs-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #cbd5e1;
  border-top-color: #1a2744;
  border-radius: 50%;
  animation: obs-spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes obs-spin {
  to { transform: rotate(360deg); }
}
.obs-loading {
  color: #64748b;
  font-size: 13px;
  padding: 12px 0;
  font-style: italic;
}

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Chart container ---- */
.chart-wrap { position: relative; height: 300px; margin-top: 8px; }

/* ---- Alert / flash ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
}
.alert-info    { background: var(--blue-lt); color: #1e40af; border-left: 3px solid var(--blue); }
.alert-warning { background: #fffbeb; color: #92400e; border-left: 3px solid var(--amber); }
.alert-error   { background: #fef2f2; color: #991b1b; border-left: 3px solid var(--red); }
.alert-success { background: #f0fdf4; color: #166534; border-left: 3px solid var(--green); }

/* ---- Module status grid ---- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.module-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color .15s, box-shadow .15s;
}
.module-card:hover {
  border-color: var(--epa-blue);
  box-shadow: 0 2px 8px rgba(26,58,92,.12);
}
.module-card .mod-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; color: var(--epa-blue); }
.module-card .mod-desc { font-size: 11px; color: var(--gray-600); margin-bottom: 6px; }
.module-card .mod-rows { font-size: 18px; font-weight: 700; color: var(--blue); }
.module-card .mod-date { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
/* Module card color variants — left border by module type */
.module-card.mod-blue   { border-left: 4px solid #2c7be5; }
.module-card.mod-green  { border-left: 4px solid #0d9f6e; }
.module-card.mod-orange { border-left: 4px solid #e67e22; }
.module-card.mod-blue   .mod-name { color: #1a3a5c; }
.module-card.mod-green  .mod-name { color: #065f46; }
.module-card.mod-orange .mod-name { color: #92400e; }
.module-card.mod-blue   .mod-rows { color: #2c7be5; }
.module-card.mod-green  .mod-rows { color: #0d9f6e; }
.module-card.mod-orange .mod-rows { color: #e67e22; }
.module-card.mod-blue:hover   { border-color: #2c7be5; box-shadow: 0 2px 8px rgba(44,123,229,.15); }
.module-card.mod-green:hover  { border-color: #0d9f6e; box-shadow: 0 2px 8px rgba(13,159,110,.15); }
.module-card.mod-orange:hover { border-color: #e67e22; box-shadow: 0 2px 8px rgba(230,126,34,.15); }

/* ---- Sub-tabs ---- */
/* Border-bottom tab bar (reports_em_summary's Summary/Rejections tabs + the
   audit views) — clear active state: gray inactive → navy bold + navy underline
   when active. Moved here from audit.html's inline <style> (2026-07-18) so pages
   that share the .mod-tab class (em-summary) actually get the styling — before,
   its active/inactive tabs were visually identical because the CSS was scoped to
   audit.html only. Inline per-tab font-size/padding still override the base. */
.mod-tab {
  padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
  border: none; background: none; color: #6b7280;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.mod-tab:hover { color: #1a3a5c; }
.mod-tab.active { color: #1a3a5c; border-bottom-color: #1a3a5c; }

.sub-tab-bar {
  display: flex;
  /* Wrap to a second row when sub-tabs don't fit (EM has 12 sub-tabs
     and overflowed the container on narrower viewports; the prior
     overflow-x scroll was scrollbar-hidden so users had no signal
     that more sub-tabs existed off-screen). Buttons keep
     flex-shrink:0 + white-space:nowrap so individual labels never
     truncate; the bar grows vertically only when truly needed. */
  flex-wrap: wrap;
  row-gap: 2px;
  gap: 2px;
  /* Connecting visual: a 3px top border in the active module's
     color creates a strong horizontal band that visually belongs
     to the active top tab above (whose downward notch points to
     this rail). Replaces the old left-rail. Default color is
     EPA blue for any sub-tab-bar without a data-module attribute;
     per-module overrides below take over when present. */
  border-top: 3px solid var(--epa-blue);
  border-bottom: 2px solid var(--gray-200);
  margin: 0 0 0 4px;
  padding: 4px 4px 0 6px;
  background: #f8fafc;
  border-radius: 0 0 4px 4px;
}
.sub-tab-btn {
  padding: 6px 11px;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: -0.1px;
  color: var(--gray-600);
  background: none;
  border: none;
  /* Reserve a 2px top border so the active state's top-accent
     can drop in without shifting layout. Mirrors the active
     pill which switched from border-left to border-top so the
     sub-tab visually "drops down from" the parent tab above. */
  border-top: 2px solid transparent;
  border-radius: 0 0 4px 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, background-color .15s, border-color .15s, padding .15s;
  flex-shrink: 0;
}
/* Inactive hover — light tint of the bar's module color so non-
   active sub-tabs feel like siblings of the active one. Default
   uses EPA blue for parent bars without a data-module attribute;
   per-module overrides below take precedence. */
.sub-tab-btn:hover {
  color: var(--epa-blue);
  font-weight: 500;
  background: rgba(15, 76, 129, 0.08);
}
/* Active sub-tab: filled pill at 20% module-color opacity + 2px
   top border in the full module color. The top-border anchor +
   the bar's matching top-rail above visually link the active
   pill to its parent tab. Slightly wider horizontal padding so
   the active pill feels weightier; transition smooths the click. */
.sub-tab-btn.active {
  color: var(--epa-blue);
  background: rgba(15, 76, 129, 0.20);
  border-top-color: var(--epa-blue);
  font-weight: 600;
  font-size: 11.5px;
  padding: 6px 14px;
}

/* Dynamic per-module styling for the bar's top rail, the bar's
   subtle 5%-opacity background tint, the active sub-tab's pill
   fill / top-border / text color, and the inactive hover tint.
   Driven by data-module on the .sub-tab-bar div in facility.html;
   each module's block updates rail + bar bg + active + hover so
   the whole strip reads as one cohesive module-colored unit. */
/* BR — navy */
.sub-tab-bar[data-module="br"]    { border-top-color: #1a3a5c; background: rgba(26, 58, 92, 0.05); }
.sub-tab-bar[data-module="br"]    .sub-tab-btn.active {
  color: #1a3a5c; background: rgba(26, 58, 92, 0.20); border-top-color: #1a3a5c;
}
.sub-tab-bar[data-module="br"]    .sub-tab-btn:not(.active):hover {
  color: #1a3a5c; background: rgba(26, 58, 92, 0.08);
}
/* ── eManifest sub-tab bar — green, no-wrap horizontal scroll ── */
.sub-tab-bar[data-module="em2"] {
  border-top-color: #065f46;
  background: rgba(6, 95, 70, 0.05);
  /* Inherit flex-wrap:wrap from the base rule. The Receipts/Shipments role
     toggle is the first inline item of ROW 1's bar (inside .em2-tabzone-scoped);
     the two .em2-tabzone wrappers (below) split the tabs into a role-scoped zone
     and a facility-wide zone. .em2-zone-bar neutralizes this bar's own bg/border
     so each zone's tint shows through, while the tab styling here is preserved. */
  align-items: stretch;
}
.sub-tab-bar[data-module="em2"] .sub-tab-btn.active {
  color: #065f46;
  background: rgba(6, 95, 70, 0.20);
  border-top-color: #065f46;
}
.sub-tab-bar[data-module="em2"] .sub-tab-btn:not(.active):hover {
  color: #065f46;
  background: rgba(6, 95, 70, 0.08);
}

/* ── eManifest tab SCOPE ZONES (2026-07-18) — two tinted containers that make
   the "role-scoped vs facility-wide" split legible. ROW 1 = green, ROW 2 = gray,
   stacked with no gap; a caption + (row 1) a live role tag sits above each. The
   inner .em2-zone-bar drops the bar's own surface so the zone tint shows; the tab
   component (green active/hover) is preserved unchanged. Both zones size to their
   content — NO fixed heights — so conditional tabs / narrow-viewport wrapping just
   grow the zone vertically. */
#em2-tabzones { margin: 0 0 0 4px; }
.em2-tabzone-scoped {
  background: #ddf1e7;
  border: 1px solid #9fd6bc;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}
.em2-tabzone-wide {
  background: #f2f3f5;
  border: 1px solid #d8dce2;
  border-radius: 0 0 6px 6px;
}
/* ROW 1 ONLY — tighter horizontal padding so the role-scoped zone fits on ONE
   line at desktop widths. It carries up to 11 buttons (Market Position,
   Rejections, PCB, Competitors and Churn/Retention are all conditional), and on
   a full-data facility it wrapped to two rows even at 1440px.
   ⚠️ Deliberately NOT applied to .em2-tabzone-wide: row 2 is only ever 3 buttons
   (Manifest Search / Containers / Data Quality) and keeps the base 6px 11px /
   6px 14px, so the two zones' buttons are not gratuitously different where
   there is no crowding to solve.
   ⚠️ This is a SUPPLEMENT to flex-wrap, never a replacement — .sub-tab-bar keeps
   flex-wrap:wrap (see the comment on that rule: wrapping deliberately replaced a
   horizontal-scroll pattern, because off-screen tabs had no visual signal). At
   narrow widths this row still wraps, by design. */
.em2-tabzone-scoped .sub-tab-btn {
  padding: 6px 8px;
}
.em2-tabzone-scoped .sub-tab-btn.active {
  padding: 6px 10px;
}
.em2-zone-cap {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 10px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.em2-zone-cap-scoped { color: #2f7d5b; }
.em2-zone-cap-wide   { color: #8a9099; }
/* Groups "Scoped to selected role" + its live role-tag pill into ONE flex child,
   so the caption row's justify-content:space-between pushes only the OTHER child
   (the role toggle) to the right. Without this the label and the pill would be
   separate flex children and space-between would split them apart. */
.em2-zone-cap-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.em2-role-tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 10px;
  background: #065f46;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
}
/* Inner bar inside a zone: transparent surface (the zone provides bg + border),
   no top-rail / bottom-border / left-margin — but the em2 tab styling is kept. */
.em2-zone-bar {
  background: transparent;
  border: none;
  border-radius: 0;
  margin: 0;
  padding: 2px 8px 6px;
}

/* Role toggle pill — sits inside the em2 sub-tab-bar before sub-tab buttons */
/* Role toggle pill — sits in the scoped zone's CAPTION row (top-right, opposite
   "Scoped to selected role"), NOT in the tab-bar row, so the role-scoped tabs
   below get the full row width. Moved 2026-08-08. The old rule's trailing
   divider + margins existed only to separate it from the tab buttons that used
   to follow it in the same row; it has no such neighbour now. */
.em2-role-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
/* Zero-height full-width flex item — forces the facility-wide sub-tabs that
   follow it onto a new row in the wrapping .sub-tab-bar. */
.em2-row-break {
  flex-basis: 100%;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
.em2-role-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(6,95,70,0.30);
  background: transparent;
  color: #065f46;
  transition: background .15s, color .15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.em2-role-btn:first-child {
  border-radius: 20px 0 0 20px;
  border-right: none;
}
.em2-role-btn:last-child {
  border-radius: 0 20px 20px 0;
  border-left: none;
}
.em2-role-btn.em2-role-only {
  border-radius: 20px;
  border: 1px solid rgba(6,95,70,0.30);
}
.em2-role-btn.active {
  background: #065f46;
  color: #fff;
  border-color: #065f46;
}
.em2-role-btn:not(.active):hover {
  background: rgba(6,95,70,0.10);
}
.em2-role-only-label {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-100);
  border-radius: 20px;
  white-space: nowrap;
}

/* BR↔EM — split BR-navy / EM-green crossover treatment that
   matches the two-tone parent tab above. The 3px top rail is a
   navy→green linear gradient painted as a top-anchored
   background layer (CSS `border-top` can't carry a gradient).
   The bar's bg tint is a 5%-opacity navy→green gradient
   underneath, so the whole strip reads as one continuous bridge.
   Padding-top compensates for the dropped solid border so the
   bar height matches the other modules. The active sub-tab
   pill and inactive hover use the midpoint color #0f4c65 so
   they sit visually centered between the two halves regardless
   of which sub-tab is hovered. */
.sub-tab-bar[data-module="brem"] {
  border-top-color: transparent;
  background:
    linear-gradient(to right, #1a3a5c, #065f46) top left / 100% 3px no-repeat,
    linear-gradient(to right, rgba(26, 58, 92, 0.05), rgba(6, 95, 70, 0.05));
}
.sub-tab-bar[data-module="brem"] .sub-tab-btn.active {
  color: #0f4c65; background: rgba(15, 76, 101, 0.20); border-top-color: #0f4c65;
}
.sub-tab-bar[data-module="brem"] .sub-tab-btn:not(.active):hover {
  color: #0f4c65; background: rgba(15, 76, 101, 0.08);
}
/* WIETS — amber */
.sub-tab-bar[data-module="wiets"] { border-top-color: #92400e; background: rgba(146, 64, 14, 0.05); }
.sub-tab-bar[data-module="wiets"] .sub-tab-btn.active {
  color: #92400e; background: rgba(146, 64, 14, 0.20); border-top-color: #92400e;
}
.sub-tab-bar[data-module="wiets"] .sub-tab-btn:not(.active):hover {
  color: #92400e; background: rgba(146, 64, 14, 0.08);
}
/* Compact info-tip ⓘ inside sub-tab buttons so the icon doesn't bloat
   tab width — 12 eManifest tabs need every pixel at 1280px viewport. */
.sub-tab-btn .info-tip-btn { padding: 0 1px; font-size: 10px; vertical-align: baseline; }
.sub-tab-content { margin-top: 20px; min-height: 100px; }

/* ---- Stat boxes (sub-tab summaries) ---- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-box .stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing:.4px; color: var(--gray-400); margin-bottom: 4px; }
.stat-box .stat-val { font-size: 22px; font-weight: 700; color: var(--epa-blue); }
.stat-box .stat-sub { font-size: 11px; color: var(--gray-600); margin-top: 2px; }

/* ---- Chart row ---- */
.chart-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.chart-box {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
}
.chart-box h4 { font-size: 11px; font-weight: 600; color: var(--gray-400); margin-bottom: 10px; text-transform: uppercase; letter-spacing:.4px; }

/* ---- eManifest note ---- */
.em-note {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  padding: 7px 12px;
  font-size: 12px;
  color: #92400e;
  margin-bottom: 14px;
}
.wi-note {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 7px 12px;
  font-size: 12px;
  color: #1e40af;
  margin-bottom: 14px;
}

/* ---- Time dimension toggle ---- */
.time-toggle {
  display: inline-flex;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}
.time-toggle button {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  background: #fff;
  border: none;
  cursor: pointer;
  color: var(--gray-600);
  border-right: 1px solid var(--gray-200);
  transition: background .15s, color .15s;
}
.time-toggle button:last-child { border-right: none; }
.time-toggle button.active { background: var(--blue); color: #fff; }
.time-toggle button:hover:not(.active) { background: var(--gray-100); }

/* ---- Download buttons ---- */
.download-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}
.btn-csv   { background: #064e3b; color: #fff; }
.btn-excel { background: #14532d; color: #fff; }

/* ---- Corrective Action Timeline ---- */
.ca-timeline { padding: 0 8px; }
.ca-event {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
  position: relative;
}
.ca-event:last-child { border-bottom: none; }
.ca-event-dot {
  flex-shrink: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 5px;
}
.ca-event-content { flex: 1; }
.ca-event-date { font-size: 11px; color: var(--gray-400); font-weight: 600; margin-bottom: 2px; }
.ca-event-desc { font-size: 13px; font-weight: 500; }
.ca-event-agency { font-size: 12px; color: var(--gray-400); margin-top: 1px; }

/* ---- Environmental Indicators ---- */
.env-indicators {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.env-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
}
.env-indicator.controlled { background: #dcfce7; color: #166534; }
.env-indicator.not-controlled { background: #fee2e2; color: #991b1b; }
.env-indicator.unknown { background: var(--gray-100); color: var(--gray-600); }

/* ---- Table toolbar (row counts + download) ---- */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}
.table-count { font-size: 12px; color: var(--gray-400); }

/* ─────────────────────────────────────────
   Responsive Design
   Breakpoints:  Mobile ≤767px  |  Tablet 768–1023px  |  Desktop ≥1024px
   ───────────────────────────────────────── */

/* ---- Tablet (768–1023px) ---- */
@media (max-width: 1023px) {
  /* Maps side-by-side → stack */
  .dual-map-layout { grid-template-columns: 1fr; }

  /* Stat cards: 2 columns on tablet */
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  /* Page side padding */
  .page { padding: 20px 16px; }
}

/* ---- Nav: hamburger menu (≤1302px) ----------------------------------------
   ⚠️ NOT the ≤767px mobile breakpoint, and deliberately so. The desktop nav
   needs 1303px of horizontal space (MEASURED in Chromium, binary-searched:
   overflow is 535px at 768, 279px at 1024, 45px at 1258, 1px at 1302, 0px at
   1303). These rules used to live in the ≤767px block below, so EVERY viewport
   from 768–1302px rendered the full nav, overflowed the document, gave the
   whole app a horizontal scrollbar, and pushed the tier pill, the notification
   bell and the ACCOUNT MENU (.nav-user-dd, right edge at 1303px) off-screen —
   a 1366×768 or 1280×800 laptop, i.e. an ordinary user, not an edge case.

   ⚠️ 1302, not the 1258/1259 an earlier note claimed. 1259 was never measured
   and leaves 1259–1302px still broken. Re-measure before changing this number;
   adding a nav item will raise it.

   Splitting this out of the mobile block is behaviour-preserving at ≤767px:
   max-width:1302 also matches there, and no rule here was altered — only the
   breakpoint it sits under. The non-nav mobile rules (.page padding, stat-grid,
   filter-bar, chart-row …) stay at ≤767px below, untouched. ------------------ */
@media (max-width: 1302px) {
  /* ── Nav: hamburger menu ── */
  .nav-hamburger {
    display: flex;
  }
  .nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin-left: 0;
    background: var(--navy);
    padding: 8px 0 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,.4);
    z-index: 99;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links > a {
    padding: 11px 24px;
    width: 100%;
    border-radius: 0;
  }
  /* In the stacked mobile menu (gap:0, column) drop the desktop negative-margin
     so the right-side items don't pull off the menu's left edge. */
  #qhl-nav-btn ~ * { margin-left: 0; }
  .nav-api-docs { margin-left: 0; }
  /* Reports dropdown in mobile menu */
  .nav-links .nav-dropdown {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  .nav-links .nav-dropdown > a {
    padding: 11px 24px;
    width: 100%;
    border-radius: 0;
    display: block;
  }
  .nav-links .nav-dropdown-menu {
    position: static;
    display: none;
    box-shadow: none;
    background: rgba(0,0,0,.15);
    border-radius: 0;
    min-width: unset;
    width: 100%;
    padding: 0;
  }
  .nav-links .nav-dropdown-menu.open { display: block; }
  .nav-links .nav-dropdown-menu a { padding: 9px 16px 9px 40px; }
  .nav-links .nav-dropdown-menu .dd-section-label { padding-left: 40px; }
  .nav-links .nav-dropdown-menu .dd-placeholder { padding-left: 40px; }
}

/* ---- Mobile (≤767px) ---- */
@media (max-width: 767px) {
  /* Page */
  .page { padding: 14px 10px; }

  /* ── Stat cards: 1 column ── */
  .stat-grid { grid-template-columns: 1fr; }

  /* ── Filter forms: stack vertically ── */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .filter-bar .field {
    width: 100%;
  }
  .filter-bar .field input,
  .filter-bar .field select {
    width: 100%;
    min-width: unset;
  }
  /* Keep submit button and secondary btn left-aligned, natural width */
  .filter-bar > .btn { align-self: flex-start; }

  /* ── Tables: ensure card doesn't clip scroll ── */
  .card { overflow: visible; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ── Charts ── */
  .chart-row { grid-template-columns: 1fr; }

  /* ── Card title: wrap on narrow screens ── */
  .card-title { flex-wrap: wrap; row-gap: 6px; }
}

/* ---- Nav dropdown "coming soon" items ---- */
.nav-dropdown-menu a.dd-soon {
  color: #9ca3af !important;
  font-style: italic;
}
.nav-dropdown-menu a.dd-soon::after {
  content: ' soon';
  font-size: 10px;
  opacity: .6;
}

/* ---- Nav dropdown section labels (module colors on light bg) ---- */
.nav-dropdown-menu .dd-section-label.dd-br   { color: #1a3a5c !important; }
.nav-dropdown-menu .dd-section-label.dd-em   { color: #065f46 !important; }
.nav-dropdown-menu .dd-section-label.dd-wiets { color: #92400e !important; }
.nav-dropdown-menu .dd-section-label.dd-trans { color: #5b21b6 !important; }

/* ---- Nav admin link ---- */
.nav-admin-link { color: rgba(255,255,255,0.8) !important; }
.nav-admin-link:hover { color: #fff !important; opacity: 1; }

/* ---- Landing page ---- */
.landing-page { background: var(--gray-50); }

.landing-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1a3a5c 60%, #1e4f72 100%);
  padding: 64px 24px 56px;
}
.landing-hero-inner {
  max-width: 960px;
  margin: 0 auto;
}
.landing-hero-two-col {
  display: flex;
  align-items: center;
  gap: 52px;
  margin-bottom: 36px;
}
.landing-hero-logo-col {
  flex-shrink: 0;
}
.landing-hero-content-col {
  flex: 1;
  text-align: left;
}
.landing-hero-logo {
  width: 160px;
  height: auto;
  display: block;
}
.landing-hero-wordmark {
  color: #fff;
  font-family: 'Nunito Wordmark', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: .3px;
  line-height: 1;
  margin-top: 14px;
  text-align: center;
}
.landing-hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.12);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(147,197,253,.25);
}
/* Home hero headline in the wordmark font (2026-10-16) so headline + wordmark read
   as one brand. Class is used only here. The font file is basic Latin only: the
   &nbsp; after the emoji falls back to the stack below (accepted by Ron) and the
   emoji comes from the system emoji font. */
.landing-hero-title {
  font-family: 'Nunito Wordmark', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 16px;
}
.landing-hero-sub {
  font-size: 16px;
  color: #94a3b8;
  max-width: 560px;
  margin: 0 0 28px;
  line-height: 1.6;
}
.landing-hero-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.landing-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 28px;
}
.landing-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 28px;
}
.landing-stat-val {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}
.landing-stat-lbl {
  font-size: 11px;
  color: #64748b;
  letter-spacing: .03em;
  margin-top: 2px;
}
.landing-stat-div {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,.12);
}
/* Row-2 sub-label — regulatory-context line beneath the main label
   (e.g., "≥1,000 kg/month" under "Large Quantity Generators"). Muted
   further than the main label so it reads as supporting context, not
   competing data. */
.landing-stat-sub {
  font-size: 10px;
  color: rgba(255,255,255,.45);
  letter-spacing: .02em;
  margin-top: 2px;
}
.landing-stats-row-2-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.5);
  text-align: center;
  margin: 18px 0 8px;
}
/* Row 3 has only 2 stats — drop the top border (we already have a
   row-2 separator above) and remove the wide top padding so the row
   sits tight beneath its label. The flex centering inherited from
   .landing-stats-row already keeps the two stats grouped in the
   middle rather than spreading edge-to-edge. */
.landing-stats-row-3 {
  border-top: 0;
  padding-top: 0;
}

.landing-module {
  padding: 48px 24px;
  border-bottom: 1px solid var(--gray-200);
}
.landing-module-alt {
  background: #fff;
}
.landing-module-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.landing-module-header {
  margin-bottom: 28px;
}
.landing-module-badge {
  display: inline-block;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
}
.landing-module-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}
.landing-module-desc {
  color: #475569;
  font-size: 14px;
  max-width: 680px;
  line-height: 1.6;
}
.landing-module-reports {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.landing-report-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
  align-items: start;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}
.landing-module-alt .landing-report-group {
  background: var(--gray-50);
}
.landing-report-group-label {
  grid-column: 1 / -1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 10px 16px 6px;
  border-bottom: 1px solid var(--gray-200);
}
.landing-report-link {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none;
  transition: background .12s;
}
.landing-report-link:last-child { border-bottom: none; }
.landing-report-link:hover { background: #eff6ff; }
.landing-report-soon:hover { background: var(--gray-100); }
.landing-report-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 2px;
}
.landing-report-soon .landing-report-name {
  color: #64748b;
}
.landing-report-desc {
  font-size: 12px;
  color: #94a3b8;
}

/* ---- Landing page competitive advantages ---- */
.landing-advantages {
  background: #fff;
  padding: 52px 24px;
  border-bottom: 1px solid var(--gray-200);
}
.landing-advantages-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.landing-advantages-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 28px;
  text-align: center;
}
.landing-adv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.landing-adv-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 24px 20px;
  box-shadow: var(--shadow);
}
.landing-adv-icon {
  font-size: 28px;
  margin-bottom: 12px;
}
.landing-adv-name {
  font-size: 14px;
  font-weight: 700;
  color: #1a3a5c;
  margin-bottom: 10px;
}
.landing-adv-body {
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

@media (max-width: 1023px) {
  .landing-adv-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .landing-adv-grid { grid-template-columns: 1fr; }
}

.landing-cta {
  background: linear-gradient(135deg, #0f172a 0%, #1a2744 100%);
  padding: 56px 24px;
  text-align: center;
}
.home-page-footer {
  text-align: center;
  padding: 16px 24px;
  font-size: 12px;
  color: #6b7280;
  background: #0f172a;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.landing-cta-inner {
  max-width: 600px;
  margin: 0 auto;
}
.landing-cta h2 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}
.landing-cta p {
  color: #94a3b8;
  margin-bottom: 24px;
  font-size: 14px;
}

@media (max-width: 767px) {
  .landing-hero-title { font-size: 26px; }
  .landing-stat { padding: 0 16px; }
  .landing-module-reports { grid-template-columns: 1fr; }
  .landing-stat-div { display: none; }
  .landing-stats-row { gap: 12px; }
  .landing-hero-two-col { flex-direction: column; gap: 28px; align-items: flex-start; }
  .landing-hero-logo { width: 120px; }
  .landing-hero-wordmark { font-size: 24px; margin-top: 10px; text-align: left; }
  .landing-hero-content-col { text-align: left; }
  .landing-hero-sub { max-width: 100%; }
}

/* ---- Landing page — Coming Soon section ---- */
.landing-coming-soon {
  background: #fff;
  padding: 56px 24px;
  border-top: 1px solid var(--gray-200);
}
.landing-coming-soon-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.landing-coming-soon-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
  text-align: center;
}
.landing-coming-soon-sub {
  text-align: center;
  color: var(--gray-500);
  font-size: 14px;
  margin-bottom: 32px;
}
.landing-cs-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.landing-cs-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 20px 16px;
  text-align: center;
}
.landing-cs-icon {
  font-size: 22px;
  margin-bottom: 8px;
}
.landing-cs-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
}
.landing-cs-body {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
}
.landing-cs-tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  background: #ede9fe;
  color: #5b21b6;
  padding: 2px 8px;
  border-radius: 10px;
}
@media (max-width: 1023px) {
  .landing-cs-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
  .landing-cs-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- Company search page ---- */
.company-name-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.company-name-row  { display: flex; align-items: center; gap: 6px; }
.company-name-row input { flex: 1; min-width: 180px; }
.company-name-remove {
  background: none; border: 1px solid var(--gray-300); border-radius: 4px;
  color: var(--gray-500); cursor: pointer; padding: 0 8px; height: 32px; font-size: 14px;
  line-height: 1;
}
.company-name-remove:hover { background: #fee2e2; border-color: #f87171; color: #991b1b; }
.company-name-add {
  background: none; border: 1px dashed var(--gray-400); border-radius: 4px;
  color: var(--gray-500); cursor: pointer; padding: 0 12px; height: 30px; font-size: 12px;
  margin-top: 2px;
}
.company-name-add:hover { border-color: #1a3a5c; color: #1a3a5c; }

/* ---- Module section label in nav dropdown ---- */
.dd-section-label {
  display: block; padding: 6px 14px 2px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--gray-400); cursor: default;
}
.dd-section-label.dd-br   { color: #1a3a5c; }
.dd-section-label.dd-em   { color: #065f46; }
.dd-section-label.dd-wiets { color: #92400e; }
.dd-section-label.dd-trans { color: #5b21b6; }

/* Freshness strip: the BR tile's forward-looking "next cycle expected" clause.
   Muted + smaller than the value it follows, so it reads as context rather than
   as a second data point. Block-level on its own line: the tile is a narrow
   flex column and an inline clause would push the row to wrap. */
.ds-next {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  /* #64748b, not the #94a3b8 this first shipped with: at 10.5px this is small
     text and needs 4.5:1. #94a3b8 on the strip's white is ~2.8:1 (fails AA);
     #64748b is ~4.8:1 and still reads as secondary to the value above it. */
  color: #64748b;
  line-height: 1.3;
  margin-top: 1px;
}

/* ---- Landing page — Data Status Bar (two-row layout) ---- */
.data-status-bar {
  background: #1f2937;
  padding: 10px 24px;
  border-bottom: 1px solid #374151;
}
.data-status-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.data-status-row-1 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #f9fafb;
  flex-wrap: wrap;
}
.data-status-row1-count {
  font-weight: 600;
}
.data-status-row1-sep {
  color: #4b5563;
}
.data-status-row1-update {
  color: #10b981;
  font-weight: 500;
}
/* Last-successful-ETL timestamp appended to the update line. Filled in by JS in
   the viewer's local timezone (home_landing.html); empty when no ETL has run. */
.data-status-row1-ts {
  color: #10b981;
  font-weight: 500;
}
/* "Weekly data refresh in progress" (#126) — only while the ETL runs. A fixed amber,
   not --amber: some themes set --amber as light as #60a5fa, unreadable on white. */
.data-status-row1-refresh {
  color: #fbbf24;
  font-weight: 500;
}
.data-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}
.data-status-row-2 {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
}
.data-status-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  min-width: 0;
}
.data-status-item:last-child {
  border-right: none;
}
.data-status-item .ds-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
  margin-bottom: 2px;
  white-space: nowrap;
}
.data-status-item .ds-value {
  color: #f9fafb;
  font-weight: 500;
  font-size: 0.82rem;
  white-space: nowrap;
}
.data-status-item .ds-value .info-tip-btn {
  color: rgba(255, 255, 255, 0.55);
  margin-left: 2px;
  cursor: help;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@media (max-width: 767px) {
  .data-status-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .data-status-item {
    border-right: none;
    padding: 6px 4px;
  }
}

/* ---- Landing page — Who Uses RCRAData ---- */
.landing-who-uses {
  background: #f8fafc;
  padding: 56px 24px;
  border-bottom: 1px solid var(--gray-200);
}
.landing-who-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.landing-who-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  text-align: center;
}
.landing-who-sub {
  font-size: 14px;
  color: #475569;
  text-align: center;
  margin-bottom: 32px;
}
.landing-who-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.landing-who-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.landing-who-icon { font-size: 24px; margin-bottom: 10px; }
.landing-who-name { font-size: 14px; font-weight: 600; color: #0f172a; margin-bottom: 8px; }
.landing-who-body { font-size: 13px; color: #475569; line-height: 1.6; }
@media (max-width: 1023px) {
  .landing-who-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .landing-who-grid { grid-template-columns: 1fr; }
}

/* ---- Landing page — Top 10 Live Intelligence section ---- */
.landing-top10 {
  background: #fff;
  padding: 56px 24px;
  border-bottom: 1px solid var(--gray-200);
}
.landing-top10-inner { max-width: 1100px; margin: 0 auto; }
.landing-top10-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.landing-top10-titles h2 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}
.landing-top10-titles p {
  font-size: 14px;
  color: #475569;
}
.landing-top10-year-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #475569;
}
.landing-top10-year-row select {
  height: 34px;
  font-size: 13px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 0 8px;
  background: #fff;
}
.landing-top10-apply {
  height: 34px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #065f46;
  border: 0;
  border-radius: 4px;
  padding: 0 16px;
  cursor: pointer;
}
.landing-top10-apply:hover { background: #0b7a58; }
.landing-top10-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.landing-top10-panel {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.landing-top10-panel-head {
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.landing-top10-panel-body {
  background: #fff;
  padding: 0;
  min-height: 220px;
}
.top10-list { list-style: none; margin: 0; padding: 8px 0; }
.top10-item {
  display: flex;
  align-items: center;
  padding: 7px 16px;
  border-bottom: 1px solid #f1f5f9;
  gap: 10px;
}
.top10-item:last-child { border-bottom: none; }
.top10-rank {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  min-width: 20px;
  text-align: right;
}
.top10-name {
  flex: 1;
  font-size: 12px;
  color: #0f172a;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top10-bar-wrap {
  width: 80px;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.top10-bar { height: 100%; border-radius: 4px; }
.top10-val {
  font-size: 11px;
  color: #475569;
  min-width: 54px;
  text-align: right;
}
.top10-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 16px;
  color: #94a3b8;
  font-size: 13px;
}
.top10-refreshing {
  position: relative;
  opacity: .85;
}
.top10-error {
  padding: 24px 16px;
  text-align: center;
  color: #dc2626;
  font-size: 13px;
}
.top10-error a { color: #dc2626; text-decoration: underline; }
.top10-refreshing::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,.08), transparent);
  background-size: 200% 100%;
  animation: top10-shimmer 1.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes top10-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
/* Top 10 row links */
.top10-row-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(0,0,0,.2);
  transition: border-color .15s, color .15s;
}
.top10-row-link:hover {
  border-bottom-color: #1a3a5c;
  color: #1a3a5c;
}
/* Top 10 footer "View Full Report" link */
.top10-footer {
  padding: 10px 16px;
  border-top: 1px solid #f1f5f9;
  text-align: right;
}
.top10-footer-link {
  font-size: 12px;
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .2px;
}
.top10-footer-link:hover { color: #0f172a; text-decoration: underline; }

@media (max-width: 1023px) {
  .landing-top10-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .landing-top10-header { flex-direction: column; align-items: flex-start; }
}

/* ---- Reference section ---- */
.ref-search-wrap {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.ref-search-input {
  width: 100%;
  height: 44px;
  font-size: 15px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 0 16px;
  outline: none;
}
.ref-search-input:focus { border-color: #475569; box-shadow: 0 0 0 3px rgba(71,85,105,.1); }
.ref-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}
.ref-cat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 20px 18px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow .15s, transform .15s;
  border-left: 4px solid #475569;
}
.ref-cat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); transform: translateY(-1px); text-decoration: none; }
.ref-cat-card-name { font-size: 14px; font-weight: 700; color: #0f172a; }
.ref-cat-card-desc { font-size: 12px; color: #64748b; line-height: 1.5; }
.ref-cat-card-meta { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.ref-module-pill {
  display: inline-flex; align-items: center; height: 20px; padding: 0 9px;
  border-radius: 10px; font-size: 10px; font-weight: 700; color: #fff;
  margin-right: 4px; white-space: nowrap; flex-shrink: 0;
}
/* Code cards (individual category pages) */
.ref-code-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.ref-code-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid #475569;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ref-code-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ref-code-val { font-size: 18px; font-weight: 800; color: #0f172a; font-family: monospace; }
.ref-code-name { font-size: 13px; font-weight: 600; color: #0f172a; }
.ref-code-description {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  margin: 6px 0 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ref-code-stats { font-size: 11px; color: #94a3b8; }
.ref-code-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ref-code-actions .btn { font-size: 11px; height: 28px; padding: 0 10px; }
/* All tables page */
.ref-all-group-header {
  font-size: 14px;
  font-weight: 600;
  padding: 6px 0 10px 12px;
  border-left: 4px solid #475569;
  margin-bottom: 0;
}
.ref-all-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ref-all-table th { background: #f8fafc; padding: 8px 12px; text-align: left; border-bottom: 2px solid var(--gray-200); font-weight: 600; font-size: 12px; color: #475569; text-transform: uppercase; letter-spacing: .4px; }
.ref-all-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.ref-all-row { cursor: pointer; transition: background .1s; }
.ref-all-row:hover td { background: #f0f9ff; }
@media (max-width: 1023px) {
  .ref-cat-grid { grid-template-columns: 1fr 1fr; }
  .ref-code-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .ref-cat-grid { grid-template-columns: 1fr; }
  .ref-code-grid { grid-template-columns: 1fr; }
}

/* PDF download button — facility profile header */
.pdf-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  color: #1a3a5c;
  border: 1.5px solid #1a3a5c;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.pdf-download-btn:hover {
  background: #1a3a5c;
  color: white;
}

.pdf-icon-btn {
    padding: 6px 8px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    position: relative;
}
/* CSS tooltip using data-tip (same pattern as nav icons) */
.pdf-icon-btn::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1f2937;
    color: #f9fafb;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 9999;
}
.pdf-icon-btn:hover::after {
    opacity: 1;
}

/* Download PDF icon — red at rest, inverts to white-on-red on hover */
#pdf-download-btn {
    color: #dc2626;
}
#pdf-download-btn:hover {
    color: #ffffff;
    background-color: #dc2626;
    border-color: #dc2626;
}

/* Portfolio + Download PDF — identical 36×36 square footprint */
.facility-header-right-actions .my-views-btn,
.facility-header-right-actions #pdf-download-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    font-size: 18px;
}

/* ===== AKA (Also Known As) button + popup (facility header) ===== */
/* Popup anchors to the right-actions container. */
.facility-header-right-actions { position: relative; }
.aka-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #1a3a5c;
    background: #f3f4f6;
    border: 1.4px solid #1a3a5c;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
}
.aka-btn:hover,
.aka-btn.aka-active { background: #e0e7ef; }
.aka-btn::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1f2937;
    color: #f9fafb;
    font-size: 11px;
    font-weight: 400;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 9999;
}
.aka-btn:hover::after { opacity: 1; }
.aka-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 1000;
    overflow: hidden;
}
.aka-popup-header {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #6b7280;
    padding: 10px 14px 8px;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
}
.aka-popup-body {
    max-height: 280px;
    overflow-y: auto;
    padding: 4px 0;
}
.aka-row { padding: 8px 14px; }
.aka-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}
.aka-meta { font-size: 11px; color: #6b7280; }
.aka-source { color: #1a3a5c; font-weight: 600; }
.aka-years { color: #6b7280; }
.aka-divider { height: 1px; background: #f3f4f6; margin: 0 14px; }
.aka-loading,
.aka-empty {
    padding: 12px 14px;
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

/* ---- Code Tooltips ---- */
.code-tip {
  cursor: help;
  border-bottom: 1px dashed var(--gray-400);
}
/* Rail-carrier badge — an INFERENCE from the transporter name (EPA records no
   transport mode). Amber pill; tooltip via the native title attribute. */
.rail-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  cursor: help;
}
.code-tip-popup {
  position: absolute;
  /* Above every modal/overlay in the app: manifest modal (10001),
     KC overlay (10000), Shepherd tour (10100), feedback modal (11000).
     Body-appended popup must out-stack the manifest modal or it paints
     behind it (the original waste-code/MMC tooltip bug). */
  z-index: 11100;
  background: #1f2937;
  color: #f9fafb;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  padding: 5px 10px;
  border-radius: 5px;
  max-width: 280px;
  pointer-events: none;
  white-space: normal;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Sortable column headers */
.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.sortable-th:hover { background: rgba(0,0,0,0.06); }
.sortable-th.active-sort { background: #eff6ff; color: #1a3a5c; }
.sort-icon { display: inline-block; margin-left: 4px; font-size: 10px; opacity: 0.4; }
.sort-icon.asc::after  { content: "▲"; opacity: 1; }
.sort-icon.desc::after { content: "▼"; opacity: 1; }
.sort-icon.none::after { content: "⇅"; }

/* Clickable manifest tracking numbers */
.mtn-link {
  font-family: monospace;
  font-size: 11px;
  color: var(--blue-600, #2563eb);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
.mtn-link:hover { color: var(--blue-800, #1e40af); }

/* ---- Info tooltip (ⓘ) ---- */
.info-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #dbe8f4;
  color: #1a3a5c;
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  cursor: help;
  margin-left: 5px;
  vertical-align: middle;
  border: none;
  padding: 0;
  position: relative;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}
/* Per-table download button (facility profile) — small circle, down-arrow icon.
   Opens the shared #modal-download popup; see macros/table_download.html. */
.table-dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eef4fa;
  color: #1a3a5c;
  border: 1px solid #d3e0ed;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease;
}
.table-dl-btn:hover,
.table-dl-btn:focus-visible {
  background: #1a3a5c;
  color: #fff;
  border-color: #1a3a5c;
  outline: none;
}
.table-dl-btn svg { display: block; }
.info-tip-popup {
  visibility: hidden;
  opacity: 0;
  position: fixed;
  background: #1a3a5c;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 6px;
  width: 280px;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.15s ease;
  font-weight: 400;
  white-space: normal;
  text-align: left;
  font-family: var(--font-sans, system-ui, sans-serif);
}
/* position set by JS; ::after arrows remain positioned relative to popup box */
.info-tip-above::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a3a5c;
}
.info-tip-below::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: #1a3a5c;
}
/* info-tip show/hide is JS-controlled (teleport pattern in tooltips.js). The 152
   inline .info-tip-popup spans are content sources only — never shown directly;
   content is copied into #info-tip-global, which lives in the body (root stacking
   context) so nothing can paint over it. */
.info-tip-popup:not(#info-tip-global) {
  display: none !important;
}
#info-tip-global {
  position: absolute;        /* absolute + scrollY in JS, so no scroll repaint */
  z-index: 2147483647;       /* max int — always on top */
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.12s ease;
}

/* ── Chart toggle pills (em2 sub-tabs) ──────────────────────────── */
.chart-toggle-pills { display: flex; gap: 4px; }
.chart-pill {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--gray-700);
  cursor: pointer;
  line-height: 1.4;
  font-weight: 500;
}
.chart-pill:hover:not(:disabled) { background: #f1f5f9; }
.chart-pill.active {
  background: #065f46;
  border-color: #065f46;
  color: #fff;
}
.chart-pill:disabled { opacity: .45; cursor: not-allowed; }

/* ── Skeleton shimmer for chart loading placeholders ─────────────── */
@keyframes skeleton-shimmer {
  0%   { background-position: -468px 0; }
  100% { background-position:  468px 0; }
}
.chart-skeleton {
  position: relative;
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 936px 100%;
  animation: skeleton-shimmer 1.4s linear infinite;
  border-radius: 6px;
}

/* ── Search simple/advanced mode ────── */
.fs-mode-pill{display:flex;background:var(--card-bg,#f3f4f6);border:1px solid var(--border-color,#e5e7eb);border-radius:99px;padding:2px}
.fs-mode-btn{font-size:12px;font-weight:500;padding:5px 18px;border-radius:99px;border:none;cursor:pointer;background:none;color:#6b7280;transition:background .15s,color .15s;white-space:nowrap}
#fs-btn-simple.fs-on{background:#4e6b3c;color:#fff;border-color:#4e6b3c;font-weight:600}
#fs-btn-adv.fs-on{background:#2B6098;color:#fff;border-color:#2B6098;font-weight:600}
.fs-adv-badge{font-size:11px;color:#6b7280;margin-left:10px}
.fs-adv-hint{font-size:11px;color:#6b7280;margin-top:3px}
/* fs-adv-only / fs-simple-only use each element's natural display
   (.field=flex, grids=grid via inline style) — only the opposite mode hides them */
.fs-mode-simple .fs-adv-only{display:none!important}
.fs-mode-adv .fs-simple-only{display:none!important}
#fs-fp-body.fs-mode-simple,
#fs-fp-body.fs-mode-simple .filter-bar{background:#c1ddbf;border-radius:6px;padding:4px}
#fs-fp-body.fs-mode-adv,
#fs-fp-body.fs-mode-adv .filter-bar{background:#b5c8db;border-radius:6px;padding:4px}
/* Site Status right-align in Simple */
#fs-fp-body.fs-mode-simple #fs-col5{
  margin-left:auto}

/* expanders removed — hide arrows */
.filter-toggle-icon{display:none}

/* ---- Auth nav user display (Tell Auth-Beta) ---- */
.nav-user { display:inline-flex; align-items:center; gap:8px; }
.nav-user-tier { font-size:11px; padding:2px 6px; border-radius:10px; font-weight:600; }
/* Dashboard tier system — Gold / Platinum / Sapphire / Diamond / Enterprise.
   Palette REDESIGNED 2026-07-28 (Ron-directed) — MUST match
   tier_config.TIER_PRICING (bg=color_lt, color=color_dk except Gold, which
   darkens color further for AA — see tier_config.py comments for the full
   per-tier rationale). The nav pill also inline-overrides these from
   TIER_PRICING, so these are a fallback for any bare .tier-* use — keep in
   sync by hand; see CLAUDE.md §Tier Colors. */
.tier-gold     { background:#F6D76B; color:#6B4F0F; border:1px solid #8A6814; }  /* text darkened for AA (5.40:1); border=color_dk */
.tier-platinum { background:#E5E4E2; color:#3E464D; border:1px solid #3E464D; }
.tier-sapphire { background:#A8C4F5; color:#082A63; border:1px solid #082A63; }
.tier-diamond  { background:#EAFAFE; color:#3C5560; border:1px solid #3C5560; }  /* ice-blue, NOT deep red */
/* ⚠️ Dashboard Enterprise deliberately does NOT get a bare `.tier-enterprise`
   rule — that class name is already taken below by the UNRELATED billing/API
   tier vocabulary (see CLAUDE.md §"TWO TIER VOCABULARIES"). Reusing it here
   would silently render the dashboard's teal Enterprise chip in the API
   vocabulary's amber (#92400e/#fffbeb) the moment anything referenced a bare
   `.tier-enterprise` class — exactly the vocabulary-collision bug class the
   app has a standing rule against. Namespaced instead: */
.tier-dash-enterprise { background:#CFEFEE; color:#0F3D3D; border:1px solid #0F3D3D; }
/* Legacy tier classes (BILLING/API vocabulary: starter/pro/enterprise/diamond
   — see CLAUDE.md "TWO TIER VOCABULARIES") — retained for any unmigrated rows.
   `.tier-enterprise` here is the API `enterprise` plan, NOT the dashboard
   Enterprise tier above. */
.tier-basic { color:#64748b; background:#f1f5f9; }
.tier-professional { color:#065f46; background:#ecfdf5; }
.tier-enterprise { color:#92400e; background:#fffbeb; }
.tier-paid { background:#065f46; color:white; }
.tier-admin { background:#991b1b; color:white; }
/* Tier icon glyphs (macros/tier_icon.html) — the first SVG icon asset for
   tiers; previously a tier was only ever represented by an emoji `badge`
   string. Sits inline next to text (nav dropdown tier line, /account/upgrade
   card badge, current-plan pill), so give it sane inline-flow defaults. */
.tier-icon { vertical-align: middle; flex-shrink: 0; }
/* ── User pill ── */
.nav-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.nav-user-pill:hover,
.nav-user-dd:hover .nav-user-pill,
.nav-user-pill.dd-open {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.35);
}
.nav-user-firstname {
  color: #e2e8f0;
}
.nav-user-chevron {
  opacity: 0.6;
  margin-left: 2px;
  transition: transform 0.15s;
}
.nav-user-pill.dd-open .nav-user-chevron {
  transform: rotate(180deg);
}

/* ── Account dropdown: identity + tier block ──
   Tier moved out of the nav trigger (now identity-only) into a dedicated block
   at the top of the dropdown. A SOFT tint of the tier's brand -lt color sits
   behind ONLY this block (email + tier line); the rest of the menu stays on the
   normal panel surface for readability. Tier CSS vars (--tier-lt/--tier-dk) are
   set inline per user; the tint uses color-mix so no per-tier precompute is
   needed. Tier-name text uses the brand -dk color (inline) — AA-verified on the
   tint for all four tiers (worst case gold ≈ 4.7:1). */
.nav-user-idblock {
  background: color-mix(in srgb, var(--tier-lt, #cbd5e1) 26%, #fff);
  margin: -4px 0 4px;                 /* cover the panel's 4px top padding */
  padding-bottom: 7px;
  border-radius: 6px 6px 0 0;         /* match the panel's top corners */
  border-bottom: 1px solid color-mix(in srgb, var(--tier-dk, #9ca3af) 22%, transparent);
}
.nav-user-idblock .nav-user-email { padding-top: 9px; }
.nav-user-tierline {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 20px 0;
}
.nav-user-tierbadge { font-size: 13px; line-height: 1; }
.nav-user-tiername { font-size: 12.5px; font-weight: 700; letter-spacing: .01em; }
.nav-user-manageplan {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #1a3a5c;
  text-decoration: none;
  white-space: nowrap;
}
.nav-user-manageplan:hover { text-decoration: underline; }

/* ── Sign In pill ── */
.nav-signin-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  background: #1a3a5c;
  border: 1px solid rgba(245,158,11,0.4);
  border-radius: 20px;
  color: #f59e0b !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.nav-signin-pill:hover {
  background: #162f4a;
  border-color: rgba(245,158,11,0.7);
  text-decoration: none !important;
}

/* ── User dropdown extras ── */
.nav-dd-divider {
  height: 1px;
  background: rgba(26,58,92,0.12);
  margin: 4px 0;
}
.nav-zoom-section {
  padding: 2px 0;
}
.nav-zoom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 20px 8px;
}
.nav-zoom-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(26,58,92,0.25);
  background: #fff;
  color: #1a3a5c;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}
.nav-zoom-btn:hover {
  background: #dbeafe;
}
#nav-zoom-val {
  font-size: 12px;
  font-weight: 600;
  color: #1a3a5c;
  min-width: 36px;
  text-align: center;
  font-family: sans-serif;
}
.nav-dd-signout {
  display: block;
  width: 100%;
  padding: 8px 20px;
  text-align: left;
  background: none;
  border: none;
  font-size: 13px;
  color: #dc2626;
  cursor: pointer;
  font-family: sans-serif;
  font-weight: 500;
}
.nav-dd-signout:hover {
  background: #fef2f2;
}
.nav-icon-btn {
    font-size: 1.4rem;
    line-height: 1;
    text-decoration: none;
    padding: 0 6px;
    opacity: 0.85;
    transition: opacity 0.15s, filter 0.15s;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    /* Flat, transparent icon — reset the default <button> chrome so button
       and anchor nav icons render identically (no box/border/shadow). */
    background: none;
    border: none;
    box-shadow: none;
}

/* Right-align a nav dropdown menu (for the far-right icon trigger). */
.nav-dropdown-menu.dd-align-right {
  left: auto;
  right: 0;
}
/* PR icon sits inside a .nav-dropdown wrapper, which breaks the usual nav
   button color inheritance — restore the transparent bg + amber explicitly. */
#nav-pr-trigger {
  background: transparent !important;
  border: none !important;
  color: rgb(245, 158, 11) !important;
}
.nav-icon-btn:hover {
    opacity: 1 !important;
    text-decoration: none;
    filter: brightness(1.3) drop-shadow(rgba(245,158,11,0.533) 0px 0px 4px);
}
.nav-icon-btn::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #f9fafb;
    font-size: 11px;
    font-family: Arial, sans-serif;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 9999;
}
.nav-icon-btn:hover::after {
    opacity: 1;
}
/* Multi-line tooltip modifier — opt-in per button (e.g. the inactive My Views
   tip). pre-line preserves intentional \n while collapsing space runs. */
.nav-icon-btn.nav-tip-multiline::after {
    white-space: pre-line;
    text-align: center;
    min-width: 120px;
}
/* KC trigger tooltip — a real child <span> bubble (not a ::after pseudo) so the
   emoji and text can be sized independently. The trigger is a fixed bottom-right
   FAB, so the bubble opens ABOVE (arrow down) and is right-anchored to avoid
   overflowing off the right edge of the screen. */
.kc-tip-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #1f2937;
    border-radius: 6px;
    padding: 6px 12px 8px;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
/* Arrow pointing down to the button */
.kc-tip-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 15px;
    border: 5px solid transparent;
    border-top-color: #1f2937;
}
.kc-tip-icon {
    display: block;
    font-size: 24px;
    line-height: 1.2;
}
.kc-tip-text {
    display: block;
    font-size: 12px;
    color: #f9fafb;
    line-height: 1.4;
    font-family: Arial, sans-serif;
}
/* Show on hover */
.kc-trigger-btn:hover .kc-tip-bubble {
    opacity: 1;
}
/* My Views nav icon — sized to match the other nav icons, fixed amber color */
.my-views-nav-btn {
    font-size: 1.4rem;
}
.my-views-nav-btn svg {
    width: 1.4rem;
    height: 1.4rem;
}
#my-views-nav-btn {
    color: #f59e0b;
}
#my-views-nav-btn:hover {
    color: #fbbf24;
    opacity: 1;
}

/* ---- Cohort fallback link (Tell 24 — popup resilience) ---- */
.cohort-fallback-link {
    font-size: 11px;
    color: #94a3b8;
    text-decoration: none;
    margin-left: 6px;
    white-space: nowrap;
}
.cohort-fallback-link:hover {
    color: #64748b;
    text-decoration: underline;
}

/* ===== My Views / Portfolio icon-toggle buttons ===== */
.my-views-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, border-color 0.15s;
    position: relative;
}
.facility-header-right-actions .portfolio-toggle-btn {
    border-color: #1a3a5c;
}
.facility-header-right-actions .portfolio-toggle-btn.in-portfolio {
    border-color: #1a3a5c;
}
.facility-header-right-actions .portfolio-toggle-btn:not(.in-portfolio) {
    background: #f3f4f6;
}
.my-views-btn:hover {
    border-color: #9ca3af;
    color: #374151;
}
.my-views-btn.active,
.my-views-btn[data-active="true"] {
    color: #16a34a;
    border-color: #16a34a;
}
.portfolio-toggle-btn.in-portfolio {
    background: #16a34a;
    color: #ffffff;
    border-color: #1a3a5c;
}
.my-views-btn::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #f9fafb;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 9999;
}
.my-views-btn:hover::after {
    opacity: 1;
}

.profile-setup-overlay {
  position:fixed; inset:0; background:rgba(15,23,42,.35); z-index:1000;
}
.profile-setup-panel, .profile-config-panel {
  position:fixed; top:0; right:0; height:100vh; width:380px; max-width:92vw;
  background:#fff; box-shadow:-4px 0 24px rgba(15,23,42,.18); z-index:1001;
  display:flex; flex-direction:column; overflow-y:auto;
  animation:pspSlideIn .22s ease-out;
}
/* Start the My Views panel just below the 64px sticky nav so the nav
   (z-index:1100) no longer clips the panel header. */
#profile-config-panel {
  top: 64px;
  height: calc(100vh - 64px);
}
@keyframes pspSlideIn { from { transform:translateX(100%); } to { transform:translateX(0); } }
.psp-header, .pcp-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 18px; border-bottom:1px solid #e2e8f0; font-size:16px; font-weight:600; color:#1a3a5c;
  position:sticky; top:0; background:#fff;
}
.pcp-header span {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #1f2937;
}
.psp-close { background:none; border:none; font-size:18px; color:#94a3b8; cursor:pointer; line-height:1; padding:0 4px; }
.psp-close:hover { color:#475569; }
.psp-desc { padding:14px 18px 4px; font-size:13px; color:#64748b; line-height:1.5; margin:0; }
.psp-roles { padding:8px 18px 18px; display:flex; flex-direction:column; gap:8px; }
.psp-role-btn {
  display:grid; grid-template-columns:32px 1fr; grid-template-rows:auto auto; column-gap:10px;
  align-items:center; text-align:left; width:100%; border:1px solid #e2e8f0; border-radius:8px;
  background:#fff; padding:10px 12px; cursor:pointer;
}
.psp-role-btn:hover { background:#f8fafc; border-color:#cbd5e1; }
.psp-role-icon { grid-row:1/3; font-size:22px; text-align:center; }
.psp-role-label { font-size:14px; font-weight:600; color:#1f2937; }
.psp-role-desc { font-size:11.5px; color:#64748b; line-height:1.4; }

.pcp-section { padding:14px 18px; border-bottom:1px solid #f1f5f9; }
.pcp-section-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:#94a3b8; margin-bottom:8px; }
.pcp-section select { width:100%; padding:7px 9px; border:1px solid #cbd5e1; border-radius:6px; font-size:13px; }
.pcp-tabs-list { display:flex; flex-direction:column; }
.pcp-tab-row { display:flex; align-items:center; gap:8px; padding:6px 0; }
.pcp-tab-toggle { display:flex; align-items:center; gap:8px; flex:1; cursor:pointer; font-size:13px; }
.pcp-tab-toggle input { cursor:pointer; }
.pcp-tab-label { color:#1f2937; }
.pcp-tab-roles { display:inline-flex; gap:2px; }
.pcp-role-pill { font-size:12px; opacity:.7; }
.pcp-info-btn { background:none; border:none; color:#94a3b8; cursor:pointer; font-size:13px; padding:0 4px; }
.pcp-info-btn:hover { color:#1a3a5c; }
.pcp-tab-info { font-size:11.5px; color:#64748b; line-height:1.5; padding:2px 0 8px 24px; }
.pcp-footer { padding:14px 18px; display:flex; gap:8px; flex-wrap:wrap; margin-top:auto; border-top:1px solid #e2e8f0; }
.pcp-footer .btn-secondary {
  flex:1; min-width:130px; background:#f1f5f9; color:#334155; border:1px solid #e2e8f0;
  border-radius:6px; padding:8px 10px; font-size:12.5px; cursor:pointer; font-family:inherit;
}
.pcp-footer .btn-secondary:hover { background:#e2e8f0; }

/* ===== My Views: pill toggle (My Role / Custom) + role cards ===== */
.myviews-pill-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.myviews-pill {
    flex: 1;
    padding: 7px 14px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.01em;
}
.myviews-pill:first-child {
    border-right: 1px solid #e5e7eb;
}
#myviews-pill-role.active {
    background: #0284c7;
    color: #ffffff;
}
#myviews-pill-custom.active {
    background: #d97706;
    color: #ffffff;
}
.myviews-pill:hover:not(.active) {
    background: #f3f4f6;
    color: #374151;
}
.myviews-role-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}
.myviews-role-card:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}
.myviews-role-card.selected {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.myviews-role-icon {
    font-size: 1.2rem;
    line-height: 1.3;
    flex-shrink: 0;
}
.myviews-role-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}
.myviews-role-desc {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
    line-height: 1.4;
}

.show-more-tabs-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 11px;
  cursor: pointer;
  padding: 3px 8px;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.8;
  font-weight: 500;
}
.show-more-tabs-btn:hover {
  opacity: 1;
  color: #1d4ed8;
}

/* ===== Cohort-Connect: facility cohort banner + peer→cohort callout ===== */
.facility-cohort-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: #eff6ff; border: 1px solid #bfdbfe;
  border-left: 4px solid #1e40af; border-radius: 6px; margin: 8px 0; font-size: 13px;
}
.fcb-icon { font-size: 16px; }
.fcb-text { color: #1e3a8a; flex: 1; }
.fcb-link { color: #1e40af; font-weight: 600; text-decoration: none; }
.fcb-link:hover { text-decoration: underline; }
.fcb-actions { white-space: nowrap; }
.fcb-manage { color: #64748b; font-size: 12px; text-decoration: none; }
.fcb-manage:hover { text-decoration: underline; }

.peer-to-cohort-callout {
  margin-top: 24px; padding: 14px 16px; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 8px;
}
.ptc-header { font-weight: 600; color: #1e3a8a; margin-bottom: 6px; font-size: 14px; }
.ptc-body { color: #475569; font-size: 13px; margin: 0 0 10px 0; line-height: 1.5; }
.ptc-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ptc-actions .btn-secondary {
  background: #1a3a5c; color: #fff; border: 0; border-radius: 6px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.ptc-actions .btn-secondary:hover { background: #15314f; }
.ptc-hint { font-size: 12px; color: #94a3b8; }

/* ===== Facility Portfolio cards (cohort_manage.html) ===== */
.fp-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
    transition: box-shadow 0.15s;
}
.fp-card:hover, .fp-card.fp-card-open {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.fp-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    gap: 12px;
}
.fp-card-left { flex: 1; min-width: 0; }
.fp-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a3a5c;
    margin-bottom: 3px;
}
.fp-card-name a { color: inherit; text-decoration: none; }
.fp-card-name a:hover { text-decoration: underline; }
.fp-card-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}
.fp-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
/* Scope the portfolio-card badge look to avoid clobbering the global .badge */
.fp-card-badges .badge {
    text-transform: none;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0;
}
.fp-card-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.fp-expand-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    transition: color 0.15s;
}
.fp-expand-btn:hover { color: #1a3a5c; }
.fp-remove-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.fp-remove-btn:hover {
    color: #dc2626;
    background: #fef2f2;
}
.fp-card-body {
    padding: 0 16px 16px;
    border-top: 1px solid #f3f4f6;
}
.fp-card-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 0;
}
.fp-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.fp-detail-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #9ca3af;
    text-transform: uppercase;
}
.fp-detail-value {
    font-size: 13px;
    color: #374151;
}
.fp-card-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}
.badge-active   { background: #dcfce7; color: #166534; }
.badge-inactive { background: #f3f4f6; color: #6b7280; }
.badge-tsd      { background: #dbeafe; color: #1e40af; }
.badge-gen      { background: #f3f4f6; color: #374151; }
.badge-risk-red    { background: #fee2e2; color: #991b1b; }
.badge-risk-yellow { background: #fef9c3; color: #854d0e; }
.badge-risk-green  { background: #dcfce7; color: #166534; }
.portfolio-page-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.portfolio-empty {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}
.portfolio-footer {
    margin-top: 20px;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
}
.section-label {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.count-badge {
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}
.btn-primary-sm {
    display: inline-block;
    padding: 5px 12px;
    background: #1a3a5c;
    color: #fff;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}
.btn-primary-sm:hover { background: #162f4a; }

/* ===== Facility Portfolio: select-to-compare (cohort_manage.html) ===== */
.fp-compare-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #1a3a5c;
  margin-right: 4px;
  align-self: center;
}
.fp-compare-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  margin-bottom: 12px;
}
.fp-compare-count {
  font-size: 13px;
  font-weight: 600;
  color: #1e40af;
}
.fp-compare-warn {
  font-size: 12px;
  color: #dc2626;
}
.fp-compare-btn {
  margin-left: auto;
  padding: 5px 14px;
  background: #1a3a5c;
  color: #fff;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.fp-compare-btn:hover { background: #162f4a; }
.fp-role-btns { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.fp-role-btn {
  padding: 5px 14px;
  background: #1a3a5c;
  color: #fff;
  border: 0;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.fp-role-btn:hover:not(:disabled) { background: #162f4a; }
.fp-role-btn:disabled { background: #cbd5e1; color: #64748b; cursor: not-allowed; }

/* ===== Facility Portfolio search bar (cohort_manage.html) ===== */
.portfolio-search-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}
.ps-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    text-transform: none;
    letter-spacing: 0;
}
.ps-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.ps-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1f2937;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}
.ps-input:focus { border-color: #1a3a5c; }
.ps-clear-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 4px;
}
.ps-clear-btn:hover { color: #374151; }
.ps-results-list {
    margin-top: 10px;
    border-top: 1px solid #e5e7eb;
    padding-top: 8px;
}
.ps-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
}
.ps-result:last-child { border-bottom: none; }
.ps-result-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}
.ps-result-meta {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}
.ps-add-btn {
    padding: 4px 12px;
    background: #1a3a5c;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.ps-add-btn:hover { background: #162f4a; }
.ps-add-btn:disabled {
    background: #9ca3af;
    cursor: default;
}
.ps-already {
    font-size: 12px;
    color: #16a34a;
    font-weight: 500;
    white-space: nowrap;
}
.ps-no-results {
    font-size: 13px;
    color: #9ca3af;
    padding: 10px 4px;
    margin: 0;
}

/* ═══ Solvent Recycling Report ══════════ */
.sr-page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* Parameter bar */
.sr-params-bar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 0;
  margin-bottom: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sr-params-bar form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sr-params-label {
  font-size: 13px;
  font-weight: 700;
  color: #1a3a5c;
  letter-spacing: 0.04em;
  margin-left: 12px;
  margin-right: 6px;
}
.sr-param-group {
  display: flex;
  align-items: center;
  gap: 5px;
}
.sr-param-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sr-select {
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}
.sr-range-arrow {
  color: #9ca3af;
  font-size: 18px;
  padding: 0 4px;
}
.sr-run-btn {
  padding: 5px 16px;
  background: #1a3a5c;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.sr-run-btn:hover {
  background: #162f4a;
}
.sr-pdf-btn {
  padding: 5px 14px;
  background: #166534;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 8px;
  transition: background 0.15s;
}
.sr-pdf-btn:hover {
  background: #14532d;
}
.sr-pdf-btn:disabled {
  background: #6b7280;
  cursor: not-allowed;
}
.sr-spinner {
  display: none;
  font-size: 16px;
}
.sr-spinner.htmx-request {
  display: inline;
}

/* Report body */
.sr-report {
  font-family: Georgia, 'Times New Roman', serif;
  color: #111827;
  line-height: 1.65;
}
.sr-title-block {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e5e7eb;
}
.sr-title-primary {
  font-size: 24px;
  font-weight: 700;
  color: #1a2744;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.3;
}
.sr-partial-warn {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  padding: 4px 12px;
  border-radius: 4px;
  font-family: sans-serif;
}
.sr-intro {
  font-size: 14.5px;
  margin-bottom: 24px;
  max-width: 860px;
}

/* Figure / table captions */
.sr-fig-caption,
.sr-tbl-caption {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  margin: 32px 0 2px;
  font-family: sans-serif;
}
.sr-tbl-title {
  text-align: center;
  font-size: 12px;
  color: #4b5563;
  margin-bottom: 8px;
  font-family: sans-serif;
}

/* Charts */
.sr-chart-box {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px;
  background: #fff;
  height: 340px;
  position: relative;
  margin-bottom: 20px;
}
.sr-chart-pie {
  height: 600px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto 20px;
  overflow: visible;
  position: relative;
  background: transparent;
  padding: 0;
  border: none;
}

/* Tables */
.sr-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  font-family: sans-serif;
  margin-bottom: 20px;
}
.sr-tbl th {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  padding: 5px 9px;
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sr-tbl td {
  border: 1px solid #e5e7eb;
  padding: 4px 9px;
}
.sr-tbl tr:nth-child(even) td {
  background: #f9fafb;
}
.sr-tbl tr:hover td {
  background: #eff6ff;
}
.sr-r { text-align: right; }
.sr-nm {
  max-width: 380px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-fac-id {
  font-size: 10px;
  color: #6b7280;
  font-weight: 400;
  white-space: nowrap;
  margin-left: 4px;
  font-family: monospace;
}
.sr-neg { color: #dc2626; font-weight: 600; }
.sr-pos { color: #166534; font-weight: 600; }
.sr-state {
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.05em;
}
.sr-qh {
  font-size: 9.5px;
  white-space: nowrap;
  min-width: 58px;
}
.sr-tbl-scroll {
  overflow-x: auto;
  margin-bottom: 20px;
}
.sr-tbl-wide {
  min-width: max-content;
}

/* Analytical Observations */
.sr-obs-wrap {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 2px solid #1a3a5c;
}
.sr-obs-hdr {
  font-size: 17px;
  font-weight: 700;
  color: #1a3a5c;
  font-family: sans-serif;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sr-ai-badge {
  font-size: 10px;
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-family: sans-serif;
}
.sr-obs-body p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 14px;
}
.sr-obs-wait {
  font-size: 13px;
  color: #9ca3af;
  font-style: italic;
  font-family: sans-serif;
}
.sr-obs-err {
  color: #dc2626;
  font-size: 13px;
  font-family: sans-serif;
}

/* Section commentary */
.sr-commentary {
  margin: 12px 0 28px;
  font-size: 14px;
  line-height: 1.7;
  color: #1f2937;
}
.sr-commentary p {
  margin-bottom: 10px;
}
.sr-commentary p:last-child {
  margin-bottom: 0;
}

/* Data-quality footnote in the premium report footer */
.sr-footnote {
  margin: 32px 0 8px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  font-size: 11px;
  line-height: 1.6;
  color: #6b7280;
}

/* Quantity mode toggle */
.sr-qty-toggle {
  display: flex;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  overflow: hidden;
}
.sr-qty-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  background: #fff;
  border: none;
  border-right: 1px solid #d1d5db;
  cursor: pointer;
  color: #374151;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.sr-qty-btn:last-child {
  border-right: none;
}
.sr-qty-btn:hover {
  background: #f3f4f6;
}
.sr-qty-active {
  background: #1a3a5c !important;
  color: #fff !important;
}
.sr-qty-note {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: sans-serif;
}

/* Choropleth maps */
.sr-map-caption {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  margin: 32px 0 2px;
  font-family: sans-serif;
}
.sr-map-subtitle {
  text-align: center;
  font-size: 12px;
  color: #4b5563;
  margin-bottom: 8px;
  font-family: sans-serif;
}
.sr-map-box {
  height: 480px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 12px;
  position: relative;
}
.sr-state-label {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-size: 9px;
  font-weight: 700;
  color: #1e3a5f;
  white-space: nowrap;
  padding: 0 !important;
  text-align: center;
}
.sr-state-label::before {
  display: none !important;
}
.sr-map-legend {
  background: rgba(255,255,255,0.92);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-family: sans-serif;
  line-height: 1.8;
  border: 1px solid #e5e7eb;
}

/* ── LQG volume sub-tier filter buttons (Facility Search) ── */
.fs-vol-btn {
  padding: 4px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.12s;
}
.fs-vol-btn:hover { border-color: #94a3b8; background: #f8fafc; }
.fs-vol-btn.active { background: #1a2744; color: #fff; border-color: #1a2744; }
.vol-badge { font-size: 10px; opacity: 0.75; font-weight: 400; }
.fs-vol-btn.active .vol-badge { opacity: 0.85; }
.fs-vol-btn[data-vol="major"].active { background: #b45309; border-color: #b45309; }
.fs-vol-btn[data-vol="industrial"].active { background: #7c2d12; border-color: #7c2d12; }

/* ── Tier search counter (Gold tier nav badge) + search wall ── */
.search-counter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: default;
  transition: background 0.3s, color 0.3s;
}
.search-counter--green {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.search-counter--yellow {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.search-counter--red {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.search-wall {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-wall__inner {
  background: white;
  border-radius: 12px;
  padding: 40px;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.search-wall__icon { font-size: 48px; margin-bottom: 16px; }
.search-wall__reset { color: #6b7280; font-size: 14px; }
.search-wall__actions { margin-top: 24px; }
.search-wall__or {
  margin-top: 12px;
  font-size: 12px;
  color: #9ca3af;
}

/* ── Tier-locked tab + nav items ── */
.tab-btn--locked {
  opacity: 0.5;
  cursor: not-allowed;
  color: #9ca3af !important;
}
.tab-btn--locked:hover {
  background: transparent !important;
}
.nav-link--locked {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Portfolio toggle (☆/⭐) in the search-result Details-panel footer */
.result-card-portfolio-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.15s;
  white-space: nowrap;
}
.result-card-portfolio-btn:hover {
  border-color: #6b7280;
  color: #374151;
  background: #f9fafb;
}
.result-card-portfolio-btn.in-portfolio {
  background: #f0fdf4;
  border-color: #86efac;
  color: #16a34a;
  font-weight: 600;
}
/* In-portfolio button turns red on hover + swaps to a remove hint. */
.result-card-portfolio-btn.in-portfolio:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  font-size: 0;   /* collapse the button's own "⭐ In Portfolio" text on hover */
  gap: 0;
}
/* Show the replacement label via ::before at a normal, readable size */
.result-card-portfolio-btn.in-portfolio:hover::before {
  content: '🗑 Remove from Portfolio';
  font-size: 12px;
  font-weight: 500;
}

/* ── Tier-gated links (macros/tier_gate.html `gate()`) ──────────────────────
   A link to a feature the user's plan does not include renders dimmed with a
   lock, so entitlement is visible BEFORE the click instead of arriving as a 403.
   Applied via [data-locked] so it works on any anchor regardless of the classes
   or child markup it already carries. */
a[data-locked] {
  opacity: 0.55;
  cursor: pointer;               /* it IS clickable — it opens the upgrade modal */
  text-decoration: none;
}
a[data-locked]::after {
  content: " 🔒";
  font-size: 0.9em;
  opacity: 0.85;
  white-space: nowrap;
}
a[data-locked]:hover { opacity: 0.75; }

/* ---- /account/upgrade — 5-across tier ladder (2026-08-27) ----
   Matches the marketing /plans page, which shows all five tiers in one row.
   The previous inline repeat(auto-fit,minmax(220px,1fr)) wrapped Enterprise to
   its own row below ~1180px, i.e. on most laptops, so the ladder read as
   "4 tiers + a straggler".

   Explicit steps rather than auto-fit, so the wrap points are chosen, not
   emergent: 5 across on desktop -> 3 on tablet/small laptop (5 would be ~150px
   each, too narrow for the price + tagline) -> 1 on phones.
   The .card padding is trimmed at 5-across so five fit without the text
   cramping against the edges. */
.upgrade-tier-grid > .card { padding: 16px 14px; }
@media (max-width: 1180px) {
  .upgrade-tier-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
/* 2e: one column below ~900px (was 760) — the cards keep the same internal
   order (head, price, tagline, features, button). */
@media (max-width: 900px) {
  .upgrade-tier-grid { grid-template-columns: 1fr !important; }
}
/* The illustrated tier badge (macros/tier_icon.html :: tier_icon_art). */
.tier-icon-art { max-width: 100%; }


/* ── Guide Me: panel-level framing note (2026-08-28) ──────────────────────────
   Shown only when the viewer can reach <=1 step in a persona. Amber, matching
   the app's established DISCLOSURE token (.cap-note, the "how to read this"
   banners) rather than a red error tone — this is information, not a failure. */
.guide-framing-note {
  font-size: 12.5px; line-height: 1.55; color: #78350f;
  background: #fffbeb; border: 1px solid #fde68a; border-left: 3px solid #f59e0b;
  border-radius: 8px; padding: 9px 12px; margin: 0 0 12px;
}
.guide-framing-lead { font-weight: 700; color: #92400e; }
.guide-framing-link { color: #92400e; font-weight: 700; text-decoration: underline; white-space: nowrap; }

/* ── Auth pages: login / register / forgot-password / reset-password ────────
   Brand-matched to the app's default "forest" theme and the marketing site's
   chartreuse CTA convention.

   ⚠️ THE HEX VALUES ARE LITERAL HERE ON PURPOSE. These four templates do NOT
   extend base.html, which is where the `html[data-theme="..."]` rules live, so
   they never receive a data-theme attribute and CANNOT resolve var(--navy) to
   the forest value — a bare :root would give them the navy baseline (#1a2744)
   instead. Sourced, not eyeballed:
     --auth-green #064e3b — base.html html[data-theme="forest"] --navy; verified
                            as the live dashboard nav background rgb(6,78,59).
     --auth-lime  #b9d142 — the marketing site's own --lime token; verified as
                            the rendered "See what it does" CTA rgb(185,209,66).
     --auth-ink   #14241d — the marketing CTA's own text colour rgb(20,36,29).
                            Dark ink on chartreuse, never white: white on
                            #b9d142 is 1.7:1 and fails AA outright.
   If the brand moves, change these four values, not the templates. */
.auth-wrap {
  --auth-green:#064e3b; --auth-green-dk:#03372a; --auth-lime:#b9d142;
  --auth-lime-dk:#a8c134; --auth-ink:#14241d;
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  padding:24px; box-sizing:border-box;
  background:var(--auth-green);
  background-image:linear-gradient(160deg, #075c45 0%, #064e3b 55%, #03372a 100%);
}
.auth-brand { text-align:center; margin-bottom:18px; }
/* Same lockup as the menu bar (nav .brand): artwork at 48px (never below 40px)
   + live two-tone wordmark. Kept as its own rule so the nav rule stays untouched. */
.auth-brand .auth-lockup { display:inline-flex; align-items:center; }
.auth-brand img { height:48px; width:auto; display:block; flex:none; }
.auth-brand .brand-wordmark {
  color: #fff;
  font-family: 'Nunito Wordmark', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1;
  margin-left: 10px;
  white-space: nowrap;
}
/* The card stays white: form controls keep their normal, already-accessible
   contrast, and the dark green reads as the frame rather than the field. */
.auth-card { background:#fff; max-width:400px; width:100%; border:1px solid rgba(255,255,255,.14);
  border-radius:12px; padding:30px 28px; box-shadow:0 18px 44px rgba(0,0,0,.28); }
.auth-logo { font-size:22px; font-weight:700; color:var(--auth-green); text-align:center;
  margin-bottom:6px; letter-spacing:.5px; }
.auth-h { font-size:16px; font-weight:600; color:#334155; text-align:center; margin:0 0 20px; }
.auth-label { display:block; font-size:12px; font-weight:600; color:#374151; margin:14px 0 4px; }
.auth-input { width:100%; padding:9px 10px; border:1px solid #cbd5e1; border-radius:6px;
  font-size:14px; box-sizing:border-box; }
.auth-input:focus { outline:none; border-color:var(--auth-green);
  box-shadow:0 0 0 3px rgba(6,78,59,.18); }
.auth-btn { width:100%; margin-top:20px; background:var(--auth-lime); color:var(--auth-ink);
  border:0; border-radius:6px; padding:11px; font-size:14px; font-weight:700;
  letter-spacing:.2px; cursor:pointer; }
.auth-btn:hover { background:var(--auth-lime-dk); }
/* Keyboard focus must stay visible on a light button against a dark page. */
.auth-btn:focus-visible { outline:3px solid #fff; outline-offset:2px; }
.auth-err { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; border-radius:6px;
  padding:9px 12px; font-size:13px; margin-bottom:4px; }
.auth-foot { text-align:center; font-size:12px; color:#64748b; margin-top:18px; }
.auth-foot a { color:var(--auth-green); text-decoration:none; font-weight:600; }
.auth-foot a:hover { text-decoration:underline; }
/* Invite code ONLY (register page). An <input type="text"> cannot wrap its
   contents onto a second row under any CSS — that is an element-level browser
   constraint, not a missing style — so the field is a <textarea>. Scoped to its
   own class so .auth-input (shared by the other 4 fields) is provably
   untouched.
   ⚠️ word-break:break-all is required IN ADDITION to overflow-wrap: an invite
   code is one unbroken secrets.token_urlsafe(32) token (~43 chars, no spaces or
   hyphens), so there is no break opportunity for overflow-wrap to use. */
.auth-textarea { width:100%; padding:9px 10px; border:1px solid #cbd5e1; border-radius:6px;
  font-size:14px; box-sizing:border-box; font-family:inherit; resize:none;
  word-break:break-all; overflow-wrap:anywhere; }
.auth-textarea:focus { outline:none; border-color:var(--auth-green,#064e3b);
  box-shadow:0 0 0 3px rgba(6,78,59,.18); }
.auth-hint { font-size:11px; color:#64748b; margin-top:3px; }
/* Consent sentence under the submit button on the auth pages. Sits INSIDE the
   white .auth-card, so its text/links are dark-on-white, not on the green.
   Separate from .auth-foot (navigation) because this is the statement of
   agreement and belongs directly under the button that performs it. */
.auth-consent { font-size:11.5px; line-height:1.5; color:#64748b; text-align:center;
  margin-top:12px; }
.auth-consent a { color:var(--auth-green,#064e3b); text-decoration:underline; font-weight:600; }

/* ===== Home page tabs + Overview redesign (2026-09-05, R2/R3/R5/R6) =========
   EVERY COLOR HERE COMES FROM THE APPEARANCE THEME. Settings → Appearance offers
   8 named themes, each overriding --navy (chrome), --gray-50 (page tint) and
   --amber (accent) on html[data-theme]. There is NO light/dark toggle — all 8 are
   light-page with a dark colored nav — so light tokens are safe for every user,
   and hardcoding a palette would leave this page the only part ignoring someone
   on Forest / Salmon / Rose / Sand. */

/* ---- Tab bar: large centered pills (R3) ---------------------------------- */
.home-tabs-wrap { background: var(--gray-50); border-bottom: 1px solid var(--gray-200);
                  padding: 18px 24px 20px; }
.home-tabs { max-width: 1200px; margin: 0 auto; display: flex; justify-content: center;
             gap: 10px; flex-wrap: wrap; }
/* R8 (retry) — the first attempt DID apply, it was just too subtle: measured
   bar #f0fdf4 (HSL-L 96.7%) vs pill #e2e8f0 (91.4%) = only a 5.3% lightness step,
   AND a hue change (green-tinted bar, neutral-grey pill) that muddied it further.
   Now the pill is DERIVED FROM THE BAR'S OWN TOKEN so it keeps the theme's hue and
   lands a real ~10% step: --gray-50 mixed 12% toward --gray-900. Same trick works
   for every theme because --gray-50 is what each theme overrides. */
.home-tab {
  appearance: none; cursor: pointer;
  background: color-mix(in srgb, var(--gray-50) 88%, var(--gray-900) 12%);
  border: 1.5px solid color-mix(in srgb, var(--gray-50) 74%, var(--gray-900) 26%);
  border-radius: 999px;
  padding: 12px 28px; font-size: 15px; font-weight: 600;
  color: var(--gray-900); white-space: nowrap;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.home-tab:hover { background: color-mix(in srgb, var(--gray-50) 78%, var(--gray-900) 22%); border-color: var(--navy); }
.home-tab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
/* Ring OUTSIDE the shape — the active pill is filled with --navy, where an inset
   outline would be nearly invisible. */
.home-tab:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---- R6: ONE background + rhythm for all five panels --------------------- */
.home-tabpanel[hidden] { display: none !important; }   /* !important: .home-tabpanel sets display */
.home-tabpanel { background: var(--gray-50); }
/* The module sections carry their own 48px padding and divider rules; strip the
   last one so a panel never ends on a stray border. */
.home-tabpanel > .landing-module:last-child { border-bottom: 0; }
.home-tabpanel .landing-advantages,
.home-tabpanel .landing-who-uses,
.home-tabpanel .landing-top10,
.home-tabpanel .landing-market-pulse { background: var(--gray-50); }

/* ---- R5: Overview — real cards on a light ground ------------------------- */
/* Was: white text on a dark gradient, tiles separated by 1px white dividers and
   defined only by that dark ground. On a light background none of that reads, so
   the tiles get genuine card treatment (surface + border + shadow) and the
   dividers go away entirely rather than being recolored. */
#ht-panel-overview .landing-hero-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
#ht-panel-overview .landing-stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px; border-top: 0; padding-top: 0; margin-bottom: 14px;
  /* ⚠️ MUST reset align-items. The base .landing-stats-row rule sets
     `align-items: center` for its FLEX layout, and that declaration still
     applies after this rule switches the element to GRID — so the tiles were
     CENTRED and each sized to its own content. Measured: 100 / 101 / 118px
     across the six, because the two with a two-line caption (Premium Reports,
     Data Domains) are taller. `stretch` sizes every tile to the tallest
     automatically, so it keeps holding if a caption grows or the domain list
     gains a code — no fixed height to maintain. */
  align-items: stretch;
}
#ht-panel-overview .landing-stat {
  /* Content centred inside a now-taller stretched tile, so short and tall
     tiles read as one row rather than text pinned to the top. */
  justify-content: center;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 14px; gap: 2px; text-align: center;
}
#ht-panel-overview .landing-stat-val { color: var(--gray-900); font-size: 23px; line-height: 1.15; }
#ht-panel-overview .landing-stat-lbl { color: var(--gray-600); font-weight: 600; }
/* --gray-400 measured 2.56:1 on the white tile; --gray-600 is the readable step */
#ht-panel-overview .landing-stat-sub { color: var(--gray-600); }
/* same pre-existing muted grey (2.54:1) — lifted inside the redesigned tab */
#ht-panel-overview .stat-currency { color: var(--gray-600); }
/* The dividers existed only to separate tiles on the dark band; cards do that now. */
#ht-panel-overview .landing-stat-div { display: none; }
#ht-panel-overview .landing-stats-row-2-label {
  color: var(--gray-600); text-align: left; margin: 20px 0 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--gray-200);
}
/* Freshness strip: reference data, NOT a headline. It was a heavy dark bar that
   out-shouted the tiles; muted to a quiet light strip so the stats lead.

   ⚠️ R9 — THE STRIP'S OWN RULES ARE WRITTEN FOR A DARK BAR and every one of them
   has to be overridden, not just the container. A live contrast sweep of the
   rendered panel found .ds-label at rgba(255,255,255,.6) on white = 1.00:1 —
   literally invisible, which is the "white module names in a box near the top"
   Ron reported. Its info-tip icon was 1.25:1 and the green timestamp 2.54:1.
   Recoloring the container alone leaves all three unreadable. */
#ht-panel-overview .data-status-bar {
  background: #fff; border: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200);
  border-radius: var(--radius); max-width: 1200px; margin: 16px auto 18px;
  padding: 10px 16px;
}
#ht-panel-overview .data-status-row-1,
#ht-panel-overview .data-status-row-2,
#ht-panel-overview .data-status-row1-sep { color: var(--gray-600); }
#ht-panel-overview .data-status-bar .ds-value,
#ht-panel-overview .data-status-bar strong,
#ht-panel-overview .data-status-row1-count { color: var(--gray-900); }
/* was rgba(255,255,255,.6) — 1.00:1 on the new white strip */
#ht-panel-overview .data-status-item .ds-label { color: var(--gray-600); }
/* was rgba(255,255,255,.55) — 1.25:1 */
#ht-panel-overview .data-status-bar .info-tip-btn { color: var(--gray-600); }
/* #10b981 reads on a dark bar, 2.54:1 on white — use the darker green token */
#ht-panel-overview .data-status-row1-update,
#ht-panel-overview .data-status-row1-ts { color: var(--green); }
/* amber-800 on the white strip: ~7:1 (the dark-bar #fbbf24 would be ~1.7:1 here) */
#ht-panel-overview .data-status-row1-refresh { color: #92400e; }
#ht-panel-overview { padding: 22px 0 34px; }

@media (max-width: 900px) {
  .home-tabs { gap: 8px; }
  .home-tab  { padding: 10px 18px; font-size: 14px; }
}
@media (max-width: 600px) {
  .home-tabs-wrap { padding: 12px 10px 14px; }
  .home-tabs { gap: 6px; }
  .home-tab  { padding: 9px 14px; font-size: 13px; }
  #ht-panel-overview .landing-stats-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
}

/* R7 — the hero's Launch Tour button spans the same width as the paragraph above
   it. .landing-hero-sub is the subhead; matching its box makes the button read as
   belonging to that block instead of floating as an odd-width chip. A narrow,
   deliberate exception to "the hero stays unchanged" (Ron's call). */
/* .landing-hero-sub is capped at max-width:560px, so "match the paragraph" means
   560px — NOT 100% of the actions row, which is the full hero column (668px) and
   overshot by 108px on the first attempt. Cap the row itself so the button tracks
   the paragraph exactly, and keep the cap identical to the subhead's. */
.landing-hero-actions {
  display: flex; flex-direction: column; align-items: stretch;
  max-width: 560px;
}
.landing-hero-actions .btn-tour-launch { width: 100%; justify-content: center; }

/* R14 — the Export Destinations card's empty tail showed the PAGE background.
   Mechanism (measured, not guessed): .landing-top10-panel carries border/radius/
   shadow but NO background of its own, and .landing-top10-panel-body is #fff yet
   sizes to its content. CSS Grid stretches the panel to the tallest sibling (the
   10-row card), so on a card with fewer rows the body stops short and the gap
   below it exposes whatever is behind — .home-tabpanel's var(--gray-50), which on
   Forest is the pale green #f0fdf4. Hence "the gap reads as green, not white".
   NOT a canvas issue: there are zero <canvas> elements in this tab.
   Fix: give the CARD the surface colour and let the body grow to fill it, so the
   white reaches the same bottom edge as its tallest sibling at any row count. */
.landing-top10-panel { background: #fff; display: flex; flex-direction: column; }
.landing-top10-panel-body { flex: 1 1 auto; }
