/* ccboot-panel · Инженерный дашборд (Linear / Vercel Graphite + Кибержесть Violet) */

html, body { overflow-x: clip; }

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* Никакого декоративного свечения: фон держит иерархию поверхностей. */

::selection { background: var(--color-accent); color: var(--color-ink-hi); }

.page { max-width: 1320px; margin: 0 auto; padding: 0 var(--space-lg) var(--space-xl); }

/* ---------------- Шапка и главная навигация ---------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 48px;
  padding: 6px var(--space-lg);
  border: 0;
  border-bottom: 1px solid var(--color-rule);
  border-radius: 0;
  margin: 0 calc(-1 * var(--space-lg)) var(--space-md);
  flex-wrap: wrap;
  box-shadow: none;
}
.masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--color-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  color: var(--color-ink);
  background: var(--color-surface-2);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out);
}
.nav-toggle:hover { background: var(--color-surface-3); }
.nav-toggle:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.nav-toggle-box { position: relative; display: block; width: 22px; height: 16px; }
.nav-toggle-box span {
  position: absolute;
  left: 0; top: 50%;
  width: 22px; height: 2px; margin-top: -1px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--dur-short) var(--ease-out);
}
.nav-toggle-box span:first-child { transform: translateY(-4px); }
.nav-toggle-box span:last-child { transform: translateY(4px); }
.masthead.is-open .nav-toggle-box span:first-child { transform: rotate(45deg); }
.masthead.is-open .nav-toggle-box span:last-child { transform: rotate(-45deg); }

.brand { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; flex: 0 1 auto; text-decoration: none; }
.brand > div { min-width: 0; }

.brand-mark {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  color: var(--color-accent-hi);
}
.brand-mark svg { display: block; }
.brand:hover .brand-title { color: var(--color-accent-hi); }

.brand-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-ink-hi);
  margin: 0;
  white-space: nowrap;
  line-height: 1.2;
  transition: color var(--dur-short) var(--ease-out);
}

.brand-sub {
  display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  color: var(--color-faint);
}

.mast-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.mast-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-rule-soft);
  padding: 4px;
  border-radius: var(--radius-md);
}

.mast-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--dur-short) var(--ease-out),
              background-color var(--dur-short) var(--ease-out);
}
.mast-link:hover { color: var(--color-ink-hi); background: var(--color-surface-2); }
.mast-link.is-active {
  color: var(--color-accent-hi);
  background: var(--color-accent-soft);
  box-shadow: inset 0 1px 0 var(--color-highlight-top);
}
.mast-link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ---------------- Конвейер залов (Hall Pipeline Switcher) ---------------- */

.hall-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: var(--space-md);
  align-items: stretch;
}

.hall-chip {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
  background: var(--color-surface-1);
  box-shadow: inset 0 1px 0 var(--color-highlight-top);
  color: var(--color-ink);
  text-decoration: none;
  position: relative;
  transition: border-color var(--dur-short) var(--ease-out),
              background-color var(--dur-short) var(--ease-out),
              transform var(--dur-short) var(--ease-out);
}
.hall-chip:hover {
  border-color: var(--color-faint);
  background: var(--color-surface-2);
}
.hall-chip.is-active {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  box-shadow: inset 0 1px 0 var(--color-highlight-top);
}
.hall-chip:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.hall-chip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
}
.hall-chip-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-ink-hi);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.hall-role-tag {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-3);
  color: var(--color-muted);
  border: 1px solid var(--color-rule);
}
.hall-role-tag.is-source {
  color: var(--color-focus);
  border-color: rgba(167, 139, 250, 0.35);
  background: var(--color-accent-soft);
}
.hall-role-tag.is-target {
  color: var(--color-live);
  border-color: rgba(34, 211, 238, 0.3);
  background: var(--color-live-soft);
}
.hall-chip-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  color: var(--color-muted);
  flex-wrap: wrap;
}
.hall-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 2px;
}
.hall-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hall-stat-value {
  font-size: var(--text-md); font-weight: 500; line-height: 1.2;
  color: var(--color-ink-hi); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hall-stat-value small { font-size: var(--text-xs); font-weight: 500; color: var(--color-faint); }
.hall-stat-label {
  font-size: var(--text-xs); font-weight: 500; color: var(--color-faint);
}
.hall-chip.is-off { opacity: 0.7; }
.hall-chip.is-off .hall-chip-meta { color: var(--color-faint); }

/* ---------------- Быстрые карточки сценариев (Scenario Bar) ---------------- */

.scenario-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: var(--space-md);
}

.scenario-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-rule);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 var(--color-highlight-top);
  color: var(--color-ink);
  text-decoration: none;
  position: relative;
  transition: border-color var(--dur-short) var(--ease-out),
              background-color var(--dur-short) var(--ease-out),
              transform var(--dur-micro) var(--ease-out);
}
.scenario-card:hover {
  background: var(--color-surface-2);
  border-color: var(--color-accent);
  transform: translateY(-1px);
}
.scenario-card.is-primary {
  border-color: rgba(167, 139, 250, 0.45);
  background: var(--color-accent-soft);
}
.scenario-card.is-primary:hover {
  border-color: var(--color-accent);
  background: var(--color-surface-2);
}
.scenario-card.is-alert {
  border-color: rgba(248, 113, 113, 0.5);
  background: var(--color-danger-soft);
}
.scenario-head {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding-right: 80px;
}
.scenario-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none;
  border-radius: 6px; background: var(--color-surface-3);
  color: var(--color-accent-hi);
}
.scenario-card.is-primary .scenario-icon {
  background: var(--color-accent-soft);
}
.scenario-badge {
  position: absolute; top: 8px; right: 8px;
  font-size: var(--text-xs); font-weight: 500;
  padding: 2px 8px; border-radius: 4px;
  color: var(--color-muted); background: var(--color-surface-3);
  border: 1px solid var(--color-rule);
}
.scenario-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-ink-hi);
}
.scenario-arrow {
  position: absolute; right: 12px; bottom: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-accent-hi);
  opacity: 0; transform: translateX(-3px);
  transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
}
.scenario-card:hover .scenario-arrow,
.scenario-card:focus-visible .scenario-arrow { opacity: 1; transform: translateX(0); }
.scenario-desc {
  font-size: var(--text-xs);
  color: var(--color-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-right: 16px;
}

/* ---------------- Карточка зала и KPI-метрики ---------------- */

.hall-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-rule-soft);
  box-shadow: inset 0 1px 0 var(--color-highlight-top);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.hall-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-md); flex-wrap: wrap;
}

.hall-card-title { font-size: var(--text-lg); font-weight: 700; color: var(--color-ink-hi); margin: 0; }

/* Сетка KPI-карточек внутри обзора зала */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: var(--space-lg);
}

.kpi-box {
  background: var(--color-surface-2);
  border: 1px solid var(--color-rule-soft);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}
.kpi-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-faint);
}
.kpi-value {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--color-ink-hi);
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}
.kpi-value.mono {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-variant-numeric: tabular-nums;
}
.kpi-sub {
  font-size: var(--text-xs);
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  flex-wrap: wrap;
  min-width: 0;
  overflow-wrap: anywhere;
}
.kpi-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

/* Индикатор заполнения диска */
.disk-meter {
  height: 5px;
  border-radius: 999px;
  background: var(--color-surface-3);
  overflow: hidden;
  margin-top: 4px;
}
.disk-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--color-ok);
}
.disk-meter-fill.warn { background: var(--color-warn); }
.disk-meter-fill.danger { background: var(--color-danger); }

/* G: — отдельный акцент, чтобы не путать с диском образов */
.kpi-games-disk { border-color: var(--color-ok); }
.kpi-games-disk.warn { border-color: var(--color-warn); }
.kpi-games-disk.danger { border-color: var(--color-danger); }
.kpi-games-disk .disk-used { color: var(--color-ok); font-weight: 600; }
.kpi-games-disk.warn .disk-used { color: var(--color-warn); }
.kpi-games-disk.danger .disk-used { color: var(--color-danger); }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-sm) var(--space-lg);
  margin: var(--space-md) 0 var(--space-xs);
}
.facts div { min-width: 0; }
.facts dt {
  font-size: var(--text-xs);
  color: var(--color-faint); margin-bottom: 2px;
}
.facts dd { margin: 0; font-size: var(--text-base); color: var(--color-ink); overflow-wrap: anywhere; }
.facts dd.num { font-family: var(--font-mono); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }

/* ---------------- Вкладки зала ---------------- */

.tabs {
  display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 4px; margin-bottom: var(--space-md);
  background: var(--color-surface-1);
  border: 1px solid var(--color-rule);
  border-radius: 8px;
}
.tab {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  transition: color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out);
}
.tab:hover { color: var(--color-ink-hi); background: var(--color-surface-2); }
.tab.is-active { color: var(--color-ink-hi); background: var(--color-accent-soft); box-shadow: inset 0 0 0 1px var(--color-accent); }
.tab:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.tab-count {
  font-size: var(--text-xs); font-weight: 500; line-height: 1.4;
  padding: 0 4px; border-radius: 4px;
  background: var(--color-surface-3); color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}
.tab.is-active .tab-count { background: var(--color-accent-soft); color: var(--color-accent-hi); }
.tab-count.is-warn { background: var(--color-warn-soft); color: var(--color-warn); }

/* ---------------- Панель инструментов и быстрые фильтры ---------------- */

.toolbar {
  display: flex; align-items: center; gap: var(--space-xs);
  flex-wrap: wrap; margin-bottom: var(--space-sm);
}
.toolbar .spacer { flex: 1 1 auto; }
/* Панель ПК: главный блок (поиск + фильтры) и блок инструментов (вид, выбор, диагностика).
   Ширины блоков не зависят от подгрузки шрифта, поэтому перенос строки стабилен. */
.toolbar-form { flex: 1 1 100%; flex-wrap: wrap; gap: var(--space-xs) var(--space-sm); align-items: center; }
.toolbar-main { display: flex; align-items: center; gap: var(--space-sm); flex: 1 1 100%; min-width: 0; }
.toolbar-main .search { flex: 0 1 220px; min-width: 140px; }
.toolbar-main .filter-chips { flex: 0 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.toolbar-main .filter-chip { white-space: nowrap; }
.toolbar-main .view-switch { margin-left: auto; flex: none; }
.toolbar-tools { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-xs); flex: 1 1 100%; flex-wrap: wrap; }
@media (max-width: 960px) {
  .toolbar-main { flex-wrap: wrap; }
  .toolbar-main .filter-chips { flex: 1 1 100%; }
  .toolbar-main .view-switch { margin-left: 0; }
}

.search {
  font-family: var(--font-body); font-size: var(--text-sm);
  color: var(--color-ink); background: var(--color-surface-1);
  border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  padding: 0 var(--space-sm); min-height: var(--control-h); min-width: 210px;
}
.search:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }

/* Чипы быстрого фильтра таблицы ПК */
.filter-chips {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-rule-soft);
  padding: 4px;
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.filter-chip {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur-micro), background-color var(--dur-micro);
  min-height: var(--control-h-sm);
  display: inline-flex;
  align-items: center;
}
.filter-chip:hover { color: var(--color-ink-hi); background: var(--color-surface-2); }
.filter-chip.is-active {
  color: var(--color-ink-hi);
  background: var(--color-accent-soft);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

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

.table-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-rule-soft);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: inset 0 1px 0 var(--color-highlight-top);
}

table.grid { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }

table.grid th {
  font-size: var(--text-xs); font-weight: 600;
  text-align: left; color: var(--color-muted);
  padding: 8px 12px;
  background: transparent;
  border-bottom: 1px solid var(--color-rule);
  white-space: nowrap;
}

table.grid td {
  padding: 4px 12px;
  border-bottom: 1px solid var(--color-rule-soft);
  color: var(--color-ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }

td.mono, .mono { font-family: var(--font-mono); font-size: var(--text-xs); }
td.num { font-variant-numeric: tabular-nums; }
td.name { font-weight: 500; color: var(--color-ink-hi); vertical-align: middle; }
.name-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
table.grid td { vertical-align: middle; }
.pc-link { color: inherit; text-decoration: none; }
.pc-link:hover { text-decoration: underline; }
td.wrap { white-space: normal; min-width: 220px; }
.pc-table td[data-label="Сеанс"] { width: 1%; white-space: normal; }
.pc-table td[data-label="Сеанс"] .section-meta { display: inline; margin-left: 8px; white-space: nowrap; }
.pc-table td.col-action { width: 1%; }
/* колонки «по содержимому»: иначе автораскладка раздаёт лишнюю ширину пилюлям и меткам */
.pc-table td[data-label="Состояние"], .pc-table td[data-label="IP-адрес"] { width: 1%; white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 220px; margin-left: auto; }
.row-actions .btn { white-space: nowrap; }

/* Зона ПК (2.5G / 1G) */
.zone-tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  border: 1px solid var(--color-rule);
  color: var(--color-faint);
  background: var(--color-surface-2);
}
.zone-tag.is-fast {
  color: var(--color-focus);
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(147, 51, 234, 0.12);
}

.row-toggle { position: absolute; opacity: 0; pointer-events: none; }
.row-open {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; padding: 0;
  cursor: pointer; color: var(--color-faint);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  transition: color var(--dur-short) var(--ease-out),
              border-color var(--dur-short) var(--ease-out),
              background-color var(--dur-short) var(--ease-out);
}
.row-open:hover { color: var(--color-ink-hi); border-color: var(--color-rule); background: var(--color-surface-3); }
.row-open:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
tr.detail-row { display: none; }
tr.detail-row td { background: var(--color-surface-2); white-space: normal; padding: var(--space-md); }
tr:has(.row-toggle:checked) + tr.detail-row { display: table-row; }

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

.btn, .search, .filter-chip, .sort-btn { box-sizing: border-box; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 500;
  color: var(--color-ink);
  background: var(--color-surface-2);
  border: 1px solid var(--color-rule);
  box-shadow: none;
  border-radius: var(--radius-md);
  padding: 0 var(--space-md);
  min-height: var(--control-h);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color var(--dur-short) var(--ease-out),
              border-color var(--dur-short) var(--ease-out),
              color var(--dur-short) var(--ease-out),
              transform var(--dur-micro) var(--ease-out);
}
.btn:hover { background: var(--color-surface-3); border-color: var(--color-muted); color: var(--color-ink-hi); }
.btn:active { transform: translateY(1px); }
.mast-link:active, .hall-chip:active, .scenario-card:active, .game-chip:active,
.filter-chip:active, .tab:active, .row-open:active, .task-option:active,
.auto-toggle:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }

