Autonomous AI sales agent powered by Claude Code or Codex. Finds prospects, writes cold emails, sends campaigns, handles replies, books meetings. No API keys needed — runs on your Claude or Codex subscriptions.
Dashboard redesign: sidebar shell, one type scale, charts on Today, cleaner tables
Ethand852ffddeaae
diff --git a/harvey/dashboard.py b/harvey/dashboard.pyindex adfec6c..7c3a7ca 100644--- a/harvey/dashboard.py+++ b/harvey/dashboard.py@@ -1238,6 +1238,30 @@ async def get_conversations():return rows[email protected]("/api/trend")+async def get_trend(days: int = 14):+ """Daily counts for the last `days` UTC days (stored times are UTC):+ contacts found, emails sent, first replies. Days with nothing are 0."""+ from datetime import datetime, timedelta, timezone+ days = max(1, min(90, days))+ today = datetime.now(timezone.utc).date()+ labels = [(today - timedelta(days=n)).isoformat() for n in range(days - 1, -1, -1)]++ async def per_day(table: str, column: str, where: str = "") -> list[int]:+ rows = await query_db(+ f"SELECT date({column}) AS d, COUNT(*) AS n FROM {table} "+ f"WHERE date({column}) >= ? {where} GROUP BY d", (labels[0],))+ counts = {r["d"]: r["n"] for r in rows}+ return [counts.get(day, 0) for day in labels]++ return {+ "days": labels,+ "found": await per_day("prospects", "created_at"),+ "sent": await per_day("outbox", "sent_at", "AND status = 'sent'"),+ "replies": await per_day("conversations", "created_at"),+ }++@app.get("/api/activity")async def get_activity():rows = await query_db("SELECT * FROM actions ORDER BY created_at DESC LIMIT 100")diff --git a/harvey/web/app.css b/harvey/web/app.cssindex fb28050..21bdc8b 100644--- a/harvey/web/app.css+++ b/harvey/web/app.css@@ -1,23 +1,23 @@/* ══════════════════════════════════════════════════════════════Harvey — dashboard styles- Three rules the whole sheet follows:-- 1. The interface carries no colour. Only STATUS is allowed a hue,- so anything coloured on screen means something.- 2. Structure comes from hairlines, alignment and type weight —- not from wrapping everything in a bordered card.- 3. Every figure is monospaced and tabular, so columns of numbers- line up and a changing value doesn't shift the layout.-- Light and dark are the same design, re-tokenised. Nothing but the- values in :root / [data-theme] changes between them.+ The rules this sheet follows:++ 1. One accent. Indigo marks the primary action, the current page+ and the main series in a chart. Status hues (good, waiting, bad,+ active, note) appear only on status, so colour always means+ something.+ 2. Space groups things; shadows lift surfaces; lines only divide.+ The gap between groups is at least twice the gap inside one.+ 3. One typeface on a small scale. Numbers are tabular so columns+ line up and a changing value never shifts the layout.+ 4. Motion is for feedback, not decoration: nothing animates on a+ tab switch, buttons press, hovers only on a real pointer.++ Light and dark are the same design re-tokenised: only :root and+ [data-theme] change between them.══════════════════════════════════════════════════════════════ */-@font-face {- font-family: 'Newsreader'; font-style: normal; font-weight: 400 500;- font-display: swap; src: url('/static/fonts/newsreader.woff2') format('woff2');-}@font-face {font-family: 'Geist'; font-style: normal; font-weight: 400 600;font-display: swap; src: url('/static/fonts/geist.woff2') format('woff2');@@ -30,576 +30,929 @@/* ── Tokens ──────────────────────────────────────────────────── */:root {- --serif: 'Newsreader', Georgia, 'Times New Roman', serif;--sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;--mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;- --r-sm: 3px;- --r-md: 5px;- --gut: 28px;-- /* Light — warm paper. Greys are tinted warm; nothing is neutral grey. */- --bg: #FBFAF8;- --panel: #FFFFFF;- --panel-raised: #F5F3EF;- --border: #E8E4DD;- --border-strong: #D3CDC3;- --rule: #1E1B17; /* the heavy rule under a heading */- --text: #1E1B17;- --text-2: #5E584F;- --text-3: #948D82;- --ink: #1E1B17; /* the one "accent": ink */- --ink-contrast: #FBFAF8;- --ink-soft: #EFEBE3;-- --s-good: #3D6046; --s-good-bg: #EAF0EB; --s-good-line: #CFDDD3;- --s-wait: #8A6A1F; --s-wait-bg: #FAF2DC; --s-wait-line: #EADFBE;- --s-bad: #96322E; --s-bad-bg: #FBEBE9; --s-bad-line: #EFD3CF;- --s-active: #2C5F7C; --s-active-bg: #E9F0F5; --s-active-line: #D0DFE9;- --s-note: #5B4A72; --s-note-bg: #F1EDF6; --s-note-line: #E0D8E9;-- --shadow: 0 8px 24px rgba(30, 27, 23, 0.10);+ /* Type scale: size / line-height pairs, by role. */+ --fs-caption: 0.75rem; /* 12 */+ --fs-ui: 0.8125rem; /* 13 */+ --fs-body: 0.875rem; /* 14 */+ --fs-lead: 0.9375rem; /* 15 */+ --fs-h3: 1rem; /* 16 */+ --fs-h2: 1.375rem; /* 22 */+ --fs-kpi: 1.75rem; /* 28 */++ /* Spacing: one step per nesting level. */+ --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;+ --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;++ /* Radii: controls sit inside cards with 6px padding+, so cards are+ concentric with the controls they hold. */+ --r-xs: 4px; /* tags, kbd */+ --r-sm: 6px; /* buttons, inputs */+ --r-md: 10px; /* inner panels */+ --r-lg: 14px; /* cards */++ --sidebar-w: 236px;+ --content-w: 1180px;++ --ease-out: cubic-bezier(0.23, 1, 0.32, 1);++ /* Light — neutral, a touch cool. */+ --bg: #F6F6F7;+ --surface: #FFFFFF;+ --surface-2: #F3F3F4; /* hover, inset panels */+ --surface-3: #EBEBED; /* pressed, tracks */+ --line: #E7E7EA;+ --line-strong: #D6D6DB;+ --text: #111113;+ --text-2: #5B5B63;+ --text-3: #8B8B93;+ --accent: #4F46E5;+ --accent-hover:#4338CA;+ --accent-text: #FFFFFF;+ --accent-soft: #EEF0FF;+ --accent-line: #D9DCFF;+ --chart-muted: #C9CAF7;++ --good: #1F7A4D; --good-bg: #E8F6EE; --good-line: #C6EAD5;+ --wait: #8A5A00; --wait-bg: #FFF4DE; --wait-line: #F6DFAE;+ --bad: #B4232F; --bad-bg: #FDECEE; --bad-line: #F7CDD2;+ --active: #1D5FA8; --active-bg: #E8F1FC; --active-line: #C9DDF6;+ --note: #6A3FB0; --note-bg: #F2ECFC; --note-line: #DFD1F6;++ --shadow-border:+ 0 0 0 1px rgb(17 17 19 / 0.06),+ 0 1px 2px -1px rgb(17 17 19 / 0.06),+ 0 2px 4px 0 rgb(17 17 19 / 0.04);+ --shadow-border-hover:+ 0 0 0 1px rgb(17 17 19 / 0.09),+ 0 1px 2px -1px rgb(17 17 19 / 0.08),+ 0 2px 6px 0 rgb(17 17 19 / 0.06);+ --shadow-pop: 0 0 0 1px rgb(17 17 19 / 0.08), 0 12px 32px -8px rgb(17 17 19 / 0.18);+ --btn-shadow: 0 0 0 1px rgb(17 17 19 / 0.10), 0 1px 2px rgb(17 17 19 / 0.06);+ --btn-primary-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18), 0 0 0 1px #3F37C9, 0 1px 2px rgb(17 17 19 / 0.12);color-scheme: light;}-/* Dark — warm charcoal. Same design, re-tokenised.- Declared twice on purpose: once for an explicit choice, once for the- system preference when the user hasn't chosen. A single selector list- can't do both, because the explicit one must win over the media query. */+/* Dark — near-black, neutral. Declared twice on purpose: once for an+ explicit choice, once for the system preference when none is chosen. */:root[data-theme='dark'] {- --bg: #131210;- --panel: #1A1917;- --panel-raised: #221F1C;- --border: #2B2825;- --border-strong: #3D3934;- --rule: #6B655D;- --text: #ECE8E1;- --text-2: #A39C92;- --text-3: #6E6960;- --ink: #ECE8E1;- --ink-contrast: #131210;- --ink-soft: #262320;-- --s-good: #86AE90; --s-good-bg: rgba(134,174,144,0.11); --s-good-line: rgba(134,174,144,0.26);- --s-wait: #CBAA63; --s-wait-bg: rgba(203,170,99,0.11); --s-wait-line: rgba(203,170,99,0.26);- --s-bad: #CB8279; --s-bad-bg: rgba(203,130,121,0.11); --s-bad-line: rgba(203,130,121,0.26);- --s-active: #85A2BD; --s-active-bg: rgba(133,162,189,0.11); --s-active-line: rgba(133,162,189,0.26);- --s-note: #A091B3; --s-note-bg: rgba(160,145,179,0.11); --s-note-line: rgba(160,145,179,0.26);-- --shadow: 0 8px 28px rgba(0, 0, 0, 0.55);+ --bg: #0E0E10;+ --surface: #161618;+ --surface-2: #1D1D20;+ --surface-3: #26262A;+ --line: #26262A;+ --line-strong: #34343A;+ --text: #F3F3F5;+ --text-2: #A3A3AC;+ --text-3: #6E6E77;+ --accent: #7B74FF;+ --accent-hover:#8D87FF;+ --accent-text: #FFFFFF;+ --accent-soft: #1E1C3A;+ --accent-line: #2E2B5C;+ --chart-muted: #34315F;++ --good: #5CCB8F; --good-bg: #10261B; --good-line: #1C4130;+ --wait: #F0B84F; --wait-bg: #2A2010; --wait-line: #4A3817;+ --bad: #FF7A85; --bad-bg: #2C1316; --bad-line: #4C1F25;+ --active: #6AA8F2; --active-bg: #11202F; --active-line: #1D3650;+ --note: #B79BF5; --note-bg: #1E1730; --note-line: #352857;++ --shadow-border: 0 0 0 1px rgb(255 255 255 / 0.07);+ --shadow-border-hover: 0 0 0 1px rgb(255 255 255 / 0.12);+ --shadow-pop: 0 0 0 1px rgb(255 255 255 / 0.09), 0 16px 40px -8px rgb(0 0 0 / 0.6);+ --btn-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06), 0 0 0 1px rgb(255 255 255 / 0.10);+ --btn-primary-shadow: inset 0 1px 0 rgb(255 255 255 / 0.20), 0 0 0 1px rgb(0 0 0 / 0.4);color-scheme: dark;}@media (prefers-color-scheme: dark) {:root:not([data-theme='light']) {- --bg:#131210; --panel:#1A1917; --panel-raised:#221F1C;- --border:#2B2825; --border-strong:#3D3934; --rule:#6B655D;- --text:#ECE8E1; --text-2:#A39C92; --text-3:#6E6960;- --ink:#ECE8E1; --ink-contrast:#131210; --ink-soft:#262320;- --s-good:#86AE90; --s-good-bg:rgba(134,174,144,0.11); --s-good-line:rgba(134,174,144,0.26);- --s-wait:#CBAA63; --s-wait-bg:rgba(203,170,99,0.11); --s-wait-line:rgba(203,170,99,0.26);- --s-bad:#CB8279; --s-bad-bg:rgba(203,130,121,0.11); --s-bad-line:rgba(203,130,121,0.26);- --s-active:#85A2BD; --s-active-bg:rgba(133,162,189,0.11); --s-active-line:rgba(133,162,189,0.26);- --s-note:#A091B3; --s-note-bg:rgba(160,145,179,0.11); --s-note-line:rgba(160,145,179,0.26);- --shadow:0 8px 28px rgba(0,0,0,0.55);+ --bg:#0E0E10; --surface:#161618; --surface-2:#1D1D20; --surface-3:#26262A;+ --line:#26262A; --line-strong:#34343A;+ --text:#F3F3F5; --text-2:#A3A3AC; --text-3:#6E6E77;+ --accent:#7B74FF; --accent-hover:#8D87FF; --accent-text:#FFFFFF;+ --accent-soft:#1E1C3A; --accent-line:#2E2B5C; --chart-muted:#34315F;+ --good:#5CCB8F; --good-bg:#10261B; --good-line:#1C4130;+ --wait:#F0B84F; --wait-bg:#2A2010; --wait-line:#4A3817;+ --bad:#FF7A85; --bad-bg:#2C1316; --bad-line:#4C1F25;+ --active:#6AA8F2; --active-bg:#11202F; --active-line:#1D3650;+ --note:#B79BF5; --note-bg:#1E1730; --note-line:#352857;+ --shadow-border: 0 0 0 1px rgb(255 255 255 / 0.07);+ --shadow-border-hover: 0 0 0 1px rgb(255 255 255 / 0.12);+ --shadow-pop: 0 0 0 1px rgb(255 255 255 / 0.09), 0 16px 40px -8px rgb(0 0 0 / 0.6);+ --btn-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06), 0 0 0 1px rgb(255 255 255 / 0.10);+ --btn-primary-shadow: inset 0 1px 0 rgb(255 255 255 / 0.20), 0 0 0 1px rgb(0 0 0 / 0.4);color-scheme: dark;}}+/* ── Base ────────────────────────────────────────────────────── */+* { margin: 0; padding: 0; box-sizing: border-box; }-::selection { background: var(--ink-soft); color: var(--text); }+::selection { background: var(--accent-soft); color: var(--text); }-html { scroll-behavior: smooth; }+html { -webkit-text-size-adjust: 100%; }body {font-family: var(--sans);+ font-size: var(--fs-body);+ line-height: 1.5;background: var(--bg);color: var(--text);- font-size: 14px;- line-height: 1.55;min-height: 100dvh;-webkit-font-smoothing: antialiased;- font-feature-settings: 'cv11', 'ss01';+ -moz-osx-font-smoothing: grayscale;+ font-variant-numeric: tabular-nums;+}+a {+ color: inherit; text-decoration: underline;+ text-underline-offset: 2px; text-decoration-thickness: from-font;+ text-decoration-color: var(--line-strong);}-a { color: inherit; text-decoration: underline; text-underline-offset: 2px;- text-decoration-color: var(--border-strong); text-decoration-thickness: 1px; }-a:hover { text-decoration-color: var(--text); }-:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }+@media (hover: hover) { a:hover { text-decoration-color: currentColor; } }+:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }+code, kbd, .mono { font-family: var(--mono); }+code {+ font-size: 0.85em; padding: 1px 5px; border-radius: var(--r-xs);+ background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);+}+kbd {+ font-family: var(--mono); font-size: 10.5px; line-height: 1;+ display: inline-flex; align-items: center; justify-content: center;+ min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--r-xs);+ color: inherit; opacity: 0.75;+ box-shadow: inset 0 0 0 1px currentColor;+}+.muted { color: var(--text-3); }+.num { text-align: right; }+svg.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none;+ stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }++/* ── App shell: sidebar + content ────────────────────────────── */-/* ── Masthead ────────────────────────────────────────────────── */+.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }-header {- display: flex; align-items: center; justify-content: space-between;- gap: 20px; padding: 14px var(--gut) 12px;- border-bottom: 1px solid var(--border);+.sidebar {+ position: sticky; top: 0; height: 100dvh;+ display: flex; flex-direction: column; gap: var(--sp-5);+ padding: var(--sp-4) var(--sp-3);+ border-right: 1px solid var(--line);+ background: var(--bg);+ overflow-y: auto; overscroll-behavior: contain;}-.brand { display: flex; align-items: center; gap: 10px; }+.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }.brand .mark {- width: 24px; height: 24px; flex: none;+ width: 28px; height: 28px; flex: none; border-radius: 8px;display: flex; align-items: center; justify-content: center;- background: var(--ink); color: var(--ink-contrast);- border-radius: var(--r-sm);- font-family: var(--serif); font-size: 15px; font-weight: 500; line-height: 1;+ background: var(--accent); color: var(--accent-text);+ font-size: 15px; font-weight: 600; letter-spacing: -0.02em;+ box-shadow: var(--btn-primary-shadow);}-.brand h1 {- font-family: var(--serif); font-size: 19px; font-weight: 500;- letter-spacing: -0.012em; line-height: 1.1;-}-.brand .tagline {- font-family: var(--serif); font-style: italic; font-size: 11.5px;- color: var(--text-3); line-height: 1.2; margin-top: 1px;-}-.header-controls { display: flex; align-items: center; gap: 8px; }-.harvey-status {- display: flex; align-items: center; gap: 7px;- font-family: var(--mono); font-size: 11.5px; color: var(--text-2);- padding-right: 4px;-}-.status-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--text-3); }-.status-dot.running { background: var(--s-good); }-.status-dot.stopped { background: var(--text-3); }-.status-dot.offline { background: var(--s-bad); }+.brand h1 { font-size: var(--fs-body); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }+.brand .tagline { font-size: var(--fs-caption); color: var(--text-3); line-height: 1.2; }-.icon-btn, .refresh-btn {- background: none; border: 1px solid var(--border-strong); border-radius: var(--r-sm);- color: var(--text-2); font-family: var(--sans); font-size: 12px; font-weight: 450;- padding: 5px 11px; cursor: pointer; transition: color .15s, border-color .15s;+nav { display: flex; flex-direction: column; gap: var(--sp-4); }+.nav-group { display: flex; flex-direction: column; gap: 1px; }+.nav-label {+ font-size: 11px; font-weight: 500; color: var(--text-3);+ text-transform: uppercase; letter-spacing: 0.06em;+ padding: 0 10px 6px;}-.icon-btn:hover, .refresh-btn:hover { color: var(--text); border-color: var(--text-3); }-.icon-btn { font-family: var(--mono); font-size: 11px; padding: 5px 9px; }--/* ── Nav ─────────────────────────────────────────────────────── */--nav {- display: flex; gap: 0; padding: 0 var(--gut);- border-bottom: 1px solid var(--border);- overflow-x: auto; scrollbar-width: none;-}-nav::-webkit-scrollbar { display: none; }nav button {- background: none; border: none; border-bottom: 1.5px solid transparent;- color: var(--text-3); font-family: var(--sans); font-size: 13px; font-weight: 450;- padding: 10px 0 9px; margin-right: 24px; cursor: pointer; white-space: nowrap;- transition: color .15s;-}-nav button:hover { color: var(--text-2); }-nav button.active { color: var(--text); border-bottom-color: var(--ink); font-weight: 500; }-nav button:last-child { margin-right: 0; }+ display: flex; align-items: center; gap: 10px; width: 100%;+ height: 32px; padding: 0 10px; border: none; border-radius: var(--r-sm);+ background: none; color: var(--text-2);+ font: 500 var(--fs-ui)/1 var(--sans); text-align: left; cursor: pointer;+ transition-property: background-color, color; transition-duration: 120ms; transition-timing-function: ease;+}+nav button .icon { color: var(--text-3); transition: color 120ms ease; }+nav button .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+@media (hover: hover) {+ nav button:hover { background: var(--surface-2); color: var(--text); }+ nav button:hover .icon { color: var(--text-2); }+}+nav button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-border); }+nav button.active .icon { color: var(--accent); }.nav-count {- display: none; margin-left: 6px; padding: 0 5px; border-radius: 2px;- font-family: var(--mono); font-size: 10px; font-weight: 500;- background: var(--s-wait-bg); color: var(--s-wait);+ display: none; min-width: 20px; height: 18px; padding: 0 6px;+ align-items: center; justify-content: center;+ font-size: 11px; font-weight: 600; border-radius: 99px;+ background: var(--accent-soft); color: var(--accent);}-.nav-count.on { display: inline-block; }--main { padding: 30px var(--gut) 88px; max-width: 1400px; margin: 0 auto; }--.section { display: none; }-.section.active { display: block; animation: rise .22s cubic-bezier(.16,1,.3,1); }-@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }--/* ── Headings ────────────────────────────────────────────────── */+.nav-count.on { display: inline-flex; }-.section-head { margin-bottom: 24px; }-.section-head h2 {- font-family: var(--serif); font-size: 31px; font-weight: 400;- letter-spacing: -0.018em; line-height: 1.12;-}-.section-head p {- font-size: 13.5px; color: var(--text-2); margin-top: 6px;- max-width: 66ch; text-wrap: pretty;-}-.subhead {- font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-3);- border-bottom: 1px solid var(--border); padding-bottom: 6px; margin: 34px 0 14px;+.sidebar-foot {+ margin-top: auto; display: flex; flex-direction: column; gap: var(--sp-2);+ padding: var(--sp-3) 6px 0; border-top: 1px solid var(--line);}+.harvey-status { display: flex; align-items: center; gap: 8px; font-size: var(--fs-ui); color: var(--text-2); }+.status-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-3); }+.status-dot.running { background: var(--good); box-shadow: 0 0 0 3px var(--good-bg); }+.status-dot.offline { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }+.foot-actions { display: flex; gap: 6px; }-/* ── Today: an asymmetric two-column screen ──────────────────── */+main.content { min-width: 0; padding: var(--sp-6) var(--sp-6) 96px; }+.content-inner { max-width: var(--content-w); margin: 0 auto; }-.today-grid { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 34px; align-items: start; }-.today-rail { display: flex; flex-direction: column; gap: 26px; position: sticky; top: 22px; }-.rail-block > .subhead { margin-top: 0; }+.section { display: none; }+.section.active { display: block; }-@media (max-width: 1080px) {- .today-grid { grid-template-columns: 1fr; gap: 26px; }- .today-rail { position: static; }-}+/* ── Page heads, section heads ───────────────────────────────── */-/* The action queue — the only thing on the page with real weight */-.queue { border-top: 1px solid var(--rule); }-.queue-item {- display: flex; align-items: flex-start; gap: 18px;- padding: 17px 2px 17px 0; border-bottom: 1px solid var(--border);+.section-head {+ display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4);+ flex-wrap: wrap; margin-bottom: var(--sp-5);}-.queue-item::before {- content: ''; width: 2px; align-self: stretch; flex: none; margin-right: 2px;- background: var(--text-3);+.section-head h2 {+ font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2;}-.queue-item.warn::before { background: var(--s-wait); }-.queue-item.bad::before { background: var(--s-bad); }-.queue-item.good::before { background: var(--s-good); }-.queue-item .qtext { flex: 1; min-width: 0; }-.queue-item .qtitle { font-size: 15px; font-weight: 500; letter-spacing: -0.006em; }-.queue-item .qdetail {- font-size: 13px; color: var(--text-2); margin-top: 4px;+.section-head p {+ font-size: var(--fs-body); color: var(--text-2); margin-top: 4px;max-width: 68ch; text-wrap: pretty;}-.queue-item .btn { flex: none; margin-top: 1px; }+.page-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; flex-shrink: 0; }-.queue-clear {- display: flex; align-items: center; gap: 13px;- border-top: 1px solid var(--rule); border-bottom: 1px solid var(--border);- padding: 22px 2px;-}-.queue-clear .glyph { color: var(--s-good); font-size: 17px; line-height: 1; }-.queue-clear .qtitle { font-size: 15px; font-weight: 500; }-.queue-clear .qdetail { font-size: 13px; color: var(--text-2); margin-top: 3px; max-width: 60ch; }--/* Rail figures — a stacked ledger, not glowing tiles */-.figures { border-top: 1px solid var(--rule); }-/* A subhead already draws a rule; a second one right under it reads as a- mistake. Anything that follows a subhead drops its own top border. */-.subhead + * > .figures,-.subhead + .figures,-.subhead + * > .activity-feed,-.subhead + .activity-feed { border-top: none; }-.figure {- display: flex; align-items: baseline; justify-content: space-between; gap: 12px;- padding: 9px 0; border-bottom: 1px solid var(--border);-}-.figure .k { font-size: 12.5px; color: var(--text-2); }-.figure .v {- font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums;- color: var(--text); letter-spacing: -0.01em;-}-.figure .v.zero { color: var(--text-3); }-.figure-note { font-size: 11.5px; color: var(--text-3); margin-top: 8px; }--/* Legacy stat grid (usage tab) */-.stats-grid {- display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0;- border-top: 1px solid var(--rule); border-bottom: 1px solid var(--border);-}-.stat-card { padding: 15px 20px 17px; border-right: 1px solid var(--border); }-.stat-card:last-child { border-right: none; }-.stat-card .label { font-size: 12px; color: var(--text-3); margin-bottom: 7px; }-.stat-card .value {- font-family: var(--mono); font-size: 26px; font-weight: 400;- letter-spacing: -0.025em; line-height: 1; font-variant-numeric: tabular-nums;-}-.stat-card .breakdown { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 4px 12px; }-.chip { font-family: var(--mono); font-size: 11px; color: var(--text-3); }-.chip b { color: var(--text-2); font-weight: 500; }+.subhead {+ display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3);+ font-size: var(--fs-ui); font-weight: 600; color: var(--text);+ margin: var(--sp-6) 0 var(--sp-3);+}+.subhead .hint { font-weight: 400; color: var(--text-3); }+.subhead:first-child { margin-top: 0; }-/* ── Panels ──────────────────────────────────────────────────── */+/* ── Cards ───────────────────────────────────────────────────── */.card {- background: var(--panel); border: 1px solid var(--border);- border-radius: var(--r-md); padding: 22px 24px; margin-bottom: 16px;-}-.card h2 { font-size: 13px; font-weight: 600; margin-bottom: 14px; letter-spacing: -0.004em; }-.card .lede { font-size: 13px; color: var(--text-2); margin: -4px 0 16px; max-width: 66ch; }+ background: var(--surface); border: 1px solid transparent; border-radius: var(--r-lg);+ box-shadow: var(--shadow-border); padding: var(--sp-5); margin-bottom: var(--sp-4);+}+.card > h2, .card-title {+ font-size: var(--fs-body); font-weight: 600; letter-spacing: -0.01em; margin-bottom: var(--sp-3);+ display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;+}+.card .lede { font-size: var(--fs-ui); color: var(--text-2); margin: -4px 0 var(--sp-4); max-width: 68ch; text-wrap: pretty; }+.card.flush { padding: 0; overflow: auto hidden; overscroll-behavior-x: contain; }+.card-head {+ display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);+ padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line);+}+.card-head h3 { font-size: var(--fs-body); font-weight: 600; letter-spacing: -0.01em; }+.card-head .meta { font-size: var(--fs-caption); color: var(--text-3); }+.inset {+ background: var(--surface-2); border-radius: var(--r-md); padding: var(--sp-4);+}++.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }+.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-5); align-items: start; }+@media (max-width: 1180px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }+@media (max-width: 760px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }++/* ── KPI cards with sparklines ───────────────────────────────── */++.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }+@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }+.kpi {+ background: var(--surface); border: 1px solid transparent; border-radius: var(--r-lg);+ box-shadow: var(--shadow-border); padding: var(--sp-4) var(--sp-4) var(--sp-3);+ display: flex; flex-direction: column; gap: 6px; min-width: 0;+}+.kpi-label { font-size: var(--fs-ui); color: var(--text-2); display: flex; align-items: center; gap: 6px; }+.kpi-value { font-size: var(--fs-kpi); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }+.kpi-value.zero { color: var(--text-3); }+.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-2); min-height: 28px; flex-wrap: wrap; }+.kpi-note { font-size: var(--fs-caption); color: var(--text-3); }+.kpi-note b { color: var(--text-2); font-weight: 500; }+.spark { display: flex; align-items: flex-end; gap: 2px; height: 28px; flex: 1; max-width: 140px; justify-content: flex-end; }+.spark i { display: block; width: 5px; min-height: 2px; border-radius: 1.5px; background: var(--chart-muted); }+.spark i.on { background: var(--accent); }+.spark i.today { background: var(--accent); }++/* ── Funnel: one segmented bar, one legend ───────────────────── */++.funnel-bar {+ display: flex; height: 10px; gap: 2px; border-radius: 99px; overflow: hidden;+ background: var(--surface-3);+}+.funnel-bar .seg { min-width: 3px; }+.funnel-legend {+ display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--sp-3) var(--sp-4);+ margin-top: var(--sp-4);+}+.legend-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }+.legend-key { display: flex; align-items: center; gap: 6px; font-size: var(--fs-caption); color: var(--text-2); }+.legend-key i { width: 8px; height: 8px; border-radius: 2px; flex: none; }+.legend-val { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -0.01em; }+.legend-val small { font-size: var(--fs-caption); font-weight: 400; color: var(--text-3); margin-left: 4px; }++.c-accent { background: var(--accent); } .c-accent-soft { background: var(--chart-muted); }+.c-good { background: var(--good); } .c-wait { background: var(--wait); }+.c-bad { background: var(--bad); } .c-active { background: var(--active); }+.c-note { background: var(--note); } .c-idle { background: var(--line-strong); }++.legend-rows { display: flex; flex-direction: column; margin-top: var(--sp-3); }+.legend-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 3.5ch; gap: var(--sp-3); align-items: center; padding: 7px 0; }+.legend-row + .legend-row { border-top: 1px solid var(--line); }+.legend-row .legend-key { font-size: var(--fs-ui); color: var(--text); gap: 8px; }+.legend-row .legend-val { font-size: var(--fs-ui); font-weight: 600; }+.legend-pct { font-size: var(--fs-caption); color: var(--text-3); text-align: right; }++/* Quiet status: a dot and a word, for secondary state inside a cell */+.mini { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-caption); white-space: nowrap; }+.mini::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }+.mini.t-good { color: var(--good); } .mini.t-waiting { color: var(--wait); } .mini.t-bad { color: var(--bad); }+.mini.t-active { color: var(--active); } .mini.t-note { color: var(--note); } .mini.t-idle { color: var(--text-3); }++/* ── Meters (score, quota, progress) ─────────────────────────── */++.meter { display: inline-flex; align-items: center; gap: 2px; height: 12px; }+.meter i { width: 4px; height: 10px; border-radius: 1px; background: var(--surface-3); }+.meter i.on { background: var(--accent); }+.meter.good i.on { background: var(--good); }+.meter.wait i.on { background: var(--wait); }+.meter.bad i.on { background: var(--bad); }+.meter-row { display: inline-flex; align-items: center; gap: 8px; }+.meter-row .v { font-size: var(--fs-ui); color: var(--text-2); min-width: 2.5ch; text-align: right; }++.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; display: flex; }+.bar > span { display: block; height: 100%; transition: width 400ms var(--ease-out); }+.bar.thick { height: 8px; }++/* Kept for quota gauges (quotaCardHtml) */+.progress-wrap { margin-bottom: var(--sp-4); }+.progress-wrap:last-child { margin-bottom: 0; }+.progress-label { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-ui); margin-bottom: 6px; }+.progress-label .pct { font-weight: 600; }+.progress-label .text { color: var(--text-2); }+.progress-bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }+.progress-fill { height: 100%; border-radius: 99px; transition: width 400ms var(--ease-out); }+.progress-fill.green { background: var(--accent); }+.progress-fill.yellow { background: var(--wait); }/* ── Buttons ─────────────────────────────────────────────────── */.btn {- display: inline-flex; align-items: center; gap: 7px;- font-family: var(--sans); font-size: 13px; font-weight: 500;- padding: 7px 14px; border-radius: var(--r-sm); border: 1px solid transparent;- cursor: pointer; white-space: nowrap;- transition: background .15s, border-color .15s, color .15s;-}-.btn:active { transform: translateY(0.5px); }-.btn:disabled { opacity: .45; cursor: not-allowed; }-.btn-primary { background: var(--ink); color: var(--ink-contrast); }-.btn-primary:hover:not(:disabled) { opacity: .86; }-.btn-secondary { background: none; border-color: var(--border-strong); color: var(--text-2); }-.btn-secondary:hover:not(:disabled) { border-color: var(--text-3); color: var(--text); }-.btn-danger { background: none; border-color: var(--s-bad); color: var(--s-bad); }-.btn-danger:hover:not(:disabled) { background: var(--s-bad-bg); }-.btn-sm { padding: 5px 11px; font-size: 12px; }-.btn-group { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; }--kbd {- font-family: var(--mono); font-size: 10px; padding: 1px 4px;- border: 1px solid var(--border-strong); border-radius: 2px;- background: var(--panel-raised); color: var(--text-3);+ display: inline-flex; align-items: center; justify-content: center; gap: 6px;+ height: 32px; padding: 0 12px; border: none; border-radius: var(--r-sm);+ font: 500 var(--fs-ui)/1 var(--sans); white-space: nowrap; cursor: pointer;+ background: var(--surface); color: var(--text); box-shadow: var(--btn-shadow);+ -webkit-tap-highlight-color: transparent;+ transition-property: background-color, color, box-shadow, scale;+ transition-duration: 150ms; transition-timing-function: ease-out;+}+.btn:not(:disabled):active { scale: 0.96; }+.btn:disabled { opacity: 0.5; cursor: not-allowed; }+.btn .icon { width: 15px; height: 15px; }+.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: var(--btn-primary-shadow); }+.btn-secondary { background: var(--surface); color: var(--text); }+.btn-ghost { background: none; box-shadow: none; color: var(--text-2); }+.btn-danger { background: var(--surface); color: var(--bad); }+@media (hover: hover) {+ .btn-primary:hover:not(:disabled) { background: var(--accent-hover); }+ .btn-secondary:hover:not(:disabled), .btn-danger:hover:not(:disabled) { background: var(--surface-2); }+ .btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }+}+.btn-sm { height: 28px; padding: 0 10px; font-size: var(--fs-caption); }+.btn-icon { width: 32px; padding: 0; }+.btn-sm.btn-icon { width: 28px; }+.btn-group { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); flex-wrap: wrap; }+.icon-btn, .refresh-btn {+ height: 28px; padding: 0 10px; border: none; border-radius: var(--r-sm); cursor: pointer;+ font: 500 var(--fs-caption)/1 var(--sans); color: var(--text-2);+ background: var(--surface); box-shadow: var(--btn-shadow);+ transition-property: background-color, color, scale; transition-duration: 150ms; transition-timing-function: ease-out;+ display: inline-flex; align-items: center; gap: 6px; text-transform: capitalize;+}+.icon-btn:active, .refresh-btn:active { scale: 0.96; }+@media (hover: hover) { .icon-btn:hover, .refresh-btn:hover { color: var(--text); background: var(--surface-2); } }++/* ── Tags & badges: the only coloured text ───────────────────── */++.badge, .tag {+ display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;+ font-size: var(--fs-caption); font-weight: 500; line-height: 1; white-space: nowrap;+ border-radius: 99px; border: 1px solid transparent;+}+.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }+.badge.t-waiting { background: var(--wait-bg); color: var(--wait); border-color: var(--wait-line); }+.badge.t-active { background: var(--active-bg); color: var(--active); border-color: var(--active-line); }+.badge.t-good { background: var(--good-bg); color: var(--good); border-color: var(--good-line); }+.badge.t-bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }+.badge.t-note { background: var(--note-bg); color: var(--note); border-color: var(--note-line); }+.badge.t-idle { background: var(--surface-2); color: var(--text-2); border-color: var(--line); }+.badge.t-idle::before { background: var(--text-3); }+.tag { background: var(--surface-2); color: var(--text-2); border-color: var(--line); }+.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }+.cost-chip {+ display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border-radius: 11px;+ font-size: var(--fs-caption); font-weight: 500; line-height: 1.35;+ background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);}+.cost-chip.free { background: var(--good-bg); color: var(--good); border-color: var(--good-line); }+.cost-chip.paid { background: var(--wait-bg); color: var(--wait); border-color: var(--wait-line); }+.optional-tag { font-size: var(--fs-caption); font-weight: 400; color: var(--text-3); margin-left: 6px; }-/* ── Status: the only coloured thing on screen ───────────────── */--.badge {- display: inline-flex; align-items: center;- font-family: var(--mono); font-size: 10.5px; font-weight: 500;- padding: 2px 6px; border-radius: 2px; border: 1px solid transparent;- white-space: nowrap;-}-.badge.t-waiting { background: var(--s-wait-bg); color: var(--s-wait); border-color: var(--s-wait-line); }-.badge.t-active { background: var(--s-active-bg); color: var(--s-active); border-color: var(--s-active-line); }-.badge.t-good { background: var(--s-good-bg); color: var(--s-good); border-color: var(--s-good-line); }-.badge.t-bad { background: var(--s-bad-bg); color: var(--s-bad); border-color: var(--s-bad-line); }-.badge.t-idle { background: var(--panel-raised);color: var(--text-3); border-color: var(--border); }-.badge.t-note { background: var(--s-note-bg); color: var(--s-note); border-color: var(--s-note-line); }+/* Settings key status chips */+.email-tag { font-size: var(--fs-caption); font-weight: 500; padding: 2px 8px; border-radius: 99px; margin-left: 6px; }+.email-tag:empty { display: none; }+.email-tag.verified { background: var(--good-bg); color: var(--good); }+.email-tag.risky { background: var(--wait-bg); color: var(--wait); }+.email-tag.guess { background: var(--surface-2); color: var(--text-3); }/* ── Tables ──────────────────────────────────────────────────── */.table-card {- background: var(--panel); border: 1px solid var(--border);- border-radius: var(--r-md); overflow: auto;+ background: var(--surface); border: 1px solid transparent; border-radius: var(--r-lg);+ box-shadow: var(--shadow-border); overflow: auto; overscroll-behavior-x: contain;}-table { width: 100%; border-collapse: collapse; font-size: 13px; }+.card .table-card { box-shadow: none; border-radius: var(--r-md); }+table { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); }th {- text-align: left; font-size: 11px; font-weight: 600; color: var(--text-3);- padding: 9px 15px; border-bottom: 1px solid var(--border-strong);- white-space: nowrap; position: sticky; top: 0; background: var(--panel);-}-td {- padding: 10px 15px; border-bottom: 1px solid var(--border);- font-variant-numeric: tabular-nums; vertical-align: top;+ text-align: left; font-size: var(--fs-caption); font-weight: 500; color: var(--text-3);+ padding: 10px 14px; border-bottom: 1px solid var(--line);+ white-space: nowrap; position: sticky; top: 0; background: var(--surface); z-index: 1;}+th.num { text-align: right; }+td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }tbody tr:last-child td { border-bottom: none; }-tbody tr:hover td { background: var(--panel-raised); }+tbody tr { transition: background-color 100ms ease; }+@media (hover: hover) { tbody tr:hover td { background: var(--surface-2); } }+tr.clickable { cursor: pointer; }+table.nowrap td { white-space: nowrap; }td a { text-decoration: none; }-td a:hover { text-decoration: underline; }-.muted { color: var(--text-3); }-.num { font-family: var(--mono); text-align: right; }+@media (hover: hover) { td a:hover { text-decoration: underline; } }+.cell-main { font-weight: 500; color: var(--text); }+.cell-sub { font-size: var(--fs-caption); color: var(--text-3); margin-top: 1px; }+.cell-stack { display: flex; flex-direction: column; min-width: 0; }+.cell-row { display: flex; align-items: center; gap: 8px; }+.avatar {+ width: 28px; height: 28px; flex: none; border-radius: 50%;+ display: inline-flex; align-items: center; justify-content: center;+ font-size: 11px; font-weight: 600; letter-spacing: 0.02em;+ background: var(--surface-3); color: var(--text-2);+}+.row-action { opacity: 0; transition: opacity 120ms ease; }+tr:focus-within .row-action { opacity: 1; }+@media (hover: hover) { tr:hover .row-action { opacity: 1; } }+@media (hover: none) { .row-action { opacity: 1; } }++/* Table toolbar: search + filters */+.toolbar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-3); }+.search {+ position: relative; flex: 1; min-width: 200px; max-width: 320px;+}+.search .icon { position: absolute; left: 10px; top: 50%; translate: 0 -50%; color: var(--text-3); width: 15px; height: 15px; }+.search input { padding-left: 32px; }+.segmented {+ display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--surface-3);+ max-width: 100%; overflow-x: auto; scrollbar-width: none;+}+.segmented button { flex: none; }+.segmented button {+ height: 28px; padding: 0 10px; border: none; border-radius: var(--r-sm); background: none; cursor: pointer;+ font: 500 var(--fs-caption)/1 var(--sans); color: var(--text-2); display: inline-flex; align-items: center; gap: 6px;+}+.segmented button .n { color: var(--text-3); font-weight: 500; }+.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-border); }+@media (hover: hover) { .segmented button:not(.on):hover { color: var(--text); } }+.table-foot { font-size: var(--fs-caption); color: var(--text-3); padding: var(--sp-3) 2px 0; }++/* ── Today: the queue, the steps, the timeline ───────────────── */++.queue { display: flex; flex-direction: column; gap: var(--sp-2); }+.queue-item {+ display: flex; align-items: center; gap: var(--sp-4);+ background: var(--surface); border: 1px solid transparent; border-radius: var(--r-lg);+ box-shadow: var(--shadow-border); padding: var(--sp-4);+}+.queue-icon {+ width: 32px; height: 32px; flex: none; border-radius: 9px;+ display: flex; align-items: center; justify-content: center;+ background: var(--surface-2); color: var(--text-2);+}+.queue-item.warn .queue-icon { background: var(--wait-bg); color: var(--wait); }+.queue-item.bad .queue-icon { background: var(--bad-bg); color: var(--bad); }+.queue-item.good .queue-icon { background: var(--good-bg); color: var(--good); }+.queue-item .qtext { flex: 1; min-width: 0; }+.queue-item .qtitle { font-size: var(--fs-body); font-weight: 600; letter-spacing: -0.005em; }+.queue-item .qdetail { font-size: var(--fs-ui); color: var(--text-2); margin-top: 2px; max-width: 72ch; text-wrap: pretty; }+.queue-item .btn { flex: none; }+.queue-clear {+ display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-5);+ background: var(--surface); border: 1px solid transparent; border-radius: var(--r-lg); box-shadow: var(--shadow-border);+}+.queue-clear .queue-icon { background: var(--good-bg); color: var(--good); }+.queue-clear .qtitle { font-weight: 600; }+.queue-clear .qdetail { font-size: var(--fs-ui); color: var(--text-2); margin-top: 2px; max-width: 64ch; }++.steps { display: flex; flex-direction: column; }+.step { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; }+.step + .step { border-top: 1px solid var(--line); }+.step-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }+.step-icon .icon { width: 12px; height: 12px; stroke-width: 2.5; }+.step-icon.done { background: var(--good-bg); color: var(--good); }+.step-icon.running { background: var(--accent-soft); color: var(--accent); }+.step-icon.partial { background: var(--surface-3); color: var(--text-2); }+.step-icon.waiting { box-shadow: inset 0 0 0 1.5px var(--line-strong); }+.step-label { font-size: var(--fs-ui); font-weight: 500; }+.step-detail { font-size: var(--fs-caption); color: var(--text-3); text-align: right; }+.step .bar { grid-column: 2 / 4; }+.live-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-2); }+.live-now { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-ui); color: var(--text-2); }+.live-next {+ display: flex; gap: 10px; align-items: flex-start; margin-top: var(--sp-3);+ padding: 10px 12px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--text);+ font-size: var(--fs-ui);+}+.live-next .icon { color: var(--accent); margin-top: 1px; }+.live-flag { font-size: var(--fs-caption); color: var(--text-3); margin-top: var(--sp-2); }+.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }+@media (prefers-reduced-motion: no-preference) {+ .pulse { animation: pulse 1.6s ease-in-out infinite; }+ @keyframes pulse { 50% { opacity: 0.35; } }+}++.figures { display: flex; flex-direction: column; }+.figure { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); padding: 8px 0; }+.figure + .figure { border-top: 1px solid var(--line); }+.figure .k { font-size: var(--fs-ui); color: var(--text-2); }+.figure .v { font-size: var(--fs-body); font-weight: 600; }+.figure .v.zero { color: var(--text-3); font-weight: 400; }+.figure-note { font-size: var(--fs-caption); color: var(--text-3); margin-top: 8px; }++.runs { display: flex; flex-direction: column; }+.run { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; align-items: center; }+.run + .run { border-top: 1px solid var(--line); }+.run .name { font-size: var(--fs-ui); font-weight: 500; text-transform: capitalize; }+.run .when, .run .stats { font-size: var(--fs-caption); color: var(--text-3); }+.run .stats { text-align: right; }++/* Activity timeline, grouped by day */+.timeline { display: flex; flex-direction: column; }+.tl-day {+ font-size: var(--fs-caption); font-weight: 600; color: var(--text-3);+ padding: var(--sp-4) 0 var(--sp-2);+}+.tl-day:first-child { padding-top: 0; }+.tl-item { display: grid; grid-template-columns: 64px 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; }+.tl-time { font-size: var(--fs-caption); color: var(--text-3); }+.tl-icon {+ width: 24px; height: 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center;+ background: var(--surface-2); color: var(--text-2);+}+.tl-icon .icon { width: 13px; height: 13px; }+.tl-text { font-size: var(--fs-ui); color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.tl-text::first-letter { text-transform: uppercase; }+.tl-agent { font-size: var(--fs-caption); color: var(--text-3); }++/* Setup progress, check list */+.check-item { display: flex; gap: 10px; padding: 10px 0; }+.check-item + .check-item { border-top: 1px solid var(--line); }+.check-icon {+ width: 18px; height: 18px; flex: none; margin-top: 1px; border-radius: 50%;+ display: flex; align-items: center; justify-content: center; font-size: 10px;+}+.check-icon.done { background: var(--good-bg); color: var(--good); }+.check-icon.pending { box-shadow: inset 0 0 0 1.5px var(--line-strong); }+.check-info { flex: 1; min-width: 0; }+.check-label { font-size: var(--fs-ui); font-weight: 500; }+.check-label.done { color: var(--text-3); font-weight: 400; }+.check-help { font-size: var(--fs-caption); color: var(--text-3); margin-top: 2px; text-wrap: pretty; overflow-wrap: anywhere; }+.setup-pct { font-size: var(--fs-caption); color: var(--text-3); font-weight: 500; }++details summary { cursor: pointer; list-style: none; }+details summary::-webkit-details-marker { display: none; }+details summary::before {+ content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 8px; translate: 0 -2px;+ border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; rotate: -45deg;+ transition: rotate 150ms ease-out;+}+details[open] > summary::before { rotate: 45deg; }/* ── Signals ─────────────────────────────────────────────────── */-.sig-summary { display: flex; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--border); margin-bottom: 26px; }-.sig-stat { padding: 14px 24px 16px; border-right: 1px solid var(--border); min-width: 118px; }-.sig-stat:last-child { border-right: none; }-.sig-stat .n { font-family: var(--mono); font-size: 25px; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }-.sig-stat .k { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }-.sig-stat.confirmed .n { color: var(--s-good); }-.sig-stat.proposed .n { color: var(--s-wait); }-.sig-stat.rejected .n { color: var(--text-3); }--.sig-group { margin-bottom: 26px; }-.sig-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 12px; }-.sig-group-head h3 { font-family: var(--serif); font-size: 20px; font-weight: 400; letter-spacing: -0.014em; }-.sig-group-head p { font-size: 13px; color: var(--text-2); margin-top: 4px; max-width: 62ch; text-wrap: pretty; }--.sig-row { display: flex; gap: 20px; align-items: flex-start; padding: 15px 20px; border-bottom: 1px solid var(--border); }-.sig-row:last-child { border-bottom: none; }-.sig-row.rejected { opacity: .5; }+.sig-summary .funnel-bar { margin-bottom: 0; }+.sig-group { margin-bottom: var(--sp-6); }+.sig-group-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-3); flex-wrap: wrap; }+.sig-group-head h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -0.01em; }+.sig-group-head p { font-size: var(--fs-ui); color: var(--text-2); margin-top: 2px; max-width: 68ch; text-wrap: pretty; }+.sig-row { display: flex; gap: var(--sp-4); align-items: flex-start; padding: var(--sp-4) var(--sp-5); }+.sig-row + .sig-row { border-top: 1px solid var(--line); }+.sig-row.rejected .sig-main { opacity: 0.55; }.sig-row .sig-main { flex: 1; min-width: 0; }-.sig-row .sig-label { font-size: 14px; font-weight: 500; }-.sig-row .sig-code { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); margin-left: 8px; }-.sig-row .sig-desc { font-size: 13px; color: var(--text-2); margin-top: 5px; max-width: 68ch; text-wrap: pretty; }-.sig-row .sig-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; align-items: center; }+.sig-row .sig-label { font-size: var(--fs-body); font-weight: 500; }+.sig-row .sig-code { font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-left: 8px; }+.sig-row .sig-desc { font-size: var(--fs-ui); color: var(--text-2); margin-top: 2px; max-width: 72ch; text-wrap: pretty; }+.sig-row .sig-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--sp-2); align-items: center; }.sig-row .sig-decide { display: flex; gap: 6px; flex: none; }-.cost-chip {- font-family: var(--mono); font-size: 10.5px; padding: 2px 6px; border-radius: 2px;- border: 1px solid var(--border); color: var(--text-3); background: var(--panel-raised);-}-.cost-chip.free { color: var(--s-good); background: var(--s-good-bg); border-color: var(--s-good-line); }-.cost-chip.paid { color: var(--s-wait); background: var(--s-wait-bg); border-color: var(--s-wait-line); }--/* ── Cohort builder ──────────────────────────────────────────── */--.cohort-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 7px; }+.cohort-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }.cohort-pick {- display: flex; align-items: center; gap: 9px; padding: 8px 11px;- border: 1px solid var(--border); border-radius: var(--r-sm);- font-size: 12.5px; cursor: pointer; user-select: none;-}-.cohort-pick:hover { border-color: var(--border-strong); }-.cohort-pick:has(input:checked) { border-color: var(--text-3); background: var(--panel-raised); }-.cohort-pick input { accent-color: var(--ink); }-.cohort-pick .n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-3); }-.cohort-size { font-family: var(--mono); font-size: 33px; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }--/* ── Decisions desk ──────────────────────────────────────────── */--.desk { display: grid; grid-template-columns: 254px minmax(0,1fr); gap: 16px; align-items: start; }-.desk-list { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden auto; max-height: 620px; }-.desk-item { padding: 11px 13px; border-bottom: 1px solid var(--border); border-left: 2px solid transparent; cursor: pointer; }-.desk-item:last-child { border-bottom: none; }-.desk-item:hover { background: var(--panel-raised); }-.desk-item.active { background: var(--panel-raised); border-left-color: var(--ink); }-.desk-item .to { font-family: var(--mono); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }-.desk-item .sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }--.desk-pane { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); padding: 28px 32px; }-.desk-pane .to-line { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }-.desk-pane .subject { font-family: var(--serif); font-size: 25px; font-weight: 400; letter-spacing: -0.018em; margin: 12px 0 16px; line-height: 1.2; }-.desk-pane .body {- font-size: 14.5px; line-height: 1.75; white-space: pre-wrap; max-width: 64ch;- padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);-}+ display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px;+ border-radius: var(--r-sm); background: var(--surface-2); box-shadow: inset 0 0 0 1px transparent;+ font-size: var(--fs-ui); cursor: pointer; transition: box-shadow 120ms ease, background-color 120ms ease;+}+@media (hover: hover) { .cohort-pick:hover { box-shadow: inset 0 0 0 1px var(--line-strong); } }+.cohort-pick:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }+.cohort-pick input { accent-color: var(--accent); }+.cohort-pick .n { margin-left: auto; font-size: var(--fs-caption); color: var(--text-3); }+.cohort-size { font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }++/* ── Outbox: the decisions desk ──────────────────────────────── */++.desk { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--sp-4); align-items: start; }+.desk-list {+ background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-border);+ border: 1px solid transparent; padding: 6px; overflow: hidden auto; max-height: 680px; overscroll-behavior: contain;+}+.desk-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-md); cursor: pointer; }+.desk-item + .desk-item { margin-top: 2px; }+@media (hover: hover) { .desk-item:hover { background: var(--surface-2); } }+.desk-item.active { background: var(--accent-soft); }+.desk-item .di-text { min-width: 0; flex: 1; }+.desk-item .to { font-size: var(--fs-ui); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.desk-item .sub { font-size: var(--fs-caption); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.desk-item.active .avatar { background: var(--accent); color: var(--accent-text); }++.desk-pane {+ background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-border);+ border: 1px solid transparent; padding: var(--sp-5) var(--sp-6);+}+.desk-pane .to-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-ui); color: var(--text-2); overflow-wrap: anywhere; min-width: 0; }+.desk-pane .to-line b { color: var(--text); font-weight: 500; }+.desk-pane .subject { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; margin: var(--sp-5) 0 var(--sp-3); }+.desk-pane .body { font-size: var(--fs-lead); line-height: 1.65; white-space: pre-wrap; max-width: 66ch; color: var(--text); }.desk-footer {- font-size: 13px; line-height: 1.6; white-space: pre-wrap; max-width: 64ch;- color: var(--text-3); padding: 10px 0; border-bottom: 1px solid var(--border);+ font-size: var(--fs-ui); line-height: 1.6; white-space: pre-wrap; max-width: 66ch;+ color: var(--text-3); margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px dashed var(--line-strong);+}+.desk-actions {+ display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-5); flex-wrap: wrap;+ padding-top: var(--sp-4); border-top: 1px solid var(--line);}-.desk-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }.desk-context {- display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 6px 14px;- margin: 14px 0 4px; padding: 14px 16px; font-size: 12.5px; line-height: 1.5;- background: var(--panel-raised); border: 1px solid var(--border); border-radius: var(--r-md);+ display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 6px 14px;+ margin-top: var(--sp-4); padding: var(--sp-4); font-size: var(--fs-ui); line-height: 1.5;+ background: var(--surface-2); border-radius: var(--r-md);}.desk-context .k { color: var(--text-3); }.desk-context .v { overflow-wrap: anywhere; }-.desk-context a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }.desk-edit-subject, .desk-edit-body {- display: block; width: 100%; box-sizing: border-box; margin: 12px 0 0;- padding: 10px 12px; font: inherit; color: var(--text); background: var(--panel);- border: 1px solid var(--border-strong); border-radius: var(--r-md);+ display: block; width: 100%; margin-top: var(--sp-4);+ padding: 10px 12px; font: inherit; color: var(--text); background: var(--surface);+ border: 1px solid var(--line-strong); border-radius: var(--r-sm);+}+.desk-edit-subject { font-size: var(--fs-h3); font-weight: 500; }+.desk-edit-body { font-size: var(--fs-body); line-height: 1.65; resize: vertical; max-width: 66ch; }+.desk-edit-subject:focus, .desk-edit-body:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }+@media (max-width: 900px) {+ .desk { grid-template-columns: minmax(0, 1fr); }+ .desk-list { max-height: 240px; }+ .desk-context { grid-template-columns: minmax(0, 1fr); }+ .desk-pane { padding: var(--sp-4); }}-.desk-edit-subject { font-size: 16px; }-.desk-edit-body { font-size: 14px; line-height: 1.7; resize: vertical; max-width: 64ch; }-.desk-edit-subject:focus, .desk-edit-body:focus { outline: none; border-color: var(--text-3); }-@media (max-width: 900px) { .desk { grid-template-columns: 1fr; } .desk-list { max-height: 220px; } .desk-context { grid-template-columns: 1fr; } .desk-pane { padding: 20px 16px; } }+.banner {+ display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4); margin-bottom: var(--sp-4);+ border-radius: var(--r-lg); border: 1px solid transparent; font-size: var(--fs-ui);+}+.banner .icon { margin-top: 2px; }+.banner b { display: block; font-size: var(--fs-body); margin-bottom: 2px; }+.banner.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }+.banner.wait { background: var(--wait-bg); color: var(--wait); border-color: var(--wait-line); }+.banner p { color: var(--text-2); }-/* ── Discovery providers ─────────────────────────────────────── */+/* ── Discover ────────────────────────────────────────────────── */-.prov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 26px; }+.prov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }.prov-card {- display: flex; flex-direction: column; gap: 8px; padding: 17px 18px; cursor: pointer;- background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md);- transition: border-color .15s;-}-.prov-card:hover { border-color: var(--border-strong); }-.prov-card.selected { border-color: var(--text-3); background: var(--panel-raised); }-.prov-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }-.prov-card h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.006em; }-.prov-card .blurb { font-size: 12.5px; color: var(--text-2); text-wrap: pretty; }-.prov-card .row { display: flex; gap: 8px; font-size: 11.5px; }-.prov-card .row .k { color: var(--text-3); min-width: 40px; flex: none; }+ display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4); cursor: pointer;+ background: var(--surface); border: 1px solid transparent; border-radius: var(--r-lg);+ box-shadow: var(--shadow-border); transition: box-shadow 150ms ease-out;+}+@media (hover: hover) { .prov-card:hover { box-shadow: var(--shadow-border-hover); } }+.prov-card.selected { box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 5px var(--accent-soft); }+.prov-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }+.prov-card h3 { font-size: var(--fs-body); font-weight: 600; letter-spacing: -0.01em; }+.prov-card .blurb { font-size: var(--fs-ui); color: var(--text-2); text-wrap: pretty; }+.prov-card .row { display: flex; gap: 8px; font-size: var(--fs-caption); }+.prov-card .row .k { color: var(--text-3); min-width: 44px; flex: none; }.prov-card .row .v { color: var(--text-2); }.prov-card .caveat {- font-size: 11.5px; color: var(--s-wait); background: var(--s-wait-bg);- border-left: 2px solid var(--s-wait-line); padding: 7px 10px;- border-radius: 0 var(--r-sm) var(--r-sm) 0; text-wrap: pretty;+ font-size: var(--fs-caption); color: var(--wait); background: var(--wait-bg);+ padding: 8px 10px; border-radius: var(--r-sm); text-wrap: pretty;}+.estimate-box { border-radius: var(--r-md); padding: var(--sp-4); margin-bottom: var(--sp-3); background: var(--surface-2); }+.estimate-box .amount { font-size: var(--fs-kpi); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }+.estimate-box .amount.free { color: var(--good); }+.estimate-box .amount.paid { color: var(--wait); }+.query-list { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin-top: var(--sp-3); line-height: 1.7; max-height: 150px; overflow-y: auto; overscroll-behavior: contain; }-.estimate-box { border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 16px; background: var(--panel-raised); }-.estimate-box .amount { font-family: var(--mono); font-size: 27px; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }-.estimate-box .amount.free { color: var(--s-good); }-.estimate-box .amount.paid { color: var(--s-wait); }-.query-list { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin-top: 12px; line-height: 1.75; max-height: 150px; overflow-y: auto; }+.stats-grid {+ display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4);+}+.stat-card {+ background: var(--surface); border: 1px solid transparent; border-radius: var(--r-lg);+ box-shadow: var(--shadow-border); padding: var(--sp-4);+}+.stat-card .label { font-size: var(--fs-ui); color: var(--text-2); margin-bottom: 6px; }+.stat-card .value { font-size: var(--fs-kpi); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }+.stat-card .breakdown { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 12px; }+.chip { font-size: var(--fs-caption); color: var(--text-3); }+.chip b { color: var(--text-2); font-weight: 500; }++/* Column chart (usage per day) */+.chart-cols { display: flex; align-items: flex-end; gap: 3px; height: 140px; margin-top: var(--sp-2); }+.chart-cols .col { flex: 1; height: 100%; display: flex; align-items: flex-end; border-radius: 3px; }+.chart-cols .col i { display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 1px 1px; background: var(--accent); opacity: 0.85; }+@media (hover: hover) { .chart-cols .col:hover i { opacity: 1; } .chart-cols .col:hover { background: var(--surface-2); } }+.chart-axis { display: flex; justify-content: space-between; font-size: var(--fs-caption); color: var(--text-3); margin-top: 6px; }/* ── Forms ───────────────────────────────────────────────────── */-.form-group { margin-bottom: 15px; }-.form-label { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-3); margin-bottom: 5px; }+.form-group { margin-bottom: var(--sp-4); }+.form-label { display: block; font-size: var(--fs-ui); font-weight: 500; color: var(--text); margin-bottom: 6px; }.form-input {- width: 100%; padding: 8px 11px; font-family: var(--sans); font-size: 13px;- background: var(--bg); color: var(--text);- border: 1px solid var(--border-strong); border-radius: var(--r-sm);- transition: border-color .15s;+ width: 100%; height: 36px; padding: 0 12px; font: 400 var(--fs-body) var(--sans);+ background: var(--surface); color: var(--text);+ border: 1px solid var(--line-strong); border-radius: var(--r-sm);+ transition-property: border-color, box-shadow; transition-duration: 120ms; transition-timing-function: ease;}-.form-input:focus { outline: none; border-color: var(--text-3); }+textarea.form-input { height: auto; padding: 8px 12px; }+.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }.form-input::placeholder { color: var(--text-3); }-.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }-.form-row .form-group { flex: 1; min-width: 130px; }--.test-result { font-size: 12.5px; margin-top: 10px; padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid transparent; }-.test-result.success { background: var(--s-good-bg); color: var(--s-good); border-color: var(--s-good-line); }-.test-result.error { background: var(--s-bad-bg); color: var(--s-bad); border-color: var(--s-bad-line); }-.test-result.pending { background: var(--panel-raised); color: var(--text-2); border-color: var(--border); }--/* ── Setup checklist ─────────────────────────────────────────── */--.progress-wrap { margin-bottom: 18px; }-.progress-label { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 7px; }-.progress-label .pct { font-family: var(--mono); font-variant-numeric: tabular-nums; }-.progress-label .text { color: var(--text-3); }-.progress-bar { height: 3px; background: var(--border); border-radius: 99px; overflow: hidden; }-.progress-fill { height: 100%; transition: width .5s cubic-bezier(.16,1,.3,1); }-.progress-fill.green { background: var(--s-good); }-.progress-fill.yellow { background: var(--s-wait); }--.check-item { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--border); }-.check-item:last-child { border-bottom: none; }-.check-icon {- width: 15px; height: 15px; flex: none; margin-top: 2px; border-radius: 50%;- display: flex; align-items: center; justify-content: center; font-size: 9px;-}-.check-icon.done { background: var(--s-good-bg); color: var(--s-good); border: 1px solid var(--s-good-line); }-.check-icon.pending { border: 1px dashed var(--border-strong); color: var(--text-3); }-.check-info { flex: 1; min-width: 0; }-.check-label { font-size: 13px; font-weight: 500; }-.check-label.done { color: var(--text-3); font-weight: 400; }-.check-help { font-size: 12px; color: var(--text-3); margin-top: 3px; text-wrap: pretty; }-.optional-tag { font-size: 10px; color: var(--text-3); font-weight: 400; margin-left: 5px; }--details summary { cursor: pointer; list-style: none; }-details summary::-webkit-details-marker { display: none; }-details summary::before { content: '+ '; font-family: var(--mono); color: var(--text-3); }-details[open] summary::before { content: '– '; }--/* ── Campaigns, conversations, activity ──────────────────────── */--.campaign-card, .convo-card {- background: var(--panel); border: 1px solid var(--border);- border-radius: var(--r-md); padding: 20px 22px; margin-bottom: 13px;-}-.campaign-card h3, .convo-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 5px; letter-spacing: -0.008em; }-.campaign-card .meta, .convo-card .meta { font-size: 12px; color: var(--text-3); display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }--.email-step { border-left: 2px solid var(--border); padding: 2px 0 2px 15px; margin-bottom: 15px; }-.email-step .step-num { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); margin-bottom: 4px; }-.email-step .subject { font-size: 13.5px; font-weight: 500; margin-bottom: 6px; }-.email-step .body { font-size: 13px; color: var(--text-2); line-height: 1.7; white-space: pre-wrap; }--.thread-msg { max-width: 78%; padding: 11px 14px; border-radius: var(--r-md); margin-bottom: 9px; font-size: 13px; line-height: 1.65; }-.thread-msg.sent { background: var(--panel-raised); border: 1px solid var(--border); margin-left: auto; }-.thread-msg.received { background: var(--bg); border: 1px solid var(--border); }-.thread-msg .sender { font-family: var(--mono); font-size: 10px; color: var(--text-3); margin-bottom: 4px; }--.activity-feed { border-top: 1px solid var(--rule); }-.activity-item { display: flex; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; align-items: baseline; }-.activity-item:last-child { border-bottom: none; }-.activity-item .time { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); min-width: 108px; flex: none; }-.activity-item .agent { font-family: var(--mono); font-size: 11px; color: var(--text-2); min-width: 62px; flex: none; }-.activity-item .action { color: var(--text-2); }--/* ── Help & misc ─────────────────────────────────────────────── */--.help-section { margin-bottom: 26px; }-.help-section h2 { font-family: var(--serif); font-size: 21px; font-weight: 400; letter-spacing: -0.014em; margin-bottom: 9px; }-.help-section p { font-size: 13.5px; color: var(--text-2); line-height: 1.7; margin-bottom: 9px; max-width: 70ch; }-.help-section code { font-family: var(--mono); font-size: 12px; background: var(--panel-raised); border: 1px solid var(--border); border-radius: 2px; padding: 1px 5px; }-.help-section pre { background: var(--panel-raised); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 13px 15px; overflow-x: auto; font-family: var(--mono); font-size: 12px; line-height: 1.6; }-.file-table { width: 100%; font-size: 12.5px; border-collapse: collapse; }-.file-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }-.file-table td:first-child { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; width: 210px; }+.form-row { display: flex; gap: var(--sp-3); align-items: flex-end; flex-wrap: wrap; }+.form-row .form-group { flex: 1; min-width: 140px; }+@media (max-width: 640px) { .form-input { font-size: 16px; } }++.test-result { font-size: var(--fs-ui); margin-top: var(--sp-3); padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid transparent; }+.test-result.success { background: var(--good-bg); color: var(--good); border-color: var(--good-line); }+.test-result.error { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }+.test-result.pending { background: var(--surface-2); color: var(--text-2); border-color: var(--line); }++/* Settings: label column + fields column */+.settings-row { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--sp-5); padding: var(--sp-5) 0; }+.settings-row + .settings-row { border-top: 1px solid var(--line); }+.settings-row:first-of-type { padding-top: 0; }+.settings-row:last-child { padding-bottom: 0; }+.settings-row h3 { font-size: var(--fs-body); font-weight: 600; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }+.settings-row .desc { font-size: var(--fs-ui); color: var(--text-2); margin-top: 4px; text-wrap: pretty; }+.settings-row .fields { max-width: 560px; }+.settings-row .fields .form-group:last-child { margin-bottom: 0; }+.settings-row .fields .form-row { margin-bottom: var(--sp-4); }+.settings-row .fields .form-row .form-group { margin-bottom: 0; }+.with-btn { display: flex; gap: var(--sp-2); }+.with-btn .form-input { flex: 1; min-width: 0; }+@media (max-width: 860px) { .settings-row { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); } }++/* ── Campaigns ───────────────────────────────────────────────── */++.campaign-card {+ background: var(--surface); border: 1px solid transparent; border-radius: var(--r-lg);+ box-shadow: var(--shadow-border); margin-bottom: var(--sp-4); overflow: hidden;+}+.campaign-top { padding: var(--sp-5); }+.campaign-title { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }+.campaign-title h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -0.01em; }+.campaign-card .meta { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; font-size: var(--fs-caption); color: var(--text-3); margin-top: 6px; }+.campaign-progress { margin-top: var(--sp-4); }+.campaign-progress .bar { height: 8px; gap: 2px; background: var(--surface-3); }+.campaign-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }+.campaign-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-caption); color: var(--text-2); }+.campaign-legend i { width: 8px; height: 8px; border-radius: 2px; }+.campaign-legend b { color: var(--text); font-weight: 600; }++.sequence { border-top: 1px solid var(--line); padding: var(--sp-2) var(--sp-5) var(--sp-5); }+.email-step { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 0 var(--sp-3); padding-top: var(--sp-4); }+.email-step::before {+ content: ''; position: absolute; left: 13.5px; top: calc(var(--sp-4) + 30px); bottom: -16px; width: 1px; background: var(--line);+}+.email-step:last-child::before { display: none; }+.step-dot {+ width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;+ font-size: var(--fs-caption); font-weight: 600; background: var(--surface-2); color: var(--text-2);+ box-shadow: inset 0 0 0 1px var(--line);+}+.email-step .step-num { font-size: var(--fs-caption); color: var(--text-3); margin-top: 5px; }+.email-step .subject { font-size: var(--fs-body); font-weight: 600; margin: 2px 0 6px; }+.email-step .body {+ font-size: var(--fs-ui); color: var(--text-2); line-height: 1.6; white-space: pre-wrap;+ background: var(--surface-2); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); max-width: 72ch;+}+.step-actions {+ margin-top: var(--sp-3); display: flex; flex-direction: column; max-width: 72ch;+ border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line);+}+.rcpt { display: flex; align-items: center; gap: var(--sp-3); padding: 8px 12px; flex-wrap: wrap; }+.rcpt + .rcpt { border-top: 1px solid var(--line); }+.rcpt-who { flex: 1 1 200px; min-width: 0; font-size: var(--fs-ui); display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }+.step-actions label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-caption); color: var(--text-2); cursor: pointer; }+.step-actions input { accent-color: var(--accent); }++/* ── Conversations ───────────────────────────────────────────── */++.convo-card {+ background: var(--surface); border: 1px solid transparent; border-radius: var(--r-lg);+ box-shadow: var(--shadow-border); padding: var(--sp-5); margin-bottom: var(--sp-4);+}+.convo-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }+.convo-head h3 { font-size: var(--fs-body); font-weight: 600; }+.convo-head .sub { font-size: var(--fs-caption); color: var(--text-3); }+.convo-head .tags { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }+.thread { display: flex; flex-direction: column; gap: var(--sp-2); }+.thread-msg { max-width: min(78%, 62ch); padding: 10px 14px; border-radius: 14px; font-size: var(--fs-ui); line-height: 1.55; white-space: pre-wrap; }+.thread-msg.sent { align-self: flex-end; background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent-line); border-bottom-right-radius: 4px; }+.thread-msg.received { align-self: flex-start; background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; }+.thread-msg .sender { font-size: 11px; opacity: 0.7; margin-bottom: 2px; }++/* ── Controls, help, misc ────────────────────────────────────── */++.control-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--sp-4); align-items: start; }+@media (max-width: 900px) { .control-panel { grid-template-columns: minmax(0, 1fr); } }+.status-big { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }+.status-big .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); }+.status-big .dot.running { background: var(--good); box-shadow: 0 0 0 4px var(--good-bg); }+.status-big .label { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; }+.status-big .label.running { color: var(--good); }+.status-meta { font-size: var(--fs-ui); color: var(--text-3); min-height: 20px; }+.log-viewer {+ background: #0B0B0D; color: #C9C9D1; border-radius: var(--r-md);+ padding: var(--sp-4); font-family: var(--mono); font-size: 12px; line-height: 1.7;+ height: 380px; overflow-y: auto; overscroll-behavior: contain; white-space: pre-wrap;+ box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06);+}++.help-section { margin-bottom: var(--sp-6); max-width: 76ch; }+.help-section h2 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -0.01em; margin-bottom: var(--sp-2); }+.help-section p { font-size: var(--fs-body); color: var(--text-2); line-height: 1.65; margin-bottom: var(--sp-2); text-wrap: pretty; }+.help-section pre {+ background: var(--surface-2); border-radius: var(--r-md); padding: var(--sp-4);+ overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; margin: var(--sp-2) 0;+}+.help-section details { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-border); margin-bottom: var(--sp-2); }+.help-section details summary { padding: 12px var(--sp-4); font-size: var(--fs-body); font-weight: 500; }+.help-section .faq-body { padding: 0 var(--sp-4) var(--sp-4) 34px; font-size: var(--fs-ui); color: var(--text-2); line-height: 1.65; }+.help-section .faq-body p { font-size: var(--fs-ui); margin-bottom: 6px; }+.file-table { width: 100%; font-size: var(--fs-ui); border-collapse: collapse; }+.file-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); }+.file-table td:first-child { font-family: var(--mono); font-size: 12px; white-space: nowrap; width: 230px; color: var(--text); }.file-table td:last-child { color: var(--text-2); }.file-table tr:last-child td { border-bottom: none; }-.control-panel { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; }-@media (max-width: 900px) { .control-panel { grid-template-columns: 1fr; } }-.status-big { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }-.status-big .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); }-.status-big .dot.running { background: var(--s-good); }-.status-big .label { font-size: 18px; font-weight: 600; letter-spacing: -0.012em; }-.status-big .label.running { color: var(--s-good); }-.status-meta { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin-bottom: 16px; min-height: 15px; }-.log-viewer { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 13px 15px; font-family: var(--mono); font-size: 11.5px; line-height: 1.65; color: var(--text-2); height: 340px; overflow-y: auto; white-space: pre-wrap; }--.empty { text-align: center; padding: 46px 24px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); }-.empty .glyph { font-size: 20px; color: var(--text-3); margin-bottom: 12px; }-.empty .title { font-family: var(--serif); font-size: 19px; font-weight: 400; margin-bottom: 6px; }-.empty .copy { font-size: 13px; color: var(--text-3); line-height: 1.65; max-width: 46ch; margin: 0 auto; text-wrap: pretty; }-.empty .copy b { color: var(--text-2); font-weight: 500; }--.toast {- position: fixed; bottom: 22px; right: 22px; z-index: 60;- padding: 11px 16px; border-radius: var(--r-sm); font-size: 13px; font-weight: 450;- box-shadow: var(--shadow); animation: toast-in .25s cubic-bezier(.16,1,.3,1);+.empty { text-align: center; padding: var(--sp-7) var(--sp-5); }+.empty .glyph {+ width: 40px; height: 40px; margin: 0 auto var(--sp-3); border-radius: 12px;+ display: flex; align-items: center; justify-content: center; font-size: 18px;+ background: var(--surface-2); color: var(--text-2);+}+.empty .title { font-size: var(--fs-h3); font-weight: 600; margin-bottom: 4px; }+.empty .copy { font-size: var(--fs-ui); color: var(--text-2); line-height: 1.6; max-width: 48ch; margin: 0 auto; text-wrap: pretty; }+.empty .copy b { color: var(--text); font-weight: 500; }+.section > .empty, .content-inner > .empty, #companies-list > .empty, #prospects-table > .empty,+#campaigns-list > .empty, #conversations-list > .empty, #activity-list > .empty {+ background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-border);}-@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }-.toast.success { background: var(--ink); color: var(--ink-contrast); }-.toast.error { background: var(--s-bad); color: #fff; }-@media (max-width: 700px) {- :root { --gut: 18px; }+.toast {+ position: fixed; bottom: var(--sp-5); right: var(--sp-5); z-index: 60; max-width: 420px;+ padding: 10px 14px; border-radius: var(--r-md); font-size: var(--fs-ui); font-weight: 500;+ box-shadow: var(--shadow-pop);+ transition-property: opacity, translate; transition-duration: 250ms; transition-timing-function: var(--ease-out);+ @starting-style { opacity: 0; translate: 0 8px; }+}+.toast.success { background: var(--text); color: var(--bg); }+.toast.error { background: var(--bad); color: #fff; }++/* Lock screen */+#lock-screen { background: var(--bg); }+#lock-screen .card { box-shadow: var(--shadow-pop); }++/* ── Small screens: the sidebar becomes a top bar ────────────── */++@media (max-width: 900px) {+ .app { grid-template-columns: minmax(0, 1fr); }+ .sidebar {+ position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap;+ align-items: center; gap: var(--sp-2) var(--sp-3); padding: var(--sp-2) var(--sp-4);+ border-right: none; border-bottom: 1px solid var(--line); overflow: visible;+ }.brand .tagline { display: none; }- .section-head h2 { font-size: 26px; }+ nav { order: 3; width: 100%; flex-direction: row; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--sp-4)); padding: 0 var(--sp-4) 2px; width: calc(100% + 2 * var(--sp-4)); }+ nav::-webkit-scrollbar { display: none; }+ .nav-group { flex-direction: row; gap: 2px; }+ .nav-label { display: none; }+ nav button { width: auto; height: 30px; flex: none; }+ .sidebar-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; border-top: none; padding: 0; }+ main.content { padding: var(--sp-5) var(--sp-4) 80px; }+ .tl-item { grid-template-columns: 52px 24px minmax(0, 1fr); }+ .queue-item { flex-wrap: wrap; }+ .queue-item .qtext { flex-basis: calc(100% - 48px); }+ .queue-item .btn { margin-left: 48px; }+ .step-detail { grid-column: 2 / 4; text-align: left; }+ .tl-agent { display: none; }}@media (prefers-reduced-motion: reduce) {- *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }+ *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }}diff --git a/harvey/web/app.js b/harvey/web/app.jsindex a8df742..10e04cc 100644--- a/harvey/web/app.js+++ b/harvey/web/app.js@@ -123,6 +123,95 @@ function formatDate(d) {} catch { return escHtml(d); }}+// ── Small render helpers ──++// The sprite in index.html holds every icon; this just references one.+function icon(name, cls) {+ return '<svg class="icon' + (cls ? ' ' + cls : '') + '" aria-hidden="true"><use href="#i-' + name + '"/></svg>';+}++function initials(first, last) {+ const a = String(first || '').trim(), b = String(last || '').trim();+ const s = (a.charAt(0) + b.charAt(0)) || a.slice(0, 2) || '?';+ return escHtml(s.toUpperCase());+}++// Stored times are UTC, often without a zone ("2026-10-21 03:07:57").+function parseTs(d) {+ let t = String(d || '').trim().replace(' ', 'T');+ if (t && !/[zZ]$|[+-]\d\d:?\d\d$/.test(t)) t += 'Z';+ return new Date(t);+}++// "3m ago", "5h ago", "Yesterday", then a date: recent things read faster.+function relTime(d) {+ if (!d) return '';+ const dt = parseTs(d);+ if (isNaN(dt)) return escHtml(d);+ const mins = Math.round((Date.now() - dt) / 60000);+ if (mins < 1) return 'just now';+ if (mins < 60) return mins + 'm ago';+ if (mins < 60 * 24) return Math.round(mins / 60) + 'h ago';+ if (mins < 60 * 48) return 'Yesterday';+ return dt.toLocaleDateString('en-US', {month: 'short', day: 'numeric'});+}++function dayLabel(d) {+ const dt = parseTs(d);+ if (isNaN(dt)) return '';+ const today = new Date(); today.setHours(0, 0, 0, 0);+ const that = new Date(dt); that.setHours(0, 0, 0, 0);+ const diff = Math.round((today - that) / 86400000);+ if (diff === 0) return 'Today';+ if (diff === 1) return 'Yesterday';+ return dt.toLocaleDateString('en-US', {weekday: 'long', month: 'short', day: 'numeric'});+}++function timeOfDay(d) {+ const dt = parseTs(d);+ return isNaN(dt) ? '' : dt.toLocaleTimeString('en-US', {hour: 'numeric', minute: '2-digit'});+}++// Columns of a tiny bar chart; the last day is "today".+function sparkBars(values, title) {+ const vals = (values || []).map(v => Number(v) || 0);+ if (!vals.length) return '';+ const max = Math.max(...vals, 1);+ return '<span class="spark" role="img" aria-label="' + escHtml(title || 'trend') + '">' ++ vals.map((v, i) => '<i class="' + (v ? 'on' : '') + '" style="height:' ++ Math.max(2, Math.round(v / max * 28)) + 'px" title="' + v + '"></i>').join('') + '</span>';+}++// A segmented meter, 0-100.+function meterHtml(pct, segments) {+ const n = segments || 10;+ const v = Math.max(0, Math.min(100, Number(pct) || 0));+ const on = Math.round(v / 100 * n);+ return '<span class="meter-row"><span class="meter" role="meter" aria-valuemin="0" ' ++ 'aria-valuemax="100" aria-valuenow="' + v + '">' ++ Array.from({length: n}, (_, i) => '<i class="' + (i < on ? 'on' : '') + '"></i>').join('') ++ '</span><span class="v">' + v + '</span></span>';+}++const SOURCE_LABELS = {+ company_website: 'Team page', known_company_backfill: 'Team page',+ scraped_mailto: 'Published address', hunter_domain_search: 'Hunter', linkedin_search: 'LinkedIn',+ job_board: 'Job board', web_search: 'Web search', company_inbox: 'Company inbox',+ osm: 'OpenStreetMap', dataforseo_listings: 'DataForSEO', dataforseo_serp: 'DataForSEO SERP',+ serper: 'Serper',+};+function sourceLabel(s) {+ if (!s) return '';+ return escHtml(Object.prototype.hasOwnProperty.call(SOURCE_LABELS, s) ? SOURCE_LABELS[s]+ : String(s).replace(/_/g, ' ').replace(/^./, c => c.toUpperCase()));+}++const AGENT_ICONS = {scout: 'discover', writer: 'pen', sender: 'campaigns', handler: 'message',+ analyst: 'usage', user: 'contacts'};+function actionText(a) {+ return escHtml(String(a.action_type || '').replace(/_/g, ' '));+}+function emptyState(glyph, title, copy) {return '<div class="empty"><div class="glyph">' + glyph + '</div>' +'<div class="title">' + title + '</div>' +@@ -249,7 +338,7 @@ function showTab(id, btn) {function loadCurrentTab() {switch (currentTab) {- case 'today': loadLiveStatus(); loadToday(); loadSetupStatus(); loadRuns(); loadTodayActivity(); break;+ case 'today': loadLiveStatus(); loadToday(); loadTrend(); loadFunnel(); loadSetupStatus(); loadRuns(); loadTodayActivity(); break;case 'signals': loadSignals(); break;case 'discover': loadDiscoverProviders(); break;case 'companies': if (!companyDrill) loadCompanies(); break;@@ -273,12 +362,13 @@ async function loadToday() {navCount('nav-today', (data.items || []).filter(i => i.tone !== 'good').length);navCount('nav-outbox', (data.stats || {}).outbox_pending || 0);- renderFigures(data.stats || {});+ _todayStats = data.stats || {};+ renderFigures(_todayStats);const items = data.items || [];if (!items.length) {el.innerHTML = '<div class="queue-clear">' +- '<div class="glyph">✓</div><div>' ++ '<div class="queue-icon">' + icon('check') + '</div><div>' +'<div class="qtitle">Nothing needs you</div>' +'<div class="qdetail">Harvey has everything it needs. Anything that requires a ' +'decision — an email to approve, a signal to confirm — shows up here.</div>' +@@ -286,16 +376,19 @@ async function loadToday() {return;}- el.innerHTML = '<div class="queue">' + items.map(it =>- '<div class="queue-item ' + escHtml(it.tone || 'warn') + '">' ++ const glyph = {bad: 'alert', warn: 'flag', good: 'check'};+ el.innerHTML = '<div class="queue">' + items.map(it => {+ const tone = escHtml(it.tone || 'warn');+ return '<div class="queue-item ' + tone + '">' ++ '<div class="queue-icon">' + icon(glyph[it.tone] || 'flag') + '</div>' +'<div class="qtext">' +'<div class="qtitle">' + escHtml(it.title) + '</div>' +'<div class="qdetail">' + escHtml(it.detail) + '</div>' +'</div>' +'<button class="btn btn-secondary btn-sm" onclick="goTab(\'' + escHtml(it.tab) + '\')">' +- escHtml(it.action) + '</button>' +- '</div>'- ).join('') + '</div>';+ escHtml(it.action) + icon('arrow') + '</button>' ++ '</div>';+ }).join('') + '</div>';}// ── Live status: the "what's happening?" answer, kept on screen ──@@ -308,84 +401,125 @@ async function loadLiveStatus() {// Keep the last good numbers on screen, but never let them pass for live.const flag = el.querySelector('.live-flag');if (flag) flag.textContent = "Can't reach Harvey right now — numbers below may be old.";- else el.innerHTML = '<div class="rail-block"><div class="subhead">Status — live</div>' +- '<p class="muted live-flag" style="font-size:13px">Can\'t reach Harvey right now. ' +- 'Is the dashboard window still open?</p></div>';+ else el.innerHTML = '<p class="muted live-flag">Can\'t reach Harvey right now. ' ++ 'Is the dashboard window still open?</p>';return;}- const icon = {done: '✓', running: '⏳', partial: '●', waiting: '○'};- const color = {done: '#2e7d32', running: '#b26a00',- partial: 'var(--text-2, #666)', waiting: 'var(--text-3, #999)'};+ const glyph = {done: icon('check'), running: '<span class="pulse"></span>', partial: '', waiting: ''};+ const fill = {done: 'var(--good)', running: 'var(--accent)', partial: 'var(--accent)', waiting: 'var(--line-strong)'};const rows = d.steps.map(s => {- const st = icon[s.state] ? s.state : 'waiting';+ const st = Object.prototype.hasOwnProperty.call(glyph, s.state) ? s.state : 'waiting';const pct = s.total ? Math.min(100, Math.round(100 * s.done / s.total)) : 0;const bar = s.total- ? '<div style="height:5px;background:var(--border, #e5e5e5);border-radius:3px;margin-top:5px">' +- '<div style="height:5px;width:' + pct + '%;background:' + color[st] +- ';border-radius:3px;transition:width .4s"></div></div>'+ ? '<div class="bar"><span style="width:' + pct + '%;background:' + fill[st] + '"></span></div>': '';- return '<div style="display:flex;gap:10px;padding:8px 0;border-bottom:1px solid var(--border, #eee)">' +- '<span style="width:20px;text-align:center;color:' + color[st] + '">' + icon[st] + '</span>' +- '<div style="flex:1;min-width:0"><div style="display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap">' +- '<strong style="font-size:13.5px">' + escHtml(s.label) + '</strong>' +- '<span class="muted" style="font-size:12.5px">' + escHtml(s.detail) + '</span></div>' + bar +- '</div></div>';+ return '<div class="step">' ++ '<span class="step-icon ' + st + '">' + glyph[st] + '</span>' ++ '<span class="step-label">' + escHtml(s.label) + '</span>' ++ '<span class="step-detail">' + escHtml(s.detail) + '</span>' + bar ++ '</div>';}).join('');const jobName = r => r.stage === 'profile' ? 'Reading websites': r.stage === 'discover' ? 'Searching for businesses (' + (r.provider || '') + ')': String(r.stage || 'Job');const running = d.running || [];const runningHtml = running.length- ? running.map(r => '⏳ ' + escHtml(jobName(r)) + ' · running ' + r.elapsed_min + ' min' +- (r.eta_text ? ' · ' + escHtml(r.eta_text) : '')).join('<br>')- : 'Nothing running right now.';+ ? running.map(r => '<span class="live-now"><span class="pulse"></span>' + escHtml(jobName(r)) ++ ' · ' + r.elapsed_min + ' min' + (r.eta_text ? ' · ' + escHtml(r.eta_text) : '') + '</span>').join('')+ : '<span class="live-now">Nothing running right now</span>';const stoppedHtml = (d.stopped || []).length- ? '<div style="margin-top:6px;font-size:13px;color:#b3261e">⚠ ' +- (d.stopped || []).map(r => escHtml(jobName(r))).join(', ') +- ' stopped before finishing.</div>'+ ? '<div class="banner bad" style="margin:8px 0 0">' + icon('alert') + '<p style="color:inherit">' ++ (d.stopped || []).map(r => escHtml(jobName(r))).join(', ') + ' stopped before finishing.</p></div>': '';- el.innerHTML = '<div class="rail-block">' +- '<div class="subhead">Status — live</div>' +- '<div style="font-size:13px;margin:6px 0 4px">' + runningHtml + '</div>' + stoppedHtml +- '<div style="margin-top:10px">' + rows + '</div>' +- '<div style="margin-top:10px;font-size:13px"><strong>Next:</strong> ' + escHtml(d.next || '') + '</div>' +- '<div class="muted live-flag" style="margin-top:4px;font-size:12px">Cost so far: $' +- Number(d.cost_usd || 0).toFixed(2) + ' · updated ' + new Date().toLocaleTimeString() +- ' · refreshes every 10 seconds</div></div>';+ el.innerHTML =+ '<div class="live-head">' + runningHtml ++ '<span class="setup-pct">Cost so far $' + Number(d.cost_usd || 0).toFixed(2) + '</span></div>' ++ stoppedHtml ++ '<div class="steps">' + rows + '</div>' ++ (d.next ? '<div class="live-next">' + icon('arrow') + '<span><b>Next</b> · ' + escHtml(d.next) + '</span></div>' : '') ++ '<div class="live-flag">Updated ' + new Date().toLocaleTimeString() + ' · refreshes every 10 seconds</div>';}+// KPI cards. Totals come from /api/today; the 14-day bars from /api/trend.function renderFigures(stats) {- const el = document.getElementById('today-figures');+ const el = document.getElementById('today-kpis');if (!el) return;- const row = (label, value) =>- '<div class="figure"><span class="k">' + label + '</span>' +- '<span class="v' + (value ? '' : ' zero') + '">' + value + '</span></div>';-- el.innerHTML = '<div class="figures">' +- row('Companies', stats.companies || 0) +- row('Contacts', stats.prospects || 0) +- row('Signals on', stats.signals_confirmed || 0) +- row('Not yet read', stats.unprofiled || 0) +- row('Awaiting approval', stats.outbox_pending || 0) +- row('Scheduled', stats.outbox_approved || 0) +- row('Live conversations', stats.open_conversations || 0) ++ const t = _trend || {};+ const sum = a => (a || []).reduce((x, y) => x + (Number(y) || 0), 0);+ const last7 = a => sum((a || []).slice(-7));+ const card = (label, value, spark, note) =>+ '<div class="kpi"><div class="kpi-label">' + label + '</div>' ++ '<div class="kpi-value' + (value ? '' : ' zero') + '">' + value + '</div>' ++ '<div class="kpi-foot"><span class="kpi-note">' + note + '</span>' + spark + '</div></div>';++ el.innerHTML = '<div class="kpis">' ++ card('Contacts found', stats.prospects || 0, sparkBars(t.found, 'Contacts found per day, last 14 days'),+ '<b>+' + last7(t.found) + '</b> this week') ++ card('Emails sent', sum(t.sent), sparkBars(t.sent, 'Emails sent per day, last 14 days'),+ 'last 14 days · <b>' + (stats.outbox_approved || 0) + '</b> scheduled') ++ card('Conversations', stats.open_conversations || 0, sparkBars(t.replies, 'New replies per day, last 14 days'),+ '<b>' + sum(t.replies) + '</b> new in 14 days') ++ card('Waiting on you', stats.outbox_pending || 0, '',+ stats.outbox_pending ? 'drafts in the Outbox' : 'nothing to approve') +'</div>';}+let _todayStats = {};+let _trend = null;++async function loadTrend() {+ const t = await api('/api/trend?days=14');+ if (t && Array.isArray(t.days)) { _trend = t; renderFigures(_todayStats); }+}++// Contacts by stage: one bar, one legend, from /api/stats.+async function loadFunnel() {+ const el = document.getElementById('today-figures');+ if (!el) return;+ const data = await api('/api/stats');+ if (!data || data.error) { el.innerHTML = '<p class="muted" style="font-size:13px">No contacts yet.</p>'; return; }+ const by = (data.prospects || {}).by_status || {};+ const total = (data.prospects || {}).total || 0;+ const n = keys => keys.reduce((x, k) => x + (by[k] || 0), 0);+ const known = ['new', 'queued', 'contacted', 'replied', 'interested', 'meeting'];+ const stages = [+ ['To write', n(['new', 'queued']), 'c-accent-soft'],+ ['Contacted', n(['contacted']), 'c-accent'],+ ['Replied', n(['replied']), 'c-active'],+ ['Interested', n(['interested', 'meeting']), 'c-good'],+ ['Closed out', total - n(known), 'c-idle'],+ ];+ if (!total) {+ el.innerHTML = '<p class="muted" style="font-size:13px">No contacts yet. Scout adds them as it finds people.</p>';+ return;+ }+ el.innerHTML =+ '<div class="funnel-bar" role="img" aria-label="Contacts by stage">' ++ stages.filter(s => s[1] > 0).map(s =>+ '<span class="seg ' + s[2] + '" style="flex:' + s[1] + '" title="' + s[0] + ': ' + s[1] + '"></span>').join('') ++ '</div>' ++ '<div class="legend-rows">' + stages.map(s =>+ '<div class="legend-row"><span class="legend-key"><i class="' + s[2] + '"></i>' + s[0] + '</span>' ++ '<span class="legend-val">' + s[1] + '</span>' ++ '<span class="legend-pct">' + Math.round(100 * s[1] / total) + '%</span></div>'+ ).join('') + '</div>';+}+async function loadTodayActivity() {const el = document.getElementById('today-activity');if (!el) return;const data = await api('/api/activity');if (!Array.isArray(data) || !data.length) {- el.innerHTML = '<p class="muted" style="font-size:12.5px">' ++ el.innerHTML = '<p class="muted" style="font-size:13px">' +'Nothing yet. Every action Harvey takes shows up here.</p>';return;}- el.innerHTML = '<div class="activity-feed">' + data.slice(0, 12).map(a =>- '<div class="activity-item">' +- '<span class="time">' + formatDate(a.created_at) + '</span>' +- '<span class="agent">' + escHtml(a.agent) + '</span>' +- '<span class="action">' + escHtml(String(a.action_type).replace(/_/g, ' ')) + '</span>' ++ el.innerHTML = '<div class="timeline">' + data.slice(0, 8).map(a =>+ '<div class="tl-item">' ++ '<span class="tl-time">' + relTime(a.created_at) + '</span>' ++ '<span class="tl-icon">' + icon(AGENT_ICONS[a.agent] || 'activity') + '</span>' ++ '<span class="tl-text">' + actionText(a) + '</span>' ++ '<span class="tl-agent">' + escHtml(a.agent) + '</span>' +'</div>').join('') + '</div>';}@@ -414,17 +548,12 @@ async function loadRuns() {return;}if (block) block.style.display = '';-- // A rail is 300px wide — a seven-column table does not belong here.- el.innerHTML = '<div class="figures">' + runs.slice(0, 6).map(r =>- '<div class="figure" style="align-items:flex-start">' +- '<span class="k">' + escHtml(r.stage) +- '<br><span class="muted" style="font-size:11px">' +- formatDate(r.started_at) + '</span></span>' +- '<span style="text-align:right;flex:none">' + badge(r.status) +- '<br><span class="muted" style="font-family:var(--mono);font-size:11px">' +- (r.records || 0) + ' rec · ' +- (r.cost_usd ? '$' + Number(r.cost_usd).toFixed(4) : 'free') + '</span></span>' ++ el.innerHTML = '<div class="runs">' + runs.slice(0, 5).map(r =>+ '<div class="run">' ++ '<span class="name">' + escHtml(r.stage) + '</span>' + badge(r.status) ++ '<span class="when">' + relTime(r.started_at) + '</span>' ++ '<span class="stats">' + (r.records || 0) + ' records · ' ++ (r.cost_usd ? '$' + Number(r.cost_usd).toFixed(4) : 'free') + '</span>' +'</div>').join('') + '</div>';}@@ -442,7 +571,7 @@ async function loadSetupStatus() {const renderCheck = (c, optional) =>'<div class="check-item">' +- (c.done ? '<span class="check-icon done">✓</span>'+ (c.done ? '<span class="check-icon done">' + icon('check') + '</span>': '<span class="check-icon pending"></span>') +'<div class="check-info">' +'<div class="check-label ' + (c.done ? 'done' : '') + '">' + escHtml(c.label) +@@ -452,12 +581,12 @@ async function loadSetupStatus() {const required = data.checks.filter(c => c.required);const optional = data.checks.filter(c => !c.required);+ const done = required.filter(c => c.done).length;el.innerHTML =- '<div class="rail-block">' +- '<div class="subhead">Setup — ' + pct + '%</div>' +- '<div class="progress-bar" style="margin-bottom:14px">' +- '<div class="progress-fill yellow" style="width:' + pct + '%"></div></div>' ++ '<div class="subhead">Setup <span class="setup-pct">' + done + ' of ' + required.length + ' done</span></div>' ++ '<div class="card">' ++ '<div class="bar thick" style="margin-bottom:8px"><span style="width:' + pct + '%;background:var(--accent)"></span></div>' +required.map(c => renderCheck(c, false)).join('') +(optional.length? '<details style="margin-top:10px"><summary class="muted" ' +@@ -479,12 +608,15 @@ async function loadSignals() {const s = data.summary || {};navCount('nav-signals', s.proposed || 0);- sumEl.innerHTML = '<div class="sig-summary">' +- ['confirmed', 'proposed', 'rejected'].map(k =>- '<div class="sig-stat ' + k + '"><div class="n">' + (s[k] || 0) + '</div>' +- '<div class="k">' + (k === 'proposed' ? 'awaiting you' : k) + '</div></div>'- ).join('') +- '</div>';+ const parts = [['Confirmed', s.confirmed || 0, 'c-good'], ['Waiting on you', s.proposed || 0, 'c-wait'],+ ['Turned off', s.rejected || 0, 'c-idle']];+ const all = parts.reduce((x, p) => x + p[1], 0) || 1;+ sumEl.innerHTML = '<div class="card sig-summary"><div class="funnel-bar">' ++ parts.filter(p => p[1]).map(p => '<span class="seg ' + p[2] + '" style="flex:' + p[1] + '"></span>').join('') ++ '</div><div class="funnel-legend">' + parts.map(p =>+ '<div class="legend-item"><span class="legend-key"><i class="' + p[2] + '"></i>' + p[0] + '</span>' ++ '<span class="legend-val">' + p[1] + '<small>' + Math.round(100 * p[1] / all) + '%</small></span></div>'+ ).join('') + '</div></div>';grpEl.innerHTML = (data.groups || []).map(g => {const codes = g.signals.map(x => x.code);@@ -502,7 +634,7 @@ async function loadSignals() {'</div>': '') +'</div>' +- '<div class="card" style="padding:4px 0">' + g.signals.map(sigRow).join('') + '</div>' ++ '<div class="card flush">' + g.signals.map(sigRow).join('') + '</div>' +'</div>';}).join('');@@ -1118,7 +1250,8 @@ function emailTag(p) {const status = p.email_status || (p.email_verified ? 'verified' : 'guess');if (!STATUS[status]) return '';const m = statusMeta(status);- return ' <span class="badge t-' + m.tone + '" style="margin-left:6px">' + escHtml(m.label) + '</span>';+ return ' <span class="mini t-' + m.tone + '" title="Email ' + escHtml(m.label.toLowerCase()) + '">' ++ escHtml(m.label) + '</span>';}// Quota gauges for the ACTIVE provider only: Claude's are the numbers@@ -1178,24 +1311,19 @@ async function loadUsage() {};statsEl.innerHTML = card('Today', t.today) + card('Last 7 Days', t.week) + card('Last 30 Days', t.month);- // Daily bars — output tokens per day (the work done)+ // Daily columns — output tokens per day (the work done)const dailyEl = document.getElementById('usage-daily');- const days = data.by_day || [];+ const days = (data.by_day || []).slice(-30);if (days.length) {const maxOut = Math.max(...days.map(d => d.output_tokens || 0), 1);- let dHtml = '<h2>Daily Output Tokens (30 days)</h2>';- for (const d of days.slice(-30)) {- const pct = Math.max(2, (d.output_tokens || 0) / maxOut * 100);- dHtml += '<div style="display:flex;align-items:center;gap:10px;margin-bottom:6px;font-size:12px">' +- '<span class="muted" style="width:78px;flex-shrink:0;font-family:var(--mono)">' + escHtml(d.day || '') + '</span>' +- '<div style="flex:1;background:rgba(255,255,255,0.05);border-radius:99px;height:10px;overflow:hidden">' +- '<div style="width:' + pct + '%;height:100%;border-radius:99px;background:linear-gradient(90deg,var(--accent-deep),var(--accent))"></div>' +- '</div>' +- '<span style="width:130px;text-align:right;font-variant-numeric:tabular-nums">' + fmtTokens(d.output_tokens) + ' out' +- ' <span class="muted">· ' + (d.calls || 0) + ' calls</span></span>' +- '</div>';- }- dailyEl.innerHTML = dHtml;+ dailyEl.innerHTML = '<h2>Output tokens per day <span class="hint muted" style="font-weight:400">last ' ++ days.length + ' days · peak ' + fmtTokens(maxOut) + '</span></h2>' ++ '<div class="chart-cols" role="img" aria-label="Output tokens per day">' + days.map(d =>+ '<span class="col" title="' + escHtml(d.day || '') + ': ' + fmtTokens(d.output_tokens) + ' out, ' ++ (d.calls || 0) + ' calls"><i style="height:' + Math.max(2, (d.output_tokens || 0) / maxOut * 100) + '%"></i></span>'+ ).join('') + '</div>' ++ '<div class="chart-axis"><span>' + escHtml(days[0].day || '') + '</span><span>' ++ escHtml(days[days.length - 1].day || '') + '</span></div>';dailyEl.style.display = 'block';} else {dailyEl.style.display = 'none';@@ -1205,22 +1333,24 @@ async function loadUsage() {const tablesEl = document.getElementById('usage-tables');const table = (title, rows, keyName) => {if (!rows || !rows.length) return '';- let h = '<div class="card"><h2>' + title + '</h2><div class="table-card"><table><thead><tr>' +- '<th>' + keyName + '</th><th>Calls</th><th>Input</th><th>Output</th><th>Cache read</th>' ++ const max = Math.max(...rows.map(r => r.calls || 0), 1);+ let h = '<div class="card flush"><div class="card-head"><h3>' + title + '</h3></div><table><thead><tr>' ++ '<th>' + keyName + '</th><th>Calls</th><th class="num">Input</th><th class="num">Output</th><th class="num">Cache read</th>' +'</tr></thead><tbody>';for (const r of rows) {- h += '<tr><td>' + escHtml(String(r[keyName.toLowerCase()] || '')) + '</td>' +- '<td>' + (r.calls || 0) + '</td>' +- '<td class="muted">' + fmtTokens(r.input_tokens) + '</td>' +- '<td>' + fmtTokens(r.output_tokens) + '</td>' +- '<td class="muted">' + fmtTokens(r.cache_read_tokens) + '</td></tr>';+ h += '<tr><td class="cell-main">' + escHtml(String(r[keyName.toLowerCase()] || '')) + '</td>' ++ '<td><span class="meter-row"><span class="bar" style="width:120px"><span style="width:' ++ (100 * (r.calls || 0) / max) + '%;background:var(--accent)"></span></span><span class="v">' + (r.calls || 0) + '</span></span></td>' ++ '<td class="num muted">' + fmtTokens(r.input_tokens) + '</td>' ++ '<td class="num">' + fmtTokens(r.output_tokens) + '</td>' ++ '<td class="num muted">' + fmtTokens(r.cache_read_tokens) + '</td></tr>';}- return h + '</tbody></table></div></div>';+ return h + '</tbody></table></div>';};const anyRows = (data.by_agent || []).length || (data.by_task || []).length;if (!anyRows) {- tablesEl.innerHTML = emptyState('◐', 'No usage recorded yet',+ tablesEl.innerHTML = emptyState(icon('usage'), 'No usage recorded yet','Once Harvey starts making model calls (Claude or Codex), every one is logged here with exact calls and tokens by provider, agent and task.');} else {const providers = data.by_provider || [];@@ -1274,32 +1404,30 @@ async function loadOutbox() {// The kill switch gets a banner only when it's actually on — a permanent// bar for a thing that isn't happening is just noise.banner.innerHTML = data.paused- ? '<div class="card" style="border-color:var(--red);margin-bottom:16px">' +- '<h2 style="color:var(--red)">⚠ Sending is paused</h2>' +- '<p style="color:var(--text-2);font-size:13px">' + escHtml(data.paused) +- '. Approved mail stays queued until you resume.</p></div>'+ ? '<div class="banner bad">' + icon('alert') + '<div><b>Sending is paused</b>' ++ '<p>' + escHtml(data.paused) + '. Approved mail stays queued until you resume.</p></div></div>': '';if (data.compliance_notice) {banner.innerHTML +=- '<div class="card" style="border-color:var(--s-wait-line);background:var(--s-wait-bg);margin-bottom:16px">' +- '<h2 style="color:var(--s-wait)">Add your postal address</h2>' +- '<p style="color:var(--text-2);font-size:13px">' + escHtml(data.compliance_notice) + '</p></div>';+ '<div class="banner wait">' + icon('alert') + '<div><b>Add your postal address</b>' ++ '<p>' + escHtml(data.compliance_notice) + '</p></div></div>';}desk.innerHTML = pending.length ? renderDesk(pending, _desk.i) :- '<div class="card">' + emptyState('✓', 'Nothing to review',+ '<div class="card">' + emptyState(icon('check'), 'Nothing to review','Every draft Harvey writes lands here first. Approve one and it sends on schedule.') +'</div>';const table = (title, rows, cols) => {if (!rows || !rows.length) return '';- let h = '<div class="card"><h2>' + title + '</h2><div class="table-card"><table><thead><tr>' ++ let h = '<div class="subhead">' + title + ' <span class="hint">' + rows.length + '</span></div>' ++ '<div class="table-card"><table><thead><tr>' +cols.map(c => '<th>' + c[0] + '</th>').join('') + '</tr></thead><tbody>';for (const r of rows) {h += '<tr>' + cols.map(c => '<td' + (c[2] ? ' class="muted"' : '') + '>' +(c[3] ? c[1](r) : escHtml(String(c[1](r) ?? ''))) + '</td>').join('') + '</tr>';}- return h + '</tbody></table></div></div>';+ return h + '</tbody></table></div>';};list.innerHTML =@@ -1358,11 +1486,15 @@ function renderDeskContext(ctx) {function renderDesk(items, i) {const cur = items[i];- const rail = items.map((it, n) =>- '<div class="desk-item ' + (n === i ? 'active' : '') + '" onclick="deskGo(' + n + ')">' +- '<div class="to">' + escHtml(it.to_email) + '</div>' +- '<div class="sub">' + escHtml(it.subject || '(no subject)') + '</div>' +- '</div>').join('');+ const rail = items.map((it, n) => {+ const who = it.context && it.context.contact ? it.context.contact : it.to_email;+ const parts = String(who || '').split(/[\s@.]+/);+ return '<div class="desk-item ' + (n === i ? 'active' : '') + '" onclick="deskGo(' + n + ')">' ++ '<span class="avatar">' + initials(parts[0], parts[1]) + '</span>' ++ '<div class="di-text"><div class="to">' + escHtml(who) + '</div>' ++ '<div class="sub">' + escHtml(it.subject || '(no subject)') + '</div></div>' ++ '</div>';+ }).join('');const editing = _desk.editing === cur.id;const unsaved = (editing && _desk.unsaved) || {subject: cur.subject || '', body: cur.body || ''};@@ -1396,9 +1528,9 @@ function renderDesk(items, i) {return '<div class="desk">' +'<div class="desk-list">' + rail + '</div>' +'<div class="desk-pane">' +- '<div class="to-line">To <b>' + escHtml(cur.to_email) + '</b> · step ' +- cur.step + ' (' + escHtml(cur.kind) + ') · sends ' +- formatDate(cur.send_at) + '</div>' ++ '<div class="to-line">To <b>' + escHtml(cur.to_email) + '</b>' ++ '<span class="tag">' + (cur.kind === 'reply' ? 'Reply' : 'Email ' + escHtml(String(cur.step))) + '</span>' ++ '<span class="muted">sends ' + formatDate(cur.send_at) + '</span></div>' +renderDeskContext(cur.context) +draft + footer +'<div class="desk-actions">' + actions +@@ -1512,23 +1644,30 @@ async function loadCompanies() {if (!data) { el.innerHTML = offlineState(); return; }_companies = data;if (!data.length) {- el.innerHTML = emptyState('⚲', 'No companies yet',+ el.innerHTML = emptyState(icon('companies'), 'No companies yet','Harvey\'s Scout agent hasn\'t researched any companies. Finish <b>Setup</b>, then start Harvey from the <b>Controls</b> tab.');return;}- let html = '<div class="table-card"><table><thead><tr><th>Company</th><th>Domain</th><th>Industry</th><th>Size</th><th>Location</th><th>Contacts</th><th>Source</th><th>Added</th></tr></thead><tbody>';+ let html = '<div class="table-card"><table class="nowrap"><thead><tr><th>Company</th><th>Industry</th>' ++ '<th>Location</th><th>Size</th><th class="num">Contacts</th><th>Source</th><th>Added</th></tr></thead><tbody>';data.forEach((c, i) => {const website = c.website || (c.domain ? 'https://' + c.domain : '');- const nameLink = safeHref(website)- ? '<a href="' + safeHref(website) + '" target="_blank" rel="noopener noreferrer" onclick="event.stopPropagation()">' + escHtml(c.name) + '</a>'- : escHtml(c.name);- html += '<tr style="cursor:pointer" onclick="showCompanyContacts(' + i + ')">' +- '<td>' + nameLink + '</td><td class="muted">' + escHtml(c.domain) + '</td><td>' + escHtml(c.industry) + '</td>' +- '<td>' + escHtml(c.company_size) + '</td><td>' + escHtml(c.location) + '</td>' +- '<td>' + (c.contact_count || 0) + '</td><td class="muted">' + escHtml(c.source) + '</td>' +- '<td class="muted">' + formatDate(c.created_at) + '</td></tr>';+ const domain = safeHref(website)+ ? '<a href="' + safeHref(website) + '" target="_blank" rel="noopener noreferrer" onclick="event.stopPropagation()">' ++ escHtml(c.domain || website.replace(/^https?:\/\//i, '')) + '</a>'+ : escHtml(c.domain);+ html += '<tr class="clickable" onclick="showCompanyContacts(' + i + ')">' ++ '<td><div class="cell-stack"><span class="cell-main">' + escHtml(c.name) + '</span>' ++ '<span class="cell-sub">' + domain + '</span></div></td>' ++ '<td>' + (c.industry ? '<span class="tag">' + escHtml(c.industry) + '</span>' : '') + '</td>' ++ '<td>' + escHtml(c.location) + '</td>' ++ '<td class="muted">' + escHtml(c.company_size) + '</td>' ++ '<td class="num">' + (c.contact_count || 0) + '</td>' ++ '<td class="muted">' + sourceLabel(c.source) + '</td>' ++ '<td class="muted">' + relTime(c.created_at) + '</td></tr>';});- el.innerHTML = html + '</tbody></table></div>';+ el.innerHTML = html + '</tbody></table></div>' ++ '<div class="table-foot">' + data.length + ' compan' + (data.length === 1 ? 'y' : 'ies') + '</div>';}async function showCompanyContacts(index) {@@ -1537,22 +1676,25 @@ async function showCompanyContacts(index) {companyDrill = true;const el = document.getElementById('companies-list');const data = await api('/api/companies/' + encodeURIComponent(company.id) + '/contacts');- let html = '<div class="card"><h2>' + escHtml(company.name) + ' — Contacts</h2>' +- '<button class="btn btn-secondary btn-sm" onclick="loadCompanies()" style="margin-bottom:16px">← Back to Companies</button>';+ let html = '<button class="btn btn-ghost btn-sm" onclick="loadCompanies()" style="margin-bottom:12px">' ++ '← All companies</button>' ++ '<div class="card flush"><div class="card-head"><h3>' + escHtml(company.name) + '</h3>' ++ '<span class="meta">' + escHtml([company.industry, company.location].filter(Boolean).join(' · ')) + '</span></div>';if (!data || !data.length) {- html += '<p style="color:var(--text-3);font-size:13px">No contacts found at this company yet.</p></div>';+ html += '<div class="empty"><div class="copy">No contacts found at this company yet.</div></div></div>';} else {- html += '<div class="table-card"><table><thead><tr><th>Name</th><th>Title</th><th>Email</th><th>Phone</th><th>LinkedIn</th><th>Status</th><th>Source</th></tr></thead><tbody>';+ html += '<table><thead><tr><th>Name</th><th>Email</th><th>Phone</th><th>LinkedIn</th><th>Status</th><th>Source</th></tr></thead><tbody>';for (const p of data) {- const emailIcon = emailTag(p);- const phoneIcon = p.phone_verified ? ' <span class="verified">✓</span>' : '';- html += '<tr><td>' + escHtml(p.first_name) + ' ' + escHtml(p.last_name) + '</td>' +- '<td>' + escHtml(p.title) + '</td><td>' + escHtml(p.email) + emailIcon + '</td>' ++ const phoneIcon = p.phone_verified ? ' <span class="muted">✓</span>' : '';+ html += '<tr><td><div class="cell-row"><span class="avatar">' + initials(p.first_name, p.last_name) + '</span>' ++ '<div class="cell-stack"><span class="cell-main">' + escHtml(p.first_name) + ' ' + escHtml(p.last_name) + '</span>' ++ '<span class="cell-sub">' + escHtml(p.title) + '</span></div></div></td>' ++ '<td>' + escHtml(p.email) + emailTag(p) + '</td>' +'<td>' + escHtml(p.phone) + phoneIcon + '</td>' +'<td>' + (safeHref(p.linkedin_url) ? '<a href="' + safeHref(p.linkedin_url) + '" target="_blank" rel="noopener noreferrer">Profile</a>' : '') + '</td>' +- '<td>' + badge(p.status) + '</td><td class="muted">' + escHtml(p.source) + '</td></tr>';+ '<td>' + badge(p.status) + '</td><td class="muted">' + sourceLabel(p.source) + '</td></tr>';}- html += '</tbody></table></div></div>';+ html += '</tbody></table></div>';}el.innerHTML = html;}@@ -1578,27 +1720,84 @@ function fbCampaign(i) {if (c) submitFeedback('campaign', c.id, 'Leave feedback on this campaign:');}+// Search and status filter live outside the table, so the 15-second refresh+// re-renders rows without losing what you typed.+let _contactQuery = '', _contactFilter = 'all';+const CONTACT_FILTERS = [+ ['all', 'All', null],+ ['todo', 'To write', ['new', 'queued']],+ ['contacted', 'Contacted', ['contacted']],+ ['replied', 'Replied', ['replied', 'interested', 'meeting']],+ ['closed', 'Closed out', null],+];+async function loadProspects() {const el = document.getElementById('prospects-table');const data = await api('/api/prospects');if (!data) { el.innerHTML = offlineState(); return; }_prospects = data;if (!data.length) {- el.innerHTML = emptyState('◉', 'No contacts yet',+ el.innerHTML = emptyState(icon('contacts'), 'No contacts yet','Harvey hasn\'t found any prospects. Once it\'s running, the Scout agent searches the web for people matching your ideal customer profile in <b>harvey.yaml</b>.');return;}- let html = '<div class="table-card"><table><thead><tr><th>Name</th><th>Title</th><th>Company</th><th>Email</th><th>Phone</th><th>Status</th><th>Source</th><th>Added</th><th></th></tr></thead><tbody>';- data.forEach((p, i) => {- const emailV = p.email ? (escHtml(p.email) + emailTag(p)) : '';- const phoneV = p.phone ? (escHtml(p.phone) + (p.phone_verified ? ' <span class="verified">✓</span>' : '')) : '';- html += '<tr><td>' + escHtml(p.first_name) + ' ' + escHtml(p.last_name) + '</td>' +- '<td>' + escHtml(p.title) + '</td><td>' + escHtml(p.company) + '</td>' +- '<td>' + emailV + '</td><td>' + phoneV + '</td><td>' + badge(p.status) + '</td>' +- '<td class="muted">' + escHtml(p.source) + '</td><td class="muted">' + formatDate(p.created_at) + '</td>' +- '<td><button class="btn btn-secondary btn-sm" onclick="fbProspect(' + i + ')">Feedback</button></td></tr>';- });- el.innerHTML = html + '</tbody></table></div>';+ if (!document.getElementById('contact-rows')) {+ el.innerHTML = '<div class="toolbar">' ++ '<label class="search">' + icon('discover') ++ '<input class="form-input" id="contact-search" type="search" placeholder="Search name, company, email" ' ++ 'aria-label="Search contacts" oninput="_contactQuery=this.value;renderContacts()"></label>' ++ '<div class="segmented" id="contact-filters" role="group" aria-label="Filter by status"></div>' ++ '</div><div id="contact-rows"></div>';+ }+ renderContacts();+}++function contactMatches(p, f) {+ const known = ['new', 'queued', 'contacted', 'replied', 'interested', 'meeting'];+ if (f === 'all') return true;+ if (f === 'closed') return !known.includes(p.status);+ const hit = CONTACT_FILTERS.find(x => x[0] === f);+ return !!(hit && hit[2] && hit[2].includes(p.status));+}++function setContactFilter(f) { _contactFilter = f; renderContacts(); }++function renderContacts() {+ const rowsEl = document.getElementById('contact-rows');+ const filtersEl = document.getElementById('contact-filters');+ if (!rowsEl) return;+ filtersEl.innerHTML = CONTACT_FILTERS.map(f =>+ '<button class="' + (f[0] === _contactFilter ? 'on' : '') + '" onclick="setContactFilter(\'' + f[0] + '\')">' ++ f[1] + ' <span class="n">' + _prospects.filter(p => contactMatches(p, f[0])).length + '</span></button>'+ ).join('');++ const q = _contactQuery.trim().toLowerCase();+ const rows = _prospects.map((p, i) => [p, i]).filter(([p]) => contactMatches(p, _contactFilter) &&+ (!q || [p.first_name, p.last_name, p.company, p.email, p.title].join(' ').toLowerCase().includes(q)));+ if (!rows.length) {+ rowsEl.innerHTML = '<div class="table-card">' + emptyState(icon('discover'), 'No matches',+ 'Nothing matches that search and filter.') + '</div>';+ return;+ }+ let html = '<div class="table-card"><table class="nowrap"><thead><tr><th>Name</th><th>Company</th><th>Email</th>' ++ '<th>Score</th><th>Status</th><th>Source</th><th>Added</th><th></th></tr></thead><tbody>';+ for (const [p, i] of rows) {+ html += '<tr><td><div class="cell-row"><span class="avatar">' + initials(p.first_name, p.last_name) + '</span>' ++ '<div class="cell-stack"><span class="cell-main">' + escHtml(p.first_name) + ' ' + escHtml(p.last_name) + '</span>' ++ '<span class="cell-sub">' + escHtml(p.title) + '</span></div></div></td>' ++ '<td>' + escHtml(p.company) + '</td>' ++ '<td><div class="cell-stack"><span>' + escHtml(p.email) + '</span>' ++ '<span class="cell-sub">' + emailTag(p) + (p.phone ? ' · ' + escHtml(p.phone) : '') + '</span>' ++ '</div></td>' ++ '<td>' + (p.score || p.score === 0 ? meterHtml(p.score) : '') + '</td>' ++ '<td>' + badge(p.status) + '</td>' ++ '<td class="muted">' + sourceLabel(p.source) + '</td>' ++ '<td class="muted" style="white-space:nowrap">' + relTime(p.created_at) + '</td>' ++ '<td><button class="btn btn-ghost btn-sm row-action" onclick="fbProspect(' + i + ')" ' ++ 'title="Leave feedback on this contact">Feedback</button></td></tr>';+ }+ rowsEl.innerHTML = html + '</tbody></table></div>' ++ '<div class="table-foot">' + rows.length + ' of ' + _prospects.length + ' contacts</div>';}// Opens a filled-in compose window in whatever Gmail account the browser is@@ -1677,13 +1876,33 @@ async function markSent(ci, ri, sent) {return ok && sent === !!res.sent && !res.status && !res.already;}+// Where a campaign's people stand, as one stacked bar.+function campaignProgress(c) {+ const rs = c.recipients || [];+ if (!rs.length) return '';+ const count = st => rs.filter(r => st.includes(r.status)).length;+ const parts = [+ ['Contacted', count(['contacted']), 'c-accent'],+ ['Replied', count(['replied']), 'c-active'],+ ['Interested', count(['interested', 'meeting']), 'c-good'],+ ['Waiting', count(['new', 'queued']), 'c-accent-soft'],+ ];+ const closed = rs.length - parts.reduce((x, p) => x + p[1], 0);+ if (closed > 0) parts.push(['Closed out', closed, 'c-idle']);+ return '<div class="campaign-progress"><div class="bar" role="img" aria-label="Where this campaign\'s people stand">' ++ parts.filter(p => p[1]).map(p => '<span class="' + p[2] + '" style="width:' + (100 * p[1] / rs.length) ++ '%" title="' + p[0] + ': ' + p[1] + '"></span>').join('') + '</div>' ++ '<div class="campaign-legend">' + parts.filter(p => p[1]).map(p =>+ '<span><i class="' + p[2] + '"></i>' + p[0] + ' <b>' + p[1] + '</b></span>').join('') + '</div></div>';+}+async function loadCampaigns() {const el = document.getElementById('campaigns-list');const data = await api('/api/campaigns');if (!data) { el.innerHTML = offlineState(); return; }_campaigns = data;if (!data.length) {- el.innerHTML = emptyState('✉', 'No campaigns yet',+ el.innerHTML = emptyState(icon('campaigns'), 'No campaigns yet','The Writer agent hasn\'t drafted any sequences. It kicks in automatically once Harvey has scored prospects to write for.');return;}@@ -1698,10 +1917,11 @@ async function loadCampaigns() {const tick = '<label style="display:inline-flex;align-items:center;gap:4px;font-size:13px;cursor:pointer">' +'<input type="checkbox" checked onchange="markSent(' + i + ',' + ri + ',this.checked)"> ' +'✓ Sent by you</label>';- if (s === 0) return escHtml(r.email) + ' ' + tick;+ if (s === 0) return '<span class="rcpt-who">' + escHtml(r.email) + '</span>' + tick;// Follow-ups are the user's too: Harvey never emails someone they emailed.- return '<button class="btn btn-secondary btn-sm" onclick="openInGmail(' + i + ',' + s + ',' + ri + ')">' +- 'Open in Gmail → ' + escHtml(r.email) + '</button>' ++ return '<span class="rcpt-who">' + escHtml(r.email) + '</span>' ++ '<button class="btn btn-secondary btn-sm" onclick="openInGmail(' + i + ',' + s + ',' + ri + ')">' ++ 'Open in Gmail</button>' +'<span class="muted" style="font-size:12px">Harvey won\'t send follow-ups to people you emailed yourself.</span>';}if (s !== 0) return '';@@ -1714,25 +1934,29 @@ async function loadCampaigns() {: '';}const risky = r.email_status === 'risky'- ? ' <span class="muted" style="font-size:12px">(catch-all address, may bounce)</span>' : '';- return '<button class="btn btn-primary btn-sm" onclick="openInGmail(' + i + ',' + s + ',' + ri + ')">' +- 'Open in Gmail → ' + escHtml(r.email) + '</button>' + risky +- '<label style="display:inline-flex;align-items:center;gap:4px;font-size:13px;cursor:pointer">' +- '<input type="checkbox" onchange="markSent(' + i + ',' + ri + ',this.checked)"> Mark as sent</label>'- }).filter(Boolean).join(' ');- stepsHtml += '<div class="email-step"><div class="step-num">Email ' + escHtml(String(step.step || '?')) +- (step.delay_days ? ' · send after ' + escHtml(String(step.delay_days)) + ' days' : '') + '</div>' ++ ? ' <span class="mini t-waiting" title="Catch-all address: it may bounce">Catch-all</span>' : '';+ return '<span class="rcpt-who">' + escHtml(r.email) + risky + '</span>' ++ '<button class="btn btn-secondary btn-sm" onclick="openInGmail(' + i + ',' + s + ',' + ri + ')">' ++ 'Open in Gmail</button>' ++ '<label><input type="checkbox" onchange="markSent(' + i + ',' + ri + ',this.checked)"> Mark as sent</label>'+ }).filter(Boolean).map(x => '<div class="rcpt">' + x + '</div>').join('');+ stepsHtml += '<div class="email-step"><span class="step-dot">' + escHtml(String(step.step || '?')) + '</span>' ++ '<div><div class="step-num">' + (s === 0 ? 'First email' : 'Follow-up') ++ (step.delay_days ? ' · ' + escHtml(String(step.delay_days)) + ' days after the last' : '') + '</div>' +'<div class="subject">' + escHtml(step.subject) + '</div>' +'<div class="body">' + escHtml(step.body) + '</div>' +- (sendBtns ? '<div style="margin-top:8px;display:flex;gap:6px;flex-wrap:wrap">' + sendBtns + '</div>' : '') +- '</div>';+ (sendBtns ? '<div class="step-actions">' + sendBtns + '</div>' : '') ++ '</div></div>';});const pc = (c.prospect_ids || []).length;- html += '<div class="campaign-card"><h3>' + escHtml(c.name || 'Untitled Campaign') + '</h3>' +- '<div class="meta">' + badge(c.status) + '<span>' + escHtml(c.channel || 'email') + '</span>' +- '<span>' + pc + ' prospect' + (pc !== 1 ? 's' : '') + '</span><span>' + formatDate(c.created_at) + '</span>' +- '<button class="btn btn-secondary btn-sm" onclick="fbCampaign(' + i + ')">Feedback</button></div>' +- (stepsHtml || '<p style="color:var(--text-3);font-size:13px">No email steps in this campaign.</p>') + '</div>';+ html += '<div class="campaign-card"><div class="campaign-top">' ++ '<div class="campaign-title"><h3>' + escHtml(c.name || 'Untitled Campaign') + '</h3>' ++ '<button class="btn btn-ghost btn-sm" onclick="fbCampaign(' + i + ')">Feedback</button></div>' ++ '<div class="meta">' + badge(c.status) + '<span>' + pc + ' prospect' + (pc !== 1 ? 's' : '') + '</span>' ++ '<span>' + (c.sequence || []).length + ' emails</span><span>Created ' + relTime(c.created_at) + '</span></div>' ++ campaignProgress(c) + '</div>' ++ '<div class="sequence">' ++ (stepsHtml || '<p class="muted" style="font-size:13px;padding-top:16px">No email steps in this campaign.</p>') + '</div></div>';});el.innerHTML = html;}@@ -1742,7 +1966,7 @@ async function loadConversations() {const data = await api('/api/conversations');if (!data) { el.innerHTML = offlineState(); return; }if (!data.length) {- el.innerHTML = emptyState('☉', 'No conversations yet',+ el.innerHTML = emptyState(icon('conversations'), 'No conversations yet','No prospects have replied so far. When they do, the Handler agent classifies each reply and responds — every thread shows up here.');return;}@@ -1751,15 +1975,18 @@ async function loadConversations() {let threadHtml = '';for (const msg of (c.thread || [])) {const cls = msg.sender === 'harvey' ? 'sent' : 'received';- threadHtml += '<div class="thread-msg ' + cls + '"><div class="sender">' + escHtml(msg.sender) +- ' · ' + formatDate(msg.timestamp) + '</div>' + escHtml(msg.content) + '</div>';+ threadHtml += '<div class="thread-msg ' + cls + '"><div class="sender">' ++ (cls === 'sent' ? 'Harvey' : escHtml(c.first_name || msg.sender)) ++ ' · ' + relTime(msg.timestamp) + '</div>' + escHtml(msg.content) + '</div>';}const name = [c.first_name, c.last_name].filter(Boolean).join(' ') || 'Unknown';- html += '<div class="convo-card"><h3>' + escHtml(name) +- (c.company ? ' <span style="color:var(--text-3);font-weight:500">— ' + escHtml(c.company) + '</span>' : '') + '</h3>' +- '<div class="meta">' + badge(c.status) + (c.intent ? badge(c.intent) : '') +- '<span>' + escHtml(c.prospect_email || '') + '</span><span>' + formatDate(c.updated_at) + '</span></div>' +- (threadHtml || '<p style="color:var(--text-3);font-size:13px">No messages in this thread yet.</p>') + '</div>';+ html += '<div class="convo-card"><div class="convo-head">' ++ '<span class="avatar">' + initials(c.first_name, c.last_name) + '</span>' ++ '<div><h3>' + escHtml(name) + '</h3><div class="sub">' ++ escHtml([c.company, c.prospect_email].filter(Boolean).join(' · ')) + ' · ' + relTime(c.updated_at) + '</div></div>' ++ '<div class="tags">' + (c.intent ? badge(c.intent) : '') + badge(c.status) + '</div></div>' ++ '<div class="thread">' + (threadHtml || '<p class="muted" style="font-size:13px">No messages in this thread yet.</p>') ++ '</div></div>';}el.innerHTML = html;}@@ -1769,22 +1996,28 @@ async function loadActivity() {const data = await api('/api/activity');if (!data) { el.innerHTML = offlineState(); return; }if (!data.length) {- el.innerHTML = emptyState('⏲', 'No activity yet',+ el.innerHTML = emptyState(icon('activity'), 'No activity yet','Harvey hasn\'t taken any actions. Every prospect found, email written, and reply handled will appear here the moment it happens.');return;}- let html = '<div class="activity-feed">';+ let html = '<div class="card"><div class="timeline">';+ let day = '';for (const a of data) {- html += '<div class="activity-item"><span class="time">' + formatDate(a.created_at) + '</span>' +- '<span class="agent">' + escHtml(a.agent) + '</span>' +- '<span class="action">' + escHtml(a.action_type) + '</span></div>';+ const label = dayLabel(a.created_at);+ if (label !== day) { day = label; html += '<div class="tl-day">' + escHtml(label) + '</div>'; }+ html += '<div class="tl-item"><span class="tl-time">' + timeOfDay(a.created_at) + '</span>' ++ '<span class="tl-icon">' + icon(AGENT_ICONS[a.agent] || 'activity') + '</span>' ++ '<span class="tl-text">' + actionText(a) + '</span>' ++ '<span class="tl-agent">' + escHtml(a.agent) + '</span></div>';}- el.innerHTML = html + '</div>';+ el.innerHTML = html + '</div></div>';}// ── Init & live refresh ──loadToday();+loadTrend();+loadFunnel();loadSetupStatus();loadRuns();loadTodayActivity();@@ -1816,7 +2049,7 @@ setInterval(async () => {setInterval(() => {if (document.hidden || _locked) return;switch (currentTab) {- case 'today': loadToday(); loadRuns(); loadTodayActivity(); break;+ case 'today': loadToday(); loadTrend(); loadFunnel(); loadRuns(); loadTodayActivity(); break;case 'companies': if (!companyDrill) loadCompanies(); break;case 'prospects': loadProspects(); break;case 'campaigns': loadCampaigns(); break;diff --git a/harvey/web/index.html b/harvey/web/index.htmlindex 8dc67bf..4698515 100644--- a/harvey/web/index.html+++ b/harvey/web/index.html@@ -11,17 +11,45 @@</head><body>+<!-- One icon set: 24px grid, 1.75 stroke, currentColor. -->+<svg width="0" height="0" style="position:absolute" aria-hidden="true">+ <defs>+ <symbol id="i-today" viewBox="0 0 24 24"><path d="M3 10.5 12 3l9 7.5"/><path d="M5.5 9v11h13V9"/><path d="M10 20v-5h4v5"/></symbol>+ <symbol id="i-signals" viewBox="0 0 24 24"><circle cx="12" cy="12" r="2"/><path d="M16.2 7.8a6 6 0 0 1 0 8.4M7.8 16.2a6 6 0 0 1 0-8.4M19.1 4.9a10 10 0 0 1 0 14.2M4.9 19.1a10 10 0 0 1 0-14.2"/></symbol>+ <symbol id="i-discover" viewBox="0 0 24 24"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></symbol>+ <symbol id="i-companies" viewBox="0 0 24 24"><rect x="4" y="3" width="16" height="18" rx="2"/><path d="M9 7.5h.01M15 7.5h.01M9 11.5h.01M15 11.5h.01M9 15.5h.01M15 15.5h.01"/></symbol>+ <symbol id="i-contacts" viewBox="0 0 24 24"><circle cx="9" cy="8" r="3.5"/><path d="M2.5 20a6.5 6.5 0 0 1 13 0"/><path d="M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14.2a6.5 6.5 0 0 1 3.5 5.8"/></symbol>+ <symbol id="i-campaigns" viewBox="0 0 24 24"><path d="M21 3 10 14"/><path d="M21 3 14.5 21l-4.5-7-7-4.5z"/></symbol>+ <symbol id="i-outbox" viewBox="0 0 24 24"><path d="M3 13h5l1.5 3h5l1.5-3h5"/><path d="M5.5 5h13L21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6z"/></symbol>+ <symbol id="i-conversations" viewBox="0 0 24 24"><path d="M20 15a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2h13a2 2 0 0 1 2 2z"/></symbol>+ <symbol id="i-activity" viewBox="0 0 24 24"><path d="M3 12h4l3-8 4 16 3-8h4"/></symbol>+ <symbol id="i-usage" viewBox="0 0 24 24"><path d="M5 20v-8M12 20V5M19 20v-5"/></symbol>+ <symbol id="i-settings" viewBox="0 0 24 24"><path d="M4 6h9M17 6h3M4 12h3M11 12h9M4 18h11M19 18h1"/><circle cx="15" cy="6" r="2"/><circle cx="9" cy="12" r="2"/><circle cx="17" cy="18" r="2"/></symbol>+ <symbol id="i-controls" viewBox="0 0 24 24"><path d="M12 3v9"/><path d="M18.4 6.6a9 9 0 1 1-12.8 0"/></symbol>+ <symbol id="i-help" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M9.5 9.5a2.5 2.5 0 0 1 4.9.7c0 1.7-2.4 2.2-2.4 3.8"/><path d="M12 17h.01"/></symbol>+ <symbol id="i-check" viewBox="0 0 24 24"><path d="m5 12.5 4.5 4.5L19 7.5"/></symbol>+ <symbol id="i-alert" viewBox="0 0 24 24"><path d="M12 9v4M12 17h.01"/><path d="M10.3 3.9 2.4 17.5A2 2 0 0 0 4.1 20.5h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/></symbol>+ <symbol id="i-arrow" viewBox="0 0 24 24"><path d="M5 12h14M13 6l6 6-6 6"/></symbol>+ <symbol id="i-refresh" viewBox="0 0 24 24"><path d="M20 11a8 8 0 0 0-14.6-4.5L4 8M4 4v4h4"/><path d="M4 13a8 8 0 0 0 14.6 4.5L20 16M20 20v-4h-4"/></symbol>+ <symbol id="i-sun" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></symbol>+ <symbol id="i-message" viewBox="0 0 24 24"><path d="M4 4h16v12H8l-4 4z"/><path d="M8 9h8M8 12h5"/></symbol>+ <symbol id="i-sparkle" viewBox="0 0 24 24"><path d="M12 3v4M12 17v4M3 12h4M17 12h4M6.3 6.3l2.5 2.5M15.2 15.2l2.5 2.5M6.3 17.7l2.5-2.5M15.2 8.8l2.5-2.5"/></symbol>+ <symbol id="i-pen" viewBox="0 0 24 24"><path d="M4 20h4L19 9l-4-4L4 16z"/><path d="m13.5 6.5 4 4"/></symbol>+ <symbol id="i-download" viewBox="0 0 24 24"><path d="M12 4v11M7 10l5 5 5-5M5 20h14"/></symbol>+ <symbol id="i-flag" viewBox="0 0 24 24"><path d="M5 21V4M5 4h11l-2 4 2 4H5"/></symbol>+ </defs>+</svg>+<!-- Shown whenever the API refuses this tab (no token, a wrong one, or none on the server). --><div id="lock-screen"- style="display:none;position:fixed;inset:0;z-index:1000;background:var(--bg);align-items:center;justify-content:center;padding:24px">- <div class="card" style="max-width:520px;width:100%">+ style="display:none;position:fixed;inset:0;z-index:1000;align-items:center;justify-content:center;padding:24px">+ <div class="card" style="max-width:500px;width:100%"><h2>Dashboard locked</h2><p class="lede" id="lock-reason" role="alert"></p>- <p class="lede">Open the link that <span style="font-family:var(--mono);font-size:12px">harvey dashboard</span>- printed in your terminal, or run <span style="font-family:var(--mono);font-size:12px">harvey dashboard --url</span>- to print it again. You can also paste the token from- <span style="font-family:var(--mono);font-size:12px">data/dashboard-token</span>:</p>- <form onsubmit="unlockWithToken(event)" class="form-row" style="align-items:flex-end">+ <p class="lede">Open the link that <code>harvey dashboard</code> printed in your terminal,+ or run <code>harvey dashboard --url</code> to print it again. You can also paste the+ token from <code>data/dashboard-token</code>:</p>+ <form onsubmit="unlockWithToken(event)" class="form-row"><div class="form-group" style="margin-bottom:0"><label class="form-label" for="lock-token">Dashboard token</label><input type="password" class="form-input" id="lock-token" autocomplete="off" spellcheck="false">@@ -31,7 +59,9 @@</div></div>-<header>+<div class="app">++<aside class="sidebar"><div class="brand"><div class="mark">H</div><div>@@ -39,59 +69,78 @@<div class="tagline">Always Be Closing</div></div></div>- <div class="header-controls">++ <nav aria-label="Sections">+ <div class="nav-group">+ <div class="nav-label">Work</div>+ <button class="active" onclick="showTab('today', this)"><svg class="icon"><use href="#i-today"/></svg><span class="label">Today</span><span class="nav-count" id="nav-today"></span></button>+ <button onclick="showTab('outbox', this)"><svg class="icon"><use href="#i-outbox"/></svg><span class="label">Outbox</span><span class="nav-count" id="nav-outbox"></span></button>+ <button onclick="showTab('conversations', this)"><svg class="icon"><use href="#i-conversations"/></svg><span class="label">Conversations</span></button>+ </div>+ <div class="nav-group">+ <div class="nav-label">Pipeline</div>+ <button onclick="showTab('signals', this)"><svg class="icon"><use href="#i-signals"/></svg><span class="label">Signals</span><span class="nav-count" id="nav-signals"></span></button>+ <button onclick="showTab('discover', this)"><svg class="icon"><use href="#i-discover"/></svg><span class="label">Discover</span></button>+ <button onclick="showTab('companies', this)"><svg class="icon"><use href="#i-companies"/></svg><span class="label">Companies</span></button>+ <button onclick="showTab('prospects', this)"><svg class="icon"><use href="#i-contacts"/></svg><span class="label">Contacts</span></button>+ <button onclick="showTab('campaigns', this)"><svg class="icon"><use href="#i-campaigns"/></svg><span class="label">Campaigns</span></button>+ </div>+ <div class="nav-group">+ <div class="nav-label">System</div>+ <button onclick="showTab('activity', this)"><svg class="icon"><use href="#i-activity"/></svg><span class="label">Activity</span></button>+ <button onclick="showTab('usage', this)"><svg class="icon"><use href="#i-usage"/></svg><span class="label">Usage</span></button>+ <button onclick="showTab('controls', this)"><svg class="icon"><use href="#i-controls"/></svg><span class="label">Controls</span></button>+ <button onclick="showTab('settings', this)"><svg class="icon"><use href="#i-settings"/></svg><span class="label">Settings</span></button>+ <button onclick="showTab('help', this)"><svg class="icon"><use href="#i-help"/></svg><span class="label">Help</span></button>+ </div>+ </nav>++ <div class="sidebar-foot"><div class="harvey-status" id="header-status"><span class="status-dot stopped" id="header-dot"></span><span id="header-status-text">Checking…</span></div>- <button class="icon-btn" id="theme-btn" onclick="cycleTheme()"- title="Appearance: follows your system until you pick one">auto</button>- <button class="refresh-btn" onclick="loadCurrentTab()">Refresh</button>+ <div class="foot-actions">+ <button class="icon-btn" id="theme-btn" onclick="cycleTheme()"+ title="Appearance: follows your system until you pick one">auto</button>+ <button class="refresh-btn" onclick="loadCurrentTab()" title="Refresh this page">+ <svg class="icon" style="width:13px;height:13px"><use href="#i-refresh"/></svg>Refresh</button>+ </div></div>-</header>--<nav>- <button class="active" onclick="showTab('today', this)">Today<span class="nav-count" id="nav-today"></span></button>- <button onclick="showTab('signals', this)">Signals<span class="nav-count" id="nav-signals"></span></button>- <button onclick="showTab('discover', this)">Discover</button>- <button onclick="showTab('companies', this)">Companies</button>- <button onclick="showTab('prospects', this)">Contacts</button>- <button onclick="showTab('campaigns', this)">Campaigns</button>- <button onclick="showTab('outbox', this)">Outbox<span class="nav-count" id="nav-outbox"></span></button>- <button onclick="showTab('conversations', this)">Conversations</button>- <button onclick="showTab('activity', this)">Activity</button>- <button onclick="showTab('usage', this)">Usage</button>- <button onclick="showTab('settings', this)">Settings</button>- <button onclick="showTab('controls', this)">Controls</button>- <button onclick="showTab('help', this)">Help</button>-</nav>--<main>+</aside>++<main class="content">+<div class="content-inner"><!-- Today: what needs a human --><div id="today" class="section active"><div class="section-head">- <h2>Today</h2>- <p>Anything waiting on you, then everything Harvey has built so far.</p>+ <div>+ <h2>Today</h2>+ <p>What's waiting on you, and how the pipeline is moving.</p>+ </div></div>- <div class="today-grid">- <div class="today-main">- <div id="live-status" style="margin-bottom:28px"></div>++ <div id="today-kpis"></div>++ <div class="grid-main">+ <div>+ <div class="subhead">Needs you</div><div id="today-queue"></div>- <div class="rail-block" style="margin-top:34px">- <div class="subhead">Recent activity</div>- <div id="today-activity"></div>- </div>++ <div class="subhead">Pipeline right now</div>+ <div class="card" id="live-status"></div>++ <div class="subhead">Recent activity <span class="hint"><a href="#" onclick="goTab('activity');return false">See all</a></span></div>+ <div class="card" id="today-activity"></div></div>- <aside class="today-rail">- <div class="rail-block">- <div class="subhead">Pipeline</div>- <div id="today-figures"></div>- </div>- <div class="rail-block" id="today-runs-block">+ <aside>+ <div class="subhead">Contacts by stage</div>+ <div class="card" id="today-figures"></div>+ <div id="today-runs-block"><div class="subhead">Collector runs</div>- <div id="today-runs"></div>+ <div class="card" id="today-runs" style="padding-top:8px;padding-bottom:8px"></div></div><div id="today-setup"></div></aside>@@ -101,9 +150,11 @@<!-- Signals: the confirmation gate --><div id="signals" class="section"><div class="section-head">- <h2>Signals</h2>- <p>Harvey proposes what it knows how to look for. You decide what actually- defines a good prospect — nothing is collected until you confirm it.</p>+ <div>+ <h2>Signals</h2>+ <p>Harvey proposes what it knows how to look for. You decide what actually+ defines a good prospect — nothing is collected until you confirm it.</p>+ </div></div><div id="signals-summary"></div><div id="signals-groups"></div>@@ -121,29 +172,32 @@<!-- Discover: the only stage that spends money --><div id="discover" class="section"><div class="section-head">- <h2>Discover</h2>- <p>Find businesses matching your ICP. Pick a source, see what it will cost,- then run it — nothing is called until you press the button.</p>+ <div>+ <h2>Discover</h2>+ <p>Find businesses matching your ICP. Pick a source, see what it will cost,+ then run it — nothing is called until you press the button.</p>+ </div></div>+ <div class="subhead">Source</div><div id="discover-providers"></div><div class="subhead">Run</div><div class="card">- <div class="form-row" style="margin-bottom:14px">+ <div class="form-row" style="margin-bottom:4px"><div class="form-group" style="flex:2">- <label class="form-label">Cities</label>- <input class="form-input" id="disc-cities" placeholder="from your ICP — or override, one per line">+ <label class="form-label" for="disc-cities">Cities</label>+ <input class="form-input" id="disc-cities" placeholder="From your ICP, or override: Denver, CO; Boulder, CO"></div><div class="form-group">- <label class="form-label">Results per query</label>+ <label class="form-label" for="disc-limit">Results per query</label><input class="form-input" id="disc-limit" type="number" value="100" min="1" max="1000"></div><div class="form-group">- <label class="form-label">Search depth</label>+ <label class="form-label" for="disc-depth">Search depth</label><input class="form-input" id="disc-depth" type="number" value="30" min="10" max="100" step="10"></div><div class="form-group">- <label class="form-label">Spend cap ($)</label>+ <label class="form-label" for="disc-cap">Spend cap ($)</label><input class="form-input" id="disc-cap" type="number" value="1.00" min="0" step="0.25"></div></div>@@ -161,17 +215,17 @@<!-- Companies --><div id="companies" class="section">- <div class="section-head"><h2>Companies</h2><p>Organizations Harvey has researched. Click a row to see its contacts.</p></div>+ <div class="section-head"><div><h2>Companies</h2><p>Organizations Harvey has researched. Click a row to see its contacts.</p></div></div><div id="companies-list"></div></div><!-- Contacts --><div id="prospects" class="section">- <div class="section-head" style="display:flex;align-items:flex-end;justify-content:space-between;gap:16px">- <div><h2>Contacts</h2><p>People Harvey has found and verified.</p></div>- <div style="display:flex;gap:8px;flex-shrink:0">- <button class="btn btn-secondary btn-sm" onclick="downloadCsv('/api/export/prospects.csv', 'prospects.csv', this)">Export deliverable CSV</button>- <button class="btn btn-secondary btn-sm" onclick="downloadCsv('/api/export/prospects.csv?all=true', 'prospects-all.csv', this)">Export all</button>+ <div class="section-head">+ <div><h2>Contacts</h2><p>People Harvey has found, how sure it is of their address, and where each one stands.</p></div>+ <div class="page-actions">+ <button class="btn btn-secondary btn-sm" onclick="downloadCsv('/api/export/prospects.csv', 'prospects.csv', this)"><svg class="icon"><use href="#i-download"/></svg>Export deliverable</button>+ <button class="btn btn-ghost btn-sm" onclick="downloadCsv('/api/export/prospects.csv?all=true', 'prospects-all.csv', this)">Export all</button></div></div><div id="prospects-table"></div>@@ -179,19 +233,19 @@<!-- Campaigns --><div id="campaigns" class="section">- <div class="section-head"><h2>Campaigns</h2><p>Email sequences Harvey has written and deployed.</p></div>+ <div class="section-head"><div><h2>Campaigns</h2><p>Email sequences Harvey has written, and how far each one has got.</p></div></div><div id="campaigns-list"></div></div><!-- Outbox: the decisions desk --><div id="outbox" class="section">- <div class="section-head" style="display:flex;align-items:flex-end;justify-content:space-between;gap:16px">+ <div class="section-head"><div><h2>Outbox</h2><p>Every outgoing email stops here. Read one, decide, move on —- <kbd>A</kbd> approve, <kbd>R</kbd> reject, <kbd>J</kbd>/<kbd>K</kbd> to move.</p>+ <kbd>A</kbd> approve, <kbd>R</kbd> reject, <kbd>E</kbd> edit, <kbd>J</kbd>/<kbd>K</kbd> to move.</p></div>- <div style="display:flex;gap:8px;flex-shrink:0" id="outbox-actions"></div>+ <div class="page-actions" id="outbox-actions"></div></div><div id="outbox-banner"></div><div id="outbox-desk"></div>@@ -200,19 +254,19 @@<!-- Conversations --><div id="conversations" class="section">- <div class="section-head"><h2>Conversations</h2><p>Every reply, and how Harvey handled it.</p></div>+ <div class="section-head"><div><h2>Conversations</h2><p>Every reply, and how Harvey handled it.</p></div></div><div id="conversations-list"></div></div><!-- Activity --><div id="activity" class="section">- <div class="section-head"><h2>Activity</h2><p>A running log of every action Harvey's agents have taken.</p></div>+ <div class="section-head"><div><h2>Activity</h2><p>A running log of every action Harvey's agents have taken.</p></div></div><div id="activity-list"></div></div><!-- Usage --><div id="usage" class="section">- <div class="section-head"><h2>Usage</h2><p>Actual model usage — your active subscription's quota (Claude or Codex), calls, and tokens per provider, agent and task. Subscription plans aren't billed per token, so no dollar costs here.</p></div>+ <div class="section-head"><div><h2>Usage</h2><p>Model usage on your subscription (Claude or Codex): calls and tokens by provider, agent and task. Subscription plans aren't billed per token, so there are no dollar costs here.</p></div></div><div id="usage-quota" class="card" style="display:none"></div><div class="stats-grid" id="usage-stats"></div><div class="card" id="usage-daily" style="display:none"></div>@@ -221,99 +275,124 @@<!-- Settings --><div id="settings" class="section">- <div class="section-head"><h2>Settings</h2><p>Credentials are stored locally in <span style="font-family:var(--mono);font-size:12px">.env</span> — never sent anywhere except the services themselves.</p></div>+ <div class="section-head"><div><h2>Settings</h2><p>Credentials are stored locally in <code>.env</code> and never sent anywhere except the services themselves.</p></div></div>++ <div class="subhead">Email provider <span class="hint">Active: <b id="active-provider">…</b> · set <code>channels.email.provider</code> in <code>harvey.yaml</code></span></div><div class="card">- <h2>Email Provider</h2>- <p class="lede">How Harvey sends and reads replies. Active provider: <b id="active-provider">…</b> — change it by setting <span style="font-family:var(--mono);font-size:12px">channels.email.provider</span> in <span style="font-family:var(--mono);font-size:12px">harvey.yaml</span> to <span style="font-family:var(--mono);font-size:12px">gmail</span>, <span style="font-family:var(--mono);font-size:12px">smtp</span>, or <span style="font-family:var(--mono);font-size:12px">instantly</span>.</p>-- <div style="border:1px solid var(--border);border-radius:10px;padding:16px;margin-bottom:12px">- <div style="font-weight:650;margin-bottom:4px">Gmail / Google Workspace <span class="optional-tag">recommended</span> <span id="gmail-status" class="email-tag"></span></div>- <p class="lede" style="margin-top:4px">Use a mailbox on a dedicated secondary domain. Create an OAuth client (type "Desktop app") in Google Cloud Console → Gmail API, paste the id/secret, save, then run <span style="font-family:var(--mono);font-size:12px">harvey gmail auth</span> in your terminal.</p>- <div class="form-group"><label class="form-label" for="gmail-id">Client ID</label>- <input type="text" class="form-input" id="gmail-id" placeholder="xxxx.apps.googleusercontent.com" autocomplete="off"></div>- <div class="form-group"><label class="form-label" for="gmail-secret">Client Secret</label>- <div class="form-row"><div class="form-group" style="margin-bottom:0">- <input type="password" class="form-input" id="gmail-secret" placeholder="Enter client secret" autocomplete="off"></div>- <button class="btn btn-secondary btn-sm" onclick="toggleVisibility('gmail-secret')">Show</button></div></div>- <button class="btn btn-primary btn-sm" onclick="saveGmail()">Save Gmail</button>+ <div class="settings-row">+ <div>+ <h3>Gmail / Google Workspace <span class="tag accent">Recommended</span> <span id="gmail-status" class="email-tag"></span></h3>+ <p class="desc">Use a mailbox on a dedicated secondary domain. Create an OAuth client (type "Desktop app") in Google Cloud Console → Gmail API, paste the id and secret, save, then run <code>harvey gmail auth</code>.</p>+ </div>+ <div class="fields">+ <div class="form-group"><label class="form-label" for="gmail-id">Client ID</label>+ <input type="text" class="form-input" id="gmail-id" placeholder="xxxx.apps.googleusercontent.com" autocomplete="off"></div>+ <div class="form-group"><label class="form-label" for="gmail-secret">Client secret</label>+ <div class="with-btn"><input type="password" class="form-input" id="gmail-secret" placeholder="Enter client secret" autocomplete="off">+ <button class="btn btn-secondary" onclick="toggleVisibility('gmail-secret')">Show</button></div></div>+ <button class="btn btn-primary btn-sm" onclick="saveGmail()">Save Gmail</button>+ </div></div>- <div style="border:1px solid var(--border);border-radius:10px;padding:16px;margin-bottom:12px">- <div style="font-weight:650;margin-bottom:4px">SMTP + IMAP mailbox</div>- <p class="lede" style="margin-top:4px">Any real mailbox (AgentMail, Fastmail, a Workspace app password). IMAP defaults to the SMTP host/login if left blank.</p>- <div class="form-row">- <div class="form-group"><label class="form-label" for="smtp-host">SMTP host</label>- <input type="text" class="form-input" id="smtp-host" placeholder="smtp.example.com" autocomplete="off"></div>- <div class="form-group" style="max-width:120px"><label class="form-label" for="smtp-port">Port</label>- <input type="text" class="form-input" id="smtp-port" placeholder="587" autocomplete="off"></div>+ <div class="settings-row">+ <div>+ <h3>SMTP + IMAP mailbox</h3>+ <p class="desc">Any real mailbox (AgentMail, Fastmail, a Workspace app password). IMAP defaults to the SMTP host and login if left blank.</p>+ </div>+ <div class="fields">+ <div class="form-row">+ <div class="form-group"><label class="form-label" for="smtp-host">SMTP host</label>+ <input type="text" class="form-input" id="smtp-host" placeholder="smtp.example.com" autocomplete="off"></div>+ <div class="form-group" style="max-width:120px"><label class="form-label" for="smtp-port">Port</label>+ <input type="text" class="form-input" id="smtp-port" placeholder="587" autocomplete="off"></div>+ </div>+ <div class="form-group"><label class="form-label" for="smtp-user">Username</label>+ <input type="text" class="form-input" id="smtp-user" placeholder="[email protected]" autocomplete="off"></div>+ <div class="form-group"><label class="form-label" for="smtp-pass">Password</label>+ <div class="with-btn"><input type="password" class="form-input" id="smtp-pass" placeholder="Enter password / app password" autocomplete="off">+ <button class="btn btn-secondary" onclick="toggleVisibility('smtp-pass')">Show</button></div></div>+ <button class="btn btn-primary btn-sm" onclick="saveSmtp()">Save SMTP</button></div>- <div class="form-group"><label class="form-label" for="smtp-user">Username</label>- <input type="text" class="form-input" id="smtp-user" placeholder="[email protected]" autocomplete="off"></div>- <div class="form-group"><label class="form-label" for="smtp-pass">Password</label>- <div class="form-row"><div class="form-group" style="margin-bottom:0">- <input type="password" class="form-input" id="smtp-pass" placeholder="Enter password / app password" autocomplete="off"></div>- <button class="btn btn-secondary btn-sm" onclick="toggleVisibility('smtp-pass')">Show</button></div></div>- <button class="btn btn-primary btn-sm" onclick="saveSmtp()">Save SMTP</button></div>- <div style="border:1px solid var(--border);border-radius:10px;padding:16px">- <div style="font-weight:650;margin-bottom:4px">Instantly <span class="optional-tag">legacy</span></div>- <p class="lede" style="margin-top:4px">Get your API key from <a href="https://app.instantly.ai/app/settings/integrations" target="_blank" rel="noopener">Instantly Settings → Integrations</a> (Growth plan+ for API).</p>- <div class="form-group"><div class="form-row"><div class="form-group" style="margin-bottom:0">- <input type="password" class="form-input" id="instantly-key" placeholder="Enter your Instantly API key" autocomplete="off"></div>- <button class="btn btn-secondary btn-sm" onclick="toggleVisibility('instantly-key')">Show</button>- <button class="btn btn-secondary btn-sm" onclick="testInstantly()">Test</button></div>- <div id="instantly-test-result"></div></div>- <button class="btn btn-primary btn-sm" onclick="saveInstantly()">Save Instantly</button>+ <div class="settings-row">+ <div>+ <h3>Instantly <span class="tag">Legacy</span></h3>+ <p class="desc">Get your API key from <a href="https://app.instantly.ai/app/settings/integrations" target="_blank" rel="noopener">Instantly Settings → Integrations</a> (Growth plan or higher for API).</p>+ </div>+ <div class="fields">+ <div class="form-group"><label class="form-label" for="instantly-key">API key</label>+ <div class="with-btn"><input type="password" class="form-input" id="instantly-key" placeholder="Enter your Instantly API key" autocomplete="off">+ <button class="btn btn-secondary" onclick="toggleVisibility('instantly-key')">Show</button>+ <button class="btn btn-secondary" onclick="testInstantly()">Test</button></div>+ <div id="instantly-test-result"></div></div>+ <button class="btn btn-primary btn-sm" onclick="saveInstantly()">Save Instantly</button>+ </div></div></div>+ <div class="subhead">Email verification <span class="hint">Strongly recommended</span></div><div class="card">- <h2>Email Verification <span class="optional-tag">strongly recommended</span></h2>- <p class="lede">Add at least one so found emails get verified. Without any, addresses stay <span class="email-tag guess">guess</span> and are never sent. Reoon has the best free tier (600/mo).</p>- <div class="form-group"><label class="form-label" for="reoon-key">Reoon API key <span id="reoon-status" class="email-tag"></span></label>- <div class="form-row"><div class="form-group" style="margin-bottom:0">- <input type="password" class="form-input" id="reoon-key" placeholder="600 free/mo — reoon.com/email-verifier" autocomplete="off"></div>- <button class="btn btn-secondary btn-sm" onclick="toggleVisibility('reoon-key')">Show</button></div></div>- <div class="form-group"><label class="form-label" for="zerobounce-key">ZeroBounce API key <span id="zerobounce-status" class="email-tag"></span></label>- <input type="password" class="form-input" id="zerobounce-key" placeholder="100 free/mo — best for M365/Workspace catch-alls" autocomplete="off"></div>- <div class="form-group"><label class="form-label" for="hunter-key">Hunter API key <span id="hunter-status" class="email-tag"></span></label>- <input type="password" class="form-input" id="hunter-key" placeholder="50 free/mo + email-pattern lookup" autocomplete="off"></div>- <button class="btn btn-primary btn-sm" onclick="saveVerifiers()">Save verification keys</button>- </div>-- <div class="card">- <h2>LinkedIn <span class="optional-tag">optional</span></h2>- <p class="lede">For automated LinkedIn prospecting. Harvey logs in and searches like a human.</p>- <div class="form-group">- <label class="form-label" for="linkedin-email">Email / Username</label>- <input type="text" class="form-input" id="linkedin-email" placeholder="[email protected]" autocomplete="off">- </div>- <div class="form-group">- <label class="form-label" for="linkedin-password">Password</label>- <input type="password" class="form-input" id="linkedin-password" placeholder="Enter password" autocomplete="new-password">+ <div class="settings-row">+ <div>+ <h3>Verifiers</h3>+ <p class="desc">Add at least one so found emails get verified. Without any, addresses stay <span class="email-tag guess" style="margin:0">guess</span> and are never sent. Reoon has the best free tier (600 a month).</p>+ </div>+ <div class="fields">+ <div class="form-group"><label class="form-label" for="reoon-key">Reoon API key <span id="reoon-status" class="email-tag"></span></label>+ <div class="with-btn"><input type="password" class="form-input" id="reoon-key" placeholder="600 free/mo — reoon.com/email-verifier" autocomplete="off">+ <button class="btn btn-secondary" onclick="toggleVisibility('reoon-key')">Show</button></div></div>+ <div class="form-group"><label class="form-label" for="zerobounce-key">ZeroBounce API key <span id="zerobounce-status" class="email-tag"></span></label>+ <input type="password" class="form-input" id="zerobounce-key" placeholder="100 free/mo — best for M365/Workspace catch-alls" autocomplete="off"></div>+ <div class="form-group"><label class="form-label" for="hunter-key">Hunter API key <span id="hunter-status" class="email-tag"></span></label>+ <input type="password" class="form-input" id="hunter-key" placeholder="50 free/mo + email-pattern lookup" autocomplete="off"></div>+ <button class="btn btn-primary btn-sm" onclick="saveVerifiers()">Save verification keys</button>+ </div></div>- <button class="btn btn-primary" onclick="saveLinkedIn()">Save</button></div>+ <div class="subhead">Optional</div><div class="card">- <h2>Cloudflare <span class="optional-tag">optional</span></h2>- <p class="lede">For deep website crawling with JavaScript rendering during product training. ~$5/month.</p>- <div class="form-group">- <label class="form-label" for="cf-account-id">Account ID</label>- <input type="text" class="form-input" id="cf-account-id" placeholder="Your Cloudflare Account ID" autocomplete="off">+ <div class="settings-row">+ <div>+ <h3>LinkedIn</h3>+ <p class="desc">For automated LinkedIn prospecting. Harvey logs in and searches like a human.</p>+ </div>+ <div class="fields">+ <div class="form-group">+ <label class="form-label" for="linkedin-email">Email or username</label>+ <input type="text" class="form-input" id="linkedin-email" placeholder="[email protected]" autocomplete="off">+ </div>+ <div class="form-group">+ <label class="form-label" for="linkedin-password">Password</label>+ <input type="password" class="form-input" id="linkedin-password" placeholder="Enter password" autocomplete="new-password">+ </div>+ <button class="btn btn-primary btn-sm" onclick="saveLinkedIn()">Save LinkedIn</button>+ </div></div>- <div class="form-group">- <label class="form-label" for="cf-api-token">API Token</label>- <input type="password" class="form-input" id="cf-api-token" placeholder="Your Cloudflare API Token" autocomplete="off">+ <div class="settings-row">+ <div>+ <h3>Cloudflare</h3>+ <p class="desc">Deep website crawling with JavaScript rendering during product training. About $5 a month.</p>+ </div>+ <div class="fields">+ <div class="form-group">+ <label class="form-label" for="cf-account-id">Account ID</label>+ <input type="text" class="form-input" id="cf-account-id" placeholder="Your Cloudflare Account ID" autocomplete="off">+ </div>+ <div class="form-group">+ <label class="form-label" for="cf-api-token">API token</label>+ <input type="password" class="form-input" id="cf-api-token" placeholder="Your Cloudflare API Token" autocomplete="off">+ </div>+ <button class="btn btn-primary btn-sm" onclick="saveCloudflare()">Save Cloudflare</button>+ </div></div>- <button class="btn btn-primary" onclick="saveCloudflare()">Save</button></div></div><!-- Controls --><div id="controls" class="section">- <div class="section-head"><h2>Controls</h2><p>Start and stop Harvey's heartbeat loop, and watch what it's doing.</p></div>+ <div class="section-head"><div><h2>Controls</h2><p>Start and stop Harvey's heartbeat loop, and watch what it's doing.</p></div></div><div class="control-panel"><div class="card"><h2>Agent</h2>@@ -328,18 +407,15 @@</div></div><div class="card">- <h2>Recent Logs</h2>+ <h2>Recent logs <button class="btn btn-ghost btn-sm" onclick="loadLogs()" style="margin-left:auto"><svg class="icon"><use href="#i-refresh"/></svg>Refresh</button></h2><div class="log-viewer" id="log-viewer">No logs yet. Start Harvey to see activity.</div>- <div class="btn-group">- <button class="btn btn-secondary btn-sm" onclick="loadLogs()">Refresh Logs</button>- </div></div></div></div><!-- Help --><div id="help" class="section">- <div class="section-head"><h2>Help</h2><p>What Harvey is, how it works, and how to fix the usual problems.</p></div>+ <div class="section-head"><div><h2>Help</h2><p>What Harvey is, how it works, and how to fix the usual problems.</p></div></div><div class="help-section"><h2>What is Harvey?</h2>@@ -348,18 +424,18 @@</div><div class="help-section">- <h2>Getting Started</h2>+ <h2>Getting started</h2><p>There are three things to do:</p>- <pre>1. Go to the Settings tab and enter your Instantly API key+ <pre>1. Go to the Settings tab and connect an email provider (Gmail recommended)2. Train Harvey on your product (through Claude or the command line)3. Go to the Controls tab and click Start</pre>- <p>The Setup tab shows you exactly what's done and what still needs to happen.</p>+ <p>Today shows exactly what's done and what still needs to happen.</p></div><div class="help-section">- <h2>Where Everything Lives</h2>+ <h2>Where everything lives</h2><p>Everything Harvey needs is inside this one project folder. Nothing is stored elsewhere.</p>- <div class="table-card" style="padding:6px 4px">+ <div class="table-card"><table class="file-table"><tr><td>.env</td><td>Your API keys and credentials (never shared or committed)</td></tr><tr><td>harvey.yaml</td><td>Your product info, target customers, and behavior settings</td></tr>@@ -373,12 +449,12 @@</div><div class="help-section">- <h2>Getting Your API Keys</h2>+ <h2>Getting your API keys</h2><details>- <summary>Instantly API Key (required)</summary>+ <summary>Instantly API key (legacy)</summary><div class="faq-body">- <p>Instantly is the email platform Harvey uses to send campaigns.</p>+ <p>Instantly is the legacy sending option; Gmail or SMTP is recommended.</p><p>1. Sign up at <a href="https://instantly.ai" target="_blank" rel="noopener">instantly.ai</a> (you need the Growth plan for API access)</p><p>2. Go to Settings > Integrations</p><p>3. Copy your API key</p>@@ -387,7 +463,7 @@</details><details>- <summary>LinkedIn Credentials (optional)</summary>+ <summary>LinkedIn credentials (optional)</summary><div class="faq-body"><p>If you want Harvey to find prospects on LinkedIn, enter your LinkedIn email and password. Harvey uses a real browser to search LinkedIn like a human would, with random delays and rate limits to avoid detection.</p><p>If you skip this, Harvey will find prospects through Google searches and company website scraping instead.</p>@@ -408,7 +484,7 @@</div><div class="help-section">- <h2>Common Issues</h2>+ <h2>Common issues</h2><details><summary>"command not found: harvey"</summary>@@ -437,7 +513,9 @@</div></div>+</div></main>+</div><script src="/static/app.js"></script></body>diff --git a/tests/test_dashboard_trend.py b/tests/test_dashboard_trend.pynew file mode 100644index 0000000..8a81e2e--- /dev/null+++ b/tests/test_dashboard_trend.py@@ -0,0 +1,42 @@+"""/api/trend: daily counts for the dashboard's sparklines."""++import asyncio+import sqlite3+from datetime import datetime, timedelta, timezone++from tests.test_dashboard_signals import client # noqa: F401 (fixture)+from harvey.state import StateManager+++def _sql(db, query, params=()):+ with sqlite3.connect(db) as conn:+ conn.execute(query, params)+ conn.close()+++def test_trend_counts_each_day_and_fills_gaps_with_zero(client):+ asyncio.run(StateManager(str(client.db_path)).init_db())+ today = datetime.now(timezone.utc).date() # stored times are UTC+ d = lambda n: (today - timedelta(days=n)).isoformat() + "T10:00:00" # noqa: E731+ for n, day in enumerate((0, 0, 2)):+ _sql(client.db_path, "INSERT INTO prospects (id, first_name, status, created_at) "+ "VALUES (?, 'A', 'new', ?)", (f"p{n}", d(day)))+ _sql(client.db_path, "INSERT INTO outbox (id, prospect_id, to_email, status, sent_at) "+ "VALUES ('o1', 'p0', '[email protected]', 'sent', ?)", (d(1),))+ _sql(client.db_path, "INSERT INTO outbox (id, prospect_id, to_email, status, sent_at) "+ "VALUES ('o2', 'p0', '[email protected]', 'pending_review', ?)", (d(1),))+ _sql(client.db_path, "INSERT INTO conversations (id, prospect_id, created_at) "+ "VALUES ('c1', 'p0', ?)", (d(0),))++ data = client.get("/api/trend?days=7").json()+ assert len(data["days"]) == 7 and data["days"][-1] == today.isoformat()+ assert data["found"][-1] == 2 and data["found"][-3] == 1 and sum(data["found"]) == 3+ assert data["sent"][-2] == 1 and sum(data["sent"]) == 1 # only sent mail counts+ assert data["replies"][-1] == 1+++def test_trend_days_are_bounded(client):+ asyncio.run(StateManager(str(client.db_path)).init_db())+ assert len(client.get("/api/trend?days=500").json()["days"]) == 90+ assert len(client.get("/api/trend?days=0").json()["days"]) == 1+ assert client.get("/api/trend?days=x").status_code == 422