:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #172033;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand-primary); }

.site-header {
  min-height: 68px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.brand { font-size: 1.35rem; font-weight: 800; text-decoration: none; color: var(--brand-primary); }
.page { width: min(1180px, calc(100% - 32px)); margin: 32px auto; flex: 1; }
.site-footer { padding: 24px 32px; color: #667085; text-align: center; }

.auth-panel, .panel, .card, .question-shell {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.05);
}

.auth-panel { max-width: 460px; margin: 64px auto; padding: 32px; }
.panel { padding: 24px; margin-bottom: 24px; }
.card { padding: 24px; }
.question-shell { max-width: 820px; margin: 32px auto; padding: 32px; }

h1, h2, h3 { margin-top: 0; color: #111827; }
p { line-height: 1.55; }
.muted { color: #667085; }

label { display: grid; gap: 8px; font-weight: 650; color: #344054; }
input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--brand-primary);
  border-radius: 6px;
  padding: 10px 16px;
  background: var(--brand-primary);
  color: #fff;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.ghost-button {
  background: #fff;
  color: var(--brand-primary);
}

.inline-form, .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; align-items: end; }
.filter-form { min-width: 240px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.assessment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }

.flash { padding: 14px 16px; border-radius: 6px; margin-bottom: 20px; border: 1px solid #d0d5dd; background: #fff; }
.flash.success { border-color: #86efac; background: #f0fdf4; }
.flash.error { border-color: #fecaca; background: #fef2f2; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
th { background: var(--brand-secondary); font-size: 0.9rem; color: #344054; }
.subtotal { background: #f8fafc; font-weight: 700; }

.status, .rag {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 800;
  background: #eef2ff;
}
.status.good { background: #dcfce7; }
.status.warn { background: #fef3c7; }

.question-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.question-meta span { background: var(--brand-secondary); color: var(--brand-primary); border-radius: 999px; padding: 6px 12px; font-weight: 800; }
.options { display: grid; gap: 14px; }
.option { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 14px; border: 1px solid #d0d5dd; border-radius: 8px; cursor: pointer; }
.option input { width: auto; min-height: auto; }

.report-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.report-summary div { background: var(--brand-secondary); border-radius: 8px; padding: 20px; }
.report-summary span { display: block; color: #475467; margin-bottom: 8px; }
.report-summary strong { font-size: 1.35rem; color: var(--brand-primary); }
.user-chip { color: #475467; font-weight: 700; }

@media (max-width: 720px) {
  .site-header { padding: 14px 16px; align-items: flex-start; gap: 12px; flex-direction: column; }
  .page { margin: 20px auto; }
  .section-head { display: block; }
  .auth-panel, .question-shell { margin: 24px auto; padding: 22px; }
}
