/* rubric-lifecycle — стили решений владельца 19.10.2026. Цвета — только токены tokens.css. */

/* ── Список рубрик направления ── */
.rubric-list-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rubric-list { display: flex; flex-direction: column; gap: 10px; }

/* Строка рубрики. Рамка и тень — классами, а не встроенным стилем: поверх
   них рисуются отметки перетаскивания. */
.rubric-row {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--sh-xs);
  transition: border-color .15s, box-shadow .15s, opacity .15s;
}
.rubric-row.is-open,
.rubric-row.is-focused { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.rubric-row.is-inactive { opacity: .62; }
.rubric-row[draggable="true"] { cursor: grab; }
.rubric-row[draggable="true"]:active { cursor: grabbing; }
.rubric-row.is-dragging { opacity: .45; }

/* Куда встанет рубрика: линия до/после строки (тень не обрезается своим
   overflow) и пунктирная рамка «в семью». */
.rubric-row.is-drop-before { box-shadow: 0 -5px 0 -2px var(--accent), var(--sh-xs); }
.rubric-row.is-drop-after { box-shadow: 0 5px 0 -2px var(--accent), var(--sh-xs); }
.rubric-row.is-drop-into { border-color: var(--accent); }
.rubric-row.is-drop-into::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px dashed var(--accent);
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent-soft) 30%, transparent);
  pointer-events: none;
}

.rubric-drag-handle {
  display: inline-grid;
  place-items: center;
  width: 18px;
  flex-shrink: 0;
  color: var(--ink-4);
  cursor: grab;
  user-select: none;
}
.rubric-row:hover .rubric-drag-handle { color: var(--ink-2); }

/* Номер рубрики перед названием; красный — номер повторяется. */
.rubric-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
}
.rubric-number-badge.is-conflict { background: var(--red-soft); color: var(--red); }
.badge.rubric-number-conflict { height: 18px; font-size: 10.5px; }

/* Семья 6.x — группой со скобкой слева и общей подписью. */
.rubric-family {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 6px;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--accent-soft-2);
  transition: box-shadow .15s;
}
.rubric-family-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.rubric-family.is-drop-before { box-shadow: 0 -5px 0 -2px var(--accent); }
.rubric-family.is-drop-after { box-shadow: 0 5px 0 -2px var(--accent); }

/* Подпись группы (семьи) и полоса под ней — места «встанет отдельно перед /
   после» при перетаскивании (21.10.2026). Рамка у подписи есть всегда, но
   прозрачная: при начале перетаскивания карточки не прыгают. */
.rubric-family-label,
.direction-group-label {
  align-self: flex-start;
  margin-left: -9.5px;
  padding: 2px 8px;
  border: 1.5px dashed transparent;
  border-radius: var(--r-sm);
  transition: border-color .12s, background-color .12s, color .12s;
}
.rubric-family-label.is-drop-zone,
.direction-group-label.is-drop-zone { border-color: var(--line-strong); }
.group-drop-zone-note {
  margin-left: 8px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.group-drop-zone {
  padding: 9px 12px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink-4);
  font-size: 12px;
  text-align: center;
  transition: border-color .12s, background-color .12s, color .12s;
}
.rubric-family-label.is-drop-zone.is-active,
.direction-group-label.is-drop-zone.is-active,
.group-drop-zone.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* Черта «Выключенные рубрики (N)» / «Выключенные направления (N)». */
.rubric-list-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: var(--ink-4);
  font-size: 12px;
  font-weight: 650;
}
.rubric-list-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.direction-list-divider { grid-column: 1 / -1; }

/* ── Окно «Выключить рубрику / направление?» ── */
.lifecycle-confirm { display: flex; flex-direction: column; gap: 14px; }
.lifecycle-confirm-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.lifecycle-confirm-list > li {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.45;
}
.lifecycle-confirm-list > li.is-warning { border-color: var(--red-border); background: var(--red-soft); color: var(--red); }
.lifecycle-confirm-items { margin: 6px 0 0; padding-left: 18px; color: var(--ink-3); font-size: 12px; line-height: 1.5; }
/* Строка архива: что уходит в архив — по видам, у каждого свои примеры. */
.lifecycle-confirm-kinds { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.lifecycle-confirm-kinds > li {
  padding-left: 10px;
  border-left: 2px solid var(--line-strong);
  color: var(--ink);
  font-weight: 600;
}
.lifecycle-confirm-kinds .lifecycle-confirm-items { font-weight: 400; }
.lifecycle-confirm-error { color: var(--red); font-size: 12.5px; }
.lifecycle-confirm-agree { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--ink); cursor: pointer; }
.lifecycle-confirm-agree input { width: 16px; height: 16px; accent-color: var(--red); }
.lifecycle-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn.btn-primary.lifecycle-danger,
.btn.btn-primary.lifecycle-danger:hover,
.btn.btn-primary.lifecycle-danger:active { background: var(--red); border-color: var(--red); }
.btn.btn-primary.lifecycle-danger:hover:not(:disabled) { filter: brightness(.94); }

/* ── Форма рубрики: номер и примечание ── */
.rubric-number-field { width: 120px; }

