:root {
  color-scheme: dark;
  --canvas: #090d12;
  --surface: #10161e;
  --surface-raised: #151d27;
  --line: #25303d;
  --line-soft: #1b2530;
  --text: #f2f5f7;
  --muted: #9da9b7;
  --muted-strong: #c3ccd5;
  --green: #39d98a;
  --green-soft: #173b2b;
  --red: #ff667a;
  --red-soft: #411f29;
  --yellow: #f0c34e;
  --yellow-soft: #3b3115;
  --missing: #aab4c2;
  --missing-soft: #29313b;
  --focus: #79a8ff;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; background: var(--canvas); }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; }

.site-header {
  height: 64px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none;
}
.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(57, 217, 138, .1);
}
.quiet-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
}
.quiet-button:hover { border-color: #3a4858; color: var(--text); }

.page-shell {
  width: min(1376px, calc(100% - 64px));
  margin: 0 auto;
  padding: 52px 0 80px;
}
.page-heading,
.history-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 36px;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -.04em;
}
h2 { margin-bottom: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.02em; }
h3 { margin-bottom: 0; font-size: 16px; letter-spacing: -.01em; }
.eyebrow {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.eyebrow.danger { color: var(--red); }

.summary {
  min-width: 244px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.status-overview {
  margin: 0 0 28px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 13px;
}
.status-overview-good { display: inline-flex; align-items: center; gap: 5px; }
.status-overview strong { color: var(--text); font-weight: 700; }
.status-overview-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.status-overview-separator { color: #526070; }
.status-overview-error,
.status-overview-error strong { color: #ff8797; }
.status-overview-warning,
.status-overview-warning strong { color: var(--yellow); }
.status-overview-missing,
.status-overview-missing strong { color: var(--missing); }

.failure-panel {
  margin-bottom: 44px;
  overflow: hidden;
  border: 1px solid #512733;
  border-radius: var(--radius);
  background: #150f14;
}
.section-heading {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.failure-panel .section-heading { border-bottom: 1px solid #38202a; }
.failure-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red-soft);
  color: #ff9aaa;
  font-weight: 700;
}
.failure-row {
  min-height: 74px;
  padding: 14px 22px;
  display: grid;
  grid-template-columns: 32px minmax(150px, .7fr) minmax(240px, 1.5fr) minmax(180px, 1fr) auto;
  gap: 18px;
  align-items: center;
}
.failure-row + .failure-row { border-top: 1px solid #38202a; }
.failure-row p { min-width: 0; margin: 0; color: var(--muted-strong); overflow-wrap: anywhere; }
.failure-identity,
.failure-action { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.failure-identity strong,
.failure-identity span { min-width: 0; overflow-wrap: anywhere; }
.failure-identity span,
.failure-action span { color: var(--muted); font-size: 11px; }
.failure-identity time { color: #778596; font-size: 10px; font-variant-numeric: tabular-nums; }
.failure-action strong { color: #f2c0c8; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }

.systems-heading { padding: 0 0 16px; }

.client-stack { min-width: 0; display: grid; gap: 18px; }
.client-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.client-panel[open] > .client-header { border-bottom: 1px solid var(--line); }
.client-header {
  min-height: 58px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.client-header::-webkit-details-marker { display: none; }
.client-header:hover { background: var(--surface-raised); }
.client-header:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.client-header > span:last-child { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.client-title { min-width: 0; display: inline-flex; align-items: center; gap: 10px; }
.client-name { min-width: 0; color: var(--text); font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }

.disclosure-icon {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}
.client-panel[open] .disclosure-icon { transform: rotate(45deg) translate(-2px, -2px); }
.table-scroll { width: 100%; max-width: 100%; overflow: visible; }
.status-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: auto;
}
.current-table { min-width: 0; table-layout: fixed; }
.current-table .status-column { width: 7%; }
.current-table .check-column { width: 14%; }
.current-table th:nth-child(3) { width: 8%; }
.current-table th:nth-child(4) { width: 24%; }
.current-table th:nth-child(5) { width: 21%; }
.current-table th:nth-child(6) { width: 9%; }
.current-table th:nth-child(7) { width: 10%; }
.current-table th:last-child { width: 7%; }
th {
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .09em;
  text-align: left;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
th a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}
th a:hover, th a[aria-sort] { color: var(--text); }
th a span { color: #637184; font-size: 12px; }
td {
  height: 61px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted-strong);
  vertical-align: middle;
  white-space: nowrap;
}
.current-table td { height: auto; min-height: 61px; white-space: normal; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color 120ms ease; }
tbody tr:hover { background: var(--surface-raised); }
.status-column, .status-cell { width: 78px; }
.status-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
}
.status-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}
.status-ok { background: var(--green-soft); color: var(--green); }
.status-fail { background: var(--red-soft); color: var(--red); }
.status-warning { background: var(--yellow-soft); color: var(--yellow); }
.status-missing { background: var(--missing-soft); color: var(--missing); }
.check-name { color: var(--text); font-weight: 650; overflow-wrap: anywhere; }
.type-label {
  color: var(--muted-strong);
  font-size: 12px;
  letter-spacing: .01em;
}
.description-cell {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.remediation-cell { color: var(--muted-strong); line-height: 1.45; overflow-wrap: anywhere; }
.date-cell { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap !important; }
.mobile-date { display: none; }
.action-cell { text-align: right; }
.row-link {
  display: inline-flex;
  min-height: 34px;
  padding: 0 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}
.row-link:hover { border-color: #475669; color: var(--text); }
.empty-state { margin: 0; padding: 22px; color: var(--muted); }

.back-nav { margin-bottom: 28px; }
.back-nav a { color: var(--muted-strong); font-size: 13px; text-decoration: none; }
.back-nav a:hover { color: var(--text); }
.history-layout { width: 100%; max-width: 1120px; margin: 0 auto; }
.history-heading { align-items: center; }
.history-heading h1 { margin-bottom: 9px; }
.history-heading > div > p:last-child { margin-bottom: 0; color: var(--muted); }
.history-total {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-strong);
  font-size: 12px;
  white-space: nowrap;
}
.history-table { min-width: 0; table-layout: fixed; }
.history-table th:nth-child(1) { width: 8%; }
.history-table th:nth-child(2) { width: 18%; }
.history-table th:nth-child(3) { width: 10%; }
.history-table th:nth-child(4) { width: 28%; }
.history-table th:nth-child(5) { width: 25%; }
.history-table th:nth-child(6) { width: 11%; }
.history-table .description-cell { width: auto; }
.history-panel { margin-top: 12px; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}
.pagination > div { display: flex; gap: 8px; }
.muted { color: var(--muted); }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-box {
  width: min(100%, 380px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 60px rgb(0 0 0 / 24%);
}
.login-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border: 1px solid #31506a;
  border-radius: 11px;
  background: #122130;
  color: #8cc4f2;
}
.login-mark svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.login-box h1 { margin-bottom: 26px; font-size: 30px; letter-spacing: -0.025em; }
.login-box form { display: grid; gap: 16px; }
.login-box label { display: grid; gap: 7px; color: var(--muted-strong); font-size: 12px; font-weight: 650; }
.login-box input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--canvas);
  color: var(--text);
}
.login-box input:focus { border-color: var(--focus); }
.login-box button {
  min-height: 44px;
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  background: var(--text);
  color: var(--canvas);
  font-weight: 750;
  cursor: pointer;
}
.error { color: var(--red); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .page-shell { width: min(100% - 32px, 1376px); padding-top: 36px; }
  .site-header { padding: 0 16px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .summary { width: 100%; justify-content: flex-start; }

  .failure-row { grid-template-columns: 32px 1fr auto; }
  .failure-row > p, .failure-action { grid-column: 2 / -1; }
  .failure-row .row-link { grid-column: 3; grid-row: 1; }

  .status-table {
    display: table;
    width: 100%;
    table-layout: fixed;
    font-size: 10px;
  }
  .current-table .status-column { width: 7%; }
  .current-table .check-column { width: 15%; }
  .current-table th:nth-child(3) { width: 7%; }
  .current-table th:nth-child(4) { width: 22%; }
  .current-table th:nth-child(5) { width: 20%; }
  .current-table th:nth-child(6) { width: 9%; }
  .current-table th:nth-child(7) { width: 11%; }
  .current-table th:last-child { width: 9%; }
  .status-table thead { display: table-header-group; }
  .status-table tbody { display: table-row-group; }
  .status-table tr { display: table-row; }
  .status-table th,
  .status-table td,
  .status-table th:first-child,
  .status-table td:first-child,
  .status-table th:last-child,
  .status-table td:last-child {
    display: table-cell;
    min-width: 0;
    height: auto;
    padding: 7px 3px;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    vertical-align: top;
  }
  .status-table th {
    font-size: 7px;
    letter-spacing: 0;
    line-height: 1.25;
  }
  .status-table th a {
    width: 100%;
    display: block;
  }
  .status-table th a span { display: block; font-size: 8px; }
  .status-table td::before { content: none; }
  .status-icon { width: 21px; height: 21px; }
  .status-icon svg { width: 13px; height: 13px; }
  .type-label { font-size: inherit; }
  .date-cell { white-space: normal !important; }
  .row-link {
    box-sizing: border-box;
    width: 100%;
    min-height: 30px;
    padding: 3px;
    justify-content: center;
    font-size: 7px;
    white-space: nowrap !important;
    overflow-wrap: anywhere;
  }
  .action-cell { text-align: center; }
}

@media (max-width: 600px) {
  .page-shell { width: min(100% - 24px, 1376px); padding: 28px 0 52px; }
  h1 { font-size: 31px; }
  .page-heading { gap: 24px; margin-bottom: 28px; }
  .summary { min-width: 0; padding: 14px 16px; }
  .section-heading { padding: 17px 16px; }
  .failure-row { padding: 14px 16px; gap: 10px 12px; }
  .failure-row > p { font-size: 13px; }

  .client-stack { gap: 14px; }
  .client-header { padding: 0 16px; }

  .history-heading { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 24px; }
  .history-total { align-self: flex-start; }
  .quiet-button { min-height: 44px; }
  .row-link { min-height: 44px; }
}
