/* Outbound Console. Warm monochrome, matching Replyslate's Notion theme. */
:root {
  color-scheme: light;
  --canvas: #ffffff;
  --sidebar: #f7f7f5;
  --surface: #ffffff;
  --soft: #f7f7f5;
  --hover: #efefed;
  --line: #e9e9e6;
  --line-strong: #dcdcd8;
  --text: #37352f;
  --muted: #787774;
  --subtle: #9b9a97;
  --accent: #37352f;
  --accent-text: #ffffff;
  --focus: #969592;
  --good: #2f7d4f;
  --good-bg: #e7f3ec;
  --info: #2a62a8;
  --info-bg: #e8f0fa;
  --warn: #8a5a12;
  --warn-bg: #fbf1df;
  --bad: #b23a2e;
  --bad-bg: #fbe9e6;
  --neutral-bg: #f1f1ef;
  --bar: #d9d8d4;
  --bar-strong: #37352f;
  --radius: 6px;
  --shadow: 0 16px 48px #26262224;
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #191919;
    --sidebar: #202020;
    --surface: #1f1f1f;
    --soft: #252525;
    --hover: #2c2c2c;
    --line: #2f2f2f;
    --line-strong: #3a3a3a;
    --text: #e6e5e2;
    --muted: #9b9a97;
    --subtle: #7a7976;
    --accent: #e6e5e2;
    --accent-text: #191919;
    --focus: #7a7976;
    --good: #6cc08f;
    --good-bg: #1f3328;
    --info: #79a8e8;
    --info-bg: #1d2a3b;
    --warn: #e2b25f;
    --warn-bg: #3a2e1a;
    --bad: #ef8a7d;
    --bad-bg: #3d2320;
    --neutral-bg: #2a2a2a;
    --bar: #3a3a3a;
    --bar-strong: #e6e5e2;
    --shadow: 0 16px 48px #00000080;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--canvas); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .45; cursor: default; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* layout */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100dvh; }
.side { background: var(--sidebar); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100dvh; }
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 8px 6px; font-weight: 700; font-size: 17px; letter-spacing: -.4px; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; }
.brand-mark svg { width: 14px; height: 14px; }
.ws-select { width: 100%; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: var(--radius); color: var(--muted); text-decoration: none; }
.nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a[aria-current="page"] { background: var(--hover); color: var(--text); font-weight: 600; }
.nav .count { margin-left: auto; font-size: 11px; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--bad-bg); color: var(--bad); text-align: center; font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.link-button { color: var(--muted); text-align: left; padding: 4px 9px; border-radius: var(--radius); }
.link-button:hover { color: var(--text); background: var(--hover); }
main { min-width: 0; padding: 28px 32px 64px; max-width: 1180px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; letter-spacing: -.4px; font-weight: 700; }
.page-head p { color: var(--muted); margin-top: 3px; }
.crumb { color: var(--muted); text-decoration: none; font-size: 12px; display: inline-block; margin-bottom: 6px; }
.crumb:hover { color: var(--text); }
section { margin-top: 28px; }
section > h2 { font-size: 13px; font-weight: 650; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
section > h2 .muted { font-weight: 400; }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { opacity: .88; background: var(--accent); }
.btn.small { padding: 3px 8px; font-size: 12px; }
.btn.danger { color: var(--bad); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
td .row-actions { flex-wrap: nowrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 11px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.select-inline { padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 13px 14px; background: var(--surface); }
.tile .label { color: var(--muted); font-size: 12px; }
.tile .value { font-size: 24px; font-weight: 650; letter-spacing: -.5px; margin-top: 3px; }
.tile .sub { color: var(--muted); font-size: 12px; margin-top: 1px; }

/* chart */
.chart { border: 1px solid var(--line); border-radius: 8px; padding: 14px 14px 8px; background: var(--surface); }
.chart svg { width: 100%; height: 150px; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* tables */
.table-wrap { border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 550; color: var(--muted); font-size: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--soft); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--soft); }
td.right, th.right { text-align: right; white-space: nowrap; }
.person b { font-weight: 600; }
.person small, td small { display: block; color: var(--muted); font-size: 12px; }
.snippet { color: var(--text); max-width: 520px; white-space: pre-line; overflow-wrap: anywhere; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.feed li { padding: 10px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.feed li:last-child { border-bottom: 0; }
.feed-top { display: flex; gap: 6px; align-items: center; }
.feed-when { margin-left: auto; font-size: 12px; }
.feed .snippet { font-size: 12.5px; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 550; white-space: nowrap; background: var(--neutral-bg); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.plain::before { display: none; }
.ws-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; white-space: nowrap; }

/* steps */
.steps { display: grid; gap: 10px; }
.step { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--surface); display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; }
.step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--neutral-bg); display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.step .meta { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.step .subject { font-weight: 600; margin-bottom: 4px; }
.step pre { margin: 0; font: inherit; white-space: pre-wrap; color: var(--text); max-height: 160px; overflow: auto; }
.step .stats { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.step .stats b { color: var(--text); font-size: 15px; }

/* notices, dialogs, sign-in */
.notice { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--soft); color: var(--muted); }
.notice.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.notice.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.signin { max-width: 400px; margin: 14vh auto; padding: 0 16px; }
.signin h1 { font-size: 22px; margin: 18px 0 6px; letter-spacing: -.4px; }
.signin p { color: var(--muted); margin-bottom: 18px; }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 550; }
.field input, .field select { padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); width: 100%; }
.check { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 16px; }
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; width: min(720px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: #0000004d; }
.dialog-body { padding: 20px 22px; display: grid; gap: 14px; max-height: 80vh; overflow: auto; }
.dialog-body h2 { font-size: 16px; }
.dialog-foot { padding: 12px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-text); padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow); z-index: 10; }
.loading { color: var(--muted); padding: 24px 0; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.split-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.split-head h2 { font-size: 13px; font-weight: 650; }
.menu-button { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 5; transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow); }
  .shell.nav-open .side { transform: none; }
  .menu-button { display: inline-flex; margin-bottom: 12px; }
  main { padding: 16px 16px 48px; }
  .step { grid-template-columns: 1fr; }
  .step .stats { text-align: left; }
}

