/* Sisifo Lead Hub - styles. Brand per Sisifo Brand Guidelines. */

:root {
  /* Mountain palette */
  --base: #0F3858;      /* header / nav */
  --base-2: #0c2f4a;
  --face: #274A81;      /* logo colour, heading accent, primary hover */
  --slopes: #337AB7;    /* secondary / primary button fill (AA with white text) */
  --peak: #4698C7;      /* primary accent: focus, active, bars */
  --peak-tint: #e6f1f9;
  --peak-tint-2: #d3e7f4;

  /* Status */
  --positive: #4CAF50;
  --positive-ink: #23672a;
  --positive-tint: #e7f5e8;
  --warning: #F7C029;
  --warning-ink: #6b4f00;
  --warning-tint: #fdf4d6;
  --negative: #D64545;
  --negative-ink: #a3302f;
  --negative-tint: #fbe8e8;

  /* Neutrals */
  --text: #1f2124;
  --grey: #5f6872;      /* darker than #69727d for AA on tinted surfaces */
  --grey-2: #8a939c;
  --border: #e3e8ee;
  --border-2: #d3dae2;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f9fbfd;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 56, 88, .06), 0 1px 3px rgba(15, 56, 88, .05);
  --shadow: 0 2px 6px rgba(15, 56, 88, .07), 0 8px 24px rgba(15, 56, 88, .07);
  --shadow-lg: 0 12px 40px rgba(15, 56, 88, .18);
  --focus: 0 0 0 3px rgba(70, 152, 199, .45);

  --font-ui: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-brand: "Montserrat", "Segoe UI", system-ui, sans-serif;

  --topbar-h: 60px;
  --drawer-w: 580px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-ui); font-weight: 700; margin: 0; color: var(--text); }
h1 { font-size: 24px; line-height: 1.25; color: var(--face); }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--slopes); }
a:hover { color: var(--face); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { box-shadow: var(--focus); border-color: var(--peak); }

.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i-sm { width: 12px; height: 12px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--grey); }
.small { font-size: 12.5px; }
.pre { white-space: pre-line; }
.small-lh { font-size: 13.5px; line-height: 1.6; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.wordmark {
  font-family: var(--font-brand);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .45em;
}

.skip-link { position: absolute; left: 8px; top: -40px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--radius); box-shadow: var(--shadow); }
.skip-link:focus { top: 8px; }

/* Discreet indicator, shown only when running on local test data */
.local-badge {
  position: fixed; left: 12px; bottom: 12px; z-index: 60;
  background: var(--surface); color: var(--grey); border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 2px 9px; border-radius: 999px; box-shadow: var(--shadow-sm);
  pointer-events: none;
}
.local-badge[hidden] { display: none; }

