/* Telset — админка и витрина. Палитра и привычки дашборда Control Center (проект mt-expert):
   панели — тонкая линия и крупный радиус, а не заливка с тенью; заголовки тихие, громкие —
   цифры; цифры всегда табличные; цвет результата — это смысл (рост/падение/внимание). */

:root, [data-theme="dark"] {
  --cc-void: #070b18;
  --cc-base: #0a1024;
  --cc-panel: #101836;
  --cc-inset: #080d1e;
  --cc-hover: #1d2853;
  --cc-line-soft: #1a2447;
  --cc-line: #26325e;
  --cc-line-strong: #36457e;
  --cc-text-hi: #f0f4ff;
  --cc-text: #c3cbe6;
  --cc-text-dim: #8b95bb;
  --cc-text-faint: #7a84ad;
  --cc-accent: #3b6ef6;
  --cc-accent-hot: #6d92ff;
  --cc-up: #35d6a0;
  --cc-up-fill: #0f7a55;
  --cc-down: #ff4d6d;
  --cc-down-fill: #c11c3c;
  --cc-warn: #ffa53d;
  --cc-info: #7b8cff;
  --cc-band: rgb(255 255 255 / 0.028);
  --cc-halo: rgb(59 110 246 / 0.10);
  --cc-shadow: 0 18px 44px rgb(0 0 0 / 0.55);
  /* категории (платформы): проверены валидатором, в т.ч. на различимость для дальтоников */
  --cat-1: #3b6ef6; --cat-2: #1da67a; --cat-3: #d47610; --cat-4: #9a6cf0;
  color-scheme: dark;
}
[data-theme="light"] {
  --cc-void: #eef1f8;
  --cc-base: #ffffff;
  --cc-panel: #ffffff;
  --cc-inset: #eef1f7;
  --cc-hover: #eff3fb;
  --cc-line-soft: #e4e9f2;
  --cc-line: #d3dae8;
  --cc-line-strong: #b6c1d6;
  --cc-text-hi: #0f172a;
  --cc-text: #35405a;
  --cc-text-dim: #5b6683;
  --cc-text-faint: #67718c;
  --cc-accent: #3b6ef6;
  --cc-accent-hot: #2450cc;
  --cc-up: #0f9d6e;
  --cc-down: #dc2f43;
  --cc-warn: #d97706;
  --cc-info: #5b68d8;
  --cc-band: rgb(15 23 42 / 0.022);
  --cc-halo: rgb(59 110 246 / 0.07);
  --cc-shadow: 0 18px 44px rgb(15 23 42 / 0.16);
  --cat-1: #3b6ef6; --cat-2: #0f9d6e; --cat-3: #d97706; --cat-4: #8b5cf6;
  color-scheme: light;
}
:root {
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --fast: 160ms; --med: 420ms; --out: cubic-bezier(0.22, 1, 0.36, 1);
  --side-w: 236px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--cc-void); }
[hidden] { display: none !important; }
body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--cc-text);
  background:
    radial-gradient(1200px 500px at 50% -10%, var(--cc-halo), transparent 70%),
    linear-gradient(180deg, var(--cc-base), var(--cc-void) 900px);
  background-repeat: no-repeat;
  background-color: var(--cc-void);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cc-accent-hot); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 600; color: var(--cc-text-hi); letter-spacing: -0.02em; margin: 0 0 4px; }
h2 { font-size: 15px; font-weight: 600; color: var(--cc-text-hi); letter-spacing: -0.01em; margin: 0 0 12px; }
h3 { font-size: 13.5px; font-weight: 600; color: var(--cc-text-hi); margin: 0 0 8px; }
p { margin: 0 0 10px; }
strong, b { color: var(--cc-text-hi); font-weight: 600; }
:focus-visible { outline: 2px solid var(--cc-accent); outline-offset: 2px; border-radius: 6px; }
.num, td, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.muted { color: var(--cc-text-dim); }
.faint { color: var(--cc-text-faint); }
.small { font-size: 12px; }
.r { text-align: right; }
.sp { height: 16px; }
.spacer { flex: 1; }
.up { color: var(--cc-up); } .down { color: var(--cc-down); } .warnc { color: var(--cc-warn); }

