/* HTML-редактор: панель кнопок, две области (на узком экране — вкладки), очистка, SEO-проверка. */
.he { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.he-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; z-index: 5;
  background: var(--card); padding: 6px 0; }
.he-block { width: auto; min-width: 150px; min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
.he-group { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.he-group button { min-width: 40px; min-height: 40px; padding: 0 10px; font-size: .95rem; color: var(--text); border-right: 1px solid var(--line); }
.he-group button:last-child { border-right: 0; }
.he-group button:hover { background: var(--cyan-soft); color: var(--cyan); }

.he-tabs { display: none; gap: 6px; }
.he-tabs button { flex: 1; min-height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-weight: 700; font-size: .9rem; color: var(--text-muted); }
.he-tabs button[aria-selected="true"] { background: var(--cyan-soft); color: var(--cyan); border-color: var(--cyan); }

.he-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.he-pane { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.he-pane-label { font-size: .8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.he-frame { width: 100%; height: 520px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; }
.he-code { height: 520px; min-height: 0; resize: vertical; font-size: .84rem; white-space: pre-wrap; tab-size: 2; }
@media (max-width: 979px) {
  .he-tabs { display: flex; }
  .he-panes { grid-template-columns: minmax(0, 1fr); }
  .he-pane-label { display: none; }
  .he-panes[data-active="visual"] .he-pane-code, .he-panes[data-active="code"] .he-pane-visual { display: none; }
  .he-frame, .he-code { height: 420px; }
}

.he-clean { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.he-clean-opts { display: flex; flex-wrap: wrap; gap: 0 20px; }
.he-clean-opts .tool-check { min-height: 36px; font-size: .9rem; }
.he-clean-opts code, .he-clean .tool-label code { font-family: var(--font-mono); font-size: .88em; color: var(--cyan); }

.he-seo { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; }
.he-seo summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.he-seo-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 10px; }
@media (min-width: 820px) { .he-seo-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.he-outline { list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: .9rem; color: var(--text-read); }
.he-outline li { padding-left: calc(var(--lvl, 0) * 18px); overflow-wrap: anywhere; }
.he-outline li.is-bad { color: var(--amber); }
.he-outline .he-empty { color: var(--text-muted); }
.he-h-tag { font-family: var(--font-mono); font-size: .78rem; font-weight: 700; color: var(--cyan); }
.he-outline li.is-bad .he-h-tag { color: var(--amber); }
.he-issues { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; }
.he-issues:empty::before { content: "Замечаний нет"; color: var(--green); }
.he-issues li { padding: 6px 10px 6px 28px; border-radius: var(--r-sm); position: relative; color: var(--text-read); }
.he-issues li::before { position: absolute; left: 10px; font-weight: 800; }
.he-i-warn { background: rgba(245,158,11,.08); } .he-i-warn::before { content: "!"; color: var(--amber); }
.he-i-tip { background: var(--cyan-soft); } .he-i-tip::before { content: "i"; color: var(--cyan); }
.he-i-info { color: var(--text-muted) !important; } .he-i-info::before { content: "·"; color: var(--text-muted); }

/* иконки, нажатые «Ж»/«К», фокус в панели, плашка про скрытые картинки */
.he-group button { display: inline-flex; align-items: center; justify-content: center; }
.he-group button svg { display: block; }
.he-group button[aria-pressed="true"] { background: var(--cyan-soft); color: var(--cyan); }
.he-group button:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; border-radius: 0; }
.he-imgs { padding: 8px 12px; font-size: .88rem; }
.he-imgs button { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.he-paste b { color: var(--text); font-weight: 600; }

/* ---------- v2: отмена действия, анализ текста ---------- */
.he-undo { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; margin-left: 4px; }
.he-text-body { display: flex; flex-direction: column; gap: 12px; padding-top: 10px; }
.he-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.he-metric { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.he-metric b { font-family: var(--font-mono); font-size: 1.15rem; color: var(--text); }
.he-metric span { font-size: .78rem; color: var(--text-muted); }
.he-metric.is-bad b { color: var(--amber); }
.he-text-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 820px) { .he-text-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.he-top, .he-anchors { display: flex; flex-direction: column; gap: 3px; font-size: .88rem; color: var(--text-read); padding-left: 1.3em; }
.he-anchors { list-style: none; padding-left: 0; max-height: 260px; overflow: auto; }
.he-anchors li { overflow-wrap: anywhere; }
.he-top li.is-bad, .he-anchors li.is-bad { color: var(--amber); }
.he-anchors .he-empty { color: var(--text-muted); }

/* UI v2: главное — «Очистить HTML» и «Копировать код», остальное — тихие ряды «Текст» и «Файл», галочки — в настройках */
.he-main { align-items: center; }
.he-row { border-top: 1px solid var(--line); padding-top: 6px; }
.he-clean .tool-settings { margin-top: 4px; }
.he-clean-opts { flex-direction: row; flex-wrap: wrap; gap: 0 20px; }

/* панель кнопок прилипает только на широком экране — на телефоне в ней 3 строки, и она закрывала бы текст */
@media (min-width: 980px) { .he-toolbar { position: sticky; top: var(--header-h); } }
