/* =========================================================
   ШИФРОВАНИЕ ТЕКСТА (/tools/text-encryption)
   Палитра и переменные — из style.css, префикс классов — cf-.

   Дизайн-план — тот же язык, что у транслита: белая карточка →
   серые поля → белые элементы поверх. Инструмент читается сверху
   вниз:
     1. все 14 алгоритмов на виду, тремя группами;
     2. полоса о выбранном: тип, реальная стойкость, суть;
     3. направление и параметры одной строкой;
     4. два поля — ввод и результат — с кнопкой «поменять»;
     5. подсказки и предупреждения;
     6. рабочая панель алгоритма: перебор, разбор, таблицы, звук.
   Стойкость показана цветом: серый — защиты нет, янтарный —
   учебная или устаревшая, зелёный — высокая, синий — не шифр,
   фиолетовый — необратимо. Раскладка переключается по ширине
   самого инструмента (контейнерные запросы).
   ========================================================= */

[hidden] { display: none !important; }

.cf-tool, .cf-seo, .cf-toc, .tool-faq#faq {
  --cf-muted: #557479;
  --cf-link: #0E7F47;
  --cf-ring: #12A05C;
  --cf-field: #F2F4F6;
  --cf-field-hover: #E9EDF0;
  --cf-line: #E3E7EB;
  --cf-line-strong: #D3D9DF;
  --cf-tint: #EEF8F2;
  --cf-warn: #8A5A0F;
  --cf-warn-bg: #FFF5E3;
  --cf-danger: #A33A2E;
}

/* ---------- Карточка инструмента ---------- */
.cf-tool {
  position: relative;
  margin: 0 0 40px;
  padding: 24px;
  background: var(--color-surface);
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(16, 20, 24, 0.04);
  container: cftool / inline-size;
}
.cf-tool button { font-family: inherit; }
.cf-tool :focus-visible { outline: 2px solid var(--cf-ring); outline-offset: 2px; }

/* ---------- Алгоритмы: три группы — три панели ----------
   Классика и кодирование — нейтральные серые панели, криптография —
   зелёная: только она защищает по-настоящему. Кнопки — белые плашки
   поверх панели, выбранная — тёмная. */
.cf-algos {
  display: grid;
  grid-template-columns: minmax(0, 13fr) minmax(0, 7fr) minmax(0, 8fr);
  gap: 10px;
}
.cf-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border-radius: 18px;
  background: var(--cf-field);
}
.cf-group-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cf-group-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--color-surface);
  font-size: 17px;
  line-height: 1;
  color: var(--cf-muted);
}
.cf-group-heading { min-width: 0; }
.cf-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  color: var(--color-text-strong);
}
.cf-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(16, 20, 24, 0.07);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text);
}
.cf-group-sub { margin: 2px 0 0; font-size: 12.5px; line-height: 16px; color: var(--cf-muted); }

.cf-group--crypto {
  background: linear-gradient(180deg, #E3F7EB 0%, #EEFAF3 100%);
  box-shadow: inset 0 0 0 1px #BFE8D0;
}
.cf-group--crypto .cf-group-icon { background: var(--color-accent); color: #06231A; }
.cf-group--crypto .cf-group-sub { font-weight: 600; color: #0B6B3C; }
.cf-group--crypto .cf-group-count { background: rgba(11, 107, 60, 0.12); color: #0B6B3C; }

.cf-group-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-algo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: 0 1px 1px rgba(16, 20, 24, 0.05), inset 0 0 0 1px rgba(16, 20, 24, 0.06);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}
.cf-algo:hover { color: var(--color-text-strong); box-shadow: 0 1px 2px rgba(16, 20, 24, 0.08), inset 0 0 0 1px rgba(16, 20, 24, 0.16); }
.cf-algo[aria-pressed="true"] {
  background: var(--color-text-strong);
  box-shadow: 0 1px 2px rgba(16, 20, 24, 0.18);
  font-weight: 600;
  color: #fff;
}

/* ---------- Сведения об алгоритме ---------- */
.cf-info {
  margin-top: 14px;
  padding: 14px 18px;
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--cf-line);
}
.cf-info-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
.cf-info-title strong { font-size: 15px; font-weight: 700; color: var(--color-text-strong); }
.cf-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(16, 20, 24, 0.06);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}
.cf-info-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cf-link);
  text-decoration: none;
}
.cf-info-more:hover { text-decoration: underline; }
.cf-info-more i { font-size: 14px; }

