/* ========================================================================
   workbench.css · CK-3COL-WORKSTATION v2.4 — пульт консультанта ЦК АПК
   Монолитный Workbench Edge-to-Edge: колонки встык, между ними — сплиттер-линия 1px
   (зона захвата 8px, col-resize, изумрудная подсветка), Snap-to-Rail 36px, шапка диалога 54px.
   Слой ПОВЕРХ screens.css; правило app_v2 сохранено — в компонентах только var(...).
   Откат — убрать <link> в index.html.
   ======================================================================== */

/* ---------- Каркас: ни зазоров, ни «островных карточек» ---------- */
@media (min-width: 1024px) {
  body.tk-focus .main { padding: 0; background: var(--surface); }
  body.tk-focus .queue-wrap.wb-root {
    display: flex; flex: 1; min-height: 0; gap: 0; align-items: stretch; background: var(--surface);
  }
  body.tk-focus .wb-root .q-col-ticket,
  body.tk-focus .wb-root .tk-split { display: contents; }
  body.tk-focus .wb-root .q-col-ticket > .skeleton,
  body.tk-focus .wb-root .q-col-ticket > .empty-state,
  body.tk-focus .wb-root .tk-split > .skeleton,
  body.tk-focus .wb-root .tk-split > .error-box { flex: 1; margin: 16px; }
  body.tk-focus .wb-pane {
    min-width: 0; min-height: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--surface);
    transition: flex-basis .2s cubic-bezier(.2, .7, .2, 1);
  }
  body.tk-focus .wb-root .q-col-list { border: 0; border-radius: 0; box-shadow: none; }
  body.wb-dragging, body.wb-dragging * { cursor: col-resize !important; user-select: none !important; }
  body.wb-dragging .wb-pane { transition: none; }

  /* Сплиттер: видимая линия 1px, невидимая зона захвата 8px поверх стыка. */
  .wb-split {
    flex: 0 0 1px; position: relative; z-index: 6; background: var(--border); cursor: col-resize;
    transition: background-color .15s, box-shadow .15s; outline: none;
  }
  .wb-split::before { content: ''; position: absolute; top: 0; bottom: 0; left: -4px; right: -4px; }
  .wb-split:hover, .wb-split.on, .wb-split:focus-visible {
    background: var(--accent); box-shadow: 0 0 0 1px var(--accent-ring), 0 0 10px var(--accent-ring);
  }

  /* Рельса 36px: стрелка возврата + иконки разделов. Содержимое колонки прячется целиком. */
  .wb-pane.is-rail > :not(.wb-rail) { display: none !important; }
  .wb-pane.is-rail { background: var(--surface-2); }
  .wb-pane.is-rail > .wb-rail { display: flex; }
  .wb-rail {
    display: none; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; width: 36px; height: 100%;
  }
  .wb-rail-btn {
    position: relative; width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent;
    color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    transition: background-color .15s, color .15s;
  }
  .wb-rail-btn:hover { background: var(--accent-weak); color: var(--accent-strong); }
  .wb-rail-btn:first-child { color: var(--accent-strong); }
  .wb-rail-sep { width: 18px; height: 1px; margin: 3px 0; background: var(--border); }
  .wb-rail-label {
    margin-top: 8px; writing-mode: vertical-rl; transform: rotate(180deg);
    font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--text-3);
  }
  .wb-rail-badge {
    position: absolute; top: -3px; right: -5px; min-width: 15px; height: 15px; padding: 0 3px;
    border-radius: var(--r-full); background: var(--accent-strong); color: var(--on-accent);
    font-size: 9.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  }

  /* Колонки: внутренние разделители вместо рамок карточек */
  body.tk-focus .tk-chat-col, body.tk-focus .tk-side-col, body.tk-focus .tk-src-col { border: 0; border-radius: 0; box-shadow: none; }
  body.tk-focus .tk-chat-feed { max-height: none; }
}
.wb-split, .wb-rail { display: none; }
@media (min-width: 1024px) { .wb-split { display: block; } }
.wb-hidden { display: none !important; }
.q-rail, .tk-side-rail { display: none !important; }

