:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #eef2ef;
  --ink: #1d2521;
  --muted: #66736c;
  --line: #d7ddd6;
  --green: #20785d;
  --green-soft: #dff2ea;
  --amber: #9b6a13;
  --amber-soft: #fbefd6;
  --red: #aa3f3f;
  --red-soft: #f8dddd;
  --cyan: #1f6f7a;
  --cyan-soft: #dceff2;
  --blue: #285f9f;
  --blue-soft: #dfe9fb;
  --shadow: 0 8px 22px rgba(29, 37, 33, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Pi1 vNext owner-backed staff forms. */
.relay-mode-form {
  display: grid;
  gap: .8rem;
  margin-top: 1rem;
}

.relay-mode-form label {
  display: grid;
  gap: .35rem;
  color: var(--muted);
  font-weight: 700;
}

.relay-mode-form input:not([type="hidden"]),
.relay-mode-form select,
.relay-mode-form textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #b8c2cf;
  border-radius: 8px;
  padding: .65rem .75rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.relay-mode-form textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.relay-mode-form input:focus-visible,
.relay-mode-form select:focus-visible,
.relay-mode-form textarea:focus-visible {
  outline: 3px solid rgba(40, 95, 159, .22);
  outline-offset: 1px;
  border-color: var(--blue);
}

.pi1-dialog-actions > form {
  margin: 0;
}

/* Pi1 local-control portal (2026-08-15). */
.pi1-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
}

