/* ==========================================================================
   Task Manager — общая тема (тёмный космический минимализм).
   Все цвета и размеры — в переменных :root. Новые страницы подключают
   этот файл и используют готовые классы: .page, .card, .field, .btn и т.д.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Фон и поверхности */
  --bg: #0B0B12;
  --surface: rgba(20, 20, 31, 0.72);     /* #14141F с прозрачностью */
  --surface-solid: #14141F;
  --input-bg: #101018;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Текст */
  --text: #EDEDF2;
  --text-muted: #8A8A9E;
  --text-faint: #5C5C70;

  /* Акцент */
  --accent: #5B5BD6;
  --accent-hover: #6E6EE4;
  --accent-glow: rgba(91, 91, 214, 0.45);
  --accent-ring: rgba(91, 91, 214, 0.28);

  /* Состояния */
  --danger: #F2555A;
  --danger-bg: rgba(242, 85, 90, 0.08);
  --danger-border: rgba(242, 85, 90, 0.25);

  /* Форма */
  --radius-card: 16px;
  --radius-control: 10px;
  --control-height: 48px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 64px -12px rgba(0, 0, 0, 0.6), 0 8px 24px -8px rgba(0, 0, 0, 0.5);

  /* Каркас */
  --sidebar-w: 248px;

  /* Шрифт и анимации */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms;
  --t-slow: 600ms;

  color-scheme: dark;
}

/* --- База --------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* --- Космический фон ------------------------------------------------------
   Слои: свечение сверху по центру, точечная сетка, гаснущая к центру,
   и тонкие вертикальные световые линии по краям. */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.backdrop::before {               /* свечение */
  content: "";
  position: absolute;
  top: -340px;
  left: 50%;
  width: min(1100px, 160vw);
  height: 680px;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side, rgba(110, 90, 255, 0.30), rgba(110, 90, 255, 0.10) 45%, transparent 75%),
    radial-gradient(closest-side at 35% 60%, rgba(70, 110, 255, 0.16), transparent 70%);
  filter: blur(40px);
  animation: glow-breathe 9s ease-in-out infinite alternate;
}

.backdrop::after {                /* точечная сетка */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, transparent 35%, #000 100%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, transparent 35%, #000 100%);
}

.backdrop__line {                 /* световые линии по краям */
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.07) 30%, rgba(140, 130, 255, 0.10) 50%, rgba(255, 255, 255, 0.04) 75%, transparent);
}
.backdrop__line--l { left: max(24px, calc(50% - 600px)); }
.backdrop__line--r { right: max(24px, calc(50% - 600px)); }

@keyframes glow-breathe {
  from { opacity: 0.85; }
  to   { opacity: 1; }
}

/* --- Раскладка ---------------------------------------------------------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

/* --- Карточка ----------------------------------------------------------- */

.card {
  width: 100%;
  max-width: 400px;
  padding: 40px 32px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
          backdrop-filter: blur(16px) saturate(140%);
}

.appear {
  animation: appear var(--t-slow) var(--ease) both;
}
.appear--delay-1 { animation-delay: 80ms; }
.appear--delay-2 { animation-delay: 160ms; }

@keyframes appear {
  from { opacity: 0; transform: translateY(12px) scale(0.985); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* --- Типографика -------------------------------------------------------- */

.title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 40%, #A9A9BC 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 15px;
}

.text-center { text-align: center; }

/* --- Поля ввода --------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 16px; margin-top: 32px; }

.field { display: flex; flex-direction: column; gap: 8px; }

.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.input-wrap { position: relative; }

.input {
  width: 100%;
  height: var(--control-height);
  padding: 0 14px;
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  color: var(--text);
  font: inherit;
  font-size: 16px;   /* 16px — iOS не масштабирует страницу при фокусе */
  outline: none;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, background-color var(--t-fast) ease;
}
.input::placeholder { color: var(--text-faint); }
.input:hover { border-color: rgba(255, 255, 255, 0.2); }
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring), 0 0 20px -4px var(--accent-glow);
}
.input--with-icon { padding-right: 52px; }
.input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset;
  caret-color: var(--text);
}
.input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset, 0 0 0 3px var(--accent-ring);
}

.input-icon-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--t-fast) ease, background-color var(--t-fast) ease;
}
.input-icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.input-icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.input-icon-btn svg { width: 20px; height: 20px; }
.input-icon-btn .icon-hide { display: none; }
.input-icon-btn[aria-pressed="true"] .icon-show { display: none; }
.input-icon-btn[aria-pressed="true"] .icon-hide { display: block; }

/* --- Кнопки ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--control-height);
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--t-fast) ease, box-shadow var(--t-fast) ease, border-color var(--t-fast) ease, transform var(--t-fast) ease, opacity var(--t-fast) ease;
}
.btn:active { transform: scale(0.985); }
.btn:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.btn--block { width: 100%; }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 4px 14px -4px var(--accent-glow);
}
.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 24px -2px var(--accent-glow);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Сообщения ---------------------------------------------------------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
}
.alert[hidden] { display: none; }
.alert--error {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  animation: appear 250ms var(--ease) both;
}
.alert svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }

.shake { animation: shake 360ms var(--ease); }
@keyframes shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* --- Бренд -------------------------------------------------------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.brand__mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, #7B7BF0, var(--accent) 60%, #3D3DA8);
  box-shadow: 0 0 16px -2px var(--accent-glow);
}

/* --- Каркас приложения: боковое меню + контент ------------------------- */

