/* Design tokens from docs/17-design-tokens.md. Hand-written until the
   Tailwind build lands; values, not mechanism, are the approved spec. */
:root {
  --bg: #1b1e22;
  --surface: #24282e;
  --surface-dim: #202329;
  --border: #33383f;
  --border-dim: #2c3037;
  --text: #f0efea;
  --text-muted: #9ba1aa;
  --text-faint: #6e7580;
  --accent: #4fa8d8;
  --accent-ink: #0e1a22;
  --green: #4caf6d;
  --red: #e4574c;
  --amber: #e8a33d;
  /* IBM Plex is to be self-hosted under static/ (CSP forbids Google Fonts). */
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--accent); }
.page { max-width: 36rem; margin: 0 auto; padding: 3rem 1rem; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
}
.center { text-align: center; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 1.5rem; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: 0.875rem; }
.mono { font-family: var(--mono); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.5rem;
  border-radius: 10px; border: 1.5px solid var(--accent);
  font: 600 1rem var(--font); letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.link-button { background: none; border: 0; color: var(--text-muted); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

label { display: block; margin: 1rem 0 0.25rem; color: var(--text-muted); font-size: 0.875rem; }
input[type=text], input[type=password], input[type=search] {
  width: 100%; min-height: 44px; padding: 0 0.75rem;
  background: var(--surface-dim); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; font: inherit;
}
input:focus-visible, .btn:focus-visible, .link-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.message { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid var(--border); }
.message.error { border-color: color-mix(in srgb, var(--red) 40%, transparent); background: color-mix(in srgb, var(--red) 9%, transparent); }
.message.warning { border-color: color-mix(in srgb, var(--amber) 40%, transparent); background: color-mix(in srgb, var(--amber) 9%, transparent); }
.message.info, .message.success { background: var(--surface-dim); }

.passkey-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.passkey-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 0; border-bottom: 1px solid var(--border-dim);
}
.stack > * + * { margin-top: 1rem; }
[hidden] { display: none !important; }
.text-left { text-align: left; }
.spaced { margin-top: 2rem; }
.break { word-break: break-all; }

/* Fault triage (apps/faults). Status pills per docs/17 §17.5–17.6. */
h2 { font-size: 1.125rem; font-weight: 600; margin: 0; }
select, textarea {
  width: 100%; padding: 0.5rem 0.75rem;
  background: var(--surface-dim); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; font: inherit;
}
select { min-height: 44px; }
select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px;
  border-radius: 999px; font-weight: 700; font-size: 0.8125rem;
  letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid var(--border); color: var(--text-muted);
}
.pill-red { background: color-mix(in srgb, var(--red) 15%, transparent); border-color: color-mix(in srgb, var(--red) 40%, transparent); color: var(--red); }
.pill-amber { background: color-mix(in srgb, var(--amber) 15%, transparent); border-color: color-mix(in srgb, var(--amber) 40%, transparent); color: var(--amber); }
.pill-green { background: color-mix(in srgb, var(--green) 15%, transparent); border-color: color-mix(in srgb, var(--green) 40%, transparent); color: var(--green); }
.status-text { margin-left: 0.5rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.875rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tabs a { padding: 0.375rem 0.875rem; border: 1px solid var(--border); border-radius: 8px; color: var(--text-muted); text-decoration: none; }
.tabs a[aria-current=page] { border-color: var(--accent); color: var(--text); }
.tabs .count { color: var(--text-faint); margin-left: 0.25rem; }
.fault-list, .history { list-style: none; padding: 0; margin: 0; }
.fault-list li a {
  display: block; padding: 1rem; margin-bottom: 0.5rem; color: var(--text); text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.fault-list li a:hover, .fault-list li a:focus-visible { border-color: var(--accent); }
.fault-row-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.fault-row-text { display: block; margin: 0.25rem 0; }
.history li { padding: 0.5rem 0; border-bottom: 1px solid var(--border-dim); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0; }
.facts dt { color: var(--text-faint); font-size: 0.875rem; }
.facts dd { margin: 0; }
.prewrap { white-space: pre-wrap; }