/* Уровень стойкости: точка + подпись */
.cf-level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.cf-level i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cf-level--none { background: #ECEEF0; color: #5B6770; }
.cf-level--weak, .cf-level--old { background: #FFF1D6; color: var(--cf-warn); }
.cf-level--strong { background: #D6F5E4; color: #0B6B3C; }
.cf-level--code { background: #E4EEF7; color: #2A4D6B; }
.cf-level--hash { background: #EEE8F7; color: #54408A; }

/* ---------- Направление и параметры ----------
   Единая система: каждый контрол — поле «подпись 18px + контрол 44px».
   Подписи одной высоты и строка выравнивается по верху, поэтому
   контролы стоят на одной линии, даже если под полем пароля есть
   подсказка. Сегменты, поля, переключатели, кнопки — одной высоты. */
.cf-controls {
  --cf-h: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px 16px;
  margin-top: 18px;
}
.cf-params { display: contents; }

.cf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cf-field--grow { flex: 1 1 300px; }
.cf-label {
  display: block;
  height: 18px;
  margin: 0;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 18px;
  color: var(--color-text-strong);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cf-label small, .cf-key-head small, .cf-cover > label small { margin-left: 2px; font-size: inherit; font-weight: 400; color: var(--cf-muted); }

.cf-dir, .cf-seg {
  display: inline-flex;
  gap: 2px;
  height: var(--cf-h);
  max-width: 100%;
  padding: 4px;
  background: var(--cf-field);
  border-radius: 12px;
}
.cf-dir-btn, .cf-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.cf-dir-btn { min-width: 132px; }
.cf-dir-btn:hover, .cf-seg-btn:hover { color: var(--color-text-strong); }
.cf-dir-btn[aria-pressed="true"], .cf-seg-btn[aria-pressed="true"] {
  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);
}
.cf-self {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--cf-h);
  margin: 0;
  padding: 0 16px 0 14px;
  border-radius: 12px;
  background: var(--cf-field);
  font-size: 13.5px;
  color: var(--color-text);
  white-space: nowrap;
}
.cf-self i { font-size: 16px; line-height: 1; color: var(--cf-link); }

.cf-input {
  width: 240px;
  max-width: 100%;
  height: var(--cf-h, 44px);
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--cf-field);
  box-shadow: inset 0 0 0 1px transparent;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text-strong);
  transition: box-shadow var(--transition-fast), background-color var(--transition-fast);
}
.cf-input:hover { background: var(--cf-field-hover); }
.cf-input:focus { outline: none; background: var(--color-surface); box-shadow: inset 0 0 0 2px var(--cf-ring); }
.cf-input::placeholder { color: #8A9DA1; }
.cf-input--mono { font-family: var(--font-mono); font-size: 13.5px; }
/* Пароль шифрования: точки рисует CSS, поле не считается паролем от сайта */
.cf-input--secret.is-masked { -webkit-text-security: disc; letter-spacing: 0.08em; }
.cf-input--secret.is-masked::placeholder { letter-spacing: 0; }
.cf-field--grow .cf-input { width: 100%; }

/* Сдвиг: − ползунок + число */
.cf-range {
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--cf-h);
  padding: 0 4px;
  border-radius: 12px;
  background: var(--cf-field);
}
.cf-range input[type="range"] { width: 180px; margin: 0; accent-color: var(--color-accent-dark); }
.cf-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}
.cf-step i { font-size: 16px; line-height: 1; }
.cf-step:hover { background: var(--color-surface); color: var(--cf-link); }
.cf-range-value {
  min-width: 36px;
  padding: 0 6px 0 2px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: var(--color-text-strong);
  font-variant-numeric: tabular-nums;
}

/* Пароль */
.cf-pass { display: flex; align-items: center; gap: 6px; }
.cf-pass .cf-input { flex: 1 1 auto; width: auto; min-width: 0; }
.cf-pass-meter { margin: 0; min-height: 18px; font-size: 12.5px; line-height: 18px; color: var(--cf-muted); }
.cf-pass-meter:empty { display: none; }
.cf-pass-meter.is-weak { color: var(--cf-danger); }
.cf-pass-meter.is-mid { color: var(--cf-warn); }
.cf-pass-meter.is-good, .cf-pass-meter.is-strong { color: var(--cf-link); }

/* Переключатели: одна строка, та же высота, что у полей */
.cf-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--cf-h);
  min-width: 0;
  margin: 0;
  padding: 0 16px 0 12px;
  border-radius: 12px;
  background: var(--cf-field);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.cf-switch:hover { background: var(--cf-field-hover); }
.cf-switch input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; }
.cf-switch-track {
  position: relative;
  flex-shrink: 0;
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: #C3CCD3;
  transition: background-color var(--transition-fast);
}
.cf-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 20, 24, 0.2);
  transition: transform var(--transition-fast);
}
.cf-switch input:checked + .cf-switch-track { background: var(--color-accent-dark); }
.cf-switch input:checked + .cf-switch-track::after { transform: translateX(14px); }
.cf-switch input:focus-visible + .cf-switch-track { outline: 2px solid var(--cf-ring); outline-offset: 2px; }
.cf-switch-text {
  min-width: 0;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text-strong);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- Ключи RSA и обложка Бэкона ---------- */
