/* ============================================================================
   Кабинет Tracker.
   Правки только визуальные: имена классов и разметка те же, что были.

   Принципы, которые здесь соблюдаются:
   · цифры — моноширинные и с табличными знаками, чтобы столбцы не «плясали»
     при обновлении данных;
   · цвет несёт смысл (прибыль, убыток, предупреждение), а не украшает;
   · плотность высокая: это рабочий инструмент, где на экране должно
     помещаться много строк, а не воздух.
   ============================================================================ */

:root {
  /* Фон трёхуровневый: полотно, панель, поднятый элемент */
  --bg:        #0b1020;
  --panel:     #121a30;
  --panel2:    #18223c;
  --raised:    #202d4b;

  --line:      #262f3b;
  --line-soft: #1e2632;

  --text:      #e8eef5;
  --text-dim:  #9aa7b4;
  --text-mute: #6b7785;

  --accent:      #6b7cff;
  --accent-dim:  #4b5fd0;
  --accent-soft: rgba(107, 124, 255, 0.17);

  --good: #46c96a;
  --bad:  #ff6b61;
  --warn: #e0a336;

  --radius:    10px;
  --radius-sm: 7px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --shadow:    0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.22);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.25);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: radial-gradient(1000px 600px at 85% -10%, rgba(103,70,190,.23), transparent 58%),
              radial-gradient(700px 480px at 0 20%, rgba(22,138,163,.15), transparent 65%), var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Полосы прокрутки в тон интерфейсу, а не системные светлые */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 6px;
  border: 2px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: #33404f; }

.boot { padding: 48px; color: var(--text-mute); }

a { color: var(--accent); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: #6ea3ff; text-decoration: none; }

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

/* ------------------------------------------------------------- каркас ---- */
.layout { display: grid; grid-template-columns: 218px 1fr; min-height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, #161d26 0%, var(--panel) 100%);
  border-right: 1px solid var(--line);
  padding: 18px 0 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  padding: 0 18px 18px;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: 1.4px;
  color: var(--text);
}
.brand::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  vertical-align: 1px;
}

.nav a {
  display: block;
  padding: 7px 18px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13.5px;
  transition: background .13s var(--ease), color .13s var(--ease);
}
.nav a:hover { background: var(--panel2); color: var(--text); }
.nav a.active {
  background: var(--accent-soft);
  color: #a8c6ff;
  font-weight: 550;
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav .group {
  padding: 16px 18px 5px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-mute);
  font-weight: 600;
}

