/* ==========================================================================
   Launch Tracker · дизайн-система v11 «Обсидиан / Ирис»
   Сигнатура: «линия сигнала» — градиент из четырёх статусов запусков
   (Active → Paused → Banned → Testing). Пульс продукта в одной нити.
   ========================================================================== */

:root {
  color-scheme: dark;
  /* Палитра */
  --bg:        #0e0e13;   /* обсидиан — фон страницы */
  --surface:   #15151c;   /* слюда — карточки, топбар */
  --surface-2: #1c1c25;   /* уголь — поля, hover-строки */
  --line:      #26262f;   /* гравировка — границы */
  --line-2:    #32323e;   /* границы при наведении */
  --text:      #eeeef4;   /* кость */
  --muted:     #9494a8;
  --dim:       #62626f;

  --accent:     #8a8aff;  /* ирис — действия, фокус, выбор */
  --accent-hi:  #a4a4ff;
  --accent-2:   #b78aff;  /* второй тон градиента действий */
  --accent-ink: #0e0e13;
  --danger:     #ff7070;

  /* Статусы — семантика запусков */
  --st-active:  #3ad6a0;
  --st-paused:  #ffc357;
  --st-banned:  #ff7070;
  --st-testing: #62a8ff;

  /* Сигнатура: линия сигнала */
  --signal: linear-gradient(90deg, var(--st-active), var(--st-paused), var(--st-banned), var(--st-testing));

  /* Сегменты UTM-конструктора */
  --seg-static: #9494a8;
  --seg-cab:    #ffb187;
  --seg-agent:  #c9a2ff;
  --seg-b:      #8a8aff;
  --seg-ad:     #7fdc9e;

  --font:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Space Grotesk', var(--font);
  --mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --radius:    10px;
  --radius-lg: 14px;
  --shadow-pop: 0 12px 36px rgba(0, 0, 0, .55);
  --ring: 0 0 0 3px rgba(138, 138, 255, .22);
  --ease: 140ms cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Базис ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.mono { font-family: var(--mono); }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="range"])),
:where(select),
:where(textarea) {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13.5px;
}
:where(input):focus-visible, :where(select):focus-visible, :where(textarea):focus-visible {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
::placeholder { color: var(--dim); }
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13.5px;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):focus,
select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: var(--dim); }
::selection { background: rgba(138, 138, 255, .3); }

/* тонкие скроллбары */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Кнопки ---------- */
.btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform var(--ease);
  white-space: nowrap;
}
.btn:hover { background: #232330; border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.12); background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger-ghost:hover { background: rgba(255, 112, 112, .12); border-color: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ui-danger { color: var(--danger); border-color: rgba(255, 112, 112, .4); background: transparent; }
.btn.ui-danger:hover { background: rgba(255, 112, 112, .12); }
.btn-bulk-danger { color: var(--danger); border-color: rgba(255, 112, 112, .4); }
.btn-bulk-danger:hover { background: rgba(255, 112, 112, .12); }

/* иконко-кнопки в строках */
.row-btn {
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--muted); cursor: pointer; padding: 4px 7px; font-size: 13px;
  transition: color var(--ease), background var(--ease);
}
.row-btn:hover { color: var(--text); background: var(--surface-2); }
.row-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.row-btn.danger:hover { color: var(--danger); background: rgba(255, 112, 112, .1); }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.field .hint { font-style: normal; color: var(--dim); font-weight: 400; text-transform: none; letter-spacing: 0; }
.field input, .field select, .filters input, .filters select {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius);
  padding: 9px 11px;
  font-size: 13.5px;
  min-width: 0;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.field input:focus, .field select:focus, .filters input:focus, .filters select:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
.field input.mono { font-family: var(--mono); font-size: 13px; }
.checkbox-field { flex-direction: row; align-items: center; gap: 9px; }
.checkbox-field span { font-size: 14px; color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 400; }
.checkbox-field input { accent-color: var(--accent); width: 16px; height: 16px; }
.form-error {
  background: rgba(255, 112, 112, .09);
  border: 1px solid rgba(255, 112, 112, .35);
  color: #ffa3a3;
  border-radius: var(--radius);
  padding: 9px 12px;
  margin-top: 12px;
  font-size: 13.5px;
}
input[type="date"] { color-scheme: dark; }