.cf-keys { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.cf-key, .cf-cover { min-width: 0; padding: 10px; background: var(--cf-field); border-radius: 16px; }
.cf-cover { margin-top: 14px; }
.cf-key-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px 6px 6px; }
.cf-key-head label, .cf-cover > label { font-size: 13px; font-weight: 600; color: var(--color-text-strong); margin: 0; }
.cf-cover > label { display: block; padding: 2px 6px 8px; }
.cf-cover small.is-over { color: var(--cf-danger); }
.cf-keybox {
  display: block;
  width: 100%;
  min-height: 118px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--cf-line);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-strong);
  resize: vertical;
  /* Строки PEM по 64 символа не рвём: ключ должен выглядеть как ключ */
  white-space: pre;
  overflow-x: auto;
}
.cf-cover .cf-keybox { font-family: var(--font-body); font-size: 14px; min-height: 84px; white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: hidden; }
.cf-keybox:focus { outline: none; box-shadow: inset 0 0 0 2px var(--cf-ring); }

/* ---------- Поля ---------- */
.cf-panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  margin-top: 16px;
}
.cf-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px 10px 8px;
  background: var(--cf-field);
  border-radius: 16px;
}
.cf-pane-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 2px 6px 8px; }
.cf-pane-head label { font-size: 13px; font-weight: 600; color: var(--color-text-strong); margin: 0; }
.cf-count { font-size: 12px; color: var(--cf-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-count.is-over { color: var(--cf-danger); font-weight: 600; }
.cf-text {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 280px;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--cf-line);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-strong);
  resize: vertical;
  overflow-wrap: anywhere;
  transition: box-shadow var(--transition-fast);
}
.cf-text::placeholder { color: #8A9DA1; }
.cf-text:focus { outline: none; box-shadow: inset 0 0 0 2px var(--cf-ring); }
.cf-text.is-mono { font-family: var(--font-mono); font-size: 14px; line-height: 1.7; }
/* Строка без пробелов длиннее 3000 знаков (Base64 большого файла): перенос
   в любом месте раскладывается мгновенно, а обычный — секундами (js/cipher.js, counts) */
.cf-text.is-unbroken { word-break: break-all; }
.cf-pane-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px 2px 0; min-height: 42px; }
.cf-foot-spacer { flex: 1 1 auto; }
.cf-tool:not(.has-text) .cf-only-text { display: none; }

.cf-swap {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--cf-field);
  color: var(--color-text);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.cf-swap i { font-size: 18px; line-height: 1; }
.cf-swap:hover:not(:disabled) { background: var(--cf-tint); color: var(--cf-link); }
.cf-swap:disabled { opacity: 0.4; cursor: default; }

/* Хеши вместо поля результата */
.cf-hashes { display: grid; gap: 6px; }
.cf-hash {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--cf-line);
}
.cf-hash.is-match { box-shadow: inset 0 0 0 2px var(--cf-ring); background: #F6FCF8; }
.cf-hash-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.cf-hash-name { font-size: 13px; font-weight: 700; color: var(--color-text-strong); }
.cf-hash-bits { font-size: 12px; color: var(--cf-muted); }
.cf-hash-line { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; }
.cf-hash-value {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-strong);
  overflow-wrap: anywhere;
  word-break: break-all;
}

