/* =========================================================
   СЖАТЬ ИЗОБРАЖЕНИЕ (/tools/compress-image)
   Палитра и переменные — из style.css, префикс классов — cm-.

   Тот же язык, что у конвертера изображений (раздел «Графика и
   изображения» выглядит одним продуктом): белая карточка → серые
   поля → белые элементы поверх. Кнопки — три вида: primary (зелёная,
   одна на экран — «Скачать»), line (белая с обводкой), quiet.
   Активный выбор — белая плашка с зелёной обводкой, а не заливка.
   Раскладка переключается по ширине самого инструмента
   (контейнерные запросы): сайдбар сайта в 332 px делает
   медиазапросы по окну неточными.
   ========================================================= */

[hidden] { display: none !important; }

/* Мелкий текст и ссылки темнее общих токенов сайта: контраст не ниже
   4,5:1 (WCAG AA) и на белом, и на сером поле; кольцо выбора — 3:1 */
.cm-tool, .cm-seo {
  --cm-muted: #557479;
  --cm-link: #0E7F47;
  --cm-ring: #12A05C;
}

.cm-tool {
  --cm-field: #F2F4F6;
  --cm-field-hover: #ECEFF2;
  --cm-line: #E3E7EB;
  --cm-line-strong: #D3D9DF;
  --cm-ok: #0E7F47;
  --cm-warn: #8A5A0F;
  --cm-err: #C23B3B;
  position: relative;
  /* 56px — как между остальными секциями страницы (.section, .tool-seo) */
  margin: 0 0 56px;
  padding: 24px;
  background: var(--color-surface);
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(16, 20, 24, 0.04);
  container: cmtool / inline-size;
}
.cm-file-input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- Кнопки ---------- */
.cm-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border: 0; border-radius: 12px; background: transparent;
  font: inherit; font-size: 14.5px; 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);
}
.cm-btn i { display: inline-flex; font-size: 17px; line-height: 1; }
.cm-btn:disabled { cursor: not-allowed; }
.cm-btn--primary { background: var(--color-accent); color: #06231A; }
.cm-btn--primary:hover:not(:disabled) { background: #17C56C; color: #06231A; }
.cm-btn--primary:disabled { background: var(--cm-field); color: var(--cm-muted); }
.cm-btn--line { background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--cm-line-strong); }
.cm-btn--line:hover:not(:disabled) { box-shadow: inset 0 0 0 1px #B9C1C9; background: #FBFCFD; }
.cm-btn--quiet { font-weight: 500; color: var(--color-text); }
.cm-btn--quiet:hover:not(:disabled) { background: var(--cm-field); color: var(--color-text-strong); }
.cm-btn--sm { height: 34px; padding: 0 12px; gap: 6px; border-radius: 10px; font-size: 13.5px; }
.cm-btn--sm i { font-size: 15px; }
.cm-btn--wide { width: 100%; }
.cm-btn--primary.cm-btn--wide { height: 50px; font-size: 15px; }
.cm-dl-label { overflow: hidden; text-overflow: ellipsis; }
.cm-dl-meta { font-weight: 500; opacity: 0.72; }
.cm-dl-meta::before { content: "·"; margin-right: 8px; }
.cm-btn.is-busy i { animation: cm-spin 1s linear infinite; }
.cm-btn:focus-visible, .cm-seg-btn:focus-visible, .cm-chip:focus-visible, .cm-icon-btn:focus-visible, .cm-pick:focus-visible,
.cm-more summary:focus-visible, .cm-select:focus-visible, .cm-input:focus-visible, .cm-stage:focus-visible, .cm-share-btn:focus-visible,
.cm-check input:focus-visible + .cm-check-box { outline: 2px solid var(--cm-ring); outline-offset: 2px; }

/* ---------- Раскладка ---------- */
.cm-work { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.cm-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cm-panel { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.cm-panel.is-sticky { position: sticky; top: 16px; }
.cm-tool:not(.has-files) .cm-actions { display: none; }

/* ---------- Пустое состояние ---------- */
.cm-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 380px; padding: 48px 24px 44px;
  background: var(--cm-field); border-radius: 20px;
  text-align: center; cursor: pointer;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}
.cm-drop:hover { background: var(--cm-field-hover); }
.cm-tool:has(.cm-file-input:focus-visible) .cm-drop { box-shadow: inset 0 0 0 2px var(--cm-ring); }
.cm-drop-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin-bottom: 8px;
  border-radius: 16px; background: var(--color-surface);
  font-size: 26px; color: var(--color-accent-dark);
  box-shadow: 0 1px 2px rgba(16, 20, 24, 0.06);
}
.cm-drop-title { font-family: var(--font-display); font-size: 21px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; color: var(--color-text-strong); }
.cm-drop-sub { font-size: 14.5px; color: var(--cm-muted); }
.cm-drop-btn { margin-top: 14px; pointer-events: none; }
.cm-drop:hover .cm-drop-btn { background: #17C56C; color: #06231A; }
.cm-drop-formats { max-width: 420px; margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--cm-muted); }
.cm-privacy { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 0; font-size: 13px; line-height: 1.5; color: var(--cm-muted); text-align: center; }
.cm-privacy i { display: inline-flex; font-size: 15px; color: var(--cm-link); }

/* ---------- Сравнение до/после ---------- */
.cm-view { display: flex; flex-direction: column; gap: 10px; padding: 8px; background: var(--cm-field); border-radius: 20px; }
.cm-view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 0 2px 0 10px; }
.cm-view-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.cm-view-name { overflow: hidden; font-size: 14px; font-weight: 600; color: var(--color-text-strong); white-space: nowrap; text-overflow: ellipsis; }
.cm-view-dims { flex-shrink: 0; font-size: 13px; color: var(--cm-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cm-seg--zoom { flex-shrink: 0; background: var(--color-surface); }
.cm-seg--zoom .cm-seg-btn { flex: 0 0 auto; min-width: 48px; padding: 0 10px; }
.cm-seg--zoom .cm-seg-btn.is-active { background: var(--cm-field); box-shadow: none; }

.cm-stage {
  position: relative; overflow: hidden;
  height: 420px; border-radius: 14px;
  background: var(--cm-field);
  cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.cm-tool.is-zoomed .cm-stage { cursor: grab; touch-action: none; }
.cm-tool.is-panning .cm-stage { cursor: grabbing; }
/* шахматка только под самим снимком — чтобы видеть прозрачные участки */
.cm-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; image-rendering: auto; background: #fff repeating-conic-gradient(#EEF0F3 0% 25%, #fff 0% 50%) 0 0 / 16px 16px; }
.cm-tool.is-zoomed .cm-img { image-rendering: pixelated; }
.cm-after-wrap { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.cm-label {
  position: absolute; top: 12px; z-index: 2;
  padding: 6px 11px; border-radius: 999px;
  background: rgba(25, 27, 30, 0.74); color: #fff;
  font-size: 12.5px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap;
  pointer-events: none;
}
.cm-label--before { left: 12px; }
.cm-lw-s { display: none; }
.cm-label--after { right: 12px; }
.cm-handle { position: absolute; top: 0; bottom: 0; left: 50%; z-index: 3; width: 44px; margin-left: -22px; cursor: ew-resize; touch-action: none; }
.cm-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(16, 20, 24, 0.14); }
.cm-grip {
  position: absolute; top: 50%; left: 50%;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(16, 20, 24, 0.12), 0 6px 16px -6px rgba(16, 20, 24, 0.35);
  font-size: 16px; color: var(--color-text-strong);
}
.cm-grip i { display: inline-flex; margin: 0 -3px; }
.cm-stage-busy { position: absolute; left: 50%; bottom: 14px; z-index: 4; transform: translateX(-50%); pointer-events: none; }
.cm-stage-busy > span {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; background: rgba(25, 27, 30, 0.8); color: #fff;
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.cm-stage-busy i { display: inline-flex; font-size: 15px; animation: cm-spin 0.9s linear infinite; }

.cm-view-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; min-height: 40px; padding: 0 4px 0 6px; }
.cm-view-foot:not(:has(> :not([hidden]))) { display: none; }
.cm-verdict {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  padding: 7px 12px 7px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--color-text-strong);
}
.cm-verdict i { display: inline-flex; font-size: 16px; }
.cm-verdict.is-top, .cm-verdict.is-good { background: #DDF6E8; }
.cm-verdict.is-top i, .cm-verdict.is-good i { color: var(--cm-ok); }
.cm-verdict.is-ok { background: #FBF0D9; }
.cm-verdict.is-ok i { color: var(--cm-warn); }
.cm-verdict.is-low { background: #FBE3E3; }
.cm-verdict.is-low i { color: var(--cm-err); }
.cm-verdict.is-plain { background: var(--color-surface); }
.cm-verdict.is-plain i { color: var(--cm-muted); }

.cm-quality { display: flex; align-items: center; gap: 12px; flex: 1 1 280px; justify-content: flex-end; min-width: 0; }
.cm-quality-label { flex-shrink: 0; margin: 0; font-size: 13px; color: var(--cm-muted); white-space: nowrap; }
.cm-quality-label strong { display: inline-block; min-width: 2ch; font-weight: 600; color: var(--color-text-strong); font-variant-numeric: tabular-nums; }
.cm-range {
  --fill: 50%;
  flex: 1 1 auto; min-width: 90px; max-width: 220px; height: 22px; margin: 0;
  background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer;
}
.cm-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--cm-ring) var(--fill), var(--cm-line-strong) var(--fill)); }
.cm-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--cm-line-strong); }
.cm-range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--cm-ring); }
.cm-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(16, 20, 24, 0.16), 0 2px 6px rgba(16, 20, 24, 0.18); }
.cm-range::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(16, 20, 24, 0.16), 0 2px 6px rgba(16, 20, 24, 0.18); }
.cm-range:focus-visible { outline: none; }
.cm-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--cm-ring); }
.cm-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--cm-ring); }