/* ------------------------------------------------------------- каркас */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 12px;
  border-right: 1px solid var(--cc-line-soft);
  background: color-mix(in srgb, var(--cc-base) 70%, transparent);
  backdrop-filter: blur(8px);
  z-index: 30;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; color: var(--cc-text-hi); }
.logo .mark {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--cc-accent); color: #fff; font-weight: 700; font-size: 15px;
}
.logo .name { font-weight: 600; font-size: 14.5px; line-height: 1.2; }
.logo .sub { font-size: 11.5px; color: var(--cc-text-faint); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--r-md);
  color: var(--cc-text-dim); font-weight: 500; font-size: 13.5px;
  transition: background var(--fast) var(--out), color var(--fast) var(--out);
}
.nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover { background: var(--cc-hover); color: var(--cc-text-hi); text-decoration: none; }
.nav a.active { background: var(--cc-hover); color: var(--cc-text-hi); }
.nav a.active svg { stroke: var(--cc-accent-hot); }
.nav .badge { margin-left: auto; font-size: 11px; color: var(--cc-up); }
.side .foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 2px; }
.side .who { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md); border: 1px solid var(--cc-line-soft); }
.side .who .ava { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--cc-inset); color: var(--cc-text-hi); font-weight: 600; font-size: 12.5px; }
.side .who .nm { font-size: 13px; color: var(--cc-text-hi); font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--cc-line-soft);
  background: color-mix(in srgb, var(--cc-base) 72%, transparent);
  backdrop-filter: blur(8px);
}
.topbar .crumb { font-size: 13px; color: var(--cc-text-dim); }
.topbar .crumb b { color: var(--cc-text-hi); }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .lead { color: var(--cc-text-dim); font-size: 13px; margin: 0; }

/* Свёрнутое меню (кнопка в верхней панели): узкая полоса с иконками, подписи — в подсказках. */
.shell { transition: grid-template-columns var(--med) var(--out); }
html.side-mini .shell { grid-template-columns: 68px 1fr; }
html.side-mini .side { padding: 18px 10px; align-items: center; }
html.side-mini .side .tx { display: none; }
html.side-mini .logo { padding: 4px 0 16px; justify-content: center; }
html.side-mini .nav { width: 100%; }
html.side-mini .nav a { justify-content: center; padding: 10px 0; }
html.side-mini .side .foot { width: 100%; padding: 0; }
html.side-mini .side .who { flex-direction: column; gap: 6px; padding: 8px 0; border: none; }

/* ------------------------------------------------------------- элементы */
.card {
  background: var(--cc-panel);
  border: 1px solid var(--cc-line-soft);
  border-radius: 14px;
  padding: 18px 20px;
  min-width: 0;
}
.card.flush { padding: 0; overflow: auto; }
.card > h2:first-child { margin-top: 0; }
.card .card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card .card-head h2 { margin: 0; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 200px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--cc-line);
  background: var(--cc-inset);
  color: var(--cc-text-hi);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background var(--fast) var(--out), border-color var(--fast) var(--out);
}
.btn:hover { background: var(--cc-hover); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.primary { background: var(--cc-accent); border-color: var(--cc-accent); color: #fff; }
.btn.primary:hover { background: var(--cc-accent-hot); border-color: var(--cc-accent-hot); }
.btn.danger { background: transparent; border-color: color-mix(in srgb, var(--cc-down) 45%, transparent); color: var(--cc-down); }
.btn.danger:hover { background: color-mix(in srgb, var(--cc-down) 12%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--cc-text-dim); }
.btn.ghost:hover { background: var(--cc-hover); color: var(--cc-text-hi); }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.sm { width: 30px; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field label, label.lbl { font-size: 12px; color: var(--cc-text-dim); font-weight: 500; }
input, select, textarea {
  font: inherit; font-size: 13.5px;
  color: var(--cc-text-hi);
  background: var(--cc-inset);
  border: 1px solid var(--cc-line-soft);
  border-radius: var(--r-md);
  padding: 9px 12px;
  width: 100%;
  transition: border-color var(--fast) var(--out);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cc-accent); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--cc-accent); padding: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cc-text); cursor: pointer; padding: 6px 0; }
