/* Lead Finder — one stylesheet, no build step.
   Tokens first; every colour, radius and shadow below comes from them, so a
   rebrand is this block and nothing else. */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --line: #e4e7ef;
  --line-strong: #d3d8e4;
  --control: #80889c;   /* a form control's edge: 3:1 on white, unlike --line-strong */
  --ink: #111729;
  --ink-2: #3b4459;
  --muted: #5f6779;
  --faint: #98a0b3;

  --brand: #4f46e5;
  --brand-ink: #3a32c4;
  --brand-soft: #eef0ff;
  --brand-line: #c9ccfb;

  --ok: #0f9d6b;
  --ok-soft: #e6f7f0;
  --ok-ink: #0b7a53;
  --warn: #b7791f;
  --warn-soft: #fdf4e3;
  --warn-ink: #8a5a12;
  --bad: #d93a3a;
  --bad-soft: #fdecec;
  --bad-ink: #b42323;
  --info: #2563eb;
  --info-soft: #e8f0fe;

  /* One height for everything you can press or type into, and one for every label that only says
     something. Change these two and every control and badge follows. */
  --control-h: 40px;
  --badge-h: 24px;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow-1: 0 1px 2px rgba(17, 23, 41, .05);
  --shadow-2: 0 1px 2px rgba(17, 23, 41, .04), 0 8px 24px rgba(17, 23, 41, .06);
  --focus: 0 0 0 3px rgba(79, 70, 229, .28);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sidebar: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; background: linear-gradient(to right, var(--surface) calc(var(--sidebar) - 1px), var(--line) calc(var(--sidebar) - 1px), var(--line) var(--sidebar), transparent var(--sidebar)); }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-org { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); }
.nav a .count { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--brand-ink); background: #fff; border: 1px solid var(--brand-line); border-radius: 999px; padding: 0 7px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: #e9ebf5; color: var(--ink-2); font-weight: 650; font-size: 12.5px;
}
.me-name { font-weight: 600; font-size: 13px; line-height: 1.25; }
.me-mail { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.me-actions { display: flex; gap: 4px; padding: 6px 4px 0; }
.me-actions a, .me-actions button {
  flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 6px;
  font: inherit; font-size: 12.5px; color: var(--muted); background: none; border: 0; padding: 6px; border-radius: var(--r-sm); cursor: pointer;
}
.me-actions a:hover, .me-actions button:hover { background: var(--surface-2); color: var(--ink); }

.main { min-width: 0; padding: 28px 36px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: inline-flex; gap: 6px; align-items: center; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--control-h); padding: 0 16px;
  font: inherit; font-weight: 560; font-size: 13.5px; line-height: 1;
  border-radius: var(--r-sm); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .3); }
