/* Spruce — product-specific layout (shared UI in components.css) */

#sp-rds-broker-table { table-layout: fixed; width: 100%; }
#sp-rds-broker-table th:nth-child(1), #sp-rds-broker-table td:nth-child(1) { width: 13%; }
#sp-rds-broker-table th:nth-child(2), #sp-rds-broker-table td:nth-child(2) { width: 20%; }
#sp-rds-broker-table th:nth-child(3), #sp-rds-broker-table td:nth-child(3) { width: 5rem; }
#sp-rds-broker-table th:nth-child(4), #sp-rds-broker-table td:nth-child(4) { width: 6.25rem; }
#sp-rds-broker-table th:nth-child(5), #sp-rds-broker-table td:nth-child(5) { width: 14%; }
#sp-rds-broker-table th:nth-child(6), #sp-rds-broker-table td:nth-child(6) { width: 4.5rem; }
#sp-rds-broker-table th:nth-child(7), #sp-rds-broker-table td:nth-child(7) { width: 8rem; }
#sp-rds-broker-table th:nth-child(8), #sp-rds-broker-table td:nth-child(8) { width: 90px; }
/* Spruce splits "Collection / name" into POD + Collection (RockSolid keeps eight columns). */
#sp-rds-broker-table.rds-split th:nth-child(3), #sp-rds-broker-table.rds-split td:nth-child(3) { width: 4rem; }
#sp-rds-broker-table.rds-split th:nth-child(5), #sp-rds-broker-table.rds-split td:nth-child(5) { width: 6.5rem; }
#sp-rds-broker-table.rds-split th:nth-child(6), #sp-rds-broker-table.rds-split td:nth-child(6) { width: 8%; }
#sp-rds-broker-table.rds-split th:nth-child(7), #sp-rds-broker-table.rds-split td:nth-child(7) { width: 4.5rem; }
#sp-rds-broker-table.rds-split th:nth-child(8), #sp-rds-broker-table.rds-split td:nth-child(8) { width: 8rem; }
#sp-rds-broker-table.rds-split th:nth-child(9), #sp-rds-broker-table.rds-split td:nth-child(9) { width: 90px; }
/* Fixed columns only cap the cell; long host names and user names wrap inside it instead
   of running into the next column (no horizontal scroll). Same fix as Horizon's table. */
#sp-rds-broker-table td { overflow: hidden; vertical-align: middle; }
#sp-rds-broker-table td:nth-child(1),
#sp-rds-broker-table:not(.rds-split) td:nth-child(5),
#sp-rds-broker-table.rds-split td:nth-child(6) { overflow-wrap: anywhere; }
#sp-rds-broker-table .rds-broker-host-link {
  display: block; width: 100%; max-width: 100%; box-sizing: border-box;
  white-space: normal; overflow-wrap: anywhere;
}
#sp-rds-broker-table .rds-session-state {
  font-size: var(--font-size-xs); padding: 2px 8px; border-radius: 999px; display: inline-block;
}

.sp-user-meta { display: flex; flex-direction: column; gap: 0; }

.hz-cm-actions { gap: 6px; }

nav.sp-nav {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: 10px 18px; margin-left: auto; justify-content: flex-end; max-width: 100%;
}
.sp-nav-cluster { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.sp-nav-cluster .sp-nav-hub { margin: 0; }
.sp-nav-cluster .sp-nav-flyout {
  display: none; position: absolute; top: 100%; right: 0;
  flex-direction: column; align-items: stretch; gap: 3px;
  min-width: 200px; padding: 6px; margin-top: 2px;
  background: var(--surface-2); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); z-index: 120;
}
.sp-nav-cluster:hover .sp-nav-flyout,
.sp-nav-cluster:focus-within .sp-nav-flyout,
.sp-nav-cluster.sp-nav-cluster--open .sp-nav-flyout { display: flex; }
nav.sp-nav.sp-nav--pointer-outside .sp-nav-cluster .sp-nav-flyout { display: none !important; }
.sp-nav-cluster.sp-nav-cluster--flyout-dismissed .sp-nav-flyout { display: none !important; }
.sp-nav-cluster .sp-nav-flyout button { text-align: left; width: 100%; justify-content: flex-start; }
.sp-nav-hub--lit {
  background: rgba(var(--action-rgb), 0.07) !important;
  border-color: rgba(var(--action-rgb), 0.25) !important;
  color: var(--action) !important;
  font-weight: var(--font-weight-semibold) !important;
}

/* Customer card pod badge — matches customer-user-count font size */
/* POD · farm on its own line, left under the users and seats counts. */
.customer-card .customer-meta {
  flex-wrap: wrap;
  row-gap: 4px;
}

.customer-card .customer-meta-break {
  flex-basis: 100%;
  height: 0;
}

.customer-card .customer-meta-break + .customer-pod-badge {
  margin-left: 0;
}

.customer-pod-badge {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: auto;
  vertical-align: middle;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  flex-shrink: 0;
}
/* Pending or requested upgrade on a customer card / list row (Upgrade status query). */
.customer-upg-tag {
  margin-left: 6px;
  padding: 1px 7px;
  font-size: var(--font-size-xs);
  vertical-align: middle;
  white-space: nowrap;
}
#customer-query-note {
  margin-top: var(--space-1);
}
#customer-query-note[hidden] {
  display: none !important;
}

/* System type accent — card borders + filter legend swatches */
.customer-card[data-system-type],
.customer-list-row[data-system-type],
.helix-sys-type-swatch[data-sys] {
  --sys-accent: #94a3b8;
}
.customer-card[data-system-type="production"],
.customer-list-row[data-system-type="production"],
.helix-sys-type-swatch[data-sys="production"] {
  --sys-accent: #5b7ea6;
}
.customer-card[data-system-type="pre-production"],
.customer-list-row[data-system-type="pre-production"],
.helix-sys-type-swatch[data-sys="pre-production"] {
  --sys-accent: #ca8a04;
}
.customer-card[data-system-type="customertest"],
.customer-list-row[data-system-type="customertest"],
.helix-sys-type-swatch[data-sys="customertest"] {
  --sys-accent: #38bdf8;
}
.customer-card[data-system-type="historical"],
.customer-list-row[data-system-type="historical"],
.helix-sys-type-swatch[data-sys="historical"] {
  --sys-accent: #ea580c;
}
.customer-card[data-system-type="cancelled"],
.customer-list-row[data-system-type="cancelled"],
.helix-sys-type-swatch[data-sys="cancelled"] {
  --sys-accent: #ef4444;
}
.customer-card[data-system-type="migration"],
.customer-list-row[data-system-type="migration"],
.helix-sys-type-swatch[data-sys="migration"] {
  --sys-accent: #7c3aed;
}
.customer-card[data-system-type="vendor"],
.customer-list-row[data-system-type="vendor"],
.helix-sys-type-swatch[data-sys="vendor"] {
  --sys-accent: #14b8a6;
}
.customer-card[data-system-type="internal"],
.customer-list-row[data-system-type="internal"],
.helix-sys-type-swatch[data-sys="internal"] {
  --sys-accent: #818cf8;
}

