/* TenderTracker: one light theme. Every colour is a token here, so a later
   theme change touches this block only. */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --surface-3: #eef1f7;
  --hover: #f7f9fd;
  --line: #e1e6ef;
  --line-strong: #d5dbe7;
  --line-soft: #edf0f5;
  --ink: #141a2a;
  --ink-2: #38425a;
  --muted: #5b6680;
  --faint: #7a849b;
  --grip: #cdd4e2;
  --grip-strong: #c3cad8;
  --line-hover: #b5bfd3;
  --badge: #e8ecf4;
  --brand-soft-hover: #dbe4fb;
  --ok-line: #c6e2b0;
  --star-row: #fffcf2;
  --brand: #2f5bd8;
  --brand-ink: #2449b8;
  --brand-ink-hover: #16337f;
  --brand-deep: #1e3fa8;
  --brand-soft: #e8eefc;
  --brand-softer: #eef2fb;
  --on-brand: #ffffff;
  --urgent: #c2410c;
  --soon: #9a5b00;
  --ok: #2f6a12;
  --ok-soft: #e6f4dc;
  --ok-dot: #3f8a17;
  --warn-dot: #d48a00;
  --warn-soft: #fff6e0;
  --warn-ink: #7a4f00;
  --warn-line: #f0d48a;
  --danger: #b4321f;
  --danger-soft: #fdecea;
  --danger-line: #f3c0b8;
  --star: #e0a100;
  --star-ink: #c58a00;
  --star-off: #9aa3b6;
  --mark: #fff1b8;
  --backdrop: rgba(20, 26, 42, 0.28);
  --stage-new: #5b6680;
  --stage-reviewing: #2449b8;
  --stage-bidding: #9a5b00;
  --stage-submitted: #6a3fc4;
  --stage-won: #2f6a12;
  --stage-lost: #b4321f;
  --stage-no_bid: #5b6680;
  --stage-irrelevant: #6c7489;
  --src-canadabuys-bg: #e6edff;
  --src-canadabuys-ink: #1e3fa8;
  --src-samgov-bg: #fde9e5;
  --src-samgov-ink: #9b2c1a;
  --src-seao-bg: #e0f3f6;
  --src-seao-ink: #155e6e;
  --src-email-bg: #e6f4dc;
  --src-email-ink: #2f6a12;
  --shadow: 0 1px 2px rgba(20, 26, 42, 0.04);
  --shadow-menu: 0 14px 36px rgba(20, 26, 42, 0.14);
  --shadow-panel: -18px 0 40px rgba(20, 26, 42, 0.16);
  --radius: 12px;
  --font: "Saira", system-ui, "Segoe UI", sans-serif;
  --display: "Saira", system-ui, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}
button { font-family: inherit; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { color: var(--brand-ink-hover); text-decoration: underline; }
input::placeholder, textarea::placeholder { color: var(--faint); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* --- Header ---------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand strong { font-size: 18px; font-weight: 700; }
.brand span { font-size: 12px; color: var(--muted); }
.main-nav { display: flex; gap: 4px; }
.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}
.main-nav a:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.main-nav a.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.topbar-spacer { flex: 1 1 0; }
.topbar-tools { display: flex; align-items: center; gap: 8px; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 13px;
  font-weight: 700;
}
.dot {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok-dot);
}
.dot.is-warn { background: var(--warn-dot); }
.dot.is-bad { background: var(--urgent); }
.dot.is-busy { background: var(--brand); }
.dot.is-off { background: var(--star-off); }
.caret { flex: none; }

