/* VPS Dashboard. Palette roles follow the dataviz reference instance (status colours are reserved). */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f2f1ed;
  --surface-3: #e9e8e3;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6d68;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --border-2: rgba(11, 11, 11, 0.18);
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-wash: #e6f0fc;
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;
  --good-text: #006300;
  --crit-text: #b3302f;
  --warn-text: #7a5200;
  --info: #2a78d6;
  --off: #898781;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .06);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, .18);
  --radius: 10px;
  --mono: ui-monospace, "Cascadia Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232322; --surface-3: #2c2c2a;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a988f; --grid: #2c2c2a; --axis: #383835;
    --border: rgba(255, 255, 255, .10); --border-2: rgba(255, 255, 255, .18);
    --accent: #3987e5; --accent-ink: #86b6ef; --accent-wash: #16263b;
    --good-text: #0ca30c; --crit-text: #e66767; --warn-text: #fab219; --info: #3987e5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .3); --shadow-lg: 0 8px 40px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232322; --surface-3: #2c2c2a;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a988f; --grid: #2c2c2a; --axis: #383835;
  --border: rgba(255, 255, 255, .10); --border-2: rgba(255, 255, 255, .18);
  --accent: #3987e5; --accent-ink: #86b6ef; --accent-wash: #16263b;
  --good-text: #0ca30c; --crit-text: #e66767; --warn-text: #fab219; --info: #3987e5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .3); --shadow-lg: 0 8px 40px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.45 var(--sans); }
[hidden] { display: none !important; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
h2, h3 { margin: 0; font-weight: 600; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- buttons & fields */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 7px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--crit-text); }
.btn.danger.solid { background: var(--crit); border-color: var(--crit); color: #fff; font-weight: 600; }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; height: 38px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.link { background: none; border: 0; color: var(--accent-ink); cursor: pointer; font: inherit; font-size: 13px; padding: 0; }
.link:hover { text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 7px; height: 32px; padding: 0 10px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.search { min-width: 220px; }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); color: var(--ink-2); padding: 0 12px; height: 30px; font: inherit; font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border-2); }
.seg button[aria-pressed="true"] { background: var(--accent-wash); color: var(--accent-ink); font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.check input { height: auto; }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 18px; }
.login-sub { margin: -6px 0 4px; color: var(--ink-2); font-size: 13px; }
.login-error { color: var(--crit-text); font-size: 13px; min-height: 18px; }
.callout { border-radius: 8px; padding: 10px 12px; font-size: 13px; border: 1px solid var(--border); background: var(--surface-2); }
.callout code { display: block; margin-top: 6px; word-break: break-all; }
.callout.warn { border-left: 3px solid var(--warn); }
.callout.crit { border-left: 3px solid var(--crit); }
.callout.info { border-left: 3px solid var(--accent); }

