/* Палитра и типографика подогнаны под родной кабинет VK Реклама
   (ads.vk.ru/hq) — цвета/радиусы/шрифт сняты через getComputedStyle прямо
   со страницы кабинета: системный шрифт, фон #EBEDF0, акцент #2688EB,
   радиус 8px на кнопках/чипах, серые "тихие" hover/active-заливки вместо
   насыщенной заливки основным цветом, минимум теней. */
/* ===== Glass Light ==========================================================
   Референс — премиальный светлый SaaS уровня Linear/Stripe/Vercel: максимум
   воздуха, минимум рамок (разделение тенями/расстоянием, а не border'ом),
   единая система крупных скруглений, очень мягкие тени, акцент VK Blue
   только на активных элементах, спокойные быстрые анимации. См. подробную
   спеку и референс-скриншот, обсуждённые с пользователем. =================== */
:root{
  --blue: #2688EB;
  --blue-dark: #1c6fc4;
  --blue-light: #eaf3fd;
  --ink: #0d0f14;
  --muted: #71757d;
  --border: #eceef2;
  --hover-fill: rgba(38,54,84,.045);
  --bg: #f4f7fb;
  --card: #ffffff;
  --green: #1fa060;
  --green-light: #e3f7ec;
  --red: #e5484d;
  --red-light: #fdeaea;
  --purple: #7c5cff;
  --purple-light: #efeaff;
  --orange: #e8871e;
  --orange-light: #fdf0e0;
  --gray-light: #eef0f3;
  --gray-text: #676b73;

  /* единая система скруглений — см. спеку: карточки 16-20, кнопки/чипы/инпуты
     12-14, таблицы 16, модалки/визарды 24-32 */
  --radius: 20px;       /* карточки */
  --radius-sm: 13px;    /* кнопки, инпуты, чипы, мелкие контролы */
  --radius-lg: 28px;    /* крупные элементы визарда */

  /* очень мягкие, "парящие" тени — без тяжёлого чёрного */
  --shadow: 0 1px 2px rgba(16,24,40,.03), 0 10px 28px rgba(16,24,40,.05);
  --shadow-hover: 0 4px 10px rgba(16,24,40,.05), 0 16px 36px rgba(16,24,40,.08);

  --ease: cubic-bezier(.2,.7,.3,1);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:"Inter", -apple-system, system-ui, "SF Pro Display", "Helvetica Neue", Roboto, sans-serif;
  -webkit-font-smoothing:antialiased;
  /* очень светлый холодный фон с едва заметным голубым сиянием сверху —
     "почти белый", не плоская заливка */
  background: radial-gradient(1200px 620px at 14% -12%, rgba(38,136,235,.06), transparent 62%), var(--bg);
  color:var(--ink);
  position:relative;
  line-height:1.5;
}

.app-shell{ position:relative; z-index:1; display:flex; align-items:flex-start; min-height:100vh; }

.sidebar{
  position:sticky; top:0; align-self:flex-start;
  width:250px; flex-shrink:0; min-height:100vh;
  background:#fff; border-right:1px solid var(--border);
  padding:22px 16px; display:flex; flex-direction:column; gap:24px;
}
.sidebar .brand{ display:flex; align-items:center; gap:10px; padding:2px 8px 6px; }

.side-nav{ display:flex; flex-direction:column; gap:2px; }
.side-nav-item{
  display:flex; align-items:center; gap:11px; border:none; background:transparent; cursor:pointer;
  padding:10px 12px; border-radius:var(--radius-sm); font-family:inherit; font-size:14.5px; font-weight:400;
  color:var(--ink); text-align:left; transition:background .15s var(--ease), color .15s var(--ease); width:100%;
}
.side-nav-item:hover{ background:var(--hover-fill); }
.side-nav-item.active{ background:var(--blue-light); color:var(--blue-dark); font-weight:600; }
.side-nav-icon{ display:inline-flex; flex-shrink:0; color:var(--muted); }
.side-nav-icon svg{ width:19px; height:19px; display:block; }
.side-nav-item:hover .side-nav-icon{ color:var(--ink); }
.side-nav-item.active .side-nav-icon{ color:var(--blue-dark); }

.main-area{ flex:1; min-width:0; }