.main { padding: 22px 26px 72px; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.topbar h1 { font-size: 20px; margin: 0; font-weight: 620; letter-spacing: -.2px; }
.spacer { flex: 1; }
.who { color: var(--text-mute); font-size: 12.5px; }

/* ---------------------------------------------------------- элементы ---- */
.card {
  background: linear-gradient(145deg, rgba(24,34,60,.94), rgba(14,21,40,.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card h2 {
  font-size: 13px;
  margin: 0 0 12px;
  font-weight: 600;
  letter-spacing: .3px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.hint {
  color: var(--text-mute);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 8px 0 0;
}

/* В таблицах важнее увидеть сам тизер, чем ещё раз прочесть его ID. */
.campaign-preview, .creative-preview {
  display: flex; align-items: center; gap: 9px; min-width: 150px; max-width: 240px;
  color: var(--text-dim); font-size: 12px; line-height: 1.25;
  /* Ячейки таблицы запрещают перенос, и без этого длинная подпись вылезала
     из своей колонки и печаталась поверх соседней */
  white-space: normal;
}
.campaign-preview img, .creative-preview img {
  width: 64px; height: 48px; flex: 0 0 auto; object-fit: cover; border-radius: 8px;
  border: 1px solid rgba(151,164,255,.36); box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.creative-preview img { width: 82px; height: 58px; }
.preview-empty {
  color: var(--text-mute); font-size: 12px; max-width: 145px;
  display: inline-block; white-space: normal; line-height: 1.3;
}
.ai-image-box { padding: 12px; border: 1px solid rgba(130,110,255,.3); border-radius: var(--radius-sm);
  background: linear-gradient(110deg, rgba(92,72,190,.14), rgba(35,107,140,.08)); }
.ai-generated { display:flex; align-items:center; gap:10px; margin-top:10px; color:var(--good); font-size:12px; }
.ai-generated img { width:92px; height:68px; object-fit:cover; border-radius:8px; border:1px solid rgba(70,201,106,.4); }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; }

label {
  display: block;
  font-size: 11.5px;
  color: var(--text-mute);
  margin-bottom: 5px;
  font-weight: 500;
}

button, .btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: 550 13px var(--sans);
  transition: background .14s var(--ease), transform .08s var(--ease), box-shadow .14s var(--ease);
  box-shadow: 0 1px 2px rgba(0,0,0,.28);
}
button:hover, .btn:hover { background: #7788ff; }
button:not(.ghost):not(.danger), .btn:not(.ghost):not(.danger) {
  background: linear-gradient(135deg, #6577ff, #9a56df);
  box-shadow: 0 5px 16px rgba(91,89,238,.26);
}
button:not(.ghost):not(.danger):hover, .btn:not(.ghost):not(.danger):hover {
  background: linear-gradient(135deg, #7788ff, #ad68ed);
}
button:active, .btn:active { transform: translateY(1px); box-shadow: none; }
button:focus-visible, .btn:focus-visible { outline: 2px solid #a8c6ff; outline-offset: 2px; }

/* Посилання в ряду кнопок має бути кнопкою.
   «Налаштування» — це <a class="ghost">, а правило писалося під <button>:
   серед кнопок воно лишалось синім підкресленим текстом, і ряд дій виглядав
   зібраним нашвидкуруч. Вигляд має залежати від ролі, а не від тега. */
button.ghost, a.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  box-shadow: none;
}
a.ghost {
  display: inline-block;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  font: 550 13px var(--sans);
  text-decoration: none;
  line-height: 1.15;
}
button.ghost:hover, a.ghost:hover {
  background: var(--panel2); color: var(--text); border-color: #33404f;
}

button:disabled { opacity: .45; cursor: not-allowed; transform: none; }

input, select, textarea {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font: 13px var(--sans);
  min-width: 0;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: #33404f; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-mute); }
textarea { font-family: var(--mono); font-size: 12.5px; }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }

/* ---------------------------------------------------------- таблицы ---- */
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel2);
}
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }

th, td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
th {
  background: var(--raised);
  color: var(--text-dim);
  font-weight: 550;
  font-size: 11.5px;
  letter-spacing: .4px;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--line);
}
th:first-child { border-top-left-radius: var(--radius); }
th:last-child  { border-top-right-radius: var(--radius); }

tbody tr { transition: background .1s var(--ease); }
tbody tr:nth-child(even) { background: rgba(255,255,255,.012); }
tbody tr:hover { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: 0; }

/* Цифры не должны «прыгать» при обновлении — табличные знаки и моноширина */
/* ------------------------------------------------ підписи в таблиці ----
   Підпис під числом — не абзац, а другий рядок того самого значення.
   Загальний .hint має відступ у вісім пікселів і розмір основного тексту:
   у картці це доречно, а в рядку таблиці розганяє її по висоті й розмиває
   головне число. Тут він щільніший і тьмяніший — очей шукає велику цифру,
   а дрібне читає, лише коли треба. */
td .hint {
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.35;
}

/* Дії в таблиці — компактніші за кнопки у формах: їх у ряду чотири, і повний
   розмір розпирає рядок так, що таблиця стає вдвічі вищою за потрібне. */
td button, td .btn, td a.ghost {
  padding: 5px 10px;
  font-size: 12px;
}

/* Сама цифра не переноситься, підпис — переноситься.
   Рядок «витрати · дохід · ROI» в одну лінію робив таблицю ширшою за екран:
   стовпець дій закріплений праворуч і накривав сусідні числа. */
td.num .hint { white-space: normal; max-width: 27ch; margin-left: auto; }

/* Верх, а не середина: у сусідніх клітинок різна кількість рядків, і при
   вирівнюванні по центру головні числа гуляли по висоті — рядок читався як
   сходинки. */
tbody td { vertical-align: top; }

td.num, th.num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}

tfoot td {
  font-weight: 650;
  background: var(--raised);
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.pos   { color: var(--good); }
.neg   { color: var(--bad); }
.warnc { color: var(--warn); }
.mono  { font-family: var(--mono); font-size: 12.5px; }

/* ------------------------------------------------------------ прочее ---- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: .2px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  background: var(--panel2);
  white-space: nowrap;
}
.badge + .badge { margin-left: 5px; }
.badge.ok    { color: var(--good); border-color: rgba(70,201,106,.35); background: rgba(70,201,106,.1); }
.badge.err   { color: var(--bad);  border-color: rgba(255,107,97,.35); background: rgba(255,107,97,.1); }
.badge.warnc { color: var(--warn); border-color: rgba(224,163,54,.35); background: rgba(224,163,54,.1); }
.badge.off   { color: var(--text-mute); }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
  gap: 12px;
}
.kpi {
  background: linear-gradient(160deg, var(--panel) 0%, #131922 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.kpi:hover { border-color: #33404f; transform: translateY(-1px); }
.kpi .label {
  color: var(--text-mute);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 550;
}
.kpi .value {
  font: 600 22px/1.25 var(--mono);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.5px;
}

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}

.err-box {
  border: 1px solid rgba(255,107,97,.35);
  background: rgba(255,107,97,.09);
  color: #ffb4ae;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.copy {
  cursor: pointer;
  border-bottom: 1px dashed var(--text-mute);
  transition: color .13s var(--ease), border-color .13s var(--ease);
}
.copy:hover { color: var(--accent); border-bottom-color: var(--accent); }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  background: var(--raised);
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 22px;
  z-index: 50;
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: toast-in .22s var(--ease);
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.toast { transform: translateX(-50%); }

/* -------------------------------------------------------- страница входа -- */
.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(76,141,255,.13), transparent 70%),
    var(--bg);
}
.login .card {
  width: 400px;
  text-align: center;
  padding: 34px 30px;
  box-shadow: var(--shadow);
}
.login h1 {
  font-size: 23px;
  margin: 0 0 8px;
  font-weight: 650;
  letter-spacing: -.3px;
}
.login .btn { display: inline-block; padding: 10px 22px; font-size: 14px; }

/* Узкий экран: боковое меню становится верхней лентой */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding-bottom: 10px; }
  .nav { display: flex; flex-wrap: wrap; }
  .nav .group { display: none; }
  .main { padding: 16px 14px 60px; }
}

