/* =========================================================
   СРАВНЕНИЕ КОДА (/tools/code-compare)
   Палитра и переменные — из style.css.

   Композиция (референс — Reg.ru, разделение поверхностями):
   белая карточка → серое рабочее поле → две белые панели.
   Между панелями — серая полоса: в ней стрелки возврата правок
   и кнопка обмена. Шапки панелей и колонки редактора выровнены
   по замерам Monaco (JS пишет ширины в --cp-col-a/--cp-band/--cp-col-b).

   Кнопки — три вида, не больше:
   primary (зелёная, одна на экран) · line (белая с обводкой) ·
   quiet (прозрачная, заливка при наведении).
   Все элементы панели — 40 px, мелкие кнопки в шапках — 32 px.

   Режимы по ширине инструмента (класс ставит JS):
   .is-compact (< 760 px) — вкладки «Было / Стало / Различия».
   ========================================================= */

[hidden] { display: none !important; }

.cp-tool {
  --cp-work: #F2F4F6;
  --cp-line: #E3E7EB;
  --cp-line-strong: #D3D9DF;
  --cp-fill: #F2F4F6;
  --cp-fill-hover: #E8EBEF;
  --cp-del: #D14343;
  --cp-add: #12A05C;
  --cp-pane-r: 14px;
  --cp-head-h: 48px;
  --cp-col-a: 1fr;
  --cp-band: 36px;
  --cp-col-b: 1fr;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 0 8px;
  padding: 24px;
  background: var(--color-surface);
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(16, 20, 24, 0.04);
  container: cptool / inline-size;
}

/* ---------- Кнопки ---------- */
.cp-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: var(--color-text-strong);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}
.cp-btn i { display: inline-flex; font-size: 16px; line-height: 1; }
.cp-btn:disabled { cursor: not-allowed; opacity: 0.45; }

.cp-btn--primary { background: var(--color-accent); color: #06231A; }
.cp-btn--primary:hover:not(:disabled) { background: var(--color-accent-dark); color: #fff; }
.cp-btn--primary:disabled { background: var(--cp-fill); color: var(--color-text-strong); opacity: 0.55; }

.cp-btn--line { background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--cp-line-strong); }
.cp-btn--line:hover:not(:disabled) { box-shadow: inset 0 0 0 1px #B9C1C9; background: #FBFCFD; }
.cp-btn--line[aria-expanded="true"] { box-shadow: inset 0 0 0 1px #B9C1C9; background: var(--cp-fill); }

.cp-btn--quiet { font-weight: 500; color: var(--color-text); }
.cp-btn--quiet:hover:not(:disabled), .cp-btn--quiet[aria-expanded="true"] { background: var(--cp-fill); color: var(--color-text-strong); }

.cp-btn--sm { height: 32px; padding: 0 10px; gap: 6px; border-radius: 9px; font-size: 13px; }
.cp-btn--sm i { font-size: 14px; }
.cp-btn--icon { width: 40px; padding: 0; }
.cp-btn--sm.cp-btn--icon { width: 32px; }

.cp-btn.is-done { background: #E3F7EC; color: #0E7A45; box-shadow: none; }
.cp-btn--primary.is-done { background: var(--color-accent-dark); color: #fff; }
.cp-btn.is-busy { cursor: progress; }
.cp-btn.is-busy i { animation: cp-spin 0.9s linear infinite; }
@keyframes cp-spin { to { transform: rotate(360deg); } }

.cp-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: #0E8A4F;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(14, 138, 79, 0.35);
  text-underline-offset: 3px;
}
.cp-link:hover { text-decoration-color: currentColor; }

.cp-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
label.cp-btn:has(.cp-file-input:focus-visible) { outline: 2px solid var(--color-accent-dark); outline-offset: 2px; }
.cp-btn:focus-visible, .cp-seg-btn:focus-visible, .cp-swap:focus-visible, .cp-link:focus-visible,
.cp-menu-item:focus-visible, .cp-switch:focus-visible { outline: 2px solid var(--color-accent-dark); outline-offset: 2px; }

/* ---------- Поля ---------- */
.cp-select {
  height: 40px;
  min-width: 176px;
  padding-block: 0;
  background-color: var(--color-surface);
  border: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--cp-line-strong);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-strong);
  cursor: pointer;
  outline: none;
  transition: box-shadow var(--transition-fast);
}
.cp-select:hover { box-shadow: inset 0 0 0 1px #B9C1C9; }
.cp-select:focus-visible { box-shadow: inset 0 0 0 2px var(--color-accent-dark); }

/* ---------- Сегменты (вид / вкладки) ---------- */
.cp-seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--cp-fill); border-radius: 12px; }
.cp-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: var(--color-text);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}
.cp-seg-btn:hover { color: var(--color-text-strong); }
.cp-seg-btn.is-active { background: var(--color-surface); font-weight: 600; color: var(--color-text-strong); box-shadow: 0 1px 2px rgba(16, 20, 24, 0.08), 0 0 0 0.5px rgba(16, 20, 24, 0.06); }
.cp-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #E3F7EC; font-size: 12px; font-weight: 600; color: #0E7A45; font-variant-numeric: tabular-nums; }