/* ---------- Логин ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(640px 340px at 50% -10%, rgba(138, 138, 255, .08), transparent 70%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 384px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px 30px 30px;
  display: flex; flex-direction: column; gap: 16px;
  position: relative;
  overflow: hidden;
}
.login-card::before {           /* линия сигнала — верх карточки */
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--signal);
}
.login-logo, .topbar-logo {
  font-family: var(--display);
  font-weight: 700; font-size: 21px; letter-spacing: -.01em;
}
.login-logo span, .topbar-logo span { color: var(--accent); }
.login-sub { margin: -8px 0 4px; color: var(--muted); font-size: 13.5px; }

/* ---------- Топбар ---------- */
.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px;
  height: 58px;
  background: rgba(21, 21, 28, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar::after {                /* линия сигнала под топбаром */
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--signal);
  opacity: .8;
}
.topbar-logo { font-size: 17px; }
.topbar-tabs {
  display: flex; gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px;
  max-width: max-content;
}
.tab {
  position: relative;
  background: transparent; border: none; color: var(--muted);
  font-size: 13.5px; font-weight: 500; padding: 7px 13px;
  border-radius: 9px; cursor: pointer;
  transition: color var(--ease), background var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.tab:focus-visible { outline: none; box-shadow: var(--ring); }
.topbar-user { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.user-chip {
  display: flex; align-items: baseline; gap: 8px; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 99px; padding: 5px 13px;
}
.user-chip code { color: var(--accent); font-size: 12px; }

/* ---------- Контент и панели ---------- */
.content { padding: 22px 24px; max-width: none; margin: 0; }
.panel-title {
  margin: 0; font-family: var(--display);
  font-size: 18px; font-weight: 600; letter-spacing: -.01em;
}
.panel-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; max-width: 640px; }

.toolbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input[type="search"] { width: 240px; }
.filters input[type="date"] { width: 138px; }
.toolbar-actions { display: flex; gap: 8px; }
.date-presets {
  display: inline-flex; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2px;
}
.date-presets .btn { border: none; background: transparent; }
.date-presets .btn:hover { background: var(--surface); }

/* ---------- Таблицы ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}
table.grid { width: 100%; min-width: 100%; border-collapse: collapse; font-size: 13.5px; }
.grid th {
  text-align: left; font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted);
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface);
  cursor: pointer; user-select: none;
  position: relative;
}
.grid td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.grid tbody tr:last-child td { border-bottom: none; }
.grid tbody tr { transition: background var(--ease); }
.grid tbody tr:hover { background: rgba(138, 138, 255, .045); }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid td.num { font-family: var(--mono); font-size: 12.5px; }
.grid .actions-col { width: 1%; }
.grid td .cell-mono { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.cell-comment { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }

/* обрезание содержимого + сортировка */
.grid th, .grid td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid td .cell-mono { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-label { vertical-align: middle; }
.th-arrow { margin-left: 4px; color: var(--accent); font-weight: 700; }
th.th-sorted { color: var(--text); }

/* статус-пилюли */
.status-pill {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line);
}
.status-pill[data-st="active"]  { color: var(--st-active);  background: rgba(58, 214, 160, .1);  border-color: rgba(58, 214, 160, .32); }
.status-pill[data-st="paused"]  { color: var(--st-paused);  background: rgba(255, 195, 87, .1);  border-color: rgba(255, 195, 87, .32); }
.status-pill[data-st="banned"]  { color: var(--st-banned);  background: rgba(255, 112, 112, .1); border-color: rgba(255, 112, 112, .32); }
.status-pill[data-st="testing"] { color: var(--st-testing); background: rgba(98, 168, 255, .1);  border-color: rgba(98, 168, 255, .32); }

.empty { padding: 52px 24px; text-align: center; color: var(--muted); }
.badge-off {
  font-size: 11.5px; font-weight: 600; color: var(--danger);
  border: 1px solid rgba(255, 112, 112, .35); border-radius: 99px; padding: 2px 9px;
}
.badge-on {
  font-size: 11.5px; font-weight: 600; color: var(--st-active);
  border: 1px solid rgba(58, 214, 160, .35); border-radius: 99px; padding: 2px 9px;
}
.badge-role { font-size: 11.5px; color: var(--muted); }
.badge-role-admin { color: #c9a2ff; }
.badge-role-assistant { color: #7cc7ff; }
.assist-of { color: var(--muted); font-size: 12px; }

/* недоделанные запуски (нет ссылки) */
tr.row-nolink td { background: rgba(255, 112, 112, .05); }
tr.row-nolink td.sel-col { box-shadow: inset 3px 0 0 rgba(255, 112, 112, .55); }
tr.row-nolink:hover td { background: rgba(255, 112, 112, .09); }

/* разделители дней */
tr.day-sep td {
  background: var(--bg) !important;
  color: var(--muted);
  font-family: var(--display);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  padding: 7px 12px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}

/* инлайн-редактирование */
.cell-edit { cursor: text; }
.cell-edit:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.grid td.editing { padding: 4px 6px; }
.inline-input {
  width: 100%; box-sizing: border-box; font: inherit;
  padding: 4px 6px; border-radius: 6px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--accent); outline: none;
}
select.inline-input { padding: 3px 4px; }

/* ресайз и перетаскивание колонок */
.col-resizer {
  position: absolute; top: 0; right: -4px; width: 9px; height: 100%;
  cursor: col-resize; z-index: 2;
}
.col-resizer:hover { background: var(--accent); opacity: .5; }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }
table.grid[data-resizable] td,
table.grid[data-resizable] th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid th.dragging { opacity: .4; }
.grid th.drag-over { box-shadow: inset 3px 0 0 var(--accent); }

/* массовые действия и галочки */
.bulk-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid rgba(138, 138, 255, .4);
  border-radius: var(--radius);
}
.bulk-count { font-size: 13px; color: var(--muted); margin-right: 4px; }
.sel-col { width: 34px; text-align: center; }
.sel-col input, .cell-check input { accent-color: var(--accent); cursor: pointer; }
.cell-check { text-align: center; }
.cell-check input { width: 15px; height: 15px; }