/* ── Форма рубрики: «Хэштег на других языках» (20.10.2026) ── */
.rubric-header-tags { display: flex; flex-direction: column; gap: 8px; }
.rubric-header-tags-toggle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}
.rubric-header-tags-toggle:hover,
.rubric-header-tags.is-open .rubric-header-tags-toggle { border-color: var(--accent); color: var(--accent-text); }
.rubric-header-tags-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rubric-header-tags-count { font-weight: 500; color: var(--ink-4); }
.rubric-header-tags-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.rubric-header-tags-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 14px; }
.rubric-header-tags-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rubric-header-tags-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rubric-header-tags-lang { min-width: 26px; font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.rubric-header-tags-row .input { flex: 1; min-width: 0; }
.rubric-header-tags-item.has-error .input { border-color: var(--red); }
.rubric-header-tags-error { color: var(--red); font-size: 12px; line-height: 1.4; }
.rubric-header-tags-shared { color: var(--ink-3); font-size: 12.5px; }
.rubric-header-tags-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rubric-header-tags-notice { color: var(--ink-3); font-size: 12px; }
.rubric-header-tags-question {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
}
.rubric-header-tags-question ul { margin: 0; padding-left: 18px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.rubric-header-tags-question-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Свёрнутый блок, у которого есть известные хэштеги для пустых полей. */
.rubric-header-tags-hint-chip {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 650;
}
/* Строка «Известны: …» с кнопкой «Подставить». */
.rubric-header-tags-known {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
}
.rubric-header-tags-known-text { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }

/* ── Список направлений: номер, группы 3.x, перетаскивание (20.10.2026) ── */
.direction-list { display: flex; flex-direction: column; gap: 14px; }
.card.direction-card {
  position: relative;
  cursor: pointer;
  transition: box-shadow .14s, border-color .14s, opacity .15s;
}
.card.direction-card:hover { box-shadow: var(--sh-md); border-color: var(--line-strong); }
.card.direction-card.is-inactive { opacity: .72; }
.card.direction-card[draggable="true"] { cursor: grab; }
.card.direction-card[draggable="true"]:active { cursor: grabbing; }
.card.direction-card.is-dragging { opacity: .45; }
.card.direction-card:hover .rubric-drag-handle { color: var(--ink-2); }
.direction-drag-handle { align-self: center; }

/* Куда встанет направление: сетка читается слева направо — линия слева
   («до») или справа («после») карточки; пунктирная рамка — «в группу». */
.card.direction-card.is-drop-before { box-shadow: -6px 0 0 -2px var(--accent), var(--sh-sm); }
.card.direction-card.is-drop-after { box-shadow: 6px 0 0 -2px var(--accent), var(--sh-sm); }
.card.direction-card.is-drop-into { border-color: var(--accent); }
.card.direction-card.is-drop-into::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px dashed var(--accent);
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent-soft) 30%, transparent);
  pointer-events: none;
}

/* Группа 3.x — на всю ширину сетки, скобкой слева и общей подписью. До и
   после всей группы — линия над или под ней. */
.direction-group {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--accent-soft-2);
  transition: box-shadow .15s;
}
.direction-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.direction-group-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.direction-group.is-drop-before { box-shadow: 0 -6px 0 -3px var(--accent); }
.direction-group.is-drop-after { box-shadow: 0 6px 0 -3px var(--accent); }

/* Карточка направления: номер в шапке и поле номера рядом с названием. */
.rubric-number-badge.direction-number-badge { min-width: 30px; height: 24px; font-size: 13px; }
.direction-name-edit { display: flex; flex-direction: column; gap: 6px; }
.input.direction-number-input { width: 96px; }

/* Выбор направления в шапке: номер перед названием. */
.direction-picker-number {
  display: inline-block;
  padding: 0 5px;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
  vertical-align: 1px;
  flex-shrink: 0;
}
.direction-switch .ds-name > .direction-picker-number { margin-right: 6px; }

@media (max-width: 767px) {
  .direction-group-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── Вкладка «Контроль постинга»: расписание как в шаблонах ── */
.rubric-plan-schedule { margin-top: 0; }
.rubric-plan-schedule > .wizard-recurrence-panel { border-top: 0; }
.rubric-plan-schedule.is-off { opacity: .6; }
.rubric-plan-perday { display: flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; }
.rubric-plan-perday input { width: 16px; height: 16px; accent-color: var(--accent); }
.rubric-plan-perday strong { font-weight: 650; color: var(--ink-2); }
.rubric-plan-days { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.rubric-plan-day-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--ink-2); font-size: 12.5px; }
.rubric-plan-day-name { min-width: 110px; font-weight: 650; }
.rubric-plan-day-row .input { width: 96px; }
.rubric-plan-day-row .input.wizard-recurrence-number { width: 68px; }
/* Общие правила доступны из таблицы; местные дополнения раскрываются по запросу. */
.rubric-prompt-section { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.rubric-prompt-section > summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.rubric-prompt-section > summary .badge { margin-left: 8px; }
.rubric-prompt-section[open] > summary { margin-bottom: 14px; }
.rubric-prompt-section > .field + .field { margin-top: 14px; }
.text-cards-settings > * + * { margin-top: 12px; }
.text-cards-platforms { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.text-cards-platforms legend { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.text-cards-option, .text-cards-platforms label { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.text-cards-options { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.text-cards-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.text-cards-preview figure { margin: 0; min-width: 0; }
.text-cards-preview figcaption { color: var(--ink-3); font-size: 12px; padding-top: 5px; }
@media (max-width: 600px) { .text-cards-options { grid-template-columns: 1fr; } }