/* ---------- Список файлов ---------- */
.cm-files { display: flex; flex-direction: column; gap: 10px; padding: 8px; background: var(--cm-field); border-radius: 20px; }
.cm-files-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; padding: 0 4px 0 10px; }
.cm-files-count { font-size: 14px; font-weight: 600; color: var(--color-text-strong); font-variant-numeric: tabular-nums; }
.cm-files-actions { display: flex; gap: 4px; }
.cm-files-actions .cm-btn--quiet:hover:not(:disabled) { background: var(--color-surface); }
.cm-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }

.cm-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "pick acts" "notes notes";
  align-items: center; column-gap: 8px;
  padding: 8px; background: var(--color-surface); border-radius: 14px;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow var(--transition-fast);
}
.cm-item.is-selected { box-shadow: inset 0 0 0 2px var(--cm-ring); }
.cm-pick {
  grid-area: pick;
  display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 14px;
  min-width: 0; padding: 0; border: 0; border-radius: 10px; background: none;
  font: inherit; text-align: left; color: inherit; cursor: pointer;
}
.cm-thumb {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; overflow: hidden;
  border-radius: 10px;
  background: #fff repeating-conic-gradient(#EEF0F2 0% 25%, #fff 0% 50%) 0 0 / 12px 12px;
  box-shadow: inset 0 0 0 1px rgba(16, 20, 24, 0.06);
  font-size: 11px; font-weight: 700; color: var(--cm-muted); letter-spacing: 0.02em;
}
.cm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cm-name { overflow: hidden; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--color-text-strong); white-space: nowrap; text-overflow: ellipsis; }
.cm-meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; row-gap: 2px; font-size: 13px; line-height: 1.45; color: var(--cm-muted); font-variant-numeric: tabular-nums; }
.cm-arrow { display: inline-flex; font-size: 13px; color: #9AA4AD; }
.cm-to { color: var(--color-text-strong); font-weight: 600; }
.cm-delta { font-weight: 500; }
.cm-delta.is-down { color: var(--cm-ok); font-weight: 600; }
.cm-busy-text { color: var(--cm-muted); }
.cm-notes { grid-area: notes; display: flex; flex-direction: column; gap: 1px; margin: 6px 0 2px 70px; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.45; color: var(--cm-muted); }
.cm-notes li { position: relative; padding-left: 12px; }
.cm-notes li::before { content: ""; position: absolute; left: 1px; top: 0.62em; width: 4px; height: 4px; border-radius: 50%; background: #B3BCC4; }
.cm-notes.is-error { color: var(--cm-err); }
.cm-notes.is-error li { padding-left: 0; }
.cm-notes.is-error li::before { content: none; }

.cm-acts { grid-area: acts; display: flex; align-items: center; gap: 2px; }
.cm-state { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; font-size: 18px; color: var(--cm-muted); }
.cm-state:empty { display: none; }
.cm-state.is-err { color: var(--cm-err); }
.cm-state.is-spin i { display: inline-flex; animation: cm-spin 0.9s linear infinite; }
.cm-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 10px; background: transparent;
  font-size: 18px; color: var(--color-text); cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.cm-icon-btn:hover { background: var(--cm-field); color: var(--color-text-strong); }
.cm-dl { color: var(--cm-link); }
.cm-dl:hover { color: var(--cm-link); }
.cm-rm { color: #8A949D; }
.cm-item.is-error .cm-thumb img { opacity: 0.4; }
@keyframes cm-spin { to { transform: rotate(360deg); } }

/* ---------- Боковая панель ---------- */
.cm-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.cm-group { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cm-row { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cm-label-title { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--color-text-strong); }
.cm-hint { margin: 0; font-size: 13px; line-height: 1.5; color: var(--cm-muted); }

.cm-seg { display: flex; gap: 2px; padding: 3px; background: var(--cm-field); border-radius: 12px; }
.cm-seg-btn {
  flex: 1 1 0; min-width: 0; height: 34px; padding: 0 6px;
  border: 0; border-radius: 9px; background: transparent;
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--color-text); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}
.cm-seg-btn:hover { color: var(--color-text-strong); }
.cm-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); }

.cm-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cm-chip {
  height: 38px; padding: 0 6px;
  border: 0; border-radius: 10px; background: var(--cm-field);
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--color-text); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}
.cm-chip:hover { background: var(--cm-field-hover); }
.cm-chip.is-active { background: var(--color-surface); color: var(--color-text-strong); font-weight: 600; box-shadow: inset 0 0 0 2px var(--cm-ring); }

