/*
 * Growth Partner — application styles
 * Built on Pico CSS 2 with custom overrides
 */

/* ── Brand font: Montserrat for headings (self-hosted, CSP-safe) ──
   Body/table text keeps the system stack — Montserrat is headings-only. */
@font-face {
  font-family: "Montserrat";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/montserrat-600.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/montserrat-700.woff2") format("woff2");
}

/* Pico variable overrides */
:root {
  --pico-font-size: 93.75%;
  --pico-border-radius: 0.5rem;
  --pico-background-color: #f8fafc;
  --pico-color: #1e293b;
  --pico-muted-color: #64748b;
  --pico-muted-border-color: #e2e8f0;
  --pico-primary: #0E3A5A;
  --pico-primary-hover: #0a2c45;
  --pico-primary-focus: rgba(14, 58, 90, 0.15);
  --pico-primary-inverse: #ffffff;
  --pico-secondary: #64748b;
  --pico-secondary-hover: #475569;
  --pico-card-background-color: #ffffff;
  --pico-card-border-color: #e2e8f0;
  --pico-card-sectioning-background-color: #f8fafc;
  --pico-table-border-color: #e2e8f0;
  --pico-form-element-border-color: #cbd5e1;
  --pico-form-element-focus-color: #0E3A5A;

  /* App tokens */
  --gp-danger: #dc2626;
  --gp-danger-hover: #b91c1c;

  /* Subtle inline panels (drawers, kanban columns, hover surfaces). Pico's
     --pico-secondary-background is a dark slate intended for SECONDARY BUTTON
     fills; do not use it as a panel tone or text on it goes unreadable. */
  --gp-panel-bg:        #EBF0F1;
  --gp-panel-bg-hover:  #e2e8f0;
  --gp-panel-border:    #e2e8f0;
}

/* Small text-only "delete" affordance used by inline rows + activity entries. */
.btn-danger-link {
  all: unset;
  cursor: pointer;
  color: var(--gp-danger);
  font-size: 0.75rem;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  transition: background 0.1s ease, color 0.1s ease;
}
.btn-danger-link:hover {
  color: var(--gp-danger-hover);
  background: rgba(220, 38, 38, 0.08);
}

/* ── Layout ── */
.app-layout { display: flex; min-height: 100vh; }
.main-wrap { margin-left: 13rem; flex: 1; min-width: 0; }
main.container { padding-top: 1.5rem; }

