:root {
  --primary: #305090;
  --primary-hover: #204080;
  --primary-soft: #dfe5f3;
  --accent: #e3a71c;
  --bg: #e9ecf4;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --border: #d0d4e4;
  --border-soft: #e6e9ef;
  --text: #2b2f3a;
  --text-2: #5e6473;
  --hover: #dcdfec;
  --row-hover: #f5f6f8;
  --danger: #c93d50;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  --radius: 8px;
  --header-h: 48px;
  --name-col: 340px;
  --col-w: 150px;
  font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161b2c; --surface: #242b40; --surface-2: #1d2335; --border: #3d4660; --border-soft: #333b52;
    --text: #d8dce6; --text-2: #9aa1b4; --hover: #343d58; --row-hover: #2b3349; --primary-soft: #2a3d6b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161b2c; --surface: #242b40; --surface-2: #1d2335; --border: #3d4660; --border-soft: #333b52;
  --text: #d8dce6; --text-2: #9aa1b4; --hover: #343d58; --row-hover: #2b3349; --primary-soft: #2a3d6b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #root { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
[hidden] { display: none !important; }

/* ---------- buttons & inputs ---------- */
.btn { border: 0; border-radius: 4px; padding: 0 12px; height: 32px; display: inline-flex; align-items: center; gap: 6px; background: transparent; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { border: 1px solid var(--border); }
.btn-danger { color: var(--danger); }
.btn-sm { height: 28px; padding: 0 8px; font-size: 13px; }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 4px; background: transparent; display: inline-grid; place-items: center; color: var(--text-2); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.input { height: 36px; border: 1px solid var(--border); border-radius: 4px; padding: 0 10px; background: var(--surface); width: 100%; outline: none; }
.input:focus { border-color: var(--primary); }
textarea.input { height: auto; padding: 10px; resize: vertical; min-height: 80px; }
.muted { color: var(--text-2); }
.svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- auth ---------- */
.auth { min-height: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.auth-hero { background: linear-gradient(135deg, #16254a 0%, #204080 55%, #6070a0 130%); color: #fff; padding: 64px; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.auth-hero h1 { font-size: 44px; line-height: 1.1; margin: 0; }
.auth-hero p { font-size: 18px; opacity: .85; max-width: 460px; margin: 0; }
.hero-board { display: grid; gap: 6px; max-width: 460px; margin-top: 16px; }
.hero-row { display: grid; grid-template-columns: 6px 1fr 110px 110px; gap: 2px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; height: 34px; align-items: stretch; }
.hero-row > div { display: flex; align-items: center; justify-content: center; font-size: 13px; }
.hero-row > div:nth-child(2) { justify-content: flex-start; padding-left: 10px; }
.auth-form-wrap { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.auth-form { width: 100%; max-width: 380px; display: grid; gap: 14px; }
.auth-form h2 { margin: 0 0 4px; font-size: 28px; }
.auth-form label { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.auth-form .btn-primary { height: 40px; justify-content: center; font-size: 15px; }
.auth-switch { text-align: center; color: var(--text-2); }
.auth-switch button { border: 0; background: none; color: var(--primary); padding: 0; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-hero { padding: 32px 16px; } .auth-hero h1 { font-size: 32px; } .hero-board { display: none; } }

/* ---------- logo ---------- */
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; letter-spacing: -0.2px; }
.logo-dots { display: inline-flex; gap: 3px; align-items: flex-end; }
.logo-dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.logo-dots i:nth-child(1) { background: #204080; }
.logo-dots i:nth-child(2) { background: #e3a71c; height: 14px; border-radius: 4px; }
.logo-dots i:nth-child(3) { background: #6070a0; }
.logo small { font-weight: 400; color: var(--text-2); font-size: 13px; }

/* ---------- shell ---------- */
.shell { height: 100%; display: grid; grid-template-rows: var(--header-h) 1fr; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; background: var(--surface-2); }
.spacer, .topbar .spacer { flex: 1; }
.avatar { width: 30px; height: 30px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; border: 2px solid var(--surface); }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 36px; height: 36px; font-size: 14px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.avatar.empty { background: transparent; border: 1px dashed var(--border); color: var(--text-2); }

.main-wrap { display: grid; grid-template-columns: 260px 1fr; min-height: 0; padding: 0 8px 8px 0; background: var(--surface-2); }
.sidebar { padding: 8px 8px 8px 12px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.sidebar.collapsed { display: none; }
.side-section { font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: .5px; padding: 12px 8px 4px; display: flex; align-items: center; justify-content: space-between; }
.ws-select { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); width: 100%; text-align: left; }
.ws-badge { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #204080, #6070a0); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.ws-select .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item { display: flex; align-items: center; gap: 8px; padding: 0 8px; height: 34px; border-radius: 4px; border: 0; background: transparent; width: 100%; text-align: left; color: var(--text); }
.side-item:hover { background: var(--hover); }
.side-item.active { background: var(--primary-soft); }
.side-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-search { margin: 4px 0; height: 32px; }

.content { background: var(--surface); border-radius: var(--radius); min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 0 0 1px var(--border-soft); }
@media (max-width: 800px) {
  .main-wrap { grid-template-columns: 1fr; padding: 0; }
  .sidebar { position: fixed; z-index: 30; top: var(--header-h); bottom: 0; left: 0; width: 260px; background: var(--surface-2); box-shadow: var(--shadow); }
  .content { border-radius: 0; }
  :root { --name-col: 220px; --col-w: 130px; }
}

/* ---------- board header ---------- */
.board-head { padding: 16px 24px 0; }
.board-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.board-title { font-size: 24px; font-weight: 600; border: 1px solid transparent; border-radius: 4px; padding: 2px 6px; margin-left: -7px; background: transparent; min-width: 120px; max-width: 100%; outline: none; }
.board-title:hover { border-color: var(--border); }
.board-title:focus { border-color: var(--primary); }
.board-title-row .spacer { flex: 1; }
.board-desc { color: var(--text-2); border: 1px solid transparent; border-radius: 4px; padding: 2px 6px; margin: 2px 0 0 -7px; width: min(600px, 100%); background: transparent; outline: none; }
.board-desc:hover { border-color: var(--border); }
.board-desc:focus { border-color: var(--primary); }
.tabs { display: flex; gap: 4px; margin-top: 10px; border-bottom: 1px solid var(--border-soft); overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 8px 12px; border-radius: 4px 4px 0 0; color: var(--text); display: flex; gap: 6px; align-items: center; position: relative; white-space: nowrap; }
.tab:hover { background: var(--hover); }
.tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); }
.toolbar { display: flex; gap: 8px; align-items: center; padding: 12px 24px; flex-wrap: wrap; }
.toolbar .search { width: 200px; height: 32px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 4px; border: 0; background: transparent; }
.chip:hover { background: var(--hover); }
.chip.on { background: var(--primary-soft); }

/* ---------- table ---------- */
.board-body { flex: 1; overflow: auto; padding: 0 24px 40px; }
.group { margin-bottom: 36px; --gc: #305090; width: max-content; min-width: 100%; }
.group-head { display: flex; align-items: center; gap: 4px; height: 40px; position: sticky; left: 0; width: max-content; z-index: 4; }
.group-head .caret { color: var(--gc); }
.group-name { color: var(--gc); font-weight: 600; font-size: 17px; border: 1px solid transparent; border-radius: 4px; padding: 2px 6px; background: transparent; outline: none; min-width: 60px; }
.group-name:hover { border-color: var(--border); }
.group-name:focus { border-color: var(--primary); color: var(--text); }
.group-count { color: var(--text-2); font-size: 13px; margin-left: 4px; }
.group-menu { opacity: 0; }
.group-head:hover .group-menu { opacity: 1; }

.grid { display: grid; grid-template-columns: 6px var(--name-col) repeat(var(--ncols), var(--col-w)) 48px; width: max-content; min-width: 100%; }
.grid .cell { border-bottom: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft); height: 37px; display: flex; align-items: center; justify-content: center; background: var(--surface); position: relative; min-width: 0; }
.grid .bar { background: var(--gc); border: 0 !important; position: sticky; left: 0; z-index: 3; }
.grid .bar::before { content: ''; position: absolute; right: 100%; top: -1px; bottom: -1px; width: 24px; background: var(--surface); }
.grid .bar.first { border-top-left-radius: 6px; }
.grid .bar.last { border-bottom-left-radius: 6px; }
.grid .hcell { font-size: 13px; color: var(--text-2); border-top: 1px solid var(--border-soft); }
.grid .hcell.name { justify-content: flex-start; padding-left: 36px; position: sticky; left: 6px; z-index: 2; }
.grid .hcell .col-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 22px; cursor: text; }
.grid .hcell .col-lock { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); color: var(--text-2); opacity: .8; display: flex; }
.grid .hcell .col-menu { position: absolute; right: 2px; opacity: 0; width: 22px; height: 22px; }
.grid .hcell:hover .col-menu { opacity: 1; }
.grid .add-col { color: var(--text-2); border-top: 1px solid var(--border-soft); }
.grid .filler { border-right: 0; }
.row { display: contents; }
.row:hover > .cell:not(.bar) { background: var(--row-hover); }
.grid .cell.name { justify-content: flex-start; padding: 0 6px 0 8px; gap: 6px; position: sticky; left: 6px; z-index: 1; }
.grid .cell.name .drag { cursor: grab; color: var(--text-2); opacity: 0; width: 18px; display: grid; place-items: center; }
.grid .cell.name:hover .drag { opacity: 1; }
.item-name { flex: 1; min-width: 0; border: 1px solid transparent; border-radius: 3px; background: transparent; padding: 3px 5px; outline: none; overflow: hidden; text-overflow: ellipsis; }
.item-name:hover { border-color: var(--border); }
.item-name:focus { border-color: var(--primary); background: var(--surface); }
.open-item { border: 0; background: transparent; color: var(--text-2); display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 6px; border-radius: 4px; font-size: 12px; }
.open-item:hover { background: var(--hover); color: var(--primary); }
.open-item .badge { background: var(--primary); color: #fff; border-radius: 10px; padding: 0 5px; font-size: 11px; line-height: 16px; }
.row-menu { opacity: 0; width: 26px; height: 26px; }
.cell.name:hover .row-menu { opacity: 1; }
.drop-before > .cell { box-shadow: inset 0 2px 0 var(--primary); }
.drop-after > .cell { box-shadow: inset 0 -2px 0 var(--primary); }
.dragging > .cell { opacity: .4; }

.cell-status { width: 100%; height: 100%; border: 0; color: #fff; font-weight: 500; font-size: 13px; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; }
.cell-status:hover::after { content: ''; position: absolute; right: 0; top: 0; width: 10px; height: 10px; background: linear-gradient(225deg, var(--surface) 50%, transparent 50%); }
.cell-input { width: 100%; height: 100%; border: 1px solid transparent; background: transparent; padding: 0 8px; outline: none; text-align: center; text-overflow: ellipsis; }
.cell-input:hover { border-color: var(--border); }
.cell-input:focus { border-color: var(--primary); background: var(--surface); }
.cell-input.num { text-align: right; }
.cell-btn { width: 100%; height: 100%; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; gap: 4px; }
.cell-btn:hover { outline: 1px solid var(--border); outline-offset: -1px; }
.cell-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 8px; max-width: 100%; }
.cell .placeholder { color: var(--text-2); opacity: 0; }
.cell:hover .placeholder { opacity: 1; }
.cell input[type=checkbox] { width: 18px; height: 18px; accent-color: #2e9e6b; cursor: pointer; }
.date-overdue { color: var(--danger); }

.add-row > .cell.name { padding-left: 34px; }
.add-row input { border: 1px solid transparent; background: transparent; outline: none; width: 100%; height: 28px; padding: 0 6px; border-radius: 3px; }
.add-row input:focus { border-color: var(--primary); }
.add-row > .cell { border-bottom-color: var(--border-soft); }
.summary > .cell { border: 0; background: transparent !important; height: 34px; }
.summary > .cell.sum { border: 1px solid var(--border-soft); border-top: 0; font-weight: 600; font-size: 13px; padding: 4px; }
.summary .sum:first-of-type { border-left: 1px solid var(--border-soft); }
.dist { display: flex; width: 100%; height: 22px; border-radius: 2px; overflow: hidden; }
.dist i { display: block; height: 100%; }
.add-group { margin-top: -16px; position: sticky; left: 0; }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 24px; min-height: 100%; }
.lane { width: 270px; flex: none; background: var(--surface-2); border-radius: 8px; display: flex; flex-direction: column; max-height: 100%; }
.lane-head { color: #fff; padding: 10px 12px; border-radius: 8px 8px 0 0; font-weight: 600; display: flex; justify-content: space-between; }
.lane-body { padding: 8px; display: grid; gap: 8px; min-height: 80px; overflow: auto; align-content: start; }
.lane.drop .lane-body { outline: 2px dashed var(--primary); outline-offset: -4px; border-radius: 8px; }
.card { background: var(--surface); border-radius: 6px; padding: 10px 12px; box-shadow: 0 1px 3px rgba(0,0,0,.12); cursor: grab; display: grid; gap: 8px; border-left: 4px solid var(--gc, var(--border)); }
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.card-title { font-weight: 500; }
.card-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--text-2); font-size: 12px; }
.card-meta .pill { padding: 2px 8px; border-radius: 10px; color: #fff; font-size: 11px; }
.lane-add { border: 0; background: transparent; color: var(--text-2); text-align: left; padding: 8px 12px 12px; }
.lane-add:hover { color: var(--primary); }
.kanban-config { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.kanban-config select { height: 32px; border: 1px solid var(--border); border-radius: 4px; padding: 0 8px; background: var(--surface); }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; padding-bottom: 24px; }
.widget { border: 1px solid var(--border-soft); border-radius: 8px; padding: 16px 18px; background: var(--surface); }
.widget h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.kpi { border: 1px solid var(--border-soft); border-radius: 8px; padding: 14px 18px; }
.kpi .label { color: var(--text-2); font-size: 13px; }
.kpi .value { font-size: 28px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: 120px 1fr 52px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.hbar .track { background: var(--surface-2); border-radius: 4px; height: 20px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 4px; }
.hbar .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.list-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- popover ---------- */
.popover { position: fixed; z-index: 100; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); padding: 8px; min-width: 200px; max-width: 320px; max-height: 70vh; overflow: auto; }
.pop-title { font-size: 12px; color: var(--text-2); padding: 4px 6px 8px; }
.label-list { display: grid; gap: 6px; padding: 4px; }
.label-opt { border: 0; color: #fff; height: 32px; border-radius: 2px; font-weight: 500; min-width: 180px; padding: 0 10px; }
.label-opt:hover { opacity: .85; }
.label-edit { display: flex; gap: 6px; align-items: center; }
.label-edit .swatch { width: 26px; height: 26px; border-radius: 4px; border: 0; flex: none; }
.label-edit input { flex: 1; height: 30px; border: 1px solid var(--border); border-radius: 4px; padding: 0 8px; background: var(--surface); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; height: 34px; padding: 0 10px; border-radius: 4px; text-align: left; color: var(--text); }
.menu-item:hover { background: var(--hover); }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border-soft); margin: 6px 0; }
.swatches { display: grid; grid-template-columns: repeat(6, 26px); gap: 6px; padding: 6px; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 0; }
.swatches button.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.person-opt { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 6px 8px; border-radius: 4px; text-align: left; }
.person-opt:hover { background: var(--hover); }
.person-opt.sel { background: var(--primary-soft); }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--surface); z-index: 51; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slideIn .18s ease-out; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { padding: 16px 20px 0; }
.drawer-head .top { display: flex; align-items: center; gap: 8px; }
.drawer-head input { font-size: 22px; font-weight: 600; flex: 1; border: 1px solid transparent; border-radius: 4px; padding: 4px 6px; background: transparent; outline: none; }
.drawer-head input:hover { border-color: var(--border); }
.drawer-head input:focus { border-color: var(--primary); }
.drawer-body { flex: 1; overflow: auto; padding: 16px 20px; }
.update-box { display: grid; gap: 8px; margin-bottom: 20px; }
.update-box .actions { display: flex; justify-content: flex-end; }
.update { border: 1px solid var(--border-soft); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.update-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.update-head .who { font-weight: 600; }
.update-body { white-space: pre-wrap; line-height: 1.5; }
.act-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.act-row .when { color: var(--text-2); width: 90px; flex: none; }
.info-grid { display: grid; grid-template-columns: 160px 1fr; border: 1px solid var(--border-soft); border-radius: 8px; overflow: hidden; }
.info-grid > div { min-height: 40px; display: flex; align-items: center; border-bottom: 1px solid var(--border-soft); }
.info-grid > .k { padding: 0 12px; color: var(--text-2); background: var(--surface-2); font-size: 13px; }
.info-grid > .v { position: relative; }
.info-grid > .v > * { height: 40px; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--text-2); }
.empty-state .big { font-size: 40px; margin-bottom: 8px; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 17, 40, .5); display: grid; place-items: center; z-index: 80; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; width: min(560px, 100%); padding: 24px; box-shadow: var(--shadow); display: grid; gap: 16px; max-height: 90vh; overflow: auto; }
.modal.wide { width: min(1120px, 100%); }
.modal h2 { margin: 0; font-size: 22px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; }
.tpl-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-scroll { max-height: 42vh; overflow: auto; padding: 2px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tpl { border: 2px solid var(--border-soft); border-radius: 8px; padding: 12px; text-align: left; background: var(--surface); display: grid; gap: 4px; }
.tpl:hover { border-color: var(--border); }
.tpl.sel { border-color: var(--primary); background: var(--primary-soft); }
.tpl strong { font-size: 14px; }
.tpl span { font-size: 12px; color: var(--text-2); }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 200; }
.toast { background: #2b2f3a; color: #fff; padding: 10px 16px; border-radius: 6px; box-shadow: var(--shadow); font-size: 14px; animation: slideIn .2s; }
.toast.error { background: var(--danger); }

.welcome { display: grid; place-items: center; height: 100%; text-align: center; padding: 24px; }
.welcome h2 { font-size: 26px; margin: 8px 0; }

/* ---------- modules ---------- */
.icon-btn.on { background: var(--primary-soft); color: var(--primary); }
.bell { position: relative; }
.bell-badge { position: absolute; top: 2px; right: 2px; background: var(--danger); color: #fff; border-radius: 10px; font-size: 10px; line-height: 14px; min-width: 14px; padding: 0 3px; text-align: center; }
.brand-logo img { display: block; }
.brand-hero { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.brand-hero img { max-height: 72px; max-width: 280px; background: #fff; padding: 8px 12px; border-radius: 10px; align-self: flex-start; }
.brand-name { font-size: 28px; font-weight: 700; } .brand-tag { opacity: .85; }
.page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.field { display: grid; gap: 6px; margin-bottom: 12px; } .field-label { font-size: 13px; color: var(--text-2); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; padding-bottom: 32px; }
.settings-grid .widget h4 { margin: 18px 0 6px; font-size: 14px; }
.logo-preview { min-height: 64px; display: flex; align-items: center; } .logo-preview img { max-height: 64px; max-width: 240px; }
.key-reveal { background: var(--primary-soft); border-radius: 8px; padding: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.key-reveal code { background: var(--surface); padding: 6px 8px; border-radius: 4px; word-break: break-all; }
pre.code { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 6px; padding: 12px; font-size: 12.5px; overflow: auto; white-space: pre; }
.chip-code { display: inline-block; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 4px; padding: 1px 6px; margin: 2px; cursor: pointer; font-size: 12px; }
.chip-code:hover { border-color: var(--primary); }

/* help */
.help-drawer { width: min(520px, 100%); }
.help-body { padding-top: 0; }
.help-sec { border: 1px solid var(--border-soft); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.help-sec-head { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: var(--surface-2); padding: 12px 14px; font-weight: 600; color: var(--text); text-align: left; }
.help-sec.open .help-sec-head { background: var(--primary-soft); }
.help-sec-body { padding: 12px 14px; }
.help-intro { margin: 0 0 12px; color: var(--text-2); line-height: 1.5; }
.help-item { padding: 10px 0; border-top: 1px solid var(--border-soft); }
.help-name { font-weight: 600; margin-bottom: 4px; }
.help-row { display: grid; grid-template-columns: 60px 1fr; gap: 8px; font-size: 13px; line-height: 1.5; margin-top: 2px; }
.help-k { color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding-top: 3px; }

/* subitems */
.sub-toggle { width: 22px; height: 22px; opacity: .35; margin-left: -4px; position: relative; }
.sub-toggle.has, .cell.name:hover .sub-toggle { opacity: 1; }
.sub-count { position: absolute; right: -4px; top: -4px; background: var(--primary); color: #fff; border-radius: 8px; font-size: 9px; line-height: 12px; padding: 0 3px; }
.sub-row > .cell { background: var(--surface-2); }

/* columns */
.tl-pill { position: relative; width: 100%; height: 24px; border-radius: 12px; background: var(--primary-soft); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.tl-pill i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); opacity: .35; }
.tl-pill span { position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.formula-val { font-variant-numeric: tabular-nums; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time-cell { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.time-cell .running { color: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.link-pills { display: flex; gap: 4px; overflow: hidden; }
.link-pill { background: var(--primary-soft); color: var(--primary); border-radius: 10px; padding: 2px 8px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.mirror-val { font-size: 13px; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }

/* timeline view */
.tl-wrap { display: flex; flex-direction: column; height: 100%; }
.tl-scroll { overflow: auto; flex: 1; border: 1px solid var(--border-soft); border-radius: 8px; }
.tl-canvas { position: relative; }
.tl-head { display: flex; position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--border-soft); }
.tl-label-col { width: 260px; flex: none; position: sticky; left: 0; background: var(--surface); z-index: 2; padding: 0 12px; display: flex; align-items: center; gap: 8px; border-right: 1px solid var(--border-soft); font-size: 13px; }
.tl-grid { position: relative; height: 40px; background-image: linear-gradient(to right, var(--border-soft) 1px, transparent 1px); background-size: 36px 100%; }
.tl-month { position: absolute; top: 2px; font-size: 11px; font-weight: 600; color: var(--text-2); padding-left: 4px; border-left: 1px solid var(--border); height: 100%; }
.tl-day { position: absolute; top: 22px; font-size: 11px; text-align: center; color: var(--text-2); } .tl-day.wknd { color: var(--border); }
.tl-group { font-weight: 600; padding: 10px 12px 4px; position: sticky; left: 0; display: inline-block; }
.tl-row { display: flex; height: 40px; border-bottom: 1px solid var(--border-soft); }
.tl-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; } .tl-name:hover { color: var(--primary); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 1; }
.tl-bar { position: absolute; top: 8px; height: 24px; border-radius: 6px; color: #fff; font-size: 12px; padding: 0 8px; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.tl-bar.done { opacity: .5; } .tl-bar.late { outline: 2px solid var(--danger); }

/* calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-size: 12px; color: var(--text-2); text-align: center; padding: 4px; }
.cal-cell { min-height: 96px; border: 1px solid var(--border-soft); border-radius: 6px; padding: 4px; display: flex; flex-direction: column; gap: 3px; background: var(--surface); }
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day { font-size: 12px; color: var(--text-2); }
.cal-item { border: 0; color: #fff; border-radius: 4px; font-size: 11px; padding: 2px 6px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item.done { opacity: .5; text-decoration: line-through; }

/* workload */
.wl-grid { display: grid; gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: 8px; overflow: hidden; }
.wl-grid > div { background: var(--surface); padding: 8px 10px; font-size: 13px; }
.wl-head { font-weight: 600; color: var(--text-2); font-size: 12px; }
.wl-person { display: flex; align-items: center; gap: 8px; }
.wl-cell { display: flex; flex-direction: column; gap: 4px; }
.wl-cell.over { background: #fbe9ec; } :root[data-theme="dark"] .wl-cell.over { background: #4a2630; }
.wl-bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; } .wl-bar i { display: block; height: 100%; background: var(--primary); } .wl-cell.over .wl-bar i { background: var(--danger); }

/* drawer tabs */
.act-type { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; padding: 2px 8px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.dropzone { border: 2px dashed var(--border); border-radius: 8px; padding: 20px; text-align: center; color: var(--text-2); cursor: pointer; display: grid; gap: 4px; justify-items: center; }
.dropzone.over, .dropzone:hover { border-color: var(--primary); color: var(--primary); }
.sms-thread { display: grid; gap: 8px; }
.bubble { max-width: 85%; padding: 10px 12px; border-radius: 12px; font-size: 14px; white-space: pre-wrap; }
.bubble.out { background: var(--primary); color: #fff; justify-self: end; border-bottom-right-radius: 4px; } .bubble.out .muted { color: rgba(255,255,255,.75); }
.bubble.in { background: var(--surface-2); justify-self: start; border-bottom-left-radius: 4px; }
.qline { display: grid; grid-template-columns: 1fr 80px 110px 100px 32px; gap: 6px; align-items: center; }
.qline.head { font-size: 11px; color: var(--text-2); text-transform: uppercase; }
.qline .amt { text-align: right; font-variant-numeric: tabular-nums; }

/* automations / forms / campaigns */
.rule-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px 12px; }
.rule-block { border: 1px solid var(--border-soft); border-radius: 8px; padding: 12px; display: grid; gap: 8px; }
.rule-kw { font-weight: 700; color: var(--primary); text-transform: uppercase; font-size: 12px; letter-spacing: .5px; }
.step-card { border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px; display: grid; gap: 8px; }
.switch { position: relative; width: 36px; height: 20px; flex: none; } .switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--border); border-radius: 10px; transition: .15s; } .switch i::after { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + i { background: var(--accent-strong, #2e9e6b); } .switch input:checked + i::after { transform: translateX(16px); }
@media (max-width: 800px) { .qline { grid-template-columns: 1fr 60px 80px 70px 28px; } .help-drawer { width: 100%; } }

/* platform owner badge + hosted companies */
.platform-badge { position: fixed; right: 14px; bottom: 12px; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-soft); box-shadow: 0 2px 10px rgba(0,0,0,.12); text-decoration: none; color: var(--text); font-size: 11px; line-height: 1.1; }
.platform-badge img { width: 30px; height: 30px; border-radius: 50%; }
.platform-badge small { display: block; color: var(--text-2); font-size: 10px; }
.platform-badge b { font-size: 12px; }
.platform-badge:hover { border-color: var(--primary); }
@media (max-width: 800px) { .platform-badge span { display: none; } .platform-badge { padding: 4px; } }
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; padding-bottom: 60px; }
.company-card { border: 1px solid var(--border-soft); border-top: 4px solid var(--primary); border-radius: 10px; padding: 14px 16px; background: var(--surface); display: grid; gap: 8px; }
.company-card-head { display: flex; gap: 12px; align-items: center; } .company-card-head img { max-height: 40px; max-width: 120px; }
.company-stats { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); }
.toasts { bottom: 64px; }

/* government capture */
.gov-tab .widget { margin-bottom: 12px; }
.req-grid { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; font-size: 13px; }
.gap { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; color: var(--danger); }
.gap.soft { color: var(--text-2); } .gap:last-child { border-bottom: 0; }
.fit-ok { color: #2e9e6b; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.partner-card { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.covers { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.cover { display: inline-flex; align-items: center; gap: 4px; background: #e3f3ea; color: #1f6e49; border-radius: 10px; padding: 2px 8px; font-size: 11px; }
:root[data-theme="dark"] .cover { background: #1f3a2d; color: #8fd4ad; }
.qa { padding: 8px 0; border-bottom: 1px solid var(--border-soft); } .qa:last-of-type { border-bottom: 0; }
.qa-q { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.qa-chip { height: 28px; text-transform: capitalize; }

/* ---------- mobile (iPhone / Galaxy) ---------- */
.mobile-nav { display: none; }
.side-backdrop { display: none; }
@media (hover: none) and (pointer: coarse) { .row-menu, .group-menu, .grid .cell.name .drag, .grid .hcell .col-lock { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); color: var(--text-2); opacity: .8; display: flex; }
.grid .hcell .col-menu { opacity: 1; } }
@media (max-width: 760px) {
  :root { --name-col: 170px; --col-w: 118px; --header-h: 52px; }
  html, body { overscroll-behavior-y: none; }
  .topbar { gap: 4px; padding: 0 6px 0 8px; }
  .topbar .brand-logo img { max-height: 32px !important; max-width: 120px !important; }
  .main-wrap { padding: 0 0 calc(56px + env(safe-area-inset-bottom)) 0; }
  .content { border-radius: 0; box-shadow: none; }
  body.mobile .sidebar { width: min(300px, 86vw); padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body.mobile .side-backdrop { display: block; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(0,0,0,.35); z-index: 29; }
  .board-head { padding: 10px 12px 0; }
  .board-title-row h2, .board-title-row input.board-title { font-size: 19px; }
  .board-desc { display: none; }
  .tabs { gap: 0; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; min-height: 40px; }
  .toolbar { padding: 8px 12px; gap: 6px; }
  .toolbar .search { width: 100%; }
  .toolbar .chip { height: 36px; }
  .board-body { padding: 0 12px 24px; }
  .group { margin-bottom: 24px; }
  .group-name { font-size: 16px; }
  .btn { min-height: 40px; } .side-item { height: 44px; } .input, .cell-input { font-size: 16px; } /* 16px prevents iOS zoom-on-focus */
  .popover { max-width: calc(100vw - 16px); max-height: 60vh; }
  .drawer { width: 100%; animation: slideUp .2s ease-out; }
  .drawer-head { padding: 12px 14px 0; } .drawer-head input { font-size: 18px; } .drawer-body { padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: slideUp .2s ease-out; }
  .modal h2 { font-size: 19px; }
  .tpl-grid { grid-template-columns: 1fr 1fr; } .tpl-scroll { max-height: 36vh; }
  .kanban { gap: 10px; scroll-snap-type: x mandatory; }
  .lane { width: min(84vw, 300px); scroll-snap-align: start; }
  .help-drawer { width: 100%; }
  .platform-badge { bottom: calc(62px + env(safe-area-inset-bottom)); right: 8px; }
  .settings-grid { grid-template-columns: 1fr !important; }
  .widget { padding: 14px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border-soft); z-index: 45; box-shadow: 0 -2px 10px rgba(0,0,0,.06); }
  .mobile-nav button { border: 0; background: transparent; color: var(--text-2); display: grid; place-items: center; gap: 2px; font-size: 11px; padding-top: 6px; }
  .mobile-nav button.active { color: var(--primary); }
  .mobile-nav button .svg { width: 22px; height: 22px; }
  .mobile-nav .fab { position: relative; }
  .mobile-nav .fab span { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; margin-top: -18px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
}
@keyframes slideUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
/* Cards view (phone-friendly list; also usable on desktop) */
.cards { display: grid; gap: 18px; padding-bottom: 12px; }
.cards-group { display: grid; gap: 8px; }
.cards-group-head { display: flex; align-items: center; gap: 8px; color: var(--gc); font-weight: 600; font-size: 15px; }
.cards-group-head .count { color: var(--text-2); font-weight: 400; font-size: 13px; }
.card-item { display: grid; gap: 8px; padding: 12px 12px 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-soft); border-left: 4px solid var(--gc, var(--border)); text-align: left; width: 100%; color: var(--text); }
.card-item:active { background: var(--hover); }
.card-item .title { font-weight: 500; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.card-item .title .sub { color: var(--text-2); font-size: 12px; font-weight: 400; }
.card-item .chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card-item .pill { padding: 3px 9px; border-radius: 10px; color: #fff; font-size: 12px; white-space: nowrap; }
.card-item .kv { font-size: 12px; color: var(--text-2); display: inline-flex; gap: 4px; align-items: center; background: var(--surface-2); border-radius: 6px; padding: 3px 7px; }
.card-item .kv b { color: var(--text); font-weight: 500; }
.card-item .kv.overdue b { color: var(--danger); }
.cards-add { display: flex; gap: 8px; }
.cards-add .input { flex: 1; }

/* ---------- Leads page (R3) ---------- */
.link-btn { border: 0; background: none; color: var(--primary); padding: 0 4px; cursor: pointer; font: inherit; display: inline-flex; gap: 4px; align-items: center; }
.link-btn:hover { text-decoration: underline; }
.leads-page .board-body { flex: 1; min-height: 0; }
.leads-list { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.lead-filters { padding: 10px 24px 6px; display: grid; gap: 8px; }
.lead-views, .lead-filter-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.lead-filter-row .input.lf { height: 32px; padding: 0 8px; font-size: 13px; }
.tier-filter { display: inline-flex; gap: 2px; }
.tier-filter .chip { padding: 0 4px; }
.tier-badge { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 12px; flex: none; }
.dnc-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; vertical-align: middle; }
.conv-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: #e3a71c; color: #1d1d1d; font-size: 10px; font-weight: 700; vertical-align: middle; }
.bulkbar { position: sticky; top: 0; z-index: 3; margin: 0 24px 6px; padding: 8px 12px; border-radius: 8px; background: var(--primary-soft); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.leads-scroll { flex: 1; min-height: 0; overflow: auto; margin: 0 24px; border: 1px solid var(--border-soft); border-radius: 8px; }
.leads-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.leads-table th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font-weight: 600; padding: 8px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; color: var(--text-2); font-size: 12px; }
.leads-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.leads-table tbody tr { cursor: pointer; }
.leads-table tbody tr:hover { background: var(--hover); }
.leads-table tr.sel { background: var(--primary-soft); }
.leads-table tr.dnc .lc-name .nm { color: var(--text-2); }
.leads-table .lc-name { min-width: 220px; max-width: 360px; }
.leads-table .lc-name .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leads-table .lc-name .sub { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leads-table .lc-cat { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leads-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.leads-table a.strike { text-decoration: line-through; color: var(--text-2); }
.status-sel, .owner-sel { height: 28px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); color: var(--text); font-size: 12px; padding: 0 8px; max-width: 150px; }
.status-sel { border-color: var(--c, var(--border)); box-shadow: inset 4px 0 0 var(--c, transparent); }
.pager { display: flex; gap: 8px; align-items: center; padding: 10px 220px 14px 24px; font-size: 13px; flex-wrap: wrap; }
.pager .spacer { flex: 1; }
.undo-bar { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 210; background: #2b2f3a; color: #fff; padding: 8px 10px 8px 16px; border-radius: 8px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); font-size: 14px; }
.undo-bar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.undo-bar .icon-btn { color: #fff; }
.fld { display: grid; gap: 4px; font-size: 12px; color: var(--text-2); }
.fld .input { color: var(--text); font-size: 14px; }
.fld-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.lead-drawer { width: min(720px, 100%); }
.lead-head-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0 12px; border-bottom: 1px solid var(--border-soft); }
.lead-head-row .spacer { flex: 1; }
.dnc-banner { background: rgba(209, 75, 90, .12); border: 1px solid var(--danger); border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.lead-note { padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.lead-note:last-child { border-bottom: 0; }
.lead-note .meta { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.lead-note .body { white-space: pre-wrap; }
.lead-note.k-system .body { color: var(--text-2); }
table.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
table.kv th { text-align: left; color: var(--text-2); font-weight: 500; padding: 5px 10px 5px 0; vertical-align: top; white-space: nowrap; width: 1%; }
table.kv td { padding: 5px 0; vertical-align: top; word-break: break-word; }
table.kv.preview th, table.kv.preview td { padding: 5px 8px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.dropzone { border: 2px dashed var(--border); border-radius: 10px; padding: 22px; text-align: center; cursor: pointer; display: grid; gap: 6px; justify-items: center; color: var(--text-2); }
.dropzone.over, .dropzone:hover { border-color: var(--primary); color: var(--text); }
.imp-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.dupe-pair { border: 1px solid var(--border-soft); border-radius: 8px; padding: 12px; margin-bottom: 12px; background: var(--surface); }
.dupe-reason { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.dupe-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dupe-card { border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px; display: grid; gap: 4px; align-content: start; }
.rule { border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px; display: grid; gap: 10px; margin-bottom: 10px; }
@media (max-width: 800px) {
  .lead-filters { padding: 8px 12px; }
  .lead-filter-row .input.lf { width: calc(50% - 4px) !important; }
  .leads-scroll { margin: 0 8px; }
  .bulkbar { margin: 0 8px 6px; }
  .pager { padding: 10px 12px; }
  .dupe-cards { grid-template-columns: 1fr; }
  .leads-table th:nth-child(n+8), .leads-table td:nth-child(n+8) { display: none; }
}
.lead-dash .hbar { grid-template-columns: 140px 1fr auto; }
.lead-dash .hbar .n { white-space: nowrap; min-width: 52px; }

/* ---------- R4: live, bulk, views, search, reports, SSO ---------- */
.row-check { width: 15px; height: 15px; margin: 0 4px 0 2px; flex: none; accent-color: var(--primary); opacity: .35; cursor: pointer; }
.row:hover .row-check, .row-check:checked, .hcell .row-check { opacity: 1; }
.cell.name.selected { background: var(--primary-soft); }
.board-bulk { margin: 0 24px 8px; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; background: #e5f6ee; color: #1f7a50; font-size: 12px; font-weight: 600; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2e9e6b; box-shadow: 0 0 0 0 rgba(46,158,107,.6); animation: livePulse 2s infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(46,158,107,.55); } 70% { box-shadow: 0 0 0 7px rgba(46,158,107,0); } 100% { box-shadow: 0 0 0 0 rgba(46,158,107,0); } }
.filter-pop { display: grid; gap: 6px; padding: 4px; width: min(520px, 90vw); }
.filter-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.filter-row .input { height: 32px; width: auto; min-width: 110px; font-size: 13px; }
.filter-row select[multiple] { height: auto; }
.view-opt { display: flex; align-items: center; }
.view-opt .person-opt { flex: 1; }
.label-pick { display: grid; gap: 4px; padding: 4px; min-width: 180px; }
.label-opt { border: 0; color: #fff; padding: 6px 10px; border-radius: 4px; text-align: left; cursor: pointer; }
.global-search { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-2); min-width: 220px; cursor: pointer; }
.global-search span { flex: 1; text-align: left; }
.global-search kbd { font-family: inherit; font-size: 11px; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.search-modal { width: min(640px, 92vw); }
.search-results { max-height: 60vh; overflow: auto; display: grid; }
.search-hit { display: flex; gap: 10px; align-items: center; border: 0; background: none; padding: 8px 10px; border-radius: 6px; text-align: left; color: var(--text); cursor: pointer; font: inherit; font-size: 14px; }
.search-hit .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit.sel { background: var(--primary-soft); }
.report-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; padding: 16px 24px; overflow: auto; align-items: start; }
.rbuild { display: grid; gap: 10px; align-content: start; }
.rchart .hbar .lbl { font-size: 12px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.ms-btn { display: flex; gap: 10px; align-items: center; justify-content: center; text-decoration: none; height: 40px; }
.ms-logo { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-logo i { width: 9px; height: 9px; } .ms-logo i:nth-child(1) { background: #f25022; } .ms-logo i:nth-child(2) { background: #7fba00; } .ms-logo i:nth-child(3) { background: #00a4ef; } .ms-logo i:nth-child(4) { background: #ffb900; }
@media (max-width: 800px) {
  .report-grid { grid-template-columns: 1fr; padding: 12px; }
  .global-search { min-width: 0; } .global-search span, .global-search kbd { display: none; }
  .filter-pop { min-width: 0; }
  .board-bulk { margin: 0 8px 8px; }
}
.label-chips { display: flex; flex-wrap: wrap; gap: 4px; flex-basis: 100%; }
.lchip { border: 1px solid var(--c); background: transparent; color: var(--text); border-radius: 12px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.lchip.on { background: var(--c); color: #fff; }
.popover:has(.filter-pop) { max-width: min(560px, 94vw); }

/* ---------- R5: accounts + forecast ---------- */
.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
table.mt { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mt th { background: var(--surface-2); color: var(--text-2); font-size: 12px; text-align: left; padding: 8px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
table.mt td { padding: 6px 8px; border-bottom: 1px solid var(--border-soft); }
table.mt td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fc-in { height: 30px; width: 120px; text-align: right; }
.fc-total td { background: var(--surface-2); }
.att-track { display: inline-block; width: 80px; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.att-track i { display: block; height: 100%; border-radius: 4px; }
a.list-row:hover { background: var(--row-hover); }

/* ---------- R6: catalog quotes, approvals, mail sync ---------- */
.qline.qline-cat { grid-template-columns: 1fr 64px 80px 70px 96px 92px 32px; }
.approval-box { border: 1px solid; border-left-width: 4px; border-radius: 6px; padding: 8px 10px; margin-top: 8px; }
.approver-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.conn-card { display: flex; gap: 10px; align-items: center; border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px 12px; }
.conn-card .grow { flex: 1; min-width: 0; }
.prov-logo { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.price-grid input { height: 30px; width: 110px; text-align: right; }
@media (max-width: 800px) { .qline.qline-cat { grid-template-columns: 1fr 56px 70px 80px 28px; } .qline.qline-cat > :nth-child(3), .qline.qline-cat > :nth-child(6) { display: none; } }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- R7: AI assist ---------- */
.ai-card { border: 1px solid #c9b6f2; background: linear-gradient(180deg, rgba(154,107,209,.08), transparent 70%); border-radius: 10px; padding: 12px 14px; }
.ai-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ai-head h3 { margin: 0; font-size: 15px; }
.tag-ai { font-size: 11px; color: #6b4bb8; background: #ece4ff; border-radius: 4px; padding: 1px 6px; }
.ai-md h4 { margin: 8px 0 2px; font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: .3px; }
.ai-md p { margin: 2px 0; font-size: 13px; } .ai-li { font-size: 13px; margin: 2px 0; }
.ai-pre { white-space: pre-wrap; font-family: inherit; font-size: 13px; background: var(--surface-2); padding: 8px; border-radius: 6px; }
.ai-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
@media (prefers-color-scheme: dark) { .tag-ai { background: #3b2f5c; color: #d9c8ff; } }
@media (max-width: 800px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi { padding: 10px 12px; } .kpi .value { font-size: 20px; } }

/* file upload progress (R7.5) */
.up-bar { height: 4px; background: var(--border-soft, #e6e8ef); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.up-bar > i { display: block; height: 100%; background: var(--primary); width: 0; transition: width .2s ease; }
.up-row.up-done .up-bar > i { background: #2e9e6b; }
.up-row.up-failed .up-bar > i { background: var(--danger, #c0392b); width: 100% !important; }
.up-row.up-failed .up-state { color: var(--danger, #c0392b); }
.up-row.up-done .up-state { color: #2e9e6b; }
.dropzone.busy { border-style: solid; border-color: var(--primary); }
.dropzone > * { pointer-events: none; }

/* checklist subitems (R7.6) */
.check-row .chk-cell { padding: 0 8px 0 52px; display: flex; align-items: center; }
.check-row .chk-rest { padding: 0 10px; display: flex; align-items: center; justify-content: flex-start; }
.check-row .chk-rest .chk-line { width: auto; }
.chk-line { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; }
.chk-line .chk-done { width: 16px; height: 16px; accent-color: #2e9e6b; flex: none; cursor: pointer; }
.chk-line .chk-name { flex: 1 1 260px; min-width: 120px; border: 1px solid transparent; background: transparent; padding: 4px 6px; border-radius: 6px; font: inherit; color: inherit; }
.chk-line .chk-name:hover, .chk-line .chk-name:focus { border-color: var(--border); background: var(--surface); outline: none; }
.chk-line .chk-due, .chk-line .chk-owner { height: 28px; border: 1px solid var(--border-soft, var(--border)); border-radius: 6px; background: var(--surface); color: var(--text-2); font-size: 12px; padding: 0 6px; flex: none; }
.chk-line .chk-due { width: 132px; }
.chk-line .chk-owner { width: 140px; }
.chk-line .chk-due.overdue { color: #c0392b; border-color: #c0392b; font-weight: 600; }
.chk-line .chk-due.soon { color: #b46a00; border-color: #e0a040; }
.chk-line .chk-avatar-gap { width: 24px; flex: none; }
.chk-line .chk-plus { color: var(--text-2); width: 16px; display: inline-flex; justify-content: center; flex: none; }
.check-row.done .chk-name, .chk-line.done .chk-name { text-decoration: line-through; color: var(--text-2); }
.check-row .chk-del { opacity: 0; } .check-row:hover .chk-del, .chk-line:hover .chk-del { opacity: 1; }
.chk-drawer .chk-line { border-bottom: 1px solid var(--border-soft, #eee); padding: 4px 0; }
.chk-drawer .chk-line .chk-del { opacity: .6; }
.chk-badge.all { background: #2e9e6b; color: #fff; }
.chk-badge.late { box-shadow: inset 0 0 0 2px #c0392b; }
@media (max-width: 700px) { .chk-line { flex-wrap: wrap; } .chk-line .chk-name { flex-basis: 100%; } }

/* column reorder (R7.7) */
.hcell[draggable="true"] { cursor: grab; }
.hcell.col-drop-l { box-shadow: inset 3px 0 0 var(--primary); }
.hcell.col-drop-r { box-shadow: inset -3px 0 0 var(--primary); }

/* marketing (R8) */
.mk-body { display: grid; gap: 14px; align-content: start; }
.mk-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mk-legal { font-size: 13px; margin: 0; }
.mk-text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; }
.mk-text.reply { border-left: 3px solid var(--primary); }
.mk-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-2); margin-top: 6px; align-items: center; }
.mk-blocked { color: #b4232f; background: #fdecee; border-radius: 6px; padding: 6px 10px; font-size: 13px; margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.mk-text-msg { display: grid; gap: 8px; align-content: start; }
.mk-confirm { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.mk-convo { display: grid; gap: 4px; margin-top: 10px; max-height: 220px; overflow: auto; }
.mk-convo .bubble { max-width: 85%; padding: 6px 10px; border-radius: 12px; font-size: 13px; white-space: pre-wrap; }
.mk-convo .bubble.in { background: var(--hover, #eef0f5); justify-self: start; }
.mk-convo .bubble.out { background: var(--primary); color: #fff; justify-self: end; }
.mk-thread summary { cursor: pointer; padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.mk-camp { text-align: left; cursor: pointer; display: grid; gap: 6px; font: inherit; color: inherit; }
.mk-camp:hover { border-color: var(--primary); }
.mk-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-2); }
.mk-st-running, .mk-st-published, .mk-st-active, .mk-st-sent { background: #e5f5ec; color: #1e7a4c; }
.mk-st-paused, .mk-st-scheduled, .mk-st-draft, .mk-st-partial { background: #fff4e0; color: #9a5b00; }
.mk-st-failed, .mk-st-opted_out { background: #fdecee; color: #b4232f; }
.mk-st-replied { background: #e8eefb; color: #24448a; }
.mk-step { border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px; display: grid; gap: 8px; }
.mk-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mk-type { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px; cursor: pointer; }
.modal.mk-wide { width: min(760px, 100%); }
.mk-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.mk-preview { border: 1px dashed var(--border); border-radius: 8px; padding: 10px; font-size: 13px; display: grid; gap: 4px; }
.mk-pick { display: grid; gap: 2px; max-height: 320px; overflow: auto; }
.mk-video img, .mk-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: #1f2430; color: #fff; display: grid; place-items: center; margin-bottom: 8px; }
.mk-live { width: 100%; max-height: 360px; background: #000; border-radius: 8px; }
.mk-clock { font-variant-numeric: tabular-nums; }
.mk-net { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; color: #fff; font-size: 11px; font-weight: 700; flex: none; }
@media (max-width: 800px) { .mk-text { grid-template-columns: 1fr; } .mk-types { grid-template-columns: 1fr; } }
/* sales videos (R8.1) */
.mk-vcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 256px)); gap: 14px; }
.mk-vcard { text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px; display: grid; gap: 6px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.mk-vcard:hover { border-color: var(--primary); box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.mk-vthumb { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 8px; overflow: hidden; display: grid; place-items: center; color: #fff; margin-bottom: 4px; }
.mk-vthumb img { width: 100%; height: 100%; object-fit: contain; }
.mk-play { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.95); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.mk-play::after { content: ''; position: absolute; left: 13px; top: 9px; border-style: solid; border-width: 8px 0 8px 12px; border-color: transparent transparent transparent var(--primary); }
.mk-crumb { font-size: 12px; } .mk-crumb a { color: var(--primary); text-decoration: none; }
.mk-vgrid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.mk-player { width: 100%; border-radius: 8px; background: #000; aspect-ratio: 16/9; display: block; }
@media (max-width: 900px) { .mk-vgrid { grid-template-columns: 1fr; } }

/* ---------- R9 lead research ---------- */
.rs-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rs-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rs-views, .rs-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rs-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 8px 12px; border-radius: 8px; }
.rs-note.ok { background: #e6f4ec; color: #1f6b47; }
.rs-note.warn { background: #fdf3e1; color: #7a5310; }
.rs-note code { font-size: 12px; background: rgba(0,0,0,.06); padding: 1px 4px; border-radius: 4px; }
.rs-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.rs-preset { text-align: left; display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; color: var(--text); }
.rs-preset { align-content: start; }
.rs .fld-grid { align-items: start; }
.rs-preset span { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.rs-preset:hover { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.rs-markets { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.rs-card { border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px; display: grid; gap: 6px; align-content: start; background: var(--surface-2); }
.rs-card .btn { justify-self: start; }
.rs-chip { font-size: 11px; font-weight: 600; background: var(--primary-soft); color: var(--primary); border-radius: 10px; padding: 1px 8px; }
.rs-last { display: grid; gap: 6px; font-size: 12px; margin: 4px 0; }
.rs-mini { display: flex; gap: 10px; flex-wrap: wrap; color: var(--text-2); }
.rs-mini b { color: var(--text); }
.rs-pill { display: inline-block; font-size: 11px; font-weight: 600; color: #fff; background: var(--c); border-radius: 10px; padding: 1px 8px; text-transform: capitalize; }
.rs-tierbar { display: flex; height: 16px; border-radius: 4px; overflow: hidden; font-size: 10px; color: #fff; font-weight: 600; }
.rs-tierbar span { display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; }
.rs-hist td, .rs-hist th { white-space: nowrap; font-size: 13px; }
.rs-live { border-left: 3px solid var(--primary); display: grid; gap: 10px; }
.rs-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.rs-steps li { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px 4px 4px; border-radius: 14px; background: var(--surface-2); color: var(--text-2); }
.rs-steps li .n { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--border); color: var(--text); font-weight: 600; font-size: 11px; }
.rs-steps li.done .n { background: #2e9e6b; color: #fff; }
.rs-steps li.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.rs-steps li.active .n { background: var(--primary); color: #fff; }
.rs-bar { height: 6px; background: var(--border-soft); border-radius: 3px; overflow: hidden; }
.rs-bar span { display: block; height: 100%; background: var(--primary); transition: width .4s; }
.rs-edit td { padding: 4px 6px 4px 0; vertical-align: middle; }
.rs-edit .input { width: 100%; }
.rs-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 6px 0; }
.rs-check input { margin-top: 3px; }
.rs-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 8px; }
.rs-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rs-weights { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.rs-preview { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.rs-savebar { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 -2px 10px rgba(0,0,0,.06); }
.rs-how { display: flex; gap: 12px; margin: 10px 0; }
.rs-how .n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.rs-how p { margin: 4px 0 0; font-size: 13px; color: var(--text-2); }
.rs-ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13px; }
.rs .fld small { font-size: 11px; }

.join-code { font-size: 18px; font-weight: 700; letter-spacing: 2px; padding: 6px 12px; border-radius: 8px; background: var(--surface-2); border: 1px dashed var(--border); }
.company-flag { display: flex; gap: 6px; align-items: center; font-size: 12px; margin: 6px 0 2px; }

/* ---------- sales strategy templates ---------- */
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.st-card { border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px; display: grid; gap: 6px; align-content: start; background: var(--surface-2); }
.st-used { display: flex; flex-wrap: wrap; gap: 4px; }
.st-co { font-size: 11px; border-radius: 10px; padding: 1px 8px; background: #e6f4ec; color: #1f6b47; }
.st-co.old { background: #fdf3e1; color: #7a5310; }
.st-report { display: grid; gap: 8px; max-height: 320px; overflow: auto; font-size: 13px; border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px; }
.st-rep ul { margin: 4px 0 0; padding-left: 18px; }
.st-rep.add strong { color: #1f6b47; } .st-rep.upd strong { color: var(--primary); } .st-rep.skip strong { color: #7a5310; } .st-rep.same strong { color: var(--text-2); }
.st-apply { width: 100%; min-width: 0; box-sizing: border-box; }
.st-apply .st-report, .st-apply p { overflow-wrap: anywhere; }

.company-features { display: grid; gap: 2px; margin: 6px 0 4px; }
.addon-list { display: grid; gap: 2px; padding-left: 22px; border-left: 2px solid var(--border-soft); margin-left: 6px; }
.addon-list.off { opacity: .5; }
.addon-dev { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; background: #fdf3e1; color: #7a5310; border-radius: 8px; padding: 1px 6px; margin-left: 6px; }

/* ---------- incumbent check ---------- */
.inc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.inc-pill { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: var(--c); border-radius: 10px; padding: 2px 9px; white-space: nowrap; }
.inc-who { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.inc-name { font-size: 18px; font-weight: 700; }
.inc-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 8px; }
.inc-money .value { font-size: 22px; }
.inc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 10px 0; }
.inc-kv { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; border-bottom: 1px solid var(--border-soft); padding: 3px 0; }
.inc-kv span { color: var(--text-2); } .inc-kv b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.inc-ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; }
.inc-none { display: grid; gap: 6px; }
@media (max-width: 640px) { .inc-money, .inc-grid { grid-template-columns: 1fr; } }

/* ---------- recompete finder ---------- */
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 14px; }
.rc-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rc-check { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.rc-lead { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.rc-lead label { display: flex; gap: 6px; align-items: center; }
.rc-summary { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.rc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rc-table th { text-align: left; font-weight: 600; color: var(--text-2); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.rc-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.rc-row-main { cursor: pointer; } .rc-row-main:hover td, .rc-row-main.open td { background: var(--row-hover); }
.rc-desc { font-weight: 600; max-width: 380px; overflow-wrap: anywhere; }
.rc-sub { font-size: 11px; }
.rc-flags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.rc-flag { font-size: 10px; font-weight: 600; border-radius: 8px; padding: 1px 6px; background: var(--surface-2); color: var(--text-2); }
.rc-flag.final { background: #fdecee; color: #b4232f; } .rc-flag.opts { background: #e6eefb; color: #305090; }
.rc-status { font-size: 11px; font-weight: 600; border-radius: 10px; padding: 2px 8px; background: #e6f4ec; color: #1f6b47; white-space: nowrap; }
.rc-status.dismissed { background: var(--surface-2); color: var(--text-2); }
.rc-detail td { background: var(--surface-2); }
.rc-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 24px; padding: 6px 4px; }
.rc-cards { display: grid; gap: 12px; max-width: 1100px; }
.rc-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.rc-card-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 10px 0; }
.rc-card-kpis div { display: grid; gap: 2px; font-size: 13px; } .rc-card-kpis span { font-size: 11px; color: var(--text-2); }
.side-item .side-count, .side-count { flex: 0 0 auto; width: auto; margin-left: auto; font-size: 11px; font-weight: 700; background: var(--primary); color: #fff; border-radius: 10px; padding: 0 7px; }

.sam-key { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.sam-test td, .sam-test th { font-size: 13px; }
.sam-ok { color: #1f6b47; font-weight: 600; } .sam-bad { color: #b4232f; font-weight: 600; }

/* ---------- buyer intent ---------- */
.int-pill { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: var(--c); border-radius: 10px; padding: 1px 8px; }
.int-stars { color: #e3a71c; letter-spacing: 1px; font-size: 12px; white-space: nowrap; } .int-stars .off { color: var(--border); }
.int-badge { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.int-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.int-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.int-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 10px; }
.int-kpis > div { display: grid; gap: 3px; font-size: 13px; } .int-kpis span:first-child { font-size: 11px; color: var(--text-2); }
.int-action { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; background: var(--primary-soft); border-radius: 8px; padding: 8px 10px; }
.int-signals { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 10px; }
.int-sig { border: 1px solid var(--border-soft); border-radius: 8px; padding: 8px; display: grid; gap: 3px; background: var(--surface-2); }
.int-sig-score { font-size: 11px; font-weight: 700; color: var(--primary); }
.int-json { max-height: 260px; overflow: auto; font-size: 11px; background: var(--surface-2); padding: 8px; border-radius: 6px; }
.int-scoring { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.int-score-mod { display: grid; gap: 4px; border: 1px solid var(--border-soft); border-radius: 8px; padding: 8px; }
.rc-cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2px 12px; margin: 4px 0 6px; }
.rc-row-main.is-new td:first-child { box-shadow: inset 3px 0 0 var(--primary); }

/* Acquisition files (R10.6) */
.acq-known { display: flex; gap: 6px; flex-wrap: wrap; }
.acq-known .chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.acq-notices { display: grid; gap: 6px; max-height: 420px; overflow: auto; }
.acq-notice { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 13px; }
.acq-notice input { margin-top: 3px; flex: 0 0 auto; }
.acq-notice .grow { flex: 1; min-width: 0; }
.acq-title { margin-top: 2px; overflow-wrap: anywhere; }
.acq-count { margin-left: 8px; padding: 1px 8px; border-radius: 10px; background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); font-size: 12px; font-weight: 600; }
.acq-pulled { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; }
.mk-bubble-opts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.mk-seg { display: inline-flex; gap: 4px; }

/* Lead status pipeline (R10.7) */
.lead-status-bar { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; }
.lsb { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: 8px; background: var(--surface); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; color: var(--text); }
.lsb b { font-variant-numeric: tabular-nums; }
.lsb:hover { background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.lsb.on { background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-color: var(--c); }
.lv-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-right: 2px; align-self: center; }

/* Sidebar board list a little larger (R10.7) */
.side-item { font-size: 15px; }
@media (min-width: 801px) { .side-item { height: 36px; } }
.side-item svg { width: 17px; height: 17px; flex: 0 0 auto; }

/* Emoji picker + email template styling (R10.7) */
.emoji-pop { position: fixed; z-index: 2000; width: 320px; max-height: 320px; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.emoji-grid { overflow: auto; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-cat { grid-column: 1 / -1; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 6px 2px 2px; }
.emoji { border: 0; background: none; font-size: 20px; line-height: 1; padding: 5px 0; border-radius: 6px; cursor: pointer; }
.emoji:hover { background: var(--hover); }
.mk-stylebar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.mk-col { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--text-2); }
.mk-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.fmt-btn { min-width: 32px; justify-content: center; }
.mk-email-prev { background: #fff; color: #1f2430; border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 6px; }
.sa-row { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.sa-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sa-grid { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; }
@media (max-width: 800px) { .sa-grid { grid-template-columns: 1fr; } }
.sa-row code { font-size: 11px; background: var(--bg); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; }
.mk-email-log td, .mk-email-log th { padding: 8px 10px; vertical-align: top; font-size: 13px; }
.mk-email-log tr.mk-failed td { background: color-mix(in srgb, var(--danger, #c93d50) 6%, transparent); }

/* AI lead finder + usage (R11) */
.lf-meter { display: grid; gap: 4px; font-size: 12px; color: var(--text-2); min-width: 180px; }
.lf-meter i { display: block; height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; }
.lf-meter i b { display: block; height: 100%; }
.lf-meter.big { font-size: 15px; font-weight: 600; color: var(--text); max-width: 520px; }
.lf-meter.big i { height: 10px; }
.lf-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; padding: 16px 24px; min-height: 0; flex: 1; overflow: hidden; }
.lf-projects { display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.lf-proj { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 8px 10px; display: grid; gap: 2px; cursor: pointer; font: inherit; color: var(--text); }
.lf-proj.on { border-color: var(--primary); background: var(--primary-soft); }
.lf-it { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.lf-it span { flex: 1; }
.lf-main { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.lf-proj-view { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1; overflow: auto; }
.lf-proj-head { display: flex; gap: 8px; align-items: flex-start; }
.lf-chat-wrap { display: flex; flex-direction: column; min-height: 0; flex: 1; gap: 8px; }
.lf-chat { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; min-height: 240px; max-height: calc(100vh - 330px); }
.lf-msg { display: flex; flex-direction: column; gap: 6px; max-width: 86%; }
.lf-msg.user { align-self: flex-end; }
.lf-bubble { white-space: pre-wrap; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; line-height: 1.45; }
.lf-msg.user .lf-bubble { background: var(--primary); color: #fff; border-color: var(--primary); }
.lf-proposals { display: grid; gap: 6px; }
.lf-card { display: grid; gap: 4px; padding: 8px 10px; border: 1px dashed var(--primary); border-radius: 8px; background: var(--primary-soft); justify-items: start; }
.lf-compose { display: flex; gap: 8px; align-items: flex-end; }
.lf-compose textarea { flex: 1; resize: vertical; }
.lf-starters { display: flex; gap: 6px; flex-wrap: wrap; }
.lf-strategy { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.lf-strategy ul { margin: 0; padding-left: 18px; }
.lf-sources { display: grid; gap: 10px; }
.lf-src-head { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.lf-cands td, .lf-cands th { padding: 7px 9px; vertical-align: top; font-size: 13px; }
.lf-sig { display: grid; grid-template-columns: 1fr 2fr 70px; gap: 6px; }
.lf-rates { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.lf-days { display: flex; gap: 4px; align-items: flex-end; height: 100px; }
.lf-day { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; max-width: 26px; }
.lf-day i { display: block; width: 100%; background: var(--primary); border-radius: 3px 3px 0 0; }
.lf-day small { font-size: 10px; color: var(--muted); }
@media (max-width: 800px) { .lf-body { grid-template-columns: 1fr; padding: 12px; overflow: auto; } .lf-chat { max-height: none; } .lf-msg { max-width: 100%; } .lf-sig { grid-template-columns: 1fr; } }

/* ===================== R12 ===================== */
.chip-code.ok { background: #e3f4ea; border-color: #b9e2c9; color: #1f7a4c; cursor: default; }
.chip-code.bad { background: #fbe6e9; border-color: #f2c2c9; color: #a3283b; cursor: default; }
:root[data-theme="dark"] .chip-code.ok { background: #1f3a2d; border-color: #2f5a43; color: #8fd8ae; }
:root[data-theme="dark"] .chip-code.bad { background: #44222a; border-color: #6a3340; color: #f1a3b0; }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.side-item .side-badge, .side-badge { flex: 0 0 auto; overflow: visible; margin-left: auto; background: var(--danger); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.side-item .addon-tag, .addon-tag { flex: 0 0 auto; margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; color: var(--text-2); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 5px 12px; font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--primary); color: #fff; }

/* Today */
.today-page .board-body { display: grid; gap: 16px; align-content: start; grid-template-columns: minmax(0, 1fr); }
.td-grid > *, .td-grid aside > * { min-width: 0; }
.td-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.td-kpis .kpi { padding: 10px 14px; background: var(--surface); }
.td-kpis .kpi .value { font-size: 22px; }
.kpi.warn { border-color: #f0b4bd; box-shadow: inset 3px 0 0 var(--danger); }
.td-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.td-grid aside { display: grid; gap: 16px; }
.td-h { margin: 0 0 10px; font-size: 16px; }
.td-card { background: var(--surface); border: 1px solid var(--border-soft); border-left: 4px solid var(--k); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; display: grid; gap: 4px; transition: box-shadow .15s; }
.td-card:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .07); }
.td-card-top { display: flex; align-items: center; gap: 6px; }
.td-kind { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--k); }
.td-title { font-weight: 700; font-size: 15px; }
.td-sub { font-size: 12px; }
.td-why { font-size: 13px; }
.td-snip { font-size: 13px; color: var(--text-2); font-style: italic; border-left: 2px solid var(--border); padding-left: 8px; }
.td-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.td-pop { position: absolute; right: 0; bottom: 110%; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); display: grid; z-index: 30; min-width: 130px; }
.td-pop button { background: none; border: 0; text-align: left; padding: 8px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.td-pop button:hover { background: var(--hover); }
.td-empty { text-align: center; padding: 30px; }
.td-empty .big { font-size: 34px; color: #2e9e6b; }
.td-meet { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border-soft); }
.td-meet:first-of-type { border-top: 0; }
.td-time { font-weight: 700; font-size: 13px; min-width: 62px; color: var(--primary); }
.td-deal { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border-soft); color: inherit; text-decoration: none; }
.td-deal:hover .td-deal-name { color: var(--primary); }
.td-deal-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-health { display: grid; justify-items: end; gap: 3px; min-width: 56px; }
.td-health b { font-size: 14px; color: var(--hc); }
.td-health i { display: block; width: 56px; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.td-health i span { display: block; height: 100%; background: var(--hc); }
.td-setup { border: 1px solid var(--primary-soft); }
.td-progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 10px 0; }
.td-progress b { display: block; height: 100%; background: var(--primary); }
.td-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 16px; }
.td-step { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.td-step.done { color: var(--text-2); text-decoration: line-through; }
.td-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; flex: none; }
.td-step.done .td-check { background: #2e9e6b; border-color: #2e9e6b; color: #fff; }
@media (max-width: 1000px) { .td-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .td-steps { grid-template-columns: 1fr; } .td-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* One timeline */
.widget.tl .tl-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tl-filters { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.tl-filters .chip { height: 26px; font-size: 12px; }
.tl-list { position: relative; display: grid; gap: 2px; }
.tl-list::before { content: ''; position: absolute; left: 12px; top: 6px; bottom: 6px; width: 2px; background: var(--border-soft); }
.tl-entry { position: relative; display: flex; gap: 10px; padding: 6px 0; }
.tl-dot { position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text-2); flex: none; }
.tl-entry.k-email_in .tl-dot, .tl-entry.k-text_in .tl-dot { background: #e1edfb; color: #2f7fd1; border-color: #c5dcf6; }
.tl-entry.k-call .tl-dot { background: #fdf0dc; color: #c07a10; border-color: #f4dcb3; }
.tl-entry.k-meeting .tl-dot { background: #ece6fd; color: #6a4bd8; border-color: #d8ccfa; }
.tl-entry.k-deal .tl-dot { background: #e3f4ea; color: #2e9e6b; border-color: #bfe3cd; }
:root[data-theme="dark"] .tl-entry .tl-dot { background: var(--surface-2); }
.tl-main { flex: 1; min-width: 0; }
.tl-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.tl-meta { font-size: 12px; }
.tl-body { font-size: 13px; white-space: pre-wrap; margin-top: 3px; overflow-wrap: anywhere; }
.tl-acts { display: flex; gap: 10px; }
.tl-acts .link-btn { font-size: 12px; display: inline-flex; gap: 4px; align-items: center; }
.tl-entry.upcoming .tl-main { background: var(--primary-soft); border-radius: 6px; padding: 4px 8px; }
.tl-quote { background: var(--surface-2); border-left: 3px solid var(--border); border-radius: 4px; padding: 8px 10px; font-size: 13px; }

/* Leads: simpler filters */
.lead-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 2px; padding-right: 2px; height: 26px; font-size: 12px; }
.lead-adv { padding: 10px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 8px; }

/* Drawer "More" tab */
select.tab.tab-more { appearance: none; -webkit-appearance: none; background: transparent; border: 0; font: inherit; color: var(--text-2); cursor: pointer; padding: 0 12px; }
select.tab.tab-more.active { color: var(--primary); font-weight: 600; }

/* Email domain check */
.dns-status { border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px 12px; margin: 6px 0 12px; display: grid; gap: 8px; }
.dns-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dns-table th { text-align: left; color: var(--text-2); font-weight: 600; font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--border-soft); }
.dns-table td { padding: 6px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.dns-table code { background: var(--surface-2); padding: 1px 4px; border-radius: 3px; font-size: 11px; overflow-wrap: anywhere; }

/* AI assistant */
.as-fab { position: fixed; right: 22px; bottom: 76px; z-index: 60; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--primary), #6a4bd8); box-shadow: 0 6px 18px rgba(48, 80, 144, .45); display: grid; place-items: center; transition: transform .15s; }
.as-fab:hover { transform: scale(1.06); }
.as-panel { position: fixed; right: 16px; bottom: 16px; top: calc(var(--header-h) + 12px); width: min(420px, calc(100vw - 32px)); z-index: 70; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.as-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); color: var(--primary); }
.as-head strong { color: var(--text); }
.as-ctx { font-size: 12px; color: var(--text-2); padding: 6px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border-soft); }
.as-msgs { flex: 1; overflow: auto; padding: 14px; display: grid; gap: 10px; align-content: start; }
.as-hello p { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
.as-sug { display: flex; flex-wrap: wrap; gap: 6px; }
.as-sug .chip { height: auto; min-height: 28px; padding: 4px 10px; font-size: 12px; text-align: left; }
.as-msg { font-size: 13px; line-height: 1.5; max-width: 100%; }
.as-msg p { margin: 0 0 6px; } .as-msg ul { margin: 0 0 6px; padding-left: 18px; }
.as-msg.user { justify-self: end; background: var(--primary); color: #fff; border-radius: 12px 12px 2px 12px; padding: 8px 12px; max-width: 85%; white-space: pre-wrap; }
.as-msg.assistant { background: var(--surface-2); border-radius: 12px 12px 12px 2px; padding: 10px 12px; }
.as-msg.err { background: #fbe6e9; color: #a3283b; }
.as-msg.typing { display: flex; gap: 4px; width: 54px; }
.as-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); animation: asdot 1s infinite ease-in-out; }
.as-msg.typing span:nth-child(2) { animation-delay: .15s; } .as-msg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes asdot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.as-block { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.as-bt { font-weight: 700; font-size: 12px; margin-bottom: 6px; }
.as-bar { display: grid; grid-template-columns: 96px 1fr auto; gap: 6px; align-items: center; font-size: 12px; margin: 3px 0; }
.as-bl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-bar i { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; display: block; }
.as-bar i b { display: block; height: 100%; background: var(--primary); border-radius: 5px; }
.as-bv { font-variant-numeric: tabular-nums; font-weight: 600; }
.as-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.as-table th { text-align: left; color: var(--text-2); font-weight: 600; padding: 3px 4px; border-bottom: 1px solid var(--border-soft); }
.as-table td { padding: 4px; border-bottom: 1px solid var(--border-soft); }
.as-table tr:hover td { background: var(--row-hover); }
.as-action { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--primary-soft); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.as-action.done { opacity: .7; }
.as-foot { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border-soft); }
.as-foot textarea { resize: none; flex: 1; }
.as-note { font-size: 11px; padding: 0 12px 8px; }
@media (max-width: 800px) { .as-fab { bottom: 76px; right: 14px; } .as-panel { top: 8px; right: 8px; left: 8px; bottom: 8px; width: auto; } }
