/* The client view (/workspace, client.js). Same design system as the public site (brand.css): warm paper and
   ink, one vermilion accent used sparingly, Bricolage Grotesque for display, Geist for text, Geist Mono for
   data only; radius 8 / 12 / 16; nothing smaller than 13 px. Phone first (iPhone 13, 390 px), a rail on
   desktop. No count-ups, no fade-ups, no gradient text, no glass, no glow. Targets are 44 px or larger. */
@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #fbfaf7; --paper-2: #f3f0e9; --paper-3: #e9e4d9; --card: #ffffff;
  --ink: #141311; --ink-2: #3d3934; --ink-3: #5c574f;
  --rule: rgb(20 19 17 / .09); --rule-2: rgb(20 19 17 / .16); --rule-3: rgb(20 19 17 / .28);
  --acc: #e5481c; --acc-ink: #b3350d; --acc-soft: #fce6dc; --mark-1: #e5481c; --mark-2: #e5481c; --mark-3: #b8360e; --mark-ink: #fff;
  --live: #1d7a4a; --live-soft: #e3f1e8; --warn-ink: #7a4b00; --warn-soft: #fbefd6; --info-ink: #24467a; --info-soft: #e6edf7;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r-sm: 8px; --r-btn: 12px; --r-card: 16px;
  --gut: 16px; --bar-h: 64px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.cv { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); overflow-x: hidden; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a { color: var(--acc-ink); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, main:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px; }
.cv-skip { position: absolute; left: 12px; top: -60px; z-index: 60; padding: 12px 16px; background: var(--ink); color: #fff; border-radius: var(--r-sm); text-decoration: none; }
.cv-skip:focus { top: 12px; }
.cv-muted { color: var(--ink-3); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- top */
.cv-top { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--rule); }
.cv-top-in { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px var(--gut); max-width: 1240px; margin: 0 auto; }
.cv-brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); text-decoration: none; flex: none; }
.cv-mark { width: 26px; height: 26px; }
.cv-word { font: 650 18px/1 var(--display); letter-spacing: -.03em; }
.cv-ws { margin: 0; min-width: 0; flex: 1; font: 600 16px/1.2 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-left: 12px; border-left: 1px solid var(--rule-2); }
.cv-who { display: flex; align-items: center; gap: 10px; flex: none; }
.cv-person { display: none; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.cv-person b { font-weight: 600; font-size: 14px; } .cv-person small { font-size: 13px; color: var(--ink-3); }
.cv-banners { max-width: 1240px; margin: 0 auto; padding: 0 var(--gut); }
.cv-banner { margin: 12px 0 0; padding: 12px 14px; border-radius: var(--r-btn); font-size: 15px; line-height: 1.45; }
.cv-banner-test { background: var(--warn-soft); color: var(--warn-ink); }
.cv-banner-preview { background: var(--info-soft); color: var(--info-ink); }

/* ---------------------------------------------------------------- shell + navs */
.cv-shell { max-width: 1240px; margin: 0 auto; padding: 0 var(--gut); }
.cv-rail { display: none; }
.cv-main { min-width: 0; padding: 20px 0 32px; outline: 0; }
.cv-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--rule-2); padding-bottom: env(safe-area-inset-bottom); }
.cv-bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--bar-h); min-width: 0;
  padding: 6px 2px; color: var(--ink-3); text-decoration: none; font-size: 13px; font-weight: 500; line-height: 1.1; text-align: center; }
.cv-bar a[aria-current="page"] { color: var(--ink); font-weight: 650; }
.cv-bar a[aria-current="page"] .cv-bar-ic { background: var(--paper-2); }
.cv-bar-ic { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 30px; border-radius: 999px; }
.cv-bar .cv-count { position: absolute; top: -4px; right: -2px; }
.cv-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--acc-ink); color: #fff; font: 600 13px/1 var(--sans); }

@media (min-width: 900px) {
  body.cv { padding-bottom: 0; }
  :root { --gut: 32px; }
  .cv-person { display: flex; }
  .cv-bar { display: none; }
  .cv-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 40px; }
  .cv-rail { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; align-self: start; padding: 24px 0; }
  .cv-rail a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink-2);
    text-decoration: none; font-size: 15px; font-weight: 500; }
  .cv-rail a:hover { background: var(--paper-2); color: var(--ink); }
  .cv-rail a[aria-current="page"] { background: var(--paper-2); color: var(--ink); font-weight: 650; }
  .cv-rail .cv-count { margin-left: auto; }
  .cv-main { padding: 32px 0 64px; max-width: 760px; }
}