/* ── Sidebar ── */
.sidebar {
  width: 13rem;
  background: linear-gradient(180deg, #0E3A5A, #07263c);
  position: fixed; top: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto;
}
.sidebar-brand { padding: 1.25rem 1rem; font-size: 1.1rem; font-weight: 700; color: #fff; border-bottom: 1px solid #1c4a6e; letter-spacing: -0.02em; font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.sidebar-nav { padding: 0.5rem 0; }
.sidebar-nav-main { flex: 1; }
.sidebar-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 1rem; color: #AFC3CE;
  text-decoration: none; font-size: 0.85rem; font-weight: 500;
  border-left: 3px solid transparent; transition: all 0.15s;
}
.sidebar-link:hover { color: #e2e8f0; background: rgba(255,255,255,0.05); }
.sidebar-link.active { color: #fff; border-left-color: #6ea8d4; background: rgba(255,255,255,0.08); }
.sidebar-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.sidebar-icon svg { width: 100%; height: 100%; }
.sidebar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.sidebar-badge {
  background: #ef4444; color: #fff; font-size: 0.7rem; font-weight: 700;
  padding: 0.1rem 0.45rem; border-radius: 999px; min-width: 1.25rem;
  text-align: center; line-height: 1.2;
}

/* ── Mention autocomplete dropdown ── */
.mention-autocomplete-wrapper { position: relative; }
.mention-autocomplete-dropdown {
  position: absolute; top: 0.25rem; left: 0; right: 0;
  z-index: 50; background: #fff; border: 1px solid #cbd5e1;
  border-radius: 6px; box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
  max-height: 220px; overflow-y: auto;
}
.mention-autocomplete-option {
  display: flex; align-items: baseline; gap: 0.5rem;
  padding: 0.45rem 0.75rem; font-size: 0.85rem; cursor: pointer;
  color: #1e293b;
}
.mention-autocomplete-option.is-active,
.mention-autocomplete-option:hover { background: #e7edf2; }
.mention-autocomplete-option strong { color: #0E3A5A; font-weight: 600; }
.mention-autocomplete-name { color: #475569; }
.mention-autocomplete-role { margin-left: auto; color: #94a3b8; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.mention-autocomplete-empty {
  padding: 0.5rem 0.75rem;
  color: #94a3b8;
  font-size: 0.85rem;
  font-style: italic;
  cursor: default;
}

/* ── Mentions inbox ── */
.mentions-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.mentions-tab {
  padding: 0.35rem 0.85rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; text-decoration: none;
  color: #64748b; background: #f1f5f9; border: 1px solid transparent;
}
.mentions-tab.active { color: #0E3A5A; background: #e7edf2; border-color: #b9ccd8; }
.mention-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem;
  align-items: start; padding: 0.85rem 1rem; border-bottom: 1px solid #e2e8f0;
}
.mention-row.unread { background: #fefce8; }
.mention-dot { width: 0.55rem; height: 0.55rem; border-radius: 999px; background: #ef4444; margin-top: 0.5rem; }
.mention-dot.read { background: transparent; }
.mention-body { font-size: 0.85rem; color: #334155; }
.mention-body .mention-meta { color: #64748b; font-size: 0.75rem; margin-bottom: 0.25rem; }
.mention-body .mention-excerpt { color: #475569; margin-top: 0.25rem; white-space: pre-wrap; }
.mention-actions { display: flex; align-items: center; gap: 0.5rem; }
/* ── Country Switcher ── */
.country-switcher {
  display: flex; gap: 0; border-bottom: 1px solid #1c4a6e;
}
.country-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 0.5rem; color: #AFC3CE; text-decoration: none;
  font-size: 0.8rem; font-weight: 600; transition: all 0.15s;
  border-bottom: 2px solid transparent;
}
.country-tab:hover { color: #cbd5e1; background: rgba(255,255,255,0.04); }
.country-tab.active { color: #fff; background: rgba(255,255,255,0.06); border-bottom-color: #6ea8d4; }
.country-flag { font-size: 1rem; }

.sidebar-admin { border-top: 1px solid #1c4a6e; padding-top: 0.5rem; }
.sidebar-admin .sidebar-link { font-size: 0.8rem; color: #8aa6b5; padding: 0.4rem 1rem; }
.sidebar-admin .sidebar-link:hover { color: #cbd5e1; }
.sidebar-admin .sidebar-link.active { color: #cbd5e1; border-left-color: #64748b; }
.sidebar-toggle { display: none; }

/* ── Typography ── */
/* Headings use Montserrat; body/tables stay on Pico's system stack. */
h1, h2, h3, h4, h5, h6 {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
h1 { color: #1e293b; font-weight: 700; letter-spacing: -0.02em; }
h2 { color: #334155; font-weight: 600; }
h3, h4 { color: #475569; font-weight: 600; }

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.kpi-grid-primary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.kpi-grid-secondary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem; margin-bottom: 2rem;
}
.kpi-card {
  text-align: center; padding: 1.25rem 1rem;
  border-left: 3px solid #0E3A5A;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, transform 0.2s;
}
.kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.kpi-card h2 { margin-bottom: 0.25rem; color: #0E3A5A; font-size: 1.75rem; }
.kpi-card small { color: var(--pico-muted-color); }
.kpi-card a { color: inherit; text-decoration: none; }
.kpi-card a:hover { text-decoration: none; opacity: 1; }
.kpi-card-primary {
  border-left-width: 4px;
  padding: 1.5rem 1rem;
}
.kpi-card-primary h2 { font-size: 2rem; }
.kpi-card-secondary {
  padding: 0.75rem 0.5rem;
  border-left-width: 2px;
  border-left-color: #e2e8f0;
}
.kpi-card-secondary h2 { font-size: 1.35rem; color: #475569; }

/* KPI delta badges */
.kpi-delta {
  display: inline-block; font-size: 0.7rem; font-weight: 600;
  padding: 0.1rem 0.4rem; border-radius: 9999px;
  margin-left: 0.3rem; vertical-align: super;
}
.kpi-delta-up { background: #d1fae5; color: #065f46; }
.kpi-delta-down { background: #fee2e2; color: #991b1b; }
.kpi-delta-neutral { background: #f1f5f9; color: #64748b; }

/* ── Next Action CTA ── */

/* ── Dashboard Actions Row ── */
.dashboard-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap;
}
.dashboard-stats {
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.dashboard-stats .kpi-card {
  min-width: 120px;
}
.dashboard-import {
  display: flex; align-items: center; gap: 0.75rem;
}
.dashboard-import button, .dashboard-import input[type="submit"] {
  margin: 0; white-space: nowrap;
}

/* ── Pipeline Funnel ── */
.pipeline {
  display: flex; gap: 0; margin-bottom: 2rem;
  border-radius: 0.5rem; overflow: hidden;
  border: 1px solid #e2e8f0;
}
.pipeline-stage {
  flex: 1; text-align: center; padding: 0.6rem 0.5rem;
  text-decoration: none; transition: opacity 0.15s;
  position: relative;
}
.pipeline-stage:hover { opacity: 0.85; }
.pipeline-stage-count { display: block; font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.pipeline-stage-label { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.pipeline-new { background: #dbeafe; color: #1e40af; }
.pipeline-contacted { background: #fef3c7; color: #92400e; }
.pipeline-approved { background: #d1fae5; color: #065f46; }
.pipeline-rejected { background: #fee2e2; color: #991b1b; }

/* ── Badges (status) ── */
.badge {
  display: inline-block; padding: 0.2rem 0.6rem;
  border-radius: 9999px; font-size: 0.75rem;
  font-weight: 600; letter-spacing: 0.02em;
}
.badge-new { background: #dbeafe; color: #1e40af; }
.badge-contacted { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* Badges (lead type — distinct from status) */
.badge-type-permit { background: #f1f5f9; color: #475569; }
.badge-type-company { background: #ede9fe; color: #5b21b6; }
.badge-type-industrial-site { background: #ccfbf1; color: #0f766e; }

/* Badges (feedback status) */
.badge-feedback-open { background: #dbeafe; color: #1e40af; }
.badge-feedback-planned { background: #ede9fe; color: #5b21b6; }
.badge-feedback-in_progress { background: #fef3c7; color: #92400e; }
.badge-feedback-done { background: #d1fae5; color: #065f46; }
.badge-feedback-wontfix { background: #f1f5f9; color: #475569; }

/* Badges (feedback priority) */
.badge-priority-low { background: #f1f5f9; color: #475569; }
.badge-priority-medium { background: #fef3c7; color: #92400e; }
.badge-priority-high { background: #fee2e2; color: #991b1b; }

/* ── Feedback page ── */
.feedback-submit {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.5rem;
  padding: 1rem; margin-bottom: 1.5rem;
}
.feedback-form textarea { margin-bottom: 0.25rem; }
.feedback-filters {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem;
}
.filter-chip {
  padding: 0.25rem 0.75rem; border-radius: 9999px;
  background: #f1f5f9; color: #475569; font-size: 0.8rem;
  text-decoration: none; border: 1px solid transparent;
}
.filter-chip:hover { background: #e2e8f0; }
.filter-chip.active { background: #0E3A5A; color: #fff; }
.feedback-list { display: flex; flex-direction: column; gap: 0.75rem; }
.feedback-card-inner { padding: 1rem; margin-bottom: 0; }
.feedback-card-header {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  align-items: center; margin-bottom: 0.5rem;
}
.feedback-meta { color: #64748b; font-size: 0.8rem; }
.feedback-body { margin: 0.25rem 0 0.5rem; white-space: pre-wrap; }
.feedback-admin-note {
  background: #e7edf2; border-left: 3px solid #0E3A5A;
  padding: 0.5rem 0.75rem; border-radius: 0.25rem;
  margin-top: 0.5rem; font-size: 0.88rem;
}
.feedback-admin-form {
  margin-top: 0.75rem; padding-top: 0.75rem;
  border-top: 1px dashed #e2e8f0;
}
.feedback-admin-form textarea { margin-bottom: 0.25rem; }
.muted { color: #64748b; }

/* ── Relevance Scores ── */
.score-high { color: #059669; font-weight: 700; }
.score-medium { color: #d97706; font-weight: 600; }
.score-low { color: var(--pico-muted-color); }
.score-blocked { color: #dc2626; font-weight: 600; }

/* ── Tables ── */
table { font-size: 0.9rem; }
thead th {
  background: #f1f5f9; color: #475569; font-weight: 600;
  text-transform: uppercase; font-size: 0.72rem;
  letter-spacing: 0.05em; border-bottom: 2px solid #e2e8f0;
}
tbody tr { transition: background-color 0.1s; }
tbody tr:hover { background-color: #f8fafc; }
td { vertical-align: middle; }

/* ── Filter bar ── */
.filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  align-items: end; margin-bottom: 1rem;
  padding: 0.75rem; background: #f1f5f9;
  border-radius: 0.5rem; border: 1px solid #e2e8f0;
}
.filters input, .filters select { margin-bottom: 0; font-size: 0.85rem; }

/* ── Flash messages ── */
.flash-notice {
  padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1.5rem;
  font-size: 0.9rem; border-left: 4px solid #0E3A5A;
  background: #e7edf2; color: #0a2c45;
}
.flash-alert {
  padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1.5rem;
  font-size: 0.9rem; border-left: 4px solid #dc2626;
  background: #fef2f2; color: #991b1b;
}

/* ── Cards ── */
article { box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #e2e8f0; }

/* ── Collapsible sections ── */
details summary .badge { vertical-align: middle; margin-left: 0.5rem; }

/* ── Definition lists (show pages) ── */
dt { color: #64748b; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
dd { color: #1e293b; margin-bottom: 0.75rem; }

/* ── Outline buttons ── */
button.outline, [type="submit"].outline, [role="button"].outline { border-color: #cbd5e1; color: #475569; }
button.outline:hover, [type="submit"].outline:hover, [role="button"].outline:hover { border-color: #0E3A5A; color: #0E3A5A; background: #e7edf2; }

/* ── Scrape status bar ── */
.scrape-status { padding: 0.5rem 1rem; margin-bottom: 2rem; background: #f1f5f9; border: 1px solid #e2e8f0; }

/* ── Pagination (Pagy) ── */
nav.pagy { background: transparent; box-shadow: none; }

/* ── Footer ── */
.attribution { text-align: center; font-size: 0.75rem; color: #94a3b8; padding: 2rem 0 1rem; border-top: 1px solid #e2e8f0; margin-top: 3rem; }

/* ── Signal chips ── */
.signal-bar {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  padding: 0.6rem 0.75rem; background: #f1f5f9;
  border-radius: 0.5rem; border: 1px solid #e2e8f0; margin-bottom: 1.5rem;
}
.signal-chip {
  display: inline-block; padding: 0.2rem 0.6rem;
  border-radius: 9999px; font-size: 0.75rem;
  font-weight: 600; letter-spacing: 0.02em;
}
/* Color palettes shared with .prospect-tag-* (same semantics, different shape/size base class). */
.signal-chip-score { background: #0E3A5A; color: #fff; }
.signal-chip-red, .prospect-tag-hot { background: #fee2e2; color: #991b1b; }
.signal-chip-amber, .prospect-tag-warm { background: #fef3c7; color: #92400e; }
.signal-chip-green { background: #d1fae5; color: #065f46; }
.signal-chip-blue { background: #dbeafe; color: #1e40af; }
.signal-chip-muted, .prospect-tag-muted { background: #f1f5f9; color: #64748b; }
.signal-chip-muted { border: 1px solid #e2e8f0; }

/* ── Score help tooltip ── */
.score-help { cursor: help; color: var(--pico-muted-color); font-size: 0.7rem; text-decoration: none; border-bottom: 1px dashed #94a3b8; }

/* ── Loading spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 0.9rem; height: 0.9rem;
  border: 2px solid #e2e8f0; border-top-color: #0E3A5A;
  border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle;
}
.btn-loading { pointer-events: none; opacity: 0.7; }

/* ── Filter count badge ── */
.filter-count {
  display: inline-block; background: #0E3A5A; color: #fff;
  font-size: 0.65rem; font-weight: 700;
  padding: 0.1rem 0.4rem; border-radius: 9999px;
  margin-left: 0.3rem; vertical-align: middle;
}

/* ── Email draft ── */
.email-draft {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 0.5rem; padding: 1rem;
  font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap;
}
.copy-btn { cursor: pointer; }
.copy-btn.copied { color: #059669; }

/* ── Show page utilities ── */
/* Back navigation: a real (subtle) button with breathing room below, so the
   page title doesn't sit glued to it. Used on all show pages. */
.back-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.8rem; font-weight: 500;
  color: var(--pico-muted-color); text-decoration: none;
  padding: 0.3rem 0.8rem; margin-bottom: 1rem;
  border: 1px solid var(--pico-muted-border-color); border-radius: 999px;
  background: var(--pico-card-background-color);
  transition: color 0.15s, border-color 0.15s;
}
.back-link:hover { color: var(--pico-primary); border-color: var(--pico-primary); }
.show-header { margin-bottom: 1.5rem; }
.show-header h1 { margin-bottom: 0.25rem; }
.show-subtitle { color: var(--pico-muted-color); margin-bottom: 0.25rem; }
.section-title { margin-top: 1.5rem; margin-bottom: 0.75rem; }
.action-group { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* Collapsible sections: the summary renders as a clickable panel bar with its
   own chevron, so it's obviously interactive (plain-text summaries weren't). */
.details-section { margin-top: 1rem; }
.details-section > summary {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.9rem; font-weight: 600; color: #475569;
  background: var(--gp-panel-bg);
  border: 1px solid var(--gp-panel-border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.details-section > summary:hover {
  background: var(--gp-panel-bg-hover);
  border-color: #cbd5e1;
  color: var(--pico-color);
}
/* Pico injects its own chevron via summary::after (background-image); ours is
   a rotating ::before marker on the left. */
.details-section > summary::after { display: none; }
.details-section > summary::before {
  content: "\25B8";
  color: #94a3b8;
  font-size: 0.8rem;
  transition: transform 0.15s ease;
}
.details-section[open] > summary::before { transform: rotate(90deg); }
.details-section[open] > summary { margin-bottom: 0.75rem; }

/* ── Filter bar enhancements ── */
.filters-search { flex: 2; min-width: 200px; }
.filters-wide { flex: 2; min-width: 300px; }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 3rem 1.5rem;
  color: var(--pico-muted-color);
}
.empty-state p { margin-bottom: 0; font-size: 0.95rem; }

/* ── Results count ── */
.results-count { font-size: 0.82rem; color: var(--pico-muted-color); margin-bottom: 0.75rem; }

/* ── Score breakdown ── */
.score-breakdown {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  align-items: center; margin-top: 0.5rem;
}
.score-breakdown-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.4rem 0.6rem; background: #f8fafc;
  border-radius: 0.375rem; border: 1px solid #e2e8f0;
  min-width: 70px; cursor: help;
}
.score-breakdown-value { font-size: 1rem; font-weight: 700; color: #475569; }
.score-breakdown-value.has-score { color: #0E3A5A; }
.score-breakdown-label { font-size: 0.65rem; color: var(--pico-muted-color); text-transform: uppercase; letter-spacing: 0.03em; }

/* ── Card section header ── */
.card-header { font-size: 0.82rem; font-weight: 600; color: #475569; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.75rem; }
/* Brand kicker: small green square before section labels (decorative only —
   green stays out of text/interactive roles). */
.card-header::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 0.5rem; height: 0.5rem; margin-right: 0.5rem;
  background: #74BE00; border-radius: 1px;
}

/* ── Page header with count ── */
.page-header { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.page-header h1 { margin-bottom: 0; }
.page-header .count { font-size: 1rem; color: var(--pico-muted-color); font-weight: 400; }

/* ── KPI card type-color variants ── */
.kpi-card-permit { border-left-color: #475569; }
.kpi-card-permit h2 { color: #475569; }
.kpi-card-company { border-left-color: #5b21b6; }
.kpi-card-company h2 { color: #5b21b6; }
.kpi-card-industrial-site { border-left-color: #0f766e; }
.kpi-card-industrial-site h2 { color: #0f766e; }
.kpi-card-amber { border-left-color: #d97706; }
.kpi-card-amber h2 { color: #d97706; }
.kpi-card-green { border-left-color: #059669; }
.kpi-card-green h2 { color: #059669; }
.kpi-card-blue { border-left-color: #2563eb; }
.kpi-card-blue h2 { color: #2563eb; }
.kpi-card-red { border-left-color: #dc2626; }
.kpi-card-red h2 { color: #dc2626; }

/* Priority row highlight */
.row-high-priority { border-left: 3px solid #059669; }

/* ── Checkbox in filter bar ── */
.filters-checkbox { font-size: 0.82rem; display: flex; align-items: center; gap: 0.3rem; margin: 0; white-space: nowrap; }
.filters-checkbox input[type="checkbox"] { margin: 0; width: auto; }

/* ── Collapsible filters ── */
.filters-more { margin-top: 0; }
.filters-more summary { font-size: 0.82rem; color: var(--pico-muted-color); cursor: pointer; margin-bottom: 0.5rem; }
.filters-more .filters { margin-top: 0.5rem; }

/* ── Smooth transitions ── */
a { transition: color 0.15s; }

/* ── Prospect List (Followed page) ── */
.prospect-pipeline {
  display: flex; gap: 0; margin-bottom: 1.5rem;
  border-radius: 0.5rem; overflow: hidden;
  border: 1px solid #e2e8f0;
}
.prospect-pipeline .pipeline-stage { cursor: pointer; }
.prospect-pipeline .pipeline-active { box-shadow: inset 0 -3px 0 currentColor; }
.pipeline-clear {
  padding: 0.6rem 0.75rem; display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; color: #64748b; text-decoration: none; font-size: 0.75rem; font-weight: 600;
  border-left: 1px solid #e2e8f0; transition: background 0.15s;
}
.pipeline-clear:hover { background: #e2e8f0; color: #475569; }

.prospect-list { display: flex; flex-direction: column; gap: 0; }

.prospect-card {
  border: 1px solid #e2e8f0;
  border-bottom: none;
  background: #fff;
  transition: box-shadow 0.15s;
}
.prospect-card:first-child { border-radius: 0.5rem 0.5rem 0 0; }
.prospect-card:last-child { border-bottom: 1px solid #e2e8f0; border-radius: 0 0 0.5rem 0.5rem; }
.prospect-card:only-child { border-radius: 0.5rem; border-bottom: 1px solid #e2e8f0; }
.prospect-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); z-index: 1; position: relative; }

.prospect-summary {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.65rem 1rem; cursor: pointer;
  transition: background 0.1s;
}
.prospect-summary:hover { background: #f8fafc; }

.prospect-score {
  flex-shrink: 0; width: 2.5rem; text-align: center;
  font-size: 1.05rem; font-weight: 700;
}

.prospect-main { flex: 2; min-width: 0; }
.prospect-name { font-weight: 600; font-size: 0.88rem; line-height: 1.3; }
.prospect-name a { color: inherit; text-decoration: none; }
.prospect-name a:hover { color: var(--pico-primary); }
.prospect-meta {
  display: flex; gap: 0.5rem; font-size: 0.72rem; color: var(--pico-muted-color);
  margin-top: 0.1rem;
}
.prospect-meta span:not(:last-child)::after { content: "·"; margin-left: 0.5rem; }

.prospect-signals { flex: 1; display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: flex-start; }

.prospect-tag {
  display: inline-block; padding: 0.1rem 0.45rem;
  border-radius: 0.25rem; font-size: 0.68rem;
  font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
}
/* Color values for -hot/-warm/-muted live grouped with .signal-chip-* above. */
.prospect-tag-permit { background: #f1f5f9; color: #475569; }
.prospect-tag-site { background: #ccfbf1; color: #0f766e; }

.prospect-contact-preview { flex: 1; font-size: 0.8rem; min-width: 0; }
.prospect-contact-name { color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.prospect-contact-empty { color: #cbd5e1; font-style: italic; font-size: 0.75rem; }

.prospect-status { flex-shrink: 0; }
.prospect-expand-icon {
  flex-shrink: 0; width: 1.25rem; text-align: center;
  color: #cbd5e1; font-size: 0.7rem; transition: transform 0.2s;
}

/* Expanded detail panel */
.prospect-detail {
  max-height: 0; overflow: hidden;
  transition: max-height 0.25s ease-out, padding 0.25s ease-out;
  background: #f8fafc; border-top: none;
}
.prospect-detail-open {
  max-height: 500px; padding: 1rem;
  border-top: 1px solid #e2e8f0;
  transition: max-height 0.35s ease-in, padding 0.2s ease-in;
}
.prospect-detail-open + .prospect-summary .prospect-expand-icon,
.prospect-card:has(.prospect-detail-open) .prospect-expand-icon {
  transform: rotate(180deg);
}

.prospect-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}

.prospect-detail-col { min-width: 0; }

.prospect-detail-header {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #64748b;
  margin-bottom: 0.5rem; padding-bottom: 0.3rem;
  border-bottom: 1px solid #e2e8f0;
}

.prospect-dl { margin: 0; }
.prospect-dl dt {
  font-size: 0.68rem; color: #94a3b8; font-weight: 500;
  text-transform: none; letter-spacing: 0; margin-top: 0.35rem;
}
.prospect-dl dd { font-size: 0.82rem; margin-bottom: 0.15rem; margin-left: 0; }

.prospect-contact-card {
  padding: 0.4rem 0; border-bottom: 1px solid #e2e8f0;
}
.prospect-contact-card:last-of-type { border-bottom: none; }
.prospect-contact-card-name { font-weight: 600; font-size: 0.82rem; color: #1e293b; }
.prospect-contact-card-role { font-size: 0.72rem; color: #64748b; }
.prospect-contact-card-channels { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.2rem; }
.prospect-channel {
  font-size: 0.72rem; color: var(--pico-primary);
  text-decoration: none; white-space: nowrap;
}
.prospect-channel:hover { text-decoration: underline; }

.prospect-activity-item { margin-bottom: 0.4rem; font-size: 0.82rem; }
.prospect-activity-label {
  display: block; font-size: 0.68rem; color: #94a3b8; font-weight: 500;
}

.prospect-detail-empty { font-size: 0.8rem; color: #94a3b8; margin: 0; display: flex; align-items: center; }

.prospect-actions {
  display: flex; gap: 0.5rem; align-items: center;
  margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px solid #e2e8f0;
}

/* ── Responsive (layout/sidebar breakpoints) ──
   Page/widget mobile overrides live in the "Mobile overrides" section at the
   BOTTOM of this file, so they win the cascade over base rules defined after
   this point. Keep them there. */

@media (max-width: 768px) {
  .sidebar { width: 3.5rem; }
  .sidebar-brand { padding: 1rem 0.5rem; font-size: 0; }
  .sidebar-brand::first-letter { font-size: 1.1rem; }
  .sidebar-label { display: none; }
  .sidebar-link { padding: 0.5rem; justify-content: center; gap: 0; border-left: none; }
  .sidebar-icon { width: 1.35rem; height: 1.35rem; }
  .sidebar-admin .sidebar-link { padding: 0.4rem; justify-content: center; }
  .main-wrap { margin-left: 3.5rem; }
  .kpi-grid-primary { grid-template-columns: 1fr 1fr; }
  .pipeline { flex-wrap: wrap; }
  .pipeline-stage { flex: 1 1 45%; }
}

@media (max-width: 480px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; width: 13rem; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-label { display: inline; }
  .sidebar-link { padding: 0.7rem 1rem; justify-content: flex-start; gap: 0.75rem; border-left: 3px solid transparent; }
  .sidebar-admin .sidebar-link { padding: 0.55rem 1rem; justify-content: flex-start; }
  .main-wrap { margin-left: 0; }
  .sidebar-toggle {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 0.75rem; left: 0.75rem; z-index: 101;
    width: 2.25rem; height: 2.25rem; border-radius: 0.375rem;
    background: #1e293b; color: #fff; border: none; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }
  .sidebar-toggle svg { width: 1.25rem; height: 1.25rem; }
  .sidebar-backdrop {
    display: none; position: fixed; inset: 0; z-index: 99;
    background: rgba(0,0,0,0.4);
  }
  .sidebar.open ~ .sidebar-backdrop { display: block; }
  body.sidebar-locked { overflow: hidden; }
  main.container { padding-top: 3.5rem; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-grid-primary { grid-template-columns: 1fr; }
  .kpi-grid-secondary { grid-template-columns: 1fr 1fr; }
}

/* ── Lists ── */
.list-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.list-card {
  display: flex; border: 1px solid #e2e8f0; border-radius: 0.5rem;
  background: #fff; text-decoration: none; color: inherit;
  transition: box-shadow 0.2s, transform 0.2s; overflow: hidden;
}
.list-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.list-card-color { width: 4px; flex-shrink: 0; }
.list-card-body { padding: 1rem; flex: 1; }
.list-card-name { font-weight: 600; font-size: 0.95rem; color: #1e293b; margin-bottom: 0.25rem; }
.list-card-desc { font-size: 0.8rem; color: #64748b; margin-bottom: 0.5rem; }
.list-card-meta { font-size: 0.72rem; color: #94a3b8; display: flex; gap: 0.75rem; }
.list-card-color-dot {
  display: inline-block; width: 0.75rem; height: 0.75rem;
  border-radius: 50%; vertical-align: middle; margin-right: 0.4rem;
}

/* Add-to-list button */
.list-add-btn {
  all: unset; cursor: pointer; font-size: 1rem; line-height: 1;
  color: var(--pico-muted-color); width: 1.5rem; height: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0.25rem; transition: background 0.1s, color 0.1s;
}
.list-add-btn:hover { background: #e7edf2; color: var(--pico-primary); }

/* Popover dropdown — fixed-positioned (placed by JS) so it escapes the
   action-bar / table-cell clipping context and never hides behind the
   z-index:100 sidebar. */
.list-popover {
  display: none; position: fixed; z-index: 200;
  min-width: 220px; max-width: calc(100vw - 1rem); background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  font-size: 0.82rem;
}
.list-popover-open { display: block; }
.list-popover-loading { padding: 0.75rem; color: #94a3b8; text-align: center; }
.list-popover-empty { padding: 0.75rem; color: #94a3b8; font-style: italic; }
.list-popover-search {
  width: 100%; padding: 0.5rem; border: none;
  border-bottom: 1px solid #e2e8f0; font-size: 0.85rem;
  box-sizing: border-box;
}
.list-popover-search:focus {
  outline: none; border-bottom-color: var(--pico-primary);
}
.list-popover-search::placeholder {
  color: #94a3b8;
}
.list-popover-items { max-height: 350px; overflow-y: auto; padding: 0.25rem 0; }
.list-popover-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.85rem;
  transition: background 0.1s;
  min-height: 2.25rem;
}
.list-popover-item:hover { background: #f8fafc; }
.list-popover-item input[type="checkbox"] { margin: 0 0.25rem 0 0; width: 1.1rem; height: 1.1rem; flex-shrink: 0; cursor: pointer; }
.list-popover-color {
  display: inline-block; width: 0.5rem; height: 0.5rem;
  border-radius: 50%; flex-shrink: 0;
}
.list-popover-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-popover-new {
  display: block; padding: 0.5rem 0.75rem; border-top: 1px solid #e2e8f0;
  color: var(--pico-primary); font-size: 0.78rem; text-decoration: none;
  font-weight: 500;
}
.list-popover-new:hover { background: #e7edf2; }

/* ── Searchable Select ── */
.searchable-select { position: relative; }
.searchable-select-input {
  width: 100%; font-size: 0.85rem; margin: 0;
  padding: 0.4rem 0.5rem;
}
.searchable-select-dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  z-index: 60; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 0 0 0.5rem 0.5rem; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: 260px; overflow-y: auto; min-width: 100%; width: max-content; max-width: 500px;
}
.searchable-select-open { display: block; }
.searchable-select-option {
  padding: 0.4rem 0.75rem; font-size: 0.8rem; cursor: pointer;
  transition: background 0.1s;
}
.searchable-select-option:hover, .searchable-select-highlighted { background: #f1f5f9; }
.searchable-select-option mark { background: #fef3c7; color: inherit; padding: 0; border-radius: 2px; }
.searchable-select-empty { padding: 0.5rem 0.75rem; font-size: 0.78rem; color: #94a3b8; font-style: italic; }

/* Table cell overflow for popover */
td { overflow: visible; }

/* ── Bulk Select ── */
.bulk-th, .bulk-td { width: 3rem; text-align: center; padding: 0.4rem 0.6rem !important; }
.bulk-th input[type="checkbox"], .bulk-td input[type="checkbox"] { margin: 0; width: 1.1rem; height: 1.1rem; cursor: pointer; }

/* Floating action bar */
.bulk-bar {
  position: fixed; bottom: -4rem; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 1rem; background: #1e293b; color: #fff;
  border-radius: 0.75rem; box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  font-size: 0.85rem; transition: bottom 0.25s ease;
  white-space: nowrap;
}
.bulk-bar-visible { bottom: 1.5rem; }
.bulk-bar-count { font-weight: 600; }
.bulk-bar-actions { display: flex; align-items: center; gap: 0.5rem; }
.bulk-bar-select {
  background: #334155; border: 1px solid #475569; color: #e2e8f0;
  font-size: 0.82rem; padding: 0.3rem 0.5rem; border-radius: 0.375rem;
  margin: 0; min-width: 160px;
}
.bulk-bar-select:focus { border-color: #6ea8d4; outline: none; }
.bulk-bar-submit {
  background: #0E3A5A; color: #fff; border: none; padding: 0.35rem 0.75rem;
  font-size: 0.82rem; font-weight: 600; border-radius: 0.375rem;
  cursor: pointer; transition: background 0.15s; margin: 0;
}
.bulk-bar-submit:hover { background: #0a2c45; }
.bulk-bar-submit:disabled { opacity: 0.7; cursor: wait; }
.bulk-bar-success { background: #059669 !important; }
.bulk-bar-clear {
  background: none; border: none; color: #94a3b8; font-size: 1.1rem;
  cursor: pointer; padding: 0 0.25rem; line-height: 1; margin: 0;
}
.bulk-bar-clear:hover { color: #fff; }

/* ── Login page ──────────────────────────────────────────────── */
.login-layout {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--pico-background-color);
  padding: 1rem;
}
.login-card {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  padding: 2.5rem 2rem; width: 100%; max-width: 24rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.login-card h2 { margin-bottom: 0.25rem; text-align: center; }
.login-subtitle { text-align: center; color: var(--pico-muted-color); margin-bottom: 1.5rem; }

/* ── Sidebar user section ────────────────────────────────────── */
.sidebar-user {
  margin-top: auto; padding: 0.75rem 1rem;
  border-top: 1px solid var(--pico-muted-border-color);
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.sidebar-user-info { display: flex; flex-direction: column; }
.sidebar-user-name { font-size: 0.8rem; font-weight: 600; color: #e2e8f0; }
.sidebar-user-role { font-size: 0.7rem; color: #AFC3CE; text-transform: uppercase; letter-spacing: 0.05em; }
.sidebar-logout-btn {
  background: transparent; border: 1px solid #1c4a6e; color: #AFC3CE;
  font-size: 0.7rem; padding: 0.25rem 0.5rem; border-radius: 0.25rem;
  cursor: pointer; white-space: nowrap;
}
.sidebar-logout-btn:hover { background: #1c4a6e; color: #fff; }

/* ── Nearby leads ── */
.nearby-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 960px) {
  .nearby-layout { grid-template-columns: 1fr; }
}
.nearby-controls { min-width: 0; }
.nearby-map-container { position: sticky; top: 1rem; }
#nearby-map { height: 500px; border-radius: 8px; border: 1px solid var(--pico-muted-border-color); }
.origin-marker { background: transparent !important; border: none !important; }
.icp-segment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.15rem 1rem;
  margin-top: 0.5rem;
}
.icp-segment-grid .filters-checkbox { font-size: 0.85rem; }

/* === Pipeline (Lijsten mini-CRM) === */

.pipeline-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}
@media (max-width: 800px) {
  .pipeline-kpis { grid-template-columns: repeat(3, 1fr); }
}
.pipeline-kpi {
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  margin: 0;
}
.pipeline-kpi h2 { margin: 0; font-size: 1.4rem; }
.pipeline-kpi small { color: var(--pico-muted-color); font-size: 0.75rem; }
.pipeline-kpi-uncontacted { border-left: 3px solid #94a3b8; }
.pipeline-kpi-contacted   { border-left: 3px solid #fbbf24; }
.pipeline-kpi-qualified   { border-left: 3px solid #60a5fa; }
.pipeline-kpi-proposal    { border-left: 3px solid #a78bfa; }
.pipeline-kpi-won         { border-left: 3px solid #10b981; }
.pipeline-kpi-lost        { border-left: 3px solid #ef4444; }

.view-toggle { display: flex; gap: 0.25rem; }
.view-toggle a { margin: 0; }

/* Shared header action cluster — replaces ad-hoc inline styles. */
.page-header-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.page-header-actions [role="button"],
.page-header-actions button,
.page-header-actions form { margin: 0; }
.page-header-actions [role="button"],
.page-header-actions button {
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
}
.page-header-desc {
  color: var(--pico-muted-color);
  margin-bottom: 1.5rem;
}

/* Archived lists block in lists#index */
.archived-heading {
  margin-top: 2rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pico-muted-color);
}
.list-card-archived { opacity: 0.65; }
.list-card-archived:hover { opacity: 1; }

.add-row-block {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--pico-muted-border-color);
  border-radius: 6px;
}
.add-row-block summary { cursor: pointer; padding: 0; }
.add-row-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
@media (max-width: 800px) { .add-row-grid { grid-template-columns: 1fr 1fr; } }

/* Kanban toolbar (lost-toggle, future filters) */
.kanban-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.4rem;
}
.kanban-toggle-lost {
  color: var(--pico-muted-color);
  font-size: 0.8rem;
  text-decoration: none;
}
.kanban-toggle-lost:hover {
  color: var(--pico-color);
  text-decoration: underline;
}

/* Kanban board — column count is rendered dynamically. */
.kanban-board {
  display: grid;
  gap: 0.5rem;
  overflow-x: auto;
}
.kanban-board-5 { grid-template-columns: repeat(5, minmax(240px, 1fr)); }
.kanban-board-6 { grid-template-columns: repeat(6, minmax(220px, 1fr)); }
.kanban-column-empty {
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  font-style: italic;
  border: 1px dashed var(--pico-muted-border-color);
  border-radius: 6px;
  background: transparent;
}
.kanban-column {
  background: var(--gp-panel-bg);
  border: 1px solid var(--gp-panel-border);
  border-radius: 6px;
  padding: 0.5rem;
  min-height: 200px;
}
.kanban-column.drag-over { background: #e0e7ff; }
.kanban-column-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  padding: 0 0.25rem;
  color: var(--pico-muted-color);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.kanban-column-count {
  background: var(--pico-card-background-color);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.75rem;
}
.kanban-column-cards { display: flex; flex-direction: column; gap: 0.4rem; min-height: 60px; }
.kanban-card {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
  cursor: grab;
  margin: 0;
  position: relative;
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.4; }
.kanban-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.kanban-card-contact { font-size: 0.8rem; line-height: 1.3; margin-bottom: 0.3rem; }
.kanban-card-contact small { color: var(--pico-muted-color); display: block; }
.kanban-card-meta {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; color: var(--pico-muted-color);
}
.kanban-card-staleness {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}
.kanban-card-staleness small { font-size: 0.7rem; }
.kanban-card-staleness.is-stale small { color: #b91c1c; font-weight: 600; }
.kanban-card-open {
  font-size: 0.7rem;
  position: absolute; top: 0.4rem; right: 0.5rem;
  color: var(--pico-muted-color);
}
/* Stage select on kanban cards: HTML5 drag-and-drop never fires on touch
   devices, so touch users get an explicit select instead. Hidden wherever a
   mouse is available so the desktop kanban stays drag-first. */
.kanban-card-stage { display: none; }
@media (hover: none) and (pointer: coarse) {
  .kanban-card-stage { display: block; margin-top: 0.5rem; }
  .kanban-card-stage .pipeline-edit-cell {
    border-color: var(--pico-muted-border-color);
    background: var(--gp-panel-bg);
  }
}
.owner-chip {
  background: #ede9fe;
  color: #5b21b6;
  border-radius: 999px;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
}
.stealth-link { color: inherit; text-decoration: none; }
.stealth-link:hover { text-decoration: underline; }

/* Table view */
.pipeline-table th, .pipeline-table td { padding: 0.4rem 0.5rem; vertical-align: top; }
.pipeline-row { cursor: pointer; transition: background-color 0.1s ease; }
.pipeline-row:hover { background: var(--gp-panel-bg); }
.pipeline-row.is-open { background: var(--gp-panel-bg); }
.pipeline-row td { font-size: 0.85rem; }
.pipeline-row select, .pipeline-row input { font-size: 0.8rem; }

/* Inline-edit affordance: subtle so it doesn't shout, but unmistakably interactive on hover. */
.pipeline-edit-form { margin: 0; }
.pipeline-edit-cell {
  margin: 0;
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
}
.pipeline-edit-cell:hover {
  background: var(--gp-panel-bg-hover);
  border-color: var(--pico-muted-border-color);
}
.pipeline-edit-cell:focus {
  background: var(--pico-card-background-color);
  border-color: #0E3A5A;
  outline: none;
}

/* Stage select: borrow the kpi accent so the row carries a pipeline-stage cue. */
.pipeline-stage-form .pipeline-edit-cell { border-left-width: 3px; border-left-style: solid; }
.pipeline-stage-form[data-stage="uncontacted"] .pipeline-edit-cell { border-left-color: #94a3b8; }
.pipeline-stage-form[data-stage="contacted"]   .pipeline-edit-cell { border-left-color: #fbbf24; }
.pipeline-stage-form[data-stage="qualified"]   .pipeline-edit-cell { border-left-color: #60a5fa; }
.pipeline-stage-form[data-stage="proposal"]    .pipeline-edit-cell { border-left-color: #a78bfa; }
.pipeline-stage-form[data-stage="won"]         .pipeline-edit-cell { border-left-color: #10b981; }
.pipeline-stage-form[data-stage="lost"]        .pipeline-edit-cell { border-left-color: #ef4444; }
/* Trigger button that toggles the detail <tr>. Looks like plain text but is
   a full clickable target so the entire name cell is hit-able. */
.pipeline-row-trigger {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  width: 100%;
  text-align: left;
}
.pipeline-row-trigger:focus-visible {
  outline: 2px solid var(--pico-primary-focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.pipeline-summary-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.pipeline-row-trigger .pipeline-disclosure {
  display: inline-block;
  width: 0.85rem;
  color: #646b79;
  font-size: 0.85rem;
  line-height: 1;
  transition: transform 0.12s ease;
  flex-shrink: 0;
}
.pipeline-row.is-open .pipeline-row-trigger .pipeline-disclosure {
  transform: rotate(90deg);
  color: #646b79;
}
.pipeline-row-trigger:hover .pipeline-disclosure { color: #373c44; }

/* Pico redefines --pico-color locally on buttons to var(--pico-primary-inverse)
   (white) so its filled button text reads on a coloured background. Our trigger
   is a transparent button on a white row; reset the variable + the color. */
.pipeline-row-trigger {
  --pico-color: #373c44;
  color: #373c44;
  background-color: transparent !important;
}
.pipeline-row-trigger strong,
.pipeline-row-trigger small { color: inherit; }

/* The detail <tr> sits flush against its main row: drawer carries its own
   spacing so the <td> doesn't need any. */
.pipeline-row-detail > td { padding: 0; }

.pipeline-drawer {
  background: var(--gp-panel-bg);
  border: 1px solid var(--gp-panel-border);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 0.25rem 0.4rem 0.6rem;
}
.pipeline-drawer-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .pipeline-drawer-grid { grid-template-columns: 1fr; }
}
.pipeline-drawer-left,
.pipeline-drawer-right { min-width: 0; }
.pipeline-drawer h5 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pico-muted-color);
  margin: 0 0 0.5rem;
}
.pipeline-drawer-subhead { margin-top: 1.25rem !important; }
.pipeline-drawer-contact {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem 0.75rem;
}
.pipeline-drawer-contact .span-2 { grid-column: span 3; }
.pipeline-drawer-contact label { margin: 0; font-size: 0.8rem; }
.pipeline-drawer-contact input,
.pipeline-drawer-contact select { margin-top: 0.15rem; }
@media (max-width: 700px) {
  .pipeline-drawer-contact { grid-template-columns: 1fr; }
  .pipeline-drawer-contact .span-2 { grid-column: span 1; }
}
.pipeline-drawer-link {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}
.activity-feed-cap {
  display: block;
  margin-top: 0.5rem;
  color: var(--pico-muted-color);
  font-style: italic;
}
.activity-feed-empty {
  list-style: none;
  padding: 0.5rem 0;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  font-style: italic;
  border-bottom: none;
}

/* System-activity collapsible (stage/owner changes etc.) — collapsed by default
   so the comments feed reads clean. */
.pipeline-system-activity {
  margin-top: 1rem;
  border-top: 1px dashed var(--gp-panel-border);
  padding-top: 0.75rem;
}
.pipeline-system-activity > summary {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pico-muted-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pipeline-system-activity > summary:hover { color: var(--pico-color); }
.pipeline-system-activity[open] > summary { margin-bottom: 0.5rem; }
.pipeline-system-count {
  background: var(--gp-panel-bg-hover);
  color: var(--pico-color);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0;
  text-transform: none;
}
.pipeline-system-activity .system-feed .activity-entry { padding: 0.35rem 0; }

/* Comment composer (right column of the drawer). */
.pipeline-comment-form { margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.pipeline-comment-form textarea { margin: 0; min-height: 8rem; }
.pipeline-comment-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.pipeline-comment-tip {
  color: var(--pico-muted-color);
  font-size: 0.75rem;
  white-space: nowrap;
}
.pipeline-comment-tip kbd {
  background: var(--pico-card-background-color);
  color: var(--pico-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 3px;
  padding: 0 0.3rem;
  font-size: 0.7rem;
  font-family: inherit;
}
/* Override Pico's default full-width submit button — we want it sized to content. */
.pipeline-comment-form button[type="submit"] {
  width: auto;
  margin: 0;
  padding: 0.4rem 1.2rem;
  flex-shrink: 0;
}

/* Empty-list state: centered card with the inline add-row form. */
.pipeline-empty {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}
.pipeline-empty-inner {
  max-width: 640px;
  width: 100%;
  text-align: left;
}
.pipeline-empty-inner h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}
.pipeline-empty-inner > p {
  color: var(--pico-muted-color);
  margin-bottom: 1.25rem;
}

.activity-feed {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}
.activity-entry {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}
.activity-entry:last-child { border-bottom: none; }
.activity-entry-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--pico-muted-color);
}
.activity-entry-head strong { color: var(--pico-color); }
.activity-entry-body { font-size: 0.85rem; margin-top: 0.25rem; }

/* Pipeline add-row picker (unified single input + segmented control) */
.pipeline-add { position: relative; margin-top: 0.5rem; }
.pipeline-add-tabs {
  display: inline-flex;
  gap: 0;
  margin-bottom: 0.6rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 6px;
  overflow: hidden;
}
.pipeline-add-tab {
  background: var(--pico-card-background-color);
  color: var(--pico-muted-color);
  border: none;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  border-right: 1px solid var(--pico-muted-border-color);
  margin: 0;
}
.pipeline-add-tab:last-child { border-right: none; }
.pipeline-add-tab:hover { background: var(--gp-panel-bg); }
.pipeline-add-tab.active {
  background: #0E3A5A;
  color: white;
}

.pipeline-add-search { position: relative; }
.pipeline-add-search input { margin: 0; }
.pipeline-add-hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--pico-muted-color);
  font-size: 0.75rem;
}

.pipeline-picker-results {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  max-height: 280px;
  overflow-y: auto;
}
.pipeline-picker-results li { border-bottom: 1px solid var(--pico-muted-border-color); }
.pipeline-picker-results li:last-child { border-bottom: none; }
.pipeline-picker-results a {
  display: block;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  text-decoration: none;
  color: inherit;
}
.pipeline-picker-results a:hover { background: var(--gp-panel-bg); }
.pipeline-picker-empty { padding: 0.5rem 0.6rem; color: var(--pico-muted-color); font-size: 0.85rem; }
.pipeline-picker-added {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.6rem; font-size: 0.85rem;
  color: var(--pico-muted-color); cursor: default;
}
.pipeline-picker-added-tag { margin-left: auto; font-size: 0.72rem; font-style: italic; white-space: nowrap; }

/* ── Kanban quick-view panel (card-click) ── */
.quickview-dialog {
  width: min(72rem, 94vw);
  max-width: 94vw;
  max-height: 90vh;
  padding: 0;
  border: none;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  overflow: hidden;
  /* Tinted canvas — content sections sit on top as white cards (3-tier depth). */
  background: var(--gp-panel-bg);
}
.quickview-dialog::backdrop { background: rgba(14, 58, 90, 0.45); }
.quickview-scroll { max-height: 90vh; overflow-y: auto; }
.quickview-loading { padding: 2rem; text-align: center; color: var(--pico-muted-color); }
.quickview-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--gp-panel-border);
  position: sticky; top: 0; z-index: 1;
  background: var(--pico-card-background-color);   /* white bar over the grey canvas */
  box-shadow: 0 1px 3px rgba(14, 58, 90, 0.06);
}
.quickview-title {
  font-weight: 700; flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--pico-primary);                      /* navy title accent */
}
.quickview-title a { color: var(--pico-primary); }
.quickview-controls { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.quickview-controls .pipeline-edit-form { margin: 0; }
.quickview-close {
  border: none; background: none; font-size: 1.5rem; line-height: 1;
  cursor: pointer; color: var(--pico-muted-color); padding: 0 0.25rem;
}
.quickview-close:hover { color: var(--pico-primary); }
/* Neutralise the drawer's own frame; the canvas comes from the dialog. */
.quickview-body .pipeline-drawer {
  border: none; margin: 0; border-radius: 0; background: transparent;
  padding: 1.1rem;
}
/* Lift the drawer's two columns into white cards on the grey canvas. */
.quickview-body .pipeline-drawer-left,
.quickview-body .pipeline-drawer-right {
  background: var(--pico-card-background-color);
  border: 1px solid var(--gp-panel-border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
}
.quickview-body .pipeline-drawer h5 { color: var(--pico-primary); }

@media (max-width: 700px) {
  .quickview-dialog {
    width: 100vw; max-width: 100vw;
    height: 100dvh; max-height: 100dvh; border-radius: 0;
  }
  .quickview-scroll { max-height: 100dvh; }
}

.pipeline-add-free .add-row-grid { margin-top: 0; }

/* Contact toevoegen — action bar with button-pill disclosure */
.contact-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0;
}
.contact-actions-pill { padding: 0.3rem 0.85rem; font-size: 0.8rem; margin: 0 !important; }
.contact-actions-link { font-size: 0.8rem; }

.contact-form-disclosure { margin: 0; }
.contact-form-disclosure > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--pico-primary);
  background: var(--pico-background-color);
  border: 1px solid var(--pico-primary);
  border-radius: var(--pico-border-radius);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background 120ms ease, color 120ms ease;
}
.contact-form-disclosure > summary::-webkit-details-marker { display: none; }
.contact-form-disclosure > summary::after { display: none; }
.contact-form-disclosure > summary:hover {
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
}
.contact-form-disclosure[open] > summary {
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
}
.contact-form-disclosure > summary > span { font-weight: 700; font-size: 0.95rem; line-height: 1; }
/* When opened inside the action bar, the form panel claims the full row so
   the Lusha/Telefoon links wrap below the form instead of sitting beside it. */
.contact-form-disclosure[open] { flex-basis: 100%; }
.contact-form {
  margin-top: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  background: var(--gp-panel-bg);
  border: 1px solid var(--gp-panel-border);
  border-radius: var(--pico-border-radius);
}
.contact-form .grid { margin-bottom: 0.5rem; }
.contact-form label { margin-bottom: 0.75rem; }
.contact-form small { color: var(--pico-muted-color); }
.contact-form-required {
  color: var(--pico-del-color, #c62828);
  text-decoration: none;
  margin-left: 0.1rem;
}
.contact-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.25rem;
}
.contact-form-actions input[type="submit"] { margin-bottom: 0; width: 100%; }
@media (min-width: 576px) {
  .contact-form-actions input[type="submit"] { width: auto; min-width: 9rem; }
}

/* ── Utility classes (design-system) ──
   Sizes that previously lived as repeated inline styles across views.
   Applied alongside Pico's button/badge classes, e.g. "outline secondary btn-xs". */
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.85rem; margin: 0; }
.btn-xs { padding: 0.25rem 0.6rem; font-size: 0.8rem; margin: 0; }
.badge-sm { font-size: 0.65rem; padding: 0.1rem 0.4rem; }

/* Busy feedback for Turbo form submissions: aria-busy is set/cleared by the
   global turbo:submit-start/-end listeners in controllers/application.js.
   pointer-events blocks double-submits while the request is in flight. */
form[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

/* ── Show-page header (company cockpit) ──
   Title row: h1 + reference chips (Companyweb) side by side. The lead ACTIONS
   (status / volgen / lijst) live in .lead-action-bar above the Reacties feed,
   so changing a status sits next to writing down why. */
.show-header-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.show-header-row h1 { margin-bottom: 0; }

/* Score block in the top-right corner of the title row. */
.show-score {
  margin-left: auto;
  display: flex; flex-direction: column; align-items: center;
  line-height: 1; flex-shrink: 0;
  padding: 0.3rem 1rem;
  background: var(--gp-panel-bg);
  border: 1px solid var(--gp-panel-border);
  border-radius: 10px;
}
.show-score-label {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--pico-muted-color);
  margin-bottom: 0.15rem;
}
.show-score-value { font-size: 2.6rem; font-weight: 700; font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* Chip row under the title (cooling tags + list memberships). */
.show-chips {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  margin: 0.5rem 0 0.75rem;
}

/* Navy reference chip next to the page title (external lookups). */
.title-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.8rem; font-weight: 600; white-space: nowrap;
  padding: 0.25rem 0.7rem; border-radius: 999px;
  background: #e7edf2; color: #0E3A5A; border: 1px solid #b9ccd8;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.title-chip:hover { background: #0E3A5A; color: #fff; border-color: #0E3A5A; }

/* Action bar above the comments feed (status select + volgen + lijst). */
.lead-action-bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  padding-bottom: 0.75rem; margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}
.lead-action-bar form { margin: 0; }
.lead-action-bar-label {
  font-size: 0.82rem; font-weight: 600; color: #475569;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-right: 0.25rem;
}

/* Segmented status control (Apple HIG pattern: all options visible, current
   segment filled in its status color, one tap to switch). Radios are visually
   hidden but keyboard-focusable; outcome-guard intercepts the rejected segment. */
.status-segmented {
  display: inline-flex;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--pico-card-background-color);
}
.status-segment {
  position: relative;
  display: inline-flex; align-items: center;
  margin: 0; padding: 0.35rem 0.85rem;
  font-size: 0.8rem; font-weight: 600;
  color: var(--pico-muted-color);
  cursor: pointer; user-select: none; white-space: nowrap;
  border-right: 1px solid var(--pico-muted-border-color);
  transition: background 0.15s, color 0.15s;
}
.status-segment:last-child { border-right: none; }
.status-segment:hover { background: var(--gp-panel-bg); color: var(--pico-color); }
.status-segment input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
  width: 1px; height: 1px; margin: 0;
}
.status-segment:has(input:focus-visible) { outline: 2px solid var(--pico-primary); outline-offset: -2px; }
.status-segment-new:has(input:checked)      { background: #dbeafe; color: #1e40af; }
.status-segment-approved:has(input:checked) { background: #d1fae5; color: #065f46; }
.status-segment-rejected:has(input:checked) { background: #fee2e2; color: #991b1b; }

/* Quiet external link inside an action cluster (HubSpot). */
.toolbar-link {
  font-size: 0.8rem; color: var(--pico-muted-color);
  text-decoration: none; white-space: nowrap;
}
.toolbar-link:hover { color: var(--pico-primary); }

/* List-membership chips: rendered inline in the meta line under the title. */
.membership-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.15rem 0.6rem; border-radius: 9999px;
  font-size: 0.72rem; font-weight: 600; vertical-align: middle;
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
  text-decoration: none;
}
.membership-chip:hover { border-color: var(--pico-primary); color: var(--pico-primary); }
.membership-chip-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex-shrink: 0; }

/* ── Mobile overrides ──
   Kept at the END of the file: most rules below override base rules defined
   earlier with the same specificity, so they must come last in the cascade.
   Everything here is scoped to small viewports or touch-only devices and
   leaves the desktop rendering untouched. */

/* Two-column block that collapses on small screens (scrape logs, etc.). */
.grid-2col { grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .grid-2col { grid-template-columns: 1fr; } }

/* Touch devices: text fields under 16px make iOS Safari zoom in on focus and
   stay zoomed. Bump form controls to 16px wherever the primary input is touch;
   desktop (hover-capable) keeps the compact sizing. !important so this a11y
   floor also beats higher-specificity compact-font rules and inline styles. */
@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select, textarea {
    font-size: 16px !important;
  }
}

@media (max-width: 640px) {
  th, td { padding: 0.45rem 0.5rem; }

  /* Filter bar: tidy two-per-row controls instead of ragged intrinsic widths. */
  .filters > select, .filters > input { flex: 1 1 calc(50% - 0.25rem); min-width: 0; }
  .filters > .filters-search, .filters > .filters-wide { flex: 1 1 100%; min-width: 0; }
  .icp-segment-grid { grid-template-columns: 1fr; }

  /* Prospect rows (Gevolgd): let the summary wrap; the contact preview is
     redundant with the expanded panel, drop it to save the line. */
  .prospect-summary { flex-wrap: wrap; row-gap: 0.35rem; position: relative; padding-right: 2.25rem; }
  .prospect-expand-icon { position: absolute; right: 0.75rem; top: 0.95rem; }
  .prospect-main { flex: 1 1 calc(100% - 3.5rem); }
  .prospect-contact-preview { display: none; }
  .prospect-signals { flex: 0 1 auto; }
  .prospect-detail-grid { grid-template-columns: 1fr; gap: 1rem; }
  .prospect-detail-open { max-height: none; }

  /* Kanban: one column per swipe instead of a 1200px-wide grid. */
  .kanban-board {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 80vw;
    scroll-snap-type: x proximity;
    padding-bottom: 0.5rem;
  }
  .kanban-column { scroll-snap-align: start; }

  .add-row-grid { grid-template-columns: 1fr; }
  .pipeline-kpis { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 520px) {
  /* Bulk action bar: full-width and wrappable so it never overflows. */
  .bulk-bar {
    left: 0.75rem; right: 0.75rem; transform: none;
    white-space: normal; flex-wrap: wrap; justify-content: center;
    bottom: -12rem;
  }
  .bulk-bar-visible { bottom: 0.75rem; }
  .bulk-bar-select { min-width: 0; flex: 1 1 auto; }
}
