:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #20292f;
  background: #f5f7f8;
  font-synthesis: none;
  letter-spacing: 0;
  --topbar: #172026;
  --surface: #ffffff;
  --canvas: #f5f7f8;
  --text: #20292f;
  --muted: #63717a;
  --border: #d9e0e4;
  --border-strong: #c3cdd3;
  --blue: #1768b5;
  --blue-soft: #e8f2fb;
  --green: #168650;
  --amber: #a35d00;
  --red: #c2352b;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  background: var(--canvas);
}

button {
  font: inherit;
  letter-spacing: 0;
}

button:focus-visible {
  outline: 3px solid rgba(23, 104, 181, 0.28);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: fixed;
  z-index: 40;
  inset: 0 0 auto 0;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--topbar);
  border-bottom: 1px solid #0d1418;
}

.product-mark,
.host-identity,
.freshness {
  display: flex;
  align-items: center;
}

.product-mark {
  gap: 10px;
  min-width: max-content;
  font-size: 17px;
  font-weight: 650;
}

.product-mark img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: #556169;
}

.host-identity {
  gap: 8px;
  min-width: 0;
  font-size: 12px;
}

.host-identity span {
  color: #aeb9bf;
}

.host-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.topbar-spacer {
  flex: 1;
}

.freshness {
  gap: 7px;
  min-width: max-content;
  color: #dce3e6;
  font-size: 12px;
}

.freshness i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #39c873;
  box-shadow: 0 0 0 3px rgba(57, 200, 115, 0.12);
}

.read-only {
  min-width: max-content;
  padding: 4px 7px;
  color: #dce3e6;
  border: 1px solid #58656d;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 36px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
}

.icon-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.12);
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.refresh-button img {
  width: 21px;
  height: 21px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.refresh-button.is-refreshing img {
  animation: pulse 850ms ease-in-out infinite alternate;
}

@keyframes pulse {
  to { opacity: 0.35; }
}

.menu-button {
  display: none;
}

.menu-glyph {
  width: 20px;
  display: grid;
  gap: 4px;
}

.menu-glyph i {
  height: 2px;
  display: block;
  background: currentColor;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 56px auto 0 0;
  width: 190px;
  padding: 14px 10px;
  background: #ffffff;
  border-right: 1px solid var(--border);
}

.sidebar nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  color: #3d4a52;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.nav-item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.nav-item:hover {
  color: #1b2730;
  background: #f1f4f6;
}

.nav-item.is-active {
  color: #0c579d;
  background: var(--blue-soft);
  border-color: #cce2f5;
}

.sidebar-scrim {
  display: none;
}

