:root {
  color-scheme: dark;
  --bg: #111316;
  --panel: #191c20;
  --panel-2: #20242a;
  --line: #2e333a;
  --text: #e6e8eb;
  --muted: #9aa1aa;
  --accent: #d4af5a;
  --accent-ink: #1a1408;
  --ok: #6fbf8b;
  --warn: #e0b45c;
  --bad: #e5766f;
  --info: #79a8e0;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f5f4f0;
    --panel: #ffffff;
    --panel-2: #efeee9;
    --line: #d9d7cf;
    --text: #1d1f22;
    --muted: #5f656d;
    --accent: #8a6a14;
    --accent-ink: #ffffff;
    --ok: #1f7a45;
    --warn: #8a6100;
    --bad: #b3362d;
    --info: #24609f;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
h1 { font-size: 20px; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: 15px; margin: 24px 0 8px; font-weight: 600; }
h3 { font-size: 13px; margin: 16px 0 6px; font-weight: 600; color: var(--muted); }
p { margin: 0 0 8px; }
a { color: var(--accent); }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.boot { padding: 32px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 100vh; }
.nav { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.brand { font-weight: 700; padding: 0 8px 12px; letter-spacing: .02em; }
.brand span { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.nav a { color: var(--text); text-decoration: none; padding: 6px 8px; border-radius: 6px; }
.nav a:hover { background: var(--panel-2); }
.nav a.active { background: var(--panel-2); color: var(--accent); font-weight: 600; }
.nav .spacer { flex: 1; min-height: 12px; }
.main { padding: 24px; max-width: 1180px; width: 100%; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.two { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.stat b { display: block; font-size: 22px; font-weight: 600; }
.stat span { color: var(--muted); font-size: 12px; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); font-size: 12px; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 4px; border: 1px solid currentColor; white-space: nowrap; }
.b-observed, .b-approved, .b-success, .b-done, .b-concluded, .b-idle { color: var(--ok); }
.b-verified { color: var(--info); }
.b-human_reported, .b-running, .b-in_review, .b-partial, .b-claimed, .b-busy { color: var(--warn); }
.b-offline, .b-self_reported, .b-pending, .b-proposed, .b-draft, .b-queued, .b-unknown, .b-analyzing { color: var(--muted); }
.b-failure, .b-failed, .b-revoked, .b-rejected, .b-withdrawn, .b-abandoned { color: var(--bad); }

form.stack, .stack { display: flex; flex-direction: column; gap: 10px; }
label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; width: 100%; }
input.check { width: auto; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: inherit; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); }
button:disabled { opacity: .55; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.filters { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 12px; }

.notice { border: 1px solid var(--line); border-left: 3px solid var(--info); border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; background: var(--panel); }
.notice.error { border-left-color: var(--bad); }
.notice.warn { border-left-color: var(--warn); }
.secret { font-family: var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; overflow-wrap: anywhere; user-select: all; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; font-family: var(--mono); }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate .panel { width: 100%; max-width: 400px; padding: 22px; }
.qr { display: block; width: 220px; height: 220px; margin: 8px auto; background: #fff; padding: 8px; border-radius: 6px; image-rendering: pixelated; }
.bar { height: 8px; background: var(--accent); border-radius: 2px; min-width: 1px; }
.barcell { min-width: 90px; }
details summary { cursor: pointer; color: var(--muted); }
.event { border-bottom: 1px solid var(--line); padding: 8px 0; }
.event:last-child { border-bottom: 0; }

@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { width: 100%; padding-bottom: 6px; }
  .nav .spacer { display: none; }
  .main { padding: 16px; }
}
