/* Blazor bridge: совместимость компонентов с buriat-theme.css */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--status-active-text, #22855e);
}

.invalid {
    outline: 1px solid var(--color-sun, #c94a42);
}

.validation-message {
    color: var(--color-sun, #c94a42);
    font-size: 12px;
}

.d-none { display: none !important; }

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Кнопки (legacy class names в admin-секциях) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--chat-border);
    background: transparent;
    color: var(--chat-text, inherit);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.22s ease;
    text-decoration: none;
}

.btn:hover { background: var(--chat-hover); }

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-color: transparent;
}

.btn-primary:hover { background: var(--btn-primary-hover); }

.btn-ghost, .btn.btn-ghost {
    background: transparent;
    border-color: var(--chat-border);
}

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-block { width: 100%; }

.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border: none;
    border-radius: var(--radius-sm, 8px);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.22s ease;
}

.primary-btn:hover { background: var(--btn-primary-hover); }

.primary-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.secondary-btn {
    padding: 9px 16px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--chat-border);
    background: transparent;
    color: var(--chat-text);
    cursor: pointer;
}

.link-btn {
    border: none;
    background: none;
    color: var(--chat-accent);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
}

/* Поля форм */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.field span {
    font-size: 13px;
    font-weight: 500;
    color: var(--chat-text-secondary);
}

.field input,
.field select,
.field textarea,
.form-control,
.compose-input {
    padding: 11px 14px;
    border: 1px solid var(--chat-border);
    border-radius: var(--radius-sm, 8px);
    background: var(--chat-input-bg);
    color: var(--chat-text);
    font-size: 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Textarea: только по вертикали, на всю ширину контейнера */
textarea,
.field textarea,
.textarea-fluid,
.admin-panel textarea,
.answer-card textarea {
    resize: vertical;
    min-height: 96px;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
    field-sizing: content;
}

.field input:focus,
.form-control:focus,
.compose-input:focus {
    outline: none;
    border-color: var(--chat-accent);
}

.compose-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    resize: none;
}

/* Элементы с hidden не должны отображаться даже при display: grid/flex в кастомных классах */
[hidden] {
    display: none !important;
}

/* Диалоги */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    display: grid;
    place-items: center;
    padding: 16px;
    z-index: 200;
}

.dialog-overlay[hidden] {
    display: none !important;
}

.dialog-card {
    width: min(100%, 520px);
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-lg, 16px);
    border: 1px solid var(--chat-border);
    background: var(--modal-bg);
    padding: 24px;
    color: var(--chat-text);
    box-shadow: var(--admin-shadow-lg);
}

.dialog-title {
    margin: 0 0 16px;
    font-size: 18px;
}

/* Алерты */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm, 8px);
    font-size: 14px;
    margin-bottom: 12px;
}

.alert-error {
    background: rgba(201, 74, 66, 0.12);
    color: var(--color-sun);
    border: 1px solid rgba(201, 74, 66, 0.25);
}

.alert-info {
    background: var(--kpi-blue-bg);
    color: var(--kpi-blue-text);
}

.alert-warning {
    background: var(--status-pending-bg);
    color: var(--status-pending-text);
}

/* Toolbar / таблицы в admin */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

/* Горизонтальный ряд: поле и кнопка на одной линии (как StackPanel Horizontal) */
.toolbar-row {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-form {
    margin-bottom: 12px;
}

.toolbar-form.toolbar-row {
    align-items: center;
    gap: 14px;
}

.toolbar-form.toolbar-row .field-inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    flex: 1 1 280px;
    min-width: 0;
    max-width: 420px;
}

.toolbar-form.toolbar-row .field-inline > span {
    flex-shrink: 0;
    margin-bottom: 0;
    white-space: nowrap;
}

.toolbar-form.toolbar-row .field-inline input {
    flex: 1;
    min-width: 120px;
}

.toolbar-form .field-grow,
.toolbar-form .input-grow {
    flex: 1 1 200px;
    min-width: 140px;
    max-width: 320px;
}

.toolbar-action {
    flex-shrink: 0;
    align-self: center;
    margin-top: 0;
}

