/* Fast by Zointy — WhatsApp automation. One stylesheet for the landing page and the app. */
:root {
  --brand: #16a34a; --brand-600: #15803d; --brand-50: #ecfdf3; --brand-100: #d1fadf;
  --bg: #f6f7f9; --surface: #fff; --surface-2: #f2f4f7; --border: #e4e7ec; --border-strong: #d0d5dd;
  --text: #101828; --text-2: #344054; --muted: #667085;
  --danger: #d92d20; --danger-50: #fef3f2; --warn: #b54708; --warn-50: #fffaeb; --info: #2e6fdb; --info-50: #eef4ff;
  --hot: #e04f16; --hot-50: #fff4ed; --violet: #6941c6; --violet-50: #f4f3ff;
  --chat-bg: #efeae2; --bubble-out: #d9fdd3; --bubble-in: #fff;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px -8px rgba(16,24,40,.18), 0 4px 8px -4px rgba(16,24,40,.06);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #22c55e; --brand-600: #16a34a; --brand-50: #0f2a1a; --brand-100: #14532d;
    --bg: #0c111d; --surface: #161b26; --surface-2: #1f2430; --border: #2a303c; --border-strong: #3a4150;
    --text: #f5f5f6; --text-2: #cecfd2; --muted: #94969c;
    --danger: #f97066; --danger-50: #3a1513; --warn: #fdb022; --warn-50: #33240b; --info: #84adff; --info-50: #142142;
    --hot: #fb6514; --hot-50: #3a1d0c; --violet: #9e77ed; --violet-50: #241b3d;
    --chat-bg: #0b141a; --bubble-out: #005c4b; --bubble-in: #202c33;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px -8px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-600); text-decoration: none; }
@media (prefers-color-scheme: dark) { a { color: var(--brand); } }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }
.ic { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.warn-text { color: var(--warn); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.small-gap { gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.btn-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-row form { display: contents; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; box-shadow: var(--shadow); transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
@media (prefers-color-scheme: dark) { .btn-primary { color: #052e16; } }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-50); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 550; font-size: 13px; color: var(--text-2); }
label small { font-weight: 400; }
input, select, textarea { width: 100%; font: 14px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 11px; min-height: 38px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; accent-color: var(--brand); margin: 2px 0 0; flex: none; }
input[type=file] { padding: 7px; }
.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 450; }
fieldset.sub { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; align-items: start; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: 1fr 1.3fr 1fr auto; align-items: end; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; min-width: 160px; flex: 1; }
.radio-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.radio-row input[type=datetime-local] { width: auto; }
.search { position: relative; flex-direction: row; align-items: center; }
.search .ic { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 32px; }
.switch { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 36px; height: 20px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: transform .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.copy-field { display: flex; gap: 6px; }
.copy-field input { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { flex-direction: row; }
.seg input { position: absolute; opacity: 0; }
.seg span { padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 99px; cursor: pointer; font-weight: 600; }
.seg input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-600); }
@media (prefers-color-scheme: dark) { .seg input:checked + span { color: var(--brand); } }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }

/* ---------- badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; text-transform: capitalize; }
.pill-new { background: var(--info-50); color: var(--info); }
.pill-qualified, .pill-c-done, .pill-run-done { background: var(--brand-50); color: var(--brand-600); }
.pill-hot { background: var(--hot-50); color: var(--hot); }
.pill-customer { background: var(--violet-50); color: var(--violet); }
.pill-cold, .pill-c-cancelled, .pill-c-failed, .pill-run-failed, .pill-run-stopped { background: var(--surface-2); color: var(--muted); }
.pill-c-sending, .pill-run-running, .pill-run-waiting_reply, .pill-run-waiting_time { background: var(--warn-50); color: var(--warn); }
.pill-c-scheduled { background: var(--info-50); color: var(--info); }
.pill-btn { height: 26px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font: 600 12px var(--font); cursor: pointer; }
.pill-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); margin: 0 4px 2px 0; }
.kw { background: var(--brand-50); color: var(--brand-600); }
.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-100); color: var(--brand-600); font-weight: 700; font-size: 14px; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
@media (prefers-color-scheme: dark) { .avatar { color: #bbf7d0; } .kw, .pill-qualified, .pill-c-done, .pill-run-done { color: var(--brand); } }

/* ---------- flash, cards ---------- */
.flash { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid; font-weight: 500; display: flex; flex-direction: column; gap: 8px; }
.flash-ok { background: var(--brand-50); border-color: color-mix(in srgb, var(--brand) 30%, transparent); color: var(--text); }
.flash-err { background: var(--danger-50); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--text); }
.flash-float { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50; max-width: min(92vw, 520px); box-shadow: var(--shadow-lg); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card + .card, .grid-2 + .card, .card + .grid-2, .kpis + .grid-2, .setup + .kpis { margin-top: 16px; }
.card h2 + p, .card h2 + ul { margin-top: 10px; }
.empty { padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.hint { background: var(--surface-2); box-shadow: none; line-height: 1.6; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cards .card { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid-2 > .card { margin: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar > p { max-width: 640px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.filters .search { flex: 1; min-width: 200px; max-width: 320px; }
.filters select { width: auto; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list li > a { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 12px 0; font-size: 13px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* modal */
dialog.modal { border: 0; border-radius: 16px; padding: 22px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(16,24,40,.45); backdrop-filter: blur(2px); }
dialog.modal h2 { margin-bottom: 14px; font-size: 18px; }
dialog[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { dialog[open] { animation: none; } }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100dvh; }
.side { width: 240px; flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: 16px 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -.03em; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }
.brand small { font: 500 11.5px var(--font); color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.side .brand { padding: 2px 8px 10px; }
.ws-name { margin: 0 8px 14px; padding: 7px 10px; border-radius: var(--radius-sm); background: var(--surface-2); font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 550; text-decoration: none; }
.side nav a span { flex: 1; }
.side nav a:hover { background: var(--surface-2); }
.side nav a.on { background: var(--brand-50); color: var(--brand-600); }
@media (prefers-color-scheme: dark) { .side nav a.on { color: var(--brand); } }
.side-foot { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.conn { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 8px; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px var(--warn-50); }
.conn-meta .dot, .conn-deropo .dot { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.me { display: flex; align-items: center; gap: 9px; padding: 0 4px 0 8px; }
.me > span:nth-child(2) { flex: 1; min-width: 0; line-height: 1.25; }
.me b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { color: var(--muted); font-size: 11.5px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 19px; font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }
.content { padding: 24px 28px 48px; max-width: 1280px; width: 100%; }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.kpi small { color: var(--muted); font-weight: 550; font-size: 12.5px; }
.kpi b { font: 700 26px var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; }
.setup h2 { font-size: 15px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 12px 0; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width .3s; }
.progress.sm { height: 4px; margin: 6px 0 0; width: 90px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.checklist li { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.checklist .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: none; }
.checklist .done .tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.checklist .done a { color: var(--muted); text-decoration: line-through; }
.legend { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-in, .b-in { background: color-mix(in srgb, var(--brand) 35%, var(--surface-2)); }
.sw-out, .b-out { background: var(--brand); }
.bars { display: flex; gap: 6px; height: 170px; align-items: stretch; margin-top: 16px; }
.bar-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--border); }
.bar-pair span { width: 42%; max-width: 12px; min-height: 2px; border-radius: 3px 3px 0 0; }
.bar-day small { font-size: 10.5px; color: var(--muted); }
.timeline { list-style: none; padding: 0; margin: 10px 0 0; }
.timeline li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.timeline li:last-child { border: 0; }
.t-kind { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); flex: none; transform: translateY(-1px); }
.k-workflow, .k-lead { background: var(--brand); } .k-handover, .k-opt_out { background: var(--hot); } .k-crm { background: var(--violet); } .k-campaign, .k-import { background: var(--info); } .k-status { background: var(--warn); }

/* inbox */
.inbox { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); height: calc(100dvh - 140px); min-height: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.threads { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.thread-search { padding: 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 4px 10px; border-radius: 99px; color: var(--muted); font-weight: 600; text-decoration: none; }
.tabs a.on { background: var(--brand-50); color: var(--brand-600); }
.sim-new { border-bottom: 1px solid var(--border); padding: 10px 12px; background: var(--warn-50); }
.sim-new summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--warn); list-style: none; display: flex; align-items: center; gap: 6px; }
.sim-new summary::-webkit-details-marker { display: none; }
.sim-new form { margin-top: 10px; }
.thread-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.thread-list a { display: flex; gap: 10px; align-items: center; padding: 11px 12px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); }
.thread-list a:hover { background: var(--surface-2); }
.thread-list a.on { background: var(--brand-50); }
.thread-list small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-list b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.pad { padding: 16px; }
.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.thread-head small { display: block; }
.thread-head .back { display: none; transform: rotate(180deg); }
.thread-note { padding: 7px 14px; font-size: 12.5px; background: var(--brand-50); color: var(--text-2); border-bottom: 1px solid var(--border); display: flex; gap: 6px; align-items: center; }
.thread-note.warn { background: var(--warn-50); color: var(--warn); }
.messages { flex: 1; overflow-y: auto; padding: 18px 6%; background: var(--chat-bg); display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: min(78%, 520px); padding: 7px 10px 5px; border-radius: 10px; box-shadow: 0 1px .5px rgba(11,20,26,.13); font-size: 14px; word-wrap: break-word; }
.msg small { display: block; text-align: right; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.msg-in { background: var(--bubble-in); align-self: flex-start; border-top-left-radius: 2px; }
.msg-out { background: var(--bubble-out); align-self: flex-end; border-top-right-radius: 2px; }
.msg-failed { outline: 1.5px solid var(--danger); }
.msg-failed small { color: var(--danger); }
.composer { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.composer select { width: 150px; flex: none; }
.composer textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 160px; }
.thread-tools { display: flex; gap: 10px; padding: 0 12px 12px; flex-wrap: wrap; align-items: center; }
.sim-reply { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 260px; }
.sim-reply .pill { background: var(--warn-50); color: var(--warn); }
.sim-reply input { flex: 1; min-width: 0; min-height: 30px; padding: 4px 10px; }

/* contact detail */
.kv { display: flex; flex-direction: column; gap: 6px; }
.kv-row { display: grid; grid-template-columns: 1fr 2fr; gap: 6px; }
.bubble-preview { background: var(--chat-bg); padding: 10px; border-radius: 10px; }
.bubble-preview, .bubble-preview::before { font-size: 13.5px; }
.bubble-preview { position: relative; }
.bubble-preview { box-shadow: inset 0 0 0 1px var(--border); }
.cards .bubble-preview, .rule .bubble-preview { background: var(--bubble-out); border-radius: 10px 2px 10px 10px; box-shadow: none; }

/* rules */
.rule { display: flex; flex-direction: column; gap: 10px; margin: 0 !important; }
.rule.off { opacity: .6; }
.rule.hit { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.rule form { display: inline; }

/* workflows */
.wf-card h2 { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-weight: 550; }
.chip-ask, .chip-if { background: var(--info-50); color: var(--info); }
.chip-send, .chip-template { background: var(--brand-50); color: var(--brand-600); }
.chip-notify, .chip-handover { background: var(--hot-50); color: var(--hot); }
.chip-crm, .chip-status, .chip-score, .chip-tag { background: var(--violet-50); color: var(--violet); }
.wf-editor { display: flex; flex-direction: column; gap: 16px; }
.steps { display: flex; flex-direction: column; gap: 0; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; position: relative; }
.step + .step { margin-top: 22px; }
.step + .step::before { content: ""; position: absolute; left: 26px; top: -23px; height: 22px; border-left: 2px dashed var(--border-strong); }
.step[data-type=send] .step-no, .step[data-type=template] .step-no { background: var(--brand-50); color: var(--brand-600); }
.step[data-type=ask] .step-no, .step[data-type=if] .step-no { background: var(--info-50); color: var(--info); }
.step[data-type=notify] .step-no, .step[data-type=handover] .step-no { background: var(--hot-50); color: var(--hot); }
.step[data-type=crm] .step-no, .step[data-type=status] .step-no, .step[data-type=score] .step-no, .step[data-type=tag] .step-no { background: var(--violet-50); color: var(--violet); }
.step[data-type=wait] .step-no { background: var(--warn-50); color: var(--warn); }
.step-head { display: flex; align-items: center; gap: 10px; }
.step-no { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.step-head b { flex: 1; }
.step-head .muted { font-size: 12px; }
.step .form-grid { gap: 10px; }
.step.flash-in { animation: pop .2s ease-out; }
.add-step { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.add-step-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.add-step-grid button { height: 30px; padding: 0 10px; border-radius: 99px; border: 1px dashed var(--border-strong); background: var(--surface); color: var(--text-2); font: 600 12.5px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.add-step-grid button:hover { border-style: solid; border-color: var(--brand); color: var(--brand-600); }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); }

/* settings */
.settings { display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.settings > .card { margin: 0; }
.provider-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.provider-card form { margin: 0; }
.hook { background: var(--surface-2); padding: 14px; border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 8px; }
.hook form { align-self: flex-start; }
.api-docs summary { cursor: pointer; font-weight: 600; }
pre.code { background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; font: 12.5px/1.6 ui-monospace, Menlo, monospace; margin: 10px 0 0; }
pre.code code { background: none; padding: 0; color: inherit; }

/* ---------- auth & legal ---------- */
.auth, .legal { background: radial-gradient(1200px 500px at 50% -10%, var(--brand-50), var(--bg)); min-height: 100dvh; }
.auth-wrap { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 22px; }
.brand-lg { font-size: 24px; }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 22px; font-family: var(--font-display); letter-spacing: -.02em; }
.legal-wrap { max-width: 720px; margin: 0 auto; padding: 40px 20px 80px; display: flex; flex-direction: column; gap: 12px; }
.legal-wrap h1 { font: 800 32px var(--font-display); letter-spacing: -.03em; margin-top: 24px; }
.legal-wrap h2 { margin-top: 14px; }
.legal-wrap p { color: var(--text-2); line-height: 1.7; }

/* ---------- landing ---------- */
.landing { background: var(--surface); }
.l-wrap { width: min(1160px, 100%); margin: 0 auto; padding: 0 24px; }
.l-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.l-nav { display: flex; align-items: center; gap: 24px; height: 64px; }
.l-links { display: flex; gap: 22px; flex: 1; }
.l-links a { color: var(--text-2); font-weight: 550; }
.l-actions { display: flex; gap: 8px; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-600); background: var(--brand-50); padding: 5px 11px; border-radius: 99px; margin-bottom: 18px; }
@media (prefers-color-scheme: dark) { .eyebrow { color: var(--brand); } }
.hero h1 { font: 800 clamp(36px, 5vw, 56px)/1.05 var(--font-display); letter-spacing: -.035em; margin-bottom: 18px; text-wrap: balance; }
.lead { font-size: 17px; line-height: 1.6; color: var(--text-2); max-width: 600px; }
.hero-cta { display: flex; gap: 10px; margin: 28px 0 14px; flex-wrap: wrap; }
.phone { background: var(--chat-bg); border-radius: 28px; border: 8px solid #101828; box-shadow: var(--shadow-lg); overflow: hidden; max-width: 380px; justify-self: center; width: 100%; }
.phone-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #075e54; color: #fff; }
.phone-top small { display: block; opacity: .8; font-size: 11.5px; }
.phone-top .avatar { background: #25d366; color: #063; }
.phone-chat { padding: 14px; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.bubble { max-width: 82%; padding: 7px 10px; border-radius: 10px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.bubble.in { background: var(--bubble-in); align-self: flex-start; border-top-left-radius: 2px; }
.bubble.out { background: var(--bubble-out); align-self: flex-end; border-top-right-radius: 2px; }
.bubble.sys { align-self: center; background: var(--warn-50); color: var(--warn); font-size: 12px; font-weight: 600; max-width: 100%; text-align: center; }
@media (prefers-reduced-motion: no-preference) {
  .phone-chat .bubble { animation: rise .4s ease-out both; }
  .phone-chat .bubble:nth-child(2) { animation-delay: .25s; } .phone-chat .bubble:nth-child(3) { animation-delay: .5s; } .phone-chat .bubble:nth-child(4) { animation-delay: .75s; }
  .phone-chat .bubble:nth-child(5) { animation-delay: 1s; } .phone-chat .bubble:nth-child(6) { animation-delay: 1.25s; } .phone-chat .bubble:nth-child(7) { animation-delay: 1.5s; } .phone-chat .bubble:nth-child(8) { animation-delay: 1.8s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.l-section { padding: 80px 0; }
.l-section h2 { font: 800 clamp(26px, 3.4vw, 36px)/1.15 var(--font-display); letter-spacing: -.03em; margin-bottom: 36px; max-width: 720px; text-wrap: balance; }
.l-alt { background: var(--bg); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { border: 1px solid var(--border); border-radius: 16px; padding: 24px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; transition: border-color .2s, box-shadow .2s, transform .2s; }
.feature:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.feature h3 { font-size: 16px; }
.feature p, .use p, .flow p { color: var(--text-2); line-height: 1.6; }
.f-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.flow li { display: flex; flex-direction: column; gap: 8px; }
.num { font-variant-numeric: tabular-nums; }
.flow .num { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.uses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.use { padding: 22px; border-radius: 16px; background: var(--brand-50); display: flex; flex-direction: column; gap: 8px; }
.dev { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.dev h2 { margin-bottom: 16px; }
.ticks { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 8px; font-weight: 550; }
.ticks .ic { color: var(--brand); }
.cta-band { background: linear-gradient(135deg, #064e3b, #15803d); color: #fff; }
.cta-band h2 { margin: 0 auto 12px; color: #fff; }
.cta-band .lead { color: #d1fae5; margin: 0 auto 26px; }
.cta-band .btn-primary { background: #fff; color: #064e3b; border-color: #fff; }
.l-footer { padding: 28px 0 40px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 10px; }
.l-footer nav { display: flex; gap: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .composer { flex-wrap: wrap; }
  .composer select { width: 100%; }
}
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-2.wide-left { grid-template-columns: minmax(0, 1fr); }
  .feature-grid, .uses { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .side { position: fixed; z-index: 30; left: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px 16px 40px; }
  .hero, .dev { grid-template-columns: 1fr; gap: 36px; padding-top: 40px; }
  .l-links { display: none; }
  .l-nav { justify-content: space-between; }
  .inbox { grid-template-columns: 1fr; height: calc(100dvh - 100px); }
  .inbox.has-thread .threads { display: none; }
  .inbox:not(.has-thread) .thread { display: none; }
  .thread-head .back { display: inline-grid; }
  .messages { padding: 14px 10px; }
  .composer { flex-wrap: wrap; }
  .composer select { width: 100%; }
}
@media (max-width: 600px) {
  .form-grid, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; }
  .feature-grid, .uses, .flow { grid-template-columns: 1fr; }
  .kpi b { font-size: 22px; }
  .l-section { padding: 56px 0; }
  .l-wrap { padding: 0 16px; }
  .l-actions .btn-ghost { display: none; }
  .table th, .table td { padding: 10px 12px; }
}
