/* ==========================================================================
   MAESTRO — тёмное стекло и свечение.
   Идея: спокойный ночной фон, стеклянные панели, один главный акцент —
   «орбита» состояния машины: цвет и пульс показывают уровень безопасности.
   Цвет в интерфейсе несёт смысл (статус), поэтому всё остальное — приглушённое.
   ========================================================================== */
:root {
  --bg: #070b12;
  --bg-elevated: rgba(255, 255, 255, 0.045);
  --bg-input: rgba(5, 9, 16, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.15);
  --text: #e8eef8;
  --text-dim: #98a4ba;
  --text-faint: #5f6b82;

  --accent: #3cc8e0;
  --accent-2: #4f8cff;
  --accent-hover: #5fd8ee;
  --accent-soft: rgba(60, 200, 224, 0.13);

  --green: #3ddc97;
  --green-soft: rgba(61, 220, 151, 0.13);
  --yellow: #f2c94c;
  --yellow-soft: rgba(242, 201, 76, 0.13);
  --red: #ff5d6c;
  --red-soft: rgba(255, 93, 108, 0.13);
  --purple: #a77bff;
  --purple-soft: rgba(167, 123, 255, 0.15);

  --radius: 18px;
  --radius-sm: 11px;
  --glass: linear-gradient(160deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.028) 100%);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 18px 44px rgba(0, 0, 0, 0.38);

  --font-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-display: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 600px at 8% -8%, rgba(60, 200, 224, 0.13), transparent 60%),
    radial-gradient(800px 560px at 100% 108%, rgba(111, 90, 255, 0.12), transparent 60%),
    radial-gradient(500px 400px at 92% 0%, rgba(79, 140, 255, 0.07), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); background-clip: padding-box; border: 2px solid transparent; }

/* ---------- каркас ---------- */
.app-shell { display: flex; min-height: 100vh; gap: 0; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  margin: 14px 0 14px 14px;
  padding: 18px 12px 14px;
  border-radius: 24px;
  background: var(--glass);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  overflow-y: auto;
}