.cm-target-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px 96px; align-items: center; gap: 8px; }
.cm-target-caption { font-size: 13px; color: var(--cm-muted); }
.cm-input {
  width: 100%; height: 38px; padding: 0 10px; border: 0; border-radius: 10px;
  background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--cm-line-strong);
  font: inherit; font-size: 14px; font-weight: 600; color: var(--color-text-strong); font-variant-numeric: tabular-nums; text-align: right;
}
.cm-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--cm-ring); }
.cm-seg--unit .cm-seg-btn { height: 32px; }

.cm-check { position: relative; display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--color-text-strong); cursor: pointer; }
.cm-check input { position: absolute; left: 0; top: 0; width: 20px; height: 20px; margin: 0; opacity: 0; cursor: pointer; }
.cm-check-box {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--color-surface); box-shadow: inset 0 0 0 1.5px var(--cm-line-strong);
  font-size: 14px; color: transparent;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}
.cm-check input:checked + .cm-check-box { background: var(--cm-ring); box-shadow: none; color: #fff; }
.cm-check-text { padding-top: 1px; }

.cm-more { border-top: 1px solid var(--cm-line); border-bottom: 1px solid var(--cm-line); }
.cm-more summary {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px; font-size: 14px; font-weight: 600; color: var(--color-text-strong);
  list-style: none; cursor: pointer;
}
.cm-more summary::-webkit-details-marker { display: none; }
.cm-more summary i { display: inline-flex; font-size: 18px; color: var(--cm-muted); transition: transform var(--transition-fast); }
.cm-more[open] summary i { transform: rotate(180deg); }
.cm-more-body { display: flex; flex-direction: column; gap: 10px; padding: 2px 0 18px; }
.cm-more-body .cm-check { margin-top: 8px; }
.cm-select {
  --select-pad: 12px;
  width: 100%; height: 38px; padding-block: 0; border: 0; border-radius: 10px;
  background-color: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--cm-line-strong);
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--color-text-strong); cursor: pointer;
}
.cm-select:disabled { background-color: var(--cm-field); box-shadow: none; color: var(--cm-muted); cursor: not-allowed; }