select.btn { height: 30px; padding: 0 28px 0 10px; width: auto; }

/* Плашки статусов: тонированная подложка и цветной текст, без насыщенной заливки. */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  color: var(--cc-text-dim);
  background: color-mix(in srgb, var(--cc-text-dim) 12%, transparent);
}
.pill.ok { color: var(--cc-up); background: color-mix(in srgb, var(--cc-up) 13%, transparent); }
.pill.bad { color: var(--cc-down); background: color-mix(in srgb, var(--cc-down) 13%, transparent); }
.pill.warn { color: var(--cc-warn); background: color-mix(in srgb, var(--cc-warn) 13%, transparent); }
.pill.info { color: var(--cc-accent-hot); background: color-mix(in srgb, var(--cc-accent) 15%, transparent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--cc-text-faint); flex: none; }
.dot.on { background: var(--cc-up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cc-up) 22%, transparent); }

.flash {
  padding: 11px 14px; border-radius: var(--r-md);
  border: 1px solid var(--cc-line-soft); background: var(--cc-inset);
  font-size: 13px; color: var(--cc-text);
}
.flash.ok { border-color: color-mix(in srgb, var(--cc-up) 35%, transparent); background: color-mix(in srgb, var(--cc-up) 9%, transparent); color: var(--cc-text-hi); }
.flash.warn { border-color: color-mix(in srgb, var(--cc-warn) 35%, transparent); background: color-mix(in srgb, var(--cc-warn) 9%, transparent); color: var(--cc-text-hi); }
.flash.bad { border-color: color-mix(in srgb, var(--cc-down) 35%, transparent); background: color-mix(in srgb, var(--cc-down) 9%, transparent); color: var(--cc-text-hi); }

/* Таблицы: тихая шапка, строки через тонкую линию. */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  color: var(--cc-text-faint); padding: 10px 12px; border-bottom: 1px solid var(--cc-line-soft); white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--cc-line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--fast) var(--out); }
tbody tr:hover { background: var(--cc-hover); }
tr.link { cursor: pointer; }
.card.flush table th:first-child, .card.flush table td:first-child { padding-left: 20px; }
.card.flush table th:last-child, .card.flush table td:last-child { padding-right: 20px; }
.empty { padding: 36px 20px; text-align: center; color: var(--cc-text-dim); }
.empty h3 { margin-bottom: 4px; }

