/* ═══════════════════════════════════════════════════════════════
   WARPSCOUT GUI — stylesheet
   Dark carbon theme, orange accent (Cloudflare WARP vibe)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0e1114;
  --bg-soft: #14181d;
  --bg-card: #171c22;
  --bg-card-hover: #1b2129;
  --bg-input: #0f1317;
  --border: #232a32;
  --border-soft: #1d232b;
  --text: #e8e6e3;
  --text-dim: #9aa3ad;
  --text-faint: #7f8993; /* v2.4.6 (F52): ≥4.5:1 на карточках и сайдбаре (было #66707a — 3.4:1) */
  --accent: #f27c20;
  --accent-soft: rgba(242, 124, 32, 0.14);
  --accent-line: rgba(242, 124, 32, 0.35);
  --accent-text: #ffb06a;
  --ok: #46c26e;
  --ok-soft: rgba(70, 194, 110, 0.13);
  --warn: #e0a63a;
  --warn-soft: rgba(224, 166, 58, 0.13);
  --err: #e05b4d;
  --err-soft: rgba(224, 91, 77, 0.13);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Segoe UI", "Segoe UI Variable Text", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, "JetBrains Mono", monospace;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
  user-select: none;
}

::selection { background: var(--accent-soft); color: var(--accent-text); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a323c; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a4450; }

.hidden { display: none !important; }
[hidden] { display: none !important; }
.mono, code { font-family: var(--mono); font-size: 0.92em; }

/* ═══ Layout ═══ */
.app { display: flex; height: 100vh; }

.main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 20px 22px;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(242, 124, 32, 0.05), transparent 60%),
    var(--bg);
}

.tab { display: none; height: 100%; }
.tab.is-active { display: block; animation: tabIn 0.18s ease; }
@keyframes tabIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ═══ Sidebar ═══ */
.sidebar {
  width: 216px;
  min-width: 216px;
  background: var(--bg-soft);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  gap: 6px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand__icon { width: 38px; height: 38px; border-radius: 9px; }
.brand__name { font-weight: 700; letter-spacing: 0.04em; font-size: 14.5px; }
.brand__gui {
  color: var(--accent);
  margin-left: 5px;
  font-size: 11px;
  border: 1px solid var(--accent-line);
  padding: 1px 5px;
  border-radius: 5px;
  vertical-align: 2px;
}
.brand__sub { font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-dim);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
  min-height: 40px;
}
.nav__item:hover { background: var(--bg-card); color: var(--text); }
.nav__item.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-text);
}
.nav__ico { width: 17px; height: 17px; flex: none; }

.sidebar__footer { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px 6px 2px; }

.mode-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px dashed rgba(224, 166, 58, 0.5);
  padding: 4px 8px;
  border-radius: 7px;
  text-align: center;
}

.statusline { display: flex; flex-direction: column; gap: 3px; }
.statusline__row { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statusline__row.is-ok { color: var(--ok); }
.statusline__row.is-err { color: var(--err); }

.sidebar__ver { font-size: 10px; color: var(--text-faint); opacity: 0.75; }

/* ═══ Cards ═══ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card__head h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--text); text-transform: uppercase; }
.card__tools { display: flex; gap: 6px; flex-wrap: wrap; }
.card--results { padding: 10px 12px 12px; }
.card--details { padding: 0; }
.card--details > .card__head { padding: 13px 16px; cursor: pointer; list-style: none; }
.card--details > .card__head::-webkit-details-marker { display: none; }
.card--details > .card__head::after { content: "▾"; color: var(--text-faint); }
.card--details[open] > .card__head::after { content: "▴"; }
.card--details > *:not(.card__head) { padding: 0 16px 14px; }
.card--details .form-grid:first-of-type { padding-top: 2px; }

/* ═══ Chips / presets ═══ */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.12s;
  min-height: 32px;
}
.chip:hover { border-color: var(--accent-line); color: var(--text); }
.chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-text);
}