.btn-primary {
  color: #0B0D11;
  background: var(--color-accent-hi);
  border-color: var(--color-accent-hi);
  box-shadow: none;
}
.btn-primary:hover {
  background: var(--color-focus);
  border-color: var(--color-focus);
  color: #0B0D11;
}

.btn-danger { color: var(--color-danger); background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.4); }
.btn-danger:hover { background: var(--color-danger-soft); border-color: var(--color-danger); }

.btn-quiet { background: transparent; border-color: var(--color-rule); color: var(--color-muted); box-shadow: none; }
.btn-quiet:hover { color: var(--color-ink-hi); background: var(--color-surface-2); }

.btn-sm { min-height: var(--control-h-sm); padding: 4px 12px; font-size: var(--text-xs); }

/* ---------------- Плашки статусов и бейджи ---------------- */

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-xs); font-weight: 500; line-height: 1.4;
  padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--color-rule);
  color: var(--color-muted); background: var(--color-surface-2);
  white-space: nowrap;
}
.pill .dot { width: 5px; height: 5px; border-radius: 50%; flex: none; background: var(--color-faint); }
.pill.ok { color: var(--color-ok); border-color: rgba(16, 185, 129, 0.35); background: var(--color-ok-soft); }
.pill.ok .dot { background: var(--color-ok); }
.pill.warn { color: var(--color-warn); border-color: rgba(245, 158, 11, 0.35); background: var(--color-warn-soft); }
.pill.warn .dot { background: var(--color-warn); animation: pill-pulse 1.8s ease-in-out infinite; }
.pill.danger { color: var(--color-danger); border-color: rgba(239, 68, 68, 0.35); background: var(--color-danger-soft); }
.pill.danger .dot { background: var(--color-danger); }
.pill.muted { color: var(--color-faint); }
.pill.muted .dot { background: var(--color-faint); }
.pill.accent { color: var(--color-focus); border-color: rgba(168, 85, 247, 0.45); background: var(--color-accent-soft); }
.pill.accent .dot { background: var(--color-accent-hi); }
@keyframes pill-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.badge-soft {
  display: inline-block; font-size: var(--text-xs); font-weight: 500;
  padding: 2px 8px; border-radius: 6px;
  background: var(--color-surface-3); color: var(--color-muted);
  border: 1px solid var(--color-rule);
}
.badge-ok { background: var(--color-ok-soft); color: var(--color-ok); border-color: rgba(16, 185, 129, 0.3); }
.badge-warn { background: var(--color-warn-soft); color: var(--color-warn); border-color: rgba(245, 158, 11, 0.3); }
a.badge-soft { display: inline-flex; align-items: center; min-height: 28px; }
a.section-meta { display: inline-flex; align-items: center; min-height: 28px; }

/* ---------------- Заметки и пустые состояния ---------------- */

.note {
  font-size: var(--text-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-rule);
  background: var(--color-surface-1);
  color: var(--color-muted);
  margin-bottom: var(--space-md);
}
.note.ok { border-color: rgba(16, 185, 129, 0.35); color: var(--color-ok); background: var(--color-ok-soft); }
.note.warn { border-color: rgba(245, 158, 11, 0.35); color: var(--color-warn); background: var(--color-warn-soft); }
.note.danger { border-color: rgba(239, 68, 68, 0.35); color: var(--color-danger); background: var(--color-danger-soft); }

.empty-state {
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  color: var(--color-muted);
  font-size: var(--text-sm);
}
.empty-state strong { display: block; color: var(--color-ink-hi); font-size: var(--text-base); margin-bottom: 4px; }

.freshness { font-size: var(--text-xs); color: var(--color-faint); }

/* ---------------- Заголовки разделов ---------------- */

.section-head { display: flex; align-items: baseline; gap: var(--space-sm); margin: var(--space-lg) 0 var(--space-sm); flex-wrap: wrap; }
.section-title {
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500;
  color: var(--color-ink-hi); margin: 0; letter-spacing: 0;
}
.section-meta { font-size: var(--text-xs); color: var(--color-faint); }
.section-head .spacer { flex: 1 1 auto; }

/* ---------------- Полоса активной задачи ---------------- */

.task-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-accent-hi);
  background: var(--color-surface-1);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  margin-bottom: var(--space-md);
}
.task-strip.failed {
  border-color: rgba(239, 68, 68, 0.55);
  background: var(--color-surface-1);
}
.task-strip-title { font-size: var(--text-md); font-weight: 700; color: var(--color-ink-hi); margin: 0; }
.task-strip-line { font-size: var(--text-sm); color: var(--color-ink); margin: 2px 0 0; }
.task-strip-line.dim { color: var(--color-muted); font-size: var(--text-xs); }
.task-strip .spacer { flex: 1 1 auto; }
.task-strip-actions { display: flex; gap: var(--space-xs); flex-wrap: wrap; }

.progress-track { height: 5px; border-radius: 999px; background: var(--color-surface-3); overflow: hidden; width: 100%; margin-top: var(--space-xs); }
.progress-fill {
  width: 100%; height: 100%;
  background: var(--color-accent);
  border-radius: 999px;
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform var(--dur-short) var(--ease-out);
}

/* ---------------- Страница задачи: Единый пульт управления (Mission Control) ---------------- */

.mission-header {
  background: var(--color-surface-1);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  box-shadow: inset 0 1px 0 var(--color-highlight-top);
}
.mission-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.mission-title-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.mission-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

/* Встроенная карточка приёмки со скриншотом на паузе задачи */
.mission-accept-box {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: var(--space-md);
  align-items: center;
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.06);
}
@media (max-width: 820px) {
  .mission-accept-box { grid-template-columns: 1fr; }
}

/* Двухколоночная раскладка пульта задачи: слева конвейер шагов, справа живая консоль */
.mission-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-md);
  align-items: start;
}
@media (max-width: 980px) {
  .mission-grid { grid-template-columns: 1fr; }
}

.terminal-card {
  background: #08090C;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: sticky;
  top: var(--space-md);
}
.terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: 8px var(--space-md);
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-rule);
  font-size: var(--text-xs);
  color: var(--color-muted);
}
.terminal {
  background: #08090C;
  padding: var(--space-sm) var(--space-md);
  max-height: 540px;
  overflow: auto;
}
.terminal pre {
  margin: 0; font-family: var(--font-mono); font-size: var(--text-xs);
  line-height: 1.55; color: #D1D5DB;
  white-space: pre-wrap; overflow-wrap: anywhere; min-height: 8em;
}

/* ---------------- Сводка операций и единый таймлайн шагов ---------------- */

.op-summary { display: grid; gap: var(--space-sm); }
.op-focus, .op {
  border: 1px solid var(--color-rule-soft);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
}
.op-focus {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
}
.op-focus-title, .op-title { margin: 0; color: var(--color-ink-hi); font-weight: 700; font-size: var(--text-sm); }
.op-focus-title { font-size: var(--text-base); }
.op-focus-text, .op-text { margin: 4px 0 0; color: var(--color-ink); font-size: var(--text-sm); overflow-wrap: anywhere; }
.op-refs { margin: 4px 0 0; color: var(--color-faint); overflow-wrap: anywhere; }
.op-links { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); margin: 8px 0 0; font-size: var(--text-xs); }
.op-links a { color: var(--color-focus); text-decoration: none; }
.op-links a:hover { text-decoration: underline; }
.op-list { display: grid; gap: 8px; }
.op { padding: 12px var(--space-md); }
.op-head { display: grid; grid-template-columns: 12px 1fr; gap: var(--space-sm); align-items: start; }
.op-meta { display: flex; flex-wrap: wrap; gap: 4px var(--space-xs); align-items: center; margin: 2px 0 0; color: var(--color-muted); font-size: var(--text-xs); }
.op-dot { width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--color-faint); flex: none; }
.op-focus-ok, .op-ok { background: var(--color-ok-soft); }
.op-focus-ok .op-dot, .op-ok .op-dot { background: var(--color-ok); }
.op-focus-waiting, .op-focus-warn, .op-waiting, .op-warn { background: var(--color-warn-soft); }
.op-focus-waiting .op-dot, .op-focus-warn .op-dot, .op-waiting .op-dot, .op-warn .op-dot { background: var(--color-warn); }
.op-focus-error, .op-error { background: var(--color-danger-soft); }
.op-focus-error .op-dot, .op-error .op-dot { background: var(--color-danger); }
.op-focus-running, .op-running { background: var(--color-live-soft); }
.op-focus-running .op-dot, .op-running .op-dot { background: var(--color-live); }
.op-focus-muted, .op-muted, .op-info { opacity: 0.75; }
.op-details, .raw-log { border: 1px solid var(--color-rule-soft); border-radius: var(--radius-sm); background: var(--color-surface-1); padding: 8px 12px; }
.op-details { margin-top: 8px; }
.raw-log { margin-top: var(--space-xs); }
.op-details summary, .raw-log summary { cursor: pointer; color: var(--color-muted); font-size: var(--text-xs); font-weight: 500; }
.op-details summary:hover, .raw-log summary:hover { color: var(--color-ink-hi); }
.op-detail { margin: var(--space-xs) 0; padding-left: var(--space-md); display: grid; gap: 2px; font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.5; overflow-wrap: anywhere; }
.op-line-error { color: var(--color-danger); }
.op-line-success { color: var(--color-ok); }
.op-line-waiting { color: var(--color-warn); }
.op-line-command, .op-line-info { color: var(--color-muted); }

/* ---------------- Компактный список шагов (steps.html) ---------------- */

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.step { display: grid; grid-template-columns: 20px 1fr max-content; gap: var(--space-sm); align-items: center; padding: 4px 0; }
.step-mark { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--color-rule); justify-self: center; }
.step.pending .step-mark { border-color: var(--color-rule); }
.step.running .step-mark { border-color: var(--color-live); background: var(--color-live-soft); }
.step.awaiting .step-mark { border-color: var(--color-warn); background: var(--color-warn-soft); }
.step.done .step-mark { border-color: var(--color-ok); background: var(--color-ok); }
.step.noop .step-mark { border-color: var(--color-warn); background: var(--color-warn-soft); }
.step.failed .step-mark { border-color: var(--color-danger); background: var(--color-danger); }
.step.skipped .step-mark { border-color: var(--color-rule); opacity: 0.45; }
.step-name { font-size: var(--text-sm); color: var(--color-ink); min-width: 0; }
.step.pending .step-name, .step.skipped .step-name { color: var(--color-faint); }
.step.skipped .step-name { text-decoration: line-through; }
.step-state {
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-faint);
  text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
}

/* ---------------- Панель запуска задачи (Slide-over Drawer) ---------------- */

.drawer-backdrop {
  position: fixed; inset: 0; z-index: var(--z-drawer);
  background: rgba(5, 6, 9, 0.72);
  backdrop-filter: blur(4px);
  transition: opacity var(--dur-short) var(--ease-out);
}
.drawer-backdrop.is-closing { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .drawer-backdrop { transition: none; }
}

.drawer {
  position: fixed; inset: 0 0 0 auto; z-index: calc(var(--z-drawer) + 1);
  box-sizing: border-box;
  width: min(860px, 92vw);
  height: 100vh; height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  background: var(--color-surface-1);
  border: 1px solid var(--color-rule);
  border-right: 0;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 var(--color-highlight-top);
  padding: 0;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 0;
  animation: drawer-slide-in var(--dur-long) var(--ease-out);
}
.drawer.is-closing {
  transform: translate3d(100%, 0, 0);
  transition: transform var(--dur-long) var(--ease-out);
}
@keyframes drawer-slide-in {
  from { transform: translate3d(100%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .drawer { animation: none; }
  .drawer.is-closing { transition: none; }
}

.drawer-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}
.drawer-col-types {
  min-width: 0; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 16px;
  border-right: 1px solid var(--color-rule-soft);
}
.drawer-col-main {
  min-width: 0; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 24px;
  display: grid; gap: var(--space-md); align-content: start;
}
@media (max-width: 780px) {
  .drawer { width: 100vw; max-width: 100vw; border-left: 0; border-radius: 0; }
  .drawer-grid { display: block; overflow-y: auto; }
  .drawer-col-types {
    overflow: visible; border-right: 0;
    border-bottom: 1px solid var(--color-rule-soft);
  }
  .drawer-col-main { overflow: visible; padding: 16px; }
}

.drawer-group-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-faint);
  margin: var(--space-sm) 0 8px;
}
.drawer-group-label:first-child { margin-top: 0; }

.drawer-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-sm);
  padding: 24px;
  border-bottom: 1px solid var(--color-rule-soft);
}
.drawer-title { font-size: var(--text-lg); font-weight: 700; color: var(--color-ink-hi); margin: 0; }

