/* ───────────────────────────────────────────────────────────────────────────
   Remote Venezuela Hiring — design system
   Blue accent, light/dark themes, modular type + spacing scale.
   ─────────────────────────────────────────────────────────────────────────── */

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

:root {
  /* Pin native controls (checkbox, select, scrollbar) to our theme, not the
     OS — otherwise an OS in dark mode renders them dark on our light theme. */
  color-scheme: light;

  /* ── Surfaces & text ─────────────────────────────────────────────────── */
  --bg:            #eef2f8;
  --surface:       #ffffff;
  --surface-alt:   #f4f7fc;
  --border:        #d0daea;
  --border-strong: #96adc8;

  --text:          #0c1528;
  --text-muted:    #41566f;
  /* --text-subtle darkened from #8aa2ba (2.4:1, failed WCAG) to pass AA. */
  --text-subtle:   #5b7088;

  --accent:        #1d4ed8;
  --accent-hover:  #1b44bd;
  --accent-light:  #dbeafe;

  --accepts-bg:    #dcfce7;
  --accepts-text:  #156433;
  --accepts-border:#86efac;

  --rejects-bg:    #fee2e2;
  --rejects-text:  #a31616;
  --rejects-border:#fca5a5;

  --unknown-bg:    #eef2f7;
  --unknown-text:  #4a5f78;
  --unknown-border:#c8d6e6;

  --stale-bg:      #fef9e7;
  --stale-text:    #815108;
  --stale-border:  #f3d77a;

  --notice-bg:     #fef9e7;
  --notice-text:   #6b4310;
  --notice-border: #f3d77a;

  --tag-bg:        #e7eefb;
  --tag-text:      #1e3a8a;
  --tag-border:    #c9d9f6;

  --row-hover:     #f0f5fe;

  /* ── Radii ───────────────────────────────────────────────────────────── */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  14px;
  --radius-pill: 999px;

  /* ── Type scale (base 15px) ──────────────────────────────────────────── */
  --fs-xs:   12px;
  --fs-sm:   13px;
  --fs-base: 15px;
  --fs-md:   17px;
  --fs-lg:   20px;
  --fs-xl:   27px;
  --fs-2xl:  34px;
  --fs-3xl:  42px;

  /* ── Spacing scale ───────────────────────────────────────────────────── */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  24px;
  --sp-6:  32px;
  --sp-7:  48px;
  --sp-8:  64px;

  /* Table row vertical padding — overridden by [data-density="compact"]. */
  --row-pad-y: var(--sp-3);

  --shadow-sm: 0 1px 2px rgba(12, 21, 40, 0.06);
  --shadow-md: 0 6px 24px rgba(12, 21, 40, 0.10);

  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-sans:    "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", "Courier New", monospace;
}

/* Scoped to :root so the data-* attributes on theme/density toggle buttons
   (which carry the same attribute names) don't inherit these overrides. */
:root[data-density="compact"] { --row-pad-y: var(--sp-2); }

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:            #0c1424;
  --surface:       #111c32;
  --surface-alt:   #172240;
  --border:        #243a63;
  --border-strong: #3a5688;

  --text:          #e4eefb;
  --text-muted:    #9fb9d6;
  /* --text-subtle raised from #2e4d78 (1.6:1, invisible) to pass AA. */
  --text-subtle:   #8ba3c0;

  --accent:        #5b95f7;
  --accent-hover:  #74a6f9;
  --accent-light:  rgba(91, 149, 247, 0.16);

  --accepts-bg:    rgba(34, 197, 94, 0.12);
  --accepts-text:  #5fd98a;
  --accepts-border:rgba(95, 217, 138, 0.30);

  --rejects-bg:    rgba(239, 68, 68, 0.13);
  --rejects-text:  #f7918d;
  --rejects-border:rgba(247, 145, 141, 0.30);

  --unknown-bg:    rgba(255, 255, 255, 0.05);
  --unknown-text:  #a7bdd6;
  --unknown-border:rgba(255, 255, 255, 0.12);

  --stale-bg:      rgba(251, 191, 36, 0.10);
  --stale-text:    #f0c14b;
  --stale-border:  rgba(240, 193, 75, 0.32);

  --notice-bg:     rgba(251, 191, 36, 0.08);
  --notice-text:   #f0c771;
  --notice-border: rgba(240, 193, 75, 0.30);

  --tag-bg:        rgba(91, 149, 247, 0.14);
  --tag-text:      #a9c4f3;
  --tag-border:    rgba(91, 149, 247, 0.26);

  --row-hover:     rgba(91, 149, 247, 0.06);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
}

