/* IT Ops Module — ported from the redesign mockup (itops.css). Every rule is
   scoped under .itops-page so the mockup's compact generic class names (card,
   tile, member, seg, stage, host-row…) cannot leak in or out. Colours come from
   the shared scheme tokens in src/styles/colorSchemes.css via a small alias
   block; only the fixed dark run-output syntax palette is declared locally
   (it is read-only terminal *content*, like the terminal surface, not chrome). */

.itops-page,
.itops-page * {
  box-sizing: border-box;
}

/* fills the workspace content area, mirroring the Installer/Dashboard modules.
   `.itops-page` also rides on portaled dialog backdrops (Sheet `zClassName`)
   and the armed-placement cursor ghosts (`.rk-cursor-ghost` /
   `.rm-cursor-ghost`) so the module
   tokens below reach those body-portaled elements — the page-root layout half
   must not apply there or it demotes their fixed overlay positioning and
   pushes them below the viewport. */
.itops-page:not(.kk-dlg-backdrop):not(.rk-cursor-ghost):not(.rm-cursor-ghost) {
  position: relative;
  grid-column: 2 / 5;
  grid-row: 1;
  z-index: 75;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--app-bg);
}

.itops-page {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;

  /* layout tokens (module-local; not global custom properties) */
  --pad: 16px;
  --gap: 12px;
  --r-card: 12px;
  --r-row: 10px;

  /* aliases onto the shared scheme tokens so the ported rule bodies are verbatim */
  --bg: var(--surface);
  --bg-2: var(--surface-muted);
  --muted: var(--surface-muted);
  --text-2: var(--text-muted);
  --text-3: var(--text-faint);
  --red-soft: color-mix(in srgb, var(--red) 16%, var(--surface));
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 0 rgba(0, 0, 0, 0.02);

  /* read-only run-output (dark terminal surface) */
  --term: var(--terminal);
  --term-2: var(--terminal-2);
  --term-border: var(--terminal-border);
  --term-text: #c9d4e2;
  --term-dim: #69798b;
  --c-key: #88c5ff;
  --c-val: #c4e88a;
  --c-cm: #8a98ad;
  --c-prompt: #5fd17a;
  --c-path: #6cb8ff;
  --c-warn: #ffcf6b;
  --c-err: #ff8a80;
}

.itops-page[data-active="false"] {
  visibility: hidden;
  pointer-events: none;
}

/* ============================ module shell ============================ */
.itops-page .it {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
}

/* ---- module header ---- */
.itops-page .it-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
}
.itops-page .it-head-tile {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.itops-page .it-head-txt {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
}
.itops-page .it-head-txt h1 {
  flex: 1 1 auto;
  margin: 0;
}
.itops-page .it-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
}
.itops-page .it-head-sp {
  flex: 1 1 auto;
}

.itops-page .it-head > .it-btn.primary {
  height: 28px;
  font-size: 12.5px;
  line-height: 1;
}
.itops-page .it-side-head {
  min-height: 44px;
  border-bottom: 1px solid var(--hairline);
  flex: 0 0 auto;
  overflow: visible;
}
.itops-page .it-side-head .it-head-txt {
  flex: 1 1 auto;
}
.itops-page .it-side-head .icon-button {
  width: 27px;
  height: 27px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
}
.itops-page .it-side-head .icon-button:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.itops-page .hg-dlg-help {
  margin: 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.itops-page .it-btn {
  --button-shadow-color: var(--border-strong);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border-radius: 9px;
  border: 0.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 580;
  cursor: pointer;
  box-shadow: var(--button-shadow);
  transition: background 0.12s, transform 0.05s;
  white-space: nowrap;
}
.itops-page .it-btn:hover {
  background: var(--hover);
}
.itops-page .it-btn:active {
  transform: translateY(0.5px);
}
.itops-page .it-btn.primary {
  --button-shadow-color: var(--accent);
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--button-shadow);
}
.itops-page .it-btn.primary:hover {
  background: var(--accent-press);
}
.itops-page .it-btn .it-btn-ic {
  display: inline-flex;
  margin-left: -2px;
}
.itops-page .it-btn.ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--text-2);
}
.itops-page .it-btn.ghost:hover {
  background: var(--hover);
  color: var(--text);
}
/* Back affordance sits at the start of the report banner top row. */
.itops-page .br-back {
  height: 28px;
  padding: 0 10px 0 6px;
  margin-right: 4px;
}
.itops-page .br-report-meta {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-3);
}

.itops-page .it-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex: 0 0 auto;
  background: var(--bg);
  border: 0.5px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: background 0.12s, color 0.12s;
}
.itops-page .it-icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.itops-page .it-icon-btn.accent {
  color: var(--accent);
}

/* ---- tab bar ---- */
.itops-page .it-tabs {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  display: flex;
  align-self: stretch;
  align-items: stretch;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 52%;
  overflow-x: auto;
  gap: 2px;
  padding: 0;
  background: transparent;
  border-bottom: 0;
  scrollbar-width: none;
  transform: translateX(-50%);
}

.itops-page .it-tabs::-webkit-scrollbar {
  display: none;
}
.itops-page .it-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 4px;
  margin: 0 10px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  transition: color 0.12s;
}
.itops-page .it-tab:first-child {
  margin-left: 0;
}
.itops-page .it-tab:hover {
  color: var(--text);
}
.itops-page .it-tab.active {
  color: var(--text);
  font-weight: 640;
}
.itops-page .it-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
}
.itops-page .it-tab .it-tab-ic {
  display: inline-flex;
  color: var(--text-3);
}
.itops-page .it-tab.active .it-tab-ic {
  color: var(--accent);
}
.itops-page .it-tab .it-tab-badge {
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.itops-page .it-tab.active .it-tab-badge {
  background: var(--accent-soft);
  color: var(--accent);
}
.itops-page .it-tab-badge.live {
  background: var(--accent);
  color: #fff;
}

/* ---- content scroll ---- */
.itops-page .it-content {
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-2);
}
.itops-page .it-content::-webkit-scrollbar {
  width: 11px;
}
.itops-page .it-content::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-3) 45%, transparent);
  border-radius: 7px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

/* shared chips/badges ---------------------------------------------------- */
.itops-page .tport {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px 0 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  flex: 0 0 auto;
}
.itops-page .tport .tport-ic {
  display: inline-flex;
}
.itops-page .tport.ssh {
  background: color-mix(in srgb, var(--green) 15%, transparent);
  color: var(--green);
}
.itops-page .tport.winrm {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.itops-page .tport.psexec {
  background: color-mix(in srgb, #bf5af2 18%, transparent);
  color: #a855e8;
}
.itops-page .tport.auto {
  background: var(--muted);
  color: var(--text-2);
}

.itops-page .tile {
  flex: 0 0 auto;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.18), 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* ====================================================================== */
/* HOST GROUPS                                                            */
/* ====================================================================== */
.itops-page .hg {
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}
.itops-page .hg-list {
  border-right: 1px solid var(--hairline);
  background: var(--bg);
  overflow-y: auto;
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.itops-page .hg-list-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 8px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.itops-page .hg-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--r-row);
  cursor: pointer;
  border: 0.5px solid transparent;
  text-align: left;
  background: transparent;
  font: inherit;
  color: var(--text);
  width: 100%;
  transition: background 0.12s;
}
.itops-page .hg-item:hover {
  background: var(--hover);
}
.itops-page .hg-item.active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.itops-page .hg-item .tile {
  width: 30px;
  height: 30px;
}
.itops-page .hg-item-txt {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.itops-page .hg-item-txt .nm {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itops-page .hg-item-txt .meta {
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itops-page .hg-item .cnt {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.itops-page .hg-item.active .cnt {
  color: var(--accent);
}
.itops-page .hg-item .dyn {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--amber);
  background: var(--amber-soft);
  padding: 2px 5px;
  border-radius: 5px;
  flex: 0 0 auto;
}

/* detail */
.itops-page .hg-detail {
  overflow-y: auto;
  padding: var(--pad);
  background: var(--bg-2);
}
/* Unified compact detail toolbar (site identity + breadcrumb + actions). */
.itops-page .hg-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  margin: -4px -4px 12px;
  padding: 0 4px 11px;
  border-bottom: 1px solid var(--hairline);
}
.itops-page .hg-bar-tile {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #fff;
}
.itops-page .hg-bar-name {
  font-size: 14px;
  font-weight: 660;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itops-page .hg-bar .ft-breadcrumb {
  flex: 0 1 auto;
  min-width: 0;
}
.itops-page .hg-bar .seg {
  margin-right: 2px;
}
.itops-page .hg-detail-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: -4px -4px 14px;
  padding: 0 4px 13px;
  border-bottom: 1px solid var(--hairline);
}
.itops-page .hg-detail-head .tile {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.itops-page .hg-detail-head .nm {
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.015em;
}
.itops-page .hg-detail-head .sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 1px;
}

.itops-page .it-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 4px 2px 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.itops-page .it-section-label .ct {
  color: var(--text-2);
}

.itops-page .card {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.itops-page .card + .it-section-label {
  margin-top: 20px;
}

/* transport default row */
.itops-page .hg-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
}
.itops-page .hg-opt + .hg-opt {
  border-top: 1px solid var(--hairline);
}
.itops-page .hg-opt .ic {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--muted);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.itops-page .hg-opt-txt {
  flex: 1 1 auto;
  min-width: 0;
}
.itops-page .hg-opt-txt .t {
  font-size: 13px;
  font-weight: 600;
}
.itops-page .hg-opt-txt .d {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 1px;
}

/* Finder segmented control (mirrors .sftp-segmented). */
.itops-page .seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border-radius: 8px;
  background: var(--surface-muted);
  box-shadow: inset 0 0 0 0.5px var(--border);
  flex: 0 0 auto;
}
.itops-page .seg button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 560;
  color: var(--text-muted);
  padding: 4px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.itops-page .seg button:hover {
  color: var(--text);
}
.itops-page .seg button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
}

.itops-page .filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--muted);
  color: var(--text);
  font-size: 12px;
  font-weight: 560;
}
.itops-page .filter-pill .k {
  color: var(--text-3);
  font-weight: 600;
}

/* member rows */
.itops-page .member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
}
.itops-page .member + .member {
  border-top: 1px solid var(--hairline);
}
.itops-page .member .tile {
  width: 30px;
  height: 30px;
  background: linear-gradient(160deg, #4a4e57, #2a2c32);
}
.itops-page .member-txt {
  flex: 1 1 auto;
  min-width: 0;
}
.itops-page .member-txt .nm {
  font-size: 13px;
  font-weight: 600;
}
.itops-page .member-txt .host {
  font-size: 11.5px;
  color: var(--text-2);
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
}
.itops-page .member .os {
  font-size: 11.5px;
  color: var(--text-3);
  flex: 0 0 auto;
  margin-right: 4px;
}
.itops-page .member .x {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.itops-page .member .x:hover {
  background: var(--press);
  color: var(--text);
}
/* A recent-run row rendered as a button that opens its saved Run Report. */
.itops-page .member.as-button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.itops-page .member.as-button:hover {
  background: var(--hover);
}
.itops-page .member-go {
  flex: 0 0 auto;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
}
.itops-page .member.as-button:hover .member-go {
  color: var(--text);
}
.itops-page .member-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border-top: 1px solid var(--hairline);
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  width: 100%;
  font-family: inherit;
}
.itops-page .member-add:hover {
  background: var(--hover);
}

/* ====================================================================== */
/* BATCH RUNS (hero)                                                      */
/* ====================================================================== */
.itops-page .br {
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* run summary banner */
.itops-page .br-banner {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--card-shadow);
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.itops-page .br-banner .lead {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.itops-page .br-banner .toprow {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.itops-page .br-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 23px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  flex: 0 0 auto;
}
.itops-page .br-state .sdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.itops-page .br-state.live {
  background: var(--accent-soft);
  color: var(--accent);
}
.itops-page .br-state.live .sdot {
  animation: itpulse 1.3s ease-in-out infinite;
}
.itops-page .br-state.done {
  background: var(--green-soft);
  color: var(--green);
}
.itops-page .br-state.done-fail {
  background: var(--amber-soft);
  color: var(--amber);
}
@keyframes itpulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 currentColor;
  }
  50% {
    opacity: 0.45;
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  .itops-page .br-state.live .sdot {
    animation: none;
  }
}

.itops-page .br-banner .grpname {
  font-size: 13px;
  font-weight: 650;
}
.itops-page .br-banner .grpname .arrow {
  color: var(--text-3);
  margin: 0 3px;
}
.itops-page .br-banner .grpname .count {
  color: var(--text-2);
  font-weight: 500;
}
.itops-page .br-cmd {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text-2);
  background: var(--muted);
  border-radius: 7px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-width: 0;
}
.itops-page .br-cmd .dollar {
  color: var(--text-3);
}
.itops-page .br-cmd .body {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.itops-page .br-banner .stat-cluster {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 0 0 auto;
}
.itops-page .br-stat {
  text-align: center;
}
.itops-page .br-stat .num {
  font-size: 22px;
  font-weight: 740;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.itops-page .br-stat .lab {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 5px;
}
.itops-page .br-stat.ok .num {
  color: var(--green);
}
.itops-page .br-stat.fail .num {
  color: var(--red);
}
.itops-page .br-stat.run .num {
  color: var(--accent);
}
.itops-page .br-banner .actions {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
}

/* progress bar */
.itops-page .br-progress {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.itops-page .br-progress .track {
  height: 7px;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
  display: flex;
}
.itops-page .br-progress .fill-ok {
  background: var(--green);
}
.itops-page .br-progress .fill-fail {
  background: var(--red);
}
.itops-page .br-progress .fill-run {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 75%, transparent), var(--accent));
  position: relative;
  overflow: hidden;
}
.itops-page .br-progress .fill-run::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: itshimmer 1.4s linear infinite;
}
@keyframes itshimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .itops-page .br-progress .fill-run::after {
    animation: none;
  }
}
.itops-page .br-progress .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-2);
}
.itops-page .br-progress .meta .legend {
  display: flex;
  gap: 14px;
}
.itops-page .br-progress .meta .lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.itops-page .br-progress .meta .lg i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.itops-page .br-progress .meta .lg.ok i {
  background: var(--green);
}
.itops-page .br-progress .meta .lg.fail i {
  background: var(--red);
}
.itops-page .br-progress .meta .lg.run i {
  background: var(--accent);
}
.itops-page .br-progress .meta .lg.pend i {
  background: var(--border-strong);
}

/* per-host grid */
.itops-page .br-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.itops-page .host-card {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: border-color 0.15s;
}
.itops-page .host-card.failed {
  border-color: color-mix(in srgb, var(--red) 45%, var(--border));
}
.itops-page .host-card.running {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.itops-page .host-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--text);
  text-align: left;
}
.itops-page .host-row:hover {
  background: var(--hover);
}
.itops-page .host-row .chev {
  color: var(--text-3);
  flex: 0 0 auto;
  transition: transform 0.18s;
}
.itops-page .host-row.open .chev {
  transform: rotate(90deg);
}

.itops-page .st-badge {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.itops-page .st-badge.ok {
  background: var(--green);
}
.itops-page .st-badge.failed {
  background: var(--red);
}
.itops-page .st-badge.running {
  background: var(--accent);
}
.itops-page .st-badge.pending {
  background: var(--border-strong);
  color: var(--bg);
}
.itops-page .st-badge.running svg {
  animation: itspin 0.9s linear infinite;
}
@keyframes itspin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .itops-page .st-badge.running svg {
    animation: none;
  }
}