.drawer-close {
  font-size: var(--text-sm); color: var(--color-muted); background: var(--color-surface-2);
  border: 1px solid var(--color-rule); border-radius: var(--radius-sm);
  min-width: 34px; min-height: 34px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.drawer-close:hover { color: var(--color-ink-hi); background: var(--color-surface-3); }

.task-option {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  background: var(--color-surface-2); color: var(--color-ink);
  text-decoration: none; margin-bottom: 4px;
  transition: border-color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out);
}
.task-option:hover { border-color: var(--color-muted); background: var(--color-surface-3); }
.task-option.is-current {
  border-color: var(--color-accent-hi);
  background: var(--color-accent-soft);
}
.task-option.is-danger { border-color: rgba(239, 68, 68, 0.35); }
.task-option.is-danger .task-option-icon { color: var(--color-danger); }
.task-option-icon {
  flex: none; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; background: var(--color-surface-3);
  font-size: var(--text-xs); line-height: 1;
}
.task-option.is-current .task-option-icon { background: var(--color-accent-soft); }
.task-option-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-option-title {
  font-size: var(--text-sm); font-weight: 700; color: var(--color-ink-hi);
  line-height: 1.25;
}
.task-option-desc {
  font-size: var(--text-xs); color: var(--color-muted); line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-option-badges { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }

.launch-summary {
  display: flex; flex-direction: column; gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface-2);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
}
.launch-summary-head { display: flex; gap: var(--space-sm); align-items: flex-start; }
.launch-summary-icon {
  flex: none; width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--color-accent-soft);
  color: var(--color-accent-hi);
}
.launch-summary-text { min-width: 0; }
.launch-summary-title {
  font-size: var(--text-base); font-weight: 700; color: var(--color-ink-hi);
  line-height: 1.3;
}
.launch-summary-short {
  font-size: var(--text-sm); color: var(--color-muted);
  line-height: 1.4; margin-top: 2px;
}
.launch-summary-more {
  margin-top: var(--space-2xs);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--color-rule-soft);
}
.launch-summary-more summary {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: var(--text-sm); font-weight: 500;
  color: var(--color-muted); padding: 4px 0;
  list-style: none;
  transition: color var(--dur-short) var(--ease-out);
}
.launch-summary-more summary::-webkit-details-marker { display: none; }
.launch-summary-more summary::before {
  content: "▸"; font-size: var(--text-xs); line-height: 1;
  transition: transform var(--dur-short) var(--ease-out);
}
.launch-summary-more[open] summary::before { transform: rotate(90deg); }
.launch-summary-more summary:hover { color: var(--color-ink-hi); }
.launch-summary-more summary:focus-visible {
  outline: 2px solid var(--color-focus); outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.launch-summary-desc {
  font-size: var(--text-sm); color: var(--color-muted);
  line-height: 1.45; margin-top: 4px;
  animation: summary-in 180ms var(--ease-out);
}
@keyframes summary-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.checks {
  list-style: none; margin: 0; padding: var(--space-sm) var(--space-md);
  background: var(--color-surface-2); border: 1px solid var(--color-rule-soft);
  border-radius: var(--radius-md); display: grid; gap: 8px;
}
.check { display: grid; grid-template-columns: 18px 1fr; gap: var(--space-xs); align-items: start; font-size: var(--text-sm); }
.check-mark { font-weight: 700; line-height: 1.4; font-family: var(--font-mono); }
.check.ok .check-mark { color: var(--color-ok); }
.check.warn .check-mark { color: var(--color-warn); }
.check.block .check-mark { color: var(--color-danger); }
.check-text { color: var(--color-ink); min-width: 0; }
.check-detail { color: var(--color-faint); font-size: var(--text-xs); }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin-bottom: var(--space-sm); }
.field > label { font-size: var(--text-xs); font-weight: 600; color: var(--color-muted); }
.field select, .field input {
  box-sizing: border-box;
  width: 100%;
  font-family: var(--font-body); font-size: var(--text-sm);
  color: var(--color-ink-hi); background: var(--color-surface-2);
  border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  padding: 8px 12px; min-height: var(--control-h);
}
.field select:focus-visible, .field input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; border-color: var(--color-accent-hi); }
.field-hint { font-size: var(--text-xs); color: var(--color-muted); margin: var(--space-xs) 0 0; line-height: 1.45; }
.field-hint strong { color: var(--color-ink); font-weight: 600; }

.drawer-footer {
  flex: 0 0 auto;
  background: var(--color-surface-1);
  padding: 16px 24px;
  border-top: 1px solid var(--color-rule-soft);
}
.drawer-footer-note {
  margin: 0 0 8px;
  font-size: var(--text-xs); color: var(--color-danger);
}
.drawer-footer-actions { display: flex; align-items: stretch; gap: 8px; }
.drawer-footer-actions > .btn-quiet {
  flex: 0 0 auto; box-sizing: border-box;
  min-height: 42px; padding: 12px 24px;
}
.drawer-footer-actions > form {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.drawer-footer-actions > form .btn,
.drawer-footer-actions > button.btn {
  width: 100%; min-height: 42px;
}
.drawer-footer-actions > button.btn { flex: 1 1 auto; }
@media (max-width: 780px) {
  .drawer-footer { padding: 12px 16px; }
  .drawer-footer-actions { gap: 8px; }
  .drawer-footer-actions > .btn-quiet { padding: 8px 12px; }
}

/* ---------------- Галерея скриншотов приёмки ---------------- */

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: var(--space-md);
}
.shot-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-rule-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-sm);
  display: flex; flex-direction: column; gap: var(--space-xs);
}
.shot-thumb {
  display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: contain;
  border-radius: var(--radius-sm); background: var(--color-bg);
  border: 1px solid var(--color-rule-soft);
}
.shot-thumb:hover { border-color: var(--color-accent-hi); }
.shot-meta { display: flex; justify-content: space-between; gap: var(--space-xs); align-items: baseline; }
.shot-name { font-size: var(--text-sm); color: var(--color-ink-hi); font-weight: 500; }
.shot-criteria { font-size: var(--text-xs); color: var(--color-faint); margin: 0; }

/* ---------------- Футер ---------------- */

.colophon {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  padding: var(--space-lg) 0 0; margin-top: var(--space-xl);
  border-top: 1px solid var(--color-rule-soft);
  font-size: var(--text-xs); color: var(--color-faint);
}

/* ---------------- Анимации ---------------- */

@keyframes fade-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------- Экран входа ---------------- */

.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 72vh;
  padding: var(--space-2xl) 0;
}
.login-box {
  width: 100%;
  max-width: 390px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.login-box h1 { font-size: var(--text-md); font-weight: 700; color: var(--color-ink-hi); margin: 0 0 4px; }
.login-box .login-lead { font-size: var(--text-sm); color: var(--color-muted); margin: 0 0 var(--space-lg); }
.login-box .field input { font-family: var(--font-mono); }
.login-box .btn { width: 100%; min-height: 40px; }
.login-hint {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-rule-soft);
  font-size: var(--text-xs);
  color: var(--color-faint);
}

/* ---------------- Двухшаговое подтверждение (app.js) ---------------- */

.confirm-dialog {
  max-width: min(440px, calc(100vw - 32px)); padding: var(--space-lg);
  color: var(--color-ink); background: var(--color-surface-2);
  border: 1px solid var(--color-rule); border-radius: 12px;
}
.confirm-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.confirm-dialog h2 { margin: 0 0 var(--space-xs); font-size: var(--text-md); }
.confirm-dialog .confirm-text { margin: 0 0 var(--space-md); font-size: var(--text-sm); color: var(--color-muted); }
.confirm-actions { display: flex; justify-content: flex-end; gap: var(--space-xs); }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

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

/* ---------- attention banner ---------- */
.attention-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: var(--space-sm);
  background: var(--color-warn-soft);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  font-size: var(--text-xs); color: var(--color-warn);
}
.attention-banner .ab-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none;
  border-radius: 6px; background: var(--color-warn); color: #0a0a12;
  font-weight: 700; font-size: var(--text-sm);
}
.attention-banner .ab-text { flex: 1 1 320px; min-width: 0; }
.attention-banner strong { color: #fff; }
.attention-banner .ab-sep { color: var(--color-warn); opacity: .5; margin: 0 4px; }
.attention-banner.is-danger {
  background: var(--color-danger-soft);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--color-danger);
}
.attention-banner.is-danger .ab-icon { background: var(--color-danger); }

/* ---------- topbar auto toggle ---------- */
.auto-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--text-xs); color: var(--color-muted);
  padding: 8px 12px; border-radius: 6px;
  border: 1px solid var(--color-rule); background: var(--color-surface-1);
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--dur-short) var(--ease-out),
              border-color var(--dur-short) var(--ease-out);
}
.auto-toggle .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-faint);
}
.auto-toggle:hover { color: var(--color-ink-hi); border-color: var(--color-muted); }
.auto-toggle.is-on { color: var(--color-ok); border-color: rgba(16, 185, 129, 0.35); }
.auto-toggle.is-on .dot { background: var(--color-ok); box-shadow: 0 0 6px var(--color-ok); }
.auto-toggle:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.brand:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; border-radius: var(--radius-sm); }

/* ---------- ползунок авто-WSS в шапке зала ---------- */
.live-toggle { margin: 0; }
.live-toggle .switch {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.live-toggle input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
  pointer-events: none;
}
.live-toggle .track {
  position: relative; flex: none;
  width: 34px; height: 18px; border-radius: 999px;
  background: var(--color-surface-3);
  border: 1px solid var(--color-rule);
  transition: background-color var(--dur-short) var(--ease-out),
              border-color var(--dur-short) var(--ease-out);
}
.live-toggle .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--color-faint);
  transition: transform var(--dur-short) var(--ease-out),
              background-color var(--dur-short) var(--ease-out);
}
.live-toggle input:checked + .track {
  background: var(--color-ok-soft);
  border-color: var(--color-ok);
}
.live-toggle input:checked + .track::after {
  transform: translateX(16px);
  background: var(--color-ok);
  box-shadow: 0 0 6px var(--color-ok);
}
.live-toggle input:focus-visible + .track {
  outline: 2px solid var(--color-focus); outline-offset: 2px;
}
.live-toggle .switch-text {
  font-size: var(--text-xs); color: var(--color-muted);
  white-space: nowrap;
}
.live-toggle input:checked ~ .switch-text { color: var(--color-ok); }
.live-toggle:hover .switch-text { color: var(--color-ink-hi); }

/* ---------- games: server updates / client reboot ---------- */
.games-strip { margin-bottom: var(--space-md); }
.games-rows { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.game-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--color-surface-2);
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
a.game-row:hover { background: var(--color-surface-3); border-color: var(--color-rule); }
.game-row.is-muted { opacity: .65; }
.game-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px;
  font-size: var(--text-xs); font-weight: 700; color: #fff;
  background: var(--color-surface-3);
}
.game-logo.steam { background: #1b2838; }
.game-logo.epic { background: #2a2a2e; }
.game-logo.riot { background: #d13639; }
.game-logo img { width: 18px; height: 18px; display: block; }
.kpi-icon {
  width: 14px; height: 14px; vertical-align: -2px; margin-right: 8px;
}
.inline-icon {
  width: 16px; height: 16px; vertical-align: -3px; margin-right: 8px;
}
.game-thumb {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 24px; border-radius: 6px; overflow: hidden;
  background: var(--color-surface-3);
  vertical-align: middle; margin-right: 8px;
}
.game-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-thumb.is-logo { width: 24px; height: 24px; }
.game-thumb.is-logo img { width: 16px; height: 16px; object-fit: contain; }
.game-thumb.fortnite { background: #1b2a4a; }
.game-thumb.lol { background: #1a2b4a; }
.game-thumb.valorant { background: #d13639; }
.game-main { min-width: 0; }
.game-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.game-name { font-weight: 500; color: var(--color-ink); font-size: var(--text-sm); }
.game-meta { color: var(--color-faint); font-size: var(--text-xs); margin-top: 2px; }
.game-time {
  display: flex; flex-direction: column; align-items: flex-end;
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--color-faint); white-space: nowrap;
}
.games-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.games-actions form { margin: 0; }
.games-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .games-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.games-table-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.games-table { max-height: 62vh; overflow: auto; }
.games-table thead th { position: sticky; top: 0; background: var(--color-surface-1); z-index: 1; }
.games-table th[data-sort-key] { white-space: nowrap; }
.sort-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; padding: 0; margin: 0;
  color: inherit; font: inherit; letter-spacing: inherit;
  text-transform: inherit; cursor: pointer; text-align: left;
}
.sort-btn::after {
  content: "↕"; opacity: .35; font-size: var(--text-xs); line-height: 1;
}
th[aria-sort="ascending"] .sort-btn::after {
  content: "↑"; opacity: 1; color: var(--color-accent);
}
th[aria-sort="descending"] .sort-btn::after {
  content: "↓"; opacity: 1; color: var(--color-accent);
}
.sort-btn:hover { color: var(--color-ink-hi); }
.game-check-log { margin: 8px 0; }
.game-check-log pre {
  max-height: 180px;
  overflow: auto;
  font-size: var(--text-xs);
  white-space: pre-wrap;
  color: var(--color-muted);
}
.text-danger { color: var(--color-danger); }

/* ---------- расписание: форма ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: var(--space-md);
}
.check-inline {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--text-sm); color: var(--color-muted);
  cursor: pointer; user-select: none;
}
.check-inline input { accent-color: var(--color-accent); }

/* ---------- история игр: карточки лаунчеров ---------- */
.game-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.game-history-card { padding: var(--space-md); }
.game-history-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-sm); margin-bottom: var(--space-xs);
}
.game-history-head strong { color: var(--color-ink-hi); font-size: var(--text-md); }
.game-history-head .section-meta { display: block; margin-top: 2px; }
.launcher-line {
  display: grid;
  grid-template-columns: 58px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--color-rule-soft);
  font-size: var(--text-xs);
}
.launcher-name { font-weight: 700; color: var(--color-ink-hi); }
.launcher-meta { color: var(--color-muted); min-width: 0; }
.launcher-time { color: var(--color-faint); white-space: nowrap; }
.event-version { white-space: nowrap; }
@media (max-width: 700px) {
  .launcher-line { grid-template-columns: 1fr auto; }
  .launcher-meta, .launcher-time { grid-column: 1 / -1; }
  .launcher-time { white-space: normal; }
}

/* ---------- таблицы: единый шапка/строки ---------- */
.grid th {
  font-size: var(--text-xs); font-weight: 600; color: var(--color-muted);
}
.grid td { font-size: var(--text-sm); }

/* ---------- клиенты: свёрнутая сводка ---------- */
.clients-summary {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-rule-soft);
  border-radius: var(--radius-md);
  font-size: var(--text-xs); color: var(--color-muted);
}
.clients-summary .cs-count { color: var(--color-warn); font-weight: 700; }
.clients-summary .cs-link {
  margin-left: auto; color: var(--color-focus); text-decoration: none;
  font-size: var(--text-xs); cursor: pointer;
}
.clients-summary .cs-link:hover { color: var(--color-ink-hi); }
details.clients-details > summary { list-style: none; }
details.clients-details > summary::-webkit-details-marker { display: none; }
details.clients-details[open] .cs-link::after { content: " ↑"; }
details.clients-details:not([open]) .cs-link::after { content: " →"; }
details.clients-details > .table-card { margin-top: 8px; }

@media (max-width: 900px) {
  .games-kpi { grid-template-columns: 1fr; }
  .grid td { font-size: var(--text-xs); }
}