/* ---------- Кнопки ---------- */
.cf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: var(--color-text-strong);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}
.cf-btn i { font-size: 16px; line-height: 1; }
.cf-btn--sm { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; }
.cf-btn--ctrl { height: var(--cf-h); padding: 0 16px; border-radius: 12px; font-size: 13.5px; }
.cf-btn--quiet { font-weight: 500; color: var(--color-text); }
.cf-btn--quiet:hover { background: var(--color-surface); color: var(--color-text-strong); }
.cf-btn--primary { background: var(--color-accent); color: #06231A; }
.cf-btn--primary:hover:not(:disabled) { background: #17C56C; }
.cf-btn--primary:disabled { background: var(--cf-field-hover); color: var(--cf-muted); cursor: not-allowed; }
.cf-btn--primary.is-done { background: var(--cf-link); color: #fff; }
.cf-btn--line { background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--cf-line-strong); }
.cf-btn--line:hover:not(:disabled) { box-shadow: inset 0 0 0 1px #B9C1C9; }
.cf-btn--line:disabled { color: var(--cf-muted); cursor: not-allowed; }
.cf-btn--line.is-done { color: var(--cf-link); box-shadow: inset 0 0 0 1px var(--cf-ring); }
.cf-btn.is-busy i { animation: spin 0.9s linear infinite; }
.cf-btn.is-busy i::before { content: "\eec6"; }
.cf-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}
.cf-icon-btn i { font-size: 16px; line-height: 1; }
.cf-icon-btn:hover { background: var(--color-surface); color: var(--cf-link); }
.cf-pass .cf-icon-btn { width: var(--cf-h); height: var(--cf-h); border-radius: 12px; background: var(--cf-field); }
.cf-pass .cf-icon-btn i { font-size: 18px; }
.cf-pass .cf-icon-btn:hover { background: var(--cf-tint); }
.cf-icon-btn.is-done { color: var(--cf-link); }
.cf-icon-btn.is-done i::before { content: "\eb7b"; }

/* ---------- Подсказки ---------- */
/* Иконка всегда слева от текста; кнопка — справа, на узком — под текстом */
.cf-note {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  margin-top: 12px;
  padding: 11px 12px 11px 14px;
  background: var(--cf-tint);
  border-radius: 12px;
}
.cf-note i { align-self: start; font-size: 18px; line-height: 21px; color: var(--cf-link); }
.cf-note p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--color-text-strong); overflow-wrap: anywhere; }
.cf-note .cf-btn { grid-column: 3; }
.cf-note--warn { background: var(--cf-warn-bg); }
.cf-note--warn i { color: var(--cf-warn); }

/* ---------- Рабочая панель алгоритма ---------- */
.cf-extra { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--cf-line); }
.cf-extra-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.cf-extra-title { margin: 0; font-size: 14px; font-weight: 700; color: var(--color-text-strong); }
.cf-extra-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-empty, .cf-legend { max-width: 760px; margin: 10px 2px 0; font-size: 13.5px; line-height: 1.6; color: var(--color-text); }

/* Полоса замены: буква → буква */
.cf-map { margin: 0 0 12px; }
.cf-map-caption { margin: 0 0 6px; font-size: 12.5px; color: var(--cf-muted); }
/* Весь алфавит на виду: на ПК — одной строкой, на телефоне —
   переносится рядами, без прокрутки вбок */