/* приоритет */
.prio-pill {
  font-size: 11.5px; padding: 2px 9px; border-radius: 20px;
  border: 1px solid var(--line); display: inline-block; white-space: nowrap;
}
.prio-high   { color: var(--st-banned); background: rgba(255, 112, 112, .1); border-color: rgba(255, 112, 112, .35); }
.prio-medium { color: var(--st-paused); background: rgba(255, 195, 87, .1);  border-color: rgba(255, 195, 87, .35); }
.prio-low    { color: #a0a8b8; background: rgba(160, 168, 184, .08); border-color: rgba(160, 168, 184, .3); }
.prio-none   { color: var(--muted); opacity: .5; }

/* цветные бейджи: продукт, CTC, кастомные списки */
.prod-badge {
  font-weight: 600; font-size: 12.5px;
  padding: 2px 9px; border-radius: 7px;
  border: 1px solid transparent; display: inline-block;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle;
}
.ctc-badge {
  font-family: var(--mono); font-size: 12.5px;
  padding: 2px 7px; border-radius: 6px; display: inline-block;
}
.cval-badge {
  font-size: 12px; padding: 2px 9px; border-radius: 20px;
  border: 1px solid var(--line); display: inline-block;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle;
}
.cc-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin: 0 3px 0 6px; vertical-align: baseline;
}

/* комментарий */
.comment-clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#cm-text {
  width: 100%; box-sizing: border-box; resize: vertical;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; font: inherit; min-height: 120px;
}
#cm-text:focus { border-color: var(--accent); outline: none; box-shadow: var(--ring); }

/* действия не обрезаются */
td.actions-cell { overflow: visible; text-overflow: clip; padding-right: 10px; background: inherit; }
td.actions-cell .row-actions { display: inline-flex; flex-wrap: nowrap; gap: 4px; }

/* переключатель прокрутки и настройка колонок */
.hscroll-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--muted); cursor: pointer;
  margin: 0; user-select: none;
}
.hscroll-toggle input { accent-color: var(--accent); cursor: pointer; }
.table-tools { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.colset-pop {
  position: absolute; z-index: 260; margin-top: -6px;
  background: var(--surface); border: 1px solid rgba(138, 138, 255, .4);
  border-radius: var(--radius); padding: 10px 12px;
  box-shadow: var(--shadow-pop);
  max-height: 340px; overflow-y: auto; min-width: 220px;
}
.colset-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-bottom: 8px;
}
.colset-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 4px 2px; cursor: pointer; user-select: none;
}
.colset-row input { accent-color: var(--accent); cursor: pointer; }

