:root {
  --bg: #f6f5f2; --panel: #ffffff; --ink: #141a22; --ink-2: #2b333e; --muted: #5b6470; --faint: #8a929c;
  --line: #e4e2dc; --line-2: #eeede8; --sunk: #efeee9;
  --ember: #d9481f; --ember-soft: #fbe3d9; --slate: #5057c4; --slate-soft: #e3e4fa; --moss: #2f7a4b; --moss-soft: #dcefe2;
  --amber: #b7791f; --amber-soft: #fbefd5; --red: #c0392b; --red-soft: #fbe1de;
  --side: #141a22; --side-2: #1e2630; --side-text: #c6ccd4; --side-dim: #7d8793;
  --r: 12px; --r-sm: 8px;
  --shadow: 0 1px 2px rgba(20,26,34,.05), 0 8px 24px -12px rgba(20,26,34,.18);
  --shadow-lg: 0 24px 64px -20px rgba(20,26,34,.35);
  --f-ui: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--f-ui); font-size: 14px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -0.02em; margin: 0; }
.hidden { display: none !important; }
.mono { font-family: var(--f-mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.stack-sm { display: grid; gap: 8px; }
.between { justify-content: space-between; }

/* ── shell ── */
.shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; font-family: var(--f-display); font-weight: 800; font-size: 19px; color: #fff; text-decoration: none; letter-spacing: -0.02em; }
.mark { width: 26px; height: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.mark i { border-radius: 3px; background: var(--ember); }
.mark i:nth-child(2) { background: #f2b134; } .mark i:nth-child(3) { background: #5f67d8; } .mark i:nth-child(4) { background: #3fa46a; }
.ws-switch { margin: 0 12px 10px; padding: 9px 11px; border-radius: 10px; background: var(--side-2); border: 1px solid #2a333e; display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; width: calc(100% - 24px); text-align: left; }
.ws-switch small { display: block; color: var(--side-dim); font-weight: 500; font-size: 11.5px; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.nav-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--side-dim); padding: 14px 10px 6px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--side-text); font-weight: 550; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.on { background: #fff; color: var(--ink); }
.nav a.on svg { color: var(--ember); }
.nav a svg { width: 17px; height: 17px; flex: 0 0 17px; }
.nav .count { margin-left: auto; background: var(--ember); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.nav a.on .count { background: var(--ember); }
.me { border-top: 1px solid #242d38; padding: 12px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; background: var(--ember); color: #fff; font-weight: 700; flex: 0 0 32px; font-size: 13px; }
.me b { color: #fff; font-size: 13px; display: block; }
.me small { color: var(--side-dim); font-size: 11.5px; }
.me button { margin-left: auto; background: none; border: 0; color: var(--side-dim); padding: 6px; border-radius: 6px; }
.me button:hover { color: #fff; background: var(--side-2); }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(246,245,242,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 12px 28px; min-height: 60px; }
.top h1 { font-size: 21px; }
.top .crumbs { color: var(--muted); font-weight: 550; display: flex; gap: 8px; align-items: center; }
.top .crumbs a { text-decoration: none; }
.top .crumbs a:hover { color: var(--ink); }
.page { padding: 26px 28px 60px; max-width: 1380px; }
.burger { display: none; background: none; border: 0; padding: 6px; }

/* ── primitives ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: 13.5px; text-decoration: none; white-space: nowrap; line-height: 1.2; transition: background .12s, border-color .12s, transform .12s; }
.btn:hover { border-color: #cfccc3; background: #fbfaf8; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #26303b; }
.btn.accent { background: var(--ember); border-color: var(--ember); color: #fff; }
.btn.accent:hover { background: #c43d17; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--sunk); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: #f0c2bc; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.icon { padding: 7px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { font-size: 15.5px; }
.card-b { padding: 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.grid > *, .stack > * { min-width: 0; }
.drawer .modal-b { align-content: start; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.pill.live, .pill.paid, .pill.completed, .pill.done { background: var(--moss-soft); color: var(--moss); }
.pill.draft, .pill.unpaid, .pill.new { background: var(--amber-soft); color: var(--amber); }
.pill.paused, .pill.cancelled, .pill.spam, .pill.refunded { background: var(--red-soft); color: var(--red); }
.pill.processing, .pill.shipped, .pill.open { background: var(--slate-soft); color: var(--slate); }
.pill.connected { background: #e6eef6; color: #2b5a86; }
.pill.built { background: var(--ember-soft); color: #a8360f; }
.dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; flex: 0 0 8px; }
.site-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; border: 1px solid transparent; }
.site-chip .dot { width: 7px; height: 7px; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; font-size: 17px; }
.empty .btn { margin-top: 14px; }

/* forms */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }
.in { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; transition: border-color .12s, box-shadow .12s; font-size: 13.5px; }
.in:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20,26,34,.08); }
textarea.in { min-height: 84px; resize: vertical; line-height: 1.5; }
select.in { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6470' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 10px center no-repeat; padding-right: 30px; }
.in.mono { font-family: var(--f-mono); font-size: 12.5px; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); }
.search .in { padding-left: 32px; }
.toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 600; font-size: 13px; user-select: none; }
.toggle input { display: none; }
.toggle i { width: 34px; height: 20px; border-radius: 999px; background: #d6d3cb; position: relative; transition: background .15s; flex: 0 0 34px; }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.toggle input:checked + i { background: var(--moss); }
.toggle input:checked + i::after { transform: translateX(14px); }
.seg { display: inline-flex; background: var(--sunk); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg.full { display: flex; } .seg.full button { flex: 1; }

/* tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fcfbf9; white-space: nowrap; }
.t td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #fbfaf7; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t .strong { font-weight: 650; }

/* KPI */
.kpi { padding: 16px 18px; }
.kpi .l { color: var(--muted); font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.kpi .l svg { width: 15px; height: 15px; }
.kpi .v { font-family: var(--f-display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; line-height: 1; }
.kpi .s { color: var(--muted); font-size: 12px; margin-top: 8px; }
.spark { display: block; width: 100%; height: 36px; margin-top: 10px; }

/* charts */
.chart { width: 100%; height: 240px; display: block; }
.chart text { font-family: var(--f-ui); font-size: 11px; fill: var(--faint); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 7px 0; }
.bar-row .bar { grid-column: 1 / -1; height: 7px; background: var(--sunk); border-radius: 999px; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; border-radius: 999px; }

/* activity */
.feed { display: grid; }
.feed a { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line-2); text-decoration: none; }
.feed a:last-child { border-bottom: 0; }
.feed a:hover { background: #fbfaf7; }
.feed .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--sunk); }
.feed .ic svg { width: 17px; height: 17px; }
.feed .ic.order { background: var(--moss-soft); color: var(--moss); }
.feed .ic.inbox { background: var(--slate-soft); color: var(--slate); }
.feed b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed small { color: var(--muted); display: flex; gap: 8px; align-items: center; margin-top: 3px; flex-wrap: wrap; }

/* sites */
.site-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.site-card { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.site-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.site-thumb { height: 150px; position: relative; overflow: hidden; background: var(--sunk); border-bottom: 1px solid var(--line-2); }
.site-thumb iframe { width: 1280px; height: 800px; border: 0; transform: scale(.25); transform-origin: 0 0; pointer-events: none; position: absolute; top: 0; left: 0; }
.site-thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 44px; color: rgba(255,255,255,.95); letter-spacing: -0.04em; }
.site-thumb .badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.site-body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.site-body h3 { font-size: 16.5px; display: flex; align-items: center; gap: 8px; }
.site-body .dom { color: var(--muted); font-size: 12.5px; }
.site-stats { display: flex; gap: 14px; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.site-stats b { color: var(--ink); }
.group-h { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.group-h h2 { font-size: 15px; font-family: var(--f-ui); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 750; }
.group-h:first-child { margin-top: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; font-weight: 650; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs .on { color: var(--ink); border-bottom-color: var(--ember); }
.code { background: #10151c; color: #e6edf3; border-radius: 10px; padding: 14px 16px; font-family: var(--f-mono); font-size: 12.5px; line-height: 1.55; overflow-x: auto; white-space: pre; position: relative; }
.code .copy { position: absolute; top: 8px; right: 8px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }

/* templates */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tpl { overflow: hidden; display: flex; flex-direction: column; }
.tpl-cover { height: 170px; background: var(--sunk) center/cover; position: relative; }
.tpl-cover .sw { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 4px; }
.tpl-cover .sw i { width: 16px; height: 16px; border-radius: 999px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.tpl-cover .cat { position: absolute; top: 12px; left: 12px; }
.tpl-b { padding: 14px 16px 16px; display: grid; gap: 6px; flex: 1; }
.tpl-b h3 { font-size: 16px; }
.tpl-b p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; flex: 1; }
.tpl-actions { display: flex; gap: 8px; margin-top: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* modal / drawer / toast */
.scrim { position: fixed; inset: 0; background: rgba(20,26,34,.45); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .15s ease; }
.modal { background: #fff; border-radius: 16px; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2,.8,.2,1); }
.modal.wide { width: min(1100px, 100%); }
.modal.xl { width: min(1320px, 100%); height: calc(100vh - 40px); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.modal-h h3 { font-size: 18px; }
.modal-b { padding: 20px; overflow-y: auto; flex: 1; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.drawer-scrim { position: fixed; inset: 0; background: rgba(20,26,34,.35); z-index: 90; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: #fff; z-index: 91; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .22s cubic-bezier(.2,.8,.2,1); }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow-lg); animation: pop .2s; }
.toast.err { background: var(--red); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--ember); border-radius: 999px; animation: spin .7s linear infinite; }
.loading { display: grid; place-items: center; padding: 80px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { background: var(--side); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::before { content: ""; position: absolute; inset: -20%; background: radial-gradient(circle at 20% 30%, rgba(217,72,31,.45), transparent 40%), radial-gradient(circle at 80% 70%, rgba(80,87,196,.45), transparent 45%), radial-gradient(circle at 60% 10%, rgba(242,177,52,.25), transparent 35%); filter: blur(10px); }
.auth-art > * { position: relative; }
.auth-art h2 { font-size: 44px; line-height: 1.02; letter-spacing: -0.04em; max-width: 480px; }
.auth-art ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; color: #d8dde3; font-size: 15px; }
.auth-art li::before { content: "✓"; color: #f2b134; font-weight: 800; margin-right: 10px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-box { width: min(400px, 100%); display: grid; gap: 16px; }
.auth-box h1 { font-size: 30px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; font-weight: 600; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.err-box { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.note-box { background: var(--amber-soft); color: #7a5212; padding: 11px 13px; border-radius: 9px; font-size: 13px; line-height: 1.5; }
.ok-box { background: var(--moss-soft); color: var(--moss); padding: 11px 13px; border-radius: 9px; font-size: 13px; font-weight: 600; }

/* wizard */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice button { text-align: left; padding: 20px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; display: grid; gap: 8px; }
.choice button:hover { border-color: var(--ink); }
.choice button b { font-family: var(--f-display); font-size: 18px; }
.choice button span { color: var(--muted); line-height: 1.5; }
.choice .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--ember-soft); color: var(--ember); }
.choice .ic.b { background: var(--slate-soft); color: var(--slate); }
.preview-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-stage { background: var(--sunk); flex: 1; display: grid; place-items: start center; overflow: auto; padding: 18px; }
.preview-stage iframe { box-shadow: var(--shadow-lg); border-radius: 10px; background: #fff; transition: width .25s; height: 100%; min-height: 70vh; }

/* product editor */
.img-list { display: flex; flex-wrap: wrap; gap: 8px; }
.img-list .th { width: 74px; height: 74px; border-radius: 9px; background: var(--sunk) center/cover; position: relative; border: 1px solid var(--line); }
.img-list .th button { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 999px; border: 0; background: var(--ink); color: #fff; font-size: 12px; line-height: 1; }
.prod-thumb { width: 44px; height: 44px; border-radius: 8px; background: var(--sunk) center/cover; border: 1px solid var(--line); flex: 0 0 44px; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 80; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: var(--shadow-lg); }
  .burger { display: block; }
  .top { padding: 10px 16px; }
  .page { padding: 18px 16px 50px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .choice { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}

/* ── CRM pipeline, tasks, article editor ── */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kan-col { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-height: 240px; transition: background .15s, border-color .15s; }
.kan-col.over { background: var(--slate-soft); border-color: var(--slate); }
.kan-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 11px 12px 8px; font-size: 13px; }
.kan-list { display: grid; gap: 8px; padding: 0 8px 10px; align-content: start; flex: 1; }
.kan-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 11px; display: grid; gap: 4px; cursor: grab; box-shadow: 0 1px 2px rgba(20,26,34,.04); }
.kan-card:hover { border-color: var(--faint); }
.kan-card:active { cursor: grabbing; }
.kan-card small { color: var(--muted); font-size: 12px; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 11px 16px; border-top: 1px solid var(--line-2); }
.task:first-of-type { border-top: 0; }
.task b { display: block; font-weight: 650; }
.task small { color: var(--faint); font-size: 12px; }
.task input[type=checkbox] { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--moss); }
.task.late small { color: var(--red); }
.rte { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); overflow: hidden; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 5px; border-bottom: 1px solid var(--line); background: var(--sunk); }
.rte-bar button { border: 0; background: none; border-radius: 6px; padding: 4px 9px; font-size: 13px; font-weight: 650; }
.rte-bar button:hover { background: var(--panel); }
.rte-body { padding: 12px 14px; outline: none; line-height: 1.6; max-height: 60vh; overflow: auto; }
.rte-body img { max-width: 100%; height: auto; }
.rte-body h2, .rte-body h3 { margin: 1em 0 .4em; }

/* ── Market research ── */
.chip-t { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 8px; padding: 6px 12px; font-weight: 650; font-size: 13px; }
.chip-t.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.research-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.research-list { display: flex; flex-direction: column; max-height: 640px; }
.plist { overflow: auto; flex: 1; border-top: 1px solid var(--line-2); }
.pitem { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.pitem:hover { background: var(--sunk); }
.pitem b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem small { display: block; color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem input { margin-top: 3px; }
@media (max-width: 1100px) { .research-grid { grid-template-columns: 1fr; } }

/* ── Live chat ── */
.chat-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; align-items: start; }
.chat-list { max-height: calc(100vh - 210px); overflow: auto; }
.citem { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line-2); text-decoration: none; }
.citem:hover { background: var(--sunk); }
.citem.on { background: var(--slate-soft); }
.citem b { font-weight: 650; }
.citem small { display: block; color: var(--faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.citem .count { background: var(--ember); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.chat-pane { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 460px; }
.cmsgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--sunk); }
.cmsg { max-width: 75%; display: flex; flex-direction: column; gap: 3px; }
.cmsg .cb { padding: 10px 13px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); white-space: pre-wrap; line-height: 1.5; }
.cmsg small { color: var(--faint); font-size: 11.5px; }
.cmsg.visitor { align-self: flex-start; }
.cmsg.agent, .cmsg.ai { align-self: flex-end; align-items: flex-end; }
.cmsg.agent .cb { background: var(--ink); color: #fff; border-color: var(--ink); }
.cmsg.ai .cb { background: var(--slate-soft); border-color: #c9ccf5; }
.cmsg.system { align-self: center; max-width: 90%; text-align: center; }
.cmsg.system .cb { background: none; border: 0; color: var(--muted); font-size: 13px; padding: 2px; }
.creply { border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; }
.creply textarea { min-height: 70px; }
@media (max-width: 900px) { .chat-grid { grid-template-columns: 1fr; } }
.qitem .card-h { gap: 10px; }
.research-list .in { width: 100%; min-width: 0; }
.research-list .row > select.in { flex: 1; }

/* ops screens */
.chip-check { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer; background: #fff; white-space: nowrap; }
.chip-check input { margin: 0; accent-color: var(--ember); }
tr.on td { background: var(--bg); }
.pill.authorized { background: #eaf2ff; color: #2456c7; }
select.in[style*="height:32px"], select.in[style*="height:34px"], input.in[style*="height:32px"] { padding-top: 0; padding-bottom: 0; line-height: 30px; }
.card-h h3 svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.card-b > svg, .card.card-b > svg { width: 16px; height: 16px; vertical-align: -3px; }