/* Menus: a button plus a panel; menus.js opens one at a time. */
.menu-wrap { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 240px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-menu);
  text-align: left;
}
.menu[hidden] { display: none; }
.menu.align-right { right: 0; }
.menu.align-left { left: 0; }
.menu form { margin: 0; }
.menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
a.menu-item:hover, .menu-item:hover, .menu-item:focus-visible { background: var(--brand-softer); color: var(--ink); text-decoration: none; }
.menu-item:disabled { color: var(--faint); cursor: not-allowed; background: transparent; }
.menu-item .grow { flex: 1 1 auto; }
.menu-item .count { color: var(--muted); font-size: 13px; }
.menu-item .check { width: 16px; color: var(--ok); font-weight: 700; }
.menu-label {
  padding: 8px 10px 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.menu-text { padding: 8px 10px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.menu-sep { height: 1px; margin: 4px 0; background: var(--line); }
.menu-note {
  margin: 4px 6px 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--warn-soft);
  color: var(--warn-ink);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.menu-note.is-bad { background: var(--danger-soft); color: var(--danger); }
.menu-note.is-ok { background: var(--ok-soft); color: var(--ok); }
.menu-scroll { max-height: 360px; overflow-y: auto; }

/* Sync status menu: one row per source. */
.status-menu { width: 380px; }
.status-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; font-size: 14px; }
.status-row .grow { flex: 1 1 auto; min-width: 0; }
.status-row .note { color: var(--muted); font-size: 13px; white-space: nowrap; }
.status-row .note.is-warn { color: var(--warn-ink); }
.status-row .note.is-bad { color: var(--urgent); font-weight: 600; }
.status-row .mini {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.status-row .mini:hover { border-color: var(--brand); color: var(--brand-ink); }
.status-row .mini:disabled { color: var(--faint); border-color: var(--line); cursor: not-allowed; }
.status-meta { padding: 4px 10px 6px; font-size: 12px; color: var(--muted); }

/* The one page-wide banner, only for a broken state. */
.alert-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 32px;
  background: var(--danger-soft);
  border-bottom: 1px solid var(--danger-line);
  color: var(--danger);
  font-size: 14px;
}
.alert-bar strong { font-weight: 600; }
.alert-bar .link-btn { color: var(--danger); }
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-ink);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Running syncs: a slim strip under the header. */
.sync-strip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 32px 8px;
  background: var(--brand-softer);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}
.sync-strip-run { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: center; gap: 4px 16px; }
.sync-progress { margin: 0; }
.sync-progress-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.sync-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--brand);
  transition: width 0.6s ease;
}
.sync-progress.is-indeterminate .sync-progress-fill {
  width: 35%;
  animation: sync-progress-slide 1.6s ease-in-out infinite;
}
.sync-progress.is-done .sync-progress-fill { width: 100%; background: var(--ok-dot); }
.sync-progress.is-failed .sync-progress-fill { background: var(--urgent); }
.sync-progress-label { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes sync-progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(290%); }
}
@media (prefers-reduced-motion: reduce) {
  .sync-progress-fill { transition: none; }
  .sync-progress.is-indeterminate .sync-progress-fill { animation: none; width: 100%; opacity: 0.5; }
}

/* --- Page shell ------------------------------------------------------------ */
.page { max-width: 1120px; margin: 0 auto; padding: 28px 20px 48px; }
.page.page-wide { max-width: 1440px; padding: 28px 32px 64px; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg);
}
.auth-panel {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-menu);
}
.auth-logo { display: block; width: min(280px, 100%); height: auto; margin: 0 auto 1.25rem; }
.auth-panel h1 { margin: 0.2rem 0 0.4rem; font-size: 1.65rem; text-align: center; }
.eyebrow {
  margin: 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--brand-ink);
}
.lede { margin: 0 0 1.25rem; color: var(--muted); text-align: center; }

