/* Authorica UI. Тёплый минимализм (референс: archie-max без фото-фона),
   лёгкие рамки, умеренный blur, светлая и тёмная темы на CSS-переменных. */

:root {
  /* светлая тема — тёплые серые */
  --bg: #f4f2ee;
  --panel: #fbfaf7;
  --panel-glass: rgba(251, 250, 247, .82);
  --border: #e5e1d8;
  --text: #26231e;
  --muted: #837d72;
  --accent: #4a63c9;
  --accent-soft: #e9edfa;
  --green: #2e7d4f;  --green-bg: #e6f3ea;
  --yellow: #b26a00; --yellow-bg: #f8efdd;
  --red: #c03530;    --red-bg: #f9e7e5;
  --gray-bg: #edeae4;
  --del-bg: #f6dcd8; --del-text: #99342e;
  --ins-bg: #ddefdf; --ins-text: #1f6b3a;
  --shadow: 0 8px 28px rgba(40, 35, 25, .10);
  --radius: 12px;
  --inspector-w: 400px;
}

[data-theme="dark"] {
  /* тёмная тема — в духе NotebookLM */
  --bg: #1c1b19;
  --panel: #262522;
  --panel-glass: rgba(38, 37, 34, .84);
  --border: #3a3833;
  --text: #e9e6df;
  --muted: #989285;
  --accent: #8fa4f2;
  --accent-soft: #2e3350;
  --green: #6fbf8b;  --green-bg: #24352a;
  --yellow: #d9a04a; --yellow-bg: #3a3122;
  --red: #e07a72;    --red-bg: #402825;
  --gray-bg: #2f2e2a;
  --del-bg: #4a2c28; --del-text: #e29a92;
  --ins-bg: #26402c; --ins-text: #8fd3a4;
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: background .2s, color .2s;
}

[hidden] { display: none !important; }

/* ---------- шапка: три зоны по колонкам ---------- */
header {
  display: flex; align-items: center;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.hzone { display: flex; align-items: center; gap: 10px; }
.hzone-left { flex: 1; min-width: 0; }
.hzone-mid { flex: 1; justify-content: center; }
.hzone-right { width: var(--inspector-w); min-width: 320px; justify-content: flex-end; }

header h1 { font-size: 17px; font-weight: 700; margin: 0 6px 0 0; letter-spacing: -.01em; }
header h1 a { color: inherit; text-decoration: none; }
header .filename { color: var(--muted); font-size: 13px; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 9px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--gray-bg); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
[data-theme="dark"] .btn.primary { color: #16151c; }
.btn.small { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--gray-bg); }

/* переключатель темы */
#btn-theme { font-size: 15px; width: 34px; height: 34px; padding: 0;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- легенда ---------- */
.legend { display: flex; gap: 10px; font-size: 12px; color: var(--muted); align-items: center; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }

/* ---------- аккаунт ---------- */
.account { position: relative; }
.avatar-btn { border: none; background: none; cursor: pointer; padding: 2px; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
}
[data-theme="dark"] .avatar { color: #16151c; }
.avatar.big { width: 40px; height: 40px; font-size: 16px; }

.dropdown {
  position: absolute; right: 0; top: 42px; z-index: 60;
  width: 240px;
  background: var(--panel-glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
}
.dd-header { display: flex; gap: 10px; align-items: center; padding: 8px 10px;
  border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dd-name { font-weight: 600; font-size: 13px; }
.dd-sub { font-size: 12px; color: var(--muted); }
.dropdown hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }
.dd-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: none; background: none; text-align: left;
  padding: 8px 10px; border-radius: 9px; font: inherit; font-size: 13px;
  color: var(--text); cursor: pointer;
}
.dd-item:hover { background: var(--gray-bg); }
.dd-item .ic { width: 16px; text-align: center; color: var(--muted); }

/* ---------- раскладка ---------- */
main { flex: 1; display: flex; min-height: 0; }

#rows {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ручка ресайза инспектора по ширине */
#resize-x {
  width: 5px; cursor: col-resize; flex-shrink: 0;
  background: transparent; transition: background .15s;
}
#resize-x:hover, #resize-x.drag { background: var(--accent); opacity: .5; }

#inspector {
  width: var(--inspector-w); min-width: 320px; max-width: 680px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-height: 0;
  flex-shrink: 0;
}