/* ---------- Кол 2: шапка 54px в две строки ---------- */
.tk-chat-head.th {
  flex: none; display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 2px;
  box-sizing: border-box; height: 54px; padding: 2px 12px; border-bottom: 1px solid var(--border);
}
.th-row { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.th-row-1 { height: 28px; }
.th-row-2 { height: 18px; gap: 8px; font-size: 12px; color: var(--text-2); overflow: hidden; }
.tk-chat-head.th .th-ava { width: 28px; height: 28px; flex: none; font-size: 11px; }
.th-who { flex: 0 1 auto; font-weight: 700; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; min-width: 90px; }
.th-no { font-size: 12.5px; font-weight: 600; color: var(--text-3); flex: none; }
.th-pill { flex: none; height: 20px; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; font-size: 11.5px; }
.th-spacer { flex: 1; min-width: 4px; }
.btn.btn-xs { height: 26px; padding: 0 9px; gap: 5px; font-size: 12.5px; border-radius: 7px; flex: none; }
.th-hist.on { background: var(--accent-weak); color: var(--accent-strong); }
.th-more { width: 28px; height: 28px; flex: none; }
.th-meta { flex: 0 1 auto; min-width: 60px; overflow: hidden; text-overflow: ellipsis; }
.th-div { flex: none; width: 1px; height: 12px; background: var(--border-strong); }
.th-steps { flex: none; display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 0; list-style: none; }
.th-step { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); }
.th-step.is-done { color: var(--accent-strong); }
.th-step.is-now { color: var(--text); font-weight: 700; }
.th-step-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.th-step-sep { color: var(--text-3); }
.th-tags { flex: 0 1 auto; min-width: 0; display: inline-flex; gap: 4px; overflow: hidden; }
.th-tag {
  flex: none; height: 18px; line-height: 18px; padding: 0 7px; border-radius: var(--r-full);
  background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 600;
}
@container (max-width: 520px) { .th-hist-label { display: none; } .th-meta { display: none; } .th-meta + .th-div { display: none; } }
/* Узкий диалог: ФИО заявителя важнее номера и статуса (статус виден в реестре и в рельсе). */
@container (max-width: 500px) { .th-no, .th-pill.status-pill { display: none; } .th-who { flex: 1 1 auto; } }
/* screens.css: `.tk-chat-head .tk-who { min-width: 0 }` весомее и сжимало ФИО в ноль — имя заявителя важнее всего в шапке. */
.tk-chat-head.th .th-who { min-width: 96px; flex: 1 1 auto; }
@container (max-width: 420px) { .th-pill.sla-pill { display: none; } }
@container (max-width: 400px) { .db-meta { display: none; } }
#replyBox.is-flash { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }

/* ---------- Кол 3: верстак ---------- */
.tk-side-tab.is-icon { flex: none; width: 40px; padding: 0; gap: 2px; }
/* Вкладки верстака подписаны, пока колонка шире 380px (screens.css прятал подписи уже с 480px). */
@container (min-width: 380px) {
  .tk-side-tab:not(.is-icon) { flex: 1 1 auto; min-width: 0; }
  .tk-side-tab:not(.on):not(.is-icon) .tk-side-tab-label { display: inline; }
}
.tk-side-tab-label { overflow: hidden; text-overflow: ellipsis; }
.tk-side-badge.is-accent { background: var(--accent-weak); color: var(--accent-strong); }
.tk-side-head { box-sizing: border-box; height: 54px; }
.tk-side-pane { gap: 10px; }