.itops-page .host-row .hname {
  font-size: 13.5px;
  font-weight: 640;
  flex: 0 0 auto;
}
.itops-page .host-row .haddr {
  font-size: 11.5px;
  color: var(--text-2);
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  flex: 0 0 auto;
}
.itops-page .host-row .hsp {
  flex: 1 1 auto;
  min-width: 8px;
}
.itops-page .host-row .hnote {
  font-size: 11.5px;
  color: var(--red);
  flex: 0 0 auto;
}
.itops-page .host-row .hdur {
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  min-width: 44px;
  text-align: right;
}
.itops-page .host-row .hcode {
  font-size: 10.5px;
  font-weight: 700;
  font-family: "SF Mono", ui-monospace, monospace;
  padding: 2px 7px;
  border-radius: 6px;
  flex: 0 0 auto;
  min-width: 56px;
  text-align: center;
}
.itops-page .host-row .hcode.ok {
  background: var(--green-soft);
  color: var(--green);
}
.itops-page .host-row .hcode.fail {
  background: var(--red-soft);
  color: var(--red);
}
.itops-page .host-row .hcode.run {
  background: var(--accent-soft);
  color: var(--accent);
}
.itops-page .host-row .hcode.pend {
  background: var(--muted);
  color: var(--text-3);
}

/* expanded streamed output (terminal surface) */
.itops-page .host-out {
  background: linear-gradient(180deg, var(--term), var(--term-2));
  border-top: 0.5px solid var(--term-border);
  padding: 11px 15px 13px;
  font-family: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--term-text);
  max-height: 220px;
  overflow-y: auto;
}
.itops-page .host-out::-webkit-scrollbar {
  width: 8px;
}
.itops-page .host-out::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--term-dim) 50%, transparent);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.itops-page .host-out .line {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}
.itops-page .host-out .c-key {
  color: var(--c-key);
}
.itops-page .host-out .c-val {
  color: var(--c-val);
}
.itops-page .host-out .c-cm {
  color: var(--c-cm);
}
.itops-page .host-out .c-prompt {
  color: var(--c-prompt);
  font-weight: 600;
}
.itops-page .host-out .c-path {
  color: var(--c-path);
}
.itops-page .host-out .c-warn {
  color: var(--c-warn);
}
.itops-page .host-out .c-err {
  color: var(--c-err);
}
.itops-page .host-out .c-dim {
  color: var(--term-dim);
}
.itops-page .host-out .cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  vertical-align: text-bottom;
  background: var(--c-prompt);
  margin-left: 2px;
  border-radius: 1px;
  animation: itblink 1.1s steps(1) infinite;
}
@keyframes itblink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .itops-page .host-out .cursor {
    animation: none;
  }
}

/* report footer note */
.itops-page .br-saved {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--card-shadow);
  color: var(--text-2);
  font-size: 12.5px;
}
.itops-page .br-saved .ic {
  color: var(--text-3);
  display: inline-flex;
}
.itops-page .br-saved b {
  color: var(--text);
  font-weight: 620;
}
.itops-page .br-saved .sp {
  flex: 1 1 auto;
}

/* ====================================================================== */
/* AUTOMATIONS                                                            */
/* ====================================================================== */
.itops-page .au {
  padding: var(--pad);
}
.itops-page .au-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.itops-page .au-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  text-align: left;
  width: 100%;
  font: inherit;
  color: var(--text);
}
.itops-page .au-row:hover {
  border-color: var(--border-strong);
}
.itops-page .au-row.off {
  opacity: 0.62;
}
.itops-page .au-row .tile {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.itops-page .au-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.itops-page .au-main .nm {
  font-size: 13.5px;
  font-weight: 640;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itops-page .au-flow {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--text-2);
  font-size: 11.5px;
}
.itops-page .au-flow .arrow {
  color: var(--text-3);
  display: inline-flex;
}
.itops-page .au-flow .cond {
  font-weight: 650;
  color: var(--text);
  background: var(--muted);
  padding: 1px 7px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
.itops-page .au-acts {
  display: inline-flex;
  gap: 3px;
}
.itops-page .au-acts .a {
  width: 21px;
  height: 21px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.itops-page .au-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}
.itops-page .au-fired {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}
.itops-page .au-fired.armed {
  color: var(--green);
  font-weight: 600;
}
.itops-page .au-del {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.itops-page .au-del:hover {
  background: var(--press);
  color: var(--red);
}

/* armed toggle */
.itops-page .au-toggle {
  position: relative;
  width: 36px;
  height: 21px;
  border: 0;
  border-radius: 999px;
  background: var(--border-strong);
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  transition: background 0.15s;
}
.itops-page .au-toggle[data-on="1"] {
  background: var(--green);
}
.itops-page .au-toggle i {
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}
.itops-page .au-toggle[data-on="1"] i {
  transform: translateX(15px);
}

/* ---- builder ---- */
.itops-page .bld {
  padding: var(--pad);
  max-width: 760px;
  margin: 0 auto;
}
.itops-page .bld-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px 0 7px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 7px;
  margin-bottom: 14px;
}
.itops-page .bld-back:hover {
  background: var(--hover);
}
.itops-page .bld-back svg {
  transform: rotate(180deg);
}

.itops-page .bld-titlerow {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
}
.itops-page .bld-titlerow .tile {
  width: 42px;
  height: 42px;
  border-radius: 11px;
}
.itops-page .bld-titlerow .nm {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.itops-page .bld-titlerow .st {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.itops-page .bld-titlerow .st .d {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* flow stages connected by a rail */
.itops-page .stage {
  position: relative;
  padding-left: 38px;
}
.itops-page .stage::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--hairline);
}
.itops-page .stage:first-of-type::before {
  top: 16px;
}
.itops-page .stage:last-of-type::before {
  bottom: calc(100% - 16px);
}
.itops-page .stage-dot {
  position: absolute;
  left: 7px;
  top: 9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.itops-page .stage-dot.filled {
  border-color: var(--accent);
  background: var(--accent);
}
.itops-page .stage-dot i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.itops-page .stage-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 11px 0 8px;
}
.itops-page .stage:first-of-type .stage-kicker {
  padding-top: 2px;
}

.itops-page .bld-card {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--card-shadow);
  padding: 14px 15px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.itops-page .bld-card .tile {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.itops-page .bld-card-txt {
  flex: 1 1 auto;
  min-width: 0;
}
.itops-page .bld-card-txt .t {
  font-size: 13.5px;
  font-weight: 640;
}
.itops-page .bld-card-txt .d {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}
.itops-page .bld-card .meta-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--muted);
  padding: 4px 9px;
  border-radius: 7px;
  flex: 0 0 auto;
}
.itops-page .bld-card .grab {
  color: var(--text-3);
  cursor: grab;
  flex: 0 0 auto;
}

.itops-page .cond-card {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--card-shadow);
  padding: 14px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.itops-page .cond-card .lhs {
  font-size: 13px;
  font-weight: 600;
}
.itops-page .cond-card .op {
  background: var(--muted);
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.itops-page .cond-card .rhs {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.itops-page .cond-card .note {
  color: var(--text-3);
  font-size: 11.5px;
  margin-left: 4px;
}

.itops-page .bld-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px;
  margin-top: 8px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-card);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.itops-page .bld-add:hover {
  background: var(--hover);
  color: var(--text);
  border-color: var(--accent);
}
.itops-page .stage-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ====================================================================== */
/* EMPTY STATE                                                            */
/* ====================================================================== */
.itops-page .it-empty {
  height: 100%;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  text-align: center;
  padding: 40px;
}
.itops-page .it-empty .glyph {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(160deg, #3a3d45, #1d1f24);
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.5), inset 0 0 0 0.5px rgba(255, 255, 255, 0.12);
}
.itops-page .it-empty h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.itops-page .it-empty p {
  margin: -5px 0 0;
  font-size: 13px;
  color: var(--text-2);
  max-width: 44ch;
}
.itops-page .it-empty .it-btn {
  margin-top: 6px;
}

/* ====================================================================== */
/* HOST GROUP DIALOG (portaled to body — not scoped under .itops-page)    */
/* ====================================================================== */
.hg-dlg-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  background: var(--surface-muted);
  align-self: flex-start;
}
.hg-dlg-seg button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.hg-dlg-seg button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.hg-dlg-list {
  display: flex;
  flex-direction: column;
  max-height: 280px;
  overflow-y: auto;
  border: 0.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.hg-dlg-empty {
  padding: 22px 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}
.hg-dlg-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.hg-dlg-row + .hg-dlg-row {
  border-top: 1px solid var(--hairline);
}
.hg-dlg-row:hover {
  background: var(--hover);
}
.hg-dlg-check {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.hg-dlg-row.checked .hg-dlg-check {
  background: var(--accent);
  border-color: var(--accent);
}
.hg-dlg-row-txt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.hg-dlg-row-txt .nm {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hg-dlg-row-txt .host {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hg-dlg-type {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--surface-muted);
  padding: 2px 7px;
  border-radius: 5px;
}

/* automation action-list editor (portaled dialog) */
.au-act-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.au-act {
  border: 0.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.au-act-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.au-act-head .kk-sel {
  flex: 1 1 auto;
}
.au-act-rm {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.au-act-rm:hover {
  background: var(--press);
  color: var(--red);
}
.au-act-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.au-act-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 9px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.au-act-add:hover {
  background: var(--hover);
  color: var(--text);
  border-color: var(--accent);
}

/* ===================== Automation node editor (n8n-style) =====================
   Portaled to <body> via DialogShell, so these rules are global (NOT scoped
   under .itops-page) and read the shared scheme tokens directly. */
.au-editor {
  width: 92vw;
  max-width: 1180px;
  height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 64px -24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.au-editor-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  flex: 0 0 auto;
}
.au-editor-tile {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000));
  flex: 0 0 auto;
}
.au-editor-name {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  padding: 4px 2px;
  outline: none;
}
.au-editor-name::placeholder {
  color: var(--text-faint);
}
.au-editor-sp {
  flex: 1 1 auto;
}
/* Header Site binding select: fixed-width so the name input keeps the room. */
.au-editor-site {
  flex: 0 0 auto;
  width: 180px;
}
.au-editor-head .au-btn-ic {
  display: inline-flex;
  margin-right: 5px;
  vertical-align: -2px;
}
.au-editor-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}
.au-canvas {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  background: var(--surface-muted);
}
.au-canvas .react-flow {
  width: 100%;
  height: 100%;
}
.au-canvas .react-flow__attribution {
  display: none;
}
.au-side {
  flex: 0 0 326px;
  border-left: 1px solid var(--hairline);
  overflow-y: auto;
  padding: 16px;
  background: var(--surface);
}
.au-side-in {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.au-side-title {
  font-size: 13px;
  font-weight: 680;
  letter-spacing: 0.01em;
}
.au-side-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* node card */
.au-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 184px;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 6px 16px -10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.au-node.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}
.au-node-ic {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: 0 0 auto;
}
.au-node-tx {
  flex: 1 1 auto;
  min-width: 0;
}
.au-node-lab {
  font-size: 12.5px;
  font-weight: 640;
  line-height: 1.2;
}
.au-node-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
}
.au-node-del {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-faint);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.au-node:hover .au-node-del {
  display: inline-flex;
}
.au-node-del:hover {
  color: var(--red);
  border-color: var(--red);
}
.au-handle.react-flow__handle {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border: 1.5px solid var(--surface);
}
.au-edge .react-flow__edge-path {
  stroke: var(--border-strong);
  stroke-width: 1.5;
}
.react-flow__arrowhead {
  fill: var(--border-strong);
}

/* test-result card */
.au-test {
  border: 0.5px solid var(--border);
  border-radius: 11px;
  background: var(--surface-muted);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.au-test-head {
  font-size: 12.5px;
  font-weight: 680;
}
.au-test-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.au-test-row .k {
  color: var(--text-muted);
}
.au-test-row .v.mono {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
}
.au-fire {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 620;
}
.au-fire.yes {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 15%, transparent);
}
.au-fire.no {
  color: var(--text-muted);
  background: var(--press);
}
.au-test-note {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.45;
}
.au-test-acts-label {
  font-size: 11px;
  font-weight: 640;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.au-test-acts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.au-test-act {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.au-test-act .ic {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: 0 0 auto;
}
.au-test-act .tx {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.au-test-empty {
  font-size: 12px;
  color: var(--text-faint);
}

/* ── Site Rack View (docs/SITE.md Phase C) ──────────────────────────────── */
.itops-page .rk-canvas {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: auto;
  padding: 2px 2px 10px;
}
.itops-page .rk-region-h {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}
.itops-page .rk-area {
  margin-bottom: 14px;
}
.itops-page .rk-area-h {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 8px 2px;
}
.itops-page .it-scope-note {
  margin: -4px 0 10px;
  padding: 6px 10px;
  border-radius: var(--r-row);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 560;
}
.itops-page .rk-row {
  display: flex;
  flex-wrap: wrap;
  row-gap: 16px;
  column-gap: 0;
  align-items: flex-start;
  padding: 4px 18px 22px 4px;
}
/* ──────────────────────────────────────────────────────────────────────────
   Rack elevation — skeuomorphic frame + animated device faceplates, ported
   from the "IT Ops Racks" design comp. Hardware greys are a fixed physical
   palette (`--rkd-*`, like the scheme-independent terminal surfaces); all
   status/accent colour reads the shared theme tokens.
   ────────────────────────────────────────────────────────────────────────── */
.itops-page .rk {
  --rk-u: 26px;
  /* Fixed hardware palette — physical equipment greys, not theme tokens. The
     default is Metallic Black; cabinet/device `data-shell` attrs override these
     vars for Milky White / Metal Grey finishes. */
  --rkd-face-top: #313134;
  --rkd-face-mid: #28282b;
  --rkd-face-bot: #222225;
  --rkd-ear-a: #1c1c1e;
  --rkd-ear-b: #2a2a2d;
  --rkd-line: #3a3a3d;
  --rkd-well: #161618;
  --rkd-slot: #141416;
  --rkd-hi: #48484c;
  --rkd-dim: #2c2c30;
  --rkd-cell-off: #1a1a1c;
  --rkd-text: #f5f5f7;
  --rkd-text-muted: #a1a1a6;
  /* Cabinet frame finish (black default). */
  --rk-frame-top: #1e1e21;
  --rk-frame-bot: #161618;
  --rk-frame-border: #38383a;
  --rk-rail-a: #2a2a2d;
  --rk-rail-b: #202022;
  flex: 0 0 auto;
  width: 300px;
}
/* ── Cabinet shell finishes (frame only; devices default to metallic black) ── */
.itops-page .rk[data-shell="white"] {
  --rk-frame-top: #e4e4e7;
  --rk-frame-bot: #d2d2d7;
  --rk-frame-border: #c2c2c8;
  --rk-rail-a: #cfcfd4;
  --rk-rail-b: #bcbcc2;
}
.itops-page .rk[data-shell="grey"] {
  --rk-frame-top: #82828a;
  --rk-frame-bot: #6a6a72;
  --rk-frame-border: #58585e;
  --rk-rail-a: #74747a;
  --rk-rail-b: #62626a;
}
/* ── Per-device shell finishes (override the cabinet default for one device) ── */
.itops-page .rkd[data-shell="black"] {
  --rkd-face-top: #313134;
  --rkd-face-mid: #28282b;
  --rkd-face-bot: #222225;
  --rkd-ear-a: #1c1c1e;
  --rkd-ear-b: #2a2a2d;
  --rkd-line: #3a3a3d;
  --rkd-well: #161618;
  --rkd-slot: #141416;
  --rkd-hi: #48484c;
  --rkd-dim: #2c2c30;
  --rkd-cell-off: #1a1a1c;
  --rkd-text: #f5f5f7;
  --rkd-text-muted: #a1a1a6;
}
.itops-page .rkd[data-shell="white"] {
  --rkd-face-top: #f5f5f6;
  --rkd-face-mid: #e9e9ec;
  --rkd-face-bot: #dcdce0;
  --rkd-ear-a: #d6d6da;
  --rkd-ear-b: #ececef;
  --rkd-line: #c2c2c8;
  --rkd-well: #d2d2d7;
  --rkd-slot: #cacace;
  --rkd-hi: #b0b0b6;
  --rkd-dim: #bcbcc2;
  --rkd-cell-off: #d8d8dc;
  --rkd-text: #1a1a1c;
  --rkd-text-muted: #55555a;
}
.itops-page .rkd[data-shell="grey"] {
  --rkd-face-top: #9a9aa0;
  --rkd-face-mid: #86868c;
  --rkd-face-bot: #76767c;
  --rkd-ear-a: #6a6a70;
  --rkd-ear-b: #8a8a90;
  --rkd-line: #5e5e64;
  --rkd-well: #6e6e74;
  --rkd-slot: #646468;
  --rkd-hi: #565258;
  --rkd-dim: #6a6a70;
  --rkd-cell-off: #7a7a80;
  --rkd-text: #16161a;
  --rkd-text-muted: #3a3a40;
}
.itops-page .rk-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 0 2px;
}
.itops-page .rk-head-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
}
.itops-page .rk-name {
  font-size: 13px;
  font-weight: 660;
  letter-spacing: -0.01em;
  color: var(--text);
}
.itops-page .rk-meta {
  font-size: 10.5px;
  color: var(--text-3, var(--text-faint));
  font-variant-numeric: tabular-nums;
}
/* Status tally pills. */
.itops-page .rk-pills {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}
.itops-page .rk-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border-radius: 5px;
  padding: 2px 6px;
}
.itops-page .rk-pill .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.itops-page .rk-pill.on {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 14%, transparent);
}
.itops-page .rk-pill.on .dot {
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}
.itops-page .rk-pill.warn {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 16%, transparent);
}
.itops-page .rk-pill.warn .dot {
  background: var(--amber);
}
.itops-page .rk-pill.off {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 16%, transparent);
}
.itops-page .rk-pill.off .dot {
  background: var(--red);
}

