/* Chamber Checks — mobile-first.
   Read on a phone, often one-handed, sometimes in gloves and poor light.
   Tap targets are deliberately large and contrast is deliberately high. */

:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #cbd5e1;
  --border-strong: #94a3b8;
  --text: #0f172a;
  --text-dim: #475569;
  --brand: #0f172a;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --ok-border: #86efac;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --warn-border: #fcd34d;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --bad-border: #fca5a5;
  --focus: #2563eb;
  --radius: 12px;
  --tap: 52px;
}

/* Light only — deliberate. This is read on a phone in a plant room, and a
   half-lit dark theme is harder to scan than plain black on white. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }

/* ---------- chrome ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.topbar__mark {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--focus);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 96px;
}

/* ---------- type ---------- */

h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 24px 0 8px; letter-spacing: -0.01em; }
.lede { color: var(--text-dim); margin: 0 0 20px; }
.muted { color: var(--text-dim); }
.small { font-size: 13px; }

/* ---------- surfaces ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.flash {
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  color: var(--ok);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  font-weight: 600;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--focus);
  border-color: var(--focus);
  color: #fff;
}

.btn--danger { color: var(--bad); border-color: var(--bad-border); }
.btn--block { display: flex; width: 100%; }
.btn--small { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- forms ---------- */

label { display: block; font-weight: 600; margin-bottom: 6px; }

input[type="text"], input[type="password"], input[type="email"],
input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

textarea { min-height: 96px; resize: vertical; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.field { margin-bottom: 16px; }

/* ---------- status pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid;
  /* "2 deviations" must never wrap inside its own pill — the table scrolls
     horizontally if a column needs the width. */
  white-space: nowrap;
}

.pill--ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok); }
.pill--warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn); }
.pill--bad { background: var(--bad-bg); border-color: var(--bad-border); color: var(--bad); }
.pill--idle { background: var(--surface-2); border-color: var(--border); color: var(--text-dim); }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); }