.db-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.db-format { position: relative; }
.db-format-btn {
  white-space: nowrap; max-width: 100%; height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer;
}
.db-format-btn:hover { border-color: var(--accent); }
.db-pop, .tk-pop.db-pop {
  position: absolute; top: 34px; left: 0; z-index: 40; min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); box-shadow: var(--shadow-2);
}
.db-pop-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 9px;
  border: 0; border-radius: 7px; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
}
.db-pop-item:hover { background: var(--surface-2); }
.db-pop-item.on { color: var(--accent-strong); font-weight: 600; }
.db-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.qb { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.qb-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.qb-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full); background: var(--accent-strong); color: var(--on-accent); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.qb-n:empty { display: none; }
.qb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qb-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 26px; padding: 0 4px 0 9px;
  border: 1px solid var(--accent-ring); border-radius: var(--r-full); background: var(--surface); font-size: 12px;
}
.qb-chip-src { flex: none; font-weight: 700; color: var(--accent-strong); }
.qb-chip-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); max-width: 200px; }
.qb-x { flex: none; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.qb-x:hover { background: var(--danger-weak); color: var(--danger); }
.qb-empty { line-height: 1.4; }

.db-body { position: relative; }
.db-text {
  display: block; width: 100%; min-height: 230px; resize: vertical; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; line-height: 1.5;
}
.db-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.db-pending { display: none; }
.db-body.is-busy .db-text { opacity: .45; }
.db-body.is-busy .db-pending {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--accent-strong);
}

.tk-revise-bar {
  display: flex; flex-direction: column; gap: 7px; padding: 8px; border-radius: 10px;
  border: 1px solid var(--accent-ring); background: color-mix(in srgb, var(--accent-weak) 70%, var(--surface));
}
.tk-revise-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tk-revise-chip {
  height: 24px; padding: 0 9px; border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer;
}
.tk-revise-chip:hover { border-color: var(--accent); color: var(--accent-strong); }
.tk-revise-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tk-revise-ico { flex: none; display: inline-flex; color: var(--accent-strong); }
.tk-revise-inp {
  flex: 1 1 170px; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px;
}
.tk-revise-inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.tk-revise-undo { align-self: flex-start; }
.tk-revise-bar .mic-recording { color: var(--danger); background: var(--danger-weak); }

.db-src { font-size: 12.5px; color: var(--text-2); }
.db-src summary { cursor: pointer; font-weight: 600; padding: 2px 0; }
.db-src-item { display: flex; gap: 6px; align-items: flex-start; padding: 3px 0; }
.db-src-item .ico { flex: none; margin-top: 2px; color: var(--text-3); }
.db-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.db-actions .btn-primary { flex: 1; justify-content: center; }

