/* Yukio Guard: тёмная стеклянная консоль охраны сервера */

:root {
  --bg: #060913;
  --bg-2: #0a0f1f;
  --ink: #e8ebf7;
  --ink-2: #a6aecb;
  --ink-3: #6b7394;
  --glass: rgba(132, 150, 255, 0.055);
  --glass-2: rgba(132, 150, 255, 0.085);
  --glass-3: rgba(132, 150, 255, 0.13);
  --line: rgba(172, 186, 255, 0.11);
  --line-2: rgba(172, 186, 255, 0.2);
  --well: rgba(3, 5, 12, 0.55);

  --signal: #8ea8ff;
  --signal-rgb: 142, 168, 255;
  --armed: #5ee2b8;
  --armed-rgb: 94, 226, 184;
  --watch: #f2b45a;
  --watch-rgb: 242, 180, 90;
  --alarm: #ff5c7a;
  --alarm-rgb: 255, 92, 122;
  --idle: #6b7394;

  --state: var(--armed);
  --state-rgb: var(--armed-rgb);

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --blur: blur(22px) saturate(140%);
  --font: 'Onest', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1;
  scrollbar-color: rgba(172, 186, 255, 0.2) transparent;
  scrollbar-width: thin;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(var(--signal-rgb), 0.35); }