.cf-map-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(26px, 1fr));
  gap: 3px;
}
.cf-map-row--num { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
.cf-map-row--wide { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.cf-map-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 2px;
  border-radius: 8px;
  background: var(--cf-field);
}
.cf-map-from { font-size: 12px; color: var(--cf-muted); }
.cf-map-to { font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; color: var(--color-text-strong); }

/* Перебор Цезаря */
.cf-brute {
  display: grid;
  gap: 2px;
  max-height: 360px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  border-radius: 12px;
}
.cf-brute-pick {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.cf-brute-pick:hover { background: var(--cf-field); }
.cf-brute-row.is-current .cf-brute-pick { background: var(--cf-field); box-shadow: inset 0 0 0 1px var(--cf-line-strong); }
.cf-brute-row.is-best .cf-brute-pick { background: var(--cf-tint); box-shadow: inset 0 0 0 2px var(--cf-ring); }
.cf-brute-shift { font-size: 12.5px; font-weight: 600; color: var(--cf-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cf-brute-text { min-width: 0; font-size: 14.5px; color: var(--color-text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-brute-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: #D6F5E4;
  font-size: 11.5px;
  font-weight: 600;
  color: #0B6B3C;
  white-space: nowrap;
}

/* Разбор Виженера */
.cf-cells { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.cf-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 44px;
  padding: 6px 6px;
  border-radius: 10px;
  background: var(--cf-field);
}
.cf-cell-src { font-size: 15px; color: var(--color-text-strong); }
.cf-cell-key { font-family: var(--font-mono); font-size: 11px; color: var(--cf-link); white-space: nowrap; }
.cf-cell-out { font-size: 15px; font-weight: 700; color: var(--color-text-strong); }
.cf-crack { margin: 0 0 14px; padding: 12px 14px; background: var(--cf-tint); border-radius: 12px; }
.cf-crack-text { margin: 0; font-size: 14px; line-height: 1.6; color: var(--color-text-strong); }
.cf-crack-key { font-family: var(--font-mono); font-size: 15px; letter-spacing: 0.04em; color: var(--cf-link); }
.cf-crack-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Квадрат Полибия */
.cf-square { border-collapse: separate; border-spacing: 3px; margin: -3px; }
.cf-square th, .cf-square td {
  width: 40px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  text-align: center;
  vertical-align: middle;
  font-size: 14px;
}
.cf-square th { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--cf-link); }
.cf-square td { background: var(--cf-field); font-weight: 600; color: var(--color-text-strong); }
.cf-square td.is-empty { background: transparent; box-shadow: inset 0 0 0 1px var(--cf-line); }

/* Звук Морзе */
.cf-speed { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.cf-speed-label { font-size: 13px; font-weight: 600; color: var(--color-text-strong); }
.cf-speed input { width: 200px; max-width: 100%; accent-color: var(--color-accent-dark); }
.cf-speed-value { font-size: 13px; color: var(--cf-muted); font-variant-numeric: tabular-nums; }

/* Сверка хеша */
.cf-compare-status { margin: 8px 2px 0; font-size: 13.5px; line-height: 1.5; }
.cf-compare-status.is-ok { color: var(--cf-link); font-weight: 600; }
.cf-compare-status.is-bad { color: var(--cf-warn); }

.cf-foot { display: flex; align-items: flex-start; gap: 6px; margin: 16px 0 0; font-size: 12.5px; line-height: 18px; color: var(--cf-muted); }
.cf-foot i { font-size: 14px; line-height: 18px; color: var(--cf-link); }

/* ---------- Узкий инструмент ---------- */
@container cftool (max-width: 900px) {
  .cf-algos { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cf-group--classic { grid-column: 1 / -1; }
}
@container cftool (max-width: 720px) {
  .cf-panes { grid-template-columns: minmax(0, 1fr); }
  .cf-swap { justify-self: center; transform: rotate(90deg); }
  .cf-text { min-height: 180px; }
  .cf-keys { grid-template-columns: minmax(0, 1fr); }
}
@container cftool (max-width: 560px) {
  /* Группы — одна под другой, кнопки — сеткой по две одной высоты */
  .cf-algos { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cf-group { gap: 10px; padding: 12px; border-radius: 16px; }
  /* 1fr: если на узком экране название переносится, все ряды растут вместе */
  .cf-group-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; }
  .cf-algo { height: auto; min-height: 40px; min-width: 0; padding: 6px 8px; white-space: normal; text-align: center; }
  /* Контролы — столбцом на всю ширину */
  .cf-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .cf-dir, .cf-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
  .cf-dir-btn, .cf-seg-btn { min-width: 0; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; }
  .cf-input, .cf-range, .cf-btn--ctrl { width: 100%; }
  .cf-range input[type="range"] { flex: 1 1 auto; width: auto; min-width: 0; }
  .cf-pane-foot { gap: 0; }
  .cf-pane-foot .cf-btn--quiet { padding: 0 8px; gap: 5px; }
  /* «Зашифровать» и «Скопировать» — поровну в одну строку */
  .cf-pane--out .cf-pane-foot { gap: 6px; }
  .cf-pane--out .cf-foot-spacer { display: none; }
  .cf-pane--out .cf-pane-foot .cf-btn { flex: 1 1 0; min-width: 0; padding: 0 8px; }
  .cf-note { grid-template-columns: 20px minmax(0, 1fr); }
  .cf-note .cf-btn { grid-column: 2; justify-self: start; }
  .cf-brute-pick { grid-template-columns: 64px minmax(0, 1fr); }
  .cf-brute-tag { grid-column: 2; justify-self: start; }
  .cf-square th, .cf-square td { width: 34px; height: 32px; font-size: 13px; }
}
@container cftool (max-width: 380px) {
  .cf-dir-btn, .cf-seg-btn { padding: 0 4px; font-size: 13px; letter-spacing: -0.01em; }
  /* «Расшифровать» и «Скопировать» не помещаются рядом — каждая на всю ширину */
  .cf-pane--out .cf-pane-foot .cf-btn { flex-basis: 100%; }
  .cf-pane-foot .cf-btn--quiet i { display: none; }
  .cf-square th, .cf-square td { width: 28px; height: 28px; font-size: 12px; }
}
@media (max-width: 560px) {
  .cf-tool { padding: 16px; border-radius: 20px; }
}

/* =========================================================
   ТЕКСТОВЫЕ РАЗДЕЛЫ
   ========================================================= */
.cf-toc {
  margin: 0 0 48px;
  padding: 18px 20px 20px;
  background: var(--color-surface);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(16, 20, 24, 0.04);
}
.cf-toc-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--color-text-strong); }
.cf-toc-title i { font-size: 16px; line-height: 1; color: var(--cf-link); }
.cf-toc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.cf-toc-list a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  height: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--cf-field);
  text-decoration: none;
  transition: background-color var(--transition-fast);
}
.cf-toc-num { flex-shrink: 0; font-family: var(--font-mono); font-size: 12px; font-weight: 600; line-height: 20px; color: var(--cf-link); }
.cf-toc-text { font-size: 14px; font-weight: 500; line-height: 20px; color: var(--color-text-strong); }
.cf-toc-list a:hover { background: var(--cf-tint); }
.cf-toc-list a:hover .cf-toc-text { color: var(--cf-link); }
.cf-toc-list a:focus-visible { outline: 2px solid var(--cf-ring); outline-offset: 2px; }

/* Читаемость: строка не длиннее ~80 знаков, кегль 16, спокойный
   интерлиньяж. Подводка раздела — контрастнее общего muted-цвета:
   тот на сером фоне даёт 3,3 : 1, этот — 5 : 1 (норма WCAG — 4,5) */
.cf-seo .section-head p { max-width: 680px; font-size: 16.5px; line-height: 1.6; color: #4E6A6F; }
.cf-seo h3 { max-width: 760px; font-size: 18px; font-weight: 700; line-height: 1.35; color: var(--color-text-strong); margin: 36px 0 10px; }
.cf-seo > p, .cf-seo h3 + p { max-width: 760px; font-size: 16px; line-height: 1.7; color: var(--color-text); margin: 0 0 16px; }

/* Метки стойкости в таблицах и карточках */
.cf-lvl {
  display: inline-flex;
  align-items: center;
  height: 21px;
  margin-right: 6px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: 1px;
}
.cf-lvl--none { background: #ECEEF0; color: #5B6770; }
.cf-lvl--weak, .cf-lvl--old { background: #FFF1D6; color: var(--cf-warn); }
.cf-lvl--strong { background: #D6F5E4; color: #0B6B3C; }
.cf-lvl--code { background: #E4EEF7; color: #2A4D6B; }
.cf-lvl--hash { background: #EEE8F7; color: #54408A; }

/* Таблицы */
.cf-table-wrap { overflow-x: auto; background: var(--color-surface); border-radius: 16px; box-shadow: 0 1px 2px rgba(16, 20, 24, 0.04); }
.cf-table-wrap:focus-visible { outline: 2px solid var(--cf-ring); outline-offset: 2px; }
.cf-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.cf-table th, .cf-table td { padding: 11px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--cf-line); }
.cf-table tbody tr:last-child > * { border-bottom: 0; }
.cf-table thead th { background: var(--color-text-strong); font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; }
.cf-table tbody th { font-weight: 600; color: var(--color-text-strong); white-space: nowrap; }
.cf-table td { color: var(--color-text); line-height: 1.55; }
.cf-table code { white-space: nowrap; }
.cf-table--algos { min-width: 900px; }
.cf-table--algos td:nth-child(5) { min-width: 250px; }
.cf-table--signs { min-width: 640px; }
.cf-table--abc { min-width: 620px; }
.cf-table--choice { min-width: 680px; }
.cf-table--choice td:first-child { width: 34%; color: var(--color-text-strong); }
.cf-table--choice td:last-child { color: var(--cf-muted); }
.cf-seo .cf-table-hint { display: flex; align-items: flex-start; gap: 6px; margin: 10px 4px 0; font-size: 12.5px; line-height: 1.5; color: var(--cf-muted); }
/* «Прокручивается вбок» — только там, где таблица действительно шире экрана */
.cf-narrow-only { display: none; }
@media (max-width: 1300px) { .cf-narrow-only { display: inline; } }
.cf-table-hint i { flex-shrink: 0; font-size: 14px; line-height: 19px; color: var(--cf-link); }

/* Шифр / код / хеш */
.cf-compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 0; }
.cf-compare-item { padding: 16px 18px; background: var(--color-surface); border-radius: 16px; }
.cf-compare-item.is-accent { box-shadow: inset 0 0 0 2px var(--color-accent); }
.cf-compare-item p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--color-text); }
.cf-compare-name { display: flex; align-items: center; gap: 8px; margin-bottom: 4px !important; font-weight: 700; color: var(--color-text-strong) !important; }
.cf-compare-name i { font-size: 18px; color: var(--cf-link); }
.cf-compare-example { margin-top: 10px !important; font-size: 13.5px !important; color: var(--cf-muted) !important; }
/* Выноска: белая карточка с зелёной полосой слева — не сливается
   с серым фоном страницы и читается как важное замечание */
.cf-callout {
  display: flex;
  gap: 14px;
  margin: 18px 0 0;
  padding: 18px 22px 18px 20px;
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: inset 4px 0 0 var(--color-accent), 0 1px 2px rgba(16, 20, 24, 0.05);
}
.cf-callout i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--cf-tint);
  font-size: 18px;
  line-height: 1;
  color: var(--cf-link);
}
.cf-callout p { max-width: 820px; margin: 0; font-size: 15.5px; line-height: 1.7; color: var(--color-text); }
.cf-callout strong { color: var(--color-text-strong); }

/* Справочник */
/* Три группы справочника — те же панели, что в инструменте: иконка,
   название, пояснение; между группами — линия и воздух */
.cf-seo .cf-ref-group {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 16px;
}
.cf-seo .cf-ref-group:not(.cf-ref-group--classic) { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--cf-line-strong); }
.cf-ref-group-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--color-surface);
  font-size: 21px;
  line-height: 1;
  color: var(--cf-muted);
  box-shadow: 0 1px 2px rgba(16, 20, 24, 0.05);
}
.cf-ref-group--crypto .cf-ref-group-icon { background: var(--color-accent); color: #06231A; box-shadow: none; }
.cf-seo .cf-ref-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text-strong);
}
.cf-ref-group-title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(16, 20, 24, 0.07);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text);
}
.cf-ref-group--crypto .cf-ref-group-title span { background: #D6F5E4; color: #0B6B3C; }
.cf-seo .cf-ref-group-sub { margin: 3px 0 0; font-size: 14.5px; line-height: 1.5; color: #4E6A6F; }
.cf-ref-group--crypto .cf-ref-group-sub { font-weight: 600; color: #0B6B3C; }
/* Карточки криптографии — с зелёной рамкой, как панель в инструменте */
.cf-ref-group--crypto + .cf-ref-list .cf-ref { box-shadow: inset 0 0 0 1px #BFE8D0; background: linear-gradient(180deg, #F3FCF7 0%, var(--color-surface) 120px); }
.cf-ref-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cf-ref {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px 22px 18px;
  background: var(--color-surface);
  border-radius: 20px;
}
.cf-ref-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.cf-seo .cf-ref-head h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.cf-ref-head .cf-lvl { margin: 0; }
.cf-ref > p { margin: 0 0 12px; font-size: 15px; line-height: 1.65; color: var(--color-text); }
.cf-ref-example {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--cf-field);
  font-size: 14px !important;
  line-height: 1.8 !important;
}
.cf-ref-example > span {
  margin-right: 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cf-muted);
}
.cf-ref-example code { background: var(--color-surface) !important; }
/* Факты — подпись над текстом, а не слева: текст получает всю ширину
   карточки вместо узкой колонки, блоки разделены тонкой линией */
.cf-ref-facts { display: grid; gap: 0; margin: 6px 0 14px; }
.cf-ref-facts > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 12px 0; border-top: 1px solid var(--cf-line); }
.cf-ref-facts > div:last-child { padding-bottom: 0; }
.cf-ref-facts dt { font-size: 12px; font-weight: 600; line-height: 1.5; letter-spacing: 0.04em; text-transform: uppercase; color: var(--cf-muted); }
.cf-ref-facts dd { margin: 0; font-size: 15px; line-height: 1.65; color: var(--color-text); }
.cf-ref-facts i { font-size: 14px; color: var(--cf-link); vertical-align: -2px; }
.cf-seo .cf-ref-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  align-self: flex-start;
  font-size: 13.5px;
  font-weight: 600;
}
.cf-ref-open i { font-size: 15px; }

