:root {
  --blue: #1565c0;
  --blue-soft: #e3f2fd;
  --green: #2e7d32;
  --green-soft: #e8f5e9;
  --amber: #e65100;
  --amber-soft: #fff3e0;
  --text: #1a202c;
  --muted: #4a5568;
  --border: #cbd5e0;
  --bg: #f4f7fb;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: 24px;
  user-select: none;
}

.top-header {
  background: linear-gradient(135deg, #1976d2, #0d47a1);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.subject-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.top-header h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.save-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
}

.save-badge.saving {
  background: var(--amber-soft);
  color: var(--amber);
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.center-card {
  text-align: center;
  padding: 28px 16px;
}

.lead-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

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

.number-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
}

.num-btn {
  height: 42px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.num-btn.answered {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
}

.num-btn.current {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}

.question-number {
  display: inline-block;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.stimulus-box {
  background: #f8fafc;
  border-left: 4px solid var(--blue);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 15px;
}

.stimulus-box img {
  max-width: 100%;
  border-radius: 10px;
  margin-top: 8px;
}

.question-prompt {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 14px 0;
  white-space: pre-line;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  font-size: 16px;
  cursor: pointer;
}

.option-item.selected {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.option-badge {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #edf2f7;
  color: var(--text);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.option-item.selected .option-badge {
  background: var(--blue);
  color: #ffffff;
}

.short-answer-input {
  width: 100%;
  padding: 14px;
  font-size: 17px;
  border: 2px solid var(--border);
  border-radius: 12px;
  outline: none;
}

.short-answer-input:focus {
  border-color: var(--blue);
}

.nav-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button {
  font-family: inherit;
}

.btn-primary,
.btn-secondary,
.btn-success,
.btn-outline-sm {
  min-height: 48px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn-outline-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
  background: var(--blue-soft);
  color: var(--blue);
}

.btn-primary {
  background: var(--blue);
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:disabled,
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-success {
  width: 100%;
  background: var(--green);
  color: #ffffff;
}

.submit-note {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--muted);
}
