/* Equalizer by Strizh — styles */
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url(fonts/onest-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url(fonts/onest-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url(fonts/onest-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap; src: url(fonts/onest-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url(fonts/onest-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url(fonts/onest-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url(fonts/onest-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap; src: url(fonts/onest-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --page: #edf0f2;
  --surface: #fbfcfc;
  --surface-2: #f3f5f7;
  --ink: #14202b;
  --ink-2: #475563;
  --muted: #6c7884;
  --rule: #d6dce1;
  --rule-strong: #b3bdc6;
  --track: #e0e5e9;
  --bar: #14202b;
  --bar-ink: #eef2f5;
  --bar-muted: #93a1ad;
  --focus: #2a78d6;
  --link: #1f5ea8;
  --good: #0ca30c;
  --good-text: #006300;
  --warn: #fab219;
  --warn-text: #8a5a00;
  --crit: #d03b3b;
  --crit-text: #b02a2a;
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100;
  --c5: #e87ba4; --c6: #008300; --c7: #6250d6; --c8: #e34948;
  --infra: #8f9ca8;
  --other: #c4ccd3;
  --hatch: #aab5bf;
  --line: var(--c1);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0f1418;
    --surface: #161d23;
    --surface-2: #1c252c;
    --ink: #e6ecf0;
    --ink-2: #aab6c0;
    --muted: #84909b;
    --rule: #29333b;
    --rule-strong: #3d4952;
    --track: #252f37;
    --bar: #0a0e11;
    --link: #78aef0;
    --focus: #5d9ff0;
    --good-text: #3fbf3f;
    --warn-text: #f0b93a;
    --crit-text: #ee7272;
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
    --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767;
    --infra: #6f7c87;
    --other: #4a5761;
    --hatch: #4e5a64;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 15px/1.5 "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 6px; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 8px; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.path { font-size: 13px; word-break: break-all; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--bar); color: var(--bar-ink);
  display: flex; align-items: center; gap: 28px; padding: 0 24px; min-height: 52px;
}
.brand { color: var(--bar-ink); font-weight: 600; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a {
  color: var(--bar-muted); text-decoration: none; padding: 15px 10px; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--bar-ink); }
.nav a[aria-current] { color: var(--bar-ink); border-bottom-color: var(--bar-ink); }
.badge {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; font-size: 12px; line-height: 18px;
  background: var(--warn); color: #14202b; text-align: center; font-weight: 600;
}
.logout button { color: var(--bar-muted); }
.logout button:hover { color: var(--bar-ink); }

.page { max-width: 1240px; margin: 0 auto; padding: 28px 24px 64px; }
.flash {
  max-width: 1192px; margin: 16px auto 0; padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--rule); border-left: 4px solid var(--c1); border-radius: 6px;
}

/* ---------- headings & blocks ---------- */
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.head .desc { color: var(--ink-2); max-width: 70ch; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.lead { font-size: 24px; line-height: 1.35; letter-spacing: -0.01em; max-width: 34ch; margin: 4px 0 20px; }
.lead strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.small-lead { font-size: 18px; max-width: 60ch; color: var(--ink-2); }
.block { margin-top: 36px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.block-head h2 { margin: 0; }
.empty { color: var(--ink-2); padding: 18px; border: 1px dashed var(--rule-strong); border-radius: 8px; }

/* ---------- status ---------- */
[hidden] { display: none !important; }
.st { display: inline; }
.st i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--muted); }
.st-ok i { background: var(--good); }
.st-warn i { background: var(--warn); }
.st-crit i { background: var(--crit); }
.st-none i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.st-crit { color: var(--crit-text); }
.lv-text-warn { color: var(--warn-text); }
.lv-text-crit { color: var(--crit-text); }

/* ---------- attention ---------- */
.att-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); overflow: hidden; }
.att + .att { border-top: 1px solid var(--rule); }
.att a { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 10px 14px; color: var(--ink); text-decoration: none; }
.att a:hover { background: var(--surface-2); }
.att i { width: 9px; height: 9px; border-radius: 50%; flex: none; transform: translateY(-1px); background: var(--muted); }
.att.lv-crit i { background: var(--crit); }
.att.lv-warn i { background: var(--warn); }
.att.lv-none i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.att-text { font-weight: 500; }
.all-good { display: flex; gap: 10px; align-items: center; color: var(--ink-2); }
.all-good i { width: 9px; height: 9px; border-radius: 50%; background: var(--good); }

/* ---------- memory map (the signature element) ---------- */
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--other); flex: none; }
.c1 { --seg: var(--c1); --seg-ink: #fff; } .c2 { --seg: var(--c2); --seg-ink: #14202b; }
.c3 { --seg: var(--c3); --seg-ink: #14202b; } .c4 { --seg: var(--c4); --seg-ink: #14202b; }
.c5 { --seg: var(--c5); --seg-ink: #14202b; } .c6 { --seg: var(--c6); --seg-ink: #fff; }
.c7 { --seg: var(--c7); --seg-ink: #fff; } .c8 { --seg: var(--c8); --seg-ink: #fff; }
.c9 { --seg: var(--c1); --seg-ink: #fff; }
.infra { --seg: var(--infra); --seg-ink: #fff; }
.other { --seg: var(--other); --seg-ink: var(--ink); }
.unassigned { --seg: var(--hatch); --seg-ink: var(--ink); }
.free { --seg: var(--track); }
.sw.c1, .sw.c2, .sw.c3, .sw.c4, .sw.c5, .sw.c6, .sw.c7, .sw.c8, .sw.infra, .sw.other, .sw.free { background: var(--seg); }
.c9.sw, .seg.c9 { background: repeating-linear-gradient(135deg, var(--c1) 0 4px, color-mix(in srgb, var(--c1) 45%, var(--surface)) 4px 7px); }
.unassigned.sw, .seg.unassigned { background: repeating-linear-gradient(45deg, var(--hatch) 0 3px, var(--track) 3px 6px); }

.memmap { width: 100%; }
.mm-bar { display: flex; gap: 2px; height: 30px; border-radius: 6px; overflow: hidden; background: var(--surface); }
.memmap.compact .mm-bar { height: 22px; }
.seg { background: var(--seg); min-width: 3px; flex: 0 1 auto; display: flex; align-items: center; overflow: hidden; position: relative; }
.seg em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--seg-ink); padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg.free { flex-grow: 1; }
.seg:hover { filter: brightness(1.08); }
.mm-legend { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; }
.mm-legend li { display: flex; align-items: center; }
.mm-legend .num { color: var(--muted); margin-left: 6px; }
.memmap.empty .mm-bar { margin-bottom: 6px; }

/* rack on overview */
.rack { border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); overflow: hidden; }
.rack-row { display: grid; grid-template-columns: 220px 1fr 150px; gap: 20px; align-items: center; padding: 14px 18px; color: var(--ink); text-decoration: none; }
.rack-row + .rack-row { border-top: 1px solid var(--rule); }
.rack-row:hover { background: var(--surface-2); }
.rack-row:hover strong { text-decoration: underline; text-underline-offset: 2px; }
.rack-name { display: flex; flex-direction: column; min-width: 0; }
.rack-sub { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; color: var(--ink-2); }
.rack-cost { text-align: right; }

/* ---------- meters ---------- */
.meters { display: flex; flex-direction: column; gap: 14px; }
.meter-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 5px; }
.meter-head .num { color: var(--ink-2); }
.meter-track { height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; }
.meter-track span { display: block; height: 100%; background: var(--ink-2); border-radius: 3px; }
.meter.lv-warn .meter-track span { background: var(--warn); }
.meter.lv-crit .meter-track span { background: var(--crit); }
.meter.lv-warn .meter-head .num::before { content: "▲ "; color: var(--warn-text); }
.meter.lv-crit .meter-head .num::before { content: "▲ "; color: var(--crit-text); }
.meter.lv-crit .meter-head .num { color: var(--crit-text); }

/* ---------- servers ---------- */
.srv { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }
.srv-head { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-bottom: 14px; }
.srv-head h2 { margin: 0; }
.srv-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(200px, 1fr) minmax(170px, 0.8fr); gap: 28px; align-items: start; }
.srv-grid.wide { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 20px; }
.srv-cost .plain-list li { display: flex; align-items: center; }
.srv-cost .plain-list .num { margin-left: auto; padding-left: 10px; }

/* ---------- charts ---------- */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 14px 8px; }
.chart figcaption { font-weight: 500; margin-bottom: 6px; }
.chart figcaption .now { font-weight: 400; margin-left: 8px; font-size: 13px; }
.chart-box { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--rule); stroke-width: 1; }
.chart-svg .cap { stroke: var(--rule-strong); stroke-width: 1; stroke-dasharray: 4 3; }
.chart-svg .base { stroke: var(--rule-strong); stroke-width: 1; }
.chart-svg .tick { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart-svg .line { fill: none; stroke: var(--line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .area { fill: var(--line); opacity: 0.1; }
.chart-svg .last { fill: var(--line); stroke: var(--surface); stroke-width: 2; }
.chart-svg .cross { stroke: var(--muted); stroke-width: 1; }
.chart-svg .dot { fill: var(--line); stroke: var(--surface); stroke-width: 2; }
.chart-empty p { padding: 30px 0; }
.tip, .ftip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 12px; line-height: 1.4;
  padding: 6px 9px; border-radius: 6px; white-space: nowrap; z-index: 20; transform: translate(-50%, calc(-100% - 10px));
}
.ftip { position: fixed; white-space: normal; max-width: 320px; }
.seg-control { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 6px; overflow: hidden; }
.seg-control a { padding: 4px 10px; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.seg-control a + a { border-left: 1px solid var(--rule-strong); }
.seg-control a[aria-current] { background: var(--ink); color: var(--surface); }

/* ---------- uptime strip ---------- */
.upstrip { display: flex; gap: 2px; height: 20px; margin: 10px 0 4px; max-width: 360px; }
.uc { flex: 1; border-radius: 2px; background: var(--track); }
.uc.up { background: var(--good); }
.uc.warn { background: var(--warn); }
.uc.down { background: var(--crit); }

/* ---------- project page ---------- */
.envs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.env { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; min-width: 0; }
.env h2 { font-size: 16px; margin-bottom: 8px; }
.env .url { word-break: break-all; }
.env .big { font-size: 24px; font-weight: 600; margin-bottom: 10px; }
.ver { font-weight: 500; }
.pname { font-weight: 600; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; }
.pname:hover { text-decoration: underline; }
.pdesc { display: block; font-weight: 400; }
.pchip { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; white-space: nowrap; }
.pchip:hover { text-decoration: underline; }
.tag { display: inline-block; font-size: 12px; padding: 0 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--rule); color: var(--ink-2); text-decoration: none; }

/* ---------- tables ---------- */
.table, .ptable { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.table th, .table td, .ptable th, .ptable td { padding: 10px 12px; text-align: left; vertical-align: top; border-top: 1px solid var(--rule); }
.table thead th, .ptable thead th { border-top: 0; font-size: 13px; font-weight: 500; color: var(--muted); background: var(--surface-2); }
.table .r, .ptable .r { text-align: right; }
.ptable tbody th { font-weight: 400; }
.ptable .lastc { max-width: 280px; font-size: 13px; }
.ptable .lastc a { color: var(--ink-2); }
tr.needs td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.is-hidden { opacity: 0.55; }
.mini { border-collapse: collapse; width: 100%; font-size: 14px; }
.mini td { padding: 5px 0; border-top: 1px solid var(--rule); }
.mini td + td { padding-left: 12px; }
.mini tr:first-child td { border-top: 0; }
.barcell { width: 35%; }
.hbar { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--ink-2); min-width: 2px; }
.hbar.c1, .hbar.c2, .hbar.c3, .hbar.c4, .hbar.c5, .hbar.c6, .hbar.c7, .hbar.c8 { background: var(--seg); }
.hbar.c9 { background: repeating-linear-gradient(135deg, var(--c1) 0 4px, color-mix(in srgb, var(--c1) 45%, var(--surface)) 4px 7px); }
.bar-col { width: 22%; vertical-align: middle !important; }
.costs td { vertical-align: middle; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 4px 0; }

/* ---------- facts ---------- */
.facts dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0; margin: 0 0 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.facts dl > div { padding: 12px 16px; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); margin: 0 -1px -1px 0; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 2px 0 0; }

/* ---------- forms ---------- */
.form { max-width: 820px; }
fieldset { border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px 8px; margin: 0 0 16px; background: var(--surface); min-width: 0; }
legend { font-weight: 600; padding: 0 6px; margin-left: -6px; }
.form label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--ink-2); }
.form label input:not([type=checkbox]):not([type=radio]):not([type=file]), .form label select, .form label textarea, .filters input, .filters select, .quick select, .inline-filter select, .comment-form textarea, .comment-tools textarea {
  display: block; width: 100%; margin-top: 4px; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: 6px; padding: 8px 10px;
}
textarea { resize: vertical; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.cols.three { grid-template-columns: 1fr 1fr 1fr; }
.hint { font-size: 13px; color: var(--muted); max-width: 70ch; }
.form .check, .checks .check, .radios label { display: flex; gap: 8px; align-items: center; color: var(--ink); margin-bottom: 8px; flex-wrap: wrap; }
.checks { margin-bottom: 12px; }
.checks .label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.alert-rows .check { line-height: 2; }
input.n { width: 64px !important; display: inline-block !important; margin: 0 4px !important; padding: 2px 6px !important; }
.shares { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 4px 0 12px; }
.shares .share { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ink); }
.shares .share input { width: 64px !important; display: inline-block !important; margin: 0 !important; padding: 4px 6px !important; }
.shares[hidden] { display: none; }
.form-actions { display: flex; gap: 16px; align-items: center; margin: 4px 0 24px; }
.form-error { color: var(--crit-text); }
.danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--rule); max-width: 820px; }
.btn {
  display: inline-block; font: inherit; font-weight: 500; color: var(--surface); background: var(--ink); border: 1px solid var(--ink);
  border-radius: 6px; padding: 8px 16px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { opacity: 0.9; }
.btn.ghost { color: var(--ink); background: var(--surface); border-color: var(--rule-strong); }
.btn.ghost:hover { border-color: var(--ink-2); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link.small { font-size: 13px; }
.link.danger, .danger { color: var(--crit-text); }
.inline-form { margin: -8px 0 24px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.filters label { font-size: 13px; color: var(--ink-2); }
.filters .grow { flex: 1; min-width: 200px; }
.quick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.quick select { width: auto; margin: 0; padding: 4px 8px; font-size: 13px; }
.inline-filter select { width: auto; margin: 0; padding: 4px 8px; font-size: 13px; }
.file input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file span { color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: 14px; }
.file input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
pre.cmd { background: var(--surface-2); border: 1px solid var(--rule); border-radius: 6px; padding: 10px 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
details.agent summary { cursor: pointer; list-style: none; }
details.agent summary h2 { display: inline; }
details.agent summary::after { content: " показать"; color: var(--link); font-size: 14px; }
details.agent[open] summary::after { content: " скрыть"; }

/* ---------- comments ---------- */
.comments { margin-top: 40px; max-width: 820px; }
.comment-form { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 12px; margin-bottom: 18px; }
.comment-form textarea { margin: 0 0 10px; }
.comment-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.comment-actions .btn { margin-left: auto; }
.feed { list-style: none; margin: 0; padding: 0; }
.comment { padding: 14px 0; border-top: 1px solid var(--rule); }
.comment-meta { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.comment-tools { margin-left: auto; }
.comment-tools summary { cursor: pointer; color: var(--muted); list-style: none; }
.comment-tools[open] { flex-basis: 100%; margin-left: 0; }
.comment-tools form { margin-top: 8px; }
.row-actions { margin-top: 6px; }
.comment-body p { margin: 0 0 6px; }
.comment-body ul { margin: 0 0 6px; padding-left: 20px; }
.comment-body code { background: var(--surface-2); padding: 1px 4px; border-radius: 3px; }
.shot { max-width: min(100%, 520px); max-height: 360px; border: 1px solid var(--rule); border-radius: 6px; margin-top: 6px; display: block; }

/* ---------- login ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { width: 100%; max-width: 360px; }
.login h1 { margin-bottom: 20px; }
.login .form { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 20px; }
.login .btn { width: 100%; margin-top: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .srv-grid, .envs, .charts { grid-template-columns: 1fr; }
  .rack-row { grid-template-columns: 1fr; gap: 8px; }
  .rack-cost { text-align: left; }
}
@media (max-width: 720px) {
  .topbar { gap: 12px; padding: 0 16px; flex-wrap: wrap; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -16px; padding: 0 8px; }
  .nav a { padding: 10px 8px; }
  .logout { margin-left: auto; }
  .page { padding: 20px 16px 48px; }
  .lead { font-size: 20px; }
  .cols, .cols.three { grid-template-columns: 1fr; }
  .table, .ptable { border: 0; background: none; }
  .table thead, .ptable thead { display: none; }
  .table tr, .ptable tr { display: block; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; margin-bottom: 10px; padding: 6px 0; }
  .table td, .ptable td { display: grid; grid-template-columns: minmax(96px, auto) 1fr; column-gap: 12px; border: 0; padding: 5px 14px; text-align: right; }
  .table td > *, .ptable td > * { grid-column: 2; justify-self: end; text-align: right; }
  .table td::before, .ptable td::before { content: attr(data-label); grid-column: 1; grid-row: 1 / span 4; color: var(--muted); font-size: 13px; text-align: left; }
  .ptable tbody th { display: block; text-align: left; padding-top: 8px; }
  .table td:first-child { display: block; text-align: left; font-weight: 500; }
  .chart-svg .tick { font-size: 19px; }
  .table td:first-child::before { content: none; }
  .table td:first-child > * { text-align: left; }
  .bar-col { display: none !important; }
  .ptable .lastc { max-width: none; }
  tr.needs td:first-child { box-shadow: none; }
  tr.needs { border-left: 3px solid var(--warn) !important; }
  .quick { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (forced-colors: active) { .seg, .sw, .uc, .meter-track span, .hbar { forced-color-adjust: none; } }

/* ---------- stage A additions ---------- */
.flash-error { border-left-color: var(--crit); color: var(--crit-text); }
.form-flash { max-width: 820px; margin: 0 0 16px; }
.att { display: flex; align-items: center; }
.att a { flex: 1; }
.att-action { padding-right: 12px; }
form.inline { display: inline; margin-left: 8px; }
.btn.danger { color: var(--crit-text); border-color: var(--crit-text); }
.pays tr.late td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.pays tr.soon td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.pays td { vertical-align: middle; }
@media (max-width: 720px) {
  .pays tr.late, .pays tr.soon { border-left: 3px solid var(--warn) !important; }
  .pays tr.late { border-left-color: var(--crit) !important; }
  .pays tr td:first-child { box-shadow: none !important; }
}

/* access block: logins and passwords */
.access-table code { user-select: all; word-break: break-all; }
.access-table .secret-value { display: inline-block; min-width: 6em; }

/* logo: Equalizer by Strizh (striped swift) */
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-tile { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; background: #E8502B; flex: none; }
.logo-text { display: inline-flex; align-items: baseline; gap: 7px; line-height: 1; }
.brand-word { font-weight: 800; letter-spacing: -0.03em; font-size: 18px; }
.brand-by { font-weight: 500; font-size: 13px; opacity: 0.7; }
.login-logo { display: flex; align-items: center; gap: 10px; margin: 0 0 24px; }
.login-logo .logo-mark { flex: none; display: block; }
.login-logo .brand-word { font-size: 34px; }
.login-logo .brand-by { font-size: 15px; color: var(--muted); opacity: 1; }
@media (max-width: 520px) { .brand .brand-by { display: none; } }