#tab-customers .customer-card[data-system-type] {
  border-color: color-mix(in srgb, var(--sys-accent) 55%, var(--glass-border));
}
#tab-customers .customer-card[data-system-type="production"] {
  border-color: color-mix(in srgb, var(--sys-accent) 38%, var(--glass-border));
}
#tab-customers .customer-card[data-system-type="pre-production"],
#tab-customers .customer-card[data-system-type="migration"] {
  border-color: var(--sys-accent);
}
#tab-customers .customer-card[data-system-type="historical"],
#tab-customers .customer-card[data-system-type="cancelled"] {
  border-color: var(--sys-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sys-accent) 70%, transparent), var(--glass-shadow);
}
#tab-customers .customer-card[data-system-type]:hover {
  border-color: var(--sys-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sys-accent) 50%, transparent), var(--shadow-md);
}
#tab-customers .customer-list-row[data-system-type] {
  box-shadow: inset 3px 0 0 var(--sys-accent);
}

.helix-sys-type-combo {
  position: relative;
  z-index: 2;
  min-width: 148px;
}
.helix-sys-type-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 1.75rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.helix-sys-type-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.helix-sys-type-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--sys-accent, var(--text-muted));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.helix-sys-type-swatch[hidden] {
  display: none !important;
}
.helix-sys-type-swatch[data-sys="production"] {
  background: color-mix(in srgb, var(--sys-accent) 72%, #0f172a);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sys-accent) 55%, transparent);
}
.helix-sys-type-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-height: 280px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated, var(--surface-1));
  box-shadow: var(--shadow-md);
}
.helix-sys-type-menu[hidden] {
  display: none !important;
}
.helix-sys-type-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: var(--font-size-md);
  text-align: left;
  cursor: pointer;
}
.helix-sys-type-option:hover,
.helix-sys-type-option[aria-selected="true"] {
  background: var(--surface-hover, var(--glass-bg-strong));
}