/* ---------- Итог и скачивание ---------- */
.cm-actions { display: flex; flex-direction: column; gap: 10px; }
.cm-saved { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 16px; background: var(--cm-field); }
.cm-saved-pct { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; color: var(--cm-ok); font-variant-numeric: tabular-nums; }
.cm-saved-text { font-size: 13.5px; line-height: 1.5; color: var(--color-text); font-variant-numeric: tabular-nums; }
.cm-status { margin: 0; font-size: 13px; line-height: 1.45; color: var(--cm-muted); text-align: center; font-variant-numeric: tabular-nums; }
.cm-share { display: flex; align-items: center; justify-content: center; gap: 6px; padding-top: 2px; }
.cm-share-text { margin-right: 4px; font-size: 13px; color: var(--cm-muted); }
.cm-share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; background: var(--cm-field); color: var(--color-text-strong);
  transition: background-color var(--transition-fast);
}
.cm-share-btn:hover { background: var(--cm-field-hover); }
.cm-share-btn .share-icon-glyph { width: 16px; height: 16px; }

/* ---------- Перетаскивание поверх инструмента ---------- */
.cm-overlay { position: absolute; inset: 0; z-index: 20; display: none; padding: 12px; border-radius: 24px; background: rgba(255, 255, 255, 0.95); pointer-events: none; }
.cm-tool.is-drag .cm-overlay { display: flex; }
.cm-overlay span { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 2px dashed var(--color-accent-dark); border-radius: 18px; font-size: 16px; font-weight: 600; color: var(--color-text-strong); }
.cm-overlay i { font-size: 30px; color: var(--color-accent-dark); }

