/* Webgentic Outbound. Brand from webgentic.ai: warm canvas, ink, the blue scale; Satoshi headings,
   Inter body, Geist Mono for numbers. One file, no build step. */

@font-face { font-family: 'Satoshi'; src: url('/assets/fonts/satoshi-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('/assets/fonts/satoshi-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/assets/fonts/geist-mono-latin.woff2') format('woff2'); font-weight: 400 500; font-display: swap; }

:root {
  --canvas: #F6F5F2;
  --surface: #FFFFFF;
  --sunk: #EFEDE8;
  --ink: #111214;
  --body: #1B1B1B;
  --muted: #5E636E;
  --line: rgba(17, 18, 20, .10);
  --line-2: rgba(17, 18, 20, .18);
  --blue: #A0E1F7;
  --blue-mid: #2E9CC4;
  --blue-ink: #1A5F7A;
  --blue-deep: #0D3E52;
  --blue-wash: #E8F6FB;
  --ok: #0E7C66; --ok-wash: #E3F3EE;
  --warn: #9A4A06; --warn-wash: #FCF1E1;
  --bad: #B42318; --bad-wash: #FCEBE9;
  --info: #1A5F7A; --info-wash: #E8F6FB;
  --neutral: #4F5560; --neutral-wash: #ECEBE7;
  --head: 'Satoshi', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, Consolas, monospace;
  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(17, 18, 20, .04), 0 2px 8px rgba(17, 18, 20, .03);
  --side: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--body); background: var(--canvas); overflow-x: clip; }
h1, h2, h3 { font-family: var(--head); color: var(--ink); letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 700; margin: 0; }
h2 { font-size: 19px; font-weight: 700; margin: 0 0 6px; }
h3 { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
p { margin: 0 0 10px; }
a { color: var(--blue-ink); text-underline-offset: 3px; }
a:hover { color: var(--blue-deep); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
code { font-family: var(--mono); font-size: 13px; background: var(--sunk); padding: 1px 5px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mt { margin-top: 22px; }
:focus-visible { outline: 2px solid var(--blue-mid); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Shell ------------------------------------------------------------------------------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--ink); color: rgba(255, 255, 255, .78); display: flex; flex-direction: column; padding: 18px 14px; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 8px 18px; }
.brand:hover { color: #fff; }
.brand strong { display: block; font-family: var(--head); font-size: 16px; letter-spacing: -.01em; }
.brand span span { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .6); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--blue); color: var(--blue-deep); display: grid; place-items: center; font: 700 17px/1 var(--head); flex: none; }
.brand-mark.big { width: 48px; height: 48px; border-radius: 13px; font-size: 24px; margin-bottom: 18px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 10px; min-height: 42px; border-radius: var(--r-sm); color: rgba(255, 255, 255, .78); text-decoration: none; font-weight: 500; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.on { background: rgba(160, 225, 247, .14); color: #fff; }
.side-nav a.on .icon { color: var(--blue); }
.badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--blue); color: var(--blue-deep); font: 600 12px/18px var(--mono); text-align: center; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.send-state { display: block; padding: 12px; border-radius: var(--r-sm); text-decoration: none; border: 1px solid rgba(255, 255, 255, .12); }
.send-state strong { display: block; color: #fff; font-size: 14px; }
.send-state span { font-size: 12.5px; color: rgba(255, 255, 255, .65); }
.send-state.live { background: rgba(14, 124, 102, .22); border-color: rgba(98, 214, 180, .35); }
.send-state.paused { background: rgba(214, 140, 40, .16); border-color: rgba(240, 180, 90, .35); }
.who { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; font-size: 12.5px; }
.who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: rgba(255, 255, 255, .78); font: inherit; cursor: pointer; padding: 6px 4px; min-height: 32px; }
.link-btn:hover { color: #fff; }
.link-btn .icon { width: 16px; height: 16px; }
.topbar, .tabbar { display: none; }

.main { margin-left: var(--side); padding: 28px 40px 80px; max-width: calc(var(--side) + 1180px); }
.main.wide { max-width: none; }
.page-head { margin-bottom: 22px; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.subtitle { margin: 6px 0 0; color: var(--muted); max-width: 70ch; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.back .icon { width: 16px; height: 16px; }
.back:hover { color: var(--ink); }

/* ---- Buttons ------------------------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: var(--r-sm); font: 600 14.5px/1 var(--font); text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s; }
.btn .icon { width: 17px; height: 17px; }
.btn.primary { background: var(--blue-deep); color: #fff; }
.btn.primary:hover { background: var(--blue-ink); color: #fff; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--blue-ink); }
.btn.ghost:hover { background: var(--blue-wash); color: var(--blue-deep); }
.btn.danger-outline { background: var(--surface); color: var(--bad); border-color: rgba(180, 35, 24, .35); }
.btn.danger-outline:hover { border-color: var(--bad); background: var(--bad-wash); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn.big { min-height: 50px; padding: 0 22px; font-size: 16px; }
.btn.wide { width: 100%; }
.btn[disabled], .btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; }
.btn.is-busy { opacity: .7; pointer-events: none; }
kbd { font: 500 11.5px/1 var(--mono); padding: 2px 5px; border-radius: 4px; border: 1px solid currentColor; opacity: .7; }
form.inline { display: inline-flex; margin: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.spacer { flex: 1; }

/* ---- Pills, tags -------------------------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.pill.ok { background: var(--ok-wash); color: var(--ok); }
.pill.warn { background: var(--warn-wash); color: var(--warn); }
.pill.bad { background: var(--bad-wash); color: var(--bad); }
.pill.info { background: var(--info-wash); color: var(--info); }
.pill.neutral { background: var(--neutral-wash); color: var(--neutral); }
.pills { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tag-list { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list li { font-size: 13px; padding: 3px 9px; border-radius: 6px; background: var(--sunk); color: var(--ink); }
.label-sm { font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }
.warn-text { color: var(--warn); font-size: 12.5px; font-weight: 600; }

/* ---- Cards and layout -------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 30px 0 12px; }
.section-head h2 { font-size: 21px; }
.section-title { font-size: 21px; margin: 28px 0 12px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.two-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.note { background: var(--blue-wash); border-radius: var(--r-sm); padding: 12px 14px; margin: 10px 0; color: var(--ink); }

/* Flash and error summary */
.flash { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: var(--r-sm); margin: 0 0 18px; border: 1px solid; font-weight: 500; }
.flash.ok { background: var(--ok-wash); border-color: rgba(14, 124, 102, .25); color: #0A5A4A; }
.flash.err { background: var(--bad-wash); border-color: rgba(180, 35, 24, .25); color: #8A1A12; }
.error-summary { border: 2px solid var(--bad); border-radius: var(--r-sm); padding: 14px 18px; margin-bottom: 18px; background: var(--surface); }
.error-summary h2 { font-size: 17px; color: var(--bad); }
.error-summary ul { margin: 6px 0 0; padding-left: 18px; }
.error-summary a { color: var(--bad); font-weight: 600; }

/* Empty states */
.empty { text-align: center; padding: 40px 24px; border: 1px dashed var(--line-2); border-radius: var(--r); background: rgba(255, 255, 255, .5); }
.empty h3 { font-size: 18px; margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 52ch; margin: 0 auto 14px; }
.empty-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 20px; overflow-x: auto; scrollbar-width: thin; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; min-height: 44px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tabs .count { font: 500 12px/18px var(--mono); padding: 0 6px; border-radius: 999px; background: var(--sunk); color: var(--muted); }
.tabs a.on .count { background: var(--ink); color: #fff; }

/* Meter: a native <progress>, styled */
progress.meter { display: block; width: 100%; height: 10px; margin: 14px 0; border: 0; border-radius: 999px; background: var(--sunk); overflow: hidden; -webkit-appearance: none; appearance: none; color: var(--blue-mid); }
progress.meter.thin { height: 6px; margin: 10px 0 14px; }
progress.meter::-webkit-progress-bar { background: var(--sunk); border-radius: 999px; }
progress.meter::-webkit-progress-value { background: var(--blue-mid); border-radius: 999px; }
progress.meter::-moz-progress-bar { background: var(--blue-mid); border-radius: 999px; }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 6px 0 0; }
.facts.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; color: var(--ink); }
.facts dd.num { font-size: 24px; font-weight: 500; letter-spacing: -.02em; }
.facts dd.num span { font-size: 14px; color: var(--muted); }

/* ---- Forms ------------------------------------------------------------------------------- */
.field { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 600; color: var(--ink); margin-bottom: 4px; font-size: 14.5px; padding: 0; }
.hint { display: block; font-size: 13px; color: var(--muted); margin: -1px 0 6px; }
.optional { font-weight: 400; color: var(--muted); }
.field-error { display: block; color: var(--bad); font-size: 13.5px; font-weight: 600; margin: 0 0 6px; }
.field-error[hidden] { display: none; }
.has-error input, .has-error textarea, input[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
input[type=text], input[type=email], input[type=url], input[type=time], input:not([type]), textarea, select { display: block; width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-sm); }
textarea { resize: vertical; line-height: 1.5; }
input.short { max-width: 160px; }
input:focus, textarea:focus { outline: 2px solid var(--blue-mid); outline-offset: 0; border-color: var(--blue-mid); }
input::placeholder, textarea::placeholder { color: #8A8F98; }
.form-card { max-width: 780px; }
.check-line { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: 14.5px; color: var(--ink); cursor: pointer; }
.check-line input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--blue-deep); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 14px; color: var(--ink); user-select: none; }
.chip span:hover { border-color: var(--ink); }
.chip input:checked + span { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.chip input:checked + span::before { content: '\2713'; margin-right: 6px; font-weight: 700; }
.chip input:focus-visible + span { outline: 2px solid var(--blue-mid); outline-offset: 2px; }
.toggle { display: flex; align-items: flex-start; gap: 12px; margin: 14px 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { width: 44px; height: 26px; border-radius: 999px; background: #C9C7C1; position: relative; flex: none; margin-top: 1px; transition: background-color .15s; }
.toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.toggle input:checked + .toggle-track { background: var(--ok); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--blue-mid); outline-offset: 2px; }
.toggle-text strong { display: block; color: var(--ink); font-size: 14.5px; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.inline-form .field { margin: 0; }
.inline-form .grow { flex: 1 1 280px; }
.alt-links { margin-top: 6px; }
details > summary { cursor: pointer; color: var(--blue-ink); font-weight: 600; min-height: 32px; display: flex; align-items: center; gap: 6px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; flex: none; }
details[open] > summary::before { transform: rotate(45deg); }

/* ---- Tables ------------------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
th { font-weight: 600; font-size: 13px; color: var(--muted); background: #FBFAF8; }
tbody tr:hover td { background: #FCFBF9; }

/* ---- Home -------------------------------------------------------------------------------- */
.tasks { display: grid; gap: 12px; margin-bottom: 20px; }
.task { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); }
.task h3 { font-size: 18px; }
.task p { margin: 0; color: var(--muted); }
.task.bad { background: var(--bad-wash); border-color: rgba(180, 35, 24, .25); }
.sending.is-paused { background: #FFFDF8; }
.steps { list-style: none; padding: 0; margin: 0 0 8px; }
.steps li { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.steps li p { margin: 2px 0 0; font-size: 13.5px; }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 13px/1 var(--mono); border: 1.5px solid var(--line-2); color: var(--muted); }
.steps li.done .step-n { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.done strong { color: var(--muted); font-weight: 500; }
.steps li.next .step-n { border-color: var(--blue-deep); color: var(--blue-deep); }
.keys { margin-top: 6px; }
.key-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.key-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.key-list.big li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.mini-camp { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.mini-camp:hover .mini-name { text-decoration: underline; }
.mini-name { font-weight: 600; }
.mini-nums { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.mini-nums b { color: var(--ink); font-weight: 500; }

/* ---- Campaigns --------------------------------------------------------------------------- */
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.camp-card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; text-decoration: none; color: var(--body); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.camp-card:hover { border-color: var(--line-2); transform: translateY(-1px); color: var(--body); }
.camp-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.camp-top h2 { font-size: 18px; margin: 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-size: 14px; }
.funnel { list-style: none; padding: 12px 0 0; margin: auto 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; border-top: 1px solid var(--line); }
.funnel li { display: flex; flex-direction: column; }
.funnel b { font-size: 20px; font-weight: 500; color: var(--ink); }
.funnel span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.funnel li.hot b { color: var(--warn); }
.stages { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.stages li { padding: 14px 16px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; }
.stages li:first-child { border-left: 0; }
.stages b { font-size: 26px; font-weight: 500; color: var(--ink); letter-spacing: -.02em; }
.stage-label { font-weight: 600; color: var(--ink); font-size: 14px; }
.stage-hint { font-size: 12.5px; color: var(--muted); }
.stages li.hot { background: var(--warn-wash); }
.stages li.hot b { color: var(--warn); }
.with-agent { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.agent { position: sticky; top: 20px; }
.agent h2 { display: flex; align-items: center; gap: 8px; }
.agent h2 .icon { color: var(--blue-mid); }
.thread { list-style: none; padding: 0; margin: 10px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.msg p { margin: 0; }
.msg .who { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.msg.you { background: var(--sunk); margin-left: 32px; }
.msg.agent { background: var(--blue-wash); margin-right: 12px; }
.msg.err { background: var(--bad-wash); }
.diff { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.diff li { background: #fff; border-radius: var(--r-sm); padding: 10px; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); }
.diff-from { text-decoration: line-through; color: var(--muted); font-size: 13px; }
.diff-to { color: var(--ink); font-weight: 500; background: var(--ok-wash); border-radius: 4px; padding: 2px 6px; }
.more-tags { margin: -4px 0 10px; font-size: 13.5px; }
.more-tags .tag-list { margin-top: 6px; }
.steer-label { display: block; font-weight: 600; color: var(--ink); font-size: 14px; margin: 4px 0 4px; }
.steer-form textarea { margin-bottom: 8px; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.activity li:first-child { border-top: 0; }
.activity time { white-space: nowrap; }
.brief { margin: 0; display: grid; gap: 0; }
.brief-item { padding: 14px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 210px 1fr; gap: 16px; }
.brief-item dt { font-weight: 600; color: var(--ink); font-size: 14px; }
.brief-item dd { margin: 0; }
.size-result { margin-bottom: 12px; }
.size-result strong { font-size: 26px; font-weight: 500; }
.sample { margin: 0 0 10px; padding-left: 18px; font-size: 14px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.pick-list { list-style: none; padding: 0; margin: 0; }
.pick-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.pick-list li p { margin: 2px 0 0; }

/* Mail rendering, shared by review and preview */
.mail-card { border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: 16px 18px; margin-bottom: 12px; }
.mail-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.mail-n { font: 700 14px/1 var(--head); color: var(--ink); }
.mail-card.has-problem { border-color: rgba(154, 74, 6, .4); }
.subject { font-weight: 600; color: var(--ink); margin: 0 0 8px; }
.subject .muted { font-weight: 400; margin-right: 6px; }
pre.mail { white-space: pre-wrap; word-wrap: break-word; font: 15px/1.6 var(--font); color: var(--body); margin: 0; }
.rule-fail { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--warn-wash); color: #6B3304; font-size: 14px; }
.sig { margin: 4px 0 12px; }
.sig pre.mail { font-size: 13.5px; color: var(--muted); padding: 10px 0 0; }
.preview-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.obs { background: var(--blue-wash); padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; }
.mail-stack { display: grid; gap: 0; }

/* ---- Review ------------------------------------------------------------------------------ */
.review { display: grid; grid-template-columns: 230px minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.queue { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
.queue-head { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.queue ol { list-style: none; margin: 0; padding: 4px; }
.queue a { display: flex; flex-direction: column; padding: 9px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); min-height: 44px; }
.queue a span { font-size: 13px; color: var(--muted); }
.queue a:hover { background: var(--sunk); }
.queue a.on { background: var(--blue-wash); }
.review-main { min-width: 0; }
.person-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.person-head h2 { font-size: 24px; margin: 0; }
.pager { display: flex; gap: 4px; }
.from-line { font-size: 14px; margin: 6px 0 14px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.decide { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: sticky; bottom: 0; background: var(--canvas); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 8px; z-index: 2; }
.kbd-hint { margin-top: 6px; }
.context { display: flex; flex-direction: column; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 18px; position: sticky; top: 20px; }
.context section { padding: 14px 0; border-top: 1px solid var(--line); }
.context section:first-child { border-top: 0; }
.context h3 { font-size: 14px; color: var(--muted); font-family: var(--font); font-weight: 600; margin-bottom: 6px; }
.context p { margin: 0 0 4px; }
blockquote { margin: 0; padding: 10px 12px; background: var(--blue-wash); border-radius: var(--r-sm); font-size: 14px; color: var(--ink); }
.fact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 13.5px; }
.src { font-size: 12.5px; }
.danger-zone { padding: 14px 0; border-top: 1px solid var(--line); }
.danger-zone summary { color: var(--bad); font-size: 14px; }
.edit-form textarea { font: 15px/1.6 var(--font); }
.bulk-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.word-count { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: block; }
.word-count.over { color: var(--bad); font-weight: 600; }

/* ---- Replies ----------------------------------------------------------------------------- */
.reply-list { display: grid; gap: 10px; }
.reply { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.reply.handled { opacity: .75; }
.reply-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reply-head h3 { font-size: 16px; margin: 0; flex: 1; min-width: 200px; }
.reply-note { margin: 8px 0 4px; color: var(--ink); }
.reply details { margin-top: 6px; }
.reply details summary { color: var(--muted); font-weight: 400; }
.reply-body { padding: 10px 0 0; }
.reply .row { margin-top: 10px; }

/* ---- Strategy ---------------------------------------------------------------------------- */
.progress-steps { list-style: none; padding: 0; margin: 0 0 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.progress-steps li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.progress-steps .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 600 12.5px/1 var(--mono); background: var(--sunk); }
.progress-steps li.now { color: var(--ink); border-color: var(--ink); font-weight: 600; }
.progress-steps li.now .n { background: var(--ink); color: #fff; }
.progress-steps li.done .n { background: var(--ok); color: #fff; }
.hero-card { padding: 32px; max-width: 820px; }
.hero-card h2 { font-size: 26px; }
.lead { font-size: 16.5px; color: var(--body); max-width: 62ch; }
.start-form { margin-top: 18px; max-width: 560px; }
.start-form .more { margin: -4px 0 16px; }
.start-form .more .field { margin-top: 10px; }
.three-up { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 820px; margin-top: 8px; }
.three-up > div { padding: 16px 4px; border-top: 2px solid var(--ink); }
.callout { display: flex; justify-content: space-between; align-items: center; gap: 18px; background: var(--blue-deep); color: rgba(255, 255, 255, .85); border-color: var(--blue-deep); }
.callout h2 { color: #fff; }
.callout .muted { color: rgba(255, 255, 255, .75); margin: 0; }
.callout .btn.primary { background: var(--blue); color: var(--blue-deep); }
.callout .btn.primary:hover { background: #fff; }
.question-card { max-width: 760px; padding: 30px; }
.q-count { font: 500 13px/1 var(--mono); color: var(--muted); margin: 0; }
h2.q { font-size: 25px; margin: 8px 0 8px; }
.why { margin-bottom: 18px; }
.options { border: 0; padding: 0; margin: 0 0 16px; }
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.option { position: relative; display: block; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option span { display: flex; align-items: center; min-height: 52px; padding: 10px 16px 10px 44px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; color: var(--ink); position: relative; }
.option span::before { content: ''; position: absolute; left: 16px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border: 1.5px solid var(--line-2); border-radius: 50%; background: #fff; }
.option input[type=checkbox] + span::before { border-radius: 4px; }
.option span:hover { border-color: var(--ink); }
.option input:checked + span { border-color: var(--blue-deep); background: var(--blue-wash); font-weight: 600; }
.option input:checked + span::before { background: var(--blue-deep); border-color: var(--blue-deep); box-shadow: inset 0 0 0 3px #fff; }
.option input:focus-visible + span { outline: 2px solid var(--blue-mid); outline-offset: 2px; }
.q-actions { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.summary-line { font: 500 18px/1.45 var(--head); color: var(--ink); margin: 6px 0 16px; max-width: 70ch; }
.profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 26px; }
.profile-grid h3 { font-size: 14px; color: var(--muted); font-family: var(--font); font-weight: 600; margin-bottom: 6px; }
.profile-grid ul { margin: 0; padding-left: 18px; font-size: 14.5px; }
.profile-grid li { margin-bottom: 5px; }
.offers { list-style: none; padding: 0 !important; }
.offers li strong { display: block; color: var(--ink); }
.answers { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 26px; }
.qa dt { font-size: 13.5px; color: var(--muted); }
.qa dd { margin: 2px 0 0; color: var(--ink); }
.pages, .restart { margin-top: 14px; }
.pages ul { font-size: 14px; }
.audience-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.audience { display: flex; flex-direction: column; margin: 0; }
.audience header { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.audience h3 { font-size: 19px; }
.audience.used { background: #FBFAF8; }
.audience .legal dl { margin-top: 8px; }
.audience footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.fit { color: var(--ink); font-weight: 500; }
.aud-detail { margin: 0 0 6px; display: grid; gap: 8px; }
.aud-detail dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.aud-detail dd { margin: 0; font-size: 14.5px; }
.legal { margin: 4px 0 8px; font-size: 14px; }
.legal p { margin-top: 6px; color: var(--muted); }
.suggest { margin-top: 16px; }

/* Live job */
.job { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; background: #FBFAF8; margin: 10px 0; }
.job-head { display: flex; align-items: center; gap: 10px; }
.job-log { list-style: none; padding: 0; margin: 10px 0 8px; display: grid; gap: 4px; font-size: 14px; }
.job-log li { padding-left: 22px; position: relative; color: var(--muted); }
.job-log li::before { content: '\2713'; position: absolute; left: 2px; color: var(--ok); font-weight: 700; }
.job-log li:last-child { color: var(--ink); font-weight: 500; }
.job-log li:last-child::before { content: '\2022'; color: var(--blue-mid); }
.job.failed { background: var(--bad-wash); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--blue); border-top-color: var(--blue-deep); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Public pages ------------------------------------------------------------------------ */
body.plain { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.plain-main { width: 100%; max-width: 460px; }
.plain-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 36px; box-shadow: var(--shadow); }
.plain-card h1 { font-size: 26px; margin-bottom: 10px; }
.plain-card .btn { margin: 10px 0 12px; }

/* ---- Responsive -------------------------------------------------------------------------- */
@media (max-width: 1280px) {
  .review { grid-template-columns: 220px minmax(0, 1fr); }
  .context { grid-column: 2; position: static; }
  .with-agent { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 1100px) {
  .home-grid, .with-agent, .two-cards, .choice-grid { grid-template-columns: 1fr; }
  .agent { position: static; }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 10; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--ink); }
  .topbar .brand { padding: 0; }
  .topbar .brand-mark { width: 28px; height: 28px; font-size: 15px; }
  .top-settings { display: inline-flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .85); text-decoration: none; min-height: 44px; padding: 0 6px; font-weight: 500; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; min-height: 52px; font-size: 11.5px; color: var(--muted); text-decoration: none; position: relative; border-radius: var(--r-sm); }
  .tabbar a.on { color: var(--blue-deep); font-weight: 600; background: var(--blue-wash); }
  .tabbar .badge { position: absolute; top: 2px; left: 55%; margin: 0; min-width: 18px; padding: 0 5px; font-size: 11px; line-height: 16px; background: var(--blue-deep); color: #fff; }
  .main { margin-left: 0; padding: 20px 16px 110px; }
  h1 { font-size: 24px; }
  .review { grid-template-columns: 1fr; }
  .queue { display: none; }
  .context { grid-column: auto; }
  .stages { grid-template-columns: repeat(5, minmax(120px, 1fr)); overflow-x: auto; }
  .decide { bottom: 64px; }
  .task { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .two, .facts, .facts.four, .three-up, .profile-grid, .answers, .option-grid { grid-template-columns: 1fr; }
  .facts.four { grid-template-columns: repeat(2, 1fr); }
  .brief-item { grid-template-columns: 1fr; gap: 4px; }
  .camp-grid, .audience-grid { grid-template-columns: 1fr; }
  .funnel { grid-template-columns: repeat(3, 1fr); }
  .callout { flex-direction: column; align-items: flex-start; }
  .card, .hero-card, .question-card { padding: 18px; }
  .page-actions { width: 100%; }
  .steps li { grid-template-columns: 30px 1fr; }
  .steps li .btn { grid-column: 2; justify-self: start; }
  .decide .spacer { display: none; }
  .kbd-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .spinner { animation: none; border-top-color: var(--blue); }
}