.toolbar-tight {
    gap: 10px;
}

.toolbar-no-margin {
    margin-bottom: 0;
}

.dept-header .toolbar-tight.toolbar-no-margin,
.dept-header-card .toolbar-tight.toolbar-no-margin {
    margin-top: 10px;
    align-items: center;
}

.dept-header .toolbar-action,
.dept-header-card .toolbar-action {
    margin-top: 4px;
}

/* Bitrix24: отступ между чекбоксами и кнопками */
.bitrix-check-group {
    margin-bottom: 14px;
}

.bitrix-check-group .check-label {
    margin-bottom: 10px;
}

.bitrix-check-group .check-label:last-child {
    margin-bottom: 0;
}

.bitrix-toolbar {
    margin-top: 24px;
    padding-top: 8px;
}

.panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
}

.table-wrap {
    overflow-x: auto;
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table-wrap th,
.table-wrap td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}

.table-wrap th {
    background: var(--table-head-bg);
    color: var(--admin-text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.section { margin-top: 16px; }

.section-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--admin-text-secondary);
}

.upload-progress {
    margin-top: 12px;
    height: 8px;
    border-radius: 999px;
    background: var(--chat-border, rgba(255, 255, 255, 0.12));
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: var(--color-sun, #c9a84c);
    transition: width 0.25s ease;
}

.upload-progress-label {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--chat-text-muted, #888);
}

.check-list { display: flex; flex-direction: column; gap: 6px; }

.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.text-hint {
    color: var(--chat-text-muted);
    font-size: 13px;
}

.text-muted { color: var(--chat-text-muted); }

/* Чат: подзаголовок и сообщения */
.chat-title-sub {
    display: block;
    font-size: 12px;
    color: var(--chat-text-muted);
    margin-top: 2px;
}

.msg-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--chat-text-muted);
    margin-bottom: 4px;
}

.msg-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.55;
    max-width: 100%;
}

.msg-text-html {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    overflow-x: auto;
    line-height: 1.5;
}

.msg-text-html strong {
    font-weight: 650;
}

.msg-text-html code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.92em;
}

.msg-text-html .chat-md-h {
    font-weight: 650;
    margin: 10px 0 4px;
    white-space: normal;
}

.msg-text-html .chat-md-p {
    margin: 0 0 8px;
    line-height: 1.5;
}

.msg-text-html .chat-md-p:last-child {
    margin-bottom: 0;
}

.msg-text-html .chat-md-list {
    white-space: normal;
    margin: 6px 0 10px;
    padding: 0 0 0 1.6em;
}

.msg-text-html ol.chat-md-list {
    padding-left: 1.85em;
    list-style-position: outside;
}

.msg-text-html ul.chat-md-list {
    padding-left: 1.35em;
    list-style-position: outside;
}

.msg-text-html .chat-md-list .chat-md-list {
    margin: 6px 0 2px;
}

.msg-text-html .chat-md-list li {
    margin: 0 0 6px;
    padding: 0 0 0 0.2em;
    line-height: 1.5;
}

.msg-text-html .chat-md-list li:last-child {
    margin-bottom: 0;
}