.app { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 12px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: rgba(13, 13, 21, 0.82);
  border-right: 1px solid var(--border);
  -webkit-backdrop-filter: blur(16px);
          backdrop-filter: blur(16px);
}
.sidebar .brand { padding: 4px 10px 20px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease;
}
.nav__item svg { width: 18px; height: 18px; flex: none; }
.nav__item:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav__item.is-active { color: var(--text); background: rgba(91, 91, 214, 0.14); box-shadow: inset 0 0 0 1px rgba(91, 91, 214, 0.25); }
.nav__item.is-active svg { color: #A5A5F5; }

.sidebar__user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 0;
  border-top: 1px solid var(--border);
}
.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #2A2A48, #1C1C2E);
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 600;
}
.sidebar__user-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.sidebar__user-role { color: var(--text-muted); font-size: 12px; }
.sidebar__user form { margin-left: auto; }

.app-main { margin-left: var(--sidebar-w); min-width: 0; }

.mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(11, 11, 18, 0.78);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(5, 5, 10, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.content {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 32px 64px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.page-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.page-sub { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
}
.back-link:hover { color: var(--text); }
.back-link svg { width: 16px; height: 16px; }

/* --- Панели ------------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.panel + .panel { margin-top: 16px; }
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 16px;
}
.panel__title { margin: 0; font-size: 15px; font-weight: 600; }
.panel__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.mt { margin-top: 12px; }
.panel .alert { margin-top: 16px; }
#text-tabs { margin-bottom: 12px; }
.cr-head + .kv { padding-top: 16px; border-top: 1px solid var(--border); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* --- Кнопки: дополнительные размеры ------------------------------------ */

.btn--sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn--icon { width: 40px; padding: 0; }
.btn--icon.btn--sm { width: 36px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn--danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.btn--danger:hover:not(:disabled) { background: rgba(242, 85, 90, 0.14); }
.btn.is-done { border-color: rgba(70, 200, 130, 0.4); color: #6EE7A8; }

.link {
  color: #A5A5F5;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.link:hover { border-bottom-color: currentColor; }

/* --- Поля: select, textarea --------------------------------------------- */

.select {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 12px;
  background-color: var(--input-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A8A9E' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  -webkit-appearance: none;
          appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.select:hover { border-color: rgba(255, 255, 255, 0.2); }
.select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.select.is-set { border-color: rgba(91, 91, 214, 0.5); background-color: rgba(91, 91, 214, 0.08); }
.select option { background: var(--surface-solid); color: var(--text); }

.input--sm { height: 40px; font-size: 14px; border-radius: 8px; }

.textarea {
  width: 100%;
  min-height: 120px;
  height: calc(9 * 1.55em + 26px);   /* ≈ 9 видимых строк */
  padding: 12px 14px;
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring), 0 0 20px -4px var(--accent-glow);
}
.textarea--sm { height: 88px; min-height: 64px; }

.field-hint { display: flex; justify-content: space-between; gap: 12px; color: var(--text-muted); font-size: 13px; }

/* --- Плашки: статус, оценка, гео --------------------------------------- */

.badge {
  --tone: 138, 138, 158;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: rgb(var(--tone));
  background: rgba(var(--tone), 0.12);
  border: 1px solid rgba(var(--tone), 0.28);
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge--plain::before { display: none; }
.badge--gray   { --tone: 160, 160, 180; }
.badge--blue   { --tone: 96, 165, 250; }
.badge--violet { --tone: 165, 140, 255; }
.badge--green  { --tone: 74, 222, 128; }
.badge--amber  { --tone: 251, 191, 36; }
.badge--red    { --tone: 248, 113, 113; }
button.badge { cursor: pointer; font-family: inherit; }
button.badge:hover { background: rgba(var(--tone), 0.2); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 4px 0 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
  font-size: 13px;
  white-space: nowrap;
}
.chip--static { padding-right: 10px; }
.chip__x {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.chip__x:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.chip__x svg { width: 14px; height: 14px; }

.lang-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(91, 91, 214, 0.16);
  color: #B9B9FA;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* --- Выпадающий список с поиском (combobox / multiselect) -------------- */

.combo { position: relative; }
.combo__control {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: var(--control-height);
  padding: 6px 40px 6px 8px;
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  cursor: text;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A8A9E' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.combo.is-open .combo__control,
.combo__control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.combo__input {
  flex: 1 1 120px;
  min-width: 80px;
  height: 34px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
}
.combo__input::placeholder { color: var(--text-faint); }
.combo__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  max-height: 280px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  background: #16162A;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.7);
  animation: pop 150ms var(--ease) both;
}
.combo__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
}
.combo__option.is-active { background: rgba(91, 91, 214, 0.18); }
.combo__option[aria-selected="true"] { color: #B9B9FA; }
.combo__option[aria-selected="true"]::after {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 8.5 3 3 7-7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 8.5 3 3 7-7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.combo__empty { padding: 10px; color: var(--text-muted); font-size: 14px; }
.combo__code { color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }

@keyframes pop {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* --- Меню «три точки» --------------------------------------------------- */

.menu-wrap { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  min-width: 230px;
  padding: 6px;
  background: #16162A;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.7);
  animation: pop 150ms var(--ease) both;
}
.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.menu__item svg { width: 16px; height: 16px; color: var(--text-muted); flex: none; }
.menu__item:hover, .menu__item:focus-visible { background: rgba(255, 255, 255, 0.06); outline: none; }
.menu__sep { height: 1px; margin: 6px 4px; background: var(--border); }
.menu__item--danger, .menu__item--danger svg { color: var(--danger); }

/* --- Модальные окна ----------------------------------------------------- */

.modal {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow-card);
}
.modal[open] { animation: appear 250ms var(--ease) both; }
.modal::backdrop { background: rgba(5, 5, 10, 0.65); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal__body { padding: 24px; }
.modal__title { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.modal__text { margin: 0 0 20px; color: var(--text-muted); font-size: 14px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.option-list { display: flex; flex-direction: column; gap: 6px; }
.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.option:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.05); }
.option.is-current { border-color: rgba(91, 91, 214, 0.6); background: rgba(91, 91, 214, 0.1); }

/* --- Уведомления -------------------------------------------------------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  max-width: min(440px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 10px;
  background: #1E1E33;
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.6);
  font-size: 14px;
  animation: appear 250ms var(--ease) both;
}
.toast--error { color: var(--danger); border-color: var(--danger-border); }

/* --- Сегментный переключатель и вкладки -------------------------------- */

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.seg__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.seg__btn svg { width: 16px; height: 16px; }
.seg__btn:hover { color: var(--text); }
.seg__btn[aria-pressed="true"], .seg__btn[aria-selected="true"] { background: rgba(255, 255, 255, 0.09); color: var(--text); }

/* --- Фильтры ------------------------------------------------------------ */

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(6, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.search { position: relative; }
.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search .input { padding-left: 36px; }
.list-bar .select { width: auto; min-width: 170px; }
.list-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: background-color var(--t-fast) ease;
}
.toggle__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--t-fast) var(--ease);
}
.toggle input:checked + .toggle__track { background: var(--accent); }
.toggle input:checked + .toggle__track::after { transform: translateX(14px); }
.toggle input:focus-visible + .toggle__track { outline: 2px solid var(--accent-hover); outline-offset: 2px; }

.results { transition: opacity var(--t-fast) ease; }
.results.is-loading { opacity: 0.5; }

/* --- Плитка креативов --------------------------------------------------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color var(--t-fast) ease, transform 200ms var(--ease), box-shadow 200ms ease;
}
.tile:hover {
  border-color: rgba(91, 91, 214, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -12px rgba(91, 91, 214, 0.35);
}
.tile__link { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.tile__actions { display: flex; gap: 6px; padding: 0 14px 14px; }
.tile__actions .btn { flex: 1; min-width: 0; }
.tile__media { position: relative; aspect-ratio: 1 / 1; background: #0E0E17; }
.tile__body { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; }
.tile__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile__id { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.tile__geo { color: var(--text-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-faint);
}
.thumb-empty svg { width: 32px; height: 32px; }
.media-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.media-badge svg { width: 12px; height: 12px; }
.media-count { left: auto; right: 8px; }
.archived-flag {
  position: absolute;
  top: 8px;
  left: 8px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.9);
  color: #1A1300;
  font-size: 11px;
  font-weight: 700;
  line-height: 22px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Таблица ------------------------------------------------------------ */

.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background-color var(--t-fast) ease; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.table .t-thumb { position: relative; width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: #0E0E17; }
.table .t-id { font-weight: 700; white-space: nowrap; }
.table a { color: inherit; text-decoration: none; }

.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 64px 16px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
}
.empty svg { width: 36px; height: 36px; color: var(--text-faint); }
.empty__title { color: var(--text); font-weight: 600; font-size: 16px; }

/* --- Мастер создания ---------------------------------------------------- */

.wizard { max-width: 760px; }
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}
.steps__item { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--text-faint); font-size: 13px; font-weight: 500; }
.steps__item::before {
  content: "";
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  transition: background-color 300ms ease;
}
.steps__item.is-done, .steps__item.is-current { color: var(--text-muted); }
.steps__item.is-current { color: var(--text); }
.steps__item.is-done::before, .steps__item.is-current::before { background: var(--accent); }
.wizard__step { animation: appear 350ms var(--ease) both; }
.wizard__nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
.wizard__nav .btn { min-width: 120px; }
.id-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(91, 91, 214, 0.08);
  border: 1px solid rgba(91, 91, 214, 0.25);
  color: var(--text-muted);
  font-size: 14px;
}
.id-preview strong { color: var(--text); font-size: 20px; letter-spacing: 0.01em; }

/* --- Загрузка файлов ---------------------------------------------------- */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 16px;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease;
}
.dropzone svg { width: 32px; height: 32px; color: #A5A5F5; }
.dropzone strong { color: var(--text); font-weight: 600; }
.dropzone:hover, .dropzone.is-over, .dropzone:focus-visible {
  border-color: var(--accent);
  background: rgba(91, 91, 214, 0.07);
  outline: none;
}
.dropzone--compact { flex-direction: row; justify-content: center; padding: 16px; }
.dropzone--compact svg { width: 20px; height: 20px; }

.files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.file {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
}
.file__media { position: relative; aspect-ratio: 1 / 1; background: #0E0E17; }
.file__meta { padding: 8px 10px; font-size: 12px; }
.file__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.file__x {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
}
.file__x svg { width: 16px; height: 16px; }
.file__x:hover { background: rgba(242, 85, 90, 0.85); }
.file.is-error { border-color: var(--danger-border); }
.file__error { color: var(--danger); }
.progress {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.progress__bar { height: 100%; width: 0; background: var(--accent); transition: width 150ms linear; box-shadow: 0 0 10px var(--accent-glow); }
.file__status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  padding: 10px;
  font-size: 13px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* --- Карточка креатива -------------------------------------------------- */

.cr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.cr-id { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.cr-id__value {
  margin: 0;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  background: linear-gradient(180deg, #FFFFFF 0%, #B4B4C8 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.cr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; color: var(--text-muted); font-size: 13px; }
.cr-actions { display: flex; align-items: center; gap: 8px; }
.cr-grid { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 14px 12px; align-items: center; font-size: 14px; }
.kv__k { color: var(--text-muted); font-size: 13px; }
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #FCD34D;
  font-size: 14px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.media-item { margin: 0; border-radius: 12px; overflow: hidden; background: var(--input-bg); border: 1px solid var(--border); }
.media-item__view { position: relative; aspect-ratio: 1 / 1; background: #07070C; }
.media-item__view img, .media-item__view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.media-item__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 12px; font-size: 12px; }
.media-item__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-item__actions { display: flex; gap: 4px; flex: none; }
.play-btn {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.play-btn span {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(91, 91, 214, 0.85);
  box-shadow: 0 0 24px var(--accent-glow);
  transition: transform var(--t-fast) var(--ease);
}
.play-btn:hover span { transform: scale(1.08); }
.play-btn svg { width: 22px; height: 22px; color: #fff; margin-left: 3px; }

.text-view {
  max-height: 420px;
  overflow-y: auto;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.6;
}
.text-view.is-empty { color: var(--text-faint); }
.notice { margin-top: 10px; color: #FCD34D; font-size: 13px; }

.comments { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.comment { display: flex; gap: 10px; }
.comment .avatar { width: 28px; height: 28px; font-size: 12px; }
.comment__head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.comment__author { font-weight: 600; }
.comment__time { color: var(--text-muted); font-size: 12px; }
.comment__body { margin-top: 2px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* --- Настройки ---------------------------------------------------------- */

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-grid > .panel { margin-top: 0; }
.ref-list { display: flex; flex-direction: column; }
.ref-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.ref-row:last-child { border-bottom: 0; }
.ref-row__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-row.is-hidden .ref-row__name { color: var(--text-faint); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.2); }
.ref-row .input { flex: 1; }
.ref-add { display: flex; gap: 8px; margin-top: 12px; }
.ref-add .input--code { width: 72px; flex: none; text-transform: uppercase; text-align: center; }

.disk__bar {
  display: flex;
  height: 10px;
  margin: 12px 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}
.disk__media { background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.disk__other { background: rgba(255, 255, 255, 0.28); }
.disk__legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--text-muted); }
.disk__legend strong { color: var(--text); font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: middle; }
.dot--media { background: var(--accent); }
.dot--other { background: rgba(255, 255, 255, 0.28); }
.dot--free { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2); }

/* --- Ссылки ------------------------------------------------------------- */

.link-url { overflow-wrap: anywhere; word-break: break-all; font-size: 14px; }
.service-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.filters--links { grid-template-columns: minmax(220px, 3fr) repeat(2, minmax(160px, 1fr)); }
.geo-cell { min-width: 140px; }
.geo-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.geo-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin: 1px 4px 1px 0;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
  font-size: 12px;
  white-space: nowrap;
}
.geo-chips .geo-chip { margin: 0; }
.geo-chip--all, .chip--all {
  background: rgba(91, 91, 214, 0.16);
  border-color: rgba(91, 91, 214, 0.45);
  color: #C9C9F7;
  font-weight: 600;
}
.combo__option--special { color: #C9C9F7; font-weight: 600; }
.combo__sep { height: 1px; margin: 4px 6px; background: var(--border-strong); list-style: none; }
.geo-chip--more { color: var(--text-muted); cursor: help; }
.geo-missing {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px dashed rgba(251, 191, 36, 0.45);
  color: #FCD34D;
  font-size: 12px;
  white-space: nowrap;
}
.picker__geo { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.picker__main { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.picker__empty .btn { margin-top: 10px; }
.table--links .link-cell { max-width: 480px; }
.table--links .link-url {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #C9C9F7;
}
.row-actions { white-space: nowrap; }
.row-actions__inner { display: flex; justify-content: flex-end; gap: 4px; }
.table time { white-space: nowrap; }
.menu--floating { position: fixed; right: auto; top: 0; left: 0; z-index: 90; }
.menu__item:disabled { opacity: 0.45; cursor: not-allowed; }
.menu__item:disabled:hover { background: transparent; }
.modal--wide { width: min(620px, calc(100vw - 32px)); }

.usage-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.usage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  text-decoration: none;
}
.usage-item:hover { border-color: rgba(91, 91, 214, 0.5); background: rgba(91, 91, 214, 0.08); }

.dup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-strong);
}

.picker { display: flex; flex-direction: column; gap: 10px; }
.picker__bar { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto; gap: 8px; }
.picker__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px solid var(--border);
}
.picker__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.picker__item:hover, .picker__item:focus-visible { background: rgba(91, 91, 214, 0.14); outline: none; }
.picker__item.is-current { box-shadow: inset 0 0 0 1px rgba(91, 91, 214, 0.6); }
.picker__empty { padding: 14px 10px; color: var(--text-muted); font-size: 14px; }

.chosen-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(91, 91, 214, 0.08);
  border: 1px solid rgba(91, 91, 214, 0.35);
}
.chosen-link__main { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }

/* --- Пиксели ------------------------------------------------------------ */

.filters--pixels { grid-template-columns: minmax(220px, 3fr) minmax(160px, 1fr); }
.table--pixels .px-name a { color: var(--text); font-weight: 600; text-decoration: none; }
.table--pixels .px-name a:hover { color: #C9C9F7; }
.copyable { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; }
.token {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: #C9C9F7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.token-view { word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.px-big { font-size: 20px; font-weight: 700; letter-spacing: 0.02em; }
.kv--wide { grid-template-columns: 110px minmax(0, 1fr); align-items: start; }
.kv--wide .kv__k { padding-top: 6px; }
.pixel-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(91, 91, 214, 0.14);
  border: 1px solid rgba(91, 91, 214, 0.35);
  color: #C9C9F7;
  font-size: 12px;
  white-space: nowrap;
  text-decoration: none;
}
.pixel-tag:hover { background: rgba(91, 91, 214, 0.22); }
.pixel-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  font-size: 13px;
  color: var(--text-muted);
}
.usage-list--plain { max-height: none; }
.usage-list--plain .usage-item { flex-wrap: wrap; padding: 10px 12px; }
.usage-list--plain .link-url { flex: 1 1 260px; min-width: 0; }

/* --- Перевод ------------------------------------------------------------ */

.tr-state {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  min-height: 120px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}
.tr-state--error { color: var(--danger); border-color: var(--danger-border); background: var(--danger-bg); }
.spinner--accent { border-color: rgba(165, 165, 245, 0.25); border-top-color: #A5A5F5; }
.tab-dot { display: inline-block; width: 6px; height: 6px; margin-left: 2px; border-radius: 50%; vertical-align: middle; }
.tab-dot--busy { background: #A5A5F5; animation: glow-breathe 0.8s ease-in-out infinite alternate; }
.tab-dot--error { background: var(--danger); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.stat { padding: 12px; border-radius: 10px; background: var(--input-bg); border: 1px solid var(--border); }
.stat__value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.stat__label { color: var(--text-muted); font-size: 12px; }
.queue-line { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* --- Агентства и Google ---------------------------------------------------- */

.banner--warn { background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.3); color: #FCD34D; }
.banner--danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.notice--danger { color: var(--danger); }
.google-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.google-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.google-dot--ok { background: #4ADE80; box-shadow: 0 0 8px rgba(74, 222, 128, 0.6); }
.google-dot--bad { background: var(--danger); }
.settings-google .btn svg { width: 16px; height: 16px; }
.filters--agencies { grid-template-columns: minmax(220px, 1fr); max-width: 520px; }
.table--agencies .ag-name a { color: var(--text); font-weight: 600; text-decoration: none; }
.table--agencies .ag-file { max-width: 320px; }

.check-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-size: 13px; color: var(--text-muted); }
.check-line--ok { color: #6EE7A8; }
.check-line--ok strong { color: var(--text); font-weight: 600; }
.check-line--bad { color: var(--danger); }
.check-line .muted { flex-basis: 100%; }

.sheet-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.sheet-tab {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.sheet-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.sheet-tab[aria-selected="true"] { color: var(--text); border-color: rgba(91, 91, 214, 0.6); background: rgba(91, 91, 214, 0.14); }
.sheet-tab.is-hidden-sheet { font-style: italic; opacity: 0.7; }
.preview .spinner { display: inline-block; vertical-align: middle; margin-right: 6px; }

.pv-wrap {
  max-height: 70vh;
  overflow: auto;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
}
.pv-table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pv-table th, .pv-table td {
  padding: 6px 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.pv-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #17172A;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}
.pv-table .pv-num, .pv-table .pv-corner {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #17172A;
  color: var(--text-muted);
  font-weight: 500;
  text-align: right;
  min-width: 40px;
}
.pv-table .pv-corner { z-index: 3; }

/* --- Агентства: этап 2 ------------------------------------------------------ */

.stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.stat__value--green { color: #6EE7A8; }
.stat__value--red { color: var(--danger); }
.period-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 4px 0 16px; }
.period-bar .select { width: auto; min-width: 170px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 36px; font-size: 14px; cursor: pointer; }
.radio input { width: 16px; height: 16px; accent-color: var(--accent); }
.radio .input { max-width: 220px; }
.tabs-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.sheet-pill { display: inline-flex; align-items: center; gap: 6px; margin: 2px 6px 2px 0; font-size: 13px; }
.sheet-cards { display: flex; flex-direction: column; gap: 12px; }
.sheet-card { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--input-bg); }
.sheet-card.is-archived { opacity: 0.6; }
.sheet-card__head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.sheet-card__meta { margin: 6px 0 10px; }
.sheet-card__nums { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.sheet-num { padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); }
.sheet-num__v { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.sheet-num__l { color: var(--text-muted); font-size: 11px; }
.warn { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.warn:last-child { border-bottom: 0; }
.warn__text { flex: 1 1 320px; min-width: 0; }
.warn .btn { margin-left: auto; }
.table--compact { font-size: 13px; }
.table--compact th, .table--compact td { padding: 7px 10px; }
.table th.num, .table td.num { text-align: right; white-space: nowrap; }
.details summary { cursor: pointer; color: var(--text-muted); font-size: 14px; padding: 6px 0; }
.chart { margin-bottom: 10px; }
.chart__svg { width: 100%; height: auto; display: block; }
.chart__grid { stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.chart__tick { fill: var(--text-muted); font-size: 11px; font-family: var(--font); }
.chart__bar { fill: var(--accent); opacity: 0.85; }
.chart__bar:hover { fill: var(--accent-hover); opacity: 1; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.status-box { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--input-bg); }
.status-box .label { margin-bottom: 8px; }
.status-box .select { width: auto; min-width: 220px; }
.badge--lg { height: 30px; padding: 0 14px; font-size: 14px; }
.agent-word { font-size: 16px; font-weight: 600; }
.history { display: flex; flex-direction: column; }
.history__item { display: flex; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.history__item:last-child { border-bottom: 0; }
.history__item time { flex: none; min-width: 150px; color: var(--text-muted); font-size: 13px; }
.filters--accounts { grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(130px, 1fr)) 150px 150px; }
.map-row__word { flex: 0 0 140px; }
.map-row .select { flex: 1; min-width: 160px; }
.map-row.needs-value { background: rgba(251, 191, 36, 0.05); }
.ref-add .select { width: auto; }
.ref-add .select.input--code { width: 110px; text-transform: none; text-align: left; }

/* --- Название аккаунта + ID ----------------------------------------------------- */

.tab-months { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 10px 12px; border-radius: 10px; border: 1px dashed rgba(251, 191, 36, 0.4); }
.tab-month-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tab-month-row .input { width: 180px; }
.acc-label { display: inline-flex; flex-direction: column; gap: 1px; min-width: 0; max-width: 100%; }
.acc-label__name { color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.acc-label__name:hover { color: #C9C9F7; }
.acc-label__id { display: inline-flex; align-items: center; gap: 2px; color: var(--text-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copy-mini { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--text-muted); cursor: pointer; flex: none; }
.copy-mini svg { width: 13px; height: 13px; }
.copy-mini:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.copy-mini.is-done { color: #6EE7A8; }
.badge-noid { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; border: 1px dashed rgba(251, 191, 36, 0.5); color: #FCD34D; font-size: 11px; font-weight: 600; }
.noid-box { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: 12px; border: 1px dashed rgba(251, 191, 36, 0.45); background: rgba(251, 191, 36, 0.05); }
.noid-box > div:first-child { flex: 1 1 320px; }
.noid-box .input { width: 240px; }
.table--matrix .acc-label__name, .table--matrix .acc-label__id { max-width: 240px; }

/* --- Спенд по дням ----------------------------------------------------------- */

.th-hint { cursor: help; text-decoration: underline dotted rgba(255, 255, 255, 0.25); text-underline-offset: 3px; }
.table--daily tbody tr.is-empty-day td { color: var(--text-faint); }
.table--daily tfoot th, .table--matrix tfoot th { padding: 9px 10px; border-top: 1px solid var(--border-strong); color: var(--text); font-weight: 600; background: rgba(255, 255, 255, 0.03); }
.table-wrap--daily { max-height: 70vh; overflow: auto; }
.table--daily thead th, .table--matrix thead th { position: sticky; top: 0; z-index: 2; background: #17172A; }
.table--daily tfoot th, .table--matrix tfoot th { position: sticky; bottom: 0; z-index: 2; background: #1A1A2E; }
.table-wrap--matrix { max-height: 70vh; overflow: auto; }
.table--matrix { border-collapse: separate; border-spacing: 0; }
.table--matrix .mx-sticky { position: sticky; left: 0; z-index: 1; min-width: 200px; max-width: 260px; background: #141422; }
.table--matrix thead .mx-sticky, .table--matrix tfoot .mx-sticky { z-index: 3; }
.table--matrix .mx-cell, .table--matrix .mx-day { min-width: 52px; text-align: right; }
.table--matrix .mx-cell { color: var(--text); }
.table--matrix .mx-total { font-weight: 600; background: rgba(255, 255, 255, 0.03); }
.table--matrix tbody tr:hover td { filter: brightness(1.15); }
.chart__value { fill: var(--text); font-size: 10px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart { padding: 8px 0 4px; }

/* --- Экран настройки таблицы ------------------------------------------------ */

.setup-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(360px, 2fr); gap: 16px; align-items: start; }
.setup-left, .setup-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.setup-left .panel, .setup-right .panel { margin: 0; }
.pv-wrap--setup { max-height: 52vh; }
.pv-col-hl { color: #C9C9F7 !important; }
.pv-row-date td { background: rgba(91, 91, 214, 0.12); }
.pv-row-head td { background: rgba(255, 255, 255, 0.05); font-weight: 600; }
.pv-row-acc td { background: rgba(74, 222, 128, 0.07); }
.pv-row-top td { background: rgba(251, 191, 36, 0.08); }
.pv-row-bad td { color: var(--danger); }
.sheet-tab.is-dim { opacity: 0.45; }
.tab-flag { display: inline-block; margin-left: 6px; color: #FCD34D; font-weight: 700; }
.stats--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 12px; }
.stats--5.stats--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat--sm { padding: 8px 10px; }
.stat--sm .stat__value { font-size: 16px; }
.trial-warnings { margin-bottom: 10px; }
.chat-panel { display: flex; flex-direction: column; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 48vh; min-height: 160px; overflow-y: auto; padding: 4px 2px; margin-bottom: 10px; }
.msg { max-width: 92%; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg--assistant { align-self: flex-start; background: var(--input-bg); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg--user { align-self: flex-end; background: rgba(91, 91, 214, 0.18); border: 1px solid rgba(91, 91, 214, 0.35); border-bottom-right-radius: 4px; }
.msg--typing { color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.msg__patch { margin-top: 8px; font-size: 12px; }
.msg__patch summary { color: #C9C9F7; cursor: pointer; }
.msg__patch pre { margin: 6px 0 0; padding: 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.3); font-size: 11px; max-height: 220px; overflow: auto; white-space: pre-wrap; }
.chat__form { display: flex; flex-direction: column; gap: 8px; }
.manual-form { margin-top: 12px; }
.cols-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cols-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.col-field { display: flex; flex-direction: column; gap: 4px; }
.status-word { min-width: 120px; font-weight: 600; }
.status-word--new { color: #FCD34D; }
#mf-json { height: 220px; font-size: 12px; }

/* --- Текстовые страницы (политика конфиденциальности) ------------------ */

.page--doc { justify-content: flex-start; padding-top: 48px; padding-bottom: 64px; }
.card.doc { max-width: 760px; padding: 32px 40px 40px; }
.doc__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.doc__head .seg__btn { text-decoration: none; }
.doc__section { scroll-margin-top: 24px; }
.doc__title { font-size: 30px; }
.doc__meta { margin: 8px 0 24px; color: var(--text-muted); font-size: 13px; }
.doc h2 { margin: 28px 0 8px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.doc p, .doc li { color: #C9C9D6; font-size: 15px; line-height: 1.7; }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-left: 22px; }
.doc li { margin-bottom: 4px; }
.doc strong { color: var(--text); font-weight: 600; }
.doc__sep { margin: 40px 0; border: 0; border-top: 1px solid var(--border); }
.page-footer-link { margin-top: 20px; color: var(--text-muted); font-size: 13px; text-decoration: none; }
.page-footer-link:hover { color: var(--text); }

/* --- Адаптив ------------------------------------------------------------ */

@media (max-width: 1180px) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters .search { grid-column: 1 / -1; }
  .cr-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 280ms var(--ease);
    box-shadow: none;
  }
  .sidebar.is-open { transform: none; box-shadow: 24px 0 64px rgba(0, 0, 0, 0.6); }
  .sidebar.is-open + .sidebar-overlay { opacity: 1; pointer-events: auto; }
  .app-main { margin-left: 0; }
  .mobile-bar { display: flex; }
  .content { padding: 20px 16px 48px; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile__body { padding: 10px; }
  .tile__actions { padding: 0 10px 10px; gap: 4px; }
  .tile__actions .btn { padding: 0 6px; font-size: 12px; gap: 4px; }
  .tile__id { font-size: 15px; }
  .page-title { font-size: 22px; }
  .cr-id__value { font-size: 32px; }
  .steps__name { display: none; }
  .stats--4 .stat__value, .stats--3 .stat__value { font-size: 15px; white-space: nowrap; }
  .setup-grid { grid-template-columns: 1fr; }
  .stats--5, .stats--5.stats--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-grid, .cols-grid--4, .cols-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats--4 { grid-template-columns: 1fr 1fr; }
  .sheet-card__nums { grid-template-columns: 1fr 1fr; }
  .status-grid, .field-row { grid-template-columns: 1fr; }
  .filters--accounts, .filters--agencies { grid-template-columns: 1fr 1fr; }
  .filters--accounts .search { grid-column: 1 / -1; }
  .history__item { flex-direction: column; gap: 2px; }
  .table--agencies .ag-sheets { grid-column: 1 / -1; }
  .table--agencies td:nth-child(4), .table--agencies td:nth-child(5) { display: none; }
  .table--agencies thead { display: none; }
  .table--agencies tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table--agencies tr:last-child { border-bottom: 0; }
  .table--agencies td { display: block; padding: 0; border: 0; min-width: 0; }
  .table--agencies .ag-name { font-weight: 600; }
  .table--agencies .row-actions { grid-column: 2; grid-row: 1; }
  .table--agencies .ag-file { grid-column: 1 / -1; max-width: none; }
  .hide-sm { display: none; }
  .picker__bar { grid-template-columns: 1fr 1fr; }
  .picker__bar .search { grid-column: 1 / -1; }
  .filters--links { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr 1fr; }
  .stat__value { font-size: 18px; }
  /* Таблица ссылок на телефоне — карточками. */
  .table--links thead { display: none; }
  .table--links tr {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 8px 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
  }
  .table--links tr:last-child { border-bottom: 0; }
  .table--links td { display: block; padding: 0; border: 0; }
  .table--links .link-cell { grid-column: 1 / -1; max-width: none; }
  .table--links td:nth-child(5), .table--links td:nth-child(6) { display: none; }
  .table--links .link-cell { order: 0; }
  .table--links .geo-cell { order: 1; grid-column: 1 / -1; min-width: 0; }
  .table--links td:nth-child(2) { order: 2; }
  .table--links .pixel-cell { order: 3; }
  .table--links .used-cell { order: 4; }
  .table--links .row-actions { order: 5; }
  .table--links tr { grid-template-columns: auto auto auto 1fr; }

  /* Таблица пикселей на телефоне — карточками. */
  .table--pixels thead { display: none; }
  .table--pixels tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
  }
  .table--pixels tr:last-child { border-bottom: 0; }
  .table--pixels td { display: block; padding: 0; border: 0; min-width: 0; }
  .table--pixels .px-name { grid-column: 1 / 3; font-weight: 600; }
  .table--pixels .row-actions { grid-column: 3; grid-row: 1; }
  .table--pixels .px-id, .table--pixels .px-token { grid-column: 1 / -1; }
  .table--pixels td:nth-child(6), .table--pixels td:nth-child(7) { display: none; }
  .table--pixels .used-cell { color: var(--text-muted); font-size: 13px; }
  .table--pixels .used-cell::before { content: attr(data-label) " "; }
  .kv--wide { grid-template-columns: 1fr; }
  .table--links .used-cell { color: var(--text-muted); font-size: 13px; }
  .table--links .used-cell::before { content: attr(data-label) " "; }
  .table--links .row-actions { justify-self: end; }
  .kv { grid-template-columns: 1fr; gap: 6px; }
  .kv__k:not(:first-child) { margin-top: 10px; }
  .cr-head { margin-bottom: 16px; }
  .panel { padding: 16px; }
  .list-bar .select { min-width: 0; flex: 1; }
  .list-bar > .row:last-child { width: 100%; flex-wrap: nowrap; }
  .wizard__nav .btn { flex: 1; min-width: 0; }
  .media-grid, .files { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .select { height: 44px; font-size: 16px; }
  .input--sm { height: 44px; font-size: 16px; }
  .btn--sm { height: 40px; }
  .btn--icon.btn--sm { width: 40px; }
}

@media (max-width: 480px) {
  .card.doc { padding: 24px 20px 28px; }
  .doc__title { font-size: 24px; }
  .card { padding: 32px 20px 24px; }
  .title { font-size: 28px; }
  .backdrop__line { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* --- Задачи ------------------------------------------------------------------ */
.tasks-toolbar { margin-bottom: 16px; justify-content: space-between; }
.filters--tasks { margin-bottom: 16px; }

.task-group { margin-bottom: 20px; }
.task-group__title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 8px; }
.task-group--overdue .task-group__title { color: var(--red, #F87171); }

.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--panel, rgba(255, 255, 255, 0.03)); border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 12px; cursor: pointer; margin-bottom: 8px;
}
.task-group .task-row:last-child { margin-bottom: 0; }
.task-row:hover { border-color: rgba(255, 255, 255, 0.18); }
.task-row.is-overdue { border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.05); }
.task-row__main { flex: 1; min-width: 0; }
.task-row__title { color: var(--text); text-decoration: none; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row__title:hover { text-decoration: underline; }
.task-row__meta { margin-top: 4px; gap: 10px; }

.task-check {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: transparent; color: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.task-check svg { width: 14px; height: 14px; }
.task-check:hover { border-color: var(--green, #34D399); color: rgba(52, 211, 153, 0.7); }
.task-check.is-done { background: var(--green, #34D399); border-color: var(--green, #34D399); color: #06281C; }

.task-due { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.task-due.is-overdue { color: #F87171; font-weight: 600; }
.task-comments { display: inline-flex; align-items: center; gap: 4px; }
.task-comments svg { width: 13px; height: 13px; }
.task-row.is-high .task-row__title::before, .task-card.is-high .task-card__title::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #F87171; margin-right: 7px; vertical-align: 1px;
}

/* Доска */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.board__col { background: rgba(255, 255, 255, 0.025); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 14px; padding: 12px; min-height: 180px; }
.board__col.is-over { border-color: var(--accent, #5B5BD6); background: rgba(91, 91, 214, 0.07); }
.board__title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; }
.board__body { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.task-card {
  background: var(--panel, rgba(255, 255, 255, 0.04)); border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px; padding: 10px 12px; cursor: grab;
}
.task-card.is-dragging { opacity: 0.45; }
.task-card.is-overdue { border-color: rgba(248, 113, 113, 0.45); }
.task-card__title { color: var(--text); text-decoration: none; font-weight: 600; display: block; }
.task-card__title:hover { text-decoration: underline; }
.task-card__meta { margin-top: 6px; gap: 8px; }

/* Выбор креативов в окне задачи */
.stack-sm { display: flex; flex-direction: column; gap: 8px; position: relative; }
.picker-chips:empty { display: none; }
.picker-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30; margin-top: 4px; max-height: 240px; overflow: auto;
  background: var(--panel-solid, #15151F); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 10px; padding: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.picker-item { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: transparent; color: var(--text); border-radius: 8px; cursor: pointer; }
.picker-item:hover { background: rgba(91, 91, 214, 0.18); }
.picker-item__snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-empty { padding: 8px 10px; }

/* Карточка задачи */
.task-title { margin: 10px 0 6px; }
.task-desc { white-space: pre-wrap; }
.text-red { color: #F87171; }
.launch-files { display: flex; flex-direction: column; gap: 8px; }
.launch-file { display: flex; align-items: center; gap: 12px; }
.launch-file .thumb, .launch-file .thumb-empty { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; }
.launch-file__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.launch-file__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.launch__value { min-width: 0; }
.combo__option.is-disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 860px) {
  .board { grid-template-columns: 1fr; }
}

/* --- План месяца -------------------------------------------------------------- */
.rotate-180 svg { transform: rotate(180deg); }
.plan-form { max-width: 640px; }
.profit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.profit-day { display: flex; flex-direction: column; gap: 4px; }
.profit-day__num { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.profit-day.is-today .profit-day__num { color: var(--accent, #7C7CF0); font-weight: 700; }
.profit-input.is-today { border-color: var(--accent, #5B5BD6); }
.profit-input.is-neg { color: #F87171; }
.profit-total.is-pos { color: #34D399; }
.profit-total.is-neg { color: #F87171; }
.nav__badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: #EF4444; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.sheet-topup { margin-top: 10px; }

/* --- Дашборд ------------------------------------------------------------------- */
.stats--6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.stats--7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.stat__value--red { color: #F87171; }
.dash-chart-box { overflow-x: auto; }
.dash-chart { width: 100%; min-width: 640px; display: block; }
.dash-chart__grid { stroke: rgba(255, 255, 255, 0.07); }
.dash-chart__label { fill: var(--muted); font-size: 10px; }
.dash-chart__label--pace { fill: #F59E0B; }
.dash-chart__pace { stroke: #F59E0B; stroke-dasharray: 5 4; stroke-width: 1.5; }
.dash-chart__day { cursor: pointer; }
.dash-chart__day:hover rect { opacity: 0.85; }
.dash-bar--spend { fill: #7C7CF0; }
.dash-bar--profit { fill: #34D399; }
.dash-bar--loss { fill: #F87171; }
.dash-legend { margin-top: 10px; gap: 14px; }
.dash-legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dash-legend__dot { width: 10px; height: 10px; border-radius: 3px; background: var(--dot, #7C7CF0); }
.day-detail { margin-top: 12px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 10px 14px; }
.day-detail__list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; max-width: 420px; }
.day-detail__row { display: flex; justify-content: space-between; gap: 16px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.dash-grid .panel { margin: 0; }
.dash-topup { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.dash-warning { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; min-width: 0; }
.dash-warning__msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.dash-quick { gap: 8px; }
.dash-quick .input { width: 180px; }
@media (max-width: 1100px) {
  .stats--6, .stats--7 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .dash-grid { grid-template-columns: 1fr; }
  .stats--6, .stats--7 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
