/* Chainly Provisioner UI - dark first, brand colours from the Chainly logo. */
:root {
  --bg: #0b0e13;
  --bg-glow: rgba(240, 90, 40, 0.10);
  --surface: #12161d;
  --surface-2: #171c25;
  --input: #0e1218;
  --fg: #e8eaee;
  --muted: #8d97a8;
  --line: #222934;
  --line-strong: #2e3744;
  --brand-1: #d0104c;
  --brand-2: #f05a28;
  --brand-3: #ff8c10;
  --brand: #f26a2b;
  --link: #ff9a57;
  --ok: #34c77b;
  --info: #5aa2ff;
  --warn: #f5b02e;
  --err: #ff5d5d;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f8; --bg-glow: rgba(240, 90, 40, 0.08); --surface: #ffffff; --surface-2: #f8f9fb; --input: #ffffff;
    --fg: #161b24; --muted: #5f6b7d; --line: #e3e7ed; --line-strong: #cfd5de; --link: #d44c12;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.06);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--fg);
  font: 15px/1.55 Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 500px at 15% -10%, var(--bg-glow), transparent 60%), var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link); }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 6px; }
h2 { font-size: 17px; font-weight: 650; margin: 0 0 12px; }
h3 { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 22px 0 10px; }
p { margin: 0 0 12px; }

/* header */
header {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 10px 28px; background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--fg); font-weight: 600; }
.brand:visited { color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.brand span { color: var(--muted); border-left: 1px solid var(--line-strong); padding-left: 12px; font-size: 14px; letter-spacing: 0.02em; }
nav { display: flex; gap: 4px; align-items: center; }
nav a, nav a:visited { color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 500; }
nav a:hover { color: var(--fg); background: var(--surface-2); text-decoration: none; }
.user { color: var(--fg); padding: 4px 12px; margin-left: 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; background: var(--surface-2); }
form.inline { display: inline; }
form.inline button { background: transparent; border: 0; box-shadow: none; color: var(--muted); padding: 6px 10px; font-weight: 500; }
form.inline button:hover { color: var(--fg); filter: none; transform: none; }

/* layout */
main { margin: 24px 0 60px; padding: 0 28px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
section.card + section.card { margin-top: 18px; }
.narrow { max-width: 420px; margin: 8vh auto; }
.narrow-wide { max-width: 620px; margin-left: auto; margin-right: auto; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
div.warn { color: var(--fg); background: color-mix(in srgb, var(--warn) 10%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  border-left: 4px solid var(--warn); border-radius: 10px; padding: 14px 16px; margin: 12px 0 16px; }
.error { color: var(--err); }
p.error[role="alert"]:not([hidden]) { background: color-mix(in srgb, var(--err) 10%, transparent); border: 1px solid color-mix(in srgb, var(--err) 35%, transparent);
  border-left: 4px solid var(--err); border-radius: 10px; padding: 10px 14px; color: var(--fg); }
[hidden] { display: none !important; }

/* forms */
label { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; color: var(--fg); font-size: 14px; }
label.check input { width: auto; margin-top: 3px; accent-color: var(--brand); }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 12px; font: inherit; font-size: 14px; color: var(--fg);
  background: var(--input); border: 1px solid var(--line-strong); border-radius: 9px; transition: border-color .15s, box-shadow .15s;
}
textarea { font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 18px; padding: 14px 18px 4px; background: var(--surface-2); }
legend { padding: 0 8px; font-weight: 650; font-size: 14px; color: var(--fg); }
table input, table select, table textarea { margin-top: 0; padding: 6px 8px; }

/* buttons */
button, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 9px 16px; border: 0; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2) 55%, var(--brand-3));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand-2) 28%, transparent); transition: transform .1s, filter .15s;
}
a.button:visited { color: #fff; }
a.button.secondary, a.button.secondary:visited { color: var(--fg); }
button:hover, a.button:hover { filter: brightness(1.08); text-decoration: none; transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:disabled { opacity: .55; cursor: progress; transform: none; }
/* secondary actions */
#console-refresh, #vnc-cad, #vnc-full, #vnc-disconnect {
  background: var(--surface-2); color: var(--fg); border: 1px solid var(--line-strong); box-shadow: none;
}
/* destructive or risky actions */
form[action$="/cancel"] button, form[action$="/recover"] button, form[action$="/network/apply"] button, form[action$="/delete"] button {
  background: transparent; color: var(--err); border: 1px solid color-mix(in srgb, var(--err) 55%, transparent); box-shadow: none;
}
form[action$="/cancel"] button:hover, form[action$="/recover"] button:hover, form[action$="/network/apply"] button:hover {
  background: color-mix(in srgb, var(--err) 12%, transparent); filter: none;
}
form[action$="/install"] button { min-width: 140px; }

/* tables */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; margin: 6px 0 4px; }
th { text-align: left; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line-strong); background: var(--surface-2); }
th:first-child { border-top-left-radius: 10px; }
th:last-child { border-top-right-radius: 10px; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
tbody tr:last-child td { border-bottom: 0; }

/* status badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--line-strong); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.discovered, .badge.discovering { color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); }
.badge.ready, .badge.installed { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.badge.installing { color: var(--brand-3); border-color: color-mix(in srgb, var(--brand-3) 45%, transparent); }
.badge.installing::before, .badge.discovering::before { animation: pulse 1.4s ease-in-out infinite; }
.badge.failed, .badge.discovery_failed { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

/* install progress */
.progress-row { display: flex; align-items: center; gap: 14px; margin: 14px 0 6px; }
.progress-row progress { flex: 1; height: 10px; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-2); -webkit-appearance: none; appearance: none; }
.progress-row progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.progress-row progress::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, var(--brand-1), var(--brand-2), var(--brand-3)); transition: width .6s ease; }
.progress-row progress::-moz-progress-bar { border-radius: 999px; background: linear-gradient(90deg, var(--brand-1), var(--brand-2), var(--brand-3)); }
.progress-row strong { font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; font-size: 18px; }
.stages { display: flex; gap: 0; list-style: none; padding: 0; margin: 16px 0 10px; counter-reset: stage; }
.stage { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  font-size: 12.5px; color: var(--muted); counter-increment: stage; padding: 0 4px; }
.stage::before { content: counter(stage); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; z-index: 1;
  font-weight: 700; font-size: 13px; background: var(--surface-2); border: 2px solid var(--line-strong); color: var(--muted); }
