@font-face {
  font-family: 'Geist'; font-style: normal; font-weight: 400 600;
  font-display: swap; src: url('/static/fonts/geist.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist Mono'; font-style: normal; font-weight: 400 500;
  font-display: swap; src: url('/static/fonts/geist-mono.woff2') format('woff2');
}

:root {
  --bg: #f6f6f6;
  --surface: #ffffff;
  --tint: rgba(0, 0, 0, .04);
  --tint-2: rgba(0, 0, 0, .07);
  --line: rgba(0, 0, 0, .08);
  --text: #111113;
  --text-2: #4b4b50;
  --muted: #7a7a7a;
  --green: #0d9467;
  --green-ink: #ffffff;
  --green-soft: #e3f4ec;
  --green-text: #0b7a55;
  --purple: #8b5cf6;
  --purple-soft: #f1ecfe;
  --orange: #ea7a1a;
  --orange-soft: #fdf0e3;
  --red: #c2410c;
  --red-soft: #fdeee6;
  --shadow: 0 0 .5px rgba(0, 0, 0, .16), 0 3px 8px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .08);
  --r: 12px;
  --r-sm: 8px;
  --side: 256px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111112; --surface: #1b1b1d; --tint: rgba(255, 255, 255, .06); --tint-2: rgba(255, 255, 255, .1);
    --line: rgba(255, 255, 255, .09); --text: #f3f3f4; --text-2: #c2c2c7; --muted: #8e8e95;
    --green: #17b07c; --green-ink: #06120d; --green-soft: #12291f; --green-text: #4fd3a2;
    --purple: #a78bfa; --purple-soft: #231c38; --orange: #f59e4b; --orange-soft: #2e2012;
    --red: #f8875a; --red-soft: #2e1810;
    --shadow: 0 0 .5px rgba(0, 0, 0, .6), 0 3px 8px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111112; --surface: #1b1b1d; --tint: rgba(255, 255, 255, .06); --tint-2: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .09); --text: #f3f3f4; --text-2: #c2c2c7; --muted: #8e8e95;
  --green: #17b07c; --green-ink: #06120d; --green-soft: #12291f; --green-text: #4fd3a2;
  --purple: #a78bfa; --purple-soft: #231c38; --orange: #f59e4b; --orange-soft: #2e2012;
  --red: #f8875a; --red-soft: #2e1810;
  --shadow: 0 0 .5px rgba(0, 0, 0, .6), 0 3px 8px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Geist', system-ui, sans-serif; font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.ph { font-size: 16px; vertical-align: -2px; }
.mono { font-family: 'Geist Mono', ui-monospace, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ── Shell & sidebar ── */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; padding: 12px 8px 8px; gap: 2px; }
.side-top { display: flex; align-items: center; gap: 8px; padding: 4px 8px 10px; }
.logo { width: 18px; height: 18px; border-radius: 5px; background: var(--green); color: var(--green-ink); display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.logo-name { font-weight: 600; letter-spacing: -.01em; }
.pill-soft { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--tint); color: var(--muted); }
.pill-soft.on { background: var(--green); color: var(--green-ink); }
.project { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-bottom: 6px; font-weight: 600; }
.project-av, .account-av { width: 18px; height: 18px; border-radius: 4px; background: #13213d; color: #fff; font-size: 11px; display: grid; place-items: center; font-weight: 600; flex: none; }
.account-av { border-radius: 50%; background: var(--tint-2); color: var(--text-2); }
.project-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav a, .nav-more { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border-radius: var(--r-sm); text-decoration: none; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; background: none; cursor: pointer; font-size: 14px; text-align: left; }
.nav a .ph, .nav-more .ph { color: var(--muted); flex: none; }
.nav a:hover, .nav-more:hover { background: var(--tint); }
.nav a.active { background: var(--tint); color: var(--text); font-weight: 600; }
.nav a.active .ph { color: var(--text); }
.nav-label { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 8px 4px; }
.nav .count { margin-left: auto; font-size: 12px; color: var(--muted); }
.nav .count:empty { display: none; }
.nav-quiet { color: var(--muted) !important; }
.dot { width: 6px; height: 6px; border-radius: 50%; flex: none; display: inline-block; background: #b9b9b9; }
.dot.active { background: var(--green); }
.dot.paused { background: var(--orange); }
.camp-link .dot { margin: 0 5px; }
.account { position: relative; padding-top: 6px; }
.account-btn { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; }
.account-btn:hover { background: var(--tint); }
.account-mail { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; bottom: 46px; left: 0; right: 0; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow), 0 12px 32px rgba(0, 0, 0, .12); padding: 6px; z-index: 20; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; background: none; border-radius: var(--r-sm); text-decoration: none; cursor: pointer; text-align: left; font-size: 14px; }
.menu a:hover, .menu button:hover { background: var(--tint); }
.menu-head { padding: 6px 8px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-theme { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; border-top: 1px solid var(--line); margin-top: 4px; color: var(--text-2); }
.theme-seg { display: inline-flex; background: var(--tint); border-radius: var(--r-sm); padding: 2px; }
.theme-seg button { width: 28px; height: 24px; padding: 0; justify-content: center; border-radius: 6px; }
.theme-seg button.on { background: var(--surface); box-shadow: var(--shadow); }

.main { min-width: 0; padding: 12px 16px 16px 0; }
.view { max-width: 1200px; margin: 0 auto; padding: 8px 8px 48px; outline: none; }
.view.wide { max-width: none; padding: 0; }
.topbar { display: none; }
.only-mobile { display: none !important; }

/* ── Type & layout ── */
h1 { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 16px; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
h3 { font-size: 14px; font-weight: 600; margin: 0; }
.sub { color: var(--muted); margin: -10px 0 18px; }
.label { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.badge { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--tint); border-radius: 4px; padding: 1px 6px; letter-spacing: 0; text-transform: none; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; align-content: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.narrow { max-width: 780px; margin: 0 auto; }
.narrower { max-width: 600px; margin: 0 auto; }

.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.tinted { background: var(--tint); box-shadow: none; }
.card.ai { box-shadow: none; border: 2px solid var(--purple); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-sm); border: 0; background: var(--tint); color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, transform .08s; }
.btn:hover { background: var(--tint-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--green); color: var(--green-ink); }
.btn-primary:hover { background: var(--green); filter: brightness(1.07); }
.btn-outline { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .05); }
.btn-outline:hover { background: var(--tint); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 13px; }
.btn-link { background: none; padding: 0; height: auto; color: var(--text-2); }
.btn-link:hover { background: none; color: var(--text); }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: var(--r-sm); color: var(--text-2); display: inline-flex; }
.icon-btn:hover { background: var(--tint); }

/* ── Segmented, selects, chips ── */
.seg { display: inline-flex; background: var(--tint); border-radius: var(--r-sm); padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; color: var(--muted); cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.seg .badge { background: transparent; padding: 0; }
.select { height: 32px; padding: 0 28px 0 10px; border-radius: var(--r-sm); border: 0; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23777' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center; box-shadow: inset 0 0 0 1px var(--line); appearance: none; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; background: var(--tint); font-size: 12.5px; }
.chip button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); display: inline-flex; }
.chip-add { border: 1px dashed var(--line); background: none; color: var(--muted); border-radius: 6px; padding: 2px 8px; font-size: 12.5px; cursor: pointer; }
.chip-suggest { border: 0; background: var(--tint); color: var(--text-2); border-radius: 6px; padding: 3px 8px; font-size: 12.5px; cursor: pointer; }
.chip-suggest:hover { background: var(--tint-2); }
.chips input.chip-input { width: auto; min-width: 70px; max-width: 220px; height: 24px; padding: 0 8px; font-size: 12.5px; border-radius: 6px; background: transparent; box-shadow: none; border: 1px dashed var(--line); outline: none; field-sizing: content; }
.chips input.chip-input:focus { box-shadow: none !important; border-color: var(--green); }
.status-chip { font-size: 12px; padding: 1px 7px; border-radius: 6px; background: var(--tint); color: var(--muted); white-space: nowrap; }
.status-chip.hot { background: var(--orange-soft); color: var(--orange); font-weight: 500; }
.status-chip.won, .status-chip.ok { background: var(--green-soft); color: var(--green-text); }
.status-chip.lost { background: var(--red-soft); color: var(--red); }
.status-chip.demo { background: var(--purple-soft); color: var(--purple); }
.state-pill { display: inline-block; font-size: 12px; padding: 0 7px; border-radius: 6px; background: var(--green-soft); color: var(--green-text); font-weight: 500; }
.state-pill.paused { background: var(--orange-soft); color: var(--orange); }
.state-pill.draft { background: var(--tint); color: var(--muted); }
.channel { font-size: 11.5px; padding: 1px 6px; border-radius: 5px; background: var(--tint); color: var(--muted); }
.channel.on { background: var(--green-soft); color: var(--green-text); }

/* ── Forms ── */
.field { display: grid; gap: 6px; }
.field > label, .flabel { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.field .help, .help { font-size: 12.5px; color: var(--muted); }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], textarea, select.input {
  width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); outline: none; }
textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.card-input { box-shadow: var(--shadow) !important; border-radius: var(--r) !important; padding: 12px 14px !important; }
input:focus, textarea:focus, select:focus { box-shadow: inset 0 0 0 1.5px var(--green), 0 0 0 3px var(--green-soft) !important; }
input::placeholder, textarea::placeholder { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.toggle { position: relative; width: 30px; height: 18px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle span { position: absolute; inset: 0; background: var(--tint-2); border-radius: 999px; cursor: pointer; transition: background .15s; }
.toggle span::after { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.toggle input:checked + span { background: var(--green); }
.toggle.purple input:checked + span { background: var(--purple); }
.toggle input:checked + span::after { transform: translateX(12px); }
.toggle input:disabled + span { opacity: .5; cursor: not-allowed; }

/* ── Dashboard ── */
.status-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; }
.status-card .title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.status-card .line { color: var(--muted); font-size: 13px; margin-left: 14px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { padding: 14px 14px 10px; min-height: 172px; display: flex; flex-direction: column; }
.kpi .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.kpi .note { font-size: 11.5px; color: var(--muted); text-align: right; }
.kpi .value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 6px; }
.spark { width: 100%; height: 76px; display: block; overflow: visible; }
.spark text { font-size: 10.5px; fill: var(--muted); font-family: 'Geist', sans-serif; }
.split-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.promo { display: flex; align-items: center; gap: 16px; padding: 0 16px 0 0; overflow: hidden; }
.promo .texture { width: 64px; align-self: stretch; background-image: radial-gradient(var(--green) 1px, transparent 1.2px); background-size: 5px 5px; opacity: .55; -webkit-mask-image: linear-gradient(90deg, #000, transparent); mask-image: linear-gradient(90deg, #000, transparent); }
.promo .text { flex: 1; padding: 22px 0; }
.promo .text b { font-size: 16px; display: block; }
.budget-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.budget-row + .budget-row { border-top: 1px solid var(--line); }
.budget-row .name { width: 80px; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.budget-row input[type=range] { flex: 1; accent-color: var(--green); }
.budget-row .amount { font-size: 22px; font-weight: 600; }
.budget-row .amount small { font-size: 13px; color: var(--muted); font-weight: 400; }
.ai-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.ai-icon { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--purple-soft); color: var(--purple); display: grid; place-items: center; flex: none; }
.ai-banner .t { font-weight: 500; }
.ai-banner .s { font-size: 12.5px; color: var(--muted); }
.ai-banner .s b { color: var(--purple); font-weight: 500; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; white-space: nowrap; }
td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
th.num, td.num { text-align: right; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: var(--tint); }
tr.total td { font-weight: 600; }
.ell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td a { white-space: nowrap; text-decoration: none; }
td .row { flex-wrap: nowrap; }
.state-cell .s1 { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--green-text); }
.state-cell .s1.paused { color: var(--orange); }
.state-cell .s1.draft { color: var(--muted); }
.state-cell .s2 { font-size: 12px; color: var(--muted); }

/* ── Replies list ── */
.reply-row { display: grid; grid-template-columns: 36px 160px 1fr auto auto auto; gap: 12px; align-items: center; padding: 12px 14px; }
.reply-row + .reply-row { border-top: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--tint-2); color: var(--text-2); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.avatar.sq { border-radius: 8px; background: #13213d; color: #fff; }
.preview { color: var(--muted); font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bars { display: inline-flex; gap: 1.5px; align-items: flex-end; height: 12px; }
.bars i { width: 3px; background: var(--tint-2); border-radius: 1px; }
.bars i:nth-child(1) { height: 4px; } .bars i:nth-child(2) { height: 7px; } .bars i:nth-child(3) { height: 10px; } .bars i:nth-child(4) { height: 12px; }
.bars.hot i { background: var(--orange); }
.bars.mid i:nth-child(-n+2) { background: var(--muted); }

/* ── Campaign split view ── */
.split { display: grid; grid-template-columns: minmax(340px, 42%) 1fr; height: calc(100dvh - 28px); background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.split-left { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; }
.split-left .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.feed { flex: 1; overflow-y: auto; padding: 16px 18px; display: grid; gap: 18px; align-content: start; }
.feed .msg { color: var(--text-2); line-height: 1.55; }
.feed .msg.you { color: var(--text); background: var(--tint); border-radius: var(--r); padding: 10px 12px; justify-self: end; max-width: 88%; }
.feed .msg .when { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.feed .msg code { font-family: 'Geist Mono', monospace; font-size: 12.5px; background: var(--tint); padding: 1px 4px; border-radius: 4px; }
.composer-box { margin: 10px 12px 12px; display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px 6px 6px 14px; }
.composer-box input { box-shadow: none !important; padding: 0; height: 36px; }
.split-right { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.split-right .bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.split-right .body { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }
.split-right .body h2 { font-size: 20px; margin-bottom: 16px; }
.channel-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; }
.channel-row + .channel-row { border-top: 1px solid var(--line); }
.channel-row .sub2 { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.block { margin-top: 22px; }
.block > .label { margin-bottom: 10px; display: flex; }
.facet { width: 100%; max-width: 360px; }
.facet-row { display: grid; grid-template-columns: 1fr 100px 46px; gap: 10px; align-items: center; font-size: 13px; padding: 3px 0; }
.facet-bar { height: 6px; background: var(--tint); border-radius: 3px; overflow: hidden; }
.facet-bar span { display: block; height: 100%; background: var(--muted); border-radius: 3px; }
.facets { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.pool-big { font-size: 44px; font-weight: 600; letter-spacing: -.03em; }
.stack-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--tint); margin: 10px 0; }
.stack-bar span { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--text-2); }
.legend .dot { margin-right: 6px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { border-radius: var(--r); padding: 14px; background: var(--tint); min-height: 86px; }
.tile.green { background: var(--green); color: var(--green-ink); }
.tile .n { font-size: 28px; font-weight: 600; margin-top: 6px; }
.info-box { background: var(--tint); border-radius: var(--r-sm); padding: 10px 12px; color: var(--text-2); font-size: 13px; display: flex; gap: 8px; }
.info-box.purple { background: var(--purple-soft); color: var(--text-2); }

/* ── Inbox ── */
.inbox-top { display: grid; gap: 8px; margin-bottom: 10px; justify-items: start; }
.inbox { display: grid; grid-template-columns: 262px 1fr; gap: 14px; height: calc(100dvh - 120px); }
.list-col { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.list-col .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.list-col .select { width: 100%; }
.search { position: relative; }
.search .ph { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.search input { padding-left: 30px; }
.cards { overflow-y: auto; display: grid; gap: 6px; align-content: start; padding: 2px 2px 8px; }
.conv { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; display: grid; grid-template-columns: 32px 1fr; gap: 10px; cursor: pointer; border: 1.5px solid transparent; }
.conv:hover { border-color: var(--line); }
.conv.on { border-color: var(--text); }
.conv .n1 { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.conv .n1 .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .n1 .bars { margin-left: auto; }
.conv .n2 { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .n3 { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.thread-card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: relative; }
.thread-head .who { flex: 1; min-width: 0; }
.thread-head .who b { display: flex; align-items: center; gap: 6px; }
.thread-head .who .t { font-size: 12.5px; color: var(--muted); }
.thread-body { flex: 1; overflow-y: auto; padding: 8px 16px; }
.email-msg { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 12px 0; }
.email-msg + .email-msg { border-top: 1px solid var(--line); }
.email-msg .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.email-msg .meta b { color: var(--text); font-weight: 600; }
.email-msg .content { white-space: pre-wrap; word-wrap: break-word; margin-top: 6px; color: var(--text); }
.email-msg.ours .content { color: var(--muted); }
.email-msg.collapsed .content { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer { margin: 8px 16px 16px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }
.composer .cc { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.composer textarea { box-shadow: none !important; min-height: 90px; border-radius: 0; }
.composer .foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; }
.popover { position: absolute; top: 48px; right: 12px; width: 340px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow), 0 16px 40px rgba(0, 0, 0, .14); padding: 14px; z-index: 15; display: grid; gap: 12px; }
.dropdown { position: absolute; top: 48px; right: 12px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow), 0 16px 40px rgba(0, 0, 0, .14); padding: 6px; z-index: 15; min-width: 170px; }
.dropdown button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: none; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; text-align: left; }
.dropdown button:hover { background: var(--tint); }

/* ── Sequence two-pane ── */
.two-pane { display: grid; grid-template-columns: 1fr 1fr; min-height: 460px; }
.two-pane > div { padding: 18px; }
.two-pane > div + div { border-left: 1px solid var(--line); }
.counter { font-size: 12px; color: var(--muted); text-align: right; }
.preview-mail { background: var(--tint); border-radius: var(--r); padding: 14px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; }

/* ── Schedule ── */
.sched td, .sched th { text-align: center; }
.sched td:first-child, .sched th:first-child { text-align: left; }
.daybox { width: 18px; height: 18px; border-radius: 50%; border: 0; cursor: pointer; background: var(--tint-2); }
.daybox.on { background: var(--green); }

/* ── Integrations / generic list rows ── */
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.app-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--tint); flex: none; }
.list-row .txt { flex: 1; min-width: 0; }
.list-row .txt b { display: block; }
.list-row .txt span { color: var(--muted); font-size: 13px; }
.dropzone { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 22px; text-align: center; color: var(--muted); }

/* ── Empty, loading, toast, modal ── */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.empty .circle { width: 44px; height: 44px; border-radius: 50%; background: var(--tint); display: grid; place-items: center; color: var(--muted); }
.empty .circle .ph { font-size: 20px; }
.empty h3 { color: var(--text); font-size: 15px; }
.empty p { margin: 0; max-width: 44ch; }
.skel { background: linear-gradient(90deg, var(--tint), var(--tint-2), var(--tint)); background-size: 200% 100%; border-radius: var(--r-sm); height: 14px; }
@media (prefers-reduced-motion: no-preference) { .skel { animation: shimmer 1.4s ease-in-out infinite; } .view > * { animation: rise .22s cubic-bezier(.16, 1, .3, 1); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.notice { padding: 10px 12px; border-radius: var(--r-sm); background: var(--orange-soft); color: var(--orange); display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
.notice.ok { background: var(--green-soft); color: var(--green-text); }
.notice.bad { background: var(--red-soft); color: var(--red); }
.notice a { font-weight: 500; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--tint-2); border-top-color: var(--green); border-radius: 50%; display: inline-block; flex: none; }
@media (prefers-reduced-motion: no-preference) { .spinner { animation: spin .8s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: var(--r-sm); font-size: 13.5px; transition: opacity .2s, transform .2s; z-index: 40; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { border: 0; border-radius: var(--r); padding: 0; background: var(--surface); color: var(--text); width: min(520px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.modal::backdrop { background: rgba(0, 0, 0, .3); }
.modal-head { padding: 16px 18px 0; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 14px 18px; display: grid; gap: 14px; }
.modal-foot { padding: 0 18px 16px; display: flex; justify-content: flex-end; gap: 8px; }

/* ── Walkthrough & get started ── */
#tourLayer { position: fixed; inset: 0; z-index: 60; }
.tour-spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(10, 10, 12, .55); pointer-events: none; transition: all .2s cubic-bezier(.16, 1, .3, 1); outline: 2px solid var(--green); }
.tour-card { position: fixed; width: min(320px, calc(100vw - 24px)); background: var(--surface); border-radius: var(--r); box-shadow: 0 20px 50px rgba(0, 0, 0, .3); padding: 16px; display: grid; gap: 8px; }
.tour-card h3 { font-size: 16px; }
.tour-card p { margin: 0; color: var(--text-2); }
.tour-count { font-size: 12px; color: var(--muted); }
.get-started { position: fixed; right: 20px; bottom: 20px; z-index: 25; display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--green); color: var(--green-ink); font-weight: 600; cursor: pointer; box-shadow: 0 8px 24px rgba(13, 148, 103, .35); }
.gs-bar { width: 64px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.gs-bar span { display: block; height: 100%; background: currentColor; }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }

/* ── Mobile ── */
@media (max-width: 1100px) { .kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .main { padding: 0; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 30; background: var(--bg); transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility .2s; }
  .sidebar.open { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .only-mobile { display: inline-flex !important; }
  .topbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; position: sticky; top: 0; z-index: 10; background: var(--bg); }
  .view { padding: 4px 16px 40px; }
  .split-cards, .grid-2, .form-grid, .two-pane { grid-template-columns: 1fr; }
  .two-pane > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .split { grid-template-columns: 1fr; height: auto; }
  .split-left { border-right: 0; border-bottom: 1px solid var(--line); max-height: 420px; }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox.reading .list-col { display: none; }
  .inbox:not(.reading) .thread-card { display: none; }
  .reply-row { grid-template-columns: 32px 1fr auto; }
  .reply-row .preview, .reply-row .hide-sm { display: none; }
  .hide-sm { display: none; }
  .status-card { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr; } }

[hidden] { display: none !important; }

tr.click { cursor: pointer; }
tr.click:hover { background: var(--tint); }
