:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --border: #2a2a2a;
  --text: #f2f2f2;
  --text-dim: #9a9a9a;
  --accent: #0a84ff;
  --danger: #ff453a;
  --ok: #30d158;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 8px;
}

h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 40px 0 16px;
}

p.subtitle {
  color: var(--text-dim);
  margin: 0 0 40px;
  font-size: 15px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

input[type="text"],
input[type="tel"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 20px;
  font-family: inherit;
}

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

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.intake-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
}

.intake-card .field-row { margin-bottom: 0; }
.intake-card > *:last-child { margin-bottom: 0; }

.progress-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  margin-bottom: 8px;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
}

.progress-bar .progress-count { flex-shrink: 0; font-variant-numeric: tabular-nums; }

.progress-track {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.tc-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}

.tc-card.is-done { border-color: var(--ok); }

.tc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.tc-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.tc-checkbox:checked {
  background: var(--ok);
  border-color: var(--ok);
}

.tc-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid #06170c;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.tc-index {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  width: 18px;
  flex-shrink: 0;
}

.tc-title {
  font-size: 15px;
  font-weight: 500;
  flex: 1;
}

.tc-details {
  margin-top: 10px;
  padding-left: 34px;
}

.tc-details summary {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.tc-details summary::-webkit-details-marker { display: none; }
.tc-details summary::before { content: "▸ "; }
.tc-details[open] summary::before { content: "▾ "; }

.tc-body {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 10px;
  white-space: pre-line;
}

.tc-body strong { color: var(--text); }

.tc-notes {
  margin-top: 12px;
  padding-left: 34px;
}

.tc-notes textarea { margin-bottom: 0; }

.submit-bar {
  position: sticky;
  bottom: 0;
  padding: 20px 0 4px;
  margin-top: 8px;
  background: linear-gradient(to top, var(--bg) 65%, transparent);
}

.test-case {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.test-case:last-of-type {
  border-bottom: 1px solid var(--border);
}

.test-case-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.test-case-header input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.test-case-title {
  font-size: 16px;
  font-weight: 500;
}

.test-case-details {
  color: var(--text-dim);
  font-size: 13px;
  margin: 12px 0 0 32px;
  white-space: pre-line;
}

.test-case-details strong {
  color: var(--text);
}

.test-case-notes {
  margin: 12px 0 0 32px;
}

.test-case-notes textarea { margin-bottom: 0; }

button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
}

button:hover { opacity: 0.9; }

button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
}

button.danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  width: auto;
  padding: 6px 12px;
  font-size: 12px;
}

.error {
  color: var(--danger);
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid rgba(255, 69, 58, 0.3);
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.success-box {
  text-align: center;
  padding: 80px 0;
}

.success-box .check {
  font-size: 48px;
  color: var(--ok);
  margin-bottom: 16px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 32px;
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
}

th {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

td.center, th.center { text-align: center; }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.dot.done { background: var(--ok); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.muted { color: var(--text-dim); }