/* ---------- Справочники ---------- */
.dicts-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.dict-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px;
}
.dict-card h3 { margin: 0 0 4px; font-family: var(--display); font-size: 15px; font-weight: 600; }
.dict-card .dict-note { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.dict-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; max-height: 320px; overflow-y: auto; }
.dict-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 7px 7px 11px; font-size: 13.5px;
  transition: border-color var(--ease);
}
.dict-item:hover { border-color: var(--line-2); }
.dict-item .dict-value { overflow: hidden; text-overflow: ellipsis; }
.dict-add { display: flex; gap: 8px; }
.dict-add input { flex: 1; }
.dict-count {
  display: inline-block; font-size: 11px; font-weight: 600;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 1px 8px; margin-left: 6px; vertical-align: middle;
  font-family: var(--mono);
}
.dict-search {
  width: 100%; box-sizing: border-box; margin-bottom: 8px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; font: inherit; font-size: 13px;
}
.dict-search:focus { border-color: var(--accent); outline: none; box-shadow: var(--ring); }
.dict-empty { padding: 10px 4px; color: var(--muted); font-size: 12.5px; }
.dict-more { width: 100%; margin: 6px 0 2px; }
.dict-row-color, .dict-add-color {
  width: 26px; height: 24px; padding: 1px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--surface-2); cursor: pointer; flex: 0 0 auto;
}
.cc-add { flex-wrap: wrap; }
.cc-add select { min-width: 90px; }
.cc-opts { margin-top: 10px; }
.cc-opts-cap { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cc-opt-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.cc-opt-row .cc-opt-value { flex: 1; }
.cc-opt-row input[type="color"] {
  width: 34px; height: 30px; padding: 2px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--surface-2); cursor: pointer;
}