/* Metal rack frame: rail caps top & bottom, dark bay between. */
.itops-page .rk-frame {
  position: relative;
  border-radius: 14px;
  padding: 6px;
  background: linear-gradient(180deg, var(--rk-frame-top), var(--rk-frame-bot));
  border: 0.5px solid var(--rk-frame-border);
  box-shadow:
    0 18px 30px -30px rgba(0, 0, 0, 0.85),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.05);
}
.itops-page .rk-cabinet {
  position: relative;
  margin-top: var(--rk-top-clearance, 0px);
}
.itops-page .rk-top-area {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: calc(100% - 2px);
  height: var(--rk-top-clearance, 0px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.itops-page .rk-top-item {
  position: relative;
  width: min(150px, 100%);
  pointer-events: auto;
}
.itops-page .rk-top-area > .rk-place-ghost {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
}
.itops-page .rk-top-item-main {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.itops-page .rk-top-item-delete {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0.5px solid color-mix(in srgb, var(--red) 44%, var(--border));
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--red);
  cursor: pointer;
}
.itops-page .rk-rail {
  height: 7px;
  border-radius: 5px;
  background: repeating-linear-gradient(90deg, var(--rk-rail-a) 0 7px, var(--rk-rail-b) 7px 11px);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
}
.itops-page .rk-bay {
  display: flex;
  gap: 6px;
  margin: 9px 0;
}
.itops-page .rk-grid {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) 7px;
  column-gap: 2px;
  flex: 1 1 auto;
}
.itops-page .rk-u {
  grid-column: 1;
  align-self: center;
  text-align: right;
  padding-right: 1px;
  font-size: 8px;
  font-family: var(--app-mono-font-family, monospace);
  font-variant-numeric: tabular-nums;
  color: var(--rkd-hi);
  user-select: none;
}
/* Empty U slot — recessed vented blanking area. */
.itops-page .rk-slot {
  grid-column: 2;
  margin: 1.5px 0;
  border-radius: 4px;
  background: repeating-linear-gradient(
    45deg,
    transparent 0 5px,
    rgba(255, 255, 255, 0.03) 5px 6px
  );
  border: 0.5px dashed rgba(255, 255, 255, 0.07);
}
/* Device wrapper — positioned over the slot grid; the faceplate paints itself. */
.itops-page .rk-item {
  grid-column: 2;
  position: relative;
  min-width: 0;
  max-width: 100%;
  margin: 1.5px 0;
  z-index: 1;
}

/* ── Rack View editing affordances (docs/SITE.md Phase C, dialogs-first) ──── */
/* Small icon buttons read as flat Finder toolbar buttons (no border/elevation). */
.itops-page .it-icon-btn.sm {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--text-muted);
}
.itops-page .it-icon-btn.sm:active {
  background: var(--press);
}
.itops-page .it-icon-btn.sm.danger {
  color: var(--red);
}
.itops-page .it-icon-btn.sm.danger:hover {
  background: color-mix(in srgb, var(--red) 13%, transparent);
}
.itops-page .it-btn.sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.itops-page .rk-slot-btn {
  position: relative;
  cursor: pointer;
  padding: 0;
  overflow: visible;
  transition: background 0.12s, border-color 0.12s;
}
.itops-page .rk-slot-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
/* Rack View slots outside an armed placement: drop targets only — no add
   affordance (adding goes through the picker column), so hover keeps the
   resting slot look. */
.itops-page .rk-slot-btn.passive {
  cursor: default;
}
.itops-page .rk-slot-btn.passive:hover {
  border-color: rgba(255, 255, 255, 0.07);
  background: repeating-linear-gradient(
    45deg,
    transparent 0 5px,
    rgba(255, 255, 255, 0.03) 5px 6px
  );
}
.itops-page .rk-slot-callout {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  z-index: 20;
  transform: translate(4px, -50%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-control);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  transition:
    opacity 0.12s,
    transform 0.12s,
    border-color 0.12s;
}
.itops-page .rk-slot-callout::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%) rotate(45deg);
  background: var(--surface);
  border-left: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
}
.itops-page .rk-slot-btn:hover .rk-slot-callout,
.itops-page .rk-slot-btn:focus-visible .rk-slot-callout {
  opacity: 1;
  transform: translate(0, -50%);
  border-color: var(--border-strong);
}

/* ── Armed device placement (Rack View picker) ──
   The configured faceplate ghosts under the cursor snapped to the hovered U;
   placed items stop intercepting the pointer so the whole column stays a
   live drop surface, and the span turns red where it would overlap. */
.itops-page .rk-grid.placing .rk-item-row {
  pointer-events: none;
}
.itops-page .rk-grid.placing .rk-slot-btn {
  cursor: copy;
}
.itops-page .rk-grid.placing .rk-slot-callout {
  display: none;
}
.itops-page .rk-place-ghost {
  pointer-events: none;
  position: relative;
  z-index: 21;
  opacity: 0.8;
  border-radius: 4px;
  outline: 1.5px dashed var(--accent);
  outline-offset: 1px;
}
.itops-page .rk-place-ghost.blocked {
  opacity: 0.4;
  outline-color: var(--red);
}
.rk-cursor-ghost {
  position: fixed;
  z-index: 120;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.78;
  border-radius: 5px;
  outline: 1.5px dashed var(--accent);
  outline-offset: 2px;
  filter: drop-shadow(0 10px 18px rgb(0 0 0 / 28%));
}
.rm-cursor-ghost {
  position: fixed;
  z-index: 120;
  width: 62px;
  height: 62px;
  padding: 5px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--obj, var(--text-muted));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1.5px dashed var(--accent);
  border-radius: 7px;
  opacity: 0.82;
  filter: drop-shadow(0 10px 18px rgb(0 0 0 / 28%));
}
.rm-cursor-ghost.iso {
  width: 96px;
  height: 112px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  opacity: 1;
  filter: none;
}
.rm-cursor-ghost .rm-object-art,
.rm-cursor-ghost-rack {
  display: block;
  width: 100%;
  height: 100%;
}
.rm-cursor-ghost-rack {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-muted);
}

/* ── Rack item open/edit affordances + ghost ─────────────────────────────── */
.itops-page .rk-item-main {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
/* Floating pencil revealed on hover over the device. */
.itops-page .rk-item-edit {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--rkd-face-mid) 88%, transparent);
  border: 0.5px solid var(--rkd-line);
  color: var(--text);
  cursor: pointer;
  z-index: 7;
}
.itops-page .rk-item-row:hover .rk-item-edit {
  display: inline-flex;
}
.itops-page .rk-item.ghost {
  opacity: 0.5;
}
.itops-page .rk-item.ghost .rkd {
  filter: grayscale(0.7);
}
.itops-page .rk-ghost-badge {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--red);
  background: color-mix(in srgb, var(--red) 18%, transparent);
  border-radius: 4px;
  padding: 1px 5px;
  z-index: 6;
}
.itops-page .rk-item-row.draggable {
  cursor: grab;
}
.itops-page .rk-item-row.draggable:active {
  cursor: grabbing;
}
.itops-page .rk-slot-btn:where(:hover) {
  outline: 1px dashed color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: -1px;
}

/* ──────────────────────────────────────────────────────────────────────────
   Device faceplate (RackDevice) + keyframes.
   ────────────────────────────────────────────────────────────────────────── */
@keyframes rkInsertIn {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes rkLedBreathe {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.42;
  }
}
@keyframes rkLedBlink {
  0%,
  46% {
    opacity: 1;
  }
  50%,
  96% {
    opacity: 0.16;
  }
  100% {
    opacity: 1;
  }
}
@keyframes rkPortBlink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.12;
  }
  100% {
    opacity: 1;
  }
}
@keyframes rkFanSpin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes rkShimmer {
  0% {
    transform: translateX(-130%);
  }
  100% {
    transform: translateX(130%);
  }
}
@keyframes rkFwBar {
  0%,
  100% {
    transform: scaleY(0.28);
  }
  50% {
    transform: scaleY(1);
  }
}
@keyframes rkChargePulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.itops-page .rk-item.dev-in {
  animation: rkInsertIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Faceplate shell. */
.itops-page .rkd {
  position: relative;
  height: 100%;
  width: 100%;
  min-height: min(22px, calc(var(--rk-u, 26px) - 3px));
  box-sizing: border-box;
  border-radius: 6px;
  border: 0.5px solid var(--rkd-line);
  overflow: hidden;
  display: flex;
  align-items: stretch;
  background: linear-gradient(
    180deg,
    var(--rkd-face-top) 0%,
    var(--rkd-face-mid) 48%,
    var(--rkd-face-bot) 100%
  );
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 0.5px rgba(0, 0, 0, 0.4),
    0 1px 2px rgba(0, 0, 0, 0.45);
  /* Text tracks the shell, not the app scheme — the faceplate is always a
     physical finish (dark metal = light text; white/grey metal = black text). */
  color: var(--rkd-text);
  transition: transform 0.16s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.16s;
}
.itops-page .rkd[data-form-factor="tower"] {
  width: 50%;
  margin-inline: auto;
}
.itops-page .rkd[data-form-factor="tower"] .rkd-id {
  flex: 1 1 auto;
  min-width: 0;
}
.itops-page .rkd[data-form-factor="tower"] .rkd-visual {
  flex: 0 1 44px;
}
.itops-page .rkd[data-form-factor="tower"] .rkd-disks-row {
  flex-basis: 44px;
  min-width: 0;
}
.itops-page .rkd[data-form-factor="tower"] .rkd-vent,
.itops-page .rkd[data-form-factor="tower"] .rkd-fans {
  display: none;
}
.itops-page .rkd[data-compact="true"] .rkd-id {
  flex: 1 1 auto;
}
.itops-page .rkd[data-compact="true"] .rkd-visual {
  flex: 0 1 52px;
}
.itops-page .rkd[data-compact="true"] .rkd-vent,
.itops-page .rkd[data-compact="true"] .rkd-fans,
.itops-page .rkd[data-compact="true"] .rkd-equip-label {
  display: none;
}
.itops-page .rk-item-row:hover .rkd {
  transform: translateY(-1px);
  box-shadow:
    0 8px 20px -6px rgba(0, 0, 0, 0.7),
    0 0 0 1px color-mix(in srgb, var(--rkd-accent, var(--accent)) 70%, transparent),
    0 0 26px -8px var(--rkd-accent, var(--accent));
}
.itops-page .rkd-ear {
  flex: 0 0 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  background: linear-gradient(90deg, var(--rkd-ear-a), var(--rkd-ear-b));
  border-right: 0.5px solid #151517;
}
.itops-page .rkd-ear-bolt {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #5a5a5e, #1a1a1c);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.6);
}
.itops-page .rkd-body {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  min-width: 0;
  position: relative;
}
.itops-page .rkd-leds {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}
.itops-page .rkd-leds > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.itops-page .rkd-id {
  flex: 0 1 138px;
  min-width: 48px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.1;
}
.itops-page .rkd-name {
  font-size: 11.5px;
  font-weight: 640;
  letter-spacing: -0.01em;
  color: var(--rkd-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itops-page .rkd-sub {
  font-family: var(--app-mono-font-family, monospace);
  font-size: 9px;
  color: var(--rkd-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itops-page .rkd-visual {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
/* LED + activity animation classes (scoped to the faceplate). */
.itops-page .rkd .led-ok {
  animation: rkLedBreathe 2.6s ease-in-out infinite;
}
.itops-page .rkd .led-warn {
  animation: rkLedBlink 1s steps(1, end) infinite;
}
.itops-page .rkd .blk-1 {
  animation: rkPortBlink 1.15s linear infinite;
}
.itops-page .rkd .blk-2 {
  animation: rkPortBlink 1.75s linear infinite 0.25s;
}
.itops-page .rkd .blk-3 {
  animation: rkPortBlink 0.85s linear infinite 0.4s;
}
.itops-page .rkd .blk-4 {
  animation: rkPortBlink 1.45s linear infinite 0.55s;
}
.itops-page .rkd .blk-5 {
  animation: rkPortBlink 2.1s linear infinite 0.15s;
}
.itops-page .rkd .fan {
  animation: rkFanSpin 2.6s linear infinite;
}
.itops-page .rkd .shimmer {
  animation: rkShimmer 2.6s ease-in-out infinite;
}
.itops-page .rkd .charge {
  animation: rkChargePulse 1.8s ease-in-out infinite;
}
.itops-page .rkd .fwb-1 {
  animation: rkFwBar 1.2s ease-in-out infinite;
}
.itops-page .rkd .fwb-2 {
  animation: rkFwBar 0.9s ease-in-out infinite 0.2s;
}
.itops-page .rkd .fwb-3 {
  animation: rkFwBar 1.5s ease-in-out infinite 0.4s;
}

/* Shared port / disk wells. */
.itops-page .rkd-ports {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 2px;
  max-height: 100%;
  padding: 0;
}
.itops-page .rkd-port {
  position: relative;
  width: 10px;
  height: 8px;
  border-radius: 2px;
  background: var(--rkd-slot);
  border: 0.5px solid var(--rkd-line);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1px;
}
.itops-page .rkd-port.wan {
  width: 12px;
  height: 10px;
  border-color: var(--rkd-accent);
}
.itops-page .rkd-port-led {
  width: 4px;
  height: 1.5px;
  border-radius: 1px;
}
.itops-page .rkd-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--rkd-accent) 22%, transparent),
    transparent
  );
}
.itops-page .rkd-kuaiguai,
.itops-page .rkd-switch,
.itops-page .rkd-router,
.itops-page .rkd-firewall,
.itops-page .rkd-server,
.itops-page .rkd-storage,
.itops-page .rkd-pdu,
.itops-page .rkd-ups,
.itops-page .rkd-kvm,
.itops-page .rkd-panel,
.itops-page .rkd-equip,
.itops-page .rkd-blank {
  position: relative;
  flex: 1 1 auto;
  height: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.itops-page .rkd-router {
  gap: 5px;
}
.itops-page .rkd-wan-label,
.itops-page .rkd-fw-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--rkd-accent);
  text-transform: uppercase;
}
.itops-page .rkd-divider {
  width: 0;
  height: 60%;
  border-left: 0.5px solid var(--rkd-line);
}

/* Firewall. */
.itops-page .rkd-firewall {
  gap: 10px;
}
.itops-page .rkd-fwbars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}
.itops-page .rkd-fwbar {
  width: 3px;
  height: 100%;
  border-radius: 1px;
  transform-origin: bottom;
  background: linear-gradient(
    180deg,
    var(--rkd-accent),
    color-mix(in srgb, var(--rkd-accent) 30%, transparent)
  );
}

