/* «База чатов» (25.10.2026): sources as underlined tabs, niches on the left, a list of rows on the right */
.cb-root { display: flex; flex-direction: column; gap: 18px; }
.sub-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.sub-tabs > button { flex: none; padding: 0 0 12px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font: 500 14px var(--f-body); cursor: pointer; white-space: nowrap; }
.sub-tabs > button span { margin-left: 4px; font: 500 12px var(--f-mono); color: var(--faint); }
.sub-tabs > button.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.cb-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.cb-niches { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; max-height: calc(100vh - 40px); overflow: auto; }
.cb-niches-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cb-niches-head h3 { font-size: 16px; }
.cb-niche-list { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; margin: 6px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cb-niche { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.cb-niche b { font: 600 13px/1.3 var(--f-body); }
.cb-niche span { font: 500 11px/1.2 var(--f-mono); color: var(--faint); }
.cb-niche:hover { background: var(--surface-2); }
.cb-niche.active { border-color: var(--accent-text); background: var(--accent-soft); }
.cb-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cb-note { padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; }
.cb-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.cb-head h3 { font-size: 18px; }
.cb-head p { margin-top: 4px; color: var(--muted); font-size: 13px; max-width: 640px; }
.cb-head-actions { display: flex; gap: 8px; flex: none; }
.cb-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cb-toolbar input { flex: 1 1 220px; min-width: 0; }
.cb-toolbar select { width: auto; }
.cb-total { margin: 14px 0 6px; font: 500 12px var(--f-mono); color: var(--faint); }
.cb-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.cb-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px 330px; gap: 16px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.cb-info { min-width: 0; }
.cb-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; }
.cb-title:hover { color: var(--accent-text); }
.cb-meta { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 12px var(--f-mono); color: var(--faint); }
.cb-topic { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cb-stats { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.cb-stats span:first-child { color: var(--ink); font-weight: 600; }
.cb-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cb-move { width: 150px; height: 34px; font-size: 12px; padding: 0 8px; }
.cb-delete { flex: none; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--faint); font-size: 18px; cursor: pointer; }
.cb-delete:hover { background: var(--danger-soft, rgba(255, 90, 90, .14)); color: var(--danger); }
.cb-empty { padding: 30px 0; text-align: center; color: var(--muted); }
.cb-more { margin-top: 14px; }
.cb-form { display: flex; flex-direction: column; gap: 12px; }
.cb-form h3 { font-size: 16px; }
.cb-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.cb-form textarea { resize: vertical; }
.cb-form-actions { display: flex; gap: 8px; }
/* 25.10.2026 (owner): the whole width of the window, audience and leads in columns of their own */
.workspace:has(.cb-root) { max-width: none; }
.cb-markbox { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cb-leads b { font-size: 13px; color: var(--ink); }
.cb-leads b.cb-none { color: var(--faint); font-weight: 500; }
.cb-leads span:last-child { color: var(--faint); }
.cb-move { width: 170px; }
.cb-layout { grid-template-columns: 270px minmax(0, 1fr); }
.cb-row { grid-template-columns: minmax(300px, 1fr) 150px 210px 170px 210px; gap: 20px; }
@media (max-width: 1500px) {
  .cb-row { grid-template-columns: minmax(0, 1fr) 160px 200px; }
  .cb-markbox { grid-column: 2 / 3; }
  .cb-actions { grid-column: 3 / 4; justify-content: flex-start; }
}
@media (max-width: 1100px) {
  .cb-layout { grid-template-columns: 1fr; }
  .cb-niches { position: static; max-height: none; }
  .cb-niche-list { flex-direction: row; flex-wrap: wrap; }
  .cb-niche { width: auto; }
  .cb-head { flex-direction: column; }
}
@media (max-width: 760px) {
  .cb-row { grid-template-columns: 1fr; gap: 8px; }
  .cb-markbox, .cb-actions { grid-column: auto; }
}

/* the mark: a pill with a coloured dot (25.10.2026: «дропдаун слишком квадратный») */
.cb-pill { position: relative; display: inline-flex; align-items: center; height: 32px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); transition: border-color .15s, background .15s; }
.cb-pill::before { content: ''; position: absolute; left: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); pointer-events: none; }
.cb-pill::after { content: ''; position: absolute; right: 12px; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); pointer-events: none; opacity: .7; }
.cb-pill:hover { border-color: var(--line-strong); }
.cb-pill.is-good { background: var(--signal-soft); border-color: transparent; color: var(--signal); }
.cb-pill.is-good::before { background: var(--signal); }
.cb-pill.is-medium { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.cb-pill.is-medium::before { background: var(--warn); }
.cb-pill.is-bad { background: var(--danger-soft, rgba(255, 90, 90, .14)); border-color: transparent; color: var(--danger); }
.cb-pill.is-bad::before { background: var(--danger); }
.cb-pill .cb-mark-select { appearance: none; -webkit-appearance: none; width: auto; min-width: 136px; height: 30px; padding: 0 30px 0 28px; border: 0; border-radius: 999px; background: transparent; color: inherit; font: 600 12px var(--f-body); cursor: pointer; box-shadow: none; }
.cb-pill .cb-mark-select:focus { outline: none; }
.cb-pill:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }
.cb-pill .cb-mark-select option { color: var(--ink); background: var(--surface); }
/* the rules of the mark behind an «i» */
.cb-help { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--muted); font: 600 12px/1 var(--f-mono); cursor: help; flex: none; }
.cb-help:hover, .cb-help:focus { color: var(--ink); border-color: var(--accent-text); outline: none; }
.cb-help-pop { position: absolute; top: calc(100% + 10px); left: 50%; z-index: 20; width: 340px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); color: var(--muted); font: 400 12px/1.5 var(--f-body); text-align: left; cursor: default;
  opacity: 0; visibility: hidden; transform: translate(-50%, -4px); transition: opacity .15s, transform .15s, visibility .15s; }
.cb-help:hover .cb-help-pop, .cb-help:focus .cb-help-pop { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.cb-help-pop b { display: block; margin-bottom: 8px; color: var(--ink); font-size: 13px; }
.cb-help-pop ul { margin: 0 0 8px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.cb-help-pop li { display: flex; align-items: baseline; gap: 8px; }
.cb-help-pop .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); transform: translateY(-1px); }
.cb-help-pop .dot.good { background: var(--signal); } .cb-help-pop .dot.medium { background: var(--warn); } .cb-help-pop .dot.bad { background: var(--danger); }
.cb-help-pop > span { color: var(--faint); }