.msg-text-html code.chat-md-path {
    display: block;
    margin: 6px 0 2px;
    padding: 6px 8px;
    font-size: 0.88em;
    line-height: 1.4;
    word-break: normal;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    background: color-mix(in srgb, var(--chat-border, #d0d5dd) 35%, transparent);
    border-radius: 6px;
}

.msg-text-html .chat-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
    table-layout: fixed;
}

.msg-text-html .chat-table th,
.msg-text-html .chat-table td {
    border: 1px solid var(--chat-border, #d0d5dd);
    padding: 6px 8px;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.msg-text-html .chat-table th {
    background: var(--chat-surface-2, rgba(0,0,0,0.06));
    font-weight: 600;
}

.agent-trace {
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--chat-text-muted);
}

.agent-trace summary {
    cursor: pointer;
    font-weight: 600;
}

.agent-trace-list {
    margin: 8px 0 0 18px;
    padding: 0;
}

.clarify-block {
    margin-top: 10px;
}

.clarify-heading {
    font-size: 13px;
    font-weight: 600;
    color: var(--chat-text-secondary, #667085);
    margin-bottom: 6px;
}

.clarify-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.clarify-chip {
    border: 1px solid var(--chat-border, #d0d5dd);
    background: var(--chat-surface-2, rgba(0, 0, 0, 0.04));
    color: var(--chat-text);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.3;
    cursor: pointer;
    max-width: 100%;
}

.clarify-chip:hover:not(:disabled) {
    border-color: var(--chat-accent, #2e90fa);
    background: color-mix(in srgb, var(--chat-accent, #2e90fa) 12%, transparent);
}

.clarify-chip:disabled {
    cursor: default;
    opacity: 0.85;
}

.clarify-chip-other {
    border-style: dashed;
}

.clarify-followup .clarify-chip {
    border-radius: 8px;
    background: transparent;
}

.agent-trace-detail {
    font-weight: 400;
    opacity: 0.85;
    white-space: pre-wrap;
}

.file-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 12px 0;
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--chat-surface-2, rgba(0,0,0,0.06));
    font-size: 12px;
}

.file-chip.expired {
    opacity: 0.55;
    text-decoration: line-through;
}

.compose-hint-error {
    color: #c0392b;
}

.diamark-attach {
    max-width: 768px;
    margin: 10px auto 0;
    display: grid;
    gap: 8px;
}

.diamark-loader-slim {
    padding: 10px 12px 8px;
}

.diamark-loader {
    border-radius: 14px;
    padding: 14px 14px 12px;
    background:
        radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--chat-accent, #3b82f6) 18%, transparent), transparent 55%),
        var(--chat-surface-2, rgba(127, 127, 127, 0.08));
    border: 1px solid color-mix(in srgb, var(--chat-accent, #3b82f6) 35%, var(--chat-border, #d0d5dd));
    box-shadow: 0 8px 24px color-mix(in srgb, var(--chat-accent, #3b82f6) 12%, transparent);
}

.diamark-loader-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.diamark-loader-ring {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--chat-accent, #3b82f6) 22%, transparent);
    border-top-color: var(--chat-accent, #3b82f6);
    animation: diamark-spin 0.75s linear infinite;
}

.diamark-loader-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--chat-accent, #3b82f6);
}

.diamark-loader-file {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diamark-loader-meta {
    margin-top: 2px;
    font-size: 12px;
    color: var(--chat-text-muted);
}

.diamark-loader-pct {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--chat-accent, #3b82f6);
}

.diamark-loader-bar {
    position: relative;
    margin-top: 12px;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--chat-accent, #3b82f6) 14%, var(--chat-border, #d0d5dd));
}

.diamark-loader-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--chat-accent, #3b82f6), color-mix(in srgb, var(--chat-accent, #3b82f6) 55%, #fff));
    transition: width 0.18s ease-out;
}

.diamark-loader-bar-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
    animation: diamark-shine 1.15s ease-in-out infinite;
}

.diamark-loader-queue {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.diamark-loader-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.diamark-loader-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chat-text-muted);
    opacity: 0.45;
}

.diamark-loader-item.is-work .diamark-loader-dot {
    opacity: 1;
    background: var(--chat-accent, #3b82f6);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--chat-accent, #3b82f6) 22%, transparent);
    animation: diamark-pulse 1s ease-in-out infinite;
}

.diamark-loader-item.is-ok .diamark-loader-dot {
    opacity: 1;
    background: #2ea44f;
}

.diamark-loader-item.is-fail .diamark-loader-dot {
    opacity: 1;
    background: #c0392b;
}

.diamark-loader-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diamark-loader-item.is-work .diamark-loader-item-name {
    font-weight: 600;
}

.diamark-loader-item-meta {
    color: var(--chat-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@keyframes diamark-spin {
    to { transform: rotate(360deg); }
}

@keyframes diamark-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes diamark-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.25); }
}

.diamark-drop {
    border: 1px dashed var(--chat-border, #d0d5dd);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--chat-surface-2, rgba(127, 127, 127, 0.06));
}

.diamark-drop-xml {
    background: transparent;
}

.diamark-drop-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.diamark-drop-title {
    font-size: 13px;
    font-weight: 600;
}

.diamark-optional {
    font-weight: 500;
    font-size: 11px;
    color: var(--chat-text-muted);
}

.diamark-drop-note,
.diamark-drop-empty {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--chat-text-muted);
}

.diamark-drop-btn {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--chat-border, #d0d5dd);
    background: var(--chat-input-bg, transparent);
    color: var(--chat-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.diamark-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

.diamark-drop-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.diamark-drop-btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.diamark-file-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.diamark-file {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--chat-input-bg, rgba(127, 127, 127, 0.08));
    font-size: 13px;
}

.diamark-file-job {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.diamark-file-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chat-text-muted);
    opacity: 0.45;
}

.diamark-file-job.is-work .diamark-file-dot {
    opacity: 1;
    background: var(--chat-accent, #3b82f6);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--chat-accent, #3b82f6) 22%, transparent);
    animation: diamark-pulse 1s ease-in-out infinite;
}

.diamark-file-job.is-ok .diamark-file-dot {
    opacity: 1;
    background: #2ea44f;
}

.diamark-file-job.is-fail .diamark-file-dot {
    opacity: 1;
    background: #c0392b;
}

.diamark-file-job.is-work .diamark-file-name {
    font-weight: 600;
}

.diamark-file.expired {
    opacity: 0.55;
}

.diamark-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diamark-file-meta {
    font-size: 11px;
    color: var(--chat-text-muted);
    white-space: nowrap;
}

.diamark-file-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--chat-text-muted);
}

.diamark-file-x svg {
    width: 14px;
    height: 14px;
}

.diamark-attach-bar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.diamark-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 768px;
}

.diamark-compact-toggle {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px dashed var(--chat-border, #d0d5dd);
    background: var(--chat-surface-2, rgba(127, 127, 127, 0.06));
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.diamark-compact-toggle > span:first-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.diamark-compact-action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--chat-accent, #3b82f6);
}

.diamark-compact-action svg {
    width: 14px;
    height: 14px;
}

.diamark-compact-title {
    font-size: 13px;
    font-weight: 600;
}

.diamark-compact-meta {
    font-size: 12px;
    color: var(--chat-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diamark-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: transparent;
    color: var(--chat-text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
}

.diamark-clear-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.diamark-clear-btn:hover {
    color: var(--chat-text);
}

.msg-time {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: var(--chat-text-muted);
}

.msg-thinking {
    opacity: 0.92;
}

.msg-thinking .thinking-text {
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    color: var(--chat-text-muted, var(--admin-text-muted));
    font-size: 15px;
    font-style: italic;
}

.typing-dots {
    display: inline-flex;
    margin-left: 1px;
    letter-spacing: 0;
}

.typing-dots span {
    display: inline-block;
    animation: thinking-dot-pulse 1.2s infinite ease-in-out;
    opacity: 0.25;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-dot-pulse {
    0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-1px); }
}

/* Просмотр чатов пользователей (admin) */
.admin-user-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.admin-user-pick-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-md, 12px);
    background: var(--admin-panel);
    cursor: pointer;
    text-align: left;
    overflow: hidden;
    transition: background 0.22s ease, border-color 0.22s ease;
}

.admin-user-pick-card:hover {
    background: var(--admin-hover);
    border-color: var(--chat-accent);
}

.pick-name {
    font-weight: 600;
    color: var(--admin-text);
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pick-email {
    color: var(--admin-text-muted);
    font-size: 12px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
}

.admin-readonly-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--status-pending-bg);
    color: var(--status-pending-text);
}

.admin-chats-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
    min-height: 400px;
}

.admin-chats-sidebar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-md, 12px);
    padding: 8px;
    background: var(--admin-panel);
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

.admin-chats-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-sm, 8px);
    background: transparent;
    color: var(--admin-text);
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.admin-chats-item:hover,
.admin-chats-item.active {
    background: var(--admin-hover);
}

.admin-chats-item-title {
    font-size: 13px;
    font-weight: 500;
}

.admin-chats-item-meta {
    color: var(--admin-muted, var(--text-muted));
    font-size: 11px;
}

.admin-conversations-toolbar {
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.admin-conversations-search {
    min-width: 220px;
    flex: 1;
}

.admin-filter-select {
    font: inherit;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--admin-border);
    background: var(--admin-panel);
    color: inherit;
}

.admin-conversation-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 10px;
}