/* Server. */
.itops-page .rkd-server {
  gap: 9px;
}
.itops-page .rkd-server-style1,
.itops-page .rkd-server-style2 {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: flex;
  align-items: stretch;
  width: auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
  background: color-mix(in srgb, var(--rkd-well) 92%, var(--rkd-face-mid));
  box-shadow: inset 0 0 0 0.5px var(--rkd-line);
}
.itops-page .rkd[data-server-panel-style="style1"] .rkd-leds,
.itops-page .rkd[data-server-panel-style="style1"] .rkd-id,
.itops-page .rkd[data-server-panel-style="style1"] .rkd-visual,
.itops-page .rkd[data-server-panel-style="style2"] .rkd-leds,
.itops-page .rkd[data-server-panel-style="style2"] .rkd-id,
.itops-page .rkd[data-server-panel-style="style2"] .rkd-visual {
  position: relative;
  z-index: 4;
}
.itops-page .rkd[data-server-panel-style="style1"] .rkd-id,
.itops-page .rkd[data-server-panel-style="style2"] .rkd-id {
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  text-align: center;
  text-shadow: 0 1px 2px rgb(0 0 0 / 92%);
}
.itops-page .rkd[data-server-panel-style="style1"] .rkd-visual,
.itops-page .rkd[data-server-panel-style="style2"] .rkd-visual {
  flex: 0 0 9%;
}

/* Style 1 — dense black drive wall under a silver hexagonal security bezel. */
.itops-page .rkd-server-style1-control,
.itops-page .rkd-server-style1-io {
  position: relative;
  z-index: 2;
  flex: 0 0 9%;
  min-width: 5px;
  background: linear-gradient(90deg, var(--rkd-face-bot), var(--rkd-line));
  box-shadow: inset -1px 0 var(--rkd-well);
}
.itops-page .rkd-server-style1-center {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  background: var(--rkd-well);
}
.itops-page .rkd-server-style1-bays {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(1px, 1fr));
  gap: 1px;
  min-width: 0;
  padding: 2px 1px;
}
.itops-page .rkd-server-style1[data-height-band="dense"] .rkd-server-style1-bays {
  grid-template-columns: repeat(4, minmax(1px, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 2px;
  padding: 4px 3px;
}
.itops-page .rkd-server-style1[data-height-band="chassis"] .rkd-server-style1-bays {
  bottom: calc(100% - var(--rkd-server-top, 40%));
  grid-template-columns: repeat(6, minmax(1px, 1fr));
  gap: 2px;
  padding: 3px;
}
.itops-page .rkd-server-style1-bay {
  position: relative;
  min-width: 0;
  border: 0.5px solid var(--rkd-hi);
  border-radius: 1px;
  background: repeating-linear-gradient(90deg, var(--rkd-slot) 0 2px, var(--rkd-well) 2px 3px);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 35%);
}
.itops-page .rkd-server-style1-bay > i {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--amber);
}
.itops-page .rkd-server-style1-lattice {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  color: color-mix(in srgb, var(--rkd-text-muted) 82%, var(--rkd-hi));
  filter: drop-shadow(0 1px 0 rgb(0 0 0 / 65%));
  pointer-events: none;
}
.itops-page .rkd-server-style1[data-height-band="chassis"] .rkd-server-style1-lattice {
  bottom: calc(100% - var(--rkd-server-top, 40%));
  height: var(--rkd-server-top, 40%);
}
.itops-page .rkd-server-style1-mark {
  fill: var(--rkd-text);
  stroke: var(--rkd-well);
  stroke-width: 1px;
}
.itops-page .rkd-server-style1-io {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: linear-gradient(90deg, var(--rkd-line), var(--rkd-face-bot));
  box-shadow: inset 1px 0 var(--rkd-well);
}
.itops-page .rkd-server-style1-io > i {
  width: 3px;
  height: 3px;
  border: 0.5px solid var(--rkd-hi);
  background: var(--rkd-slot);
}
.itops-page .rkd-server-style1-lower {
  position: absolute;
  z-index: 2;
  top: var(--rkd-server-top, 40%);
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 3px;
  padding: 7% 4% 7%;
  background:
    repeating-linear-gradient(0deg, transparent 0 5px, var(--rkd-line) 5px 6px),
    repeating-linear-gradient(90deg, var(--rkd-slot) 0 4px, var(--rkd-well) 4px 7px);
  box-shadow: inset 0 1px var(--rkd-hi);
}
.itops-page .rkd-server-style1-lower > span {
  position: relative;
  height: 86%;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--rkd-text-muted) 78%, var(--rkd-line));
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, var(--rkd-hi), var(--rkd-text-muted), var(--rkd-hi));
  box-shadow: 0 0 0 1px rgb(0 0 0 / 45%);
}
.itops-page .rkd-server-style1-lower > span.short {
  height: 62%;
}
.itops-page .rkd-server-style1-lower > span > i {
  position: absolute;
  inset: 7% 27%;
  border-radius: 1px;
  background: repeating-linear-gradient(0deg, var(--rkd-slot) 0 3px, var(--rkd-line) 3px 4px);
  box-shadow: inset 0 0 0 0.5px var(--rkd-well);
}
.itops-page .rkd[data-server-panel-style="style1"][data-server-height-band="chassis"] .rkd-id {
  position: absolute;
  top: 0;
  right: 12%;
  left: 12%;
  height: var(--rkd-server-top, 40%);
  justify-content: center;
}
.itops-page .rkd[data-server-panel-style="style1"][data-server-height-band="chassis"] .rkd-leds {
  position: absolute;
  top: calc(var(--rkd-server-top-mid, 20%) - 3.5px);
  left: 4px;
}

/* Style 2 — silver end bezels, twin rows of bays and converging grille rails. */
.itops-page .rkd-server-style2-bezel {
  position: relative;
  z-index: 3;
  flex: 0 0 9%;
  min-width: 6px;
  background: linear-gradient(90deg, var(--rkd-text-muted), var(--rkd-hi) 45%, var(--rkd-text-muted));
  box-shadow: inset 0 0 0 0.5px var(--rkd-line);
}
.itops-page .rkd-server-style2-bezel.left::after {
  position: absolute;
  inset: 18% 34%;
  border-radius: 1px;
  background: var(--rkd-well);
  content: "";
}
.itops-page .rkd-server-style2-bezel.right {
  background: linear-gradient(90deg, var(--rkd-text-muted), var(--rkd-hi) 45%, var(--rkd-text-muted));
}
.itops-page .rkd-server-style2-bezel.right::after {
  position: absolute;
  inset: 18% 30%;
  border: 0.5px solid var(--rkd-line);
  border-radius: 1px;
  background: repeating-linear-gradient(var(--rkd-slot) 0 3px, var(--rkd-hi) 3px 4px);
  content: "";
}
.itops-page .rkd-server-style2-core {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  background: var(--rkd-well);
}
.itops-page .rkd-server-style2-bays {
  position: absolute;
  left: 2%;
  right: 2%;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(1px, 1fr));
  gap: 1px;
  height: 31%;
}
.itops-page .rkd-server-style2-bays.top { top: 3%; }
.itops-page .rkd-server-style2-bays.bottom { bottom: 3%; }
.itops-page .rkd-server-style2-bays > i {
  min-width: 0;
  border: 0.5px solid var(--rkd-line);
  border-radius: 1px;
  background: repeating-linear-gradient(90deg, var(--rkd-slot) 0 2px, var(--rkd-dim) 2px 3px);
}
.itops-page .rkd-server-style2-rail {
  position: absolute;
  z-index: 2;
  left: -2%;
  right: -2%;
  height: 28%;
  background: linear-gradient(var(--rkd-hi), var(--rkd-face-bot) 28%, var(--rkd-slot));
  filter: drop-shadow(0 1px 0 rgb(0 0 0 / 70%));
}
.itops-page .rkd-server-style2-rail.upper {
  top: 23%;
  clip-path: polygon(0 0, 44% 58%, 56% 58%, 100% 0, 100% 42%, 56% 100%, 44% 100%, 0 42%);
}
.itops-page .rkd-server-style2-rail.lower {
  bottom: 23%;
  transform: scaleY(-1);
  clip-path: polygon(0 0, 44% 58%, 56% 58%, 100% 0, 100% 42%, 56% 100%, 44% 100%, 0 42%);
}
.itops-page .rkd-server-style2-badge {
  position: absolute;
  z-index: 4;
  left: 43%;
  right: 43%;
  top: 41%;
  bottom: 41%;
  min-width: 8px;
  border: 1px solid var(--green);
  background: color-mix(in srgb, var(--green) 24%, var(--rkd-slot));
  box-shadow: 0 0 5px color-mix(in srgb, var(--green) 70%, transparent);
}
.itops-page .rkd-disks-row {
  --rkd-disk-bay-h: clamp(9px, calc((100% - 5px) / 2), 18px);
  flex: 0 1 min(112px, 46%);
  height: calc(100% - 4px);
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 2px;
  min-width: 70px;
  max-height: calc(100% - 4px);
  overflow: hidden;
  padding: 1px 0;
  box-sizing: border-box;
}
.itops-page .rkd-disk-bay {
  position: relative;
  width: clamp(4px, calc((100% - 22px) / 12), 6px);
  height: var(--rkd-disk-bay-h);
  border-radius: 1.5px;
  background: var(--rkd-well);
  border: 0.5px solid var(--rkd-line);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: min(2px, 12%);
  box-sizing: border-box;
}
.itops-page .rkd-disk-led {
  width: 3px;
  height: 3px;
  border-radius: 50%;
}
.itops-page .rkd-vent {
  flex: 1 1 auto;
  height: 14px;
  border-radius: 2px;
  min-width: 16px;
  background: repeating-linear-gradient(90deg, #202023 0 2px, var(--rkd-well) 2px 4px);
  opacity: 0.8;
}
.itops-page .rkd-vent.flex {
  height: 13px;
}
.itops-page .rkd-fans {
  flex: 0 0 auto;
  display: flex;
  gap: 5px;
}
.itops-page .rkd-fan {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--rkd-line),
    var(--rkd-hi) 25%,
    #2a2a2c 26%,
    var(--rkd-line) 50%,
    var(--rkd-hi) 75%,
    #2a2a2c 76%,
    var(--rkd-line)
  );
  box-shadow: inset 0 0 0 0.5px #151517, 0 0 8px -3px var(--rkd-accent);
}
.itops-page .rkd-fan.alt {
  background: conic-gradient(
    from 90deg,
    var(--rkd-line),
    var(--rkd-hi) 25%,
    #2a2a2c 26%,
    var(--rkd-line) 50%,
    var(--rkd-hi) 75%,
    #2a2a2c 76%,
    var(--rkd-line)
  );
}

/* Storage disk grid. */
.itops-page .rkd-storage {
  flex-wrap: wrap;
  align-content: center;
  gap: 3px;
  padding: 2px 0;
}
.itops-page .rkd-storage-bay {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 34px;
  height: 9px;
  border-radius: 2px;
  background: var(--rkd-well);
  border: 0.5px solid var(--rkd-line);
  padding: 0 3px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.4);
}
.itops-page .rkd-storage-bar {
  flex: 1 1 auto;
  height: 2px;
  border-radius: 1px;
  background: repeating-linear-gradient(90deg, #2a2a2d 0 2px, var(--rkd-well) 2px 3px);
}

/* PDU. */
.itops-page .rkd-pdu {
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.itops-page .rkd-outlets {
  display: flex;
  gap: 5px;
  align-items: center;
}
.itops-page .rkd-outlet {
  position: relative;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #202023, #101012);
  border: 0.5px solid var(--rkd-line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.itops-page .rkd-outlet-pin {
  width: 1.5px;
  height: 4px;
  border-radius: 1px;
  background: var(--rkd-hi);
}
.itops-page .rkd-load {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.itops-page .rkd-load-track {
  flex: 1 1 auto;
  height: 4px;
  border-radius: 2px;
  background: var(--rkd-well);
  overflow: hidden;
  border: 0.5px solid var(--rkd-line);
}
.itops-page .rkd-load-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--green), var(--amber));
}
.itops-page .rkd-load-pct {
  font-family: var(--app-mono-font-family, monospace);
  font-size: 8.5px;
  color: var(--amber);
  font-weight: 600;
}

/* UPS. */
.itops-page .rkd-ups {
  gap: 9px;
}
.itops-page .rkd-bolt {
  flex: 0 0 auto;
  color: var(--rkd-accent);
  font-size: 15px;
  line-height: 1;
}
.itops-page .rkd-cells {
  display: flex;
  align-items: center;
  gap: 2px;
}
.itops-page .rkd-cell {
  width: 9px;
  height: 16px;
  border-radius: 2px;
  border: 0.5px solid var(--rkd-line);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.4);
}
.itops-page .rkd-cell-cap {
  width: 2px;
  height: 8px;
  border-radius: 0 1px 1px 0;
  background: var(--rkd-line);
  margin-left: 1px;
}
.itops-page .rkd-ups-pct {
  font-family: var(--app-mono-font-family, monospace);
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
}
.itops-page .rkd-ups-mode {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* KVM. */
.itops-page .rkd-kvm {
  gap: 8px;
}
.itops-page .rkd-kvm-screens {
  display: flex;
  gap: 4px;
}
.itops-page .rkd-kvm-screen {
  width: 16px;
  height: 13px;
  border-radius: 2px;
  background: var(--rkd-slot);
  border: 0.5px solid var(--rkd-line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.itops-page .rkd-kvm-screen-in {
  width: 8px;
  height: 5px;
  border-radius: 1px;
  background: var(--rkd-dim);
}
.itops-page .rkd-kvm-channels {
  display: flex;
  gap: 4px;
}
.itops-page .rkd-kvm-ch {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7.5px;
  font-weight: 700;
  font-family: var(--app-mono-font-family, monospace);
  border: 0.5px solid var(--rkd-line);
}

/* Patch panel. */
.itops-page .rkd-panel {
  flex-wrap: wrap;
  align-content: center;
  gap: 2px;
  padding: 2px 0;
}
.itops-page .rkd-panel-port {
  width: 11px;
  height: 9px;
  border-radius: 1.5px;
  background: #1a1a1c;
  border: 0.5px solid var(--rkd-line);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
}

/* Equipment / general. */
.itops-page .rkd-equip {
  gap: 8px;
}
.itops-page .rkd-equip-label {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--rkd-text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Blank / label filler. */
.itops-page .rkd-blank {
  justify-content: center;
}
.itops-page .rkd-blank-plate {
  width: 100%;
  max-width: 200px;
  height: 9px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, #26262a 0 6px, #1c1c1e 6px 12px);
  opacity: 0.55;
}

/* ──────────────────────────────────────────────────────────────────────────
   Sites tree navigator + rack drill-down (docs/SITE.md Rack View).
   ────────────────────────────────────────────────────────────────────────── */
.itops-page .hg.ft {
  display: flex;
}
/* The detail pane fills the remaining width (the tree is fixed/resizable).
   Without this it shrinks to its content, leaving an empty "third column".
   Padding is zero so drill views (and their backgrounds) run border to
   border; content that needs breathing room carries its own inset below. */
.itops-page .hg.ft .hg-detail {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}
/* Finder source-list sidebar (mirrors .sftp-sidebar / .sftp-sb-row). */
.itops-page .ft-tree {
  position: relative;
  flex: 0 0 auto;
  border-right: 1px solid var(--hairline);
  background: var(--surface-muted);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
  transition:
    width 0.18s cubic-bezier(0.2, 0, 0, 1),
    flex-basis 0.18s cubic-bezier(0.2, 0, 0, 1);
}
.itops-page .ft-collapsed .ft-tree {
  border-right: 0;
  overflow: hidden;
}
.itops-page .ft-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px 2px 12px;
  flex: 0 0 auto;
}
.itops-page .ft-head-title {
  flex: 1 1 auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.itops-page .ft-tree-controls {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  margin: 0;
}
.itops-page .ft-tree-control {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}
.itops-page .ft-add-wrap {
  position: relative;
  flex: 0 0 auto;
  z-index: 45;
}
.itops-page .ft-add-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
}
.itops-page .ft-add-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 41;
  min-width: 168px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.itops-page .ft-add-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.itops-page .ft-add-menu button:hover {
  background: var(--hover);
}
.itops-page .ft-add-menu button:disabled {
  opacity: 0.4;
  cursor: default;
}
.itops-page .ft-add-menu button > svg {
  color: var(--text-muted);
}
.itops-page .ft-search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 10px 8px;
  padding: 0 8px;
  height: 28px;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: inset 0 0 0 0.5px var(--border);
  color: var(--text-faint);
  flex: 0 0 auto;
}
.itops-page .ft-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  outline: none;
}
.itops-page .ft-search-x {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  padding: 2px;
}
.itops-page .ft-tree-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 2px 4px 10px;
}
.itops-page .ft-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding-right: 8px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  user-select: none;
}
.itops-page .ft-row:hover {
  background: var(--hover);
}
.itops-page .ft-row.sel {
  background: var(--sel);
  color: #fff;
}
.itops-page .ft-caret {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}
.itops-page .ft-row.sel .ft-caret {
  color: rgba(255, 255, 255, 0.85);
}
.itops-page .ft-caret.empty {
  cursor: default;
}
.itops-page .ft-ic {
  flex: 0 0 auto;
  display: inline-flex;
  width: 19px;
  justify-content: center;
  color: var(--accent);
}
.itops-page .ft-row.sel .ft-ic {
  color: #fff;
}
.itops-page .ft-ic .connection-icon-shell {
  flex: 0 0 auto;
}
.itops-page .ft-custom-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  color: #fff;
}
.itops-page .ft-label {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itops-page .ft-count {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
}
.itops-page .ft-row.sel .ft-count {
  color: rgba(255, 255, 255, 0.82);
}
.itops-page .ft-resize {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}
.itops-page .ft-collapsed .ft-resize {
  cursor: default;
  pointer-events: none;
}
.itops-page .ft-resize:hover {
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 40%, transparent));
}