/* ═══ Segmented control ═══ */
.seg { display: flex; background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; }
.seg--wrap { flex-wrap: wrap; }
.seg__btn {
  flex: 1;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 32px;
  transition: background 0.12s, color 0.12s;
}
.seg__btn:hover { color: var(--text); background: var(--bg-card-hover); }
.seg__btn.is-active { background: var(--accent); color: #17100a; }

/* ═══ Buttons ═══ */
.btn {
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  cursor: pointer;
  transition: all 0.13s;
  min-height: 36px;
}
.btn:hover { border-color: #39424d; background: var(--bg-card-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn__ico { font-size: 11px; }
.btn--primary {
  background: linear-gradient(180deg, #f68b31, #e8731a);
  border-color: #b45a12;
  color: #1c1105;
  box-shadow: 0 2px 14px rgba(242, 124, 32, 0.25);
}
.btn--primary:hover { background: linear-gradient(180deg, #fb9540, #f07c22); border-color: #c96a18; }
.btn--danger {
  background: var(--err-soft);
  border-color: rgba(224, 91, 77, 0.45);
  color: #ef8b80;
}
.btn--danger:hover { background: rgba(224, 91, 77, 0.22); border-color: var(--err); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn--ghost:hover { background: var(--bg-card-hover); border-color: var(--border); color: var(--text); }
.btn--sm { padding: 4px 9px; min-height: 28px; font-size: 12px; border-radius: 7px; }
.btn--xl { padding: 11px 22px; min-height: 46px; font-size: 15px; border-radius: 11px; }

/* ═══ Forms ═══ */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
/* v2.7.0 (отчёт пользователя): длинные неразрывные идентификаторы AWG 3.1
   (ContentPaddingAddition, MaxHandshakeAttempts…) в узких ячейках перелезали
   на соседние подписи — переносим по символам там, где слов-границ нет */
.field__label { font-size: 12px; color: var(--text-dim); font-weight: 600; overflow-wrap: anywhere; }
.field__label code { color: var(--text-faint); font-size: 10.5px; background: var(--bg-input); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border-soft); }
/* v2.7.0: сетка AWG 3.1 — на всю ширину карточки (в правой половине внешней
   2-колоночной сетки ячейки получались ~90px, и 9 длинных полей не помещались) */
#cfgAwg31Grid { grid-column: 1 / -1; }

input[type="text"], input[type="number"], select, textarea {
  font: inherit;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.13s, box-shadow 0.13s;
  min-height: 37px;
  user-select: text;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input[readonly] { color: var(--text-dim); background: var(--bg-soft); }
select { font-family: var(--font); }
textarea { resize: vertical; min-height: 40px; line-height: 1.4; }

/* switch */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 8px;
}
.switch-row:hover { background: var(--bg-card-hover); }
.switch-row__title { font-weight: 600; font-size: 13px; }
.switch-row__title code { color: var(--text-faint); font-size: 10.5px; }
.switch-row .hint { margin: 1px 0 0; }
.switch-group { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.switch { position: relative; flex: none; width: 40px; height: 22px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i {
  position: absolute; inset: 0;
  background: #2a323c;
  border-radius: 999px;
  transition: background 0.15s;
  border: 1px solid var(--border);
}
.switch i::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #aab3bd;
  border-radius: 50%;
  transition: transform 0.15s, background 0.15s;
}
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }

.hint { font-size: 12px; color: var(--text-faint); }
.hint code { background: var(--bg-input); border: 1px solid var(--border-soft); border-radius: 4px; padding: 0 4px; color: var(--text-dim); }
.hint a { color: var(--accent-text); }
/* v2.4.1: полный путь виден ЦЕЛИКОМ (жалоба: «полный путь не был виден из-за короткой строки») */
.ws-fullpath { margin-top: 4px; line-height: 1.5; }
.ws-fullpath__label { color: var(--text-faint); }
.ws-fullpath code { display: inline; word-break: break-all; overflow-wrap: anywhere; font-size: 11.5px; padding: 1px 6px; }
/* v2.4.1: многострочная диагностика проверки warpscout */
.hint--pre { white-space: pre-line; line-height: 1.55; margin-top: 4px; }
.hint--pre.is-err-hint { color: var(--err, #ff6b6b); }
.row-buttons--tight { margin-top: 8px; gap: 6px; }
.row-buttons--tight .btn--sm { min-height: 26px; padding: 3px 8px; font-size: 11.5px; }

.badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}
.badge--accent { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-line); }
/* v2.6.4: живой индикатор фильтров узлов — компактный, не распирает шапку карточки */
.badge--filter { max-width: 46%; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
.mono-badge { font-family: var(--mono); font-size: 11px; color: var(--text-dim); background: var(--bg-input); border: 1px solid var(--border-soft); padding: 2px 7px; border-radius: 5px; margin-left: 8px; }

/* ═══ Scan tab ═══ */
.scan-grid { display: grid; grid-template-columns: minmax(360px, 480px) minmax(0, 1fr); gap: 18px; align-items: start; height: 100%; }
.scan-form { display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 40px); overflow-y: auto; padding-right: 6px; }
/* v2.6.6 (запрос пользователя): параметры скана недоступны, пока идёт скан —
   случайные нажатия по полям не выглядят как «что-то сломалось». Гасим всю
   колонку параметров; Пуск/Стоп, командная строка и лог — вне .scan-form и
   остаются доступными. disabled ставится кодом (setScanParamsLocked),
   pointer-events дополнительно отсекает тапы по не-контролам (чипы пресетов
   уже disabled, но подписи/лейблы тоже не должны ловить нажатия). */
.scan-form.is-locked { opacity: 0.55; pointer-events: none; user-select: none; }
.scan-form.is-locked input, .scan-form.is-locked select, .scan-form.is-locked textarea, .scan-form.is-locked button { cursor: not-allowed; }
.scan-lock-hint { color: var(--warn); font-weight: 600; margin: 0; }
.scan-exec { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.cmd-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #10151a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
}
.cmd-bar__label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-faint); text-transform: uppercase; flex: none; }
.cmd-bar__cmd {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-text);
  /* v2.4.4: команда переносится на несколько строк — точная команда видна целиком,
     а не обрезается многоточием за краем карточки (баг-репорт пользователя) */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.55;
  flex: 1;
  min-width: 0;
  max-height: 200px; /* ~10 строк — худший реальный случай (пути -o/-a) виден целиком; страховка от абсурдно длинных */
  overflow-y: auto;
  user-select: text;
}

.run-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.scan-progress { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 5px; }
.scan-progress__phase { font-size: 11.5px; color: var(--text-dim); font-weight: 600; }
.scan-progress__bar { height: 6px; background: var(--bg-input); border-radius: 999px; overflow: hidden; border: 1px solid var(--border-soft); }
.scan-progress__bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #ffb06a); border-radius: 999px; transition: width 0.3s; }

.card--results { min-height: 300px; flex: 1; }
.subtabs { display: flex; gap: 4px; }
.subtab {
  font: inherit; font-size: 12.5px; font-weight: 600;
  background: transparent; color: var(--text-dim);
  border: 1px solid transparent; border-radius: 7px;
  padding: 5px 11px; cursor: pointer; min-height: 30px;
  display: inline-flex; align-items: center; gap: 6px;
}
.subtab:hover { color: var(--text); background: var(--bg-card-hover); }
.subtab.is-active { background: var(--bg-input); border-color: var(--border); color: var(--text); }

.table-wrap { overflow: auto; max-height: calc(100vh - 265px); border-radius: 8px; }
.rtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rtable th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
  white-space: nowrap;
}
.rtable td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
  color: var(--text-dim);
}
.rtable td:first-child { color: var(--text); font-weight: 600; }
.rtable tr { cursor: pointer; transition: background 0.1s; }
.rtable tbody tr:hover { background: var(--bg-card-hover); }
.rtable tr.is-selected { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.rtable tr.is-torn td { color: #c9826f; }
.rtable tr.is-torn td:first-child::after { content: "разорван"; margin-left: 8px; font-size: 10px; color: var(--err); font-family: var(--font); border: 1px solid rgba(224,91,77,.4); border-radius: 4px; padding: 0 5px; }
.rtable .good { color: var(--ok); }
.rtable .mid { color: var(--warn); }
.rtable .bad { color: var(--err); }

.empty { text-align: center; padding: 46px 10px; color: var(--text-faint); }
.empty__ico { font-size: 34px; margin-bottom: 10px; filter: grayscale(0.4); }
.empty__title { font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.empty__hint { font-size: 12.5px; line-height: 1.6; }

.log-wrap { min-height: 200px; }
.log {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: #b9c2cc;
  background: #0c1013;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px 12px;
  overflow: auto;
  max-height: calc(100vh - 265px);
  min-height: 200px;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
}
.log--tall { max-height: 52vh; min-height: 260px; }
.log .lg-accent { color: var(--accent-text); }
.log .lg-ok { color: var(--ok); }
.log .lg-err { color: var(--err); }
.log .lg-dim { color: var(--text-faint); }

/* ═══ Config tab ═══ */
.config-grid { display: grid; grid-template-columns: minmax(380px, 500px) minmax(0, 1fr); gap: 18px; align-items: start; height: 100%; }
.config-form { display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 40px); overflow-y: auto; padding-right: 6px; }
.config-preview { min-width: 0; }
.card--preview { height: calc(100vh - 40px); }
.conf {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: #c7d0d9;
  background: #0c1013;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 12px 14px;
  overflow: auto;
  white-space: pre;
  user-select: text;
  min-height: 200px;
}
.conf .c-sec { color: var(--accent-text); font-weight: 700; }
.conf .c-key { color: #8fb4d9; }
.conf .c-dim { color: var(--text-faint); }
.conf .c-val { color: #d7e2ec; }
.cfg-advanced > summary { cursor: pointer; color: var(--text-dim); font-size: 12.5px; font-weight: 600; padding: 2px 0 8px; }
.cfg-advanced > summary:hover { color: var(--text); }
.row-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═══ Account / SOCKS / Tools / Settings ═══ */
.account-grid, .socks-grid, .tools-grid, .settings-grid {
  display: grid;
  grid-template-columns: minmax(400px, 560px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.settings-grid { grid-template-columns: minmax(400px, 620px); }
.tools-grid { grid-template-columns: 1fr 1fr; }
.tools-log { grid-column: 1 / -1; }
.acc-status { display: flex; flex-direction: column; gap: 8px; background: var(--bg-input); border: 1px solid var(--border-soft); border-radius: 9px; padding: 12px 14px; }
.acc-status__row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: 12.5px; color: var(--text-dim); }
.acc-status__row b { color: var(--text); font-weight: 600; white-space: nowrap; }
.acc-status__row b.is-ok { color: var(--ok); }
.acc-status__row b.is-err { color: var(--err); }
.acc-status__row b.is-warn { color: var(--warn); }
.code-clip { font-family: var(--mono); font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; direction: rtl; text-align: right; }
.socks-info { display: flex; flex-direction: column; gap: 7px; background: var(--ok-soft); border: 1px solid rgba(70,194,110,.35); border-radius: 9px; padding: 11px 13px; }
.socks-info__row { font-size: 12.5px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.socks-info__row code { color: var(--ok); user-select: text; }


/* ═══ History panel ═══ */
.history {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  padding: 8px;
  max-height: 260px;
  overflow-y: auto;
}
.history__head { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); padding: 2px 6px 6px; }
.history__empty { font-size: 12px; color: var(--text-faint); padding: 6px; }
.history__item {
  font: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 12px;
  transition: background 0.12s, border-color 0.12s;
}
.history__item:hover { background: var(--bg-card-hover); border-color: var(--border); color: var(--text); }
.history__ts { font-family: var(--mono); color: var(--text-faint); flex: none; }
.history__proto {
  font-weight: 700; font-size: 10px; letter-spacing: 0.05em;
  color: var(--accent-text); background: var(--accent-soft);
  border: 1px solid var(--accent-line); border-radius: 5px; padding: 1px 6px; flex: none;
}
.history__label { font-family: var(--mono); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.history__cnt { flex: none; }
.history__cnt.is-ok { color: var(--ok); }
.history__cnt.is-err { color: var(--err); }

/* ═══ Table polish: zebra + hover row actions ═══ */
.rtable tbody tr:nth-child(even):not(.is-selected) { background: rgba(255, 255, 255, 0.015); }
.rtable td.seen { white-space: nowrap; }
.rtable td.row-actions {
  white-space: nowrap;
  text-align: right;
  font-family: var(--font);
}
.rtable td.row-actions button {
  font: inherit;
  font-size: 12px;
  line-height: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  padding: 3px 6px;
  margin-left: 3px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s, border-color 0.12s;
}
.rtable tr:hover td.row-actions button { opacity: 1; }
/* v2.4.6 (F49): Tab не должен вести к невидимым кнопкам */
.rtable tr:focus-within td.row-actions button { opacity: 1; }
.rtable td.row-actions button:focus-visible {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.rtable td.row-actions button:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-text);
}
@media (hover: none) {
  .rtable td.row-actions button { opacity: 1; } /* touch-устройства: кнопки всегда видны */
}

/* ═══ Toasts ═══ */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 11px 15px;
  font-size: 13px;
  max-width: 340px;
  animation: toastIn 0.22s ease;
}
.toast--ok { border-left-color: var(--ok); }
.toast--err { border-left-color: var(--err); }
.toast--out { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

/* ═══ Статистика результатов (chips) ═══ */
.res-stats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.stat-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--text-dim);
  background: var(--bg-input); border: 1px solid var(--border-soft);
  border-radius: 999px; padding: 3px 10px;
  animation: chipIn 0.25s ease both;
}
.stat-chip b { color: var(--text); font-weight: 700; }
.stat-chip--ok { border-color: rgba(70, 194, 110, 0.35); background: var(--ok-soft); }
.stat-chip--ok b { color: var(--ok); }
.stat-chip--err { border-color: rgba(224, 91, 77, 0.35); background: var(--err-soft); }
.stat-chip--err b { color: var(--err); }
.stat-chip--best { border-color: var(--accent-line); background: var(--accent-soft); }
.stat-chip--best b { color: var(--accent-text); }
.stat-chip--new { border-color: rgba(70, 194, 110, 0.35); background: var(--ok-soft); }
.stat-chip--new b { color: var(--ok); }
button.stat-chip { cursor: pointer; font-family: var(--font); transition: border-color 0.15s, transform 0.15s; }
button.stat-chip:hover { border-color: var(--err); transform: translateY(-1px); }
@keyframes chipIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* лучший эндпоинт + новые строки */
.rtable tr.is-best { background: linear-gradient(90deg, rgba(242, 124, 32, 0.08), transparent 60%); }
.rtable tr.is-best td:first-child { color: var(--accent-text); }
.best-star { color: var(--accent); margin-right: 6px; font-size: 12px; text-shadow: 0 0 8px rgba(242, 124, 32, 0.6); }
.new-badge {
  margin-left: 8px; font-size: 9px; font-weight: 800; letter-spacing: 0.06em;
  color: var(--ok); border: 1px solid rgba(70, 194, 110, 0.45); border-radius: 4px;
  padding: 0 4px; vertical-align: 1px; text-transform: uppercase;
  animation: newPulse 1.6s ease infinite;
}
@keyframes newPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ═══ Модалка горячих клавиш ═══ */
.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(5, 8, 10, 0.62); backdrop-filter: blur(3px); }
.modal__card {
  position: relative; width: min(430px, calc(100vw - 32px));
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  animation: modalIn 0.18s ease both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--border-soft); }
.modal__head h2 { font-size: 14px; font-weight: 700; }
.modal__close { background: none; border: none; color: var(--text-faint); font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.modal__close:hover { color: var(--text); background: var(--bg-card-hover); }
.modal__body { padding: 12px 16px 16px; }
.kbd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.kbd-table td { padding: 6px 4px; border-bottom: 1px solid var(--border-soft); color: var(--text-dim); }
.kbd-table td:last-child { color: var(--text); }
.kbd-table tr:last-child td { border-bottom: none; }
kbd {
  font-family: var(--mono); font-size: 11px; color: var(--text);
  background: var(--bg-input); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px;
}
.modal__note { margin-top: 10px; font-size: 11.5px; color: var(--text-faint); line-height: 1.5; }
.sidebar__kbd {
  margin-top: 8px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; color: var(--text-dim);
  background: transparent; border: 1px dashed var(--border);
  border-radius: 8px; padding: 6px 8px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.sidebar__kbd:hover { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }

/* ═══ Responsive ═══ */
@media (max-width: 1080px) {
  .scan-grid, .config-grid { grid-template-columns: 1fr; }
  .scan-form, .config-form { max-height: none; overflow: visible; }
  .card--preview { height: auto; }
  .table-wrap, .log { max-height: 50vh; }
}
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; min-width: 0; flex-direction: row; align-items: center; overflow-x: auto; padding: 8px 10px; gap: 4px; }
  .brand { padding: 0 8px 0 2px; }
  .brand__text { display: none; }
  .nav { flex-direction: row; }
  .nav__item span { display: none; }
  .sidebar__footer { display: none; }
  .account-grid, .socks-grid, .tools-grid, .settings-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid--2 { grid-template-columns: 1fr; }
  .form-grid--3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}


/* ═══ v1.3.0 (append-only): новые переменные ═══ */
:root {
  --bg-log: #0c1013;
  --text-log: #b9c2cc;
  --c-key: #8fb4d9;
  --zebra: rgba(255, 255, 255, 0.015);
  --scroll-thumb: #2a323c;
  --scroll-thumb-hover: #3a4450;
  --switch-bg: #2a323c;
  --switch-knob: #aab3bd;
  --torn-text: #c9826f;
  --backdrop: rgba(5, 8, 10, 0.62);
}

/* ═══ v1.3.0: светлая тема ═══ */
html[data-theme="light"] {
  --bg: #f3f1eb;
  --bg-soft: #eae6de;
  --bg-card: #ffffff;
  --bg-card-hover: #f7f4ee;
  --bg-input: #fbfaf7;
  --border: #d5cfc3;
  --border-soft: #e2ddd2;
  --text: #28241e;
  --text-dim: #5d574d;
  --text-faint: #6b655b; /* v2.4.6 (F52): ≥4.5:1 на светлом фоне (было #8b8478 — 3.7:1) */
  --accent: #e0700f;
  --accent-soft: rgba(224, 112, 15, 0.12);
  --accent-line: rgba(224, 112, 15, 0.45);
  --accent-text: #b3540a;
  --ok: #1e9e56;
  --ok-soft: rgba(30, 158, 86, 0.12);
  --warn: #a8760f;
  --warn-soft: rgba(168, 118, 15, 0.12);
  --err: #cc4433;
  --err-soft: rgba(204, 68, 51, 0.1);
  --bg-log: #f7f4ec;
  --text-log: #4a443a;
  --c-key: #8a5a13;
  --zebra: rgba(40, 30, 10, 0.025);
  --scroll-thumb: #ccc5b6;
  --scroll-thumb-hover: #b5ad9c;
  --switch-bg: #d5cfc3;
  --switch-knob: #ffffff;
  --torn-text: #b05a3f;
  --backdrop: rgba(50, 42, 28, 0.4);
  --shadow: 0 8px 28px rgba(80, 65, 35, 0.14);
}
html[data-theme="light"] .socks-info { border-color: rgba(30, 158, 86, 0.4); }

/* ═══ v1.3.0: переопределения поверх базовых правил ═══ */
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
.switch i { background: var(--switch-bg); }
.switch i::after { background: var(--switch-knob); }
.cmd-bar { background: var(--bg-log); }
.log { color: var(--text-log); background: var(--bg-log); }
.conf { color: var(--text-log); background: var(--bg-log); }
.conf .c-key { color: var(--c-key); }
.rtable tbody tr:nth-child(even):not(.is-selected) { background: var(--zebra); }
.rtable tr.is-torn td { color: var(--torn-text); }
.modal__backdrop { background: var(--backdrop); }
[HIDDEN] { display: none !important; }

/* ═══ v1.3.0: фильтр результатов ═══ */
.res-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.res-filter { position: relative; flex: 1; max-width: 360px; }
.res-filter input {
  width: 100%;
  min-height: 32px;
  padding: 6px 30px 6px 32px;
  font-size: 12.5px;
  border-radius: 8px;
}
.res-filter__ico {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); font-size: 12px; pointer-events: none;
}
.res-filter__clear {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-faint);
  cursor: pointer; padding: 2px 6px; border-radius: 5px; font-size: 11px; font-family: var(--font);
}
.res-filter__clear:hover { color: var(--text); background: var(--bg-card-hover); }
.res-filter__meta { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.res-filter__meta b { color: var(--text); }

/* ═══ v1.3.0: история — кнопки в шапке ═══ */
.history__head { display: flex; align-items: center; gap: 8px; }
.history__head-title { flex: 1; min-width: 0; }
.history__tools { display: flex; gap: 5px; flex: none; }
.history__tools button {
  font: inherit; font-size: 10.5px; font-weight: 700;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 6px; padding: 3px 8px;
  cursor: pointer; transition: color 0.13s, border-color 0.13s, background 0.13s;
}
.history__tools button:hover { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
.history__tools button.history__clear:hover { color: var(--err); border-color: rgba(224, 91, 77, 0.45); background: var(--err-soft); }
.history__item { transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.12s; }
.history__item:hover { transform: translateX(2px); }

/* ═══ v1.3.0: спарклайн пинга ═══ */
.spark svg { display: block; }
.spark b { color: var(--text); }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.spark-area { fill: var(--accent-soft); stroke: none; }

/* ═══ v1.3.0: доступность и микрополировка ═══ */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.btn--primary { transition: background 0.13s, border-color 0.13s, box-shadow 0.13s, transform 0.13s; }
.btn--primary:hover { box-shadow: 0 4px 22px rgba(242, 124, 32, 0.4); }
.btn--primary:active { box-shadow: 0 1px 8px rgba(242, 124, 32, 0.3); }
.rtable tbody tr { animation: rowIn 0.18s ease both; }
@keyframes rowIn { from { opacity: 0; } to { opacity: 1; } }
.rtable td.row-actions button { transform: translateY(2px); }
.rtable tr:hover td.row-actions button { transform: translateY(0); }
.rtable td.row-actions button { transition: opacity 0.12s, background 0.12s, color 0.12s, border-color 0.12s, transform 0.12s; }
.sidebar__kbd { transition: color 0.15s, border-color 0.15s, background 0.15s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══ v1.4.0: компактная таблица ═══ */
.rtable.is-compact td { padding: 3px 8px; font-size: 11px; }
.rtable.is-compact th { padding: 4px 8px; font-size: 9.5px; }
.rtable.is-compact td.row-actions button { padding: 2px 4px; font-size: 11px; }
.btn.is-toggled { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); }

/* ═══ v1.4.0: пользовательские пресеты ═══ */
.chips__custom { display: contents; }
.chip--custom {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-style: dashed;
  border-color: var(--accent-line);
  color: var(--accent-text);
  cursor: pointer;
}
.chip--custom:hover { background: var(--accent-soft); }
.chip--custom.is-active { background: var(--accent-soft); color: var(--accent-text); }
.chip__custom-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip__del {
  font: inherit;
  font-size: 10px;
  line-height: 1;
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 4px;
}
.chip__del:hover { color: var(--err); background: var(--err-soft); }
.chip--add { border-style: dashed; color: var(--text-faint); }
.chip--add:hover { color: var(--accent-text); border-color: var(--accent-line); }
.preset-save {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: tabIn 0.18s ease;
}
.preset-save input { flex: 1; min-height: 32px; font-size: 12.5px; padding: 5px 10px; }

/* ═══ v1.4.0: панель Δ-сравнения в истории ═══ */
.history__cmp {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  padding: 8px 10px;
  margin: 2px 0 4px 8px;
  animation: chipIn 0.2s ease;
}
.history__cmp-title { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 5px; }
.history__cmp-row { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; color: var(--text-dim); padding: 1.5px 0; flex-wrap: wrap; }
.history__cmp-row .is-ok { color: var(--ok); font-weight: 600; }
.history__cmp-row .is-err { color: var(--err); font-weight: 600; }
.history__cmp-list { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); word-break: break-all; }
.history__cmp-btn {
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  flex: none;
  color: var(--text-faint);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s, transform 0.12s;
}
.history__cmp-btn:hover, .history__cmp-btn:focus-visible {
  color: var(--accent-text);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* ═══ v1.4.0: иконки в тостах ═══ */
.toast { display: flex; align-items: flex-start; gap: 9px; }
.toast__ico { flex: none; font-size: 13px; line-height: 1.3; }
.toast__txt { flex: 1; min-width: 0; }

/* ═══ v1.4.0: индикатор активного раздела в сайдбаре ═══ */
.nav__item { position: relative; }
.nav__item.is-active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(242, 124, 32, 0.7);
  animation: navIn 0.25s ease;
}
@keyframes navIn { from { height: 0; opacity: 0; } to { height: 55%; opacity: 1; } }

/* ═══ v1.4.0: QR-модалка ═══ */
.modal__card--qr { width: min(380px, calc(100vw - 32px)); }
.modal__body--qr { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qr-box {
  background: #ffffff;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  display: inline-flex;
}
.qr-box svg { display: block; width: 240px; height: 240px; }
.row-buttons--center { justify-content: center; }
/* v2.4.4: пейджер многостраничного QR */
.qr-pager { display: flex; align-items: center; justify-content: center; gap: 10px; }
.qr-pager__label { font-size: 12px; font-weight: 700; color: var(--text-dim); min-width: 130px; text-align: center; user-select: none; }
.qr-pager .btn { min-width: 38px; }
.qr-pager .btn:disabled { opacity: 0.4; cursor: default; }

/* ═══════════ v1.5.0 — тренд пинга, импорт .conf, полировка деталей ═══════════ */

/* — кнопка с акцентной рамкой (импорт .conf целиком) — */
.btn--accent {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
  transition: background 0.13s, color 0.13s, box-shadow 0.13s, transform 0.13s;
}
.btn--accent:hover { background: var(--accent); color: #17100a; box-shadow: 0 3px 16px rgba(242, 124, 32, 0.35); }
.btn--accent:active { transform: translateY(1px); }

/* — тренд лучшего пинга (панель истории) — */
.trend {
  margin: 10px 12px 12px;
  padding: 10px 12px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}
.trend__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.trend__title { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-dim); }
.trend__range { font-size: 11px; color: var(--text-dim); }
.trend__range b { color: var(--accent); font-variant-numeric: tabular-nums; }
.trend__svg { display: block; width: 100%; height: 56px; border-radius: 6px; }
.trend__area { fill: rgba(242, 124, 32, 0.13); }
.trend__line { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.trend-dot { fill: #ffd9b3; stroke: var(--accent); stroke-width: 1.4; cursor: pointer; transition: stroke-width 0.12s; }
.trend-dot:hover, .trend-dot:focus-visible { stroke-width: 2.6; }
.trend-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.trend__hint { margin-top: 5px; font-size: 10.5px; color: var(--text-dim); opacity: 0.75; }

/* — заголовки карточек: акцентная планка — */
.card__head h2::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 14px;
  margin-right: 8px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), #ffb06a);
  vertical-align: -2px;
}

/* — чипы статистики: микро-взаимодействие — */
.stat-chip { transition: transform 0.12s, box-shadow 0.12s; }
.stat-chip:hover { transform: translateY(-1px); box-shadow: 0 2px 12px rgba(242, 124, 32, 0.18); }

/* — строки результатов: акцентная планка при ховере — */
.rtable tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* — кнопки тулбаров: единое «дыхание» — */
.card__tools .btn { transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.12s; }
.card__tools .btn:active { transform: translateY(1px); }

/* — история: элементы живее — */
.history__item { transition: background 0.12s, transform 0.12s; }
.history__item:hover { transform: translateX(2px); }
.history__cmp-btn { transition: background 0.12s, color 0.12s, border-color 0.12s; }

/* — тосты: полоска-таймер — */
.toast { position: relative; overflow: hidden; }
.toast::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), #ffb06a);
  opacity: 0.55;
  animation: toastBar 3.2s linear forwards;
  pointer-events: none;
}
@keyframes toastBar { from { width: 100%; } to { width: 0%; } }