@media (max-width: 860px) {
  .hall-switch { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .scenario-bar { grid-template-columns: 1fr; }
  .game-row { grid-template-columns: 26px minmax(0, 1fr); }
  .game-time { grid-column: 2; flex-direction: row; gap: 8px; justify-content: flex-start; }
  .mast-nav { flex-wrap: nowrap; overflow-x: auto; }
}

/* ==================================================================
 * Диспетчерская: обзор двух залов, конвейер, компактные статусы.
 * ================================================================== */

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: var(--z-toast);
  padding: 12px 16px; border-radius: var(--radius-md);
  background: var(--color-accent-hi); color: #0B0D11;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.ui-icon { flex: none; vertical-align: -3px; }

.eyebrow {
  display: block;
  font-size: var(--text-xs); font-weight: 600; color: var(--color-muted);
  margin-bottom: 4px;
}
.lead { max-width: 62ch; color: var(--color-muted); font-size: var(--text-base); line-height: 1.6; margin: 0; }
.meta-label { color: var(--color-faint); font-size: var(--text-xs); }
.table-link { color: var(--color-ink-hi); text-decoration: none; font-weight: 500; }
.table-link:hover { color: var(--color-accent-hi); text-decoration: underline; }

/* ---------- обзор ---------- */
.overview-hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-lg); padding: var(--space-lg) 0 var(--space-md);
}
.overview-hero-copy { min-width: 0; }
.overview-hero h1 { margin: 0 0 8px; font-size: var(--text-3xl); line-height: 1.1; letter-spacing: -.03em; color: var(--color-ink-hi); }
.overview-hero-actions { display: flex; gap: var(--space-xs); flex-wrap: wrap; align-items: center; }
.overview-statusline {
  display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap;
  padding: 12px 0 var(--space-md); border-bottom: 1px solid var(--color-rule-soft);
  margin-bottom: var(--space-md);
}
.overview-statusline-item { display: inline-flex; align-items: baseline; gap: 8px; }
.overview-statusline-item strong { color: var(--color-ink); font-weight: 500; }
.overview-statusline-route { margin-left: auto; }
.overview-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md); margin-bottom: var(--space-lg);
}
.overview-card {
  display: flex; flex-direction: column; gap: var(--space-sm);
  padding: var(--space-md); border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg); background: var(--color-surface-1);
  min-width: 0;
}
.overview-card.is-source { border-color: rgba(167, 139, 250, .35); }
.overview-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-sm); }
.overview-card-title { min-width: 0; }
.overview-role { display: block; font-size: var(--text-xs); font-weight: 600; color: var(--color-faint); }
.overview-card h2 { margin: 2px 0 2px; font-size: var(--text-xl); line-height: 1.3; color: var(--color-ink-hi); }
.overview-sub { color: var(--color-muted); font-size: var(--text-sm); }
.overview-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px; background: var(--color-rule-soft);
  border: 1px solid var(--color-rule-soft); border-radius: var(--radius-md); overflow: hidden;
}
.overview-metric { display: flex; flex-direction: column; gap: 4px; padding: 12px; background: var(--color-surface-2); min-width: 0; }
.overview-metric strong { color: var(--color-ink-hi); font-size: var(--text-md); line-height: 1.2; }
.overview-metric small { color: var(--color-faint); font-size: var(--text-xs); }
.overview-active-label { font-size: var(--text-sm) !important; }
.overview-active-state { display: block; }
.overview-idle { color: var(--color-ok) !important; }
.overview-notes { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: baseline; color: var(--color-muted); font-size: var(--text-xs); }
.overview-note-warn { color: var(--color-warn); }
.overview-note.is-ok { color: var(--color-ok); }
.overview-note.is-danger { color: var(--color-danger); }
.overview-alerts { display: grid; gap: 8px; margin-top: var(--space-xs); }
.overview-alert {
  display: flex; align-items: center; gap: 8px; min-height: 34px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--color-rule-soft); background: var(--color-surface-2);
  color: var(--color-ink); text-decoration: none; font-size: var(--text-xs);
}
.overview-alert:hover { border-color: var(--color-muted); background: var(--color-surface-3); }
.overview-alert .ui-icon:last-child { margin-left: auto; color: var(--color-faint); }
.overview-alert.is-danger { border-color: rgba(248, 113, 113, .35); background: var(--color-danger-soft); }
.overview-alert.is-warn { border-color: rgba(251, 191, 36, .3); background: var(--color-warn-soft); }
.overview-all-clear { display: inline-flex; align-items: center; gap: 8px; color: var(--color-ok); font-size: var(--text-xs); }
.overview-card-actions { display: flex; gap: var(--space-xs); flex-wrap: wrap; margin-top: 2px; }
.panel-section { margin-top: var(--space-lg); }

/* ---------- шапка зала и конвейер ---------- */
.hall-hero {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-lg); padding: var(--space-lg) 0 var(--space-md);
}
.hall-hero-copy { min-width: 0; }
.hall-hero h1 { margin: 0 0 8px; font-size: var(--text-2xl); line-height: 1.2; letter-spacing: -.025em; color: var(--color-ink-hi); }
.hall-hero-sub { max-width: 68ch; margin: 0; color: var(--color-muted); line-height: 1.55; }
.hall-hero-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hall-hero-actions { display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; justify-content: flex-end; }
.pipeline {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch; gap: 12px;
  padding: var(--space-sm); margin-bottom: var(--space-lg);
  border: 1px solid var(--color-rule); border-radius: var(--radius-lg);
  background: var(--color-surface-1);
}
.pipeline-node {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 2px;
  grid-template-areas: "label state" "name meta"; align-items: center; min-width: 0;
  padding: 8px 12px; border-radius: var(--radius-md);
  background: var(--color-surface-2); border: 1px solid var(--color-rule-soft);
}
.pipeline-node-label { grid-area: label; color: var(--color-faint); font-size: var(--text-xs); }
.pipeline-node strong { grid-area: name; color: var(--color-ink-hi); font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipeline-node-meta { grid-area: meta; justify-self: end; color: var(--color-muted); font-size: var(--text-xs); }
.pipeline-node-state { grid-area: state; justify-self: end; display: inline-flex; align-items: center; gap: 4px; color: var(--color-muted); font-size: var(--text-xs); }
.pipeline-node-state .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--color-faint); }
.pipeline-node-state.is-ok { color: var(--color-ok); }
.pipeline-node-state.is-ok .dot { background: var(--color-ok); }
.pipeline-node-state.is-warn { color: var(--color-warn); }
.pipeline-node-state.is-warn .dot { background: var(--color-warn); }
.pipeline-node-state.is-danger { color: var(--color-danger); }
.pipeline-node-state.is-danger .dot { background: var(--color-danger); }
.pipeline-node-state.is-muted { color: var(--color-faint); }
.pipeline-node-staging.is-live { border-color: rgba(34, 211, 238, .4); background: var(--color-live-soft); }
.pipeline-node-target { border-color: rgba(34, 211, 238, .25); }
.pipeline-arrow { display: grid; place-items: center; color: var(--color-faint); }

/* ---------- компактные игры ---------- */
.games-summary {
  margin-top: var(--space-lg); margin-bottom: var(--space-lg); padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-rule); border-radius: var(--radius-lg);
  background: var(--color-surface-1);
}
.games-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-sm); margin-bottom: 8px; }
.games-summary-head h2 { margin: 0; font-size: var(--text-md); color: var(--color-ink-hi); }
.games-summary-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.game-chip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0;
  padding: 8px; border: 1px solid var(--color-rule-soft);
  border-radius: var(--radius-md); background: var(--color-surface-2);
  color: var(--color-ink); text-decoration: none;
}
.game-chip:hover { border-color: var(--color-muted); background: var(--color-surface-3); }
.game-chip-icon { width: 18px; height: 18px; object-fit: contain; flex: none; }
.game-chip-name { font-weight: 600; color: var(--color-ink-hi); font-size: var(--text-sm); }
.game-chip-meta { flex: 1 0 100%; margin-left: 26px; min-width: 0; color: var(--color-faint); font-size: var(--text-xs); }
.games-summary-note { margin: 8px 0 0; color: var(--color-muted); font-size: var(--text-xs); }
.games-summary-note a { color: var(--color-focus); }

/* ---------- сценарии и приёмник ---------- */
.scenario-section { margin: var(--space-lg) 0; }
.scenario-section .section-head { margin-top: 0; }
.scenario-super-note { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; margin-top: var(--space-sm); }
.target-note {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  flex-wrap: wrap; padding: var(--space-md); margin: var(--space-md) 0;
  border: 1px solid var(--color-rule); border-radius: var(--radius-lg);
  background: var(--color-surface-1);
}
.target-note strong { color: var(--color-ink-hi); }
.target-note p { margin: 4px 0 0; color: var(--color-muted); font-size: var(--text-sm); }
.target-note-actions { display: flex; gap: var(--space-xs); flex-wrap: wrap; }

/* ---------- приёмка ---------- */
.acceptance-block { margin-top: var(--space-md); border: 1px solid var(--color-rule-soft); border-radius: var(--radius-lg); background: var(--color-surface-1); }
.acceptance-block > summary { cursor: pointer; padding: 12px 16px; display: flex; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap; color: var(--color-ink); font-weight: 500; }
.acceptance-block > summary:hover { background: var(--color-surface-2); }
.acceptance-block .shot-grid { padding: var(--space-md); border-top: 1px solid var(--color-rule-soft); }

/* ---------- вход и 404 ---------- */
.login-mark { display: inline-grid; place-items: center; width: 44px; height: 44px; color: var(--color-accent-hi); margin-bottom: var(--space-sm); }
.login-box h1 { margin: 0 0 8px; font-size: var(--text-xl); color: var(--color-ink-hi); }
.error-page { max-width: 620px; padding: var(--space-2xl) 0; }
.error-page h1 { margin: 0 0 12px; font-size: var(--text-3xl); line-height: 1.1; color: var(--color-ink-hi); letter-spacing: -.03em; }
.error-page-actions { display: flex; gap: var(--space-xs); flex-wrap: wrap; margin-top: var(--space-md); }

/* ---------- адаптив ---------- */
@media (max-width: 980px) {
  .overview-grid { grid-template-columns: 1fr; }
  .overview-statusline-route { margin-left: 0; }
  /* телефон: узлы конвейера сеткой 2×2 без стрелок — вместо четырёх экранов вертикали */
  .pipeline { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pipeline-arrow { display: none; }
  .pipeline-node { grid-template-areas: "label label" "name meta" "state state"; }
  .pipeline-node-state { justify-self: start; }
  /* вкладки — прокручиваемая строка на планшете, на телефоне переносятся */
  .tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
  .tab { flex: none; white-space: nowrap; }
  .overview-hero, .hall-hero { flex-direction: column; align-items: stretch; }
  .hall-hero-actions { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-hero-actions .btn { flex: 1 1 auto; }
  .games-summary-row { grid-template-columns: 1fr; }
  .game-chip-meta { margin-left: 0; }
  .scenario-bar { grid-template-columns: 1fr; }
  .hall-hero-actions .btn { flex: 1 1 auto; }
  .overview-statusline { gap: 8px 16px; }
  .mast-nav { overflow-x: auto; max-width: 100%; flex-wrap: nowrap; }
  .mast-link { min-height: 44px; display: inline-flex; align-items: center; }
  .btn-sm { min-height: 44px; }
  .tabs { flex-wrap: wrap; overflow-x: visible; }
  .tab { flex: 0 1 auto; min-height: 44px; display: inline-flex; align-items: center; }
  .acceptance-block > summary { min-height: 44px; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .hall-chip, .scenario-card, .game-chip, .overview-alert { transition: none; }
}

/* ---------- таблица ПК как карточки на узких экранах ---------- */
@media (max-width: 1100px) {
  .pc-table-card {
    overflow: visible; border: 0; border-radius: 0;
    background: transparent; box-shadow: none;
  }
  .pc-table, .pc-table tbody, .pc-table tr, .pc-table td { display: block; width: 100%; }
  .pc-table thead { display: none; }
  .pc-table tr[data-pc-row] {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 8px; padding: 2px 0;
    border: 1px solid var(--color-rule); border-radius: var(--radius-lg);
    background: var(--color-surface-1);
  }
  .pc-table tr[data-pc-row]:hover td { background: transparent; }
  .pc-table, .pc-table th, .pc-table td, .pc-table tr { box-sizing: border-box; }
  .pc-table td {
    display: block;
    padding: 4px 12px; border: 0;
  }
  table.grid.pc-table td { white-space: normal; }
  .pc-table td > .pill, .pc-table td > .badge-soft { justify-self: start; }
  .pc-table td::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    color: var(--color-faint); font-size: var(--text-xs);
  }
  .pc-table td.name {
    display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px;
    grid-column: 1 / -1;
    padding: 8px 12px 4px; border-bottom: 1px solid var(--color-rule-soft);
    font-size: var(--text-base);
  }
  .pc-table td.name::before { content: none; }
  .pc-table td.name .name-cell { flex-wrap: wrap; }
  .pc-table td[data-label="Сеанс"] { grid-column: 1 / -1; }
  .pc-table td.col-action {
    display: flex; align-items: flex-end; justify-content: flex-end;
    grid-column: 2; padding: 4px 12px 8px;
  }
  .pc-table td.col-action::before { content: none; }
  .pc-table td.col-action .btn { width: auto; min-width: 120px; min-height: 44px; }
  .pc-table td.mono { overflow-wrap: anywhere; }
  .pc-table tr.detail-row { display: none; }
  .pc-table tr.detail-row td { display: block; padding: 8px 12px; }
  .pc-table tr:has(.row-toggle:checked) + tr.detail-row { display: block; }
  .pc-table .facts { grid-template-columns: 1fr; gap: 8px; }
  .pc-table .facts > div { display: flex; justify-content: space-between; gap: 12px; }
  .pc-table .facts dt { color: var(--color-faint); }
  .pc-table .facts dd { text-align: right; }
}

@media (max-width: 720px) {
  .filter-chip { min-height: 44px; padding: 8px 12px; }
  .row-open { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; }
  .live-toggle .switch { min-height: 44px; align-items: center; }
  .search { min-height: 44px; }
  /* фильтры ПК на телефоне переносятся рядами — без скрытой ленты */
  .toolbar-main .filter-chips { flex-wrap: wrap; overflow-x: visible; }
  .toolbar-main .filter-chip { white-space: normal; }
}

.week-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.week-strip .check-inline {
  min-height: 38px; padding: 8px 12px; border: 1px solid var(--color-rule);
  border-radius: var(--radius-md); background: var(--color-surface-2);
  color: var(--color-muted);
}
.week-strip .check-inline:has(input:checked) {
  border-color: var(--color-accent); background: var(--color-accent-soft);
  color: var(--color-ink-hi);
}
.week-strip .check-inline input { accent-color: var(--color-accent); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-actions .btn { flex: 0 0 auto; }
@media (max-width: 720px) {
  .week-strip .check-inline { min-height: 44px; }
  .form-actions .btn { width: 100%; }
}

@media (max-width: 720px) {
  .mast-right { width: 100%; max-width: 100%; flex-wrap: wrap; gap: 8px; }
  .mast-nav { width: 100%; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .auto-toggle { max-width: 100%; }
  .pc-table, .pc-table th, .pc-table td, .pc-table tr { box-sizing: border-box; }
}

@media (max-width: 720px) {
  .btn { min-height: 44px; }
  .sort-btn { min-height: 44px; min-width: 44px; align-items: center; }
  .games-table th { padding-top: 4px; padding-bottom: 4px; }
}

.scenario-card:focus-visible,
.game-chip:focus-visible,
.overview-alert:focus-visible,
.filter-chip:focus-visible,
.table-link:focus-visible,
.sort-btn:focus-visible,
.acceptance-block > summary:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ---------- фильтры журналов ---------- */
.filter-bar {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding: 12px; margin: 0 0 12px;
  border: 1px solid var(--color-rule); border-radius: var(--radius-lg);
  background: var(--color-surface-1);
}
.filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.filter-field label { font-size: var(--text-xs); font-weight: 600; color: var(--color-faint); }
.filter-field .search { min-width: 0; }
.filter-field-hall { min-width: 190px; }
.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-left: auto; }
.list-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 12px; color: var(--color-faint); font-size: var(--text-xs);
}
.list-meta strong { color: var(--color-ink); font-weight: 600; }
@media (max-width: 720px) {
  .filter-bar { display: grid; grid-template-columns: 1fr; align-items: end; }
  .filter-field, .filter-field-hall { min-width: 0; }
  .filter-actions { margin-left: 0; }
  .filter-actions .btn { flex: 1 1 auto; }
}

/* ---------- job: сворачиваемый терминал и мобильная панель действий ---------- */
.terminal-card.is-collapsed .terminal { display: none; }
.terminal-toggle { min-width: 82px; }
.mobile-action-bar { display: none; }
@media (max-width: 720px) {
  .terminal-card { position: static; }
  .terminal { max-height: 260px; }
  .job-page:has(.mobile-action-bar) { padding-bottom: 88px; }
  .mobile-action-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky);
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--color-bg);
    background: color-mix(in srgb, var(--color-bg) 92%, transparent);
    border-top: 1px solid var(--color-rule);
    backdrop-filter: blur(10px);
  }
  .mobile-action-bar form { margin: 0; flex: 1 1 auto; }
  .mobile-action-bar .btn { width: 100%; min-height: 44px; }
  .mobile-action-bar > .btn { flex: 0 1 auto; width: auto; }
}