/* ─── Base ───────────────────────────────────────────────────────────────── */

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image: radial-gradient(ellipse 120% 50% at 50% -15%,
    rgba(29, 78, 216, 0.10) 0%, transparent 55%);
}

:root[data-theme="dark"] body {
  background-image: radial-gradient(ellipse 120% 50% at 50% -15%,
    rgba(91, 149, 247, 0.12) 0%, transparent 55%);
}

main { flex: 1; }

h1, h2, h3 { font-family: var(--font-display); }

a { color: var(--accent); }

::selection { background: var(--accent-light); color: var(--accent); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) { outline: none; }

.is-hidden, [hidden] { display: none !important; }

/* Respect users who ask for less motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.skip-link {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff;
  padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-md);
  font-weight: 600; z-index: 200;
}
.skip-link:focus { left: var(--sp-4); top: var(--sp-3); }

/* ─── NavBar ─────────────────────────────────────────────────────────────── */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--sp-2) var(--sp-5);
}

.nav-brand {
  display: flex; align-items: center; gap: var(--sp-2);
  text-decoration: none;
}

.nav-logo {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  background-color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.35);
}

.nav-brand-text { display: flex; flex-direction: column; align-items: flex-start; }
.nav-brand-title {
  font-size: var(--fs-base); font-weight: 800; color: var(--text);
  letter-spacing: -0.02em; line-height: 1.15; font-family: var(--font-display);
}
.nav-brand-kicker {
  font-size: 10px; color: var(--text-subtle); letter-spacing: 0.08em;
  line-height: 1; text-transform: uppercase; font-family: var(--font-display);
  font-weight: 700;
}

.nav-links { display: flex; gap: var(--sp-1); margin-left: var(--sp-4); flex: 1; }

.nav-link {
  cursor: pointer;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.12s, background-color 0.12s;
}
.nav-link:hover { color: var(--text); background: var(--surface-alt); }
.nav-link.is-active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}

.nav-actions { display: flex; align-items: center; gap: var(--sp-2); }

.nav-icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.nav-icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Navbar settings menu ───────────────────────────────────────────── */

.nav-settings { position: relative; }