/* — пустое состояние: мягкое парение иконки — */
.empty__ico { animation: floatIco 3.2s ease-in-out infinite; }
@keyframes floatIco { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* — навигация: иконка чуть увеличивается при ховере — */
.nav__item svg, .nav__item img { transition: transform 0.15s; }
.nav__item:hover svg, .nav__item:hover img { transform: scale(1.08); }

/* — поля ввода: отзывчивая рамка при ховере — */
input:hover, select:hover, textarea:hover { border-color: var(--border); }

/* — доступность: отключить новые анимации при reduced-motion — */
@media (prefers-reduced-motion: reduce) {
  .toast::after, .empty__ico { animation: none; }
  .stat-chip, .history__item, .nav__item svg, .nav__item img, .trend-dot, .btn--accent { transition: none; }
}

/* ═══════════ v1.6.0 — i18n switch, sortable headers, polish (append-only) ═══════════ */

:root {
  --lang-h: 26px;
}

/* ── RU/EN переключатель ── */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-inset, rgba(255, 255, 255, 0.03));
  margin: 6px 0 10px;
  align-self: flex-start;
}
.lang-switch__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  min-height: var(--lang-h);
}
.lang-switch__btn:hover { color: var(--text); background: rgba(242, 124, 32, 0.1); }
.lang-switch__btn.is-active {
  background: linear-gradient(180deg, rgba(242, 124, 32, 0.28), rgba(232, 115, 26, 0.18));
  color: #ffd9b0;
  box-shadow: inset 0 0 0 1px rgba(242, 124, 32, 0.45);
}
html[data-theme="light"] .lang-switch__btn.is-active { color: #8a4400; }

/* ── сортировка по клику на заголовок ── */
.rtable th.th-sort { cursor: pointer; user-select: none; transition: color 0.12s, background 0.12s; }
.rtable th.th-sort:hover { color: var(--accent); background: rgba(242, 124, 32, 0.08); }
.rtable th.th-sort .th-arrow {
  color: var(--accent);
  font-size: 9px;
  margin-left: 2px;
  display: inline-block;
  animation: thIn 0.18s ease;
}
@keyframes thIn { from { transform: translateY(-3px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── полировка: липкая шапка таблицы с блюром ── */
.table-wrap { overflow: auto; overscroll-behavior: contain; }
.rtable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-card);
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--border);
}

/* ── полировка: свечение карточек при наведении ── */
.card { transition: border-color 0.2s, box-shadow 0.2s; }
.card:hover { box-shadow: 0 0 0 1px rgba(242, 124, 32, 0.07), 0 10px 30px -18px rgba(0, 0, 0, 0.55); }

/* ── полировка: мерцание прогресс-бара во время скана ── */
.scan-progress { position: relative; overflow: hidden; }
#scanBarFill { position: relative; }
#scanBarFill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.35) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: barShimmer 1.4s infinite;
  pointer-events: none;
}
@keyframes barShimmer { to { transform: translateX(100%); } }