/* ---------- Модалки ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8, 8, 12, .72);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.modal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); width: 100%; max-width: 440px;
  padding: 22px 24px 24px;
  box-shadow: var(--shadow-pop);
}
.modal-wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { margin: 0; font-family: var(--display); font-size: 17px; font-weight: 600; }
.modal-x {
  background: none; border: none; color: var(--muted); font-size: 24px;
  line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.modal-x:hover { color: var(--text); background: var(--surface-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid-1 { grid-template-columns: 1fr; }
.field-span2 { grid-column: span 2; }

/* ui-модалки (confirm / prompt / alert) */
.ui-modal-back {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(8, 8, 12, .6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ui-modal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px 20px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-pop);
}
.ui-modal-title { font-family: var(--display); font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.ui-modal-msg { font-size: 13.5px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
.ui-modal-fields { display: grid; gap: 10px; margin-bottom: 12px; }
.ui-field { display: grid; gap: 5px; }
.ui-field span { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ui-field input, .ui-field select {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 11px; font: inherit; font-size: 13.5px; width: 100%; box-sizing: border-box;
}
.ui-field input:focus, .ui-field select:focus { border-color: var(--accent); outline: none; box-shadow: var(--ring); }
.ui-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ---------- Сигнатурный блок формы: UTM-конструктор ---------- */
.utm-box {
  margin-top: 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 0;
}
.utm-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px 14px;
}
.utm-row + .utm-row { border-top: 1px dashed var(--line); }
.utm-label {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}
.utm-value { font-size: 12.5px; word-break: break-all; line-height: 1.6; font-family: var(--mono); }
.utm-wait { color: var(--dim); font-family: var(--font); font-size: 13px; }
.seg-static { color: var(--seg-static); }
.seg-cab    { color: var(--seg-cab); }
.seg-agent  { color: var(--seg-agent); }
.seg-b      { color: var(--seg-b); }
.seg-ad     { color: var(--seg-ad); }
.btn-copy { padding: 7px 13px; font-size: 13px; }
.btn-copy.copied { color: var(--st-active); border-color: rgba(58, 214, 160, .4); }

/* ---------- Тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 99px; padding: 10px 20px; font-size: 13.5px;
  z-index: 500; box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.toast::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--signal);
}

/* ---------- Дашборд ---------- */
.dash-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px; align-items: start;
}
.dash-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px;
}
.dash-card h3 {
  margin: 0 0 12px; font-family: var(--display); font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
.dash-card h4 { margin: 14px 0 6px; font-size: 12.5px; color: var(--muted); }
.dash-card h4:first-of-type { margin-top: 4px; }
.dash-wide { grid-column: 1 / -1; }
.dash-total { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 110px; }
.dash-num { font-family: var(--display); font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.dash-cap { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.dash-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.dash-row-label { flex: 0 0 92px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bar { flex: 1; height: 7px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.dash-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 6px; }
.dash-row-num { flex: 0 0 34px; text-align: right; font-family: var(--mono); font-size: 12.5px; }
.dash-names { flex: 1; font-size: 12.5px; color: var(--muted); }
.dash-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dash-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 5px 8px; border-bottom: 1px solid var(--line);
}
.dash-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table .num { text-align: right; font-family: var(--mono); }
.dash-buyers {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.dash-buyer {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.dash-buyer-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px; font-size: 14px;
}
.dash-buyer-total { font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--accent); }
.dash-sub {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin: 8px 0 2px;
}
.dash-geo-block { margin-bottom: 4px; }

/* ---------- Popover-редактор ---------- */
.popover {
  position: absolute; z-index: 300;
  background: var(--surface); border: 1px solid rgba(138, 138, 255, .4);
  border-radius: var(--radius); padding: 10px 12px 12px;
  box-shadow: var(--shadow-pop);
}
.popover-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-bottom: 6px;
}
.popover-text {
  width: 100%; box-sizing: border-box; resize: vertical;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 13px;
}
.popover-text:focus { border-color: var(--accent); outline: none; }
.popover-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ---------- Combobox ---------- */
.combo { position: relative; }
.combo input { width: 100%; box-sizing: border-box; }
.combo-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 250;
  background: var(--surface); border: 1px solid rgba(138, 138, 255, .4);
  border-radius: var(--radius);
  max-height: 260px; overflow-y: auto;
  box-shadow: var(--shadow-pop);
  padding: 4px;
}
.combo-item {
  padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.combo-item:hover, .combo-item.active { background: rgba(138, 138, 255, .13); }
.combo-more { padding: 7px 10px; font-size: 12px; color: var(--muted); }
.combo-hint { color: var(--muted); font-style: normal; font-size: 11.5px; margin-left: 4px; }

/* ---------- Генератор оффер-ссылок ---------- */
.links-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px; align-items: start;
}
.lg-result { margin-top: 14px; display: grid; gap: 12px; }
.lg-block { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.lg-cap {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin-bottom: 5px;
}
.lg-out { font-size: 13px; margin-bottom: 8px; word-break: break-all; min-height: 18px; }
.lg-url { font-family: var(--mono); font-size: 12px; color: #a9b8ff; }
.bl-url-hint { display: block; font-family: var(--mono); font-size: 11px; word-break: break-all; }
#bl-items .dict-value { white-space: normal; }
.bl-add { display: block; }
.bl-add .modal-foot { justify-content: flex-start; margin-top: 14px; }

/* ---------- История ---------- */
.audit-act {
  font-size: 11.5px; padding: 2px 9px; border-radius: 20px;
  border: 1px solid var(--line); display: inline-block;
}
.audit-create  { color: var(--st-active);  border-color: rgba(58, 214, 160, .3); }
.audit-update  { color: var(--st-testing); border-color: rgba(98, 168, 255, .3); }
.audit-delete  { color: var(--danger);     border-color: rgba(255, 112, 112, .3); }

/* ---------- Кнопка «Креативы» в строке ---------- */
.btn-drive.drive-ready { color: var(--st-active); border-color: rgba(58, 214, 160, .4); }
.btn-drive.drive-loading { opacity: .7; animation: drive-pulse 1s infinite; }
@keyframes drive-pulse { 50% { opacity: .35; } }

/* ---------- Кабинеты ---------- */
.cab-agency-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.cab-ag-pill {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 99px;
  padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}
.cab-ag-pill:hover { border-color: rgba(138, 138, 255, .5); }
.cab-ag-pill.active { border-color: var(--accent); background: rgba(138, 138, 255, .12); }
.cab-ag-x { margin-left: 6px; opacity: .6; }
.cab-ag-x:hover { opacity: 1; color: var(--danger); }
.cab-ag-add select {
  background: var(--surface); color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: 99px;
  padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer;
}
#cab-card { max-width: 720px; }
.cab-head { margin-bottom: 2px; }
.cab-add { display: flex; gap: 8px; margin-bottom: 10px; }
.cab-add input { flex: 1; }
.cab-row { display: flex; align-items: center; gap: 12px; }
.cab-id { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.cab-date { color: var(--muted); font-size: 12px; flex: 0 0 78px; font-family: var(--mono); }
.cab-status-pill {
  font-size: 11.5px; padding: 2px 10px; border-radius: 99px;
  border: 1px solid var(--line); cursor: pointer; white-space: nowrap;
}
.cab-status-select { max-width: 150px; }
.cab-chart { margin-bottom: 16px; max-width: 720px; }
.cabchart-title {
  font-family: var(--display); font-size: 12.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  margin: 0 0 10px;
}
.cabchart-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cabchart-ag { flex: 0 0 130px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cabchart-body { flex: 1; }
.cabchart-bar {
  display: flex; height: 14px; border-radius: 7px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
}
.cabchart-seg { height: 100%; }
.cabchart-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 5px; }
.cabchart-lg { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.cabchart-lg i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* ---------- Креативы: файловый менеджер ---------- */
#cr-search { min-width: 220px; }
.cr-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cr-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 13px; }
.cr-crumb {
  background: none; border: none; color: var(--accent-hi); cursor: pointer;
  font: inherit; font-size: 13px; padding: 2px 5px; border-radius: 6px;
}
.cr-crumb:hover { background: rgba(138, 138, 255, .12); }
.cr-actions { display: flex; gap: 8px; }
.cr-drop {
  border: 2px dashed transparent; border-radius: var(--radius-lg); min-height: 200px;
  transition: border-color var(--ease), background var(--ease); padding: 4px;
}
.cr-drop.drag { border-color: var(--accent); background: rgba(138, 138, 255, .05); }
.cr-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
.cr-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color var(--ease), transform var(--ease), background var(--ease);
}
.cr-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.cr-folder { background: var(--surface-2); }
.cr-thumb {
  height: 92px; display: flex; align-items: center; justify-content: center;
  font-size: 34px; background: var(--surface-2); border-radius: 8px; overflow: hidden;
}
.cr-folder .cr-thumb { background: transparent; }
.cr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cr-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: default; }
.cr-folder .cr-name { cursor: pointer; font-weight: 600; }
.cr-meta { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.cr-row-actions { display: flex; gap: 3px; margin-top: 2px; }
.cr-loading { padding: 20px; color: var(--muted); text-align: center; }
.cr-check {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer;
  opacity: 0; transition: opacity var(--ease);
}
.cr-card:hover .cr-check, .cr-check:checked, .cr-card.cr-selected .cr-check { opacity: 1; }
.cr-card.cr-selected { border-color: var(--accent); background: rgba(138, 138, 255, .07); }
.cr-selbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid rgba(138, 138, 255, .4); border-radius: var(--radius);
}
.cr-sel-count { font-size: 13px; color: var(--muted); }
.cr-clip { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.cr-uploads { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.cr-upload {
  display: flex; align-items: center; gap: 10px; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
}
.cr-up-name { flex: 0 0 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-up-bar { flex: 1; height: 5px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.cr-up-bar i { display: block; height: 100%; width: 0; background: var(--signal); transition: width .2s; }
.cr-up-pct { flex: 0 0 40px; text-align: right; font-family: var(--mono); }
.cr-upload.done .cr-up-pct { color: var(--st-active); }
.cr-upload.failed .cr-up-pct { color: var(--danger); }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .topbar-tabs { order: 3; width: 100%; max-width: none; overflow-x: auto; }
  .topbar-user { margin-left: auto; }
  .content { padding: 14px 10px; }
  .filters input[type="search"] { width: 100%; }
  .filters > * { flex: 1 1 45%; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .field-span2 { grid-column: span 1; }
  .utm-row { grid-template-columns: 1fr; gap: 6px; }
  .utm-row .btn-copy { justify-self: start; }
  .modal-backdrop { padding: 12px 8px; }
  .cr-up-name { flex-basis: 120px; }

  /* таблица запусков → карточки */
  #launches-table thead { display: none; }
  #launches-table, #launches-table tbody, #launches-table tr, #launches-table td { display: block; width: 100%; }
  #launches-table tr { border-bottom: 8px solid var(--bg); padding: 6px 0; }
  #launches-table td { border: none; padding: 5px 14px; }
  #launches-table td:empty { display: none; }
  #launches-table td[data-label]::before {
    content: attr(data-label);
    display: inline-block; width: 110px;
    font-size: 10.5px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted);
  }
  #launches-table td.num { text-align: left; }
  .cell-comment { max-width: none; white-space: normal; }
  .row-actions { justify-content: flex-start; padding-left: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}


/* ---------- v12: копия ссылки Fanpage ---------- */
.cell-fp { position: relative; }
.cell-fp .fp-wrap { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cell-fp .fp-id { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-fp .fp-copy { flex: 0 0 auto; opacity: 0; transition: opacity var(--ease); }
.cell-fp:hover .fp-copy { opacity: 1; }

/* ---------- v12: уведомления ---------- */
.notif-wrap { position: relative; }
.notif-btn { position: relative; font-size: 15px; padding: 5px 10px; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
  font-family: var(--mono);
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 300;
  width: 340px; max-height: 440px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 8px 14px; border-bottom: 1px solid var(--line);
  font-family: var(--display); font-size: 13px; font-weight: 600;
}
.notif-list { overflow-y: auto; }
.notif-item {
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background var(--ease);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { box-shadow: inset 3px 0 0 var(--accent); background: rgba(138, 138, 255, .05); }
.notif-title { font-size: 13px; font-weight: 600; }
.notif-body { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--dim); margin-top: 4px; font-family: var(--mono); }
.notif-empty { padding: 24px 16px; color: var(--muted); font-size: 13px; text-align: center; }

/* подсветка строки при переходе из уведомления */
@keyframes row-flash-kf {
  0%, 60% { background: rgba(138, 138, 255, .16); }
  100% { background: transparent; }
}
tr.row-flash td { animation: row-flash-kf 2.4s ease-out; }

@media (max-width: 900px) {
  .notif-panel { position: fixed; left: 8px; right: 8px; top: 60px; width: auto; }
}

/* ---------- v12: раздел «Тексты» ---------- */
.tx-grid {
  display: grid; grid-template-columns: minmax(280px, 380px) minmax(360px, 640px);
  gap: 16px; align-items: start;
}
.tx-params {
  margin: 14px 0; padding: 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.tx-params-cap {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin-bottom: 10px;
}
.tx-param-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tx-param-name { flex: 0 0 78px; font-size: 12.5px; color: var(--muted); }
.tx-param-row input, .tx-param-row select { flex: 1; min-width: 0; }
.tx-param-custom .tx-cp-name { flex: 0 0 120px; }
.tx-prompt-field { margin-bottom: 14px; }
.tx-prompt-row { display: flex; align-items: center; gap: 4px; }
.tx-prompt-row select { flex: 1; }
.tx-result { margin-top: 16px; }
.tx-result-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
#tx-result { width: 100%; box-sizing: border-box; resize: vertical; font-size: 13.5px; line-height: 1.55; }
@media (max-width: 900px) { .tx-grid { grid-template-columns: 1fr; } }

/* ---------- v12: кнопка копии ссылки Fanpage видима ---------- */


/* ---------- v13: статус подключения AI ---------- */
.tx-ai-state { margin-top: 8px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.tx-ai-state.ok { color: var(--st-active); }

/* ---------- v15: масштаб строк таблицы ---------- */
.density-switch {
  display: inline-flex; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2px;
}
.density-switch .btn { border: none; background: transparent; }
.density-switch .btn:hover { background: var(--surface); }
.density-switch .btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.4); }

.dens-compact table.grid { font-size: 12px; }
.dens-compact .grid td { padding: 3px 8px; line-height: 1.25; }
.dens-compact .grid th { padding: 6px 8px; font-size: 9.5px; }
.dens-compact .status-pill, .dens-compact .prio-pill,
.dens-compact .cval-badge { padding: 0 7px; font-size: 10.5px; }
.dens-compact .prod-badge, .dens-compact .ctc-badge { padding: 0 6px; font-size: 11.5px; }
.dens-compact .row-btn { padding: 1px 5px; font-size: 12px; }
.dens-compact tr.day-sep td { padding: 3px 8px; font-size: 10px; }
.dens-compact .grid td.num { font-size: 11.5px; }

.dens-cozy .grid td { padding: 14px 14px; }
.dens-cozy .grid th { padding: 14px 14px; }

/* ---------- v16: конфигуратор лендингов ---------- */
.ld-steps { display: grid; gap: 14px; max-width: 860px; }
.ld-card h3 { display: flex; align-items: center; gap: 9px; }
.ld-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; color: var(--accent);
}
.ld-drop {
  display: flex; align-items: center; justify-content: center;
  min-height: 84px; padding: 14px; cursor: pointer; text-align: center;
  border: 2px dashed var(--line-2); border-radius: var(--radius);
  color: var(--muted); font-size: 13px;
  transition: border-color var(--ease), background var(--ease);
}
.ld-drop:hover, .ld-drop.drag { border-color: var(--accent); background: rgba(138,138,255,.05); color: var(--text); }
.ld-scan {
  margin-top: 12px; padding: 10px 12px; font-size: 12.5px; line-height: 1.7;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.ld-scan code { font-family: var(--mono); font-size: 11.5px; color: var(--accent-hi); }
.ld-ok { color: var(--st-active); }
.ld-warn { color: var(--st-paused); }
.ld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-bottom: 14px; }
.ld-sub {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 14px 0 8px;
}
.ld-sub .hint { text-transform: none; letter-spacing: 0; font-style: normal; color: var(--dim); }
.ld-price-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.ld-from {
  flex: 0 0 190px; font-family: var(--mono); font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ld-arrow { color: var(--dim); }
.ld-price-row input { flex: 1; min-width: 0; }
.ld-rule-from { flex: 0 0 190px !important; font-family: var(--mono); font-size: 12px; }
.ld-count { flex: 0 0 34px; font-size: 11.5px; color: var(--dim); font-family: var(--mono); }
.ld-imgs { display: flex; gap: 14px; flex-wrap: wrap; }
.ld-img { cursor: pointer; text-align: center; }
.ld-img-prev {
  width: 132px; height: 132px; display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--line-2); border-radius: var(--radius);
  color: var(--dim); font-size: 26px; overflow: hidden;
  transition: border-color var(--ease);
}
.ld-img:hover .ld-img-prev { border-color: var(--accent); }
.ld-img.filled .ld-img-prev { border-style: solid; border-color: var(--st-active); }
.ld-img-prev img { width: 100%; height: 100%; object-fit: contain; background: var(--surface-2); }
.ld-img-cap { margin-top: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.ld-result {
  margin-top: 12px; padding: 10px 12px; font-size: 12.5px;
  background: rgba(58,214,160,.08); border: 1px solid rgba(58,214,160,.3);
  border-radius: var(--radius); color: var(--text);
}
.ld-result code { font-family: var(--mono); font-size: 11.5px; }
@media (max-width: 900px) { .ld-grid { grid-template-columns: 1fr; } .ld-from, .ld-rule-from { flex-basis: 120px !important; } }

/* ---------- v17: редактор словарей лендингов ---------- */
.ld-dict-modal { max-width: 760px; }
.ld-dict-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.ld-dict-search { margin: 0; flex: 1; }
.ld-dict-list {
  max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  padding-right: 4px; margin-bottom: 12px;
}
.ld-dict-row { display: flex; align-items: center; gap: 8px; }
.ld-dict-from {
  flex: 0 0 46%; font-size: 12px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ld-dict-to { flex: 1; min-width: 0; }
#ld-geo-hint { display: block; margin-top: 4px; font-size: 11.5px; color: var(--dim); }
@media (max-width: 900px) { .ld-dict-from { flex-basis: 40%; } }

/* ---------- v19: выбор болванки лендинга ---------- */
.ld-tpls { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ld-tpl {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; font: inherit; color: var(--text);
  transition: border-color var(--ease), background var(--ease);
}
.ld-tpl:hover { border-color: var(--line-2); }
.ld-tpl.active { border-color: var(--accent); background: rgba(138,138,255,.1); }
.ld-tpl-name { font-family: var(--display); font-weight: 600; font-size: 14px; }
.ld-tpl-note { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.ld-tpl-size { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.ld-own { margin-bottom: 10px; }
.ld-own summary { cursor: pointer; font-size: 12.5px; color: var(--muted); padding: 4px 0; }
.ld-own summary:hover { color: var(--text); }
.ld-values { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-bottom: 4px; }
.ld-value-row .hint { color: var(--dim); font-style: normal; }
@media (max-width: 900px) { .ld-values { grid-template-columns: 1fr; } }

/* ---------- v20: имя файла лендинга ---------- */
.ld-name-row { display: flex; gap: 6px; align-items: center; }
.ld-name-row input { flex: 1; }

/* ---------- v21: редактор стандартного промта ---------- */
#prompt-card { grid-column: 1 / -1; margin-top: 4px; }
.sp-text { width: 100%; box-sizing: border-box; resize: vertical; font-size: 13px; line-height: 1.5; }
.sp-foot { justify-content: flex-end; gap: 8px; margin-top: 10px; }
.sp-state { margin-top: 8px; font-size: 11.5px; color: var(--muted); }


/* ---------- v22: тёмные выпадающие списки ---------- */
select { color-scheme: dark; }
select option, select optgroup {
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- v23: единая таблица офферов по GEO ---------- */
.dash-offers { table-layout: fixed; width: 100%; }
.dash-offers .c-offer { width: 40%; }
.dash-offers .c-num { width: 20%; }
.dash-offers .dash-geo-sep td {
  padding-top: 14px; font-family: var(--display); font-weight: 600;
  font-size: 12px; letter-spacing: .04em; color: var(--accent);
  border-bottom: 1px solid var(--line);
}
.dash-offers .dash-geo-sep:first-child td { padding-top: 4px; }
