:root {
  color-scheme: light;
  --paper: #fff;
  --canvas: #f3f5f8;
  --ink: #171f33;
  --muted: #536179;
  --line: #e0e5ed;
  --focus: #254de1;
  --up: #087653;
  --up-soft: #e6f5ee;
  --down: #9c2c39;
  --down-soft: #fcebef;
  --pending: #695011;
  --pending-soft: #fcf1d7;
  --data-font: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
h1, h2, p, dl, dd { margin: 0; }
button, input { font: inherit; }
a { color: #2347a9; text-decoration-thickness: .075em; text-underline-offset: .22em; }
a:hover { color: #142a72; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.shell { width: min(100% - 3rem, 76rem); margin-inline: auto; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: .75rem; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-size: .9375rem; font-weight: 680; }
.brand-mark { display: inline-block; flex: 0 0 2rem; width: 2rem; aspect-ratio: 1; border-radius: .55rem; background: #222b46; position: relative; }
.brand-mark::before {
  content: "";
  position: absolute;
  inset: .48rem .41rem;
  background: #b7f9db;
  clip-path: polygon(0 76%, 29% 44%, 47% 60%, 76% 10%, 100% 10%, 53% 86%, 31% 68%, 0 100%);
}
.button {
  display: inline-grid;
  place-items: center;
  min-height: 2.75rem;
  padding: .5rem .95rem;
  border: 1px solid #d5dce8;
  border-radius: .5rem;
  background: var(--paper);
  color: var(--ink);
  font-size: .875rem;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.button:hover, .button[aria-busy="true"] { background: #edf1f7; border-color: #bcc7d7; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-block: 4rem 1.65rem; }
h1 { font-size: clamp(2.15rem, 5vw, 3.45rem); letter-spacing: -.055em; line-height: 1.08; font-weight: 730; }
.page-heading p, .login-card p { margin-top: .65rem; color: var(--muted); }
.updated { color: var(--muted); display: inline-flex; align-items: center; gap: .55rem; min-height: 2.25rem; font-size: .875rem; }
.signal { display: inline-block; inline-size: .46rem; block-size: .46rem; flex: 0 0 auto; border-radius: 50%; background: #6b7890; }
.signal.up { background: var(--up); }
.signal.down { background: var(--down); }
.overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1.75rem; }
.stat, .projects, .login-card { background: var(--paper); border: 1px solid var(--line); border-radius: .85rem; }
.stat { min-width: 0; padding: 1rem 1.2rem; }
.stat dt { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--muted); }
.stat dd { margin-top: .35rem; font: 650 clamp(1.35rem, 3vw, 2rem)/1.2 var(--data-font); letter-spacing: -.055em; }
.projects { overflow: clip; margin-bottom: 2rem; }
.projects-heading, .projects-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .35rem .75rem;
  padding: .9rem 1.2rem;
}
h2 { font-size: 1.125rem; letter-spacing: -.02em; }
.projects-footer { color: var(--muted); font-size: .875rem; border-top: 1px solid var(--line); }
.notice { border-top: 1px solid var(--line); padding: 1.2rem; color: var(--muted); }
table { border-collapse: collapse; width: 100%; text-align: left; }
thead { color: var(--muted); background: #f7f8fb; }
thead th { font-size: .875rem; font-weight: 600; }
td, th { padding: .75rem 1rem; border-top: 1px solid var(--line); }
tr > :where(:first-child) { padding-left: 1.2rem; }
tr > :where(:last-child) { padding-right: 1.2rem; }
tbody tr:hover { background: #fafbfd; }
.site { line-height: 1.2; min-width: 9.5rem; }
.site strong { display: block; font-size: 1rem; font-weight: 660; }
.domain, .repo-link { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: .875rem; }
.domain { overflow-wrap: anywhere; max-width: 100%; font-weight: 500; }
.repo-link { color: var(--muted); }
.numeric { text-align: right; white-space: nowrap; }
td.numeric { color: #38455e; font: .875rem var(--data-font); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .21rem .58rem;
  border-radius: 3rem;
  color: var(--pending);
  background: var(--pending-soft);
  font-size: .875rem;
  font-weight: 630;
}
.badge::before { content: ""; flex: 0 0 .42rem; height: .42rem; border-radius: 50%; background: currentColor; }
.badge.up { color: var(--up); background: var(--up-soft); }
.badge.down { color: var(--down); background: var(--down-soft); }
.detail { display: block; margin-top: .2rem; color: var(--muted); font-size: .8125rem; }
.detail:empty { display: none; }

.login-page { display: grid; min-height: 100dvh; place-items: center; padding: 1.2rem; }
.login-card { width: min(100%, 27rem); padding: clamp(1.35rem, 6vw, 2rem); box-shadow: 0 12px 40px #2234550c; }
.login-card h1 { margin-top: 1.75rem; font-size: 2rem; }
.login-card form { display: grid; gap: .55rem; margin-top: 1.55rem; }
.login-card label { font-size: .9rem; font-weight: 640; }
.login-card input { padding: .7rem .75rem; min-width: 0; border: 1px solid #9faabe; border-radius: .5rem; color: var(--ink); }
.login-card .primary { margin-top: .5rem; color: white; background: #24304d; border-color: #24304d; }
.login-card .primary:hover { background: #374668; border-color: #374668; }
.login-card .form-error { margin-top: 0; color: var(--down); font-size: .875rem; }

@media (max-width: 52rem) {
  .shell { width: calc(100% - 2rem); }
  .page-heading { margin-top: 2.55rem; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table, tbody { display: block; }
  tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: "site site state" "repo repo repo" "response cpu disk";
    gap: 0 .45rem;
    padding: .75rem 1rem .85rem;
    border-top: 1px solid var(--line);
  }
  tbody tr > :is(td, th) { min-width: 0; border: 0; padding: 0; }
  .site { grid-area: site; }
  .availability { grid-area: state; text-align: right; }
  .repository { grid-area: repo; }
  .response { grid-area: response; }
  .cpu { grid-area: cpu; }
  .disk { grid-area: disk; }
  td.numeric { text-align: left; white-space: normal; }
  td.numeric::before { content: attr(data-label); display: block; margin-bottom: .15rem; color: var(--muted); font: .8125rem/1.35 system-ui, sans-serif; }
  .domain, .repo-link { min-height: 2.75rem; }
}

@media (max-width: 36rem) {
  .page-heading { display: block; margin-bottom: 1rem; }
  .updated { margin-top: .55rem; }
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin-bottom: 1.1rem; }
  .stat, .projects-heading, .projects-footer { padding-inline: .85rem; }
  tbody tr { grid-template-columns: 1fr .8fr 1.4fr; }
  .badge { font-size: .8125rem; padding-inline: .45rem; }
}

@media (prefers-reduced-motion: reduce) { .button { transition: none; } }
