/* Acquiser command center - design system
   Brand: Acquiser blue #0048ff, Archivo (display) + Inter (interface).
   Progress ramp (validated ordinal, light): #93AEFF -> #5E86FF -> #2457FF -> #0B2C93
   Status (reserved, always with a label): good #0f8a52, warning #b26b00, critical #d1343a */

@font-face { font-family: "Archivo"; src: url("/static/fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Archivo", "Inter", system-ui, sans-serif;

  --blue: #0048ff; --blue-hover: #0039d6; --blue-ink: #0036c4;
  --blue-wash: rgba(0, 72, 255, .07); --blue-wash-2: rgba(0, 72, 255, .13);

  --ink: #0b1b3f; --ink-2: #364766; --muted: #66748f; --faint: #98a3b9;
  --paper: #f3f5f9; --surface: #ffffff; --surface-2: #f8f9fc; --line: #e3e8f0; --line-2: #eef1f6;

  --p1: #93aeff; --p2: #5e86ff; --p3: #2457ff; --p4: #0b2c93;
  --good: #0f8a52; --good-wash: #e4f5ec; --warn: #b26b00; --warn-wash: #fff3de; --bad: #d1343a; --bad-wash: #fdeaea;
  --neutral: #a3adbf;
  --hero: #0b1b3f; --hero-ink: #ffffff; --hero-muted: rgba(255, 255, 255, .62); --hero-faint: rgba(255, 255, 255, .42);
  --hero-line: rgba(255, 255, 255, .14); --hero-lit: #6f93ff;

  --r-xs: 6px; --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --float: 0 1px 2px rgba(11, 27, 63, .06), 0 16px 40px -16px rgba(11, 27, 63, .28);
  --ring: 0 0 0 3px rgba(0, 72, 255, .25);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #e8edf8; --ink-2: #c3cce0; --muted: #8e9ab6; --faint: #66728f;
  --paper: #0a1228; --surface: #0f1a33; --surface-2: #13203d; --line: #1f2d4f; --line-2: #18254a;
  --blue: #4d7cff; --blue-hover: #6a91ff; --blue-ink: #8eabff;
  --blue-wash: rgba(77, 124, 255, .12); --blue-wash-2: rgba(77, 124, 255, .22);
  --p1: #3a5bc7; --p2: #6f93ff; --p3: #9db6ff; --p4: #c9d8ff;
  --good: #3ecb8a; --good-wash: rgba(62, 203, 138, .13); --warn: #f0b04c; --warn-wash: rgba(240, 176, 76, .13);
  --bad: #ff6b70; --bad-wash: rgba(255, 107, 112, .13); --neutral: #5c6886;
  --hero: #132a63; --hero-line: rgba(255, 255, 255, .12); --hero-lit: #8eabff;
  --float: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
svg { width: 16px; height: 16px; flex: none; }  /* icons never grow to their container */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }
::selection { background: var(--blue-wash-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.rail { position: fixed; top: 0; bottom: 0; left: 0; width: 244px; z-index: 30; display: flex; flex-direction: column; gap: 6px;
  padding: 22px 14px 16px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.rail .logo { display: block; padding: 2px 10px 18px; }
.rail .logo img { height: 21px; width: auto; display: block; }
:root[data-theme="dark"] .rail .logo img { filter: brightness(0) invert(1); opacity: .92; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 520; font-size: 14px; }
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.on { background: var(--blue-wash); color: var(--blue-ink); }
.nav a.on svg { color: var(--blue); }
.nav .count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--bad);
  color: #fff; font-size: 11.5px; font-weight: 650; line-height: 20px; text-align: center; }
.nav .sep { height: 1px; background: var(--line-2); margin: 10px 10px; }
.rail-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); }
.rail-foot .row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.rail-foot button { all: unset; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.rail-foot button svg { width: 15px; height: 15px; }
.rail-foot button:hover { color: var(--ink); }
.rail-foot button:focus-visible { box-shadow: var(--ring); border-radius: var(--r-xs); }

.main { min-width: 0; margin-left: 244px; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 60px;
  padding: 0 28px; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2); }
.searchbox { position: relative; flex: 1; max-width: 560px; }
.searchbox input { width: 100%; height: 38px; padding: 0 74px 0 38px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.searchbox input:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.searchbox > svg { position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; color: var(--faint); }
.searchbox kbd { position: absolute; right: 9px; top: 8px; }
kbd { font: 600 11px/20px var(--font); padding: 0 6px; border-radius: 5px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted); }
.top .clock { margin-left: auto; display: flex; gap: 16px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.top .clock b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.page { padding: 26px 28px 80px; max-width: 1360px; }
.head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head h1 { margin: 0; font: 720 28px/1.15 var(--display); letter-spacing: -.022em; }
.head p { margin: 4px 0 0; color: var(--muted); max-width: 72ch; }
.head p a { display: inline-flex; align-items: center; gap: 4px; }
.head p svg { width: 14px; height: 14px; }
.head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumb a { color: var(--muted); }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel > header { display: flex; align-items: baseline; gap: 10px; padding: 16px 20px 0; }
.panel > header h2 { margin: 0; font: 680 15.5px/1.3 var(--display); letter-spacing: -.01em; }
.panel > header .sub { color: var(--muted); font-size: 12.5px; }
.panel > header .right { margin-left: auto; font-size: 13px; }
.panel .body { padding: 14px 20px 18px; }
.panel .body.flush { padding: 8px 0 4px; }
.cols { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cols.wide-left { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.cols.wide-right { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); }
.stack { display: grid; gap: 18px; align-content: start; }
.mt { margin-top: 18px; }
@media (max-width: 1100px) { .cols, .cols.wide-left, .cols.wide-right { grid-template-columns: 1fr; } }

/* ---------- strip of figures ---------- */
.strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); }
.strip > div { padding: 16px 20px; border-left: 1px solid var(--line-2); }
.strip > div:first-child { border-left: 0; }
.fig .l { font-size: 12.5px; color: var(--muted); }
.fig .v { font: 700 26px/1.2 var(--display); letter-spacing: -.02em; margin-top: 3px; }
.fig .h { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.fig a.v { color: var(--ink); display: inline-block; }
.fig a.v:hover { color: var(--blue); text-decoration: none; }
@media (max-width: 1100px) { .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip > div:nth-child(odd) { border-left: 0; } .strip > div { border-top: 1px solid var(--line-2); } }

/* ---------- hero: today's send rack (the one dark, bold surface) ---------- */
.hero { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: 32px;
  background: var(--hero); color: var(--hero-ink); border-radius: var(--r-lg); padding: 26px 28px 22px; margin-bottom: 18px; }
.hero a { color: var(--hero-ink); text-decoration: underline; text-underline-offset: 2px; }
.hero .today .l { color: var(--hero-muted); font-size: 13px; }
.hero .today .big { font: 760 64px/1 var(--display); letter-spacing: -.04em; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.hero .today .big small { font: 600 24px/1 var(--display); color: var(--hero-faint); letter-spacing: -.01em; }
.hero .today .state { margin-top: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 9px; font-size: 13.5px; }
.hero .today .state .note { color: var(--hero-muted); max-width: 34ch; }
.hero .state-pill { background: rgba(255, 255, 255, .07); border-color: var(--hero-line); color: var(--hero-ink); }
.hero .state-pill i { background: rgba(255, 255, 255, .45); }
.hero .state-pill.on { color: #7fe3b3; border-color: rgba(127, 227, 179, .35); }
.hero .state-pill.on i { background: #3ecb8a; box-shadow: 0 0 0 3px rgba(62, 203, 138, .22); }
.hero .state-pill.paused { color: #f6c46e; } .hero .state-pill.paused i { background: #f0b04c; }
.rack-side { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.rack { display: flex; gap: 30px; align-items: flex-end; flex-wrap: wrap; padding-bottom: 2px; }
.rack .group { display: flex; flex-direction: column; gap: 10px; }
.rack .cols { display: flex; flex-wrap: wrap; gap: 5px; align-items: flex-end; grid-template-columns: none; }
.rack .box { display: grid; grid-template-columns: repeat(2, 8px); gap: 2px; align-content: end;
  padding: 5px 4px; border-radius: 6px; background: rgba(255, 255, 255, .035); border: 1px solid var(--hero-line); }
.rack .box:hover { border-color: var(--hero-lit); }
.rack .slot { width: 8px; height: 8px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.rack .slot.on { background: var(--hero-lit); box-shadow: 0 0 7px rgba(111, 147, 255, .55); }
.rack .who { font-size: 12.5px; color: var(--hero-muted); white-space: nowrap; }
.rack .who b { color: var(--hero-ink); font-weight: 620; margin-right: 6px; }
.rack-note { margin: 14px 0 0; font-size: 12.5px; color: var(--hero-faint); }
.hero .empty, .hero .empty b { color: var(--hero-muted); }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 22px; } }

/* ---------- switch state ---------- */
.state-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 11px 4px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); white-space: nowrap; }
.state-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); }
.state-pill.on { border-color: color-mix(in srgb, var(--good) 35%, var(--line)); color: var(--good); }
.state-pill.on i { background: var(--good); box-shadow: 0 0 0 3px var(--good-wash); }
.state-pill.paused i { background: var(--warn); }
.state-pill.paused { color: var(--warn); }

/* ---------- status pills ---------- */
.st { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 560; color: var(--ink-2); white-space: nowrap; }
.st i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.st.queued i { background: var(--p1); } .st.uploaded i { background: var(--p2); }
.st.sent i { background: var(--p3); } .st.replied i { background: var(--p4); }
.st.interested i { background: var(--good); }
.st.pending i { background: var(--good); box-shadow: 0 0 0 3px var(--good-wash); }
.st.pending { color: var(--good); }
.st.bounced i { background: var(--bad); } .st.stopped i { background: var(--warn); }
.st.held i { background: transparent; box-shadow: inset 0 0 0 1.6px var(--neutral); }
.st.excluded i { background: transparent; box-shadow: inset 0 0 0 1.6px var(--bad); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--surface-2);
  border: 1px solid var(--line-2); color: var(--ink-2); font-size: 12px; font-weight: 560; white-space: nowrap; }
.tag.blue { background: var(--blue-wash); border-color: transparent; color: var(--blue-ink); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 150px; max-width: 260px; }
.tags .tag { white-space: normal; }
.tag.good { background: var(--good-wash); border-color: transparent; color: var(--good); }
.tag.warn { background: var(--warn-wash); border-color: transparent; color: var(--warn); }
.tag.bad { background: var(--bad-wash); border-color: transparent; color: var(--bad); }

/* ---------- the send track ---------- */
.track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; min-width: 120px; }
.track span { height: 5px; border-radius: 3px; background: var(--line); }
.track span.done { background: var(--blue); }
.track.good span.done:last-of-type { background: var(--good); }
.track.bad span.done:nth-child(3) { background: var(--bad); }
.track.stop span.done:last-of-type { background: var(--warn); }
.track-full { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.track-full div { padding-top: 10px; border-top: 4px solid var(--line); font-size: 12.5px; color: var(--faint); }
.track-full div.done { border-color: var(--blue); color: var(--ink-2); }
.track-full div.now { color: var(--ink); font-weight: 600; }
.track-full.good div.done.last { border-color: var(--good); }
.track-full.bad div.done.last { border-color: var(--bad); }
.track-full.stop div.done.last { border-color: var(--warn); }

/* ---------- tables ---------- */
.table-wrap { overflow: visible; }
@media (max-width: 1100px) { .table-wrap { overflow-x: auto; } .table-wrap table.t th { position: static; } }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
table.t th { position: sticky; top: 60px; z-index: 2; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; font-size: 13.5px; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background-color .12s; }
table.t tbody tr[data-href] { cursor: pointer; }
table.t tbody tr:hover { background: var(--surface-2); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.name { font-weight: 600; color: var(--ink); }
a.name { color: var(--ink); }
a.name:hover { color: var(--blue); }
.sub2 { color: var(--muted); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.who-cell { display: flex; gap: 11px; align-items: flex-start; }
.av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--blue-wash); color: var(--blue-ink); font: 650 12px/1 var(--font); letter-spacing: .02em; }
.av.lg { width: 46px; height: 46px; font-size: 15px; }
.co-mark { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font: 700 12px/1 var(--display); }

/* ---------- filters ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 540; white-space: nowrap; }
.chip:hover { border-color: var(--p2); color: var(--ink); text-decoration: none; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.on .n { color: color-mix(in srgb, var(--surface) 70%, transparent); }
.field { height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  color: var(--ink); font: inherit; font-size: 13.5px; }
.field:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
input.field[type="search"] { min-width: 260px; flex: 1 1 260px; max-width: 420px; }
select.field { padding-right: 28px; flex: 0 1 auto; max-width: 200px; }
.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 13px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 13.5px/1 var(--font);
  cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--p2); text-decoration: none; color: var(--ink); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.icon-link { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; }
.icon-link svg { width: 15px; height: 15px; }
.icon-link:hover { color: var(--blue); text-decoration: none; }

/* ---------- charts ---------- */
.chart { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; padding-top: 20px; }
.chart .y { position: relative; height: 150px; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.chart .y span { position: absolute; right: 0; transform: translateY(-50%); }
.chart .plot { position: relative; height: 150px; display: flex; align-items: flex-end; gap: 3px; }
.chart .plot .grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--line-2); }
.chart .col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart .col .bar { width: min(22px, 70%); background: var(--blue); border-radius: 4px 4px 0 0; min-height: 0; position: relative; z-index: 1; }
.chart .col.zero .bar { background: transparent; }
.chart .col .lbl { position: absolute; z-index: 2; transform: translateY(-120%); font-size: 11.5px; font-weight: 650; color: var(--ink-2);
  font-variant-numeric: tabular-nums; }
