:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --border: #e3e3de;
  --text: #1b1b19;
  --muted: #6a6a64;
  --faint: #a2a29b;
  --accent: #3e63dd;
  --up: #2f9e68;
  --down: #e5484d;
  --late: #e8a317;
  --running: #3e63dd;
  --none: #dcdcd6;
  --t-page: #e5484d;
  --t-notify: #e8a317;
  --t-digest: #8e4ec6;
  --t-agent: #3e63dd;
  --t-record: #8b8d98;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --surface: #191918;
    --surface-2: #21211f;
    --border: #2b2b29;
    --text: #ecece9;
    --muted: #a09f99;
    --faint: #63625d;
    --none: #2e2e2b;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  font-feature-settings: "tnum";
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }

header.top {
  display: flex; align-items: center; gap: 20px;
  padding: 18px 0 22px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--text); color: var(--bg);
  display: grid; place-items: center; font: 600 15px/1 var(--mono);
}
nav { display: flex; gap: 4px; flex: 1; }
nav a { padding: 5px 10px; border-radius: 7px; color: var(--muted); }
nav a.on, nav a:hover { color: var(--text); background: var(--surface-2); }
header form { margin: 0; }

h1 { font-size: 20px; letter-spacing: -0.015em; margin: 0 0 4px; font-weight: 600; }
h1.mono { font-size: 19px; }
h2 { font-size: 15px; margin: 0; font-weight: 600; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 22px 0 8px; font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 20px; }

.summary { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 500; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.card-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head .meta { color: var(--muted); font-size: 13px; margin-left: auto; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--none); }
.dot.up { background: var(--up); }
.dot.down { background: var(--down); box-shadow: 0 0 0 3px color-mix(in srgb, var(--down) 22%, transparent); }
.dot.late { background: var(--late); }
.dot.running { background: var(--running); }
.dot.paused, .dot.new { background: var(--faint); }

.checks { display: grid; gap: 2px; }
.check {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1.3fr) minmax(160px, 2fr) 56px;
  align-items: center; gap: 14px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
}
.check:first-child { border-top: 0; }
.check .name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.check .name a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.check .pct { text-align: right; color: var(--muted); font-size: 12.5px; }

.strip { display: flex; gap: 2px; height: 20px; align-items: stretch; }
.strip span { flex: 1; border-radius: 2px; background: var(--none); min-width: 2px; }
.strip .up { background: var(--up); opacity: .85; }
.strip .down { background: var(--down); }

.chip {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  background: color-mix(in srgb, currentColor 10%, transparent);
  white-space: nowrap;
}
.t-page { color: var(--t-page); }
.t-notify { color: var(--t-notify); }
.t-digest { color: var(--t-digest); }
.t-agent { color: var(--t-agent); }
.t-record { color: var(--t-record); }
.s-open { color: var(--down); }
.s-resolved { color: var(--up); }
.s-ignored, .s-muted { color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

table { width: 100%; border-collapse: collapse; }
th { white-space: nowrap; text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 0 10px 8px 0; }
td { padding: 9px 10px 9px 0; border-top: 1px solid var(--border); vertical-align: top; }
td.num, th.num { text-align: right; }
.title-cell a { font-weight: 500; }
.title-cell .culprit { color: var(--muted); font-size: 12.5px; font-family: var(--mono); overflow-wrap: anywhere; }

.tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.tabs a { padding: 4px 10px; border-radius: 7px; color: var(--muted); border: 1px solid transparent; }
.tabs a.on { color: var(--text); border-color: var(--border); background: var(--surface); }

dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; overflow-wrap: anywhere; }

pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; overflow: auto; margin: 6px 0 0; max-height: 460px; line-height: 1.45;
}
.exc { font-size: 15px; margin: 2px 0 10px; overflow-wrap: anywhere; }
.exc b { font-family: var(--mono); font-size: 14px; }
.frames { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 12.5px; }
.frames li { padding: 4px 8px; border-radius: 6px; color: var(--muted); overflow-wrap: anywhere; }
.frames li.app { color: var(--text); background: var(--surface-2); }
.frames li .ctx { display: block; padding-left: 14px; color: var(--muted); white-space: pre-wrap; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 6px 0; border-top: 1px solid var(--border); display: flex; gap: 12px; }
.timeline li:first-child { border-top: 0; }
.timeline .ts { color: var(--muted); font-size: 12.5px; min-width: 96px; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.actions form { margin: 0; }
.btn {
  font: inherit; font-size: 13px; cursor: pointer;
  padding: 5px 11px; border-radius: 8px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.btn { white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
input[type=password], input[type=text] {
  font: inherit; padding: 8px 10px; border-radius: 8px; width: 100%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 7px 0; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: baseline; }
.feed li:first-child { border-top: 0; }
.feed .ts { color: var(--muted); font-size: 12.5px; min-width: 70px; }
.empty { color: var(--muted); padding: 6px 0; }
.muted { color: var(--muted); }

.login { max-width: 340px; margin: 12vh auto 0; }
.login .card { padding: 22px; }
.login form { display: grid; gap: 12px; }
.err { color: var(--down); }

@media (max-width: 720px) {
  .check { grid-template-columns: 1fr 70px; }
  .check .strip, .check .pct { grid-column: 1 / -1; }
  .check .pct { text-align: left; }
  .hide-sm { display: none; }
  nav a { padding: 5px 7px; }
  header.top { gap: 10px; }
  .brand { gap: 0; font-size: 0; }
}
