/* Zeltas Outreach. Tokens, type and block vocabulary are projects/wheel-bot/docs/design-tokens.md, unchanged except where marked "added".
   No inline styles anywhere: every colour is a token, every size is a class. Light first, dark redefines the same names. */

:root {
  color-scheme: light;
  --dsp: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --bdy: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --mno: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ground: #EEF1F4; --surface: #FFFFFF; --sunken: #E6EAEE; --inset: #E2E7EC;
  --ink: #121A22; --ink-2: #4A5661; --ink-3: #5C6873;
  --line: #CBD3DA; --line-2: #A8B4BE; --accent: #1C4F7C;
  --t-trigger: #5B3E96; --t-input: #1C5E8C; --t-cond: #A4620F; --t-loop: #2E6A6E; --t-group: #6A7580; --t-action: #1E6F52;
  --on-tag: #FFFFFF;
  --stop: #92372A; --on-stop: #FFFFFF; --go: #1E6F52; --warn: #8A5200;
  /* added: text on the accent fill, the brand tile from the Zeltas site, the layer backdrop and one shadow */
  --on-accent: #FFFFFF; --brand: #2B3F87; --on-brand: #F1F2F3; --brand-soft: #C9D0EC;
  --overlay: rgba(14, 20, 25, .5); --shadow: 0 1px 2px rgba(18, 26, 34, .08), 0 4px 14px rgba(18, 26, 34, .06);

  /* one size per role */
  --step: 304px; --stepH: 120px; --side: 176px; --sideH: 84px; --wire: 28px;
  --w-page: 1320px;
  --t-xs: 12px; --t-sm: 13.5px; --t-md: 15px; --t-lg: 17px; --t-xl: 24px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0E1419; --surface: #161E25; --sunken: #1C252C; --inset: #121920;
    --ink: #E6EBEF; --ink-2: #A6B2BC; --ink-3: #7B8792;
    --line: #28323A; --line-2: #3A4650; --accent: #6BA6DC;
    --t-trigger: #9B7FD4; --t-input: #6BA6DC; --t-cond: #D6A75C; --t-loop: #5FB0B5; --t-group: #8A96A0; --t-action: #5FBF95;
    --on-tag: #0E1419;
    --stop: #B04B3B; --on-stop: #FFFFFF; --go: #5FBF95; --warn: #E0B060;
    --on-accent: #0E1419; --brand: #1E2C63; --on-brand: #F1F2F3; --brand-soft: #93A6EA;
    --overlay: rgba(0, 0, 0, .6); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0E1419; --surface: #161E25; --sunken: #1C252C; --inset: #121920;
  --ink: #E6EBEF; --ink-2: #A6B2BC; --ink-3: #7B8792;
  --line: #28323A; --line-2: #3A4650; --accent: #6BA6DC;
  --t-trigger: #9B7FD4; --t-input: #6BA6DC; --t-cond: #D6A75C; --t-loop: #5FB0B5; --t-group: #8A96A0; --t-action: #5FBF95;
  --on-tag: #0E1419;
  --stop: #B04B3B; --on-stop: #FFFFFF; --go: #5FBF95; --warn: #E0B060;
  --on-accent: #0E1419; --brand: #1E2C63; --on-brand: #F1F2F3; --brand-soft: #93A6EA;
  --overlay: rgba(0, 0, 0, .6); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 var(--t-md)/1.5 var(--bdy); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
code, pre, .mono { font-family: var(--mno); }
code { font-size: .9em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.offscreen { position: fixed; left: -9999px; top: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 6px; z-index: 100; border: 1px solid var(--line-2); }
.skip:focus { left: 8px; }
.noscript { padding: 24px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.h1 { font: 600 var(--t-xl)/1.15 var(--dsp); letter-spacing: -.01em; }
.h1:focus { outline: none; }
.h2 { font: 600 var(--t-lg)/1.3 var(--dsp); display: flex; align-items: center; gap: 8px; }
.h3 { font: 600 var(--t-md)/1.3 var(--dsp); }
.sub { color: var(--ink-2); margin-top: 4px; }
.dim { color: var(--ink-3); }
.fine { font-size: var(--t-sm); }
.lab { font: 500 11px/1 var(--mno); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.mono { font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.trunc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.trunc2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.count { margin: 0 0 8px; }
.ico { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.row-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 600; text-align: left; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbtn:hover { color: var(--accent); text-decoration-color: var(--accent); }
.ext { display: inline-flex; align-items: center; gap: 4px; }
.bul { padding-left: 18px; list-style: disc; display: grid; gap: 4px; }
.bul.bad { color: var(--stop); }

/* ---------- buttons, chips, tags ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 var(--t-sm)/1 var(--bdy); white-space: nowrap; max-width: 100%; }
.btn span { overflow: hidden; text-overflow: ellipsis; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.danger { background: var(--stop); border-color: var(--stop); color: var(--on-stop); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-2); }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--line-2); font: 600 12px/1 var(--bdy); white-space: nowrap; color: var(--ink-2); background: var(--sunken); max-width: 100%; }
.chip .ico { width: 12px; height: 12px; flex: none; }
.chip-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chip.go { color: var(--go); border-color: color-mix(in srgb, var(--go) 50%, transparent); background: color-mix(in srgb, var(--go) 9%, var(--surface)); }
.chip.stop { color: var(--stop); border-color: color-mix(in srgb, var(--stop) 50%, transparent); background: color-mix(in srgb, var(--stop) 9%, var(--surface)); }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.chip.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.tag { font: 400 10.5px/1.5 var(--mno); letter-spacing: .1em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; flex: none; color: var(--on-tag); display: inline-flex; align-items: center; gap: 5px; }
.tag .ico { width: 11px; height: 11px; stroke-width: 1.7; }
.tag.t-trigger { background: var(--t-trigger); } .tag.t-input { background: var(--t-input); } .tag.t-cond { background: var(--t-cond); }
.tag.t-stop { background: var(--stop); color: var(--on-stop); }
.tag.t-loop { background: var(--t-loop); } .tag.t-group { background: var(--t-group); } .tag.t-action { background: var(--t-action); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font: 600 11.5px/20px var(--bdy); text-align: center; white-space: nowrap; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 9px; background: var(--sunken); border: 1px solid var(--line); }
.seg-b { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 6px; border: 0; background: transparent; color: var(--ink-2); font: 600 var(--t-sm)/1 var(--bdy); }
.seg-b[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2); }
.seg-n { display: inline-block; min-width: 20px; padding: 2px 6px; border-radius: 10px; background: var(--inset); color: var(--ink-2); font: 500 11.5px/1.3 var(--mno); text-align: center; }

/* ---------- forms ---------- */
.input { width: 100%; min-height: 38px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
textarea.input { resize: vertical; line-height: 1.45; }
.input:hover { border-color: var(--ink-3); }
.field { display: grid; gap: 5px; }
.fl { font-weight: 600; font-size: var(--t-sm); }
.hint { color: var(--ink-3); font-size: var(--t-sm); }
.form { display: grid; gap: 14px; }
.form-msg { color: var(--stop); font-weight: 600; min-height: 0; padding-left: 10px; border-left: 3px solid var(--stop); }
.form-msg:empty { display: none; }
.form-msg.ok { color: var(--go); border-left-color: var(--go); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch, .check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--t-sm); }
.switch input, .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.search-wrap { position: relative; display: block; flex: 1 1 240px; min-width: 0; }
.search-wrap .ico { position: absolute; left: 11px; top: 12px; color: var(--ink-3); }
.search-wrap .input { padding-left: 34px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filters select.input { width: auto; min-width: 150px; flex: 0 1 auto; }
.preview { color: var(--ink-2); }
.preview-box:empty { display: none; }
.preview-box { padding: 10px 12px; border-radius: 8px; background: var(--sunken); }
.json-edit { font-family: var(--mno); font-size: 12.5px; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { max-width: var(--w-page); margin: 0 auto; height: 56px; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand-mark { display: block; border-radius: 6px; }
.brand-name { font: 600 var(--t-lg)/1 var(--dsp); letter-spacing: -.005em; white-space: nowrap; }
.tabs { display: flex; gap: 2px; align-self: stretch; }
.tab { display: flex; align-items: center; padding: 0 14px; color: var(--ink-2); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.top-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: var(--t-sm); }
.top-btn:hover, .top-btn[aria-expanded="true"] { background: var(--sunken); color: var(--ink); }
.top-btn.mention .badge { background: var(--stop); color: var(--on-stop); }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--sunken); color: var(--ink); font: 600 13px/1 var(--dsp); }
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; flex: none; }
.pop-wrap { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-width: calc(100vw - 24px); max-height: calc(100vh - 90px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); z-index: 30; }
.pop-in { padding: 16px; display: grid; gap: 12px; }
.pop-in.menu { padding: 8px; gap: 2px; width: 260px; }
#pop-account { width: 260px; }
.pop-h { font: 600 var(--t-lg)/1.2 var(--dsp); }
.pop-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.who { display: grid; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.who span { overflow: hidden; text-overflow: ellipsis; }
.menu-sec { display: grid; gap: 6px; padding: 8px 10px; }
.menu-i { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-decoration: none; font-weight: 600; text-align: left; }
.menu-i:hover { background: var(--sunken); }
.calm { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.cmd { padding: 12px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); display: grid; gap: 8px; }
.cmd-t { display: flex; align-items: center; gap: 8px; }
.cmd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cmd-c { flex: 1 1 200px; min-width: 0; padding: 8px 10px; border-radius: 6px; background: var(--ink); color: var(--surface); overflow-wrap: anywhere; font-size: 12.5px; }
.job-list { display: grid; gap: 6px; }
.job { height: 88px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: grid; align-content: start; gap: 3px; }
.job-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.job-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.job-sub { font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-res { font-size: var(--t-sm); color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.job-res.bad { color: var(--stop); }
.pending { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.job-row { display: flex; flex-wrap: wrap; gap: 8px; }

.main { max-width: var(--w-page); margin: 0 auto; padding: 24px 24px 64px; }
.main:focus { outline: none; }
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.ph-a { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.sec { padding: 18px 20px 20px; margin-bottom: 20px; scroll-margin-top: 72px; }
.sec:focus { outline: none; }
.sec-h { display: grid; gap: 2px; margin-bottom: 12px; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.jump-a { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: var(--t-sm); }
.jump-a:hover { border-color: var(--accent); }
.backlink { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; text-decoration: none; font-weight: 600; }

/* ---------- states: loading, empty, error ---------- */
.state { display: grid; justify-items: center; gap: 8px; padding: 48px 24px; text-align: center; border: 1px dashed var(--line-2); border-radius: 8px; background: var(--surface); }
.state p { max-width: 52ch; color: var(--ink-2); }
.state-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--sunken); color: var(--ink-2); }
.state-ico .ico { width: 22px; height: 22px; }
.state-ico.stop { background: color-mix(in srgb, var(--stop) 12%, var(--surface)); color: var(--stop); }
.state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.state.error { border-style: solid; border-color: color-mix(in srgb, var(--stop) 40%, var(--line)); }
.skel-list { display: grid; gap: 8px; }
.sk { border-radius: 8px; background: linear-gradient(90deg, var(--sunken) 0%, var(--inset) 50%, var(--sunken) 100%); background-size: 200% 100%; animation: sk 1.4s ease-in-out infinite; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-row { height: 56px; } .sk-today { height: 80px; } .sk-lead { height: 64px; } .sk-mail { height: 78px; } .sk-run { height: 64px; } .sk-block { height: 96px; } .sk-act { height: 64px; } .sk-token { height: 60px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: grid; gap: 8px; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 8px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow); max-width: 420px; }
.toast .ico { margin-top: 3px; }
.toast.err { background: var(--stop); color: var(--on-stop); }

/* ---------- layers ---------- */
.layer { position: fixed; inset: 0; z-index: 60; }
.backdrop { position: absolute; inset: 0; background: var(--overlay); }
.modal { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); }
.modal.wide { width: min(860px, calc(100vw - 24px)); }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(580px, 100vw); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line-2); box-shadow: var(--shadow); }
.modal:focus, .drawer:focus { outline: none; }
.modal-head, .drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); flex: none; }
.modal-title, .drawer-title { font: 600 var(--t-lg)/1.25 var(--dsp); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.modal-body, .drawer-body { padding: 18px 20px 22px; overflow: auto; display: grid; gap: 16px; align-content: start; flex: 1 1 auto; }
.modal-foot, .drawer-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex: none; }
.ds { display: grid; gap: 8px; }
.ds + .ds { padding-top: 14px; border-top: 1px solid var(--line); }
.fold summary { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 0; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; }
.kv.wide { grid-template-columns: 260px 1fr; }
.kv dt { color: var(--ink-3); font-size: var(--t-sm); padding-top: 1px; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.evidence { max-height: 132px; overflow: auto; padding: 8px 10px; border-radius: 6px; background: var(--sunken); font-size: var(--t-sm); }
.ld-sub { color: var(--ink-2); }
.ld-head { display: grid; gap: 8px; }
.ld-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.step { display: grid; justify-items: start; gap: 2px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); min-height: 74px; align-content: start; }
.step-ico { color: var(--ink-3); } .step.done .step-ico { color: var(--go); } .step.next { border-color: var(--accent); } .step.next .step-ico { color: var(--accent); }
.step-n { font-weight: 600; font-size: var(--t-sm); line-height: 1.2; }
.step-w { font: 500 11px/1.4 var(--mno); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.conflict { padding: 12px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--stop) 50%, transparent); background: color-mix(in srgb, var(--stop) 7%, var(--surface)); display: grid; gap: 10px; }
.conflict p { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.comments { display: grid; gap: 10px; }
.comment { padding: 10px 12px; border-radius: 8px; background: var(--sunken); display: grid; gap: 4px; }
.comment-h { display: flex; justify-content: space-between; gap: 8px; }
.comment-b { white-space: pre-wrap; overflow-wrap: anywhere; }
.mention-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.timeline { display: grid; gap: 0; border-left: 2px solid var(--line); margin-left: 4px; }
.tl { padding: 4px 0 10px 14px; position: relative; display: grid; gap: 2px; }
.tl::before { content: ""; position: absolute; left: -6px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.tl-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chg { display: grid; gap: 2px; font-size: var(--t-sm); }
.chg li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.was { text-decoration: line-through; color: var(--ink-3); }
.now { font-weight: 600; }
.plist { display: grid; gap: 6px; }
.prow { display: grid; gap: 1px; min-height: 64px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; align-content: center; }
.prow-t { display: flex; gap: 10px; min-width: 0; align-items: baseline; }
.prow .dim { white-space: normal; overflow-wrap: anywhere; font-size: var(--t-sm); }

/* ---------- Today ---------- */
.rows { display: grid; gap: 8px; }
.row-today { display: grid; grid-template-columns: 240px minmax(0, 1fr) 250px; align-items: center; gap: 20px; height: 84px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.row-today:hover { border-color: var(--line-2); }
.rt-who { display: grid; min-width: 0; justify-items: start; }
.rt-who .dim { max-width: 100%; }
.rt-why.short { -webkit-line-clamp: 2; line-clamp: 2; }
.rt-why { color: var(--ink-2); font-size: var(--t-sm); line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.rt-act { display: flex; justify-content: flex-end; }
.rt-act .btn { width: 100%; }
.rt-btns { display: grid; gap: 4px; width: 100%; }
.sec .sec-h .dim { font-size: var(--t-sm); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tbl th { text-align: left; font: 500 11px/1.2 var(--mno); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px; background: var(--sunken); border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow: hidden; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td .trunc, .tbl td .trunc2 { max-width: 100%; }
.tbl td.num, .tbl th.num { text-align: right; }
.leads-tbl td { height: 68px; }
.leads-tbl td > .trunc, .leads-tbl td > .linkbtn, .leads-tbl td > .dim { display: block; }
.leads-tbl td > .linkbtn { display: inline-block; vertical-align: top; }
.lead-row { cursor: pointer; }
.lead-row:hover td { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.c-person { width: 15%; } .c-company { width: 13%; } .c-verdict { width: 11%; } .c-stage { width: 11%; } .c-email { width: 12%; } .c-owner { width: 8%; } .c-next { width: auto; } .c-last { width: 9%; }
.leads-tbl .c-next .trunc2 { -webkit-line-clamp: 2; }
.tpl-tbl td, .dims td, .runleads td, .edit-tbl td, .cat-tbl td { height: 52px; }
.cat-tbl .cc0, .cat-tbl .cc1 { width: 20%; } .cat-tbl .cc2 { width: 17%; } .cat-tbl .cc3 { width: 18%; } .cat-tbl .cc4 { width: auto; }
.cat-tbl td { height: 64px; font-size: var(--t-sm); }
.edit-tbl td input.input { max-width: 110px; }
.mini td, .mini th { padding: 6px 10px; }
.mini th:nth-child(1) { width: 50%; } .mini th:nth-child(2) { width: 16%; } .mini td { white-space: nowrap; }

/* ---------- Sequence ---------- */
.seq-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
.glance { padding: 18px 18px 20px; display: grid; gap: 12px; position: sticky; top: 76px; }
.glance-sum { font: 600 var(--t-lg)/1.3 var(--dsp); }
.where { display: grid; gap: 0; }
.where li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.where li:last-child { border-bottom: 0; }
.legend { display: grid; gap: 8px; font-size: var(--t-sm); color: var(--ink-2); }
.legend li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; }
.lg-edge { display: block; height: 0; border-top: 2px solid var(--line-2); }
.lg-edge.dashed { border-top-style: dashed; } .lg-edge.red { border-top-color: var(--stop); border-top-width: 3px; }
.lg-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.legend li:last-child { grid-template-columns: 1fr; }
.sim-banner { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--sunken); margin-bottom: 16px; }
.cv { background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 20px 16px 30px; color: var(--ink); }
.cv-canvas { display: flex; flex-direction: column; align-items: center; }
.cv-row { display: grid; grid-template-columns: var(--side) var(--wire) var(--step); width: calc(var(--side) + var(--wire) + var(--step)); align-items: center; }
.cv-c1 { grid-column: 1; min-width: 0; }
.cv-c3 { grid-column: 3; min-width: 0; }
.cv-sup { grid-column: 2; border-top: 1.5px dashed var(--line-2); height: 0; align-self: center; }
.cv-flowcell { display: flex; flex-direction: column; align-items: center; }
.cv-flow { display: block; width: 1.5px; height: 26px; background: var(--line-2); }
.cv-flow.short { height: 12px; }
.cv-wait { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--t-group); color: var(--on-tag); font: 500 11px/1 var(--mno); letter-spacing: .08em; text-transform: uppercase; max-width: 100%; }
.cv-wait:hover { filter: brightness(1.1); }
.cv-wait .ico { width: 12px; height: 12px; }
.cv-wn { padding-left: 8px; border-left: 1px solid color-mix(in srgb, var(--on-tag) 40%, transparent); letter-spacing: .04em; text-transform: none; }
.cv-card { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-align: left; overflow: hidden; min-width: 0; }
button.cv-card:hover { border-color: var(--accent); }
.cv-step { height: var(--stepH); }
.cv-side { height: var(--sideH); padding: 8px 10px; gap: 3px; }
.cv-side .cv-ttl { font-size: 13.5px; }
.cv-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.cv-n { font: 400 12px/1 var(--mno); color: var(--ink-2); white-space: nowrap; }
.cv-n b { font-weight: 500; color: var(--ink); font-size: 14px; }
.cv-ttl { font: 600 15.5px/1.25 var(--dsp); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; min-width: 0; }
.cv-sub { font-size: 13px; line-height: 1.3; color: var(--ink-2); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; min-width: 0; }
.cv-step:has(.cv-stopbar) .cv-sub { -webkit-line-clamp: 1; line-clamp: 1; }
.cv-side .cv-sub { -webkit-line-clamp: 1; line-clamp: 1; font-size: 12.5px; }
.cv-stopbar { display: flex; align-items: center; gap: 8px; margin: auto -14px -10px; padding: 6px 14px 6px 11px; background: color-mix(in srgb, var(--stop) 9%, var(--surface)); border-top: 1px solid color-mix(in srgb, var(--stop) 30%, var(--line)); border-left: 3px solid var(--stop); flex: none; min-height: 28px; }
.cv-iflab { font: 500 10.5px/1 var(--mno); letter-spacing: .1em; text-transform: uppercase; color: var(--stop); white-space: nowrap; }
.cv-ifval { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cv-card.bad { border-color: color-mix(in srgb, var(--stop) 55%, var(--line)); }
.cv-end { border-color: var(--stop); border-width: 1.5px; background: color-mix(in srgb, var(--stop) 5%, var(--surface)); }
.cv-note { font-size: 12.5px; line-height: 1.3; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-weight: 600; }
.cv-step:has(.cv-note) .cv-sub { -webkit-line-clamp: 1; line-clamp: 1; }
.cv-branch { margin-top: 30px; padding-top: 14px; border-top: 1px dashed var(--line-2); display: grid; justify-items: center; gap: 14px; width: calc(var(--side) + var(--wire) + var(--step) + 40px); max-width: 100%; }
.cv-blabel { font: 500 11px/1 var(--mno); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.cv-group { position: relative; border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 16px 8px 8px; background: var(--ground); }
.cv-glabel { position: absolute; top: -10px; left: 10px; background: var(--ground); padding: 0 4px; }
.cv-ghead { display: grid; grid-template-columns: 14px 1fr; column-gap: 6px; align-items: center; width: 100%; background: none; border: 0; padding: 4px 4px; text-align: left; border-radius: 6px; min-height: 44px; }
.cv-ghead .cv-sub { grid-column: 2; -webkit-line-clamp: 1; line-clamp: 1; }
.cv-ghead .ico { transition: transform .15s; transform: rotate(-90deg); }
.cv-group.open .cv-ghead .ico { transform: none; }
.cv-gbody { display: grid; gap: 4px; padding: 6px 4px 2px; }
.cv-gbody li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 4px 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; }
.cv-gbody li .trunc { flex: 1 1 100%; }
.mailbody { font: 400 14px/1.6 var(--mno); white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.drawer-body .mailbody { background: var(--sunken); }

/* ---------- Outbox ---------- */
.mail { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-height: 560px; overflow: hidden; }
.mail-list { border-right: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr; min-width: 0; background: var(--surface); }
.mail-tabs { padding: 10px; border-bottom: 1px solid var(--line); }
.mail-rows { overflow: auto; max-height: calc(100vh - 220px); }
.mail-rows .state { margin: 12px; padding: 32px 12px; }
.mrow { display: grid; grid-template-rows: auto auto auto; align-content: center; gap: 2px; width: 100%; height: 80px; padding: 8px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; border-left: 3px solid transparent; }
.mrow:hover { background: var(--sunken); }
.mrow[aria-current="true"] { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-left-color: var(--accent); }
.mrow-1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mrow-1 strong { min-width: 0; }
.mrow-2, .mrow-3 { font-size: var(--t-sm); }
.mail-pane { padding: 20px 24px 28px; display: grid; gap: 16px; align-content: start; min-width: 0; }
.mail-pane .state { border: 0; }
.mail-back { display: none; justify-self: start; }
.mp-head { display: grid; gap: 8px; }
.mp-title { font: 600 var(--t-xl)/1.2 var(--dsp); overflow-wrap: anywhere; }
.mailhead { display: grid; grid-template-columns: 70px 1fr; gap: 6px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--sunken); }
.mailhead dt { color: var(--ink-3); font-size: var(--t-sm); padding-top: 1px; }
.mailhead dd { min-width: 0; overflow-wrap: anywhere; }
.send-bar { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.send-grp { display: grid; gap: 6px; }
.send-grp.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; align-items: flex-end; }
.btn.real { border-color: var(--accent); }
.sent-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hint-box, .held-box, .real-warn { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--sunken); }
.hint-box .ico, .held-box .ico, .real-warn .ico { margin-top: 3px; }
.real-warn { border-color: color-mix(in srgb, var(--stop) 55%, transparent); background: color-mix(in srgb, var(--stop) 8%, var(--surface)); border-left: 3px solid var(--stop); }
.gates { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.gate { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; min-height: 44px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.gate:last-child { border-bottom: 0; }
.gate-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.gate.ok .gate-ico { color: var(--go); } .gate.bad .gate-ico { color: var(--stop); background: color-mix(in srgb, var(--stop) 12%, var(--surface)); }
.gate-t { display: grid; min-width: 0; }
.gate-w { font: 500 11px/1 var(--mno); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.gate.bad .gate-w { color: var(--stop); }
.gate.bad { background: color-mix(in srgb, var(--stop) 5%, var(--surface)); }
.sec-note { margin-top: 14px; }
.gates-wrap { display: grid; gap: 8px; }
.gates-fold summary { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 32px; font-weight: 600; }
.gates-fold summary .ico { width: 14px; height: 14px; transition: transform .15s; transform: rotate(-90deg); }
.gates-fold[open] summary .ico { transform: none; }
.gates-fold .gates { margin-top: 6px; }

/* ---------- Runs ---------- */
.runs { display: grid; gap: 8px; }
.run-row { display: grid; grid-template-columns: 240px 190px minmax(0, 1fr) 120px; align-items: center; gap: 16px; height: 64px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-decoration: none; }
.run-row:hover { border-color: var(--accent); }
.run-1 { display: grid; min-width: 0; line-height: 1.3; }
.run-1 .mono { font-size: 12px; }
.run-3 { color: var(--ink-2); font-size: var(--t-sm); }
.run-4 { justify-self: end; }
.run-sum { display: grid; gap: 14px; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, 152px); gap: 10px; }
.stat { display: grid; align-content: center; gap: 2px; width: 152px; height: 84px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.stat-n { font: 600 28px/1 var(--dsp); font-variant-numeric: tabular-nums; }
.stat-l { color: var(--ink-2); font-size: var(--t-sm); }
.run-view { margin-top: 16px; }
.json { margin: 0; padding: 14px 16px; max-height: 560px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; line-height: 1.5; }
.runleads td, .runleads th { overflow: hidden; }

/* ---------- Setup ---------- */
.icp-grid { display: grid; grid-template-columns: repeat(auto-fill, 288px); gap: 14px; }
.icp-card { display: grid; grid-template-rows: 24px 1fr 28px; gap: 6px; width: 288px; height: 176px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: left; }
.icp-card:hover { border-color: var(--accent); }
.icp-t { font: 600 var(--t-lg)/1.3 var(--dsp); }
.icp-d { color: var(--ink-2); font-size: var(--t-sm); line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; align-self: start; }
.icp-f { display: flex; align-items: center; gap: 8px; min-width: 0; }
.icp-f .dim { font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowlist { display: grid; }
.rowlist li { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 52px; padding: 0 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.rowlist li:last-child { border-bottom: 0; }
.rowlist li > .trunc, .rowlist li > .who-row { min-width: 0; flex: 0 1 50%; }
.who-row { display: flex; align-items: center; gap: 10px; }
.dims td { vertical-align: middle; }
.dims th:nth-child(1) { width: 34%; } .dims th:nth-child(2) { width: 14%; }
.dims td { height: auto; }
.dims td:last-child { font-size: var(--t-sm); color: var(--ink-2); }

/* ---------- Activity and tokens ---------- */
.acts { display: grid; gap: 8px; }
.act { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 14px; height: 72px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.act.fresh { border-left: 3px solid var(--accent); }
.act-b { min-width: 0; display: grid; }
.act-l { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; line-height: 1.3; }
.act-l .linkbtn { display: inline; }
.act-d { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-sm); min-height: 20px; }
.act-r { display: grid; justify-items: end; gap: 2px; font-size: var(--t-sm); color: var(--ink-3); white-space: nowrap; }
.newtag { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-weight: 600; }
.more { display: flex; justify-content: center; margin-top: 14px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 16px; margin-bottom: 16px; }
.inline-form .field { flex: 1 1 260px; }
.tok li { height: 64px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) auto; }
.tok-n { display: grid; min-width: 0; }
.tok.rowlist { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.tok.rowlist li { padding: 0 16px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); background: var(--ground); }
.auth-brand { background: var(--brand); color: var(--on-brand); padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.auth-logo { display: flex; align-items: center; gap: 12px; }
.auth-logo img { border-radius: 10px; display: block; box-shadow: 0 0 0 1px color-mix(in srgb, var(--on-brand) 35%, transparent); }
.auth-word { font: 500 32px/1 Newsreader, Georgia, "Times New Roman", serif; letter-spacing: .005em; }
.auth-prod { font: 500 12px/1 var(--mno); letter-spacing: .16em; text-transform: uppercase; color: var(--brand-soft); padding-top: 8px; }
.auth-pitch { font: 600 26px/1.25 var(--dsp); max-width: 20ch; }
.auth-points { display: grid; gap: 10px; color: var(--brand-soft); }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; }
.auth-points .ico { margin-top: 5px; color: var(--on-brand); }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 16px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.auth-alt { color: var(--ink-2); font-size: var(--t-sm); }
.ok-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--go) 50%, transparent); background: color-mix(in srgb, var(--go) 8%, var(--surface)); }
.ok-note .ico { margin-top: 4px; color: var(--go); }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .leads-tbl .c-last, .leads-tbl td.c-last { display: none; }
  .leads-tbl th.c-email { width: 15%; } .leads-tbl th.c-verdict { width: 14%; }
}
@media (max-width: 1100px) {
  .seq-layout { grid-template-columns: minmax(0, 1fr); }
  .glance { position: static; }
}
@media (max-width: 960px) {
  .mail { grid-template-columns: minmax(0, 1fr); }
  .mail-list { border-right: 0; }
  .mail.has-sel .mail-list { display: none; }
  .mail:not(.has-sel) .mail-pane { display: none; }
  .mail-back { display: inline-flex; }
  .mail-rows { max-height: none; }
  .run-row { grid-template-columns: 200px minmax(0, 1fr) 110px; }
  .run-2 { display: none; }
  .leads-tbl .c-last, .leads-tbl td.c-last { display: none; }
  .leads-tbl th.c-person { width: 22%; }
}
@media (max-width: 860px) {
  .row-today { grid-template-columns: minmax(0, 1fr) 190px; grid-template-rows: auto auto; height: 128px; row-gap: 4px; padding: 10px 16px; align-content: center; }
  .rt-text { grid-column: 1 / -1; grid-row: 2; }
  .rt-why { -webkit-line-clamp: 2; line-clamp: 2; }
  .rt-act { grid-column: 2; grid-row: 1; }
  .leads-tbl .c-stage, .leads-tbl td.c-stage { display: none; }
}
@media (max-width: 760px) {
  /* tables become cards: one column, a label before every value */
  .tbl-wrap { border: 0; background: transparent; overflow: visible; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl tbody { display: grid; gap: 10px; }
  .tbl tr { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 6px 0; overflow: hidden; }
  .tbl td { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; border: 0; padding: 4px 14px; height: auto; min-height: 30px; align-items: center; }
  .tbl td::before { content: attr(data-label); font: 500 11px/1.2 var(--mno); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
  .tbl td.num { text-align: left; }
  .leads-tbl tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 14px; padding: 12px 14px; align-content: start; }
  .leads-tbl td, .leads-tbl td.c-person, .leads-tbl td.c-company, .leads-tbl td.c-verdict, .leads-tbl td.c-stage, .leads-tbl td.c-email, .leads-tbl td.c-owner, .leads-tbl td.c-next, .leads-tbl td.c-last { display: block; padding: 0; height: auto; min-height: 0; width: auto; overflow: hidden; }
  .leads-tbl td::before { display: block; margin-bottom: 2px; }
  .leads-tbl td.c-person, .leads-tbl td.c-next { grid-column: 1 / -1; }
  .leads-tbl td.c-person::before, .leads-tbl td.c-company::before, .leads-tbl td.c-next::before { content: none; }
  .leads-tbl td.c-person .linkbtn { font-size: var(--t-lg); }
  .leads-tbl td.c-person .dim, .leads-tbl td.c-company .dim { display: block; font-size: var(--t-sm); }
  .leads-tbl td.c-next { margin-top: 4px; height: 104px; }
  .leads-tbl td.c-next .trunc2 { -webkit-line-clamp: 3; line-clamp: 3; }
  .leads-tbl td.c-company { grid-column: 1; } .leads-tbl td.c-verdict { grid-column: 2; align-self: end; }
  .tbl.mini, .tbl.mini tbody, .tbl.mini tr, .tbl.mini td { display: revert; }
  .tbl.mini { width: 100%; table-layout: fixed; }
  .tbl.mini thead { position: static; width: auto; height: auto; clip: auto; overflow: visible; }
  .tbl.mini tbody { display: table-row-group; }
  .tbl.mini tr { border: 0; padding: 0; background: transparent; overflow: visible; display: table-row; }
  .tbl.mini td { display: table-cell; padding: 6px 10px; border-bottom: 1px solid var(--line); }
  .tbl.mini td::before { content: none; }
  .tbl.edit-tbl, .tbl.edit-tbl tbody, .tbl.edit-tbl tr, .tbl.edit-tbl td { display: revert; }
  .tbl.edit-tbl thead { position: static; width: auto; height: auto; clip: auto; overflow: visible; }
  .tbl.edit-tbl tbody { display: table-row-group; }
  .tbl.edit-tbl tr { display: table-row; border: 0; padding: 0; background: transparent; }
  .tbl.edit-tbl td { display: table-cell; padding: 6px 8px; }
  .tbl.edit-tbl td::before { content: none; }
  .tbl.edit-tbl th { padding: 8px 6px; }
}
@media (max-width: 720px) {
  .top-in { height: auto; flex-wrap: wrap; padding: 8px 16px 0; gap: 4px 10px; }
  .brand { order: 1; flex: 1 1 0; min-width: 0; }
  .top-r { order: 2; }
  .tabs { order: 3; flex: 1 0 100%; align-self: auto; margin: 0 -8px; }
  .tab { flex: 1 1 0; justify-content: center; padding: 0 2px; height: 42px; font-size: var(--t-sm); }
  .top-btn-t { display: none; }
  .top-btn { padding: 0 8px; }
  .brand-name { font-size: var(--t-md); }
  .main { padding: 18px 16px 56px; }
  .pop { position: fixed; left: 12px; right: 12px; top: 56px; width: auto; max-width: none; }
  #pop-account { width: auto; }
  .pop-in.menu { width: auto; }
  .ph { align-items: flex-start; }
  .ph-a { width: 100%; }
  .row-today { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; height: 176px; padding: 10px 14px; row-gap: 4px; }
  .row-today:has(.rt-btns) { height: 220px; }
  .rt-who { grid-column: 1; grid-row: 1; }
  .rt-text { grid-column: 1; grid-row: 2; }
  .rt-act { grid-column: 1; grid-row: 3; justify-content: stretch; }
  .filters select.input { flex: 1 1 140px; }
  .kv, .kv.wide { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dt { margin-top: 8px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .run-row { grid-template-columns: minmax(0, 1fr) auto; height: 76px; grid-template-rows: auto auto; row-gap: 2px; align-content: center; }
  .run-3 { grid-column: 1 / -1; grid-row: 2; }
  .run-4 { grid-column: 2; grid-row: 1; }
  .stats { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .stat { width: 100%; }
  .icp-grid { grid-template-columns: minmax(0, 1fr); }
  .icp-card { width: 100%; }
  .act { grid-template-columns: 30px minmax(0, 1fr); height: 104px; }
  .act-r { grid-column: 2; justify-items: start; grid-auto-flow: column; justify-content: start; gap: 10px; margin-top: -8px; }
  .tok li { grid-template-columns: minmax(0, 1fr) auto; height: 88px; grid-template-rows: auto auto; row-gap: 2px; }
  .tok li > .dim { grid-column: 1 / -1; grid-row: 2; }
  .mail-pane { padding: 16px 14px 24px; }
  .mailhead { grid-template-columns: 56px minmax(0, 1fr); }
  .send-bar { flex-direction: column; align-items: stretch; }
  .send-grp.tools { margin-left: 0; }
  .send-bar .btn { width: 100%; }
  .gate { grid-template-columns: 22px 1fr; }
  .gate-w { grid-column: 2; }
  .modal { top: auto; bottom: 0; left: 0; transform: none; width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; }
  .modal.wide { width: 100%; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { padding: 24px 20px; gap: 12px; }
  .auth-pitch { font-size: 19px; max-width: none; }
  .auth-points { display: none; }
  .auth-main { padding: 16px; }
  .auth-card { padding: 20px; }
  .rowlist li { height: 56px; }
  .rowlist li > .trunc, .rowlist li > .who-row { flex-basis: 56%; }
}
@media (max-width: 560px) {
  /* the spine keeps its meaning: template above its block on a dashed vertical edge, blocks full width */
  .cv { padding: 14px 10px 24px; }
  .cv-row { grid-template-columns: minmax(0, 1fr); width: 100%; max-width: var(--step); }
  .cv-c1, .cv-c3 { grid-column: 1; }
  .cv-sup { grid-column: 1; width: 0; height: 14px; border-top: 0; border-left: 1.5px dashed var(--line-2); justify-self: start; margin-left: 24px; }
  .cv-flowrow { max-width: var(--step); }
  .cv-branch { width: 100%; }
}


/* ---------- review round: approval, headers, diffs, proposals, amber steps, read-more ---------- */
.cv-stopbar.warn { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border-top-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.cv-stopbar.warn .cv-iflab { color: var(--warn); }
.cv-card.dropped { border-left: 3px solid var(--warn); }
.hdrs { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--sunken); font-size: var(--t-sm); }
.hdrs dt { color: var(--ink-3); font-family: var(--mno); }
.hdrs dd { min-width: 0; overflow-wrap: anywhere; font-family: var(--mno); }
.hdrs .flag { color: var(--stop); font-weight: 600; }
.diff { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: 400 12.5px/1.55 var(--mno); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
.diff .add { color: var(--go); }
.diff .del { color: var(--stop); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--stop) 50%, transparent); }
.review-box { display: grid; gap: 10px; padding: 12px 14px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent); border-left: 3px solid var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.review-box.ok { border-color: color-mix(in srgb, var(--go) 50%, transparent); border-left-color: var(--go); background: color-mix(in srgb, var(--go) 7%, var(--surface)); }
.review-box p { display: flex; align-items: flex-start; gap: 8px; }
.proposal { display: grid; gap: 8px; padding: 12px 14px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent); border-left: 3px solid var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.proposal ul { display: grid; gap: 2px; }
.proposal > p:first-child { display: flex; align-items: flex-start; gap: 8px; }
.fresh-note { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--sunken); font-size: var(--t-sm); }
.rt-more { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: var(--t-sm); text-decoration: underline; text-underline-offset: 3px; justify-self: start; }
.rt-text { display: grid; gap: 2px; min-width: 0; align-content: center; }
.countdown { font-variant-numeric: tabular-nums; }
.step-reason { display: grid; gap: 2px; }
.raw-detail { font: 400 12.5px/1.5 var(--mno); overflow-wrap: anywhere; white-space: pre-wrap; color: var(--ink-2); }
.stat-btn { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.stat-btn:hover { border-color: var(--accent); }

/* ---------- lead deep-dive: who this is, why they fit ---------- */
a.btn { text-decoration: none; }
.who-name { font: 600 var(--t-lg)/1.25 var(--dsp); }
.who-src { display: grid; gap: 2px; font-size: var(--t-sm); }
.li-none { display: grid; gap: 4px; }
.fit-list { display: grid; gap: 16px; }
.fit { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.fit-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fit-n { font: 600 var(--t-md)/1.3 var(--dsp); }
.fit-bar { display: grid; grid-template-columns: minmax(0, 1fr) 76px; align-items: center; gap: 10px; }
.fit-num { text-align: right; font-weight: 600; white-space: nowrap; }
.fitbar { width: 100%; height: 12px; display: block; overflow: visible; }
.fb-track { fill: var(--inset); }
.fb-fill.hit { fill: var(--go); }
.fb-fill.miss { fill: var(--stop); }
.fb-mark { fill: var(--ink); }
.crits { display: grid; gap: 0; border-top: 1px solid var(--line); margin-top: 6px; }
.crit { display: grid; grid-template-columns: minmax(0, 1.4fr) 78px minmax(0, 1.6fr); gap: 6px 10px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.crit-w { white-space: nowrap; }
.crit-res { display: grid; gap: 3px; justify-items: start; min-width: 0; }
.crit-why { overflow-wrap: anywhere; }
.casl-missing { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
@media (max-width: 560px) {
  .crit { grid-template-columns: minmax(0, 1fr) 72px; }
  .crit-res { grid-column: 1 / -1; }
}

/* ---------- research-led outreach: grounding beside the words, edit, plan, writing guide ---------- */
.msg-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-col { display: grid; gap: 8px; min-width: 0; }
@media (min-width: 1280px) { .msg-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.length-line { margin-top: 2px; }
.warm-note { padding: 8px 12px 10px; }
.ground { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-width: 0; align-content: start; }
.ground-warn { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent); border-left: 3px solid var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.ground-warn .ico { margin-top: 3px; color: var(--warn); flex: none; }
.ev { display: grid; gap: 8px; }
.ev-i { display: grid; gap: 4px; padding: 8px 10px; border-radius: 8px; background: var(--sunken); border-left: 3px solid var(--line-2); }
.ev-i.amber { border-left-color: var(--warn); }
.ev-i.red { border-left-color: var(--stop); }
.ev-c { overflow-wrap: anywhere; }
.ev-m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--t-sm); }
.gv { display: grid; gap: 6px; }
.gv li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.gv-n { overflow-wrap: anywhere; }
.edit-body { min-height: 260px; font: 400 14px/1.6 var(--mno); resize: vertical; }
.task { display: grid; gap: 4px; }
.task-t { overflow-wrap: anywhere; }
.plan { display: grid; gap: 12px; margin-bottom: 16px; padding: 16px 20px; }
.pl-chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.pl-step { display: grid; align-content: start; gap: 4px; width: 188px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.pl-mail { border-top: 3px solid var(--t-action); }
.pl-task { border-top: 3px solid var(--t-input); }
.pl-stop { border-top: 3px solid var(--stop); }
.pl-ico { color: var(--ink-3); }
.pl-t { font: 600 var(--t-md)/1.2 var(--dsp); }
.pl-s { font-size: var(--t-sm); line-height: 1.35; }
.pl-need { margin-top: 2px; }
.pl-arrow { align-self: center; color: var(--ink-3); font-size: var(--t-lg); }
.pl-rules { display: grid; gap: 6px; }
.pl-rulelist { display: flex; flex-wrap: wrap; gap: 6px; }
.guide { display: grid; gap: 14px; }
.guide-sec { display: grid; gap: 8px; }
.guide-p { max-width: 80ch; color: var(--ink-2); }
.guide-list { list-style: decimal; padding-left: 20px; display: grid; gap: 4px; }
.guide-tbl { table-layout: auto; }
.guide-tbl td { height: auto; vertical-align: top; font-size: var(--t-sm); }
.guide-tbl .g0 { width: 38%; } .guide-tbl .g1 { width: 34%; }
@media (max-width: 760px) {
  .pl-chain { flex-direction: column; align-items: stretch; }
  .pl-step { width: auto; }
  .pl-arrow { align-self: flex-start; transform: rotate(90deg); margin-left: 12px; }
}