/* Customer SystemType — small glassy color pills */
.sp-system-type-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  vertical-align: middle;
}
.sp-system-type-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid transparent;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-inset-highlight, inset 0 1px 0 rgba(255, 255, 255, 0.08));
}
.sp-system-type-warn {
  flex-shrink: 0;
  font-size: 0.85rem;
  line-height: 1;
  cursor: help;
}
.sp-system-type--production {
  color: var(--success);
  background: rgba(var(--success-rgb), 0.16);
  border-color: rgba(var(--success-rgb), 0.35);
}
.sp-system-type--pre-production {
  color: #c99212;
  background: rgba(var(--warning-rgb), 0.18);
  border-color: rgba(var(--warning-rgb), 0.38);
}
[data-theme="dark"] .sp-system-type--pre-production { color: #f0c44a; }
.sp-system-type--customertest {
  color: #c2410c;
  background: rgba(249, 115, 22, 0.16);
  border-color: rgba(249, 115, 22, 0.38);
}
[data-theme="dark"] .sp-system-type--customertest { color: #fb923c; }
.sp-system-type--historical {
  color: #f1f5f9;
  background: rgba(15, 18, 28, 0.72);
  border-color: rgba(255, 255, 255, 0.14);
}
[data-theme="light"] .sp-system-type--historical {
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(15, 23, 42, 0.95);
}
.sp-system-type--cancelled {
  color: var(--danger);
  background: rgba(var(--danger-rgb), 0.16);
  border-color: rgba(var(--danger-rgb), 0.36);
}
.sp-system-type--migration {
  color: #a21caf;
  background: rgba(192, 38, 211, 0.14);
  border-color: rgba(192, 38, 211, 0.34);
}
[data-theme="dark"] .sp-system-type--migration { color: #e879f9; }
.sp-system-type--vendor {
  color: #0f766e;
  background: rgba(20, 184, 166, 0.14);
  border-color: rgba(20, 184, 166, 0.36);
}
[data-theme="dark"] .sp-system-type--vendor { color: #2dd4bf; }
.sp-system-type--internal {
  color: var(--info, #2563eb);
  background: rgba(var(--info-rgb), 0.16);
  border-color: rgba(var(--info-rgb), 0.36);
}
.sp-system-type--unknown {
  color: var(--text-secondary);
  background: rgba(128, 128, 128, 0.14);
  border-color: rgba(128, 128, 128, 0.32);
}

/* Software Version modal */
/* The version value, styled as the links beside it (.server-hub-v a). */
.sp-sv-value-btn {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--link);
  cursor: pointer;
  text-decoration: none;
}
.sp-sv-value-btn:hover,
.sp-sv-value-btn:focus-visible { text-decoration: underline; }
.sp-sv-current {
  text-align: center;
  padding: var(--space-5) var(--space-4);
  margin-bottom: var(--space-5);
  border-radius: var(--radius-md);
  background: var(--glass-bg, var(--surface-2));
  border: 1px solid var(--glass-border, var(--border-subtle));
}
.sp-sv-current-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.sp-sv-current-value {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: 1.2;
}
.sp-sv-current-date {
  margin-top: 6px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary, var(--text-muted));
}
.sp-sv-meta {
  margin-top: 8px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.sp-sv-section {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.sp-sv-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.sp-sv-section-title {
  margin: 0 0 4px;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}
.sp-sv-section-sub {
  margin: 0 0 12px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.sp-sv-path { word-break: break-all; }
.sp-sv-empty {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px dashed var(--border-subtle);
}
.sp-sv-not-scheduled {
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
}
.sp-sv-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.sp-sv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}
.sp-sv-table th,
.sp-sv-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.sp-sv-table th {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-2);
}
.sp-sv-table tr:last-child td { border-bottom: none; }
.sp-sv-schedule-grid {
  display: grid;
  gap: 10px;
}
.sp-sv-kv {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}
.sp-sv-k {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: var(--font-weight-semibold);
  min-width: 10rem;
}
.sp-sv-v { color: var(--text-primary); font-size: var(--font-size-md); }
.sp-sv-tz {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  background: rgba(var(--info-rgb, 110, 184, 255), 0.14);
  color: var(--info, #60a5fa);
  border: 1px solid rgba(var(--info-rgb, 110, 184, 255), 0.32);
}
.sp-sv-note {
  margin: 10px 0 0;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.sp-sv-log-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.sp-sv-log-panel {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
}
.sp-sv-log-pre {
  margin: 0;
  padding: 12px 14px;
  max-height: 320px;
  overflow: auto;
  font-family: var(--eci-font-family-mono, ui-monospace, monospace);
  font-size: var(--font-size-xs);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
}
.sp-sv-log-status {
  margin-top: 8px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.sp-sv-log-status.ok { color: var(--success); }
.sp-sv-log-status.err { color: var(--danger); }

.sp-sv-timeline-table .sp-sv-timeline-version {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}
.sp-sv-timeline-row--failed td {
  background: rgba(var(--danger-rgb, 239, 68, 68), 0.04);
}
.sp-sv-timeline-actions-cell {
  white-space: nowrap;
}
.sp-sv-timeline-actions-cell .btn-sm + .btn-sm {
  margin-left: 6px;
}
.sp-sv-timeline-log-row td {
  padding: 0;
  border-bottom: 1px solid var(--border-subtle);
}
.sp-sv-timeline-log-row .sp-sv-timeline-log {
  border-top: none;
  max-height: 280px;
}
.sp-sv-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.sp-sv-status--success {
  color: var(--success, #22c55e);
  background: rgba(var(--success-rgb, 34, 197, 94), 0.12);
  border: 1px solid rgba(var(--success-rgb, 34, 197, 94), 0.28);
}
.sp-sv-status--failed {
  color: var(--danger, #ef4444);
  background: rgba(var(--danger-rgb, 239, 68, 68), 0.12);
  border: 1px solid rgba(var(--danger-rgb, 239, 68, 68), 0.28);
}
.sp-sv-timeline-log {
  margin: 0;
  padding: 12px 14px;
  max-height: 280px;
  overflow: auto;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--eci-font-family-mono, ui-monospace, monospace);
  font-size: var(--font-size-xs);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
  background: var(--surface-1, var(--bg));
}
.sp-sv-log-truncated-note {
  margin: 0;
  padding: 6px 12px 10px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  border-top: 1px dashed var(--border-subtle);
}
.btn-sm {
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  min-height: 28px;
}

/* Filter select used on Customers and Servers tabs */
.filter-select {
  height: var(--control-height-md, 40px);
  font-size: var(--font-size-md);
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-primary);
  min-width: 120px;
}

/* ── Spruce Fleet Dashboard ──────────────────────────────────────────────── */
.sp-dash-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin: 0 0 18px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.sp-dash-meta-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-width: 0;
}
.sp-dash-meta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.sp-dash-meta strong {
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}

@media (max-width: 768px) {
  .sp-dash-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .sp-dash-meta-actions {
    margin-left: 0;
    width: 100%;
  }
  .sp-dash-meta-actions .btn {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 0;
    justify-content: center;
    padding: 8px 10px;
    font-size: var(--font-size-xs);
    white-space: nowrap;
  }
}
.sp-dash-sync-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.12);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  line-height: 1.45;
}
.sp-dash-sync-alert strong {
  font-weight: var(--font-weight-semibold);
}
.sp-dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.sp-dash-stat {
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.sp-dash-stat--clickable {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sp-dash-stat--clickable:hover {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(248, 113, 113, 0.08);
}
.sp-dash-stat--clickable:focus-visible {
  outline: 2px solid rgba(248, 113, 113, 0.7);
  outline-offset: 2px;
}
.sp-dash-stat--clickable .sp-dash-stat-value {
  color: #f87171;
}
.sp-dash-stat-hint {
  display: block;
  margin-top: 4px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: var(--font-weight-normal);
  text-transform: none;
  letter-spacing: 0;
}
.sp-dash-errors-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}
.sp-dash-errors-table th,
.sp-dash-errors-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}
.sp-dash-errors-table th {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: var(--bg2);
  position: sticky;
  top: 0;
}
.sp-dash-errors-table code {
  font-family: var(--eci-font-family-mono, ui-monospace, monospace);
  font-size: .85em;
}
.sp-dash-errors-table button.linkish {
  background: none;
  border: none;
  padding: 0;
  color: var(--link, #60a5fa);
  cursor: pointer;
  font: inherit;
}
.sp-dash-errors-table button.linkish:hover {
  text-decoration: underline;
}
.sp-dash-errors-empty {
  padding: 24px 8px;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}
.sp-dash-stat-label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.sp-dash-stat-value {
  font-size: 1.35rem;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: 1.2;
}
.sp-dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1100px) {
  .sp-dash-grid { grid-template-columns: 1fr; }
}
.sp-dash-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 14px 16px 10px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}
.sp-dash-card.wide {
  grid-column: 1 / -1;
  min-height: 340px;
}
.sp-dash-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.sp-dash-card-head h3 {
  margin: 0;
}
.sp-dash-skew-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.sp-dash-skew-sep {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
  margin: 0 2px;
}
.sp-dash-skew-btn {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.sp-dash-skew-btn:hover {
  color: var(--text-primary);
  border-color: var(--border);
  background: var(--surface);
}
.sp-dash-skew-btn.is-active,
.sp-dash-skew-btn[aria-pressed="true"] {
  color: var(--text-primary);
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.12);
}
.sp-dash-card h3 {
  margin: 0 0 4px;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}
.sp-dash-expand {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -4px -6px 0 0;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.sp-dash-expand:hover {
  color: var(--text-primary);
  border-color: var(--border);
  background: var(--surface);
}
.sp-dash-card .sp-dash-hint {
  margin: 0 0 6px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.sp-dash-limit-note {
  margin: 0 0 8px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.sp-dash-chart-wrap {
  position: relative;
  flex: 1;
  min-height: 220px;
}
.sp-dash-card.wide .sp-dash-chart-wrap {
  min-height: 280px;
}
.sp-dash-chart-wrap[hidden] {
  display: none;
}
.sp-dash-empty-note {
  margin: var(--space-6) 0;
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.sp-dash-empty-note[hidden] {
  display: none;
}
.sp-dash-chart-wrap--modal {
  flex: none;
  min-height: 320px;
  width: 100%;
}
.sp-dash-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

/* ── RDS Collections & Capacity ───────────────────────────────────────────── */
.farms-filters {
  margin-top: var(--space-4);
  align-items: flex-end;
}
.farms-filters .toggles { margin-top: 4px; }
.farm-cap-swatch {
  width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0;
  background: var(--accent);
}
.farm-cap-swatch--yellow { background: #d97706; }
.farm-cap-swatch--red { background: #dc2626; }
.farm-pod-group { margin-top: var(--space-4); }
.farm-pod-group-title {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.farms-capacity {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-4);
}
.farm-pod-group-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: var(--space-4);
}
.farm-pod-card {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  cursor: pointer;
}
.farm-pod-card:hover { border-color: var(--border-strong); }
.farm-pod-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.farm-pod-head { display: flex; align-items: center; gap: 8px; user-select: none; }
.farm-pod-headinfo { flex: 1 1 auto; min-width: 0; }
.farm-pod-title { display: flex; align-items: baseline; gap: 8px; user-select: none; }
.farm-pod-title + .farm-pod-head { margin-top: calc(2px - var(--space-3)); }
.farm-pod-name { margin: 0; white-space: nowrap; font-size: var(--font-size-md); font-weight: var(--font-weight-bold); color: var(--text-primary); }
.farm-pod-commissioned {
  margin-left: auto;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-normal);
  color: var(--text-muted);
  white-space: nowrap;
}
.farm-pod-stage {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(var(--warning-rgb), 0.55);
  background: rgba(var(--warning-rgb), 0.14);
  color: var(--text-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}
.pod-provisioning { border-color: rgba(var(--warning-rgb), 0.55); }
.pod-provisioning-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pod-provisioning-item { display: flex; align-items: flex-start; gap: 8px; font-size: var(--font-size-sm); color: var(--text-primary); }
.pod-provisioning-item .btn { margin-left: auto; flex-shrink: 0; }
.pod-provisioning-mark { width: 1.2em; flex-shrink: 0; text-align: center; color: var(--text-muted); }
.pod-provisioning-item.is-done { color: var(--text-muted); }
.pod-provisioning-item.is-done .pod-provisioning-mark { color: var(--success); }
.pod-provisioning-text { min-width: 0; }
.pod-provisioning-detail { font-size: var(--font-size-xs); color: var(--text-muted); overflow-wrap: anywhere; }
.farm-pod-sub { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.farm-pod-wl {
  margin-top: 4px;
  font-size: var(--font-size-xs);
  color: var(--text-primary);
}
.farm-pod-wl-detail { margin-top: 4px; font-size: var(--font-size-sm); color: var(--text-primary); }
.farm-pod-actions, .farm-row-actions { margin-left: auto; display: inline-flex; gap: 4px; flex-shrink: 0; }
.farm-pod-head .farm-pod-actions { margin-left: 8px; }
.farm-pod-meter { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.farm-pod-pct { font-variant-numeric: tabular-nums; font-weight: var(--font-weight-bold); font-size: var(--font-size-sm); color: var(--text-secondary, var(--text-muted)); min-width: 3.5ch; text-align: right; }
.farm-pod-pct.near { color: #d97706; }
.farm-pod-pct.over { color: #dc2626; }
.farm-util-bar.meter { width: 110px; flex-shrink: 0; }
.farm-pod-body { display: flex; flex-direction: column; gap: var(--space-3); }
.farm-row-pct { margin-left: 6px; font-size: var(--font-size-xs); font-variant-numeric: tabular-nums; color: var(--text-muted); }
.farm-row-pct.near { color: #d97706; font-weight: var(--font-weight-semibold); }
.farm-row-pct.over { color: #dc2626; font-weight: var(--font-weight-bold); }

/* Capacity overview dashboard */
.farms-overview {
  margin-top: var(--space-4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.farms-overview-bars { display: flex; flex-direction: column; gap: 12px; }
.farms-overview-bars .farm-util-head { font-size: var(--font-size-sm); }
.farms-overview-bars .farm-util-bar { height: 12px; }
.farms-overview-free { font-size: var(--font-size-xs); color: var(--text-muted); }
.farms-overview-tiles { margin: 0; }
.farm-pod-sql {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--surface-1);
}
/* POD detail: label/value pairs (helixDetailKvHtml) in a wrapping grid. min-width: 0 lets a
   long value such as an RDWeb URL wrap inside its column instead of running into the next. */
.farm-pod-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 18px;
  margin-top: 6px;
}
.farm-pod-detail-grid > .kv-item {
  min-width: 0;
  padding: 0;
  background: none;
}
.farm-pod-detail-grid > .kv-item:hover { background: none; }
.farm-pod-detail-grid .kv-key {
  font-size: var(--font-size-xs);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.farm-pod-detail-grid .kv-val { font-size: var(--font-size-sm); }
.farm-pod-detail-grid .kv-val-wrap {
  display: flex;
  width: 100%;
  text-align: left;
}
.farm-pod-sql-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.farm-pod-farms { display: flex; flex-direction: column; gap: 10px; }
.farm-row { border-top: 1px solid var(--border-subtle); padding-top: 8px; }
.farm-row:first-child { border-top: none; padding-top: 0; }
/* Brief highlight when jumped to from a customer's RDS Collection link */
.farm-row-flash { animation: farm-row-flash 2s ease-out; border-radius: var(--radius-sm); }
@keyframes farm-row-flash {
  0%   { background: color-mix(in srgb, var(--accent) 28%, transparent); }
  100% { background: transparent; }
}
.farm-row-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.farm-row-name { font-weight: var(--font-weight-semibold); color: var(--text-primary); font-size: var(--font-size-sm); }
.farm-view-btn { background: none; border: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; font-weight: var(--font-weight-semibold); }
.farm-view-btn:hover { text-decoration: underline; }
.farm-cust-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.farm-cust-table th, .farm-cust-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border-subtle); }
.farm-cust-table th { font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.farm-cust-table td.farm-asg-actions { white-space: nowrap; text-align: right; }
.farm-cust-table .farm-asg-edit { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.farm-row-sub { color: var(--text-muted); font-weight: var(--font-weight-normal); font-size: var(--font-size-xs); }
.farm-row-bars { display: flex; flex-direction: column; gap: 6px; }
.farm-row-counts { display: flex; gap: 14px; font-size: var(--font-size-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.farm-cust-link { background: none; border: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; }
.farm-cust-link:hover { text-decoration: underline; }

.farm-util { display: flex; flex-direction: column; gap: 3px; }
.farm-util-head { display: flex; justify-content: space-between; font-size: var(--font-size-xs); color: var(--text-secondary, var(--text-muted)); }
.farm-util-num { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.farm-util-num.near { color: #d97706; font-weight: var(--font-weight-semibold); }
.farm-util-num.over { color: #dc2626; font-weight: var(--font-weight-bold); }
.farm-util-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--border-subtle);
  overflow: hidden;
}
.farm-util-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width var(--transition-normal);
}
.farm-util-fill.near { background: #d97706; }
.farm-util-fill.over { background: #dc2626; }

/* PODs page: the Add menu and the add / edit modals (pod-manage.js) */
.pod-add-menu { position: relative; display: inline-flex; }
.pod-add-menu-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 120;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-md);
}
.pod-add-menu-list[hidden] { display: none; }
.pod-add-menu-list [role="menuitem"] {
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  text-align: left;
  cursor: pointer;
}
.pod-add-menu-list [role="menuitem"]:hover,
.pod-add-menu-list [role="menuitem"]:focus-visible { background: var(--surface-1); outline: none; }
.pod-manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px var(--space-4);
}
.pod-manage-overlay { z-index: 310; }
.pod-manage-overlay .modal-body { overflow-y: auto; }
.farms-form input[readonly] { color: var(--text-muted); }
.farm-pod-modal-actions { display: flex; justify-content: flex-end; gap: 6px; }
.farms-form { display: flex; flex-direction: column; gap: 8px; }
.farms-form h4 { margin: 0 0 4px; font-size: var(--font-size-sm); color: var(--text-primary); }
.farms-form label { display: flex; flex-direction: column; gap: 3px; font-size: var(--font-size-xs); color: var(--text-muted); }
.farms-form input, .farms-form select {
  padding: 6px 8px;
  font-size: var(--font-size-sm);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: var(--text-primary);
  box-sizing: border-box;
}
.farms-form-actions { display: flex; gap: 6px; margin-top: 4px; }

/* POD egress IP tables (whitelist + EDC) */
.helix-ip-section {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
}
.helix-ip-section > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.helix-ip-section > summary::-webkit-details-marker { display: none; }
.helix-ip-section > summary::before {
  content: '▸';
  color: var(--text-muted);
  font-size: 0.85em;
}
.helix-ip-section[open] > summary::before { content: '▾'; }
.helix-ip-hint {
  margin: 8px 0 12px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.helix-ip-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.helix-ip-toolbar .filter-select { flex: 1; min-width: 160px; max-width: 280px; }
.helix-ip-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.helix-ip-form label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.helix-ip-form input, .helix-ip-form select {
  padding: 6px 8px;
  font-size: var(--font-size-sm);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: var(--text-primary);
  box-sizing: border-box;
  min-width: 140px;
}
.helix-ip-form input[readonly], .helix-ip-form select:disabled {
  opacity: 0.85;
  background: var(--surface-2, var(--surface-1));
}
.helix-ip-table-wrap { overflow-x: auto; }
.helix-ip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}
.helix-ip-table th, .helix-ip-table td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.helix-ip-table th {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.helix-ip-table tr:hover td { background: var(--glass-bg-strong); }
.helix-ip-table .mono { font-variant-numeric: tabular-nums; }
.helix-ip-updated { color: var(--text-muted); font-size: var(--font-size-xs); }
.helix-ip-actions { display: flex; gap: 6px; }
.helix-ip-btn { font-size: var(--font-size-xs); padding: 3px 8px; }

#soft-locks-panel {
  margin-top: var(--space-3);
  min-width: 0;
}
.soft-locks-table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 22rem;
  margin-top: var(--space-3);
  min-width: 0;
  max-width: 100%;
}
.soft-locks-table {
  table-layout: fixed;
  width: 100%;
}
.soft-locks-table th,
.soft-locks-table td {
  padding: var(--space-2);
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.soft-locks-table th {
  cursor: default;
}
.soft-locks-table th:hover {
  color: var(--text-muted);
  background: var(--surface-2);
}
.soft-locks-table .soft-locks-actions {
  width: 5.5rem;
  white-space: nowrap;
  overflow-wrap: normal;
  vertical-align: middle;
}
.soft-locks-table .soft-locks-actions .btn-sm {
  padding: var(--space-1) var(--space-2);
  min-height: 0;
}
.soft-locks-toolbar .helix-search-wrap,
.soft-locks-toolbar .search-box-narrow {
  max-width: 240px;
}
.soft-locks-case-input {
  margin-bottom: var(--space-3);
}

#customer-param-api,
#customer-param-rcws {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  min-width: 0;
  max-width: 100%;
}

/* URL value with its chips (DNS) on the same line; the URL truncates before the chips wrap. */
.sp-cf-url-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  min-width: 0;
}

.sp-cf-url-line > a {
  flex: 0 1 auto;
  min-width: 0;
}

.sp-cf-url-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: var(--space-2);
}

.sp-cf-url-actions > .helix-inline-chip {
  margin-left: 0;
}

/* Sits inside a single-line, clipped value cell; the panel's own text has to wrap. */
.sp-cf-panel {
  width: min(28rem, 100%);
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.sp-cf-note {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.sp-cf-note--error {
  color: var(--danger);
}

.sp-cf-record {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.sp-cf-record-name {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.sp-cf-view {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.sp-cf-record:has(.sp-cf-edit:not(.helix-perm-hidden)) .sp-cf-view {
  display: none;
}

.sp-cf-edit {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sp-cf-edit label,
.sp-cf-check {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.sp-cf-check {
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
}

.sp-cf-edit input {
  font: inherit;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
}

.sp-cf-edit .btn {
  align-self: flex-start;
}

.rcws-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.rcws-title-row .page-title {
  margin-bottom: 0;
}

.rcws-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
  margin: var(--space-3) 0;
}

.rcws-toolbar label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--font-size-sm);
}

.rcws-toolbar input,
.rcws-toolbar select {
  font: inherit;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
}

.rcws-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: flex-end;
}

#rcws-clear {
  color: var(--text-muted);
  opacity: 0.55;
  box-shadow: var(--shadow-sm);
  cursor: default;
}
#rcws-clear:hover,
#rcws-clear:disabled {
  color: var(--text-muted);
  background: transparent;
  border-color: var(--border-subtle);
  opacity: 0.55;
  box-shadow: var(--shadow-sm);
  filter: none;
  cursor: default;
}
#rcws-clear.is-lit {
  opacity: 1;
  color: var(--text-primary);
  border-color: rgba(var(--action-rgb), 0.7);
  background: rgba(var(--action-rgb), 0.16);
  box-shadow: 0 0 0 1px rgba(var(--action-rgb), 0.28), 0 0 18px rgba(var(--action-rgb), 0.45);
  cursor: pointer;
}
#rcws-clear.is-lit:hover {
  color: var(--text-primary);
  background: rgba(var(--action-rgb), 0.28);
  border-color: rgba(var(--action-rgb), 0.9);
  box-shadow: 0 0 0 1px rgba(var(--action-rgb), 0.4), 0 0 22px rgba(var(--action-rgb), 0.55);
  filter: none;
}

.rcws-table-wrap {
  overflow-x: auto;
}

.rcws-schedules {
  margin-top: var(--space-6);
  scroll-margin-top: 5.5rem;
}

.rcws-schedules h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-lg);
}

/* ── Upgrades tab (upgrades.js) ─────────────────────────────────────────── */
.sp-upg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  align-self: flex-end;
}

.sp-upg-chip {
  font: inherit;
  font-size: var(--font-size-sm);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
}

.sp-upg-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast, #fff);
}

#sp-upg-pagination[hidden],
#sp-ins-pagination[hidden] {
  display: none;
}

/* System Management: Installs and Removals tabs, in-progress and failed counts on each. */
.sp-ins-tab-action {
  margin-left: auto;
}

.sp-ins-tab-action[hidden] {
  display: none;
}

.sp-ins-tabs [role="tab"] {
  font-size: var(--font-size-base, 1rem);
}

.sp-ins-tab-badges .tag {
  margin-left: var(--space-1);
  padding: 0 var(--space-2);
  font-size: var(--font-size-xs, 0.75rem);
}

#sp-ins-q {
  min-width: 18rem;
}

.sp-ins-chip-n {
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.sp-upg-ga-pill {
  cursor: pointer;
  font: inherit;
  font-size: var(--font-size-sm);
}

.sp-upg-sub {
  display: block;
  font-size: var(--font-size-xs, 0.75rem);
  color: var(--text-muted);
}

.sp-upg-actions {
  white-space: nowrap;
}

.sp-upg-actions .btn + .btn {
  margin-left: var(--space-1);
}

.sp-upg-footer {
  justify-content: flex-end;
  gap: var(--space-2);
}

.sp-upg-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: var(--space-3) 0;
  font-size: var(--font-size-sm);
}

.sp-upg-field--narrow {
  align-self: flex-start;
  width: min(24rem, 100%);
}

.sp-upg-field input,
.sp-upg-field textarea,
.sp-upg-input {
  font: inherit;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
}

.sp-upg-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
}

.sp-upg-ack {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: var(--space-2);
  align-items: flex-start;
  margin: var(--space-2) 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(var(--warning-rgb), 0.35);
  border-radius: var(--radius-sm);
  background: rgba(var(--warning-rgb), 0.08);
  font-size: var(--font-size-sm);
}

.sp-upg-steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.sp-upg-steps .active {
  color: var(--text-primary);
  font-weight: 600;
}

.sp-upg-steps .done {
  color: var(--success);
}

.sp-upg-ver-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: var(--space-2);
  max-height: 22rem;
  overflow-y: auto;
}

.sp-upg-ver {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--space-2);
  font: inherit;
  text-align: left;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
}

.sp-upg-ver:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sp-upg-ver.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.sp-upg-ver-line {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* New upgrade steps that fill the fixed frame: the version grid and the system picker. */
#sp-upg-new-modal .modal-body {
  display: flex;
  flex-direction: column;
}

#sp-upg-new-modal .modal-body > * {
  flex-shrink: 0;
}

#sp-upg-new-modal .sp-upg-fill {
  flex: 1 1 0;
  min-height: 18rem;
  display: flex;
  flex-direction: column;
}

.sp-upg-ver-step .sp-upg-ver-list {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  align-content: start;
}

.sp-upg-pick {
  gap: var(--space-2);
}

.sp-upg-pick > .rcws-toolbar,
.sp-upg-pick > .sp-cf-note {
  margin: 0;
}

.sp-upg-panes {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 24rem);
  gap: var(--space-3);
}