.table-scroll-hint { margin: 0 0 8px; color: var(--color-faint); font-size: var(--text-xs); }
@media (max-width: 1100px) { .table-scroll-hint { display: none; } }


/* ---------- дизайн-система: hero, переносы, motion ---------- */
.overview-hero h1, .hall-hero h1, .error-page h1 {
  max-width: 680px;
  text-wrap: balance;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--color-ink-hi);
}
.lead, .hall-hero-sub { max-width: 680px; text-wrap: pretty; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
.drawer-close:focus-visible, .task-option:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
@media (forced-colors: active) {
  .overview-hero h1, .hall-hero h1, .error-page h1 {
    background: none; color: CanvasText; -webkit-text-fill-color: CanvasText;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 720px) {
  .overview-hero h1, .error-page h1 { font-size: var(--text-2xl); line-height: 1.2; }
  .hall-hero h1 { font-size: var(--text-xl); line-height: 1.33; }
}

/* ---------- мобильное меню: полноэкранная панель ---------- */
@media (max-width: 960px) {
  /* меню здесь вынесено в полноэкранную панель (position: fixed), в строке остаются
     бренд и бургер — переносить их друг на друга нельзя, иначе высота шапки «прыгает» */
  .masthead { padding: 6px var(--space-md); flex-wrap: nowrap; margin: 0 calc(-1 * var(--space-lg)) var(--space-md); }
  .nav-toggle { display: inline-flex; position: relative; z-index: 400; }
  .mast-right {
    position: fixed;
    inset: 0;
    z-index: var(--z-drawer);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    padding: 80px var(--space-lg) var(--space-xl);
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(7, 10, 15, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--dur-short) var(--ease-out),
                transform var(--dur-short) var(--ease-out),
                visibility 0s linear var(--dur-short);
  }
  .masthead.is-open .mast-right {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
  }
  .mast-nav {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: var(--space-xs);
    width: 100%;
    max-width: 420px;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
  }
  .mast-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 0;
    border-radius: 0;
    border-bottom: 1px solid var(--color-rule-soft);
    font-size: var(--text-xl);
    font-weight: 600;
  }
  .mast-link.is-active { background: transparent; box-shadow: none; color: var(--color-accent-hi); }
  .mast-link:hover { background: transparent; color: var(--color-ink-hi); }
  .auto-toggle { align-self: center; }
  .masthead.is-open .mast-link { animation: nav-link-in var(--dur-micro) var(--ease-out) both; }
  .masthead.is-open .mast-link:nth-child(1) { animation-delay: 0ms; }
  .masthead.is-open .mast-link:nth-child(2) { animation-delay: 40ms; }
  .masthead.is-open .mast-link:nth-child(3) { animation-delay: 80ms; }
  .masthead.is-open .mast-link:nth-child(4) { animation-delay: 120ms; }
  .masthead.is-open .mast-link:nth-child(5) { animation-delay: 160ms; }
  .masthead.is-open .mast-link:nth-child(6) { animation-delay: 200ms; }
}
@keyframes nav-link-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .masthead.is-open .mast-link { animation: none; }
}

/* ---------- карта ПК + модалка карточки ---------- */
.pc-map-layout { display: grid; gap: var(--space-md); align-items: start; grid-template-columns: minmax(0, 1fr); }
.pc-map { display: grid; gap: var(--space-md); min-width: 0; }
.pc-group { background: var(--color-surface-1); border: 1px solid var(--color-rule); border-radius: var(--radius-lg); padding: var(--space-md); }
.pc-group[hidden] { display: none; }
.pc-group-head { display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; margin-bottom: var(--space-sm); }
.pc-group-head h3 { margin: 0; font-size: var(--text-md); }
.pc-tiles { display: grid; gap: var(--space-xs); grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.pc-tile {
  position: relative; display: grid; gap: 2px; justify-items: start; text-align: left;
  min-height: 64px; padding: var(--space-xs) 10px; cursor: pointer;
  font: inherit; color: var(--color-ink);
  background: var(--color-surface-2); border: 1px solid var(--color-rule); border-left-width: 4px;
  border-radius: var(--radius-md);
  transition: background-color var(--dur-micro), border-color var(--dur-micro);
}
.pc-tile:hover { background: var(--color-surface-3); }
.pc-tile:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.pc-tile[aria-pressed="true"] { background: var(--color-accent-soft); border-color: var(--color-accent); }
.pc-tile-num { font-family: var(--font-mono); font-size: var(--text-md); font-weight: 600; }
.pc-tile-state { display: block; width: 100%; min-width: 0; font-size: var(--text-xs); color: var(--color-muted); white-space: normal; overflow-wrap: normal; }
.pc-tile.is-busy .pc-tile-state,
.pc-tile.is-super .pc-tile-state,
.pc-tile.is-powering .pc-tile-state { position: relative; padding-left: 10px; }
.pc-tile.is-busy .pc-tile-state::before,
.pc-tile.is-super .pc-tile-state::before,
.pc-tile.is-powering .pc-tile-state::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}
.pc-tile.is-off .pc-tile-state { color: var(--color-faint); }
.pc-tile-flag { position: absolute; top: 4px; right: 8px; color: var(--color-warn); font-weight: 700; }
.pc-tile.is-free { border-left-color: var(--color-ok); }
.pc-tile.is-busy { border-left-color: var(--color-live); }
.pc-tile.is-off { border-left-color: var(--color-rule); }
.pc-tile.is-off .pc-tile-num { color: var(--color-muted); }
.pc-tile.is-super { border-left-color: var(--color-danger); }
.pc-tile.is-unknown { border-left-color: var(--color-warn); }
.pc-tile.is-service { border-left-color: var(--color-warn); }
.pc-tile.is-powering { border-left-color: var(--color-accent); animation: pc-power-pulse 1.6s ease-in-out infinite; }
.grid-usb td:first-child { white-space: nowrap; }
.grid-usb tr.usb-storage-row td { background: rgba(245, 158, 11, .07); }
.pc-tile-power { font-size: var(--text-xs); color: var(--color-muted); line-height: 1.2; }
.pc-tile-power.is-error { color: var(--color-danger); }
@keyframes pc-power-pulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 0 3px var(--color-accent-soft); }
}
@media (prefers-reduced-motion: reduce) {
  .pc-tile.is-powering { animation: none; }
}
.pc-legend { display: flex; flex-wrap: wrap; gap: var(--space-md); margin: 0; padding: 0; list-style: none; font-size: var(--text-xs); color: var(--color-muted); }
.pc-legend li { display: flex; align-items: center; gap: 6px; }
.pc-swatch { width: 4px; height: 14px; border-radius: 2px; background: var(--color-rule); }
.pc-swatch.is-free { background: var(--color-ok); }
.pc-swatch.is-busy { background: var(--color-live); }
.pc-swatch.is-super { background: var(--color-danger); }
/* ---------- карточка ПК в модалке ---------- */
body.pc-modal-open { overflow: hidden; }
.pc-modal {
  width: min(820px, calc(100vw - 32px)); max-width: 820px;
  max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 0;
  border-radius: var(--radius-xl); background: transparent; color: var(--color-ink);
}
.pc-modal::backdrop {
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.pc-modal[open] .pc-modal-card { animation: dialog-in var(--dur-short) var(--ease-out); }
.pc-modal-card {
  position: relative; display: flex; flex-direction: column;
  max-height: calc(100dvh - 48px); overflow: hidden;
  background: linear-gradient(180deg, var(--color-surface-1), var(--color-bg));
  border: 1px solid var(--color-rule); border-radius: var(--radius-xl);
  box-shadow: inset 0 1px 0 var(--color-highlight-top), var(--shadow-lg);
}
.pc-modal-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--color-ok); z-index: 2;
}
.pc-modal-card.is-busy::before { background: var(--color-live); }
.pc-modal-card.is-super::before { background: var(--color-danger); }
.pc-modal-card.is-service::before { background: var(--color-warn); }
.pc-modal-card.is-unknown::before { background: var(--color-warn); }
.pc-modal-card.is-off::before { background: var(--color-rule); }
:root[data-theme="light"] .pc-modal-card { background: var(--color-surface-1); }

.pc-modal-head {
  flex: none; display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-md); padding: 18px 20px 14px;
  border-bottom: 1px solid var(--color-rule-soft);
  background: linear-gradient(180deg, var(--color-accent-soft), transparent 75%);
}
.pc-modal-title-block { min-width: 0; }
.pc-modal-eyebrow {
  margin-bottom: 2px; font-size: var(--text-xs); color: var(--color-faint);
}
.pc-modal-title-row {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.pc-modal-title-row h2 {
  margin: 0; flex: none; font-family: var(--font-display); font-size: var(--text-xl);
  line-height: 1.1; letter-spacing: -0.02em; color: var(--color-ink-hi);
}
.pc-modal-pills {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px;
}
.pc-modal-head-actions {
  display: flex; align-items: center; gap: 6px; flex: none;
}
.pc-ip-copy {
  display: inline-flex; align-items: center; min-height: 28px; padding: 2px 8px;
  border-radius: var(--radius-sm); border: 1px solid var(--color-rule-soft);
  background: var(--color-surface-2); color: var(--color-muted);
  font-size: var(--text-xs); cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.pc-ip-copy:hover {
  color: var(--color-ink-hi); border-color: var(--color-accent-border);
  background: var(--color-accent-soft);
}

.pc-modal-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 16px 20px; display: grid; gap: 12px; align-content: start;
}
.pc-modal-columns {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px; align-items: start;
}
.pc-modal-section {
  display: grid; gap: 10px; padding: 14px 16px;
  border-radius: var(--radius-lg); background: var(--color-surface-1);
  border: 1px solid var(--color-rule-soft);
}
.pc-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.pc-section-head h3 {
  margin: 0; font-size: var(--text-sm); font-weight: 700; color: var(--color-ink-hi);
}
.pc-section-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.pc-section-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pc-section-tools form { margin: 0; }

.pc-kv-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px; margin: 0;
}
.pc-kv-grid > div {
  min-width: 0; padding: 8px 10px; border-radius: var(--radius-md);
  background: var(--color-surface-2); border: 1px solid var(--color-rule-soft);
}
.pc-kv-grid > div.is-wide { grid-column: 1 / -1; }
.pc-kv-grid dt {
  margin-bottom: 2px; font-size: var(--text-xs); color: var(--color-faint);
}
.pc-kv-grid dd {
  margin: 0; font-size: var(--text-sm); color: var(--color-ink-hi);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pc-kv-grid dd .badge-soft { margin-left: 4px; }
.pc-card-more { margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--color-rule-soft); }
.pc-card-more summary {
  cursor: pointer; list-style: none; font-size: var(--text-sm); color: var(--color-muted);
}
.pc-card-more summary::-webkit-details-marker { display: none; }
.pc-card-more summary::before {
  content: "▸"; display: inline-block; width: 1em; margin-right: 2px;
  transition: transform var(--dur-fast) var(--ease-out);
}
.pc-card-more[open] summary::before { transform: rotate(90deg); }
.pc-card-more summary:hover { color: var(--color-ink); }
.pc-card-more .table-card { margin-top: 8px; }