.logo { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); position: relative; flex: none; }
.logo::before, .logo::after { content: ""; position: absolute; left: 6px; right: 6px; height: 4px; border-radius: 2px; background: var(--page); }
.logo::before { top: 7px; }
.logo::after { bottom: 7px; box-shadow: 9px 0 0 -1px var(--good); width: 4px; left: auto; right: 6px; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 20px;
  background: color-mix(in oklab, var(--page) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-title { font-weight: 650; font-size: 15px; white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tabs { display: flex; gap: 2px; margin-left: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs button, .dr-tabs button {
  border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 13.5px; padding: 7px 11px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.tabs button:hover, .dr-tabs button:hover { background: var(--surface-2); color: var(--ink); }
.tabs button[aria-selected="true"], .dr-tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--ink); font-weight: 600; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-right: 6px; white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--off); }
.live.ok i { background: var(--good); box-shadow: 0 0 0 3px color-mix(in oklab, var(--good) 22%, transparent); }
.live.bad i { background: var(--crit); }

main { padding: 18px 20px 60px; max-width: 1600px; margin: 0 auto; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }

/* ---------------------------------------------------------------- alerts */
.alerts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.alerts.bad { border-left: 4px solid var(--crit); }
.alerts.warn { border-left: 4px solid var(--warn); }
.alerts .lead { font-weight: 600; margin-right: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--border-2);
  background: var(--surface); font-size: 12.5px; cursor: pointer; color: var(--ink); }
.chip:hover { background: var(--surface-2); }

/* ---------------------------------------------------------------- tiles */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 10px; box-shadow: var(--shadow); min-width: 0; }
.tile-label { font-size: 12.5px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.tile-value { font-size: 24px; font-weight: 620; margin: 2px 0 2px; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 8px; }
.tile-value small { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.tile-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.sev-warn .tile-value, .tile.sev-crit .tile-value { gap: 6px; }
.meter { height: 8px; border-radius: 4px; overflow: hidden; margin: 6px 0 6px; background: color-mix(in oklab, var(--m, var(--accent)) 20%, var(--surface)); }
.meter > i { display: block; height: 100%; border-radius: 4px; background: var(--m, var(--accent)); min-width: 4px; }
.spark { display: block; width: 100%; height: 34px; margin-top: 4px; overflow: visible; cursor: crosshair; }
.spark .line { fill: none; stroke: var(--axis); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .area { fill: color-mix(in oklab, var(--axis) 25%, transparent); }
.spark .cur { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.spark .hair { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 2; }
.spark .hot { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.svcsum { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; font-size: 13px; }
.svcsum div { display: flex; align-items: center; gap: 8px; }
.svcsum b { min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- status icon */
.st { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
.si { width: 14px; height: 14px; flex: none; display: inline-block; }
.si.ok { color: var(--good); } .si.warn { color: var(--warn); } .si.bad { color: var(--crit); } .si.off { color: var(--off); } .si.info { color: var(--info); }
.st.bad .st-label { color: var(--crit-text); font-weight: 600; }
.st.warn .st-label { color: var(--warn-text); font-weight: 600; }
.spin { width: 14px; height: 14px; border: 2px solid var(--axis); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- groups */
.ov-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.groups { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.g-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; flex-wrap: wrap; }
.g-toggle { border: 0; background: none; color: var(--ink-2); cursor: pointer; padding: 2px; border-radius: 5px; display: inline-flex; }
.g-toggle:hover { background: var(--surface-2); }
.g-toggle svg { transition: transform .15s; }
.group.collapsed .g-toggle svg { transform: rotate(-90deg); }
.g-name { font-size: 15px; font-weight: 650; }
.g-desc { font-size: 12.5px; color: var(--muted); }
.g-count { font-size: 12.5px; color: var(--ink-2); display: inline-flex; gap: 10px; }
.g-count span { display: inline-flex; align-items: center; gap: 4px; }
.g-links { display: inline-flex; gap: 10px; font-size: 12.5px; }
.g-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.g-checks { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--surface-2); font-size: 12px; color: var(--ink-2); max-width: 100%; }
.pill .si { width: 12px; height: 12px; }
.pill b { font-weight: 600; color: var(--ink); }
.pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group.collapsed .g-body, .group.collapsed .g-checks { display: none; }

.rows { border-top: 1px solid var(--border); }
.row {
  display: grid; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border);
  grid-template-columns: 128px minmax(180px, 1fr) 64px 58px 68px 86px minmax(70px, 110px) auto;
}
.row:last-child { border-bottom: 0; }
.row.head { font-size: 11.5px; color: var(--muted); padding-top: 6px; padding-bottom: 6px; background: var(--surface-2); text-transform: none; }
.row:not(.head):hover { background: color-mix(in oklab, var(--surface-2) 60%, transparent); }
.row .c-name { min-width: 0; cursor: pointer; }
.row .c-name b { font-weight: 600; }
.row .c-name .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .c-name .note { font-size: 12px; color: var(--warn-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.h-bad .c-name .note { color: var(--crit-text); }
.row .c-num { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: right; white-space: nowrap; }
.row .c-ports { font-size: 12px; color: var(--ink-2); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .c-act { display: flex; gap: 5px; justify-content: flex-end; }
.row.h-bad { box-shadow: inset 3px 0 0 var(--crit); }
.row.h-warn { box-shadow: inset 3px 0 0 var(--warn); }
.badge { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; padding: 1px 6px; border-radius: 5px; background: var(--surface-3); color: var(--ink-2); vertical-align: 1px; margin-left: 6px; text-transform: uppercase; }
.badge.pub { background: color-mix(in oklab, var(--serious) 22%, var(--surface)); color: var(--ink); }

/* ---------------------------------------------------------------- side panel / timeline */
.side { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 14px 8px; }
.timeline { list-style: none; margin: 0; padding: 0 14px 12px; max-height: 70vh; overflow: auto; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 9px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 12.5px; }
.timeline li:first-child { border-top: 0; }
.timeline .si { margin-top: 2px; }
.timeline .tl-t { color: var(--muted); font-size: 11.5px; }
.timeline .tl-m { color: var(--ink-2); word-break: break-word; }
.timeline .tl-n { font-weight: 600; cursor: pointer; }
.empty { padding: 18px 14px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel .table-wrap { border: 0; box-shadow: none; border-radius: 0 0 var(--radius) var(--radius); }
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
table.grid th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 7px 10px; position: sticky; top: 0; white-space: nowrap; }
table.grid td { padding: 6px 10px; border-top: 1px solid var(--border); vertical-align: top; }
table.grid td.r, table.grid th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid td.cmd { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.grid tr:hover td { background: color-mix(in oklab, var(--surface-2) 60%, transparent); }
table.grid tr.warn td:first-child { box-shadow: inset 3px 0 0 var(--serious); }
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }

/* ---------------------------------------------------------------- events */
.events { display: flex; flex-direction: column; gap: 8px; }
.ev { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; display: grid; grid-template-columns: 14px 1fr; gap: 10px; }
.ev-h { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.ev-h b { color: var(--ink); }
.ev pre { margin: 4px 0 0; white-space: pre-wrap; word-break: break-word; font-family: var(--sans); font-size: 13px; }

/* ---------------------------------------------------------------- drawer */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .28); z-index: 40; }
.backdrop.top { z-index: 60; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(880px, 100vw); z-index: 50; background: var(--page);
  border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
}
.dr-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 10px; border-bottom: 1px solid var(--border); background: var(--surface); }
.dr-title { min-width: 0; flex: 1; }
.dr-title h2 { font-size: 18px; margin: 4px 0 2px; }
.dr-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 55%; }
.dr-tabs { display: flex; gap: 2px; padding: 6px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.dr-body { flex: 1; overflow: auto; padding: 16px 18px 40px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }
.section { margin-top: 18px; }
.section > h4 { margin: 0 0 8px; font-size: 13px; font-weight: 650; display: flex; justify-content: space-between; align-items: baseline; }
.list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); overflow: hidden; }
.list > div { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: start; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 13px; }
.list > div:first-child { border-top: 0; }
.list .d { color: var(--ink-2); font-size: 12.5px; word-break: break-word; }
.list .meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.hints { border-left: 3px solid var(--accent); background: var(--accent-wash); border-radius: 8px; padding: 10px 14px; }
.hints ul { margin: 6px 0 0; padding-left: 18px; }
.hints li { margin: 3px 0; }
.warnbox { border-left: 3px solid var(--warn); background: var(--surface); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-top: 12px; border-top: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ---------------------------------------------------------------- log viewer */
.logv { display: flex; flex-direction: column; gap: 10px; }
.logv-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.logv-bar select.file { max-width: 340px; }
.logv-meta { font-size: 12px; color: var(--muted); }
.logbox {
  background: #111110; color: #e7e6e1; border-radius: 9px; padding: 10px 0; font-family: var(--mono); font-size: 12px; line-height: 1.5;
  height: min(64vh, 900px); overflow: auto; border: 1px solid var(--border);
}
.view .logbox { height: calc(100vh - 250px); }
.logbox .ln { padding: 0 12px 0 10px; white-space: pre; border-left: 3px solid transparent; }
.logbox.wrap .ln { white-space: pre-wrap; word-break: break-all; }
.logbox .ln.e { border-left-color: var(--crit); background: rgba(208, 59, 59, .14); }
.logbox .ln.w { border-left-color: var(--warn); background: rgba(250, 178, 25, .08); }
.logbox mark { background: #fab219; color: #0b0b0b; border-radius: 2px; }
.logbox .none { color: #898781; padding: 4px 12px; }

/* ---------------------------------------------------------------- menu / modal / toast / tip */
.menu { position: fixed; z-index: 70; min-width: 220px; max-width: 340px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; }
.menu button { display: flex; width: 100%; gap: 8px; align-items: center; text-align: left; border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); outline: none; }
.menu button.danger { color: var(--crit-text); }
.menu button small { color: var(--muted); display: block; font-size: 11.5px; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 2px; }
.menu .mh { font-size: 11px; color: var(--muted); padding: 6px 10px 2px; text-transform: uppercase; letter-spacing: .04em; }
.modal { position: fixed; z-index: 61; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px);
  overflow: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 20px 22px; border: 1px solid var(--border); }
.modal.wide { width: min(900px, calc(100vw - 32px)); }
.modal h3 { font-size: 16px; margin-bottom: 10px; }
.modal p { margin: 0 0 10px; color: var(--ink-2); white-space: pre-line; }
.modal pre { background: #111110; color: #e7e6e1; padding: 10px 12px; border-radius: 8px; max-height: 50vh; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 32px)); }
.toast { display: grid; grid-template-columns: 16px 1fr; gap: 10px; align-items: start; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 13px; animation: tin .15s ease-out; }
@keyframes tin { from { transform: translateY(6px); opacity: 0; } }
.tip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: var(--page); font-size: 12px; padding: 5px 8px; border-radius: 6px; white-space: nowrap; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: 1fr; }
  .side { position: static; }
  .row { grid-template-columns: 120px minmax(160px, 1fr) 58px 54px 64px 80px auto; }
  .row .c-ports { display: none; }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .tabs { order: 3; width: 100%; margin: 0; }
  main { padding: 12px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 1fr auto; grid-template-areas: "name act" "st nums"; row-gap: 4px; }
  .row.head { display: none; }
  .row .c-st { grid-area: st; }
  .row .c-name { grid-area: name; }
  .row .c-act { grid-area: act; }
  .row .c-num { display: none; }
  .row .c-num.c-mem { display: block; grid-area: nums; }
  .two-col { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .dr-head { flex-wrap: wrap; }
  .dr-actions { max-width: none; justify-content: flex-start; order: 3; width: 100%; }
  .live span { display: none; }
}
@media (forced-colors: active) {
  .si, .meter > i, .live i { forced-color-adjust: none; }
}