.hero-strip {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.hero-strip h1 { margin: 0; font-size: 28px; font-weight: 700; }
.hero-strip p { margin: 0.35rem 0 0; color: var(--muted); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-scroll { position: relative; width: 100%; overflow-x: auto; }
.panel-head h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.panel-head p { margin: 0.35rem 0 0.9rem; color: var(--muted); font-size: 0.92rem; }
.empty-state { text-align: center; padding: 2rem 1.25rem; }
.empty-state h2 { margin-top: 0; font-size: 1.15rem; font-weight: 600; }
.empty-state p { color: var(--muted); }

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.stack { display: grid; gap: 0.9rem; }
.inline-form { display: flex; gap: 0.75rem; align-items: end; }
.inline-form .grow { flex: 1; }

/* --- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { border-color: var(--line-hover); background: var(--hover); color: var(--ink); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: var(--on-brand); }
.btn.secondary { background: var(--surface); color: var(--ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); border-color: var(--line); color: var(--ink); }
.btn.danger { color: var(--danger); }
.btn.is-on { border-color: var(--star); background: var(--warn-soft); color: var(--warn-ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface); border-color: var(--line-strong); }

/* --- Generic tables (radar, competitors, users, keywords, email log) ------- */
.data { width: 100%; border-collapse: collapse; font-size: 14px; }
.data th,
.data td {
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.data th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom-color: var(--line);
}
.data code { font-family: ui-monospace, "Cascadia Code", monospace; font-size: 0.92rem; color: var(--ink-2); }
.data tbody tr:hover { background: var(--hover); }
.data .num { text-align: right; font-variant-numeric: tabular-nums; }
/* Stay a table cell: display:flex on a <td> detaches it from the row. */
.actions { text-align: right; white-space: nowrap; }
.actions form { display: inline-block; margin: 0; }
.actions > * + * { margin-left: 0.4rem; }

/* Sortable headers (table.js). */
.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
a.th-sort:hover, .th-sort:hover { color: var(--ink); text-decoration: none; }
th[aria-sort="ascending"] .th-sort,
th[aria-sort="descending"] .th-sort { color: var(--ink); }
.th-sort .arrow { font-size: 11px; }

.pill, .chip, .set-aside-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.muted { background: var(--surface-3); color: var(--muted); }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.chip.more { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }

.flash {
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  margin: 0 0 1rem;
  font-size: 14px;
  font-weight: 500;
}
.flash.error { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line); }
.flash.warn { background: var(--warn-soft); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.flash.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }

.match-title { font-weight: 600; color: var(--ink); margin-bottom: 0.25rem; overflow-wrap: anywhere; }
.match-meta { color: var(--muted); font-size: 0.82rem; margin-bottom: 0.35rem; overflow-wrap: anywhere; }
.match-snippet { color: var(--ink-2); font-size: 0.88rem; line-height: 1.4; overflow-wrap: anywhere; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 0.12em; }
.keyword-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.new-badge { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }

/* Tabs, filters and chips, shared by Home and Radar. */
.inbox-toolbar,
.inbox-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
}
.inbox-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.inbox-tab,
.source-chip,
.sort-link,
.facet-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 32px;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}
.inbox-tab:hover,
.source-chip:hover,
.sort-link:hover,
.facet-chip:hover { border-color: var(--brand); color: var(--ink); text-decoration: none; }
.inbox-tab.is-on,
.source-chip.is-on,
.sort-link.is-on,
.facet-chip.is-on { background: var(--brand-soft); border-color: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.inbox-tab span { font-variant-numeric: tabular-nums; }
.source-chips,
.sort-toggle,
.facet-bar { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.facet-count { color: var(--muted); font-size: 12px; }
.facet-clear { flex-shrink: 0; font-size: 13px; font-weight: 600; }
.matches-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }

.closing-date { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.tone-critical, .closing-date.tone-critical { color: var(--urgent); }
.tone-soon, .closing-date.tone-soon { color: var(--soon); }
.tone-upcoming, .closing-date.tone-upcoming { color: var(--soon); }
.closing-date.tone-ok { color: var(--ink); }
.tone-past, .tone-none,
.closing-date.tone-past,
.closing-date.tone-none { color: var(--muted); font-weight: 500; }
.match-row.tone-past { opacity: 0.85; }
.match-row.is-starred { background: var(--star-row); }

.workflow-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; margin: 0.55rem 0 0; }
.workflow-bar form { margin: 0; }
.star-toggle {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--star-off);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.star-toggle:hover { background: var(--surface-3); color: var(--star-ink); }
.star-toggle.is-on { color: var(--star-ink); }
.star-toggle.is-on svg { fill: var(--star); }
.notes { margin-top: 0.4rem; font-size: 0.82rem; }
.notes summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.notes summary:hover { color: var(--ink); }
.notes-preview { color: var(--ink-2); font-weight: 500; }
.notes-form { display: grid; gap: 0.4rem; margin-top: 0.4rem; max-width: 36rem; }
.notes-form textarea { resize: vertical; }
.notes-form .btn { justify-self: start; }
.set-aside-badge { background: var(--ok-soft); color: var(--ok); flex: none; }
.outcome-line { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.outcome-line strong { color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.admin-hint { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.82rem; }
.attribution { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* --- Home ------------------------------------------------------------------ */
.home-head h1 { margin: 0; font-size: 28px; font-weight: 700; }
.home-head p { margin: 4px 0 18px; color: var(--muted); font-size: 14px; }
.stage-tabs { display: flex; gap: 24px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.stage-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 4px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}
.stage-tab:hover { color: var(--ink); text-decoration: none; }
.stage-tab.is-on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.stage-tab .badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--badge);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filter-bar form { margin: 0; }
.search-box { position: relative; display: block; width: 380px; margin: 0; }
.search-box svg { position: absolute; left: 12px; top: 11px; color: var(--faint); }
.search-box input[type="search"] { height: 38px; padding: 0 12px 0 36px; font-size: 14px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 500;
}
.filter-chip:hover { background: var(--brand-soft-hover); color: var(--brand-deep); text-decoration: none; }
.kw-menu { width: 280px; }
.kw-menu label.menu-item { display: flex; font-weight: 400; color: var(--ink); }
.kw-menu input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.kw-menu-actions { display: flex; justify-content: space-between; gap: 8px; padding: 8px 6px 4px; border-top: 1px solid var(--line); }
.seg-group { display: inline-flex; padding: 2px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); }
.seg {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.seg[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }

.wins-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 6px 6px 6px 12px;
  border: 1px solid var(--ok-line);
  border-radius: 8px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 13px;
}
.wins-line .grow { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wins-line form { margin: 0; }
.wins-line .btn { min-height: 28px; font-size: 13px; }

/* The tender table: fixed layout, sticky header, resizable columns and height. */
.table-box {
  height: 620px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
}
.grid-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 14px; }
.grid-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 8px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.grid-table th.col-star { padding: 8px 0 8px 16px; }
.grid-table td { padding: 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; overflow: hidden; }
.grid-table td.cell-star { padding: 10px 0 10px 16px; }
.grid-table td.cell-stage { padding-right: 16px; overflow: visible; }
.grid-table tbody tr:hover { background: var(--hover); }
.grid-table tbody tr.is-starred { background: var(--star-row); }
.grip {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 2;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}
.grip::after { content: ""; position: absolute; top: 25%; bottom: 25%; left: 4px; width: 1px; background: var(--grip); }
.grip:hover::after, .grip.is-dragging::after { left: 3px; width: 2px; background: var(--brand); }
.height-grip {
  display: grid;
  place-items: center;
  height: 14px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: var(--surface-2);
  cursor: row-resize;
  touch-action: none;
}
.height-grip span { width: 40px; height: 4px; border-radius: 2px; background: var(--grip-strong); }
.table-hint { margin: 12px 4px 0; font-size: 13px; color: var(--muted); }
.title-line { display: flex; align-items: flex-start; gap: 8px; }
.title-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.title-btn:hover { color: var(--brand-ink); text-decoration: underline; }
.sub-line { margin-top: 4px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buyer { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.src-badge { background: var(--surface-3); color: var(--ink-2); }
.src-badge.src-canadabuys { background: var(--src-canadabuys-bg); color: var(--src-canadabuys-ink); }
.src-badge.src-samgov { background: var(--src-samgov-bg); color: var(--src-samgov-ink); }
.src-badge.src-seao { background: var(--src-seao-bg); color: var(--src-seao-ink); }
.src-badge.src-email { background: var(--src-email-bg); color: var(--src-email-ink); }
.close-date { font-weight: 600; white-space: nowrap; }
.close-in { margin-top: 2px; font-size: 13px; white-space: nowrap; }
.density-compact .grid-table td { padding-top: 8px; padding-bottom: 8px; }
.density-compact .grid-table td.cell-star { padding-top: 4px; padding-bottom: 4px; }
.density-compact .sub-line,
.density-compact .stage-by,
.density-compact .close-in { display: none; }

/* Stage pill and its menu. */
.stage-pill {
  --stage: var(--stage-new);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--stage) 35%, transparent);
  background: color-mix(in srgb, var(--stage) 7%, transparent);
  color: var(--stage);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.stage-new { --stage: var(--stage-new); }
.stage-reviewing { --stage: var(--stage-reviewing); }
.stage-bidding { --stage: var(--stage-bidding); }
.stage-submitted { --stage: var(--stage-submitted); }
.stage-won { --stage: var(--stage-won); }
.stage-lost { --stage: var(--stage-lost); }
.stage-no_bid { --stage: var(--stage-no_bid); }
.stage-irrelevant { --stage: var(--stage-irrelevant); }
.stage-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--stage); flex: none; }
.stage-menu { min-width: 190px; }
.stage-by { margin-top: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Side panel ------------------------------------------------------------ */
.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  border: 0;
  background: var(--backdrop);
  cursor: default;
}
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  width: 580px;
  max-width: 100vw;
  overflow-y: auto;
  padding: 24px 28px 40px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-panel);
}
.side-panel[hidden], .panel-backdrop[hidden] { display: none; }
.sp-head { display: flex; align-items: flex-start; gap: 12px; }
.sp-head .grow { flex: 1 1 auto; min-width: 0; }
.sp-kicker { font-size: 13px; color: var(--muted); }
.sp-head h2 { margin: 6px 0 0; font-size: 21px; line-height: 1.3; overflow-wrap: anywhere; }
.sp-close { width: 40px; padding: 0; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.sp-actions .static { cursor: default; }
.sp-actions .static:hover { background: var(--surface); border-color: var(--line-strong); }
.sp-facts { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 16px; margin: 20px 0 0; font-size: 14px; }
.sp-facts dt { color: var(--muted); }
.sp-facts dd { margin: 0; overflow-wrap: anywhere; }
.sp-facts .stage-text { color: var(--stage); font-weight: 600; }
.side-panel h3 { margin: 24px 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sp-summary { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere; }
.sp-notes { display: grid; gap: 8px; }
.sp-notes textarea { resize: vertical; font-size: 14px; }
.sp-notes .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sp-muted { margin: 0; font-size: 14px; color: var(--muted); }
.sp-held { margin-bottom: 8px; padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn-ink); font-size: 14px; font-weight: 600; }
.past-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.past-table th { padding: 6px 8px 6px 0; text-align: left; border-bottom: 1px solid var(--line); }
.past-table th .th-sort { font-size: 11px; }
.past-table td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.past-table td.nowrap { white-space: nowrap; }
.past-table .what { margin-top: 2px; color: var(--muted); }
.sp-activity { margin: 0; padding: 0; list-style: none; }
.sp-activity li { padding: 4px 0; font-size: 13px; color: var(--ink-2); }

/* --- Award history: radar, competitors, past winners ----------------------- */
.count-note { color: var(--muted); font-weight: 600; margin-left: 0.35rem; }
.muted-note { color: var(--muted); font-size: 0.85em; }
.crumbs { margin: 0 0 0.5rem; font-size: 0.88rem; }
.radar-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 0.75rem; }
.radar-filters label { margin: 0; }
.radar-filters input[type="search"],
.radar-filters select,
.merge-form input[type="number"] { width: auto; padding: 0.45rem 0.65rem; font-size: 0.9rem; }
.radar-filters input[type="search"] { width: 13rem; }
.source-badge,
.reason-badge,
.watched-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  vertical-align: 1px;
}
.source-badge { background: var(--src-canadabuys-bg); color: var(--src-canadabuys-ink); }
.source-badge.source-seao { background: var(--src-seao-bg); color: var(--src-seao-ink); }
.source-badge.source-usaspending { background: var(--src-samgov-bg); color: var(--src-samgov-ink); }
.reason-badge { border: 1px solid var(--line-strong); color: var(--muted); }
.reason-badge.reason-series { border-style: dashed; }
.watched-badge { background: var(--warn-soft); color: var(--warn-ink); }
.is-offscope { opacity: 0.62; }
.follow-on {
  margin-top: 0.45rem;
  padding: 0.35rem 0.55rem;
  border-left: 3px solid var(--star);
  background: var(--warn-soft);
  border-radius: 0 6px 6px 0;
  font-size: 0.86rem;
}
.watch-label { color: var(--muted); font-size: 0.82rem; }
.data.radar { table-layout: fixed; width: 100%; }
.data.radar col.col-end { width: 17%; }
.data.radar col.col-title { width: 51%; }
.data.radar col.col-holder { width: 18%; }
.data.radar col.col-value { width: 14%; }
.data.radar td { vertical-align: top; overflow-wrap: anywhere; }
.cell-value { font-size: 0.88rem; }
.competitor-name { font-weight: 600; }
.buyer-line { display: block; font-size: 0.86rem; }
.award-list { list-style: none; margin: 0; padding: 0; }
.award-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.75rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.award-list li:last-child { border-bottom: 0; }
.award-list-title { font-weight: 600; }
.award-list .match-meta { flex: 1 0 100%; }
.merge-row { justify-content: space-between; }
.merge-row .match-meta { flex: initial; }
.merge-form { margin-top: 0.75rem; align-items: flex-end; }
.plain-list { margin: 0; padding-left: 1.1rem; }
.plain-list li { margin: 0.2rem 0; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1rem; }
.past-summary { margin: 0 0 0.45rem; font-weight: 600; color: var(--warn-ink); }
.past-list { list-style: none; margin: 0; padding: 0; }
.past-row { padding: 0.4rem 0; border-top: 1px solid var(--line-soft); }
.past-row:first-child { border-top: 0; padding-top: 0; }
.past-head { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; align-items: baseline; }
.past-winner { font-weight: 600; }
.past-value { color: var(--muted); }
.past-title { color: var(--ink-2); }
.wins-notice { display: flex; gap: 0.75rem; align-items: flex-start; justify-content: space-between; }
.wins-notice form { margin: 0; }
.data.competitors td[data-label="First award"],
.data.competitors td[data-label="Latest end"],
.data.awards-table td[data-label="Ends"],
.data.awards-table td[data-label="Awarded"] { white-space: nowrap; }
.data.competitors .cell-buyers { min-width: 14rem; }
.radar-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: center; margin-top: 16px; }