/* ---------- Панель ---------- */
.cp-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cp-bar-main, .cp-bar-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cp-seg--tabs { display: none; }
.cp-flag { width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent); }

/* ---------- Всплывающие меню ---------- */
.cp-pop { position: relative; display: inline-flex; }
.cp-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  min-width: 232px;
  padding: 6px;
  background: var(--color-surface);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(16, 20, 24, 0.07), 0 12px 32px -12px rgba(16, 20, 24, 0.28);
  animation: cp-pop 140ms ease-out;
}
@keyframes cp-pop { from { opacity: 0; transform: translateY(-4px); } }
.cp-menu--settings { left: 0; right: auto; width: 340px; }
.cp-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-strong);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.cp-menu-item i { display: inline-flex; width: 18px; justify-content: center; font-size: 15px; color: #6B7780; }
.cp-menu-item:hover:not(:disabled) { background: var(--cp-fill); }
.cp-menu-item:disabled { opacity: 0.4; cursor: not-allowed; }
.cp-menu-item--danger, .cp-menu-item--danger i { color: #C23B3B; }
.cp-menu-item--compact { display: none; }
.cp-menu-sep { height: 1px; margin: 6px 4px; background: var(--cp-line); }

.cp-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 10px 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cp-switch:hover { background: var(--cp-fill); }
.cp-switch-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cp-switch-text strong { font-size: 14px; font-weight: 600; color: var(--color-text-strong); }
.cp-switch-text span { font-size: 12.5px; line-height: 1.45; color: var(--color-muted); }
.cp-switch-track { position: relative; flex: 0 0 36px; height: 20px; border-radius: 10px; background: #D3D9DF; transition: background-color var(--transition-fast); }
.cp-switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16, 20, 24, 0.2); transition: transform var(--transition-fast); }
.cp-switch[aria-checked="true"] .cp-switch-track { background: var(--color-accent-dark); }
.cp-switch[aria-checked="true"] .cp-switch-track::after { transform: translateX(16px); }

/* ---------- Рабочее поле и панели ---------- */
.cp-work { position: relative; padding: 6px; background: var(--cp-work); border-radius: 20px; }
.cp-heads { display: grid; grid-template-columns: var(--cp-col-a) var(--cp-band) var(--cp-col-b); }
.cp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  height: var(--cp-head-h);
  padding: 0 8px 0 16px;
  background: var(--color-surface);
  border-radius: var(--cp-pane-r) var(--cp-pane-r) 0 0;
  box-shadow: inset 0 -1px 0 #EDF0F3;
  container: cphead / inline-size;
}
.cp-head--diff { display: none; }
.cp-head-text { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cp-head-title { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; min-width: 58px; font-size: 14.5px; font-weight: 600; line-height: 20px; color: var(--color-text-strong); white-space: nowrap; }
.cp-head-meta { min-width: 0; font-size: 13px; line-height: 20px; color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cp-head-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.cp-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; }
.cp-dot--del { background: var(--cp-del); }
.cp-dot--add { background: var(--cp-add); }
.cp-legend { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--color-muted); }
.cp-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Полоса между панелями: кнопка обмена точно по её центру */
.cp-band { display: flex; align-items: center; justify-content: center; min-width: 0; }
.cp-swap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: 0 0 0 1px var(--cp-line);
  font-size: 14px;
  color: var(--color-text-strong);
  cursor: pointer;
  transition: box-shadow var(--transition-fast), transform 240ms ease;
}
.cp-swap:hover:not(:disabled) { box-shadow: 0 0 0 1px #B9C1C9; transform: rotate(180deg); }
.cp-swap:disabled { color: #A3AEB4; cursor: not-allowed; }

.cp-body {
  position: relative;
  isolation: isolate;   /* слои Monaco не перекрывают обводку панели */
  height: clamp(400px, 64vh, 640px);
  border-radius: 0 0 var(--cp-pane-r) var(--cp-pane-r);
  overflow: hidden;
}
.cp-editor, .cp-single { position: absolute; inset: 0; }
.cp-single { background: var(--color-surface); }

/* Обводка панели: при наведении — тонкая, при вводе — зелёная. Не ловит клики */
.cp-ring {
  position: absolute;
  z-index: 6;
  border-radius: var(--cp-pane-r);
  pointer-events: none;
  transition: box-shadow var(--transition-fast);
}
.cp-ring.is-hover { box-shadow: inset 0 0 0 1px #C9D0D7; }
.cp-ring.is-focus { box-shadow: inset 0 0 0 2px var(--color-accent-dark); }

/* В одну колонку шапки стоят на одной белой полосе, разделитель — линия */
.is-inline:not(.is-compact) { --cp-band: 1px; }
.is-inline:not(.is-compact) .cp-band { position: relative; overflow: visible; background: #EDF0F3; box-shadow: inset 0 -1px 0 #EDF0F3; }
.is-inline:not(.is-compact) .cp-swap { position: absolute; top: 50%; left: 50%; margin: -14px 0 0 -14px; }
.is-inline:not(.is-compact) .cp-head[data-side="a"] { border-radius: var(--cp-pane-r) 0 0 0; }
.is-inline:not(.is-compact) .cp-head[data-side="a"] { padding-right: 24px; }
.is-inline:not(.is-compact) .cp-head[data-side="b"] { border-radius: 0 var(--cp-pane-r) 0 0; padding-left: 24px; }

/* Заглушки загрузки и ошибки */
.cp-loading, .cp-fail {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: var(--color-surface);
  font-size: 14px;
  color: var(--color-muted);
  text-align: center;
}
.cp-loading i { font-size: 20px; animation: cp-spin 0.9s linear infinite; }
.cp-fail strong { font-size: 16px; color: var(--color-text-strong); }
.cp-fail span { max-width: 420px; line-height: 1.55; }

/* Перетаскивание файла: подсвечивается сторона, куда он встанет */
.cp-drop { position: absolute; inset: 0; z-index: 7; display: none; pointer-events: none; }
.cp-body.is-drag .cp-drop { display: grid; grid-template-columns: var(--cp-col-a) var(--cp-band) var(--cp-col-b); }
.cp-drop-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; margin: 10px; border: 2px dashed #C9D0D7; border-radius: 12px; background: rgba(255, 255, 255, 0.96); font-size: 14px; font-weight: 600; color: var(--color-muted); }
.cp-drop-side i { font-size: 24px; }
.cp-drop-side--b { grid-column: 3; }
.cp-body[data-side="a"] .cp-drop-side--a, .cp-body[data-side="b"] .cp-drop-side--b { border-color: var(--color-accent-dark); color: var(--color-text-strong); }
.is-inline .cp-body.is-drag .cp-drop, .is-compact .cp-body.is-drag .cp-drop { grid-template-columns: 1fr; }
.is-inline .cp-body.is-drag .cp-drop-side, .is-compact .cp-body.is-drag .cp-drop-side { grid-column: 1; grid-row: 1; }
.is-inline .cp-body.is-drag:not([data-side="a"]) .cp-drop-side--a, .is-inline .cp-body.is-drag[data-side="a"] .cp-drop-side--b,
.is-compact .cp-body.is-drag:not([data-side="a"]) .cp-drop-side--a, .is-compact .cp-body.is-drag[data-side="a"] .cp-drop-side--b { display: none; }

/* ---------- Низ: итог, переходы, экспорт ---------- */
.cp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; min-height: 40px; }
.cp-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; min-width: 0; }
.cp-hint { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; font-size: 14px; line-height: 1.45; color: var(--color-muted); }
.cp-stats { display: inline-flex; align-items: center; gap: 12px; font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums; }
.cp-stats b { font-weight: 500; }
.cp-del { color: var(--cp-del); }
.cp-add { color: var(--cp-add); }
.cp-same { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #0E7A45; }
.cp-same i { display: inline-flex; font-size: 18px; }
.cp-nav { display: inline-flex; align-items: center; gap: 6px; }
.cp-nav-label { margin-left: 4px; font-size: 14px; color: var(--color-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-foot-actions { display: flex; gap: 8px; flex-shrink: 0; margin-left: auto; }
.cp-foot-actions:not(:has(> :not([hidden]))) { display: none; }
.cp-note { display: flex; align-items: center; gap: 8px; margin: -4px 0 0; font-size: 13px; line-height: 1.5; color: var(--color-muted); }
.cp-note i { display: inline-flex; color: var(--color-accent-dark); }

/* ---------- Во весь экран ---------- */
.cp-tool.is-full { position: fixed; inset: 0; z-index: 2000; margin: 0; border-radius: 0; padding: 16px 20px; box-shadow: none; }
.cp-tool.is-full .cp-work { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.cp-tool.is-full .cp-body { height: auto; flex: 1 1 auto; min-height: 0; }
.cp-tool.is-full .cp-note { display: none; }
html.cp-lock, html.cp-lock body { overflow: hidden; }

/* ---------- Уведомление ---------- */
.cp-msg {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 2100;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  background: #191B1E;
  box-shadow: 0 10px 30px -10px rgba(16, 20, 24, 0.45);
  font-size: 14px;
  line-height: 1.45;
  color: #fff;
  transform: translateX(-50%);
  animation: cp-toast 180ms ease-out;
}
.cp-msg > i { display: inline-flex; font-size: 16px; color: var(--color-accent); flex-shrink: 0; }
.cp-msg--error > i { color: #FF8F8F; }
.cp-msg-action { flex-shrink: 0; margin-left: 6px; padding: 6px 10px; border: 0; border-radius: 8px; background: #2B2F35; font: inherit; font-weight: 600; color: var(--color-accent); cursor: pointer; }
.cp-msg-action:hover { background: #353A41; }
@keyframes cp-toast { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (min-width: 1024px) { .cp-msg { left: calc(50% + var(--sidebar-width, 332px) / 2); } .cp-tool.is-full .cp-msg { left: 50%; } }

/* ---------- Monaco под стиль сайта ---------- */
.cp-editor .monaco-editor, .cp-editor .monaco-diff-editor, .cp-single .monaco-editor { --vscode-focusBorder: transparent; }
/* полоса между колонками — серое поле, внутренние углы панелей скруглены */
.cp-editor .monaco-diff-editor, .cp-editor .monaco-diff-editor .gutter { background: transparent !important; }
.cp-editor .monaco-diff-editor .gutter .gutterItem .background { display: none; }
/* в одну колонку Monaco ставит ту же полосу слева — там она часть белой панели */
.is-inline .cp-editor .monaco-diff-editor .gutter, .is-compact .cp-editor .monaco-diff-editor .gutter { background: var(--color-surface) !important; }
.cp-editor .monaco-diff-editor .editor.original { border-bottom-right-radius: var(--cp-pane-r); overflow: hidden; }
.cp-editor .monaco-diff-editor .editor.modified { border-bottom-left-radius: var(--cp-pane-r); overflow: hidden; }
.is-inline .cp-editor .monaco-diff-editor .editor.modified { border-radius: 0; }
.cp-editor .diffOverview { background: var(--color-surface); }
.cp-editor .diff-hidden-lines .center { font-family: var(--font-body) !important; font-size: 12.5px !important; }
.cp-editor .diff-hidden-lines .center span[title] { cursor: pointer; }
/* заполнитель на месте отсутствующих строк: ровная светлая плашка вместо косой штриховки */
.cp-editor .diagonal-fill { background-image: none !important; background-color: #F5F7F9 !important; }
/* рамка видимой области на полосе обзора — только когда полосой пользуются */
.cp-editor .diffViewport { background: transparent !important; transition: background-color 0.15s; }
.cp-editor .diffOverview:hover .diffViewport { background: rgba(25, 27, 30, 0.07) !important; }
/* одна версия из двух: без раскраски удалений и вставок (кроме вида «Одной колонкой»,
   где удалённые строки — единственный способ показать «Было») */
.is-onesided:not(.is-inline) .cp-editor :is(.line-insert, .line-delete, .char-insert, .char-delete, .gutter-insert, .gutter-delete, .diagonal-fill) { background: transparent !important; }
.is-onesided:not(.is-inline) .cp-editor :is(.insert-sign, .delete-sign) { visibility: hidden; }
.is-onesided:not(.is-inline) .cp-editor :is(.gutter, .diffOverview > *) { visibility: hidden; }
/* подсказка в пустом поле — как у обычного текстового поля */
.cp-editor .editorPlaceholder, .cp-single .editorPlaceholder { color: #93A0A8 !important; font-family: var(--font-body) !important; font-size: 14px !important; font-style: normal !important; }

/* ---------- Адаптив ---------- */
/* узкая шапка панели: у кнопок остаются только значки (подписи — в подсказках) */
@container cphead (max-width: 440px) {
  .cp-head-actions .cp-btn-label { display: none; }
  .cp-head-actions .cp-btn--sm { width: 32px; padding: 0; }
}
@container cphead (max-width: 360px) {
  .cp-head-text { flex-direction: column; align-items: flex-start; gap: 0; }
  .cp-head-meta { max-width: 100%; padding-left: 16px; font-size: 12px; line-height: 16px; }
  .cp-head-title { line-height: 18px; }
}
@container cptool (max-width: 900px) {
  .cp-bar-side .cp-btn-label { display: none; }
  .cp-bar-side #cpUndo { width: 40px; padding: 0; }
}
@container cptool (max-width: 760px) {
  .cp-bar-main .cp-btn-label { display: none; }
  #cpSettingsBtn { width: 40px; padding: 0; }
  #cpSettingsBtn .cp-flag { position: absolute; top: 8px; right: 8px; }
  .cp-select { min-width: 150px; }
}

/* Телефон и узкая колонка: шаги-вкладки, одна панель */
.is-compact { --cp-col-a: 1fr; --cp-band: 0px; --cp-col-b: 0px; }
/* панель в две строки: вкладки на всю ширину; ниже язык и три кнопки-значка */
.is-compact .cp-bar { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 40px); gap: 8px; }
.is-compact .cp-bar-main, .is-compact .cp-bar-side { display: contents; }
.is-compact .cp-seg--view { display: none; }
.is-compact .cp-seg--tabs { display: flex; grid-column: 1 / -1; }
.is-compact .cp-seg--tabs .cp-seg-btn { flex: 1 1 0; padding: 0 8px; }
.is-compact .cp-select { grid-column: 1; width: 100%; min-width: 0; }
.is-compact .cp-bar .cp-btn-label { display: none; }
.is-compact #cpSettingsBtn, .is-compact #cpUndo { width: 40px; padding: 0; }
.is-compact #cpSettingsBtn .cp-flag { position: absolute; top: 8px; right: 8px; }
.is-compact .cp-bar .cp-pop { position: static; }
.is-compact .cp-heads { grid-template-columns: 1fr; }
.is-compact .cp-band { display: none; }
.is-compact .cp-head { display: none; }
.is-compact[data-step="a"] .cp-head[data-side="a"],
.is-compact[data-step="b"] .cp-head[data-side="b"],
.is-compact[data-step="diff"] .cp-head--diff { display: flex; }
.is-compact .cp-menu-item--compact { display: flex; }
/* пальцем: пункты меню и кнопки в шапке — не меньше 40–44 px */
.is-compact .cp-menu-item { height: 44px; }
.is-compact .cp-head { height: 56px; }
.is-compact .cp-head .cp-btn--sm { width: 40px; height: 40px; }
.is-compact .cp-menu--settings { left: 0; right: 0; width: auto; }
.is-compact .cp-body { height: clamp(360px, 60vh, 560px); }
.is-compact .cp-foot { flex-direction: column; align-items: stretch; justify-content: center; }
.is-compact .cp-summary { justify-content: space-between; flex-wrap: wrap; }
.is-compact .cp-foot-actions { margin-left: 0; }
.is-compact .cp-foot-actions > .cp-btn { flex: 1 1 0; padding: 0 12px; }
.is-compact .cp-editor .monaco-diff-editor .editor.modified { border-radius: 0; }
.is-compact .cp-wide { display: none; }
@media (max-width: 480px) { .cp-tool { padding: 16px; border-radius: 20px; } .cp-work { padding: 4px; border-radius: 18px; } }

/* =========================================================
   SEO-БЛОКИ — белые панели со строками
   ========================================================= */
.cp-seo { container-type: inline-size; container-name: cpseo; }
.cp-seo-panel { padding: 8px 32px; background: var(--color-surface); border: 1px solid rgba(43, 47, 51, 0.07); border-radius: var(--radius-lg); }
.cp-srow { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 28px; align-items: start; padding: 24px 0; border-top: 1px solid rgba(43, 47, 51, 0.08); }
.cp-srow:first-child { border-top: none; }
.cp-srow-mark { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; line-height: 1.5; letter-spacing: -0.01em; color: var(--color-accent-dark); }
.cp-srow h3 { font-size: 17px; line-height: 1.35; margin: 0 0 8px; color: var(--color-text-strong); }
.cp-srow p { font-size: 14.5px; line-height: 1.75; color: var(--color-muted); margin: 0 0 10px; }
.cp-srow p:last-child { margin-bottom: 0; }
.cp-srow strong { color: var(--color-text-strong); font-weight: 600; }

.cp-seo-panel pre { margin: 10px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--cp-soft, #F7F8FA); border: 1px solid rgba(43, 47, 51, 0.08); font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; color: var(--color-text-strong); white-space: pre-wrap; overflow-wrap: anywhere; }
@container cpseo (max-width: 700px) {
  .cp-seo-panel { padding: 4px 20px; }
  .cp-srow { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
}
@supports not (container-type: inline-size) {
  @media (max-width: 952px) { .cp-srow { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; } }
}
