/* Extend the existing operations-board palette without changing its design. */
.source-health {
  margin: 8px 36px 0; padding: 7px 12px; border: 1px solid var(--line, #243049);
  border-radius: 10px; background: var(--panel, #131a26);
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  position: relative; z-index: 5;
  font-size: 11px; line-height: 1.35; overflow: visible; flex-shrink: 0;
}
.connection-status { font-weight: 650; color: var(--amber, #f1c40f); }
.connection-status.current { color: var(--green, #2ecc71); }
.source-readouts, .server-monitors { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 5px 7px; }
.health-indicator { position: relative; color: var(--muted, #8a98b3); }
.health-indicator summary {
  display: flex; align-items: center; gap: 6px; min-height: 22px; padding: 2px 8px;
  border: 1px solid var(--line, #243049); border-radius: 999px; background: #101722;
  cursor: pointer; list-style: none; white-space: nowrap; user-select: none;
}
.health-indicator summary::-webkit-details-marker { display: none; }
.health-indicator summary::after { content: "+"; color: var(--muted, #8a98b3); font-size: 12px; margin-left: 2px; }
.health-indicator[open] summary::after { content: "−"; }
.health-indicator summary:focus-visible { outline: 2px solid var(--blue, #4aa3ff); outline-offset: 2px; }
.health-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #8290a7; }
.health-label { color: var(--text, #e8eef9); font-weight: 650; }
.health-state { color: inherit; }
.health-indicator.up .health-dot { background: var(--green, #2ecc71); }
.health-indicator.down .health-dot { background: var(--red, #e74c3c); }
.health-indicator.pending .health-dot { background: var(--amber, #f1c40f); }
.health-indicator.stale .health-dot { background: #d48a63; }
.health-indicator.unknown .health-dot { background: #77849a; }
.health-indicator.up .health-state { color: var(--green, #2ecc71); }
.health-indicator.down .health-state { color: var(--red, #e74c3c); }
.health-indicator.pending .health-state { color: var(--amber, #f1c40f); }
.health-details {
  position: absolute; z-index: 10; top: calc(100% + 4px); left: 0; min-width: 230px; max-width: min(360px, 88vw);
  padding: 8px 10px; border: 1px solid var(--line, #243049); border-radius: 8px;
  background: #101722; color: var(--muted, #8a98b3); box-shadow: 0 8px 22px rgb(0 0 0 / 24%);
  overflow-wrap: anywhere;
}
.server-monitors .health-indicator:last-child .health-details { left: auto; right: 0; }
.health-detail-line + .health-detail-line { margin-top: 3px; }
.infrastructure-heading { display: none; }
body.business-last-known #grid, body.business-last-known #qmsPage,
body.business-last-known #hdrIntegrity, body.business-last-known #hdrSurveys,
body.business-last-known #integrityDialog, body.business-last-known #qmsNotesPopup {
  filter: grayscale(1);
}
body.business-last-known .card::after {
  content: "Last-known / unverified"; position: absolute; right: 14px; bottom: 6px;
  font-size: 10px; color: var(--muted);
}
body.business-waiting .card::after { content: none; }
body { min-height: 100dvh; }
@media (max-width: 1200px) {
  header { flex-wrap: wrap; gap: 10px; }
  .hdr-surveys { margin: 0; }
}
@media (max-width: 767px) {
  body { height: auto; overflow: auto; }
  header { padding: 16px; }
  header .title { flex-wrap: wrap; }
  header h1 { font-size: 26px; }
  .hdr-integrity, .hdr-surveys { margin: 0; flex-wrap: wrap; max-width: 100%; }
  .hdr-surveys { gap: 12px; }
  .hdr-surveys .svy + .svy { border: 0; padding-left: 0; }
  .source-health { margin: 8px 16px 0; max-height: none; overflow: visible; }
  .source-readouts, .server-monitors { gap: 5px; }
  .health-details { position: static; min-width: 0; max-width: 100%; margin: 4px 4px 0; }
  .grid { grid-template-columns: 1fr; grid-auto-rows: auto; padding: 16px; }
  .card { min-height: 240px; }
  footer { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
}
/* Supporting pages use the board's existing dark panels and typography. */
.access-page {
  --bg: #0b0f17; --panel: #131a26; --line: #243049; --text: #e8eef9;
  --muted: #8a98b3; --accent: #6c8cff; --amber: #f1c40f;
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: grid; place-items: center; padding: 24px; box-sizing: border-box;
}
.access-panel {
  width: min(100%, 560px); box-sizing: border-box; background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; padding: 32px;
}
.access-panel h1 { font-size: 28px; margin: 0 0 8px; }
.access-panel h2 { font-size: 20px; margin: 24px 0 12px; }
.access-panel p, .access-panel li { color: var(--muted); line-height: 1.6; }
.access-panel li { margin-bottom: 12px; }
.access-panel ol { padding-left: 22px; }
.access-panel code { color: var(--text); overflow-wrap: anywhere; }
.access-panel label { display: block; margin: 24px 0 8px; }
.access-panel input[type=password] {
  width: 100%; box-sizing: border-box; padding: 12px; border-radius: 8px;
  background: var(--bg); color: var(--text); border: 1px solid var(--line); font: inherit;
}
.access-panel button {
  width: 100%; margin-top: 18px; padding: 12px; border-radius: 8px;
  border: 1px solid var(--accent); background: #243556; color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
}
.access-panel button:hover { background: #2c4066; }
.access-panel :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.access-panel .access-error { color: #f1948a; padding: 12px; border: 1px solid #743f45; border-radius: 8px; }
.access-panel .setup-label { color: var(--amber); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
