:root {
  --bg: #ffffff;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --surface: #f5f5f7;
  --accent: #0071e3;
  --accent-fg: #ffffff;
  --danger: #d70015;
  --radius: 8px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --fg: #f5f5f7;
    --muted: #98989d;
    --line: #38383a;
    --surface: #1c1c1e;
    --accent: #0a84ff;
    --danger: #ff453a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif; }
main { max-width: 880px; margin: 0 auto; padding: 32px 16px 64px; }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
nav { display: flex; align-items: center; gap: 4px; margin: -8px 0 24px; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: var(--radius); }
nav a[aria-current="page"] { color: var(--fg); background: var(--surface); }
nav .spacer { flex: 1; }
h1 { margin-bottom: 24px; }
h2 { font-size: 13px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 32px 0 8px; }
a { color: var(--accent); }
td a { text-decoration: none; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.alerts { list-style: none; padding: 0; margin: 0; }
.alerts li { padding: 10px 12px; border-radius: var(--radius); background: var(--surface); margin-bottom: 8px; }
.alerts strong { color: var(--danger); font-weight: 500; margin-right: 6px; }
.alerts time { color: var(--muted); float: right; }
tr[data-state="alert"] .state, tr[data-state="failed"] .state, tr[data-state="kept"] .state { color: var(--danger); }
tr[data-state="not-enrolled"] td { color: var(--muted); }
.center { display: flex; flex-direction: column; gap: 16px; max-width: 320px; margin: 18vh auto 0; text-align: center; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.row input { flex: 1 1 180px; }
input {
  font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; min-width: 0;
}
button {
  font: inherit; font-weight: 500; border: 0; border-radius: var(--radius); padding: 10px 16px;
  background: var(--accent); color: var(--accent-fg); cursor: pointer;
}
button.quiet { background: transparent; color: var(--accent); padding: 6px 10px; }
button.danger { color: var(--danger); }
button:disabled { opacity: 0.5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
td.actions { text-align: right; white-space: nowrap; }
tr[data-state="gone"] td { color: var(--muted); }
.state { color: var(--muted); }
tr[data-state="suspended"] .state { color: var(--danger); }
.error { color: var(--danger); margin: 0 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 560px) {
  table.drop-2 :is(th, td):nth-child(2), table.drop-3 :is(th, td):nth-child(3) { display: none; }
  dl { grid-template-columns: 1fr; gap: 2px; }
  dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
td time, td .state { white-space: nowrap; }
nav button.quiet { padding: 6px 8px; }
select { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 10px; flex: 1 1 180px; min-width: 0; }
.phases { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.phases li { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); }
.phases li[data-step="done"] { color: var(--fg); }
.phases li[data-step="now"] { background: var(--accent); color: var(--accent-fg); }
.phases li[data-step="failed"] { background: var(--danger); color: #fff; }
tr[data-state="rolledback"] .state { color: var(--danger); }
@media (max-width: 560px) {
  nav { gap: 0; font-size: 14px; }
  nav a, nav button.quiet { padding: 6px 7px; }
}
.secret { background: var(--surface); border-radius: var(--radius); padding: 10px 12px; word-break: break-all; user-select: all; margin: 0 0 16px; }
.banner { padding: 10px 12px; border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.banner[data-state="failed"] { color: var(--danger); }
.stack .row { margin-bottom: 8px; }
.stack p { margin: 12px 0 6px; }
tr[data-state="failed"] .state { color: var(--danger); }
tr[data-state="deleted"] td { color: var(--muted); }