/* ---------- строка-блок (исходник + правка) ---------- */
.row { display: flex; gap: 10px; }
.cell {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
}
.row.selected .cell { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.cell .badge {
  display: inline-block;
  font-size: 11px;
  border-radius: 6px;
  padding: 1px 8px;
  margin-bottom: 6px;
  margin-right: 6px;
  font-weight: 600;
}

.cell.risk-high   { border-left: 4px solid var(--red); }
.cell.risk-medium { border-left: 4px solid var(--yellow); }
.cell.risk-low    { border-left: 4px solid var(--green); }
.cell.risk-none   { border-left: 4px solid var(--border); color: var(--muted); background: var(--gray-bg); }
.cell.risk-pre    { border-left-style: dashed; }
.cell.accepted    { background: var(--green-bg); }

.badge.high   { background: var(--red-bg);    color: var(--red); }
.badge.medium { background: var(--yellow-bg); color: var(--yellow); }
.badge.low    { background: var(--green-bg);  color: var(--green); }
.badge.gray   { background: var(--gray-bg);   color: var(--muted); }
.badge.acc    { background: var(--green-bg);  color: var(--green); }

.cell.heading-cell { font-weight: 700; font-size: 15px; background: transparent; border-color: transparent; cursor: default; }
.cell.table-cell { font-family: Consolas, monospace; font-size: 12px; color: var(--muted); }

/* средняя ячейка */
.cell.rewrite-cell del { background: var(--del-bg); color: var(--del-text); text-decoration: line-through; }
.cell.rewrite-cell ins { background: var(--ins-bg); color: var(--ins-text); text-decoration: none; }
/* интерактивные куски diff'а (5.6а): клик отменяет именно эту правку */
.cell.rewrite-cell .diff-chunk { cursor: pointer; border-radius: 3px; }
.cell.rewrite-cell .diff-chunk:hover { outline: 1px dashed var(--muted); }
/* отменено пользователем: ins больше не будет включён / del больше не будет применён */
.cell.rewrite-cell .diff-chunk.diff-overridden.diff-ins ins { opacity: .45; text-decoration: line-through; }
.cell.rewrite-cell .diff-chunk.diff-overridden.diff-del del { opacity: .5; text-decoration: none; background: transparent; }
.cell.rewrite-cell.empty {
  color: var(--muted); background: var(--gray-bg);
  border-style: dashed;
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  cursor: default;
  min-height: 52px;
}
.cell.rewrite-cell.done { background: var(--green-bg); }
.cell .diff-wrap { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }

.cell .actions { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

/* инлайн-редактирование: textarea растёт под текст, кнопки всегда видны */
.cell textarea.inline-edit {
  width: 100%;
  resize: vertical;
  overflow: hidden;             /* высота управляется скриптом по scrollHeight */
  border: 1px solid var(--accent); border-radius: 9px;
  padding: 8px 10px; font: inherit; line-height: 1.55;
  background: var(--panel); color: var(--text);
}

/* ---------- инспектор: вкладки Правка / История / Поиск ---------- */
.tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.tabs button {
  flex: 1; padding: 10px 4px; border: none; background: none; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.tab-body { display: none; flex: 1; min-height: 0; }
.tab-body.active { display: flex; flex-direction: column; }
#tab-history.active { display: block; overflow-y: auto; padding: 14px 16px; }

/* секции с собственным скроллом + перетаскиваемый разделитель */
.panel { display: flex; flex-direction: column; min-height: 60px; overflow: hidden; }
#panel-analysis { flex: 1 1 0; }
#panel-edit { flex: 1.2 1 0; }
#resize-y {
  height: 5px; cursor: row-resize; flex-shrink: 0;
  background: var(--border); transition: background .15s;
}
#resize-y:hover, #resize-y.drag { background: var(--accent); }

.panel-title {
  flex-shrink: 0;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
  padding: 8px 16px 5px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.panel-scroll { flex: 1; overflow-y: auto; padding: 12px 16px; min-height: 0; }

.panel-scroll h3, #tab-history h3 {
  font-size: 12px; margin: 14px 0 6px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em;
}
.panel-scroll h3:first-child { margin-top: 0; }
.panel-scroll ul { margin: 4px 0; padding-left: 18px; }
.panel-scroll li { margin-bottom: 4px; }

.risk-banner { border-radius: 10px; padding: 10px 12px; font-weight: 600; margin-bottom: 10px; }
.risk-banner.high   { background: var(--red-bg);    color: var(--red); }
.risk-banner.medium { background: var(--yellow-bg); color: var(--yellow); }
.risk-banner.low    { background: var(--green-bg);  color: var(--green); }
.risk-banner.gray   { background: var(--gray-bg);   color: var(--muted); font-weight: 400; }

.changes-box { background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.changes-box ul { margin: 4px 0; padding-left: 18px; }

.disclaimer { font-size: 11px; color: var(--muted); margin-top: 10px; }

/* чекбоксы-ограничения: компактно, 2 столбца */
.checks-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px;
}
label.check { display: flex; gap: 7px; align-items: center; margin: 4px 0;
  cursor: pointer; font-size: 12.5px; }

select, textarea, input[type="text"], input[type="search"] {
  width: 100%; border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 10px; font: inherit; background: var(--panel); color: var(--text);
}
textarea { resize: vertical; min-height: 64px; }

.version {
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px;
  font-size: 13px;
}
.version .meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.version .text { max-height: 110px; overflow-y: auto; white-space: pre-wrap; }
.version .btn { margin-top: 6px; }

/* ---------- обогащение из источников (этап 5) ---------- */
#enrich-box { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 10px; }
#enrich-box h3 { margin-top: 0; }
.evidence-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
  margin-bottom: 8px; font-size: 12.5px;
}
.evidence-card.low    { border-color: var(--green); }
.evidence-card.medium { border-color: var(--yellow); }
.evidence-card.high   { border-color: var(--red); }
.cite-chip {
  display: inline-block; font-size: 10.5px; font-weight: 600; border-radius: 20px;
  padding: 0 6px; margin: 0 2px; background: var(--accent-soft); color: var(--accent);
  cursor: pointer; vertical-align: middle;
}
.cite-chip.confirmed   { background: var(--green-bg); color: var(--green); }
.cite-chip.partial     { background: var(--yellow-bg); color: var(--yellow); }
.cite-chip.unsupported { background: var(--red-bg); color: var(--red); }

/* --- этап 6: канонические ссылки, собственные ссылки пользователя, аудит --- */
.cite-chip.canon { font-size: 11.5px; }
.user-cite { border-bottom: 1px dotted var(--accent); cursor: pointer; }
.user-cite:hover { background: var(--accent-soft); }
#cite-card {
  position: absolute; z-index: 60; width: 360px; max-width: 92vw;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.22);
  font-size: 13px; line-height: 1.45;
}
#cite-card .cc-entry { margin-bottom: 8px; }
#cite-card .cc-missing { color: var(--red); }
#cite-card .cc-note { color: var(--muted); font-size: 12px; }
#cite-card .cc-quote {
  color: var(--muted); font-size: 12px; max-height: 140px; overflow: auto;
  border-left: 2px solid var(--border); padding-left: 8px; margin-top: 6px;
}
.bib-box { margin: 8px 0; padding: 8px; border: 1px dashed var(--border); border-radius: 8px; }
.bib-box .bib-fmt {
  width: 100%; min-height: 54px; margin: 6px 0; font-size: 12.5px;
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px;
  background: var(--bg); color: var(--text); resize: vertical;
}
.audit-modal { flex-direction: column; }
.audit-scroll { flex: 1; overflow: auto; padding: 12px 18px 18px; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.audit-table th, .audit-table td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.audit-table th { color: var(--muted); font-weight: 600; font-size: 12px; }
#audit-close {
  position: absolute; top: 12px; right: 14px; border: 0; background: none;
  color: var(--muted); font-size: 16px; cursor: pointer;
}