.sp-upg-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, var(--radius-sm));
  overflow: hidden;
}

.sp-upg-pane-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--font-size-sm);
}

.sp-upg-pane-head .sp-upg-sub {
  display: inline;
}

.sp-upg-pane-head > .btn:first-of-type {
  margin-left: auto;
}

.sp-upg-pane-find {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.sp-upg-pane-find {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.sp-upg-pane-find .sp-upg-input {
  flex: 1 1 auto;
  min-width: 0;
}

.sp-upg-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.sp-upg-list[hidden] {
  display: none;
}

.sp-upg-list textarea {
  width: 100%;
  resize: vertical;
  font-family: var(--font-mono, monospace);
  font-size: var(--font-size-xs);
}

.sp-upg-list-actions {
  display: flex;
  justify-content: flex-end;
}

.sp-upg-list-report {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-height: 8rem;
  overflow-y: auto;
  font-size: var(--font-size-xs);
  overflow-wrap: anywhere;
}

.sp-upg-pane-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sp-upg-pane-body thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2, var(--surface));
}

.sp-upg-addable {
  cursor: pointer;
}

.sp-upg-addable:hover td {
  background: rgba(var(--accent-rgb, 59, 130, 246), 0.08);
}

.sp-upg-cart {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sp-upg-cart li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--font-size-xs);
}