/* ---- shared form bits ---- */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="number"], select, textarea { font: inherit; color: var(--text); }
.field textarea, .step-editor textarea, .step-editor input[type="text"] { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.field textarea { resize: vertical; }
.field small { font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.check-row { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 0; }
.check-inline { display: inline-flex; gap: 7px; align-items: center; font-size: 13px; white-space: nowrap; }
.inline-form { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(160px, 2fr) auto; gap: 0 12px; align-items: end; }
.inline-form .btn { margin-bottom: 12px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.search, .toolbar input { padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); min-width: min(320px, 100%); }
.split-head .search { min-width: 220px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
code { background: var(--neutral-bg); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.notice pre, .snippet-box pre { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.snippet-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); margin-bottom: 8px; }
.snippet-box .split-head { margin-bottom: 0; }
.reasons { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.reasons li { margin: 2px 0; }
.reasons b { color: var(--text); }
.error-text { color: var(--bad); font-size: 12.5px; }
.small-print { font-size: 12px; margin-top: 14px; }
.ext { text-decoration: none; color: var(--info); white-space: nowrap; }
.pill-row { display: flex; gap: 6px; align-items: center; margin-top: 3px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; }
.pager a[aria-disabled="true"] { pointer-events: none; opacity: .4; }
.btn { text-decoration: none; color: inherit; }
.notice b { display: block; color: var(--text); }
.notice small { display: block; margin-top: 4px; }

/* ---- people ---- */
.selection-bar { display: flex; gap: 12px; align-items: center; padding: 8px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); flex-wrap: wrap; }
td input[type="checkbox"], th input[type="checkbox"] { width: 15px; height: 15px; vertical-align: middle; }

/* ---- campaign builder ---- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.builder-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
.builder-fields input, .builder-fields select { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 12px; font-size: 12px; }
.chip { border: 1px solid var(--line-strong); border-radius: 12px; padding: 2px 9px; font-size: 12px; background: var(--surface); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.chip:hover:not(:disabled) { background: var(--hover); }
.steps-editor { display: grid; gap: 12px; margin-bottom: 12px; }
.step-editor { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--surface); display: grid; gap: 8px; }
.step-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.step-top .n { width: 24px; height: 24px; border-radius: 50%; background: var(--neutral-bg); display: grid; place-items: center; font-weight: 600; font-size: 12px; flex-shrink: 0; }
.step-top select, .wait select { padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.wait { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; }
.delay-input { width: 64px; padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.step-tools { margin-left: auto; display: inline-flex; gap: 2px; }
.icon-btn { width: 28px; height: 28px; border-radius: var(--radius); color: var(--muted); font-size: 15px; }
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.segmented { display: inline-flex; padding: 2px; gap: 2px; background: var(--hover); border-radius: 7px; }
.segmented button { padding: 4px 10px; border-radius: 5px; font-size: 12px; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px #00000018; font-weight: 600; }
.variant-tabs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.variant-tabs button { padding: 3px 9px; border-radius: 5px; color: var(--muted); border: 1px solid transparent; }
.variant-tabs button[aria-pressed="true"] { border-color: var(--line-strong); color: var(--text); background: var(--soft); font-weight: 600; }
.variant-tabs .add { color: var(--info); }
.variant-tabs .remove { color: var(--bad); margin-left: auto; }
.builder-preview { position: sticky; top: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); padding: 12px; max-height: calc(100dvh - 32px); overflow: auto; }
.preview-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 8px; font-size: 12px; }
.preview-head h2 { font-size: 13px; }
.picker { position: relative; margin-bottom: 10px; }
.picker input { width: 100%; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.picker-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 2; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.picker-results:empty { display: none; }
.picker-results p { padding: 8px 10px; }
.picker-item { display: block; width: 100%; text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.picker-item:hover { background: var(--hover); }
.picker-item small { display: block; color: var(--muted); font-size: 12px; }
.preview-steps { display: grid; gap: 8px; }
.preview-step { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 10px 11px; }
.preview-step.bad { border-color: var(--bad); }
.preview-step .meta { color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.preview-step .subject { font-weight: 600; margin-bottom: 4px; }
.preview-step pre { margin: 0; font: inherit; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .builder { grid-template-columns: 1fr; }
  .builder-preview { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .builder-fields, .inline-form { grid-template-columns: 1fr; }
}
.wait-note { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--soft); border-radius: var(--radius); padding: 6px 9px; }

/* ---- conversation ---- */
.thread-facts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -8px 0 18px; color: var(--muted); }
.chip-link { text-decoration: none; display: inline-flex; gap: 4px; align-items: center; font-size: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 1px 4px 1px 9px; color: var(--text); }
.thread { display: grid; gap: 10px; margin-bottom: 18px; }
.bubble { border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; background: var(--surface); max-width: 760px; }
.bubble.out { justify-self: end; background: var(--soft); }
.bubble.li { border-style: dashed; }
.bubble.warn { border-color: var(--warn); }
.bubble-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; margin-bottom: 5px; }
.bubble-when { margin-left: auto; }
.bubble-subject { font-weight: 600; margin-bottom: 4px; }
.bubble pre { margin: 0 0 6px; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.composer { border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px; background: var(--surface); display: grid; gap: 10px; max-width: 760px; margin-left: auto; }
.composer-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.composer-row label { display: grid; gap: 4px; font-size: 12px; font-weight: 550; }
.composer select, .composer input, .composer textarea { width: 100%; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.composer textarea { resize: vertical; }
.feed li.clickable { cursor: pointer; }
.feed li.clickable:hover { background: var(--soft); }
@media (max-width: 860px) { .composer-row { grid-template-columns: 1fr; } }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; overflow-wrap: anywhere; }
.good-text { color: var(--good); }
.bad-text { color: var(--bad); font-weight: 600; }
.wide { width: 100%; justify-content: center; padding: 9px; }
.key-signin { margin-top: 18px; color: var(--muted); }
.key-signin summary { cursor: pointer; font-size: 12px; margin-bottom: 10px; }
.new-ws { font-size: 12px; margin-top: -6px; }
a.link-button { text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
