:root {
  --bg: #ffffff;
  --bg-muted: #f4f5f7;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --link: #0f172a;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --warn: #a16207;
  --warn-bg: #fffbeb;
  --bad: #b91c1c;
  --bad-bg: #fef2f2;
  --info: #1d4ed8;
  --info-bg: #eff6ff;
  --accent: #0f172a;
  --focus: #7c3aed;
  --header-bg: #ffffff;
  --header-text: #0f172a;
  --header-muted: #64748b;
  --side-bg: #0a0a0a;
  --btn-fg: #ffffff;
  --input-bg: #ffffff;
  --card-bg: #ffffff;
  --radius: 8px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #050505;
  --bg-muted: #0c0c0c;
  --surface: #111111;
  --border: #222222;
  --border-strong: #333333;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --link: #f1f5f9;
  --ok: #4ade80;
  --ok-bg: #052e16;
  --warn: #fbbf24;
  --warn-bg: #422006;
  --bad: #f87171;
  --bad-bg: #450a0a;
  --info: #93c5fd;
  --info-bg: #0b1a3a;
  --accent: #f1f5f9;
  --focus: #c084fc;
  --header-bg: #050505;
  --header-text: #f1f5f9;
  --header-muted: #94a3b8;
  --side-bg: #050505;
  --btn-fg: #050505;
  --input-bg: #0c0c0c;
  --card-bg: #111111;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
}
a { color: inherit; }
a:hover { text-decoration: underline; }
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
img { max-width: 100%; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }

.wrap {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 56px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
}
.site-header-inner {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--header-text);
}
.brand:hover { text-decoration: none; }
.brand img {
  display: block;
  width: auto;
  height: 36px;
  background: transparent;
}
.brand .logo-light { display: block; }
.brand .logo-dark { display: none; }
html[data-theme="dark"] .brand .logo-light { display: none; }
html[data-theme="dark"] .brand .logo-dark { display: block; }
.brand-tag {
  color: var(--header-muted);
  font-weight: 500;
  font-size: 14px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  line-height: 1;
}
.brand-center {
  justify-content: center;
  margin-bottom: 8px;
}
.brand-center img { height: 44px; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.theme-toggle:hover { border-color: var(--border-strong); }
.nav-link {
  color: var(--header-muted);
  text-decoration: none;
  font-size: 14px;
}
.nav-link:hover { color: var(--header-text); text-decoration: none; }

.page-head {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.page-head .crumbs {
  display: inline-block;
  margin: 0 0 10px;
}
.page-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.page-head-row > div:first-child {
  min-width: 0;
  flex: 1;
}
.page-head h1 {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.page-head p {
  margin: 0;
  color: var(--text-muted);
  max-width: 60ch;
}
.status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
  font-weight: 600;
}
.status-banner.compact {
  margin-top: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}
.status-banner.up { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); color: var(--ok); }
.status-banner.partial { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); color: var(--warn); }
.status-banner.down { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); color: var(--bad); }
.status-banner.maintenance { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 35%, var(--border)); color: var(--info); }

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
}
.notice strong { display: block; margin-bottom: 2px; }
.notice.info { background: var(--info-bg); }
.notice.warning, .notice.warn { background: var(--warn-bg); }
.notice.critical, .notice.bad { background: var(--bad-bg); }
.notice.ok { background: var(--ok-bg); }

.group { margin: 0 0 28px; }
.group-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.monitor-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.monitor {
  display: grid;
  grid-template-columns: 220px 1fr 88px;
  gap: 24px;
  align-items: center;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
}
.monitor .bars {
  width: 100%;
  min-width: 0;
}
.monitor:first-child { border-top: 0; }
.monitor .name {
  font-weight: 600;
  text-decoration: none;
}
.monitor .name:hover { text-decoration: underline; }
.monitor .meta {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Public / admin machine overview rows */
.view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
}
.view-toggle .chip {
  margin: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  min-height: 30px;
  padding: 0 12px;
}
.view-toggle .chip.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.page-head-row .view-toggle { align-self: flex-start; margin-top: 4px; }

html[data-home-view="machines"] [data-home-panel="list"],
html:not([data-home-view="machines"]) [data-home-panel="machines"] {
  display: none !important;
}