/* Методы расшифровки */
.cf-cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cf-case { padding: 20px 22px; background: var(--color-surface); border-radius: 20px; }
.cf-case-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cf-case-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--cf-tint);
  color: var(--cf-link);
  font-size: 18px;
}
.cf-case h4 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; color: var(--color-text-strong); }
.cf-case p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--color-text); }

/* Правила защиты */
.cf-rules { margin: 0; padding: 0; list-style: none; counter-reset: rule; display: grid; gap: 8px; }
.cf-rules li {
  position: relative;
  padding: 14px 18px 14px 56px;
  background: var(--color-surface);
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text);
  counter-increment: rule;
}
.cf-rules li::before {
  content: counter(rule);
  position: absolute;
  left: 16px;
  top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cf-tint);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--cf-link);
}
.cf-rules strong { color: var(--color-text-strong); }
.cf-rules i { color: var(--cf-link); }
.cf-method { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 0; }
.cf-method-item { padding: 16px 18px; background: var(--color-surface); border-radius: 16px; }
.cf-method-item strong { display: block; font-family: var(--font-display); font-size: 26px; line-height: 1.1; color: var(--cf-link); }
.cf-method-item span { display: block; margin-top: 6px; font-size: 14px; line-height: 1.55; color: var(--color-text); }