.admin-chats-main {
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-md, 12px);
    padding: 16px;
    background: var(--admin-panel);
    overflow: hidden;
}

.admin-chats-main .chat-feed,
.admin-chats-main .grok-thread {
    max-height: calc(100vh - 240px);
    overflow-y: auto;
}

.chat-list-row {
    display: flex;
    align-items: stretch;
    gap: 2px;
}

.chat-list-row .chat-item {
    flex: 1;
    min-width: 0;
}

.chat-delete-btn {
    flex-shrink: 0;
    width: 28px;
    border: none;
    border-radius: var(--radius-sm, 8px);
    background: transparent;
    color: var(--chat-text-muted);
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.chat-list-row:hover .chat-delete-btn { opacity: 1; }

.chat-delete-btn:hover {
    background: rgba(201, 74, 66, 0.15);
    color: var(--color-sun);
}

.card {
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-md, 12px);
    background: var(--admin-panel);
}

.card-body { padding: 20px; }

/* Сетка полей (Bitrix, настройки) */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.grid-2 .field {
    min-width: 0;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Таблицы admin */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
    vertical-align: middle;
}

.data-table th {
    background: var(--table-head-bg);
    color: var(--admin-text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table tbody tr:hover {
    background: var(--admin-hover);
}

.data-table .col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.table-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 32px;
    width: 100%;
    margin-top: 16px;
    padding: 14px 16px;
    box-sizing: border-box;
}

.table-pagination-size {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--admin-text-muted);
}