.pc-modal-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; padding: 12px 20px;
  border-top: 1px solid var(--color-rule); background: var(--color-surface-1);
}
.pc-modal-power-group,
.pc-modal-primary-group {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pc-modal-primary-group { margin-left: auto; }
.pc-modal-foot form { margin: 0; }
.btn-danger-ghost {
  background: transparent; border-color: var(--color-rule); color: var(--color-muted);
}
.btn-danger-ghost:hover {
  color: var(--color-danger); border-color: var(--color-danger-border);
  background: var(--color-danger-soft);
}
.pc-modal-loading { margin: 0; padding: 48px 24px; text-align: center; color: var(--color-muted); }
.pc-modal-close { flex: none; }
@media (max-width: 720px) {
  .pc-modal { width: calc(100vw - 16px); max-height: calc(100dvh - 24px); }
  .pc-modal-card { max-height: calc(100dvh - 24px); }
  .pc-modal-columns { grid-template-columns: 1fr; }
  .pc-modal-head { padding: 14px 16px 12px; }
  .pc-modal-body { padding: 12px 16px; }
  .pc-modal-foot { padding: 10px 16px; }
  .pc-modal-primary-group { width: 100%; margin-left: 0; justify-content: flex-end; }
}


/* ---------- левая навигация (десктоп) ---------- */
.side-nav { display: none; }
.side-nav-title {
  padding: 12px 10px 4px; font-size: var(--text-xs); color: var(--color-faint);
}
.side-hall {
  display: flex; align-items: center; gap: 8px; line-height: 1.25;
  padding: 7px 10px; border-left: 2px solid transparent; border-radius: var(--radius-sm);
  font-size: var(--text-sm); color: var(--color-muted); text-decoration: none;
  transition: color var(--dur-short), background-color var(--dur-short);
}
.side-hall:hover { color: var(--color-ink-hi); background: var(--color-surface-2); }
.side-hall.is-active { color: var(--color-ink-hi); background: var(--color-accent-soft); border-left-color: var(--color-accent); }
.side-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--color-faint); }
.side-dot.is-ok { background: var(--color-ok); }
.side-dot.is-off { background: var(--color-danger); }
.side-hall-count { margin-left: auto; font-size: var(--text-xs); color: var(--color-faint); }
@media (min-width: 1100px) {
  .page:has(.side-nav) {
    max-width: 1440px; display: grid;
    grid-template-columns: 208px minmax(0, 1fr); column-gap: var(--space-lg);
    align-items: start;
  }
  .page:has(.side-nav) .masthead,
  .page:has(.side-nav) .colophon { grid-column: 1 / -1; }
  .side-nav { display: grid; gap: 1px; grid-row: 2; grid-column: 1; align-self: start; position: sticky; top: 64px; }
  .page:has(.side-nav) #main { grid-column: 2; grid-row: 2; min-width: 0; }
  .page:has(.side-nav) .mast-nav {
    background: transparent; border: 0; padding: 0;
  }
  .page:has(.side-nav) .mast-nav .mast-link:not(.mast-logout) { display: none; }
}
.side-hall-count { white-space: nowrap; }

/* ---------- «Нужно решение» на обзоре ---------- */
.decisions {
  margin: 0 0 var(--space-lg); padding: var(--space-md);
  border: 1px solid var(--color-rule); border-radius: var(--radius-lg);
  background: var(--color-surface-1);
}
.decisions.is-danger { border-color: rgba(248, 113, 113, 0.35); background: var(--color-danger-soft); }
.decisions-head { display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; margin-bottom: var(--space-sm); }
.decisions-head h2 { margin: 0; font-size: var(--text-md); }
.decisions-count {
  display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 999px; background: var(--color-surface-3); color: var(--color-ink-hi);
  border: 1px solid var(--color-muted); font-size: var(--text-xs); font-weight: 700;
}
.decisions.is-danger .decisions-count { background: var(--color-danger); color: #0B0D11; }
.decisions-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.decisions-list .overview-alert { background: var(--color-surface-1); }
.decisions-hall { color: var(--color-ink-hi); font-weight: 600; white-space: nowrap; }
.decisions-clear {
  display: flex; align-items: center; gap: 8px; margin: 0 0 var(--space-lg);
  font-size: var(--text-sm); color: var(--color-muted);
}
.decisions-clear .ui-icon { color: var(--color-ok); }

/* ---------- панель запуска: три шага ---------- */
.launch-step {
  display: grid; gap: var(--space-sm);
  padding-top: var(--space-md); border-top: 1px solid var(--color-rule-soft);
}
.launch-step:first-child { padding-top: 0; border-top: 0; }
.launch-step-title {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: var(--text-xs);
  color: var(--color-muted);
}
.launch-step-num {
  display: grid; place-items: center; width: 22px; height: 22px; flex: none;
  border-radius: 50%; background: var(--color-surface-3); color: var(--color-ink-hi);
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0;
}
.field-tight { margin-bottom: var(--space-2xs); }
.launch-ready { margin: 0; font-size: var(--text-xs); color: var(--color-faint); }
.launch-ready.is-ok { color: var(--color-ok); }
.launch-ready.is-blocked { color: var(--color-danger); }

/* ---------- светлая тема: точечные переопределения жёстких цветов ---------- */
:root[data-theme="light"] ::selection { background: var(--color-accent); color: #fff; }
:root[data-theme="light"] .masthead::before { background: rgba(243, 245, 249, 0.92); }
:root[data-theme="light"] .masthead { box-shadow: none; }
:root[data-theme="light"] table.grid tbody tr:hover td { background: rgba(11, 13, 17, 0.025); }
:root[data-theme="light"] .attention-banner strong { color: var(--color-ink-hi); }
:root[data-theme="light"] .terminal-card,
:root[data-theme="light"] .terminal { border-color: #22262E; }
:root[data-theme="light"] .theme-toggle { background: var(--color-surface-1); }

/* ---------- переключатель темы ---------- */
.theme-toggle {
  font: inherit; font-size: var(--text-xs); color: var(--color-muted);
  background: var(--color-surface-1); border: 1px solid var(--color-rule-soft);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; white-space: nowrap;
  transition: color var(--dur-short), border-color var(--dur-short);
}
.theme-toggle:hover { color: var(--color-ink-hi); border-color: var(--color-rule); }
.theme-toggle:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
:root[data-theme="light"] .btn-primary,
:root[data-theme="light"] .btn-primary:hover,
:root[data-theme="light"] .mast-link.is-active,
:root[data-theme="light"] .skip-link { color: #fff; }

/* ---------- словарь ---------- */
.glossary { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.glossary-group {
  padding: var(--space-md); background: var(--color-surface-1);
  border: 1px solid var(--color-rule); border-radius: var(--radius-lg);
}
.glossary-group h2 { margin: 0 0 var(--space-sm); font-size: var(--text-md); }
.glossary-group dl { display: grid; gap: var(--space-sm); margin: 0; }
.glossary-group dt { font-weight: 600; color: var(--color-ink-hi); }
.glossary-group dd { margin: 2px 0 0; font-size: var(--text-sm); color: var(--color-muted); }

/* ---------- утилиты отступов (замена одноразовых inline style) ---------- */
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-2xs { margin-top: var(--space-2xs) !important; }
.mt-xs { margin-top: var(--space-xs) !important; }
.mt-sm { margin-top: var(--space-sm) !important; }
.mt-md { margin-top: var(--space-md) !important; }
.mt-xl { margin-top: var(--space-xl) !important; }
.mb-md { margin-bottom: var(--space-md) !important; }
.mb-lg { margin-bottom: var(--space-lg) !important; }
.min-w-0 { min-width: 0 !important; }
.text-none { text-decoration: none !important; }
.cursor-pointer { cursor: pointer !important; }

/* ---------- экран ПК (noVNC) ---------- */
body.vnc-page {
  margin: 0; height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column; background: var(--color-bg);
}
.vnc-bar {
  display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap;
  padding: 8px var(--space-md); border-bottom: 1px solid var(--color-rule);
  background: var(--color-surface-1); flex: none;
}
.vnc-title { font-size: var(--text-md); color: var(--color-ink-hi); margin-right: 4px; }
.vnc-hint { font-size: var(--text-xs); color: var(--color-faint); }
.vnc-bar .spacer { flex: 1 1 auto; }
.vnc-frame { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: #000; }
.vnc-error { padding: var(--space-lg); }
@media (max-width: 720px) {
  .vnc-hint { display: none; }
  .vnc-bar { padding: 6px 8px; }
}

/* ---------- экран ПК: пресеты качества ---------- */
.vnc-quality {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px; border: 1px solid var(--color-rule-soft);
  border-radius: var(--radius-md); background: var(--color-surface-2);
}
.vnc-quality .filter-chip { padding: 3px 8px; }

/* ---------- питание ПК ---------- */
.power-actions { display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; margin-bottom: var(--space-sm); }
.power-actions form { margin: 0; }
.power-force { margin-top: var(--space-xs); }
.power-force summary { cursor: pointer; color: var(--color-warn); font-size: var(--text-sm); }
.power-force-body { display: grid; gap: var(--space-xs); margin-top: var(--space-xs); padding: var(--space-sm); border: 1px solid rgba(248, 113, 113, .35); border-radius: var(--radius-md); background: var(--color-danger-soft); }
.confirm-ack { display: flex; align-items: center; gap: 8px; margin: 0 0 var(--space-sm); font-size: var(--text-sm); color: var(--color-ink); }
.confirm-ack[hidden] { display: none; }
.confirm-ok[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- выбор ПК для пакетного питания: Ctrl/Cmd+клик ---------- */
.pc-tile.is-picked { border-color: var(--color-accent); background: var(--color-accent-soft); }
.pc-tile.is-picked::after {
  content: "✓"; position: absolute; top: 4px; right: 8px;
  width: 18px; height: 18px; display: grid; place-items: center;
  border-radius: 50%; background: var(--color-accent); color: #fff;
  font-size: var(--text-xs); font-weight: 700; line-height: 1;
}
tr[data-pc-row].is-picked td { background: var(--color-accent-soft); }
tr[data-pc-row].is-picked td:first-child { box-shadow: inset 3px 0 0 var(--color-accent); }
.pc-bulk-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--color-bg) 94%, transparent);
  border-top: 1px solid var(--color-rule);
  backdrop-filter: blur(10px);
}
.pc-bulk-bar[hidden] { display: none; }
.pc-bulk-bar form { display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; max-width: 1320px; margin: 0 auto; }
.pc-bulk-count { font-size: var(--text-sm); color: var(--color-muted); white-space: nowrap; }
.pc-bulk-count strong { color: var(--color-ink-hi); }
.pc-bulk-force { margin: 0; white-space: nowrap; }
body.pc-has-selection main { padding-bottom: 84px; }

/* ---------- выход как POST-форма: выглядит как обычная ссылка шапки ---------- */
.mast-form { display: contents; margin: 0; }
button.mast-link {
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  background: none;
  border: 0;
  cursor: pointer;
}

/* ---------- баннер связи при мягком обновлении (нет связи / сессия истекла) ---------- */
.live-banner {
  margin: 0 auto var(--space-sm);
  max-width: var(--page-max, 1200px);
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--color-warn);
  border-radius: var(--radius-md);
  background: var(--color-warn-soft);
  color: var(--color-warn);
  font-size: var(--text-sm);
}
.live-banner a { color: inherit; font-weight: 600; text-decoration: underline; }

/* ---------- контекстное меню питания ---------- */
.pc-menu {
  position: fixed; z-index: var(--z-toast); min-width: 218px; max-width: 310px;
  padding: 4px; background: var(--color-surface-1); color: var(--color-ink);
  border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.pc-menu[hidden] { display: none; }
.pc-menu-head {
  padding: 6px 10px 8px; font-size: var(--text-xs); color: var(--color-faint);
  border-bottom: 1px solid var(--color-rule-soft); margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pc-menu button, .pc-menu a[href] {
  display: flex; align-items: center; width: 100%; min-height: 32px;
  padding: 6px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--color-ink); text-decoration: none;
  font: inherit; font-size: var(--text-sm); text-align: left; cursor: pointer;
}
.pc-menu button:hover:not([disabled]), .pc-menu a[href]:hover {
  background: var(--color-surface-2); color: var(--color-ink-hi);
}
.pc-menu button:focus-visible, .pc-menu a[href]:focus-visible {
  outline: 2px solid var(--color-focus); outline-offset: -2px;
}
.pc-menu button[disabled] { opacity: 0.45; cursor: not-allowed; }
.pc-menu .is-danger { color: var(--color-danger); }
.pc-menu .is-danger:hover:not([disabled]) { background: var(--color-danger-soft); }
.pc-menu-sep { height: 1px; margin: 4px 6px; background: var(--color-rule-soft); }
.pc-menu-note {
  padding: 8px 10px; font-size: var(--text-xs); color: var(--color-muted);
  line-height: 1.35;
}

/* ---------- главная: стена ПК всех залов ---------- */
.overview-hero-compact { padding-block: var(--space-sm); margin-bottom: var(--space-sm); }
.overview-hero-compact h1 { margin: 0; font-size: var(--text-2xl); }
.overview-grid-secondary { margin-top: var(--space-lg); }

.club { display: grid; gap: var(--space-md); margin-bottom: var(--space-xl); }
.club-head { display: flex; align-items: flex-end; gap: var(--space-sm); flex-wrap: wrap; }
.club-title { margin: 0; font-size: var(--text-xl); color: var(--color-ink-hi); }

/* Полоса счётчиков = фильтры (как верхняя панель SmartShell) + поиск */
.club-toolbar { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; margin: 0; }
.club-stats { display: flex; gap: 6px; flex-wrap: wrap; flex: 0 1 auto; }
.stat-chip {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  padding: var(--space-2xs) 10px; min-height: var(--control-h); font: inherit; cursor: pointer;
  color: var(--color-ink); background: var(--color-surface-2);
  border: 1px solid var(--color-rule); border-bottom-width: 3px; border-radius: var(--radius-md);
  transition: background-color var(--dur-micro), border-color var(--dur-micro);
}
.stat-chip strong { font-size: var(--text-md); font-variant-numeric: tabular-nums; }
.stat-chip span { font-size: var(--text-sm); color: var(--color-muted); }
.stat-chip:hover { background: var(--color-surface-3); }
.stat-chip:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.stat-chip.is-free { border-bottom-color: var(--color-ok); }
.stat-chip.is-busy { border-bottom-color: var(--color-live); }
.stat-chip.is-off { border-bottom-color: var(--color-rule); }
.stat-chip.is-warn, .stat-chip.is-unknown { border-bottom-color: var(--color-warn); }
.stat-chip.is-super { border-bottom-color: var(--color-danger); }
.stat-chip.is-active { background: var(--color-accent-soft); border-color: var(--color-accent); color: var(--color-ink-hi); }
.stat-chip.is-active span { color: inherit; }

.club-search {
  display: inline-flex; align-items: center; gap: var(--space-xs); flex: 1 1 160px; min-width: 160px; max-width: 280px; margin-left: auto;
  padding: 0 var(--space-sm); background: var(--color-surface-2);
  border: 1px solid var(--color-rule); border-radius: var(--radius-md); color: var(--color-muted);
}
.club-search:focus-within { border-color: var(--color-accent); }
.club-search input {
  flex: 1; min-width: 0; padding: var(--space-xs) 0; font: inherit; color: var(--color-ink);
  background: none; border: 0; outline: none;
}

.club-halls { gap: var(--space-lg); }
.wall-hall { display: grid; gap: var(--space-sm); }
.wall-hall[hidden] { display: none; }
.wall-hall-head { display: flex; align-items: center; gap: var(--space-xs) var(--space-sm); flex-wrap: wrap; }
.wall-hall-head h3 { margin: 0; font-size: var(--text-lg); }
.wall-hall-head h3 a { display: inline-flex; align-items: center; min-height: 28px; color: var(--color-ink-hi); text-decoration: none; }
.wall-hall-head h3 a:hover { text-decoration: underline; }
.wall-hall-meta { font-size: var(--text-sm); color: var(--color-muted); }
.wall-hall .pc-group-head h4 { margin: 0; font-size: var(--text-md); }
.wall-loading { margin: 0; }

/* Богатая плитка: клиент и остаток времени */
.pc-tiles-rich { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.pc-tiles-rich .pc-tile { min-height: 72px; }
.pc-tile-meta {
  max-width: 100%; white-space: normal; overflow-wrap: anywhere;
  font-size: var(--text-xs); line-height: 1.25; color: var(--color-live);
}
.pc-tile.is-selected { border-color: var(--color-accent); box-shadow: 0 0 0 1px var(--color-accent); }

@media (max-width: 720px) {
  /* счётчики переносятся рядами — все чипы доступны без скрытой прокрутки */
  .club-stats { flex-wrap: wrap; }
  .stat-chip { flex: 0 1 auto; }
  .club-search { flex: 1 1 100%; max-width: none; margin-left: 0; }
  .pc-tiles-rich { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}


/* ==================================================================
 * Production UI Polish: Единая система статусов, живые анимации,
 * микроинтеракции, индикатор синхронизации и доступность.
 * ================================================================== */

/* ---------- 1. Семантические статусы (.pill.live, токенизированные границы, радар-пульс) ---------- */
.pill {
  gap: 6px;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.pill .dot {
  position: relative;
  width: 6px;
  height: 6px;
}
.pill.ok {
  border-color: var(--color-ok-border);
}
.pill.warn {
  border-color: var(--color-warn-border);
}
.pill.danger {
  border-color: var(--color-danger-border);
}
.pill.accent {
  border-color: var(--color-accent-border);
}
.pill.live {
  color: var(--color-live);
  border-color: var(--color-live-border);
  background: var(--color-live-soft);
}
.pill.live .dot {
  background: var(--color-live);
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.55);
  animation: radar-live 2s var(--ease-std) infinite;
}
.pill.warn .dot {
  animation: radar-warn 2.2s var(--ease-std) infinite;
}
.pill.danger[data-state="super"] .dot,
.pill.danger[data-state="disconnected"] .dot,
.pill.danger[data-state="failed"] .dot {
  animation: radar-danger 2.4s var(--ease-std) infinite;
}

@keyframes radar-live {
  0%   { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}
@keyframes radar-warn {
  0%   { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.50); opacity: 1; }
  55%  { box-shadow: 0 0 0 5px rgba(251, 191, 36, 0); opacity: 0.7; }
  100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); opacity: 1; }
}
@keyframes radar-danger {
  0%   { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.50); }
  70%  { box-shadow: 0 0 0 5px rgba(248, 113, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0); }
}

.badge-danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border-color: var(--color-danger-border);
}
.badge-violet {
  background: var(--color-accent-soft);
  color: var(--color-focus);
  border-color: var(--color-accent-border);
}

/* ---------- 2. Индикатор живой синхронизации в топбаре ---------- */
.live-sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-rule-soft);
  background: var(--color-surface-1);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  transition: border-color var(--dur-micro) var(--ease-out),
              color var(--dur-micro) var(--ease-out),
              background-color var(--dur-micro) var(--ease-out);
}
.live-sync[hidden] { display: none; }
.live-sync .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-ok);
  flex: none;
}
.live-sync.is-syncing {
  border-color: var(--color-live-border);
  color: var(--color-live);
}
.live-sync.is-syncing .dot {
  background: var(--color-live);
  animation: radar-live 1s var(--ease-std) infinite;
}
.live-sync.is-offline,
.live-sync.is-expired {
  border-color: var(--color-warn-border);
  background: var(--color-warn-soft);
  color: var(--color-warn);
}
.live-sync.is-offline .dot,
.live-sync.is-expired .dot {
  background: var(--color-warn);
  animation: radar-warn 1.8s var(--ease-std) infinite;
}