/* Панель фильтров дашборда: липкая, потому что при длинной таблице
   переключать разрез, скролля вверх, — лишнее движение */
.filterbar { position: sticky; top: 0; z-index: 5; }
.filterbar .row { align-items: flex-end; flex-wrap: wrap; }
.filterbar input[type="date"] { width: 145px; }
.muted { color: var(--muted); font-style: italic; }
/* Удаление отделено цветом: кнопка, которая уносит статистику,
   не должна выглядеть как соседняя «Пауза» */
button.danger, .danger { background: transparent; border: 1px solid #6b2230; color: #ff8a9b; }
button.danger:hover { background: #2a1119; }

/* Колонка выделения: узкая, флажок по центру */
th.pickcol, td.pickcol { width: 30px; text-align: center; padding-left: 6px; }
th.pickcol input, td.pickcol input { min-width: auto; width: 15px; height: 15px; margin: 0; }
/* Панель групповых действий появляется только когда что-то выделено */
.bulkbar { display: none; gap: 10px; align-items: center; margin-bottom: 10px;
           padding: 8px 12px; background: var(--panel2); border-radius: 8px; }
.bulkbar.on { display: flex; }

/* Сетка найденных объявлений: карточка = картинка + подпись, как в самом
   виджете. Смотреть их надо глазами и пачкой, поэтому плитка, а не таблица */
.spygrid { display: grid; gap: 12px;
           grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.spycard { background: var(--panel2); border: 1px solid var(--line);
           border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.spycard img { width: 100%; height: 150px; object-fit: cover; display: block; }
.spybody { padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; }
.spytitle { font-weight: 600; font-size: 13px; line-height: 1.35; }

/* ============================================================================
   Страница кампании: креативы и превью на телефоне.

   Тизер в вакууме выглядит иначе, чем в ленте: там он мелкий, обрезан по
   ширине блока и стоит между чужими заголовками. Поэтому превью — не
   «картинка крупно», а рекламный блок в окружении текста статьи. Так видно
   то, ради чего его и смотрят: читается ли заголовок и не теряется ли лицо.
   ============================================================================ */
.crgrid { display: flex; flex-direction: column; gap: 14px; }
.crcard {
  display: flex; gap: 16px; align-items: flex-start; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel2);
}
.crmain { display: flex; gap: 12px; flex: 1; min-width: 0; }
.crmain > img, .crmain > .crvideo {
  width: 168px; height: 112px; flex: 0 0 auto; object-fit: cover; border-radius: 8px;
  border: 1px solid rgba(151,164,255,.3);
}
/* Ролик занимает то же место, что и картинка: карточки в сетке не должны
   разъезжаться от того, какого типа объявление. Чёрный фон — пока кадр не
   загрузился, иначе на его месте зияет дыра цвета страницы. */
.crmain > .crvideo { background: #000; }
.crnoimg {
  width: 168px; height: 112px; flex: 0 0 auto; display: flex; align-items: center;
  justify-content: center; border-radius: 8px; border: 1px dashed var(--line);
  color: var(--text-mute); font-size: 12px;
}
/* Причина отказа бывает длинной — сеть присылает целый абзац правил.
   Без ограничения ширины он вылезал поверх превью телефона. */
.crtext { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.crtext .warn-box { max-width: 100%; white-space: normal; }
.crtitle { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.crbody { color: var(--text-dim); font-size: 13px; margin-top: 4px; line-height: 1.4; }
.crmeta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.ce-image-preview { display:flex; align-items:center; gap:10px; margin-top:10px; min-height:44px; }
.ce-image-preview img { width:116px; height:76px; object-fit:cover; border-radius:8px; border:1px solid rgba(151,164,255,.45); }

/* Рамка телефона. Размер взят такой, чтобы блок был виден целиком без
   прокрутки и при этом остался мелким — как на экране в руке. */
.phone {
  flex: 0 0 auto; width: 208px; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line); background: #0e1424; box-shadow: 0 8px 22px rgba(0,0,0,.35);
}
.phone.ios { border-radius: 30px; }
.phone-bar {
  display: flex; align-items: center; gap: 6px; padding: 7px 10px;
  background: #1b2437; border-bottom: 1px solid var(--line);
}
.phone.ios .phone-bar { justify-content: center; background: #f2f3f7; border-bottom-color: #dcdfe8; }
.phone-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: #46c96a; }
.phone.ios .phone-bar .dot { display: none; }
.phone-bar .url {
  font-size: 10.5px; color: var(--text-mute); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.phone.ios .phone-bar .url { color: #5b6270; background: #e3e5ec; border-radius: 6px; padding: 2px 10px; }

.phone-screen { background: #fff; padding: 10px; }
.fakeline { height: 9px; border-radius: 3px; background: #d7dbe4; margin-bottom: 6px; }
.fakepar { height: 5px; border-radius: 3px; background: #e9ecf2; margin-bottom: 5px; }
.w80 { width: 80%; } .w70 { width: 70%; } .w60 { width: 60%; }
.adlabel { font-size: 9px; color: #9aa1ad; margin: 8px 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.adblock { display: flex; gap: 8px; border: 1px solid #e4e7ee; border-radius: 8px; padding: 6px; }
.phone.ios .adblock { border-radius: 12px; }
.adimg { width: 74px; height: 56px; flex: 0 0 auto; border-radius: 6px; overflow: hidden; background: #eef0f5; }
.adimg img { width: 100%; height: 100%; object-fit: cover; }
.adimg .crnoimg { width: 100%; height: 100%; border: 0; }
.adtexts { min-width: 0; }
.adtitle { font-size: 11.5px; line-height: 1.25; color: #14181f; font-weight: 600; }
.phone.ios .adtitle { font-family: -apple-system, "SF Pro Text", system-ui, sans-serif; }
.adbody { font-size: 10px; color: #5d6470; margin-top: 2px; line-height: 1.3; }
.adhost { font-size: 9.5px; color: #9aa1ad; margin-top: 3px; }

/* Списки площадок: два столбца рядом, чтобы чёрный и белый читались вместе —
   белый сильнее чёрного, и видеть их порознь опасно. */
.zonegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .zonegrid { grid-template-columns: 1fr; } }
.zonecol h3 { margin: 0 0 8px; font-size: 14px; }
.zonelist { list-style: none; margin: 10px 0 0; padding: 0; max-height: 260px; overflow: auto; }
.zonelist li {
  display: flex; align-items: center; gap: 8px; padding: 4px 0;
  border-bottom: 1px solid var(--line-soft);
}
.zonelist li .hint { margin: 0; flex: 1; }
.zone-add { flex: 1; min-width: 160px; }


/* ============================================================================
   Действия в таблицах.

   Таблица кампаний шире экрана, и кнопки «Старт», «Змінити», «Видалити»
   уезжали за правый край: строка была видна, а сделать с ней ничего нельзя.
   Прижимаем последний столбец к правому краю — он остаётся на месте, пока
   остальное прокручивается.
   ============================================================================ */
table td:last-child, table th:last-child {
  position: sticky;
  right: 0;
  background: var(--panel2);
  box-shadow: -8px 0 12px -8px rgba(0, 0, 0, .55);
  /* Кнопки в один ряд и покомпактнее: столбец висит поверх соседнего,
     и чем он уже, тем меньше перекрывает */
  white-space: nowrap;
  padding: 6px 8px;
}
table td:last-child button, table td:last-child .badge { margin-left: 4px; }
table td:last-child button { padding: 4px 9px; font-size: 12px; }
table th:last-child { background: var(--panel); z-index: 2; }
tbody tr:hover td:last-child { background: var(--raised); }

/* Длинные значения в ячейках подрезаем, а не даём им лезть на соседей */
td .mono, td .copy { max-width: 260px; overflow: hidden; text-overflow: ellipsis;
  display: inline-block; vertical-align: bottom; }

/* Сетка расписания: дни строками, часы столбцами — как в кабинетах сетей. */
.schedgrid { margin-top: 8px; display: inline-block; }
.schedrow { display: flex; align-items: center; gap: 2px; }
.schedrow span { width: 28px; font-size: 11px; color: var(--text-dim); }
.schedrow i { width: 18px; text-align: center; font-size: 10px; color: var(--text-mute); font-style: normal; }
.schedrow label { width: 18px; display: flex; justify-content: center; }
.schedrow input { width: 13px; height: 13px; margin: 1px 0; }

/* Цифры и кнопки на карточке креатива: решение принимают, глядя на него. */
.crstat { display: flex; gap: 14px; align-items: baseline; margin-top: 8px; font-size: 12.5px; }
.crstat b { font-family: var(--mono); font-size: 14px; }
.crops { display: flex; gap: 8px; margin-top: 10px; }

/* Ход обхода: сколько площадок пройдено и сколько ещё ждать.
   Надпись «іде зараз» не отвечала на вопрос «сколько ждать», а круг по
   восьми десяткам сайтов идёт двадцать минут. */
.crawlbar { display: flex; flex-direction: column; gap: 4px; min-width: 210px; }
.crawlbar .track { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.crawlbar .fill { height: 100%; background: linear-gradient(90deg, #6c5ce7, #a29bfe); transition: width .4s ease; }
.crawlbar .note { font-size: 12px; color: var(--muted); }

/* Множественный выбор галочками: областей два десятка, и список с прокруткой
   для них неудобен — не видно, что выбрано, и один щелчок сбрасывает всё. */
.checkgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 4px 10px; max-height: 230px; overflow-y: auto; padding: 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel2);
}
.checkitem { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.checkitem input { width: 15px; height: 15px; flex: 0 0 auto; }
.checkitem span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Выпадающий список с галочками — измерения таргетинга.
   Раскрытые multiple-списки занимали пол-экрана и теряли выбранное за
   границей прокрутки; здесь на виду ровно то, что выбрано. */
.dropsel { position: relative; }
/* Селектор длиннее нужного намеренно: общее правило кнопок
   button:not(.ghost):not(.danger) красит их градиентом, и по весу оно
   сильнее одного класса — выпадающий список выглядел как кнопка «Создать» */
.dropsel button.dropbtn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; font-size: 13px; font-weight: 400;
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px;
}
.dropsel button.dropbtn:hover { border-color: var(--accent); background: var(--panel2); }
.dropsel.has button.dropbtn { border-color: var(--accent); }
.dropsel .dropsum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropsel.has .dropsum { color: var(--text); }
.dropsel .dropcar { opacity: .6; flex: 0 0 auto; }
.droplist {
  position: absolute; z-index: 40; left: 0; right: 0; top: 100%; margin-top: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .45); padding: 8px;
}
.droptools { display: flex; gap: 6px; margin-bottom: 6px; }
.droptools .dropfind { flex: 1; min-width: 0; font-size: 12px; padding: 5px 8px; }
.droptools button.ghost { font-size: 11px; padding: 4px 8px; }
/* Список короткий и прокручивается: раскрытый на весь экран перечень
   областей закрывал собой всё остальное, и до кнопки приходилось листать */
.dropitems { max-height: min(180px, 34vh); overflow-y: auto; display: grid; gap: 3px; }
.dropitems .checkitem { padding: 3px 4px; border-radius: 4px; }
.dropitems .checkitem:hover { background: var(--panel2); }
/* Чего у сети нет для выбранного устройства, того и не показываем */
.dropitems .checkitem.gone { display: none; }
/* Поиск прячет строки через hidden, а display:flex у .checkitem сильнее
   правила браузера для [hidden] — из-за этого поиск ничего не фильтровал */
.dropitems .checkitem[hidden] { display: none; }
.drophint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.drophint:empty { display: none; }

/* Сегментированный переключатель: чем смотреть находки Ad Spy.
   Кнопки рядом, потому что это один вопрос с несколькими ответами, а не
   четыре независимых фильтра — так их и читают. */
.segbar { display: flex; flex-wrap: wrap; gap: 0; }
.segbar button {
  background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
  border-radius: 0; padding: 7px 12px; font-size: 13px; font-weight: 500;
  box-shadow: none;
}
.segbar button + button { border-left: none; }
.segbar button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.segbar button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.segbar button:hover { color: var(--text); background: var(--panel); }
.segbar button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Окно поверх экрана: креатив крупно, варианты рядом, залив тут же. */
.modalwrap {
  position: fixed; inset: 0; z-index: 200; background: rgba(4, 8, 18, .72);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 16px; overflow-y: auto;
}
.modalbox {
  position: relative; width: min(980px, 100%); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.modalx {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; padding: 0;
  background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 18px; line-height: 1; box-shadow: none;
}
.modalx:hover { color: var(--text); background: var(--panel); }
/* Витрина вариантов: оригинал и то, что предложила модель, рядом и одного размера */
.varlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.varcard {
  border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 6px;
  background: var(--panel2); cursor: pointer;
}
.varcard.on { border-color: var(--accent); }
.varcard img, .varcard video { width: 100%; border-radius: 4px; display: block; aspect-ratio: 16/9; object-fit: cover; background: #0b1020; }
.varcard .vartag { font-size: 11px; color: var(--muted); margin-top: 4px; display: block; }

/* Картинки страницы: превью, а не список имён файлов.
   По имени avataka-11.jpg не понять, лицо это из отзыва или упаковка. */
.imggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.imgpick {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel2); padding: 8px; display: flex; flex-direction: column; gap: 6px;
}
.imgpick img {
  width: 100%; height: 120px; object-fit: contain; background: #0b1020;
  border-radius: 4px;
}
.imgpick .imgmeta { display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.imgpick .imgmeta .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imgpick input { font-size: 12px; padding: 5px 8px; }
.imgpick[data-role="people"] { opacity: .75; }

/* Полоса «вышла новая версия»: вкладку держат открытой днями, и человек
   смотрит на вчерашнюю вёрстку, не зная об этом. */
.newbuild {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 300;
  background: var(--panel); border: 1px solid var(--accent); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