.table-pagination-size label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.table-pagination-size select {
    min-width: 4.5rem;
    background: var(--admin-panel);
    border: 1px solid var(--admin-border);
    color: var(--admin-text);
    border-radius: var(--radius-sm, 8px);
    padding: 6px 10px;
    font: inherit;
    font-size: 13px;
}

.table-pagination-info {
    font-size: 13px;
    color: var(--admin-text-muted);
    white-space: nowrap;
}

.table-pagination-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.dept-section {
    margin-top: 20px;
    padding-top: 4px;
}

.dept-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--admin-text);
}

.dept-header,
.dept-header-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dept-job-table {
    margin-top: 8px;
}

.dept-job-name {
    font-weight: 500;
    color: var(--admin-text);
}

.actions-inline {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.input-width-lg {
    width: min(100%, 20rem);
}

.input-width-md {
    width: min(100%, 16rem);
}

.input-width-sm {
    width: min(100%, 14rem);
}

/* Вопросы без ответа */
.pending-split {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.85fr);
    gap: 20px;
    align-items: start;
}

.pending-split .answer-card {
    min-width: 0;
}

.pending-split .field {
    min-width: 0;
    width: 100%;
}

.data-table tr.selected {
    background: var(--kpi-blue-bg);
}

.data-table .cell-question {
    max-width: 100%;
    white-space: pre-wrap;
    word-break: break-word;
}

.answer-card {
    background: var(--admin-panel);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-md, 12px);
    padding: 20px;
    min-width: 0;
}

.answer-card.empty {
    border-style: dashed;
}

.answer-card .question-preview {
    padding: 12px 14px;
    background: var(--chat-input-bg);
    border-radius: var(--radius-sm, 8px);
    border-left: 3px solid var(--chat-accent);
    margin-bottom: 16px;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}

.bitrix-status-card {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--admin-border);
    background: var(--chat-input-bg);
    font-size: 13px;
}

.bitrix-status-card.is-ok {
    border-color: rgba(52, 180, 140, 0.4);
    background: var(--kpi-green-bg);
}

.bitrix-status-card.is-pending {
    border-color: rgba(201, 168, 76, 0.4);
    background: var(--status-pending-bg);
}