/* Drill-down detail. Grows to fill the .hg-detail pane so the spatial room
   views can take its full height; taller content keeps its natural height
   (flex basis stays content-sized) and scrolls the pane as before. */
.itops-page .ft-drill {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  gap: 14px;
  min-height: 0;
  overflow: auto;
}
/* The drill background host and its content stretch to the drill viewport so
   the spatial room views can fill the window; tall content (rack elevations)
   still scrolls the drill as before, since the flex basis stays
   content-sized. */
.itops-page .ft-drill > .ft-drill-bg {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}
.itops-page .ft-drill > .ft-drill-bg > .itops-bg-content {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  min-height: 0;
}
.itops-page .ft-drill > .ft-drill-bg.has-bg > .itops-bg-content {
  padding-top: 0;
}
/* The empty-state card is the only bare .card child of a zero-padding drill
   pane; give it back an inset. */
.itops-page .ft-drill .itops-bg-content > .card {
  margin: 0 14px 14px;
}
.itops-page .it-topology-empty {
  align-self: center;
  margin: auto;
  padding: 14px;
  border: 0.5px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-control);
}
.itops-page .it-drill-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 8px 0;
  pointer-events: none;
}
.itops-page .it-drill-spacer {
  flex: 1 1 auto;
}
.itops-page .it-rack-toolbar-meta {
  position: absolute;
  left: 50%;
  top: 4px;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 8px;
  max-width: calc(100% - 160px);
  min-width: 0;
  pointer-events: auto;
  white-space: nowrap;
}
.itops-page .it-rack-toolbar-meta strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 680;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
}
.itops-page .it-rack-toolbar-meta span {
  color: var(--text-faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.itops-page .it-drill-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-control);
  pointer-events: auto;
}
.itops-page .it-drill-action {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.14s, color 0.14s, transform 0.14s;
}
.itops-page .it-drill-action:hover,
.itops-page .it-drill-action.active {
  background: var(--hover);
  color: var(--accent);
}
.itops-page .it-drill-action:active {
  transform: translateY(1px);
}
.itops-page .it-drill-export {
  position: relative;
}
.itops-page .it-drill-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 42;
}
.itops-page .it-drill-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 43;
  min-width: 150px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.itops-page .it-drill-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 7px 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.itops-page .it-drill-menu button:hover {
  background: var(--hover);
}
.itops-page .ft-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.itops-page .ft-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  min-width: 0;
}
.itops-page .ft-crumb {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--text-faint);
}
.itops-page .ft-crumb button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 5px;
}
.itops-page .ft-crumb button:hover {
  background: var(--hover);
  color: var(--text);
}
.itops-page .ft-crumb button.cur {
  color: var(--text);
  font-weight: 660;
  cursor: default;
}

/* Free placement surface (Site View server-room cards). */
.itops-page .it-site-layout {
  display: flex;
  align-items: stretch;
  flex: 1 0 auto;
  gap: 10px;
  min-height: 0;
}
.itops-page .it-site-layout > .it-free-surface.site {
  flex: 1 1 auto;
}
.itops-page .it-rack-layout {
  display: flex;
  align-items: stretch;
  flex: 1 0 auto;
  gap: 10px;
  min-height: 0;
}
.itops-page .it-rack-layout > .rk-stage {
  flex: 1 1 auto;
  min-width: 0;
}
.itops-page .it-free-surface {
  position: relative;
  min-width: 0;
  border-radius: 12px;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--border) 58%, transparent) 1px, transparent 1.5px) 0 0 / 18px 18px,
    color-mix(in srgb, var(--surface-muted) 70%, transparent);
  border: 1px dashed var(--border);
}
/* Site View: the placement grid fills the whole zero-padding drill pane,
   border to border, in view and edit modes alike. */
.itops-page .it-free-surface.site {
  flex: 1 0 auto;
  border: 0;
  border-radius: 0;
}
/* With a custom Site background the surface keeps only its dot grid so the
   image shows through. */
.itops-page .ft-drill-bg.has-bg .it-free-surface.site {
  background:
    radial-gradient(circle, color-mix(in srgb, var(--border) 58%, transparent) 1px, transparent 1.5px) 0 0 / 18px 18px;
}
.itops-page .it-free-surface.site:not(.editing) {
  background-image: none;
}
/* The dot grid is an edit-mode affordance only; outside edit mode a custom
   background shows through a fully transparent surface. Must outrank the
   `.has-bg` rule above (it is one class more specific than the generic
   `:not(.editing)` reset). */
.itops-page .ft-drill-bg.has-bg .it-free-surface.site:not(.editing) {
  background: none;
}
.itops-page .it-free-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 240px;
}
.itops-page .it-free-card.editing {
  touch-action: none;
  cursor: grab;
}
.itops-page .it-free-card.editing:active {
  cursor: grabbing;
}
.itops-page .it-free-card .ft-card {
  width: 100%;
  height: 100%;
}
.itops-page .it-free-delete,
.itops-page .rk-item-delete {
  position: absolute;
  top: -7px;
  right: -7px;
  z-index: 8;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--red) 70%, var(--border));
  background: color-mix(in srgb, var(--surface) 86%, var(--red));
  color: var(--red);
  cursor: pointer;
  box-shadow: var(--shadow-control);
}
.itops-page .it-free-delete:hover,
.itops-page .rk-item-delete:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.itops-page .ft-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-radius: var(--r-card);
  background: var(--surface);
  border: 0.5px solid var(--border);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: transform 0.16s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.16s, box-shadow 0.16s;
}
.itops-page .ft-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-control);
}
.itops-page .ft-card-ic {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.itops-page .ft-card-ic .connection-icon-shell {
  flex: 0 0 auto;
}
.itops-page .ft-card-ic .ft-custom-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}
.itops-page .ft-card-txt {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.itops-page .ft-card-title {
  font-size: 13.5px;
  font-weight: 620;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itops-page .ft-card-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.itops-page .ft-card > svg:last-child {
  flex: 0 0 auto;
  color: var(--text-faint);
}
.itops-page .ft-rack-detail {
  display: flex;
  justify-content: flex-start;
}

/* Single-rack detail: wider cabinet + placed-device summary list. */
.itops-page .rk.rk-detailed {
  width: auto;
  display: grid;
  grid-template-columns: 340px minmax(180px, 280px);
  gap: 18px;
  align-items: start;
}
.itops-page .rk-detailed .rk-head {
  grid-column: 1 / -1;
}
.itops-page .rk-detail-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: var(--r-card, 12px);
  background: var(--surface);
  border: 1px solid var(--border);
  align-self: stretch;
}
.itops-page .rk-detail-h {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 6px 8px 8px;
}
.itops-page .rk-detail-empty {
  padding: 10px;
  color: var(--text-faint);
  font-size: 12px;
}
.itops-page .rk-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}
.itops-page .rk-detail-row:hover {
  background: var(--hover);
}
.itops-page .rk-detail-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.itops-page .rk-detail-dot.online {
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}
.itops-page .rk-detail-dot.warning {
  background: var(--amber);
}
.itops-page .rk-detail-dot.offline {
  background: var(--red);
}
.itops-page .rk-detail-nm {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itops-page .rk-detail-u {
  flex: 0 0 auto;
  font-family: var(--app-mono-font-family, monospace);
  font-size: 10px;
  color: var(--text-faint);
}

/* ──────────────────────────────────────────────────────────────────────────
   Per-view backgrounds (reuses the Dashboard background machinery) + the
   background picker popover anchor. Mirrors the SFTP background layer.
   ────────────────────────────────────────────────────────────────────────── */
.itops-page .itops-bg-host {
  position: relative;
  min-height: 0;
}
.itops-page .itops-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: var(--r-card);
}
.itops-page .itops-bg-fill,
.itops-page .itops-bg-fill video,
.itops-page .itops-bg-layer .dw-dynamic-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.itops-page .itops-bg-media::after {
  position: absolute;
  inset: 0;
  display: block;
  background: var(--itops-bg-dim-color, transparent);
  content: "";
}
/* Content sits above the background; padding gives the wallpaper a margin. */
.itops-page .itops-bg-host.has-bg > .itops-bg-content {
  position: relative;
  z-index: 1;
  padding: 14px;
  border-radius: var(--r-card);
}
.itops-page .itops-bg-content {
  min-height: 0;
}

/* Background picker button wrap. The popover itself is the shared
   `.dw-bg-popover`, a centered fixed modal — do not re-anchor it (an absolute
   override would clip it inside the scrolling drill). */
.itops-page .itops-bg-pop-wrap {
  position: relative;
  flex: 0 0 auto;
}

/* ──────────────────────────────────────────────────────────────────────────
   Single-rack stage: centered rack + per-device balloon callouts.
   ────────────────────────────────────────────────────────────────────────── */
.itops-page .rk-stage {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 4px 28px 4px;
  min-height: 0;
}
.itops-page .rk-stage-rack {
  flex: 0 0 auto;
}
.itops-page .rk-balloon {
  position: absolute;
  display: flex;
  align-items: center;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 2;
}
.itops-page .rk-balloon.left {
  justify-content: flex-end;
  padding-left: 8px;
}
.itops-page .rk-balloon.right {
  justify-content: flex-start;
  padding-right: 8px;
}
.itops-page .rk-balloon-leader {
  flex: 0 0 auto;
  width: 20px;
  height: 1px;
  background: var(--border-strong);
}
.itops-page .rk-balloon-box {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 200px;
  min-width: 0;
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-control);
  transition: border-color 0.14s, box-shadow 0.14s;
}
.itops-page .rk-balloon:hover .rk-balloon-box {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.itops-page .rk-balloon-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.itops-page .rk-balloon-dot.online {
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}
.itops-page .rk-balloon-dot.warning {
  background: var(--amber);
}
.itops-page .rk-balloon-dot.offline {
  background: var(--red);
}
.itops-page .rk-balloon-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.itops-page .rk-balloon-nm {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.itops-page .rk-balloon-meta {
  display: flex;
  gap: 7px;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itops-page .rk-balloon-meta .host {
  font-family: var(--app-mono-font-family, monospace);
}
.itops-page .rk-balloon-meta .spec {
  color: var(--text-faint);
}

/* Server-room rack groups: labeled sections in the room view. */
/* The drill pane itself has no padding (views bleed border to border), so
   the elevation rows carry their own inset. */
.itops-page .rk-group {
  margin: 0 14px 4px;
}
.itops-page .rk-group-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 2px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.itops-page .rk-group-h::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--hairline);
}

/* ──────────────────────────────────────────────────────────────────────────
   Top-down Server Room View — a blueprint-style floor plan on the shared
   floor grid: rack footprints with facing edges and compact status tags,
   plus non-rack room objects. Footprints render in the rack's shell finish
   (`data-shell`, fixed hardware palette like the 2D rack skin — no status
   colouring); object accents come from `data-kind`.
   ────────────────────────────────────────────────────────────────────────── */
/* The room layout switcher lives centered in the sticky drill toolbar,
   vertically middle-aligned with the edit/add/export action pill on the same
   compact row. */
.itops-page .rm-segmented {
  position: absolute;
  left: 50%;
  top: calc(50% + 1px);
  transform: translate(-50%, -50%);
  display: inline-flex;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow-control);
  pointer-events: auto;
}
.itops-page .rm-segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 560;
  padding: 0 10px;
  height: 24px;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.itops-page .rm-segmented button + button {
  border-left: 0.5px solid var(--border);
}
.itops-page .rm-segmented button:hover:not([data-active="true"]) {
  background: var(--hover);
  color: var(--text);
}
.itops-page .rm-segmented button[data-active="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.itops-page .rm-bp-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  gap: 8px;
}
/* The scroll area takes the drill's leftover height and its content-box size
   drives how many floor cells the grid needs to cover the window. */
.itops-page .rm-bp-scroll {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  min-height: 280px;
  overflow: auto;
}
/* Sizer around the zoomed plan: sized to the scaled footprint so scrolling
   and centering track the zoom level. */
.itops-page .rm-bp-zoom {
  flex: 0 0 auto;
  margin: auto;
}
/* The room outline reads as a blueprint: heavy wall stroke, major grid per
   floor cell, minor quarter-cell grid, cool tint. Cell size is set inline. */
.itops-page .rm-bp {
  position: relative;
  transform-origin: 0 0;
  border: 2.5px solid color-mix(in srgb, var(--text) 52%, var(--surface));
  border-radius: 3px;
  background:
    linear-gradient(color-mix(in srgb, var(--accent) 26%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 26%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--accent) 10%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent) 1px, transparent 1px),
    color-mix(in srgb, var(--accent) 4%, var(--surface-muted));
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--surface-muted) 38%, transparent);
}
.itops-page .rm-bp.placing {
  cursor: crosshair;
}
.itops-page .rm-bp.placing .rm-bp-rack,
.itops-page .rm-bp.placing .rm-bp-obj {
  pointer-events: none;
}
.itops-page .rm-bp-drop {
  position: absolute;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  pointer-events: none;
}
/* Armed-placement ghost: the picked fixture (or pending rack footprint) rides
   the cursor snapped to the hovered cell, previewing the drop before the
   click commits; blocked means the cell has no free vertical span. */
