/* Активность Foma — маленькое окно под проводником, только вертикальный скролл */
.foma-proc-dock {
    flex: none;
    height: 148px;
    min-height: 96px;
    max-height: 220px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border, #2a3340);
    background: linear-gradient(180deg, rgba(18, 24, 32, 0.98), rgba(10, 14, 20, 1));
    font-size: 11px;
    line-height: 1.35;
}
.foma-proc-dock .foma-proc-head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 8px 4px;
    color: var(--text-dim, #94a3b8);
    font-weight: 600;
    letter-spacing: 0.02em;
    border-bottom: 1px solid rgba(42, 51, 64, 0.8);
}
.foma-proc-dock .foma-proc-list {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 4px 6px 8px;
    overscroll-behavior: contain;
}
.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 7px 10px;
}
.chat-message__avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--border);
}
.chat-message__body {
    min-width: 0;
    max-width: min(86%, 900px);
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.chat-message--user { justify-content: flex-end; }
.chat-message--user .chat-message__avatar { order: 2; }
.chat-message--user .chat-message__body {
    background: #123d73;
    border-color: #2d6fbc;
    color: #eef6ff;
    border-bottom-right-radius: 2px;
}
.chat-message__author { display: block; width: 100%; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-message__content { display: block; margin-top: 3px; }
.chat-message__body--folded { display: block; white-space: normal; }
.chat-message__fold { min-width: 0; max-width: 100%; }
.chat-message__fold-toggle {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    cursor: pointer;
    text-align: left;
    font: 11px var(--font-code);
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-message__fold-toggle:hover,
.chat-message__fold-toggle:focus-visible { text-decoration: underline; }
.chat-message__fold-toggle:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
.chat-message__fold-content { margin: 7px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.chat-message__fold-content[hidden] { display: none; }
.chat-message--foma .chat-message__body {
    background: #18241c;
    border-color: #386b4a;
    color: #e3f8e9;
    border-bottom-left-radius: 2px;
}
.chat-message--progress .chat-message__body {
    padding: 5px 8px;
    background: #25221a;
    border-color: #806d34;
    color: #f3dfa1;
    font-size: 11px;
}
.chat-message--progress-error .chat-message__body {
    background: #321c20;
    border-color: #a84b56;
    color: #fecdd3;
}
.chat-message--progress-done .chat-message__body {
    background: #173526;
    border-color: #3d8d5a;
    color: #bbf7d0;
}
.chat-message--runtime {
    display: block;
    margin: 4px 10px;
}
.foma-task-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 26px;
    padding: 4px 10px;
    border-bottom: 1px solid var(--border);
    background: rgba(17, 29, 23, 0.76);
    color: var(--text-dim);
    font-size: 10px;
    line-height: 1.2;
}
.foma-task-progress__stages {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    overflow: hidden;
}
.foma-task-progress__stage { white-space: nowrap; opacity: 0.48; }
.foma-task-progress__stage.is-current { color: #fbbf24; opacity: 1; }
.foma-task-progress__stage.is-done { color: #86efac; opacity: 0.92; }
.foma-task-progress__time {
    margin-left: auto;
    flex: 0 0 auto;
    color: #86efac;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.foma-task-progress.is-error .foma-task-progress__time { color: #fca5a5; }
@media (max-width: 680px) {
    .foma-task-progress__stage:not(.is-current):not(.is-done) { display: none; }
}
.runtime-entry {
    max-width: 100%;
    border: 1px solid #3b4658;
    border-radius: 6px;
    background: #151c26;
    color: #d7e2f1;
    font: 12px/1.45 var(--font-mono, Consolas, monospace);
}
.runtime-entry > summary {
    cursor: pointer;
    padding: 6px 8px;
    user-select: none;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.runtime-entry > summary::marker { color: #8ca9cf; }
.runtime-entry__detail {
    max-height: 260px;
    overflow: auto;
    margin: 0;
    padding: 8px;
    border-top: 1px solid #3b4658;
    background: #0d1219;
    color: #c5d4e8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
/* Рассуждение Foma — тёплый акцент, чтобы отличалось от синих записей инструментов. */
.chat-message--reasoning .runtime-entry {
    border-color: #6d5a24;
    background: #191810;
}
.chat-message--reasoning .runtime-entry > summary {
    color: #e7d9a3;
    font-style: italic;
}
.chat-message--reasoning .runtime-entry > summary::marker { color: #b49a53; }
.ghost-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}
.ghost-btn:hover { color: var(--text-main); background: rgba(255,255,255,0.06); }
.icon-action-btn {
    box-sizing: border-box;
    width: 26px;
    height: 26px;
    min-width: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    place-items: center;
    line-height: 0;
    color: var(--text-dim);
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    transition: color .12s ease, background-color .12s ease, border-color .12s ease;
}
.sidebar-head-actions .icon-action-btn:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .06);
}
.sidebar-head-actions .icon-action-btn:focus-visible {
    outline: none;
    color: var(--text-main);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
.sidebar-head-actions .icon-action-btn:active {
    background: rgba(255, 255, 255, .12);
}
.sidebar-head-actions .project-open-btn {
    color: #57b879;
    border-color: #2f8b57;
    background: transparent;
}
.sidebar-head-actions .project-open-btn:hover {
    color: #fff;
    border-color: #57b879;
    background: #287d4e;
}
.sidebar-head-actions .project-open-btn:active { background: #1d6740; }
.sidebar-head-actions .project-close-btn {
    color: #df7180;
    border-color: #a84b56;
    background: transparent;
}
.sidebar-head-actions .project-close-btn:hover {
    color: #fff;
    border-color: #df7180;
    background: #923b47;
}
.sidebar-head-actions .project-close-btn:active { background: #752f38; }
.icon-action-btn svg {
    display: block;
    flex: none;
    width: 16px;
    height: 16px;
    fill: currentColor;
}
.sidebar-head-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: none;
}

.file-tree {
    padding: 0;
    user-select: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ft-root-label {
    flex: none;
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 8px 12px 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--bg-panel);
    cursor: pointer;
}
.ft-root-label.active {
    color: var(--accent, #5b8def);
}
.ft-list {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 4px 0 12px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}
.ft-node { }
.ft-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px 3px 0;
    color: var(--text-dim);
    cursor: default;
    font-size: 12px;
    white-space: nowrap;
    min-height: 22px;
}
.ft-row.folder {
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
}
.ft-row.file {
    color: var(--text-dim);
    font-weight: 400;
    cursor: pointer;
}
.ft-row.ft-ignored {
    color: #c4a1ff;
    opacity: .82;
    font-style: italic;
}
.ft-row.ft-ignored .ft-twist,
.ft-row.ft-ignored .ft-ico { color: #b78cff; }
.ft-row.ft-ignored:hover,
.ft-row.ft-ignored.active {
    color: #eadcff;
}
.ft-row:hover, .ft-row.active {
    background: var(--bg-active);
    color: var(--text-main);
}
.ft-row.ft-flash {
    animation: ftFlash 1.4s ease;
}
@keyframes ftFlash {
    0% { background: rgba(90, 180, 255, 0.45); color: var(--text-main); }
    100% { background: transparent; }
}
/* Живое дерево: идёт запись агента / диск изменился */
#sidebarTitle.tree-live::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 8px;
    border-radius: 50%;
    background: #5aa8ff;
    vertical-align: middle;
    animation: treeLivePulse 1s ease-in-out infinite;
}
#fileTree.tree-live {
    box-shadow: inset 2px 0 0 rgba(90, 168, 255, 0.55);
}
@keyframes treeLivePulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}
#fileTree.tree-refreshing .ft-row.ft-stream-active {
    animation: none !important;
}
#fileTree.tree-live .ft-row.ft-flash,
#fileTree.tree-refreshing .ft-row.ft-flash {
    animation: none !important;
    background: rgba(90, 180, 255, 0.2);
}
.ft-row.dragging { opacity: 0.5; }
.ft-row.ft-drop-hover,
#ftRootLabel.ft-drop-hover {
    background: rgba(91, 141, 239, 0.22) !important;
    color: var(--text-main);
    outline: 1px solid rgba(91, 141, 239, 0.55);
    outline-offset: -1px;
}
.ft-twist {
    width: 12px;
    flex-shrink: 0;
    font-size: 8px;
    opacity: 0.7;
    text-align: center;
}
.ft-ico-img {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
    image-rendering: auto;
    pointer-events: none;
    user-select: none;
}
.ft-ico-img.file { opacity: 0.95; }
.ft-ico-img.folder { opacity: 0.98; }

.ft-ico {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    position: relative;
}
.ft-ico.folder {
    border: 1.5px solid var(--text-main);
    border-radius: 2px 2px 1px 1px;
    background: transparent;
}
.ft-ico.folder::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 1px;
    width: 6px;
    height: 3px;
    border: 1.5px solid var(--text-main);
    border-bottom: none;
    border-radius: 2px 2px 0 0;
    background: var(--bg-panel);
}
.ft-ico.file {
    border: 1.5px solid currentColor;
    border-radius: 1px;
    background: transparent;
}
.ft-ico.file::after {
    content: '';
    position: absolute;
    right: -1px;
    top: -1px;
    border: 3px solid transparent;
    border-left-color: currentColor;
    border-bottom-color: currentColor;
    transform: rotate(180deg);
    opacity: 0.5;
}
.ft-name {
    overflow: hidden;
    text-overflow: ellipsis;
}
.ft-folder-git-dot {
    width: 7px;
    height: 7px;
    margin-left: auto;
    flex: none;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 5px rgba(74, 222, 128, 0.7);
}
.ft-status { margin-left: auto; flex: none; min-width: 1.1em; font-size: 11px; font-weight: 800; line-height: 1; text-align: center; }
.ft-row.git-modified .ft-status, .ft-row.git-modified { color: #facc15; }
.ft-row.git-added .ft-status, .ft-row.git-added { color: #86efac; }
.ft-row.git-deleted .ft-status, .ft-row.git-deleted { color: #f87171; }
.ft-row.git-untracked .ft-status, .ft-row.git-untracked { color: #7dd3fc; }
.ft-row.git-renamed .ft-status, .ft-row.git-renamed { color: #facc15; }
.ft-row.git-modified .ft-name, .ft-row.git-modified .ft-ico.file { color: #facc15; }
.ft-row.git-added .ft-name, .ft-row.git-added .ft-ico.file { color: #86efac; }
.ft-row.git-deleted .ft-name, .ft-row.git-deleted .ft-ico.file { color: #f87171; }
.ft-row.git-untracked .ft-name, .ft-row.git-untracked .ft-ico.file { color: #7dd3fc; }
.ft-row.git-renamed .ft-name, .ft-row.git-renamed .ft-ico.file { color: #facc15; }
.change-kind.modified, .change-item.modified .change-name { color: #facc15; }
.change-kind.added, .change-item.added .change-name { color: #86efac; }
.change-kind.untracked, .change-item.untracked .change-name { color: #7dd3fc; }
.change-kind.deleted, .change-item.deleted .change-name { color: #f87171; }
.change-kind.renamed, .change-item.renamed .change-name { color: #facc15; }
.ft-deleted-git-node { margin: 8px 0 0; padding-top: 5px; border-top: 1px solid rgba(248, 113, 113, 0.25); }
.ft-deleted-git-heading { padding: 2px 8px; color: #f87171; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.ft-deleted-git-file { padding-left: 22px; font-style: italic; opacity: .9; }
.ft-children {
    border-left: 1px solid #2a2a2a;
    margin-left: 14px;
}
.ft-loading, .ft-empty {
    padding: 4px 8px 4px 28px;
    font-size: 11px;
    color: var(--text-dim);
    opacity: 0.7;
}
.ft-loading.ft-silent {
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
.file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}
.file-item:hover, .file-item.active {
    background: var(--bg-active);
    color: var(--text-main);
}
.file-item .fi { width: 14px; text-align: center; opacity: 0.7; font-size: 10px; }
.empty-hint {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.6;
}
kbd {
    font-family: var(--font-code);
    background: var(--bg-active);
    border: 1px solid var(--border);
    padding: 1px 5px;
    font-size: 10px;
    border-radius: 2px;
}

.search-panel {
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.search-results {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-dim);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.search-hit {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    text-align: left;
    padding: 6px 8px;
    margin: 0 0 4px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 6px);
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
}
.search-hit:hover {
    border-color: var(--border);
    background: var(--bg-active);
}
.search-hit-path {
    color: var(--text-main);
    font-size: 11px;
    font-weight: 600;
    word-break: break-all;
}
.search-hit-text {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.center-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    /* при росте нижней зоны приказа редактор ужимается, не вылезает */
    overflow: hidden;
}

.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    height: 100%;
    position: relative;
    background: var(--bg-app);
    overflow: hidden;
}
/* Только рамка — НИКАКОГО чёрного ::after (он залипал и прятал код) */
.editor-area.drop-target {
    outline: 2px dashed #9ca3af;
    outline-offset: -6px;
}
.editor-area.drop-target::after {
    content: none !important;
    display: none !important;
}
textarea.path-drop-target,
input.path-drop-target {
    outline: 1px dashed var(--accent, #8af);
    outline-offset: 2px;
}
.tabs {
    display: flex;
    background: var(--bg-panel);
    height: 32px;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    flex-shrink: 0;
    border-bottom: none;
}
.tabs-bar {
    display: flex;
    align-items: stretch;
    background: var(--bg-panel);
    height: 34px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 8;
}
.tabs-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0 5px;
    border-left: 1px solid var(--border);
    flex-shrink: 0;
}
.tabs-actions .editor-action-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: var(--radius-xs);
}
.tabs-actions .editor-action-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}
.md-mode-button {
    min-width: 38px !important;
    padding: 0 6px !important;
    font-size: 10px;
    font-weight: 700;
}
.md-mode-button.is-on,
.md-mode-button[aria-pressed="true"] {
    color: var(--text-main);
    background: var(--accent);
}
.md-mode-button:focus-visible { outline: 2px solid var(--text-main); outline-offset: 1px; }
.tab.dirty-tab {
    color: #fbbf24;
    background: #2b2108;
}
.tab.dirty-tab span:first-child::after {
    content: '';
}
.tab {
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 12px;
    min-width: 100px;
    cursor: pointer;
    max-width: 200px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab.active {
    background: var(--bg-app);
    color: var(--text-main);
    border-top: 1px solid var(--text-main);
}
.tab.stream-tab {
    opacity: 0.82;
    font-style: italic;
    color: #86efac;
    border-top: 1px dashed rgba(134, 239, 172, 0.45);
}
.tab.stream-tab.active {
    color: #bbf7d0;
    border-top-color: #86efac;
}

/*
 * КОРЕНЬ чёрного экрана: Monaco нельзя создавать/держать в display:none —
 * layout 0×0, тема #000 → «пустая чернота» после drop/open.
 * Контейнер ВСЕГДА в flex; welcome/image — оверлеи сверху.
 */
#monacoContainer {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: block;
    overflow: hidden;
    position: relative;
    z-index: 1;
}
#monacoContainer.visible {
    /* класс оставлен для JS-совместимости; display больше не трогаем */
    display: block;
}
#monacoDiffContainer {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: none;
    overflow: hidden;
    position: relative;
    z-index: 2;
}
#monacoDiffContainer.visible { display: block; }
.editor-unsaved-warning {
    position: absolute;
    z-index: 20;
    top: 50%;
    left: 50%;
    display: grid;
    gap: 5px;
    min-width: 270px;
    max-width: min(440px, calc(100% - 40px));
    padding: 16px 20px;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(251, 191, 36, .9);
    border-radius: var(--radius-sm);
    background: rgba(36, 27, 7, .97);
    box-shadow: 0 14px 38px rgba(0, 0, 0, .5);
    color: #fde68a;
    font-size: 13px;
    pointer-events: none;
}
.editor-unsaved-warning strong { color: #fbbf24; }
.editor-unsaved-warning span { color: var(--text-main); }
.editor-unsaved-warning[hidden] { display: none; }
.changes-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid var(--border); }
.changes-heading { flex: 1; font-size: 12px; font-weight: 700; }
.changes-list { margin: 0; padding: 0; list-style: none; overflow: auto; }
.changes-list--cursor { flex: 0 0 auto; max-height: 34vh; border-bottom: 1px solid var(--border); }
.change-item { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 7px 9px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 12px; }
.change-item:hover { background: var(--bg-active); }.change-item:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }
.change-kind { font-weight: 800; min-width: 16px; color: #facc15; }
.change-kind.added { color: #86efac; }.change-kind.untracked { color: #7dd3fc; }.change-kind.deleted { color: #f87171; }.change-kind.renamed { color: #facc15; }
.change-file { min-width: 0; display: flex; align-items: baseline; gap: 7px; overflow: hidden; }.change-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-main); font-weight: 700; }.change-folder { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #94a3b8; font-family: var(--font-code); font-size: 10px; font-weight: 500; }.change-folder::before { content: '›'; margin-right: 5px; color: #64748b; }.change-item:hover .change-folder, .change-item:focus-visible .change-folder { color: #cbd5e1; }.change-stats { display: flex; gap: 7px; white-space: nowrap; font-size: 11px; }.change-plus { color: #86efac; }.change-minus { color: #f87171; }
.changes-stream { display: grid; grid-template-rows: auto minmax(90px, 1fr) minmax(90px, 1fr); flex: 1; min-height: 0; border-top: 1px solid var(--border); }
.changes-stream-title { padding: 7px 9px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-main); background: var(--bg-app); }
.changes-diff-pane { min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.changes-diff-label { padding: 4px 9px; flex: none; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.changes-diff-pane--before .changes-diff-label { color: #fca5a5; background: rgba(248,113,113,.14); }
.changes-diff-pane--after .changes-diff-label { color: #86efac; background: rgba(134,239,172,.14); }
.changes-diff-code { margin: 0; min-height: 0; flex: 1; overflow: auto; padding: 7px 9px; tab-size: 4; font: 11px/1.48 Consolas, 'Courier New', monospace; white-space: pre; color: var(--text-main); background: var(--bg-editor, #000); }
.changes-diff-code .diff-line { display: block; min-height: 16px; padding: 0 3px; }
.changes-diff-code .diff-line.is-changed.before { background: rgba(248,113,113,.25); color: #fecaca; }
.changes-diff-code .diff-line.is-changed.after { background: rgba(134,239,172,.2); color: #dcfce7; }
/* MD preview — оверлей поверх Monaco (как image-preview), не вторая flex-колонка */
#mdPreviewPane {
    position: absolute;
    left: 0;
    right: 0;
    top: 34px;
    bottom: 0;
    z-index: 7;
    overflow: auto;
    display: none;
    background: var(--bg-editor, var(--bg-app));
}
#mdPreviewPane.is-open:not([hidden]) {
    display: block !important;
}
#mdPreviewPane[hidden] {
    display: none !important;
}
.video-preview {
    position: absolute;
    inset: 34px 0 0;
    z-index: 8;
    display: none;
    flex-direction: column;
    min-height: 0;
    background: var(--bg-editor, #000);
}
.video-preview.visible:not([hidden]) { display: flex !important; }
.video-preview[hidden] { display: none !important; }
.video-preview-stage {
    display: flex;
    flex: 1;
    min-height: 0;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: #000;
}
.video-preview-stage video { display: block; width: min(100%, 1280px); max-height: 100%; object-fit: contain; }
#mdPreviewPane.md-preview-txt {
    box-sizing: border-box;
    padding: 28px 32px 48px;
    white-space: pre-wrap;
    tab-size: 4;
    font: 13px/1.55 var(--font-code);
    color: var(--text-main);
}
.md-html-document {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #111827;
}
/* Читаемый и изолированный Markdown preview. */
.md-doc {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 32px 48px;
    color: var(--text-main);
    font: 14px/1.6 var(--font-ui);
    overflow-wrap: anywhere;
}
.md-doc > :first-child { margin-top: 0; }
.md-doc h1, .md-doc h2, .md-doc h3, .md-doc h4, .md-doc h5, .md-doc h6 { margin: 1.3em 0 .45em; line-height: 1.22; }
.md-doc p { margin: .8em 0; }
.md-doc .md-link { color: #7dd3fc; text-decoration: underline; }
.md-doc .md-inline, .md-doc .md-code { font-family: var(--font-code); }
.md-doc .md-inline { padding: .1em .35em; border-radius: 4px; background: rgba(255,255,255,.1); }
.md-doc .md-code { margin: 1em 0; padding: 14px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #080b10; white-space: pre; }
.md-doc .md-list { margin: .75em 0; padding-left: 1.5em; }
.md-doc .md-check { list-style: none; margin-left: -1.25em; }
.md-doc .md-check::before { content: '☐'; display: inline-block; width: 1.25em; color: #94a3b8; }
.md-doc .md-check.done { color: var(--text-dim); text-decoration: line-through; }
.md-doc .md-check.done::before { content: '☑'; color: #86efac; }
.md-doc .md-figure { margin: 1em 0; }
.md-doc .md-figure img { display: block; max-width: 100%; max-height: 70vh; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.md-doc .md-figure figcaption { margin-top: .35em; color: var(--text-dim); font-size: 12px; }
.md-table-wrap { max-width: 100%; margin: 1em 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.md-doc table { width: 100%; border-collapse: collapse; }
.md-doc th, .md-doc td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.md-doc th { background: rgba(255,255,255,.08); font-weight: 700; }
.md-doc tbody tr:last-child td { border-bottom: 0; }
.md-doc .md-align-left { text-align: left; }.md-doc .md-align-center { text-align: center; }.md-doc .md-align-right { text-align: right; }
.md-flowchart { margin: 1em 0; padding: 16px; border: 1px solid #356477; border-radius: var(--radius-md); background: linear-gradient(135deg, rgba(14, 45, 59, .75), rgba(10, 15, 22, .9)); }
.md-flow-nodes { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.md-flow-node { display: inline-flex; align-items: center; min-height: 36px; padding: 7px 12px; border: 1px solid #38bdf8; border-radius: var(--radius-sm); background: rgba(14, 116, 144, .24); font-weight: 600; }
.md-flow-node:not(:last-child)::after { content: '→'; margin-left: 18px; color: #7dd3fc; font-size: 18px; }
.md-flow-edges { margin: 12px 0 0; padding-left: 20px; color: var(--text-dim); font-size: 12px; }

#monacoContainer .monaco-editor,
#monacoContainer .overflow-guard {
    outline: none !important;
    width: 100% !important;
    height: 100% !important;
}

/* Подсветка всех строк с ошибками (клик по счётчику err в статусбаре) */
#monacoContainer .cluster-error-line-hl {
    background: rgba(255, 60, 60, 0.22) !important;
}
#monacoContainer .cluster-error-line-hl-warn {
    background: rgba(240, 192, 64, 0.18) !important;
}
#monacoContainer .cluster-error-line-margin {
    border-left: 3px solid #ff4d4d !important;
    margin-left: 3px;
}
#monacoContainer .cluster-error-line-margin-warn {
    border-left: 3px solid #f0c040 !important;
    margin-left: 3px;
}

/* Явные волнистые ошибки на чёрной теме (+ fallback wavy border — SVG иногда не виден) */
#monacoContainer .squiggly-error,
#monacoContainer .monaco-editor .squiggly-error {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3'%3E%3Cpath fill='%23ff4d4d' d='M0 2.5A.5.5 0 0 1 .5 2a.5.5 0 0 1 .5.5v.1A.5.5 0 0 0 1.5 3H2a.5.5 0 0 0 .5-.5.5.5 0 0 1 1 0A.5.5 0 0 0 4 3h.5a.5.5 0 0 0 .5-.5.5.5 0 0 1 1 0v.1a.5.5 0 0 1-.5.5h-.5a.5.5 0 0 1-.5-.5.5.5 0 0 0-1 0 .5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5.5.5 0 0 0-1 0 .5.5 0 0 1-.5.5z'/%3E%3C/svg%3E") repeat-x bottom left !important;
    background-size: 6px 3px !important;
    border-bottom: 2px solid #ff4d4d !important;
}
#monacoContainer .squiggly-warning,
#monacoContainer .monaco-editor .squiggly-warning {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3'%3E%3Cpath fill='%23f0c040' d='M0 2.5A.5.5 0 0 1 .5 2a.5.5 0 0 1 .5.5v.1A.5.5 0 0 0 1.5 3H2a.5.5 0 0 0 .5-.5.5.5 0 0 1 1 0A.5.5 0 0 0 4 3h.5a.5.5 0 0 0 .5-.5.5.5 0 0 1 1 0v.1a.5.5 0 0 1-.5.5h-.5a.5.5 0 0 1-.5-.5.5.5 0 0 0-1 0 .5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5.5.5 0 0 0-1 0 .5.5 0 0 1-.5.5z'/%3E%3C/svg%3E") repeat-x bottom left !important;
    background-size: 6px 3px !important;
    border-bottom: 2px solid #f0c040 !important;
}
#monacoContainer .squiggly-info,
#monacoContainer .monaco-editor .squiggly-info {
    border-bottom: 2px solid #5aa8ff !important;
}
/* Неиспользуемые символы / deprecated (JS/TS showUnused) */
#monacoContainer .monaco-editor .showUnused,
#monacoContainer .monaco-editor .squiggly-unnecessary {
    opacity: 0.55 !important;
    border-bottom: 1px dashed #888 !important;
}
#monacoContainer .monaco-editor .squiggly-deprecated {
    border-bottom: 1px dashed #f0c040 !important;
}
/* Красные точки на overview ruler справа — нормальны только при реальных маркерах */
#monacoContainer .monaco-editor .decorationsOverviewRuler {
    width: 10px !important;
}

.image-preview {
    position: absolute;
    left: 0;
    right: 0;
    top: 34px;
    bottom: 0;
    z-index: 8;
    display: none;
    flex-direction: column;
    background: var(--bg-app);
    overflow: hidden;
}
.image-preview.visible {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.image-preview[hidden] {
    display: none !important;
}
.image-preview.visible:not([hidden]) {
    display: flex !important;
}
.image-preview-meta {
    flex: none;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel);
    user-select: text;
}
.image-preview-meta strong { color: var(--text-main); font-weight: 600; }
.image-preview-stage {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background:
        linear-gradient(45deg, #111 25%, transparent 25%),
        linear-gradient(-45deg, #111 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #111 75%),
        linear-gradient(-45deg, transparent 75%, #111 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-color: #0a0a0a;
}
.image-preview-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: auto;
    box-shadow: 0 0 0 1px var(--border);
    background: transparent;
    transition: opacity 0.12s ease;
}
.image-preview-error {
    flex: none;
    padding: 10px 14px;
    font-size: 12px;
    color: #ff6b6b;
    border-top: 1px solid var(--border);
    background: #140808;
}

.welcome {
    position: absolute;
    left: 0;
    right: 0;
    top: 34px;
    bottom: 0;
    z-index: 6;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.04), transparent 50%),
        var(--bg-app);
}
.welcome.hidden { display: none !important; }
.welcome-inner {
    text-align: center;
    width: min(520px, 100%);
    padding: 32px 24px 48px;
    margin: auto 0;
    user-select: text;
}
/* Курсор-аватар clus{TER} в рабочих окнах */
body.cluster-cursor-on .workspace,
body.cluster-cursor-on .workspace *:not(input):not(textarea):not(select):not([contenteditable="true"]),
body.cluster-cursor-on .titlebar,
body.cluster-cursor-on .titlebar *:not(input):not(textarea),
body.cluster-cursor-on .modal-overlay.open .modal-window,
body.cluster-cursor-on .modal-overlay.open .modal-window *:not(input):not(textarea):not(select) {
    cursor: var(--cluster-cursor, auto) !important;
}
body.cluster-cursor-on .workspace input,
body.cluster-cursor-on .workspace textarea,
body.cluster-cursor-on .workspace select,
body.cluster-cursor-on .workspace [contenteditable="true"],
body.cluster-cursor-on .modal-overlay.open input,
body.cluster-cursor-on .modal-overlay.open textarea,
body.cluster-cursor-on .modal-overlay.open select {
    cursor: text !important;
}
body.cluster-cursor-on .workspace input[type="checkbox"],
body.cluster-cursor-on .workspace input[type="radio"],
body.cluster-cursor-on .modal-overlay.open input[type="checkbox"],
body.cluster-cursor-on .modal-overlay.open input[type="radio"] {
    cursor: var(--cluster-cursor, pointer) !important;
}
.cluster-cursor-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-weight: 600;
}
.cluster-cursor-preview {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.welcome-logo-stage {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0 auto 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    perspective: 360px;
    transform: translateZ(0);
}
.welcome-logo-stage::after {
    content: '';
    position: absolute;
    /* Удлинённый диагональный фронт: примерно втрое длиннее стороны аватара. */
    inset: -165%;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(112deg, transparent 37%, rgba(255,255,255,.08) 44%, rgba(153,201,255,.86) 50%, rgba(255,255,255,.18) 56%, transparent 63%);
    mix-blend-mode: screen;
    transform: translate3d(-198%, 126%, 26px) rotateY(-22deg) rotateZ(-18deg);
}
.welcome-logo-stage.is-wave::after { animation: welcome-logo-wave 3.8s cubic-bezier(.22,.61,.36,1) both; }
.welcome-logo-stage.is-wave .welcome-logo { animation: welcome-logo-depth 3.8s cubic-bezier(.22,.61,.36,1) both; }
.welcome-logo {
    width: 88px;
    height: 88px;
    object-fit: cover;
    display: block;
}
@keyframes welcome-logo-wave {
    0% { opacity: 0; transform: translate3d(-198%, 126%, 26px) rotateY(-22deg) rotateZ(-18deg); }
    16% { opacity: .25; }
    52% { opacity: .9; }
    100% { opacity: 0; transform: translate3d(198%, -126%, 26px) rotateY(-22deg) rotateZ(-18deg); }
}
@keyframes welcome-logo-depth {
    0%, 100% { filter: brightness(1); transform: rotateY(0) scale(1); }
    48% { filter: brightness(1.18); transform: rotateY(-5deg) scale(1.018); }
}
@media (prefers-reduced-motion: reduce) {
    .welcome-logo-stage.is-wave::after,
    .welcome-logo-stage.is-wave .welcome-logo { animation: none; }
}
html.performance-no-animations *,
html.performance-no-animations *::before,
html.performance-no-animations *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}
.welcome h1 {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.welcome p { color: var(--text-dim); margin-bottom: 20px; }
.welcome-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap;
    margin-bottom: 16px;
}
.welcome-tips {
    list-style: none;
    text-align: left;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 2;
    display: inline-block;
    margin-top: 48px;
}
.welcome-recent {
    margin-top: 32px;
    text-align: left;
    width: min(680px, 100%);
}
.welcome-recent h2 {
    font-size: 14px;
    margin: 0 0 12px;
    color: #f7f7f8;
    letter-spacing: .02em;
}
.settings-tool-section {
    padding: 14px;
}
.settings-tool-section[hidden],
.project-settings-section[hidden] { display: none !important; }
.capture-path-field .field { flex: 1; min-width: 0; }
.capture-screen-list, .capture-auto-settings { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 7px; background: rgba(255, 255, 255, .025); }
.capture-screen-list { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
.capture-auto-settings { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.capture-auto-controls { display: grid; gap: 8px; }
.capture-auto-settings .settings-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.capture-auto-settings .field { width: 90px; }
.video-capture-settings { max-height: 100%; overflow-y: auto; overscroll-behavior: contain; padding-right: 8px; scrollbar-gutter: stable; }
.photo-capture-button { width: 116px; height: 116px; border: 2px solid var(--accent, #5d9cff); border-radius: 50%; color: var(--text-main); background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.16), rgba(93,156,255,.20)); display: grid; place-content: center; gap: 4px; font: inherit; letter-spacing: .08em; cursor: pointer; box-shadow: 0 4px 18px rgba(0,0,0,.25); }
.photo-capture-button span { font-size: 33px; line-height: .8; }
.photo-capture-button:hover { filter: brightness(1.15); }
.photo-capture-button.is-running { border-color: #ef4444; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.15), rgba(239,68,68,.33)); color: #fff; }
kbd { padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-active); font: inherit; color: var(--text-main); }
@media (max-width: 560px) { .capture-screen-list { grid-template-columns: 1fr; } }
.project-settings-section#legalTemplatesSettingsView { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.editor-settings-list {
    display: grid;
    gap: 10px;
    padding-top: 12px;
}
.editor-settings-list .check,
.editor-settings-list .settings-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 34px;
}
.editor-settings-list .settings-field > span { color: var(--text, #e5e7eb); }
.editor-settings-list .settings-field .field { width: 150px; }
.editor-settings-list .check { color: var(--text, #e5e7eb); }
.editor-settings-reset {
    justify-self: start;
    margin-top: 4px;
}
.archive-settings-list { display: grid; gap: 10px; padding-top: 12px; }
.archive-settings-list .settings-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.archive-settings-list .field { width: 160px; }
.archive-path-field { align-items: flex-start !important; }
.archive-path-field input { font-size: 11px; }
.archive-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.archive-list-title { margin: 20px 0 8px; font-size: 13px; }
.archive-list { display: grid; gap: 8px; }
.archive-item { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255,255,255,.03); }
.archive-item strong, .archive-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-item span { color: var(--text-dim); font-size: 11px; margin-top: 3px; }
.archive-item button { margin-top: 8px; }
.chronology-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chronology-actions { display: flex; align-items: center; gap: 6px; }
.chronology-refresh-btn { margin: 0; }
.chronology-refresh-btn svg { width: 16px; height: 16px; }
.chronology-refresh-btn.is-loading svg { animation: chronology-spin .75s linear infinite; }
@keyframes chronology-spin { to { transform: rotate(360deg); } }
.chronology-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.chronology-filters label { display: grid; gap: 4px; font-size: 10px; color: var(--text-dim); }
.chronology-filters .field { width: 100%; }
.chronology-search { grid-column: span 2; }
.chronology-list { display: grid; gap: 8px; max-height: min(58vh, 620px); overflow-y: auto; overflow-x: hidden; padding-right: 7px; overscroll-behavior: contain; scrollbar-gutter: stable; }
.chronology-day { margin: 12px 0 0; font-size: 12px; color: var(--text-dim); }
.chronology-event { display: grid; grid-template-columns: 44px 72px minmax(0, 1fr); gap: 8px; padding: 9px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255,255,255,.03); font-size: 11px; }
.chronology-event time, .chronology-event-type { color: var(--text-dim); }
.chronology-event strong, .chronology-event span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chronology-event span { margin-top: 3px; color: var(--text-dim); }
.security-settings-view { overflow: auto; }
.security-status { margin: 10px 0; padding: 9px; border: 1px solid #39715a; border-radius: 7px; background: rgba(33, 104, 67, .16); font-size: 11px; }
.security-status.is-warning { border-color: #9b7430; background: rgba(128, 96, 28, .16); color: #f4d89c; }
.security-policy-status { padding: 9px; border: 1px solid #35618c; border-radius: 7px; background: rgba(33, 82, 132, .16); color: var(--text-dim); font-size: 11px; line-height: 1.45; }
.security-policy-status.is-strict { border-color: #9b7430; background: rgba(128, 96, 28, .16); color: #f4d89c; }
.security-settings-list { padding-bottom: 16px; }
.security-workspace { display: grid; gap: 7px; padding: 10px 0; border-top: 1px solid var(--border); }
.security-workspace > span { overflow-wrap: anywhere; }
.security-trusted-list, .security-audit-list { display: grid; gap: 6px; max-height: 170px; overflow: auto; padding-right: 5px; }
.security-trusted-list > span { overflow-wrap: anywhere; font: 11px var(--font-code, monospace); color: var(--text-dim); }
.security-audit-list article { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; padding: 7px; border: 1px solid var(--border); border-radius: 6px; font-size: 10px; line-height: 1.4; }
.security-audit-list time, .security-audit-list span { color: var(--text-dim); }
.security-audit-list span { grid-column: 1 / -1; overflow-wrap: anywhere; }
.network-settings-view { overflow: auto; }
.network-settings-list { padding-bottom: 18px; }
.updates-settings-view { overflow: auto; }
.updates-info { display: grid; gap: 8px; margin: 2px 0; }
.updates-info > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.updates-info dt { color: var(--text-dim); }
.updates-info dd { margin: 0; color: var(--text, #e5e7eb); font-family: var(--font-code, monospace); overflow-wrap: anywhere; text-align: right; }
.updates-status { min-height: 18px; margin: 2px 0; padding: 9px; border: 1px solid #35618c; border-radius: 7px; background: rgba(33, 82, 132, .16); color: var(--text-dim); font-size: 11px; line-height: 1.45; }
.updates-status.is-warning { border-color: #9b7430; background: rgba(128, 96, 28, .16); color: #f4d89c; }
.settings-subtitle { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); color: #c9d8ed; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.settings-subtitle:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.network-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.network-status { min-height: 18px; padding: 9px; border: 1px solid #35618c; border-radius: 7px; background: rgba(33, 82, 132, .16); color: var(--text-dim); font-size: 11px; line-height: 1.45; }
.network-status.is-error { border-color: #9b443d; background: rgba(128, 47, 36, .16); color: #f6bbb5; }
.copyright-settings-view { overflow: auto; }
.copyright-settings-list { padding-bottom: 18px; }
.copyright-settings-list .copyright-wide-field { display: block; }
.copyright-settings-list .copyright-email-field { display: grid; gap: 6px; }
.copyright-settings-list .copyright-wide-field .field,
.copyright-settings-list .copyright-email-field .field { width: 100%; min-width: 0; box-sizing: border-box; }
.copyright-esign-note { margin: 0; color: var(--text-dim); font-size: 11px; line-height: 1.45; }
.settings-tool-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.settings-tool-card {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    min-height: 82px;
    padding: 14px;
    overflow: hidden;
    color: #fafafa;
    text-align: left;
    border: 1px solid #393b40;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .13), transparent 30%),
        linear-gradient(160deg, #202126 0%, #09090b 45%, #020203 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .15),
        inset 0 -1px 0 rgba(0, 0, 0, .75),
        0 8px 18px rgba(0, 0, 0, .32);
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.settings-tool-card::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: -30% 28% auto -25%;
    height: 100%;
    pointer-events: none;
    opacity: .55;
    background: radial-gradient(ellipse, rgba(154, 198, 255, .2), transparent 68%);
    transition: opacity .18s ease, transform .18s ease;
}
.settings-tool-card:hover,
.settings-tool-card:focus-visible {
    border-color: #7f9ed1;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .18), transparent 32%),
        linear-gradient(160deg, #292b31 0%, #0d0e12 48%, #030304 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .22),
        inset 0 -1px 0 rgba(0, 0, 0, .75),
        0 0 0 1px rgba(125, 172, 255, .14),
        0 12px 28px rgba(0, 0, 0, .48),
        0 0 24px rgba(85, 142, 255, .18);
}
.settings-tool-card:hover::before,
.settings-tool-card:focus-visible::before { opacity: 1; transform: translate(10%, 8%); }
.settings-tool-card:focus-visible { outline: 2px solid #9ec5ff; outline-offset: 2px; }
.settings-tool-card strong { font-size: 13px; font-weight: 750; letter-spacing: .01em; }
.settings-tool-card span { color: #a7a9b0; font-size: 10px; }
.capture-settings { display: grid; gap: 12px; padding: 14px; align-content: start; }
.capture-settings h3, .capture-settings p { margin: 0; }
.capture-settings .settings-field { display: grid; gap: 6px; }
.capture-settings .field { width: 100%; }
.capture-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gantt-kanban-settings {
    display: grid;
    gap: 12px;
}
.gantt-kanban-settings[hidden] { display: none; }
.gantt-kanban-settings__status.is-error { border-color: #b95353; color: #ffb4b4; }
.gantt-kanban-settings__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gantt-kanban-settings__head h3 { margin: 0; color: #eaf3ff; font-size: 14px; }
.gantt-kanban-settings__head p,
.gantt-kanban-settings__notice,
.gantt-kanban-settings__wip > p,
.gantt-kanban-settings__hint { margin: 5px 0 0; color: var(--text-dim); font-size: 11px; line-height: 1.45; }
.gantt-kanban-settings__scope {
    flex: none;
    padding: 3px 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    font-size: 10px;
    white-space: nowrap;
}
.gantt-kanban-settings__notice {
    margin: 0;
    padding: 8px 9px;
    border-left: 2px solid var(--border);
    border-radius: 4px;
    background: rgba(255, 255, 255, .03);
    color: var(--text-dim);
}
.gantt-kanban-settings__form { display: grid; gap: 9px; padding-top: 12px; }
.editor-settings-list .gantt-kanban-settings__field,
.gantt-kanban-settings__field { min-height: 34px; }
.gantt-kanban-settings__field .field { width: 164px; }
.gantt-kanban-settings__color {
    box-sizing: border-box;
    width: 164px;
    height: 32px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input, #141a22);
    cursor: pointer;
}
.gantt-kanban-settings__wip {
    display: grid;
    gap: 8px;
    margin: 3px 0 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.gantt-kanban-settings__wip legend { padding: 0 5px; color: #dbeafe; font-size: 12px; font-weight: 700; }
.gantt-kanban-settings__wip > p { margin: -2px 0 2px; }
.gantt-kanban-settings__hint { margin: 0; }
.gantt-kanban-settings__actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 3px; }
.gantt-kanban-settings__status {
    min-height: 18px;
    padding: 8px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: rgba(255, 255, 255, .03);
    color: var(--text-dim);
    font-size: 11px;
    line-height: 1.4;
}
@media (max-width: 360px) {
    .gantt-kanban-settings__head { flex-direction: column; }
    .gantt-kanban-settings__field { align-items: flex-start !important; flex-direction: column; }
    .gantt-kanban-settings__field .field,
    .gantt-kanban-settings__color { width: 100%; }
}
.recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: min(42vh, 360px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    pointer-events: auto;
}
.recent-list li {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 82px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid #393b40;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .13), transparent 30%),
        linear-gradient(160deg, #202126 0%, #09090b 45%, #020203 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .15),
        inset 0 -1px 0 rgba(0, 0, 0, .75),
        0 8px 18px rgba(0, 0, 0, .32);
    cursor: pointer;
    font-size: 12px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.recent-list li::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: -30% 28% auto -25%;
    height: 100%;
    background: radial-gradient(ellipse, rgba(154, 198, 255, .2), transparent 68%);
    opacity: .55;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.recent-list li:hover,
.recent-list li:focus-within {
    border-color: #7f9ed1;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .18), transparent 32%),
        linear-gradient(160deg, #292b31 0%, #0d0e12 48%, #030304 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .22),
        inset 0 -1px 0 rgba(0, 0, 0, .75),
        0 0 0 1px rgba(125, 172, 255, .14),
        0 12px 28px rgba(0, 0, 0, .48),
        0 0 24px rgba(85, 142, 255, .18);
}
.recent-list li:hover::before,
.recent-list li:focus-within::before { opacity: 1; transform: translate(10%, 8%); }
.recent-list li.archived { opacity: 0.58; filter: saturate(.45); }
.recent-list .archive-signal { color: #ffce7a; font-size: 10px; font-weight: 800; letter-spacing: .07em; }
.recent-list li.unavailable { opacity: .72; }
.recent-list .recent-main {
    min-width: 0;
    flex: 1;
}
.recent-list .recent-main strong {
    display: block;
    overflow: hidden;
    color: #fafafa;
    font-size: 13px;
    font-weight: 750;
    letter-spacing: .01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recent-list .recent-path {
    margin-top: 6px;
    font-size: 10px;
    color: #a7a9b0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recent-list .recent-state {
    margin-top: 4px;
    color: #f5c36a;
    font-size: 10px;
}
.recent-list .recent-actions {
    position: relative;
    align-self: stretch;
    flex-shrink: 0;
    padding-top: 10px;
}
.recent-list .recent-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font: 18px/16px Arial, sans-serif;
    cursor: pointer;
    opacity: .82;
    z-index: 2;
}
.recent-list .recent-actions .archive-signal,
.recent-list .recent-actions .recent-archive-btn { display: inline-block; margin-top: 8px; }
.recent-list .recent-remove-btn:hover,
.recent-list .recent-remove-btn:focus-visible { opacity: 1; background: rgba(255, 255, 255, .14); }
.recent-list .recent-archive-btn {
    font-size: 11px;
    padding: 2px 8px;
    border-color: #535762;
    background: rgba(255, 255, 255, .06);
}
.recent-list .recent-archive-btn:focus-visible {
    outline: 2px solid #9ec5ff;
    outline-offset: 2px;
}
@media (max-width: 580px) {
    .recent-list, .settings-tool-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .recent-list li,
    .recent-list li::before,
    .settings-tool-card,
    .settings-tool-card::before { transition: none; }
}

.right-panel {
    width: var(--right-panel-width);
    min-width: 260px;
    max-width: 640px;
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: relative;
    flex-shrink: 0;
}
.right-panel.collapsed { display: none; }

.project-settings-section {
    display: grid;
    gap: 10px;
    padding: 14px;
}
.project-settings-section h3 {
    margin: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
/* Карта Monaco остаётся читаемой, но не утяжеляет тёмный редактор. */
#monacoContainer .minimap { opacity: .58; }
.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.p-tab {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    font-size: 11px;
    cursor: pointer;
    color: var(--text-dim);
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.p-tab.active {
    color: var(--text-main);
    border-bottom-color: var(--text-main);
    background: var(--bg-active);
}
.panel-content {
    flex: 1;
    overflow: hidden;
    display: none;
    flex-direction: column;
    min-height: 0;
}
.panel-content.active { display: flex; }

.foma-route-bar.is-clickable {
    cursor: pointer;
    user-select: none;
}
.foma-route-bar.is-clickable:hover {
    background: linear-gradient(90deg, #1a2230, #141a24);
}
.foma-route-bar.is-auto .foma-route-value { color: #a3e635; }
.foma-route-bar.is-pinned .foma-route-value { color: #7dd3fc; }

.foma-model-menu[hidden] { display: none !important; }
.foma-model-menu {
    position: fixed;
    z-index: 12000;
    max-height: min(320px, 45vh);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #121820;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.foma-model-menu-hd {
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}
.foma-model-menu-list {
    overflow-y: auto;
    padding: 4px;
    max-height: 280px;
}
.foma-model-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 12px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.foma-model-item:hover { background: rgba(255, 255, 255, 0.06); }
.foma-model-item.is-selected { background: rgba(90, 168, 255, 0.18); color: #7dd3fc; }
.foma-model-item.is-auto { font-weight: 700; color: #a3e635; }
.foma-model-empty { padding: 8px 10px; margin: 0; }

#statusFoma {
    max-width: min(58vw, 720px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.foma-route-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, #141a24, #0f141c);
    font-size: 11px;
    line-height: 1.3;
    min-height: 28px;
}
.foma-route-label {
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
}
.foma-route-value {
    color: var(--text-main);
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.foma-route-bar.is-paid .foma-route-value { color: #7dd3fc; }
.foma-route-bar.is-error .foma-route-value { color: #f87171; }
.foma-route-bar.is-cache .foma-route-value { color: #a3e635; }
.foma-route-bar.is-thinking {
    border-color: rgba(251, 191, 36, 0.55);
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.15);
}
.foma-route-bar.is-thinking .foma-route-value {
    color: #fbbf24;
    animation: fomaPulseText 1.2s ease-in-out infinite;
}
.foma-route-bar.is-thinking::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
    flex-shrink: 0;
    animation: fomaBlink 0.9s ease-in-out infinite;
}
@keyframes fomaBlink {
    0%, 100% { opacity: 0.25; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}
@keyframes fomaPulseText {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

.chat-msg.is-thinking .chat-avatar.max {
    animation: fomaAvatarSpin 2.4s linear infinite;
    border-color: #fbbf24;
    color: #fbbf24;
}
.chat-msg.is-thinking .chat-bubble {
    border-color: rgba(251, 191, 36, 0.45);
    background: linear-gradient(90deg, #141820 0%, #1e2a3a 40%, #141820 80%);
    background-size: 200% 100%;
    animation: fomaShimmer 1.6s linear infinite;
    min-height: 2.2em;
}
@keyframes fomaAvatarSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes fomaShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
.foma-think-line {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.foma-think-main {
    color: #fbbf24;
    font-weight: 600;
}
.foma-think-sub {
    color: var(--text-dim);
    font-size: 11px;
}
.foma-think-bar {
    height: 3px;
    border-radius: var(--radius-pill);
    background: #1a2030;
    overflow: hidden;
    margin-top: 6px;
}
.foma-think-bar > i {
    display: block;
    height: 100%;
    width: 35%;
    background: linear-gradient(90deg, transparent, #fbbf24, transparent);
    animation: fomaBarRun 1.1s ease-in-out infinite;
}
@keyframes fomaBarRun {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}
#statusFoma.foma-busy {
    color: #ca8a04;
    min-width: 160px;
    max-width: 420px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: none;
}
.status-item.status-foma {
    min-width: 140px;
    max-width: 480px;
    flex: 1 1 auto;
    text-align: right;
    color: #a16207;
    font-weight: 600;
}
.status-item.status-metrics {
    color: inherit;
    opacity: 0.85;
    font-size: 11px;
    max-width: min(720px, 55vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}
.status-tok-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    padding: 0 2px;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}
.status-tok-btn:hover {
    opacity: 1;
    text-decoration-style: solid;
}
.status-tok-sum {
    font-weight: 800;
}
.token-rate-menu {
    position: fixed;
    z-index: 4000;
    width: 220px;
    padding: 10px 12px;
    background: #111827;
    color: #f1f5f9;
    border: 1px solid #334155;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    font-size: 12px;
    font-weight: 500;
}
.token-rate-title {
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.token-rate-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    color: #cbd5e1;
}
.token-rate-input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #475569;
    background: #0b1220;
    color: #f8fafc;
    font-family: var(--font-code, Consolas, monospace);
    font-size: 13px;
}
.token-rate-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.token-rate-hint {
    margin: 0;
    font-size: 10px;
    color: #94a3b8;
    line-height: 1.35;
}

.project-metrics-detail {
    padding: 12px;
    overflow: auto;
}
.metrics-section + .metrics-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.metrics-section h3 {
    margin: 0 0 8px;
    font-size: 13px;
}
.metrics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
    margin: 0;
    font-size: 12px;
}
.metrics-grid dt { color: var(--text-muted); }
.metrics-grid dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.metric-chart-card { min-width: 0; }
.metric-chart-caption { margin-bottom: 7px; }
.metrics-month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 16px 0 4px;
}
.metrics-month-button {
    width: 28px;
    min-width: 28px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}
.metrics-month-label {
    min-width: 152px;
    text-align: center;
    text-transform: capitalize;
    font-size: 12px;
}
.metric-chart-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.metric-chart-legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.metric-chart-empty { padding: 10px 0; }
.metric-chart-svg {
    display: block;
    width: 100%;
    height: auto;
    background: #0b1220;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.metric-chart-day-grid { stroke: #243142; stroke-width: 1; }
.metric-chart-day-grid.is-today { stroke: #ef4444; stroke-width: 1.5; }
.status-item.status-problems {
    cursor: pointer;
    color: #ff4d4d;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.status-item.status-components {
    cursor: pointer;
}
.status-item.status-components.warn {
    color: #fbbf24;
}
.status-item.status-components.is-ready { color: #86efac; }
.status-item.status-components.is-installing {
    color: #86efac;
}
.status-item.status-components.is-error { color: #f87171; }
.components-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 420px;
    overflow: auto;
}
.comp-progress-panel {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-active, rgba(255,255,255,0.03));
}
.comp-progress-message {
    margin-bottom: 10px;
    color: var(--text-main);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.comp-progress-message.is-done { color: #86efac; }
.comp-progress-message.is-error { color: #f87171; }
.comp-prog-row {
    margin-bottom: 10px;
}
.comp-prog-row:last-of-type { margin-bottom: 4px; }
.comp-prog-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 4px;
    color: var(--text-main);
}
.comp-prog-track {
    height: 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}
.comp-prog-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    background: linear-gradient(90deg, #38bdf8, #22c55e);
    transition: width 0.25s ease, background 0.2s ease;
}
.comp-prog-fill.indeterminate {
    width: 18% !important;
    animation: compProgSlide 1.8s ease-in-out infinite;
}
.comp-prog-row.is-error .comp-prog-track {
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.55);
}
.comp-prog-row.is-error .comp-prog-fill {
    background: #ef4444;
    animation: none;
}
.comp-prog-row.is-error .comp-prog-label {
    color: #f87171;
}
@keyframes compProgSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(520%); }
}
.comp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 6px;
    border-bottom: 1px solid var(--border);
}
.comp-main {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: 0;
    flex: 1;
}
.comp-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.comp-badge.ok { color: #86efac; border-color: rgba(134, 239, 172, 0.45); }
.comp-badge.miss { color: var(--text-dim); }
.comp-label { font-size: 12px; font-weight: 600; }
.comp-ver { word-break: break-all; }
a.comp-dl {
    display: inline-block;
    margin-top: 2px;
    color: #7dd3fc;
    text-decoration: underline;
    cursor: pointer;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.status-item.status-problems {
    user-select: none;
    border-radius: 3px;
    padding: 0 6px;
    border: 1px solid transparent;
}
.status-item.status-problems.is-warn {
    color: #f0c040;
}
.status-item.status-problems:hover {
    border-color: currentColor;
    background: rgba(255, 77, 77, 0.12);
}
.status-item.status-problems.is-warn:hover {
    background: rgba(240, 192, 64, 0.12);
}
.status-item.status-problems.error-hl-on {
    border-color: currentColor;
    background: rgba(255, 77, 77, 0.22);
    box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.35);
}
.foma-route-bar.is-thinking {
    animation: none !important;
}
.foma-route-bar.is-thinking .foma-route-value {
    color: var(--text-dim, #94a3b8) !important;
    animation: none !important;
}
.foma-route-bar.is-thinking::before {
    display: none !important;
}

.chat-container {
    flex: 1;
    min-height: 0;
    padding: 12px 12px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    user-select: text;
    scroll-behavior: auto;
    /* «воздух» снизу — последнее сообщение не прилипает к кромке и не теряется */
    padding-bottom: 28px;
    scroll-padding-bottom: 28px;
}
.chat-container::after {
    content: '';
    display: block;
    flex: 0 0 12px;
    height: 12px;
    min-height: 12px;
    pointer-events: none;
}
.chat-msg { display: flex; gap: 10px; }
.chat-avatar {
    width: 28px;
    height: 28px;
    background: var(--bg-active);
    border: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 9px;
    flex-shrink: 0;
}
.chat-avatar.user {
    width: auto;
    min-width: 56px;
    height: 28px;
    padding: 0 7px;
    background: var(--text-main);
    color: var(--bg-app);
    border: none;
    font-size: 8px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.chat-avatar.max {
    letter-spacing: 0.02em;
}
.chat-body { flex: 1; min-width: 0; }
.chat-bubble {
    background: var(--bg-active);
    padding: 10px 12px;
    border: 1px solid var(--border);
    line-height: 1.45;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    border-radius: var(--radius-lg);
}
.chat-msg-tools {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.chat-msg:hover .chat-msg-tools,
.chat-msg:focus-within .chat-msg-tools {
    opacity: 1;
}
.chat-tool-btn {
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    font-size: 11px;
    line-height: 1;
}
.chat-tool-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.chat-meta {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 4px;
}
.chat-input-area {
    padding: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.chat-input-area--bottom {
    border-top: none;
    flex: 1;
    height: auto;
    min-height: 0;
    overflow: hidden;
    padding: 6px 10px 0;
    box-sizing: border-box;
}
.chat-input-area--bottom .chat-tools {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    overflow: hidden;
}
.chat-tools .check,
.chat-tools .check-mode {
    width: auto;
    min-width: 0;
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.foma-plan-act-switch {
    flex: 0 0 auto;
    min-width: 42px;
    padding: 3px 6px;
    color: #d9f7e2;
    border: 1px solid #39715a;
    border-radius: 999px;
    background: rgba(33, 104, 67, .2);
    font: 700 10px var(--font-ui);
    letter-spacing: .04em;
    cursor: pointer;
}
.foma-plan-act-switch[aria-checked="true"] {
    color: #f4d89c;
    border-color: #9b7430;
    background: rgba(128, 96, 28, .22);
}
.foma-plan-act-switch:hover { filter: brightness(1.15); }
.foma-plan-act-switch:focus-visible {
    outline: 2px solid var(--accent, #5b8def);
    outline-offset: 2px;
}
.foma-mode-clear-controls {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    min-width: 0;
    white-space: nowrap;
}
.foma-mode-clear-controls .check-mode { flex: 0 0 auto; }
.foma-model-picker {
    flex: 1 1 auto !important;
    max-width: min(360px, 38vw);
}
.foma-model-picker select {
    width: clamp(72px, 16vw, 300px);
    min-width: 72px;
    max-width: 300px;
    color: var(--text-main);
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: 12px var(--font-ui);
    padding: 4px 8px;
}
.chat-tools .check-mode select {
    color: var(--text-main);
    background: var(--bg-app);
}
/* На средней ширине вся панель управления чатом остаётся одной строкой:
   модель ужимается первой, а режим, очистка и согласования не переносятся. */
.chat-tools .foma-model-picker select,
.chat-tools .foma-plan-act-switch,
.chat-tools .foma-clear-btn,
.chat-tools .foma-approval-controls,
.chat-tools .foma-approval-btn,
.chat-tools .foma-auto-btn {
    flex-shrink: 0;
}
.chat-tools .foma-model-picker {
    min-width: 0;
}
.chat-tools .foma-model-picker select {
    flex-shrink: 1;
}
.chat-input-area--bottom .chat-input {
    height: var(--chat-input-height);
    min-height: 56px;
    max-height: 100%;
    flex: none;
    resize: none;
    padding-right: 28px;
    border: none !important;
    box-sizing: border-box;
    outline: none;
}
.chat-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: stretch;
    margin-bottom: 1px;
    border: 1px solid var(--border);
    box-sizing: border-box;
    background: var(--bg-app);
    border-radius: 10px;
    overflow: hidden;
}
.chat-input-wrap:focus-within {
    border-color: var(--text-main);
}
.chat-input-wrap .chat-input {
    width: 100%;
    border: none !important;
    background: transparent;
    border-radius: 10px;
}
.chat-input-wrap .chat-input:focus {
    border: none !important;
    outline: none;
}
.chat-input-resize {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 22px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 11px;
    letter-spacing: -1px;
    color: var(--text-dim);
    cursor: nwse-resize;
    user-select: none;
    z-index: 3;
    border-radius: 3px;
    background: rgba(0,0,0,0.35);
}
.chat-input-resize:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.1);
}
.chat-input-area--bottom .chat-send-row {
    flex: 0 1 auto;
    align-items: stretch;
    min-height: 56px;
    height: var(--chat-input-height);
    padding-bottom: 0;
    margin-bottom: 0;
}
#btab-chat.bottom-content {
    overflow: hidden;
    min-height: 0;
    padding-bottom: 4px;
    box-sizing: border-box;
}
.account-panel {
    padding: 12px 16px;
    overflow: auto;
}
.account-panel__head {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}
.account-panel__head h2 { margin: 0; font: 700 13px var(--font-ui); }
.account-panel__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 10px;
    margin: 12px 0 8px;
}
.account-panel__grid > div { display: grid; gap: 3px; min-width: 0; }
.account-panel__grid strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .account-panel__grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); } }
.agent-trace {
    display: block;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
    font-size: clamp(10px, 0.95vw + 8px, 12px);
    line-height: 1.4;
    padding: 6px 10px;
    margin: 0 0 6px;
    color: #bae6fd;
    background: rgba(14, 116, 144, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-left: 3px solid #38bdf8;
    border-radius: 4px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    /* растёт под текст; скролл только если совсем длинно — не «полполоски» */
    max-height: min(22vh, 160px);
    overflow-x: hidden;
    overflow-y: auto;
}
.agent-trace[hidden] {
    display: none !important;
}
.agent-trace.live {
    animation: agentTracePulse 1.6s ease-in-out infinite;
}
@keyframes agentTracePulse {
    0%, 100% { border-left-color: #38bdf8; opacity: 1; }
    50% { border-left-color: #fbbf24; opacity: 0.92; }
}
/* Да/Нет — стационарно в .chat-tools рядом с режимом; не отдельная полоска */
.order-confirm-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 4px;
}
.order-confirm-inline .btn {
    min-width: 36px;
    height: 26px;
    padding: 0 8px;
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
}
.model-runtime-modes {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-right: 4px;
}
.model-runtime-mode-btn {
    min-width: 0 !important;
    padding: 0 7px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    background: color-mix(in srgb, var(--bg-active) 80%, transparent) !important;
    border-color: var(--border) !important;
    color: var(--text-muted, #94a3b8) !important;
    opacity: 1 !important;
}
.model-runtime-mode-btn.is-on {
    background: color-mix(in srgb, #2563eb 55%, var(--bg-active)) !important;
    border-color: #3b82f6 !important;
    color: #fff !important;
}
.order-confirm-inline:not(.is-active) .btn:not(.order-btn-auto):not(.model-runtime-mode-btn) {
    opacity: 0.45;
}
.order-confirm-inline.is-active .btn:not(.order-btn-auto) {
    opacity: 1;
}
.order-confirm-inline .order-btn-auto {
    opacity: 0.65;
    min-width: 44px;
}
.order-btn-yes {
    background: #16a34a !important;
    border-color: #15803d !important;
    color: #fff !important;
    font-size: 15px !important;
}
.order-btn-no {
    background: #b91c1c !important;
    border-color: #991b1b !important;
    color: #fff !important;
    font-size: 15px !important;
}
.order-confirm-inline .btn:disabled {
    cursor: default;
}
/* Titlebar: Студия | AGENT */
.titlebar-work-mode {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
    flex-shrink: 0;
    -webkit-app-region: no-drag;
}
.tb-mode-btn {
    font: inherit;
    font-size: 11px;
    padding: 2px 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    color: inherit;
    opacity: 0.65;
    cursor: pointer;
    border-radius: 3px;
}
.tb-mode-btn.is-on {
    opacity: 1;
    border-color: rgba(120, 180, 255, 0.55);
    background: rgba(80, 140, 220, 0.22);
}
.order-btn-auto.is-on {
    opacity: 1;
    border-color: rgba(90, 200, 120, 0.7);
    background: rgba(60, 160, 90, 0.35);
    color: #dff8e6;
}
/* живой ход только над приказом — не дублируем пузырём в чате */
.chat-msg[data-live-work="1"] {
    display: none !important;
}

/* (устаревший блок в чате — оставлен на случай старых вставок) */
.foma-proc {
    display: none !important;
}
.foma-proc-node {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 2px 0 2px calc(var(--d, 0) * 10px);
    color: var(--text-main, #e2e8f0);
    border-left: 2px solid transparent;
    animation: fomaProcIn 0.22s ease-out;
    white-space: nowrap;
}
.foma-proc-node.st-run { border-left-color: #38bdf8; }
.foma-proc-node.st-ok { border-left-color: #4ade80; color: #bbf7d0; }
.foma-proc-node.st-stop,
.foma-proc-node.st-err { border-left-color: #f87171; color: #fecaca; }
.foma-proc-ico {
    width: 1.1em;
    flex: none;
    opacity: 0.85;
}
.foma-proc-label { flex: none; }
.foma-proc-path {
    color: #7dd3fc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.foma-proc-empty { padding: 2px 0; }
@keyframes fomaProcIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}
/* Зелёный — правка/запись внутри файла */
.ft-row.ft-foma-new,
.ft-row.ft-foma-write {
    outline: 1px solid rgba(34, 197, 94, 0.75);
    background: rgba(34, 197, 94, 0.14);
}
/* Красный — ошибка / битый / удаление */
.ft-row.ft-foma-del,
.ft-row.ft-foma-err {
    outline: 1px solid rgba(239, 68, 68, 0.85);
    background: rgba(239, 68, 68, 0.18);
}
/* Жёлтый — только чтение/просмотр */
.ft-row.ft-foma-read {
    outline: 1px solid rgba(234, 179, 8, 0.8);
    background: rgba(234, 179, 8, 0.14);
}
/* Стрим агента: активный файл — статичная подсветка (без пульса — не трясёт дерево) */
.ft-row.ft-foma-stream.ft-stream-active {
    outline: 2px solid rgba(90, 168, 255, 0.85);
    background: rgba(90, 168, 255, 0.12);
}

.chat-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
}
.check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-dim);
    cursor: pointer;
}
.chat-send-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.chat-send-row .chat-input { flex: 1; }
.btn-stop-foma {
    align-self: stretch;
    min-width: 52px;
    display: inline-grid;
    place-items: center;
    text-transform: none;
    letter-spacing: 0;
    border-radius: var(--radius-md);
    opacity: 0.45;
}
.btn-stop-foma__icon {
    display: block;
    width: 20px;
    height: 20px;
}
.btn-stop-foma:not(:disabled) {
    opacity: 1;
    border-color: #f66;
    color: #fcc;
    background: rgba(200, 40, 40, 0.18);
}
.p-tab--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-top: 2px;
    padding-bottom: 2px;
}
.p-tab__icon {
    display: block;
    width: 32px;
    height: 32px;
    filter: brightness(0) saturate(100%) invert(53%) sepia(77%) saturate(464%) hue-rotate(91deg) brightness(93%) contrast(88%);
}
.chat-input {
    width: 100%;
    background: var(--bg-app);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px;
    font-family: var(--font-ui);
    resize: none;
    height: 72px;
    font-size: 12px;
    user-select: text;
    border-radius: var(--radius-lg);
}
.chat-input:focus { border-color: var(--text-main); }
.btn.send {
    align-self: stretch;
    min-width: 56px;
    width: 56px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn.send.send-icon {
    background: #f8fafc;
    border: 1px solid var(--border);
    color: #0b1220;
}
.btn.send.send-icon:hover {
    background: #fff;
    border-color: #0b1220;
}
.btn.send .send-plane {
    width: 28px;
    height: 28px;
    fill: #0b1220;
    display: block;
}

.mirror-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    overflow-y: auto;
}
.scrcpy-workbench {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 50% 0, rgba(56, 189, 248, 0.10), transparent 38%), var(--bg-panel);
}
.scrcpy-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}
.scrcpy-header strong { display: block; font-size: 12px; letter-spacing: .035em; }
.scrcpy-header span { display: block; margin-top: 2px; color: var(--text-dim); font-size: 10px; }
.scrcpy-brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, .45);
    border-radius: 10px;
    background: rgba(14, 116, 144, .14);
    box-shadow: inset 0 0 18px rgba(56, 189, 248, .10);
}
.scrcpy-brand-mark svg { width: 23px; height: 23px; }
.scrcpy-workbench .mirror-container { flex: 1 1 auto; min-height: 0; }
.phone-frame {
    width: min(220px, 86%);
    aspect-ratio: 9 / 19.5;
    height: auto;
    min-height: 360px;
    max-height: 52vh;
    border: 8px solid #fff;
    border-radius: 22px;
    background: #000;
    overflow: hidden;
    box-shadow: 0 0 0 1px #333;
    position: relative;
}
.phone-screen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    text-align: center;
}
.device-connection-dot {
    position: absolute;
    z-index: 5;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .82);
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, .8);
}
.device-connection-dot.is-online {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, .85);
}
.phone-screen.mirroring {
    border: none;
    cursor: default;
    touch-action: none;
}
.mirror-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    user-select: none;
    -webkit-user-drag: none;
    cursor: default;
    pointer-events: none;
}
.phone-screen.mirroring .mirror-img {
    pointer-events: auto;
    cursor: default;
}
.phone-empty {
    position: relative;
    z-index: 1;
    padding: 12px;
}
.mirror-nav {
    display: flex;
    gap: 8px;
    width: min(220px, 86%);
}
.mirror-nav .btn { flex: 1; }
.mirror-nav .mirror-screenshot-btn { flex: 1.8; font-size: 9px; }
.scrcpy-hint {
    width: 100%;
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 8px 10px;
    background: var(--bg-app);
}
.scrcpy-hint code {
    font-family: var(--font-code);
    color: var(--text-main);
    font-size: 10px;
}
.phone-glyph { font-size: 28px; margin-bottom: 8px; opacity: 0.5; }
.device-stats { display: flex; gap: 8px; width: 100%; }
.stat-box {
    flex: 1;
    background: var(--bg-app);
    border: 1px solid var(--border);
    padding: 8px;
    text-align: center;
}
.stat-val { font-weight: 700; font-size: 12px; }
.stat-label { font-size: 9px; color: var(--text-dim); margin-top: 2px; text-transform: uppercase; }
.device-section-label {
    width: 100%;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin: 4px 0 0;
}
.device-actions { display: flex; gap: 6px; width: 100%; flex-wrap: wrap; }
.device-actions .btn { flex: 1 1 auto; min-width: 0; }
.device-deploy { margin-top: 0; }
.device-deploy .btn { font-weight: 600; }
.device-list { list-style: none; width: 100%; font-size: 11px; margin: 0; padding: 0; }
.device-list li {
    padding: 7px 8px;
    border: 1px solid var(--border);
    margin-bottom: 4px;
    cursor: pointer;
    color: var(--text-dim);
    border-radius: var(--radius-md);
    line-height: 1.35;
    word-break: break-all;
}
.device-list li:hover, .device-list li.active {
    border-color: #38bdf8;
    color: var(--text-main);
    background: rgba(56, 189, 248, 0.08);
}

.preview-toolbar {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.preview-toolbar #btnPreviewBack,
.preview-toolbar #btnPreviewForward {
    min-width: 28px;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 14px;
    line-height: 1;
}
.preview-toolbar .btn:disabled {
    opacity: 0.35;
}
.preview-url-input {
    flex: 1 1 120px;
    min-width: 80px;
    foma-width: 100%;
    font-size: 11px;
}
.preview-bookmarks {
    flex: 0 1 140px;
    min-width: 100px;
    foma-width: 200px;
    font-size: 11px;
}
/* Оболочка превью: iframe (HTML) + BrowserView поверх (интернет) */
.preview-status {
    flex: 0 0 auto;
    font-size: 11px;
    line-height: 1.3;
    padding: 2px 8px;
    color: var(--muted, #8a93a6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid var(--border, #2a3140);
    min-height: 18px;
}
.preview-status[data-kind="loading"] { color: #c9a227; }
.preview-status[data-kind="error"] { color: #e06c75; }
.preview-status[data-kind="ok"] { color: #7ec699; }
.preview-shell {
    flex: 1 1 auto;
    min-height: 120px;
    position: relative;
    overflow: hidden;
    background: #fff;
    width: 100%;
}
/* Веб-страница — одна нативная Chromium-поверхность BrowserView над этой
 * областью. Хост не формирует второй видимый слой и нужен только как якорь. */
.preview-web-host[hidden] { display: none; }
.preview-web-host:not([hidden]) { visibility: hidden; pointer-events: none; }
.preview-frame,
.preview-web-host {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    border: none;
    background: #fff;
    display: block;
    margin: 0;
    padding: 0;
}
.preview-web-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: #888;
    font-size: 13px;
    background: #f4f5f7;
    user-select: none;
}
.chat-web-result {
    max-width: 100%;
    margin-top: 4px;
    padding: 0;
    border: 0;
    color: var(--accent, #60a5fa);
    background: transparent;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.preview-web-host[hidden],
.preview-frame[hidden] {
    display: none !important;
    pointer-events: none !important;
}
#tab-preview.panel-content.active {
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    flex: 1 1 auto;
    height: auto;
}
#tab-chat.panel-content.active,
#tab-release.panel-content.active {
    overflow: hidden;
}

.bottom-panel {
    height: var(--bottom-panel-height);
    min-height: 0;
    flex: 0 1 var(--bottom-panel-height);
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    /* Тонкий край панели без вытеснения строки ввода. */
    padding-bottom: 6px;
    margin-bottom: 0;
    box-sizing: border-box;
}
.bottom-panel.collapsed {
    height: 30px !important;
    min-height: 30px !important;
    flex-basis: 30px !important;
    overflow: hidden;
}
.bottom-panel.collapsed .bottom-content,
.bottom-panel.collapsed .term-input-row { display: none; }
.bottom-tabs {
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    height: 30px;
    flex-shrink: 0;
}
.b-tab {
    font-size: 11px;
    color: var(--text-dim);
    cursor: pointer;
    text-transform: uppercase;
    font-weight: 700;
    background: none;
    border: none;
    border-radius: 0;
    font: 700 11px var(--font-ui);
    appearance: none;
    height: 100%;
    border-bottom: 2px solid transparent;
}
.b-tab.active { color: var(--text-main); border-bottom-color: var(--text-main); }
.prob-line[draggable="true"] { cursor: grab; }
.prob-line[draggable="true"]:active { cursor: grabbing; }
.prob-line.is-fixed { border-color: rgba(34, 197, 94, .5); background: rgba(34, 197, 94, .12); }
.prob-line.is-fixed strong { color: #22c55e; }
.bottom-actions { margin-left: auto; display: flex; gap: 4px; }
.bottom-content {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}
.bottom-content.active { display: flex; }
.terminal-content {
    flex: 1;
    padding: 8px 12px;
    font-family: var(--font-code);
    font-size: 12px;
    color: var(--text-dim);
    overflow-y: auto;
    background: var(--bg-app);
    user-select: text;
}
.xterm-host {
    flex: 1;
    min-height: 0;
    /* запас снизу вместо rows-1 в JS (rows-1 давал качели ResizeObserver) */
    padding: 4px 6px 22px;
    background: #000;
    overflow: hidden;
    user-select: text;
    position: relative;
}
.xterm-host.term-path-drop {
    outline: 1px dashed #aaa;
    outline-offset: -2px;
}
.xterm-host .xterm,
.xterm-host .xterm * {
    user-select: text;
}
.xterm-host .xterm { height: 100%; width: 100%; }
.xterm-host .xterm-viewport {
    overflow-y: auto !important;
    /* уменьшает артефакты дублей при скролле на Windows */
    background-color: #000 !important;
}
.xterm-host .xterm-screen { background-color: #000; }

.term-ctx {
    position: fixed;
    z-index: 3000;
    min-width: 160px;
    background: #0a0a0a;
    border: 1px solid #333;
    box-shadow: 0 8px 24px #000;
    padding: 4px 0;
}
.term-ctx[hidden] {
    display: none !important;
}
.term-ctx-item {
    padding: 7px 14px;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
}
.term-ctx-item:hover { background: #1a1a1a; }
.term-ctx-sep { height: 1px; background: #333; margin: 4px 0; }
.mirror-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.term-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-top: 1px solid var(--border);
    background: var(--bg-panel);
}
.term-prompt { color: var(--text-main); font-family: var(--font-code); font-weight: 700; }
.term-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-code);
    font-size: 12px;
    user-select: text;
}
.log-line { margin-bottom: 2px; white-space: pre-wrap; word-break: break-all; }
.log-info { color: var(--text-main); }
.log-error { color: #ff6666; }
.log-cmd { color: #fff; font-weight: 700; }
.log-dim { color: var(--text-dim); }
.logcat-V { color: #888; }
.logcat-D { color: #aaa; }
.logcat-I { color: #fff; }
.logcat-W { color: #ddd; }
.logcat-E { color: #f66; }
.logcat-toolbar {
    display: flex;
    gap: 6px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.logcat-side-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    container-type: inline-size;
}
.cluster-project-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    padding: 8px;
    overflow-x: hidden;
    overflow-y: auto;
}
.sidebar-body > .cluster-project-panel:not([hidden]) { height: 100%; overflow-y: scroll; }
.architecture-panel-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 2px 0 6px;
    border-bottom: 1px solid var(--border);
}
.architecture-panel-heading strong { font-size: 12px; }
.architecture-panel-heading .dim { margin-right: auto; }
.architecture-panel-heading .btn { display: inline-flex; align-items: center; gap: 4px; }
.architecture-panel-heading .btn svg { width: 14px; height: 14px; }
.architecture-empty-state { display: grid; gap: 8px; place-items: start; padding: 18px 10px; border: 1px dashed var(--border); background: rgba(17, 24, 35, .55); }
.architecture-empty-state strong { color: var(--text-main); }
.project-graph-axis-toolbar { display: flex; flex: 0 0 auto; align-items: center; gap: 18px; min-height: 32px; padding: 4px 2px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.project-graph-axis-toolbar .project-graph-axis { flex: 1 1 0; min-width: 0; }
.project-graph-axis-toolbar .project-graph-axis input { flex: 1 1 auto; min-width: 80px; width: auto; }
.project-graph-stage { position: relative; display: flex; flex: 0 0 520px; min-height: 520px; max-height: none; overflow: hidden; }
.project-graph-viewport {
    position: relative;
    flex: 1 1 auto;
    min-height: 260px;
    max-height: 100%;
    overflow: auto;
    border: 1px solid var(--border);
    background: #10141b;
}
.project-graph-viewport svg { display: block; min-width: 1400px; min-height: 1400px; cursor: default; touch-action: none; }
.project-graph-viewport svg.is-dragging { cursor: grabbing; }
.project-graph-edge { fill: none; stroke: #58a6ff; stroke-width: 2.2; marker-end: url(#projectGraphArrow); cursor: pointer; opacity: .9; }
.project-graph-edge.resolved { stroke: #58a6ff; }
.project-graph-edge.unresolved { stroke: #f0883e; stroke-dasharray: 4 3; marker-end: none; }
.project-graph-edge.external { stroke: #bc8cff; stroke-dasharray: 2 3; marker-end: none; }
.project-graph-edge.broken { stroke: #ff5d5d; stroke-dasharray: 5 3; marker-end: none; }
.project-graph-edge.highlighted { stroke: #45d483; stroke-width: 3; opacity: 1; }
.project-graph-tree-link { fill: none; stroke: #5e7494; stroke-width: 1.5; opacity: .9; }
.project-graph-node.radial circle { fill: #172235; stroke: #9fc8ff; stroke-width: 2; }
.project-graph-node.radial.selected circle, .project-graph-node.radial.current circle { fill: #263c5d; stroke: var(--accent); stroke-width: 2; }
.project-graph-node.radial.folder-selected circle { fill: #173d29; stroke: #45d483; stroke-width: 2.4; }
.project-graph-node.radial.dead-candidate circle { fill: #050505; stroke: #111; stroke-width: 2.5; }
.project-graph-dead-cross { fill: none; stroke: #f4f4f4; stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.project-graph-node.radial.stale-candidate circle { fill: #3d3310; stroke: #f2c94c; stroke-width: 2.2; }
.project-graph-stale-cross { fill: none; stroke: #ffd84d; stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.project-graph-edge:hover, .project-graph-edge:focus { stroke-width: 2.6; opacity: 1; outline: none; }
.project-graph-arrow { fill: #58a6ff; }
.project-graph-arrow.active { fill: #45d483; }
.project-graph-folder circle { fill: #f2c94c; stroke: #ffe69a; stroke-width: 1.5; }
.project-graph-folder.selected circle, .project-graph-folder:focus circle { fill: #ffd95a; stroke: #fff4bd; stroke-width: 2; }
.project-graph-path, .project-graph-more { fill: #8b949e; font-size: 8px; }
.project-graph-node { cursor: pointer; outline: none; }
.project-graph-node rect { fill: #172235; stroke: #536a89; }
.project-graph-node.selected rect, .project-graph-node:focus rect { fill: #263c5d; stroke: var(--accent); }
.project-graph-node.current rect { stroke: #58a6ff; stroke-width: 2; }
.project-graph-legend { display: flex; flex-wrap: nowrap; width: 100%; min-width: 0; box-sizing: border-box; gap: 3px; min-height: 24px; padding: 6px 0 5px; overflow: visible; white-space: nowrap; color: var(--text-dim); font-size: 8px; }
.project-graph-legend span { display: inline-flex; flex: 1 1 0; min-width: 0; align-items: center; justify-content: center; gap: 2px; }
.project-graph-legend i { display: inline-block; width: 13px; border-top: 2px solid #58a6ff; }
.project-graph-legend i.file { width: 10px; height: 10px; box-sizing: border-box; border: 2px solid #9fc8ff; border-radius: 50%; background: #172235; }
.project-graph-legend i.folder { width: 10px; height: 10px; border: 1px solid #ffe69a; border-radius: 50%; background: #f2c94c; }
.project-graph-legend i.unresolved { border-top-color: #f0883e; border-top-style: dashed; }
.project-graph-legend i.external { border-top-color: #bc8cff; border-top-style: dotted; }
.project-graph-legend i.external-highlighted { border-top-color: #45d483; border-top-style: dotted; }
.project-graph-legend i.broken { border-top-color: #ff5d5d; border-top-style: dashed; }
.project-graph-legend i.dead { width: 10px; height: 10px; border: 0; background: linear-gradient(45deg, transparent 42%, #f4f4f4 43%, #f4f4f4 57%, transparent 58%), linear-gradient(-45deg, transparent 42%, #f4f4f4 43%, #f4f4f4 57%, transparent 58%), #050505; }
.project-graph-legend i.stale { width: 10px; height: 10px; border: 0; background: linear-gradient(45deg, transparent 42%, #ffd84d 43%, #ffd84d 57%, transparent 58%), linear-gradient(-45deg, transparent 42%, #ffd84d 43%, #ffd84d 57%, transparent 58%); }
.project-graph-axis { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: var(--text-dim); }
.project-graph-axis input { width: 62px; }
.project-graph-minimap { position: absolute; z-index: 2; right: 8px; bottom: 8px; width: 86px; height: 54px; margin: 0; padding: 0; cursor: crosshair; border: 1px solid #536a89; background: rgba(16,20,27,.92); }
.project-graph-minimap i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #8b949e; }
.project-graph-minimap-frame { position: absolute; display: block; box-sizing: border-box; border: 1px solid #58a6ff; background: rgba(88,166,255,.14); pointer-events: none; }
.project-graph-line-highlight { background: rgba(88, 166, 255, .24); }
.project-graph-line-highlight-broken { background: rgba(255, 93, 93, .28); }
.project-graph-line-highlight-dead { background: rgba(18, 18, 18, .58); border-left: 3px solid #050505; }
.project-graph-line-highlight-stale { background: rgba(242, 201, 76, .24); border-left: 3px solid #f2c94c; }
.cluster-project-details { display: grid; gap: 4px; }
.project-graph-connections { display: grid; gap: 3px; min-height: 24px; overflow: visible; }
.project-graph-connections:empty { display: none; }
.project-graph-connection { display: flex; min-width: 0; align-items: baseline; gap: 5px; padding: 3px 5px; overflow: hidden; color: var(--text-dim); border: 1px solid rgba(83,106,137,.55); border-radius: 3px; background: rgba(23,34,53,.55); font-size: 10px; text-align: left; cursor: pointer; }
.project-graph-connection:hover, .project-graph-connection:focus { color: var(--text-main); border-color: #58a6ff; outline: none; }
.project-graph-connection--dismiss { color: #8df0b2; border-color: rgba(69,212,131,.7); }
.project-graph-connection__direction { flex: 0 0 auto; color: #b8d7ff; font-weight: 800; }
.project-graph-connection__path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.architecture-documents-list { display: grid; flex: 1 1 auto; min-height: 0; gap: 12px; overflow: auto; padding: 8px; }
.architecture-documents-list.is-refreshing { cursor: progress; }
.architecture-documents-list.is-refreshing > :not(.architecture-loading) { pointer-events: none; }
.architecture-document-group { display: grid; gap: 7px; }
.architecture-document-group h3 { display: flex; justify-content: space-between; margin: 0; color: var(--text-dim); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.architecture-document-group h3 span { color: var(--text-main); }
.architecture-document-card {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
    min-height: 152px;
    padding: 14px;
    overflow: hidden;
    color: #fafafa;
    border: 1px solid #393b40;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .13), transparent 30%),
        linear-gradient(160deg, #202126 0%, #09090b 45%, #020203 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .15),
        inset 0 -1px 0 rgba(0, 0, 0, .75),
        0 8px 18px rgba(0, 0, 0, .32);
}
.architecture-document-card::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: -30% 28% auto -25%;
    height: 100%;
    pointer-events: none;
    opacity: .55;
    background: radial-gradient(ellipse, rgba(154, 198, 255, .2), transparent 68%);
}
.devbook-panel { gap: 12px; }
.devbook-list {
    display: grid;
    flex: 1 1 auto;
    align-content: start;
    gap: 10px;
    min-height: 0;
}
.devbook-list[hidden],
.devbook-workbench[hidden] {
    display: none !important;
}
.devbook-card {
    --devbook-accent: #75b7ff;
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 112px;
    padding: 14px 14px 28px;
    overflow: hidden;
    color: #fafafa;
    border: 1px solid #393b40;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, color-mix(in srgb, var(--devbook-accent) 16%, transparent), transparent 42%), linear-gradient(160deg, #202126 0%, #09090b 48%, #020203 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), inset 0 -1px 0 rgba(0, 0, 0, .75), 0 8px 18px rgba(0, 0, 0, .32);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.devbook-card::before { content: ''; position: absolute; z-index: -1; inset: -45% auto auto -20%; width: 72%; height: 150%; pointer-events: none; opacity: .65; background: radial-gradient(ellipse, color-mix(in srgb, var(--devbook-accent) 34%, transparent), transparent 68%); }
.devbook-card:hover { transform: translateY(-2px); border-color: var(--devbook-accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 12px 24px rgba(0, 0, 0, .42); }
.devbook-card--management { --devbook-accent: #a78bfa; }
.devbook-card--investment { --devbook-accent: #f5b94c; }
.devbook-card--legal { --devbook-accent: #5fdaa0; }
.devbook-card--full { --devbook-accent: #ef81c0; }
.devbook-card__number { align-self: start; color: var(--devbook-accent); font: 800 10px/1 var(--font-code); letter-spacing: .08em; }
.devbook-card__icon { display: grid; width: 34px; height: 34px; place-items: center; color: var(--devbook-accent); border: 1px solid color-mix(in srgb, var(--devbook-accent) 55%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--devbook-accent) 12%, transparent); }
.devbook-card__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.devbook-card h3 { margin: 0 0 5px; color: #fafafa; font-size: 13px; line-height: 1.25; }
.devbook-card p { margin: 0; color: #a7a9b0; font-size: 11px; line-height: 1.45; }
.devbook-workbench { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; gap: 10px; overflow: auto; padding: 1px; }
.devbook-workbench__heading { display: flex; align-items: flex-start; gap: 8px; }
.devbook-workbench__heading strong, .devbook-workbench__heading .tiny { display: block; }
.devbook-tabs { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 2px; border-bottom: 1px solid var(--border); }
.devbook-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 7px 8px; color: var(--text-dim); background: transparent; font-size: 11px; white-space: nowrap; cursor: pointer; }
.devbook-tabs button.active { color: #fff; border-bottom-color: var(--accent); }
.devbook-tab-content { display: grid; gap: 10px; align-content: start; }
.devbook-settings-grid { display: grid; gap: 8px; }
.devbook-settings-card { display: grid; gap: 9px; padding: 10px; border: 1px solid rgba(148, 163, 184, .2); border-radius: var(--radius-md); background: rgba(12, 14, 18, .52); }
.devbook-settings-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 7px; border-bottom: 1px solid rgba(148, 163, 184, .14); }
.devbook-settings-card__head strong { color: #f1f5f9; font-size: 11px; }
.devbook-settings-card__head span { color: var(--text-dim); font-size: 9px; text-align: right; }
.devbook-real-preview { display: grid; grid-template-columns: minmax(118px, .72fr) minmax(0, 1.28fr); min-height: 154px; overflow: hidden; border: 1px solid #3d4149; border-radius: var(--radius-md); background: #111216; box-shadow: 0 10px 22px rgba(0, 0, 0, .28); }
.devbook-real-preview__cover { display: flex; flex-direction: column; gap: 9px; padding: 14px 12px; color: #f4f7fb; background: linear-gradient(145deg, #184b50, #0b252c 70%, #091116); border-right: 5px solid #5ad2c3; }
.devbook-real-preview__eyebrow { color: #8be9dc; font: 700 8px/1 var(--font-code); letter-spacing: .08em; }
.devbook-real-preview__cover strong { font-size: 16px; line-height: 1.05; overflow-wrap: anywhere; }
.devbook-real-preview__cover span:not(.devbook-real-preview__eyebrow) { color: #b7d5d3; font-size: 10px; line-height: 1.35; }
.devbook-real-preview__cover i { margin-top: auto; color: #8be9dc; font: 800 10px/1 var(--font-code); font-style: normal; }
.devbook-real-preview__pages { display: grid; align-content: start; gap: 12px; padding: 14px; background: linear-gradient(180deg, #f5f7f8, #cbd1d4); color: #1b252b; }
.devbook-real-preview__page-head { display: flex; justify-content: space-between; gap: 8px; font: 800 11px/1.2 var(--font-code); }
.devbook-real-preview__page-head b { color: #267d78; font-size: 9px; text-align: right; }
.devbook-real-preview__lines { display: grid; gap: 5px; }
.devbook-real-preview__lines span { display: block; height: 3px; border-radius: 2px; background: #8f9ca1; }
.devbook-real-preview__lines span:nth-child(2) { width: 78%; }.devbook-real-preview__lines span:nth-child(3) { width: 91%; }.devbook-real-preview__lines span:nth-child(4) { width: 62%; }
.devbook-real-preview__chapters { display: grid; gap: 4px; color: #31545a; font: 700 9px/1.2 var(--font-code); }
.devbook-real-preview__pages small { margin-top: auto; color: #52666b; font-size: 9px; }
.devbook-form { display: grid; gap: 8px; }
.devbook-form label { display: grid; gap: 4px; color: var(--text-dim); font-size: 11px; }
.devbook-form .field { width: 100%; }
.devbook-fact-grid { display: grid; gap: 4px 8px; grid-template-columns: minmax(80px, auto) minmax(0, 1fr); font-size: 10px; color: var(--text-dim); }
.devbook-fact-grid code, .devbook-export-path { overflow-wrap: anywhere; color: #cbd5e1; font-size: 10px; }
.devbook-source-list, .devbook-section-list { display: grid; gap: 6px; }
.devbook-source-list > div, .devbook-section-list label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 8px; padding: 8px; border: 1px solid rgba(148, 163, 184, .18); border-radius: 7px; color: #d7dbe2; font-size: 11px; }
.devbook-source-list b { color: #7dd3fc; }
.devbook-source-list small, .devbook-section-list small { grid-column: 2; color: var(--text-dim); font-size: 10px; }
.devbook-section-list label { cursor: pointer; }
.devbook-section-list input { margin: 1px 0 0; }
.devbook-export-path { padding: 8px; border: 1px solid rgba(148, 163, 184, .18); border-radius: 7px; background: rgba(0, 0, 0, .18); }
.devbook-export-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.devbook-card__research-progress { grid-column: 1 / -1; width: 100%; align-self: start; }
.devbook-research-progress { display: grid; gap: 4px; width: 100%; }
.devbook-research-progress__label { color: #d7dbe2; font-size: 10px; line-height: 1.2; }
.devbook-research-progress__track { height: 7px; overflow: hidden; border-radius: 4px; background: #454a55; }
.devbook-research-progress__fill { height: 100%; background: var(--devbook-accent, #75b7ff); transition: width .2s ease; }
.devbook-card__progress { position: absolute; right: 12px; bottom: 9px; left: 14px; color: var(--text-dim); font-size: 10px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.devbook-card__progress[data-phase="working"] { color: var(--devbook-accent); }
.devbook-card__progress[data-phase="done"] { color: #86efac; }
.devbook-card__progress[data-phase="error"] { color: #fca5a5; }
.devbook-preview { max-height: 360px; overflow: auto; margin: 0; padding: 10px; border: 1px solid rgba(148, 163, 184, .18); border-radius: 7px; background: rgba(0, 0, 0, .22); color: #d7dbe2; white-space: pre-wrap; font: 10px/1.45 Consolas, monospace; }
.architecture-document-main { display: flex; align-items: flex-start; gap: 8px; min-width: 0; grid-column: 1 / -1; }
.architecture-document-main strong { min-width: 0; color: #fafafa; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.architecture-document-status { border-radius: 10px; padding: 2px 6px; font-size: 9px; font-weight: 800; white-space: nowrap; background: rgba(148, 163, 184, .18); color: #cbd5e1; }
.architecture-document-status.status-approved { background: rgba(34, 197, 94, .18); color: #86efac; }
.architecture-document-status.status-proposal_ready { background: rgba(59, 130, 246, .18); color: #93c5fd; }
.architecture-document-status.status-outdated, .architecture-document-status.status-needs_user_input { background: rgba(245, 158, 11, .18); color: #fcd34d; }
.architecture-document-card .dim { grid-column: 1; overflow-wrap: anywhere; color: #a7a9b0; }
.architecture-document-actions, .architecture-document-workflow { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 5px; grid-column: 1 / -1; }
.architecture-document-workflow { grid-column: 1 / -1; justify-content: flex-start; min-height: 31px; border-top: 1px solid rgba(148, 163, 184, .16); padding-top: 7px; }
.architecture-foma-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; min-width: 30px; padding: 5px; }
.architecture-foma-btn img { width: 16px; height: 16px; filter: grayscale(1) brightness(0) invert(1); }
.logcat-side-toolbar, .logcat-side-filters, .logcat-side-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    border-bottom: 1px solid var(--border);
}
.logcat-side-toolbar {
    flex-wrap: wrap;
    align-content: flex-start;
}
.logcat-side-filters { flex-wrap: wrap; }
.logcat-side-filters .field { min-width: 0; flex: 1 1 120px; }
.logcat-side-meta { justify-content: space-between; flex-wrap: wrap; color: var(--text-dim); font-size: 11px; }
.logcat-side-content {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 8px;
    font-family: var(--font-code);
    font-size: 11px;
    line-height: 1.45;
    background: #10141b;
    user-select: text;
    cursor: text;
}
@container (max-width: 240px) {
    .logcat-side-toolbar { gap: 4px; padding: 6px; }
    .logcat-side-filters, .logcat-side-meta { gap: 4px; padding: 6px; }
    .logcat-side-filters .field { flex-basis: 100%; }
}

.panel-resizer { position: absolute; background: transparent; z-index: 5; }
.panel-resizer:hover { background: rgba(255,255,255,0.15); }
.bottom-panel-resizer {
    top: -3px;
    right: 0;
    left: 0;
    height: 6px;
    cursor: ns-resize;
    touch-action: none;
}
.sidebar-resizer { right: -2px; top: 0; bottom: 0; width: 4px; cursor: ew-resize; }
.right-panel-resizer { left: -2px; top: 0; bottom: 0; width: 6px; cursor: ew-resize; touch-action: none; }
body.is-resizing,
body.is-resizing * {
    cursor: ew-resize !important;
    user-select: none !important;
}
body.is-resizing--vertical,
body.is-resizing--vertical * {
    cursor: ns-resize !important;
}
body.is-chat-input-resizing,
body.is-chat-input-resizing * {
    cursor: nwse-resize !important;
}
/* модалки поверх ресайза — клики и Esc всегда живые */
body.is-resizing .modal-overlay,
body.is-resizing .modal-overlay *,
body.is-chat-input-resizing .modal-overlay,
body.is-chat-input-resizing .modal-overlay * {
    cursor: auto !important;
    user-select: text !important;
    pointer-events: auto !important;
}
