/* docgen.css — панель документа модуля «Составление документов» (docgen/SPEC.md §3, §7).
 * 18.10.2026 Claude: создан на этапе 1. Панель — в токенах темы приложения (светлая/тёмная),
 * лист документа — всегда белый, Times New Roman, размеры в мм как в .docx. Откат: удалить файл
 * и строку в index.html. Без флага DOCGEN_ENABLED элементов .dg-* на странице нет. */

/* 18.10.2026 (замечания пользователя, «как у Claude»): панель — плавающая карточка со скруглёнными углами
 * справа на всю высоту экрана чата; фон карточки — серый продукта (как пузырь сообщения пользователя,
 * --bg-bubble; в светлой теме — --bg-active); чат, поле ввода, кнопка «?» и переключатель темы уходят в левую
 * колонку (отступ = ширина карточки --dg-w, её ставит docgen.js). Откат: вернуть прежний блок из git. */
.dg-panel {
  --dg-gap: 12px;
  --dg-card: var(--bg-bubble, #1a1a1a);
  --dg-hover: rgba(255, 255, 255, .08);
  --dg-line: rgba(255, 255, 255, .08);
  --dg-desk: #e6e6e9;      /* светлая подложка под листом, как у Claude / «стол» Word (18.10.2026) */
  position: absolute; top: var(--dg-gap); right: var(--dg-gap); bottom: var(--dg-gap);
  width: var(--dg-w, 50%);
  display: none;
  flex-direction: column;
  border: 1px solid var(--border-strong, #282828);
  border-radius: 16px;
  overflow: hidden;
  background: var(--dg-card);
  color: var(--text-primary, #111);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .28);
  z-index: 30;
}
:root[data-theme="light"] .dg-panel {
  --dg-card: var(--bg-active, #e8e8ed);
  --dg-hover: rgba(0, 0, 0, .06);
  --dg-line: rgba(0, 0, 0, .08);
  --dg-desk: #d6d6dc;      /* светлая тема: подложка чуть темнее карточки, чтобы белый лист читался */
  box-shadow: 0 10px 32px rgba(0, 0, 0, .10);
}
.dg-panel.is-open { display: flex; }
body.dg-resizing { cursor: col-resize; user-select: none; }

/* Чат, поле ввода, «?» и тема — левее карточки (только на экране чата; на телефоне карточка — поверх) */
body.dg-panel-open #chatView.active { position: relative; }
@media (min-width: 769px) {
  body.dg-panel-open #chatView.active { padding-right: calc(var(--dg-w, 50%) + 24px); }
  body.dg-panel-open:has(#chatView.active) #topbar { right: calc(var(--dg-w, 50%) + 24px); }
  /* «?» — у правого края левой колонки и над полем ввода: колонка уже, и внизу кружок наезжал на поле */
  body.dg-panel-open:has(#chatView.active) .spc-fab { right: calc(var(--dg-w, 50%) + 40px); bottom: 116px; }
}

.dg-resize {
  position: absolute; left: 0; top: 16px; bottom: 16px; width: 6px; cursor: col-resize; z-index: 3; border-radius: 3px;
}
.dg-resize:hover { background: color-mix(in srgb, var(--accent, #3D78CC) 35%, transparent); }

/* 18.10.2026 (вторые и третьи замечания): шапка и кнопки крупнее, как у Claude — кнопки 42 px, значки 22 px, заголовок 16 px */
.dg-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap;
  padding: 7px 10px 7px 22px; min-height: 56px; box-sizing: border-box;   /* 18.10.2026: было 66 + отступы = 86 px, слишком высоко */
}
.dg-title { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex: 1 1 110px; overflow: hidden; }
.dg-badge {
  font-size: 16px; font-weight: 500; color: var(--text-primary, #111); white-space: nowrap; flex: 0 0 auto;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.dg-name {
  font-size: 16px; color: var(--text-muted, #888); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1 1 auto; min-width: 0;
}
.dg-actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.dg-btn {
  position: relative; height: 42px; padding: 0 14px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text-secondary, #555); font: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: background .12s ease, color .12s ease;
}
.dg-btn:hover:not(:disabled) { background: var(--dg-hover); color: var(--text-primary, #111); }
.dg-btn:focus-visible { outline: 2px solid var(--accent, #3D78CC); outline-offset: 1px; }
.dg-btn:disabled { opacity: .4; cursor: default; }
.dg-btn.dg-primary { background: var(--accent, #3D78CC); color: #fff; }
.dg-btn.dg-primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent, #3D78CC); color: #fff; }
.dg-btn.dg-icon { width: 42px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.dg-btn.dg-icon svg { display: block; }
.dg-btn[hidden] { display: none !important; }   /* 18.10.2026: inline-flex перебивал hidden — «Изменения» висела на v1 */
.dg-btn.is-done { color: #2a8a4a; }
.dg-btn.has-dot::after {          /* свой бланк или включён «мой стиль» */
  content: ""; position: absolute; top: 6px; right: 5px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent, #3D78CC);
}
.dg-sep { width: 1px; height: 26px; margin: 0 6px; background: var(--dg-line); flex-shrink: 0; }
/* 18.10.2026 (замечание пользователя): список версий — своя кнопка «Версия №N ▾» и аккуратное меню, как у карточки
 * документа в чате; в шапке — только вид документа (без «о …»). Откат — прежний .dg-ver (select) из git. */
.dg-name { display: none; }
.dg-vers { position: relative; display: inline-flex; }
.dg-vers[hidden] { display: none; }
.dg-vbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 10px 0 14px; border: 0;
  border-radius: 10px; background: transparent; color: var(--text-secondary, #555); font: inherit; font-size: 15px;
  font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s ease, color .12s ease;
}
.dg-vbtn:hover:not(:disabled), .dg-vbtn[aria-expanded="true"] { background: var(--dg-hover); color: var(--text-primary, #111); }
.dg-vbtn:disabled { opacity: .4; cursor: default; }
.dg-vbtn:focus-visible { outline: 2px solid var(--accent, #3D78CC); outline-offset: 1px; }
.dg-vbtn svg { transition: transform .15s ease; }
.dg-vbtn[aria-expanded="true"] svg { transform: rotate(180deg); }
.dg-vmenu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 12; min-width: 180px; max-height: 320px; overflow: auto;
  padding: 6px; display: flex; flex-direction: column; border-radius: 12px; background: var(--bg-elevated, #fff);
  border: 1px solid var(--border-strong, #ddd); box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
}
.dg-vmenu[hidden] { display: none; }
.dg-vmenu button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 38px; padding: 0 12px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-primary, #111); font: inherit;
  font-size: 15px; text-align: left; cursor: pointer;
}
.dg-vmenu button:hover { background: var(--bg-hover, #f0f0f0); }
.dg-vmenu button.is-cur { font-weight: 600; }
.dg-vmenu button svg { color: var(--accent, #3D78CC); flex-shrink: 0; }

.dg-status {
  display: flex; align-items: center; gap: 8px; padding: 2px 18px 8px; font-size: 13px;
  color: var(--text-secondary, #555);
}
.dg-spin {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-strong, #ccc);
  border-top-color: var(--accent, #3D78CC); animation: dg-spin 0.9s linear infinite; flex-shrink: 0;
}
@keyframes dg-spin { to { transform: rotate(360deg); } }

/* Серый «стол» Word и листы A4 на нём */
/* 18.10.2026 (пользователь: «у Claude лист как будто лежит на чём-то»): лист лежит на светлой подложке во всю
 * ширину карточки, с полями 24 px и тенью. Откат: background: transparent; padding: 4px 16px 16px. */
.dg-scroll {
  flex: 1; overflow: auto; background: var(--dg-desk, #e6e6e9); padding: 24px;
  border-top: 1px solid var(--dg-line, transparent);
  scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, .28) transparent;
}
.dg-scroll .dg-page { box-shadow: 0 1px 2px rgba(0, 0, 0, .10), 0 6px 20px rgba(0, 0, 0, .10); }
.dg-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; transform-origin: top center; }

.dg-page {
  position: relative; box-sizing: border-box; flex-shrink: 0;
  width: 210mm; height: 297mm;
  padding: var(--dg-mt, 20mm) var(--dg-mr, 15mm) var(--dg-mb, 20mm) var(--dg-ml, 30mm);   /* бланк — этап 3 */
  background: #fff; color: #000; box-shadow: 0 1px 3px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.08);
}
.dg-page.is-live::after {
  content: ""; position: absolute; left: 30mm; right: 15mm; bottom: 12mm; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent, #3D78CC), transparent); opacity: .5;
  animation: dg-live 1.4s ease-in-out infinite;
}
@keyframes dg-live { 50% { opacity: .1; } }
.dg-body { width: var(--dg-body-w, 165mm); height: var(--dg-body-h, 257mm); overflow: hidden; }
.dg-runhead {
  position: absolute; top: 8mm; left: var(--dg-ml, 30mm); right: var(--dg-mr, 15mm); font-size: 9pt; line-height: 1.2;
  color: #555; white-space: pre-line; text-align: center; overflow: hidden; max-height: calc(var(--dg-mt, 20mm) - 9mm);
}
.dg-pnum {
  position: absolute; left: 0; right: 0; bottom: 10mm; text-align: center; font-size: 12pt; color: #000;
}

/* Шрифт листа — Times New Roman, сильнее глобального Inter (family-inter.css: * {… !important}) */
.dg-page, .dg-page *, .dg-measure, .dg-measure * {
  font-family: var(--dg-font, "Times New Roman"), "Times New Roman", Times, "Liberation Serif", "Tinos", serif !important;
}
.dg-body p {
  margin: 0; font-size: var(--dg-size, 14pt); line-height: var(--dg-line, 1.5); color: #000; text-align: justify;
  text-indent: var(--dg-indent, 12.5mm);
  hyphens: manual; overflow-wrap: break-word;
}
.dg-body p.dg-hdr { margin-left: 85mm; text-indent: 0; text-align: left; line-height: 1.15; }
.dg-body p.dg-gap { text-indent: 0; }
.dg-body p.dg-ttl { text-align: center; text-indent: 0; font-weight: 700; line-height: 1.15; }
.dg-body p.dg-sub { text-align: center; text-indent: 0; line-height: 1.15; }
.dg-body p.dg-ask { text-align: center; text-indent: 0; font-weight: 700; }
.dg-body p.dg-atth { text-align: left; text-indent: 0; font-weight: 700; }
.dg-body p.dg-att { text-indent: 0; line-height: 1.15; text-align: left; }
.dg-body p.dg-sign { text-align: left; text-indent: 0; line-height: 1.15; }
.dg-body p.dg-sign.dg-right { text-align: right; }
.dg-body p.dg-cont { text-indent: 0; }
.dg-body p.dg-split { text-align-last: justify; }

/* Подсветка поверх листа (в .docx её нет; «чистый вид» выключает) */
.dg-cite { background: rgba(61,120,204,.10); border-bottom: 1px solid rgba(61,120,204,.55); cursor: pointer; }
.dg-cite::after { content: " ✓"; color: #2a8a4a; font-size: 10pt; font-family: system-ui, sans-serif !important; }
.dg-cite.is-warn { background: rgba(214,140,20,.12); border-bottom-color: rgba(214,140,20,.7); }
.dg-cite.is-warn::after { content: " ⚠"; color: #b26b00; }
.dg-cite-raw { color: #3D78CC; font-size: 11pt; }
.dg-ph { background: #fff2b3; border-radius: 2px; cursor: pointer; box-shadow: 0 0 0 1px #f0d36a inset; }
.dg-ph:hover { background: #ffe680; }
.dg-ph-input {
  font: inherit; font-size: 13pt; border: 1px solid #3D78CC; border-radius: 3px; padding: 0 4px;
  min-width: 14em; outline: none; background: #fff; color: #000;
}

/* Скрытый контейнер для измерения абзацев — те же размеры, что у листа */
.dg-measure { position: absolute; left: -10000px; top: 0; visibility: hidden; pointer-events: none; }
.dg-measure .dg-page { height: auto; box-shadow: none; }
.dg-measure .dg-body { height: auto; overflow: visible; }

/* Отчёт проверки */
/* 18.10.2026 (замечание пользователя «непонятно, что это за строка»): строка проверки — фраза со значком
 * состояния и кнопкой «Подробнее»; в развёрнутом виде — что проверено и список замечаний. Откат — прежние правила. */
.dg-report { border-top: 1px solid var(--dg-line, #e5e5e5); font-size: 14px; max-height: 45%; overflow: auto; }
.dg-rep-head {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px 12px 18px; border: 0;
  background: none; color: var(--text-primary, #111); text-align: left; cursor: pointer; font: inherit; font-size: 14px;
}
.dg-rep-head:hover { background: var(--dg-hover, rgba(0, 0, 0, .04)); }
.dg-rep-ico { display: inline-flex; flex-shrink: 0; color: #2f9e5a; }
.dg-report.is-warn .dg-rep-ico { color: #d68c14; }
.dg-report.is-fail .dg-rep-ico { color: #d64545; }
.dg-rep-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-rep-title { font-weight: 500; }
.dg-rep-sum { color: var(--text-muted, #888); }
.dg-rep-more {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; padding: 4px 8px; border-radius: 7px;
  color: var(--text-secondary, #555); font-size: 13px; font-weight: 500;
}
.dg-rep-head:hover .dg-rep-more { color: var(--text-primary, #111); }
.dg-rep-more svg { transition: transform .15s ease; }
.dg-report:not(.is-expanded) .dg-rep-more svg { transform: rotate(180deg); }
.dg-rep-close { display: none; }
.dg-report.is-expanded .dg-rep-close { display: inline; }
.dg-report.is-expanded .dg-rep-open { display: none; }
.dg-rep-facts { display: none; padding: 0 18px 6px 46px; color: var(--text-muted, #888); font-size: 13px; line-height: 1.6; }
.dg-report.is-expanded .dg-rep-facts { display: block; }
.dg-dot { width: 9px; height: 9px; border-radius: 50%; background: #2a8a4a; flex-shrink: 0; }
.dg-rep-list { display: none; margin: 0; padding: 0 18px 14px 46px; list-style: none; }
.dg-report.is-expanded .dg-rep-list { display: block; }
.dg-rep-list li { margin: 6px 0; color: var(--text-secondary, #444); }
.dg-rep-list li.lv-fail b { color: #c93b3b; }
.dg-rep-list li.lv-warn b { color: #b26b00; }
.dg-rep-list li.lv-fixed b { color: #2a8a4a; }
.dg-rep-detail { color: var(--text-muted, #888); margin-top: 2px; }
.dg-rep-quote { color: var(--text-muted, #888); font-style: italic; margin-top: 2px; }

/* Подсказка у ссылки на практику */
.dg-tip {
  position: absolute; z-index: 5; width: 360px; max-width: calc(100% - 16px); padding: 10px 12px;
  border-radius: 10px; background: var(--bg-elevated, #fff); color: var(--text-primary, #111);
  border: 1px solid var(--border-strong, #ddd); box-shadow: 0 8px 28px rgba(0,0,0,.18); font-size: 12.5px;
  pointer-events: none;
}
.dg-tip-ok { color: #2a8a4a; font-weight: 600; margin-bottom: 4px; }
.dg-tip-name { font-weight: 600; margin-bottom: 4px; }
.dg-tip-gist { margin-bottom: 4px; }
.dg-tip-ex { color: var(--text-muted, #777); }
.dg-tip-hint { margin-top: 6px; color: var(--accent, #3D78CC); }

.dg-panel.is-clean .dg-cite, .dg-panel.is-clean .dg-ph { background: none; box-shadow: none; border: 0; }

/* Карточка документа в чате и кнопки «Составить документ» */
/* 18.10.2026 (замечание пользователя): карточка документа в чате как у Claude — серый продукта, плитка со значком,
 * «Документ · DOCX», «Скачать» с меню. Откат: прежние 6 правил .dg-card* из git. */
.dg-card {
  --dg-card-bg: var(--bg-bubble, #1a1a1a);
  --dg-card-btn: rgba(255, 255, 255, .08);
  --dg-card-btn-hover: rgba(255, 255, 255, .14);
  position: relative; display: flex; align-items: center; gap: 16px; max-width: 640px;
  padding: 14px 16px 14px 14px; margin: 16px 0 6px; cursor: pointer;
  border: 1px solid var(--border-strong, #282828); border-radius: 14px; background: var(--dg-card-bg);
  transition: border-color .15s ease, background .15s ease;
}
:root[data-theme="light"] .dg-card {
  --dg-card-bg: var(--bg-sub, #f7f7f9);
  --dg-card-btn: rgba(0, 0, 0, .06);
  --dg-card-btn-hover: rgba(0, 0, 0, .1);
}
.dg-card:hover { border-color: color-mix(in srgb, var(--accent, #3D78CC) 45%, var(--border-strong, #282828)); }
.dg-card:focus-visible { outline: 2px solid var(--accent, #3D78CC); outline-offset: 2px; }
.dg-card-ico {
  flex-shrink: 0; width: 52px; height: 60px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; color: color-mix(in srgb, var(--accent, #3D78CC) 80%, #fff);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent, #3D78CC) 30%, transparent),
                                      color-mix(in srgb, var(--accent, #3D78CC) 12%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent, #3D78CC) 40%, transparent);
}
.dg-card-main { flex: 1; min-width: 0; }
.dg-card-title {
  font-weight: 500; font-size: 16px; color: var(--text-primary, #111);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dg-card-sub { font-size: 13px; color: var(--text-muted, #888); margin-top: 4px; }
.dg-card-dl { position: relative; display: flex; align-items: center; flex-shrink: 0; }
.dg-card-btn, .dg-card-more {
  height: 38px; border: 0; background: var(--dg-card-btn); color: var(--text-primary, #111);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .12s ease;
}
.dg-card-btn { padding: 0 14px 0 16px; border-radius: 10px 0 0 10px; }
.dg-card-more {
  width: 36px; border-radius: 0 10px 10px 0; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 1px 0 0 var(--dg-line, rgba(255, 255, 255, .1)); color: var(--text-secondary, #555);
}
.dg-card-btn:hover, .dg-card-more:hover { background: var(--dg-card-btn-hover); }
.dg-card-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 190px; padding: 6px;
  display: flex; flex-direction: column; border-radius: 10px; background: var(--bg-elevated, #fff);
  border: 1px solid var(--border-strong, #ddd); box-shadow: 0 10px 28px rgba(0, 0, 0, .25);
}
.dg-card-menu[hidden] { display: none; }
.dg-card-menu button {
  height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; text-align: left;
  color: var(--text-primary, #111); font: inherit; font-size: 14px; cursor: pointer;
}
.dg-card-menu button:hover { background: var(--bg-hover, #f0f0f0); }
@media (max-width: 480px) {
  .dg-card { gap: 12px; padding: 12px; }
  .dg-card-ico { width: 40px; height: 48px; }
  .dg-card-btn { padding: 0 12px; }
}
.dg-compose {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px;
  color: var(--text-muted, #888);
}
.dg-compose button {
  height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--border-strong, #ccc);
  background: var(--bg-elevated, #fafafa); color: var(--text-primary, #111); cursor: pointer; font-size: 13px;
}
.dg-compose button:hover { background: var(--bg-hover, #f0f0f0); }

/* Этап 2 (18.10.2026): правка через чат, версии, «Изменения», ручная правка */
.dg-btn.is-on { background: color-mix(in srgb, var(--accent, #3D78CC) 18%, transparent); border-color: var(--accent, #3D78CC); }
.dg-body p.dg-changed { background: rgba(61,120,204,.07); box-shadow: -3mm 0 0 -1mm rgba(61,120,204,.55); }
.dg-body ins { text-decoration: none; background: #d9f2df; color: #0f5223; }
.dg-body del { background: #fbe0e0; color: #8a1f1f; }
.dg-body p.dg-gone { text-decoration: line-through; color: #8a1f1f; background: #fbe0e0; }
.dg-page.dg-flow { height: auto; min-height: 297mm; }
.dg-page.dg-flow .dg-body { height: auto; overflow: visible; }
.dg-eblock {
  font-size: var(--dg-size, 14pt); line-height: var(--dg-line, 1.5); color: #000; padding: 2mm 3mm; margin: 0 -3mm 3mm;
  border-radius: 2px;
  outline: 1px dashed rgba(61,120,204,.35); white-space: pre-wrap; text-align: justify;
}
.dg-eblock:focus { outline: 2px solid #3D78CC; background: #f7fbff; }
.dg-eblock.dg-k-header { margin-left: 82mm; text-align: left; line-height: 1.15; }
.dg-eblock.dg-k-title { text-align: center; font-weight: 700; }
.dg-eblock.dg-k-attachments, .dg-eblock.dg-k-signature { text-align: left; line-height: 1.15; }

/* Этап 3: меню бланка */
.dg-head { position: relative; }
.dg-menu {
  position: absolute; right: 14px; top: calc(100% - 4px); z-index: 6; width: 340px; max-width: calc(100% - 28px);
  padding: 12px; border-radius: 10px; background: var(--bg-elevated, #fff); border: 1px solid var(--border-strong, #ddd);
  box-shadow: 0 8px 28px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 8px; font-size: 13px;
}
.dg-menu button {
  height: 32px; border-radius: 8px; border: 1px solid var(--border-strong, #ccc); background: var(--bg-surface, #fff);
  color: var(--text-primary, #111); cursor: pointer; text-align: left; padding: 0 10px;
}
.dg-menu button:disabled { opacity: .45; cursor: default; }
.dg-menu-cur { color: var(--text-secondary, #444); }
.dg-menu-note { color: var(--text-muted, #888); font-size: 12px; }

/* Этап 4 (18.10.2026): «пиши как я» — раздел меню и карточка в чате. Откат: удалить блок. */
.dg-menu { max-height: calc(100vh - 120px); overflow-y: auto; }
.dg-menu-sep { height: 1px; background: var(--border-subtle, #e6e6e6); margin: 2px 0; }
.dg-menu.is-busy button { opacity: .5; pointer-events: none; }
.dg-muted { color: var(--text-muted, #888); }
.dg-style-prof {
  margin: 0; padding: 8px 10px; max-height: 220px; overflow: auto; white-space: pre-wrap;
  font-family: inherit; font-size: 12px; line-height: 1.45;
  background: var(--bg-surface, #f7f7f7); border: 1px solid var(--border-subtle, #e6e6e6); border-radius: 8px;
  color: var(--text-secondary, #444);
}
.dg-stylecard { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.dg-stylecard .dg-btn { height: 32px; padding: 0 14px; border-radius: 8px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--border-strong, #ccc); background: var(--bg-surface, #fff); color: var(--text-primary, #111); }
.dg-stylecard .dg-btn.dg-primary { background: var(--accent, #3D78CC); border-color: var(--accent, #3D78CC); color: #fff; }
.dg-stylecard .dg-btn:disabled { opacity: .45; cursor: default; }
.dg-stylecard.is-busy .dg-btn { opacity: .5; pointer-events: none; }
.dg-stylecard-st { font-size: 13px; color: var(--text-muted, #888); }

/* Телефон: панель поверх чата на весь экран */
@media (max-width: 768px) {
  .dg-panel.is-open {
    position: fixed; inset: 0; width: 100% !important; max-width: none; min-width: 0; z-index: 60; border: 0;
    border-radius: 0; box-shadow: none;
  }
  .dg-resize { display: none; }
  .dg-actions .dg-btn:not(.dg-primary):not(.dg-icon) { display: none; }
  /* бланк, ручная правка и «Изменения» — задачи для компьютера; на телефоне их не было и раньше */
  .dg-actions [data-act="blank"], .dg-actions [data-act="edit"], .dg-actions [data-act="diff"] { display: none; }
  .dg-scroll { padding: 12px; }
}
