/* consult.css — окно «AI Эксперт» (ТЗ TZ_FORM_ANALYST_2026-10-01, T1.5; структура окна — T6.5).
   Подложка и окно — как у Студии изображений (image-studio.css .img-overlay/.img-modal).
   Структура — по образцу окна AI-Аналитика (orchestrator-ui.css): карточка секции .oa-sec → .cs-sec,
   вкладки .oa-tabs → .cs-tabs, строка «зачем» .oa-purpose → .cs-purpose, группы fieldset.oa-fs → .cs-fs,
   выбор карточками .oa-choice-item → .cs-choice-item, строка итога .oa-summary → .cs-summary.
   Токены: текст #1f1f1f, акцент #1f1f1f, рамка rgba(31,31,31,0.1). Радиусы: секции 10, блоки 8, кнопки ≤ 7. */

.cs-overlay [hidden] { display: none !important; }
.cs-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10050;
}
.cs-overlay.show { display: flex; }
.cs-modal {
    position: relative;
    background: #FFFFFF;
    border: 1px solid rgba(31,31,31,0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10), 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 94%;
    max-width: 1480px;
    height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.875rem;
    color: #1f1f1f;
}

/* шапка: заголовок, строка текущего шага, кнопки 32×32 */
.cs-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 20px; border-bottom: 1px solid rgba(31,31,31,0.1); flex-shrink: 0; }
.cs-head-text { min-width: 0; flex: 1; }
.cs-head-title { font-size: 1.05rem; font-weight: 600; line-height: 1.25; }
.cs-head-step { font-size: 0.78rem; color: rgba(31,31,31,0.62); line-height: 1.35; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-head-tools { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.cs-warn { padding: 8px 20px; font-size: 0.82rem; color: #b42318; background: rgba(180,35,24,0.06); flex-shrink: 0; }

.cs-icon, .cs-btn-text {
    height: 32px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: rgba(31,31,31,0.62);
    font: 500 0.82rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cs-icon { width: 32px; font-size: 1.1rem; padding: 0; }
.cs-btn-text { padding: 0 10px; }
.cs-icon:hover, .cs-btn-text:hover { background: rgba(31,31,31,0.05); color: #1f1f1f; }
.cs-btn-danger:hover { color: #b42318; }
.cs-btn-outline {
    height: 32px; padding: 0 12px; border-radius: 7px;
    border: 1px solid rgba(31,31,31,0.27); background: #FFFFFF; color: #1f1f1f;
    font: 500 0.82rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
}
.cs-btn-outline:hover:not(:disabled) { border-color: #1f1f1f; background: rgba(31,31,31,0.036); }
.cs-btn-outline:disabled { opacity: 0.45; cursor: default; }
.cs-icon:focus-visible, .cs-btn-text:focus-visible, .cs-btn-outline:focus-visible, .cs-row:focus-visible, .cs-link:focus-visible,
.cs-tab:focus-visible, .cs-choice-item:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(31,31,31,0.18); }

/* тело: список слева, справа — лента и подвал */
.cs-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px 1fr; }
.cs-side { border-right: 1px solid rgba(31,31,31,0.1); display: flex; flex-direction: column; min-height: 0; padding: 10px 8px; gap: 6px; background: rgba(31,31,31,0.015); }
.cs-new { color: #1f1f1f; justify-content: flex-start; text-align: left; width: 100%; }
.cs-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.cs-empty { font-size: 0.78rem; color: rgba(31,31,31,0.45); padding: 8px 10px; }
.cs-row { padding: 8px 4px 8px 10px; border-radius: 7px; cursor: pointer; display: flex; align-items: flex-start; gap: 4px; }
.cs-row-text { flex: 1; min-width: 0; }
/* «Удалить» — вполсилы, разгорается под курсором; у выбранной строки виден всегда */
.cs-row-del { flex-shrink: 0; width: 26px; height: 26px; font-size: 1rem; opacity: 0; transition: opacity 150ms ease, color 150ms ease, background 150ms ease; }
.cs-row:hover .cs-row-del, .cs-row:focus-within .cs-row-del, .cs-row.is-active .cs-row-del { opacity: 0.55; }
.cs-row .cs-row-del:hover, .cs-row .cs-row-del:focus-visible { opacity: 1; color: #b42318; }
.cs-row:hover { background: rgba(31,31,31,0.04); }
.cs-row.is-active { background: rgba(31,31,31,0.06); }
.cs-row-title { font-size: 0.82rem; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cs-row-meta { font-size: 0.7rem; color: rgba(31,31,31,0.5); margin-top: 2px; }

.cs-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.cs-feed { overflow-y: auto; min-height: 0; flex: 1; }
.cs-feed-inner { max-width: 920px; margin: 0 auto; padding: 18px 28px 40px; }
.cs-feed-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 10px; }
.cs-feed-title { font-size: 1.15rem; font-weight: 600; flex: 1; line-height: 1.3; }
.cs-label { font-size: 0.78rem; font-weight: 500; color: rgba(31,31,31,0.62); margin: 14px 0 6px; }
.cs-hint { font-size: 0.76rem; color: rgba(31,31,31,0.5); }
.cs-link { color: #1f1f1f; font-size: 0.82rem; font-weight: 500; cursor: pointer; border-bottom: 1px dashed rgba(31,31,31,0.27); border-radius: 2px; }
.cs-link-muted { color: rgba(31,31,31,0.5); border-bottom-color: rgba(31,31,31,0.25); }

/* подвал окна: сводка консультации и действия */
.cs-winfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 14px 6px 28px; border-top: 1px solid rgba(31,31,31,0.1); background: #FFFFFF; flex-shrink: 0; }
.cs-winfoot-sum { font-size: 0.76rem; color: rgba(31,31,31,0.62); font-variant-numeric: tabular-nums; }
.cs-winfoot-acts { display: flex; gap: 4px; }

/* вкладки — как .oa-tabs */
.cs-tabs { display: flex; gap: 2px; margin-bottom: 14px; border-bottom: 1px solid rgba(31,31,31,0.1); flex-wrap: wrap; }
.cs-tab {
    padding: 7px 12px; border: none; border-bottom: 2px solid transparent; background: transparent;
    color: rgba(31,31,31,0.62); font: 500 0.82rem/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    cursor: pointer; border-radius: 7px 7px 0 0; transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
    display: inline-flex; align-items: center; gap: 6px;
}
.cs-tab:hover { background: rgba(31,31,31,0.05); color: #1f1f1f; }
.cs-tab.active { color: #1f1f1f; border-bottom-color: #1f1f1f; }
.cs-tab-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 7px; background: rgba(31,31,31,0.072); color: #1f1f1f; font-size: 0.7rem; line-height: 18px; text-align: center; box-sizing: border-box; }
.cs-tabpanel { outline: none; }

/* карточка секции — как .oa-sec: рамка, лёгкий фон, заголовок + уточнение серым */
.cs-sec { margin: 0 0 14px; padding: 12px 16px 14px; border: 1px solid rgba(31,31,31,0.1); border-radius: 10px; background: rgba(31,31,31,0.02); min-width: 0; }
.cs-sec-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; font-size: 0.9rem; font-weight: 600; color: #1f1f1f; }
.cs-sec-sub { font-weight: 400; color: rgba(31,31,31,0.55); }
.cs-sec-meta { font-size: 0.74rem; color: rgba(31,31,31,0.5); margin: -2px 0 8px; }
.cs-sec-actions { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.cs-purpose { margin: 0 0 8px; font-size: 0.78rem; line-height: 1.45; color: rgba(31,31,31,0.62); }
.cs-badge { display: inline-block; padding: 2px 8px; border-radius: 7px; font-size: 0.7rem; font-weight: 500; line-height: 1.4; background: rgba(31,31,31,0.06); color: rgba(31,31,31,0.62); }
.cs-badge.is-wait { background: rgba(31,31,31,0.072); color: #1f1f1f; }
.cs-badge.is-done { background: rgba(31,31,31,0.06); color: rgba(31,31,31,0.62); }

/* ситуация — текст на белом блоке внутри карточки */
.cs-task-text { font-size: 0.875rem; line-height: 1.5; white-space: pre-wrap; background: #FFFFFF; border: 1px solid rgba(31,31,31,0.06); border-radius: 8px; padding: 10px 14px; }
.cs-task .cs-purpose { margin: 8px 0 0; }
/* лист — белый блок в карточке; разделы внутри листа — легче границы листа */
.cs-sheet .cs-sheet-body { background: #FFFFFF; border: 1px solid rgba(31,31,31,0.06); border-radius: 8px; padding: 4px 16px 14px; }
.cs-sheet .form-sheet { max-width: none; }
.cs-sheet .form-sheet .fs-section { border-top-color: rgba(31,31,31,0.06); margin-top: 16px; padding-top: 10px; }
.cs-sheet .form-sheet .fs-section-title { font-size: 0.86rem; color: rgba(31,31,31,0.78); }
.cs-sheet .form-sheet .fs-header { margin-top: 8px; }
.cs-sheet .form-sheet .fs-title { display: none; }
.cs-decision { font-size: 0.78rem; color: rgba(31,31,31,0.62); margin: 0 0 8px; padding-left: 10px; border-left: 2px solid rgba(31,31,31,0.21); }
.cs-price { color: #1f1f1f; font-variant-numeric: tabular-nums; }
.cs-done { font-size: 0.74rem; color: rgba(31,31,31,0.5); margin-top: 6px; text-align: right; }

/* ожидание модели — карточка с шагами */
.cs-pending .cs-sec-title { color: #1f1f1f; }
.cs-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cs-step { position: relative; padding-left: 22px; font-size: 0.82rem; color: rgba(31,31,31,0.45); line-height: 1.4; }
.cs-step::before { content: ''; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid rgba(31,31,31,0.25); box-sizing: border-box; }
.cs-step.is-done { color: rgba(31,31,31,0.62); }
.cs-step.is-done::before { background: #1f1f1f; border-color: #1f1f1f; }
.cs-step.is-cur { color: #1f1f1f; font-weight: 500; }
.cs-step.is-cur::before { border-color: #9b9b9b; box-shadow: none; }
.cs-step-model { font-weight: 400; color: rgba(31,31,31,0.5); }
.cs-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(31,31,31,0.12); border-top-color: #1f1f1f; animation: csSpin 0.8s linear infinite; flex-shrink: 0; }
@keyframes csSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cs-spinner { animation: none; } }
.cs-sec-error { border-color: rgba(180,35,24,0.25); background: rgba(180,35,24,0.03); }
.cs-sec-error .cs-sec-title { color: #b42318; }
.cs-error { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: 0.82rem; color: #b42318; }
.cs-error.is-cancelled { color: rgba(31,31,31,0.62); }
.cs-sec-done { background: rgba(31,31,31,0.03); border-color: rgba(31,31,31,0.15); }
/* непросмотренный результат в списке — точка слева от названия */
.cs-row.is-unseen .cs-row-title::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #1f1f1f; margin-right: 6px; vertical-align: 1px; }

/* плашка свёрнутого окна — по образцу Студии изображений (.img-pill) */
.cs-pill[hidden] { display: none !important; }
.cs-pill {
    position: fixed; right: 20px; bottom: 76px; z-index: 10040;
    display: flex; align-items: center; gap: 8px; padding: 9px 14px;
    border: none; border-radius: 7px; background: #FFFFFF; cursor: pointer;
    box-shadow: 0 4px 16px rgba(31,31,31,0.16), 0 1px 3px rgba(31,31,31,0.08);
    font: 500 0.82rem/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: #1f1f1f;
}
.cs-pill:hover { box-shadow: 0 6px 22px rgba(31,31,31,0.22), 0 1px 3px rgba(31,31,31,0.08); }
.cs-pill:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(31,31,31,0.18); }
.cs-pill-label { white-space: nowrap; }
.cs-pill-status { font-size: 0.76rem; color: rgba(31,31,31,0.62); white-space: nowrap; }
.cs-pill-status.running, .cs-pill-status.done { color: #1f1f1f; }
.cs-pill-status.bad { color: #b42318; }

/* вкладка «Отчёт» (T3.4) */
.cs-report-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cs-report-bar .cs-label { margin: 0 8px 0 0; font-size: 0.82rem; color: #1f1f1f; }
.cs-select { height: 32px; padding: 0 8px; border-radius: 7px; border: 1px solid rgba(31,31,31,0.1); background: #FFFFFF; color: #1f1f1f; font: 400 0.82rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.cs-export { color: #1f1f1f; }
.cs-export:disabled { opacity: 0.45; cursor: default; }
.cs-report-body { border: 1px solid rgba(31,31,31,0.1); border-radius: 8px; padding: 24px 28px; background: #fff; }
.cs-report-body img { max-width: 100%; }
.cs-rebuild { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.cs-md { font-size: 0.875rem; line-height: 1.55; }
.cs-md h1, .cs-md h2, .cs-md h3 { font-size: 0.95rem; font-weight: 600; margin: 16px 0 6px; }
.cs-md p { margin: 0 0 8px; }
.cs-md ul, .cs-md ol { margin: 0 0 8px; padding-left: 22px; }

/* поля */
.cs-textarea {
    width: 100%;
    min-height: 72px;
    padding: 10px 12px;
    border-radius: 7px;
    border: 1px solid rgba(31,31,31,0.14);
    background: #FFFFFF;
    color: #1f1f1f;
    font: 400 0.875rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}
#consultTaskInput { min-height: 140px; }
.cs-textarea:focus { border-color: #9b9b9b; box-shadow: none; }
.cs-count { font-size: 0.7rem; color: rgba(31,31,31,0.5); text-align: right; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cs-field-label { font-size: 0.8rem; font-weight: 600; margin: 4px 0 6px; }
.cs-check { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; margin-top: 12px; cursor: pointer; }
.cs-rbase { display: flex; align-items: center; gap: 8px; margin: 6px 0 0 22px; }

/* форма новой консультации — группы как fieldset.oa-fs */
.cs-newform .cs-feed-title { margin-bottom: 12px; }
.cs-fs { margin: 0 0 14px; padding: 10px 16px 14px; border: 1px solid rgba(31,31,31,0.1); border-radius: 10px; background: rgba(31,31,31,0.02); min-width: 0; }
.cs-fs legend { padding: 0 6px; font-size: 0.86rem; font-weight: 600; color: #1f1f1f; }
.cs-fs legend span { font-weight: 400; color: rgba(31,31,31,0.55); }
.cs-ctx-inline { background: #FFFFFF; border: 1px solid rgba(31,31,31,0.06); border-radius: 8px; padding: 10px 14px 12px; }
.cs-ctx-inline .cs-ctx-docs { margin-top: 12px; }
.cs-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cs-choice-item {
    display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 8px 12px; text-align: left;
    background: #FFFFFF; border: 1px solid rgba(31,31,31,0.1); border-radius: 7px;
    font-family: inherit; color: #1f1f1f; cursor: pointer; transition: background 150ms ease, border-color 150ms ease;
}
.cs-choice-item:hover { border-color: #1f1f1f; }
.cs-choice-item.is-active { background: rgba(31,31,31,0.036); border-color: #1f1f1f; box-shadow: inset 3px 0 0 #1f1f1f; }
.cs-choice-title { font-size: 0.84rem; font-weight: 600; }
.cs-choice-desc { font-size: 0.74rem; line-height: 1.4; color: rgba(31,31,31,0.62); }
/* «Что получится» — список «подпись — значение», позиция строкой (владелец 04.10) */
.cs-summary { margin: 0 0 4px; padding: 10px 14px; border: 1px solid rgba(31,31,31,0.1); border-radius: 8px; background: rgba(31,31,31,0.036); font-size: 0.82rem; }
.cs-summary-label { font-weight: 600; margin-bottom: 6px; }
.cs-summary-list { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.cs-summary-list dt { color: rgba(31,31,31,0.62); }
.cs-summary-list dd { margin: 0; color: #1f1f1f; min-width: 0; overflow-wrap: anywhere; }
.cs-summary-note { margin-top: 6px; }
.cs-summary-note:empty { display: none; }
.cs-newfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(31,31,31,0.1); }
.cs-newfoot .form-sheet { max-width: none; }

/* свой контекст (T6.3): форма документов */
.cs-drop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed rgba(31,31,31,0.24); border-radius: 8px; background: #FFFFFF; }
.cs-drop.is-over { background: rgba(31,31,31,0.048); border-color: #1f1f1f; }
.cs-ctx-msg { font-size: 0.78rem; color: rgba(31,31,31,0.62); margin-top: 6px; min-height: 0; }
.cs-ctx-msg:empty { display: none; }
.cs-ctx-msg.is-bad { color: #b42318; }
.cs-docs { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cs-doc { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid rgba(31,31,31,0.08); border-radius: 8px; background: #FFFFFF; }
.cs-doc-main { flex: 1; min-width: 200px; }
.cs-doc-name { font-size: 0.84rem; font-weight: 500; word-break: break-word; }
.cs-doc-meta { font-size: 0.72rem; color: rgba(31,31,31,0.5); }
.cs-doc-state { font-size: 0.76rem; color: rgba(31,31,31,0.62); margin-top: 2px; }
.cs-doc.is-ready .cs-doc-state { color: #1f1f1f; }
.cs-doc.is-failed .cs-doc-state, .cs-doc.is-declined .cs-doc-state { color: #b42318; }
.cs-doc-note { font-size: 0.72rem; color: rgba(31,31,31,0.55); margin-top: 2px; }
.cs-doc-acts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cs-doc-use { margin: 0; font-size: 0.78rem; }
.cs-doc-edit { flex-basis: 100%; }
.cs-doc-edit-acts { display: flex; justify-content: flex-end; margin-top: 6px; }

.cs-doc.is-open { border-color: rgba(31,31,31,0.27); box-shadow: inset 3px 0 0 #1f1f1f; }
.cs-doc-name { display: block; padding: 0; border: none; background: none; font: 500 0.84rem/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: #1f1f1f; text-align: left; cursor: pointer; word-break: break-word; }
.cs-doc-name:hover { color: #1f1f1f; text-decoration: underline; text-decoration-style: dashed; text-underline-offset: 3px; }
.cs-doc-name:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(31,31,31,0.18); border-radius: 4px; }
.cs-doc-state { display: flex; align-items: center; gap: 6px; }
.cs-spinner-s { width: 11px; height: 11px; border-width: 1.5px; }

/* просмотрщик документа (владелец 03.10): страница слева, прочитанное справа, листание ← 1/3 → */
.cs-viewer { margin-top: 10px; border: 1px solid rgba(31,31,31,0.1); border-radius: 8px; background: #FFFFFF; padding: 8px 12px 12px; outline: none; }
.cs-viewer-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cs-viewer-title { flex: 1; min-width: 160px; font-size: 0.84rem; font-weight: 600; word-break: break-word; }
.cs-viewer-pager { display: flex; align-items: center; gap: 2px; }
.cs-viewer-pager .cs-icon:disabled { opacity: 0.35; cursor: default; background: transparent; }
.cs-viewer-page { min-width: 44px; text-align: center; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.cs-viewer-state { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px; font-size: 0.78rem; color: rgba(31,31,31,0.62); min-height: 1.2em; }
.cs-viewer-state.is-live { color: #1f1f1f; }
.cs-viewer-state.is-ok { color: #1f1f1f; }
.cs-viewer-state.is-bad { color: #b42318; }
.cs-viewer-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.cs-viewer-body.is-text-only { grid-template-columns: minmax(0, 1fr); }
.cs-viewer-col { display: flex; flex-direction: column; min-width: 0; }
.cs-viewer-col .cs-viewer-text { flex: 1; }
.cs-viewer-page-img.is-loading > * { opacity: 0.55; transition: opacity 150ms ease; }
.cs-viewer-label { font-size: 0.72rem; font-weight: 600; color: rgba(31,31,31,0.55); margin-bottom: 4px; text-transform: none; }
.cs-viewer-page-img { min-height: 160px; max-height: 70vh; overflow: auto; display: flex; align-items: flex-start; justify-content: center; background: rgba(31,31,31,0.04); border-radius: 7px; padding: 8px; }
.cs-viewer-page-img canvas, .cs-viewer-page-img img { max-width: 100%; height: auto; box-shadow: 0 1px 4px rgba(31,31,31,0.16); background: #FFFFFF; }
.cs-viewer-text { max-height: 70vh; overflow: auto; white-space: pre-wrap; font-size: 0.8rem; line-height: 1.5; padding: 8px 10px; border: 1px solid rgba(31,31,31,0.08); border-radius: 7px; background: rgba(31,31,31,0.015); min-height: 160px; }

/* беседа (Этап 7): реплика эксперта с вопросами, ответ человека, поле ответа */
.cs-choices.cs-choices-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-turn-pair { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; }
.cs-turn { border-radius: 10px; padding: 10px 14px 12px; max-width: 92%; }
.cs-turn.is-expert { align-self: flex-start; background: #FFFFFF; border: 1px solid rgba(31,31,31,0.1); width: 92%; box-sizing: border-box; }
.cs-turn.is-user { align-self: flex-end; background: rgba(31,31,31,0.06); max-width: 80%; }
.cs-turn-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.cs-turn-who { font-size: 0.8rem; font-weight: 600; color: #1f1f1f; }
.cs-turn-who-me { color: #1f1f1f; margin-bottom: 4px; }
.cs-turn-meta { font-size: 0.72rem; color: rgba(31,31,31,0.5); }
.cs-turn.is-user .cs-turn-meta { margin-top: 4px; text-align: right; }
.cs-turn-say { font-size: 0.9rem; line-height: 1.5; margin-bottom: 4px; }
.cs-turn-text { white-space: pre-wrap; font-size: 0.875rem; line-height: 1.5; }
.cs-turn-questions .form-sheet { max-width: none; }
.form-sheet.fs-talk .fs-item { padding: 9px 0; }
.form-sheet.fs-talk .fs-item:last-child { border-bottom: none; }
.form-sheet.fs-talk .fs-qno { color: #1f1f1f; font-weight: 600; }
.cs-turn-reply { align-self: stretch; margin-left: 8%; padding: 10px 12px; border: 1px solid rgba(31,31,31,0.14); border-radius: 10px; background: #FFFFFF; }
.cs-turn-reply:focus-within { border-color: #9b9b9b; box-shadow: none; }
.cs-turn-reply .cs-chat-text { width: 100%; box-sizing: border-box; }
.cs-turn-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.cs-turn-send { margin-left: auto; max-width: none; display: flex; gap: 8px; align-items: center; }
.cs-turn-hint { margin-top: 4px; }
.cs-turn-hint.is-bad { color: #b42318; }
.cs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cs-chips:empty { display: none; }
.cs-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 7px; background: rgba(31,31,31,0.06); font-size: 0.76rem; }
.cs-chip-x { border: none; background: none; cursor: pointer; color: rgba(31,31,31,0.5); font-size: 0.9rem; line-height: 1; padding: 0 2px; border-radius: 4px; }
.cs-chip-x:hover { color: #b42318; }
.cs-ref-menu { margin-top: 6px; padding: 4px; border: 1px solid rgba(31,31,31,0.12); border-radius: 8px; background: #FFFFFF; box-shadow: 0 4px 16px rgba(31,31,31,0.1); display: flex; flex-direction: column; max-width: 420px; }
.cs-ref-item { text-align: left; border: none; background: none; padding: 6px 8px; border-radius: 7px; font: 400 0.82rem/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: #1f1f1f; cursor: pointer; }
.cs-ref-item:hover, .cs-ref-item:focus-visible { background: rgba(31,31,31,0.048); outline: none; }

/* лист из диалога и пометка «отчёт старше листа» */
.cs-sheet.is-dialog { border-style: dashed; }
.cs-stale { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: rgba(180,35,24,0.06); color: #b42318; font-size: 0.8rem; }

/* диалог после отчёта (T6.7): лента сообщений и поле ввода — как в чате */
.cs-dialog { margin-top: 16px; }
.cs-chat { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 10px; }
.cs-chat-empty { padding: 4px 0; }
.cs-msg { max-width: 88%; border-radius: 8px; padding: 8px 12px; font-size: 0.875rem; line-height: 1.5; }
.cs-msg.is-user { align-self: flex-end; background: rgba(31,31,31,0.06); white-space: pre-wrap; }
.cs-msg.is-assistant { align-self: flex-start; background: #FFFFFF; border: 1px solid rgba(31,31,31,0.08); }
.cs-msg.is-event { align-self: center; max-width: none; padding: 2px 8px; font-size: 0.74rem; color: rgba(31,31,31,0.55); background: rgba(31,31,31,0.04); }
.cs-msg-body > :first-child { margin-top: 0; }
.cs-msg-body > :last-child { margin-bottom: 0; }
.cs-msg-meta { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.cs-msg-wait { display: flex; align-items: center; gap: 8px; color: #1f1f1f; font-size: 0.82rem; }
.cs-proposal { margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(31,31,31,0.18); border-radius: 8px; background: rgba(31,31,31,0.03); }
.cs-proposal-title { font-size: 0.84rem; font-weight: 600; color: #1f1f1f; }
.cs-proposal-why { font-size: 0.82rem; margin-top: 2px; }
.cs-proposal-need { margin: 6px 0 0; padding-left: 20px; font-size: 0.8rem; color: rgba(31,31,31,0.78); }
.cs-proposal-acts { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.cs-proposal-acts .form-sheet { max-width: none; }
.cs-chat-input { display: flex; align-items: flex-end; gap: 8px; padding: 8px; border: 1px solid rgba(31,31,31,0.14); border-radius: 8px; background: #FFFFFF; }
.cs-chat-input:focus-within { border-color: #9b9b9b; box-shadow: none; }
.cs-chat-text { border: none; min-height: 40px; max-height: 220px; padding: 6px 4px; resize: none; box-shadow: none !important; }
.cs-chat-text:focus { border: none; }
.cs-chat-send-wrap { max-width: none; flex-shrink: 0; }
.cs-chat-send:disabled { opacity: 0.45; cursor: default; }
.cs-chat-note { margin-top: 4px; }
.cs-chat-note:empty { display: none; }

/* вопрос поверх окна: согласие на платное распознавание */
.cs-ask { position: absolute; inset: 0; background: rgba(31,31,31,0.12); display: flex; align-items: center; justify-content: center; z-index: 5; }
.cs-ask-card { max-width: 520px; width: calc(100% - 48px); background: #FFFFFF; border: 1px solid rgba(31,31,31,0.1); border-radius: 10px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); padding: 16px 18px 14px; }
.cs-ask-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.cs-ask-text { font-size: 0.84rem; line-height: 1.5; color: rgba(31,31,31,0.82); }
.cs-ask-fs { max-width: none; }
.cs-ask-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

@media (max-width: 900px) {
    .cs-body { grid-template-columns: 1fr; }
    .cs-side { display: none; }
    .cs-choices { grid-template-columns: 1fr; }
    .cs-viewer-body { grid-template-columns: minmax(0, 1fr); }
    .cs-choices.cs-choices-2 { grid-template-columns: 1fr; }
    .cs-turn.is-expert, .cs-turn.is-user { width: 100%; max-width: none; }
    .cs-turn-reply { margin-left: 0; }
}

/* беседа: «обязательный» не держит отправку — звёздочку не показываем */
.form-sheet.fs-talk .fs-req { display: none; }