*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #222;
}

.site-header {
  background: #1f2933;
  color: #fff;
  padding: 1rem 0;
}

.site-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.site-header a {
  color: inherit;
  text-decoration: none;
}

.site-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nav-form {
  display: inline;
  margin: 0;
}

.link-btn {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

.text-input {
  width: 100%;
  max-width: 520px;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background: #fff;
}

.text-area {
  width: 100%;
  max-width: 840px;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.admin-table .btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
}

.truncate {
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-main {
  padding: 2rem 0;
}

.container {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  padding: 0 1rem;
}

h2 {
  margin-top: 0;
}

.muted {
  color: #6b7280;
}

.small {
  font-size: 0.9rem;
}

.help {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.help.compact {
  padding: 0.6rem 0.85rem;
}

.help p {
  margin: 0 0 0.5rem;
}

.help-list {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
}

.help-list li {
  margin: 0.25rem 0;
}

.field-help {
  margin: 0.25rem 0 0.5rem;
}

.exam-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.exam-card {
  background: #fff;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.exam-card h3 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.exam-card .exam-code {
  font-size: 0.85rem;
  color: #6b7280;
}

.exam-card .meta {
  font-size: 0.9rem;
  color: #4b5563;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: none;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn.secondary {
  background: #374151;
}

.btn.secondary:hover {
  background: #1f2937;
}

.btn.primary {
  margin-top: 1rem;
}

.btn:hover {
  background: #1d4ed8;
}

.btn-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.field {
  margin: 0.75rem 0;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
}

.field select {
  width: 100%;
  max-width: 420px;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background: #fff;
}

.category-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.35rem 0.75rem;
}

.check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.take-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}

.category-tag {
  color: #4b5563;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.notice {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.results-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.exam-section {
  background: #fff;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.section-description {
  color: #4b5563;
}

.passage {
  background: #f9fafb;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.question {
  margin: 1rem 0;
}

.question h4 {
  margin-bottom: 0.25rem;
}

.choices {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
  cursor: pointer;
}

.choice input[type="radio"] {
  margin-top: 0.2rem;
}

.score-summary {
  background: #ecfdf5;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid #a7f3d0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.table th,
.table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.question-review {
  list-style: none;
  padding: 0;
  margin: 0;
}

.question-review-item {
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  border-left: 4px solid transparent;
}

.question-review-item.correct {
  border-color: #16a34a;
}

.question-review-item.incorrect {
  border-color: #dc2626;
}

.question-text {
  margin: 0.25rem 0 0.5rem;
}

.question-review .choices {
  margin-top: 0.25rem;
}

.correct-answer {
  font-weight: 600;
  color: #16a34a;
}

.your-answer {
  font-style: italic;
  color: #b91c1c;
}

.explanation {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: #4b5563;
}