@media (max-width: 900px) {
    .pending-split {
        grid-template-columns: 1fr;
    }
}

.auth-loading-screen,
.auth-loading-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    color: var(--text-muted, #888);
    padding: 24px;
}

.auth-loading-inline {
    min-height: auto;
    padding: 16px;
}

#blazor-error-ui {
    background: var(--color-sun);
    color: #fff;
    padding: 8px 16px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    margin-left: 12px;
}

/* —— Knowledge admin —— */
.knowledge-admin {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.knowledge-admin > .alert {
    margin-bottom: 0;
}

.knowledge-section {
    margin: 0;
    padding: 16px 18px;
    background: var(--admin-hover, rgba(180, 210, 255, 0.04));
    border: 1px solid var(--admin-border, var(--chat-border));
    border-radius: var(--radius-md, 12px);
}

.knowledge-section > .section-title {
    margin: 0 0 14px;
}

.knowledge-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.knowledge-section-head .section-title {
    margin: 0;
}

.knowledge-search-count {
    font-size: 12px;
    color: var(--admin-text-muted, var(--chat-text-secondary));
    white-space: nowrap;
}

.knowledge-tip {
    margin-bottom: 14px;
    padding: 12px 14px;
    background: var(--chat-input-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius-sm, 8px);
}

.knowledge-checklist {
    margin: 0;
    padding-left: 1.15rem;
    line-height: 1.55;
    color: var(--admin-text-muted, var(--chat-text-secondary));
    font-size: 12px;
}

.knowledge-checklist code {
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--admin-hover);
    color: var(--admin-text-secondary, var(--chat-text));
}

.knowledge-upload-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.knowledge-file-zone {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 280px;
    min-width: 0;
    min-height: 42px;
    padding: 6px 12px;
    background: var(--chat-input-bg);
    border: 1px dashed var(--chat-border);
    border-radius: var(--radius-sm, 8px);
}

.knowledge-upload-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.knowledge-upload-actions .btn {
    height: 42px;
    box-sizing: border-box;
}

.knowledge-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.knowledge-meta-grid .field {
    margin-bottom: 0;
}

.knowledge-reindex-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.knowledge-admin .reindex-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin: 0;
}

.knowledge-filenames-field {
    margin-top: 12px;
    margin-bottom: 0;
}

.knowledge-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 14px;
}

.knowledge-status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: -4px 0 14px;
}

.knowledge-status-filters .btn.is-active {
    background: color-mix(in srgb, var(--chat-accent, #3b82f6) 16%, transparent);
    border-color: var(--chat-accent, #3b82f6);
    font-weight: 600;
}

.knowledge-index-summary {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--chat-border);
    border-radius: var(--radius-sm, 8px);
    background: var(--chat-input-bg);
}

.knowledge-index-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.knowledge-index-summary-head .section-subtitle {
    margin: 0;
}

.knowledge-index-errors {
    margin: 8px 0 0;
    padding-left: 1.15rem;
    color: var(--admin-text, var(--chat-text));
    font-size: 13px;
}

.knowledge-search-input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    height: 40px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--chat-border);
    border-radius: var(--radius-sm, 8px);
    background: var(--chat-input-bg);
    color: var(--chat-text);
    font-size: 14px;
    line-height: 1.2;
}

.knowledge-search-input::placeholder {
    color: var(--admin-text-muted, var(--chat-text-secondary));
    opacity: 0.85;
}

.knowledge-search-input:focus {
    outline: none;
    border-color: var(--chat-accent, var(--color-sky));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--chat-accent, #3b82f6) 22%, transparent);
}

.knowledge-search-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.knowledge-search-actions .btn {
    height: 40px;
    min-width: 76px;
    padding-left: 14px;
    padding-right: 14px;
    box-sizing: border-box;
}

.knowledge-table-wrap {
    margin: 0;
    /* border уже на .table-wrap из темы — не дублируем */
    overflow-x: auto;
    overflow-y: hidden;
}