/* Omnisearch */
.omni-top { position: sticky; top: -12px; z-index: 2; margin: -12px -14px 0; padding: 12px 14px 8px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--border); }
.omni-field {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: var(--surface); color: var(--text-3);
}
.omni-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.omni-inp { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 14px; }
.omni-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.omni-chip {
  height: 28px; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: var(--r-full); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.omni-chip.on { background: var(--accent-weak); color: var(--accent-strong); border-color: var(--accent); }
.omni-chip-n { font-weight: 400; color: var(--text-3); }
.omni-meta { display: flex; align-items: center; gap: 5px; }
.omni-results, .omni-web { display: flex; flex-direction: column; gap: 8px; }
.omni-group { display: flex; flex-direction: column; gap: 8px; }
.omni-group-head { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.omni-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.omni-card:hover { border-color: var(--border-strong); }
.omni-card-head { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.omni-src { font-weight: 700; color: var(--accent-strong); }
.omni-score { margin-left: auto; }
.omni-title { font-weight: 600; font-size: 13.5px; color: var(--text); }
.omni-snippet {
  margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.omni-actions { display: flex; justify-content: flex-end; gap: 4px; }
.omni-zero { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 8px; text-align: center; color: var(--text-2); }
.omni-web-link {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 4px 0;
  border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer;
}
.omni-web-link:hover { color: var(--accent-strong); text-decoration: underline; }
mark.kbp-hit { background: color-mix(in srgb, var(--warn) 30%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ---------- Кол 4: окно «Источник» ---------- */
.tk-src-col { display: flex; flex-direction: column; overflow: hidden; container-type: inline-size; }
.src-head { flex: none; display: flex; align-items: center; gap: 8px; box-sizing: border-box; height: 54px; padding: 6px 10px 6px 14px; border-bottom: 1px solid var(--border); }
.src-ico { flex: none; display: inline-flex; color: var(--accent-strong); }
.src-title-box { flex: 1; min-width: 0; }
.src-title { font-weight: 700; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-hint { flex: none; display: flex; align-items: center; gap: 6px; padding: 5px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.src-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px 24px; font-size: 14px; line-height: 1.6; color: var(--text); scrollbar-width: thin; }
.src-body .kbp-law-p.on { background: var(--accent-weak); border-radius: 6px; box-shadow: -3px 0 0 var(--accent); }
.src-card { margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.src-card.on { border-color: var(--accent); background: var(--accent-weak); }
.src-card-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.src-card-text, .src-text p { margin: 0 0 10px; white-space: pre-wrap; }
.src-mark {
  position: fixed; z-index: 1000; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 0; border-radius: var(--r-full); background: var(--accent-strong); color: var(--on-accent);
  font: inherit; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow-2); cursor: pointer; animation: tk-pane-in .12s ease;
}
.src-mark:hover { background: var(--accent-hover); }
.src-sheet-back {
  position: fixed; inset: 0; z-index: 900; display: flex; justify-content: center; padding: 24px;
  background: color-mix(in srgb, var(--text) 55%, transparent);
}
.src-sheet { width: min(860px, 100%); height: 100%; display: flex; flex-direction: column; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-2); overflow: hidden; }
.src-sheet-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 24px; border-bottom: 1px solid var(--border); }
.src-sheet-head b { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-sheet-head .muted { flex: 1; }
.src-sheet .src-body { padding: 40px 64px 64px; font-size: 15px; line-height: 1.7; }


/* ══════════ v2.6 · тотальная лаконичность: одна рамка, табы Кол 2, верстак 3 таба, веб-поиск ══════════ */

/* ---------- Одна рамка: капсула светится снаружи, у поля внутри — ни рамки, ни кольца ---------- */
.cap {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text-3); transition: border-color .15s, box-shadow .15s;
}
.cap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.cap input, .cap textarea, .cap select {
  border: 0 !important; outline: none !important; box-shadow: none !important; background: transparent !important;
  color: var(--text); font: inherit;
}
/* Браузерный outline поверх собственной рамки поля и давал «рамку в рамке». */
input:not([type="checkbox"]):not([type="radio"]):focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
.omni-meta { display: none; }

/* ---------- Кол 2: табы Диалог / История бота / Досье в строке 2 шапки ---------- */
.th-row-2 { height: 20px; overflow: visible; }
.th-tabs { display: inline-flex; gap: 2px; flex: none; }
.th-tab {
  height: 20px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text-3); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.th-tab:hover { color: var(--text); background: var(--surface-2); }
.th-tab.on { color: var(--accent-strong); background: var(--accent-weak); }
.th-tab .tk-side-badge { min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.th-collapse { width: 24px; height: 20px; flex: none; color: var(--text-3); }
.tk-chat-head.th { height: 54px; padding: 2px 12px; }
.tk-chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tk-chat-pane { display: none !important; }
.tk-chat-pane.on { display: flex !important; }
.tk-chat-col .history-panel.tk-chat-pane {
  flex: 1; min-height: 0; max-height: none; margin: 0; border-radius: 0; padding: 12px 14px;
  flex-direction: column; gap: 6px; overflow-y: auto; background: var(--surface);
}
.tk-dossier-pane { flex: 1; min-height: 0; overflow-y: auto; flex-direction: column; gap: 12px; padding: 12px 14px 16px; }
@container (max-width: 560px) { .th-tab span:not(.tk-side-badge) { display: none; } .th-tab { padding: 0 6px; } }

/* «Путь клиента»: [компас 3/4 ●●●○ ▾] + поповер этапов с датами */
.th-journey { position: relative; flex: none; }
.th-journey-btn {
  height: 24px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border: 1px solid var(--border);
  border-radius: var(--r-full); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer;
}
.th-journey-btn:hover, .th-journey-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-strong); }
.th-dots { display: inline-flex; gap: 3px; }
.th-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.th-dots i.is-done { background: var(--accent); }
.th-dots i.is-now { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }
.th-journey-pop {
  position: absolute; right: 0; top: 30px; z-index: 50; width: 270px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow-2); animation: tk-pane-in .16s ease; white-space: normal;
}
.th-journey-title { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.th-journey-pop ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.th-journey-pop li { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 8px; padding: 5px 4px; font-size: 13px; color: var(--text-3); }
.th-jp-dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; }
.th-journey-pop li.is-done { color: var(--text); }
.th-journey-pop li.is-done .th-jp-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.th-journey-pop li.is-now { color: var(--text); font-weight: 700; }
.th-journey-pop li.is-now .th-jp-dot { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.th-jp-date { font-size: 11.5px; font-weight: 400; color: var(--text-3); white-space: nowrap; }

/* ---------- Кол 3: три таба со счётчиками, строка «Формат · Контекст» 32px ---------- */
.tk-side-n { font-weight: 500; color: var(--text-3); }
.tk-side-tab.on .tk-side-n { color: var(--accent-strong); }
.db-bar { height: 32px; flex: none; gap: 6px; justify-content: flex-start; }
.db-bar .db-format-btn { height: 30px; }
.db-meta { margin-left: auto; flex: 0 1 auto; min-width: 0; text-align: right; }
.db-ctx { position: relative; flex: none; }
.db-format { flex: none; }
@container (max-width: 470px) { .db-meta { display: none; } }
.db-ctx-btn .ico:first-child { color: var(--text-3); }
.db-ctx-btn.has b { color: var(--accent-strong); }
.db-pop.db-ctx-pop { left: auto; right: 0; width: min(340px, 90vw); max-height: 340px; overflow-y: auto; padding: 6px; }
/* Поповеры не должны раздувать колонку: горизонтальный скролл тела верстака уводил весь Черновик влево. */
.tk-side-body { overflow-x: hidden; }
.db-ctx-pop .qb { border: 0; background: none; padding: 0; }
.qb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.qb-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 6px 7px 8px; border-radius: 8px; }
.qb-item:hover { background: var(--surface-2); }
.qb-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qb-item-src { font-size: 12px; font-weight: 700; color: var(--accent-strong); }
.qb-item-txt { font-size: 12.5px; line-height: 1.4; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qb-empty { padding: 8px; }

/* Планка правок без «рамки в рамке»: чипы + одна капсула с авто-растущим полем */
.tk-revise-bar { border: 0; background: none; padding: 0; gap: 6px; }
.tk-revise-cap { align-items: flex-end; padding: 6px 6px 6px 10px; }
.tk-revise-cap .tk-revise-ico { align-self: center; }
.tk-revise-inp {
  flex: 1; min-width: 0; height: auto; min-height: 40px; padding: 2px 0; resize: none; line-height: 1.4; font-size: 13.5px;
}
.tk-revise-tools { display: flex; align-items: center; gap: 4px; flex: none; }
#aiDraftTa.is-flash { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }

/* Правка по выделению: микро-панель у курсора → форма */
.df-bar {
  position: fixed; z-index: 1000; padding: 4px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); box-shadow: var(--shadow-2); animation: tk-pane-in .12s ease;
}
.df-actions { display: flex; gap: 2px; }
.df-btn {
  height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.df-btn:hover { background: var(--accent-weak); color: var(--accent-strong); }
.df-bar.is-open { width: 330px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.df-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.df-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.df-cap { align-items: flex-end; padding: 5px 5px 5px 10px; }
.df-inp { flex: 1; min-width: 0; resize: none; font-size: 13px; line-height: 1.4; padding: 2px 0; }
.df-bar.is-busy { opacity: .6; pointer-events: none; }

/* ---------- Веб-поиск ---------- */
.web-top { display: flex; flex-direction: column; gap: 8px; }
.web-bar { height: 38px; padding: 0 4px 0 10px; }
.web-inp { flex: 1; min-width: 0; height: 100%; font-size: 14px; }
.web-bar-div { width: 1px; height: 20px; background: var(--border); flex: none; }
.web-wl { position: relative; flex: none; }
.web-wl-btn {
  height: 28px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.web-wl-btn:hover { background: var(--accent-weak); color: var(--accent-strong); }
.web-wl-btn .ico:first-child { color: var(--accent-strong); }
.web-wl-pop {
  position: absolute; right: -4px; top: 36px; z-index: 40; width: 310px; padding: 10px; border: 1px solid var(--border);
  border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow-2); animation: tk-pane-in .14s ease;
}
.web-wl-title { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.web-wl-list { display: flex; flex-direction: column; }
.web-wl-item { display: grid; grid-template-columns: 18px 1fr; column-gap: 8px; padding: 6px 4px; border-radius: 6px; cursor: pointer; }
.web-wl-item:hover { background: var(--surface-2); }
.web-wl-item input { grid-row: span 2; margin: 2px 0 0; accent-color: var(--accent-strong); }
.web-wl-d { font-size: 13px; font-weight: 600; color: var(--text); }
.web-wl-add { margin-top: 8px; padding: 2px 2px 2px 10px; }
.web-wl-add-inp { flex: 1; min-width: 0; height: 30px; font-size: 13px; }
.web-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.web-sel { height: 30px; padding: 0 4px 0 10px; gap: 4px; font-size: 12.5px; }
.web-sel select { height: 100%; padding-right: 2px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.web-docs { display: flex; flex-direction: column; gap: 4px; }
.web-docs:empty { display: none; }
.web-doc { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border: 1px dashed var(--border-strong); border-radius: 8px; font-size: 12.5px; color: var(--text-2); }
.web-doc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.web-results { display: flex; flex-direction: column; gap: 8px; }
.web-hint { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.web-hint .ico { flex: none; color: var(--accent-strong); }
a.btn.web-open { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }


/* ══════════ v2.7 · сплиттеры без стенок, атомы БЗ / доп-контекст, композер как в VS Code, веб → Кол 4 ══════════ */

/* Колонка выезжает из рельсы за мышью: пока она уже своего min, содержимое приглушено. */
.wb-pane.is-live > :not(.wb-rail) { opacity: .45; }
.wb-pane.is-live { overflow: hidden; }

/* Строка фактуры: поповеры на всю ширину строки (тело верстака режет горизонтальный вылет). */
.db-bar { position: relative; }
.db-bar .db-ctx { position: static; }
.db-bar .db-pop.db-ctx-pop, .db-bar .db-pop.db-chunks-pop { left: 0; right: 0; width: auto; top: 36px; max-height: 380px; overflow-y: auto; padding: 6px; }
.db-chunks-btn .ico:first-child { color: var(--text-3); }
.db-chunks-btn.has b { color: var(--accent-strong); }
.dk-item { align-items: flex-start; }
.dk-check { flex: none; margin: 3px 0 0; width: 15px; height: 15px; accent-color: var(--accent-strong); cursor: pointer; }
.dk-item.is-off .qb-item-main { opacity: .5; }
.dk-sub { font-size: 12.5px; font-weight: 600; color: var(--text); }
.dk-snip { font-size: 12.5px; line-height: 1.4; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dk-open { align-self: flex-start; margin-top: 2px; }
.qb-item-src { display: inline-flex; align-items: center; gap: 2px; }

/* Композер правок: одна капсула — поле сверху, ряд управления снизу */
.tk-revise-bar.dc { gap: 0; }
.dc-cap { flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 6px 6px 12px; }
.dc-cap .tk-revise-inp { flex: none; width: 100%; min-height: 42px; }
.dc-row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.dc-row .db-format-btn {
  height: 28px; padding: 0 8px; gap: 5px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-size: 12.5px;
}
.dc-row .db-format-btn:hover { background: var(--surface-2); color: var(--text); }
.dc-row .db-format-btn b { color: var(--text); font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.dc-row .icon-btn { width: 30px; height: 30px; color: var(--text-2); }
.dc-quick { position: relative; flex: none; }
.dc-send {
  flex: none; height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px 0 12px; border: 0;
  border-radius: var(--r-full); background: var(--accent-strong); color: var(--on-accent); font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background-color .15s, transform .1s;
}
.dc-send:hover { background: var(--accent-hover); }
.dc-send:active { transform: scale(.97); }
.dc-send:disabled { opacity: .55; cursor: default; }
:root[data-theme="dark"] .dc-send { background: var(--accent); }
.db-pop.up { top: auto; bottom: calc(100% + 6px); }
.dc-pop { min-width: 250px; }
.dc-own { height: 32px; margin: 4px 2px 0; padding: 0 8px; }
.dc-own-inp { flex: 1; min-width: 0; height: 30px; font-size: 13px; }
.dc-row .db-format { flex: 0 1 auto; min-width: 0; }
.dc-row .db-format .db-format-btn { max-width: 100%; }
/* Меню команд — на ширину композера: от кнопки оно вылезало за край колонки (её тело режет вылет по горизонтали). */
.dc-cap { position: relative; }
.dc-row .dc-quick { position: static; }
.db-pop.dc-pop { left: 6px; right: 6px; min-width: 0; }
/* Ряд композера всегда в одну строку: на узкой колонке подписи уступают место иконкам. */
@container (max-width: 520px) { .dc-quick-btn span, .dc-row .db-format-btn .muted { display: none; } }
@container (max-width: 380px) { .dc-send span { display: none; } .dc-send { padding: 0 9px; } }

/* Веб-карточка: клик по ней открывает документ в Кол 4 */
.web-card.is-clickable { cursor: pointer; transition: border-color .15s; }
.web-card.is-clickable:hover { border-color: var(--accent); }
.web-title { padding: 0; border: 0; background: none; text-align: left; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--text); cursor: pointer; }
.web-title:hover { color: var(--accent-strong); text-decoration: underline; }

/* Кол 4: карточка кейса и веб-страница */
#srcExt { display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); }
#srcExt.hidden { display: none; }
.src-case { display: flex; flex-direction: column; gap: 12px; }
.src-case .kbp-law-badge { align-self: flex-start; }
.src-case-label { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.src-case-sec p { margin: 4px 0 0; white-space: pre-wrap; }
.src-case-refs { margin: 4px 0 0; padding-left: 18px; }
.src-web .kbp-law-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }


/* ══════════ v2.8 · шапка-блок, загрузка в БЗ, черновик на всю высоту, тонкий скроллбар ══════════ */

/* Шапка Кол 2: ФИО · № · статус · SLA — один плотный блок слева, пустота только справа от него. */
.th-id { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 8px; }
.tk-chat-head.th .th-who { flex: 0 1 auto; min-width: 60px; }

/* База знаний: [+ Загрузить нормативный акт / PDF ▾] */
.kbu { position: relative; align-self: flex-start; }
.kbu-btn { height: 28px; gap: 6px; padding: 0 8px; color: var(--accent-strong); font-weight: 600; }
.db-pop.kbu-pop { top: 32px; left: 0; width: min(340px, 86vw); padding: 6px; }
.kbu-item { justify-content: flex-start; align-items: flex-start; gap: 10px; padding: 9px 10px; }
.kbu-item .ico { flex: none; margin-top: 2px; color: var(--accent-strong); }
.kbu-item-txt { display: flex; flex-direction: column; gap: 2px; }
.kbu-item-txt b { font-weight: 600; }
.kbu-drop {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: 10px;
  background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.kbu-drop:hover { border-color: var(--accent); color: var(--accent-strong); }
.kbu-file { flex: 1; min-width: 0; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbu-progress { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.kbu-progress-fill { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* Черновик на всю высоту колонки: поле растягивается, композер и кнопки прижаты к низу — без белой дыры. */
.tk-side-body { display: flex; flex-direction: column; }
.tk-side-pane.on { flex: none; }
#tkPaneAi.on { flex: 1 0 auto; }
#tkPaneAi .db-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#tkPaneAi .db-body > .expand-wrap { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
#tkPaneAi .db-text { flex: 1 1 0; height: auto; min-height: 200px; resize: none; }

/* Тонкий полупрозрачный скроллбар рабочих областей (Firefox — стандарт, Chromium/Safari — ::-webkit-scrollbar). */
.db-text, .tk-side-body, .src-body, .tk-chat-feed, .q-list, .tk-revise-inp, .history-panel, .tk-dossier-pane, .tk-reply-input, .db-pop {
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-3) 45%, transparent) transparent;
}
.db-text::-webkit-scrollbar, .tk-side-body::-webkit-scrollbar, .src-body::-webkit-scrollbar, .tk-chat-feed::-webkit-scrollbar,
.q-list::-webkit-scrollbar, .history-panel::-webkit-scrollbar, .tk-dossier-pane::-webkit-scrollbar, .db-pop::-webkit-scrollbar { width: 5px; height: 5px; }
.db-text::-webkit-scrollbar-thumb, .tk-side-body::-webkit-scrollbar-thumb, .src-body::-webkit-scrollbar-thumb, .tk-chat-feed::-webkit-scrollbar-thumb,
.q-list::-webkit-scrollbar-thumb, .history-panel::-webkit-scrollbar-thumb, .tk-dossier-pane::-webkit-scrollbar-thumb, .db-pop::-webkit-scrollbar-thumb {
  border-radius: 4px; background: color-mix(in srgb, var(--text-3) 40%, transparent);
}
.db-text::-webkit-scrollbar-track, .tk-side-body::-webkit-scrollbar-track, .src-body::-webkit-scrollbar-track { background: transparent; }

/* Кнопки карточек поиска переносятся, а не вылезают за край на узкой колонке. */
.omni-actions { flex-wrap: wrap; gap: 6px; }

/* Тесный диалог: ФИО важнее подписей — «Взять в работу» → «Взять», у пути клиента остаётся «2/4». */
.th-take-short { display: none; }
@container (max-width: 720px) {
  .th-take-full, .th-dots { display: none; }
  .th-take-short { display: inline; }
  .tk-chat-head.th .th-who { min-width: 110px; }
}

/* CCD-20261012-CK-SEARCH: боевой веб-поиск — бейдж PDF, строка провайдера, скан без текстового слоя */
.web-badge-pdf { font-size: 11px; font-weight: 800; letter-spacing: .04em; color: #b42318; background: rgba(180, 35, 24, .1); border: 1px solid rgba(180, 35, 24, .35); padding: 0 6px; border-radius: 4px; line-height: 18px; }
.web-meta { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 2px 8px; }
.web-meta.is-degraded { color: var(--warn, #b54708); }
.src-scan { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 14px; border-radius: 10px; background: var(--surface-2); }
.src-scan .ico { flex: none; color: var(--accent-strong); margin-top: 2px; }
.src-scan p { margin: 6px 0 10px; }