/* --- Accounts -------------------------------------------------------------- */
.ms-signin { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; width: 100%; text-decoration: none; }
.auth-hint { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.88rem; }
.shared-login { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: 0.9rem; }
.shared-login summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; margin-bottom: 0.6rem; }
.data.users-table td, .data.users-table th { vertical-align: middle; }
.users-table .row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.users-table .row-actions form { margin: 0; }
.users-table .btn { min-height: 30px; font-size: 13px; }
.users-table tr.is-inactive td { opacity: 0.55; }
.role-badge { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--brand-soft); color: var(--brand-deep); }
.add-user-form { flex-wrap: wrap; }
.add-user-form .grow { min-width: 16rem; }
.add-user-form .checkbox-inline { display: flex; flex-direction: row; align-items: center; gap: 0.4rem; padding-bottom: 0.75rem; }
.add-user-form .checkbox-inline input { width: auto; }
.activity-list { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.activity-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--line-soft); }
.auth-hint + .btn { margin-top: 1.1rem; }
.keyword-chips .chip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; line-height: 24px; }
.grid-table th:last-child .grip { right: 0; }
.past-table { table-layout: fixed; }
.past-table td { overflow-wrap: anywhere; }

/* --- Radar and Competitors (wave 6) --------------------------------------- */
.table-caption { margin: 0 4px 10px; font-size: 13px; color: var(--muted); }
.table-caption strong { color: var(--ink-2); font-variant-numeric: tabular-nums; }
a.seg { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
a.seg:hover { color: var(--ink); text-decoration: none; }
.seg-count { color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.grid-table th.align-right { text-align: right; }
.grid-table th.align-center { text-align: center; }
.grid-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid-table td.nowrap { white-space: nowrap; }
.grid-table td.cell-watch { padding: 8px 10px; text-align: center; }
.grid-table .currency { color: var(--muted); font-size: 12px; }
.grid-table td.value-missing { color: var(--muted); white-space: normal; }
.grid-table tr.month-row th {
  position: static;
  padding: 16px 14px 8px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}
.grid-table tr.month-row th span { color: var(--muted); font-weight: 500; }
.grid-table tr.month-row:hover { background: transparent; }
.grid-table .follow-on { margin-top: 6px; border-left: 0; border-radius: 6px; font-size: 13px; color: var(--warn-ink); }
.grid-table .follow-on a { color: var(--warn-ink); font-weight: 600; }
.grid-table .watched-badge { margin-left: 4px; }
.reason-text { border-bottom: 1px dashed var(--line-strong); }
.density-compact .grid-table td.cell-watch { padding-top: 4px; padding-bottom: 4px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.competitor-name { color: var(--ink); font-weight: 600; }
.buyer-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink-2); }

/* Award side panel. */
.sp-head form { margin: 0; }
.sp-star { width: 40px; height: 40px; }
.sp-actions .sp-muted-btn { color: var(--muted); }
.sp-holder { margin: 0; font-size: 15px; font-weight: 600; }
.sp-follow { margin: 0; padding: 0; list-style: none; }
.sp-follow li { margin-bottom: 8px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); font-size: 14px; }
.sp-follow a { color: var(--warn-ink); font-weight: 600; }
.sp-follow .what, .sp-muted-inline { color: var(--muted); font-size: 13px; }