.knowledge-admin .knowledge-table-wrap .data-table {
    margin: 0;
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.knowledge-admin .knowledge-table-wrap .data-table th,
.knowledge-admin .knowledge-table-wrap .data-table td {
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid var(--admin-border, var(--chat-border));
    vertical-align: middle;
    box-sizing: border-box;
}

.knowledge-admin .knowledge-table-wrap .data-table thead th {
    border-bottom: 1px solid var(--admin-border, var(--chat-border));
}

.knowledge-admin .knowledge-table-wrap .data-table tbody tr:last-child td {
    border-bottom: none;
}

.knowledge-admin .knowledge-table-wrap .data-table th:first-child,
.knowledge-admin .knowledge-table-wrap .data-table td:first-child {
    padding-left: 12px;
}

.knowledge-admin .knowledge-table-wrap .data-table th:last-child,
.knowledge-admin .knowledge-table-wrap .data-table td:last-child {
    padding-right: 12px;
}

.knowledge-doc-name {
    word-break: break-word;
}

.knowledge-doc-error {
    margin-top: 8px;
    padding: 8px;
}

.knowledge-empty {
    text-align: center;
    padding: 28px 16px !important;
}

.knowledge-pagination {
    margin-top: 14px;
    margin-bottom: 0;
}

.knowledge-admin .col-check {
    width: 40px;
    text-align: center;
}

.knowledge-admin .col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

/* Не ставить display:flex на <td> — ломает границы строк таблицы */
.knowledge-admin td.actions-row {
    display: table-cell;
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}

.knowledge-admin td.actions-row .btn {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 6px;
}

.knowledge-admin td.actions-row .btn:first-child {
    margin-left: 0;
}

.knowledge-selected-files {
    margin: 0 0 12px;
    padding-left: 1.1rem;
    color: var(--admin-text-muted, var(--chat-text-secondary));
    font-size: 13px;
}

.knowledge-upload-previews {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--chat-border);
}

.knowledge-preview-card {
    margin-bottom: 8px;
    padding: 10px 12px;
    background: var(--chat-input-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius-sm, 8px);
}

.knowledge-preview-sections {
    margin: 6px 0 0 1.1rem;
    padding: 0;
    color: var(--admin-text-muted, var(--chat-text-secondary));
    font-size: 12px;
}

.section-subtitle {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--admin-text, var(--chat-text));
}

@media (max-width: 900px) {
    .admin-chats-layout {
        grid-template-columns: 1fr;
    }

    .knowledge-meta-grid {
        grid-template-columns: 1fr;
    }

    .knowledge-upload-row {
        flex-direction: column;
        align-items: stretch;
    }

    .knowledge-upload-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .knowledge-upload-actions .btn {
        flex: 1 1 auto;
    }

    .knowledge-search-row {
        flex-wrap: wrap;
    }

    .knowledge-search-input {
        flex: 1 1 100%;
        width: 100%;
    }

    .knowledge-search-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* —— Knowledge markdown editor —— */
.kme-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: grid;
    place-items: center;
    padding: 18px;
    background: var(--modal-overlay);
    backdrop-filter: blur(6px);
}

.kme-shell {
    width: min(1280px, 100%);
    height: min(900px, calc(100vh - 36px));
    display: flex;
    flex-direction: column;
    background: var(--modal-bg);
    border: 1px solid var(--admin-border, var(--chat-border));
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--admin-shadow-lg);
    overflow: hidden;
    color: var(--admin-text, var(--chat-text));
}

.kme-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--admin-border, var(--chat-border));
    background: color-mix(in srgb, var(--admin-panel, #161c24) 88%, transparent);
}

.kme-header-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.kme-close {
    flex-shrink: 0;
    margin-top: 2px;
}

.kme-title-block {
    min-width: 0;
}

.kme-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}

.kme-hint {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--admin-text-muted, var(--chat-text-secondary));
    line-height: 1.4;
}

.kme-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.kme-view-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 2px;
    border: 1px solid var(--chat-border);
    border-radius: var(--radius-sm, 8px);
    background: var(--chat-input-bg);
}

.kme-badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 2px;
}

.kme-badge-dirty {
    background: rgba(232, 168, 56, 0.16);
    color: #e8a838;
}