.settings-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--sp-3);
  z-index: 110;
}
.settings-group + .settings-group { margin-top: var(--sp-3); }
.settings-menu-label {
  font-size: 10px; font-weight: 800; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 6px;
}
.settings-seg {
  display: flex;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.settings-seg-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: var(--fs-sm); font-weight: 600;
  font-family: var(--font-sans);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.12s;
}
.settings-seg-btn:hover { color: var(--text); }
.settings-seg-btn[aria-checked="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] .settings-seg-btn[aria-checked="true"] { background: var(--surface-alt); }

.nav-github {
  display: flex; align-items: center; gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  background-color: var(--surface);
  transition: color 0.12s, border-color 0.12s;
}
.nav-github:hover { border-color: var(--accent); color: var(--accent); }
.nav-github-label { display: inline; }

/* ─── Page shells ────────────────────────────────────────────────────────── */

.page          { max-width: 1320px; margin: 0 auto; padding: 0 var(--sp-5) var(--sp-8); }
.page-company  { max-width: 820px;  margin: 0 auto; padding: var(--sp-6) var(--sp-5) var(--sp-8); }
.page-stats    { max-width: 1040px; margin: 0 auto; padding: var(--sp-6) var(--sp-5) var(--sp-8); }

/* ─── Hero (index) ───────────────────────────────────────────────────────── */

.hero { padding: var(--sp-7) 0 var(--sp-5); }

.hero-title {
  font-size: var(--fs-3xl);
  font-weight: 800; color: var(--text);
  letter-spacing: -0.03em; line-height: 1.1;
  max-width: 18ch;
}

.hero-lede {
  margin-top: var(--sp-3);
  font-size: var(--fs-md);
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 60ch;
}

.hero-stats {
  margin-top: var(--sp-4);
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
}
.hero-stat {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 5px var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  white-space: nowrap;
}
.hero-stat strong {
  font-size: var(--fs-md); font-weight: 800; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.hero-stat-accepts { border-color: var(--accepts-border); background: var(--accepts-bg); color: var(--accepts-text); }
.hero-stat-accepts strong { color: var(--accepts-text); }
/* The last chip has no <strong>, so baseline alignment looks off-centre. */
.hero-stat:last-child { align-items: center; }

/* ─── Callouts ───────────────────────────────────────────────────────────── */

.callout {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.callout-icon { flex-shrink: 0; margin-top: 2px; }
.callout-link { color: var(--accent); text-decoration: none; font-weight: 700; white-space: nowrap; }
.callout-link:hover { text-decoration: underline; }

.callout-notice {
  margin-top: var(--sp-4);
  background-color: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-left: 4px solid var(--notice-border);
  color: var(--notice-text);
  max-width: 72ch;
}

.callout-disclaimer {
  margin-top: var(--sp-5);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
  line-height: 1.6;
}

.callout-stale {
  margin-top: var(--sp-5);
  background-color: var(--surface);
  border: 1px solid var(--stale-border);
  border-left: 4px solid var(--stale-text);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  display: block;
}
.callout-stale-head {
  font-size: var(--fs-xs); font-weight: 800; color: var(--stale-text);
  margin-bottom: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-1);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.callout-stale-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.stale-chip {
  padding: 4px var(--sp-3); border-radius: var(--radius-sm);
  background-color: var(--stale-bg);
  color: var(--stale-text);
  border: 1px solid var(--stale-border);
  font-size: var(--fs-xs); font-weight: 600;
  text-decoration: none;
}
.stale-chip:hover { background-color: color-mix(in srgb, var(--stale-bg) 70%, var(--stale-text)); }

.noscript-notice {
  padding: var(--sp-3) var(--sp-4); margin: var(--sp-4) 0;
  background-color: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-left: 4px solid var(--notice-border);
  color: var(--notice-text);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
}

/* ─── Toolbar / filters (index) ──────────────────────────────────────────── */

.toolbar {
  display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center;
  padding: var(--sp-4) 0 var(--sp-3);
  border-top: 1px solid var(--border);
}

.search-field { position: relative; flex: 1 1 240px; min-width: 200px; max-width: 380px; }
.search-icon {
  position: absolute; left: var(--sp-3); top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle); pointer-events: none;
}
.search-input {
  width: 100%;
  padding: var(--sp-2) var(--sp-3) var(--sp-2) 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  outline: none;
  font-family: var(--font-sans);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.filter-toggle {
  display: none;
  align-items: center; gap: 6px;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-sm); font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
}
.filter-toggle:hover { border-color: var(--accent); color: var(--accent); }
.filter-toggle-count {
  background: var(--accent); color: #fff;
  border-radius: var(--radius-pill);
  font-size: 10px; font-weight: 800;
  min-width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

.filter-panel {
  display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center;
}

.filter-select {
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
}
.filter-select:hover { border-color: var(--border-strong); }

.filter-check {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); color: var(--text-muted);
  cursor: pointer; white-space: nowrap; user-select: none;
  padding: var(--sp-1) var(--sp-2);
}
.filter-check input { accent-color: var(--accent); cursor: pointer; width: 15px; height: 15px; }

.btn-ghost {
  padding: 6px var(--sp-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: transparent;
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: var(--sp-1);
  font-family: var(--font-sans);
  transition: color 0.12s, border-color 0.12s;
}
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Active filter chips ────────────────────────────────────────────────── */

.filter-chips {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  padding: var(--sp-1) 0 var(--sp-3);
}
.filter-chips:empty { display: none; }

.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 6px 3px var(--sp-3);
  border-radius: var(--radius-pill);
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  font-size: var(--fs-xs); font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
}
.filter-chip:hover { background: color-mix(in srgb, var(--accent-light) 65%, var(--accent)); }
.filter-chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ─── Status tabs (segmented control) ────────────────────────────────────── */

.status-tabs {
  display: flex; gap: var(--sp-2); flex-wrap: wrap;
  margin-bottom: var(--sp-4); align-items: center;
}

.status-tab {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 7px var(--sp-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-sm); font-weight: 600;
  cursor: pointer; white-space: nowrap;
  font-family: var(--font-sans);
  transition: border-color 0.12s, color 0.12s, background-color 0.12s;
}
.status-tab:hover { border-color: var(--border-strong); color: var(--text); }
.status-tab.is-active {
  border-color: var(--accent);
  background-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot-accepts { background-color: var(--accepts-text); }
.status-dot-rejects { background-color: var(--rejects-text); }
.status-dot-unknown { background-color: var(--unknown-text); }
.status-tab.is-active .status-dot { background-color: rgba(255, 255, 255, 0.9); }

.status-tab-count {
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background-color: var(--bg);
  color: var(--text-muted);
  font-size: 11px; font-weight: 800;
  min-width: 20px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.status-tab.is-active .status-tab-count {
  background-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.status-tab-results {
  margin-left: auto;
  font-size: var(--fs-sm); color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ─── Table ──────────────────────────────────────────────────────────────── */

.table-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.company-table {
  width: 100%; border-collapse: collapse;
}

.sort-th, .th-static {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background-color: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.sort-th { cursor: pointer; user-select: none; }
.sort-th:hover { color: var(--text); }
.sort-th.is-active { color: var(--accent); }
.sort-arrow { font-size: 9px; opacity: 0.3; line-height: 1; margin-left: 4px; }
.sort-th.is-active .sort-arrow { opacity: 1; }

.company-row {
  background-color: transparent;
  transition: background-color 0.1s;
  border-bottom: 1px solid var(--border);
}
.company-row:last-child { border-bottom: none; }
.company-row:hover { background-color: var(--row-hover); }
.company-row td { padding: var(--row-pad-y) var(--sp-4); vertical-align: middle; }

.company-link {
  font-size: var(--fs-base); font-weight: 700; color: var(--text);
  text-decoration: none;
}
.company-link:hover { color: var(--accent); }
.cell-domain {
  font-size: var(--fs-xs); color: var(--text-subtle);
  margin-top: 2px; font-family: var(--font-mono);
}
.cell-date { white-space: nowrap; font-size: var(--fs-sm); color: var(--text-muted); }
.cell-date.is-stale { color: var(--stale-text); font-weight: 600; }
.cell-muted { font-size: var(--fs-sm); color: var(--text-muted); }

.mini-tag {
  display: inline-block; margin-left: 6px;
  font-size: 10px; font-weight: 800;
  background-color: var(--bg);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  vertical-align: middle;
}

/* ─── Status badge ───────────────────────────────────────────────────────── */

.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px var(--sp-2);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 700;
  white-space: nowrap;
  line-height: 1.4;
  border: 1px solid;
}
.status-badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background-color: currentColor;
  flex-shrink: 0;
}
.status-badge-lg { padding: 6px var(--sp-3); font-size: var(--fs-sm); }
.status-badge-lg .status-badge-dot { width: 8px; height: 8px; }

.status-accepts {
  background-color: var(--accepts-bg);
  color: var(--accepts-text);
  border-color: var(--accepts-border);
}
.status-rejects {
  background-color: var(--rejects-bg);
  color: var(--rejects-text);
  border-color: var(--rejects-border);
}
.status-unknown {
  background-color: var(--unknown-bg);
  color: var(--unknown-text);
  border-color: var(--unknown-border);
}

.stale-marker {
  margin-left: 2px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background-color: var(--stale-bg);
  color: var(--stale-text);
  border: 1px solid var(--stale-border);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* ─── Tag badges ─────────────────────────────────────────────────────────── */

.tag-list { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.tag-badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600;
  background-color: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--tag-border);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.tag-more {
  font-size: 11px;
  color: var(--text-subtle);
  align-self: center;
  font-weight: 600;
}

/* ─── Empty state ────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center; padding: var(--sp-8) var(--sp-5);
  color: var(--text-muted); font-size: var(--fs-base);
}
.empty-dash { font-size: var(--fs-2xl); margin-bottom: var(--sp-2); opacity: 0.4; }
.empty-state .btn-ghost { display: inline-flex; margin-top: var(--sp-3); color: var(--accent); }

/* ─── Footer links (index) ───────────────────────────────────────────────── */

.page-footer-links {
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: var(--sp-4);
  font-size: var(--fs-sm);
}
.page-footer-links a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.page-footer-links a:hover { color: var(--accent); }

/* ─── Site footer ────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-4) 0;
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}
.footer-inner {
  max-width: 1320px; margin: 0 auto; padding: 0 var(--sp-5);
  text-align: center;
}
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ─── Company detail page ────────────────────────────────────────────────── */

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); color: var(--text-muted);
  text-decoration: none; font-weight: 600;
  transition: color 0.1s;
}
.back-link:hover { color: var(--accent); }

.company-card {
  margin-top: var(--sp-4);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.company-card-head {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
  background-color: var(--surface-alt);
  display: flex; justify-content: space-between;
  align-items: flex-start; flex-wrap: wrap; gap: var(--sp-4);
}
.company-card-titlerow { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.company-card-title {
  font-size: var(--fs-2xl); font-weight: 800; color: var(--text);
  letter-spacing: -0.03em; line-height: 1.15;
}
.company-card-website {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px;
  font-size: var(--fs-sm); color: var(--accent);
  text-decoration: none; font-weight: 600;
}
.company-card-website:hover { text-decoration: underline; }

.company-card-fields {
  padding: var(--sp-5) var(--sp-6);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.field-label {
  font-size: 10px; font-weight: 800; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 6px;
}
.field-value { font-size: var(--fs-base); color: var(--text); font-weight: 600; }
.field-value.is-stale { color: var(--stale-text); }
.field-mono { font-size: var(--fs-sm); color: var(--text-muted); font-family: var(--font-mono); font-weight: 400; }
.field-stale-note { margin-left: 6px; font-size: var(--fs-xs); font-weight: 700; }

.company-card-tags { padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--border); }
.company-card-tags:last-child { border-bottom: none; }
.company-card-notes { padding: var(--sp-4) var(--sp-6); }

.notes-body {
  font-size: var(--fs-base); color: var(--text); line-height: 1.7;
  padding: var(--sp-3) var(--sp-4);
  background-color: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  margin-top: 6px;
}

/* ─── Stats page ─────────────────────────────────────────────────────────── */

.stats-title {
  font-size: var(--fs-2xl); font-weight: 800; color: var(--text);
  letter-spacing: -0.03em; margin-bottom: 6px;
}
.stats-lede { font-size: var(--fs-base); color: var(--text-muted); margin-bottom: var(--sp-5); }

/* Single stacked proportion bar — the headline insight. */
.proportion {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.proportion-title {
  font-size: var(--fs-xs); font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: var(--sp-3);
}
.proportion-bar {
  display: flex;
  height: 28px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
}
.proportion-seg {
  height: 100%;
  transition: width 0.5s ease;
  min-width: 2px;
}
.proportion-seg.seg-accepts { background-color: var(--accepts-text); }
.proportion-seg.seg-rejects { background-color: var(--rejects-text); }
.proportion-seg.seg-unknown { background-color: var(--unknown-border); }
.proportion-legend {
  display: flex; flex-wrap: wrap; gap: var(--sp-4);
  margin-top: var(--sp-3);
}
.proportion-key {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); color: var(--text-muted);
}
.proportion-key b { color: var(--text); font-variant-numeric: tabular-nums; }
.proportion-key .status-dot { width: 10px; height: 10px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.stat-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-sm);
}
.stat-card-label {
  font-size: var(--fs-xs); font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.stat-card-value {
  font-size: var(--fs-3xl); font-weight: 800; color: var(--text);
  letter-spacing: -0.03em; line-height: 1;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}
.stat-card-sub { font-size: var(--fs-xs); color: var(--text-subtle); }

.stat-card-accepts { border-top-color: var(--accepts-text); }
.stat-card-accepts .stat-card-value { color: var(--accepts-text); }
.stat-card-rejects { border-top-color: var(--rejects-text); }
.stat-card-rejects .stat-card-value { color: var(--rejects-text); }
.stat-card-unknown { border-top-color: var(--unknown-text); }
.stat-card-unknown .stat-card-value { color: var(--unknown-text); }
.stat-card-stale { border-top-color: var(--stale-text); }
.stat-card-stale .stat-card-value { color: var(--stale-text); }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--sp-4);
}

.chart-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.chart-title {
  font-size: var(--fs-xs); font-weight: 800; color: var(--text);
  margin-bottom: var(--sp-5);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.bar-chart { display: flex; flex-direction: column; gap: var(--sp-4); }
.bar-row-head {
  display: flex; justify-content: space-between;
  margin-bottom: 6px; font-size: var(--fs-sm);
}
.bar-row-label { color: var(--text); font-weight: 600; }
.bar-row-meta { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.bar-row-pct { color: var(--text-subtle); font-size: var(--fs-xs); }
.bar-track {
  height: 10px;
  background-color: var(--bg);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background-color: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 0.5s ease;
}

/* ─── Responsive: tablet ─────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero { padding: var(--sp-6) 0 var(--sp-4); }
  .hero-title { font-size: var(--fs-2xl); }
  /* Trim the table to its essential columns between phone and desktop. */
  .company-table .hide-mobile { display: none; }
}

/* ─── Responsive: phone ──────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .page         { padding: 0 var(--sp-4) var(--sp-7); }
  .page-company,
  .page-stats   { padding: var(--sp-5) var(--sp-4) var(--sp-7); }
  .nav-inner    { padding: var(--sp-2) var(--sp-4); }
  .nav-links    { margin-left: var(--sp-2); }
  .nav-github-label { display: none; }

  .hero-title { font-size: var(--fs-xl); }
  .hero-lede  { font-size: var(--fs-base); }

  /* Search takes the full row; filters collapse behind a toggle button. */
  .search-field { flex-basis: 100%; max-width: none; }
  .filter-toggle { display: inline-flex; }
  .filter-panel {
    flex-basis: 100%;
    flex-direction: column; align-items: stretch;
    gap: var(--sp-2);
    padding: var(--sp-3);
    margin-top: var(--sp-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-alt);
  }
  .filter-panel.is-collapsed { display: none; }
  .filter-select { width: 100%; }

  .status-tab-results {
    margin-left: 0; flex-basis: 100%; order: 3;
  }

  /* Table → stacked cards. */
  .company-table,
  .company-table tbody,
  .company-table tr,
  .company-table td { display: block; }
  .company-table thead { display: none; }

  .company-row { padding: var(--sp-4); }
  .company-row td { padding: 0; }
  .company-row .cell-name { margin-bottom: var(--sp-3); }
  .company-link { font-size: var(--fs-md); }

  .company-row td:not(.cell-name) {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-3);
    padding: 7px 0;
    border-top: 1px solid var(--border);
    font-size: var(--fs-sm);
  }
  .company-row td:not(.cell-name)::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-weight: 700;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
  }
  /* In card mode every field is shown — override the tablet hide. */
  .company-table .hide-mobile { display: flex; }
  .company-row .tag-list { justify-content: flex-end; }

  .chart-grid { grid-template-columns: 1fr; }
  .company-card-head,
  .company-card-fields,
  .company-card-tags,
  .company-card-notes { padding-left: var(--sp-4); padding-right: var(--sp-4); }
}