/* ---------- Уведомление ---------- */
.cm-msg {
  position: fixed; left: 50%; bottom: 24px; z-index: 2100;
  display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: min(560px, 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: cm-toast 180ms ease-out;
}
.cm-msg > i { display: inline-flex; font-size: 16px; color: var(--color-accent); flex-shrink: 0; }
.cm-msg--error > i { color: #FF8F8F; }
@keyframes cm-toast { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (min-width: 1024px) { .cm-msg { left: calc(50% + var(--sidebar-width, 332px) / 2); } }

/* ---------- Адаптив по ширине инструмента ---------- */
@container cmtool (max-width: 900px) {
  .cm-work { display: flex; flex-direction: column; align-items: stretch; gap: 22px; }
  .cm-panel { display: contents; }
  .cm-main { order: 1; }
  .cm-side { order: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 24px; align-items: start; }
  .cm-side > .cm-more { grid-column: 1 / -1; }
  .cm-side:has(#cmLevelGroup[hidden]):has(#cmTargetGroup[hidden]) > .cm-group:first-child { grid-column: 1 / -1; }
  .cm-drop { min-height: 0; }
  /* «Скачать» прилипает к низу экрана, пока виден инструмент */
  .cm-actions {
    order: 3; position: sticky; bottom: 12px; z-index: 6;
    padding: 8px; margin: 0 -8px -8px;
    background: var(--color-surface); border-radius: 18px;
    box-shadow: 0 -1px 0 var(--cm-line), 0 10px 30px -12px rgba(16, 20, 24, 0.35);
  }
  .cm-saved { flex-direction: row; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 12px; }
  .cm-saved-pct { font-size: 30px; }
  .cm-saved-text { font-size: 13px; }
  .cm-tool.is-stuck .cm-actions { gap: 6px; }
  .cm-tool.is-stuck .cm-saved { gap: 10px; padding: 2px 6px; background: none; }
  .cm-tool.is-stuck .cm-saved-pct { font-size: 22px; }
  .cm-tool.is-stuck .cm-saved-text { font-size: 12.5px; line-height: 1.4; }
  .cm-tool.is-stuck .cm-share { display: none; }
}
@container cmtool (max-width: 600px) {
  .cm-side { display: flex; flex-direction: column; align-items: stretch; gap: 20px; }
  .cm-seg-btn { height: 38px; }
  .cm-drop { padding: 36px 16px 32px; }
  .cm-drop-title { font-size: 19px; }
  .cm-pick { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; }
  .cm-thumb { width: 48px; height: 48px; }
  .cm-notes { margin-left: 60px; }
  .cm-files, .cm-view { padding: 6px; border-radius: 18px; }
  .cm-files-head { padding-left: 8px; }
  .cm-view-head { flex-wrap: wrap; row-gap: 6px; padding-left: 8px; }
  .cm-view-foot { padding: 0 2px 2px; }
  .cm-quality { flex-basis: 100%; justify-content: flex-start; }
  .cm-range { max-width: none; }
  .cm-label { top: 8px; padding: 5px 9px; font-size: 12px; }
  .cm-label--before { left: 8px; }
  .cm-label--after { right: 8px; }
}
@container cmtool (max-width: 420px) {
  .cm-item { column-gap: 4px; }
  .cm-pick { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; }
  .cm-thumb { width: 44px; height: 44px; }
  .cm-notes { margin-left: 54px; }
  .cm-acts { gap: 0; }
  .cm-acts .cm-icon-btn, .cm-state { width: 32px; height: 32px; }
  .cm-files-head { padding-left: 6px; gap: 8px; }
  .cm-files-count { white-space: nowrap; font-size: 13.5px; }
  #cmClear { width: 34px; padding: 0; }
  #cmClear .cm-btn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cm-target-row { grid-template-columns: minmax(0, 1fr) 96px; }
  .cm-target-caption { grid-column: 1 / -1; }
  .cm-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cm-saved-pct { font-size: 26px; }
  .cm-tool.is-stuck .cm-saved-pct { font-size: 22px; }
  .cm-dl-meta { display: none !important; }
  .cm-lw { display: none; }
  .cm-lw-s { display: inline; }
}
@container cmtool (max-width: 300px) {
  .cm-seg-btn { padding: 0 2px; font-size: 12.5px; letter-spacing: -0.01em; }
  .cm-files-head { flex-wrap: wrap; row-gap: 4px; }
}
@media (max-width: 480px) { .cm-tool { padding: 16px; border-radius: 20px; } }
@media (prefers-reduced-motion: reduce) { .cm-state.is-spin i, .cm-btn.is-busy i, .cm-stage-busy i { animation: none; } }

/* =========================================================
   SEO-БЛОКИ — белые панели со строками (как у конвертера)
   ========================================================= */
.cm-seo { container-type: inline-size; container-name: cmseo; }
.cm-seo-panel { padding: 8px 32px; background: var(--color-surface); border: 1px solid rgba(43, 47, 51, 0.07); border-radius: var(--radius-lg); }
.cm-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); }
.cm-srow:first-child { border-top: none; }
.cm-srow-mark { padding-top: 2px; font-family: var(--font-display); font-weight: 700; font-size: 14.5px; line-height: 1.5; letter-spacing: -0.01em; color: var(--cm-link); } /* 2px — общая базовая линия с h3 справа */
.cm-srow h3 { font-size: 17px; line-height: 1.35; margin: 0 0 8px; color: var(--color-text-strong); }
.cm-srow p { font-size: 14.5px; line-height: 1.75; color: var(--cm-muted); margin: 0 0 10px; }
.cm-srow p:last-child { margin-bottom: 0; }
.cm-srow strong { color: var(--color-text-strong); font-weight: 600; }

.cm-srow ul { margin: 0 0 10px; padding-left: 18px; font-size: 14.5px; line-height: 1.75; color: var(--cm-muted); }
.cm-srow li + li { margin-top: 2px; }
.cm-seo-table { width: 100%; margin: 4px 0 0; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.cm-seo-table thead th { padding: 10px 12px 8px 0; font-size: 12.5px; font-weight: 600; text-align: left; color: var(--cm-muted); }
.cm-seo-table tbody th, .cm-seo-table td { padding: 10px 12px 10px 0; border-top: 1px solid rgba(43, 47, 51, 0.08); vertical-align: top; text-align: left; color: var(--cm-muted); }
.cm-seo-table tbody th { font-weight: 600; color: var(--color-text-strong); }
.cm-seo-table strong { font-weight: 600; color: var(--color-text-strong); }
.cm-seo-sub { display: block; font-size: 12.5px; color: var(--cm-muted); }
.cm-seo-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cm-seo-table th.num, .cm-seo-table td.num { text-align: right; padding-right: 0; }
.cm-seo-panel--table { padding: 16px 32px 20px; }
.cm-seo-note { margin: 14px 0 0; font-size: 13px; line-height: 1.6; color: var(--cm-muted); }
@container cmseo (max-width: 700px) {
  .cm-seo-panel { padding: 4px 20px; }
  .cm-srow { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 20px 0; }
  .cm-srow-mark { padding-top: 0; }
  .cm-seo-table { font-size: 13.5px; }
  .cm-seo-table--stack thead { display: none; }
  .cm-seo-table--stack tr { display: block; padding: 10px 0; border-top: 1px solid rgba(43, 47, 51, 0.08); }
  .cm-seo-table--stack tr:first-child { border-top: 0; }
  .cm-seo-table--stack tbody th, .cm-seo-table--stack td { display: block; padding: 2px 0; border: 0; white-space: normal !important; text-align: left !important; }
  .cm-seo-table--stack tbody th { padding-bottom: 4px; }
  .cm-seo-table--stack td[data-label]::before { content: attr(data-label) ": "; }
  .cm-seo-table--stack .cm-seo-sub { display: inline; }
  .cm-seo-table--stack .cm-seo-sub::before { content: " · "; }
  .cm-seo-panel--table { padding: 8px 20px 16px; }
}