/* Data freshness + refresh in the top bar */
.data-loaded { font-size: 12px; color: #a9c3d8; white-space: nowrap; }
#data-refresh.spinning .i { animation: spin .8s linear infinite; }
/* Microsoft sign-in button */
.btn-ms { height: 42px; padding: 0 18px; font-size: 14.5px; gap: 10px; width: 100%; justify-content: center; }
.ms-logo { width: 18px; height: 18px; flex: none; background: #fff; padding: 1px; border-radius: 2px; }
/* Feedback history (Sales Feedback lines, never deleted) */
.fb-history { list-style: none; margin: 10px 0 0; padding: 8px 10px; display: grid; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); max-height: 160px; overflow: auto; }
.fb-history li { color: var(--text); }
.drawer.saving .d-body { cursor: progress; }

/* ---------- Boot / loading ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--grey); text-align: center; padding: 24px; }
.boot-error h1 { color: var(--negative-ink); }
.boot-spinner, .spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--peak-tint-2); border-top-color: var(--peak);
  animation: spin .8s linear infinite;
}
.spinner { width: 16px; height: 16px; border-width: 2px; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-inline { display: flex; align-items: center; gap: 10px; color: var(--grey); padding: 16px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--border-2); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--peak); color: var(--face); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
.btn.primary { background: var(--slopes); border-color: var(--slopes); color: #fff; }
.btn.primary:hover { background: var(--face); border-color: var(--face); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--grey); }
.btn.ghost:hover { background: var(--peak-tint); color: var(--face); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.copied { background: var(--positive-tint) !important; border-color: var(--positive) !important; color: var(--positive-ink) !important; }
.btn-linkedin { color: #0a66c2; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--grey);
}
.icon-btn:hover { background: var(--peak-tint); color: var(--face); }
.icon-btn[disabled] { opacity: .35; cursor: default; background: transparent; }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn.on-dark { color: #cfe0ee; }
.icon-btn.on-dark:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.icon-btn.copied { color: var(--positive-ink); }

.linklike { background: none; border: 0; padding: 0; color: var(--slopes); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.linklike:hover { color: var(--face); text-decoration: underline; }

/* ---------- Form controls ---------- */
.select, input[type="text"], input[type="search"], input[type="date"], textarea {
  border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--surface);
  padding: 7px 10px; min-height: 36px; width: 100%;
}
.select { width: auto; padding-right: 28px; cursor: pointer; }
.select.sm { min-height: 32px; padding: 4px 26px 4px 9px; font-size: 13px; }
textarea { resize: vertical; line-height: 1.5; }
.field { display: grid; gap: 5px; margin-top: 10px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.field.grow { flex: 1; min-width: 180px; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 34px; height: 20px; border-radius: 999px; background: var(--border-2); position: relative; transition: background .15s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; 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 + .switch-track { background: var(--slopes); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--focus); }

/* ---------- Sign-in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 44%) 1fr; }
.signin-brand {
  background: radial-gradient(circle at 20% 110%, rgba(70, 152, 199, .35), transparent 55%), linear-gradient(160deg, var(--base) 0%, var(--base-2) 100%);
  color: #e3eef6; padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 18px;
}
.signin-logo { width: 190px; height: auto; }
.signin-brand h1 { color: #fff; font-size: 22px; margin-top: 4px; }
.signin-brand > p { font-size: 16px; max-width: 420px; color: #d2e2ee; }
.signin-points { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 12px; }
.signin-points li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: #d2e2ee; }
.signin-points .i { color: var(--peak); width: 18px; height: 18px; }
.tagline { margin-top: 24px !important; font-family: var(--font-brand); font-weight: 600; font-size: 13px; letter-spacing: .04em; color: #9fc4de !important; }
.signin-main { display: grid; place-items: center; padding: 32px 20px; outline: none; }
.signin-card { width: 100%; max-width: 440px; }
.signin-card-logo { width: 120px; height: auto; margin-bottom: 22px; display: block; }
.signin-card h2 { font-size: 22px; color: var(--face); }
.signin-card > p { margin: 4px 0 20px; }
.user-options { display: grid; gap: 10px; }
.user-option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.user-option:hover { border-color: var(--peak); box-shadow: var(--shadow); }
.uo-text { flex: 1; display: grid; gap: 1px; }
.uo-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.uo-email { font-size: 12.5px; color: var(--grey); }
.uo-blurb { font-size: 13px; color: var(--text); margin-top: 3px; }
.uo-chev { color: var(--grey-2); }
.role-tag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--peak-tint); color: var(--face); letter-spacing: .02em; }
.role-tag.rt-uploader { background: #eef0fb; color: #3c4596; }
.role-tag.rt-admin { background: var(--base); color: #fff; }
.reset-link { margin-top: 18px; }
.logo-fallback { font-family: var(--font-brand); font-weight: 700; letter-spacing: .45em; color: #fff; font-size: 18px; }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--peak); color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .02em;
}
.avatar.lg { width: 42px; height: 42px; font-size: 14px; }
.avatar.av-alt { background: #5961b5; }
.avatar.av-admin { background: var(--face); box-shadow: inset 0 0 0 2px var(--peak); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px;
  background: var(--base); color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 2px 10px rgba(12, 47, 74, .25);
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; flex: none; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .25); }
.brand-app { font-size: 12px; color: #d6e6f2; }
.brand:focus-visible { box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); }
.mainnav { display: flex; gap: 4px; height: 100%; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 12px; height: 100%;
  color: #c4d7e6; text-decoration: none; font-weight: 600; font-size: 13.5px; white-space: nowrap;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
}
.mainnav a:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.mainnav a.active { color: #fff; border-bottom-color: var(--peak); }
.mainnav a:focus-visible { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6); border-radius: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.role-switch { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #a9c3d8; }
.role-switch select {
  background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--radius); padding: 5px 8px; font-size: 13px; max-width: 220px;
}
.role-switch select option { color: var(--text); background: #fff; }

/* ---------- Main / page ---------- */
.main { outline: none; transition: padding-right .2s ease; min-height: calc(100vh - var(--topbar-h)); display: flex; flex-direction: column; }
#view { flex: 1; }
.page { max-width: 1440px; margin: 0 auto; padding: 24px 24px 40px; }
.page-narrow { max-width: 1200px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--grey); margin-top: 4px; max-width: 760px; }
.page-actions { display: flex; gap: 8px; }
.app-foot {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; justify-content: center;
  padding: 16px 24px 24px; font-size: 12.5px; color: var(--face); border-top: 1px solid var(--border);
}
.wm-sm { font-size: 11px; color: var(--base); }

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