/* Ответы FAQ — тем же кеглем, что и текст разделов. Ширину не ограничиваем:
   у всех остальных инструментов ответ занимает всю карточку, а здесь он
   заканчивался на 780px и оставлял справа пустое поле */
.tool-faq#faq .tool-faq-answer-inner p { font-size: 15.5px; line-height: 1.7; }

/* Источники */
.cf-sources { margin: 0; padding: 0; list-style: none; background: var(--color-surface); border-radius: 16px; }
.cf-sources li { padding: 13px 18px; border-bottom: 1px solid var(--cf-line); font-size: 14.5px; line-height: 1.6; color: var(--color-text); }
.cf-sources li:last-child { border-bottom: 0; }

@media (max-width: 900px) {
  .cf-compare, .cf-cases, .cf-method, .cf-ref-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .cf-toc { margin-bottom: 36px; padding: 16px; }
  .cf-toc-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
  .cf-toc-list a { padding: 9px 10px; gap: 8px; }
  .cf-toc-text { font-size: 13.5px; }
  .cf-ref { padding: 16px 16px 14px; }
  .cf-seo .cf-ref-group { gap: 12px; }
  .cf-seo .cf-ref-group:not(.cf-ref-group--classic) { margin-top: 40px; padding-top: 24px; }
  .cf-ref-group-icon { width: 40px; height: 40px; font-size: 19px; }
  .cf-seo .cf-ref-group-title { font-size: 17px; }
  .cf-seo .cf-ref-group-sub { font-size: 14px; }
  .cf-callout { padding: 16px; gap: 12px; }
  .cf-rules li { padding: 12px 14px 12px 50px; }
  .cf-rules li::before { left: 12px; top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-switch-track, .cf-switch-track::after { transition: none; }
  .cf-btn.is-busy i { animation: none; }
}

/* Сведения об алгоритме: подпись слева, текст справа. Пример — две плашки с моно-шрифтом */
.cf-info-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--cf-line);
}
.cf-info-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 4px 14px; align-items: start; }
.cf-info-row dt { margin: 0; font-size: 12.5px; font-weight: 600; line-height: 22px; color: var(--cf-muted); }
.cf-info-row dd { margin: 0; font-size: 14px; line-height: 22px; color: var(--color-text); }
.cf-info-row[hidden] { display: none; }
.cf-ex { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.cf-ex-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--cf-field);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-strong);
  overflow-wrap: anywhere;
}
.cf-ex-chip--to { background: var(--cf-tint); color: #0B6B3C; font-weight: 600; }
.cf-ex-arrow { flex-shrink: 0; font-size: 15px; line-height: 1; color: var(--cf-muted); }
.cf-ex-note { font-size: 12.5px; color: var(--cf-muted); }
.cf-info-more { margin-top: 10px; }

/* «Не знаете, что выбрать?» — сворачиваемая подсказка над списком алгоритмов */
.cf-guide { margin: 0 0 12px; }
.cf-guide-sum {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--cf-field);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text-strong);
  list-style: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.cf-guide-sum::-webkit-details-marker { display: none; }