/* тулбар по выделению текста внутри левой колонки (блок 5.6) */
#selection-toolbar {
  position: absolute; z-index: 50; display: flex; gap: 4px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 9px;
  padding: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
#selection-toolbar button {
  border: none; background: none; font: inherit; font-size: 11.5px;
  padding: 5px 8px; border-radius: 7px; cursor: pointer; color: var(--text); white-space: nowrap;
}
#selection-toolbar button:hover { background: var(--accent-soft); color: var(--accent); }

/* ---------- вкладка «Поиск» (каркас этапа 3–4) ---------- */
#tab-search.active { display: flex; flex-direction: column; }
#panel-sources { flex: 1 1 0; }
#panel-query { flex: 1.3 1 0; border-top: 1px solid var(--border); }
.src-empty {
  border: 1.5px dashed var(--border); border-radius: 12px;
  padding: 18px 14px; text-align: center; color: var(--muted); font-size: 12.5px;
}
.search-row { display: flex; gap: 6px; margin-bottom: 8px; }
.seg {
  display: flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden;
  margin-bottom: 10px;
}
.seg button {
  flex: 1; border: none; background: none; padding: 6px 8px; font: inherit; font-size: 12px;
  color: var(--muted); cursor: pointer;
}
.seg button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
@keyframes blink-tab { 0%, 100% { background: none; } 50% { background: var(--yellow-bg); } }
.tabs button.blink { animation: blink-tab .5s ease-in-out 4; }
.stub-note { font-size: 11.5px; color: var(--muted); background: var(--gray-bg);
  border-radius: 8px; padding: 6px 10px; margin-top: 10px; }
.source-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 11px; margin-bottom: 8px; font-size: 12.5px;
}
.source-card .sc-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.source-card .sc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-card .sc-meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.source-card .btn { margin-top: 7px; }