/* Competitor profile. */
.profile-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 18px; }
.profile-head .grow { flex: 1 1 auto; min-width: 0; }
.profile-head h1 { margin: 0; font-size: 28px; font-weight: 700; }
.profile-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.profile-head form { margin: 0; }
.more-btn { width: 38px; justify-content: center; padding: 0; font-size: 20px; line-height: 1; }
.small-table td { padding: 10px 14px; }
.small-table th { position: static; }
.profile-grid .small-table td, .profile-grid .small-table th { padding-left: 0; }
.count-list { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.count-list li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.keyword-line { margin: 12px 0 0; line-height: 2; }
.profile-section { margin-top: 8px; }
.profile-section h2 { margin: 0 0 4px; font-size: 1.1rem; font-weight: 600; }
.table-box.table-box-short { height: 520px; }
.dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-menu);
}
.dialog::backdrop { background: var(--backdrop); }
.dialog h2 { margin: 0; font-size: 19px; }
.dialog h3 { margin: 18px 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.merge-list { margin: 0; padding: 0; list-style: none; }
.merge-list li { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.merge-list .grow { flex: 1 1 auto; min-width: 0; }
.merge-list form { margin: 0; }
.caption-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.caption-row .table-caption { margin-bottom: 0; }
.search-box.is-narrow { width: 300px; }
.caption-row { justify-content: flex-start; }
.btn.btn-small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.src-badge.src-usaspending { background: var(--src-samgov-bg); color: var(--src-samgov-ink); }
.buyer-line { display: flex; gap: 4px; }
.buyer-line .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.buyer-line .muted-note { flex: none; }

/* --- Keywords, Users, Alert email log (wave 6 admin) ------------------------- */
.kw-toolbar { gap: 12px; }
.kw-add { display: flex; gap: 8px; width: 440px; }
.kw-add-field { flex: 1 1 auto; margin: 0; }
.kw-add-field input { height: 38px; font-size: 14px; }
.kw-sections { display: flex; flex-direction: column; gap: 10px; }
.kw-section { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.kw-section > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px;
  cursor: pointer;
  list-style: none;
}
.kw-section > summary::-webkit-details-marker { display: none; }
.kw-section > summary h2 { flex: 1 1 auto; margin: 0; font-size: 16px; font-weight: 600; }
.kw-section > summary:hover h2 { color: var(--brand-ink); }
.kw-chev { flex: none; color: var(--muted); transition: transform 0.12s ease; }
.kw-section[open] > summary .kw-chev { transform: rotate(90deg); }
.kw-summary { font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.kw-body { padding: 0 18px 16px; }
.kw-hint { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.kw-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.kw-pill-wrap { display: inline-flex; align-items: center; gap: 2px; }
.kw-pill-wrap[hidden] { display: none; }
.kw-pill-form, .kw-delete { margin: 0; }
.kw-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.kw-pill:hover { border-color: var(--line-hover); background: var(--hover); }
.kw-pill.is-static { cursor: default; }
.kw-pill.is-static:hover { border-color: var(--line-strong); background: var(--surface); }
.kw-pill.is-off { background: var(--surface-3); color: var(--faint); }
.kw-pill.is-off .kw-label { text-decoration: line-through; }
.kw-pill.is-off.is-static:hover { background: var(--surface-3); }
.kw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok-dot); flex: none; }
.kw-pill.is-off .kw-dot { background: var(--star-off); }
.kw-pill.is-mixed .kw-dot { background: var(--warn-dot); }
form[aria-busy="true"] .kw-pill { opacity: 0.6; cursor: progress; }
.kw-weak {
  display: inline-block;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--badge);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 18px;
}
.kw-x {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.kw-x:hover { background: var(--danger-soft); color: var(--danger); }
.kw-empty { margin: 8px 4px; color: var(--muted); font-size: 14px; }
.table-box.kw-codes-box, .table-box.admin-box { height: auto; max-height: none; border-radius: 12px; }
.kw-codes tr.is-excluded td { color: var(--muted); }
.kw-codes code, .admin-table code { font-family: ui-monospace, "Cascadia Code", monospace; font-size: 13px; }
.kw-codes td { padding-top: 9px; padding-bottom: 9px; }
.admin-table td { vertical-align: middle; overflow-wrap: anywhere; }
.admin-table tr.is-inactive td { color: var(--muted); }
.admin-table td.cell-actions { overflow: visible; text-align: right; padding-top: 6px; padding-bottom: 6px; }
.admin-table .menu { text-align: left; }
.admin-table .err { color: var(--danger); font-size: 13px; overflow-wrap: anywhere; }
.status-seg { margin-bottom: 0; }
.health-strip { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 14px; }
.health-strip dl { display: contents; }
.health-strip div { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.health-strip dt { color: var(--muted); }
.health-strip dd { margin: 0; overflow-wrap: anywhere; }
.add-user-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.add-user-row label { margin: 0; font-size: 13px; }
.add-user-row input[type="email"], .add-user-row input[type="text"] { height: 38px; font-size: 14px; }
.add-user-row .grow { flex: 1 1 260px; }
.add-user-row .checkbox-inline { display: flex; flex-direction: row; align-items: center; gap: 6px; height: 38px; }
.add-user-row .checkbox-inline input { width: auto; }
.admin-table .row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.admin-table .row-actions form { margin: 0; }
.admin-table.users-table tr.is-inactive td { opacity: 1; }

/* --- AI fit rating (wave 7) ------------------------------------------------ */
.fit-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  cursor: help;
}
.fit-pill.fit-good { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.fit-pill.fit-maybe { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.fit-pill.fit-unlikely { background: transparent; color: var(--muted); }
.fit-none { color: var(--muted); }
.sp-fit .fit-pill { margin-right: 4px; cursor: default; }
.sp-fit .attribution { margin-top: 2px; }

/* Admin: AI check against past decisions */
.check-note { flex: 1 1 100%; margin: 0; }
.check-result { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin: 0 0 16px; }
.check-score { display: flex; flex-direction: column; }
.check-score strong { font-size: 40px; line-height: 1.1; }
.check-score span { color: var(--muted); font-size: 14px; }
.check-confusion { border-collapse: collapse; font-size: 14px; background: var(--surface); }
.check-confusion th, .check-confusion td { padding: 6px 14px; border: 1px solid var(--line); text-align: center; }
.check-confusion th[scope="row"] { text-align: left; }
.check-confusion thead th { color: var(--muted); font-weight: 500; }
.check-confusion td.is-agree { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.check-confusion td.is-disagree { color: var(--warn-ink); }
.check-confusion td.is-error { color: var(--muted); }
.check-history-head { font-size: 16px; margin: 24px 0 8px; }
.check-history { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