.main-content {
  min-height: 100vh;
  margin-left: 190px;
  padding: 80px 24px 24px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.page-heading h1 {
  margin: 0;
  color: #182229;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}

.page-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.page-heading > span {
  padding-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.error-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 11px 12px;
  color: #7e221c;
  background: #fceceb;
  border: 1px solid #efc6c2;
  border-radius: 5px;
  font-size: 13px;
}

.error-banner[hidden] {
  display: none;
}

.error-banner span {
  color: #754a47;
}

.error-banner button {
  margin-left: auto;
  padding: 6px 10px;
  color: #7e221c;
  background: #ffffff;
  border: 1px solid #dcaaa5;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.loading-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--border);
  font-size: 14px;
}

.loading-state[hidden] {
  display: none;
}

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

.summary-metric {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}

.summary-metric > div {
  display: grid;
  gap: 2px;
}

.summary-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.summary-metric strong {
  color: var(--text);
  font-size: 25px;
  line-height: 1;
}

.status-mark {
  width: 13px;
  height: 13px;
  display: inline-block;
  flex: 0 0 13px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: currentColor;
  box-shadow: inset 0 0 0 3px #ffffff;
}

.summary-metric > .status-mark {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-width: 3px;
  box-shadow: inset 0 0 0 7px #ffffff;
}

.status-healthy,
.tone-healthy { color: var(--green); }
.status-degraded,
.status-unknown,
.tone-degraded { color: var(--amber); }
.status-critical,
.status-offline,
.tone-offline { color: var(--red); }
.status-neutral,
.tone-neutral { color: #5b6870; }

.summary-metric.tone-healthy strong,
.summary-metric.tone-healthy > .status-mark { color: var(--green); }
.summary-metric.tone-degraded strong,
.summary-metric.tone-degraded > .status-mark { color: var(--amber); }
.summary-metric.tone-offline strong,
.summary-metric.tone-offline > .status-mark { color: var(--red); }
.summary-metric.tone-neutral > .status-mark { color: #5b6870; }

.storage-section,
.resource-section {
  margin-bottom: 22px;
}

.section-heading-row {
  min-height: 36px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-strong);
}

.section-heading-row > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-heading-row h2 {
  margin: 0;
  padding-bottom: 9px;
  color: #1c272e;
  font-size: 16px;
  line-height: 1.2;
}

.section-heading-row span {
  color: var(--muted);
  font-size: 11px;
}

.storage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-top: 12px;
}

.storage-volume {
  min-width: 0;
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.storage-volume-header {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.manual-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.storage-volume-header h3 {
  overflow: hidden;
  margin: 0;
  color: #27333a;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-volume-header span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.storage-volume-header strong {
  color: #46535b;
  font-size: 11px;
  font-weight: 600;
}

.capacity-track {
  height: 6px;
  overflow: hidden;
  margin: 13px 0 8px;
  background: #e4e9ec;
  border-radius: 3px;
}

.capacity-track span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
}

.storage-volume[data-health="degraded"] .capacity-track span,
.storage-volume[data-health="unknown"] .capacity-track span {
  background: var(--amber);
}

.storage-volume[data-health="critical"] .capacity-track span,
.storage-volume[data-health="offline"] .capacity-track span {
  background: var(--red);
}

.storage-volume-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.storage-volume-footer span:first-child {
  color: #34424a;
  font-weight: 650;
}

.overview-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
  align-items: start;
}

.overview-sections .resource-section:nth-child(n + 3) {
  grid-column: 1 / -1;
}

.resource-table {
  background: #ffffff;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.resource-table-header,
.resource-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(180px, 1.4fr) minmax(125px, .75fr) minmax(145px, .75fr);
  align-items: center;
  column-gap: 12px;
}

@media (min-width: 1181px) {
  .overview-sections .resource-table-header,
  .overview-sections .resource-row {
    grid-template-columns: minmax(105px, 1fr) minmax(120px, 1.25fr) minmax(90px, .75fr) minmax(105px, .8fr);
  }
}

.resource-table-header {
  min-height: 35px;
  padding: 0 13px;
  color: #5d6a72;
  background: #f6f8f9;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.resource-entry + .resource-entry {
  border-top: 1px solid var(--border);
}

.resource-row {
  width: 100%;
  min-height: 49px;
  padding: 7px 13px;
  color: var(--text);
  background: #ffffff;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.resource-row:hover {
  background: #f9fbfc;
}

.resource-name,
.health-label {
  min-width: 0;
  display: flex;
  align-items: center;
}

.resource-name {
  gap: 9px;
}

.chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-right: 2px solid #77858e;
  border-bottom: 2px solid #77858e;
  transform: rotate(-45deg);
  transition: transform 120ms ease-out;
}

.chevron.is-open {
  transform: rotate(45deg);
}

.resource-name strong,
.resource-summary,
.observed-time {
  overflow-wrap: anywhere;
}

.resource-name strong {
  color: #26333b;
  font-size: 12px;
  font-weight: 650;
}

.resource-summary,
.observed-time {
  color: #5c6971;
  font-size: 11px;
}

.health-label {
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.health-label small {
  display: none;
}

.resource-entry[data-health="healthy"] .health-label { color: var(--green); }
.resource-entry[data-health="degraded"] .health-label,
.resource-entry[data-health="unknown"] .health-label { color: var(--amber); }
.resource-entry[data-health="critical"] .health-label,
.resource-entry[data-health="offline"] .health-label { color: var(--red); }

.resource-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 10px 13px 12px 35px;
  background: #f7f9fa;
  border-top: 1px solid var(--border);
}

.resource-details > div {
  min-width: 0;
  padding: 4px 14px 4px 0;
}

.resource-details dt {
  margin-bottom: 2px;
  color: #69767e;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.resource-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #2e3a42;
  font-size: 11px;
}

.empty-message {
  min-height: 80px;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--border);
  border-top: 0;
  font-size: 12px;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  color: #7a878e;
  border-top: 1px solid var(--border);
  font-size: 10px;
}

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

  .overview-sections {
    grid-template-columns: 1fr;
  }

  .overview-sections .resource-section {
    grid-column: auto;
  }
}

