/* ========================================================================
   kb.css · KB-WORKBENCH-3COL (15.10) — 3-колоночный Верстак Базы знаний (#kb)
   Фонд · Читалка · Студия атомов знаний встык на сплиттерах Workbench (workbench.css).
   Слой ПОВЕРХ app_v2.css / screens.css / workbench.css / organizer.css: переиспользует tk-side-tabs, segmented,
   df-bar, db-pop, studio-device/phone-*/studio-msg и добавляет только своё (kb3-*). В компонентах — только var(...).
   Откат — убрать <link> в index.html (и вернуть kb.js из _backup/20261015-kb3col/).
   ======================================================================== */

:root { --kb3-mark: #fde68a; --kb3-read: 15px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --kb3-mark: rgba(251, 191, 36, .32); } }
:root[data-theme="dark"] { --kb3-mark: rgba(251, 191, 36, .32); }

/* ---------- Каркас ---------- */
.kb3-wrap { display: flex; flex-direction: column; gap: 12px; }
.kb3-wrap .th-spacer { flex: 1; }
.kb3-fund, .kb3-read, .kb3-studio {
  position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--surface);
}
.kb3-read { container-type: inline-size; container-name: kb3read; }
.kb3-studio { container-type: inline-size; container-name: kb3studio; }
@media (min-width: 1024px) {
  body.tk-focus .kb3-wrap.wb-root { flex-direction: row; flex: 1; min-height: 0; gap: 0; align-items: stretch; background: var(--surface); }
}
@media (max-width: 1023px) {
  .kb3-fund, .kb3-read, .kb3-studio { border: 1px solid var(--border); border-radius: var(--r-l); box-shadow: var(--shadow-1); }
  .kb3-fund { max-height: 72vh; }
  .kb3-read { height: 86vh; }
  .kb3-studio { height: 860px; }
}

/* Общие точки статусов */
.kb3-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--text-3); display: inline-block; }
.kb3-dot.is-ok { background: var(--ok); }
.kb3-dot.is-warn { background: var(--warn); }
.kb3-dot.is-bad { background: var(--danger); }
.kb3-dot.is-info { background: var(--info); }
.kb3-dot.is-muted { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.kb3-dot.is-none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.kb3-bar { position: relative; display: block; height: 4px; border-radius: var(--r-full); background: var(--surface-2); overflow: hidden; }
.kb3-bar > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--accent); transition: width .3s ease; }
.kb3-bar.is-warn > i { background: var(--warn); }
.kb3-bar.is-bad > i { background: var(--danger); }
.kb3-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 20px; color: var(--text-3); text-align: center; font-size: 13px; }

