/* SOC Deck — design system shared with Kuma Deck (copied 2026-10-29; deck-specific rules live in deck.css). Tokens first; components reference roles, never raw hex. Dark is the default theme. */
:root {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222220;
  --surface-3: #2c2c2a;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f0efec;
  --text-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --accent: #3987e5;
  --accent-wash: rgba(57, 135, 229, 0.14);
  --series-1: #3987e5;   /* rx / response time */
  --series-2: #d95926;   /* tx */
  --series-3: #199e70;   /* storage I/O */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --unknown: #898781;
  --good-text: #0ca30c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --page: #f4f4f1; --surface: #fcfcfb; --surface-2: #f3f3f0; --surface-3: #e9e8e3;
    --border: rgba(11, 11, 11, 0.10); --border-strong: rgba(11, 11, 11, 0.18);
    --text: #0b0b0b; --text-2: #52514e; --muted: #6f6d68; --grid: #e1e0d9; --axis: #c3c2b7;
    --accent: #2a78d6; --accent-wash: rgba(42, 120, 214, 0.10);
    --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --good-text: #006300;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.06);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f4f4f1; --surface: #fcfcfb; --surface-2: #f3f3f0; --surface-3: #e9e8e3;
  --border: rgba(11, 11, 11, 0.10); --border-strong: rgba(11, 11, 11, 0.18);
  --text: #0b0b0b; --text-2: #52514e; --muted: #6f6d68; --grid: #e1e0d9; --axis: #c3c2b7;
  --accent: #2a78d6; --accent-wash: rgba(42, 120, 214, 0.10);
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --good-text: #006300;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
svg { display: block; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.t2 { color: var(--text-2); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 60px;
  background: color-mix(in srgb, var(--page) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: 0.01em; white-space: nowrap; }
.brand svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); padding: 4px; border-radius: 10px; }
.tabs a { padding: 6px 14px; border-radius: 7px; color: var(--text-2); text-decoration: none; font-weight: 550; font-size: 14px;
  transition: background 160ms var(--ease), color 160ms var(--ease); }
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a[aria-selected="true"] { background: var(--accent-wash); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.live { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live.ok .pulse { background: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); animation: ping 2.4s infinite; }
.live.stale .pulse { background: var(--warning); }
.live.err .pulse { background: var(--critical); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; transition: background 160ms var(--ease); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.who .via { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted); }
.who .via.local { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 50%, transparent); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; max-width: none; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; padding: 28px 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.login-brand { font-size: 18px; }
.login-page .brand span { display: inline; }  /* the narrow-screen topbar rule hides it; the login card always shows the name */
.login-sub { margin: -6px 0 4px; color: var(--text-2); font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 550; }
.field .input { height: 40px; font-size: 15px; color: var(--text); }
.btn-primary { height: 40px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
  transition: filter 160ms var(--ease); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.7; cursor: progress; }
.login-err { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; color: var(--text);
  background: color-mix(in srgb, var(--critical) 14%, transparent); border: 1px solid color-mix(in srgb, var(--critical) 45%, transparent); }
.login-foot { margin: 2px 0 0; font-size: 12.5px; }

main { padding: 24px; max-width: 1680px; margin: 0 auto; }
main:has(.view-full:not([hidden])) { max-width: none; padding: 0; }
.view { animation: fade 240ms var(--ease); }
@keyframes fade { from { opacity: 0.6; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- shared pieces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-h h2 { margin: 0; font-size: 15px; font-weight: 620; }
.panel-h .sub { font-size: 13px; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 28px 0 12px; font-weight: 600; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 560; white-space: nowrap; }
.status svg { width: 15px; height: 15px; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.status.up svg { stroke: var(--good); } .status.down svg { stroke: var(--critical); }
.status.pending svg { stroke: var(--warning); } .status.maintenance svg { stroke: var(--accent); }
.status.unknown svg { stroke: var(--unknown); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--unknown); }
.dot.up { background: var(--good); } .dot.down { background: var(--critical); } .dot.pending { background: var(--warning); }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 560;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 550; white-space: nowrap;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease); }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent-wash); border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--text); }
.chip .n { font-variant-numeric: tabular-nums; color: var(--muted); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 550; color: var(--text-2); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.input { height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.input:focus { border-color: var(--accent); outline: none; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search .input { padding-left: 32px; width: 240px; }
select.input { max-width: 200px; }
.btn { height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-size: 13px; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .spacer { flex: 1; }

.tooltip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow); max-width: 320px; }
.tooltip .tt-h { font-weight: 620; margin-bottom: 2px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .key { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* ---------- dashboard ---------- */
.hero { display: grid; grid-template-columns: minmax(280px, 1.2fr) repeat(5, minmax(150px, 1fr)); gap: 16px; }
.hero.seven { grid-template-columns: minmax(260px, 1.2fr) repeat(6, minmax(140px, 1fr)); }
.tile .foot a { color: inherit; text-decoration: none; } .tile .foot a:hover { text-decoration: underline; }
.hero-main { padding: 20px 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface) 60%); }
.hero-fig { font-size: 52px; line-height: 1; font-weight: 650; letter-spacing: -0.02em; }
.hero-fig small { font-size: 22px; color: var(--muted); font-weight: 560; }
.hero-label { color: var(--text-2); font-size: 14px; }
.tile { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile .label { font-size: 13px; color: var(--text-2); }
.tile .value { font-size: 26px; font-weight: 640; line-height: 1.15; letter-spacing: -0.01em; }
.tile .foot { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.tile.alert { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--critical) 55%, transparent); }
.tile.warn { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 45%, transparent); }
.collectors { display: flex; gap: 8px; flex-wrap: wrap; }
.collectors .badge { max-width: 100%; overflow: hidden; } .collectors .badge .status { overflow: hidden; text-overflow: ellipsis; }
.dash-row { display: grid; gap: 16px; margin-top: 16px; }
.dash-row.two { grid-template-columns: 1fr 1fr; }
.dash-row.three { grid-template-columns: 1.3fr 1fr 1fr; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.gtile { padding: 14px 16px; cursor: pointer; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 10px; transition: transform 160ms var(--ease), border-color 160ms var(--ease), background 160ms var(--ease); }
.gtile:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }
.gtile .g-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gtile .g-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtile .g-stats { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.gtile .g-stats b { color: var(--text-2); font-weight: 600; }
.gtile.has-down { border-color: color-mix(in srgb, var(--critical) 60%, transparent); }
.cells { display: flex; flex-wrap: wrap; gap: 2px; }
.cells i { width: 8px; height: 8px; border-radius: 2px; background: var(--good); }
.cells i.down { background: var(--critical); } .cells i.pending { background: var(--warning); } .cells i.maintenance { background: var(--accent); }
.meter { height: 6px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 18%, var(--surface-3)); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width 400ms var(--ease); }
.meter.w > i { background: var(--warning); } .meter.c > i { background: var(--critical); }
.list { display: flex; flex-direction: column; }
.list-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--border); font-size: 13.5px; }
.list-row:first-child { border-top: 0; }
.list-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row button.linkish, .linkish { all: unset; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkish:hover { color: var(--accent); text-decoration: underline; }
.empty { color: var(--muted); font-size: 13.5px; padding: 16px 0; text-align: center; }
.feed-row { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--border); font-size: 13px; align-items: center; }
.feed-row:first-child { border-top: 0; }
.infra { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.host-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.host-card .hc-top { display: flex; justify-content: space-between; align-items: center; }
.host-card .hc-name { font-weight: 620; }
.kv { display: grid; grid-template-columns: 44px 1fr 46px; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.kv b { color: var(--text-2); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 560; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }

/* charts */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .crosshair { stroke: var(--text-2); stroke-width: 1; opacity: 0.5; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }

/* ---------- monitors ---------- */
.mon-toolbar { position: sticky; top: 60px; z-index: 10; padding: 12px 0; background: var(--page); }
.group-block { margin-top: 18px; }
.group-head { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 4px; cursor: pointer; border-radius: 8px; }
.group-head:hover { background: var(--surface); }
.group-head .chev { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; transition: transform 200ms var(--ease); }
.group-head[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.group-head h3 { margin: 0; font-size: 15px; font-weight: 620; }
.group-head .gh-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin-top: 8px; }
.mcard { position: relative; padding: 14px 16px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; text-align: left;
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); transition: border-color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease); }
.mcard:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.mcard::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--good); }
.mcard.down::before { background: var(--critical); } .mcard.pending::before { background: var(--warning); } .mcard.maintenance::before { background: var(--accent); }
.mcard.down { border-color: color-mix(in srgb, var(--critical) 55%, transparent); }
.mcard .mc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mcard .mc-host { font-weight: 620; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard .mc-check { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard .mc-target { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard .mc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mcard .mc-stat .l { font-size: 11.5px; color: var(--muted); }
.mcard .mc-stat .v { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mcard .spark { height: 30px; }
.mcard.open { grid-column: 1 / -1; cursor: default; transform: none; padding: 18px 20px; }
.mdetail { display: grid; grid-template-columns: 1fr 300px; gap: 20px; margin-top: 4px; }
.mdetail .facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; align-content: start; }
.mdetail .facts dt { color: var(--muted); } .mdetail .facts dd { margin: 0; overflow-wrap: anywhere; }
.strip { display: flex; gap: 1px; height: 22px; align-items: stretch; }
.strip i { flex: 1; border-radius: 2px; background: var(--good); min-width: 1px; }
.strip i.down { background: var(--critical); } .strip i.mixed { background: var(--warning); } .strip i.none { background: var(--surface-3); }
.close-x { position: absolute; top: 12px; right: 12px; }

/* ---------- performance ---------- */
.ptable-wrap { padding: 4px 8px; overflow-x: auto; }
.ptable tbody tr { cursor: pointer; transition: background 140ms var(--ease); }
.ptable tbody tr:hover, .ptable tbody tr:focus-visible { background: var(--surface-2); }
.ptable tr.off td { color: var(--muted); }
.ptable td { vertical-align: middle; }
.tbl th.r, .tbl td.r { text-align: right; }
.psys { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.pname { font-weight: 600; font-size: 13.5px; }
.psub { font-size: 11.5px; }
.pmeter { display: grid; grid-template-columns: minmax(60px, 1fr) 44px; gap: 8px; align-items: center; min-width: 110px; }
.pmeter b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.pgap-note { font-size: 12.5px; margin-bottom: 8px; }
.pskip { margin-top: 12px; font-size: 13px; } .pskip summary { cursor: pointer; color: var(--muted); padding: 6px 2px; }
#p-gap { max-height: 520px; overflow: auto; }
#p-hyg .list-row { grid-template-columns: auto 1fr; } #p-hyg .list-row > span:last-child { text-align: right; white-space: normal; }
#p-hyg .badge { margin: 2px 0 2px 4px; }
.pd-bar { margin-bottom: 16px; }
.pd-bar .back { transform: rotate(90deg); }
.pd-title { margin: 0 0 0 6px; font-size: 20px; font-weight: 640; overflow-wrap: anywhere; }
.pd-top { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.pd-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; margin: 0; }
.pd-facts dt { color: var(--muted); } .pd-facts dd { margin: 0; overflow-wrap: anywhere; }
.pd-now { display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.pd-now .kv { grid-template-columns: 44px 1fr; }
.pd-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 16px; margin-top: 16px; }
.dash-row.pd-ext { grid-template-columns: 1fr 2fr; }

/* ---------- backups ---------- */
.b-attn { margin-top: 16px; }
.b-attn-row { grid-template-columns: 1fr auto; }
.b-attn-txt { overflow-wrap: anywhere; }
.b-toolbar { margin-bottom: 4px; }
.bjob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 8px; }
.bcard.unknown::before { background: var(--unknown); }
.bcard.pending { border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.bstrip { height: 16px; }
.bcard.open .mc-top { padding-right: 44px; }
.b-norun { font-size: 12px; }
.b-msg { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; border-left: 2px solid var(--border-strong); padding-left: 8px; }
.bdetail { margin-top: 4px; }
.bdetail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px; }
.bdetail .facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; margin: 0 0 12px; }
.bdetail .facts dt { color: var(--muted); } .bdetail .facts dd { margin: 0; overflow-wrap: anywhere; }
.b-msgcell { max-width: 420px; overflow-wrap: anywhere; font-size: 12.5px; }
.b-repo { grid-template-columns: minmax(0, 1fr) 170px; }
.b-feed-row { grid-template-columns: 74px minmax(0, 1fr) auto; }
.b-feed-row .name { display: flex; flex-direction: column; min-width: 0; }
.b-feed-msg { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#b-gap { max-height: 520px; overflow: auto; }

/* ---------- diagrams ---------- */
.diagram-wrap { position: relative; height: calc(100vh - 60px); display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); }
.diagram-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--page); }
.cy-host { position: relative; overflow: hidden;
  background-color: var(--page);
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 0);
  background-size: 22px 22px; }