@media (max-width: 800px) {
  .topbar {
    gap: 8px;
    padding: 0 10px;
  }

  .menu-button {
    display: inline-grid;
  }

  .product-mark {
    gap: 7px;
    font-size: 15px;
  }

  .product-mark img,
  .topbar-divider,
  .host-identity,
  .freshness span {
    display: none;
  }

  .topbar-spacer {
    display: none;
  }

  .freshness {
    margin-left: auto;
  }

  .read-only {
    padding: 4px 6px;
    font-size: 10px;
  }

  .sidebar {
    width: min(280px, calc(100vw - 44px));
    transform: translateX(-102%);
    transition: transform 170ms ease-out;
    box-shadow: 12px 0 30px rgba(18, 28, 34, 0.14);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scrim.is-visible {
    position: fixed;
    z-index: 20;
    inset: 56px 0 0;
    display: block;
    padding: 0;
    background: rgba(20, 29, 34, 0.36);
    border: 0;
  }

  .main-content {
    margin-left: 0;
    padding: 74px 14px 20px;
  }

  .page-heading {
    align-items: flex-start;
    margin-bottom: 15px;
  }

  .page-heading h1 {
    font-size: 21px;
  }

  .page-heading > span {
    padding-top: 5px;
  }

  .summary-grid {
    gap: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
  }

  .summary-metric {
    min-height: 78px;
    border: 0;
    border-radius: 0;
  }

  .summary-metric:nth-child(odd) {
    border-right: 1px solid var(--border);
  }

  .summary-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .storage-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 0;
    background: #ffffff;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
  }

  .storage-volume {
    border: 0;
    border-radius: 0;
  }

  .storage-volume + .storage-volume {
    border-top: 1px solid var(--border);
  }

  .section-heading-row {
    min-height: 42px;
  }

  .resource-table-header {
    display: none;
  }

  .resource-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 14px;
    min-height: 72px;
    padding: 10px 12px;
  }

  .resource-name {
    align-self: end;
  }

  .resource-summary {
    grid-column: 1;
    padding-left: 17px;
  }

  .health-label {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    justify-self: end;
  }

  .observed-time {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }

  .resource-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 29px;
  }

  .error-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .error-banner button {
    margin-left: 0;
  }
}