/* ---------- настройки (в стиле Claude Desktop) ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(20, 18, 14, .40); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.modal {
  width: 760px; max-width: 94vw; height: 560px; max-height: 88vh;
  background: var(--panel); border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex; overflow: hidden; position: relative;
}
.set-nav {
  width: 190px; flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 14px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.set-nav .cap { font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; padding: 4px 10px 6px; }
.set-nav button {
  display: flex; align-items: center; gap: 8px;
  border: none; background: none; text-align: left;
  padding: 8px 10px; border-radius: 9px; font: inherit; font-size: 13px;
  color: var(--text); cursor: pointer;
}
.set-nav button:hover { background: var(--gray-bg); }
.set-nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.set-body { flex: 1; overflow-y: auto; padding: 22px 26px; }
.set-body h2 { font-size: 16px; margin: 0 0 16px; }
.set-body h3 { font-size: 13px; margin: 18px 0 8px; color: var(--muted); }
.set-row { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border); gap: 14px; }
.set-row .lbl { font-size: 13.5px; }
.set-row .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
#settings-close {
  position: absolute; top: 12px; right: 14px;
  border: none; background: none; font-size: 16px; color: var(--muted);
  cursor: pointer; border-radius: 8px; padding: 4px 8px;
}
#settings-close:hover { background: var(--gray-bg); }

.set-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.set-body th, .set-body td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.set-body th { color: var(--muted); font-weight: 600; font-size: 12px; }
.set-body .note { font-size: 12px; color: var(--muted); margin-top: 12px; }
.kpi-row { display: flex; gap: 12px; margin-bottom: 16px; }
.kpi { flex: 1; background: var(--gray-bg); border-radius: 12px; padding: 12px 14px; }
.kpi .v { font-size: 20px; font-weight: 700; }
.kpi .l { font-size: 12px; color: var(--muted); }

/* ---------- экран проектов ---------- */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.project-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.project-card .pc-name {
  font-weight: 600; font-size: 14px; margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.project-card .pc-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }

/* ---------- дроп-зона ---------- */
#dropzone {
  margin: auto; text-align: center; color: var(--muted);
  border: 2px dashed var(--border); border-radius: 16px;
  padding: 60px 80px; background: var(--panel); cursor: pointer;
}
#dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
#dropzone h2 { color: var(--text); font-weight: 600; margin: 0 0 6px; }

/* ---------- тосты ---------- */
#toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); border-radius: 10px; padding: 10px 18px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 200;
  max-width: 70vw;
}
#toast.show { opacity: .95; }

.spinner {
  display: inline-block; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(128,128,128,.35); border-top-color: currentColor;
  animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* узкие окна: легенда и имя файла мешают — прячем второстепенное */
@media (max-width: 1100px) {
  .legend { display: none; }
  header .filename { display: none; }
}

/* ---------- онбординг (этап 1б) ---------- */
.tour-shade {
  position: fixed; background: rgba(20, 18, 14, .55); z-index: 90;
  transition: all .2s ease; pointer-events: none;
}
.tour-card {
  position: fixed; z-index: 91; max-width: 280px;
  background: var(--panel); border-radius: 14px; box-shadow: var(--shadow);
  padding: 14px 16px; border: 1px solid var(--border);
}
.tour-card .t-title { font-weight: 700; margin-bottom: 6px; }
.tour-card .t-text { font-size: 13.5px; color: var(--text); line-height: 1.4; }
.tour-card .t-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; gap: 8px;
}
.tour-card .t-progress { font-size: 11px; color: var(--muted); }
.tour-highlight {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px;
  position: relative; z-index: 92;
}

/* Паспорт работы (этап 10) */
.assignment-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 12px; padding: 10px 14px;
}
.assignment-panel .ap-header {
  display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
}
.assignment-panel .ap-toggle { margin-left: auto; color: var(--muted); }
.assignment-panel .ap-body { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.assignment-panel .ap-body label {
  display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted);
}
.assignment-panel .ap-body input[type="text"],
.assignment-panel .ap-body textarea,
.assignment-panel .ap-body select {
  font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.assignment-panel h3 { margin: 4px 0 2px; font-size: 13px; }
.ap-section-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-bottom: 4px; }
.ap-gap-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.ap-gap-row span:first-child { flex: 1; }

/* вставленный черновик (10.1) — пунктирная рамка до принятия */
.cell.inserted-draft { border-style: dashed; }

/* Аудит работы (этап 12, блок 12.2) */
.audit-check-row.active { background: var(--panel-hover, rgba(0,0,0,0.04)); font-weight: 600; }
.audit-flash {
  outline: 2px solid var(--accent); outline-offset: 2px;
  animation: audit-flash-anim 2s ease-out;
}
@keyframes audit-flash-anim {
  0% { background: rgba(255, 200, 0, 0.35); }
  100% { background: transparent; }
}