/* ---------- 3. Улучшенные карточки, KPI и глубина поверхностей ---------- */
.kpi-box,
.overview-card,
.hall-card,
.pc-group {
  box-shadow: inset 0 1px 0 var(--color-highlight-top);
  transition: border-color var(--dur-micro) var(--ease-out),
              box-shadow var(--dur-micro) var(--ease-out);
}
.overview-card:hover {
  border-color: var(--color-muted);
  box-shadow: inset 0 1px 0 var(--color-highlight-top), var(--shadow-sm);
}
.overview-card.is-source:hover {
  border-color: var(--color-accent-border);
}

/* ---------- 4. Плитки ПК: статусы, hover, дифф-подсветка при обновлении ---------- */
.pc-tile {
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-micro) var(--ease-out);
}
.pc-tile:hover {
  background: var(--color-surface-3);
  border-color: var(--color-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.pc-tile:active {
  transform: translateY(0);
}
.pc-tile.is-busy:hover { border-left-color: var(--color-live); }
.pc-tile.is-free:hover { border-left-color: var(--color-ok); }
.pc-tile.is-super {
  background: color-mix(in srgb, var(--color-surface-2) 92%, var(--color-danger) 8%);
}
.pc-tile.is-super .pc-tile-state {
  color: var(--color-danger);
  font-weight: 600;
}
.pc-tile.is-super .pc-tile-state::before {
  animation: radar-danger 2.2s var(--ease-std) infinite;
}
.pc-tile.is-service .pc-tile-state {
  color: var(--color-warn);
}
.pc-tile.is-service .pc-tile-state::before {
  background: var(--color-warn);
}
.pc-tile.is-powering {
  border-left-color: var(--color-live);
  background: color-mix(in srgb, var(--color-surface-2) 90%, var(--color-live) 10%);
  animation: pc-power-pulse 1.6s var(--ease-std) infinite;
}
.pc-tile.is-powering .pc-tile-state {
  color: var(--color-live);
  font-weight: 500;
}
.pc-tile.is-powering .pc-tile-state::before {
  background: var(--color-live);
  animation: radar-live 1.4s var(--ease-std) infinite;
}
.pc-tile.is-just-changed {
  animation: pc-state-flash 1.4s var(--ease-out);
}
@keyframes pc-state-flash {
  0%   { box-shadow: var(--shadow-ring-live); border-color: var(--color-live); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes pc-power-pulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50%      { box-shadow: var(--shadow-ring-live); }
}

.pc-swatch.is-service { background: var(--color-warn); }
.pc-swatch.is-powering { background: var(--color-live); }
.pc-swatch.is-unknown { background: var(--color-warn); opacity: 0.65; }

/* ---------- 5. Плавное появление модалки ПК, меню, bulk-бара и диалогов ---------- */
.pc-modal[open] {
  animation: side-panel-in var(--dur-short) var(--ease-out);
  box-shadow: inset 0 1px 0 var(--color-highlight-top), var(--shadow-md);
}
@keyframes side-panel-in {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.pc-menu:not([hidden]) {
  animation: menu-pop-in var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-lg);
}
@keyframes menu-pop-in {
  from { opacity: 0; transform: scale(0.96) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.pc-bulk-bar:not([hidden]) {
  animation: bulk-bar-up var(--dur-short) var(--ease-out);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
}
@keyframes bulk-bar-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.confirm-dialog[open] {
  animation: dialog-in var(--dur-micro) var(--ease-out);
  box-shadow: var(--shadow-lg);
}
.confirm-dialog::backdrop {
  background: rgba(5, 8, 14, 0.68);
  backdrop-filter: blur(4px);
}
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.live-banner {
  animation: banner-slide-in var(--dur-short) var(--ease-out);
}
@keyframes banner-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

tr:has(.row-toggle:checked) + tr.detail-row td {
  animation: detail-fade-in var(--dur-micro) var(--ease-out);
}
@keyframes detail-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- 6. Полоса прогресса с живым shimmer и статусами ---------- */
.progress-track {
  position: relative;
  height: 6px;
}
.progress-fill {
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-short) var(--ease-out),
              background-color var(--dur-short) var(--ease-out);
}
.progress-fill.is-active {
  background: linear-gradient(90deg, var(--color-accent), var(--color-live));
}
.progress-fill.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.32) 50%,
    transparent 100%
  );
  animation: progress-shimmer 1.8s linear infinite;
}
.progress-fill.is-warn { background: var(--color-warn); }
.progress-fill.is-danger { background: var(--color-danger); }
.progress-fill.is-ok { background: var(--color-ok); }

@keyframes progress-shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ---------- 7. Полоса активной задачи, конвейер и этапы операций ---------- */
.task-strip {
  transition: border-color var(--dur-short) var(--ease-out),
              box-shadow var(--dur-short) var(--ease-out);
}
.task-strip-head {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}
.task-strip.is-running {
  border-color: var(--color-live-border);
  box-shadow: inset 0 1px 0 var(--color-highlight-top), var(--shadow-md);
}
.task-strip.is-awaiting {
  border-color: var(--color-warn-border);
  box-shadow: inset 0 1px 0 var(--color-highlight-top), var(--shadow-md);
}

.pipeline-node {
  transition: border-color var(--dur-micro) var(--ease-out),
              background-color var(--dur-micro) var(--ease-out);
}
.pipeline-node-target.is-warn {
  border-color: var(--color-warn-border);
}
.pipeline.is-live .pipeline-arrow {
  color: var(--color-live);
  animation: pipeline-flow 1.8s var(--ease-std) infinite;
}
.pipeline.is-live .pipeline-arrow:nth-of-type(2) { animation-delay: 0.25s; }
.pipeline.is-live .pipeline-arrow:nth-of-type(3) { animation-delay: 0.5s; }

@keyframes pipeline-flow {
  0%, 100% { opacity: 0.45; transform: translateX(0); }
  50%      { opacity: 1; transform: translateX(3px); }
}

.op, .op-focus {
  transition: border-color var(--dur-micro) var(--ease-out),
              background-color var(--dur-micro) var(--ease-out);
}
.op-running, .op-focus-running {
  border-color: var(--color-live-border);
}
.op-running .op-dot,
.op-focus-running .op-dot,
.step.running .step-mark {
  animation: radar-live 1.8s var(--ease-std) infinite;
}
.op-waiting, .op-focus-waiting {
  border-color: var(--color-warn-border);
}
.op-waiting .op-dot,
.op-focus-waiting .op-dot,
.step.awaiting .step-mark {
  animation: radar-warn 2s var(--ease-std) infinite;
}
.op-error, .op-focus-error {
  border-color: var(--color-danger-border);
}
.op-ok, .op-focus-ok {
  border-color: var(--color-ok-border);
}

.mission-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-sm);
  margin-bottom: var(--space-2xs);
  font-size: var(--text-xs);
  color: var(--color-muted);
}

/* ---------- 8. Индикатор загрузки (спиннер) внутри занятых кнопок ---------- */
.btn[aria-busy="true"] {
  position: relative;
  opacity: 0.85;
  cursor: progress;
}
.btn[aria-busy="true"]::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  flex: none;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ---------- 9. Поиск, счётчик фильтра, горячая клавиша и пустое состояние ---------- */
.filter-count {
  font-size: var(--text-xs);
  color: var(--color-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  border: 1px solid var(--color-rule-soft);
  white-space: nowrap;
}
.filter-count[hidden] { display: none; }
.filter-empty[hidden] { display: none; }
.filter-empty {
  border: 1px dashed var(--color-rule);
  border-radius: var(--radius-lg);
  background: var(--color-surface-1);
  animation: fade-in var(--dur-micro) var(--ease-out);
}
.kbd-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-rule);
  background: var(--color-surface-1);
  color: var(--color-faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1;
  flex: none;
}
.club-search:focus-within .kbd-hint {
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
@media (max-width: 720px) {
  .kbd-hint { display: none; }
}

/* ---------- 10. Страница входа: переключатель видимости кода доступа ---------- */
.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrap input {
  width: 100%;
  padding-right: 92px;
}
.password-toggle {
  position: absolute;
  right: 6px;
  min-height: 28px;
  padding: 2px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-muted);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.password-toggle:hover {
  color: var(--color-ink-hi);
  background: var(--color-surface-3);
}
.password-toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ---------- 11. Улучшенный терминал задачи ---------- */
.terminal-title {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}
.terminal-card.is-collapsed .terminal {
  display: none;
}

/* ---------- 12. Светлая тема: точная калибровка новых элементов ---------- */
:root[data-theme="light"] .live-sync {
  background: var(--color-surface-1);
}
:root[data-theme="light"] .pc-tile.is-super {
  background: rgba(185, 28, 28, 0.06);
}
:root[data-theme="light"] .pc-tile.is-powering {
  background: rgba(14, 116, 144, 0.07);
}
:root[data-theme="light"] .confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

/* ---------- 13. Строгая поддержка prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .pill.live .dot,
  .pill.warn .dot,
  .pill.danger .dot,
  .live-sync .dot,
  .pc-tile.is-super .pc-tile-state::before,
  .pc-tile.is-powering,
  .pc-tile.is-powering .pc-tile-state::before,
  .pc-tile.is-just-changed,
  .pc-modal[open],
  .pc-modal[open] .pc-modal-card,
  .pc-menu:not([hidden]),
  .pc-bulk-bar:not([hidden]),
  .confirm-dialog[open],
  .live-banner,
  .progress-fill.is-active::after,
  .pipeline.is-live .pipeline-arrow,
  .op-running .op-dot,
  .op-focus-running .op-dot,
  .op-waiting .op-dot,
  .op-focus-waiting .op-dot,
  .step.running .step-mark,
  .step.awaiting .step-mark,
  .btn[aria-busy="true"]::before {
    animation: none !important;
  }
  .pc-tile:hover {
    transform: none;
  }
}


/* ==================================================================
 * Комплексный визуальный редизайн: Command Graphite 2.0
 * Атмосферная глубина, стеклянная навигация, телеметрия клуба,
 * выразительные плитки ПК, KPI-карточки с индикаторами и плавный motion.
 * ================================================================== */

/* ---------- 1. Атмосферный фон и визуальная глубина ---------- */
body {
  background-color: var(--color-bg);
  background-image:
    radial-gradient(ellipse 900px 420px at 12% -6%, rgba(139, 92, 246, 0.13), transparent 70%),
    radial-gradient(ellipse 760px 380px at 88% -4%, rgba(34, 211, 238, 0.09), transparent 68%);
  background-attachment: fixed;
}
:root[data-theme="light"] body {
  background-image:
    radial-gradient(ellipse 900px 420px at 12% -6%, rgba(109, 40, 217, 0.07), transparent 70%),
    radial-gradient(ellipse 760px 380px at 88% -4%, rgba(14, 116, 144, 0.06), transparent 68%);
}

/* ---------- 2. Стеклянный топбар и брендовый знак ---------- */
.masthead {
  min-height: 58px;
  padding: 8px var(--space-lg);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.masthead::before {
  background: rgba(7, 10, 15, 0.78);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.masthead::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(139, 92, 246, 0.45) 30%, rgba(34, 211, 238, 0.4) 70%, transparent 100%);
  pointer-events: none;
}
:root[data-theme="light"] .masthead::before {
  background: rgba(243, 245, 249, 0.82);
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.24), rgba(34, 211, 238, 0.12));
  border: 1px solid var(--color-accent-border);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.22);
  transition: transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out);
}
.brand:hover .brand-mark {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.34);
}