.sp-upg-cart-main {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sp-upg-cart-x {
  flex: 0 0 auto;
  font: inherit;
  line-height: 1;
  padding: var(--space-1) var(--space-2);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.sp-upg-cart-x:hover,
.sp-upg-cart-x:focus-visible {
  color: var(--danger, #ef4444);
  border-color: var(--border-subtle);
}

.sp-upg-cart li.sp-upg-cart-empty {
  display: block;
  border-bottom: 0;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .sp-upg-panes {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 3fr) minmax(0, 2fr);
  }
}

.sp-upg-msg {
  width: min(48rem, 100%);
  margin: var(--space-3) 0;
}

.sp-upg-msg-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
}

.sp-upg-msg-head > .btn:first-of-type {
  margin-left: auto;
}

.sp-upg-msg textarea {
  width: 100%;
  resize: vertical;
}

.sp-upg-msg-text {
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-2, var(--surface));
  font-size: var(--font-size-sm);
  white-space: pre-wrap;
}

.sp-upg-review-kv {
  max-width: 56rem;
}

.sp-upg-off {
  opacity: 0.55;
}

.sp-upg-preview-banner,
.sp-upg-info {
  width: fit-content;
  max-width: 100%;
  margin: var(--space-3) 0 var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}

.sp-upg-why-panel {
  margin: var(--space-3) 0;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.sp-upg-why-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.sp-upg-why-head .btn {
  margin-left: auto;
}

.sp-upg-why-head .sp-upg-sub {
  display: inline;
}

.sp-upg-why-list {
  list-style: none;
  margin: 0 0 var(--space-2);
  padding: 0;
  max-height: 18rem;
  overflow-y: auto;
}

.sp-upg-why-list li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--font-size-sm);
}