.chart .col .tip { display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 5;
  background: var(--ink); color: var(--surface); padding: 6px 9px; border-radius: 7px; font-size: 12px; white-space: nowrap; box-shadow: var(--float); }
.chart .col:hover .tip, .chart .col:focus .tip { display: block; }
.chart .col:hover .bar { background: var(--blue-hover); }
.chart .x { grid-column: 2; display: flex; gap: 3px; font-size: 11px; color: var(--faint); }
.chart .x span { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; }
.chart-note { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.chart-empty { position: absolute; inset: 0 0 18px; display: grid; place-items: center; color: var(--faint); font-size: 13px; }
.chart.is-empty .col { display: none; }

.pipe { display: flex; height: 14px; gap: 2px; border-radius: 7px; overflow: hidden; background: var(--line-2); }
.pipe span { display: block; height: 100%; min-width: 0; }
.pipe .queued { background: var(--p1); } .pipe .uploaded { background: var(--p2); } .pipe .sent { background: var(--p3); }
.pipe .replied { background: var(--p4); } .pipe .bounced { background: var(--bad); } .pipe .stopped { background: var(--warn); }
.legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; margin-top: 14px; }
.legend > div { display: flex; flex-direction: column; gap: 2px; }
.legend .k { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.legend .k i { width: 9px; height: 9px; border-radius: 3px; }
.legend .k i.queued { background: var(--p1); } .legend .k i.uploaded { background: var(--p2); }
.legend .k i.sent { background: var(--p3); } .legend .k i.replied { background: var(--p4); }
.legend .k i.bounced { background: var(--bad); } .legend .k i.stopped { background: var(--warn); }
.legend .v { font: 680 18px/1.2 var(--display); letter-spacing: -.01em; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.list > a, .list > div.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; border-top: 1px solid var(--line-2); color: var(--ink); }
.list > a:first-child, .list > div.item:first-child { border-top: 0; }
.list > a:hover { background: var(--surface-2); text-decoration: none; }
.list .grow { flex: 1; min-width: 0; }
.list .snip { color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.list .when { color: var(--faint); font-size: 12px; white-space: nowrap; }
.empty { padding: 28px 22px; color: var(--muted); font-size: 13.5px; }
.empty b { color: var(--ink-2); display: block; font-size: 14px; margin-bottom: 2px; }

/* ---------- email + research ---------- */
.letter { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.letter .hdr { padding: 12px 16px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); font-size: 13px; display: grid; gap: 3px; }
.letter .hdr div { display: flex; gap: 8px; }
.letter .hdr span:first-child { width: 58px; flex: none; color: var(--faint); }
.letter .hdr .subj { font-weight: 650; color: var(--ink); }
.letter .txt { padding: 16px 18px 18px; white-space: pre-wrap; font-size: 14.5px; line-height: 1.62; max-width: 68ch; color: var(--ink); }
.letter .foot { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.letter.theirs { border-color: color-mix(in srgb, var(--good) 30%, var(--line)); }
.letter.theirs .hdr { background: var(--good-wash); }
.facts { display: grid; gap: 16px; }
.fact h3 { margin: 0 0 6px; font: 650 13px/1.3 var(--font); color: var(--muted); }
.fact p { margin: 0; color: var(--ink); max-width: 72ch; }
.fact ul { margin: 0; padding-left: 18px; } .fact li { margin: 4px 0; }
.found { display: grid; gap: 10px; }
.found .f { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 12px; }
.found .d { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; }
.sources a { font-size: 12.5px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- ladder (people at a company, in send order) ---------- */
.ladder { display: grid; gap: 0; }
.rung { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; position: relative; padding: 14px 20px 14px 18px; border-top: 1px solid var(--line-2); }
.rung:first-child { border-top: 0; }
.rung .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 12.5px/1 var(--display);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.rung.live .n { background: var(--blue); border-color: var(--blue); color: #fff; }
.rung .line1 { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.rung .when { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.rung details { margin-top: 10px; }
.rung summary { cursor: pointer; font-size: 13px; color: var(--blue); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.rung summary::-webkit-details-marker { display: none; }
.rung details[open] summary { margin-bottom: 10px; }

/* ---------- notes, callouts, forms ---------- */
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--blue-wash); color: var(--ink); font-size: 13.5px; }
.callout.good { background: var(--good-wash); } .callout.warn { background: var(--warn-wash); } .callout.bad { background: var(--bad-wash); }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.decide { display: grid; gap: 10px; }
.decide textarea, .decide input[type=text] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: var(--surface); color: var(--ink); }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.copy { all: unset; cursor: pointer; color: var(--faint); display: inline-flex; vertical-align: middle; }
.copy svg { width: 14px; height: 14px; }
.copy:hover { color: var(--blue); }
.copy.ok { color: var(--good); }
.checks { margin: 6px 0 16px; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.checks-head { padding: 10px 14px; font-size: 12.5px; font-weight: 650; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.check { display: grid; grid-template-columns: 22px 190px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 9px 14px;
  border-top: 1px solid var(--line-2); font-size: 13.5px; }
.check:nth-child(2) { border-top: 0; }
.check .mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; align-self: center; }
.check .mark svg { width: 13px; height: 13px; stroke-width: 2.4; }
.check.ok .mark { background: var(--good-wash); color: var(--good); }
.check.bad .mark { background: var(--bad-wash); color: var(--bad); }
.check.ask .mark { background: var(--warn-wash); color: var(--warn); }
.check .lbl { font-weight: 600; color: var(--ink); }
.check .det { color: var(--ink-2); }
@media (max-width: 700px) { .check { grid-template-columns: 22px minmax(0, 1fr); } .check .det { grid-column: 2; } }
.health { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.health .h { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.health .h .t { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 13.5px; }
.health .h .d { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.bubble-row { display: grid; gap: 14px; }
.convo-mark { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted);
  padding: 10px 14px; border: 1px dashed var(--line); border-radius: var(--r); }
.convo-mark svg { width: 15px; height: 15px; color: var(--p3); }
.ai { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; background: var(--surface-2); }
.ai .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.conf { height: 6px; width: 90px; border-radius: 3px; background: var(--line); overflow: hidden; }
.conf span { display: block; height: 100%; background: var(--blue); }
.mb-bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; width: 120px; }
.mb-bar span { display: block; height: 100%; background: var(--blue); }

/* ---------- command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center;
  padding-top: 12vh; background: rgba(11, 27, 63, .32); }
.palette.open { display: flex; }
.palette .box { width: min(640px, 92vw); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--float); border: 1px solid var(--line); overflow: hidden; }
.palette input { width: 100%; height: 54px; border: 0; border-bottom: 1px solid var(--line-2); padding: 0 20px; font: inherit; font-size: 16px; background: transparent; color: var(--ink); }
.palette input:focus { outline: none; }
.palette .res { max-height: 56vh; overflow-y: auto; padding: 6px 0; }
.palette .grp { padding: 10px 20px 4px; font-size: 12px; color: var(--faint); font-weight: 600; }
.palette a { display: flex; gap: 10px; align-items: baseline; padding: 9px 20px; color: var(--ink); }
.palette a .s { color: var(--muted); font-size: 12.5px; margin-left: auto; text-align: right; }
.palette a.sel, .palette a:hover { background: var(--blue-wash); text-decoration: none; }
.palette .hint { padding: 10px 20px; font-size: 12px; color: var(--faint); border-top: 1px solid var(--line-2); }

dialog.confirm { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; box-shadow: var(--float); width: min(460px, 92vw); background: var(--surface); color: var(--ink); }
dialog.confirm::backdrop { background: rgba(11, 27, 63, .35); }
dialog.confirm .in { padding: 22px 22px 18px; }
dialog.confirm h3 { margin: 0 0 6px; font: 700 18px/1.3 var(--display); }
dialog.confirm p { margin: 0 0 14px; color: var(--muted); }
dialog.confirm .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface);
  padding: 10px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--float); z-index: 120; }

/* ---------- shared small pieces ---------- */
.co-mark.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 17px; }
.av.sm { width: 26px; height: 26px; font-size: 10.5px; border: 2px solid var(--surface); }
.av.sm.sent, .av.sm.replied { background: var(--p3); color: #fff; }
.av.sm.uploaded { background: var(--p2); color: #fff; }
.av.sm.interested { background: var(--good); color: #fff; }
.av.sm.bounced { background: var(--bad-wash); color: var(--bad); }
.av.sm.held { background: var(--surface-2); color: var(--faint); }
.faces { display: flex; align-items: center; }
.faces .av + .av { margin-left: -6px; }
.faces .more { margin-left: 6px; font-size: 12px; color: var(--muted); }
.dot-sep { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--faint); margin: 0 9px; vertical-align: middle; }
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.contact .copy { margin-left: -6px; }
.mono-ish { font-variant-numeric: tabular-nums; letter-spacing: .005em; overflow-wrap: anywhere; }
.mt-s { margin-top: 10px; }
.line1 { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.name.big { font: 700 18px/1.25 var(--display); letter-spacing: -.012em; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; color: var(--ink-2); font-size: 13.5px; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue-wash); color: var(--blue-ink); font: 700 12px/1 var(--display); }
.steps li b { color: var(--ink); font-weight: 650; }
.legend.inline { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.big-empty { padding: 48px 28px; text-align: center; max-width: 560px; margin: 0 auto; }

/* ---------- portal (what Benchmarc sees) ---------- */
body.portal { background: var(--paper); }
.p-wrap { max-width: 1180px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }
.p-top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.p-top .p-wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.p-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); white-space: nowrap; }
.p-brand:hover { text-decoration: none; color: var(--ink); }
.p-brand img { height: 19px; width: auto; display: block; }
:root[data-theme="dark"] .p-brand img { filter: brightness(0) invert(1); opacity: .92; }
.p-brand .for { color: var(--faint); font-size: 13px; }
.p-brand b { font: 720 16px/1 var(--display); letter-spacing: -.015em; }
.p-nav { display: flex; gap: 2px; margin-left: 14px; }
.p-nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 560; font-size: 14px; }
.p-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.p-nav a.on { background: var(--blue-wash); color: var(--blue-ink); }
.p-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.p-right form { margin: 0; }
.p-preview { background: var(--ink); color: var(--surface); font-size: 13px; }
.p-preview .p-wrap { display: flex; gap: 10px; align-items: center; padding-top: 9px; padding-bottom: 9px; }
.p-preview svg { width: 16px; height: 16px; flex: none; }
.p-preview a { margin-left: auto; color: var(--surface); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.p-page { padding-top: 30px; padding-bottom: 72px; }
.p-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line-2);
  color: var(--muted); font-size: 12.5px; padding-top: 18px; padding-bottom: 40px; }

.p-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px 36px; padding: 28px 30px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.p-hero-main h1 { margin: 14px 0 10px; font: 720 34px/1.12 var(--display); letter-spacing: -.028em; color: var(--ink); }
.p-hero-main h1 .num { color: var(--blue); }
.p-hero-main p { margin: 0; color: var(--muted); max-width: 60ch; }
.p-hero-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-self: end; border-left: 1px solid var(--line-2); }
.p-hero-figs .fig { padding: 4px 0 4px 20px; }
.p-hero-bar { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid var(--line-2); }
.p-hero-bar .pipe { height: 12px; }
.pipe .interested { background: var(--good); }
.legend .k i.interested { background: var(--good); }

.p-lead { margin-bottom: 16px; }
.p-lead-top { display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px 0; }
.p-lead-top .grow { flex: 1; min-width: 0; }
.p-lead-top .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.p-lead-body { display: grid; gap: 14px; padding: 16px 22px 20px 82px; }
.p-lead-body details summary, .rung summary { cursor: pointer; font-size: 13px; color: var(--blue); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.p-lead-body details summary::-webkit-details-marker { display: none; }
.p-lead-body details summary svg, .rung summary svg { width: 15px; height: 15px; }
.p-lead-body details[open] summary { margin-bottom: 10px; }
.p-lead-body .btn { justify-self: start; }

.p-login { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 40px 16px; }
.p-login .card { width: 420px; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 30px 30px 26px; box-shadow: var(--float); display: grid; gap: 14px; }
.p-login h1 { margin: 10px 0 0; font: 740 28px/1.15 var(--display); letter-spacing: -.025em; }
.p-login .lede { margin: 0; color: var(--muted); }
.p-form { display: grid; gap: 12px; margin-top: 4px; }
.p-form label { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 560; }
.p-form .field { height: 42px; width: 100%; font-size: 15px; }
.p-form .btn { height: 42px; margin-top: 4px; font-size: 14.5px; }
.p-login-foot { text-align: center; color: var(--faint); font-size: 12.5px; margin: 0; }
.p-empty-page { padding: 12vh 0; display: grid; gap: 12px; justify-items: start; max-width: 560px; }
.p-empty-page h1 { margin: 0; font: 720 30px/1.15 var(--display); letter-spacing: -.025em; }
.p-empty-page p { margin: 0 0 6px; color: var(--muted); }

@media (max-width: 900px) {
  .p-wrap { padding-left: 16px; padding-right: 16px; }
  .p-top .p-wrap { height: auto; flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; padding-bottom: 8px; }
  .p-nav { order: 3; width: 100%; margin-left: -8px; overflow-x: auto; }
  .p-brand .for, .hide-sm { display: none; }
  .p-hero { grid-template-columns: 1fr; padding: 22px 18px; }
  .p-hero-main h1 { font-size: 27px; }
  .p-hero-figs { border-left: 0; border-top: 1px solid var(--line-2); padding-top: 14px; }
  .p-hero-figs .fig { padding-left: 0; }
  .legend.inline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-lead-body { padding-left: 22px; }
  .p-preview .p-wrap { flex-wrap: wrap; }
}

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .main { margin-left: 0; }
  .rail { position: fixed; bottom: 0; top: auto; left: 0; right: 0; width: auto; height: auto; z-index: 40; flex-direction: row; padding: 6px 8px;
    border-right: 0; border-top: 1px solid var(--line); overflow: visible; }
  .rail .logo, .rail-foot, .nav .sep { display: none; }
  .nav { flex-direction: row; justify-content: flex-start; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; position: relative; }
  .nav a { flex-direction: column; gap: 3px; padding: 6px 8px; font-size: 11px; }
  .nav a .count { position: absolute; margin: -4px 0 0 14px; min-width: 18px; line-height: 16px; font-size: 10.5px; }
  .top { padding: 0 14px; } .top .clock, .searchbox kbd { display: none; }
  .searchbox input { padding-right: 12px; }
  .page { padding: 18px 14px 110px; }
  .head h1 { font-size: 23px; }
  .hero .today .big { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .rail, .top { display: none; } .main { margin-left: 0; } }