/* ── полировка: типографика стат-чипов ── */
.stat-chip b { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

/* ── полировка: фокус-кольца единообразно ── */
.btn:focus-visible, .chip:focus-visible, .lang-switch__btn:focus-visible,
.th-sort:focus-visible, .history__cmp-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .rtable th.th-sort .th-arrow { animation: none; }
  #scanBarFill::after { animation: none; display: none; }
  .lang-switch__btn, .card, .rtable th.th-sort { transition: none; }
}

/* v1.6.0: бейдж «разорван» учитывает язык (attr вместо жёсткого текста) */
.rtable tr.is-torn td:first-child::after { content: attr(data-torn); }

/* ═══════════════ v1.7.0: ⇅-сравнение, тренд CSV, каскад строк, kbd-язык ═══════════════ */

/* — каскадное появление строк после скана (поверх базового rowIn) — */
@keyframes rowCascade {
  from { opacity: 0; transform: translateX(-7px); }
  to   { opacity: 1; transform: none; }
}
.rtable tbody tr.is-entering { animation: rowCascade 0.26s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.rtable tbody tr.is-entering td { background-position-x: 7px; }

/* — CSV-кнопка в шапке тренда — */
.trend__tools { display: inline-flex; align-items: center; gap: 7px; }
.trend__csv {
  font: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--text-dim); background: transparent; border: 1px dashed var(--border);
  border-radius: 6px; padding: 2px 7px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s;
}
.trend__csv:hover { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); transform: translateY(-1px); }
.trend__csv:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* — кнопка ⇅ в тулзах истории — акцентная, чтобы отличалась от CSV/JSON — */
.history__tools button#btnHistCmp { color: var(--accent-text); border-style: solid; border-color: var(--accent-line); }
.history__tools button#btnHistCmp:hover { background: var(--accent-soft); }