/* ---------- 3. Сайдбар как оформленная карточка управления ---------- */
@media (min-width: 1100px) {
  .page:has(.side-nav) {
    grid-template-columns: 224px minmax(0, 1fr);
    column-gap: var(--space-lg);
  }
  .side-nav {
    top: 74px;
    padding: 10px;
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(16, 22, 33, 0.92), rgba(11, 15, 23, 0.92));
    border: 1px solid var(--color-rule);
    box-shadow: inset 0 1px 0 var(--color-highlight-top), var(--shadow-md);
    gap: 3px;
  }
  :root[data-theme="light"] .side-nav {
    background: var(--color-surface-1);
    box-shadow: var(--shadow-sm);
  }
}
.side-nav-title {
  padding: 10px 10px 4px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: var(--text-xs);
  color: var(--color-faint);
}
.side-hall {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border-left: 0;
  position: relative;
  font-weight: 500;
}
.side-hall.is-active {
  background: linear-gradient(90deg, var(--color-accent-soft), rgba(139, 92, 246, 0.04));
  color: var(--color-ink-hi);
  box-shadow: inset 3px 0 0 var(--color-accent), inset 0 0 0 1px var(--color-accent-border);
}
.side-dot.is-ok {
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.22);
}

/* ---------- 4. Выразительные кнопки и CTA ---------- */
.btn-primary {
  color: #FFFFFF;
  background: linear-gradient(135deg, #9F7AEA 0%, #7C3AED 100%);
  border-color: rgba(196, 181, 253, 0.45);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-weight: 600;
}
.btn-primary:hover {
  color: #FFFFFF;
  background: linear-gradient(135deg, #A78BFA 0%, #8B5CF6 100%);
  border-color: rgba(221, 214, 254, 0.65);
  box-shadow: 0 6px 22px rgba(139, 92, 246, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

/* ---------- 5. Шапки страниц (Hero) ---------- */
.overview-hero,
.hall-hero {
  position: relative;
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(21, 27, 39, 0.88) 0%, rgba(14, 18, 25, 0.88) 100%);
  border: 1px solid var(--color-rule);
  box-shadow: inset 0 1px 0 var(--color-highlight-top), var(--shadow-sm);
}
:root[data-theme="light"] .overview-hero,
:root[data-theme="light"] .hall-hero {
  background: linear-gradient(135deg, #FFFFFF 0%, #F7F9FC 100%);
}
.overview-hero::before,
.hall-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-live), transparent);
  opacity: 0.75;
}

/* ---------- 6. Полоса телеметрии и загрузки клуба ---------- */
.club-telemetry {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(18, 24, 36, 0.92), rgba(14, 18, 25, 0.95));
  border: 1px solid var(--color-rule);
  box-shadow: inset 0 1px 0 var(--color-highlight-top), var(--shadow-sm);
}
:root[data-theme="light"] .club-telemetry {
  background: var(--color-surface-1);
}
.club-telemetry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.club-telemetry-kpi {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.club-telemetry-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.club-telemetry-pct {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-ink-hi);
  line-height: 1;
}
.club-telemetry-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.club-capacity-bar {
  display: flex;
  height: 10px;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-surface-3);
  border: 1px solid var(--color-rule-soft);
  gap: 2px;
  padding: 1px;
}
.cap-seg {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width var(--dur-long) var(--ease-out);
  animation: bar-grow var(--dur-long) var(--ease-out);
  transform-origin: left center;
}
.cap-seg.is-busy {
  background: linear-gradient(90deg, #06B6D4, #22D3EE);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.35);
}
.cap-seg.is-free {
  background: linear-gradient(90deg, #10B981, #34D399);
}
.cap-seg.is-warn {
  background: var(--color-warn);
}
.cap-seg.is-super {
  background: var(--color-danger);
}
@keyframes bar-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ---------- 7. Переработанные Stat-Chips (фильтры-счётчики) ---------- */
.stat-chip {
  padding: 6px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--color-surface-2), var(--color-surface-1));
  border: 1px solid var(--color-rule);
  border-bottom-width: 3px;
  box-shadow: inset 0 1px 0 var(--color-highlight-top);
  transition: transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-micro) var(--ease-out);
}
.stat-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.stat-chip:active {
  transform: translateY(0);
}
.stat-chip.is-active {
  background: linear-gradient(180deg, var(--color-accent-2-soft), var(--color-accent-soft));
  border-color: var(--color-accent);
  box-shadow: var(--shadow-ring-accent), var(--shadow-sm);
}
.club-search {
  border-radius: 10px;
  min-height: var(--control-h);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.club-search:focus-within {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-ring-accent);
  background: var(--color-surface-1);
}

/* ---------- 8. Плитки ПК нового поколения (визуально выразительные статусы) ---------- */
.pc-group {
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(15, 20, 30, 0.92), rgba(11, 15, 22, 0.96));
  border: 1px solid var(--color-rule);
  padding: 16px;
}
:root[data-theme="light"] .pc-group {
  background: var(--color-surface-1);
}
.pc-tile {
  border-radius: 10px;
  border: 1px solid var(--color-rule);
  border-left-width: 4px;
  padding: 10px 12px;
  min-height: 70px;
  box-shadow: inset 0 1px 0 var(--color-highlight-top);
}
.pc-tiles-rich .pc-tile {
  min-height: 78px;
}
.pc-tile.is-free {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.11) 0%, var(--color-surface-2) 65%);
  border-color: rgba(52, 211, 153, 0.24);
  border-left-color: var(--color-ok);
}
.pc-tile.is-free .pc-tile-state {
  color: var(--color-ok);
  font-weight: 500;
}
.pc-tile.is-free .pc-tile-state::before {
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.65);
}
.pc-tile.is-busy {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15) 0%, var(--color-surface-2) 72%);
  border-color: rgba(34, 211, 238, 0.30);
  border-left-color: var(--color-live);
}
.pc-tile.is-busy .pc-tile-state {
  color: var(--color-live);
  font-weight: 600;
}
.pc-tile.is-busy .pc-tile-state::before {
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.75);
  animation: radar-live 2.2s var(--ease-std) infinite;
}
.pc-tile.is-super {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.18) 0%, var(--color-surface-2) 72%);
  border-color: rgba(248, 113, 113, 0.42);
  border-left-color: var(--color-danger);
}
.pc-tile.is-service {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(251, 191, 36, 0.08),
      rgba(251, 191, 36, 0.08) 6px,
      transparent 6px,
      transparent 12px
    ),
    var(--color-surface-2);
  border-color: rgba(251, 191, 36, 0.36);
  border-left-color: var(--color-warn);
}
.pc-tile.is-off {
  background: rgba(14, 18, 25, 0.65);
  border-color: var(--color-rule-soft);
  border-left-color: var(--color-rule);
}
:root[data-theme="light"] .pc-tile.is-off {
  background: var(--color-surface-2);
}
.pc-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.pc-tile.is-selected,
.pc-tile[aria-pressed="true"] {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent), 0 10px 24px rgba(139, 92, 246, 0.28);
}

/* ---------- 9. Карточка ПК в модалке ---------- */
/* каркас и секции заданы в блоке .pc-modal выше; здесь только поведение при reduced-motion */

/* ---------- 10. KPI-карточки с акцентной полосой и прогресс-метрами ---------- */
.kpi-box {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(21, 27, 39, 0.92), rgba(14, 18, 25, 0.96));
  border: 1px solid var(--color-rule);
}
:root[data-theme="light"] .kpi-box {
  background: var(--color-surface-1);
}
.kpi-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-rule);
}
.kpi-box.kpi-tone-accent::before { background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hi)); }
.kpi-box.kpi-tone-ok::before     { background: linear-gradient(90deg, #10B981, var(--color-ok)); }
.kpi-box.kpi-tone-warn::before   { background: linear-gradient(90deg, #F59E0B, var(--color-warn)); }
.kpi-box.kpi-tone-danger::before { background: linear-gradient(90deg, #EF4444, var(--color-danger)); }
.kpi-box.kpi-tone-live::before   { background: linear-gradient(90deg, #06B6D4, var(--color-live)); }
.kpi-box:hover {
  border-color: var(--color-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.kpi-value {
  font-size: var(--text-xl);
  font-weight: 600;
}
.disk-meter {
  height: 6px;
  margin: 6px 0 4px;
}
.disk-meter-fill {
  transition: width var(--dur-long) var(--ease-out);
  animation: bar-grow var(--dur-long) var(--ease-out);
  transform-origin: left center;
}
.disk-meter-fill.ok { background: linear-gradient(90deg, #10B981, var(--color-ok)); }
.disk-meter-fill.live { background: linear-gradient(90deg, #06B6D4, var(--color-live)); }

/* ---------- 11. Карточки залов на обзоре + мини-индикатор онлайна ---------- */
.overview-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 18px;
  background: linear-gradient(180deg, rgba(17, 23, 34, 0.94), rgba(12, 16, 24, 0.96));
}
:root[data-theme="light"] .overview-card {
  background: var(--color-surface-1);
}
.overview-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-rule);
}
.overview-card.is-source::before {
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hi));
}
.overview-card.is-target::before {
  background: linear-gradient(90deg, #06B6D4, var(--color-live));
}
.overview-role.is-source {
  display: inline-block;
  color: var(--color-focus);
}
.overview-role.is-target {
  display: inline-block;
  color: var(--color-live);
}
.hall-mini-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--color-surface-3);
  overflow: hidden;
}
.hall-mini-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-ok), var(--color-live));
  animation: bar-grow var(--dur-long) var(--ease-out);
  transform-origin: left center;
}

/* ---------- 12. Карточки сценариев, конвейер и таблицы ---------- */
.scenario-bar {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.scenario-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(18, 24, 36, 0.92), rgba(13, 17, 25, 0.96));
}
:root[data-theme="light"] .scenario-card {
  background: var(--color-surface-1);
}
.scenario-card.is-primary {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(18, 24, 36, 0.96) 75%);
  border-color: var(--color-accent-border);
}
.scenario-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.scenario-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--color-rule);
}
.scenario-card.is-primary .scenario-icon {
  background: rgba(139, 92, 246, 0.22);
  border-color: var(--color-accent-border);
  color: var(--color-focus);
}

.pipeline {
  padding: 12px;
  border-radius: var(--radius-xl);
  background: rgba(14, 18, 25, 0.72);
  border: 1px solid var(--color-rule-soft);
}
:root[data-theme="light"] .pipeline {
  background: var(--color-surface-1);
}
.pipeline-node {
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 var(--color-highlight-top);
}
.pipeline-node-staging.is-live {
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.14), inset 0 1px 0 var(--color-highlight-top);
}

.table-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-rule);
  box-shadow: inset 0 1px 0 var(--color-highlight-top), var(--shadow-sm);
}
table.grid tbody tr td {
  transition: background-color var(--dur-fast) var(--ease-out);
}
table.grid tbody tr:hover td {
  background: rgba(139, 92, 246, 0.055);
}

/* ---------- 13. Экран входа (Command Center Auth Card) ---------- */
.login-box {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(18, 24, 36, 0.96), rgba(11, 15, 22, 0.98));
  border: 1px solid var(--color-rule);
  box-shadow: var(--shadow-lg);
  animation: card-rise var(--dur-short) var(--ease-out);
}
:root[data-theme="light"] .login-box {
  background: var(--color-surface-1);
}
.login-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-live));
}
.login-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.24), rgba(34, 211, 238, 0.12));
  border: 1px solid var(--color-accent-border);
  color: var(--color-accent-hi);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.24);
}

/* ---------- 14. Плавное каскадное появление блоков (Zero-CLS GPU Motion) ---------- */
@keyframes card-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.overview-hero,
.hall-hero,
.club-telemetry,
.mission-header,
.decisions {
  animation: card-rise var(--dur-short) var(--ease-out) both;
}
.kpi-box,
.overview-card,
.scenario-card,
.pc-group {
  animation: card-rise var(--dur-short) var(--ease-out) both;
}
.kpi-box:nth-child(2),
.overview-card:nth-child(2),
.scenario-card:nth-child(2),
.pc-group:nth-child(2) { animation-delay: 45ms; }
.kpi-box:nth-child(3),
.scenario-card:nth-child(3),
.pc-group:nth-child(3) { animation-delay: 90ms; }
.kpi-box:nth-child(4),
.pc-group:nth-child(4) { animation-delay: 135ms; }

@media (prefers-reduced-motion: reduce) {
  .overview-hero,
  .hall-hero,
  .club-telemetry,
  .mission-header,
  .decisions,
  .kpi-box,
  .overview-card,
  .scenario-card,
  .pc-group,
  .login-box,
  .cap-seg,
  .disk-meter-fill,
  .hall-mini-fill,
  .pc-tile.is-busy .pc-tile-state::before {
    animation: none !important;
  }
  .btn-primary:hover,
  .stat-chip:hover,
  .kpi-box:hover,
  .scenario-card:hover,
  .brand:hover .brand-mark {
    transform: none;
  }
}