@media (max-width: 430px) {
  .product-mark span {
    max-width: 174px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .summary-metric {
    gap: 9px;
    padding: 12px;
  }

  .summary-metric > .status-mark {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
    box-shadow: inset 0 0 0 6px #ffffff;
  }

  .resource-row {
    grid-template-columns: minmax(0, 1fr) minmax(90px, auto);
  }

  .resource-details {
    grid-template-columns: 1fr;
  }

  .page-footer {
    flex-direction: column;
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Authenticated control-plane additions */
[hidden] {
  display: none !important;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #edf1f3;
}

.auth-panel {
  width: min(430px, 100%);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 16px 38px rgba(21, 31, 37, 0.14);
}

.auth-brand {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 18px;
  color: #ffffff;
  background: var(--topbar);
  border-bottom: 1px solid #0d1418;
}

.auth-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.auth-brand div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.auth-brand strong {
  font-size: 17px;
}

.auth-brand span {
  overflow: hidden;
  color: #b9c4ca;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-message {
  margin: 16px 18px 0;
  padding: 9px 11px;
  color: #325263;
  background: #edf6fa;
  border: 1px solid #cce2eb;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.45;
}

.auth-message.is-error {
  color: #7e211d;
  background: #fff0ef;
  border-color: #f1c4c1;
}

.auth-form {
  display: grid;
  gap: 14px;
  padding: 20px 18px 22px;
}

.auth-form h1 {
  margin: 0 0 2px;
  color: #202c33;
  font-size: 19px;
  font-weight: 650;
}

.auth-form label,
.app-dialog label {
  display: grid;
  gap: 6px;
  color: #4f5c64;
  font-size: 11px;
  font-weight: 650;
}

.auth-form input,
.app-dialog input,
.app-dialog select,
.search-box input {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  outline: 0;
}

.auth-form input:focus,
.app-dialog input:focus,
.app-dialog select:focus,
.search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 104, 181, 0.12);
}

.primary-command,
.secondary-command {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 4px;
  font-weight: 650;
  cursor: pointer;
}

.primary-command {
  color: #ffffff;
  background: var(--blue);
  border: 1px solid #0e5b9f;
}

.primary-command:hover {
  background: #125c9f;
}

.primary-command.is-danger {
  background: var(--red);
  border-color: #a82c24;
}

.secondary-command {
  color: #34424a;
  background: #ffffff;
  border: 1px solid var(--border-strong);
}

.secondary-command:hover:not(:disabled) {
  background: #f2f5f6;
}

.secondary-command:disabled {
  cursor: default;
  opacity: .45;
}

.totp-setup {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  padding: 12px;
  background: #f6f8f9;
  border: 1px solid var(--border);
}

.totp-setup img {
  width: 132px;
  height: 132px;
  object-fit: contain;
  background: #ffffff;
}

.totp-setup div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.totp-setup span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.totp-setup code {
  overflow-wrap: anywhere;
  color: #28363e;
  font-size: 12px;
  line-height: 1.55;
}

.signed-in {
  max-width: 160px;
  overflow: hidden;
  color: #d6dfe3;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-action img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.topbar-action {
  position: relative;
}

.topbar-action > span {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  color: #ffffff;
  background: var(--red);
  border: 2px solid var(--topbar);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
}

.logout-button span {
  font-size: 24px;
  line-height: 1;
  transform: rotate(180deg);
}

.sidebar {
  width: 208px;
}

.main-content {
  margin-left: 208px;
}

.page-tools {
  min-width: min(320px, 42vw);
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.search-box input {
  height: 34px;
}

.resource-table-header,
.resource-row {
  grid-template-columns: minmax(170px, 1.1fr) minmax(260px, 1.8fr) minmax(140px, .75fr) minmax(190px, auto);
}

.resource-row {
  cursor: default;
}

.resource-name.resource-expand {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  color: var(--text);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.resource-summary {
  line-height: 1.35;
}

.health-label > span:last-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.health-label strong {
  font-size: 11px;
  font-weight: 650;
}

.health-label small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

.resource-action,
.plain-icon-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 32px;
  padding: 0;
  color: #35434b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}

.resource-action:hover,
.plain-icon-button:hover {
  background: #eef2f4;
  border-color: var(--border);
}

.resource-action.requires-confirmation:hover {
  background: #fff0ef;
  border-color: #efc5c2;
}

.resource-action img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

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

.jobs-drawer {
  position: fixed;
  z-index: 80;
  inset: 0 0 0 auto;
  width: min(430px, calc(100vw - 28px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #ffffff;
  border-left: 1px solid var(--border-strong);
  box-shadow: -16px 0 34px rgba(21, 31, 37, .16);
  transform: translateX(102%);
  transition: transform 170ms ease-out;
}

.jobs-drawer.is-open {
  transform: translateX(0);
}

.jobs-drawer > header,
.app-dialog header {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 15px;
  background: #f6f8f9;
  border-bottom: 1px solid var(--border);
}

.jobs-drawer > header div,
.app-dialog header div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.jobs-drawer > header strong,
.app-dialog header strong {
  color: #26333b;
  font-size: 14px;
}

.jobs-drawer > header span,
.app-dialog header span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-scrim {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: none;
  padding: 0;
  background: rgba(18, 27, 32, .34);
  border: 0;
}

.drawer-scrim.is-visible {
  display: block;
}

.jobs-list {
  overflow: auto;
  padding: 12px;
}

.job-entry {
  padding: 11px 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 3px solid #89969d;
  border-radius: 5px;
}

.job-entry + .job-entry {
  margin-top: 8px;
}

.job-entry.job-running,
.job-entry.job-queued { border-left-color: var(--blue); }
.job-entry.job-succeeded { border-left-color: var(--green); }
.job-entry.job-failed { border-left-color: var(--red); }

.job-entry > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.job-entry strong {
  font-size: 12px;
}

.job-state {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.job-entry p,
.job-entry small {
  display: block;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
}

.job-entry pre {
  max-height: 130px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 8px;
  color: #dfe7eb;
  background: #1e282e;
  border-radius: 3px;
  font: 10px/1.45 Consolas, monospace;
  white-space: pre-wrap;
}

.app-dialog {
  width: min(500px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 18px 48px rgba(18, 27, 32, .22);
}

.app-dialog::backdrop {
  background: rgba(18, 27, 32, .4);
}

.app-dialog form {
  display: grid;
}

.dialog-copy {
  padding: 16px 15px 4px;
  color: #4d5a62;
  font-size: 12px;
  line-height: 1.5;
}

.app-dialog form > label {
  margin: 12px 15px 0;
}

.app-dialog form > footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding: 12px 15px;
  background: #f6f8f9;
  border-top: 1px solid var(--border);
}

.file-dialog {
  width: min(960px, calc(100vw - 28px));
}

.node-settings-dialog {
  width: min(760px, calc(100vw - 28px));
}

.node-settings-dialog form {
  max-height: min(820px, calc(100vh - 36px));
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.settings-notice {
  padding: 10px 15px;
  color: #4d5a62;
  background: #f8fafb;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  line-height: 1.45;
}

.node-settings-fields,
.node-settings-review {
  min-height: 0;
  overflow: auto;
  padding: 12px 15px 18px;
}

.node-settings-section + .node-settings-section {
  margin-top: 18px;
}

.node-settings-section h3,
.node-settings-review h3 {
  margin: 0 0 8px;
  color: #28363e;
  font-size: 12px;
}

.node-setting-row {
  min-height: 54px;
  display: grid !important;
  grid-template-columns: minmax(190px, .72fr) minmax(220px, 1fr);
  align-items: center;
  gap: 5px 14px !important;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.node-setting-label {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.node-setting-label strong {
  color: #2c3941;
  font-size: 11px;
}

.setting-critical-badge,
.setting-restart-badge {
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 750;
}

.setting-critical-badge {
  color: #8c2720;
  background: #fff0ef;
  border: 1px solid #efcac7;
}

.setting-restart-badge {
  color: #785012;
  background: #fff8e8;
  border: 1px solid #ead7aa;
}

.node-setting-input {
  width: 100%;
  min-width: 0;
}

.node-setting-input[type="checkbox"] {
  width: 18px;
  height: 18px;
  justify-self: start;
}

.node-setting-readonly {
  min-width: 0;
  overflow: hidden;
  color: #57656d;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-setting-help {
  grid-column: 2;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.settings-change-list {
  border: 1px solid var(--border);
  border-radius: 4px;
}

.settings-change-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(160px, .65fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.settings-change-row:last-child { border-bottom: 0; }
.settings-change-row strong { font-size: 10px; }
.settings-change-row code { overflow-wrap: anywhere; font-size: 9px; }

.critical-settings-guard {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  color: #61211d;
  background: #fff4f2;
  border: 1px solid #e8b9b5;
  border-radius: 4px;
}

.critical-settings-guard p { margin: 0; font-size: 10px; line-height: 1.45; }

.critical-acknowledgement {
  grid-template-columns: 18px minmax(0, 1fr) !important;
  align-items: center;
}

.critical-acknowledgement input { width: 18px; height: 18px; }

@media (max-width: 620px) {
  .node-setting-row,
  .settings-change-row {
    grid-template-columns: 1fr;
  }

  .node-setting-help { grid-column: 1; }
}

.file-shell {
  height: min(720px, calc(100vh - 42px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.file-toolbar {
  min-height: 47px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
}

.file-toolbar code {
  min-width: 0;
  overflow: hidden;
  color: #46535b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-content {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
}

.file-list {
  overflow: auto;
  border-right: 1px solid var(--border);
}

.file-row {
  min-height: 49px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.file-open {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 6px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.file-open:hover {
  background: #f5f8f9;
}

.file-open img {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  object-fit: contain;
}

.file-open span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.file-open strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-open small {
  color: var(--muted);
  font-size: 9px;
}

.file-download {
  margin-right: 10px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
}

.file-preview {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  margin: 0;
  padding: 14px;
  color: #dfe7eb;
  background: #1e282e;
  font: 11px/1.5 Consolas, monospace;
  white-space: pre-wrap;
}

.file-loading {
  padding: 18px;
  color: var(--muted);
  font-size: 11px;
}

.toast-region {
  position: fixed;
  z-index: 120;
  right: 16px;
  bottom: 16px;
  width: min(360px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
}

.toast {
  padding: 11px 13px;
  color: #ffffff;
  background: #34434b;
  border-left: 4px solid #91a0a8;
  border-radius: 4px;
  box-shadow: 0 8px 22px rgba(18, 27, 32, .18);
  font-size: 11px;
  line-height: 1.4;
}

.toast.success { border-left-color: #41c77b; }
.toast.error { border-left-color: #f06d64; }

.audit-list {
  background: #ffffff;
  border: 1px solid var(--border);
  border-top: 0;
}

.audit-row {
  padding: 11px 13px;
}

.audit-row + .audit-row {
  border-top: 1px solid var(--border);
}

.audit-row > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.audit-row strong {
  font-size: 11px;
}

.audit-row time,
.audit-row p {
  color: var(--muted);
  font-size: 10px;
}

.audit-row p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

@media (max-width: 1120px) {
  .resource-table-header,
  .resource-row {
    grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.4fr) minmax(120px, .7fr) minmax(150px, auto);
  }

  .resource-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 800px) {
  .signed-in,
  .page-heading > div > p {
    display: none;
  }

  .main-content {
    margin-left: 0;
  }

  .page-heading {
    display: grid;
    gap: 10px;
  }

  .page-tools {
    width: 100%;
    min-width: 0;
  }

  .resource-table-header {
    display: none;
  }

  .resource-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
    min-height: 88px;
    padding: 10px 12px;
  }

  .resource-name.resource-expand {
    grid-column: 1;
    grid-row: 1;
  }

  .health-label {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .resource-summary {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-left: 17px;
  }

  .resource-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: flex-start;
    padding-left: 17px;
  }

  .resource-details {
    grid-template-columns: 1fr;
    padding-left: 29px;
  }

  .file-content {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(190px, .7fr) minmax(160px, 1fr);
  }

  .file-list {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 480px) {
  .auth-view {
    padding: 10px;
  }

  .totp-setup {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .totp-setup img {
    width: 104px;
    height: 104px;
  }

  .topbar {
    gap: 4px;
  }

  .product-mark span {
    max-width: 128px;
  }

  .resource-row {
    grid-template-columns: minmax(0, 1fr) minmax(92px, auto);
  }
}

/* Control-plane density and state pass. Keep these final overrides together. */
.main-content {
  padding-top: 72px;
}

.page-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.search-box {
  width: min(420px, 100%);
}

.resource-table {
  display: grid;
  grid-template-columns: minmax(230px, .95fr) minmax(430px, 2fr) 165px 280px;
  border-top: 1px solid var(--border);
}

.resource-entry {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
}

.resource-row {
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  min-height: 72px;
  cursor: default;
}

.resource-context {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.resource-summary {
  display: block;
  color: #47565f;
  font-size: 10px;
  line-height: 1.35;
}

.badge-strip {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.detail-badge {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  max-width: 100%;
  padding: 2px 5px;
  color: #43515a;
  background: #eef2f4;
  border: 1px solid #dce3e7;
  border-radius: 3px;
  font-size: 9px;
  line-height: 1.25;
}

.detail-badge small {
  color: #69777f;
  font-size: inherit;
  font-weight: 600;
}

.detail-badge strong {
  min-width: 0;
  overflow: hidden;
  font-size: inherit;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-badge.badge-healthy {
  color: #17633b;
  background: #eaf7f0;
  border-color: #c8e8d6;
}

.detail-badge.badge-critical {
  color: #922c25;
  background: #fff0ef;
  border-color: #efcac7;
}

.detail-badge.badge-muted {
  color: #66737b;
  background: #f2f4f5;
  border-color: #e1e5e7;
}

.resource-action:disabled {
  opacity: .28;
  cursor: not-allowed;
  filter: grayscale(1);
}

.resource-action:disabled:hover {
  background: transparent;
  border-color: transparent;
}

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

.resource-action-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 32px;
  border-radius: 4px;
  outline: 0;
}

.resource-action-wrap::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 60;
  right: 0;
  bottom: calc(100% + 7px);
  width: max-content;
  max-width: min(250px, calc(100vw - 28px));
  padding: 6px 8px;
  color: #ffffff;
  background: #182229;
  border: 1px solid #0b1115;
  border-radius: 4px;
  box-shadow: 0 5px 14px rgba(16, 24, 29, .2);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 100ms ease-out, transform 100ms ease-out;
  visibility: hidden;
  white-space: normal;
}

.resource-action-wrap:hover::after,
.resource-action-wrap:focus-within::after,
.resource-action-wrap:focus::after {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.resource-action-wrap:focus-visible {
  outline: 3px solid rgba(23, 104, 181, 0.28);
  outline-offset: 2px;
}

.missing-action-icon {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  color: #7a878e;
  background: #f4f6f7;
  border: 1px dashed #9aa6ac;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 750;
}

.resource-entry.is-inactive .resource-row {
  color: #748087;
  background: #f3f5f6;
}

.resource-entry.is-inactive .resource-name strong,
.resource-entry.is-inactive .resource-summary {
  color: #707c83;
}

.resource-entry.is-inactive .health-label {
  color: #7b878e;
}

.storage-volume {
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.storage-volume:hover {
  background: #f8fafb;
  border-color: #b8c6ce;
}

.storage-volume.is-selected {
  background: #f2f8fd;
  border-color: #2879bd;
  box-shadow: inset 0 0 0 1px #2879bd;
}

.storage-explorer {
  min-height: 390px;
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  grid-template-rows: auto minmax(330px, 1fr);
  margin-top: 12px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
}

.storage-explorer-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 7px 10px;
  background: #f5f7f8;
  border-bottom: 1px solid var(--border);
}

.storage-path {
  min-width: 0;
  overflow: hidden;
  flex: 1;
  color: #35434b;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-root {
  max-width: 42%;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-file-list {
  min-width: 0;
  overflow: auto;
  border-right: 1px solid var(--border);
}

.storage-explorer:has(.storage-file-preview[hidden]) .storage-file-list {
  grid-column: 1 / -1;
  border-right: 0;
}

.storage-file-row {
  min-height: 49px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.storage-file-open {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 6px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.storage-file-open:hover {
  background: #f5f8f9;
}

.storage-file-open img {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  object-fit: contain;
}

.storage-file-open span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.storage-file-open strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-file-open small {
  color: var(--muted);
  font-size: 9px;
}

.storage-file-preview {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  margin: 0;
  padding: 14px;
  color: #dfe7eb;
  background: #1e282e;
  font: 11px/1.5 Consolas, monospace;
  white-space: pre-wrap;
}

.file-error {
  padding: 18px;
  color: #7e221c;
  font-size: 11px;
}

.file-error p {
  margin: 0 0 10px;
}

.activity-dialog {
  width: min(980px, calc(100vw - 30px));
  height: min(720px, calc(100vh - 30px));
}

.activity-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.activity-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  color: var(--muted);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
}

.update-activity-list {
  min-height: 0;
  overflow: auto;
  background: #ffffff;
}

.update-activity-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  min-height: 48px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}

.update-activity-row > div {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 3px;
}

.update-activity-row time,
.update-activity-row strong {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-activity-row p {
  margin: 0;
  overflow-wrap: anywhere;
  color: #2f3c43;
  font-size: 11px;
  line-height: 1.45;
}

.update-activity-row.activity-warning {
  border-left: 3px solid var(--amber);
}

.update-activity-row.activity-error {
  border-left: 3px solid var(--red);
}

@media (max-width: 1120px) {
  .resource-table {
    grid-template-columns: minmax(150px, .8fr) minmax(260px, 1.6fr) 130px 245px;
  }

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

@media (max-width: 800px) {
  .main-content {
    padding: 68px 12px 18px;
  }

  .page-tools,
  .search-box {
    width: 100%;
    min-width: 0;
  }

  .resource-table,
  .resource-entry {
    display: block;
  }

  .resource-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    min-height: 110px;
    padding: 10px 11px;
  }

  .resource-name {
    grid-column: 1;
    grid-row: 1;
  }

  .health-label {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .resource-context {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .resource-summary,
  .resource-actions {
    padding-left: 0;
  }

  .resource-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: flex-start;
  }

  .storage-explorer {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(250px, 1fr) minmax(180px, .8fr);
  }

  .storage-file-list {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .storage-explorer:has(.storage-file-preview[hidden]) .storage-file-list {
    grid-row: 2 / -1;
  }

  .update-activity-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

@media (max-width: 520px) {
  .freshness {
    display: none;
  }

  .storage-grid {
    grid-template-columns: 1fr;
  }

  .storage-root {
    display: none;
  }
}