.itops-page .rm-bp-ghost {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--accent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  pointer-events: none;
  z-index: 4;
}
.itops-page .rm-bp-ghost.blocked {
  border-color: var(--red);
  background: color-mix(in srgb, var(--red) 12%, transparent);
}
.itops-page .rm-bp-ghost-item {
  display: block;
  color: var(--obj, var(--text-muted));
  opacity: 0.75;
}
.itops-page .rm-bp-ghost.blocked .rm-bp-ghost-item {
  opacity: 0.4;
}
.itops-page .rm-bp-ghost-rack {
  border: 1.5px solid color-mix(in srgb, var(--accent) 65%, var(--border));
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  opacity: 0.75;
}

/* One rack footprint standing on its cell, painted in the rack's shell
   finish (fixed hardware palette mirroring the .rk cabinet frame; black is
   the default, `data-shell` overrides for white/grey). The `data-front` edge
   marks which way the front faces. */
.itops-page .rm-bp-rack {
  --cab-a: #1e1e21;
  --cab-b: #161618;
  --cab-edge: #38383a;
  --cab-text: #f5f5f7;
  position: absolute;
  border: 1.5px solid var(--cab-edge);
  border-radius: 3px;
  background: linear-gradient(180deg, var(--cab-a), var(--cab-b));
  box-shadow: var(--card-shadow);
}
.itops-page .rm-bp-rack[data-shell="white"] {
  --cab-a: #e4e4e7;
  --cab-b: #d2d2d7;
  --cab-edge: #c2c2c8;
  --cab-text: #1a1a1c;
}
.itops-page .rm-bp-rack[data-shell="grey"] {
  --cab-a: #82828a;
  --cab-b: #6a6a72;
  --cab-edge: #58585e;
  --cab-text: #16161a;
}
.itops-page .rm-bp-rack.editing {
  cursor: grab;
  touch-action: none;
}
.itops-page .rm-bp-rack.dragging {
  cursor: grabbing;
  z-index: 5;
}
/* Lift the hovered footprint so its detail card clears neighbours. */
.itops-page .rm-bp-rack:hover {
  z-index: 6;
}
.itops-page .rm-bp-rack::after {
  content: "";
  position: absolute;
  background: color-mix(in srgb, var(--cab-text) 60%, var(--cab-edge));
  border-radius: 2px;
  pointer-events: none;
}
.itops-page .rm-bp-rack[data-front="s"]::after {
  left: 10%;
  right: 10%;
  bottom: -1px;
  height: 3px;
}
.itops-page .rm-bp-rack[data-front="n"]::after {
  left: 10%;
  right: 10%;
  top: -1px;
  height: 3px;
}
.itops-page .rm-bp-rack[data-front="w"]::after {
  top: 10%;
  bottom: 10%;
  left: -1px;
  width: 3px;
}
.itops-page .rm-bp-rack[data-front="e"]::after {
  top: 10%;
  bottom: 10%;
  right: -1px;
  width: 3px;
}
.itops-page .rm-bp-rack-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 2px 3px;
  border: 0;
  background: transparent;
  color: var(--cab-text);
  cursor: pointer;
  overflow: hidden;
}
.itops-page .rm-bp-rack.editing .rm-bp-rack-body {
  cursor: inherit;
}
.itops-page .rm-bp-rack-name {
  max-width: 100%;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itops-page .rm-bp-top-kuaiguai {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54%;
  height: 46%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.itops-page .rm-bp-top-kuaiguai .kk-bag {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 2px 2px rgb(0 0 0 / 32%));
}

/* Compact always-on status tags (device count · watts); rack-unit figures
   stay off the view and live in the hover detail card instead. */
.itops-page .rm-tags {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
  max-width: 100%;
  overflow: hidden;
}
.itops-page .rm-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0.5px 4px;
  border-radius: 5px;
  border: 0.5px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  font-size: 8.5px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
}
.itops-page .rm-tag-count i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
}

/* A non-rack room object on the plan; `--obj` accent comes from data-kind. */
.itops-page .rm-bp-obj {
  --obj: var(--text-muted);
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--obj);
  filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--text) 18%, transparent));
}
.itops-page .rm-bp-obj.editing {
  cursor: grab;
  touch-action: none;
}
.itops-page .rm-bp-obj.dragging {
  cursor: grabbing;
  z-index: 5;
}
.itops-page .rm-bp-obj-glyph {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.14s;
}

/* Reference-driven fixture artwork shared by the floor plan and 2.5D room.
   Object identity stays on --obj; neutral hardware surfaces derive from app
   tokens so every KKTerm colour scheme remains legible. */
.itops-page .rm-object-art {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: var(--obj);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.itops-page .rm-object-art * {
  vector-effect: non-scaling-stroke;
}
.itops-page .rm-art-soft {
  fill: color-mix(in srgb, var(--obj) 14%, var(--surface));
  stroke: var(--obj);
}
.itops-page .rm-art-fill {
  fill: var(--obj);
  stroke: var(--obj);
}
.itops-page .rm-art-line,
.itops-page .rm-art-detail {
  fill: none;
  stroke: var(--obj);
}
.itops-page .rm-art-detail {
  opacity: 0.58;
  stroke-width: 1.5;
}
.itops-page .rm-art-dark,
.itops-page .rm-art-dark-fill {
  fill: color-mix(in srgb, var(--text) 88%, var(--surface));
  stroke: color-mix(in srgb, var(--text) 72%, var(--border));
}
.itops-page .rm-art-alert,
.itops-page .rm-art-bag-label {
  fill: var(--red);
  stroke: var(--red);
}
.itops-page .rm-art-ok {
  fill: var(--green);
  stroke: var(--green);
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--green) 72%, transparent));
  animation: rm-object-blink 2.6s steps(1) infinite;
}
.itops-page .rm-art-fov,
.itops-page .rm-art-beam {
  fill: color-mix(in srgb, var(--obj) 22%, transparent);
  stroke: none;
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: rm-object-sweep 5s ease-in-out infinite;
}
.itops-page .rm-art-ring,
.itops-page .rm-art-aura {
  fill: none;
  stroke: var(--obj);
  opacity: 0.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: rm-object-ring 2.6s ease-out infinite;
}
.itops-page .rm-art-ring.delayed {
  animation-delay: 1.3s;
}
.itops-page .rm-art-aura {
  fill: color-mix(in srgb, var(--green) 20%, transparent);
  stroke: var(--green);
  animation: rm-object-aura 3s ease-in-out infinite;
}
.itops-page .rm-art-fan {
  fill: none;
  stroke: var(--obj);
  transform-box: fill-box;
  transform-origin: center;
  animation: rm-object-fan 3.4s linear infinite;
}
.itops-page .rm-art-fan.reverse {
  animation-direction: reverse;
  animation-duration: 4s;
}
.itops-page .rm-art-airflow {
  fill: none;
  stroke: var(--obj);
  animation: rm-object-breathe 1.6s ease-in-out infinite;
}
.itops-page .rm-art-breathe {
  transform-box: fill-box;
  transform-origin: center;
  animation: rm-object-breathe 2s ease-in-out infinite;
}
.itops-page .rm-art-cable {
  fill: none;
  stroke-width: 3;
}
.itops-page .rm-art-cable.blue { stroke: var(--accent); }
.itops-page .rm-art-cable.green { stroke: var(--green); }
.itops-page .rm-art-cable.amber { stroke: var(--amber); }
.itops-page .rm-art-signal {
  fill: var(--surface);
  stroke: var(--accent);
  animation: rm-object-signal 2.2s linear infinite;
}
.itops-page .rm-art-bag {
  fill: var(--green);
  stroke: color-mix(in srgb, var(--green) 72%, var(--text));
}
.itops-page .rm-art-bag-text,
.itops-page .rm-art-terminal-text {
  fill: var(--surface);
  stroke: none;
  font-family: var(--app-ui-font-family);
  font-size: 8px;
  font-weight: 800;
  text-anchor: middle;
}
.itops-page .rm-art-terminal-text {
  fill: color-mix(in srgb, var(--green) 82%, var(--surface));
  font-family: var(--app-mono-font-family, monospace);
  font-size: 9px;
}
/* Reference CSS-3D object constructions. In the live room they remain inside
   the floor plane; the detached cursor preview supplies its own projection. */
.itops-page .rm-iso-obj-model {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 48px;
  height: 48px;
  pointer-events: none;
  transform-origin: 0 0;
  transform-style: preserve-3d;
}
.itops-page .rm-iso-obj-model[data-kind="aircon"] { width: 62px; height: 96px; }
.itops-page .rm-iso-obj-model[data-kind="ups"] { width: 48px; height: 58px; }
.itops-page .rm-iso-obj-model[data-kind="crashCart"] { width: 58px; height: 66px; }
.itops-page .rm-iso-obj-model[data-kind="camera"] { width: 62px; height: 48px; }
.itops-page .rm-iso-obj-model[data-kind="sensor"] { width: 48px; height: 38px; }
.itops-page .rm-iso-obj-model[data-kind="smokeDetector"] { width: 45px; height: 22px; }
.itops-page .rm-iso-obj-model[data-kind="fireExtinguisher"] { width: 38px; height: 54px; }
.itops-page .rm-iso-obj-model[data-kind="cableTray"] { width: 78px; height: 42px; }
.itops-page .rm-iso-obj-model[data-kind="kuaikuai"] { width: 42px; height: 56px; }
.itops-page .rm-object-art-iso {
  position: relative;
  overflow: visible;
  transform-style: preserve-3d;
  --font-mono: var(--app-mono-font-family, monospace);
}
.itops-page .rm-ref-iso-stage {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  transform: scale(0.78);
  transform-style: preserve-3d;
}
.itops-page .rm-object-art-iso[data-kind="aircon"] .rm-ref-iso-stage { transform: scale(0.72); }
.itops-page .rm-object-art-iso[data-kind="ups"] .rm-ref-iso-stage { transform: scale(0.78); }
.itops-page .rm-object-art-iso[data-kind="crashCart"] .rm-ref-iso-stage { transform: scale(0.82); }
.itops-page .rm-object-art-iso[data-kind="camera"] .rm-ref-iso-stage { transform: scale(0.68); }
.itops-page .rm-object-art-iso[data-kind="sensor"] .rm-ref-iso-stage { transform: scale(0.82); }
.itops-page .rm-object-art-iso[data-kind="smokeDetector"] .rm-ref-iso-stage { transform: scale(0.86); }
.itops-page .rm-object-art-iso[data-kind="fireExtinguisher"] .rm-ref-iso-stage { transform: scale(0.88); }
.itops-page .rm-object-art-iso[data-kind="cableTray"] .rm-ref-iso-stage { transform: scale(0.72); }
.itops-page .rm-object-art-iso[data-kind="kuaikuai"] .rm-ref-iso-stage { transform: scale(0.9); }
.itops-page .rm-iso-plane .rm-ref-iso-stage > div {
  /* The live room plane already owns rotateX(55deg) rotateZ(45deg). */
  transform: none !important;
}
@keyframes rm-object-fan { to { transform: rotate(360deg); } }
@keyframes rm-object-breathe { 50% { opacity: 0.45; transform: scale(0.88); } }
@keyframes rm-object-blink { 48% { opacity: 1; } 50%, 58% { opacity: 0.25; } 60% { opacity: 1; } }
@keyframes rm-object-sweep { 50% { transform: rotate(28deg); } }
@keyframes rm-object-ring { from { opacity: 0.55; transform: scale(0.4); } to { opacity: 0; transform: scale(1.35); } }
@keyframes rm-object-aura { 50% { opacity: 0.85; transform: scale(1.12); } }
@keyframes rm-object-signal { from { transform: translateX(0); } to { transform: translateX(62px); } }

/* Animation names/timings are copied from Server Room Objects.dc.html because
   the reference 2.5D constructions carry these names in their inline styles. */
@keyframes kkBreathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.38; } }
@keyframes kkBlink { 0%, 44% { opacity: 1; } 56%, 100% { opacity: 0.12; } }
@keyframes kkRec { 0%, 48% { opacity: 1; } 52%, 100% { opacity: 0.08; } }
@keyframes kkAir { 0% { opacity: 0; transform: translateY(4px) scaleY(0.5); } 35% { opacity: 0.85; } 100% { opacity: 0; transform: translateY(-20px) scaleY(1); } }
@keyframes kkRing { 0% { opacity: 0.7; transform: scale(0.18); } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes kkPulse { 0% { opacity: 0; transform: translateX(0); } 12% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; transform: translateX(52px); } }
@keyframes kkSweep { 0%, 100% { transform: rotate(-30deg); } 50% { transform: rotate(30deg); } }
@keyframes kkAura { 0%, 100% { opacity: 0.4; transform: scale(0.94); } 50% { opacity: 0.92; transform: scale(1.08); } }
@keyframes kkCharge { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes kkScroll { to { transform: translateY(-50%); } }
@keyframes kkBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

@media (prefers-reduced-motion: reduce) {
  .itops-page .rm-object-art * {
    animation: none !important;
  }
}
/* Hover control strip (rotate / raise / lower / delete) on plan footprints. */
.itops-page .rm-bp-ctl {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  display: inline-flex;
  gap: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.itops-page .rm-bp-rack:hover .rm-bp-ctl,
.itops-page .rm-bp-obj:hover .rm-bp-ctl {
  opacity: 1;
  pointer-events: auto;
}
.itops-page .rm-bp-ctl button,
.itops-page .rm-iso-ctl button {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-control);
}
.itops-page .rm-bp-ctl button:hover,
.itops-page .rm-iso-ctl button:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
}
.itops-page .rm-bp-ctl button.danger,
.itops-page .rm-iso-ctl button.danger {
  border-color: color-mix(in srgb, var(--red) 70%, var(--border));
  background: color-mix(in srgb, var(--surface) 86%, var(--red));
  color: var(--red);
}
.itops-page .rm-bp-ctl button.danger:hover,
.itops-page .rm-iso-ctl button.danger:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.itops-page .rm-flip {
  display: inline-flex;
  transform: rotate(180deg);
}

/* Edit-mode object picker: a full-height searchable column on the right of a
   spatial layout, holding preview cards for Racks and every room-object kind.
   Object accents (`--obj`/`--tile`) are set inline from IT_ACCENTS. */
.itops-page .rm-spatial {
  display: flex;
  align-items: stretch;
  flex: 1 0 auto;
  gap: 10px;
  min-height: 0;
}
.itops-page .rm-spatial > .rm-bp-wrap,
.itops-page .rm-spatial > .rm-iso {
  flex: 1 1 auto;
  min-width: 0;
}
.itops-page .rm-picker {
  display: flex;
  flex-direction: column;
  flex: 0 0 218px;
  gap: 8px;
  padding: 8px;
  margin: 8px 8px 8px 0;
  border: 0.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.itops-page .rm-picker-h {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 2px;
}
.itops-page .rm-picker-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  height: 26px;
  border: 0.5px solid var(--border);
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--text-faint);
}
.itops-page .rm-picker-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  outline: none;
}
.itops-page .rm-picker-search-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 1px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}
.itops-page .rm-picker-search-x:hover {
  color: var(--text);
}
.itops-page .rm-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-content: start;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 1px;
}
.itops-page .rm-picker-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 6px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 560;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.itops-page .rm-picker-card:hover:not([data-active="true"]) {
  background: var(--hover);
  color: var(--text);
}
.itops-page .rm-picker-card[data-active="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  color: var(--accent);
}
.itops-page .rm-picker-card:disabled {
  opacity: 0.45;
  cursor: default;
}
.itops-page .rm-picker-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}
.itops-page .rm-picker-thumb .rm-object-art {
  width: 100%;
  height: 100%;
}
.itops-page .rm-picker-thumb.device {
  width: 100%;
  height: 40px;
  flex: 0 0 auto;
}
/* Rack View device picker: a single-column list of compact faceplate previews.
   The faceplate itself carries the type name; there is no duplicate caption. */