.sp-upg-why-evidence summary {
  cursor: pointer;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.sp-upg-why-evidence ul {
  margin: var(--space-1) 0 0;
  padding-left: var(--space-4);
  font-size: var(--font-size-xs);
  overflow-wrap: anywhere;
}

.sp-upg-version-note {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-left-color: var(--warning);
}

.sp-upg-nowrap {
  white-space: nowrap;
}

/* New upgrade and request detail: a fixed frame so content changes do not resize it. */
#sp-upg-new-modal .modal,
#sp-upg-detail .modal {
  width: min(1320px, calc(100vw - 32px));
}

#sp-upg-new-modal .modal {
  height: min(88vh, 920px);
}

#sp-upg-new-modal .modal-body,
#sp-upg-detail .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Compact tables that fit their container instead of scrolling sideways. */
.sp-upg-table {
  width: 100%;
  table-layout: fixed;
  font-size: var(--font-size-xs);
}

.sp-upg-table th,
.sp-upg-table td {
  padding: var(--space-2) var(--space-3);
  overflow-wrap: anywhere;
}

.sp-upg-table th {
  white-space: normal;
  overflow-wrap: normal;
  cursor: default;
}

.sp-upg-table .tag {
  white-space: nowrap;
}

.sp-upg-c-pick { width: 2.5rem; }
.sp-upg-c-add { width: 4.5rem; }
.sp-upg-c-xs { width: 5rem; }
.sp-upg-c-sm { width: 6.5rem; }
.sp-upg-c-version { width: 8.5rem; }
.sp-upg-c-type { width: 11rem; }
.sp-upg-c-server { width: 15rem; }
.sp-upg-c-status { width: 10rem; }
.sp-upg-c-date { width: 10.5rem; }
.sp-upg-c-runat { width: 13rem; }
.sp-upg-c-system { width: 30%; }
.sp-upg-c-actions { width: 9.5rem; }
.sp-upg-c-pick { width: 2.25rem; }