.sub-tabbar{
  position:sticky; top:0; z-index:2;
  display:flex; gap:26px; background:rgba(244,247,251,.86); backdrop-filter:blur(10px);
  padding:22px 28px 0; border-bottom:1px solid var(--border);
}
.sub-tab{
  border:none; background:transparent; cursor:pointer;
  padding:0 2px 13px; font-family:inherit; font-size:14.5px; font-weight:400; color:var(--muted);
  border-bottom:2px solid transparent; transition:color .15s var(--ease), border-color .15s var(--ease);
}
.sub-tab:hover{ color:var(--ink); }
.sub-tab.active{ color:var(--ink); font-weight:600; border-bottom-color:var(--blue); }

.brand{ display:flex; align-items:center; gap:10px; }
.brand-mark{
  display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:32px; border-radius:var(--radius-sm);
  background:var(--blue);
  color:#fff; font-weight:700; font-size:13px; flex-shrink:0;
}
.brand-title{ font-weight:600; font-size:14.5px; line-height:1.25; color:var(--ink); }
.brand-sub{ font-size:11px; color:var(--muted); margin-top:1px; }

/* Контейнер прижат к левому краю и занимает всю доступную ширину — как в
   родном кабинете, где контент-панель тянется на весь экран без полей. */
.container{ position:relative; z-index:1; max-width:none; margin:0; padding:28px 32px 90px; }

.tab{ display:none; animation: fadeIn .2s var(--ease); }
.tab.active{ display:block; }
@keyframes fadeIn{ from{opacity:0; transform:translateY(6px)} to{opacity:1; transform:none} }

.card{ background:var(--card); border:1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding:28px; margin-bottom:22px; }
.placeholder-card{ text-align:left; }

h1{ font-size:26px; margin:0 0 8px; font-weight:700; letter-spacing:-.01em; }
h2{ font-size:17px; margin:0 0 10px; font-weight:600; letter-spacing:-.005em; }
.muted{ color:var(--muted); font-size:13.5px; line-height:1.6; margin:0 0 18px; }

.summary-bar{
  display:flex; align-items:center; gap:22px; flex-wrap:wrap;
  background:#fff; border:1px solid var(--border); border-radius:var(--radius);
  padding:16px 20px; margin-bottom:20px; box-shadow: var(--shadow);
}
.summary-stat{ font-size:13.5px; color:var(--muted); }
.summary-stat b{ color:var(--ink); font-size:15px; font-weight:600; margin-right:4px; }
.summary-spacer{ flex:1; }

.form-grid{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; margin-bottom:6px; }
.field label{ display:block; font-size:13px; font-weight:500; margin-bottom:7px; color:var(--ink); }
.field input{
  width:100%; padding:13px 14px; border-radius:var(--radius-sm); border:1px solid var(--border);
  font-family:inherit; font-size:14px; outline:none; transition:border-color .15s, box-shadow .15s; background:#fff;
}
.field input:focus{ border-color:var(--blue); box-shadow:0 0 0 4px var(--blue-light); }