/* Сегментированный переключатель (период, фильтры). */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px; background: var(--cc-inset); border: 1px solid var(--cc-line-soft); }
.seg a, .seg button {
  font: inherit; font-size: 12.5px; font-weight: 500; color: var(--cc-text-dim);
  padding: 5px 12px; border-radius: 8px; border: none; background: none; cursor: pointer;
}
.seg a:hover, .seg button:hover { background: var(--cc-hover); color: var(--cc-text-hi); text-decoration: none; }
.seg .on { background: var(--cc-accent); color: #fff; }
.seg .on:hover { background: var(--cc-accent); color: #fff; }

/* Модальные окна. */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: flex-start; justify-content: center;
  padding: 6vh 16px; overflow-y: auto;
  background: rgb(3 6 16 / 0.62);
  backdrop-filter: blur(3px);
}
.modal.open { display: flex; animation: fade var(--fast) var(--out); }
.modal .box {
  width: min(640px, 100%);
  background: var(--cc-panel); border: 1px solid var(--cc-line);
  border-radius: var(--r-lg); padding: 22px 24px;
  box-shadow: var(--cc-shadow);
  animation: rise var(--med) var(--out);
}
.modal .box.wide { width: min(860px, 100%); }
.modal h2 { font-size: 17px; margin-bottom: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.toast-wrap { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  padding: 11px 16px; border-radius: var(--r-md);
  background: var(--cc-panel); border: 1px solid var(--cc-line); color: var(--cc-text-hi);
  box-shadow: var(--cc-shadow); font-size: 13px; max-width: 360px;
  animation: rise var(--med) var(--out);
}

/* Ключ — значение (карточки устройства, выпуска). */
.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 0; }
.kv > div { padding: 9px 0; border-bottom: 1px solid var(--cc-line-soft); min-width: 0; overflow-wrap: anywhere; }
.kv > div:nth-last-child(-n+2) { border-bottom: none; }
.kv .k { color: var(--cc-text-dim); font-size: 12.5px; }
.kv .v { color: var(--cc-text-hi); }

/* Горизонтальные полосы распределения (версии, модели, ОС). */
.dist { display: flex; flex-direction: column; gap: 7px; }
.dist .ln { display: grid; grid-template-columns: minmax(70px, 38%) 1fr 44px; align-items: center; gap: 10px; font-size: 12.5px; }
.dist .nm { color: var(--cc-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist .tr { display: block; height: 6px; border-radius: 3px; background: var(--cc-inset); overflow: hidden; }
.dist .fl { display: block; height: 100%; border-radius: 3px; background: var(--cc-accent); }
.dist .ct { text-align: right; color: var(--cc-text-dim); font-variant-numeric: tabular-nums; }

/* Медиа приложения (иконка и скриншоты) в админке. */
.media-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.media-tile { position: relative; flex: none; border-radius: 12px; overflow: hidden; border: 1px solid var(--cc-line-soft); background: var(--cc-inset); }
.media-tile img { display: block; height: 180px; width: auto; }
.media-tile.icon img { height: 96px; width: 96px; object-fit: cover; }
.media-tile .acts { position: absolute; inset: auto 6px 6px 6px; display: flex; gap: 4px; justify-content: center; opacity: 0; transition: opacity var(--fast) var(--out); }
.media-tile:hover .acts, .media-tile:focus-within .acts { opacity: 1; }
.media-add {
  flex: none; width: 110px; height: 180px; border-radius: 12px;
  border: 1.5px dashed var(--cc-line); color: var(--cc-text-dim);
  display: grid; place-items: center; text-align: center; font-size: 12px; cursor: pointer; padding: 10px;
}
.media-add.icon { width: 96px; height: 96px; }
.media-tile.wide img, .media-add.wide { width: 320px; height: 180px; object-fit: cover; }
.bg-meta { font-size: 12px; color: var(--cc-text-dim); line-height: 1.6; }
.bg-meta .mono { color: var(--cc-text); }
.media-add:hover { border-color: var(--cc-accent); color: var(--cc-text-hi); }
.app-icon { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--cc-inset); border: 1px solid var(--cc-line-soft); flex: none; display: grid; place-items: center; color: var(--cc-text-dim); font-weight: 700; overflow: hidden; }
.app-icon img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------- вход */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .box {
  width: min(380px, 100%);
  background: var(--cc-panel); border: 1px solid var(--cc-line-soft);
  border-radius: var(--r-lg); padding: 28px;
}
.auth .logo { padding: 0 0 22px; }
.auth .tools { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 8px; }

/* ------------------------------------------------------------- адаптив */
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell, html.side-mini .shell { grid-template-columns: 1fr; }
  html.side-mini .side .tx { display: revert; }
  html.side-mini .side { align-items: stretch; padding: 18px 12px; }
  html.side-mini .nav a { justify-content: flex-start; padding: 9px 10px; }
  html.side-mini .logo { justify-content: flex-start; padding: 4px 10px 16px; }
  html.side-mini .side .who { flex-direction: row; border: 1px solid var(--cc-line-soft); padding: 8px; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); transform: translateX(-100%); transition: transform var(--med) var(--out); background: var(--cc-base); }
  .side.open { transform: none; box-shadow: var(--cc-shadow); }
  .burger { display: inline-flex; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .cols-2, .cols-4 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv .k { border-bottom: none !important; padding-bottom: 0; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ======================================================= обзор (Control Center) */
.cc {
  --left-w: 220px; --right-w: 230px;
  position: relative; overflow: hidden;
  border: 1px solid var(--cc-line-soft); border-radius: var(--r-lg);
  background:
    radial-gradient(1200px 500px at 50% -10%, var(--cc-halo), transparent 70%),
    linear-gradient(180deg, var(--cc-base), var(--cc-void));
  font-variant-numeric: tabular-nums;
}
.cc-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--cc-line-soft); }
.cc-toolbar .ttl { font-size: 15px; font-weight: 600; color: var(--cc-text-hi); }
.cc-toolbar .meta { font-size: 12px; color: var(--cc-text-faint); }
.cc-live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--cc-text-dim); }
.cc-stage { position: relative; display: grid; grid-template-columns: var(--left-w) 1fr var(--right-w); min-height: 430px; padding: 0 20px; }
.cc-bands { position: absolute; inset: 0 20px; display: grid; grid-template-columns: var(--left-w) repeat(3, 1fr) var(--right-w); pointer-events: none; }
.cc-bands span { grid-row: 1; background: linear-gradient(180deg, var(--cc-band), transparent 55%); border-left: 1px solid var(--cc-line-soft); opacity: .75; }
.cc-bands span:nth-child(1) { grid-column: 2; } .cc-bands span:nth-child(2) { grid-column: 3; }
.cc-bands span:nth-child(3) { grid-column: 4; border-right: 1px solid var(--cc-line-soft); }