.btn-primary:hover { background: var(--brand-ink); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.btn-secondary:hover { background: var(--surface-2); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #eceef5; color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: #f2c4c4; }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn-lg { height: var(--control-h); padding: 0 20px; font-size: 14px; }
.btn-sm { height: var(--control-h); padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-primary:disabled:hover { background: var(--brand); }
/* A fieldset can disable a whole form without any one control carrying the attribute, so style the state, not the attribute. */
.input:disabled, .field input[type]:disabled, .field select:disabled {
  background-color: #eef0f5; color: var(--muted); border-color: var(--line-strong); cursor: not-allowed;
}
fieldset:disabled .label, fieldset:disabled .hint { color: var(--muted); }

/* ---------- cards & grid ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-body { padding: 20px; }
.stack > * + * { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

/* ---------- KPIs ---------- */
.kpi { padding: 18px 20px; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 520; }
.kpi-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi-value { font-size: 28px; font-weight: 680; letter-spacing: -.02em; margin-top: 10px; line-height: 1.1; }
.kpi-foot { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.kpi-ok .kpi-icon { background: var(--ok-soft); color: var(--ok); }
.kpi-warn .kpi-icon { background: var(--warn-soft); color: var(--warn); }
.kpi-info .kpi-icon { background: var(--info-soft); color: var(--info); }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--badge-h); padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 580; white-space: nowrap;
  background: #eef0f5; color: var(--ink-2);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-running { background: var(--info-soft); color: var(--info); }
.badge-running .dot { animation: pulse 1.4s ease-in-out infinite; }
.badge-queued { background: #f1f2f7; color: var(--muted); }
.badge-completed, .badge-done { background: var(--ok-soft); color: var(--ok-ink); }
.badge-cancelled, .badge-stopped { background: var(--warn-soft); color: var(--warn-ink); }
.badge-failed { background: var(--bad-soft); color: var(--bad-ink); }
.badge-reading, .badge-discovering { background: var(--info-soft); color: var(--info); }
.badge-waiting { background: #f1f2f7; color: var(--muted); }
.badge-outline { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-2); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- progress ---------- */
.bar { position: relative; height: 8px; border-radius: 999px; background: #eceef5; overflow: hidden; }
.bar > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--brand); transition: width .6s ease; }
.bar-lg { height: 12px; }
.bar.is-live > span {
  background-image: linear-gradient(45deg, rgba(255,255,255,.22) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.22) 50%, rgba(255,255,255,.22) 75%, transparent 75%);
  background-size: 18px 18px;
  animation: stripes 1s linear infinite;
}
.bar.ok > span { background: var(--ok); }
.bar.warn > span { background: var(--warn); }
.bar.bad > span { background: var(--bad); }
.bar.thin { height: 5px; }
@keyframes stripes { to { background-position: 18px 0; } }

.live-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.live-numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.live-numbers > div { padding: 16px 20px; border-right: 1px solid var(--line); }
.live-numbers > div:last-child { border-right: 0; }
.live-numbers .v { font-size: 22px; font-weight: 680; letter-spacing: -.02em; }
.live-numbers .l { font-size: 12.5px; color: var(--muted); }
.big-pct { font-size: 40px; font-weight: 720; letter-spacing: -.03em; line-height: 1; }
.phase { display: inline-flex; align-items: center; gap: 8px; font-weight: 560; color: var(--ink-2); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--brand-line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--surface-2);
  padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfe; }
.table .right { text-align: right; }
.table a.row-link { color: var(--ink); font-weight: 580; }
.table a.row-link:hover { color: var(--brand); }
.cell-sub { font-size: 12px; color: var(--muted); }
.source-cell { display: flex; align-items: center; gap: 10px; }
.source-logo { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--ink-2); background: #eef0f6; text-transform: uppercase; }
.source-logo.re { background: #fdf0e6; color: #b45309; }
.source-logo.lo { background: #e9f0ff; color: #1d4ed8; }
.source-logo.cp { background: #e6f7f0; color: #0b7a53; }
.progress-cell { min-width: 160px; }
.progress-cell .bar { margin-bottom: 4px; }

/* ---------- forms ---------- */
.field { display: block; }
.field + .field { margin-top: 16px; }
.label { display: block; font-weight: 580; font-size: 13px; margin-bottom: 6px; color: var(--ink); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field select {
  width: 100%; height: var(--control-h); padding: 0 12px;
  font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--control); border-radius: var(--r-sm);
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .field input:focus, .field select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
/* Dropdowns: the browser's own arrow sits hard against the border, so draw ours with room. */
select.input, .field select {
  -webkit-appearance: none; appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6779' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 16px 16px;
  cursor: pointer;
}
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--bad); font-size: 12.5px; }
.form-error { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--bad-soft); color: #9f1d1d; border: 1px solid #f5c9c9; margin-bottom: 16px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-title .tools { display: flex; gap: 6px; }
.link-btn { font: inherit; font-size: 12.5px; font-weight: 560; color: var(--brand); background: none; border: 0; padding: 2px 4px; cursor: pointer; border-radius: 4px; }
.link-btn:hover { color: var(--brand-ink); text-decoration: underline; }

/* choice tiles: professions */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1.5px solid var(--control); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s; }
.tile:hover { border-color: var(--brand-line); }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile .tile-icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: #f1f2f7; color: var(--ink-2); }
.tile .tile-title { font-weight: 620; }
.tile .tile-sub { font-size: 12.5px; color: var(--muted); }
.tile .check { margin-left: auto; flex: none; width: 20px; height: 20px; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; }
.tile:has(input:checked) { border-color: var(--brand); background: #fbfbff; box-shadow: 0 0 0 3px rgba(79, 70, 229, .08); }
.tile:has(input:checked) .tile-icon { background: var(--brand-soft); color: var(--brand); }
.tile:has(input:checked) .check { background: var(--brand); border-color: var(--brand); color: #fff; }
.tile:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

/* chips: states, directories */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: var(--control-h); padding: 0 14px; border: 1px solid var(--control); border-radius: 999px; background: var(--surface); font-weight: 540; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; transition: background .12s, border-color .12s, color .12s; }
.chip:hover { border-color: var(--brand-line); color: var(--ink); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip .code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.chip:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip:has(input:checked) .code { color: rgba(255, 255, 255, .75); }
.chip:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.chips-dense .chip { height: var(--control-h); padding: 0 12px; font-size: 13px; }
.state-filter { margin-bottom: 12px; max-width: 280px; }

.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-pill { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: var(--control-h); padding: 0 14px; border: 1px solid var(--control); border-radius: var(--r-sm); cursor: pointer; font-weight: 540; }
.radio-pill input { accent-color: var(--brand); margin: 0; }
.radio-pill:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }

.switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.switch-row:first-child { border-top: 0; padding-top: 0; }
.switch { position: relative; width: 38px; height: 22px; flex: none; margin-top: 2px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--control); transition: background .15s; cursor: pointer; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }

.summary-list { display: grid; gap: 12px; margin: 0; }
.summary-list > div { display: flex; justify-content: space-between; gap: 12px; }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 580; text-align: right; }
.sticky { position: sticky; top: 24px; }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 56px 24px; }
.empty-icon { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty h2 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 420px; margin: 0 auto 18px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.notice-info { background: var(--info-soft); border-color: #cfe0fd; color: #1e3a8a; }
.notice-warn { background: var(--warn-soft); border-color: #f4dfb5; color: #7c4a03; }
.notice-bad { background: var(--bad-soft); border-color: #f5c9c9; color: #8f1c1c; }
.notice-ok { background: var(--ok-soft); border-color: #bfe8d6; color: #0b5e41; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 50; max-width: 380px; }
.toast { display: flex; pointer-events: auto; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--ink); color: #fff; box-shadow: var(--shadow-2); font-size: 13.5px; animation: toast-in .25s ease; }
.toast-close { margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.6); cursor: pointer; padding: 0 2px; font-size: 16px; line-height: 1; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.hbar-list { display: grid; gap: 12px; }
.hbar-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 64px; gap: 12px; align-items: center; font-size: 13px; }
.hbar-row .bar { height: 8px; }
.split { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: #eceef5; }
.split > span { display: block; height: 100%; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.filters .input { height: var(--control-h); }
.filters .search { position: relative; flex: 1 1 180px; min-width: 180px; }
.filters .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.filters .search .input { padding-left: 34px; }
.filters select.input { width: auto; min-width: 136px; }
.filters .chip { padding: 0 12px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pager .actions { gap: 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; min-height: var(--control-h); padding: 0 14px; color: var(--muted); font-weight: 560; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--brand-ink); border-color: var(--brand); }
.kbd-note { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12.5px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.pill-count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: var(--badge-h); padding: 0 7px; border-radius: 999px; background: #eef0f5; color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.copy-email { color: var(--ink-2); }
.copy-email:hover { color: var(--brand); }
.note-line { font-size: 12px; color: var(--warn-ink); margin-top: 2px; }

/* Small links under a person's name in the team table. */

/* ---------- accessibility helpers ---------- */
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 12px; border-radius: var(--r-sm); background: var(--ink); color: #fff; font-weight: 600; }
.skip-link:focus { top: 12px; color: #fff; }
.grid + .field { margin-top: 16px; }
.mobile-submit { display: none; }
.show-sm { display: none; }
.auth-brand-phone { display: none; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-aside {
  position: relative; overflow: hidden;
  padding: 48px 56px; color: #e6e8ff;
  background: #171a3a;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-aside::before {
  content: ""; position: absolute; inset: auto -120px -160px auto; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle at center, rgba(99, 91, 255, .55), rgba(99, 91, 255, 0) 65%);
}
.auth-aside::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, #000 20%, transparent 85%);
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside .brand { color: #fff; padding: 0; }
.auth-aside .brand-mark { background: #fff; color: var(--brand); }
.auth-pitch h2 { color: #fff; font-size: 32px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; max-width: 440px; }
.auth-pitch p { margin-top: 14px; color: #b9bdf0; font-size: 15px; max-width: 420px; }
.auth-points { display: grid; gap: 14px; margin-top: 32px; }
.auth-points div { display: flex; gap: 12px; align-items: flex-start; color: #d7d9fb; }
.auth-points svg { color: #a5a0ff; margin-top: 2px; }
.auth-stat { display: flex; gap: 28px; }
.auth-stat b { display: block; color: #fff; font-size: 22px; letter-spacing: -.02em; }
.auth-stat span { font-size: 12.5px; color: #9ea3dd; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 24px; }
.auth-card .sub { color: var(--muted); margin: 6px 0 26px; }
.auth-foot { margin-top: 22px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; z-index: 20; height: auto;
    flex-direction: row; align-items: center; gap: 6px;
    padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .brand { padding: 0 8px 0 0; }
  .brand-org, .nav-label, .sidebar-foot .me { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { padding: 7px 10px; white-space: nowrap; }
  .nav a span.nav-text { display: none; }
  .nav a .count { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .me-actions { padding: 0; }
  .me-actions .label-text { display: none; }
  .main { padding: 20px 16px 48px; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .live-hero { grid-template-columns: 1fr; }
  .live-numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-numbers > div:nth-child(2) { border-right: 0; }
  .live-numbers > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .tiles { grid-template-columns: 1fr; }
  .hbar-row { grid-template-columns: 90px minmax(0, 1fr) 54px; }
  .nav a { padding: 10px 11px; }
  /* The submit button is ~2,400px down a phone's form; this keeps it in reach. */
  .mobile-submit {
    display: flex; align-items: center; gap: 12px;
    position: sticky; bottom: 0; z-index: 10;
    margin: 18px -16px -48px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .mobile-submit .ms-text { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); line-height: 1.3; }
  .mobile-submit .ms-text b { display: block; color: var(--ink); font-size: 13.5px; }
  .auth-brand-phone { display: flex; margin-bottom: 28px; }
}
@media (max-width: 900px) {
  .shell { background: none; }
}
@media (max-width: 640px) {
  /* Wide tables become one card per row: a phone has room for a name and
     its details stacked, not for six columns side by side. */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table.table-cards tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table-cards tr:last-child { border-bottom: 0; }
  .table.table-cards td { padding: 2px 0; border: 0; text-align: left !important; }
  .table-cards td.hide-sm { display: none; }
  .table-cards td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 12px; }
  .table-cards tbody tr:hover td { background: none; }
  .table-cards .progress-cell { min-width: 0; margin-top: 6px; }
  .show-sm { display: inline; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 14px; }
  .kpi-label { font-size: 12px; }
  h1 { font-size: 20px; }
  .kpi-value { font-size: 24px; }
  .table th, .table td { padding: 10px 12px; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- members table ---------- */
.member { display: flex; align-items: center; gap: 12px; min-width: 0; }
.member .avatar { flex: none; width: 38px; height: 38px; font-size: 13px; }
.member .avatar.a1 { background: var(--brand-soft); color: var(--brand-ink); }
.member .avatar.a2 { background: var(--ok-soft); color: var(--ok-ink); }
.member .avatar.a3 { background: var(--warn-soft); color: var(--warn-ink); }
.member .avatar.a4 { background: var(--bad-soft); color: var(--bad-ink); }
.member-name { font-weight: 600; line-height: 1.3; white-space: nowrap; }
.member-name .muted { font-weight: 450; }
.member .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.role-tag { font-size: 12px; font-weight: 600; color: var(--muted); margin-right: 2px; }
.role-tag.admin { color: var(--brand-ink); }
.table td.actions-cell { text-align: right; white-space: nowrap; width: 1%; }
.member-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.member-actions form { display: inline; margin: 0; }
.mini-btn { display: inline-flex; align-items: center; height: var(--control-h); padding: 0 14px; font: inherit; font-size: 13px; font-weight: 560; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); cursor: pointer; text-decoration: none; }
.mini-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--control); }
.mini-btn.danger { color: var(--bad-ink); }
.mini-btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); color: var(--bad-ink); }
.mini-btn:disabled { color: var(--muted); background: #eef0f5; cursor: not-allowed; }
.table tr.is-off .member, .table tr.is-off td:first-child > div:first-child { opacity: .62; }

.add-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.scope-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
@media (max-width: 1100px) { .add-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .add-grid { grid-template-columns: 1fr; } }
.add-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

/* A field with an error says so on the field, not only in the message under it. */
.field input[aria-invalid="true"], .input[aria-invalid="true"] { border-color: var(--bad); outline-color: var(--bad); }
/* Filter chips that narrow a list: the filled background is the whole "on" state. */
.chip-group { display: contents; border: 0; margin: 0; padding: 0; }
@media (max-width: 900px) {
  /* Phones: every nav item must be reachable, so the bar wraps instead of scrolling out of sight. */
  /* Wrapped, it is two or three rows tall: let it scroll away instead of pinning it over the page. */
  .sidebar { flex-wrap: wrap; overflow-x: visible; position: static; }
  .nav { flex-wrap: wrap; }
  .sidebar-foot { margin-left: 0; }
}

/* A table that is the first or last thing in a card must follow the card's rounded corners, or its
   square header or hover colour paints over the card's border at the corners. */
.card > .table-wrap:first-child { border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.card > .table-wrap:last-child { border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }

/* A long address must wrap, not push the page wider than the screen. */
.page-head h1, .page-head .sub { overflow-wrap: anywhere; }
.scan-col { max-width: 720px; margin-bottom: 18px; }
.scan-col.flush { margin-bottom: 0; }
.bullets { margin: 6px 0 0; padding-left: 18px; }