.machine-row {
  --machine-meter-h: 18px;
  display: grid;
  grid-template-columns: minmax(132px, 168px) minmax(0, 1fr) 80px;
  grid-template-rows: auto var(--machine-meter-h);
  column-gap: 18px;
  row-gap: 6px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.machine-list .machine-row:first-child { border-top: 0; }
.machine-id {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.machine-id .name {
  font-weight: 650;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.machine-id .name:hover { text-decoration: underline; }
.machine-row .res-stack {
  grid-column: 1;
  grid-row: 2;
  height: var(--machine-meter-h);
  max-width: 132px;
}
.machine-row .bars.bars-tall {
  grid-column: 2;
  grid-row: 2;
  height: var(--machine-meter-h);
  align-self: stretch;
}
.machine-row .pct {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
}
.machine-row .pct b { font-size: 15px; }
.machine-row .pct span { font-size: 11px; }

/* Four thin meters — same total height as the uptime strip. */
.res-stack {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}
.res-bar {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  border-radius: 4px;
  background: var(--border);
  overflow: visible;
  position: relative;
  cursor: default;
}
.res-bar > i {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: 4px;
}
.res-bar.res-bar-net {
  display: flex;
  flex-direction: row;
  gap: 0;
  padding: 0;
  overflow: visible;
}
.res-bar-net > i {
  flex-grow: 0;
  flex-shrink: 0;
  width: auto;
  max-width: none;
  height: 100%;
  min-width: 0;
}
.res-bar-net > .res-net-in {
  border-radius: 4px 0 0 4px;
}
.res-bar-net > .res-net-out {
  border-radius: 0 4px 4px 0;
}
.res-bar[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 20;
  padding: 4px 8px;
  border-radius: 6px;
  background: #111827;
  color: #f9fafb;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(2px);
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}
.res-bar[data-tip]:hover::after,
.res-bar[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
html[data-theme="dark"] .res-bar[data-tip]::after {
  background: #f3f4f6;
  color: #111827;
}
.res-cpu { background: #4f46e5; }
.res-ram { background: #059669; }
.res-disk { background: #d97706; }
.res-net-in { background: #0284c7; }
.res-net-out { background: #e11d48; }
.res-cpu.ok, .res-ram.ok, .res-disk.ok { opacity: 1; }
.res-cpu.warn, .res-ram.warn, .res-disk.warn { filter: saturate(1.1); }
.res-cpu.bad, .res-ram.bad, .res-disk.bad { filter: brightness(1.05); }

html[data-theme="dark"] .res-bar {
  background: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .res-cpu { background: #a5b4fc; }
html[data-theme="dark"] .res-ram { background: #6ee7b7; }
html[data-theme="dark"] .res-disk { background: #fcd34d; }
html[data-theme="dark"] .res-net-in { background: #7dd3fc; }
html[data-theme="dark"] .res-net-out { background: #fda4af; }
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #98a2b3;
  margin-right: 6px;
  vertical-align: 1px;
}
.status-dot.up { background: var(--ok); }
.status-dot.down { background: var(--bad); }
.status-dot.degraded, .status-dot.warn { background: var(--warn); }
.status-dot.maintenance { background: var(--info); }
.status-dot.paused, .status-dot.unknown { background: #98a2b3; }

.bars {
  display: flex;
  gap: 0;
  align-items: stretch;
  height: 24px;
  /* Gutters are borders on each bar (not flex gap) so zoom/subpixel
     rounding cannot create the wavy closer/farther spacing pattern. */
}
.bars.bars-tall {
  height: var(--machine-meter-h, 18px);
}
.bars i {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 1px;
  border-right: 1px solid var(--surface);
  background: var(--border);
}
.bars i:last-child {
  border-right-width: 0;
}
.bars i.bar-good { background: #22a06b; }
.bars i.bar-warn { background: #e2a203; }
.bars i.bar-bad { background: #e34935; }
.bars i.bar-empty { background: var(--border); }
.pct {
  text-align: right;
  min-width: 72px;
  font-variant-numeric: tabular-nums;
}
.pct b { display: block; font-size: 15px; }
.pct span { color: var(--text-muted); font-size: 12px; }

.section-title {
  margin: 32px 0 10px;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.incident {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.incident:last-child { border-bottom: 0; }
.incident time {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}
.empty {
  color: var(--text-muted);
  padding: 8px 0 24px;
}

.detail-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  box-sizing: border-box;
}
.chip:hover { text-decoration: none; color: var(--text); border-color: var(--border-strong); }
.chip.on {
  background: var(--text);
  border-color: var(--text);
  color: var(--btn-fg);
}

.specs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 20px;
}
.spec {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
}
.spec span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.spec strong { font-weight: 600; }

.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 20px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  margin: 0 0 12px;
}
.panel h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.chart-stats {
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chart-focus {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.panel-wide {
  display: block;
  width: 100%;
  margin-bottom: 12px;
}
.chart-box { height: 200px; width: 100%; position: relative; user-select: none; }
.chart-box-lg { height: 340px; width: 100%; position: relative; user-select: none; }
.chart-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.chart-box canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: crosshair;
}

.uptime-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.uptime-head h3 { margin: 0; }
.uptime-head .help { margin: 0; }
.bars-wide {
  width: 100%;
  height: 28px;
}

.diag pre {
  margin: 8px 0 0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-family: var(--mono);
  font-size: 12px;
}
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 18px;
}
.feature-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}
.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.table tr:last-child td { border-bottom: 0; }

.site-footer {
  width: min(1280px, calc(100% - 40px));
  margin: 24px auto 0;
  padding: 18px 0 36px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-footer .footer-logo {
  height: 28px;
  width: auto;
  background: transparent;
}
.site-footer .logo-light { display: block; }
.site-footer .logo-dark { display: none; }
html[data-theme="dark"] .site-footer .logo-light { display: none; }
html[data-theme="dark"] .site-footer .logo-dark { display: block; }

/* Auth */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg-muted);
}
.auth-box {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.auth-box h1 {
  margin: 14px 0 6px;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.auth-box .lede {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 14px;
}
.auth-theme {
  position: fixed;
  top: 16px;
  right: 16px;
}

label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
}
.field { margin: 0 0 14px; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="url"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  padding: 9px 11px;
  outline: none;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  font-weight: 500;
}
.check input { width: auto; margin-top: 3px; }
.help {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--text);
  border-radius: var(--radius);
  background: var(--text);
  color: var(--btn-fg);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn.danger {
  background: var(--surface);
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 40%, var(--border));
}
.btn.small {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 13px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Admin shell */
.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  background: var(--bg-muted);
}
.side {
  background: var(--side-bg);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  color: #fff;
}
.side .brand {
  display: flex;
  padding: 4px 8px 18px;
  color: #fff;
}
.side .brand img { height: 34px; }
.side .brand .logo-light { display: none; }
.side .brand .logo-dark { display: block; }
.side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.72);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 14px;
}
.side a:hover,
.side a.on {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}
.side .side-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side .theme-toggle {
  width: 100%;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
}
.main {
  padding: 28px 32px 48px;
  width: min(1280px, 100%);
}
.main h1 {
  margin: 0 0 4px;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.lede {
  margin: 0 0 18px;
  color: var(--text-muted);
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.stat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  padding: 14px;
}
.stat b {
  display: block;
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat span {
  color: var(--text-muted);
  font-size: 13px;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  padding: 16px;
  margin-bottom: 12px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
pre.install {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-family: var(--mono);
  font-size: 12px;
}
.crumbs {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
}
.crumbs:hover { color: var(--text); }

.live-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.live-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}
.live-tile span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.live-tile strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}
.live-tile.ok strong { color: var(--ok); }
.live-tile.warn strong { color: var(--warn); }
.live-tile.bad strong { color: var(--bad); }
.live-pill.ok { color: var(--ok); }
.live-pill.warn { color: var(--warn); }
.live-pill.bad { color: var(--bad); }
.install-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}
.install-row .install { margin: 0; }
.agent-panel { margin-bottom: 18px; }
.server-info { margin-bottom: 18px; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 16px;
  margin: 0;
}
.info-grid > div { min-width: 0; }
.info-grid dt {
  margin: 0 0 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.info-grid dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}
.charts-stack > div { margin: 0; }
.chart-tabs { margin-bottom: 12px; }

@media (max-width: 860px) {
  .live-grid { grid-template-columns: 1fr 1fr; }
  .install-row { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .side nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .main { padding: 20px 16px 40px; }
  .monitor {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px 12px;
    align-items: start;
    padding: 12px 14px;
  }
  .monitor > :first-child {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .monitor .pct {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }
  .monitor .bars {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 18px;
  }
  .charts, .specs, .stats, .grid-2, .grid-3, .feature-grid, .live-grid { grid-template-columns: 1fr; }
  .toolbar, .page-head-row, .uptime-head, .panel-head { flex-direction: column; align-items: flex-start; }
  .status-banner.compact { width: 100%; justify-content: center; }
  .brand img { height: 30px; }
  .chart-stats { white-space: normal; }
  .machine-row {
    --machine-meter-h: 40px;
    grid-template-columns: 1fr;
    grid-template-rows: auto var(--machine-meter-h);
    gap: 8px;
  }
  .machine-row .machine-id {
    grid-column: 1;
    grid-row: 1;
  }
  .machine-row .pct,
  .machine-row .bars.bars-tall {
    display: none;
  }
  .machine-row .res-stack {
    grid-column: 1;
    grid-row: 2;
    max-width: none;
    height: var(--machine-meter-h);
    gap: 3px;
  }
  .page-head-row .view-toggle { margin-left: 0; }
}