.itops-page .rm-picker-devices .rm-picker-grid {
  grid-template-columns: minmax(0, 1fr);
}
.itops-page .rm-picker-devices .rm-picker-card {
  align-items: stretch;
  gap: 0;
  padding: 8px;
}
.itops-page .rm-picker-name {
  max-width: 100%;
  text-align: center;
  line-height: 1.25;
}

.itops-page .rm-tile-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.itops-page .rm-dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.itops-page .rm-dot i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.itops-page .rm-dot.on i {
  background: var(--green);
}
.itops-page .rm-dot.warn i {
  background: var(--amber);
}
.itops-page .rm-dot.off i {
  background: var(--red);
}

/* ──────────────────────────────────────────────────────────────────────────
   2.5D Server Room View. An axonometric floor plane (rotateX(55°) rotateZ(45°),
   no perspective — angles must match ISO_TILT_DEG/ISO_ROT_DEG in
   roomIsoLayout.ts) with each Rack extruded into a cabinet cuboid. Cabinet
   faces render the rack's shell finish (`data-shell`, fixed hardware palette
   like the 2D rack skin — no status colouring); room-object faces mix the
   `--tile` kind accent into surface tokens. Name badges, tooltips, and delete
   bubbles are billboarded back to screen alignment by inline transforms in
   ServerRoomIsoView.tsx.
   ────────────────────────────────────────────────────────────────────────── */
.itops-page .rm-iso {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  gap: 8px;
}
/* Positioning context for a spatial layout's scroll viewport and its floating
   overlays: the zoom ruler (top right) and the 2.5D angle stepper (top left). */
.itops-page .rm-view-body {
  position: relative;
  display: flex;
  flex: 1 1 0;
  min-height: 0;
}
/* Vertical ruler-style zoom control floating over the room's top-right
   corner: one clickable tick per fixed level, largest on top; the active tick
   follows wheel-zoom steps. */
.itops-page .rm-zoomruler {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 5px 6px;
  border: 0.5px solid var(--border);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow-control);
}
.itops-page .rm-zoomruler-tick {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 0;
  padding: 2px 2px;
  border-radius: 5px;
  background: transparent;
  color: var(--text-faint);
  font: inherit;
  font-size: 9.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.itops-page .rm-zoomruler-tick i {
  flex: 0 0 auto;
  width: 10px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
}
.itops-page .rm-zoomruler-tick:hover {
  background: var(--hover);
  color: var(--text);
}
.itops-page .rm-zoomruler-tick[data-active="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.itops-page .rm-zoomruler-tick[data-active="true"] i {
  width: 14px;
  height: 2.5px;
}
/* Floating control column over the 2.5D room's top-right corner: the shared
   zoom ruler with the view-angle stepper and floor-colour swatches under it. */
.itops-page .rm-iso-corner {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.itops-page .rm-iso-corner .rm-zoomruler {
  position: static;
}
/* Fixed view-angle stepper: the camera stays put, the room turns in quarter
   steps (roomIsoLayout.ts rotates the grid under it). */
.itops-page .rm-iso-angles {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.itops-page .rm-iso-angles button {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0.5px solid var(--border);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow-control);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.itops-page .rm-iso-angles button:hover {
  background: var(--hover);
  color: var(--text);
}
/* The scroll area takes the drill's leftover height; its content-box size is
   the canvas the room's floor plane must cover. */
.itops-page .rm-iso-scroll {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  min-height: 280px;
  overflow: auto;
}
/* Sizer around the zoomed canvas: sized to the scaled footprint so scrolling
   and centering track the zoom level. */
.itops-page .rm-iso-zoom {
  flex: 0 0 auto;
  margin: auto;
}
/* Clip the decorative floor overhang: the plane's projection is sized to
   cover the whole canvas, so its corners stick out past the viewport. */
.itops-page .rm-iso-viewport {
  position: relative;
  transform-origin: 0 0;
  overflow: hidden;
}
/* Solid floor finish shared by the plane and the corner swatches: the default
   follows the app theme; `data-floor` picks a fixed material palette (hex like
   the cabinet shell hardware palette). `--floor-line` draws the tile grid. */
.itops-page .rm-iso-plane,
.server-room-floor-swatch {
  --floor-a: color-mix(in srgb, var(--surface-muted) 94%, var(--surface));
  --floor-b: color-mix(in srgb, var(--surface-muted) 66%, var(--surface));
  --floor-line: color-mix(in srgb, var(--border) 52%, transparent);
}
.itops-page .rm-iso-plane[data-floor="concrete"],
.server-room-floor-swatch[data-floor="concrete"] {
  --floor-a: #cfcfd4;
  --floor-b: #b7b7bd;
  --floor-line: rgb(40 40 46 / 22%);
}
.itops-page .rm-iso-plane[data-floor="graphite"],
.server-room-floor-swatch[data-floor="graphite"] {
  --floor-a: #3b3b41;
  --floor-b: #2c2c31;
  --floor-line: rgb(255 255 255 / 14%);
}
.itops-page .rm-iso-plane[data-floor="green"],
.server-room-floor-swatch[data-floor="green"] {
  --floor-a: #4c7d67;
  --floor-b: #3b634f;
  --floor-line: rgb(12 34 25 / 30%);
}
.itops-page .rm-iso-plane[data-floor="blue"],
.server-room-floor-swatch[data-floor="blue"] {
  --floor-a: #4d6a99;
  --floor-b: #3c527a;
  --floor-line: rgb(13 22 40 / 32%);
}
.itops-page .rm-iso-plane {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%) rotateX(55deg) rotateZ(45deg);
  transform-style: preserve-3d;
  background:
    linear-gradient(var(--floor-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--floor-line) 1px, transparent 1px),
    linear-gradient(135deg, var(--floor-a), var(--floor-b));
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--surface-muted) 38%, transparent);
}

/* Empty floor tile — edit-mode click target for adding a rack in place. */
.itops-page .rm-iso-tile {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px dashed transparent;
  border-radius: 4px;
  background: transparent;
  color: transparent;
  cursor: pointer;
}
.itops-page .rm-iso-tile:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}
/* Snap-target highlight while dragging a cabinet. */
.itops-page .rm-iso-drop {
  position: absolute;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  pointer-events: none;
}
.itops-page .rm-iso-drop.blocked {
  border-color: var(--red);
  background: color-mix(in srgb, var(--red) 14%, transparent);
}

/* Armed placement over the 2.5D room: the picked fixture (or pending rack)
   ghost rides the hovered tile so the grid previews the drop in realtime.
   Objects let the pointer through so tiles under them stay hover/click
   targets, and the tile's own plus glyph stays hidden while a ghost shows. */
.itops-page .rm-iso-plane.placing,
.itops-page .rm-iso-plane.placing .rm-iso-body,
.itops-page .rm-iso-plane.placing .rm-iso-tile {
  cursor: crosshair;
}
.itops-page .rm-iso-plane.placing .rm-iso-obj:not(.ghost) {
  pointer-events: none;
}
.itops-page .rm-iso-plane.placing .rm-iso-tile:hover {
  color: transparent;
}
.itops-page .rm-iso-cab.ghost {
  opacity: 0.65;
  pointer-events: none;
}
.itops-page .rm-iso-obj.ghost {
  /* Parent opacity flattens preserve-3d descendants and collapses every
     vertical face into the floor. The blue snap tile already distinguishes
     the preview, so keep the reference model fully 3D and fully legible. */
  pointer-events: none;
}

/* Cabinet cuboid, painted in the rack's shell finish (fixed hardware palette
   mirroring the .rk cabinet frame; black default, `data-shell` overrides). */
.itops-page .rm-iso-cab {
  --cab-a: #1e1e21;
  --cab-b: #161618;
  --cab-edge: #38383a;
  position: absolute;
  transform-style: preserve-3d;
}
.itops-page .rm-iso-cab[data-shell="white"] {
  --cab-a: #e4e4e7;
  --cab-b: #d2d2d7;
  --cab-edge: #c2c2c8;
}
.itops-page .rm-iso-cab[data-shell="grey"] {
  --cab-a: #82828a;
  --cab-b: #6a6a72;
  --cab-edge: #58585e;
}
.itops-page .rm-iso-cab.editing {
  cursor: grab;
  touch-action: none;
}
.itops-page .rm-iso-cab.dragging {
  cursor: grabbing;
}
.itops-page .rm-iso-cab.selected .rm-iso-top {
  box-shadow: inset 0 0 0 2px var(--accent);
}
/* Soft floor shadow, lifted 1px above the plane to avoid z-fighting. */
.itops-page .rm-iso-cab::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--text) 16%, transparent);
  filter: blur(4px);
  transform: translateZ(1px);
}
.itops-page .rm-iso-body {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: transparent;
  transform-style: preserve-3d;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.itops-page .rm-iso-cab:not(.dragging) .rm-iso-body:hover {
  transform: translateZ(8px);
}
.itops-page .rm-iso-face {
  position: absolute;
  display: block;
}
.itops-page .rm-iso-top {
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--tile) 55%, var(--border));
  border-radius: 2px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--tile) 34%, var(--surface)),
    color-mix(in srgb, var(--tile) 16%, var(--surface))
  );
}
/* South (+y) face rises from its bottom edge on the floor line (top offset
   and size set inline). Its role class decides the finish: `front` carries
   the device skin, `side` plain metal, `rear` a vented cable panel. */
.itops-page .rm-iso-front {
  left: 0;
  transform-origin: 50% 100%;
  transform: rotateX(-90deg);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tile) 45%, var(--border));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--tile) 30%, var(--surface-muted)),
    color-mix(in srgb, var(--tile) 12%, var(--surface-muted))
  );
}
/* East (+x) face swings up around its right edge (left offset set inline). */
.itops-page .rm-iso-side {
  top: 0;
  transform-origin: 100% 50%;
  transform: rotateY(90deg);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tile) 40%, var(--border));
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--tile) 10%, var(--surface-muted)),
    color-mix(in srgb, var(--tile) 22%, var(--surface-muted))
  );
  filter: brightness(0.82);
}
/* Cabinet faces override the generic (--tile) recipes with the shell finish,
   so the whole cuboid reads as one cabinet colour. */
.itops-page .rm-iso-cab .rm-iso-top {
  border: 1px solid var(--cab-edge);
  background:
    linear-gradient(135deg, rgb(255 255 255 / 16%), rgb(255 255 255 / 0%) 62%),
    linear-gradient(180deg, var(--cab-a), var(--cab-b));
}
.itops-page .rm-iso-nameplate {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  max-width: calc(100% - 8px);
  padding: 1px 4px;
  overflow: hidden;
  border: 0.5px solid var(--border-strong);
  border-radius: 2px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--text);
  font-size: 8px;
  font-weight: 680;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform-origin: center;
  pointer-events: none;
}
.itops-page .rm-iso-top-kuaiguai {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58%;
  height: 52%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.itops-page .rm-iso-top-kuaiguai .kk-bag {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 2px 2px rgb(0 0 0 / 38%));
}
.itops-page .rm-iso-cab .rm-iso-front {
  border: 1px solid var(--cab-edge);
  background: linear-gradient(180deg, var(--cab-a), var(--cab-b));
}
.itops-page .rm-iso-cab .rm-iso-side {
  border: 1px solid var(--cab-edge);
  background: linear-gradient(90deg, var(--cab-b), var(--cab-a));
}
.itops-page .rm-iso-cab .rm-iso-front.rear,
.itops-page .rm-iso-cab .rm-iso-side.rear {
  background:
    repeating-linear-gradient(
      0deg,
      color-mix(in srgb, var(--cab-edge) 85%, transparent) 0 1px,
      transparent 1px 4px
    ),
    linear-gradient(180deg, var(--cab-a), var(--cab-b));
}

/* Miniature 2D rack skin painted on the cabinet's front face: the cabinet
   frame in the rack's shell finish plus one faceplate strip per placed
   device with a status LED. Fixed hardware palette like the full-size rack
   skin above (physical equipment greys, not theme tokens); `data-shell`
   overrides mirror the .rk cabinet finishes. */
.itops-page .rm-iso-skin {
  --skin-a: #1e1e21;
  --skin-b: #161618;
  --skin-rail: #38383a;
  position: absolute;
  inset: 0;
  display: block;
  background:
    repeating-linear-gradient(
      180deg,
      rgb(255 255 255 / 5%) 0 1px,
      transparent 1px 5px
    ),
    linear-gradient(180deg, var(--skin-a), var(--skin-b));
  border-left: 2px solid var(--skin-rail);
  border-right: 2px solid var(--skin-rail);
}
.itops-page .rm-iso-skin[data-shell="white"] {
  --skin-a: #e4e4e7;
  --skin-b: #d2d2d7;
  --skin-rail: #c2c2c8;
}
.itops-page .rm-iso-skin[data-shell="grey"] {
  --skin-a: #82828a;
  --skin-b: #6a6a72;
  --skin-rail: #58585e;
}
/* On the east face the fold maps the cabinet's up direction onto the
   element's width (left edge = top), so rails and slats turn with it. */
.itops-page .rm-iso-skin.axis-x {
  background:
    repeating-linear-gradient(
      90deg,
      rgb(255 255 255 / 5%) 0 1px,
      transparent 1px 5px
    ),
    linear-gradient(270deg, var(--skin-a), var(--skin-b));
  border-left: 0;
  border-right: 0;
  border-top: 2px solid var(--skin-rail);
  border-bottom: 2px solid var(--skin-rail);
}
.itops-page .rm-iso-skin.axis-y .rm-iso-skin-item {
  left: 2px;
  right: 2px;
}
.itops-page .rm-iso-skin.axis-x .rm-iso-skin-item {
  top: 2px;
  bottom: 2px;
}
.itops-page .rm-iso-skin-item {
  position: absolute;
  display: block;
  border-radius: 1px;
  border: 0.5px solid rgb(255 255 255 / 14%);
  background: linear-gradient(180deg, #313134, #222225);
  box-shadow: 0 0.5px 1px rgb(0 0 0 / 40%);
}
.itops-page .rm-iso-skin-item::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1.5px;
  width: 2px;
  height: 2px;
  margin-top: -1px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 3px var(--green);
}
.itops-page .rm-iso-skin.axis-x .rm-iso-skin-item::after {
  top: auto;
  right: auto;
  left: 50%;
  bottom: 1.5px;
  margin-top: 0;
  margin-left: -1px;
}
.itops-page .rm-iso-skin-item[data-status="warning"]::after {
  background: var(--amber);
  box-shadow: 0 0 3px var(--amber);
}
.itops-page .rm-iso-skin-item[data-status="offline"]::after {
  background: var(--red);
  box-shadow: 0 0 3px var(--red);
}
.itops-page .rm-iso-skin-item[data-kind="kuaiguai"] {
  background: linear-gradient(180deg, #3fae5a, #2f8746);
}
.itops-page .rm-iso-skin-item[data-kind="blank"],
.itops-page .rm-iso-skin-item[data-kind="label"] {
  background: linear-gradient(180deg, #2c2c30, #1a1a1c);
  border-color: rgb(255 255 255 / 8%);
}
.itops-page .rm-iso-skin-item[data-kind="blank"]::after,
.itops-page .rm-iso-skin-item[data-kind="label"]::after {
  content: none;
}
/* Hover detail card shared by both spatial views (RackTipContent): billboarded
   above a 2.5D cabinet, floating above a floor-plan footprint. */
.itops-page .rm-iso-tip,
.itops-page .rm-bp-tip {
  position: absolute;
  left: 50%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 136px;
  padding: 8px 10px;
  border: 0.5px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-control);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s;
}
.itops-page .rm-iso-tip {
  top: 50%;
}
.itops-page .rm-bp-tip {
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 9;
}
.itops-page .rm-iso-cab:hover .rm-iso-tip,
.itops-page .rm-bp-rack:hover .rm-bp-tip {
  opacity: 1;
}
/* Edit mode floats the control strip in the same spot; keep the card away. */
.itops-page .rm-bp-rack.editing .rm-bp-tip {
  display: none;
}
.itops-page .rm-tip-name {
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}
.itops-page .rm-tip-detail {
  font-size: 11px;
  font-weight: 640;
  color: var(--text-muted);
  white-space: nowrap;
}
.itops-page .rm-tip-cap {
  font-size: 10px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Billboarded edit controls (rotate / raise / lower / delete), static inside
   their billboard wrapper. Button recipe shared with .rm-bp-ctl above. */
.itops-page .rm-iso-ctl-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
}
.itops-page .rm-iso-ctl {
  display: inline-flex;
  gap: 3px;
}
.itops-page .rm-iso-hint {
  padding: 0 10px 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* A room object anchored to its floor cell and vertical position; the
   reference-driven model above supplies each kind's distinct silhouette. */
.itops-page .rm-iso-obj {
  --tile: var(--text-faint);
  position: absolute;
  transform-style: preserve-3d;
}
.itops-page .rm-iso-obj.editing {
  cursor: grab;
  touch-action: none;
}
.itops-page .rm-iso-obj.dragging {
  cursor: grabbing;
}
.itops-page .rm-iso-obj.selected .rm-iso-obj-model {
  filter: none;
}
.itops-page .rm-iso-obj.selected {
  box-shadow: inset 0 0 0 2px var(--accent);
}
/* Floor shadow only for objects actually standing on the floor. */
.itops-page .rm-iso-obj.grounded::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--text) 14%, transparent);
  filter: blur(3px);
  transform: translateZ(1px);
}
.rack-item-dialog {
  max-width: calc(100vw - 64px);
}