/* ---------------------------------------------------------------- type + blocks */
.cv-head { margin: 4px 0 20px; }
.cv-head h1 { margin: 0; font: 600 clamp(28px, 7vw, 40px)/1.08 var(--display); letter-spacing: -.03em; }
.cv-head p { margin: 8px 0 0; color: var(--ink-2); font-size: 16px; max-width: 62ch; }
.cv-h2 { margin: 28px 0 12px; font: 600 20px/1.25 var(--display); letter-spacing: -.015em; }
.cv-eyebrow { margin: 0 0 6px; font-size: 14px; color: var(--ink-3); font-weight: 500; }
.cv-note { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.cv-empty { margin: 8px 0; padding: 20px; border-radius: var(--r-card); background: var(--paper-2); color: var(--ink-2); }
.cv-callout { margin: 12px 0 0; padding: 12px 14px; border-radius: var(--r-btn); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.cv-callout.warn { background: var(--warn-soft); color: var(--warn-ink); }
.cv-callout.bad { background: var(--acc-soft); color: #8f2a0a; }
.cv-callout.ok { background: var(--live-soft); color: #165f39; }
.cv-mono { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.cv-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-card); padding: 18px; }
.cv-card + .cv-card, section.cv-card { margin-top: 16px; }
.cv-card h2, .cv-need section h2, .cv-card section h2 { margin: 0 0 10px; font: 600 17px/1.3 var(--sans); letter-spacing: -.01em; }
.cv-need section, article.cv-card > section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); }
.cv-need-title { margin: 0; font: 600 clamp(22px, 6vw, 30px)/1.15 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.cv-back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 8px; color: var(--ink-2); font-weight: 500; text-decoration: none; }
.cv-back:hover { color: var(--ink); }

/* buttons */
.cv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: var(--r-btn);
  border: 1px solid var(--rule-3); background: var(--card); color: var(--ink); font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer; }
.cv-btn:hover:not(:disabled) { background: var(--paper-2); }
.cv-btn-sm { min-height: 44px; padding: 0 14px; font-size: 15px; }
.cv-btn-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.cv-btn-ink:hover:not(:disabled) { background: #000; }
.cv-btn-bad { color: var(--acc-ink); border-color: rgb(179 53 13 / .45); }
.cv-btn-bad:hover:not(:disabled) { background: var(--acc-soft); }
.cv-btn:disabled, .cv-btn.is-off { background: var(--paper-2); border-color: var(--rule-2); color: #6b655c; cursor: not-allowed; }
.cv-wide { width: 100%; margin-top: 16px; }
.cv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.cv-actions .cv-btn { flex: 1 1 140px; }

/* lists */
.cv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cv-item { display: grid; gap: 4px; min-height: 44px; padding: 16px; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--rule);
  color: var(--ink); text-decoration: none; }
.cv-item:hover { border-color: var(--rule-3); }
.cv-item-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-3); }
.cv-agent { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-item-top time { flex: none; font-variant-numeric: tabular-nums; }
.cv-item-title { font-size: 17px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.cv-item-sub { font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; }
.cv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-chips:empty { display: none; }
.cv-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2);
  font-size: 13px; font-weight: 600; margin: 8px 0 0; }