/* ---------- KPIs ---------- */
.kpis { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.kpi-group { display: flex; flex: 1 1 auto; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.kpi {
  flex: 1 1 0; min-width: 104px; display: flex; flex-direction: column; gap: 2px;
  padding: 11px 14px; background: var(--surface); border: 0; text-align: left;
}
.kpi-btn { cursor: pointer; transition: background .12s; position: relative; }
.kpi-btn:hover { background: var(--surface-2); }
.kpi-btn.on { background: var(--peak-tint); }
.kpi-btn.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--peak); }
.kpi-btn:focus-visible { box-shadow: inset var(--focus); border-radius: 0; }
.kpi-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--grey); white-space: nowrap; }
.kpi-value { font-size: 22px; font-weight: 700; color: var(--base); font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-hint { font-size: 11.5px; color: var(--grey); }
.kpis-dash .kpi { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 140px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.t1 { background: var(--positive); }
.dot.t2 { background: var(--peak); }
.dot.t3 { background: var(--warning); }
.dot.t4, .dot.t5 { background: var(--grey-2); }
.dot.tx { background: var(--negative); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; scrollbar-width: thin; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 10px 14px; border: 0; background: none; color: var(--grey);
  font-weight: 600; font-size: 13.5px; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--face); }
.tab.active { color: var(--face); border-bottom-color: var(--peak); }
.tab:focus-visible { box-shadow: inset var(--focus); border-radius: 4px 4px 0 0; }
.tab-count { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #edf1f5; color: var(--grey); font-variant-numeric: tabular-nums; }
.tab.active .tab-count, .d-tab.active .tab-count { background: var(--peak-tint-2); color: var(--face); }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.toolbar-spacer { flex: 1; }
.search-box { position: relative; flex: 1 1 320px; max-width: 460px; display: flex; align-items: center; }
.search-box > .i { position: absolute; left: 11px; color: var(--grey); pointer-events: none; }
.search-box input { padding-left: 34px; padding-right: 34px; }
.search-box.sm { flex: none; max-width: none; margin-bottom: 8px; }
.search-box.sm input { min-height: 32px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
.search-kbd { position: absolute; right: 9px; }
kbd {
  display: inline-block; min-width: 20px; padding: 0 5px; text-align: center;
  font: 600 11.5px/18px var(--font-ui); color: var(--grey);
  background: var(--surface-2); border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 4px;
}
.count-badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--slopes); color: #fff; font-size: 11px; }
.count-badge[hidden] { display: none; }
.result-count { font-size: 13px; color: var(--grey); font-weight: 600; font-variant-numeric: tabular-nums; }
.sort-mobile { display: none; }

.filter-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.filter-panel[hidden] { display: none; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 20px; }
.fgroup { border: 0; padding: 0; margin: 0; min-width: 0; }
.fgroup legend { font-size: 12px; font-weight: 700; color: var(--face); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; padding: 0; }
.fgroup-company { grid-row: span 2; }
.fopts { display: grid; gap: 1px; }
.fopts-scroll { max-height: 236px; overflow-y: auto; padding-right: 4px; border-top: 1px solid var(--border); padding-top: 4px; }
.fopt { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; }
.fopt:hover { background: var(--surface-2); }
.fopt input { width: 15px; height: 15px; accent-color: var(--slopes); margin: 0; flex: none; }
.fopt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fopt-n { font-size: 11.5px; color: var(--grey); font-variant-numeric: tabular-nums; }
.fopt.zero { opacity: .55; }
.fopt-empty { padding: 6px; }
.fpanel-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 14px; }
.quick-toggles, .tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.qt {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  font-size: 12.5px; font-weight: 600;
}
.qt:hover { border-color: var(--peak); color: var(--face); }
.qt.on { background: var(--peak-tint); border-color: var(--peak); color: var(--face); }
.qt.on::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--slopes); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px;
  border-radius: 999px; border: 1px solid var(--peak-tint-2); background: var(--peak-tint); color: var(--face);
  font-size: 12.5px; font-weight: 600; max-width: 320px;
}
.chip .i { width: 13px; height: 13px; opacity: .7; }
.chip:hover { background: var(--peak-tint-2); }
.chip:hover .i { opacity: 1; }
.chip-k { font-weight: 500; color: var(--grey); }