.sidebar-brand { padding: 4px 10px 18px; }
.sidebar-brand a {
  display: flex; align-items: center; gap: 11px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600; letter-spacing: 0.6px;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-2) 70%, #7a63ff);
  box-shadow: 0 0 22px rgba(60, 200, 224, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.brand-mark svg { width: 18px; height: 18px; stroke: #04141c; }

.sidebar-search { padding: 0 2px 12px; margin: 0; }
.sidebar-search input[type=text] { margin: 0; font-size: 13.5px; padding: 9px 12px 9px 34px;
  background: rgba(5, 9, 16, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2398a4ba' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px 50%; }

.sidebar-nav { margin-bottom: 6px; }
.sidebar-nav a, .sidebar-groups a {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 2px;
  transition: background .15s ease, color .15s ease;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; transition: transform .2s ease, opacity .15s ease; }
.sidebar-nav a:hover, .sidebar-groups a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.sidebar-nav a:hover svg { transform: scale(1.1); opacity: 1; }
.sidebar-nav a.active, .sidebar-groups a.active {
  background: linear-gradient(90deg, rgba(60, 200, 224, 0.18), rgba(60, 200, 224, 0.04));
  color: #fff; font-weight: 500;
}
.sidebar-nav a.active::before, .sidebar-groups a.active::before {
  content: ""; position: absolute; left: -12px; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
.sidebar-nav a.active svg { opacity: 1; stroke: var(--accent); }

.sidebar-section { font-size: 12px; color: var(--text-faint); margin: 16px 12px 6px; font-weight: 600; letter-spacing: 0.3px; }
.sidebar-groups { flex: 1; overflow-y: auto; }
.grp-dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; background: rgba(255, 255, 255, 0.22); transition: background .2s; }
.sidebar-groups a:hover .grp-dot, .sidebar-groups a.active .grp-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.sidebar-footer { margin-top: 10px; padding: 12px 4px 4px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.sf-user { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.sidebar-footer .avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #04141c; background: linear-gradient(140deg, var(--accent), var(--accent-2)); flex-shrink: 0; }
.sf-user .who { flex: 1; min-width: 0; line-height: 1.3; }
.sf-user .who b { display: block; color: var(--text); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-menu { display: flex; flex-direction: column; gap: 1px; }
.sf-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: var(--text-dim);
  transition: background .15s ease, color .15s ease;
}
.sf-item svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; opacity: .85; transition: transform .2s ease, opacity .15s ease; }
.sf-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.sf-item:hover svg { opacity: 1; transform: translateX(2px); }
.sf-item.sf-logout:hover { color: var(--red); }
.sf-item .sf-sun { display: none; }
html[data-theme="light"] .sf-item .sf-sun { display: block; }
html[data-theme="light"] .sf-item .sf-moon { display: none; }

.main-content { flex: 1; min-width: 0; }
.main-content .container { max-width: 1180px; margin: 0 auto; padding: 30px 32px 70px; animation: pageIn .4s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: relative; margin: 10px; top: 0; }
  .main-content .container { padding: 18px 16px 50px; }
}

.container { max-width: 1180px; margin: 36px auto; padding: 0 20px 60px; }

/* ---------- заголовки ---------- */
h1, h2, h3, h4 { margin-top: 0; font-weight: 600; letter-spacing: -0.2px; }
h2 { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: 0.2px; margin-bottom: 22px; }
h3 { font-size: 16px; color: var(--text); margin-bottom: 14px; }
h4 { font-size: 14px; margin: 18px 0 10px; color: var(--text-dim); }
.page-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.page-back:hover { color: var(--text); }

/* ---------- стеклянные панели ---------- */
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* сворачиваемые разделы на странице машины и отдела */
details.sect { padding: 0; overflow: hidden; }
details.sect > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 12px;
  padding: 18px 26px;
  font-size: 16px; font-weight: 600;
}
details.sect > summary::-webkit-details-marker { display: none; }
details.sect > summary::after {
  content: ""; margin-left: auto; width: 9px; height: 9px;
  border-right: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint);
  transform: rotate(45deg); transition: transform .25s ease, border-color .2s;
}
details.sect[open] > summary::after { transform: rotate(-135deg); }
details.sect > summary:hover::after { border-color: var(--text-dim); }
details.sect > summary .sect-hint { font-weight: 400; font-size: 13px; color: var(--text-faint); }
details.sect > .sect-body { padding: 0 26px 24px; animation: sectIn .3s ease; }
@keyframes sectIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

/* ---------- плитки статистики ---------- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-tile {
  --tc: var(--text-faint);
  position: relative; overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.stat-tile::before {
  content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 2px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, var(--tc), transparent); opacity: .85;
}
.stat-tile::after {
  content: ""; position: absolute; inset: auto -20% -60% -20%; height: 100%;
  background: radial-gradient(closest-side, var(--tc), transparent 70%); opacity: .10; pointer-events: none;
}
.stat-tile .stat-value { position: relative; font-family: var(--font-display); font-size: 38px; font-weight: 600; line-height: 1.05; letter-spacing: 0.5px; font-variant-numeric: tabular-nums; }
.stat-tile .stat-label { position: relative; font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.stat-tile.accent { --tc: var(--accent); }
.stat-tile.green { --tc: var(--green); }
.stat-tile.red { --tc: var(--red); }
.stat-tile.yellow { --tc: var(--yellow); }
.stat-tile.purple { --tc: var(--purple); }
.stat-tile.accent .stat-value, .stat-tile.green .stat-value, .stat-tile.red .stat-value,
.stat-tile.yellow .stat-value, .stat-tile.purple .stat-value { color: var(--tc); text-shadow: 0 0 22px color-mix(in srgb, var(--tc) 45%, transparent); }
a.stat-tile { text-decoration: none; color: inherit; }
a.stat-tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tc) 55%, transparent); color: inherit; }

/* ---------- формы ---------- */
input[type=text], input[type=password], input[type=search], select, textarea {
  font-family: inherit;
}
input[type=text], input[type=password], input[type=search] {
  width: 100%;
  padding: 10px 13px;
  margin: 6px 0 14px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input[type=text]:focus, input[type=password]:focus, input[type=search]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 18px rgba(60, 200, 224, 0.12);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
select { padding: 7px 28px 7px 11px; border-radius: var(--radius-sm); background-color: var(--bg-input); color: var(--text); border: 1px solid var(--border-light);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%2398a4ba' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
select option { background: #0e1420; color: var(--text); }

/* ---------- свой выпадающий список (вместо нативного select) ----------
   нативный select открывает системный список, который нельзя раскрасить
   под тему (всегда синее выделение ОС) — для пака программ и похожих мест
   рисуем список сами, тот же вид, что у карточек «Готовых решений». */
.csel { position: relative; display: inline-flex; }
.csel-btn {
  display: flex; align-items: center; gap: 10px; min-width: 200px;
  padding: 7px 11px; border-radius: var(--radius-sm);
  background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border-light); font-size: 14px; font-weight: 400; text-align: left;
  box-shadow: none; text-shadow: none;
}
.csel-btn::after {
  content: ""; margin-left: auto; width: 8px; height: 8px; flex-shrink: 0;
  border-right: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint);
  transform: rotate(45deg); transition: transform .2s ease;
}
.csel.open .csel-btn::after { transform: rotate(-135deg); }
.csel-btn:hover { filter: none; border-color: rgba(60, 200, 224, 0.5); background: var(--bg-input); color: var(--text); box-shadow: none; }
.csel-btn:disabled { opacity: .5; cursor: default; }
.csel-list {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; min-width: 100%; max-width: 360px;
  max-height: 260px; overflow-y: auto;
  background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light); border-radius: 12px; padding: 6px;
  box-shadow: var(--shadow), 0 18px 44px rgba(0, 0, 0, 0.35);
  animation: sectIn .15s ease;
}
.csel-opt { padding: 8px 12px; border-radius: 8px; font-size: 13.5px; color: var(--text-dim); cursor: pointer; white-space: nowrap; transition: background .12s ease, color .12s ease; }
.csel-opt:hover { background: rgba(60, 200, 224, 0.12); color: var(--text); }
.csel-opt.sel { color: var(--accent); font-weight: 600; }
.csel-opt.sel::after { content: "✓"; float: right; margin-left: 14px; }
.form-row .csel { display: flex; width: 100%; }
.form-row .csel-btn { width: 100%; }
html[data-theme="light"] .csel-list { box-shadow: var(--shadow), 0 18px 40px rgba(15, 23, 42, 0.12); }
textarea { border-radius: var(--radius-sm); }
input[type=checkbox] { accent-color: var(--accent); }
label { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.form-row { margin-bottom: 12px; }

/* ---------- кнопки ---------- */
button, .btn {
  font-family: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #03131b;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 9px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: inline-block;
  text-align: center;
  box-shadow: 0 6px 18px rgba(60, 200, 224, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: filter .15s ease, transform .08s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
button:hover, .btn:hover { filter: brightness(1.1); box-shadow: 0 8px 26px rgba(60, 200, 224, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.4); color: #03131b; }
button:active, .btn:active { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: default; filter: none; }

.btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-light);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-weight: 500;
}
.btn.secondary:hover { filter: none; background: rgba(255, 255, 255, 0.1); border-color: rgba(60, 200, 224, 0.6); color: var(--text); box-shadow: 0 0 18px rgba(60, 200, 224, 0.18); }
.btn.danger { background: var(--red-soft); color: #ff9aa4; border: 1px solid rgba(255, 93, 108, 0.4); box-shadow: none; }
.btn.danger:hover { background: rgba(255, 93, 108, 0.22); color: #ffb3ba; box-shadow: 0 0 18px rgba(255, 93, 108, 0.2); }

.error { color: #ff9aa4; font-size: 13px; margin-bottom: 14px; background: var(--red-soft); border: 1px solid rgba(255, 93, 108, 0.3); padding: 9px 13px; border-radius: var(--radius-sm); }

/* ---------- таблицы ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--border); font-size: 14px; transition: background .15s ease; }
th { color: var(--text-faint); font-weight: 600; font-size: 12.5px; letter-spacing: 0.2px; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td, table tr:not(:first-child):hover td { background: rgba(255, 255, 255, 0.025); }
td a { font-weight: 500; }
code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; background: rgba(255, 255, 255, 0.07); padding: 2px 7px; border-radius: 6px; color: #b9c6dc; }

/* ---------- бейджи ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 12px 3px 9px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.badge.online { background: var(--green-soft); color: #6fe8b2; border-color: rgba(61, 220, 151, 0.25); }
.badge.online::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.badge.offline { background: var(--red-soft); color: #ff9ca6; border-color: rgba(255, 93, 108, 0.25); }
.badge.offline::before { background: var(--red); }

.group-list a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  border-radius: 10px;
  transition: background .15s ease, padding-left .15s ease;
}
.group-list a:last-child { border-bottom: none; }
.group-list a:hover { padding-left: 14px; color: var(--text); background: rgba(255, 255, 255, 0.04); }
.group-list a span { color: var(--text-faint); font-size: 13px; }

/* ---------- логин ---------- */
.login-box {
  max-width: 380px;
  margin: 12vh auto 0;
  background: var(--glass);
  border: 1px solid var(--border-light);
  border-radius: 26px;
  padding: 36px 34px 32px;
  box-shadow: var(--shadow), 0 0 80px rgba(60, 200, 224, 0.10);
}
.login-box h1 { text-align: center; font-family: var(--font-display); font-size: 26px; letter-spacing: 3px; margin-bottom: 26px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.login-box h1 .brand-mark { width: 50px; height: 50px; border-radius: 16px; }
.login-box h1 .brand-mark svg { width: 28px; height: 28px; }
.login-box input { margin-bottom: 16px; }

.token-box { font-family: Consolas, "Cascadia Mono", monospace; background: var(--bg-input); border: 1px solid var(--border-light); padding: 11px 13px; border-radius: var(--radius-sm); word-break: break-all; font-size: 13px; color: #a9b8d0; }

details > summary { outline: none; }
details > summary::marker { color: var(--text-faint); }

#terminal-output { background: rgba(2, 5, 9, 0.8); color: #55e89a; padding: 14px; height: 420px; overflow-y: auto; font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; white-space: pre-wrap; border-radius: var(--radius-sm); border: 1px solid var(--border); }
#cmd-form { display: flex; gap: 8px; margin-top: 10px; }
#cmd-input { flex: 1; margin: 0; }

.subtle { color: var(--text-dim); font-size: 13px; }
.subtle-faint { color: var(--text-faint); font-size: 12px; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* ---------- орбита состояния: главный акцент интерфейса ---------- */
.orb {
  --oc: 120, 135, 160;
  position: relative; display: inline-block; flex-shrink: 0;
  width: var(--orb, 14px); height: var(--orb, 14px); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.85), rgb(var(--oc)) 55%);
  box-shadow: 0 0 calc(var(--orb, 14px) * 0.9) rgba(var(--oc), 0.75);
}
.orb::before, .orb::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(var(--oc), 0.7);
  opacity: 0; transform: scale(1);
}
.orb.lv-green { --oc: 61, 220, 151; }
.orb.lv-yellow { --oc: 242, 201, 76; }
.orb.lv-red { --oc: 255, 93, 108; }
.orb.lv-purple { --oc: 167, 123, 255; }
.orb.lv-none { --oc: 120, 135, 160; }
.orb.off, .orb.off.lv-green, .orb.off.lv-yellow, .orb.off.lv-purple { --oc: 255, 93, 108; }
.orb.off::before, .orb.off::after { animation: none; opacity: 0; }
.orb.lv-yellow::before, .orb.lv-red::before, .orb.lv-purple::before { animation: orbRing 2.6s ease-out infinite; }
.orb.lv-red::after, .orb.lv-purple::after { animation: orbRing 2.6s ease-out infinite 1.3s; }
.orb.lv-green::before { animation: orbRing 4.5s ease-out infinite; }
@keyframes orbRing { 0% { opacity: .75; transform: scale(1); } 100% { opacity: 0; transform: scale(2.6); } }

/* шапка машины */
.hero { display: flex; align-items: center; gap: 24px; padding: 26px 30px; flex-wrap: wrap; }
.hero-orb { --orb: 56px; padding: 14px; }
.hero-main { flex: 1; min-width: 260px; }
.hero-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.hero-title h1 { font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: 0.3px; margin: 0; line-height: 1.15; }
.hero-sub { color: var(--text-dim); font-size: 14.5px; margin-bottom: 14px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 10px; font-size: 13px; background: rgba(255, 255, 255, 0.055); border: 1px solid var(--border); color: var(--text); }
.chip i { font-style: normal; color: var(--text-faint); font-size: 12px; }
.chip code { background: none; padding: 0; color: var(--text); font-size: 12.5px; }
.hero-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 190px; }
.hero-ver { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); width: 100%; }

.machine-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
/* --- Безопасность (Defender): уровни зелёный / жёлтый / красный / фиолетовый --- */
.badge.sec-green { background: var(--green-soft); color: #5edb9c; }
.badge.sec-green::before { background: var(--green); box-shadow: 0 0 6px var(--green); }
.badge.sec-yellow { background: rgba(240,198,72,0.14); color: #f0c648; }
.badge.sec-yellow::before { background: #f0c648; box-shadow: 0 0 6px rgba(240,198,72,0.6); }
.badge.sec-red { background: var(--red-soft); color: #ff9398; }
.badge.sec-red::before { background: var(--red); box-shadow: 0 0 6px var(--red); }
.badge.sec-purple { background: rgba(160,90,255,0.18); color: #c79bff; }
.badge.sec-purple::before { background: #a05aff; box-shadow: 0 0 8px #a05aff; }
.badge.sec-none { background: rgba(255,255,255,0.06); color: var(--text-faint); }
.badge.sec-none::before { background: var(--text-faint); }
.stat-tile.yellow .stat-value { color: #f0c648; }
.stat-tile.purple .stat-value { color: #b57bff; }
a.stat-tile { text-decoration: none; color: inherit; }
a.stat-tile:hover { border-color: var(--border-light); }

/* --- Всплывающие уведомления безопасности (переливающееся окно + убегающая полоска) --- */
#toast-stack {
  position: fixed; top: 16px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  width: 370px; max-width: calc(100vw - 32px); pointer-events: none;
}
.sec-toast {
  --tc-a: #f0c648; --tc-b: #ffb020; --tc-c: #ffe58a; --tc-glow: rgba(240,198,72,0.35);
  pointer-events: auto; position: relative; overflow: hidden; cursor: pointer;
  border-radius: 14px; padding: 13px 38px 19px 16px; color: #fff;
  border: 1px solid rgba(255,255,255,0.22); background: #12141a;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 26px var(--tc-glow);
  animation: toastIn .4s cubic-bezier(.2,.9,.3,1.15);
  transition: opacity .3s ease, transform .3s ease;
}
.sec-toast.lv-red { --tc-a: #ff4d57; --tc-b: #ff8a5b; --tc-c: #ff2e63; --tc-glow: rgba(255,77,87,0.4); }
.sec-toast.lv-purple { --tc-a: #a05aff; --tc-b: #5b7cfa; --tc-c: #e08bff; --tc-glow: rgba(160,90,255,0.5); }
.sec-toast::before {
  content: ""; position: absolute; inset: 0; opacity: 0.6;
  background: linear-gradient(115deg, var(--tc-a) 0%, var(--tc-b) 30%, var(--tc-c) 60%, var(--tc-a) 100%);
  background-size: 260% 100%; animation: toastShimmer 3.2s linear infinite;
}
.sec-toast > * { position: relative; }
.sec-toast.out { opacity: 0; transform: translateX(40px); }
.sec-toast .t-head { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.95; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.sec-toast .t-machine { display: block; font-size: 15px; font-weight: 700; margin: 3px 0 4px; color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.45); text-shadow: 0 1px 3px rgba(0,0,0,0.55); }
.sec-toast .t-text { font-size: 13px; line-height: 1.4; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.sec-toast .t-close { position: absolute; top: 8px; right: 10px; width: 22px; height: 22px; line-height: 20px; text-align: center; border-radius: 50%; background: rgba(0,0,0,0.3); font-size: 15px; cursor: pointer; }
.sec-toast .t-close:hover { background: rgba(0,0,0,0.55); }
.sec-toast .t-bar { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: rgba(255,255,255,0.9); transform-origin: left center; animation: toastBar 30s linear forwards; }
.sec-toast:hover .t-bar, .sec-toast:hover::before { animation-play-state: paused; }
@keyframes toastIn { from { opacity: 0; transform: translateX(60px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastShimmer { from { background-position: 0% 0; } to { background-position: 260% 0; } }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* --- Свечение по уровню проблемы + значки групп --- */
.glow-yellow { --g: 240,198,72; }
.glow-red    { --g: 255,77,87; }
.glow-purple { --g: 160,90,255; }
tr[class*="glow-"] td { background-color: rgba(var(--g), 0.09); animation: rowGlow 2.8s ease-in-out infinite; }
tr[class*="glow-"] td:first-child { box-shadow: inset 4px 0 0 rgb(var(--g)); border-radius: 10px 0 0 10px; }
tr[class*="glow-"] td:last-child { border-radius: 0 10px 10px 0; }
@keyframes rowGlow { 0%,100% { background-color: rgba(var(--g), 0.06); } 50% { background-color: rgba(var(--g), 0.2); } }
.card.glow-yellow, .card.glow-red, .card.glow-purple {
  border-color: rgba(var(--g), 0.65);
  animation: cardGlow 3s ease-in-out infinite;
}
@keyframes cardGlow {
  0%,100% { box-shadow: 0 0 0 1px rgba(var(--g), 0.3), 0 0 14px rgba(var(--g), 0.16); }
  50%     { box-shadow: 0 0 0 1px rgba(var(--g), 0.65), 0 0 40px rgba(var(--g), 0.42); }
}
.grp-badge { font-size: 12px; }
.side-sec { margin-left: auto; min-width: 18px; padding: 0 6px; border-radius: 10px; font-size: 11px; font-weight: 700; text-align: center; color: #12141a; line-height: 18px; }
.side-sec:empty { display: none; }
.side-sec.lv-yellow { background: #f0c648; box-shadow: 0 0 10px rgba(240,198,72,0.7); }
.side-sec.lv-red { background: #ff4d57; color: #fff; box-shadow: 0 0 10px rgba(255,77,87,0.8); animation: dotPulse 1.6s ease-in-out infinite; }
.side-sec.lv-purple { background: #a05aff; color: #fff; box-shadow: 0 0 12px rgba(160,90,255,0.9); animation: dotPulse 1.2s ease-in-out infinite; }
@keyframes dotPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.sidebar-groups a { display: flex; align-items: center; }

/* Карточка безопасности: аккуратные строки */
.sd-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid rgba(255,255,255,0.06); align-items: start; }
.sd-k { color: var(--text-dim); font-size: 12.5px; padding-top: 2px; }
.sd-v { line-height: 1.9; }
.sd-chip { display: inline-block; padding: 1px 9px; margin: 0 6px 4px 0; border-radius: 999px; font-size: 12px; line-height: 1.6; background: rgba(255,255,255,0.07); }
.sd-ok { background: rgba(80,200,120,0.15); color: #7fe3a0; }
.sd-bad { background: rgba(255,90,90,0.18); color: #ff8a8a; }
.sd-hist > div { margin-bottom: 6px; line-height: 1.4; }
.sd-path { font-size: 11.5px; word-break: break-all; }
@media (max-width: 640px) { .sd-row { grid-template-columns: 1fr; gap: 2px; } }

.sd-link { font-size: 11.5px; margin-left: 6px; color: var(--text-dim); text-decoration: none; border-bottom: 1px dotted currentColor; }
.sd-link:hover { color: var(--text); }

/* Компактные уведомления */
#toast-stack { width: 300px; gap: 6px; top: 12px; right: 12px; }
.sec-toast { border-radius: 10px; padding: 8px 30px 11px 12px; }
.sec-toast .t-head { font-size: 10px; }
.sec-toast .t-machine { font-size: 13px; margin: 1px 0 2px; }
.sec-toast .t-text { font-size: 12px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sec-toast .t-close { top: 5px; right: 7px; width: 18px; height: 18px; line-height: 16px; font-size: 13px; }
.sec-toast .t-bar { height: 3px; }

/* Правила: каталог программ — выдвижные группы и «чипы» */
.pol-grp { border: 1px solid rgba(255,255,255,0.09); border-radius: 12px; margin: 6px 0; background: rgba(255,255,255,0.025); overflow: hidden; max-width: 760px; transition: border-color .2s, background .2s; }
.pol-grp:hover { border-color: rgba(255,255,255,0.18); }
.pol-grp[open] { background: rgba(255,255,255,0.045); }
.pol-grp > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 13.5px; user-select: none; }
.pol-grp > summary::-webkit-details-marker { display: none; }
.pol-grp > summary::after { content: "›"; margin-left: auto; font-size: 18px; line-height: 1; opacity: .6; transition: transform .25s ease; }
.pol-grp[open] > summary::after { transform: rotate(90deg); }
.pol-ico { font-size: 16px; }
.pol-title { font-weight: 600; }
.pol-count { display: none; font-size: 11.5px; padding: 1px 9px; border-radius: 999px; background: rgba(255,90,90,0.18); color: #ff9a9a; }
.pol-all { font-size: 11.5px; opacity: .55; padding: 1px 7px; border-radius: 6px; border: 1px solid transparent; margin-left: 2px; }
.pol-all:hover { opacity: 1; border-color: rgba(255,255,255,0.25); }
.pol-body { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 14px 14px; animation: polIn .28s ease; }
@keyframes polIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.pol-chip { cursor: pointer; }
.pol-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pol-chip span { display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 13px; border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.04); transition: all .18s ease; }
.pol-chip span::before { content: "＋ "; opacity: .55; }
.pol-chip:hover span { border-color: rgba(255,255,255,0.4); transform: translateY(-1px); }
.pol-chip input:checked + span { background: linear-gradient(135deg, rgba(255,90,90,0.28), rgba(255,140,90,0.2)); border-color: rgba(255,110,110,0.65); color: #ffb0b0; box-shadow: 0 0 14px rgba(255,90,90,0.22); }
.pol-chip input:checked + span::before { content: "⛔ "; opacity: 1; }
.pol-chip input:focus-visible + span { outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px; }

/* ---------- поиск ---------- */
button.sidebar-search { width: calc(100% - 4px); margin: 0 2px 12px; display: flex; align-items: center; gap: 9px; padding: 9px 12px;
  background: rgba(5, 9, 16, 0.55); border: 1px solid var(--border); border-radius: 12px; color: var(--text-faint); font-weight: 400; font-size: 13.5px; box-shadow: none; text-align: left; }
button.sidebar-search:hover { filter: none; border-color: rgba(60, 200, 224, 0.5); box-shadow: 0 0 16px rgba(60, 200, 224, 0.12); color: var(--text-dim); }
button.sidebar-search svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
button.sidebar-search span { flex: 1; }
kbd { font-family: inherit; font-size: 11px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border-light); background: rgba(255, 255, 255, 0.06); color: var(--text-dim); margin: 0 2px; }

.pal { position: fixed; inset: 0; z-index: 1000; background: rgba(3, 6, 12, 0.62); backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 0; animation: palFade .15s ease; }
.pal[hidden] { display: none; }
@keyframes palFade { from { opacity: 0; } to { opacity: 1; } }
.pal-box { width: 100%; max-width: 640px; border-radius: 22px; background: linear-gradient(160deg, rgba(30, 40, 58, 0.97), rgba(14, 20, 32, 0.97)); border: 1px solid var(--border-light); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), 0 0 70px rgba(60, 200, 224, 0.12); overflow: hidden; }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.pal-input svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.pal-input input { flex: 1; margin: 0; border: none; background: none; padding: 4px 0; font-size: 16px; box-shadow: none !important; }
.pal-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.pal-item { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 13px; color: var(--text); }
.pal-item.sel, .pal-item:hover { background: linear-gradient(90deg, rgba(60, 200, 224, 0.17), rgba(60, 200, 224, 0.04)); color: var(--text); }
.pal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pal-main b { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-main small { color: var(--text-dim); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-empty { padding: 26px 20px; color: var(--text-dim); font-size: 14px; text-align: center; line-height: 1.7; }
.pal-empty b { color: var(--text); font-weight: 500; }
.pal-foot { display: flex; gap: 18px; padding: 10px 20px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 12px; flex-wrap: wrap; }
body.pal-open { overflow: hidden; }

.search-form { display: flex; align-items: center; gap: 12px; }
.search-form svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.search-form input[type=text] { flex: 1; margin: 0; font-size: 17px; padding: 12px 16px; }
.loc-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.lchip { padding: 5px 13px; border-radius: 999px; font-size: 13px; color: var(--text-dim); border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04); transition: all .15s; }
.lchip i { font-style: normal; color: var(--text-faint); margin-left: 4px; }
.lchip:hover { color: var(--text); border-color: var(--border-light); }
.lchip.on { color: #04141c; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; font-weight: 600; }
.lchip.on i { color: rgba(4, 20, 28, 0.6); }

.res-list .res-item { display: flex; align-items: center; gap: 18px; padding: 16px 22px; margin-bottom: 12px; color: var(--text); transition: transform .15s, border-color .15s; }
.res-list .res-item:hover { transform: translateY(-1px); border-color: rgba(60, 200, 224, 0.45); color: var(--text); }
.res-main { flex: 1; min-width: 0; }
.res-name { font-size: 16px; font-weight: 600; }
.res-sub { color: var(--text-dim); font-size: 13.5px; margin: 1px 0 8px; }
.res-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.res-meta .chip { padding: 2px 10px; font-size: 12.5px; }
.res-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12px; text-align: right; }

.chip-loc input { width: 9ch; min-width: 9ch; margin: 0; padding: 0; border: none; background: none; box-shadow: none; color: var(--text); font-size: 13px; border-radius: 0; border-bottom: 1px dashed var(--border-light); }
.chip-loc input:focus { box-shadow: none; border-bottom-color: var(--accent); }
.chip-loc input.saved { border-bottom-color: var(--green); color: var(--green); }

/* ---------- опасная зона и окно подтверждения ---------- */
.danger-zone { border-color: rgba(255, 93, 108, 0.22); background: linear-gradient(160deg, rgba(255, 93, 108, 0.07), rgba(255, 255, 255, 0.02)); margin-top: 28px; }
.dz-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.dz-row > div { flex: 1; min-width: 240px; max-width: 640px; }
.del-box { max-width: 480px; padding: 26px 28px; margin-top: 4vh; }
.del-box input[type=text] { font-size: 15px; }
.del-box .btn.danger:disabled { opacity: .4; }

/* ---------- «Требует внимания» ---------- */
.attn-card.ok { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 14px; padding: 16px 24px; }
.attn-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin: 0 -12px; border-radius: 12px; color: var(--text); transition: background .15s; }
.attn-row:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.attn-name { font-weight: 600; min-width: 170px; }
.attn-text { flex: 1; color: var(--text-dim); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attn-grp { color: var(--text-faint); font-size: 12.5px; }
@media (max-width: 700px) { .attn-name { min-width: 0; } .attn-grp { display: none; } }

/* ---------- массовые действия ---------- */
.bulk-bar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(60, 200, 224, 0.15), rgba(60, 200, 224, 0.04)); border: 1px solid rgba(60, 200, 224, 0.35); }
.bulk-bar[hidden] { display: none; }
.bulk-grp { display: inline-flex; gap: 6px; align-items: center; }
.bulk-bar input[type=text] { margin: 0; width: 170px; padding: 7px 11px; }
.bulk-bar .btn { padding: 6px 12px; font-size: 13px; }
input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

/* кнопки подтверждения в карточке безопасности */
.sd-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sd-acts .btn { margin: 0; }
.ok-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; font-size: 12.5px; color: var(--text-dim); }
.ok-item { display: inline-flex; align-items: center; gap: 8px; padding: 2px 4px 2px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--border); }
.ok-item .btn { margin: 0; padding: 1px 9px !important; font-size: 11.5px !important; }

/* ---------- справка и обучающий тур ---------- */
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 22px; }
.help-tile { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 16px 20px; color: var(--text); transition: transform .15s, border-color .15s; }
.help-tile:hover { transform: translateY(-2px); border-color: rgba(60, 200, 224, 0.45); color: var(--text); }
.help-tile span { color: var(--text-dim); font-size: 13px; }
.sect-body ul, .sect-body ol { padding-left: 22px; margin: 8px 0; line-height: 1.75; }
.sect-body li { margin-bottom: 4px; }
.sect-body p { line-height: 1.7; }
.help-colors { display: flex; flex-direction: column; gap: 14px; }
.help-colors > div { display: flex; align-items: flex-start; gap: 14px; line-height: 1.6; }
.help-colors .orb { margin-top: 5px; }

#tour { position: fixed; inset: 0; z-index: 2000; }
#tour[hidden] { display: none; }
#tour-spot { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(3, 6, 12, 0.72), 0 0 0 2px var(--accent), 0 0 28px rgba(60, 200, 224, 0.5); pointer-events: none; transition: all .25s ease; }
#tour-card { position: fixed; padding: 18px 20px 16px; border-radius: 18px; background: linear-gradient(160deg, rgba(32, 44, 64, 0.98), rgba(14, 20, 32, 0.98)); border: 1px solid var(--border-light); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6); transition: top .25s ease, left .25s ease; }
#tour-card h4 { margin: 4px 0 6px; font-size: 17px; color: var(--text); }
#tour-card p { margin: 0 0 14px; color: var(--text-dim); font-size: 14px; line-height: 1.6; }
.tour-step { font-size: 12px; color: var(--accent); font-weight: 600; }
.tour-btns { display: flex; gap: 8px; align-items: center; }
.tour-btns .btn { padding: 6px 14px; font-size: 13px; }
#tour-skip { background: none; border-color: transparent; box-shadow: none; color: var(--text-faint); }
body.tour-on { overflow: hidden; }

.sync-banner { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 900; padding: 10px 18px; border-radius: 14px; font-size: 13.5px;
  background: linear-gradient(160deg, rgba(32, 44, 64, 0.98), rgba(14, 20, 32, 0.98)); border: 1px solid rgba(60, 200, 224, 0.45); box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), 0 0 24px rgba(60, 200, 224, 0.18); }
.sync-banner[hidden] { display: none; }

.ver-tag { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted, #8b93a7); opacity: .75; letter-spacing: .02em; }

/* правка на месте + переключатели доступов */
td.ed { cursor: text; }
td.ed:hover .ed-val, td.ed:hover { text-decoration: underline dotted var(--text-faint); text-underline-offset: 4px; }
.ed-input { width: 100%; min-width: 9ch; margin: 0; padding: 3px 6px; font-size: 14px; border-radius: 6px; }
td.ed-ok { box-shadow: inset 0 -2px 0 var(--green); }
td.ed-err, .tg.ed-err { box-shadow: inset 0 -2px 0 #e5484d; }
.ed-pen { background: none; border: none; padding: 0 4px; margin: 0; color: var(--text-faint); font-size: 13px; cursor: pointer; opacity: 0; box-shadow: none; }
tr:hover .ed-pen, .ed-pen:focus { opacity: 1; }
.ed-pen:hover { color: var(--accent); background: none; }
.tg { display: inline-flex; align-items: center; padding: 3px 11px; margin: 0 4px 0 0; border-radius: 999px; font-size: 12.5px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); box-shadow: none; }
.tg.on { background: rgba(60, 200, 120, 0.14); color: var(--green); border-color: rgba(60, 200, 120, 0.4); }
.tg.off { background: transparent; color: var(--text-faint); text-decoration: line-through; }
.tg:hover { filter: brightness(1.2); }
.chip-loc input.saved#mail-input { border-bottom-color: var(--green); color: var(--green); }

/* --- Библиотека файлов и решений --- */
.lib-tabs { display: flex; gap: 6px; margin: 0 0 16px; flex-wrap: wrap; }
.lib-tabs a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim); text-decoration: none; font-size: 13.5px; background: var(--bg-elevated); transition: all .15s; }
.lib-tabs a:hover { color: var(--text); border-color: var(--border-light); }
.lib-tabs a.on { color: var(--accent); background: var(--accent-soft); border-color: rgba(60, 200, 224, 0.4); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.sol-card { display: flex; flex-direction: column; gap: 10px; }
.sol-card h3 { margin: 0; font-size: 16px; }
.sol-card .sol-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.sol-card .sol-act { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: rgba(255,255,255,.06); color: var(--text-dim); border: 1px solid var(--border); }
.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: rgba(60,200,224,.3); }
.tag.yellow { background: var(--yellow-soft); color: var(--yellow); border-color: rgba(242,201,76,.3); }
.tag.purple { background: var(--purple-soft); color: var(--purple); border-color: rgba(167,123,255,.3); }
.badge.yellow { background: var(--yellow-soft); color: var(--yellow); border-color: rgba(242,201,76,.28); }
.badge.yellow::before { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.badge.run { background: var(--accent-soft); color: var(--accent); border-color: rgba(60,200,224,.28); }
.badge.run::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse-run 1.2s ease-in-out infinite; }
@keyframes pulse-run { 50% { opacity: .35; } }
.badge.idle { background: rgba(255,255,255,.05); color: var(--text-dim); border-color: var(--border); }
.badge.idle::before { background: var(--text-faint); }
.picker { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 12px; background: var(--bg-input); }
.picker .pg { padding: 8px 0; border-bottom: 1px solid var(--border); }
.picker .pg:last-child { border-bottom: 0; }
.picker .pg-h { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13.5px; }
.picker .pg-h a { margin-left: auto; font-size: 12px; color: var(--accent); cursor: pointer; text-decoration: none; }
.picker .pm { display: flex; align-items: center; gap: 8px; padding: 3px 0 3px 22px; font-size: 13.5px; cursor: pointer; }
.picker .pm .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.picker .pm.on .dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.picker .pm small { color: var(--text-faint); margin-left: auto; }
.script-box { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; line-height: 1.5; min-height: 260px; width: 100%; white-space: pre; tab-size: 4; }
.run-out { margin: 8px 0 2px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--border); font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; white-space: pre-wrap; max-height: 260px; overflow: auto; color: var(--text-dim); }
.drop-zone { border: 1.5px dashed var(--border-light); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--text-dim); cursor: pointer; transition: all .15s; }
.drop-zone:hover, .drop-zone.over { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.prog { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 10px; }
.prog > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--green)); transition: width .15s; }

/* --- Установка программ --- */
.apps-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .apps-layout { grid-template-columns: 1fr; } }
.apps-side { position: sticky; top: 14px; }
.app-cat { margin: 0 0 18px; }
.app-cat h4 { margin: 0 0 8px; font-size: 12.5px; letter-spacing: .2px; color: var(--text-faint); font-weight: 600; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.app-tile { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-elevated); cursor: pointer; user-select: none; transition: border-color .15s, background .15s, box-shadow .15s; }
.app-tile:hover { border-color: var(--border-light); transform: translateY(-1px); }
.app-tile b { font-weight: 600; font-size: 14px; }
.app-tile small { color: var(--text-faint); font-size: 11.5px; word-break: break-all; }
.app-tile.sel { border-color: rgba(60,200,224,.65); background: var(--accent-soft); box-shadow: 0 0 18px rgba(60,200,224,.14); }
.app-tile.sel::after { content: "✓"; position: absolute; top: 9px; right: 11px; color: var(--accent); font-size: 13px; font-weight: 700; }
.app-tile .app-x { position: absolute; bottom: 7px; right: 9px; font-size: 14px; color: var(--text-faint); display: none; padding: 0 4px; }
.app-tile:hover .app-x { display: block; }
.app-tile .app-x:hover { color: var(--red); }
.seg { display: flex; border: 1px solid var(--border-light); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-input); }
.seg button { flex: 1; padding: 9px 8px; border: 0; background: transparent; color: var(--text-dim); font: inherit; font-size: 13px; cursor: pointer; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.sel-chips { display: flex; gap: 6px; flex-wrap: wrap; min-height: 28px; margin: 4px 0 12px; }
.sel-chips .tag { cursor: pointer; }
.sel-chips .tag:hover { border-color: var(--red); color: var(--red); }

/* --- Пошаговое обучение --- */
.tour-ring { position: fixed; z-index: 9998; display: none; border-radius: 14px; pointer-events: none; border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(3, 6, 12, 0.66), 0 0 26px rgba(60, 200, 224, 0.55); transition: left .25s, top .25s, width .25s, height .25s; }
.tour-pop { position: fixed; z-index: 9999; padding: 18px 20px 16px; border-radius: var(--radius); border: 1px solid rgba(60, 200, 224, 0.45);
  background: linear-gradient(160deg, #141c2b 0%, #0d1320 100%); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04) inset; transition: left .25s, top .25s; }
.tour-pop h4 { margin: 4px 0 6px; font-size: 16px; font-family: var(--font-display); }
.tour-pop p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.55; color: var(--text-dim); }
.tour-count { font-size: 12px; color: var(--accent); }
.tour-row { display: flex; gap: 8px; align-items: center; }
.tour-offer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin: 0 0 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(60, 200, 224, 0.35); background: var(--accent-soft); }
.tour-offer > div { flex: 1; min-width: 220px; font-size: 13.5px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head h2 { margin: 0; }
.page-head .btn { margin-left: auto; }
.pe-h { margin: 18px 0 8px; font-size: 13.5px; font-weight: 600; }


/* --- Обращения (чат с пользователями) --- */
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 10px; background: var(--accent); color: #03131b; font-size: 11.5px; font-weight: 700; text-align: center; }
.chat-layout { display: grid; grid-template-columns: minmax(250px, 340px) 1fr; gap: 16px; align-items: start; }
.chat-list { padding: 8px; max-height: calc(100vh - 190px); overflow: auto; }
.chat-list-empty { padding: 14px; }
.chat-thread { display: block; width: 100%; text-align: left; background: transparent; color: var(--text); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 4px; box-shadow: none; font-weight: 400; }
.chat-thread:hover { background: rgba(255,255,255,0.05); filter: none; box-shadow: none; color: var(--text); }
.chat-thread.active { background: var(--accent-soft); border-color: rgba(60,200,224,0.35); }
.chat-thread .ct-top { display: flex; align-items: center; gap: 8px; }
.chat-thread .ct-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread .ct-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chat-thread .ct-dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.chat-thread .ct-dot.off { background: var(--text-faint); }
.chat-thread .ct-badge { background: var(--accent); color: #03131b; border-radius: 10px; padding: 0 7px; font-size: 11.5px; font-weight: 700; }
.chat-thread .ct-open { color: var(--yellow); font-size: 11.5px; }
.chat-thread .ct-sub { color: var(--text-dim); font-size: 13px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread.unread .ct-sub { color: var(--text); }
.chat-thread .ct-meta { color: var(--text-faint); font-size: 12px; margin-top: 3px; }
.chat-pane { padding: 0; min-height: 420px; display: flex; flex-direction: column; }
.chat-pane-empty { padding: 40px; text-align: center; }
.chat-pane-body { display: flex; flex-direction: column; min-height: 0; }
.chat-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.chat-title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chat-title a { color: var(--text); text-decoration: none; }
.chat-title a:hover { color: var(--accent); }
.chat-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.sm, button.sm { padding: 5px 12px; font-size: 12.5px; }
.chat-msgs { padding: 16px 18px; height: min(52vh, 460px); overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.bub { max-width: 78%; padding: 9px 13px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,0.06); }
.bub.in { align-self: flex-start; border-top-left-radius: 4px; }
.bub.out { align-self: flex-end; border-top-right-radius: 4px; background: var(--accent-soft); border-color: rgba(60,200,224,0.3); }
.bub.sys { align-self: center; max-width: 92%; background: transparent; border: 1px dashed var(--border-light); color: var(--text-dim); font-size: 12.5px; text-align: center; }
.bub-text { white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.bub-meta { color: var(--text-faint); font-size: 11.5px; margin-top: 4px; }
.chat-sug { margin: 0 18px 8px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--yellow-soft); border: 1px solid rgba(242,201,76,0.3); }
.chat-sug-title { font-size: 13px; color: var(--yellow); margin-bottom: 8px; }
.chat-sug-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.chat-solpick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 18px 10px; }
.chat-solpick select { max-width: 320px; }
.chat-compose { display: flex; gap: 10px; align-items: flex-end; padding: 0 18px 8px; }
.chat-compose textarea { flex: 1; resize: vertical; min-height: 48px; padding: 10px 13px; background: var(--bg-input); color: var(--text); border: 1px solid var(--border-light); border-radius: 11px; font-family: inherit; }
.chat-pane-body > .subtle-faint { padding: 0 18px 14px; min-height: 18px; }
@media (max-width: 820px) { .chat-layout { grid-template-columns: 1fr; } .chat-list { max-height: 260px; } .bub { max-width: 92%; } }

/* атрибут hidden должен работать и там, где у блока задан display */
[hidden] { display: none !important; }

/* ---- Статистика операторов ---- */
.stat-tabs { display: flex; gap: 6px; }
.stat-tabs a { padding: 7px 14px; border-radius: 9px; border: 1px solid var(--border); color: var(--text-dim); font-size: 13px; }
.stat-tabs a.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.award-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.award { display: flex; gap: 14px; align-items: center; }
.award-icon { font-size: 34px; line-height: 1; }
.award-title { font-size: 12px; color: var(--text-faint); }
.award-who { font-size: 18px; font-weight: 700; color: var(--text); }
.me-row td { background: var(--accent-soft); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.ach-card.me { border-color: var(--accent); }
.ach-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ach-count { font-size: 20px; font-weight: 700; color: var(--accent); }
.badges { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.badge-item { display: flex; gap: 9px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; opacity: .5; filter: grayscale(.8); }
.badge-item.done { opacity: 1; filter: none; border-color: var(--accent); background: var(--accent-soft); }
.badge-ic { font-size: 22px; }
.badge-name { font-size: 13px; font-weight: 600; }
.badge-desc { font-size: 11px; color: var(--text-dim); }
.badge-bar { height: 4px; background: var(--border); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.badge-bar i { display: block; height: 100%; background: var(--accent); }
.badge-prog { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
@media (max-width: 700px) { .badges { grid-template-columns: 1fr; } }

/* ---- Пояснения за «?» ---- */
.hint-btn { display: inline-grid; place-items: center; width: 19px; height: 19px; margin: 0 0 0 8px; padding: 0; vertical-align: middle;
  border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text-faint); font: 600 11px/1 var(--font-body, inherit); cursor: pointer; }
.hint-btn:hover, .hint-btn.on { color: var(--accent); border-color: var(--accent); }
p + .hint-btn, .form-row > .hint-btn { margin-left: 0; }

/* ---- Мобильный вид ---- */
.mobile-bar, .sidebar-backdrop { display: none; }
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40; padding: 10px 12px;
    background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
  .mobile-bar button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border);
    background: rgba(255,255,255,.04); color: var(--text); padding: 0; cursor: pointer; }
  .mobile-bar button svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
  .mb-brand { flex: 1; text-align: center; color: var(--text); font-family: var(--font-display); font-weight: 600; letter-spacing: .6px; font-size: 17px; }
  .sidebar { position: fixed !important; left: 0; top: 0; bottom: 0; height: 100% !important; width: min(86vw, 310px) !important; margin: 0 !important;
    border-radius: 0 24px 24px 0; z-index: 60; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.6); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.55); }
  .sidebar-backdrop[hidden] { display: none; }
  body.menu-open { overflow: hidden; }
  .sidebar-nav a, .sidebar-groups a { padding: 12px 12px; }
  .main-content .container { padding: 14px 12px 60px; }
  h2 { font-size: 23px; margin-bottom: 16px; }
  .page-head { flex-wrap: wrap; gap: 10px; }
  .card { padding: 14px; }
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  input[type=text], input[type=password], input[type=search], input[type=number], input[type=email], select, textarea { font-size: 16px; }
  .btn, button { min-height: 38px; }
  .pal-box { width: 94vw; }
}

/* ---- Обращения: горячие клавиши и телефон ---- */
.keys-wrap { position: relative; }
.keys-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 300px; padding: 12px 14px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(14px); font-size: 13px; }
.keys-pop[hidden] { display: none; }
.keys-pop > div { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.keys-pop kbd { min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border); background: rgba(255,255,255,.06); font: 600 11px/1.6 inherit; color: var(--text); }
.keys-pop span { margin-left: auto; color: var(--text-dim); text-align: right; }
.keys-pop .keys-note { color: var(--text-faint); font-size: 12px; padding-top: 6px; border-top: 1px solid var(--border); margin-top: 4px; }
.chat-back { display: none; margin-right: 8px; }
@media (max-width: 820px) {
  .chat-back { display: inline-flex; }
  .chat-layout:not(.open-thread) .chat-pane { display: none; }
  .chat-layout.open-thread .chat-list { display: none; }
  .chat-list { max-height: none !important; }
  .keys-wrap { display: none; }
  .chat-head { flex-wrap: wrap; gap: 8px; }
}

/* правки по результатам проверки на телефоне */
.hint-btn { color: var(--text-dim); border-color: rgba(255,255,255,.28); }
@media (max-width: 860px) {
  .sidebar { background: #0b1019 !important; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (max-width: 820px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .chat-pane, .chat-list { min-width: 0; }
  .chat-compose { flex-wrap: wrap; }
  .chat-compose textarea { flex: 1 1 100%; }
  .chat-compose button { width: 100%; }
  .chat-solpick { flex-wrap: wrap; }
  .chat-solpick select { flex: 1 1 100%; max-width: 100%; }
}
.hint-btn { min-height: 0 !important; }

/* значок «?»: без свечения и градиента общих кнопок */
button.hint-btn, button.hint-btn:hover, button.hint-btn:active {
  background: transparent; box-shadow: none; filter: none; transform: none; padding: 0;
  width: 18px; height: 18px; min-height: 0 !important; border-radius: 50%; font-size: 11px; line-height: 1; font-weight: 600;
  letter-spacing: 0; text-shadow: none; display: inline-grid; place-items: center; vertical-align: middle; position: relative; top: -2px;
  border: 1px solid rgba(255,255,255,.3); color: var(--text-dim);
}
button.hint-btn:hover, button.hint-btn.on { color: var(--accent); border-color: var(--accent); background: rgba(60,200,224,.08); }

/* ==========================================================================
   Светлая тема. Переключается на аккаунте (data-theme на <html>), не в
   браузере. Переопределяем переменные + отдельные места, где в тёмной теме
   был зашит белый/чёрный цвет напрямую (подсветки, оверлеи, бейджи).
   ========================================================================== */
html[data-theme="light"] { color-scheme: light; }

html[data-theme="light"] {
  --bg: #eef1f6;
  --bg-elevated: #ffffff;
  --bg-input: rgba(15, 23, 42, 0.035);
  --border: rgba(15, 23, 42, 0.10);
  --border-light: rgba(15, 23, 42, 0.17);
  --text: #0f172a;
  --text-dim: #4b5668;
  --text-faint: #8691a3;

  --glass: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.82) 100%);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 28px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] body {
  background-image:
    radial-gradient(900px 600px at 8% -8%, rgba(60, 200, 224, 0.09), transparent 60%),
    radial-gradient(800px 560px at 100% 108%, rgba(111, 90, 255, 0.08), transparent 60%),
    radial-gradient(500px 400px at 92% 0%, rgba(79, 140, 255, 0.05), transparent 60%);
}

/* полосы прокрутки, оверлеи-подсветки при наведении, тонкие рамки —
   в тёмной теме это было «подсветить белым», в светлой — «притемнить» */
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.18); }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.32); }
html[data-theme="light"] .sidebar-nav a:hover, html[data-theme="light"] .sidebar-groups a:hover { background: rgba(15, 23, 42, 0.05); }
html[data-theme="light"] .sidebar-nav a.active, html[data-theme="light"] .sidebar-groups a.active { color: #0b1220; }
html[data-theme="light"] .grp-dot { background: rgba(15, 23, 42, 0.22); }
html[data-theme="light"] button, html[data-theme="light"] .btn { border-color: rgba(15, 23, 42, 0.14); }
html[data-theme="light"] .btn.secondary { background: rgba(15, 23, 42, 0.045); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7); }
html[data-theme="light"] .btn.secondary:hover { background: rgba(15, 23, 42, 0.08); }
html[data-theme="light"] tbody tr:hover td, html[data-theme="light"] table tr:not(:first-child):hover td { background: rgba(15, 23, 42, 0.035); }
html[data-theme="light"] code { background: rgba(15, 23, 42, 0.06); color: #334155; }
html[data-theme="light"] .group-list a:hover { background: rgba(15, 23, 42, 0.045); }
html[data-theme="light"] .chip { background: rgba(15, 23, 42, 0.05); }
html[data-theme="light"] kbd { background: rgba(15, 23, 42, 0.06); }
html[data-theme="light"] .lchip { background: rgba(15, 23, 42, 0.045); }
html[data-theme="light"] .danger-zone { background: linear-gradient(160deg, rgba(255, 93, 108, 0.08), rgba(15, 23, 42, 0.02)); }
html[data-theme="light"] .attn-row:hover { background: rgba(15, 23, 42, 0.05); }
html[data-theme="light"] .ok-item { background: rgba(15, 23, 42, 0.045); }
html[data-theme="light"] .hint-btn, html[data-theme="light"] button.hint-btn { border-color: rgba(15, 23, 42, 0.22); }
html[data-theme="light"] .sd-row { border-top-color: rgba(15, 23, 42, 0.08); }
html[data-theme="light"] .sd-chip { background: rgba(15, 23, 42, 0.06); }
html[data-theme="light"] .pol-grp { border-color: rgba(15, 23, 42, 0.12); background: rgba(15, 23, 42, 0.03); }
html[data-theme="light"] .pol-grp:hover { border-color: rgba(15, 23, 42, 0.22); }
html[data-theme="light"] .pol-grp[open] { background: rgba(15, 23, 42, 0.05); }
html[data-theme="light"] .pol-all:hover { border-color: rgba(15, 23, 42, 0.22); }
html[data-theme="light"] .pol-chip span { border-color: rgba(15, 23, 42, 0.16); background: rgba(15, 23, 42, 0.045); }
html[data-theme="light"] .pol-chip:hover span { border-color: rgba(15, 23, 42, 0.35); }
html[data-theme="light"] .pol-chip input:focus-visible + span { outline-color: rgba(15, 23, 42, 0.45); }
html[data-theme="light"] .badge.sec-none { background: rgba(15, 23, 42, 0.05); }
html[data-theme="light"] .tag { background: rgba(15, 23, 42, 0.05); }
html[data-theme="light"] .badge.idle { background: rgba(15, 23, 42, 0.045); }
html[data-theme="light"] .prog { background: rgba(15, 23, 42, 0.08); }
html[data-theme="light"] .chat-thread:hover { background: rgba(15, 23, 42, 0.045); }
html[data-theme="light"] .bub { background: rgba(15, 23, 42, 0.05); }
html[data-theme="light"] .keys-pop kbd { background: rgba(15, 23, 42, 0.06); }

/* плавающие панели: выпадающий список, поиск по Ctrl+K, экскурсия, всплывающее
   окошко с клавишами — в тёмной теме это был тёмно-синий градиент */
html[data-theme="light"] select option { background: #ffffff; }
html[data-theme="light"] .sidebar-search input[type=text] { background-color: rgba(15, 23, 42, 0.045); }
html[data-theme="light"] button.sidebar-search { background: rgba(15, 23, 42, 0.045); }
html[data-theme="light"] button.sidebar-search kbd { background: rgba(15, 23, 42, 0.08); border-color: var(--border-light); }
html[data-theme="light"] .pal-box { background: linear-gradient(160deg, #ffffff 0%, #f1f4f9 100%); }
html[data-theme="light"] #tour-card { background: linear-gradient(160deg, #ffffff 0%, #f1f4f9 100%); }
html[data-theme="light"] .sync-banner { background: linear-gradient(160deg, #ffffff 0%, #f1f4f9 100%); }
html[data-theme="light"] .tour-pop { background: linear-gradient(160deg, #ffffff 0%, #f1f4f9 100%); }
@media (max-width: 860px) {
  html[data-theme="light"] .sidebar { background: #eef1f6 !important; }
}

/* статусные бейджи и подсказки: в тёмной теме это был яркий пастельный текст
   почти без фона (на чёрном — контраст, на белом — еле видно). В светлой
   теме делаем как обычные «чипы»: тёмный насыщенный текст + свой плотный
   цветной фон того же оттенка (не унаследованный полупрозрачный). */
html[data-theme="light"] .badge.online { color: #15803d; background: rgba(21, 128, 61, 0.12); border-color: rgba(21, 128, 61, 0.28); }
html[data-theme="light"] .badge.offline { color: #b91c3c; background: rgba(185, 28, 60, 0.1); border-color: rgba(185, 28, 60, 0.26); }
html[data-theme="light"] .error,
html[data-theme="light"] .btn.danger { color: #b91c3c; background: rgba(185, 28, 60, 0.1); }
html[data-theme="light"] .btn.danger:hover { color: #9f1239; background: rgba(185, 28, 60, 0.16); }
html[data-theme="light"] .badge.sec-green { color: #15803d; background: rgba(21, 128, 61, 0.12); }
html[data-theme="light"] .badge.sec-yellow { color: #92650a; background: rgba(146, 101, 10, 0.12); }
html[data-theme="light"] .badge.sec-red { color: #b91c3c; background: rgba(185, 28, 60, 0.1); }
html[data-theme="light"] .badge.sec-purple { color: #6b21a8; background: rgba(107, 33, 168, 0.12); }
html[data-theme="light"] .stat-tile.yellow .stat-value { color: #92650a; }
html[data-theme="light"] .stat-tile.purple .stat-value { color: #6b21a8; }
html[data-theme="light"] .sd-ok { color: #15803d; background: rgba(21, 128, 61, 0.12); }
html[data-theme="light"] .sd-bad { color: #b91c3c; background: rgba(185, 28, 60, 0.12); }
html[data-theme="light"] .pol-count { color: #b91c3c; background: rgba(185, 28, 60, 0.14); }
html[data-theme="light"] .pol-chip input:checked + span { color: #9f1239; background: linear-gradient(135deg, rgba(185, 28, 60, 0.16), rgba(194, 65, 12, 0.12)); border-color: rgba(185, 28, 60, 0.4); }
html[data-theme="light"] .token-box { color: #334155; }
html[data-theme="light"] .sf-item:hover { background: rgba(15, 23, 42, 0.05); }
@media (max-width: 860px) {
  html[data-theme="light"] .mobile-bar button { background: rgba(15, 23, 42, 0.05); }
}

/* Смена темы «кружком от центра» (View Transitions API): отключаем
   стандартный кросс-фейд, саму окружность анимируем из JS. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
/* Переход на тёмную тему (светлый кружок стягивается к центру) — старый
   кадр должен лежать сверху, он и стягивается, а тёмный открывается под ним. */
html.vt-reverse::view-transition-old(root) { z-index: 2; }
html.vt-reverse::view-transition-new(root) { z-index: 1; }