.cc-left { display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 20px 16px 20px 0; z-index: 2; }
.cc-stat { display: flex; align-items: center; gap: 13px; padding: 6px 8px; margin: -6px -8px; border-radius: var(--r-md); color: inherit; }
a.cc-stat:hover { background: var(--cc-hover); text-decoration: none; }
.cc-stat .ic { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--cc-inset); border: 1px solid var(--cc-line-soft); color: var(--cc-text-dim); }
.cc-stat .ic svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cc-stat .ic.on { background: var(--cc-accent); border-color: var(--cc-accent); color: #fff; }
.cc-stat .lb { font-size: 12px; color: var(--cc-text-dim); }
.cc-stat .vl { font-size: 20px; font-weight: 600; color: var(--cc-text-hi); line-height: 1.15; }
.cc-stat .sb { font-size: 11px; color: var(--cc-text-faint); }

.cc-centre { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 26px 0; min-width: 0; z-index: 2; }
.cc-groups { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; align-items: start; }
.cc-group { display: flex; flex-direction: column; align-items: center; gap: 18px; min-width: 0; padding: 0 6px; }
.cc-group h3 { margin: 0; font-size: 11.5px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--cc-text-dim); text-align: center; }
.cc-rings { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.ring { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; animation: ring-up var(--med) var(--out) both; }
.ring .box { position: relative; display: grid; place-items: center; }
.ring .box svg { display: block; }
.ring .track { stroke: var(--cc-line-soft); }
.ring .arc { transition: stroke-dashoffset 900ms var(--out); }
.ring .glyph { position: absolute; display: grid; place-items: center; }
.ring .glyph svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ring .val { font-size: 16px; font-weight: 600; color: var(--cc-text-hi); line-height: 1.1; }
.ring .lab { font-size: 11.5px; color: var(--cc-text-dim); text-align: center; max-width: 104px; overflow-wrap: anywhere; hyphens: auto; }
.ring .sub { font-size: 10.5px; color: var(--cc-text-faint); }
@keyframes ring-up { from { opacity: 0; transform: translateY(6px); } }
.cc-hero { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 14px; }
.cc-hero .v { font-size: 30px; font-weight: 600; color: var(--cc-text-hi); line-height: 1.1; letter-spacing: -0.02em; }
.cc-hero .l { font-size: 12px; color: var(--cc-text-dim); }
.cc-hero .d { font-size: 11.5px; color: var(--cc-up); }

.cc-right { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 20px 0 20px 18px; z-index: 2; min-width: 0; }
.cc-right h4 { margin: 0 0 6px; font-size: 12px; font-weight: 500; color: var(--cc-text-dim); }
.cc-rail { position: relative; display: flex; flex-direction: column; gap: 2px; padding-left: 16px; }
.cc-rail::before { content: ""; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 1px; background: linear-gradient(180deg, transparent, var(--cc-line), transparent); }
.cc-dev { position: relative; display: block; padding: 6px 8px; border-radius: var(--r-sm); color: inherit; animation: ring-up var(--med) var(--out) both; }
.cc-dev:hover { background: var(--cc-hover); text-decoration: none; }
.cc-dev::before { content: ""; position: absolute; left: -16px; top: 13px; width: 9px; height: 9px; border-radius: 50%; background: var(--cc-base); border: 2px solid var(--cc-line-strong); }
.cc-dev.on::before { background: var(--cc-up); border-color: var(--cc-up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cc-up) 20%, transparent); }
.cc-dev .m { font-size: 13.5px; font-weight: 600; color: var(--cc-text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-dev .s { font-size: 11.5px; color: var(--cc-text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-dev .t { font-size: 11px; color: var(--cc-text-faint); }
.cc-dev.on .t { color: var(--cc-up); }
.cc-empty { font-size: 12px; color: var(--cc-text-faint); padding: 6px 0; }

.cc-strip { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 26px; padding: 16px 20px 18px; border-top: 1px solid var(--cc-line-soft); }
.cc-strip h4 { margin: 0 0 8px; font-size: 12.5px; font-weight: 500; color: var(--cc-text-dim); }
.cc-inv { display: flex; flex-wrap: wrap; gap: 8px 0; }
.cc-inv > div { display: flex; flex-direction: column; gap: 1px; padding: 0 12px; border-left: 1px solid var(--cc-line-soft); min-width: 0; }
.cc-inv > div:first-child { padding-left: 0; border-left: none; }
.cc-inv .v { font-size: 13.5px; font-weight: 600; color: var(--cc-text-hi); }
.cc-inv .l { font-size: 11px; color: var(--cc-text-faint); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.cc-inv .sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.cc-spark { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 46px; margin-top: 12px; }
.cc-spark i { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; background: var(--cc-accent); opacity: .85; transition: opacity var(--fast) var(--out); }
.cc-spark i.z { background: var(--cc-line); height: 2px !important; opacity: 1; }
.cc-spark i:hover { opacity: 1; filter: brightness(1.2); }
.cc-axis { height: 1px; background: var(--cc-line); }
.cc-axis-l { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--cc-text-faint); margin-top: 4px; }
.cc-big { display: flex; align-items: baseline; gap: 8px; }
.cc-big .v { font-size: 22px; font-weight: 600; color: var(--cc-text-hi); }
.cc-big .l { font-size: 11.5px; color: var(--cc-text-faint); }
.cc-chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cc-chip { display: flex; flex-direction: column; gap: 1px; padding: 4px 10px; border-left: 3px solid var(--chip); background: color-mix(in srgb, var(--chip) 10%, transparent); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.cc-chip .v { font-size: 12.5px; font-weight: 600; color: var(--cc-text-hi); }
.cc-chip .l { font-size: 11px; color: var(--cc-text-dim); }
.tip { position: fixed; z-index: 300; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: var(--cc-panel); border: 1px solid var(--cc-line); box-shadow: var(--cc-shadow); font-size: 12px; color: var(--cc-text-hi); white-space: nowrap; opacity: 0; transition: opacity 100ms; }
.tip.show { opacity: 1; }
.tip .k { color: var(--cc-text-dim); }

@media (max-width: 1240px) {
  .cc-stage { grid-template-columns: 1fr; padding: 0 16px; }
  .cc-bands { display: none; }
  .cc-left { flex-direction: row; flex-wrap: wrap; gap: 14px 22px; padding: 18px 0 4px; }
  .cc-right { padding: 4px 0 18px; }
  .cc-strip { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 640px) { .cc-groups { grid-template-columns: 1fr; gap: 22px; } }

/* карточка устройства: кнопки сеанса поддержки отступают от плашки статуса */
#support-actions { margin-top: 12px; }

/* ======================================================= диалоги (ui.confirm / ui.form) */
.dlg { position: fixed; inset: 0; z-index: 150; display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 24px; background: rgb(3 6 16 / 0.62); backdrop-filter: blur(4px); animation: fade var(--fast) var(--out); }
.dlg-box { width: min(460px, 100%); background: var(--cc-panel); border: 1px solid var(--cc-line);
  border-radius: 18px; box-shadow: var(--cc-shadow); animation: rise var(--med) var(--out); overflow: hidden; }
.dlg-head { display: flex; gap: 14px; align-items: flex-start; padding: 22px 22px 0; }
.dlg-ic { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center;
  color: var(--cc-accent-hot); background: color-mix(in srgb, var(--cc-accent) 14%, transparent); }
.dlg-ic svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dlg.danger .dlg-ic { color: var(--cc-down); background: color-mix(in srgb, var(--cc-down) 13%, transparent); }
.dlg-title { font-size: 17px; font-weight: 600; color: var(--cc-text-hi); margin: 2px 0 4px; letter-spacing: -0.01em; }
.dlg-lead { white-space: pre-line; font-size: 13.5px; color: var(--cc-text-dim); line-height: 1.5; margin: 0; }
.dlg-body { padding: 18px 22px 4px; }
.dlg-body .field:last-child { margin-bottom: 8px; }
.dlg-body textarea { min-height: 110px; }
.dlg-opt { font-weight: 400; color: var(--cc-text-faint); }
.dlg-count { align-self: flex-end; font-size: 11.5px; color: var(--cc-text-faint); font-variant-numeric: tabular-nums; margin-top: -2px; }
.dlg-pw { position: relative; }
.dlg-pw input { padding-right: 44px; }
.dlg-pw button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.dlg-note { display: flex; gap: 9px; align-items: flex-start; margin: 4px 0 6px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--cc-inset); border: 1px solid var(--cc-line-soft); font-size: 12.5px; color: var(--cc-text-dim); }
.dlg-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; }
.dlg-foot .btn { min-width: 108px; }
.dlg.danger .dlg-foot .btn.primary { background: var(--cc-down-fill); border-color: var(--cc-down-fill); }
.dlg.danger .dlg-foot .btn.primary:hover { filter: brightness(1.12); }
.dlg-err { color: var(--cc-down); font-size: 12.5px; margin: 0 0 6px; }
@media (max-width: 560px) { .dlg { align-items: flex-end; padding: 0; } .dlg-box { border-radius: 18px 18px 0 0; width: 100%; } .dlg-foot .btn { flex: 1; } }

/* узкий экран: таблица прокручивается внутри своей карточки, страница не расползается вбок */
@media (max-width: 860px) {
  .card table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card table td, .card table th { white-space: nowrap; }
  .main, .content { min-width: 0; max-width: 100vw; }
}

/* ======================================================= алерты в стиле SweetAlert2 */
.dlg.swal { align-items: center; padding: 16px; }
.dlg.swal .dlg-box { width: min(440px, 100%); padding: 30px 26px 24px; text-align: center; animation: swal-in 300ms cubic-bezier(.2,1.3,.4,1) both; }
@keyframes swal-in { from { opacity: 0; transform: scale(.72); } 60% { opacity: 1; } to { transform: scale(1); } }
.swal-title { font-size: 21px; font-weight: 600; color: var(--cc-text-hi); margin: 18px 0 8px; letter-spacing: -0.01em; }
.swal-text { white-space: pre-line; font-size: 14.5px; color: var(--cc-text-dim); line-height: 1.55; margin: 0 auto; max-width: 36ch; }
.swal-acts { display: flex; justify-content: center; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.swal-acts .btn { min-width: 120px; height: 42px; border-radius: 11px; font-size: 14px; }
.dlg.swal.danger .swal-acts .btn.primary { background: var(--cc-down-fill); border-color: var(--cc-down-fill); }

/* иконка: кольцо + знак, как у swal2 (кольцо и знак прорисовываются) */
.swal-icon { --c: var(--cc-accent); display: block; width: 84px; height: 84px; margin: 0 auto; position: relative; }
.swal-icon svg { width: 100%; height: 100%; overflow: visible; }
.swal-icon .ring { fill: color-mix(in srgb, var(--c) 9%, transparent); stroke: color-mix(in srgb, var(--c) 35%, transparent); stroke-width: 3.2; }
.swal-icon .arc { fill: none; stroke: var(--c); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 264; stroke-dashoffset: 264;
  transform: rotate(-90deg); transform-origin: 50% 50%; animation: swal-ring 600ms var(--out) 80ms forwards; }
.swal-icon .mark { fill: none; stroke: var(--c); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 80; stroke-dashoffset: 80; animation: swal-mark 380ms var(--out) 520ms forwards; }
.swal-icon .dot { fill: var(--c); opacity: 0; animation: swal-dot 200ms ease 760ms forwards; }
@keyframes swal-ring { to { stroke-dashoffset: 0; } }
@keyframes swal-mark { to { stroke-dashoffset: 0; } }
@keyframes swal-dot { to { opacity: 1; } }
.swal-icon.success { --c: var(--cc-up); }
.swal-icon.error { --c: var(--cc-down); }
.swal-icon.error { animation: swal-shake 420ms ease 520ms; }
.swal-icon.warning { --c: var(--cc-warn); }
.swal-icon.info { --c: var(--cc-accent-hot); }
.swal-icon.question { --c: var(--cc-info); }
@keyframes swal-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* тосты: правый верхний угол, иконка, полоска таймера */
.toast-wrap { top: 18px; right: 18px; bottom: auto; gap: 10px; }
.toast {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 11px;
  min-width: 260px; max-width: 380px; padding: 12px 16px 14px 12px; border-radius: 13px;
  animation: toast-in 320ms cubic-bezier(.2,1.3,.4,1) both;
}
.toast.out { animation: toast-out 220ms ease forwards; }
.toast .t-ic { width: 30px; height: 30px; flex: none; }
.toast .t-ic .swal-icon { width: 30px; height: 30px; }
.toast .t-ic .swal-icon .ring, .toast .t-ic .swal-icon .arc { stroke-width: 6; }
.toast .t-ic .swal-icon .mark { stroke-width: 9; }
.toast .t-tx { font-size: 13.5px; color: var(--cc-text-hi); line-height: 1.4; }
.toast .t-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--c, var(--cc-accent)); opacity: .7; animation: toast-bar linear forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }
@keyframes toast-bar { from { width: 100%; } to { width: 0; } }
@media (max-width: 560px) { .toast-wrap { left: 12px; right: 12px; top: 12px; } .toast { max-width: none; } .dlg.swal { align-items: center; padding: 16px; } .dlg.swal .dlg-box { border-radius: 18px; } }

/* ---- пагинация таблиц ---- */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 8px 2px; }
.pager .pg-lab { font-size: 13px; color: var(--cc-text-dim); min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.pager .btn[disabled] { opacity: .4; cursor: default; }

/* ---- панель снимков экрана ---- */
.shot-panel { margin-top: 14px; border: 1px solid var(--cc-line); border-radius: 14px;
  background: var(--cc-panel); box-shadow: var(--cc-shadow); overflow: hidden; }
.shot-panel.float { position: fixed; z-index: 400; width: 380px; max-width: calc(100vw - 16px); margin: 0; }
.shot-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-bottom: 1px solid var(--cc-line-soft); background: var(--cc-line-soft); }
.shot-panel.float .shot-head { cursor: move; }
.shot-head .shot-ttl { font-weight: 650; font-size: 13.5px; color: var(--cc-text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.shot-head .shot-x { flex-shrink: 0; }
.shot-tools { display: flex; gap: 8px; padding: 8px 10px 0; flex-wrap: wrap; }
.shot-tools .btn { flex: 0 0 auto; }
.shot-head .spacer { flex: 1; }
.shot-head .shot-x { padding: 2px 9px; font-size: 16px; line-height: 1; }
.shot-img { background: #05070f; display: flex; align-items: center; justify-content: center;
  min-height: 160px; max-height: 60vh; }
.shot-panel.float .shot-img { max-height: 420px; }
.shot-img img { max-width: 100%; max-height: 46vh; object-fit: contain; display: block; }
.shot-panel.float .shot-img img { max-height: 420px; }
.shot-foot { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px; }
.shot-foot .shot-cap { font-size: 12.5px; color: var(--cc-text-dim); font-variant-numeric: tabular-nums; min-width: 120px; text-align: center; }