/* Request detail: sortable headers and status group rows. */
.sp-upg-sort {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.sp-upg-sort:hover { color: var(--text-primary); }
.sp-upg-sort.is-sorted { color: var(--text-primary); }
.sp-upg-sort[data-arrow]:not([data-arrow=""])::after { content: ' ' attr(data-arrow); font-size: .7em; }

.sp-upg-group td {
  background: var(--surface-2, var(--bg2));
  border-top: 1px solid var(--border-subtle, var(--border));
  padding: var(--space-1) var(--space-3);
}

.sp-upg-group-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  background: none;
  border: 0;
  padding: var(--space-1) 0;
  font: inherit;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.sp-upg-group-caret { width: 1em; color: var(--text-muted); }
.sp-upg-group--failed .sp-upg-group-btn,
.sp-upg-group--write_error .sp-upg-group-btn { color: var(--danger, #dc2626); }
.sp-upg-group--canceled .sp-upg-group-btn { color: var(--warning, #d97706); }

/* Request detail: find a system and tick systems to remove. */
.sp-upg-detail-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-3) 0;
}

.sp-upg-detail-find { flex: 0 1 24rem; min-width: 14rem; }

.sp-upg-remove-list {
  margin: var(--space-2) 0 var(--space-3);
  padding-left: 1.25rem;
  max-height: 12rem;
  overflow-y: auto;
}

.sp-upg-actions--stack {
  white-space: normal;
}

.sp-upg-actions--stack .btn {
  display: block;
  width: 100%;
}

.sp-upg-actions--stack .btn + .btn {
  margin: var(--space-1) 0 0;
}

.sp-upg-why {
  color: var(--warning);
}

.sp-upg-excluded {
  color: var(--text-muted);
}

.sp-upg-log {
  max-height: 24rem;
  overflow: auto;
  margin: 0;
  padding: var(--space-2);
  font-family: var(--font-mono, monospace);
  font-size: var(--font-size-xs, 0.75rem);
  white-space: pre-wrap;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.sp-upg-radio {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.sp-upg-pill {
  margin-left: var(--space-1);
  vertical-align: middle;
  font-size: var(--font-size-xs, 0.7rem);
  text-decoration: none;
}

/* ── Temp Systems (temp-systems.js) ─────────────────────────────────────── */
/* Purple T in place of the SP / RM badge; the same colour as Temp.ico on the shortcut. */
:root {
  --sp-temp: #7c3aed;
  --sp-temp-contrast: #fff;
}

.sp-tmp-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  height: 1.4em;
  padding: 0 0.3em;
  border-radius: var(--radius-sm);
  background: var(--sp-temp);
  color: var(--sp-temp-contrast);
  font-weight: var(--font-weight-bold);
  font-size: 0.75rem;
  line-height: 1;
  vertical-align: middle;
}

.sp-tmp-chip--nav {
  margin-right: 2px;
}

/* Markup with no text, so the permission catalogue reads the button label alone. */
.sp-tmp-chip--glyph::before {
  content: 'T';
}

.sp-tmp-action-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.sp-tmp-action-why {
  max-width: 100%;
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: var(--font-weight-normal, 400);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.sp-tmp-action-why[hidden] {
  display: none;
}

.hz-cm-action-btn.sp-tmp-action:disabled,
.hz-cm-action-btn.sp-tmp-action:disabled:hover {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--surface-2) !important;
  border-color: var(--border-strong) !important;
}

.hz-cm-action-btn.sp-tmp-action:disabled .hz-cm-action-text {
  color: var(--text-muted) !important;
}

.customer-avatar--temp {
  background: var(--sp-temp);
  border-color: var(--sp-temp);
  color: var(--sp-temp-contrast);
  font-size: var(--font-size-lg);
}

.sp-tmp-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
}

.sp-tmp-facts {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-3) 0;
  font-size: var(--font-size-sm);
}

.sp-tmp-facts th,
.sp-tmp-facts td {
  padding: var(--space-1) var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

.sp-tmp-facts th {
  width: 12rem;
  white-space: nowrap;
  font-weight: var(--font-weight-normal, 400);
  color: var(--text-muted);
}

.sp-tmp-facts td {
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

/* Fixed columns that wrap, so the list never scrolls sideways. */
.sp-tmp-table {
  table-layout: fixed;
  width: 100%;
}

.sp-tmp-table th,
.sp-tmp-table td {
  padding: var(--space-2) var(--space-3);
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.sp-tmp-table .tag {
  white-space: normal;
}

.sp-tmp-table th:not([data-col]) { cursor: default; }

.sp-tmp-table .sp-tmp-flag {
  display: inline-block;
  margin-top: var(--space-1);
}

.sp-tmp-col-name { width: 27%; }
.sp-tmp-col-source { width: 17%; }
.sp-tmp-col-age { width: 7%; }
.sp-tmp-col-size { width: 8%; }
.sp-tmp-col-status { width: 15%; }
.sp-tmp-col-who { width: 17%; }
.sp-tmp-col-action { width: 9%; }

.sp-tmp-protect-note {
  margin: var(--space-1) 0 var(--space-3) calc(1.25rem + var(--space-2));
}

.sp-tmp-problems,
.sp-tmp-warnings {
  margin: 0 0 var(--space-3) var(--space-4);
  padding: 0;
  font-size: var(--font-size-sm);
}

.sp-tmp-problems {
  color: var(--danger);
}

.sp-tmp-warnings {
  color: var(--warning);
}

.sp-tmp-storage {
  margin: var(--space-3) 0;
}

.sp-tmp-bar {
  height: 10px;
  max-width: 32rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-bottom: var(--space-1);
}

.sp-tmp-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sp-temp);
}

.sp-tmp-bar-fill--high {
  background: var(--danger);
}

.sp-tmp-h {
  margin: var(--space-3) 0 var(--space-2);
  font-size: var(--font-size-md);
}

.sp-tmp-open-list,
.sp-tmp-step-list {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sp-tmp-steps summary {
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* ── Install detail copy icons (System Management) ─────────────────────── */

td > .btn-copy-field {
  margin-left: var(--space-1);
  vertical-align: middle;
}

#sp-ins-detail-modal .btn-copy-field {
  margin-left: var(--space-1);
  vertical-align: middle;
}

.sp-ins-copyable {
  display: inline-flex;
  align-items: center;
  margin-right: var(--space-2);
}

/* Install notifications: Helix user search results in the Environment editor. */
.sp-ins-user-hits {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

/* Install notifications: one row per recipient, one checkbox column per audience. */
.sp-ins-matrix-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.sp-ins-matrix-bar input[type="search"] {
  flex: 1 1 16rem;
  max-width: 22rem;
}

.sp-ins-matrix-scroll {
  max-height: 60vh;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.sp-ins-matrix {
  width: 100%;
  margin: 0;
}

.sp-ins-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-elevated);
}

.sp-ins-matrix td {
  padding-top: var(--space-1);
  padding-bottom: var(--space-1);
  vertical-align: middle;
}

.sp-ins-matrix .sp-ins-matrix-cell {
  width: 8.5rem;
  text-align: center;
  white-space: nowrap;
}

.sp-ins-matrix-cell .sp-upg-sub {
  margin-left: var(--space-1);
}

.sp-ins-matrix-n {
  margin-left: var(--space-1);
  font-weight: 400;
  color: var(--text-muted);
}

.sp-ins-matrix-name {
  margin-right: var(--space-1);
}

.sp-ins-matrix td .tag {
  margin-right: var(--space-1);
}

/* Removing / Removal failed on a customer row and on the customer page. */
.sp-ins-removing {
  margin-left: var(--space-2);
  cursor: pointer;
  vertical-align: middle;
}

/* Remove System SiteID suggestions: in the modal's flow, directly under the field. */
#sp-ins-remove-modal .helix-suggest-menu {
  position: static;
  margin-top: var(--space-1);
  max-height: 14rem;
}

/* ── New Install form (System Management) ─────────────────────────────── */

.sp-ins-orgs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-2);
  max-height: 22rem;
  overflow-y: auto;
  padding: 2px;
}

.sp-ins-org-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.sp-ins-org-card:hover:not(:disabled),
.sp-ins-org-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.sp-ins-org-card.is-selected {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: 0 0 0 1px var(--accent);
}

.sp-ins-org-card:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.sp-ins-org-name {
  font-weight: 600;
  line-height: 1.3;
}

.sp-ins-org-ids {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.sp-ins-org-ids b {
  font-weight: 500;
  color: var(--text);
}

.sp-ins-org-flags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  max-width: 100%;
  min-width: 0;
}

/* A long SiteID ("Already AlabamaWholesaleLmbr_C41823") wraps inside the card. */
.sp-ins-org-flags .tag {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}

.sp-ins-org-card {
  min-width: 0;
}

.sp-ins-form {
  max-width: none;
  margin: 0;
  gap: var(--space-3);
}

.sp-ins-form fieldset {
  margin: 0;
  min-width: 0;
  padding: var(--space-3) var(--space-4) var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sp-ins-form fieldset[hidden] {
  display: none;
}

.sp-ins-form legend {
  padding: 0 var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sp-ins-form .sp-cf-note {
  margin: 0;
}

.sp-ins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-3);
}

.sp-ins-grid[hidden] {
  display: none;
}

.sp-ins-grid--5 {
  grid-template-columns: minmax(12rem, 2fr) repeat(4, minmax(6rem, 1fr));
}

/* RCWS / RRWS: one row per service, checkbox then its version on the same line. */
.sp-ins-ws {
  display: grid;
  grid-template-columns: minmax(16rem, max-content) minmax(12rem, 16rem);
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

.sheet-form .sp-ins-ws-version {
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.sp-ins-ws-version input {
  flex: 1;
  min-width: 0;
}

@media (max-width: 640px) {
  .sp-ins-ws {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sp-ins-grid--5 {
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  }
}

.sp-ins-choice {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5, 1.5rem);
}

.sp-ins-choice .sheet-check {
  align-items: flex-start;
  color: var(--text-primary);
}

.sp-ins-choice .sheet-check input {
  margin-top: 0.15rem;
}

.sp-ins-form .sheet-check .sp-upg-sub {
  display: inline;
  margin-left: var(--space-1);
}

/* Download Software: version-matched packages under the customer action tiles. */
.sp-sw-table th,
.sp-sw-table td {
  padding: var(--space-2) var(--space-3);
}

.sp-sw-table th,
.sp-sw-table th:hover {
  cursor: default;
  color: var(--text-muted);
  background: var(--surface-2);
}

.sp-sw-mono {
  font-family: var(--eci-font-family-mono);
}

.sp-sw-muted {
  color: var(--text-muted);
}

.sp-sw-action {
  text-align: right;
  white-space: nowrap;
}

/* View Stations (helix-stations.js): Stations table rows joined to live RCWS connections.
   The customer column stays sized for key/value rows; only the station panel runs out to the
   page width. The column is left-aligned in the page, so the panel grows to the right. */
.helix-entity-page:has(#station-details-panel) {
  container-type: inline-size;
}

#station-details-panel[data-open="1"] {
  width: 100cqw;
  max-width: 100cqw;
  box-sizing: border-box;
}

.helix-stations-table th,
.helix-stations-table td {
  padding: var(--space-2) var(--space-3);
}

th.helix-stations-static {
  cursor: default;
}

th.helix-stations-static:hover {
  color: var(--text-muted);
  background: var(--surface-2);
}

.helix-stations-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  white-space: nowrap;
}

.helix-stations-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-4);
  margin-bottom: var(--space-3);
}

.helix-stations-summary .sp-cf-note {
  margin: 0;
}

.helix-stations-row {
  cursor: pointer;
}

th.helix-stations-chevron {
  cursor: default;
}

.helix-stations-chevron {
  width: 24px;
  text-align: center;
  color: var(--text-muted);
}

.helix-stations-name,
.helix-stations-mono {
  font-family: var(--eci-font-family-mono);
}

.helix-stations-name {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.helix-stations-muted {
  color: var(--text-muted);
}

.helix-stations-detail > td {
  padding: 0;
  background: var(--surface-2);
}

.helix-stations-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-2) var(--space-6);
  padding: var(--space-3) var(--space-4);
}

.helix-stations-orphans {
  margin-top: var(--space-4);
}