.field select{
  width:100%; padding:13px 38px 13px 14px; border-radius:var(--radius-sm); border:1px solid var(--border);
  font-family:inherit; font-size:14px; font-weight:400; outline:none; transition:border-color .15s, box-shadow .15s; background-color:#fff;
  color:var(--ink); cursor:pointer; appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><path d='M5.5 8l4.5 4.5L14.5 8' stroke='%236d7078' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat:no-repeat; background-position:right 12px center;
}
.field select:hover{ border-color:#c7cad1; }
.field select:focus{ border-color:var(--blue); box-shadow:0 0 0 4px var(--blue-light); }

/* Кнопки — Glass Light, но с поправкой на читаемость: чисто-белая кнопка на
   белой карточке почти не видна (даже с тенью), поэтому secondary/ghost и
   danger получают лёгкую тонированную заливку — этого достаточно, чтобы
   кнопка читалась как кнопка, но всё ещё гораздо мягче обычной серой рамки. */
.btn{ font-family:inherit; font-weight:500; font-size:13.5px; text-align:left; border-radius:var(--radius-sm); border:none; padding:9px 17px; cursor:pointer; transition:.15s var(--ease); }
.btn-primary{ background:var(--blue); color:#fff; box-shadow:0 1px 2px rgba(38,136,235,.15), 0 6px 16px rgba(38,136,235,.18); }
.btn-primary:hover{ background:var(--blue-dark); transform:translateY(-1px); box-shadow:0 2px 4px rgba(38,136,235,.18), 0 10px 22px rgba(38,136,235,.24); }
.btn-primary:disabled{ opacity:.5; cursor:not-allowed; transform:none; }
.btn-ghost{ background:var(--gray-light); color:var(--ink); box-shadow:0 1px 2px rgba(16,24,40,.04); }
.btn-ghost:hover{ background:var(--blue-light); color:var(--blue-dark); transform:translateY(-1px); box-shadow:0 2px 6px rgba(16,24,40,.06); }
.btn-danger{ background:var(--red-light); color:var(--red); box-shadow:0 1px 2px rgba(16,24,40,.04); }
.btn-danger:hover{ background:#f9d6d6; transform:translateY(-1px); }

.status{ margin-left:10px; font-size:13px; font-weight:500; }
.status.ok{ color:var(--green); }
.status.err{ color:var(--red); }
.status.pending{ color:var(--muted); }

.launch-row{ display:flex; align-items:center; flex-wrap:wrap; gap:4px 10px; margin-top:24px; }

#campaign-results{ display:flex; flex-direction:column; gap:10px; margin-top:18px; }
.result-item{
  display:flex; align-items:center; flex-wrap:wrap; gap:6px 14px;
  padding:13px 16px; border-radius:var(--radius-sm); border:1px solid var(--border);
  background:#fff; font-size:13.5px; font-weight:500; color:var(--ink);
  animation:fadeIn .15s ease;
}
.result-item.ok{ border-color:#bfe6cd; background:var(--green-light); }
.result-item.err{ border-color:#f3c3c3; background:var(--red-light); }
.result-item > span:first-child{ margin-right:auto; }
.result-item .result-warning{ flex-basis:100%; margin-top:0; }

.rows > * + *{ margin-top:10px; }

.pill{ font-size:11px; font-weight:600; padding:4px 10px; border-radius:999px; white-space:nowrap; }
.pill.ok{ background:var(--green-light); color:var(--green); }
.pill.err{ background:var(--red-light); color:var(--red); }
.pill.info{ background:var(--blue-light); color:var(--blue-dark); }
.pill.neutral{ background:var(--gray-light); color:var(--gray-text); }
.pill.acc-pill{ background:var(--hover-fill); color:var(--ink); font-size:11.5px; margin-right:8px; border-radius:8px; }
.editor-table td > .pill:first-child{ margin-left:-9px; }

.result-warning{ width:100%; font-size:12px; color:#a15c00; margin-top:4px; }

.acc-row.selected td{ background:var(--blue-light); transition:background .15s var(--ease); }
.acc-row.selected td:first-child{ border-radius:12px 0 0 12px; }
.acc-row.selected td:last-child{ border-radius:0 12px 12px 0; }
.acc-select{ width:17px; height:17px; accent-color:var(--blue); cursor:pointer; }
.acc-label{ font-weight:500; font-size:14px; }
.acc-error{ font-size:12.5px; color:var(--red); background:var(--red-light); border-radius:var(--radius-sm); padding:6px 10px; margin-top:6px; word-break:break-word; }

.btn-sm{ padding:6px 12px; font-size:12.5px; }

.form-grid-2{ grid-template-columns:1fr 1fr; }
.form-grid-3{ grid-template-columns:1fr 1fr 1fr; }

/* ---------- визард создания кампании / лид-формы — модальное окно, а не
   полноэкранная страница (по образцу нативной модалки "Создать кампанию" в
   родном кабинете VK Рекламы: аккуратная карточка по центру затемнённого
   фона, а не заливка на весь экран). .wizard-overlay — затемнённый фон,
   центрирует .wizard-modal; .wizard-modal — сама ограниченная по размеру
   карточка с крупным скруглением, шапка/футер прибиты к её краям, тело
   скроллится внутри. ---------------------------------------------------- */
.wizard-overlay{
  position:fixed; inset:0; z-index:1000;
  background:rgba(12,14,20,.6);
  backdrop-filter:blur(2px);
  display:flex; align-items:center; justify-content:center;
  padding:24px;
}
.wizard-modal{
  width:100%; max-width:1180px; max-height:min(800px, 92vh);
  background:#fff; border-radius:var(--radius-lg);
  box-shadow:0 24px 64px rgba(8,10,16,.35), 0 4px 18px rgba(8,10,16,.18);
  display:flex; flex-direction:column; overflow:hidden;
  animation:modalIn .2s var(--ease);
}
@keyframes modalIn{ from{opacity:0; transform:translateY(10px) scale(.985)} to{opacity:1; transform:none} }
.wizard-header{
  position:relative; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:#fff; border-bottom:1px solid var(--border);
  padding:18px 24px;
}
.wizard-close{
  position:absolute; left:18px; top:50%; transform:translateY(-50%);
  width:34px; height:34px; border-radius:50%; border:none; background:transparent;
  color:var(--muted); font-size:16px; cursor:pointer; transition:.15s var(--ease);
}
.wizard-close:hover{ background:var(--hover-fill); color:var(--ink); }
.wizard-header-spacer{ width:34px; flex-shrink:0; }
.wizard-title{ font-size:16px; font-weight:600; color:var(--ink); }
.wizard-steps{ display:flex; align-items:center; gap:10px; }
.wizard-step-item{
  display:flex; align-items:center; gap:8px; border:none; background:transparent; cursor:pointer;
  padding:6px 4px; font-family:inherit; font-size:13.5px; font-weight:500; color:var(--muted);
}
.wizard-step-item:disabled{ cursor:default; }
.wizard-step-num{
  display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
  width:24px; height:24px; border-radius:50%; background:var(--hover-fill); color:var(--muted);
  font-size:12.5px; font-weight:600; transition:.15s var(--ease);
}
.wizard-step-item.active{ color:var(--ink); }
.wizard-step-item.active .wizard-step-num{ background:var(--blue); color:#fff; }
.wizard-step-item.done .wizard-step-num{ background:var(--green); color:#fff; }
.wizard-step-item.done:not(.active){ color:var(--ink); }
.wizard-step-line{ width:32px; height:1px; background:var(--border); flex-shrink:0; }
.wizard-body{ flex:1; min-height:0; overflow-y:auto; padding:28px 24px 32px; }
.wizard-panel{ display:none; }
.wizard-panel.active{ display:block; animation: fadeIn .2s var(--ease); }
.wizard-footer{
  flex-shrink:0; display:flex; align-items:center; gap:12px;
  background:#fff; border-top:1px solid var(--border); padding:14px 24px;
}
.wizard-footer-right{ margin-left:auto; display:flex; align-items:center; gap:12px; }

/* Дерево "Кампания → Группы → Объявления" на шаге 2 визарда (см.
   index.html, #group-tree / renderGroupTree в app.js) — по образцу дерева
   в реальном кабинете VK Рекламы (иконки кампании/группы/объявления +
   "..." меню с Дублировать/Удалить на каждом узле, кроме кампании). */
.tree-layout{ display:flex; align-items:flex-start; gap:20px; }
.tree-sidebar{
  width:250px; flex-shrink:0; background:#fff; border:1px solid var(--border);
  border-radius:var(--radius); padding:10px; position:sticky; top:0;
}
.tree-editor{ flex:1; min-width:0; }
.tree-campaign-label{
  display:flex; align-items:center; gap:8px; padding:8px; font-size:13px;
  font-weight:600; color:var(--muted); cursor:pointer; border-radius:8px; transition:background .12s;
}
.tree-campaign-label:hover{ background:var(--hover-fill); color:var(--ink); }
.tree-group-block + .tree-group-block{ margin-top:2px; padding-top:8px; border-top:1px solid var(--border); }
.tree-node{
  display:flex; align-items:center; gap:7px; padding:7px 8px; border-radius:8px;
  cursor:pointer; font-size:13.5px; position:relative;
}
.tree-node:hover{ background:var(--hover-fill); }
.tree-node.active{ background:var(--blue-light); color:var(--blue-dark); font-weight:600; }
.tree-node .tree-icon{ flex-shrink:0; display:inline-flex; opacity:.65; }
.tree-node.active .tree-icon{ opacity:1; }
.tree-node .tree-label{
  flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.tree-node .tree-actions-btn{
  flex-shrink:0; opacity:0; border:none; background:none; cursor:pointer; color:var(--muted);
  font-size:15px; line-height:1; padding:2px 5px; border-radius:6px;
}
.tree-node:hover .tree-actions-btn, .tree-node .tree-actions-btn.show-menu{ opacity:1; }
.tree-node .tree-actions-btn:hover{ background:var(--border); color:var(--ink); }
.tree-ads{ margin-left:18px; }
.tree-add-btn{
  display:flex; align-items:center; gap:7px; width:100%; text-align:left; padding:7px 8px;
  border-radius:8px; cursor:pointer; font-size:13px; color:var(--blue); background:none; border:none;
  font-family:inherit;
}
.tree-add-btn:hover{ background:var(--blue-light); }
.tree-add-group{ margin-top:6px; padding-top:6px; border-top:1px solid var(--border); }

@media (max-width: 900px){
  .tree-layout{ flex-direction:column; }
  .tree-sidebar{ width:100%; position:static; }
}

@media (max-width: 720px){
  .wizard-overlay{ padding:0; }
  .wizard-modal{ max-width:none; max-height:none; height:100%; border-radius:0; }
}

.objective-picker{ display:flex; gap:14px; margin-bottom:22px; flex-wrap:wrap; }
.obj-btn{
  flex:1; min-width:200px; text-align:left; cursor:pointer;
  border:1px solid var(--border); background:#fff; border-radius:var(--radius-lg);
  padding:16px 18px; font-family:inherit; font-size:14px; font-weight:500; color:var(--ink);
  transition:.15s var(--ease); box-shadow:var(--shadow);
}
.obj-btn span{ font-weight:400; color:var(--muted); font-size:13px; }
.obj-btn:hover{ border-color:var(--blue); transform:translateY(-1px); box-shadow:var(--shadow-hover); }
.obj-btn.active{ border-color:var(--blue); background:var(--blue-light); }
.obj-btn.active span{ color:var(--blue-dark); }

.selected-accounts-bar{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; background:#fff; border:1px solid var(--border); border-radius:var(--radius-sm); padding:14px 16px; }
.chips{ display:flex; gap:8px; flex-wrap:wrap; flex:1; }
.chip{
  display:inline-flex; align-items:center; gap:6px; background:#fff; box-shadow:inset 0 0 0 1px var(--border);
  border-radius:999px; padding:5px 12px; font-size:12.5px; font-weight:500;
}
.chip.chip-ok{ box-shadow:inset 0 0 0 1px #bfe6cd; }
.chip .chip-x{ cursor:pointer; color:var(--muted); font-weight:700; }
.chip .chip-x:hover{ color:var(--red); }
/* Регионы показа: клик по названию переключает вкл/искл (см. renderGeoChips
   в app.js) — искл. регион красным с минусом, как в самом VK Ads. */
.chip-geo .chip-geo-label{ cursor:pointer; }
.chip.chip-excluded{ box-shadow:inset 0 0 0 1px #f3c6c6; background:var(--red-light); color:var(--red); }

/* Гиперлокальный таргетинг (targetings.geo.local_geo) — точки на карте с
   радиусом, альтернатива обычным регионам (см. #cf-geo-local-block). */
.local-geo-add-row{
  display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:4px;
}
.local-geo-add-row input{ flex:1 1 140px; min-width:110px; }
.local-geo-add-row input#cf-lg-label{ flex-basis:220px; }
.local-geo-add-row input#cf-lg-address{ flex-basis:200px; }
.local-geo-points{
  display:flex; flex-direction:column; gap:6px; margin-bottom:10px;
  max-height:280px; overflow-y:auto; padding-right:4px;
}
.local-geo-point{
  display:flex; align-items:center; gap:10px; padding:8px 12px; border-radius:8px;
  background:#fafafb; box-shadow:inset 0 0 0 1px var(--border); font-size:13px;
}
.local-geo-point-main{ flex:1; min-width:0; }
.local-geo-point-label{ font-weight:500; }
.local-geo-point-meta{ color:var(--muted); font-size:12px; margin-top:2px; }
.local-geo-point-remove{ cursor:pointer; color:var(--muted); font-weight:700; flex-shrink:0; }
.local-geo-point-remove:hover{ color:var(--red); }

.check-row{ display:flex; gap:16px; flex-wrap:wrap; font-size:13.5px; }
.check-row label{ display:flex; align-items:center; gap:6px; cursor:pointer; }

/* Таблицы — главный элемент интерфейса по спеке: без сетки, без толстых
   линий, строки разделяются расстоянием (крупные вертикальные паддинги, ~60px
   высоты строки), а не border-bottom. Разделение только тенью/hover-фоном. */
.editor-table{ width:100%; border-collapse:collapse; margin-top:18px; font-size:13.5px; text-align:left; }
.editor-table thead th{
  text-align:left; font-size:11.5px; font-weight:500; text-transform:uppercase; letter-spacing:.03em;
  color:var(--muted); padding:0 14px 12px 0; border-bottom:1px solid var(--border); white-space:nowrap;
}
.editor-table tbody td{
  padding:19px 14px 19px 0; vertical-align:middle; color:var(--ink); text-align:left;
}
.editor-table tbody tr{ transition:background .12s var(--ease); border-radius:12px; }
.editor-table tbody tr:hover td{ background:var(--hover-fill); }
.editor-table tr.acc-row.selected:hover td{ background:var(--blue-light); }
.editor-table td:last-child, .editor-table th:last-child{ padding-right:0; }
.editor-table td:first-child, .editor-table th:first-child{ width:1%; white-space:nowrap; padding-right:10px; }
.editor-table td.actions-cell{ text-align:right; }
.spark-cell{ white-space:nowrap; max-width:115px; }
.spark-cell .spark{ display:inline-flex; align-items:center; gap:6px; color:var(--muted); font-size:13px; max-width:115px; overflow-x:auto; overflow-y:hidden; padding-bottom:2px; }
.spark-cell svg{ display:block; cursor:default; flex-shrink:0; }
.spark-tooltip{
  display:none; position:fixed; z-index:9999; pointer-events:none;
  background:var(--ink); color:#fff; font-size:12px; line-height:1.4;
  padding:5px 9px; border-radius:6px; white-space:nowrap;
  box-shadow:0 4px 16px rgba(0,0,0,.18);
}
.actions-wrap{ display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; }
.editor-table .btn{ padding:6px 12px; font-size:12.5px; }

.radio-col{ display:flex; flex-direction:column; gap:10px; font-size:14px; margin-top:2px; }
.radio-col label{ display:flex; align-items:center; gap:9px; cursor:pointer; }
.radio-col input[type="radio"]{ width:17px; height:17px; accent-color:var(--blue); cursor:pointer; flex-shrink:0; }
.hint-inline{ color:var(--green); font-weight:500; }

.color-swatch-row{ display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
.color-swatch-row input[type=radio]{ position:absolute; opacity:0; width:0; height:0; }
.color-swatch{
  width:32px; height:32px; border-radius:50%; cursor:pointer; display:inline-block;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
  transition: box-shadow .12s ease, transform .12s ease;
}
.color-swatch-row label{ position:relative; display:inline-flex; }
.color-swatch-row input[type=radio]:checked + .color-swatch{
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue);
  transform: scale(1.06);
}
.swatch-0{ background:linear-gradient(135deg,#FF7583,#E62E40); }
.swatch-1{ background:linear-gradient(135deg,#FF80D5,#E645B1); }
.swatch-2{ background:linear-gradient(135deg,#FFD54F,#E7A902); }
.swatch-3{ background:linear-gradient(135deg,#6CD97E,#12B312); }
.swatch-4{ background:linear-gradient(135deg,#8AE6E6,#12B3B3); }
.swatch-5{ background:linear-gradient(135deg,#73D0FF,#3885E1); }
.swatch-6{ background:linear-gradient(135deg,#FF4D87,#9F40FF); }

.dropdown{ position:relative; display:inline-block; }
.dropdown-menu{
  display:none; position:absolute; top:calc(100% + 8px); left:0; z-index:50;
  background:#fff; border:1px solid var(--border); border-radius:var(--radius-sm);
  box-shadow:var(--shadow-hover); min-width:190px; width:max-content; padding:6px;
}
.dropdown-menu.show{ display:block; animation:fadeIn .15s var(--ease); }
/* button не наследует font-family/line-height от body по умолчанию (UA
   stylesheet) — без явного сброса пункты меню рендерились системным Arial
   заметно крупнее остального текста, из-за чего меню выглядело неряшливо и
   слишком просторно. flex вместо block — чтобы иконка-эмодзи и текст были
   выровнены по одной базовой линии, а не "плавали". */
.dropdown-menu button{
  display:flex; align-items:center; gap:8px; width:100%; text-align:left;
  padding:9px 10px; border-radius:8px; margin:0; white-space:nowrap;
  border:none; background:none; font-family:inherit; font-size:13.5px; line-height:1.3;
  color:var(--ink); cursor:pointer; transition:background .12s var(--ease);
}
.dropdown-menu button:hover{ background:var(--hover-fill); }
.dropdown-menu button.danger{ color:var(--red); }
.dropdown-menu button.danger:hover{ background:var(--red-light); }
/* Символы ⏸ ▶ ✕ ↻ имеют собственную высоту глифа, отличную от кириллицы —
   в потоке текста они "плавали" выше строки и меню выглядело криво.
   Заворачиваем иконку в отдельный бокс фиксированной ширины с line-height:1,
   тогда flex выравнивает его как обычный блок, а не по метрике шрифта. */
.dropdown-menu .dd-icon{
  display:inline-flex; align-items:center; justify-content:center;
  width:16px; flex-shrink:0; line-height:1; font-size:13px;
}

.autocomplete-results{
  position:relative; margin-top:4px; background:#fff; border:1px solid var(--border); border-radius:var(--radius-sm);
  max-height:360px; overflow-y:auto; display:none;
  box-shadow: 0 8px 20px rgba(16,24,40,.08);
}
.autocomplete-results.show{ display:block; }
.autocomplete-item{ padding:8px 12px; font-size:13px; cursor:pointer; }
.autocomplete-item:hover{ background:var(--hover-fill); }
.autocomplete-count{
  padding:6px 12px; font-size:11.5px; color:var(--muted); font-weight:500;
  position:sticky; top:0; background:#fff; border-bottom:1px solid var(--border);
}

.upload-status{ font-size:12px; color:var(--muted); margin-top:6px; min-height:16px; }
.upload-status.ok{ color:var(--green); }
.upload-status.err{ color:var(--red); }

.field-block{
  border:1px solid var(--border); border-radius:var(--radius-sm); padding:15px; background:#fff;
  margin-bottom:12px; transition:border-color .12s ease;
}
.field-block:last-child{ margin-bottom:0; }
.field-block:focus-within{ border-color:var(--blue); }
.field-block .fb-label{ font-size:13.5px; font-weight:500; margin-bottom:4px; }
.field-block .fb-label::first-letter{ text-transform:uppercase; }
.field-block .fb-hint{ font-size:12px; color:var(--muted); margin-bottom:10px; line-height:1.5; }
.field-block.required .fb-label::after{ content:" *"; color:var(--red); }

/* .dyn-text/.dyn-select/.dyn-link — единый вид "динамических" полей формы
   объявления/лид-формы, не завязан на .field-block: те же поля переиспользует
   и .leadform-row (выбор лид-формы на шаге 1 визарда кампании), у которой
   нет .field-block-обёртки. */
.dyn-text,
.dyn-select,
.dyn-link{
  width:100%; padding:9px 12px; border-radius:var(--radius-sm); border:1px solid var(--border);
  font-family:inherit; font-size:14px; outline:none; transition:border-color .15s, box-shadow .15s; background:#fff; color:var(--ink);
}
.dyn-text:focus,
.dyn-select:focus,
.dyn-link:focus{ border-color:var(--blue); box-shadow:0 0 0 4px var(--blue-light); }
textarea.dyn-text{ resize:vertical; min-height:70px; line-height:1.5; }
.dyn-select{
  font-weight:400; cursor:pointer; appearance:none; -webkit-appearance:none;
  padding-right:36px;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><path d='M5.5 8l4.5 4.5L14.5 8' stroke='%236d7078' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat:no-repeat; background-position:right 10px center;
}

.field-block input[type="file"]{
  width:100%; font-family:inherit; font-size:13px; color:var(--muted);
}
.field-block input[type="file"]::file-selector-button{
  font-family:inherit; font-weight:500; font-size:13px; color:var(--ink);
  background:#fff; box-shadow:inset 0 0 0 1px var(--border); border:none; border-radius:var(--radius-sm);
  padding:8px 14px; margin-right:12px; cursor:pointer; transition:.12s ease;
}
.field-block input[type="file"]::file-selector-button:hover{ box-shadow:inset 0 0 0 1px var(--blue); color:var(--blue); }
.field-block .upload-status{ margin-top:8px; }

/* Отдельный вариант "видео + обложка" (см. renderVideoCoverVariantBlock в
   app.js) — визуально отличаем от обычных полей пунктирной рамкой и слегка
   подсвеченным фоном, чтобы было понятно, что это альтернатива, а не
   обязательный шаг. */
.field-block.cover-variant-block{ border-style:dashed; background:var(--hover-fill); }
.cover-variant-row{ display:flex; gap:16px; flex-wrap:wrap; margin-top:4px; }
.cover-variant-row > div{ flex:1; min-width:200px; }
.fb-sublabel{ font-size:12.5px; font-weight:500; margin-bottom:6px; color:var(--ink); }

.leadform-row{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.leadform-row + .leadform-row{ margin-top:8px; }
.leadform-row-label{
  min-width:150px; font-size:13px; font-weight:500; color:var(--ink); flex-shrink:0;
}
.leadform-row .dyn-select{ flex:1; }
.leadform-row input[type="text"]{
  flex:1; width:100%; padding:9px 12px; border-radius:var(--radius-sm); border:1px solid var(--border);
  font-family:inherit; font-size:14px; outline:none; transition:border-color .12s; background:#fff; color:var(--ink);
}
.leadform-row input[type="text"]:focus{ border-color:var(--blue); box-shadow:0 0 0 3px var(--blue-light); }
.leadform-row input[type="file"]{ flex:1; font-family:inherit; font-size:13px; color:var(--muted); }

/* Тумблер "свой файл на каждый аккаунт" в динамических полях креатива (см.
   renderPerAccountContentBlock в app.js) — тот же паттерн, что и
   per-account ссылка на шаге 1 (.leadform-row), но раскрывается по чекбоксу
   прямо внутри .field-block. */
.per-account-toggle-wrap{ margin-top:10px; padding-top:10px; border-top:1px dashed var(--border); }
.per-account-toggle-label{
  display:flex; align-items:center; gap:8px; font-size:12.5px; font-weight:500; color:var(--ink); cursor:pointer;
}
.per-account-rows{ margin-top:10px; display:flex; flex-direction:column; gap:8px; }

/* Строка "или ссылкой" под файловым инпутом видео (см. renderDynamicFields
   и renderPerAccountContentBlock в app.js) — вставка видео прямой ссылкой
   вместо загрузки файла (например, скопированной через «👁 Показать URL»
   у другого объявления). */
.video-url-row{ display:flex; align-items:center; gap:8px; margin-top:8px; }
.video-url-row-sep{ font-size:12px; color:var(--muted); flex-shrink:0; }
.video-url-row input[type="text"]{
  flex:1; min-width:0; padding:8px 10px; border-radius:var(--radius-sm); border:1px solid var(--border);
  font-family:inherit; font-size:13px; outline:none; transition:border-color .12s; background:#fff; color:var(--ink);
}
.video-url-row input[type="text"]:focus{ border-color:var(--blue); box-shadow:0 0 0 3px var(--blue-light); }
.leadform-row .video-url-row{ flex-basis:100%; margin-left:0; }
.leadform-row .per-account-content-status{ flex-basis:100%; }

.fmt-row{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px 14px; background:#fff;
}
.fmt-row .fmt-label{ font-weight:500; font-size:13.5px; min-width:180px; }
.fmt-row .fmt-search{ flex:1; min-width:200px; position:relative; }
.fmt-row input:not([type="checkbox"]){ width:100%; padding:8px 11px; border-radius:var(--radius-sm); border:1px solid var(--border); font-family:inherit; font-size:13px; }
/* Человекочитаемое название пакета (package_description от VK) — основная
   строка; техническое package_name уходит в мелкий моноширинный подзаголовок,
   чтобы не мешать, но оставаться доступным для сверки/поддержки. */
.fmt-pinned{ display:flex; flex-direction:column; gap:4px; min-width:260px; }
.fmt-pinned-title{ font-size:13px; color:var(--green); font-weight:600; }
.fmt-pinned-meta{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.fmt-pinned-tech{ font-family:monospace; font-size:11px; color:var(--muted); }

.pads-accordion{
  border:1px solid var(--border); border-radius:var(--radius-sm); background:#fff; overflow:hidden;
}
.pads-group + .pads-group{ border-top:1px solid var(--border); }
.pads-group-header{
  display:flex; align-items:center; gap:10px; padding:8px 14px; background:#fafafb;
}
.pads-group-toggle{
  border:none; background:transparent; cursor:pointer; padding:0; width:18px; height:18px;
  color:var(--muted); font-size:13px; line-height:1; transition:transform .12s ease;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.pads-group-toggle.collapsed{ transform:rotate(-90deg); }
.pads-group-header input.pads-group-check, .pads-item input[type="checkbox"]{
  width:17px !important; height:17px; accent-color:var(--blue); cursor:pointer; flex-shrink:0;
}
.pads-group-name{ font-weight:500; font-size:13.5px; }
.pads-group-items{ padding:2px 14px 6px 42px; display:flex; flex-direction:column; gap:0; }
.pads-item{
  display:flex; align-items:center; gap:10px; padding:2px 8px; border-radius:6px;
  font-size:13.5px; line-height:1.25; cursor:pointer; transition:background .1s ease;
}
.pads-item:hover{ background:var(--hover-fill); }

@media (max-width: 720px){
  .topbar{ padding:18px 18px; flex-direction:column; align-items:flex-start; }
  .steps{ width:100%; overflow-x:auto; }
  .container{ padding:8px 14px 60px; }
  .card{ padding:18px; }
  .form-grid{ grid-template-columns:1fr; }
  .form-grid-2, .form-grid-3{ grid-template-columns:1fr; }
}

.sidebar-footer{ margin-top:auto; padding:10px 12px 2px; border-top:1px solid var(--border); display:flex; flex-direction:column; gap:6px; }
.sidebar-user{ display:flex; align-items:center; gap:8px; font-size:13px; font-weight:500; color:var(--ink); }
.sidebar-user-dot{ width:7px; height:7px; border-radius:50%; background:var(--green); flex-shrink:0; }
.sidebar-logout{ font-size:12.5px; color:var(--muted); text-decoration:none; width:fit-content; }
.sidebar-logout:hover{ color:var(--red); text-decoration:underline; }