/* ---------- Кол 1 · Фонд ---------- */
.kb3-fund-head { flex: none; display: flex; flex-direction: column; gap: 9px; padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.kb3-fund-title { display: flex; align-items: center; justify-content: space-between; height: 30px; }
.kb3-fund-title h1 { margin: 0; }   /* размер/начертание — единое правило H1 в polish.css */
.kb3-fund-tools { display: flex; align-items: center; gap: 4px; }
.kb3-fund-tools .icon-btn { width: 30px; height: 30px; color: var(--text-2); }
.kb3-add { height: 30px; padding: 0 10px 0 8px; gap: 4px; }
.kb3-search {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-s);
  background: var(--surface); color: var(--text-3); transition: border-color .15s, box-shadow .15s;
}
.kb3-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.kb3-search-inp { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; }
.kb3-search-inp::-webkit-search-cancel-button { display: none; }
.kb3-pills { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.kb3-pill {
  flex: 1 1 auto; min-width: 0; height: 27px; display: inline-flex; align-items: center; justify-content: 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; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.kb3-pill:hover { border-color: var(--border-strong); color: var(--text); }
.kb3-pill.on { background: var(--accent-weak); border-color: var(--accent); color: var(--accent-strong); }
.kb3-pill-n { font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
.kb3-pill-n.is-ok { color: var(--ok); }
.kb3-pill-n.is-warn { color: var(--warn); }
.kb3-fund-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kb3-fund-row .segmented-item { padding: 4px 10px; font-size: 12.5px; }
.kb3-fund-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 8px 10px; scrollbar-width: thin; }

.kb3-grp + .kb3-grp { margin-top: 2px; }
.kb3-grp-head {
  width: 100%; display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 6px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left;
}
.kb3-grp-head:hover { background: var(--surface-2); color: var(--text); }
.kb3-caret { color: var(--text-3); transition: transform .15s; flex: none; }
.kb3-grp.is-open .kb3-caret { transform: rotate(90deg); }
.kb3-grp-ico { color: var(--accent-strong); flex: none; }
.kb3-grp.is-arch .kb3-grp-ico { color: var(--text-3); }
.kb3-grp-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb3-grp-n { font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.kb3-grp-list { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px 12px; animation: tk-pane-in .15s ease; }

.kb3-doc {
  position: relative; width: 100%; display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 6px 8px 6px 10px; border: 0;
  border-radius: 8px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background-color .12s;
}
.kb3-doc:hover { background: var(--surface-2); }
.kb3-doc.on { background: var(--accent-weak); }
.kb3-doc.on::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); }
.kb3-doc.is-arch { opacity: .72; }
.kb3-doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kb3-doc-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.kb3-doc-short { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb3-doc.on .kb3-doc-short { color: var(--accent-strong); }
.kb3-doc-meta { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb3-new { flex: none; padding: 0 6px; border-radius: var(--r-full); background: var(--info-weak); color: var(--info); font-size: 10.5px; font-weight: 700; line-height: 17px; }
.kb3-flag { flex: none; display: inline-flex; color: var(--warn); }
.kb3-due {
  flex: none; display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border-radius: var(--r-full);
  background: var(--warn-weak); color: var(--warn); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.kb3-due.is-late { background: var(--danger-weak); color: var(--danger); }

/* Календарь ревизий */
.kb3-cal { padding: 4px 4px 0; }
.kb3-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.kb3-cal-nav .icon-btn { width: 28px; height: 28px; }
.kb3-cal-period { border: 0; background: none; padding: 4px 8px; border-radius: 6px; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--text); cursor: pointer; }
.kb3-cal-period:hover { background: var(--surface-2); color: var(--accent-strong); }
.kb3-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.kb3-cal-dow { text-align: center; font-size: 10.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; padding-bottom: 2px; }
.kb3-cal-day {
  position: relative; aspect-ratio: 1 / .92; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 1px solid transparent; border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; padding: 0;
}
.kb3-cal-day:hover { border-color: var(--border-strong); }
.kb3-cal-day.is-out { background: transparent; color: var(--text-3); }
.kb3-cal-day.is-today .kb3-cal-n { background: var(--accent-strong); color: var(--on-accent); }
.kb3-cal-day.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }
.kb3-cal-n { min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-full); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kb3-cal-dots { display: flex; gap: 3px; height: 6px; }
.kb3-ev { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex: none; }
.kb3-ev.is-edition { background: var(--info); }
.kb3-ev.is-effective { background: var(--ok); }
.kb3-ev.is-review { background: var(--warn); }
.kb3-ev.is-late { background: var(--danger); }
.kb3-cal-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 2px 4px; font-size: 11px; color: var(--text-3); }
.kb3-cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.kb3-agenda { margin-top: 6px; }
.kb3-agenda-h { margin: 10px 4px 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.kb3-agenda-none { padding: 4px 6px; }
.kb3-agenda-row {
  width: 100%; display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer;
}
.kb3-agenda-row:hover, .kb3-agenda-row.on { background: var(--surface-2); }
.kb3-agenda-name { font-weight: 600; flex: none; max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb3-agenda-what { flex: 1; min-width: 0; color: var(--text-3); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Квота хранилища */
.kb3-quota { flex: none; display: flex; flex-direction: column; gap: 7px; padding: 10px 14px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.kb3-quota-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kb3-quota-ico { color: var(--text-3); flex: none; }
.kb3-quota-txt { flex: 1; min-width: 0; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kb3-quota-txt b { color: var(--text); font-weight: 700; }
.kb3-quota-arch {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--r-full);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.kb3-quota-arch:hover, .kb3-quota-arch.on { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-weak); }
.kb3-quota-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Drag&Drop */
.kb3-drop {
  position: absolute; inset: 8px; z-index: 5; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 2px dashed var(--accent); border-radius: var(--r-m); background: var(--accent-weak); color: var(--accent-strong); font-size: 13px; pointer-events: none;
}
.kb3-fund.is-drop .kb3-drop { display: flex; animation: tk-pane-in .12s ease; }
.kb3-drop span { color: var(--text-2); font-size: 12px; }

/* ---------- Кол 2 · Читалка ---------- */
.kb3-read-bar {
  flex: none; box-sizing: border-box; height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 10px 0 16px; border-bottom: 1px solid var(--border);
}
.kb3-crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--text-2); }
.kb3-crumb-ico { color: var(--accent-strong); flex: none; }
.kb3-crumb-f { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kb3-crumb-sep { color: var(--text-3); flex: none; }
.kb3-crumb-d { color: var(--text); white-space: nowrap; flex: none; }
.kb3-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.kb3-tool { width: 32px; height: 32px; color: var(--text-2); }
.kb3-tool[aria-pressed="true"] { background: var(--accent-weak); color: var(--accent-strong); }
.kb3-tool:disabled { opacity: .38; cursor: not-allowed; background: transparent; }
.kb3-pop-anchor { position: relative; display: inline-flex; }
.kb3-tool-n {
  position: absolute; top: 2px; right: 1px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: var(--r-full); pointer-events: none;
  background: var(--accent-strong); color: var(--on-accent); font-size: 9.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.kb3-edit-hint { margin-right: 6px; }
@container kb3read (max-width: 560px) { .kb3-crumb-f, .kb3-crumb-sep { display: none; } }

.kb3-read-body { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: auto; scrollbar-width: thin; padding: 18px 20px 48px; }
.kb3-read-skel { max-width: 720px; margin: 0 auto; }

.kb3-insp { max-width: 860px; margin: 0 auto 14px; display: flex; flex-direction: column; gap: 10px; }
.kb3-insp-title { margin: 0; font-size: 19px; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; color: var(--text); text-wrap: balance; }
.kb3-insp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kb3-legal, .kb3-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.kb3-legal { background: var(--ok-weak); color: var(--ok); }
.kb3-legal.is-warn { background: var(--warn-weak); color: var(--warn); }
.kb3-legal.is-muted { background: var(--surface-2); color: var(--text-2); }
.kb3-chip { background: var(--surface-2); color: var(--text-2); font-weight: 500; }
.kb3-chip .ico { color: var(--text-3); }
.kb3-chip.is-info { background: var(--info-weak); color: var(--info); }
.kb3-chip.is-warn { background: var(--warn-weak); color: var(--warn); }
.kb3-chip.is-bad { background: var(--danger-weak); color: var(--danger); }
.kb3-chip.is-info .ico, .kb3-chip.is-warn .ico, .kb3-chip.is-bad .ico { color: inherit; }
.kb3-chip.is-muted { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--text-3); }
.kb3-tags { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.kb3-tag { font-size: 12.5px; color: var(--info); }
.kb3-banner {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; border-radius: var(--r-s); font-size: 13px; line-height: 1.45;
}
.kb3-banner > span { flex: 1; min-width: 0; }
.kb3-banner.is-warn { background: var(--warn-weak); color: var(--text); box-shadow: inset 3px 0 0 var(--warn); }
.kb3-banner.is-warn > .ico { color: var(--warn); flex: none; }
.kb3-banner.is-info { background: var(--info-weak); color: var(--text); box-shadow: inset 3px 0 0 var(--info); }
.kb3-banner.is-info > .ico { color: var(--info); flex: none; }
.kb3-folder-sel { flex: none; width: auto; max-width: 220px; height: 30px; padding: 0 8px; font-size: 12.5px; }
.kb3-banner-btn { flex: none; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.kb3-banner-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.kb3-cover { display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; align-items: center; gap: 10px; font-size: 12px; color: var(--text-3); }
.kb3-cover-txt b { color: var(--text); }
.kb3-src-link { display: inline-flex; align-items: center; gap: 4px; color: var(--info); text-decoration: none; white-space: nowrap; }
.kb3-src-link:hover { text-decoration: underline; }

/* Оглавление + полотно */
.kb3-docgrid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; max-width: 1000px; margin: 0 auto; align-items: start; }
.kb3-docgrid.no-toc { grid-template-columns: minmax(0, 1fr); max-width: 780px; }
.kb3-docgrid.no-toc .kb3-toc { display: none; }
.kb3-toc {
  position: sticky; top: 0; max-height: calc(100dvh - 56px - 54px - 40px); overflow-y: auto; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: 1px; padding: 2px 4px 10px 0;
}
.kb3-toc-h { margin: 2px 8px 6px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.kb3-toc-i {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 7px; padding: 5px 14px 5px 8px;
  border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer;
}
.kb3-toc-i:hover { background: var(--surface-2); color: var(--text); }
.kb3-toc-i.on { background: var(--accent-weak); color: var(--accent-strong); }
.kb3-toc-l { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kb3-toc-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb3-toc-i.has-chunks::after { content: ''; position: absolute; right: 5px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--ok); }
.kb3-toc-i[data-st="review"]::after { background: var(--warn); }
.kb3-toc-i[data-st="draft"]::after { background: var(--text-3); }
@container kb3read (max-width: 880px) { .kb3-docgrid { grid-template-columns: 128px minmax(0, 1fr); gap: 12px; } .kb3-toc-i { grid-template-columns: minmax(0, 1fr); gap: 0; } .kb3-toc-t { font-size: 11.5px; color: var(--text-3); } .kb3-toc-i.on .kb3-toc-t { color: inherit; } }
@container kb3read (max-width: 600px) { .kb3-docgrid { grid-template-columns: minmax(0, 1fr); } .kb3-toc { display: none; } }

.kb3-canvas { min-width: 0; font-size: var(--kb3-read); line-height: 1.68; color: var(--text); }
.kb3-sec { position: relative; padding: 12px 14px 4px 20px; margin: 0 0 4px; border-radius: 10px; scroll-margin-top: 16px; }
.kb3-sec::before { content: ''; position: absolute; left: 6px; top: 14px; bottom: 12px; width: 3px; border-radius: 3px; background: transparent; }
.kb3-sec.st-indexed::before { background: var(--ok); }
.kb3-sec.st-review::before { background: var(--warn); }
.kb3-sec.st-draft::before { background: repeating-linear-gradient(to bottom, var(--text-3) 0 5px, transparent 5px 9px); }
.kb3-sec.is-flash { animation: kb3-flash 1.8s ease; }
@keyframes kb3-flash { 0%, 45% { background: var(--accent-weak); box-shadow: 0 0 0 1px var(--accent-ring); } 100% { background: transparent; box-shadow: none; } }
.kb3-sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.kb3-sec-label {
  flex: none; padding: 1px 8px; border-radius: var(--r-full); background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 700; line-height: 20px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kb3-sec-title { flex: 1; min-width: 0; margin: 0; font-size: 15.5px; font-weight: 700; line-height: 1.4; color: var(--text); }
.kb3-sec-tools { flex: none; display: inline-flex; align-items: center; gap: 4px; align-self: center; }
.kb3-sec-ai, .kb3-sec-chunks {
  height: 24px; display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; border: 1px solid var(--border); border-radius: var(--r-full);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.kb3-sec-ai { opacity: 0; transition: opacity .15s; padding: 0 6px; }
.kb3-sec:hover .kb3-sec-ai, .kb3-sec-ai:focus-visible { opacity: 1; }
.kb3-sec-ai:hover, .kb3-sec-chunks:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-weak); }
.kb3-sec.st-indexed .kb3-sec-chunks { color: var(--ok); }
.kb3-sec.st-review .kb3-sec-chunks { color: var(--warn); }
.kb3-p { margin: 0 0 10px; max-width: 76ch; hyphens: auto; overflow-wrap: break-word; }
.kb3-p::selection, .kb3-sec-title::selection { background: var(--accent-ring); }
.kb3-note { margin: -6px 0 10px; font-size: 12px; line-height: 1.5; color: var(--text-3); font-style: italic; }
.kb3-canvas.is-clean .kb3-note { display: none; }
.kb3-ptitle { margin: 0; text-align: center; font-weight: 600; color: var(--text-2); font-size: 13.5px; }
mark.kb3-mark { background: var(--kb3-mark); color: inherit; border-radius: 3px; box-shadow: 0 0 0 2px var(--kb3-mark); }
.kb3-canvas.is-editing .kb3-p { outline: 1px dashed var(--border-strong); outline-offset: 3px; border-radius: 4px; cursor: text; }
.kb3-canvas.is-editing .kb3-p:focus { outline: 2px solid var(--accent); background: var(--surface-2); }
.kb3-canvas.is-editing .kb3-sec-tools { display: none; }

/* Поповер выделения (df-bar) и связи графа */
.df-bar.kb3-selbar { z-index: 1001; }
.kb3-selbar .df-btn:disabled { opacity: .45; cursor: not-allowed; background: transparent; color: var(--text-2); }
.kb3-sel-new { color: var(--accent-strong); }
.kb3-sel-n { display: inline-flex; align-items: center; padding: 0 8px 0 6px; margin-left: 2px; border-left: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tk-pop.db-pop.kb3-graph-pop { top: 38px; left: auto; right: 0; width: 300px; }
.kb3-pop-h { padding: 4px 9px 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.kb3-pop-none { padding: 6px 9px 8px; }
.kb3-graph-pop .db-pop-item { justify-content: flex-start; gap: 8px; }
.kb3-rel-via { flex: none; width: 92px; font-size: 11.5px; color: var(--text-3); }
.kb3-rel-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.kb3-graph-pop .db-pop-item .ico { color: var(--text-3); flex: none; }

/* ---------- Кол 3 · Студия атомов знаний ---------- */
.kb3-studio-head .tk-side-tabs { flex: 1; min-width: 0; }
.kb3-st-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.kb3-st-pane { display: none; flex: 1; min-height: 0; flex-direction: column; }
.kb3-st-pane.on { display: flex; animation: tk-pane-in .18s ease; }
.kb3-st-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.kb3-st-lbl { font-size: 11.5px; font-weight: 600; color: var(--text-3); flex: none; }
.kb3-models { flex: none; }
.kb3-models .segmented-item { padding: 3px 9px; font-size: 12px; height: 26px; }
.kb3-slice { margin-left: auto; height: 28px; padding: 0 9px; gap: 5px; color: var(--accent-strong); }
.kb3-st-sum { flex: none; display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--text-2); }
.kb3-sum-i { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.kb3-sum-i b { color: var(--text); font-variant-numeric: tabular-nums; }
.kb3-next { height: 26px; padding: 0 8px; gap: 5px; font-size: 12px; }
.kb3-next:disabled { opacity: .45; cursor: default; }
@container kb3studio (max-width: 390px) { .kb3-st-lbl { display: none; } .kb3-slice span { display: none; } .kb3-sum-i { gap: 3px; } }
.kb3-st-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 10px 24px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; background: var(--surface-2); }
.kb3-st-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 18px; text-align: center; color: var(--text-2); font-size: 13px; }
.kb3-st-empty > .ico { color: var(--accent-strong); }
.kb3-st-empty b { color: var(--text); font-size: 14px; }

.kb3-chunk {
  position: relative; flex: none; display: flex; flex-direction: column; gap: 8px; padding: 11px 12px 9px; border: 1px solid var(--border);
  border-radius: var(--r-m); background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: border-color .15s, box-shadow .15s;
}
.kb3-chunk:hover { border-color: var(--border-strong); }
.kb3-chunk.st-review { box-shadow: inset 3px 0 0 var(--warn); }
.kb3-chunk.st-draft { border-style: dashed; }
.kb3-chunk.is-flash { animation: kb3-card-flash 1.6s ease; }
@keyframes kb3-card-flash { 0%, 40% { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); } 100% { } }
.kb3-chunk.is-edit { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.kb3-c-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.kb3-st { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 7px; border-radius: var(--r-full); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.kb3-st.is-ok { background: var(--ok-weak); color: var(--ok); }
.kb3-st.is-warn { background: var(--warn-weak); color: var(--warn); }
.kb3-st.is-muted { background: var(--surface-2); color: var(--text-2); }
.kb3-art {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 46%; height: 22px; padding: 0 8px; border: 1px solid var(--border);
  border-radius: var(--r-full); background: var(--surface); color: var(--text-2); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.kb3-art span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb3-art:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-weak); }
.kb3-art.is-doc { cursor: default; color: var(--text-3); border-style: dashed; }
.kb3-art.is-doc:hover { border-color: var(--border); background: var(--surface); color: var(--text-3); }
.kb3-conf {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: help;
}
.kb3-conf.is-ok { background: var(--ok-weak); color: var(--ok); }
.kb3-conf.is-warn { background: var(--warn-weak); color: var(--warn); }
.kb3-conf.is-bad { background: var(--danger-weak); color: var(--danger); }
.kb3-c-title { margin: 0; font-size: 13.5px; font-weight: 700; line-height: 1.4; color: var(--text); }
.kb3-c-body {
  position: relative; max-height: 132px; overflow: hidden; cursor: pointer; font-size: 12.8px; line-height: 1.55; color: var(--text-2);
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent); mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.kb3-c-body.is-open { max-height: none; -webkit-mask-image: none; mask-image: none; }
.kb3-layer { margin: 0 0 6px; }
.kb3-layer:first-child { color: var(--text); font-weight: 500; }
.kb3-layer-l {
  display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px; background: var(--surface-2); color: var(--text-3);
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 16px; vertical-align: 1px;
}
.kb3-layer:first-child .kb3-layer-l { background: var(--accent-weak); color: var(--accent-strong); }
.kb3-meter { display: grid; grid-template-columns: minmax(60px, 1fr) auto; align-items: center; gap: 10px; }
.kb3-meter-track { position: relative; height: 6px; border-radius: var(--r-full); background: var(--surface-2); overflow: hidden; }
.kb3-meter-zone { position: absolute; top: 0; bottom: 0; background: var(--ok-weak); box-shadow: inset 1px 0 0 var(--ok), inset -1px 0 0 var(--ok); }
.kb3-meter-fill { position: absolute; left: 0; top: 1px; bottom: 1px; border-radius: var(--r-full); background: var(--ok); transition: width .2s ease; }
.kb3-meter.is-warn .kb3-meter-fill { background: var(--warn); }
.kb3-meter.is-bad .kb3-meter-fill { background: var(--danger); }
.kb3-meter-txt { font-size: 11.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kb3-meter-txt b { color: var(--text); }
.kb3-meter.is-warn .kb3-meter-txt { color: var(--warn); }
.kb3-meter.is-bad .kb3-meter-txt { color: var(--danger); }
.kb3-c-foot { display: flex; align-items: center; gap: 2px; min-width: 0; padding-top: 6px; border-top: 1px solid var(--border); }
.kb3-c-model { margin-right: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kb3-c-btn { width: 28px; height: 28px; flex: none; color: var(--text-2); }
.kb3-c-foot .btn-sm { height: 28px; padding: 0 9px; gap: 5px; font-size: 12px; flex: none; }
.kb3-pub { box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.kb3-ed-hint { display: flex; gap: 6px; align-items: flex-start; line-height: 1.4; }
.kb3-ed-hint .ico { flex: none; margin-top: 2px; }
.kb3-ed-title { height: 34px; font-weight: 600; font-size: 13.5px; }
.kb3-ed-text { min-height: 180px; resize: vertical; font-size: 13px; line-height: 1.55; }
.kb3-busy-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--accent-strong); }
.kb3-spin { width: 14px; height: 14px; flex: none; border: 2px solid var(--accent-ring); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.kb3-chunk.is-busy { border-style: dashed; border-color: var(--accent); }

/* ---------- Кол 3 · Диалог с ботом ---------- */
.kb3-sim-bar.studio-toolbar { flex-wrap: nowrap; height: 44px; padding: 4px 10px 4px 12px; gap: 6px; }
.kb3-sim-chs .segmented-item { padding: 3px 10px; font-size: 12px; height: 26px; }
.kb3-toggle {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px 0 6px; border: 1px solid var(--border); border-radius: var(--r-full);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.kb3-toggle-k { position: relative; width: 26px; height: 16px; border-radius: var(--r-full); background: var(--border-strong); transition: background-color .15s; flex: none; }
.kb3-toggle-k::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); transition: transform .15s; box-shadow: 0 1px 2px rgba(15, 23, 42, .25); }
.kb3-toggle.on { border-color: var(--warn); color: var(--warn); background: var(--warn-weak); }
.kb3-toggle.on .kb3-toggle-k { background: var(--warn); }
.kb3-toggle.on .kb3-toggle-k::after { transform: translateX(10px); }
@container kb3studio (max-width: 380px) { .kb3-toggle span:last-child { display: none; } .kb3-toggle { padding: 0 6px; } }
.kb3-sim-vp.studio-viewport { flex: 1; min-height: 0; align-items: stretch; padding: 12px 10px 14px; background-color: var(--stage-bg); }
.studio-device.is-mobile.kb3-phone { width: min(344px, calc(100% - 22px)); height: calc(100% - 20px); max-height: 780px; min-height: 0; margin: 10px auto; }
.kb3-phone.ch-max .studio-bot-ava { background: var(--ch-max); }
.kb3-phone.ch-telegram .studio-bot-ava { background: var(--ch-tg); }
.kb3-phone.ch-vk .studio-bot-ava { background: var(--ch-vk); }
.kb3-phone.ch-max .studio-bot-state { color: var(--ch-max); }
.kb3-phone.ch-telegram .studio-bot-state { color: var(--ch-tg); }
.kb3-phone.ch-vk .studio-bot-state { color: var(--ch-vk); }
.kb3-sim-chat { gap: 8px; }
.studio-msg.kb3-b { min-width: 0; max-width: 92%; padding: 9px 11px 18px; }
.studio-msg.kb3-b .studio-msg-body { font-size: 13.2px; overflow-wrap: anywhere; }
.studio-msg.kb3-b.is-miss { border-style: dashed; }
.studio-msg.kb3-u {
  align-self: flex-end; min-width: 0; max-width: 84%; padding: 8px 11px 18px; border-radius: 18px 18px 6px 18px;
  background: var(--accent-strong); border-color: transparent; color: var(--on-accent);
}
.studio-msg.kb3-u .studio-msg-body { color: var(--on-accent); font-size: 13.2px; }
.studio-msg.kb3-u .studio-msg-time { color: var(--on-accent); opacity: .75; }
.kb3-phone.ch-max .studio-msg.kb3-u { background: var(--ch-max); }
.kb3-phone.ch-telegram .studio-msg.kb3-u { background: var(--ch-tg); }
.kb3-phone.ch-vk .studio-msg.kb3-u { background: var(--ch-vk); }
.kb3-srcs { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 8px; }
.kb3-srcs-h { font-size: 11px; color: var(--text-3); font-weight: 600; }
.kb3-src {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 24px; padding: 2px 8px; border: 1px solid var(--key-border); border-radius: 8px;
  background: var(--key-bg); color: var(--key-text); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; text-align: left;
}
.kb3-src span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb3-src:hover { background: var(--accent-weak); border-color: var(--accent); }
.kb3-src.is-draft { border-style: dashed; color: var(--warn); }
.kb3-sim-note { display: flex; align-items: center; gap: 5px; margin-top: 7px; font-size: 11px; color: var(--warn); }
.kb3-sim-meta { display: block; margin-top: 6px; font-size: 10.5px; color: var(--text-3); }
.kb3-sim-sug { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.kb3-sim-sug-h { font-size: 11px; font-weight: 600; color: var(--text-3); text-align: center; }
.kb3-sim-sug-none { padding: 6px 10px; line-height: 1.4; }
.studio-key.kb3-sim-key { min-height: 36px; justify-content: flex-start; text-align: left; font-size: 12.5px; line-height: 1.3; padding: 7px 10px; }
.kb3-typing { display: inline-flex; gap: 4px; align-items: center; min-width: 0; width: auto; padding: 12px 14px; }
.kb3-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: kb3-dot 1s infinite ease-in-out; }
.kb3-typing i:nth-child(2) { animation-delay: .15s; }
.kb3-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes kb3-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.kb3-sim-compose { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 10px 4px; background: var(--surface); border-top: 1px solid var(--border); }
.kb3-sim-inp {
  flex: 1; min-width: 0; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--r-full);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 13.5px; outline: 0;
}
.kb3-sim-inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); background: var(--surface); }
.kb3-sim-send {
  width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%;
  background: var(--accent-strong); color: var(--on-accent); cursor: pointer;
}
.kb3-sim-send:hover { background: var(--accent-hover); }
.kb3-phone .phone-home { margin-top: 4px; }

@media (prefers-reduced-motion: reduce) {
  .kb3-sec.is-flash, .kb3-chunk.is-flash, .kb3-st-pane.on, .kb3-grp-list, .kb3-typing i { animation: none; }
}

/* ---------- CCD-20261018-KB-KERNEL · Верстак на ядре Прокопа: пустой фонд, разделы и папки ядра, атом ядра, «Что видит бот» ---------- */
.kb3-empty-hero { min-height: 100%; justify-content: center; gap: 10px; max-width: 460px; margin: 0 auto; padding: 48px 24px; }
.kb3-empty-ico { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-weak); color: var(--accent-strong); }
.kb3-empty-title { color: var(--text); font-size: 16px; }
.kb3-empty-text { color: var(--text-2); line-height: 1.5; }
.kb3-sect { display: flex; align-items: center; gap: 6px; padding: 12px 6px 4px; color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.kb3-sect:first-child { padding-top: 4px; }
.kb3-sect-n { margin-left: auto; font-weight: 500; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.kb3-grp-hrow { display: flex; align-items: center; gap: 2px; }
.kb3-grp-hrow .kb3-grp-head { flex: 1; min-width: 0; }
.kb3-grp-edit { width: 26px; height: 26px; flex: none; color: var(--text-3); opacity: 0; transition: opacity .15s; }
.kb3-grp-hrow:hover .kb3-grp-edit, .kb3-grp-edit:focus-visible { opacity: 1; }
.kb3-grp.is-system .kb3-grp-ico { color: var(--text-3); }
.kb3-grp-empty { padding: 4px 10px 8px 10px; line-height: 1.4; }
.kb3-grp-add {
  width: 100%; display: flex; align-items: center; gap: 7px; height: 32px; margin-top: 8px; padding: 0 8px; border: 1px dashed var(--border); border-radius: 7px;
  background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s;
}
.kb3-grp-add:hover { border-color: var(--accent); color: var(--accent-strong); }
.kb3-folder-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kb3-folder-row .kb3-folder-ico { color: var(--text-3); flex: none; }
.kb3-folder-row .kb3-folder-sel { flex: 1; max-width: 320px; }
.kb3-folder-dlg { display: flex; flex-direction: column; gap: 8px; min-width: min(360px, 80vw); }
.kb3-kernel-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 600; }
.kb3-chunk.is-kernel.is-publishing { opacity: .85; }
.kb3-pub-wait { font-size: 12px; font-weight: 500; color: var(--text-3); }
.kb3-live { margin: 6px 0 2px; font-size: 12.5px; color: var(--text-2); }
.kb3-live > summary { cursor: pointer; color: var(--text-3); font-weight: 600; }
.kb3-live-t { max-height: 220px; overflow: auto; margin-top: 6px; padding: 8px 10px; border-radius: var(--r-s); background: var(--surface-2); white-space: pre-wrap; line-height: 1.45; }
.kb3-c-err { margin: 6px 0; padding: 7px 10px; font-size: 12.5px; }
.kb3-sim-seen { margin-top: 8px; font-size: 12px; }
.kb3-sim-seen > summary { cursor: pointer; color: var(--text-3); font-weight: 600; }
.kb3-sim-seen-l { display: flex; flex-direction: column; gap: 5px; margin: 6px 0 0; padding-left: 18px; }
.kb3-sim-seen-l li { line-height: 1.35; }
.kb3-sim-seen-t { padding: 0; border: 0; background: none; color: var(--accent-strong); font: inherit; text-align: left; cursor: pointer; }
.kb3-sim-seen-t:hover { text-decoration: underline; }
.kb3-sim-seen-s { display: block; color: var(--text-3); font-variant-numeric: tabular-nums; }
