:root { --border:#222; --grid:#bbb; }

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 24px;
  color: #111;
}

h1 { margin: 0 0 10px; font-size: 22px; }
p { margin: 0 0 16px; }

.note { font-size: 13px; color:#333; }

.toolbar {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin: 14px 0 18px;
}

button {
  padding:10px 12px;
  border:1px solid #333;
  background:#fff;
  cursor:pointer;
  border-radius:8px;
}

button.primary {
  background:#111;
  color:#fff;
  border-color:#111;
}

button:disabled { opacity:.5; cursor:not-allowed; }

.table-wrap {
  overflow:auto;
  border:1px solid var(--border);
  border-radius:10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

th, td {
  border:1px solid var(--grid);
  padding:10px;
  vertical-align: top;
}

thead th {
  position: sticky;
  top: 0;
  background: #f7f7f7;
  z-index: 1;
}

th.left { width: 420px; text-align:left; }
th.num { width: 40px; text-align:center; }
th.scale { text-align:center; width: 80px; }

.scale-top { font-size: 12px; font-weight:600; margin-bottom: 4px; }
.scale-sub { font-size: 11px; font-weight:400; line-height:1.2; }

.qprefix { font-weight:700; margin-bottom: 6px; }
.qlabel { line-height:1.25; }

.radio-cell { text-align:center; }
input[type="radio"] { transform: scale(1.15); }

.error {
  color:#b00020;
  font-weight:600;
  margin-top: 12px;
}

.results {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background:#fafafa;
}

.results h2 { margin: 0 0 10px; font-size: 18px; }
.results h3 { margin: 18px 0 8px; font-size: 16px; }

.result-grid { display:grid; gap: 10px; }

.cause-row {
  display:flex;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 12px;
  border:1px solid #e3e3e3;
  border-radius:10px;
  background:#fff;
}

.cause-name { max-width: 75%; }
.score { font-weight:800; }

.footer-actions {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 14px;
}

/* Impression (PDF) */
@media print {
  .toolbar, .footer-actions, .table-wrap { display:none !important; }
  body { margin: 0; }
  .results { border:none; background:#fff; }
}
