/* Дизайн-система: спокойные сплошные поверхности, slate + зелёный статус, Fira (по ui-ux-pro-max) */
:root {
  --bg: #f3f4f6;
  --glass: #ffffff;
  --glass-strong: #ffffff;
  --glass-border: #e5e7eb;
  --surface: #ffffff;
  --sunken: #f6f7f9;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --primary: #1e293b;
  --on-primary: #ffffff;
  --accent: #16a34a;
  --ok: #16a34a;
  --bad: #e11d48;
  --warn: #d97706;
  --ring-track: rgba(148, 163, 184, .2);
  --chart-1: #2563eb;
  --chart-2: #059669;
  --dark-zone: #0f172a;
  --blob-1: #c7d7fe; --blob-2: #c4f1e0; --blob-3: #f5d0fe; --blob-4: #fde2c4;
  --t-blue: #2563eb; --t-green: #059669; --t-violet: #7c3aed; --t-orange: #ea580c; --t-pink: #db2777; --t-slate: #475569;
  --r-xl: 28px; --r-lg: 22px; --r: 16px; --r-sm: 12px;
  --blur: saturate(160%) blur(18px);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-lift: 0 4px 16px -6px rgba(15, 23, 42, .14);
  --sans: "Fira Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1117;
  --glass: #161b24;
  --glass-strong: #161b24;
  --glass-border: #262d3a;
  --surface: #161b24;
  --sunken: #1d2330;
  --line: #262d3a;
  --line-strong: #353d4c;
  --ink: #f8fafc;
  --ink-2: #cbd5e1;
  --muted: #94a3b8;
  --faint: #64748b;
  --primary: #f8fafc;
  --on-primary: #0f172a;
  --accent: #22c55e;
  --ok: #22c55e;
  --bad: #fb7185;
  --warn: #fbbf24;
  --ring-track: rgba(148, 163, 184, .14);
  --chart-1: #3b82f6;
  --chart-2: #059669;
  --dark-zone: #070b14;
  --blob-1: #1e3a8a; --blob-2: #064e3b; --blob-3: #4c1d95; --blob-4: #7c2d12;
  --t-blue: #60a5fa; --t-green: #34d399; --t-violet: #a78bfa; --t-orange: #fb923c; --t-pink: #f472b6; --t-slate: #94a3b8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lift: 0 6px 18px -6px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
html { background: var(--bg); touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; background: var(--bg); }
a { color: inherit; }
button, a, label.btn, [data-tab], tr.click { cursor: pointer; }
.hidden { display: none !important; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--sunken); border: 1px solid var(--line); border-radius: 8px; padding: 1px 7px; }
:focus-visible { outline: 2px solid var(--t-blue); outline-offset: 2px; border-radius: 10px; }

/* стеклянная поверхность */
.glass, .card, .side, .modal-box, .login-card, .tabs { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }

/* ---------- иконки ---------- */
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* цвета разделов */
.t-blue { --t: var(--t-blue); } .t-green { --t: var(--t-green); } .t-violet { --t: var(--t-violet); }
.t-orange { --t: var(--t-orange); } .t-pink { --t: var(--t-pink); } .t-slate { --t: var(--t-slate); }
.tile { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex: none; color: var(--t, var(--ink-2));
  background: color-mix(in srgb, var(--t, #64748b) 13%, transparent); border: 1px solid color-mix(in srgb, var(--t, #64748b) 22%, transparent); }
.tile .i { width: 20px; height: 20px; }
.tile.sm { width: 32px; height: 32px; border-radius: 10px; }
.tile.sm .i { width: 15px; height: 15px; }

/* ---------- каркас ---------- */
.layout { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; padding: 14px; gap: 14px; }
.side { border-radius: var(--r-xl); padding: 18px 12px 12px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 14px; height: calc(100vh - 28px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; font-weight: 600; font-size: 15.5px; }
.brand-mark { width: 40px; height: 40px; border-radius: 14px; color: #fff; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); }
.brand small { display: block; font: 400 11.5px/1.3 var(--mono); color: var(--muted); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-group { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 12px 12px 4px; }
.nav-group:first-child { padding-top: 0; }
nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 8px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; font-weight: 500; transition: background .2s var(--ease), color .2s; }
nav a .nav-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: var(--t); background: color-mix(in srgb, var(--t) 11%, transparent); transition: background .2s, color .2s; }
nav a .nav-ico .i { width: 16px; height: 16px; }
nav a:hover { background: var(--glass-strong); color: var(--ink); }
nav a.active { background: var(--sunken); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
nav a.active .nav-ico { background: var(--t); color: #fff; }
.side-foot { margin-top: auto; display: flex; gap: 6px; }
.side-foot .btn { flex: 1; justify-content: center; }
main { padding: 14px 18px 48px; max-width: 1260px; width: 100%; min-width: 0; }

.tabbar, .nav-backdrop { display: none; }
@media (max-width: 860px) {
  /* сверху — только бренд и две кнопки, разделы — в нижней панели и шторке «Меню» */
  .layout { display: block; padding: 0; min-height: 100dvh; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
    border-radius: 0; border: 0; border-bottom: 1px solid var(--line); box-shadow: none; }
  .brand { gap: 10px; padding: 0; min-width: 0; flex: 1; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .brand small { max-width: 46vw; }
  .side-foot { margin: 0; flex: none; }
  .side-foot .btn { flex: none; min-width: 40px; }
  .side-foot .btn span.lbl { display: none; }
  main { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }

  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
    border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; border: 0; background: none; border-radius: 14px;
    color: var(--muted); font: 500 11.5px var(--sans); text-decoration: none; -webkit-tap-highlight-color: transparent; transition: color .2s, background .2s; }
  .tabbar .i { width: 22px; height: 22px; }
  .tabbar a.active, .tabbar button.active, .tabbar button[aria-expanded="true"] { color: var(--ink); }
  .tabbar a.active .i, .tabbar button.active .i { color: var(--t-blue); }
  .tabbar a:active, .tabbar button:active { background: var(--sunken); }

  /* шторка со всеми разделами */
  nav#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 39; max-height: min(78dvh, 640px); overflow-y: auto; overscroll-behavior: contain;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-content: start;
    background: var(--surface); border-top: 1px solid var(--line); border-radius: 24px 24px 0 0; box-shadow: 0 -20px 50px -20px rgba(15, 23, 42, .35);
    padding: 8px 10px calc(84px + env(safe-area-inset-bottom)); transform: translateY(100%); visibility: hidden; transition: transform .32s var(--ease), visibility 0s .32s; }
  body.menu-open nav#nav { transform: none; visibility: visible; transition: transform .32s var(--ease); }
  nav#nav::before { content: ""; grid-column: 1 / -1; justify-self: center; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin-bottom: 6px; }
  .nav-group { grid-column: 1 / -1; padding: 8px 4px 0; font-size: 10.5px; }
  .nav-group:first-child { padding-top: 0; }
  nav a { flex-direction: column; justify-content: center; gap: 5px; min-height: 72px; padding: 8px 2px; text-align: center; font-size: 11.5px; line-height: 1.2; background: var(--sunken); border-radius: 16px; white-space: normal; hyphens: auto; }
  nav a .nav-ico { width: 32px; height: 32px; }
  nav a.active { box-shadow: inset 0 0 0 1.5px var(--t); background: color-mix(in srgb, var(--t) 8%, var(--sunken)); }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 38; background: rgba(15, 23, 42, .4); opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.menu-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  body.member .tabbar a:not([href="#servers"]) { display: none; }
  body.member .tabbar { grid-template-columns: 1fr 1fr; }
}

/* ---------- заголовок страницы ---------- */
.head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head-title { display: flex; align-items: center; gap: 16px; }
.head-title .tile { width: 54px; height: 54px; border-radius: 18px; }
.head-title .tile .i { width: 24px; height: 24px; }
h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
.sub { color: var(--muted); margin-top: 4px; max-width: 640px; font-size: 14px; }

/* ---------- блоки ---------- */
.card { border-radius: var(--r-lg); padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); }
.grid > * { min-width: 0; }
.grid.metrics { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1180px) { .grid.metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .grid.wide { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.mt { margin-top: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 52px 20px; color: var(--muted); border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--glass); grid-column: 1 / -1; }
.empty b { color: var(--ink); font-weight: 600; font-size: 16px; }
.empty .tile { width: 58px; height: 58px; border-radius: 20px; }

/* появление: элементы выезжают по очереди */
.rise > * { animation: rise .45s var(--ease) both; }
.rise > *:nth-child(2) { animation-delay: .05s; } .rise > *:nth-child(3) { animation-delay: .1s; }
.rise > *:nth-child(4) { animation-delay: .15s; } .rise > *:nth-child(5) { animation-delay: .2s; } .rise > *:nth-child(n+6) { animation-delay: .25s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.985); } }

/* ---------- обзор: блок-приветствие ---------- */
.hero { border-radius: var(--r-xl); padding: 26px 28px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-end; }
.live { display: inline-flex; align-items: center; gap: 8px; font: 500 14px var(--sans); color: var(--ok); }
.hero h1 { font-size: 32px; margin: 14px 0 6px; }
.hero p { margin: 0; color: var(--muted); max-width: 460px; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.hero-meta span { font: 500 13px var(--sans); color: var(--ink-2); background: var(--sunken); border-radius: 8px; padding: 5px 10px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- метрики ---------- */
.metric { display: flex; align-items: center; justify-content: space-between; gap: 12px; transition: transform .25s var(--ease), box-shadow .25s; }
.metric:hover { border-color: var(--line-strong); }
.metric-label { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.metric-value { font: 600 32px/1.1 var(--mono); letter-spacing: -.04em; margin: 14px 0 4px; color: var(--ink); }
.metric-value small { font-size: 15px; color: var(--muted); letter-spacing: 0; margin-left: 2px; font-weight: 500; }
.ring-wrap { position: relative; width: 72px; height: 72px; flex: none; }
.ring { width: 72px; height: 72px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring .track { stroke: var(--ring-track); }
.ring .val { stroke: var(--t, var(--ink)); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.ring.hot .val { stroke: var(--bad); }
canvas.spark { width: 100%; height: 160px; display: block; }
.legend { display: flex; gap: 16px; font: 13px var(--sans); color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; background: var(--glass-strong); color: var(--ink-2); border: 1px solid var(--line); border-radius: 13px; padding: 8px 15px; font: 500 14px var(--sans); text-decoration: none; transition: background .2s, border-color .2s, transform .12s, box-shadow .2s, color .2s; white-space: nowrap; }
.btn:hover { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { filter: brightness(1.15); }
.btn.go { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.go:hover { filter: brightness(1.08); }
.btn.danger:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 13.5px; border-radius: 12px; }
.btn.icon { min-width: 36px; padding: 6px; }
.btn.pill { border-radius: 99px; }
.btn:disabled { opacity: .55; cursor: progress; }

/* ---------- формы ---------- */
input, select, textarea { -webkit-appearance: none; appearance: none; line-height: 1.4; background-color: var(--sunken); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; font: 15px var(--sans); width: 100%; min-height: 44px; transition: border-color .2s, box-shadow .2s, background .2s; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { outline: none; background-color: var(--surface); border-color: var(--t-blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--t-blue) 16%, transparent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
select { padding-right: 40px; background-image: 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='%2364748b' stroke-width='2' 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 14px center; cursor: pointer; }
input[type=checkbox] { -webkit-appearance: auto; appearance: auto;  width: 18px; height: 18px; min-height: 0; accent-color: var(--t-blue); margin: 0; }
input[type=file] { -webkit-appearance: auto; appearance: auto; padding: 8px; font-size: 13.5px; }
input[type=file]::file-selector-button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 6px 12px; margin-right: 10px; font: 500 13px var(--sans); cursor: pointer; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 7px; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; margin: 0; cursor: pointer; min-height: 32px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.field { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 14px; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }

/* ---------- статусы ---------- */
/* Статус — цветная точка и слово, без «таблетки» */
.status { display: inline-flex; align-items: center; gap: 8px; font: 500 14px var(--sans); color: var(--muted); white-space: nowrap; flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.status.running { color: var(--ok); }
.status.running .dot, .live .dot { background: var(--ok); animation: pulse 2s ease-in-out infinite; }
.status.crashed { color: var(--bad); } .status.crashed .dot { background: var(--bad); }
.status.installing { color: var(--warn); } .status.installing .dot { background: var(--warn); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); } 60% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } }
/* Метка — спокойный прямоугольник обычным шрифтом */
.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 13px var(--sans); color: var(--ink-2); background: var(--sunken); border: 0; border-radius: 8px; padding: 5px 10px; line-height: 1.3; }
.tag .i { width: 14px; height: 14px; color: var(--muted); }

/* ---------- карточка проекта ---------- */
.app-card { display: flex; flex-direction: column; gap: 16px; transition: transform .25s var(--ease), box-shadow .25s; }
/* без подскока: при наведении только чуть ярче рамка */
.app-card:hover { border-color: var(--line-strong); }
.app-title { display: flex; align-items: center; gap: 13px; min-width: 0; flex: 1; }
.app-title b { display: block; font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kv b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv div { padding: 10px 13px; min-width: 0; background: var(--sunken); border-radius: var(--r); }
.kv span { display: block; font-size: 11.5px; color: var(--muted); }
.kv b { font: 600 14.5px var(--mono); color: var(--ink); }
.cmd { font: 12.5px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.link { display: inline-flex; align-items: center; gap: 5px; font: 13px var(--mono); color: var(--t-blue); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .i { width: 14px; height: 14px; }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; }
.table-box { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--glass-strong); }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 11px 16px; white-space: nowrap; }
td { border-top: 1px solid var(--line); }
th { font: 500 11.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--sunken); }
td.num { font-family: var(--mono); font-size: 13px; }
tr.click:hover td { background: color-mix(in srgb, var(--t-blue) 5%, transparent); }
.name-cell { display: flex; align-items: center; gap: 11px; font-weight: 500; }
.name-cell > .i { color: var(--faint); }

/* ---------- тёмные зоны ---------- */
.logs { background: var(--dark-zone); color: #cbd5e1; border-radius: var(--r-lg); padding: 16px 18px; height: 56vh; overflow: auto; white-space: pre-wrap; word-break: break-all; font: 12.5px/1.7 var(--mono); }
.logs .err { color: #fda4af; }
.logs .sys { color: #7dd3fc; }
textarea.code { font: 13px/1.7 var(--mono); height: 62vh; resize: vertical; tab-size: 2; }
.term { background: var(--dark-zone); border-radius: var(--r-lg); padding: 14px; height: 62vh; }

/* ---------- модальные окна ---------- */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .2s ease-out; }
.modal-box { background: var(--glass-strong); border-radius: var(--r-xl); width: min(920px, 100%); max-height: 92vh; overflow: auto; padding: 24px 26px; box-shadow: 0 40px 80px -24px rgba(15, 23, 42, .45); animation: pop .3s var(--ease); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-head b { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { display: flex; gap: 10px; align-items: flex-start; background: #0f172a; color: #f1f5f9; padding: 13px 17px; border-radius: 18px; max-width: 390px; font-size: 14px; box-shadow: 0 16px 34px -12px rgba(15, 23, 42, .6); animation: pop .3s var(--ease); border: 1px solid rgba(255,255,255,.08); }
.toast .i { margin-top: 1px; color: #4ade80; }
.toast.bad .i { color: #fb7185; }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { border-radius: var(--r-xl); padding: 36px; width: min(390px, 100%); display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lift); animation: pop .4s var(--ease); }
.login-card .brand-mark { width: 52px; height: 52px; border-radius: 18px; }
.login-card h1 { font-size: 24px; margin-top: 10px; }
.err { color: var(--bad); min-height: 20px; font-size: 13.5px; }

/* ---------- файлы ---------- */
.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font: 13px var(--mono); color: var(--faint); background: var(--sunken); border-radius: 12px; padding: 4px; }
.crumbs a { padding: 4px 10px; border-radius: 8px; color: var(--muted); }
.crumbs a:hover { background: var(--surface); color: var(--ink); }
.crumbs a:last-child { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; opacity: .55; transition: opacity .2s; }
tr:hover .row-actions, .row-actions:focus-within { opacity: 1; }

/* ---------- AI ---------- */
.tabs { display: inline-flex; border-radius: 16px; padding: 5px; margin-bottom: 16px; gap: 4px; }
.tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; border: 0; background: transparent; padding: 6px 18px; border-radius: 11px; font: 500 14px var(--sans); color: var(--muted); transition: background .2s, color .2s; }
.tabs button.on { background: var(--primary); color: var(--on-primary); }
.chat { display: flex; flex-direction: column; gap: 12px; height: 56vh; overflow: auto; padding: 4px 2px; }
.msg { padding: 12px 17px; border-radius: 22px; max-width: 80%; white-space: pre-wrap; line-height: 1.6; animation: rise .3s var(--ease); }
.msg.user { background: var(--primary); color: var(--on-primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 7px; }
.msg.bot { background: var(--glass-strong); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 7px; }
.msg .act { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
.composer { display: flex; gap: 8px; align-items: center; background: var(--glass-strong); border: 1px solid var(--line); border-radius: 99px; padding: 6px 6px 6px 10px; margin-top: 12px; }
.composer input { flex: 1; border: 0; background: transparent; box-shadow: none; }
.composer input:focus { box-shadow: none; background-color: transparent; }
.composer .btn { border-radius: 99px; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.suggest button { min-height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 5px 14px; font: 13.5px var(--sans); color: var(--ink-2); transition: border-color .2s, transform .12s, color .2s; }
.suggest button:hover { border-color: var(--t-blue); color: var(--t-blue); }
.suggest button:active { transform: scale(.96); }
iframe.preview { width: 100%; height: 62vh; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.browser-bar { display: flex; align-items: center; gap: 8px; background: var(--sunken); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 9px 12px; }
.browser-bar + iframe.preview { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.browser-bar .dots { display: flex; gap: 6px; }
.browser-bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: #f87171; } .browser-bar .dots i:nth-child(2) { background: #fbbf24; } .browser-bar .dots i:nth-child(3) { background: #34d399; }
.browser-bar .url { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 4px 13px; font: 12.5px var(--mono); color: var(--muted); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- график нагрузки ---------- */
.chart-box { position: relative; }
.chart-tip { position: absolute; top: 8px; pointer-events: none; background: var(--glass-strong); border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; font: 12.5px/1.6 var(--mono); color: var(--ink); box-shadow: var(--shadow-lift); white-space: nowrap; transform: translateX(-50%); transition: left .08s linear; }
.chart-tip b { font-weight: 600; }
.chart-tip .k { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--c); vertical-align: middle; margin-right: 7px; }
.chart-tip .k.dash { border-top-style: dashed; }
.chart-now { display: flex; gap: 18px; flex-wrap: wrap; }
.chart-now div { display: flex; align-items: baseline; gap: 8px; }
.chart-now .k { display: inline-block; width: 16px; height: 0; border-top: 2.5px solid var(--c); align-self: center; }
.chart-now .k.dash { border-top-style: dashed; }
.chart-now b { font: 600 20px var(--mono); letter-spacing: -.03em; }
.chart-now span { color: var(--muted); font-size: 13px; }
.chart-table { margin-top: 14px; }

/* ---------- разделы сервера ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.notice b { font-weight: 600; }
.group-title { margin: 22px 0 12px; font-size: 15px; color: var(--ink-2); }
.group-title:first-child { margin-top: 0; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 42px; background-color: var(--surface); }
.card.off { opacity: .65; }
tr.dim td { opacity: .55; }
.sec-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); align-items: start; }
.sec-wide { grid-column: 1 / -1; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form > * { flex: 1 1 140px; width: auto; }
.inline-form .btn { flex: 0 0 auto; min-height: 44px; }
.banned, .key-row { padding: 8px 8px 8px 14px; background: var(--sunken); border-radius: var(--r-sm); flex-wrap: nowrap; gap: 10px; }
pre.last { margin: 0; background: var(--sunken); border-radius: var(--r); padding: 12px 14px; overflow-x: auto; color: var(--ink-2); }
.cfg { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; align-items: start; }
.cfg-list { padding: 12px 8px; position: sticky; top: 14px; max-height: calc(100vh - 140px); overflow-y: auto; }
.cfg-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; border: 0; background: transparent; border-radius: var(--r-sm); color: var(--ink-2); font: 14px var(--sans); text-align: left; }
.cfg-item .i { color: var(--faint); width: 16px; height: 16px; }
.cfg-item:hover { background: var(--sunken); }
.cfg-item.on { background: var(--sunken); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.cfg-edit textarea.code { height: 60vh; }
@media (max-width: 860px) { .cfg { grid-template-columns: minmax(0, 1fr); } .cfg-list { position: static; max-height: none; } }
input.filled, select.filled, textarea.filled { border-color: var(--t-pink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--t-pink) 16%, transparent); transition: box-shadow .3s; }

/* ---------- помощник в углу ---------- */
body:not(.authed) .asst, body:not(.authed) .asst-fab { display: none !important; }
.asst-fab { position: fixed; right: 22px; bottom: 22px; z-index: 45; width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary); box-shadow: 0 10px 28px -8px rgba(15, 23, 42, .45); transition: transform .2s var(--ease), box-shadow .2s; }
.asst-fab:hover { transform: translateY(-2px) scale(1.04); }
.asst-fab:active { transform: scale(.95); }
.asst-fab .i { width: 22px; height: 22px; }
.asst { position: fixed; right: 22px; bottom: 22px; z-index: 45; width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 44px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: 0 30px 70px -20px rgba(15, 23, 42, .4); animation: pop .25s var(--ease); overflow: hidden; }
.asst-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.asst-head b { font-weight: 600; }
.asst-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.amsg { padding: 10px 14px; border-radius: 18px; max-width: 88%; white-space: pre-wrap; line-height: 1.55; font-size: 14px; word-break: break-word; }
.amsg.user { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 6px; }
.amsg.bot { align-self: flex-start; background: var(--sunken); border-bottom-left-radius: 6px; }
.amsg.confirm { align-self: stretch; max-width: none; background: color-mix(in srgb, var(--warn) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); white-space: normal; }
.amsg pre { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 6px 0; font-size: 12.5px; }
.amsg code { font-size: 12.5px; }
.amsg.user code { background: transparent; border-color: rgba(255, 255, 255, .3); }
.amsg a { color: var(--t-blue); }
code.pend { display: block; white-space: pre-wrap; word-break: break-all; margin-top: 4px; }
.aacts { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font: 11.5px/1.5 var(--mono); color: var(--muted); white-space: normal; }
.aacts span { display: flex; gap: 6px; align-items: flex-start; word-break: break-all; }
.aacts .i { width: 13px; height: 13px; margin-top: 2px; color: var(--ok); }
.aacts .bad, .aacts .bad .i { color: var(--bad); }
.atips { display: flex; flex-wrap: wrap; gap: 6px; }
.atips button { min-height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 5px 13px; font: 13px var(--sans); color: var(--ink-2); transition: border-color .2s, color .2s; }
.atips button:hover { border-color: var(--t-pink); color: var(--t-pink); }
.asst-input { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.asst-input textarea { resize: none; min-height: 44px; max-height: 140px; border-radius: 16px; font-size: 14px; }
.asst-input .btn { min-height: 44px; min-width: 44px; border-radius: 14px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- серверы ---------- */
a.srv-card { text-decoration: none; color: inherit; }
.srv-meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.srv-meters > div { background: var(--sunken); border-radius: var(--r); padding: 10px 12px; min-height: 64px; }
.srv-meters span { display: block; font-size: 11.5px; color: var(--muted); }
.srv-meters b { font: 600 16px var(--mono); }
.srv-meters.skeleton > div { animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { 50% { opacity: .5; } }
.bar { height: 5px; border-radius: 99px; background: var(--ring-track); margin-top: 7px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--t-blue); transition: width .6s var(--ease); }
.bar.hot i { background: var(--bad); }
.tag-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 11%, transparent); }
a.tag { text-decoration: none; }
a.tag:hover { border-color: var(--line-strong); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13.5px; margin-bottom: 12px; }
.back .i { transform: rotate(-90deg); width: 15px; height: 15px; }
.back:hover { color: var(--ink); }
#tabs { flex-wrap: wrap; }
@media (max-width: 480px) { .srv-meters { grid-template-columns: 1fr 1fr 1fr; gap: 6px; } .srv-meters > div { padding: 8px; } }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; min-height: 32px; padding: 4px 14px; border-radius: 9px; font: 500 13.5px var(--sans); color: var(--muted); transition: background .2s, color .2s; }
.seg button { display: inline-flex; align-items: center; gap: 6px; }
.seg button .i { width: 15px; height: 15px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg button[data-m="always"].on { background: var(--bad); color: #fff; }
.seg button[data-m="auto"].on { background: var(--ok); color: #fff; }
.tfa-setup { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.tfa-setup .qr { width: 168px; height: 168px; flex: none; background: #fff; border-radius: var(--r); padding: 6px; border: 1px solid var(--line); }
.tfa-setup .qr svg { width: 100%; height: 100%; display: block; }
body.member #nav a:not([href="#servers"]):not([href="#settings"]), body.member .nav-group, body.member .asst-fab, body.member .asst { display: none !important; }
#login .stack input { margin: 0; }

/* ---------- папки, мониторинг, версия ---------- */
.folders { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 500 13.5px var(--sans); transition: background .2s, color .2s, border-color .2s; }
.fchip .i { width: 14px; height: 14px; color: var(--t, var(--faint)); }
.fchip:hover { border-color: var(--line-strong); }
.fchip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.fchip.on .i { color: inherit; }
.fchip.add { padding: 4px 10px; color: var(--muted); }
.tag-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.tag-bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 11%, transparent); }
.tag.muted { color: var(--faint); }
.upbars { display: flex; align-items: flex-end; justify-content: flex-end; gap: 2px; height: 34px; overflow: hidden; }
.upbars i { flex: 0 0 5px; border-radius: 2px; background: color-mix(in srgb, var(--ok) 70%, transparent); }
.upbars i.down { background: var(--bad); }
.note { background: var(--sunken); border-radius: var(--r-sm); padding: 9px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.cl + .cl { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.cl ul { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); line-height: 1.7; }
#ver { font: 500 12px var(--mono); flex: 0 0 auto !important; position: relative; }
#ver.fresh::after { content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--t-pink); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
/* Редактор базы: ячейки таблицы и сортировка по колонке */
.dbt td { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 13px var(--mono); }
.dbt th .sort { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.dbt th .sort .i { width: 12px; height: 12px; }
.dbt th .sort.on, .dbt th .sort:hover { color: var(--ink); }
.cfg.dbcfg { grid-template-columns: 220px minmax(0, 1fr); }
@media (max-width: 860px) { .cfg.dbcfg { grid-template-columns: minmax(0, 1fr); } }

/* ---------- телефон ---------- */
@media (max-width: 860px) {
  .asst-fab { right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); width: 50px; height: 50px; }
  .asst { inset: auto 0 0 0; width: 100%; height: min(86dvh, 720px); border-radius: 24px 24px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); z-index: 55; }
  #toasts { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }
  body.menu-open .asst-fab { display: none; }
}
@media (max-width: 640px) {
  html, body { font-size: 15px; }
  /* заголовок страницы: без большой плитки, кнопки во всю ширину */
  .head { gap: 12px; margin-bottom: 16px; }
  .head-title { gap: 12px; align-items: flex-start; }
  .head-title > .tile { display: none; }
  h1 { font-size: 24px; }
  .sub { font-size: 13.5px; }
  .head > .row { width: 100%; }
  .head > .row:empty { display: none; }
  .head > .row > .btn:not(.icon) { flex: 1 1 auto; }
  .hero { padding: 20px 18px; border-radius: var(--r-lg); }
  .hero h1 { font-size: 26px; margin-top: 10px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 auto; }
  .card { padding: 16px; border-radius: 20px; }
  .card-head { flex-wrap: wrap; }
  .grid, .stack { gap: 12px; }
  /* показатели — по два в ряд, кольцо прячем: число и полоска понятнее на узком экране */
  .grid.metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.metrics > .card { padding: 14px; }
  .metric .ring-wrap { display: none; }
  .metric-label { font-size: 12.5px; gap: 8px; }
  .metric-label .tile { width: 28px; height: 28px; border-radius: 9px; }
  .metric-label .tile .i { width: 14px; height: 14px; }
  .metric-value { font-size: 24px; margin: 10px 0 2px; }
  .grid.metrics .small, .grid.metrics .muted { font-size: 12px; }

  /* кнопки: палец попадает уверенно */
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; padding: 6px 12px; }
  .btn.icon { min-width: 40px; }
  .seg button, .tabs button { min-height: 38px; }
  .tabs { display: flex; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs button { flex: 1 0 auto; justify-content: center; padding: 6px 12px; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg button { flex: 1 0 auto; }
  .row-actions { opacity: 1; }
  input, select, textarea { font-size: 16px; } /* иначе iOS увеличивает страницу при вводе */

  /* карточки проектов: заголовок и статус переносятся, действия растягиваются */
  .app-card > .row.spread { flex-wrap: wrap !important; }
  .app-card .status { margin-left: auto; }
  .kv div { padding: 9px 11px; }
  .kv b { font-size: 13.5px; }
  .ellip { max-width: 100%; }
  .toolbar > * { flex: 1 1 100%; }
  .search { min-width: 0; }

  /* таблица превращается в список карточек */
  table.mcards, table.mcards tbody { display: block; }
  table.mcards tr:first-child:has(th) { display: none; }
  table.mcards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 12px 14px; }
  table.mcards tr + tr { border-top: 1px solid var(--line); }
  table.mcards tr:nth-child(2) { border-top: 0; }
  table.mcards td { display: block; border: 0; padding: 0; white-space: normal; min-width: 0; overflow-wrap: anywhere; }
  table.mcards td.m-name { grid-column: 1; font-weight: 500; }
  table.mcards td.m-act { grid-column: 2; grid-row: 1; }
  table.mcards td.m-hide { display: none; }
  table.mcards td[data-label] { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; text-align: right; }
  table.mcards td[data-label]::before { content: attr(data-label); color: var(--muted); font: 400 12.5px var(--sans); text-align: left; flex: none; }
  table.mcards td[data-label]:empty { display: none; }
  table.mcards .ellip { max-width: 60vw; }
  .table-box:has(table.mcards) { overflow: visible; }

  /* модальное окно — шторка снизу */
  .modal { place-items: end stretch; padding: 0; }
  .modal-box { width: 100%; max-height: 92dvh; border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: sheet .3s var(--ease); }
  .modal-head { position: sticky; top: -18px; z-index: 2; margin: -18px -16px 14px; padding: 16px 16px 12px; background: var(--glass-strong); border-bottom: 1px solid var(--line); }
  .modal-head b { font-size: 17px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-foot { flex-direction: column-reverse; align-items: stretch; }
  .form-foot > .row, .form-foot > div { justify-content: stretch; }
  .form-foot .btn { width: 100%; }
  .form-foot > .row .btn, .form-foot > div .btn { flex: 1 1 0; width: auto; }

  .logs, .term { height: 60dvh; border-radius: 16px; padding: 12px; }
  textarea.code { height: 60dvh; font-size: 13px; }
  .chat { height: 52dvh; }
  .msg { max-width: 92%; }
  .login-card { padding: 28px 22px; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
/* клавиши для терминала: видны только на сенсорных экранах */
.termkeys { display: none; }
@media (pointer: coarse) {
  .termkeys { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-top: 10px; padding-bottom: 2px; }
  .termkeys button { flex: none; min-width: 44px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); background: var(--sunken); color: var(--ink); border-radius: 10px; font: 500 13.5px var(--mono); -webkit-tap-highlight-color: transparent; }
  .termkeys button:active, .termkeys button.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
}
/* колонка действий в редакторе базы закреплена справа: кнопки видны при прокрутке широкой таблицы */
.dbt .dbt-act { position: sticky; right: 0; background: var(--surface); box-shadow: -8px 0 12px -10px rgba(15, 23, 42, .35); }
.dbt th.dbt-act { background: var(--sunken); }
.iso { padding: 14px; border-radius: var(--r); background: var(--sunken); }
.iso label.check .i { width: 16px; height: 16px; color: var(--ok); }

/* ===== Иконки серверов ===== */
.tile.ava { overflow: hidden; padding: 0; background: var(--sunken); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.tile.ava svg, .tile.ava img { width: 100%; height: 100%; display: block; object-fit: cover; }
.ava-wrap { position: relative; flex: none; display: inline-flex; }
.ava-btn { position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 2px solid var(--surface); background: var(--ink); color: var(--surface); opacity: 0; transform: scale(.8); transition: opacity .15s, transform .15s; }
.ava-btn .i { width: 12px; height: 12px; }
.srv-card:hover .ava-btn, .ava-btn:focus-visible { opacity: 1; transform: none; }
@media (pointer: coarse) { .ava-btn { opacity: 1; transform: none; } }
.ava-head { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 18px; flex: none; }
.ava-head .tile { width: 54px; height: 54px; border-radius: 18px; }
.ava-head:focus-visible { outline: 2px solid var(--t-blue); outline-offset: 2px; }
.ava-edit { display: flex; gap: 18px; align-items: center; }
.tile.ava-big { width: 96px; height: 96px; border-radius: 28px; }
.ava-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 96px)); gap: 10px; margin-top: 10px; }
.ava-grid .tile { width: 100%; height: auto; aspect-ratio: 1; border: 0; cursor: pointer; border-radius: 14px; transition: transform .12s; }
.ava-grid .tile:hover { transform: translateY(-2px); }
.ava-grid .tile.on { outline: 3px solid var(--t-blue); outline-offset: 2px; }
@media (max-width: 640px) { .ava-grid { grid-template-columns: repeat(4, 1fr); } }

/* ===== Пользователь с лимитами ===== */
body.client .asst-fab, body.client .asst, body.client #nav [hidden] { display: none !important; }
.app-card.foreign { opacity: .7; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 16px; }
.qcard { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px; }
.qnum { font-size: 26px; font-weight: 700; }
.qnum span { font-size: 15px; font-weight: 500; color: var(--muted); }
#nav [hidden], .tabbar [hidden] { display: none !important; }
@media (max-width: 640px) { .qgrid { grid-template-columns: 1fr 1fr; gap: 10px; } }

/* ===== Лицо проекта: аватарка бота, иконка сайта ===== */
.tile.proj-ava { background: var(--surface); }
.tile.proj-ava img { object-fit: cover; }
.bot-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.tile.proj-ava.fav img { object-fit: contain; padding: 9px; }

/* ===== Анимации ===== */
/* уведомления: выезжают, полоска показывает, сколько осталось, уходят со схлопыванием */
.toast { position: relative; overflow: hidden; cursor: pointer; animation: toastIn .38s var(--ease) both;
  transition: height .3s var(--ease), opacity .22s, transform .3s var(--ease), padding .3s var(--ease), margin .3s var(--ease); }
.toast.out { opacity: 0; transform: translateX(28px) scale(.96); padding-top: 0; padding-bottom: 0; margin-top: -8px; pointer-events: none; }
.toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #4ade80; opacity: .7; transform-origin: left; animation: toastBar linear forwards; }
.toast.bad .toast-bar { background: #fb7185; }
.toast.paused .toast-bar { animation-play-state: paused; }
.toast:hover { box-shadow: 0 20px 40px -12px rgba(15, 23, 42, .7); }
@keyframes toastIn { from { opacity: 0; transform: translateX(32px) scale(.94); } }
@keyframes toastBar { to { transform: scaleX(0); } }
@media (max-width: 640px) {
  @keyframes toastIn { from { opacity: 0; transform: translateY(18px) scale(.96); } }
  .toast.out { transform: translateY(12px) scale(.96); }
}
/* окна: закрываются так же плавно, как открываются; смена содержимого — мягкая */
.modal.closing { animation: fadeOut .2s ease-in forwards; pointer-events: none; }
.modal.closing .modal-box { animation: popOut .2s ease-in forwards; }
#modalBody.swap { animation: fade .25s ease-out; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@media (max-width: 640px) { .modal.closing .modal-box { animation: sheetOut .22s ease-in forwards; } }
@keyframes sheetOut { to { transform: translateY(60px); opacity: 0; } }
/* смена раздела и вкладки */
.page-in { animation: pageIn .3s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
/* живые элементы: карточки приподнимаются, полосы нагрузки и статусы меняются плавно */
.app-card { transition: border-color .2s, box-shadow .25s var(--ease), transform .25s var(--ease); }
@media (hover: hover) { .app-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); } a.card.qcard:hover, .srv-card:hover { transform: translateY(-2px); } }
.bar i { transition: width .6s var(--ease); }
.status, .status .dot, .tag { transition: color .3s, background .3s, border-color .3s; }
.tabs button, .seg button, .fchip { transition: background .2s, color .2s, box-shadow .2s, transform .12s; }
.tabs button:active, .seg button:active, .fchip:active { transform: scale(.96); }
.btn:disabled { transition: opacity .2s; }
.tile.ava img { transition: opacity .3s; }
@media (min-width: 641px) { body.authed #toasts { bottom: 90px; } }

/* ===== AI-генератор: сайт собирается на глазах ===== */
.btn .spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.btn.busy { position: relative; overflow: hidden; }
.btn.busy::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%); animation: sweep 1.6s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.gen { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.gen-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.gen-steps { display: flex; flex-direction: column; gap: 4px; }
.gstep { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; font-size: 14px; color: var(--muted); transition: color .3s, background .3s; }
.gstep .gdot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; position: relative; transition: border-color .3s, background .3s; }
.gstep.on { color: var(--ink); background: var(--sunken); }
.gstep.on .gdot { border-color: var(--t-pink); border-right-color: transparent; animation: spin .9s linear infinite; }
.gstep.ok { color: var(--ink-2); }
.gstep.ok .gdot { border-color: var(--ok); background: var(--ok); animation: pop .3s var(--ease); }
.gstep.ok .gdot::after { content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.gen-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gen-meta div { background: var(--sunken); border-radius: 12px; padding: 8px 12px; }
.gen-meta span { display: block; font-size: 12px; color: var(--muted); }
.gen-meta b { font: 600 15px var(--mono); }
.gen-frame { position: relative; overflow: hidden; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.gen-frame iframe.preview { border-radius: 0 0 var(--r-lg) var(--r-lg); display: block; transition: filter .5s, opacity .5s; }
.gen-frame.building iframe { filter: saturate(.85); }
.gen-scan { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--t-pink) 16%, transparent) 50%, transparent 100%); background-size: 100% 40%; background-repeat: no-repeat; }
.gen-frame.building .gen-scan { opacity: 1; animation: scan 2.4s ease-in-out infinite; }
@keyframes scan { from { background-position: 0 -40%; } to { background-position: 0 140%; } }
.gen-frame.ready { animation: readyGlow 1.2s var(--ease); }
@keyframes readyGlow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.gen-frame.stopped iframe { opacity: .5; }
.gen-ghost { position: absolute; inset: 0; padding: 28px; display: grid; gap: 16px; grid-template-rows: 44px 180px 1fr 90px; background: #fff; }
.gen-ghost i { border-radius: 14px; background: linear-gradient(90deg, #eef0f4 0%, #f7f8fa 50%, #eef0f4 100%); background-size: 200% 100%; animation: ghost 1.4s linear infinite; }
.gen-ghost i:nth-child(1) { width: 40%; } .gen-ghost i:nth-child(3) { width: 85%; }
@keyframes ghost { to { background-position: -200% 0; } }
@media (max-width: 860px) { .gen { grid-template-columns: 1fr; } .gen-side { position: static; } .gen-steps { display: grid; grid-template-columns: 1fr 1fr; } }
.msearch { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.msearch .search { max-width: none; }
.msearch .folders { margin: 0; }
/* MCP: список ключей, журнал вызовов, права */
tr.click { cursor: pointer; transition: background .15s; }
tr.click:hover td, tr.click:focus-visible td { background: var(--sunken); }
tr.click:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.mcp-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.mcp-badges .tag { font-size: 11.5px; padding: 2px 7px; }
.mcp-badges:empty { display: none; }
.mlog-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mlog-bar .search { max-width: none; }
.mlog-list { display: flex; flex-direction: column; gap: 6px; max-height: 56vh; overflow: auto; }
.mlog { flex: none; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.mlog summary { display: grid; grid-template-columns: 10px 132px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 12px; cursor: pointer; list-style: none; min-height: 44px; }
.mlog summary::-webkit-details-marker { display: none; }
.mlog summary:hover { background: var(--sunken); border-radius: var(--r-sm); }
.mlog .mdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.mlog.err .mdot { background: var(--bad); } .mlog.denied .mdot { background: var(--warn); } .mlog.connect .mdot { background: var(--t-blue); }
.mlog.err { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.mlog.denied { border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }
.mtime { font-size: 12.5px; color: var(--muted); }
.mmain { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.mmain b { font-weight: 600; font-size: 14px; }
.mmain code { font-size: 12px; color: var(--muted); }
.mmain .tag { font-size: 11px; padding: 1px 6px; }
.msub { flex-basis: 100%; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }
.mms { font-size: 12.5px; color: var(--faint); }
.mbody { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.mlabel { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.mbody pre.last { font-size: 12.5px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.mcalls { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.mcalls div { display: grid; grid-template-columns: 56px minmax(0, 1fr) 40px 56px; gap: 8px; align-items: center; padding: 5px 10px; background: var(--sunken); border-radius: 8px; }
.mcalls code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcalls .mm { font: 600 11.5px var(--mono); color: var(--t-violet); }
.mcalls .okc { color: var(--ok); font-family: var(--mono); } .mcalls .bad { color: var(--bad); font-family: var(--mono); }
.mk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; margin-top: 6px; }
.mk-item { align-items: flex-start; min-height: 36px; padding: 4px 0; }
.mk-item input { margin-top: 3px; }
.mk-item.off { opacity: .45; }
.mk-item .tag { font-size: 11px; padding: 1px 6px; margin-left: 4px; }
.mk-code { display: block; font-size: 11.5px; color: var(--faint); }
.mk-group { margin-top: 12px; }
@media (max-width: 640px) {
  .mlog summary { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .mlog .mtime { grid-column: 2 / -1; grid-row: 2; }
  .mlog-bar .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .mlog-bar .seg button { flex: none; }
  .mlog-list { max-height: none; overflow: visible; }
  .mbody .kv { grid-template-columns: 1fr; }
  .mk-grid { grid-template-columns: 1fr; }
  .mcalls div { grid-template-columns: 48px minmax(0, 1fr) 36px; }
  .mcalls div .muted { display: none; }
}

/* ===== Визуальный редактор ===== */
body.ed-open { overflow: hidden; }
.ed { position: fixed; inset: 0; z-index: 58; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); }
.ed-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); min-height: 56px; }
.ed-site { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.ed-site b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.ed-page { width: auto; max-width: 220px; min-height: 36px; padding: 6px 30px 6px 10px; font-size: 13.5px; }
.ed-dock { display: flex; align-items: center; gap: 6px; }
.ed-ai { display: inline-flex; align-items: center; gap: 7px; font: 500 12.5px var(--mono); color: var(--muted); padding: 0 6px 0 10px; white-space: nowrap; }
.ed-ai i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.ed-ai.off i { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 20%, transparent); }
.ed-main { flex: 1; display: flex; min-height: 0; }
.ed-stage { flex: 1; min-width: 0; padding: 12px; }
.ed-stage iframe { width: 100%; height: 100%; border: 1px solid var(--line); border-radius: var(--r); background: #fff; display: block; box-shadow: var(--shadow-lift); }
.ed-panel { width: 372px; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); min-height: 0; }
.ed-empty { margin: auto; padding: 28px; display: grid; justify-items: center; gap: 10px; text-align: center; max-width: 300px; }
.ed-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ed-crumb { display: flex; align-items: center; gap: 8px; padding: 14px 14px 0; }
.ed-crumb code { flex: 1; min-width: 0; font: 12px var(--mono); background: var(--sunken); border: 1px solid var(--line); padding: 7px 10px; border-radius: 10px; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.ed-tabs { display: flex; margin: 12px 14px 0; }
.ed-tabs button { flex: 1; justify-content: center; padding: 4px 8px; }
.ed-tabs button.on, .ed .seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); }
.ed-scroll { flex: 1; overflow: auto; padding: 14px; overscroll-behavior: contain; }
.ed-l { display: block; font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 7px; }
.ed-scroll section > .ed-l:first-child, .ed-note + .ed-l { margin-top: 0; }
.ed textarea { width: 100%; resize: vertical; min-height: 96px; line-height: 1.45; }
.ed-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ed-row { display: flex; align-items: center; gap: 8px; }
.ed-row > * { min-width: 0; }
.ed-row input[type=range] { flex: 2; accent-color: var(--t-violet); }
.ed-row input[type=number], .ed-row select { flex: 1; }
.ed-row .seg { flex: none; }
.ed input[type=color] { width: 44px; height: 38px; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); flex: none; }
.ed-sw { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-sw button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong); padding: 0; }
.ed-sw button:focus-visible { outline: 2px solid var(--t-violet); outline-offset: 2px; }
.ed [data-sg] { display: flex; }
.ed [data-sg] button { flex: 1; justify-content: center; }
.ed-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; margin-bottom: 14px; font-size: 13px; line-height: 1.45;
  background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); color: var(--ink-2); }
.ed-note .i { color: var(--warn); flex: none; margin-top: 1px; }
.ed-load { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.ed-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--t-violet); animation: edspin .8s linear infinite; }
@keyframes edspin { to { transform: rotate(360deg); } }
.ed-shot { margin: 14px 0 0; }
.ed-shot figcaption { font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.ed-shot img { width: 100%; display: block; border-radius: 10px; border: 1px solid var(--line); }
.ed-res { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--t-violet) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--t-violet) 25%, transparent); font-size: 13.5px; line-height: 1.45; }
.ed-res b { display: block; font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--t-violet); margin-bottom: 4px; }
.ed-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ed-hist li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--sunken); font-size: 13px; }
.ed-hist li.small, .ed-hist li.muted { display: block; background: transparent; border-style: dashed; }
.ed-hist .num { color: var(--muted); font: 12px var(--mono); }
.ed-hist small { grid-column: 2; }
.ed-hist b { font-weight: 500; overflow-wrap: anywhere; }
.ed-foot { display: flex; gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.ed-foot .btn { flex: 1; }
@media (max-width: 760px) {
  /* телефон: док сверху, панель — нижняя шторка поверх страницы */
  .ed-top { flex-wrap: wrap; gap: 6px; padding: 6px 8px; min-height: 0; }
  .ed-site { flex: 1 1 0; }
  .ed-site b { max-width: 110px; font-size: 14px; }
  .ed-page { max-width: 130px; }
  .ed-dock { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .ed-dock .btn { flex: none; }
  .ed-ai { margin-left: auto; }
  .ed-stage { padding: 0; }
  .ed-stage iframe { border: 0; border-radius: 0; box-shadow: none; }
  .ed-main { position: relative; }
  .ed-panel { position: absolute; left: 0; right: 0; bottom: 0; width: auto; height: min(58%, 520px); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0;
    box-shadow: 0 -18px 40px -18px rgba(15, 23, 42, .35); transform: translateY(calc(100% - 64px)); transition: transform .35s var(--ease); }
  .ed.has-sel .ed-panel { transform: none; }
  .ed-panel::before { content: ''; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 8px auto 0; flex: none; }
  .ed-empty { margin: 0; padding: 10px 16px; display: flex; gap: 10px; text-align: left; max-width: none; }
  .ed-empty .tile, .ed-empty .small { display: none; }
  .ed-crumb { padding-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .ed-panel { transition: none; } .ed-spin { animation-duration: 2s; } }

/* ===== Дежурный и алерты ===== */
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; display: inline-grid; place-items: center; font: 600 12px var(--sans); background: var(--warn); color: #1f1300; }
.nav-badge.crit { background: var(--bad); color: #fff; }
.bad-t { color: var(--bad); }
.faint { color: var(--faint); }
.lvl { display: inline-flex; align-items: center; font: 600 12px var(--sans); letter-spacing: .02em; padding: 4px 10px; border-radius: 8px; flex: none; }
.lvl.critical { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.lvl.warning { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.lvl.info { background: var(--sunken); color: var(--muted); }
.duty-hero { display: flex; gap: 18px; align-items: center; }
.dh-state { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; flex: none; }
.dh-state .i { width: 30px; height: 30px; }
.dh-state.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.dh-state.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.dh-state.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.dh-main { min-width: 0; }
.dh-main h2 { margin: 0 0 8px; }
.dh-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--muted); }
.dh-meta span { display: inline-flex; align-items: center; gap: 6px; }
.dh-meta .i { width: 15px; height: 15px; }
.inc { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.inc.critical { border-left-color: var(--bad); }
.inc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inc h3 { margin: 10px 0 4px; font-size: 17px; }
.inc-text { margin: 0; white-space: pre-line; color: var(--ink-2); font-size: 14px; }
.inc-ai { display: flex; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--sunken); font-size: 14px; line-height: 1.5; }
.inc-ai > .i { width: 18px; height: 18px; flex: none; color: var(--t-violet); margin-top: 2px; }
.inc-ai .muted { margin-top: 4px; }
.inc-fix { display: flex; gap: 8px; margin-top: 10px; font-size: 13.5px; }
.inc-fix .i { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.inc-fix.ok .i { color: var(--ok); } .inc-fix.bad .i { color: var(--bad); }
.inc-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dlog { display: flex; flex-direction: column; }
.dlog-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); }
.dlog-row:first-child { border-top: 0; }
.dlog-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dmodes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dmode { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--sunken); cursor: pointer; transition: border-color .2s, background .2s; }
.dmode input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dmode:has(input:checked) { border-color: var(--primary); background: var(--surface); box-shadow: inset 0 0 0 1px var(--primary); }
.dmode:has(input:focus-visible) { outline: 2px solid var(--chart-1); outline-offset: 2px; }
.drow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.drow select { width: auto; min-width: 0; }
.dnum { display: inline-flex; align-items: center; gap: 6px; }
.dnum input { width: 86px; }
.dnum span { color: var(--muted); font-size: 13px; }
.dsrc { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
.botid { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px; border-radius: var(--r); background: var(--sunken); }
.botid-ava { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: color-mix(in srgb, var(--t-blue) 16%, transparent); color: var(--t-blue); flex: none; }
.rcps { display: flex; flex-direction: column; gap: 8px; }
.rcp { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); }
.rcp.on { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok) 5%, transparent); }
.rcp-ava { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; background: var(--sunken); color: var(--ink-2); flex: none; }
.rcp.on .rcp-ava { background: var(--ok); color: #fff; }
.rcp-main { flex: 1; min-width: 0; }
.rcp-set { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 8px; }
.rcp-set select { width: auto; }
.rcp-btns { display: flex; gap: 6px; flex: none; }
canvas.spark.hist { height: 210px; }
.spikes { display: flex; flex-direction: column; gap: 8px; }
.spike { display: grid; grid-template-columns: 170px auto 1fr; gap: 14px; align-items: center; padding: 10px 14px; border-radius: var(--r); background: var(--sunken); }
.spike.now { box-shadow: inset 3px 0 0 var(--bad); }
.spike-time { display: flex; flex-direction: column; }
.spike-vals { display: flex; gap: 14px; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.spike-vals b { color: var(--ink); }
.spike-procs { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 760px) {
  .duty-hero { align-items: flex-start; }
  .dh-state { width: 48px; height: 48px; border-radius: 15px; }
  .dmodes { grid-template-columns: 1fr; }
  .spike { grid-template-columns: 1fr; gap: 6px; }
  .rcp { flex-wrap: wrap; }
  .rcp-btns { margin-left: 50px; }
}