.cv-chips .cv-chip { margin: 4px 0 0; }
.cv-chip-warn { background: var(--warn-soft); color: var(--warn-ink); }
.cv-mode { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; flex: none; }
.m-test, .m-draft { background: var(--warn-soft); color: var(--warn-ink); }
.m-shadow { background: var(--info-soft); color: var(--info-ink); }
.m-live { background: var(--live-soft); color: #165f39; }
.m-paused, .m-stopped { background: var(--acc-soft); color: #8f2a0a; }

/* the decision */
.cv-do, .cv-why { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.cv-do li, .cv-why li { overflow-wrap: anywhere; }
.cv-pre { margin: 8px 0 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--paper-2); font: 400 13px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.cv-fields { margin: 0; display: grid; gap: 0; }
.cv-fields > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.cv-fields > div:last-child { border-bottom: 0; }
.cv-fields dt { font-size: 13px; font-weight: 600; color: var(--ink-3); text-transform: none; }
.cv-fields dd { margin: 0; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
@media (min-width: 600px) { .cv-fields > div { grid-template-columns: 180px minmax(0, 1fr); gap: 16px; } }
.cv-decide label, .cv-stopf label, .cv-signin label { display: block; font-size: 15px; font-weight: 600; margin: 4px 0 6px; }
textarea, .cv-signin input { width: 100%; min-height: 48px; padding: 12px; border-radius: var(--r-sm); border: 1px solid var(--rule-3); background: #fff; color: var(--ink);
  font: 400 16px/1.45 var(--sans); resize: vertical; }
textarea:disabled { background: var(--paper-2); color: #6b655c; }

/* today + run */
.cv-seg { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: var(--r-btn); background: var(--paper-2); }
.cv-seg button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: 600 15px/1 var(--sans); cursor: pointer; }
.cv-seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgb(20 19 17 / .12); }
.cv-runs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.cv-runs a { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; min-height: 44px; padding: 14px 4px; border-bottom: 1px solid var(--rule);
  color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.45; }
.cv-runs a:hover { background: var(--paper-2); }
.cv-runs time { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 14px; padding-top: 1px; }
.cv-runs span { overflow-wrap: anywhere; }
.cv-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.cv-steps li { overflow-wrap: anywhere; font-size: 15px; }
.cv-step-h { display: flex; justify-content: space-between; gap: 12px; }
.cv-step-h time { color: var(--ink-3); font-size: 14px; flex: none; }
.cv-steps li > span:last-child { display: block; color: var(--ink-2); }

/* report + spend */
.cv-stats { margin: 16px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cv-stats > div { padding: 14px; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--rule); min-width: 0; }
.cv-stats dt { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.cv-stats dd { margin: 4px 0 0; font: 600 22px/1.2 var(--display); overflow-wrap: anywhere; }
@media (min-width: 900px) { .cv-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cv-agents-r { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.cv-agents-r li { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.cv-ar-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cv-ar-h b { min-width: 0; overflow-wrap: anywhere; }
.cv-ar-n { font-size: 14px; color: var(--ink-2); }
.cv-big { margin: 0; font-size: 17px; } .cv-big b { font: 600 30px/1.1 var(--display); letter-spacing: -.02em; }
.cv-meter { height: 10px; margin-top: 12px; border-radius: 999px; background: var(--paper-3); overflow: hidden; }
.cv-meter span { display: block; height: 100%; min-width: 2px; background: var(--ink); }
.cv-kv { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cv-kv li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.cv-kv span { min-width: 0; overflow-wrap: anywhere; color: var(--ink-2); }
.cv-kv b { flex: none; max-width: 50%; text-align: right; font-weight: 600; }

/* agents, team */
.cv-agentc { display: grid; gap: 8px; }
.cv-agentc .cv-muted { margin: 0; font-size: 14px; }
.cv-agentc > .cv-btn { justify-self: start; }
.cv-ag-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cv-ag-h b { min-width: 0; font-size: 17px; overflow-wrap: anywhere; }
.cv-person-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; }
.cv-person-row b { min-width: 0; overflow-wrap: anywhere; }
.cv-role { flex: none; font-size: 14px; color: var(--ink-2); }
.cv-roles { margin-top: 20px; }
.cv-signin { display: grid; gap: 10px; max-width: 480px; }
.cv-signin .cv-btn { justify-self: start; }

.cv-toast { position: fixed; left: 50%; bottom: calc(var(--bar-h) + 16px + env(safe-area-inset-bottom)); z-index: 70; max-width: calc(100vw - 32px);
  transform: translateX(-50%); padding: 12px 16px; border-radius: var(--r-btn); background: var(--ink); color: #fff; font-size: 15px; line-height: 1.4;
  visibility: hidden; }
.cv-toast.show { visibility: visible; }
.cv-toast.bad { background: #8f2a0a; }
@media (min-width: 900px) { .cv-toast { bottom: 24px; } }

@media print {
  .cv-top, .cv-bar, .cv-rail, .cv-banners, .cv-noprint, .cv-skip, .cv-toast { display: none !important; }
  body.cv { background: #fff; padding: 0; }
  .cv-shell { display: block; padding: 0; } .cv-main { padding: 0; max-width: none; }
  .cv-stats > div, .cv-card { border-color: #bbb; }
}