.kme-badge-busy {
    background: rgba(90, 160, 230, 0.16);
    color: var(--color-sky, #5aa0e6);
}

.kme-badge-ok {
    background: rgba(72, 170, 110, 0.16);
    color: #48aa6e;
}

.kme-alert {
    margin: 0 16px;
    margin-top: 12px;
}

.kme-meta {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--admin-border, var(--chat-border));
}

.kme-meta-field {
    margin-bottom: 0;
}

.kme-loading {
    flex: 1;
    display: grid;
    place-items: center;
    color: var(--admin-text-muted);
    font-size: 14px;
}

.kme-body {
    flex: 1;
    min-height: 0;
    display: grid;
    gap: 0;
}

.kme-body-split {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.kme-body-single {
    grid-template-columns: 1fr;
}

.kme-editor-pane,
.kme-side-pane {
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--admin-border, var(--chat-border));
}

.kme-side-pane {
    border-right: none;
    background: color-mix(in srgb, var(--admin-hover, rgba(180, 210, 255, 0.07)) 70%, transparent);
}

.kme-editor-toolbar,
.kme-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--admin-text-muted);
    border-bottom: 1px solid var(--admin-border, var(--chat-border));
}

.kme-insert-group {
    display: flex;
    gap: 4px;
}

.kme-textarea {
    flex: 1;
    width: 100%;
    min-height: 0;
    resize: none;
    border: none;
    outline: none;
    padding: 14px 16px;
    background: var(--chat-input-bg);
    color: var(--chat-text);
    font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: 13.5px;
    line-height: 1.55;
    tab-size: 2;
}

.kme-textarea:focus {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chat-accent, #3b82f6) 45%, transparent);
}

.kme-side-empty {
    margin: 16px;
    font-size: 13px;
    color: var(--admin-text-muted);
    line-height: 1.5;
}

.kme-outline {
    list-style: none;
    margin: 0;
    padding: 8px;
    overflow: auto;
    flex: 1;
}

.kme-outline-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 10px;
    border: none;
    border-radius: var(--radius-sm, 8px);
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.kme-outline-item:hover {
    background: var(--admin-hover);
}

.kme-outline-line {
    font-size: 11px;
    color: var(--admin-text-muted);
}

.kme-outline-title {
    font-size: 13px;
    line-height: 1.35;
}

.kme-preview {
    flex: 1;
    overflow: auto;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.55;
}

.kme-preview .kme-h1,
.kme-preview .kme-h2,
.kme-preview .kme-h3 {
    margin: 0.9em 0 0.35em;
    line-height: 1.3;
    color: var(--admin-text);
}

.kme-preview .kme-h1 { font-size: 1.35rem; }
.kme-preview .kme-h2 { font-size: 1.15rem; }
.kme-preview .kme-h3 { font-size: 1.05rem; }

.kme-preview p {
    margin: 0 0 0.7em;
}

.kme-preview .kme-ul {
    margin: 0 0 0.7em;
    padding-left: 1.2rem;
}

.kme-preview .kme-code,
.kme-preview code {
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 0.9em;
}

.kme-preview .kme-code {
    display: block;
    padding: 10px 12px;
    margin: 0 0 0.8em;
    overflow: auto;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
}

.kme-preview-empty {
    color: var(--admin-text-muted);
}

.kme-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 16px;
    border-top: 1px solid var(--admin-border, var(--chat-border));
    font-size: 12px;
    color: var(--admin-text-muted);
    background: color-mix(in srgb, var(--admin-panel, #161c24) 88%, transparent);
}

.kme-footer-hint {
    margin-left: auto;
    opacity: 0.85;
}

@media (max-width: 960px) {
    .kme-overlay {
        padding: 0;
    }

    .kme-shell {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .kme-header {
        flex-direction: column;
    }

    .kme-header-actions {
        width: 100%;
    }

    .kme-meta {
        grid-template-columns: 1fr;
    }

    .kme-body-split {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) minmax(180px, 0.55fr);
    }

    .kme-editor-pane {
        border-right: none;
        border-bottom: 1px solid var(--admin-border, var(--chat-border));
    }
}