/* — модалка сравнения — */
.modal__card--cmp { width: min(680px, calc(100vw - 32px)); }
.cmp-pickers {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px;
  margin-bottom: 12px;
}
.cmp-pick { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cmp-pick > span {
  font-size: 10px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-dim);
}
.cmp-pick select {
  width: 100%; font: inherit; font-size: 12px; color: var(--text);
  background: var(--input-bg, rgba(255, 255, 255, 0.04)); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 9px; cursor: pointer;
  transition: border-color 0.15s;
}
.cmp-pick select:hover { border-color: var(--accent-line); }
.cmp-pick select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cmp-vs {
  color: var(--accent); font-size: 15px; font-weight: 800; padding-bottom: 8px;
  text-shadow: 0 0 12px var(--accent-soft);
}

/* — карточки лучших пингов + дельта — */
.cmp-best { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 8px; margin-bottom: 10px; }
.cmp-best__card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px;
  background: var(--card-2, rgba(255, 255, 255, 0.02));
}
.cmp-best__label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-dim); }
.cmp-best__val { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.cmp-best__delta {
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 11.5px; font-weight: 800; padding: 6px 10px; border-radius: 9px;
  border: 1px solid var(--border); align-self: center;
}
.cmp-best__delta.is-better { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.cmp-best__delta.is-worse  { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); background: color-mix(in srgb, var(--err) 10%, transparent); }
.cmp-best__delta.is-same   { color: var(--text-dim); }
@supports not (color: color-mix(in srgb, red 10%, blue)) {
  .cmp-best__delta.is-better { border-color: rgba(70, 194, 110, 0.45); background: rgba(70, 194, 110, 0.1); }
  .cmp-best__delta.is-worse  { border-color: rgba(224, 91, 77, 0.45); background: rgba(224, 91, 77, 0.1); }
}

/* — наборы (только в A / только в B / общие) — */
.cmp-sets { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.cmp-set {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px;
  font-size: 12px; color: var(--text-dim);
  border-left: 2px solid var(--border); padding: 3px 0 3px 9px;
}
.cmp-set b { font-variant-numeric: tabular-nums; color: var(--text); }
.cmp-set--b { border-left-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.cmp-set--a { border-left-color: color-mix(in srgb, var(--err) 55%, transparent); }
@supports not (color: color-mix(in srgb, red 10%, blue)) {
  .cmp-set--b { border-left-color: rgba(70, 194, 110, 0.55); }
  .cmp-set--a { border-left-color: rgba(224, 91, 77, 0.55); }
}
.cmp-set__list { font-family: var(--mono, monospace); font-size: 11px; opacity: 0.85; }

/* — таблица Δ-пинга — */
.cmp-table-wrap { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cmp-table th {
  position: sticky; top: 0; background: var(--card-bg, rgba(20, 24, 29, 0.97));
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-dim);
  text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); z-index: 1;
}
.cmp-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.cmp-table tbody tr:last-child td { border-bottom: none; }
.cmp-table tbody tr:hover td { background: var(--accent-soft); }
.cmp-ep { font-family: var(--mono, monospace); font-size: 11.5px; }
.cmp-delta { font-weight: 800; }
.cmp-table tr.is-better .cmp-delta { color: var(--ok); }
.cmp-table tr.is-worse  .cmp-delta { color: var(--err); }
.cmp-table tr.is-same   .cmp-delta { color: var(--text-dim); }
.cmp-table tr.is-torn td { color: var(--text-dim); font-style: italic; }
.cmp-empty { padding: 18px 10px; text-align: center; color: var(--text-dim); font-size: 12.5px; }

/* — переключатель языка в модалке горячих клавиш — */
.kbd-lang-row { display: flex; justify-content: center; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.kbd-lang-row .lang-switch { margin: 0; }

/* — светлая тема: подложки селектов/карточек сравнения — */
html[data-theme="light"] .cmp-pick select { --input-bg: rgba(20, 24, 29, 0.05); }
html[data-theme="light"] .cmp-best__card { --card-2: rgba(20, 24, 29, 0.03); }
html[data-theme="light"] .cmp-table th { --card-bg: rgba(243, 241, 235, 0.97); }

@media (prefers-reduced-motion: reduce) {
  .rtable tbody tr.is-entering { animation: none; opacity: 1; transform: none; }
  .trend__csv:hover { transform: none; }
}

/* ══════════════════════════════════════════════════════════════
   v1.8.0 — живая панель скана, шаринг пресетов, детали стилей
   ══════════════════════════════════════════════════════════════ */
.scan-live {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, var(--accent-soft), transparent 60%),
    var(--bg-card);
  padding: 11px 14px 12px;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow);
  animation: liveIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes liveIn { from { opacity: 0; transform: translateY(7px); } }

.scan-live__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.scan-live__dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: liveDot 1.6s ease-out infinite;
}
@keyframes liveDot {
  0% { box-shadow: 0 0 0 0 rgba(242, 124, 32, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(242, 124, 32, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 124, 32, 0); }
}
html[data-theme="light"] .scan-live__dot {
  animation-name: liveDotLight;
}
@keyframes liveDotLight {
  0% { box-shadow: 0 0 0 0 rgba(224, 112, 15, 0.4); }
  70% { box-shadow: 0 0 0 9px rgba(224, 112, 15, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 112, 15, 0); }
}
.scan-live__title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-text);
  white-space: nowrap;
}
.scan-live__phase {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scan-live__meta {
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.scan-live__time {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 1px 9px;
}
.scan-live__canvas {
  width: 100%;
  height: 46px;
  display: block;
  border-radius: 6px;
}
.scan-live__nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.scan-live__nodes:empty { display: none; }
.scan-live__node {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 2.5px 9px;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scan-live__node.is-entering { animation: nodeIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
@keyframes nodeIn { from { opacity: 0; transform: translateX(-8px) scale(0.92); } }

/* кнопки шаринга пресетов в шапке карточки */
.card__head .card__tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#btnPresetsExport:not(:disabled):active,
#btnPresetsImport:not(:disabled):active { transform: translateY(1px); }

/* детали стилей v1.8.0: акцентная полоса у строки при hover */
.rtable tbody tr:not(.is-torn):hover td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
/* плавный подъём кнопки скана при наведении уже есть — добавляем тень нажатия */
#btnRunScan:not(:disabled):active {
  transform: translateY(1px);
  box-shadow: 0 1px 8px rgba(242, 124, 32, 0.3);
}

@media (prefers-reduced-motion: reduce) {
  .scan-live, .scan-live__node.is-entering { animation: none !important; opacity: 1; transform: none; }
  .scan-live__dot { animation: none !important; }
}

/* ═══════════════ v1.9.0: порты, быстрая проверка, PNG тренда ═══════════════ */

/* кликабельные чипы частоты портов в статистике */
.stat-chip--port {
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.stat-chip--port b { color: var(--accent); }
.stat-chip--port:hover {
  transform: translateY(-2px);
  border-style: solid;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 22%, transparent);
}
.stat-chip--port:active { transform: translateY(0); }
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .stat-chip--port { border: 1px dashed var(--accent); }
  .stat-chip--port:hover { background: rgba(255, 122, 26, 0.14); }
}

/* кнопка PNG в шапке тренда — как trend__csv, но чуть акцентнее */
.trend__png { color: var(--accent); }

/* ── модалка быстрой проверки эндпоинта ── */
.modal__card--qc { max-width: 640px; }
.qc-ep {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.qc-ep__addr {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text);
}
.qc-ep__proto {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .qc-ep__proto { border: 1px solid var(--accent); background: rgba(255, 122, 26, 0.1); }
}
.qc-cmd {
  font-size: 11.5px;
  line-height: 1.5;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--text) 4%, transparent);
  color: var(--text-dim);
  word-break: break-all;
  margin-bottom: 10px;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .qc-cmd { background: rgba(128, 128, 128, 0.08); }
}
.qc-log {
  height: 148px;
  overflow-y: auto;
  font-size: 11.5px;
  line-height: 1.55;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--hairline);
  color: var(--log-text, #cfe8cf);
  white-space: pre-wrap;
  word-break: break-all;
}
html[data-theme="light"] .qc-log { background: #26221c; color: #d8f3d8; }
.qc-verdict {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid transparent;
  animation: qcIn 0.25s ease both;
}
.qc-verdict.is-ok {
  background: color-mix(in srgb, #2fbf71 14%, transparent);
  border-color: color-mix(in srgb, #2fbf71 45%, transparent);
  color: #35d37c;
}
.qc-verdict.is-err {
  background: color-mix(in srgb, #e5484d 14%, transparent);
  border-color: color-mix(in srgb, #e5484d 45%, transparent);
  color: #ff6b70;
}
.qc-verdict.is-warn {
  background: color-mix(in srgb, #e2a336 14%, transparent);
  border-color: color-mix(in srgb, #e2a336 45%, transparent);
  color: #eebc55;
}
.qc-verdict.is-run {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
  animation: qcPulse 1.1s ease-in-out infinite;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .qc-verdict.is-ok { background: rgba(47, 191, 113, 0.14); border-color: #2fbf71; }
  .qc-verdict.is-err { background: rgba(229, 72, 77, 0.14); border-color: #e5484d; }
  .qc-verdict.is-warn { background: rgba(226, 163, 54, 0.14); border-color: #e2a336; }
  .qc-verdict.is-run { background: rgba(255, 122, 26, 0.1); border-color: var(--accent); }
}
html[data-theme="light"] .qc-verdict.is-ok { color: #177a45; }
html[data-theme="light"] .qc-verdict.is-err { color: #b3261e; }
html[data-theme="light"] .qc-verdict.is-warn { color: #8a5a00; }
@keyframes qcIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes qcPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ⚡ в строке результатов — акцентная кнопка; busy-состояние с вращением */
.row-actions button[data-act="check"] { color: var(--accent); }
.row-actions button[data-act="check"].is-busy {
  pointer-events: none;
  animation: qcSpin 0.9s linear infinite;
  opacity: 0.85;
}
@keyframes qcSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* фокус-кольца для новых кнопок */
.trend__png:focus-visible,
.stat-chip--port:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* светлая тема: чипы портов и лог */
html[data-theme="light"] .stat-chip--port:hover {
  background: rgba(255, 122, 26, 0.14);
}

@media (prefers-reduced-motion: reduce) {
  .qc-verdict, .stat-chip--port, .row-actions button[data-act="check"].is-busy { animation: none !important; }
  .stat-chip--port:hover { transform: none; }
}

/* ═══════════ v2.0.0: журнал ⚡-проверок · пакетная проверка · SVG/HTML-экспорт ═══════════ */

/* кнопка SVG в шапке тренда — как trend__png */
.trend__svg { color: var(--accent); }

/* кнопки «☑ Выбрать» / «⬇ HTML» в тулбаре результатов: активный режим выбора — акцент */
.btn--sm.is-on {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

/* панель пакетной проверки */
.batch-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 65%);
  animation: batchIn 0.28s ease;
}
.batch-bar__go {
  color: #191410;
  background: linear-gradient(180deg, #ffa04d, var(--accent));
  border: 1px solid var(--accent-line);
  font-weight: 700;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.batch-bar__go:hover { filter: brightness(1.07); transform: translateY(-1px); }
.batch-bar__go:active { transform: translateY(0); }
.batch-bar__go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.batch-bar__meta {
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.batch-bar__meta.is-run { color: var(--accent-text); }
.batch-bar__meta.is-run::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: liveDot 1.1s ease-in-out infinite;
}
@keyframes batchIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* колонка чекбоксов в таблице результатов */
.th-sel { width: 34px; text-align: center; padding-right: 4px !important; }
.td-sel { text-align: center; width: 34px; padding-right: 4px !important; }
.row-sel, #selAllBox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line-strong, rgba(240, 237, 230, 0.35));
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.row-sel:hover, #selAllBox:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row-sel:checked, #selAllBox:checked {
  background: var(--accent) center/11px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23191410' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  border-color: var(--accent);
}
.row-sel:focus-visible, #selAllBox:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* журнал ⚡-проверок (внутри панели истории) */
.qcj { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 10px; }
.qcj__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 2px 6px 8px;
}
.qcj__title { flex: 1; min-width: 0; }
.qcj__cnt {
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10.5px;
}
.qcj__tools { display: inline-flex; gap: 6px; }
.qcj__tools button {
  font: inherit;
  font-size: 11px;
  color: var(--text-mute);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 9px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.qcj__tools button:hover { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
.qcj__tools button.history__clear:hover { color: var(--err); border-color: rgba(224, 91, 77, 0.45); background: var(--err-soft); }
.qcj__list {
  max-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 2px;
}
.qcj__row {
  display: grid;
  grid-template-columns: 10px auto auto minmax(120px, auto) 1fr;
  align-items: baseline;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 8px;
  animation: qcjIn 0.3s ease both;
  transition: background 0.15s ease;
}
.qcj__row:hover { background: var(--hover, rgba(255, 255, 255, 0.04)); }
.qcj__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  align-self: center;
  background: var(--text-faint);
}
.qcj__row.is-ok .qcj__dot { background: #40c06e; box-shadow: 0 0 6px rgba(64, 192, 110, 0.55); }
.qcj__row.is-err .qcj__dot { background: #e0524d; box-shadow: 0 0 6px rgba(224, 82, 77, 0.55); }
.qcj__row.is-warn .qcj__dot { background: #e0a24d; box-shadow: 0 0 6px rgba(224, 162, 77, 0.5); }
.qcj__ts { color: var(--text-faint); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qcj__proto {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-mute);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  white-space: nowrap;
}
.qcj__ep { font-size: 12.5px; color: var(--text); white-space: nowrap; }
.qcj__verdict { font-size: 12px; color: var(--text-mute); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcj__row.is-ok .qcj__verdict { color: #7fd9a0; }
.qcj__row.is-err .qcj__verdict { color: #f09a9a; }
.qcj__row.is-warn .qcj__verdict { color: #f0c89a; }
.qcj__node { color: var(--text-faint); }
.qcj__empty { padding: 10px 6px 4px; font-size: 12px; color: var(--text-faint); font-style: italic; }
@keyframes qcjIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

/* светлая тема: контрастные подгонки новых блоков */
html[data-theme="light"] .row-sel,
html[data-theme="light"] #selAllBox { border-color: rgba(36, 33, 28, 0.4); }
html[data-theme="light"] .qcj__row:hover { background: rgba(36, 33, 28, 0.05); }
html[data-theme="light"] .batch-bar__go { color: #fff6ee; }

/* мобильная вёрстка: журнал и панель выбора */
@media (max-width: 720px) {
  .batch-bar { padding: 8px 10px; }
  .qcj__row { grid-template-columns: 10px auto minmax(110px, auto) 1fr; }
  .qcj__proto { display: none; }
  .qcj__verdict { white-space: normal; }
}

/* понижение анимации */
@media (prefers-reduced-motion: reduce) {
  .batch-bar, .qcj__row, .batch-bar__meta.is-run::before { animation: none !important; }
  .batch-bar__go:hover { transform: none; }
}

/* ══════════ v2.3.0: карточка «Папка данных» (Настройки) ══════════ */
#udfState { font-weight: 600; font-size: 13px; white-space: nowrap; }
#udfState.is-ok { color: var(--ok); }
#udfState.is-warn { color: var(--warn); }
#udfState.is-err { color: var(--err); }
#dataRootHint { margin-top: 8px; display: block; }
#setDataRoot { font-family: var(--mono); font-size: 12px; }
.form-grid .field > div { flex-wrap: wrap; }