.cf-guide-sum:hover { background: var(--cf-field-hover); }
.cf-guide-sum > i:first-child { font-size: 18px; line-height: 1; color: var(--cf-link); }
.cf-guide-sum > span { flex: 1 1 auto; min-width: 0; }
.cf-guide-chev { font-size: 18px; line-height: 1; color: var(--cf-muted); transition: transform var(--transition-fast); }
.cf-guide[open] .cf-guide-chev { transform: rotate(180deg); }
.cf-guide-sum:focus-visible { outline: 2px solid var(--cf-ring); outline-offset: 2px; }
.cf-guide-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.cf-guide-list li { display: flex; min-width: 0; }
.cf-pick {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-width: 0;
  min-height: 52px;
  padding: 8px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--cf-line);
  font-size: 13.5px;
  line-height: 1.4;
  text-align: left;
  color: var(--color-text);
  cursor: pointer;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}
.cf-pick:hover { background: var(--cf-tint); box-shadow: inset 0 0 0 1px #BFE8D0; }
.cf-pick-goal { min-width: 0; flex: 1 1 auto; }
.cf-pick-to {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--cf-field);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-strong);
  white-space: nowrap;
}
.cf-pick:hover .cf-pick-to { background: var(--color-accent); color: #06231A; }
@container cftool (max-width: 720px) {
  .cf-guide-list { grid-template-columns: minmax(0, 1fr); }
}
@container cftool (max-width: 560px) {
  .cf-info { padding: 12px 14px; }
  .cf-info-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cf-info-row dt { line-height: 18px; }
  .cf-pick { flex-wrap: wrap; align-items: flex-start; }
  .cf-pick-to { flex-shrink: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-guide-chev, .cf-guide-sum, .cf-pick { transition: none; }
}
/* Текст на всю ширину карточки; ограничение длины строки — только на очень широких экранах (карточка от 1200 px) */
@container cftool (min-width: 1200px) {
  .cf-info-row dd { max-width: 120ch; }
}