.stage::after { content: ""; position: absolute; top: 15px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: var(--line-strong); }
.stage:last-child::after { display: none; }
.stage.done { color: var(--fg); }
.stage.done::before { content: "\2713"; background: var(--ok); border-color: var(--ok); color: #06150d; }
.stage.done::after { background: var(--ok); }
.stage.active { color: var(--fg); font-weight: 650; }
.stage.active::before { border-color: var(--brand-2); color: var(--brand-3); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand-2) 22%, transparent); }
.stage.failed { color: var(--err); font-weight: 650; }
.stage.failed::before { content: "!"; background: var(--err); border-color: var(--err); color: #1a0606; }
.stage-sub { font-weight: 500; font-size: 11.5px; color: var(--brand-3); min-height: 1em; }
.stage-sub:empty { display: none; }
#install-detail { min-height: 1.5em; font-size: 13.5px; }

/* log and code panels */
pre { overflow-x: auto; background: var(--surface-2); border: 1px solid var(--line); padding: 14px; border-radius: 10px; font: 12.5px/1.55 var(--mono); }
pre.log { max-height: 440px; overflow: auto; background: #07090d; color: #c9d1d9; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; box-shadow: inset 0 1px 0 rgba(255,255,255,.02); }
pre.preview { max-height: 420px; }
pre.fingerprint { font-size: 14px; user-select: all; }

/* console */
img.screen { display: block; width: 100%; max-width: 1024px; aspect-ratio: 4 / 3; margin: 6px auto 10px; object-fit: contain;
  background: #000; border-radius: 12px; border: 1px solid var(--line-strong); box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.console-bar { margin: 12px 0; }
.console-bar span:last-child { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.vnc-screen { width: 100%; height: 76vh; background: #000; border-radius: 12px; border: 1px solid var(--line-strong); overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.45); }

/* login */
.login-logo { display: block; width: 240px; max-width: 100%; height: auto; margin: 4px auto 22px; }
.narrow h1 { text-align: center; }
.narrow > p.muted { text-align: center; font-size: 13.5px; }
.narrow form button { width: 100%; margin-top: 4px; padding: 11px 16px; }

@media (max-width: 720px) {
  header { padding: 10px 14px; flex-wrap: wrap; }
  .brand span { display: none; }
  main { padding: 0 12px; margin-top: 18px; }
  .card { padding: 18px; }
  .stages { flex-wrap: wrap; row-gap: 14px; }
  .stage { flex: 0 0 33%; }
  .stage::after { display: none; }
  table { display: block; overflow-x: auto; }
}

/* hardware facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 8px 0 18px; }
.facts > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.facts span { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.facts strong { font-size: 14.5px; }
.facts em { font-style: normal; font-size: 12.5px; color: var(--muted); }
button.secondary, a.button.secondary { background: var(--surface-2); color: var(--fg); border: 1px solid var(--line-strong); box-shadow: none; }
form.inline-block { display: inline-block; margin: 0; }

/* node header */
.node-head h1 { margin-bottom: 8px; }
.node-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 999px; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line); font-family: var(--mono); }
.chip em { font-style: normal; font-family: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.actions:not(:has(a)) { display: none; }

/* collapsible log */
details.log-box { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
details.log-box > summary { cursor: pointer; list-style: none; padding: 11px 16px; font-weight: 650; font-size: 14px; display: flex; align-items: center; gap: 8px; user-select: none; }
details.log-box > summary::-webkit-details-marker { display: none; }
details.log-box > summary::before { content: "\25B8"; color: var(--muted); transition: transform .15s; }
details.log-box[open] > summary::before { transform: rotate(90deg); }
details.log-box > summary:hover { color: var(--brand-3); }
details.log-box pre.log { margin: 0 12px 12px; }

/* server front view (drive bays) */
.front { background: #07090d; border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 6px; overflow-x: auto; }
svg.chassis { display: block; width: 100%; min-width: 640px; height: auto; }
svg.chassis .ulhide, svg.chassis .slot-status-transparent { display: none; }
svg.chassis .bay > text { fill: var(--muted); font-family: var(--mono); font-size: 13px; }
svg.chassis .drive { cursor: help; transition: filter .15s; }
svg.chassis .drive:hover { filter: brightness(1.35); }
svg.chassis .drive:hover .slot-status-transparent { display: inline; }
svg.chassis .drive.os .slot-status-transparent { display: inline; fill: var(--brand-2); opacity: .45; stroke: var(--brand-3); stroke-width: 3; }
svg.chassis .drive.data .slot-status-transparent { display: inline; fill: var(--info); opacity: .35; stroke: var(--info); stroke-width: 3; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 10px 2px 14px; font-size: 12.5px; }
.legend .key::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--line-strong); }
.legend .key.os::before { background: var(--brand-2); }
.legend .key.data::before { background: var(--info); }
.slots { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.slot { background: #07090d; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 10px; padding: 8px 14px; display: flex; align-items: center; gap: 8px;
  font: 12.5px var(--mono); color: var(--muted); cursor: help; transition: filter .15s; }
.slot:hover, .slot:focus { filter: brightness(1.35); outline: none; color: var(--fg); }
.slot-icon { width: 22px; height: 12px; border-radius: 2px; background: #3a3e46; box-shadow: inset 0 0 0 1px #5b6069; }
.slot.data { border-left-color: var(--info); }
.slot.os { border-left-color: var(--brand-2); }
.slot span { font: 11.5px var(--mono); color: var(--muted); }
.slot strong { font-size: 13.5px; }
.slot em { font-style: normal; font-size: 12.5px; color: var(--muted); }

/* background work notice (hardware discovery) */
.notice { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; padding: 11px 14px; border-radius: 10px; font-size: 13.5px;
  background: color-mix(in srgb, var(--info) 12%, transparent); border: 1px solid color-mix(in srgb, var(--info) 35%, transparent); }
.spinner { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--info) 30%, transparent);
  border-top-color: var(--info); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
div.error p { margin: 0 0 10px; }

/* node page: side menu + 12-column grid, full width */
.node-page { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.node-nav { position: sticky; top: 84px; display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 2px; padding: 14px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.node-nav .nav-title { font-weight: 700; font-size: 15px; padding: 4px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-nav .nav-section { margin: 14px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.node-nav a, .node-nav a:visited { padding: 8px 12px; border-radius: 9px; color: var(--fg); font-size: 14px; font-weight: 550; text-decoration: none; }
.node-nav a:hover, .node-nav a:visited:hover { background: var(--surface-2); color: var(--brand-3); }
.node-nav a[aria-current="page"], .node-nav a[aria-current="page"]:visited { background: color-mix(in srgb, var(--brand-2) 16%, transparent); color: var(--brand-3); }
.node-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-items: start; }
.node-grid > section.card + section.card { margin-top: 0; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.node-grid h2 { margin-top: 0; }
#hw-system .facts { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* console thumbnail and enlarged view */
button.screen-thumb { display: block; width: 100%; padding: 0; margin: 6px 0 8px; border: 0; background: none; box-shadow: none; cursor: zoom-in; border-radius: 12px; }
button.screen-thumb:hover { transform: none; filter: brightness(1.12); }
button.screen-thumb img.screen { margin: 0; max-width: none; height: 190px; aspect-ratio: auto; box-shadow: none; }
dialog.console-dialog { width: min(1180px, 94vw); padding: 18px 20px; color: var(--fg); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
dialog.console-dialog::backdrop { background: rgba(4, 6, 10, .72); backdrop-filter: blur(3px); }
img.screen-large { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #000; border-radius: 10px; border: 1px solid var(--line-strong); }

@media (max-width: 1280px) {
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
}
@media (max-width: 900px) {
  main { padding: 0 14px; }
  .node-page { grid-template-columns: minmax(0, 1fr); }
  .node-nav { position: static; flex-direction: row; flex-wrap: wrap; padding: 8px; }
  .node-nav .nav-title, .node-nav .nav-section { display: none; }
}

.danger-zone { border-color: color-mix(in srgb, var(--err) 35%, var(--line)); }

.node-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.node-main > section.card + section.card { margin-top: 0; }
.node-main > .card { width: 100%; max-width: 1100px; }
.node-main > .narrow-wide { margin: 0; }

fieldset.roles { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 6px; margin: 4px 0 14px; }
fieldset.roles legend { padding: 0 6px; font-size: 13px; color: var(--muted); }
fieldset.roles label.check { display: flex; gap: 8px; align-items: baseline; margin: 6px 0; }
p.warning { color: var(--warn); margin: 10px 0 0; font-size: 13.5px; }

.node-nav .nav-group { padding: 8px 12px 2px; font-size: 14px; font-weight: 550; color: var(--muted); }
.node-nav a.sub, .node-nav a.sub:visited { padding-left: 26px; font-size: 13.5px; }

/* node header with the console box beside it */
.head-row { display: flex; gap: 18px; align-items: stretch; }
.head-row > .node-head { flex: 1 1 auto; min-width: 0; margin: 0; }
.head-row > .console-mini { flex: 0 0 auto; width: 240px; max-width: 240px; margin: 0; padding: 14px 16px; }
.console-mini h2 { font-size: 15px; margin: 0; }
.console-mini button.small { padding: 4px 10px; font-size: 12px; }
.console-mini button.screen-thumb { margin: 8px 0 4px; }
.console-mini button.screen-thumb img.screen { width: 100%; max-width: 200px; height: auto; aspect-ratio: 16 / 9; margin: 0 auto; }
.console-mini #console-status { font-size: 11.5px; margin: 0; }
@media (max-width: 900px) { .head-row { flex-direction: column; } .head-row > .console-mini { width: auto; max-width: none; } }
.head-row > section.card + section.card { margin-top: 0; }

/* installation: progress left, log right */
.install-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: stretch; }
.install-split > .card { margin: 0; min-width: 0; }
.install-log { display: flex; flex-direction: column; }
.install-log h2 .muted { font-size: 13px; font-weight: 500; }
.install-log pre.log { flex: 1 1 auto; margin: 0; min-height: 220px; max-height: 520px; }
@media (max-width: 1100px) { .install-split { grid-template-columns: 1fr; } }
.install-log pre.log:empty::before { content: "No events yet."; color: var(--muted); }

/* roles as tags */
.role-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.role-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; line-height: 1.6;
  border: 1px solid currentColor; background: color-mix(in srgb, currentColor 14%, transparent); }
.role-nodes { color: #f59e0b; }
.role-ingestion { color: #60a5fa; }
.role-data { color: #34d399; }
.role-apps { color: #f472b6; }
.install-split > section.card + section.card, .head-row > section.card + section.card { margin-top: 0; }

/* access: users and SSH keys */
.user-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 16px 18px; margin: 14px 0; }
.user-card h2, .user-card h3 { margin: 0 0 6px; }
.user-card h3 { font-size: 14px; margin-top: 12px; }
.user-card .row { align-items: center; }
.users-title { margin-top: 26px; }
.key-list { list-style: none; margin: 8px 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.key-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.key-list li:first-child { border-top: 0; }
.key-list .key-icon { font-size: 18px; opacity: .8; }
.key-list .key-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.key-list .key-text code { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-add { display: flex; gap: 10px; align-items: center; margin: 8px 0 0; }
.key-add input { margin: 0; flex: 1 1 auto; }
.key-add button { flex: 0 0 auto; white-space: nowrap; }
button.small { padding: 6px 12px; font-size: 12.5px; }
button.danger { background: transparent; color: #f87171; border: 1px solid #7f1d1d; box-shadow: none; }
button.danger:hover:not([disabled]) { background: #7f1d1d; color: #fff; }
button[disabled] { opacity: .45; cursor: not-allowed; }
.user-add label.check { margin: 8px 0 12px; }
.user-card button.danger, .key-list button.danger { color: #f87171; border-color: #7f1d1d; background: transparent; }
.user-card button.danger:hover:not([disabled]) { background: #7f1d1d; color: #fff; }

/* R630 drawn front view */
svg.chassis.r630 .bay > text { font-size: 15px; }
svg.chassis.r630 .bay > text.n { font-size: 12px; fill: #9ca3af; }
svg.chassis .drive .hl { fill: transparent; }
svg.chassis .drive.os .hl { fill: var(--brand-2); opacity: .35; stroke: var(--brand-3); stroke-width: 2; }
svg.chassis .drive.data .hl { fill: var(--info); opacity: .3; stroke: var(--info); stroke-width: 2; }

/* network ports */
.hw-sub { margin: 18px 0 8px; font-size: 14px; }
.netpanel-wrap { background: #07090d; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; overflow-x: auto; }
svg.netpanel { display: block; max-width: 100%; height: auto; }
svg.netpanel .card-label { fill: var(--muted); font: 600 12px var(--sans, sans-serif); }
svg.netpanel .port-label { fill: var(--muted); font: 12px var(--mono); }
svg.netpanel .port { cursor: help; transition: filter .15s; }
svg.netpanel .port:hover { filter: brightness(1.4); }
svg.netpanel .port.up .jack { fill: #14532d; stroke: #22c55e; }
svg.netpanel .port.up .led { fill: #4ade80; }
svg.netpanel .port.up .led.act { fill: #f59e0b; }
svg.netpanel .port.up > rect:first-child { stroke: #22c55e; }
.legend .key.up::before { background: #22c55e; }

/* hover cards for the hardware pictures (static/hwtip.js) */
.hw-tip { position: fixed; z-index: 50; pointer-events: none; min-width: 220px; max-width: 380px; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, black); border: 1px solid var(--line-strong); box-shadow: 0 12px 32px rgba(0,0,0,.55); font-size: 12.5px; }
.hw-tip strong { display: block; font-size: 13.5px; margin-bottom: 8px; color: var(--fg); }
.hw-tip dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.hw-tip dt { color: var(--muted); }
.hw-tip dd { margin: 0; font-family: var(--mono); word-break: break-all; }
.hw-tip dd.ok { color: #4ade80; font-weight: 650; }
/* role tags as tall as the chips, text centered; addresses below the iDRAC row */
.role-tag { display: inline-flex; align-items: center; line-height: 1; padding: 6px 11px; }
.role-tags { align-items: center; }
.node-meta + .node-addrs { margin-top: 10px; }

/* sub-steps of the active stage, a smaller stepper under the stages */
.stages.substeps { margin: 4px 0 14px; padding: 12px 6px 4px; border-top: 1px dashed var(--line); }
.substeps .stage { font-size: 11px; line-height: 1.25; gap: 5px; color: var(--muted); }
.substeps .stage::before { width: 20px; height: 20px; font-size: 10.5px; border-width: 1.5px; }
.substeps .stage::after { top: 10px; left: calc(50% + 13px); right: calc(-50% + 13px); }
.substeps .stage.active { color: var(--brand-3); }
.substeps .stage.active::before { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-2) 22%, transparent); }
@media (max-width: 900px) { .substeps .stage { flex: 0 0 25%; } }
.stages.substeps { flex-wrap: wrap; row-gap: 12px; }
.substeps .stage { flex: 1 0 74px; min-width: 0; overflow-wrap: anywhere; }
/* large console view: nearly the whole window; small previews scaled without smoothing */
dialog.console-dialog { width: min(1600px, 96vw); max-height: 96vh; }
img.screen-large { max-height: calc(96vh - 90px); }
img.screen.lowres, img.screen-large.lowres { image-rendering: pixelated; }

/* serial console terminal */
.serial-screen { height: min(70vh, 720px); background: #07090d; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px; }
.serial-screen:fullscreen { height: 100vh; border-radius: 0; }

/* health card (todo 0095) */
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 8px; }
.health-grid .tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.health-grid .tile > span { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.health-grid .tile strong { font-size: 20px; }
.health-grid .tile em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.health-grid .fs { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
svg.spark { width: 100%; height: 28px; margin-top: 6px; }
svg.spark polyline { stroke: var(--brand-2); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

/* alerts (todo 0095) */
.alert-banner { border-color: var(--danger, #e5484d); }
.alert-banner ul { margin: 6px 0; padding-left: 18px; }
a.alert-count { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--danger, #e5484d); color: #fff; text-decoration: none; }
.badge.alert-firing { background: var(--danger, #e5484d); color: #fff; }
.badge.alert-pending { background: var(--warning, #f5a524); color: #111; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.rule-grid label { display: flex; flex-direction: column; gap: 4px; }

/* disk layout (todo 0086) */
.disk-builder { display: grid; gap: 12px; max-width: 760px; }
.disk-builder fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.badge.warn { background: var(--warning, #f5a524); color: #111; }

/* power page */
.power-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.power-action { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