/* ---------- фон ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 700px at 70% -10%, #0f1734 0%, transparent 60%), var(--bg); }
.backdrop .glow { position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.55; }
.backdrop .g1 { width: 620px; height: 620px; left: -180px; top: -160px; background: #2a2f8f; }
.backdrop .g2 { width: 560px; height: 560px; right: -160px; bottom: -200px; background: rgba(var(--state-rgb), 0.28); transition: background 0.8s; }
.backdrop .grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(172, 186, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(172, 186, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(900px 600px at 60% 30%, #000 0%, transparent 75%);
}

/* ---------- каркас ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(var(--signal-rgb), 0.2); border-top-color: var(--signal); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 22px 14px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 15, 31, 0.75), rgba(6, 9, 19, 0.6));
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 20px; }
.brand img { width: 34px; height: 34px; }
.brand b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.brand span { display: block; font-size: 12px; color: var(--ink-3); }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 10px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14px; transition: background 0.15s, color 0.15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: 0.8; }
.nav a:hover { background: var(--glass); color: var(--ink); }
.nav a.on { background: var(--glass-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.on svg { color: var(--state); opacity: 1; }
.nav a .count { margin-left: auto; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: rgba(var(--alarm-rgb), 0.16); color: var(--alarm); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--line); }
.side-foot img { width: 34px; height: 34px; border-radius: 50%; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: 12px; color: var(--ink-3); }

.main { padding: 34px 40px 120px; max-width: 1240px; width: 100%; }
.main:focus { outline: none; }
.topbar { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; }
.page-head p { color: var(--ink-2); margin-top: 6px; max-width: 64ch; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- стекло ---------- */
.panel {
  position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-lg);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow);
}
.panel::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), transparent 38%);
}
.pad { padding: 22px 24px; }
.panel h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.panel h2 + p, .hint { color: var(--ink-3); font-size: 13.5px; margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--glass-2); cursor: pointer;
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--glass-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #9db4ff, #7b94f5); color: #0a0f24; border-color: transparent; }
.btn.primary:hover { background: linear-gradient(180deg, #adc0ff, #889ff7); }
.btn.danger { background: rgba(var(--alarm-rgb), 0.14); border-color: rgba(var(--alarm-rgb), 0.4); color: #ffb3c1; }
.btn.danger:hover { background: rgba(var(--alarm-rgb), 0.24); }
.btn.solid-danger { background: linear-gradient(180deg, #ff6f89, #e8445f); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--glass); color: var(--ink); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn.icon { width: 36px; padding: 0; }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .select {
  height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--well);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s; min-width: 0; color: var(--ink);
}
.input:focus, .select:focus { border-color: rgba(var(--signal-rgb), 0.6); box-shadow: 0 0 0 3px rgba(var(--signal-rgb), 0.15); }
.input.num { width: 84px; text-align: center; }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a6aecb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.select option { background: #0e1426; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 4px 0; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .sw { flex: none; width: 40px; height: 23px; border-radius: 99px; background: rgba(172, 186, 255, 0.16); position: relative; transition: background 0.2s; margin-top: 1px; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #c9d0ea; transition: transform 0.2s, background 0.2s; }
.toggle input:checked + .sw { background: rgba(var(--armed-rgb), 0.45); }
.toggle input:checked + .sw::after { transform: translateX(17px); background: #fff; }
.toggle input:focus-visible + .sw { outline: 2px solid var(--signal); outline-offset: 2px; }
.toggle b { display: block; font-weight: 600; font-size: 14px; }
.toggle small { display: block; color: var(--ink-3); font-size: 13px; }
.toggle > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.grid2 > *, .grid3 > * { min-width: 0; }

.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--well); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--glass-3); color: var(--ink); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset; }
.seg button.on[data-v='allow'] { background: rgba(var(--armed-rgb), 0.18); color: var(--armed); }
.seg button.on[data-v='deny'] { background: rgba(var(--alarm-rgb), 0.18); color: #ff9db0; }
.seg button.on[data-v='limit'] { background: rgba(var(--signal-rgb), 0.2); color: #c3d0ff; }

/* ---------- чипы, бейджи ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 6px 0 10px; border-radius: 99px; background: var(--glass-2); border: 1px solid var(--line); font-size: 13px; font-weight: 500; max-width: 100%; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip img { width: 20px; height: 20px; border-radius: 50%; margin-left: -5px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: transparent; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; color: var(--ink-3); display: grid; place-items: center; }
.chip button:hover { background: rgba(var(--alarm-rgb), 0.2); color: #ffb3c1; }
.chip button svg { width: 12px; height: 12px; }
.chip.static { padding-right: 10px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--glass-2); color: var(--ink-2); white-space: nowrap; }
.badge.armed { background: rgba(var(--armed-rgb), 0.14); color: var(--armed); }
.badge.watch { background: rgba(var(--watch-rgb), 0.15); color: var(--watch); }
.badge.alarm { background: rgba(var(--alarm-rgb), 0.15); color: #ff9db0; }
.badge.signal { background: rgba(var(--signal-rgb), 0.15); color: #c3d0ff; }

/* ---------- обзор: щит ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.ward { display: grid; grid-template-columns: 170px 1fr; gap: 28px; align-items: center; padding: 30px 32px; overflow: hidden; }
.ward::after { content: ''; position: absolute; width: 380px; height: 380px; left: -110px; top: -100px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--state-rgb), 0.28), transparent 65%); pointer-events: none; transition: background 0.6s; }
.ward .crest { position: relative; width: 170px; height: 170px; display: grid; place-items: center; z-index: 1; }
.ward .crest svg { width: 150px; height: 150px; filter: drop-shadow(0 0 28px rgba(var(--state-rgb), 0.55)); transition: filter 0.6s; }
.ward .crest .ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(var(--state-rgb), 0.35); }
.ward .crest .ring.r2 { inset: -14px; border-color: rgba(var(--state-rgb), 0.14); border-style: dashed; animation: spin 40s linear infinite; }
.ward[data-state='alarm'] .crest .ring.r2 { animation-duration: 6s; }
.ward .copy { position: relative; z-index: 1; }
.ward .state { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--state); transition: color 0.6s; }
.ward .copy p { color: var(--ink-2); margin: 10px 0 20px; max-width: 46ch; }
.ward .controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.checks { display: flex; flex-direction: column; gap: 4px; }
.check { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.check.ok svg { color: var(--armed); }
.check.bad svg { color: var(--watch); }
.check b { display: block; font-weight: 600; font-size: 14px; }
.check span { display: block; color: var(--ink-3); font-size: 13px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 18px 20px; }
.stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.stat span { color: var(--ink-3); font-size: 13px; }
.stat b.long { font-size: 19px; line-height: 1.6; }

/* ---------- списки ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; gap: 14px; align-items: center; padding: 14px 24px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.item:first-child { border-top: 0; }
a.item:hover, button.item:hover { background: rgba(132, 150, 255, 0.04); }
button.item { width: 100%; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; cursor: pointer; }
.item .ico { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--glass-2); }
.item .ico svg { width: 18px; height: 18px; }
.item .ico.alarm { background: rgba(var(--alarm-rgb), 0.14); color: var(--alarm); }
.item .ico.watch { background: rgba(var(--watch-rgb), 0.14); color: var(--watch); }
.item .ico.signal { background: rgba(var(--signal-rgb), 0.14); color: var(--signal); }
.item .ico img { width: 38px; height: 38px; border-radius: 12px; }
.item .body { flex: 1; min-width: 0; }
.item .body > b, .item .body > div > b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .body > span, .item .body > div > span { display: block; color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .body .chip { display: inline-flex; }
.item time { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.empty { padding: 44px 24px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink-2); font-size: 16px; margin-bottom: 4px; }

/* ---------- группы ---------- */
.groups { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.glist { padding: 10px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 24px; }
.gitem { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); border: 1px solid transparent; background: transparent; cursor: pointer; text-align: left; width: 100%; }
.gitem:hover { background: var(--glass); }
.gitem.on { background: var(--glass-2); border-color: var(--line); }
.gitem .sw { width: 12px; height: 12px; border-radius: 4px; flex: none; box-shadow: 0 0 12px currentColor; }
.gitem b { display: block; font-weight: 600; font-size: 14px; }
.gitem span { display: block; color: var(--ink-3); font-size: 12.5px; }
.gitem .tags { margin-left: auto; display: flex; gap: 4px; }
.gitem .tags svg { width: 15px; height: 15px; color: var(--ink-3); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 9px; border: 2px solid transparent; cursor: pointer; }
.swatches button.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15); }

.policy { display: flex; flex-direction: column; }
.policy h3 { font-size: 13px; font-weight: 700; color: var(--ink-3); padding: 18px 0 6px; }
.prule { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.prule .name { font-size: 14px; }
.prule .name.danger::after { content: 'опасно'; margin-left: 8px; font-size: 11px; font-weight: 700; color: #ff9db0; background: rgba(var(--alarm-rgb), 0.14); padding: 1px 7px; border-radius: 99px; vertical-align: 1px; }
.prule .ctl { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.prule .limit { display: flex; gap: 8px; align-items: center; color: var(--ink-3); font-size: 13px; }
.prule .limit .select { height: 34px; }
.prule .limit .input { height: 34px; }

.picker { position: relative; }
.menu {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; max-height: 300px; overflow-y: auto; padding: 6px;
  background: rgba(13, 19, 38, 0.97); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow);
}
.menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left; font-size: 14px; }
.menu button:hover, .menu button.hl { background: var(--glass-2); }
.menu button img { width: 24px; height: 24px; border-radius: 50%; }
.menu button .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.menu button small { color: var(--ink-3); margin-left: auto; font-size: 12px; }
.menu .none { padding: 10px; color: var(--ink-3); font-size: 13px; }

/* ---------- панель сохранения ---------- */
.savebar {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%); z-index: 40; transition: transform 0.25s cubic-bezier(.2, .9, .3, 1.2);
  display: flex; gap: 14px; align-items: center; padding: 10px 10px 10px 20px; border-radius: 16px;
  background: rgba(14, 20, 40, 0.92); border: 1px solid var(--line-2); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); max-width: calc(100vw - 32px);
}
.savebar:not(.show) { visibility: hidden; transition: transform 0.2s, visibility 0s 0.2s; }
.savebar.show { transform: translate(-50%, 0); }
.savebar span { font-weight: 600; font-size: 14px; }

/* ---------- окна и всплывающие ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(2, 4, 10, 0.6); backdrop-filter: blur(6px); animation: fade 0.15s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: rgba(14, 20, 40, 0.96); }
.modal.wide { width: min(780px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.modal-head h2 { font-size: 19px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 22px; }
@keyframes fade { from { opacity: 0; } }

#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { max-width: 420px; padding: 12px 16px; border-radius: 12px; background: rgba(14, 20, 40, 0.96); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; animation: rise 0.2s ease-out; }
.toast.err { border-color: rgba(var(--alarm-rgb), 0.5); }
.toast.ok { border-color: rgba(var(--armed-rgb), 0.45); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

.notice { display: flex; gap: 12px; padding: 14px 18px; border-radius: var(--r-md); background: rgba(var(--watch-rgb), 0.09); border: 1px solid rgba(var(--watch-rgb), 0.28); color: #f6d39f; font-size: 14px; margin-bottom: 20px; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.notice.alarm { background: rgba(var(--alarm-rgb), 0.09); border-color: rgba(var(--alarm-rgb), 0.35); color: #ffc2cd; }
.notice.info { background: rgba(var(--signal-rgb), 0.08); border-color: rgba(var(--signal-rgb), 0.28); color: #cdd8ff; }

.result { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.result:first-child { border-top: 0; }
.result svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.result.ok svg { color: var(--armed); }
.result.no svg { color: var(--alarm); }
.result.manual svg { color: var(--watch); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 13px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 24px; border-top: 1px solid var(--line); vertical-align: top; }
.table tr:first-child td { border-top: 0; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }

/* ---------- вход ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate .panel { width: min(440px, 100%); padding: 40px 36px; text-align: center; }
.gate img { width: 72px; height: 72px; margin-bottom: 18px; filter: drop-shadow(0 0 24px rgba(var(--signal-rgb), 0.5)); }
.gate h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.gate p { color: var(--ink-2); margin: 10px 0 26px; }
.gate .btn { width: 100%; height: 48px; font-size: 15px; }
.gate .btn svg { width: 20px; height: 20px; }

/* ---------- адаптив ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .groups { grid-template-columns: minmax(0, 1fr); }
  .glist { position: static; flex-direction: row; overflow-x: auto; }
  .gitem { width: auto; flex: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 45; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform 0.25s; background: rgba(8, 12, 26, 0.97); }
  .shell.nav-open .side { transform: none; box-shadow: 30px 0 60px rgba(0, 0, 0, 0.6); }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; padding: 12px 16px; background: rgba(6, 9, 19, 0.85); backdrop-filter: var(--blur); border-bottom: 1px solid var(--line); }
  .topbar b { font-weight: 800; }
  .main { padding: 22px 16px 120px; }
  .page-head h1 { font-size: 25px; }
  .ward { grid-template-columns: minmax(0, 1fr); text-align: center; justify-items: center; padding: 26px 20px; }
  .ward .crest { width: 130px; height: 130px; }
  .ward .crest svg { width: 116px; height: 116px; }
  .seg { flex-wrap: wrap; }
  .savebar { left: 16px; right: 16px; transform: translateY(140%); }
  .savebar.show { transform: none; }
  .savebar span { display: none; }
  .ward .controls { justify-content: center; }
  .ward .state { font-size: 28px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .prule { grid-template-columns: 1fr; }
  .prule .ctl { justify-content: flex-start; }
  .item { padding: 12px 16px; }
  .pad { padding: 18px; }
  .table th, .table td { padding: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
