:root {
  color-scheme: light;
  --ink: #25313f;
  --muted: #626f7e;
  --line: #dfe5eb;
  --accent: #365e86;
  --paper: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: #f6f8fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: #203f60;
}

:focus-visible {
  outline: 3px solid #729ac3;
  outline-offset: 4px;
}

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 600;
}

h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  letter-spacing: -0.035em;
}

h2 {
  margin: 36px 0 16px;
  font-size: 1.2rem;
}

h3 {
  margin: 0 0 20px;
  font-size: 1.05rem;
}

p {
  margin: 0 0 20px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

.muted, .eyebrow {
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}


.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-nav {
  max-width: 1320px;
  margin: auto;
  padding: 18px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  background: #f6f8fa;
}

.page {
  max-width: 1320px;
  margin: auto;
  padding: 44px 36px 72px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.page-heading p {
  margin: 0;
}

.project-count {
  color: var(--muted);
  font-size: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  background: var(--paper);
}

.breadcrumb {
  margin-bottom: 24px;
  font-size: 0.85rem;
}

.skip-link {
  position: absolute;
  top: -80px;
  left: 20px;
  padding: 10px 16px;
  background: var(--paper);
  z-index: 10;
}

.skip-link:focus {
  top: 12px;
}


button, input {
  font: inherit;
}

button, input[type="submit"] {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 500;
}

button:hover, input[type="submit"]:hover {
  background: #294e73;
}

button.button-secondary {
  background: var(--paper);
  color: var(--muted);
  border-color: var(--line);
  font-size: 0.85rem;
}

button.button-secondary:hover {
  color: var(--ink);
  background: #f6f8fa;
}

.button_to {
  margin: 0;
}

input:not([type="submit"]):not([type="hidden"]) {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #bac5d1;
  border-radius: 6px;
  color: var(--ink);
  background: var(--paper);
}

input::placeholder {
  color: var(--muted);
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

.sign-in {
  max-width: 420px;
  margin: 6vh auto 0;
  padding: 32px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 4px 18px #25313f05;
}

.sign-in h1 {
  font-size: 1.75rem;
}

.sign-in .muted {
  font-size: 0.9rem;
}

.sign-in-form {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

.flash {
  padding: 12px 16px;
  border: 1px solid var(--health-ok-box);
  border-radius: 6px;
  background: var(--health-ok-background);
  color: var(--health-ok-text);
}

.flash-alert {
  border-color: var(--health-down-box);
  background: var(--health-down-background);
  color: var(--health-down-text);
}


.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px;
  font-size: 0.85rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

caption {
  padding: 16px 20px;
  text-align: left;
  color: var(--muted);
  font-size: 0.8rem;
  border-bottom: 1px solid var(--line);
}

th, td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  background: #f9fafb;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

tbody th {
  font-weight: 600;
  min-width: 170px;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafbfd;
}

tbody th code {
  display: block;
  color: var(--muted);
  font-weight: 400;
  margin-top: 4px;
}

td {
  overflow-wrap: anywhere;
  min-width: 80px;
}

td a {
  white-space: nowrap;
}

.project-table {
  min-width: 1080px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

td .project-links {
  display: grid;
  gap: 4px;
}

.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  line-height: 1.5;
  background: #edf0f4;
  color: #526171;
  white-space: nowrap;
}

.status[data-status="ok"] {
  background: var(--health-ok-background);
  color: var(--health-ok-text);
}

.status[data-status="failed"] {
  background: var(--health-down-background);
  color: var(--health-down-text);
}

.status[data-status="missing_credentials"], .status[data-status="stale"] {
  background: var(--health-partial-background);
  color: var(--health-partial-text);
}


dl {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 12px 24px;
  margin: 20px 0;
  font-size: 0.9rem;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.project-meta {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 36px 0 20px;
}

.section-heading h2 {
  margin: 0;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  align-items: start;
  gap: 20px;
}

.section-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.section-card dl {
  grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1fr);
  gap: 10px 16px;
  font-size: 0.8rem;
}

.section-card dl + dl {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.section-card dl:last-child {
  margin-bottom: 0;
}

.section-card table {
  min-width: 600px;
}

.check-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 28px 0;
}

.check-filters a {
  display: block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  background: var(--paper);
}

.check-filters a[aria-current="page"] {
  color: #294e73;
  border-color: #c4d4e4;
  background: #eaf0f6;
}


@media (max-width: 640px) {
  .site-nav {
    padding: 14px 20px;
  }

  .page {
    padding: 28px 20px 48px;
  }

  h1 {
    font-size: 1.65rem;
  }

  .sign-in {
    margin-top: 20px;
    padding: 24px;
  }

  .project-meta, .section-card {
    padding: 20px;
  }

  dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  dd {
    margin-bottom: 12px;
  }

  .section-card dl {
    grid-template-columns: 1fr 1fr;
  }

  .section-card dd {
    margin-bottom: 0;
  }

  th, td {
    padding: 12px 16px;
  }

}

/* Status colors apply to the project grid. Collection warnings stay neutral. */
.health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.grid-refresh-note {
  margin: -12px 0 24px;
  font-size: 0.8rem;
}

.health-card {
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  --card-background: #f0f2f4;
  background: var(--card-background);
}

.health-card[data-health="ok"] { --card-background: var(--health-ok-background); }
.health-card[data-health="partial"] { --card-background: var(--health-partial-background); }
.health-card[data-health="down"] { --card-background: var(--health-down-background); }
.health-grid [data-health="ok"] { --health-ink: var(--health-ok-text); --health-stroke: var(--health-ok-stroke); }
.health-grid [data-health="partial"] { --health-ink: var(--health-partial-text); --health-stroke: var(--health-partial-stroke); }
.health-grid [data-health="down"] { --health-ink: var(--health-down-text); --health-stroke: var(--health-down-stroke); }
.health-grid [data-health=""], .health-grid [data-health="neutral"] { --health-ink: var(--muted); --health-stroke: #626f7e; }

.health-card-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-height: 96px;
  margin-bottom: 16px;
}

.health-card-services { display: flex; flex-wrap: wrap; align-items: start; gap: 8px; }
.health-check-box { position: relative; z-index: 1; padding: 5px 9px; border: 1px solid #25313f24; border-radius: 6px; background: #d9dee4; color: var(--ink); line-height: 1.4; }
.health-check-box[data-health="ok"] { background: var(--health-ok-box); }
.health-check-box[data-health="partial"] { background: var(--health-partial-box); }
.health-check-box[data-health="down"] { background: var(--health-down-box); }
.health-primary { font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 600; letter-spacing: -0.035em; overflow-wrap: anywhere; }
.health-connectors { display: grid; gap: 5px; font-size: 0.75rem; }
.health-card-metadata { text-align: right; overflow-wrap: anywhere; }
.health-card-metadata h2 { margin: 0 0 8px; font-size: 1.05rem; }
.health-card-link { color: var(--ink); text-decoration: none; }
.health-card-link::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.health-card-link:focus-visible { outline: none; }
.health-card-link:focus-visible::after { outline: 3px solid #365e86; outline-offset: 4px; }
.health-card-link:hover { text-decoration: underline; }
.health-collection-notes { margin: 0; font-size: 0.73rem; line-height: 1.45; color: #56636f; }
.poll-countdown { position: relative; z-index: 1; display: grid; grid-template-columns: 56px minmax(20px, 1fr) auto 7px; align-items: center; gap: 5px; margin: 3px 0; text-align: left; }
.poll-name { white-space: nowrap; overflow-wrap: normal; }
.poll-track { height: 3px; background: #25313f1a; overflow: hidden; }
.poll-fill { display: block; height: 100%; background: #75818b; }
.poll-time { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.poll-warning { color: #44525d; font-weight: 600; }
.health-chart { position: relative; z-index: 1; min-width: 0; }
.health-chart-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.health-chart-heading h3 { font-size: 0.8rem; margin: 0; font-weight: 500; }
.health-chart-heading span { font-weight: 600; white-space: nowrap; }
.health-chart svg { display: block; width: 100%; overflow: visible; margin: 3px 0; }
.chart-axis { stroke: #abb5ae; stroke-width: 0.6; }
.chart-axis-label { fill: #56636f; font-size: 11px; }
.chart-data { stroke: var(--health-stroke, #626f7e); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart-point { fill: var(--health-stroke, #626f7e); }
.chart-selection { fill: none; stroke: #25313f; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart-tooltip { position: absolute; top: 30px; right: 8px; z-index: 2; max-width: calc(100% - 16px); margin: 0; padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); font-size: 0.73rem; font-variant-numeric: tabular-nums; color: var(--ink); pointer-events: none; }
.chart-median-line { stroke: #626f7e; stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.chart-median-label { fill: #44525d; font-size: 11px; paint-order: stroke; stroke: var(--card-background); stroke-width: 3px; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.health-chart-empty { display: grid; place-items: center; margin: 3px 0; padding: 8px; border: 1px dashed var(--muted); border-radius: 4px; font-size: 0.75rem; text-align: center; color: var(--muted); }
.health-secondary-charts { display: grid; flex-grow: 1; align-content: start; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.health-card-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; border-top: 1px solid #25313f1a; margin-top: 18px; padding-top: 10px; font-size: 0.7rem; color: #56636f; }

@media (max-width: 980px) {
  .health-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .health-card { padding: 18px; }
  .health-card-heading { min-height: 0; grid-template-columns: 1fr; gap: 18px; }
  .health-card-metadata { text-align: left; }
  .health-secondary-charts { grid-template-columns: 1fr; }
}