#cy { position: absolute; inset: 0; }
.dlegend { position: absolute; left: 16px; bottom: 16px; padding: 12px 14px; font-size: 12px; display: grid; gap: 6px; color: var(--text-2);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: 10px; }
.dlegend .row { display: flex; align-items: center; gap: 8px; }
.dlegend .lg-body { display: grid; gap: 6px; }
.dlegend.shut .lg-body { display: none; }
.lg-toggle { all: unset; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; color: var(--text); }
.lg-toggle svg { width: 14px; height: 14px; transition: transform 200ms var(--ease); }
.dlegend.shut .lg-toggle svg { transform: rotate(-90deg); }
.dlegend i.line { width: 22px; height: 0; border-top: 3px dashed; }
.dlegend i.glow { width: 12px; height: 12px; border-radius: 50%; margin: 0 5px; }
.bd-glows { position: absolute; inset: 0; pointer-events: none; }
.bd-glows i { position: absolute; animation: bd-breathe 2s ease-in-out infinite; transition: opacity 200ms; }
.cy-host.still .bd-glows i { animation: none; }
@keyframes bd-breathe { 0%, 100% { filter: brightness(0.75); transform: scale(0.985); } 50% { filter: brightness(1.15); transform: scale(1.03); } }
/* backups diagram side panel */
.bd-usage { margin: 14px 0 4px; }
.bd-usage .meter { height: 10px; }
.bd-usage .meter:not(.w):not(.c) > i { background: var(--good); }
.bd-usage-k { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-top: 6px; }
.bd-usage-cap { font-size: 12px; margin-top: 2px; }
.bd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.side .list-row button.linkish[disabled] { color: var(--text); cursor: default; text-decoration: none; }
.section-title .b-diag { float: right; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--accent); text-decoration: none; display: inline-flex; gap: 5px; align-items: center; }
.section-title .b-diag svg { width: 14px; height: 14px; }
.side { position: absolute; top: 12px; right: 12px; bottom: 12px; width: 360px; overflow: auto; padding: 18px; z-index: 5;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow); animation: slidein 220ms var(--ease); }
@keyframes slidein { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.side h3 { margin: 0 0 4px; font-size: 17px; overflow-wrap: anywhere; padding-right: 36px; }
.side .facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; margin: 14px 0; }
.side .facts dt { color: var(--muted); } .side .facts dd { margin: 0; overflow-wrap: anywhere; }
.side .checks .list-row { font-size: 13px; }
.dstats { position: absolute; left: 16px; top: 16px; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.dstats .badge { background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(8px); height: 26px; font-size: 12.5px; }
.notice { margin: 16px; padding: 14px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 13.5px; }

@media (max-width: 1300px) {
  .hero, .hero.seven { grid-template-columns: repeat(3, 1fr); }
  .hero-main { grid-column: 1 / -1; }
  .dash-row.three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .topbar { gap: 12px; padding: 0 16px; }
  .tabs { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .tabs a { padding: 6px 10px; white-space: nowrap; }
  .brand span, .live #live-text, .who .name, .who .via { display: none; }
  main { padding: 16px; }
  .hero, .hero.seven { grid-template-columns: 1fr 1fr; }
  .bdetail-grid, .b-repo { grid-template-columns: 1fr; }
  .dash-row.two, .dash-row.three { grid-template-columns: 1fr; }
  .mdetail { grid-template-columns: 1fr; }
  .pd-top, .dash-row.pd-ext { grid-template-columns: 1fr; }
  .pd-charts { grid-template-columns: 1fr; }
  #g-env { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  #g-env button { flex: none; white-space: nowrap; }
  .search .input { width: 100%; }
  .search { flex: 1 1 100%; }
  .side { left: 12px; width: auto; top: auto; height: 60%; }
  .dstats { right: 16px; }
  .dstats .badge { display: block; height: auto; white-space: normal; padding-top: 4px; padding-bottom: 4px; line-height: 1.4; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