/* ---------- Badges / pills ---------- */
.tier-badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid transparent;
}
.tier-badge .dot { width: 7px; height: 7px; }
.tier-badge .tb-short { display: none; }
.tier-badge.t1 { background: var(--positive-tint); color: var(--positive-ink); border-color: #c4e5c6; }
.tier-badge.t1 .dot { background: var(--positive); }
.tier-badge.t2 { background: var(--peak-tint); color: #1f5d8a; border-color: #c4ddee; }
.tier-badge.t2 .dot { background: var(--peak); }
.tier-badge.t3 { background: var(--warning-tint); color: var(--warning-ink); border-color: #f3dc8f; }
.tier-badge.t3 .dot { background: var(--warning); }
.tier-badge.t4, .tier-badge.t5 { background: #eef1f4; color: #4b545d; border-color: #dde2e7; }
.tier-badge.t4 .dot, .tier-badge.t5 .dot { background: var(--grey-2); }
.tier-badge.tx { background: var(--negative-tint); color: var(--negative-ink); border-color: #f1caca; }
.tier-badge.tx .dot { background: var(--negative); }
.tier-badge.sm { font-size: 11.5px; padding: 1px 7px 1px 6px; }

.tier-mini { display: inline-flex; align-items: baseline; gap: 2px; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tier-mini .tm-k { font-size: 10.5px; font-weight: 600; opacity: .85; }
.tier-mini.t1 { background: var(--positive-tint); color: var(--positive-ink); }
.tier-mini.t2 { background: var(--peak-tint); color: #1f5d8a; }
.tier-mini.t3 { background: var(--warning-tint); color: var(--warning-ink); }
.tier-mini.t4, .tier-mini.t5 { background: #eef1f4; color: #4b545d; }
.tier-mini.tx { background: var(--negative-tint); color: var(--negative-ink); }

.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.s-none { background: #f0f2f5; color: #5a636c; }
.s-sent { background: var(--peak-tint); color: #1f5d8a; }
.s-connected { background: #dceaf6; color: var(--face); }
.s-followup { background: #e4e6f7; color: #3c4596; }
.s-replied { background: var(--positive-tint); color: var(--positive-ink); }
.s-meeting { background: #2e7d32; color: #fff; }
.s-no { background: var(--negative-tint); color: var(--negative-ink); }
.s-wrong { background: var(--warning-tint); color: var(--warning-ink); }

.hook-tier { display: inline-block; padding: 0 7px; border-radius: 4px; font-size: 11.5px; font-weight: 700; line-height: 18px; }
.h-auth { background: var(--positive-tint); color: var(--positive-ink); }
.h-usable { background: var(--peak-tint); color: #1f5d8a; }
.h-weak { background: var(--warning-tint); color: var(--warning-ink); }
.h-none { background: #f0f2f5; color: #5a636c; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; vertical-align: 1px; }
.tag-good { background: var(--positive-tint); color: var(--positive-ink); }
.tag-bad { background: var(--negative-tint); color: var(--negative-ink); }
.tag-warn { background: var(--warning-tint); color: var(--warning-ink); }
.tag-info { background: var(--peak-tint); color: var(--face); }
.tag-muted { background: #f0f2f5; color: #5a636c; }

/* ---------- Tables ---------- */
.table-card { overflow: clip; } /* clip (not hidden) keeps the sticky header working */
.table-scroll { overflow-x: auto; }
#lv-table-wrap { overflow: visible; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.data-table thead th {
  position: sticky; top: var(--topbar-h); z-index: 5;
  background: var(--surface-2); color: var(--grey); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; padding-top: 8px; padding-bottom: 8px;
  box-shadow: inset 0 -1px 0 var(--border);
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.th-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; }
.th-btn:hover { color: var(--face); }
.sort-icon { width: 13px; height: 13px; opacity: .45; }
.sort-icon.on { opacity: 1; color: var(--slopes); }

.leads-table tbody tr { cursor: pointer; transition: background .08s; }
.leads-table tbody tr:hover { background: #f5f9fc; }
.leads-table tbody tr.active { background: var(--peak-tint); box-shadow: inset 3px 0 0 var(--peak); }
.leads-table tbody tr.open { background: #dceaf6; box-shadow: inset 3px 0 0 var(--face); }
.leads-table tbody tr.excluded td { opacity: .72; }
.leads-table tbody tr.empty-row { cursor: default; }
.leads-table tbody tr.empty-row:hover { background: none; }
.c-tier { width: 96px; }
.c-name { min-width: 200px; }
.c-company { min-width: 150px; }
.c-channel { width: 140px; }
.c-hook { width: 170px; }
.c-status { width: 168px; white-space: nowrap; }
.c-touch { width: 104px; white-space: nowrap; color: var(--grey); }
.row-open { font-weight: 700; color: var(--text); text-decoration: none; }
.row-open:hover, tr:hover .row-open { color: var(--face); text-decoration: underline; }
.cell-sub { display: block; font-size: 12.5px; color: var(--grey); line-height: 1.35; margin-top: 1px; }
.msg-dot { display: inline-flex; margin-left: 6px; color: var(--peak); vertical-align: -1px; }
.msg-dot .i { width: 14px; height: 14px; }
.channel { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.ch-linkedin .i { color: #0a66c2; }
.ch-mail .i { color: var(--grey); }
.hook-type { display: block; font-weight: 600; font-size: 13px; }
.hook-line { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.q-score { font-weight: 700; font-size: 12.5px; color: var(--base); font-variant-numeric: tabular-nums; }
.q-max { color: var(--grey); font-weight: 500; }
.flag-ico { display: inline-flex; margin-left: 6px; color: #b07f00; vertical-align: -2px; }

.empty-state { text-align: center; padding: 48px 20px; display: grid; justify-items: center; gap: 8px; color: var(--grey); }
.empty-state h2 { color: var(--text); }
.empty-state .btn { margin-top: 8px; }
.empty-icon { width: 40px; height: 40px; color: var(--peak); stroke-width: 1.5; margin-bottom: 4px; }
.empty-state.wide { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--radius); }

/* ---------- Drawer ---------- */
.drawer {
  position: fixed; top: var(--topbar-h); right: 0; bottom: 0; z-index: 30;
  width: min(var(--drawer-w), 100vw);
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateX(102%); transition: transform .22s ease, visibility .22s;
  visibility: hidden; outline: none;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-scrim { position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(15, 56, 88, .28); z-index: 29; display: none; }
@media (min-width: 1280px) {
  body.drawer-open .main { padding-right: var(--drawer-w); }
  /* Keep the essentials visible next to the open drawer */
  body.drawer-open .leads-table .c-channel,
  body.drawer-open .leads-table .c-touch { display: none; }
}
@media (min-width: 1280px) and (max-width: 1599px) {
  body.drawer-open .leads-table .c-company .cell-sub { display: none; }
}
@media (max-width: 1279px) {
  .drawer-scrim:not([hidden]) { display: block; }
}
.d-head { padding: 14px 20px 0; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #f7fafd 0%, var(--surface) 100%); flex: none; }
.d-head-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-head-spacer { flex: 1; }
.d-nav { display: flex; align-items: center; gap: 2px; }
.d-pos { font-size: 12px; color: var(--grey); font-variant-numeric: tabular-nums; min-width: 54px; text-align: center; }
.d-head h2 { font-size: 21px; color: var(--base); margin-top: 10px; outline: none; }
.d-head h2:focus-visible { box-shadow: var(--focus); }
.d-title { color: var(--text); margin-top: 2px; }
.d-company { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 4px; }
.d-loc { display: inline-flex; align-items: center; gap: 5px; color: var(--grey); font-size: 13px; }
.d-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.email-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; min-height: 30px; }
.email-chip a { color: var(--text); text-decoration: none; }
.email-chip a:hover { color: var(--face); text-decoration: underline; }
.email-chip.muted { padding-right: 10px; }
.channel-hint { font-size: 12.5px; color: var(--grey); }
.d-tabs { display: flex; gap: 2px; margin-top: 12px; }
.d-tab { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 9px 12px; font-weight: 600; color: var(--grey); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.d-tab:hover { color: var(--face); }
.d-tab.active { color: var(--face); border-bottom-color: var(--peak); }
.d-body { flex: 1; overflow-y: auto; padding: 4px 20px 40px; overscroll-behavior: contain; }
.d-empty { padding: 40px; text-align: center; color: var(--grey); }
.d-sec { padding: 16px 0; border-bottom: 1px solid var(--border); }
.d-sec:last-child { border-bottom: 0; }
.d-sec > h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--face); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.d-sec > h3 .i { color: var(--peak); }
.d-sec > h3 .tag { text-transform: none; letter-spacing: 0; }
.sec-meta { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--grey); text-transform: none; letter-spacing: 0; }

.d-outreach { background: var(--surface-2); margin: 12px -20px 0; padding: 14px 20px 16px; border-bottom: 1px solid var(--border); }
.stepper { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; }
.step { position: relative; }
.step:not(:last-child)::after { content: ""; position: absolute; top: 14px; left: calc(50% + 15px); right: calc(-50% + 15px); height: 2px; background: var(--border-2); }
.step.done:not(:last-child)::after { background: var(--peak); }
.step button { display: grid; justify-items: center; gap: 4px; width: 100%; background: none; border: 0; padding: 0 2px; color: var(--grey); }
.step-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-2); background: var(--surface); font-size: 12px; font-weight: 700; transition: all .12s; }
.step-dot .i { width: 14px; height: 14px; stroke-width: 3; }
.step-label { font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center; }
.step button:hover .step-dot { border-color: var(--peak); color: var(--face); }
.step.done .step-dot { background: var(--peak); border-color: var(--peak); color: #fff; }
.step.current .step-dot { background: var(--face); border-color: var(--face); color: #fff; box-shadow: 0 0 0 4px var(--peak-tint-2); }
.step.current .step-label { color: var(--face); font-weight: 700; }
.step.done .step-label { color: var(--text); }
.outreach-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.closed-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.xcols { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--grey); }
.xcol-k { font-weight: 700; margin-right: 5px; text-transform: uppercase; font-size: 10.5px; letter-spacing: .05em; }
.xcol.yes { color: var(--positive-ink); }

.why { font-weight: 600; }
.personal-detail { font-size: 15.5px; line-height: 1.55; color: var(--base); font-weight: 600; padding: 12px 14px; border-radius: var(--radius); background: var(--peak-tint); border-left: 4px solid var(--peak); }
.evidence { margin: 12px 0 0; padding: 10px 14px 10px 40px; position: relative; color: #3a4148; font-style: italic; background: var(--surface-2); border-radius: var(--radius); }
.evidence .q-ico { position: absolute; left: 12px; top: 12px; color: var(--peak); }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px 16px; margin: 12px 0 0; }
.meta-grid dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--grey); }
.meta-grid dd { margin: 2px 0 0; font-size: 13px; }
.source-link { margin-top: 10px; font-size: 13px; }
.source-link a { display: inline-flex; gap: 6px; align-items: flex-start; font-weight: 600; word-break: break-word; }
.source-link .i { margin-top: 2px; }
.angle, .best-content { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; word-break: break-word; }
.angle-k { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--face); margin-bottom: 3px; }
.li-activity { margin-top: 14px; }
.li-activity h4 { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin-bottom: 4px; }
.li-activity h4 .i { color: #0a66c2; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius); background: var(--warning-tint); border: 1px solid #f3dc8f; cursor: pointer; font-size: 13px; }
.checklist input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--positive); flex: none; }
.checklist label.done { background: var(--positive-tint); border-color: #c4e5c6; }
.checklist label.done span { text-decoration: line-through; color: var(--grey); }

.msg-box { border: 1px solid var(--border-2); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.msg-box textarea { border: 0; border-radius: 0; min-height: 110px; padding: 12px; font-size: 14px; }
.msg-box textarea:focus-visible { box-shadow: inset var(--focus); }
.msg-text { padding: 12px; font-size: 14px; white-space: pre-line; }
.msg-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 10px; background: var(--surface-2); border-top: 1px solid var(--border); }
.msg-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.msg-actions [hidden] { display: none; }
.char-count { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--grey); }
.char-count .near { color: #8a6500; }
.char-count .over { color: var(--negative-ink); }
.next-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.next-row .field { margin-top: 0; }
.next-row .btn { margin-bottom: 3px; }
.notes summary { cursor: pointer; font-weight: 700; color: var(--face); display: flex; align-items: center; gap: 6px; list-style: none; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.notes summary::-webkit-details-marker { display: none; }
.notes .sum-ico { transition: transform .15s; }
.notes[open] .sum-ico { transform: rotate(90deg); }
.notes p { margin-top: 10px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { display: flex; gap: 12px; padding: 6px 0; position: relative; }
.tl-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-2); color: var(--peak); flex: none; z-index: 1; }
.tl-ico .i { width: 13px; height: 13px; }
.tl-status .tl-ico { border-color: var(--peak); }
.tl-feedback .tl-ico { border-color: var(--warning); color: #8a6500; }
.tl-body { flex: 1; min-width: 0; padding-top: 3px; }
.tl-text { font-size: 13.5px; }
.tl-detail { font-size: 13px; color: #3a4148; margin-top: 2px; padding: 6px 10px; background: var(--surface-2); border-radius: var(--radius-sm); white-space: pre-line; }
.tl-meta { font-size: 12px; color: var(--grey); margin-top: 2px; }

.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.contact-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.contact-row:hover { border-color: var(--peak); background: var(--surface-2); }
.contact-list li.me .contact-row { background: var(--peak-tint); border-color: var(--peak-tint-2); }
.cr-main { flex: 1; min-width: 0; }
.cr-name { font-weight: 600; }
.co-ico { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius); background: var(--peak-tint); color: var(--face); }

/* ---------- Notices / toasts ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 0 0 16px; border-radius: var(--radius); background: var(--peak-tint); border: 1px solid var(--peak-tint-2); color: var(--base); font-size: 13.5px; }
.notice-icon { color: var(--slopes); flex: none; margin-top: 1px; }
.notice-error { background: var(--negative-tint); border-color: #f1caca; color: #6e1f1f; }
.notice-error .notice-icon { color: var(--negative); }
.notice-warn { background: var(--warning-tint); border-color: #f3dc8f; color: #4d3900; }
.notice-warn .notice-icon { color: #a87b00; }
.d-body .notice { margin: 12px 0 0; }

.toast-region { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 10px; pointer-events: auto;
  background: var(--base); color: #fff; padding: 10px 12px 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-size: 13.5px; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; }
.toast-icon { color: var(--positive); display: inline-flex; }
.toast-error .toast-icon { color: #ff9a9a; }
.toast-action { background: rgba(255, 255, 255, .12); border: 0; color: #fff; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-sm); }
.toast-action:hover { background: rgba(255, 255, 255, .22); }

/* ---------- Companies ---------- */
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.co-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 16px;
  transition: border-color .12s, box-shadow .12s, transform .12s; min-height: 158px;
}
.co-card:hover { border-color: var(--peak); box-shadow: var(--shadow); }
.co-card.out { background: #fbfcfd; }
.co-card.out .co-name { color: var(--grey); }
.co-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.co-name { font-weight: 700; font-size: 15px; color: var(--base); line-height: 1.3; }
.co-meta { color: var(--grey); font-size: 13px; }
.co-tiers { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.co-foot { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12.5px; color: var(--grey); border-top: 1px solid var(--border); }
.co-foot > span:not(.tag) { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; margin-bottom: 16px; }
.dash-card { padding: 18px 20px; margin-bottom: 16px; }
.dash-grid .dash-card { margin-bottom: 0; }
.card-head { margin-bottom: 14px; }
.card-head h2 { color: var(--face); }
.card-head p { font-size: 13px; margin-top: 2px; }
.funnel-svg { width: 100%; height: auto; display: block; }
.f-label { font: 600 13px var(--font-ui); fill: var(--text); }
.f-track { fill: #eef2f6; }
.f-val { font: 700 15px var(--font-ui); fill: var(--base); }
.f-conv { font: 500 11px var(--font-ui); fill: var(--grey); }
.hbar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hbar-list li { display: grid; grid-template-columns: 190px 1fr 40px; align-items: center; gap: 10px; }
.hbar-track { height: 10px; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 999px; background: var(--peak); min-width: 0; }
.hbar-fill.s-none { background: var(--grey-2); }
.hbar-fill.s-sent { background: var(--peak); }
.hbar-fill.s-connected { background: var(--slopes); }
.hbar-fill.s-followup { background: #5961b5; }
.hbar-fill.s-replied { background: var(--positive); }
.hbar-fill.s-meeting { background: #2e7d32; }
.hbar-fill.s-no { background: var(--negative); }
.hbar-fill.s-wrong { background: var(--warning); }
.hbar-val { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.rate { display: flex; align-items: center; gap: 8px; min-width: 160px; }
.rate-track { flex: 1; height: 8px; background: #eef2f6; border-radius: 999px; overflow: hidden; min-width: 60px; }
.rate-fill { display: block; height: 100%; background: var(--peak); border-radius: 999px; }
.rate-val { font-weight: 700; width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.rate-n { font-size: 11.5px; color: var(--grey); width: 40px; font-variant-numeric: tabular-nums; }
.rate-table thead th, .funnel-table thead th, .preview-table thead th, .history-table thead th { position: static; }
.rate-table th[scope=row], .funnel-table th[scope=row] { font-weight: 600; white-space: nowrap; }
.mini-bar { height: 8px; background: #eef2f6; border-radius: 999px; overflow: hidden; min-width: 60px; margin-top: 5px; }
.mini-fill { display: block; height: 100%; border-radius: 999px; }
.mini-fill.m1 { background: var(--base); }
.mini-fill.m2 { background: var(--peak); }
.mini-fill.m3 { background: var(--positive); }
.mini-fill.m4 { background: #2e7d32; }
.mini-val { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Upload ---------- */
.upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.upload-main { padding: 20px; }
.upload-help { padding: 18px 20px; font-size: 13.5px; }
.upload-help h2 { font-size: 14px; color: var(--face); margin-bottom: 10px; }
.upload-help h3 { font-size: 13px; margin: 18px 0 8px; color: var(--face); }
.req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.req-list li { display: flex; gap: 8px; align-items: flex-start; }
.req-list .i { color: var(--peak); margin-top: 2px; }
.steps-list { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 4px; }
.dropzone {
  display: grid; justify-items: center; gap: 6px; text-align: center;
  padding: 36px 20px; border: 2px dashed var(--border-2); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; transition: border-color .12s, background .12s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--peak); background: var(--peak-tint); }
.dz-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--peak-tint-2); color: var(--face); margin-bottom: 6px; }
.dz-icon .i { width: 24px; height: 24px; }
.dz-title { font-weight: 700; font-size: 16px; color: var(--base); }
.dz-sub { font-size: 13px; color: var(--grey); }
.dz-link { color: var(--slopes); font-weight: 600; text-decoration: underline; }
.file-summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 18px 0 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.file-summary > div { flex: 1; min-width: 0; }
.file-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius); background: var(--positive-tint); color: var(--positive-ink); flex: none; }
.file-name { font-weight: 700; word-break: break-all; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-tile { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); display: grid; gap: 2px; }
.stat-val { font-size: 22px; font-weight: 700; color: var(--base); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--grey); font-weight: 600; }
.stat-tile.good { background: var(--positive-tint); border-color: #c4e5c6; }
.stat-tile.good .stat-val { color: var(--positive-ink); }
.stat-tile.warn { background: var(--warning-tint); border-color: #f3dc8f; }
.stat-tile.warn .stat-val { color: var(--warning-ink); }
.sec-title { font-size: 13px; margin: 18px 0 8px; color: var(--face); text-transform: uppercase; letter-spacing: .05em; }
.sec-title .small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.col-check { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.col-check li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.col-check li.ok .i { color: var(--positive); }
.col-check li.bad { color: var(--negative-ink); font-weight: 600; }
.col-check li.bad .i { color: var(--negative); }
.preview-scroll { border: 1px solid var(--border); border-radius: var(--radius); max-height: 380px; overflow: auto; }
.preview-table { font-size: 12.5px; }
.preview-table td, .preview-table th { padding: 7px 10px; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.success-panel { margin-top: 18px; padding: 28px 20px; text-align: center; border: 1px solid #c4e5c6; background: var(--positive-tint); border-radius: var(--radius); display: grid; gap: 6px; justify-items: center; }
.success-panel h2 { color: var(--positive-ink); }
.success-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--positive); color: #fff; margin-bottom: 4px; }
.success-icon .i { width: 24px; height: 24px; stroke-width: 3; }
.success-panel .btn-row { justify-content: center; }
.file-cell { display: flex; align-items: center; gap: 6px; font-weight: 600; word-break: break-all; }
.file-cell .i { color: var(--positive-ink); }
.note-cell { max-width: 320px; }
.up-status { font-weight: 600; font-size: 12.5px; }

/* ---------- Keyboard dialog ---------- */
.kbd-dialog { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 22px 24px; max-width: 380px; width: calc(100vw - 32px); color: var(--text); }
.kbd-dialog::backdrop { background: rgba(15, 56, 88, .35); }
.kbd-dialog h2 { color: var(--face); margin-bottom: 14px; }
.kbd-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0 0 18px; align-items: center; }
.kbd-list dd { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .c-touch { display: none; }
  .upload-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .rs-label, .brand-sep, .brand-app, .data-loaded { display: none; }
  .topbar { gap: 10px; padding: 0 12px; }
  .mainnav a span { display: none; }
  .mainnav a { padding: 0 10px; }
  .mainnav a .i { width: 18px; height: 18px; }
  .signin { grid-template-columns: 1fr; }
  .signin-brand { padding: 32px 24px; }
  .signin-points { display: none; }
  .dash-grid { grid-template-columns: 1fr; }
  .hbar-list li { grid-template-columns: 150px 1fr 32px; }
}
@media (max-width: 760px) {
  .page { padding: 16px 16px 32px; }
  h1 { font-size: 21px; }
  .hide-sm { display: none; }
  .kpi-group { flex-basis: 100%; }
  .kpi { min-width: 0; padding: 9px 10px; }
  .kpi-value { font-size: 19px; }
  .search-box { flex-basis: 100%; max-width: none; }
  .search-kbd { display: none; }
  .sort-mobile { display: block; }
  .role-switch select { max-width: 130px; }
  .toolbar-spacer { display: none; }

  /* Table becomes cards */
  .leads-table thead { display: none; }
  .leads-table, .leads-table tbody { display: block; }
  .leads-table tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: 4px 10px;
    padding: 12px 14px; border-bottom: 1px solid var(--border);
  }
  .leads-table tbody tr td { display: block; padding: 0; border: 0; width: auto; min-width: 0; }
  .leads-table .c-name { grid-column: 1; grid-row: 1; }
  .leads-table .c-tier { grid-column: 2; grid-row: 1; justify-self: end; }
  .leads-table .c-company { grid-column: 1 / -1; font-weight: 600; }
  .leads-table .c-company .cell-sub { display: inline; margin-left: 6px; }
  .leads-table .c-channel { grid-column: 1; }
  .leads-table .c-hook { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .leads-table .c-hook .hook-line { margin: 0; }
  .leads-table .c-status { grid-column: 1 / -1; }
  .leads-table .c-touch { display: none; }
  .leads-table tbody tr.empty-row { display: block; }
  .tier-badge .tb-long { display: inline; }

  .d-body { padding: 4px 16px 40px; }
  .d-head { padding: 12px 16px 0; }
  .d-outreach { margin: 12px -16px 0; padding: 14px 16px 16px; }
  .step-label { font-size: 10px; }
  .stepper { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .local-badge { left: 8px; bottom: 8px; font-size: 10.5px; }
}
@media (max-width: 420px) {
  .step-label { display: none; }
  .avatar:not(.lg) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; }
}