.server-room-floor-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.server-room-floor-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 8px 4px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
}
.server-room-floor-option:hover {
  background: var(--hover);
  color: var(--text);
}
.server-room-floor-option[data-active="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}
.server-room-floor-swatch {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--floor-a), var(--floor-b));
}
.rack-item-dialog .kk-dlg-body {
  padding: 18px 22px;
  overflow-x: hidden;
}

/* Add/Edit Rack follows the split preview/form reference while the preview
   itself reuses the shipped RackElevation hardware graphic. */
.rack-dialog {
  max-width: 100%;
}
.rack-dialog .kk-dlg-body {
  padding: 18px 22px;
}
.rack-dialog-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}
.rack-dialog-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.rack-dialog-preview-stage {
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  align-items: flex-start;
  min-height: 252px;
  max-height: 330px;
  padding: 16px 14px;
  overflow: hidden;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background-color: var(--surface-muted);
  background-image: radial-gradient(circle, var(--hairline) 0.8px, transparent 0.8px);
  background-size: 14px 14px;
}
.rack-dialog-preview-stage .rk-head,
.rack-dialog-shell-preview .rk-head {
  display: none;
}
.rack-dialog-preview-stage .rk {
  --rk-u: 4.5px;
  width: 156px;
  -webkit-mask-image: linear-gradient(to bottom, black 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 82%, transparent 100%);
}
.rack-dialog-preview-stage .rk-frame {
  border-radius: 10px;
}
.rack-dialog-preview-stage .rk-u {
  overflow: hidden;
  font-size: 5px;
  line-height: 1;
}
.rack-dialog-preview-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 0 4px;
  text-align: center;
}
.rack-dialog-preview-caption strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rack-dialog-preview-caption span {
  color: var(--text-muted);
  font-family: var(--app-mono-font-family, monospace);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.rack-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.rack-dialog-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.rack-dialog-shell-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}
.rack-dialog-shell-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 8px 4px 7px;
  color: var(--text-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--control-shadow);
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s, transform 0.06s;
}
.rack-dialog-shell-tile:hover {
  background: var(--hover);
  color: var(--text);
}
.rack-dialog-shell-tile:active {
  transform: translateY(0.5px);
}
.rack-dialog-shell-tile:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.rack-dialog-shell-tile.selected {
  color: var(--text);
  font-weight: 600;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.rack-dialog-shell-preview {
  display: block;
  width: 40px;
  height: 34px;
  overflow: hidden;
}
.rack-dialog-shell-preview .rk {
  --rk-u: 2px;
  width: 30px;
  margin: 0 auto;
}
.rack-dialog-shell-preview .rk-frame {
  padding: 2px;
  border-radius: 4px;
}
.rack-dialog-shell-preview .rk-rail {
  height: 2px;
}
.rack-dialog-shell-preview .rk-bay {
  gap: 1px;
  margin: 2px 0;
}
.rack-dialog-shell-preview .rk-grid {
  grid-template-columns: 2px minmax(0, 1fr) 2px;
  column-gap: 1px;
}
.rack-dialog-shell-preview .rk-u {
  display: none;
}
.rack-dialog-dimensions .kk-field > .kk-inp {
  margin-top: 2px;
}

@media (max-width: 760px) {
  .rack-dialog-layout {
    grid-template-columns: 1fr;
  }
  .rack-dialog-preview-stage {
    min-height: 150px;
    max-height: 190px;
  }
  .rack-dialog-preview-stage .rk {
    --rk-u: 3px;
  }
}
.rack-item-dialog-grid {
  display: grid;
  grid-template-columns: minmax(0, 310px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.rack-item-dialog-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.rack-item-dialog-column .kk-field:first-child { margin-top: 0; }

.rack-item-preview-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rack-item-preview-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  height: 144px;
  overflow: hidden;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background-color: var(--surface-muted);
  background-image: radial-gradient(circle, var(--hairline) 0.8px, transparent 0.8px);
  background-size: 14px 14px;
}
.rack-item-preview-rack {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) 7px;
  width: calc(100% - 24px);
  height: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, black 62%, transparent 96%);
  mask-image: linear-gradient(to bottom, black 62%, transparent 96%);
}
.rack-item-preview-rail {
  background:
    radial-gradient(circle, var(--text-faint) 0 1px, transparent 1.5px) center 8px / 4px 18px repeat-y,
    linear-gradient(90deg, var(--border-strong), var(--surface), var(--border-strong));
  border-inline: 0.5px solid var(--border-strong);
}
.rack-item-preview-bay {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 5px 0;
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
}
.rack-item-preview-device {
  flex: 0 0 var(--rack-item-preview-height, 22px);
  min-height: 30px;
  max-height: 110px;
}
.rack-item-preview-empty-slot {
  flex: 0 0 20px;
  border: 0.5px solid var(--border);
  border-radius: 5px;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, var(--hairline) 8px 9px),
    color-mix(in srgb, var(--surface) 72%, transparent);
}
.rack-item-preview-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 0 4px;
  text-align: center;
}
.rack-item-preview-caption strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rack-item-preview-caption span {
  color: var(--text-muted);
  font-family: var(--app-mono-font-family, monospace);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.rack-item-shell-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}
.rack-item-shell-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 8px 5px 7px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--control-shadow);
  color: var(--text-muted);
  font: inherit;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s, transform 0.06s;
}
.rack-item-shell-tile:hover {
  background: var(--hover);
  color: var(--text);
}
.rack-item-shell-tile:active {
  transform: translateY(0.5px);
}
.rack-item-shell-tile:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.rack-item-shell-tile.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}
.rack-item-shell-face {
  display: block;
  width: 100%;
  height: 26px;
}
.rack-item-shell-face .rkd-id {
  display: none;
}
.rack-item-shell-face .rkd-ear {
  flex-basis: 8px;
}
.rack-item-shell-face .rkd-body {
  gap: 2px;
  padding-inline: 2px;
}
.itops-page .rack-kind-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 4px 0 0;
}
.itops-page .rack-kind-preview {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  padding: 5px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s, background 0.14s, transform 0.14s;
}
.itops-page .rack-kind-preview:hover,
.itops-page .rack-kind-preview.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}
.itops-page .rack-kind-preview:active {
  transform: translateY(1px);
}
.itops-page .rack-kind-preview-face {
  height: 28px;
  display: flex;
  align-items: center;
}
.itops-page .rack-kind-preview-face .rkd-id {
  display: none;
}
.itops-page .rack-kind-preview-face .rkd-ear {
  flex-basis: 7px;
  padding-block: 4px;
}
.itops-page .rack-kind-preview-face .rkd-ear-bolt,
.itops-page .rack-kind-preview-face .rkd-leds > span {
  width: 4px;
  height: 4px;
}
.itops-page .rack-kind-preview-face .rkd-body {
  gap: 2px;
  padding-inline: 2px;
}
.itops-page .rack-kind-preview-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 620;
  color: var(--text-muted);
}

.itops-page .rack-form-grid {
  display: grid;
  gap: 12px;
}

.itops-page .rack-form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.itops-page .rack-device-dimensions .kk-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  border: 0.5px solid var(--border-strong);
  box-shadow: none;
}

.itops-page .rack-device-dimensions .kk-stepper input,
.itops-page .rack-device-dimensions .kk-stepper button {
  width: 100%;
  min-width: 0;
  align-self: center;
  justify-self: center;
}

.itops-page .rack-port-list {
  display: grid;
  gap: 8px;
}

.itops-page .rack-port-row {
  display: grid;
  gap: 8px;
  align-items: center;
}

.rack-item-dialog .rack-port-row {
  grid-template-columns: 1fr;
}

.itops-page .connection-binding-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 118px;
  overflow: auto;
}
.itops-page .connection-binding-list.standalone {
  grid-template-columns: 1fr;
  max-height: 430px;
}

.itops-page .rk-item-bind {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  z-index: 7;
}
.itops-page .rk-item-row:hover .rk-item-bind { display: inline-flex; }

.itops-page .connection-binding-row {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 7px;
  row-gap: 1px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.itops-page .connection-binding-row small {
  grid-column: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

.itops-page .rack-random-callouts {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
  pointer-events: none;
}

.itops-page .rack-random-callouts button {
  min-width: 0;
  max-width: 210px;
  display: grid;
  gap: 1px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 24px var(--shadow);
  text-align: left;
  pointer-events: auto;
}

.itops-page .rack-random-callouts span,
.itops-page .rack-random-callouts small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.itops-page .rack-random-callouts span {
  font-size: 12px;
  font-weight: 700;
}

.itops-page .rack-random-callouts small {
  color: var(--text-muted);
  font-size: 10px;
}

.itops-page .rk-detail-meta {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--surface);
}

@media (max-width: 760px) {
  .rack-item-dialog {
    max-width: calc(100vw - 24px);
  }
  .rack-item-dialog-grid { grid-template-columns: 1fr; }
  .itops-page .rack-form-grid.two,
  .itops-page .connection-binding-list,
  .itops-page .rack-port-row {
    grid-template-columns: 1fr;
  }
}


.itops-page .rkd.rkd-kuaiguai-only {
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.itops-page .rkd-kuaiguai-only .kk-bag {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: rotate(var(--rkd-rotate, -2deg)) rotateY(var(--rkd-yaw, 0deg));
  transform-origin: center;
  filter: drop-shadow(0 5px 6px rgb(0 0 0 / 32%));
}
.itops-page .rkd-kuaiguai-only[data-kuaiguai-style="full"] .kk-bag {
  max-width: 92px;
}
.itops-page .rkd-kuaiguai-only[data-kuaiguai-style="laidDown"] .kk-bag {
  max-width: 170px;
}
.itops-page .rkd-kuaiguai-only[data-kuaiguai-size="small"] .kk-bag {
  transform: rotate(var(--rkd-rotate, -2deg)) rotateY(var(--rkd-yaw, 0deg)) scale(.82);
}
.itops-page .rkd-kuaiguai-only[data-kuaiguai-size="large"] .kk-bag {
  transform: rotate(var(--rkd-rotate, -2deg)) rotateY(var(--rkd-yaw, 0deg)) scale(1.08);
}

/* ── Rack-device connect popover (RackItemConnectPopover) ──
   Portaled to document.body (see DialogPortal) so it escapes the itops-page
   stacking context; selectors are intentionally NOT scoped to .itops-page.
   Sits at the dialog layer (kk-dlg-backdrop is z-index 130). */
.rkc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
}
.rkc-pop {
  position: fixed;
  z-index: 131;
  display: flex;
  flex-direction: column;
  min-width: 240px;
  max-width: 320px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rkc-head {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 12px 7px;
  border-bottom: 1px solid var(--border);
}
.rkc-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rkc-count {
  font-size: 10px;
  color: var(--text-faint);
}
.rkc-rows {
  display: flex;
  flex-direction: column;
  padding: 4px;
  max-height: 240px;
  overflow-y: auto;
}
.rkc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}
.rkc-row:hover {
  background: var(--hover);
}
.rkc-row.missing {
  cursor: default;
  color: var(--text-faint);
  font-size: 11px;
  font-style: italic;
}
.rkc-row-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.rkc-row-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rkc-row-host {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--app-mono-font-family, monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rkc-row-act {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.rkc-row-act.open {
  color: var(--green);
}
.rkc-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}

/* ── Hosts segment (docs/ITOPS.md Hosts) ─────────────────────────────────── */
.itops-page .it-hosts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 14px 14px;
}
.itops-page .it-hosts-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.itops-page .it-hosts-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.itops-page .it-hosts-sp {
  flex: 1;
}
.itops-page .it-hosts-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.itops-page .it-hosts-action:hover:not(:disabled) {
  background: var(--hover);
}
.itops-page .it-hosts-action:disabled {
  opacity: 0.5;
  cursor: default;
}
.itops-page .it-hosts-action.primary {
  border-color: var(--accent);
  color: var(--accent);
}
.itops-page .it-hosts-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  overflow: hidden;
}
.itops-page .it-host-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.itops-page .it-host-row:last-child {
  border-bottom: none;
}
.itops-page .it-host-kind {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text-muted);
}
.itops-page .it-host-kind.physical {
  color: var(--accent);
}
.itops-page .it-host-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.itops-page .it-host-name .nm {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itops-page .it-host-name .addr {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--app-mono-font-family, monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itops-page .it-host-name .kids {
  font-size: 10px;
  color: var(--text-faint);
  white-space: nowrap;
}
.itops-page .it-host-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
.itops-page .it-host-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--app-mono-font-family, monospace);
  color: var(--text-muted);
  white-space: nowrap;
}
.itops-page .it-host-chip.ssh,
.itops-page .it-host-chip.winrm,
.itops-page .it-host-chip.https {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}
.itops-page .it-host-chip.scanning {
  color: var(--text);
}
.itops-page .it-host-chip.muted {
  color: var(--text-faint);
}
.itops-page .it-host-bind {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.itops-page .it-host-bind.bound {
  color: var(--accent);
  border-color: var(--accent);
}
.itops-page .it-host-bind:hover {
  background: var(--hover);
}
.itops-page .it-host-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
}
.itops-page .it-host-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.itops-page .it-host-actions button:hover {
  background: var(--hover);
  color: var(--text);
}

/* Balloon callout host list: the bound Host plus its child VMs/containers. */
.itops-page .rk-balloon-hosts {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itops-page .rk-balloon-hosts .hostname {
  color: var(--text-muted);
  font-family: var(--app-mono-font-family, monospace);
}
.itops-page .rk-balloon-hosts .child {
  color: var(--text-faint);
}
.itops-page .rk-balloon-hosts .child::before {
  content: "▸ ";
}
.itops-page .rk-balloon-hosts .more {
  color: var(--text-faint);
}
