:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1a1d24;
  --muted: #6b7280;
  --primary: #2b5fff;
  --primary-hover: #1e4dd8;
  --border: #e2e5ec;
  --success: #16a34a;
  --danger: #dc2626;
  --warn: #d97706;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.container.wide { max-width: 1100px; }

h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 24px 0 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

label { display: block; font-weight: 600; margin: 16px 0 6px; font-size: 14px; }

input[type=text], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}

input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: -1px; }

button, .btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: 0;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--primary-hover); }
button:disabled { background: #9ca3af; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: #f3f4f6; }

.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--danger); margin-top: 8px; font-size: 14px; }

.timer {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: inline-block;
  background: #1a1d24;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 18px;
}
.timer.warn { background: var(--warn); }
.timer.danger { background: var(--danger); }

.question {
  margin: 18px 0;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.question .q-num { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.question .q-text { font-weight: 600; margin-bottom: 12px; }
.question label.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 6px 0;
  cursor: pointer;
  font-weight: 400;
}
.question label.option:hover { background: #f9fafc; }
.question label.option input { margin-top: 3px; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tabs button {
  background: transparent;
  color: var(--text);
  border: 0;
  padding: 10px 14px;
  border-radius: 0;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.tabs button:hover { background: #eef0f5; }
.tabs button.active { border-bottom-color: var(--primary); color: var(--primary); }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: #f9fafc; font-weight: 600; }
tr:last-child td { border-bottom: 0; }

.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.done { background: #dcfce7; color: #166534; }
.badge.progress { background: #fef3c7; color: #92400e; }

.user-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: #eef0f5; border-radius: 999px; padding: 6px 12px; font-size: 14px;
}

.consent-block {
  margin-top: 18px;
  padding: 14px 16px;
  background: #f9fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.consent-block summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 4px 0;
}
.consent-block summary:hover { color: var(--primary); }
.consent-block .required { color: var(--danger); }
.consent-block .consent-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.consent-block .consent-text p { margin: 0 0 8px; }
.consent-block .consent-text ul { margin: 0 0 8px 0; padding-left: 22px; }
.consent-block .consent-text li { margin: 2px 0; }
.consent-block .consent-text a { color: var(--primary); }
.consent-check {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400 !important;
  font-size: 14px !important;
  margin: 14px 0 0 !important;
  cursor: pointer;
}
.consent-check input { margin-top: 3px; flex-shrink: 0; width: auto; }
.consent-check span { flex: 1; line-height: 1.45; }