.pi1-control-card {
  background: var(--panel, #fff);
  border: 1px solid var(--border, #d7dde5);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.pi1-control-card h3,
.pi1-dialog h2 {
  margin: 0;
}

.runtime-meter {
  width: 100%;
  height: 1rem;
  accent-color: var(--green);
}

.runtime-reset-form {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
}

.runtime-reset-form label {
  display: grid;
  gap: .4rem;
  color: var(--muted);
  font-weight: 700;
}

.runtime-reset-form input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .7rem .8rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.runtime-reset-form input[type="text"]:focus-visible {
  outline: 3px solid rgba(40, 95, 159, .22);
  outline-offset: 1px;
  border-color: var(--blue);
}

.pi1-kv {
  display: grid;
  gap: .65rem;
  margin: 1rem 0;
}

.pi1-kv div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  padding-bottom: .45rem;
}

.pi1-kv dt { color: var(--muted, #64748b); }
.pi1-kv dd { margin: 0; text-align: right; font-weight: 600; }

.pi1-dialog {
  width: min(760px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 0;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .3);
}

.pi1-dialog::backdrop { background: rgba(15, 23, 42, .58); }
.pi1-dialog form + form { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid #d7dde5; }

.pi1-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
  margin: 1rem 0;
}

.pi1-form-grid label,
.pi1-dialog > form > label,
.pi1-dialog form > label {
  display: grid;
  gap: .35rem;
  color: #475569;
  font-weight: 600;
}

.pi1-dialog input,
.pi1-dialog select,
.pi1-dialog textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #b8c2cf;
  border-radius: 8px;
  padding: .65rem .75rem;
  background: #fff;
  color: #0f172a;
}

.pi1-dialog textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.pi1-button-row,
.pi1-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
  margin-top: .8rem;
}

.pi1-dialog-actions { justify-content: flex-end; }
.pi1-confirm { grid-template-columns: auto 1fr !important; align-items: center; margin-top: 1rem; }
.pi1-confirm input { width: auto; }
.pi1-button-row button,
.pi1-dialog-actions button,
.pi1-dialog > form > button {
  border: 0;
  border-radius: 8px;
  padding: .65rem .9rem;
  background: #164e63;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.pi1-button-row button:disabled,
.pi1-dialog-actions button:disabled,
.pi1-dialog > form > button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.maintenance-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid #bed8cd;
  border-left: 5px solid var(--green);
  border-radius: 12px;
  background: linear-gradient(135deg, #f1faf6 0%, #ffffff 72%);
}

.maintenance-banner.compact { padding-block: 14px; }
.maintenance-banner h2 { margin: 2px 0 5px; font-size: 21px; }
.maintenance-banner p { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.5; }
.maintenance-banner > .badge { flex: 0 0 auto; font-size: 13px; padding: 8px 11px; }

.eyebrow {
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.friendly-status-grid,
.friendly-relay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.friendly-status-row {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.relay-friendly-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
}

.relay-friendly-card h3 { margin: 0; font-size: 16px; }

.relay-state-line {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.relay-state-line div {
  display: grid;
  gap: 3px;
  padding: 9px;
  border-radius: 7px;
  background: var(--surface-2);
}

.relay-state-line span,
.setting-strip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.setting-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #d6e5de;
  border-radius: 8px;
  background: #f2f8f5;
}

.setting-strip > div { display: grid; gap: 2px; }
.setting-strip.compact { padding-block: 8px; }
.dialog-note { color: var(--muted); line-height: 1.5; }

.diagnostics {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.diagnostics summary {
  width: max-content;
  cursor: pointer;
  color: var(--muted);
  font-weight: 750;
}

.diagnostics dl { display: grid; gap: 6px; margin: 10px 0 0; }
.diagnostics dl div { display: flex; justify-content: space-between; gap: 12px; }
.diagnostics dt { color: var(--muted); }
.diagnostics dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.diagnostics code { color: #40514a; font-size: 11px; overflow-wrap: anywhere; }
.diagnostics.inline { margin-top: 5px; border: 0; padding: 0; }
.diagnostics.inline summary { font-size: 11px; }

.friendly-sensor { align-content: center; }
.friendly-sensor .diagnostics { grid-column: 1 / -1; width: 100%; }
.stable-temperature-panel .panel-head {
  align-items: flex-start;
  flex-wrap: wrap;
}

.stable-temperature-panel .panel-head > div {
  min-width: 0;
  flex: 1 1 320px;
}

.stable-temperature-panel .panel-head > .refresh-link {
  flex: 0 0 auto;
}

.temperature-grid.stable-temperature-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.temperature-tile.stable-temperature-tile {
  min-width: 0;
  align-items: start;
}

.stable-temperature-tile .sensor-tile-copy,
.stable-temperature-tile .sensor-display-name,
.stable-temperature-tile .sensor-reading-meta,
.stable-temperature-tile .diagnostics,
.stable-temperature-tile .diagnostics dd {
  min-width: 0;
  max-width: 100%;
}

.stable-temperature-tile .sensor-display-name {
  display: block;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.stable-temperature-tile .sensor-reading-meta {
  line-height: 1.4;
}

.stable-temperature-tile .temperature-value {
  align-self: center;
  justify-self: end;
}

.stable-temperature-tile .diagnostics dl div {
  align-items: flex-start;
}

.compressor-guard-intro {
  color: var(--muted);
  line-height: 1.5;
}

.compressor-guard-intro strong {
  color: var(--ink);
}

.compact-row.compressor-guard-row {
  align-items: flex-start;
}

.compressor-guard-copy {
  min-width: 0;
  line-height: 1.4;
}

.compressor-guard-copy > strong,
.compressor-guard-copy > span {
  overflow-wrap: anywhere;
}

.guard-countdown-value {
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.compressor-guard-row > .badge {
  flex: 0 0 auto;
  min-width: 72px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.safety-order { margin: 0; padding-left: 1.25rem; }
.safety-order li { margin-bottom: .55rem; line-height: 1.45; }

.policy-lock-panel { border-left: 4px solid var(--green); }

@media (max-width: 700px) {
  .pi1-form-grid { grid-template-columns: 1fr; }
  .pi1-kv div { display: grid; }
  .pi1-kv dd { text-align: left; }
  .maintenance-banner { align-items: flex-start; flex-direction: column; }
  .relay-state-line { grid-template-columns: 1fr; }
  .setting-strip { align-items: stretch; flex-direction: column; }
}

.relay-mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.relay-mode-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.72fr) minmax(230px, 1fr) minmax(300px, 1.25fr);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-color, #d6dbe3);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--panel-bg, #fff);
}

.relay-mode-card-head {
  min-width: 0;
  display: grid;
  grid-column: 1;
  grid-row: 1 / 3;
  gap: 8px;
}

.relay-mode-card-head h3 {
  margin: 0 0 3px;
}

.relay-mode-readback {
  min-width: 0;
  display: grid;
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--surface-2);
}

.relay-mode-readback span {
  min-width: 0;
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.relay-mode-readback strong {
  color: var(--ink);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.relay-node-copy {
  min-width: 0;
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.relay-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0 10px;
}

.relay-mode-button {
  width: 100%;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 10px;
  text-align: left;
  border: 1px solid #cfd6df;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  cursor: pointer;
}

.relay-mode-button.good { border-color: #5ca77a; }
.relay-mode-button.warn { border-color: #d29a37; }
.relay-mode-button.bad { border-color: #cf5b63; }
.relay-mode-button.selected { box-shadow: 0 0 0 2px rgba(52, 112, 199, 0.25); }
.relay-mode-button:disabled { cursor: default; opacity: 0.68; }

.relay-mode-control {
  min-width: 0;
  display: grid;
  grid-column: 3;
  grid-row: 1 / 3;
  gap: 6px;
}

.relay-mode-control > label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.relay-mode-control-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.relay-mode-select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 34px 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
}

.relay-mode-selection-description {
  min-height: 1.25em;
  margin: 0;
}

.relay-mode-card > .control-note {
  grid-column: 1 / -1;
  margin: 0;
}

.facility-power-panel {
  border-top: 4px solid var(--green);
}

.facility-power-panel.facility-power-latched {
  border-top-color: var(--red);
}

.facility-power-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.facility-power-status-grid > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--surface-2);
}

.facility-power-status-grid span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.facility-power-status-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.facility-operation-progress {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #e6bd73;
  border-radius: 10px;
  background: var(--amber-soft);
}

.facility-operation-progress > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.facility-operation-progress p {
  margin: 0;
}

.facility-power-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.facility-power-action-card {
  min-width: 0;
  min-height: 138px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.facility-power-action-card.action-permanent_off {
  border-color: #d78b8b;
  background: #fffafa;
}

.facility-power-action-card.action-grace_permanent_off {
  border-color: #dcc18d;
  background: #fffdf8;
}

.facility-power-action-card.action-start {
  border-color: #91c2aa;
  background: #f9fdfa;
}

.facility-power-action-card h3,
.facility-power-action-card p {
  margin: 0;
}

.facility-power-action-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.facility-power-action-card > button {
  width: 100%;
}

.facility-grace-settings {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.facility-grace-settings summary {
  width: fit-content;
  cursor: pointer;
  color: var(--blue);
  font-weight: 800;
}

.facility-grace-settings[open] summary {
  margin-bottom: 14px;
}

.facility-grace-settings .control-form {
  max-width: 760px;
}

.facility-grace-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.control-form label.facility-settings-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 650;
  text-transform: none;
}

.facility-settings-confirm input {
  flex: 0 0 auto;
  margin-top: 2px;
}

.action-review-dialog {
  width: min(540px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(15, 25, 20, 0.28);
}

.action-review-dialog::backdrop {
  background: rgba(20, 29, 25, 0.52);
  backdrop-filter: blur(2px);
}

.action-review-dialog-content {
  display: grid;
  gap: 0;
}

.action-review-dialog [hidden] {
  display: none !important;
}

.action-review-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--line);
}

.action-review-dialog-head h2 {
  margin: 3px 0 0;
  font-size: 1.08rem;
}

.action-review-dialog-close {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
}

.action-review-description {
  margin: 0;
  padding: 14px 18px 4px;
  color: var(--muted);
  line-height: 1.5;
}

.action-review-summary {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 12px 18px;
}

.action-review-summary > div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
}

.action-review-summary dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.action-review-summary dd {
  margin: 0;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.action-review-reason,
.action-review-acknowledgement {
  margin: 0 18px 14px;
}

.action-review-reason {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.action-review-reason input {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.action-review-acknowledgement {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid #e2b0b0;
  border-radius: 8px;
  background: var(--red-soft);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
}

.action-review-acknowledgement input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 1px 0 0;
}

.action-review-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1180px) {
  .relay-mode-card {
    grid-template-columns: minmax(150px, 0.8fr) minmax(260px, 1.2fr);
  }

  .relay-mode-card-head,
  .relay-mode-readback {
    grid-row: 1;
  }

  .relay-mode-card-head {
    grid-column: 1;
  }

  .relay-mode-readback {
    grid-column: 2;
  }

  .relay-node-copy {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .relay-mode-control {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 860px) {
  .facility-power-panel > .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .facility-power-panel > .panel-head > .badge {
    align-self: flex-start;
  }

  .facility-power-actions,
  .facility-power-status-grid {
    grid-template-columns: 1fr;
  }

  .relay-modes-panel > .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .relay-modes-panel > .panel-head > .badge {
    align-self: flex-start;
  }

  .relay-mode-grid,
  .relay-mode-options,
  .relay-mode-status-grid {
    grid-template-columns: 1fr;
  }

  .relay-mode-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .relay-mode-card-head,
  .relay-mode-readback,
  .relay-node-copy,
  .relay-mode-control {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 560px) {
  .facility-grace-settings-grid {
    grid-template-columns: 1fr;
  }

  .relay-mode-control-row,
  .action-review-summary > div {
    grid-template-columns: 1fr;
  }

  .node-workspace-callout {
    align-items: stretch;
    flex-direction: column;
  }

  .node-workspace-callout .button-link {
    width: 100%;
  }

  .policy-domain-notes {
    grid-template-columns: 1fr;
  }

  .node-plan-toolbar > span {
    width: 100%;
  }

  .force-power-confirmation .button-row,
  .force-power-confirmation .button-row > form:first-child {
    align-items: stretch;
    flex-direction: column;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 9px 12px;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #202722;
  color: #f5f8f5;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #d7f0e5;
  color: #123f32;
  font-size: 14px;
  font-weight: 800;
}

.brand-title {
  font-size: 15px;
  font-weight: 760;
}

.brand-subtitle,
.sidebar-footer {
  color: #b6c2bb;
  font-size: 12px;
}

.nav-toggle {
  min-height: 44px;
  display: none;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: #2f3a33;
  color: #f5f8f5;
  padding: 0 11px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.nav-toggle-icon {
  width: 16px;
  display: grid;
  gap: 3px;
}

.nav-toggle-icon i {
  height: 2px;
  display: block;
  border-radius: 999px;
  background: currentColor;
}

.sidebar-content {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
}

.nav {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 15px;
  min-height: 0;
  padding-right: 3px;
  overflow-y: auto;
  scrollbar-color: #56665c transparent;
  scrollbar-width: thin;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group-label {
  margin: 0;
  padding: 0 10px;
  color: #8fa096;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.09em;
  line-height: 1.5;
  text-transform: uppercase;
}

.nav-group-operations .nav-group-label {
  color: #e6c886;
}

.nav-group-configuration .nav-group-label {
  color: #a9c9eb;
}

.nav-group-links {
  display: grid;
  gap: 3px;
}

.nav-link {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  color: #dce5df;
  font-size: 13px;
  font-weight: 620;
  line-height: 1.25;
}

.nav-link:hover,
.nav-link.active {
  background: #2f3a33;
  color: #ffffff;
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #6f8176;
}

.nav-link.active .nav-dot {
  background: #6fd4a8;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 10px;
}

.session-card {
  display: grid;
  gap: 2px;
}

.session-card span {
  color: #f5f8f5;
  font-size: 13px;
  font-weight: 800;
}

.session-card strong {
  color: #b6c2bb;
  font-size: 12px;
  font-weight: 650;
}

.logout-button {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: #2f3a33;
  color: #f5f8f5;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.page-context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.page-mode {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
}

.page-mode-operations {
  background: var(--amber-soft);
  color: var(--amber);
}

.page-mode-configuration {
  background: var(--blue-soft);
  color: var(--blue);
}

.section-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -6px 0 18px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
}

.section-nav-label {
  flex: 0 0 auto;
  padding-left: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.section-nav-links {
  min-width: 0;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.section-nav-link {
  min-height: 34px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.section-nav-link:hover,
.section-nav-link.active {
  background: var(--surface-2);
  color: var(--ink);
}

.section-nav-link-operations {
  color: var(--amber);
}

.section-nav-link-configuration {
  color: var(--blue);
}

.refresh-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

.refresh-link.secondary {
  background: var(--surface-2);
}

.live-refresh-control {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 0 6px 0 10px;
}

.live-refresh-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.live-refresh-control span.good {
  color: var(--green);
}

.live-refresh-control span.bad {
  color: var(--red);
}

.live-refresh-control span.paused {
  color: var(--amber);
}

.live-refresh-control .refresh-link {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.message-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.message {
  min-height: 38px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 8px 12px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 750;
}

.message.success {
  border-color: #b9dfce;
  background: var(--green-soft);
  color: var(--green);
}

.message.error {
  border-color: #ecc5c5;
  background: var(--red-soft);
  color: var(--red);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.power-current-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric,
.panel,
.line-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 116px;
  padding: 16px;
  display: grid;
  gap: 6px;
}

.metric-label,
.metric-detail,
.panel-note,
.compact-row span,
.line-panel p,
.line-top span,
.gpio-tile span,
.muted {
  color: var(--muted);
}

.metric-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

th .help-tip,
.metric-label .help-tip,
.control-subhead .help-tip {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  font-size: 11px;
}

.metric strong {
  font-size: 34px;
  line-height: 1;
}

.metric-detail {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.status-item {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.status-item strong {
  margin-left: auto;
  font-size: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.good {
  background: var(--green);
}

.status-dot.warn {
  background: var(--amber);
}

.status-dot.bad {
  background: var(--red);
}

.boot-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.boot-summary .metric {
  min-height: 128px;
}

.boot-summary .metric strong .badge {
  font-size: 12px;
}

.boot-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.boot-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.boot-step.passed {
  border-color: #b9dfce;
  background: var(--green-soft);
}

.boot-step.current {
  border-color: #ecd49c;
  background: var(--amber-soft);
}

.boot-step.failed {
  border-color: #ecc5c5;
  background: var(--red-soft);
}

.boot-step.pending {
  background: #f5f7f5;
}

.boot-step-marker {
  display: grid;
  place-items: start center;
  padding-top: 2px;
}

.boot-step-marker span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--muted);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.boot-step.passed .boot-step-marker span {
  background: var(--green);
}

.boot-step.current .boot-step-marker span {
  background: var(--amber);
}

.boot-step.failed .boot-step-marker span {
  background: var(--red);
}

.boot-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.boot-step-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.boot-step-status,
.boot-condition {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.boot-step-status {
  font-weight: 720;
}

.boot-condition {
  color: var(--muted);
}

.boot-step-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.boot-detail-columns td .muted {
  display: block;
  margin-top: 2px;
  font-size: 12px;
}

.boot-event-log .notice-row {
  min-height: 0;
  overflow-wrap: anywhere;
}

.alert-note {
  border-color: #ecc5c5;
  background: var(--red-soft);
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  padding: 16px;
  margin-bottom: 14px;
}

.panel-head,
.line-top,
.compact-row,
.gpio-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head {
  margin-bottom: 12px;
}

.panel-title-help {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.panel-head h2,
.line-top h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--cyan);
  cursor: help;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.help-tip:not(.help-rich)::after {
  content: attr(data-help);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: min(320px, 72vw);
  transform: translateX(-50%);
  border: 1px solid #cad8d3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--ink);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.help-tip:not(.help-rich)::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 3px);
  z-index: 21;
  width: 9px;
  height: 9px;
  transform: translateX(-50%) rotate(45deg);
  border-left: 1px solid #cad8d3;
  border-top: 1px solid #cad8d3;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.help-tip:hover,
.help-tip:focus,
.help-tip:focus-visible {
  border-color: #badfe5;
  background: var(--cyan-soft);
  outline: none;
}

.help-tip:not(.help-rich):hover::before,
.help-tip:not(.help-rich):hover::after,
.help-tip:not(.help-rich):focus::before,
.help-tip:not(.help-rich):focus::after,
.help-tip:not(.help-rich):focus-visible::before,
.help-tip:not(.help-rich):focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.help-rich {
  cursor: pointer;
}

.help-overview {
  margin-bottom: 14px;
  border: 1px solid #c6d8d2;
  border-radius: 8px;
  background: #f4faf8;
  box-shadow: var(--shadow);
}

.help-overview details {
  padding: 0;
}

.help-overview summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 850;
}

.help-overview summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.help-page-summary {
  margin: 0;
  padding: 0 14px 12px;
  color: #39473f;
  font-size: 13px;
  line-height: 1.45;
}

.help-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.help-topic {
  border: 1px solid #d7e5df;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.help-topic h3 {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.25;
}

.help-topic-section {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.help-topic-section strong {
  color: #26362e;
  font-size: 12px;
  text-transform: uppercase;
}

.help-topic-section ul {
  margin: 0;
  padding-left: 18px;
  color: #415149;
  font-size: 12px;
  line-height: 1.42;
}

.help-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.help-dialog::backdrop {
  background: rgba(20, 28, 24, 0.42);
}

.help-dialog-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(820px, calc(100vh - 32px));
  border: 1px solid #cbd8d2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.help-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f6faf8;
}

.help-dialog-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.help-dialog-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.help-dialog-body {
  display: grid;
  gap: 10px;
  padding: 16px;
  overflow: auto;
}

.help-dialog-body pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #33443b;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.panel-head a {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-row {
  min-height: 38px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.compact-row:last-child {
  border-bottom: 0;
}

.compact-row div {
  display: grid;
  gap: 2px;
}

.line-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.line-current-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.line-current-inline strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.line-current-inline em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 720;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.good {
  background: var(--green-soft);
  color: var(--green);
}

.badge.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.bad {
  background: var(--red-soft);
  color: var(--red);
}

.badge.neutral {
  background: var(--cyan-soft);
  color: var(--cyan);
}

.usage-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e8eee9;
  overflow: hidden;
}

.usage-bar.compact {
  margin-top: 6px;
  max-width: 180px;
}

.usage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
}

.usage-bar span.good {
  background: var(--green);
}

.usage-bar span.warn {
  background: var(--amber);
}

.usage-bar span.bad {
  background: var(--red);
}

.usage-bar span.neutral {
  background: var(--cyan);
}

.badge.plan-on,
.badge.plan-keep {
  background: var(--green-soft);
  color: var(--green);
}

.badge.plan-desired {
  background: var(--cyan-soft);
  color: var(--cyan);
}

.badge.plan-off-candidate {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.plan-busy {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge.plan-blocked {
  background: var(--red-soft);
  color: var(--red);
}

.badge.plan-neutral {
  background: #edf0ed;
  color: #46534c;
}

.temp {
  font-weight: 800;
  color: var(--cyan);
}

.ac-row {
  align-items: flex-start;
}

.ac-copy {
  min-width: 0;
}

.ac-temp-pair {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 8px;
  min-width: 254px;
  text-align: right;
}

.ac-temp-pair span {
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.ac-temp-pair strong {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.ac-temp-pair em {
  display: block;
  color: var(--red);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ac-fault-inline {
  margin-left: 6px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  white-space: nowrap;
}

td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  vertical-align: middle;
}

tbody tr:hover {
  background: #f9faf8;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 14px 0;
}

.compact-table {
  max-height: 640px;
}

.power-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.line-panel {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.line-current-meter {
  display: grid;
  gap: 2px;
  padding-left: 10px;
  border-left: 3px solid var(--cyan);
}

.line-current-meter span,
.line-current-meter em,
.line-current-meter small {
  color: var(--muted);
  font-style: normal;
  line-height: 1.3;
}

.line-current-meter span {
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.line-current-meter strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.05;
}

.line-current-meter em {
  font-size: 12px;
  font-weight: 760;
}

.line-current-meter small {
  font-size: 12px;
}

.line-current-meter.error {
  border-left-color: var(--red);
}

.line-current-meter.error small:last-child {
  color: var(--red);
  font-weight: 760;
}

.line-panel p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.node-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.node-pill,
.line-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 7px;
  background: #edf0ed;
  color: #344039;
  font-size: 12px;
  font-weight: 760;
}

.node-pill.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.node-pill.ipmi {
  border-color: #cce9d7;
  background: #f0faf4;
  color: #2f7650;
}

.node-pill.online {
  border-color: #2f8457;
  background: #3c9d67;
  color: #ffffff;
}

.line-chip {
  margin: 1px 3px 1px 0;
  background: var(--cyan-soft);
  color: var(--cyan);
}

.line-chip.line-on {
  background: var(--green-soft);
  color: var(--green);
}

.line-chip.line-off {
  background: #edf0ed;
  color: #46534c;
}

.line-chip.line-unknown {
  background: var(--red-soft);
  color: var(--red);
}

.node-pill.plan-on {
  border-color: #9bcfb8;
  background: var(--green-soft);
  color: var(--green);
}

.node-pill.plan-desired {
  border-color: #badfe5;
  background: var(--cyan-soft);
  color: var(--cyan);
}

.node-pill.plan-off-candidate {
  border-color: #ecd19a;
  background: var(--amber-soft);
  color: var(--amber);
}

.hpc-power-summary .metric {
  min-height: 108px;
}

.runtime-summary .metric {
  min-height: 108px;
}

.runtime-summary .metric strong .badge {
  min-height: 30px;
  font-size: 12px;
}

.runtime-history .notice-row {
  min-height: 34px;
  padding: 9px 12px;
}

.control-panel {
  display: grid;
  align-content: start;
}

.control-form {
  display: grid;
  gap: 10px;
}

.control-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.control-form input[type="number"],
.control-form input[type="text"],
.control-form input[type="datetime-local"],
.control-form select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
}

.control-form textarea {
  min-height: 156px;
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.control-form textarea.wide-textarea {
  min-height: 420px;
}

.fan-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fan-status-item {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.fan-status-item:last-child {
  border-right: 0;
}

.fan-status-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.fan-status-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.fan-control-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 22px;
  align-items: start;
}

.fan-mode-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.fan-mode-fieldset legend {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
}

.segmented-control.two-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-head-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.schedule-mode-form {
  margin-top: 18px;
}

.schedule-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.schedule-mode-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.schedule-mode-fieldset legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.schedule-control-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.schedule-mode-form > .primary-button {
  width: min(280px, 100%);
}

.schedule-advanced {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.schedule-advanced summary {
  width: fit-content;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.schedule-advanced[open] summary {
  margin-bottom: 14px;
}

.control-form .segmented-option {
  position: relative;
  display: block;
  min-width: 0;
  color: var(--ink);
  text-transform: none;
  cursor: pointer;
}

.segmented-option + .segmented-option {
  border-left: 1px solid var(--line);
}

.segmented-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.segmented-option span {
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 7px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.segmented-option:has(input:checked) span {
  background: var(--green);
  color: #ffffff;
}

.segmented-option:has(input:focus-visible) span {
  outline: 2px solid var(--cyan);
  outline-offset: -3px;
}

.fan-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.fan-policy-form > .primary-button {
  width: min(220px, 100%);
}

.fan-override-control {
  min-width: 0;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.fan-override-control .control-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.fan-override-control .control-subhead h3 {
  margin: 0;
  font-size: 14px;
}

.fan-override-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fan-override-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  margin: 14px 0 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.fan-override-meta span {
  color: var(--muted);
}

.fan-override-meta strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.fan-cancel-button {
  width: 100%;
}

.dense-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.dense-form button {
  min-width: 0;
}

.thermal-safety-panel {
  grid-column: 1 / -1;
}

.thermal-safety-panel .control-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 0;
}

.thermal-safety-panel .control-subhead h3 {
  margin: 0;
  font-size: 14px;
}

.thermal-settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.thermal-reset-row {
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.button-row.wrap {
  flex-wrap: wrap;
}

.button-row form {
  margin: 0;
}

.small-button {
  min-height: 40px;
  padding: 0 11px;
  font-size: 12px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.check-row {
  min-height: 40px;
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  padding: 8px 10px;
  color: var(--ink) !important;
  text-transform: none !important;
}

.check-row input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.primary-button,
.danger-button,
.secondary-button,
.warning-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
}

.primary-button:disabled,
.danger-button:disabled,
.secondary-button:disabled,
.warning-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary-button:focus-visible,
.danger-button:focus-visible,
.secondary-button:focus-visible,
.warning-button:focus-visible {
  outline: 3px solid rgba(40, 95, 159, 0.28);
  outline-offset: 2px;
}

.primary-button {
  border: 0;
  color: #ffffff;
  background: var(--green);
}

.danger-button {
  border: 0;
  color: #ffffff;
  background: var(--red);
}

.warning-button {
  border: 0;
  color: #ffffff;
  background: var(--amber);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #f3f6f5;
}

.button-link {
  width: fit-content;
  text-decoration: none;
}

button[aria-busy="true"] {
  cursor: progress;
  opacity: 0.72;
}

.danger-zone {
  border-color: #ecc5c5;
}

.power-plan-editor {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
}

.power-plan-editor .primary-button,
.power-plan-editor .secondary-button,
.power-plan-editor .warning-button,
.power-plan-editor .danger-button {
  min-width: 150px;
}

.power-plan-editor .help-tip {
  width: 22px;
  min-width: 22px;
}

.node-workspace-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #bdd2e9;
  border-radius: 10px;
  background: #f5f9ff;
}

.node-workspace-callout p {
  max-width: 860px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.control-form select.relay-mode-select {
  padding: 0 34px 0 10px;
  font-size: 0.82rem;
}

.hpc-policy-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.hpc-policy-form button {
  min-width: 170px;
}

.ac-fault-policy-form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
}

.ac-fault-policy-form button {
  min-width: 160px;
}

.ac-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ac-control-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 14px;
}

.ac-control-item .panel-head h2 {
  font-size: 15px;
}

.control-mini-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.control-mini-facts span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
}

.fault-panel {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid #ecc5c5;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  line-height: 1.35;
}

.fault-panel strong {
  text-transform: uppercase;
  letter-spacing: 0;
}

.fault-panel span {
  overflow-wrap: anywhere;
}

.fault-panel form {
  margin: 2px 0 0;
}

.control-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.section-divider {
  height: 1px;
  margin: 12px 0;
  background: var(--line);
}

.control-subhead {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.25;
}

.temporary-gpio-list {
  display: grid;
  gap: 8px;
}

.temporary-gpio-row,
.alarm-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 8px 10px;
}

.alarm-control {
  margin-top: 8px;
  border-color: #badfe5;
  background: #f4fbfc;
}

.temporary-gpio-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.temporary-gpio-meta strong {
  font-size: 13px;
}

.temporary-gpio-meta span {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.compact-actions {
  margin-top: 0;
}

.control-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.control-status-item {
  min-height: 92px;
  display: grid;
  align-content: start;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
  font-size: 13px;
}

.control-status-item span {
  color: var(--muted);
  line-height: 1.4;
}

.audit-table td {
  vertical-align: top;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.plan-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.plan-facts div {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.plan-facts span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.plan-facts strong {
  font-size: 20px;
}

.plan-block {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
}

.power-plan-table tbody tr.plan-on-row {
  background: #f3fbf7;
}

.power-plan-table tbody tr.plan-desired-row {
  background: #f4fbfc;
}

.power-plan-table tbody tr.plan-idle-row {
  background: #fffaf0;
}

.power-plan-table tbody tr.plan-busy-row {
  background: #f5f8ff;
}

.power-plan-table tbody tr.plan-blocked-row {
  background: #fff7f7;
}

.cell-note {
  display: block;
  max-width: 220px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.manual-power-table td:last-child {
  min-width: 300px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.node-plan-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.node-plan-toolbar > span {
  margin-right: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.text-button {
  min-height: 40px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
}

.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.node-plan-table {
  min-width: 1060px;
}

.node-plan-table th,
.node-plan-table td {
  padding: 10px 8px;
  vertical-align: middle;
}

.node-plan-table th:first-child,
.node-plan-table td:first-child {
  width: 36px;
  text-align: center;
}

.node-plan-table th:nth-child(2),
.node-plan-table td:nth-child(2) {
  min-width: 190px;
}

.node-plan-table select,
.node-plan-table .compact-number-input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
}

.node-plan-table select {
  width: 100%;
  min-width: 130px;
  padding: 0 30px 0 8px;
}

.node-boot-segment {
  min-width: 238px;
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.node-boot-segment input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.node-boot-segment label {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.node-boot-segment input[value="boot_on"]:checked + label {
  border-color: #91c2aa;
  background: var(--green-soft);
  color: var(--green);
}

.node-boot-segment input[value="boot_off"]:checked + label {
  border-color: #ddbf83;
  background: var(--amber-soft);
  color: var(--amber);
}

.node-boot-segment input[value="unmanaged"]:checked + label {
  border-color: #c6cec8;
  background: var(--surface);
  color: var(--ink);
}

.node-boot-segment input:focus-visible + label {
  outline: 3px solid rgba(40, 95, 159, 0.24);
  outline-offset: 1px;
}

.node-plan-table .compact-number-input {
  width: 72px;
  padding: 0 7px;
}

.node-plan-table select:focus-visible,
.node-plan-table .compact-number-input:focus-visible,
.force-power-form input:focus-visible {
  outline: 3px solid rgba(40, 95, 159, 0.22);
  outline-offset: 1px;
  border-color: var(--blue);
}

.node-plan-table tbody tr:has([data-row-select]:checked) {
  background: #f2faf6;
}

.node-state-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
}

.policy-domain-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.policy-domain-notes .notice-row {
  min-height: 96px;
  align-content: start;
  border-left: 3px solid var(--blue);
}

.node-plan-save-row {
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.node-plan-save-row > .muted {
  max-width: 620px;
  font-size: 0.78rem;
  line-height: 1.4;
}

.force-power-confirmation {
  border-width: 2px;
  background: #fffafa;
}

.force-power-confirmation .button-row > form:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.force-acknowledgement {
  max-width: 660px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #e2b0b0;
  border-radius: 8px;
  background: var(--red-soft);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
}

.force-acknowledgement input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 1px 0 0;
}

.manual-power-table {
  min-width: 980px;
}

.node-power-action-menu {
  min-width: 0;
}

.node-power-action-menu > summary {
  list-style: none;
}

.node-power-action-menu > summary::-webkit-details-marker {
  display: none;
}

.node-power-action-menu[open] > summary {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(40, 95, 159, 0.12);
}

.node-power-action-menu-card {
  width: min(430px, 100%);
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.force-power-form {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.force-power-form > label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.force-power-form input[type="text"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.server-action-row {
  margin-top: 0;
  gap: 6px;
}

.server-action-row .small-button {
  min-width: 76px;
}

.gpio-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.temperature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.temperature-tile {
  min-height: 84px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.temperature-tile div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.temperature-tile span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.temperature-tile .temperature-value {
  color: var(--cyan);
  font-size: 20px;
  font-weight: 850;
  white-space: nowrap;
}

.temperature-tile .temperature-value.bad {
  color: var(--red);
}

.gpio-tile {
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.gpio-tile div {
  display: grid;
  gap: 3px;
}

.alert-panel {
  border-color: #ecc5c5;
}

.notice-row {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  font-size: 13px;
}

.notice-row span {
  color: var(--muted);
}

.notice-row > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-toolbar {
  display: grid;
  gap: 12px;
}

.history-controls {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) repeat(2, minmax(190px, 1fr)) auto auto auto;
  gap: 10px;
  align-items: end;
}

.history-controls label {
  display: grid;
  gap: 5px;
}

.history-controls label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.history-controls select,
.history-controls input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 0 9px;
  font: inherit;
  font-size: 13px;
}

.history-controls button {
  justify-content: center;
  cursor: pointer;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.history-status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 9px;
  font-size: 13px;
  font-weight: 700;
}

.history-timezone {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-status.good {
  background: var(--green-soft);
  color: var(--green);
}

.history-status.bad {
  background: var(--red-soft);
  color: var(--red);
}

.series-controls {
  display: grid;
  gap: 8px;
  margin: 12px 0 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.series-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.series-control-actions {
  display: flex;
  gap: 6px;
}

.series-control-actions button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  min-height: 28px;
  padding: 0 10px;
}

.series-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.series-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  max-width: 230px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
}

.series-pill:has(input:not(:checked)) {
  color: var(--muted);
  opacity: 0.62;
}

.series-pill input {
  margin: 0;
}

.series-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.series-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-chart {
  width: 100%;
  min-height: 470px;
}

.history-chart.pin-chart {
  min-height: 520px;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
}

.login-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--ink);
}

.login-brand .brand-subtitle {
  color: var(--muted);
}

.login-panel h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.login-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-form input {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
  text-transform: none;
}

.login-form button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
}

.login-help {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6faf8;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.login-help summary {
  cursor: pointer;
  font-weight: 850;
}

.login-help p {
  margin: 8px 0 0;
  color: #415149;
}

.login-error {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid #ecc5c5;
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 750;
}

@media (max-width: 1180px) {
  .summary-grid,
  .power-grid,
  .status-strip,
  .help-topic-grid,
  .plan-facts,
  .control-status-grid,
  .hpc-policy-form,
  .ac-fault-policy-form,
  .power-plan-editor,
  .ac-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dense-form,
  .check-grid,
  .fan-status-grid,
  .fan-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .thermal-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gpio-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .temperature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: auto;
    padding: 11px 14px;
    overflow: visible;
  }

  .sidebar-header {
    min-height: 46px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .sidebar-content {
    max-height: calc(100dvh - 68px);
    padding-top: 6px;
    overflow: hidden;
  }

  .nav-enhanced .sidebar:not(.nav-open) .sidebar-content {
    display: none;
  }

  .nav {
    grid-template-columns: 1fr;
    padding-right: 5px;
  }

  .nav-link {
    min-height: 44px;
    font-size: 14px;
  }

  .sidebar-footer {
    margin-top: 0;
  }

  .section-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    margin-top: -4px;
  }

  .section-nav-label {
    padding: 2px 7px 0;
  }

  .section-nav-links {
    width: 100%;
  }

  .section-nav-link {
    min-height: 44px;
  }

  .main {
    padding: 16px;
  }

  .topbar,
  .two-column,
  .summary-grid,
  .power-grid,
  .status-strip,
  .help-topic-grid,
  .gpio-grid,
  .temperature-grid,
  .plan-facts,
  .control-status-grid,
  .dense-form,
  .hpc-policy-form,
  .ac-fault-policy-form,
  .check-grid,
  .power-plan-editor,
  .ac-control-grid,
  .fan-status-grid,
  .fan-settings-grid,
  .fan-control-layout,
  .schedule-mode-grid {
    grid-template-columns: 1fr;
  }

  .thermal-settings-grid {
    grid-template-columns: 1fr;
  }

  .fan-status-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .fan-status-item:last-child {
    border-bottom: 0;
  }

  .fan-override-control {
    padding-top: 16px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .help-overview summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .help-topic {
    padding: 10px;
  }

  .ac-row {
    align-items: stretch;
    flex-direction: column;
  }

  .ac-temp-pair {
    min-width: 0;
    text-align: left;
  }

  .history-controls {
    grid-template-columns: 1fr;
  }

  .history-chart,
  .history-chart.pin-chart {
    min-height: 360px;
  }

  .series-control-head {
    align-items: stretch;
    flex-direction: column;
  }

  .series-control-actions {
    width: 100%;
  }

  .series-control-actions button {
    flex: 1;
  }

  .temporary-gpio-row,
  .alarm-control {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .compact-actions {
    width: 100%;
  }

  .compact-actions form,
  .compact-actions button {
    flex: 1;
  }

  .boot-step {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .boot-step-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .node-workspace-callout {
    align-items: stretch;
    flex-direction: column;
  }

  .node-workspace-callout .button-link {
    width: 100%;
  }
}

/* Relay controls: plain-language hierarchy and durable three-mode controls. */
.relay-page-intro,
.relay-section-heading,
.relay-mode-card-head,
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.relay-page-intro {
  align-items: center;
  margin-bottom: 1rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid #cbded5;
  border-radius: 14px;
  background: linear-gradient(135deg, #edf8f3 0%, #fff 72%);
  box-shadow: var(--shadow);
}

.relay-page-intro h2,
.relay-section-heading h2,
.relay-mode-card h3,
.dialog-heading h2 {
  margin: .15rem 0 .35rem;
}

.relay-page-intro p,
.relay-section-heading p {
  max-width: 800px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.global-off-banner {
  display: grid;
  gap: .25rem;
  margin: 1rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid #e7b6b6;
  border-left: 5px solid var(--red);
  border-radius: 10px;
  background: var(--red-soft);
}

.global-off-banner span { color: #743434; }

.relay-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.relay-section:first-of-type { border-top: 0; }
.relay-section-heading { align-items: center; margin-bottom: .9rem; }

.facility-gate-card,
.relay-mode-card,
.fan-control-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(29, 37, 33, .055);
}

.relay-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.relay-mode-grid.single-card { grid-template-columns: minmax(0, 720px); }
.relay-mode-card { display: grid; align-content: start; gap: .85rem; }
.relay-mode-card-head { align-items: center; }

.relay-state-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}

.relay-state-summary > div {
  display: grid;
  align-content: start;
  gap: .2rem;
  min-height: 54px;
  padding: .7rem;
  border-radius: 8px;
  background: var(--surface-2);
}

.relay-state-summary span,
.fan-policy-summary span,
.relay-card-actions span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.relay-state-summary strong { overflow-wrap: anywhere; }
.state-on { color: var(--green); }
.state-off { color: var(--red); }
.state-unknown { color: var(--amber); }

.relay-explanation {
  margin: 0;
  padding: .7rem .8rem;
  border-left: 3px solid var(--cyan);
  border-radius: 6px;
  background: var(--cyan-soft);
  color: #31535a;
  line-height: 1.45;
}

.relay-explanation.forced-off {
  border-color: var(--red);
  background: var(--red-soft);
  color: #743434;
}

.relay-explanation.handoff {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: #704a0c;
}

.relay-mode-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.relay-mode-form legend {
  margin-bottom: .45rem;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.mode-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
}

.mode-option {
  min-height: 42px;
  padding: .6rem .45rem;
  border: 1px solid #b9c8c0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.mode-option:hover { border-color: var(--green); background: #f3faf7; }
.mode-option.is-active { border-color: var(--green); background: var(--green-soft); color: #155a45; box-shadow: inset 0 0 0 1px var(--green); }
.mode-option:focus-visible { outline: 3px solid rgba(40, 95, 159, .24); outline-offset: 2px; }
.mode-option:disabled { cursor: not-allowed; }
.mode-option.is-active:disabled { opacity: 1; }
.relay-mode-form fieldset:disabled .mode-option { cursor: not-allowed; opacity: .52; }

.mode-help {
  margin: -.3rem 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.relay-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
}

.relay-card-actions > div { display: grid; gap: .08rem; }
.relay-card-actions small { color: var(--muted); }

.dialog-heading { align-items: center; margin-bottom: .75rem; }
.dialog-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.schedule-list { display: grid; gap: .4rem; margin: 1rem 0; }
.schedule-list > div:not(.empty) {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto auto;
  align-items: center;
  gap: .75rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.advanced-settings {
  margin-top: .8rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}

.advanced-settings summary { cursor: pointer; font-weight: 750; color: var(--cyan); }
.advanced-settings form { display: grid; gap: .7rem; margin-top: .75rem; }
.advanced-settings label { display: grid; gap: .35rem; font-weight: 650; color: var(--muted); }
.advanced-settings textarea { box-sizing: border-box; width: 100%; padding: .7rem; border: 1px solid #b8c2cf; border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.fan-control-card { display: grid; gap: 1rem; }
.fan-policy-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.fan-policy-summary > div { display: grid; gap: .2rem; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 8px; }

.settings-fieldset {
  margin: .9rem 0;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.settings-fieldset legend { padding: 0 .4rem; color: var(--ink); font-weight: 800; }
.auxiliary-relays { margin-top: 1.25rem; }
.auxiliary-relays > summary { cursor: pointer; font-weight: 750; }
.auxiliary-relays .friendly-status-grid { margin-top: .9rem; }

@media (max-width: 900px) {
  .relay-mode-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .relay-page-intro,
  .relay-section-heading,
  .relay-mode-card-head { align-items: stretch; flex-direction: column; }
  .relay-state-summary,
  .fan-policy-summary { grid-template-columns: 1fr; }
  .mode-selector { grid-template-columns: 1fr; }
  .relay-card-actions { align-items: stretch; flex-direction: column; }
  .relay-card-actions button { width: 100%; }
}

@media (max-width: 760px) {
  .policy-domain-notes {
    grid-template-columns: 1fr;
  }

  .node-plan-toolbar > span {
    width: 100%;
  }

  .force-power-confirmation .button-row,
  .force-power-confirmation .button-row > form:first-child {
    align-items: stretch;
    flex-direction: column;
  }

  .action-review-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .action-review-dialog-actions > button {
    width: 100%;
  }
}

/* Pi1 staff portal readability pass (2026-09-05).
   The current relay template is vertical; these scoped rules prevent the
   retired three-column relay-card layout above from placing sections beside
   and on top of one another. */
.vnext-load-grid,
.vnext-utility-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
}

.vnext-relay-card {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.vnext-relay-card > * {
  min-width: 0;
  grid-column: 1 / -1;
  grid-row: auto;
}

.vnext-relay-card > .relay-mode-card-head {
  grid-column: 1;
  grid-row: auto;
}

.environment-support-grid {
  grid-template-columns: minmax(0, 1fr);
}

.pi1-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
}

.message {
  display: block;
  line-height: 1.45;
}

.message.warning {
  border-color: #ead09a;
  background: var(--amber-soft);
  color: #704a0c;
}

.pi1-dialog-actions .primary-button {
  border: 0;
  background: var(--green);
  color: #fff;
}

.pi1-dialog-actions .secondary-button {
  border: 1px solid var(--line);
  background: #f3f6f5;
  color: var(--ink);
}

.metric strong,
.temperature-value,
.guard-countdown-value,
.pi1-kv dd {
  font-variant-numeric: tabular-nums;
}

.metric strong {
  font-size: clamp(1.35rem, 2.2vw, 2.125rem);
  overflow-wrap: anywhere;
}

@media (min-width: 761px) and (max-width: 1320px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-head > .badge,
  .panel-head > .refresh-link {
    align-self: flex-start;
  }
}
