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

:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --muted: #666666;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --error-color: #dc2626;
  --error-bg: #fee2e2;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Screens */
.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.username-badge {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: #eff6ff;
  padding: 4px 10px;
  border-radius: 20px;
}

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
}
.btn-ghost:hover { background: var(--bg); }

.btn-danger {
  background: none;
  border: 1px solid #e55;
  color: #e55;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
}
.btn-danger:hover { background: #e55; color: #fff; }

/* Container */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* Login card */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.card h1 { font-size: 1.8rem; margin-bottom: 8px; }
.subtitle { color: var(--muted); margin-bottom: 24px; }

.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  display: block;
  margin: 6px auto 0;
}
.btn-link:hover { color: var(--text); }

#login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus { border-color: var(--primary); }

button[type="submit"], #submit-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
button[type="submit"]:hover, #submit-btn:hover:not(:disabled) {
  background: var(--primary-hover);
}
#submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.error { color: var(--error-color); font-size: 0.875rem; margin-top: 8px; }

/* Question list */
.container h2 { margin-bottom: 20px; font-size: 1.4rem; }

.question-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.question-list li a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.question-list li a:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.question-list li a .q-id {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}
.submitted-badge {
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.q-type-badge {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Question */
.question-number { color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; }

.previous-answer-note {
  font-size: 0.82rem;
  color: var(--primary);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 16px;
}
#question-text { font-size: 1.25rem; line-height: 1.5; margin-bottom: 24px; }

#answer-form { display: flex; flex-direction: column; gap: 12px; }

.choices-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.choice-item label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.95rem;
}
.choice-item label:hover { border-color: var(--primary); background: #eff6ff; }
.choice-item input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; }
.choice-item input[type="radio"]:checked + span { font-weight: 600; }
.choice-item:has(input:checked) label { border-color: var(--primary); background: #eff6ff; }

/* Disabled state after submit */
.choice-item.correct label { border-color: var(--success); background: var(--success-bg); }
.choice-item.incorrect label { border-color: var(--error-color); background: var(--error-bg); }
.choice-item.correct-answer label { border-color: var(--success); background: var(--success-bg); }

/* Result panel */
.result-panel {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
}
.result-panel.correct-result { background: var(--success-bg); border: 1px solid #86efac; }
.result-panel.incorrect-result { background: var(--error-bg); border: 1px solid #fca5a5; }
.result-panel.neutral-result { background: #f1f5f9; border: 1px solid var(--border); }

.result-badge {
  font-size: 1.5rem;
  line-height: 1;
}
#result-message { font-weight: 500; }

/* Stats panel */
.stats-panel {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stats-panel h3 { font-size: 1rem; margin-bottom: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* Toolbar */
.stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.stats-toolbar:empty { margin-bottom: 0; }

.toolbar-search {
  flex: 1;
  min-width: 140px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.toolbar-search:focus { border-color: var(--primary); }

.toolbar-select-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.toolbar-select-wrap select {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.toolbar-select-wrap select:focus { border-color: var(--primary); }

.toolbar-btn {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.toolbar-btn:hover { background: var(--bg); color: var(--text); }
.toolbar-btn-active {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.stat-row { margin-bottom: 14px; }
.stat-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  margin-bottom: 4px;
}
.stat-label .stat-text { color: var(--text); }
.stat-label .stat-count { color: var(--muted); }

.stat-bar-bg {
  height: 10px;
  background: var(--bg);
  border-radius: 5px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 5px;
  transition: width 0.4s ease;
}
.stat-row.is-correct .stat-bar-fill { background: var(--success); }

.stats-total { margin-top: 12px; font-size: 0.8rem; color: var(--muted); text-align: right; }

/* Admin screen */
.admin-badge { background: #fef3c7; color: #92400e; }

.admin-section { margin-bottom: 36px; }

.admin-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.admin-section-header h2 { margin-bottom: 0; }

.admin-count-badge {
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 24px;
  text-align: center;
}

.admin-users {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
}
.admin-empty { font-size: 0.875rem; color: var(--muted); }

.admin-q-source-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.admin-q-source-or {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-hover); }

.admin-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-file-pick {
  display: inline-block;
  padding: 7px 14px;
  border: 1.5px solid var(--primary);
  border-radius: 7px;
  background: var(--surface);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-file-pick:hover { background: #eff6ff; }

.admin-file-status {
  font-size: 0.875rem;
  color: var(--muted);
}

.admin-question-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.admin-question-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.admin-q-body { flex: 1; min-width: 0; }
.drag-handle {
  display: none;
  align-self: center;
  color: var(--border);
  font-size: 1.1rem;
  cursor: grab;
  padding: 0 2px;
  user-select: none;
  flex-shrink: 0;
  transition: color 0.15s;
}
.drag-handle:hover { color: var(--muted); }
.admin-question-list.is-draggable .drag-handle { display: block; }
.admin-question-item.dragging { opacity: 0.4; }
.admin-question-item.drag-over {
  border-top: 2px solid var(--primary);
  border-radius: 0 0 var(--radius) var(--radius);
}

.admin-q-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.admin-q-header .q-id { font-size: 0.8rem; color: var(--muted); }
.admin-q-count { font-size: 0.8rem; color: var(--muted); margin-left: auto; }
.admin-q-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.admin-unsaved-indicator {
  font-size: 0.75rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}

.admin-q-duplicate-btn, .admin-q-delete-btn {
  font-size: 0.75rem;
  padding: 2px 8px;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.admin-question-item:hover .admin-q-duplicate-btn,
.admin-question-item:hover .admin-q-delete-btn { opacity: 1; }
.admin-q-delete-btn { color: var(--error-color); border-color: currentColor; }
.admin-q-delete-btn:hover { background: var(--error-bg); }
.admin-reset-btn { font-size: 0.78rem; padding: 3px 10px; color: var(--error-color); border-color: #fca5a5; }
.admin-reset-btn:hover { background: var(--error-bg); }
.admin-q-text { font-size: 0.9rem; color: var(--text); line-height: 1.4; }

/* Asked / not-asked indicators */
.admin-question-item.was-asked {
  border-left: 3px solid var(--success);
}
.admin-question-item.not-asked {
  border-left: 3px solid var(--border);
}
.count-asked   { color: var(--success) !important; font-weight: 600; }
.count-not-asked { color: var(--muted); font-style: italic; }

/* Code question type badge */
.q-type-code { background: #f5f3ff; color: #7c3aed; border-color: #ddd6fe; }
.q-type-mc   { background: #eff6ff; color: var(--primary); border-color: #bfdbfe; }

/* Code language row */
.code-lang-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.code-lang-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
#code-language-select {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
#code-language-select:focus { border-color: #7c3aed; }
#code-language-select:disabled { opacity: 0.5; cursor: not-allowed; }

.response-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.response-header .response-username { margin-bottom: 0; }
.response-header .code-language-label { margin-bottom: 0; }
.response-timestamp {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Code input area */
.code-language-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7c3aed;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 8px;
}

/* CodeMirror editor wrapper */
.CodeMirror {
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: 'Menlo', 'Consolas', 'Monaco', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  height: auto;
  min-height: 200px;
  transition: border-color 0.15s;
}
.CodeMirror-focused { border-color: #7c3aed; }
.CodeMirror-scroll { min-height: 200px; }
.CodeMirror.cm-readonly { opacity: 0.65; cursor: not-allowed; }
.CodeMirror.cm-readonly .CodeMirror-cursor { display: none; }

#run-btn {
  margin-top: 8px;
  background: #7c3aed;
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
#run-btn:hover:not(:disabled) { background: #6d28d9; }
#run-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Output panel */
.output-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 12px 0 4px;
}

#run-output-wrapper { margin-top: 4px; }

.run-output {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: 'Menlo', 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
}
.run-output-error { background: #2d1515; color: #f38ba8; }

/* Open-ended textarea */
#open-ended-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
#open-ended-input:focus { border-color: var(--primary); }
#open-ended-input:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }

/* Open-ended response list */
.response-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  background: var(--bg);
}
.response-username {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.response-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

.response-code {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 6px;
  padding: 10px 12px;
  font-family: 'Menlo', 'Consolas', 'Monaco', monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 0;
}

.response-item .output-label { margin-top: 8px; }
.response-item .run-output { max-height: 100px; font-size: 0.8rem; }

/* Empty state (no live questions) */
.empty-state {
  list-style: none;
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-state p { margin-bottom: 8px; }
.empty-state p:first-child { font-size: 1rem; font-weight: 500; color: var(--text); }

/* Live toggle switch */
.live-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.live-toggle input { display: none; }
.live-track {
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.live-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left 0.2s;
}
.live-checkbox:checked ~ .live-track { background: var(--success); }
.live-checkbox:checked ~ .live-track .live-thumb { left: 19px; }
.live-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 38px;
}
.live-checkbox:checked ~ .live-label { color: var(--success); }

/* Live question highlight in admin list */
.admin-question-item.is-live {
  border-color: #86efac;
  background: #f0fdf4;
}

/* Admin question list — clickable items */
.admin-question-clickable {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-question-clickable:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

/* Live status pill (list view) */
.live-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.live-pill-on  { background: #dcfce7; color: var(--success); border: 1px solid #86efac; }
.live-pill-off { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

/* Reveal bar */
.admin-q-reveal-bar {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

.reveal-btn {
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.reveal-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.reveal-btn.is-revealed {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
}

/* Admin question detail screen */
.admin-q-detail-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.admin-q-detail-top .question-number { margin-bottom: 0; }

.admin-q-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* Live control button (admin question detail) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.live-control-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.live-control-btn:hover { border-color: #86efac; }
.live-control-btn.is-live {
  background: #dcfce7;
  border-color: #86efac;
  color: var(--success);
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.2s;
}
.live-control-btn.is-live .live-dot {
  background: var(--success);
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(22,163,74,0); }
}

/* Choices list on admin detail */
.admin-q-choices-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 16px 0 24px;
}
.admin-choice-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--surface);
}
.admin-choice-item.is-correct {
  border-color: #86efac;
  background: var(--success-bg);
  font-weight: 600;
  color: var(--success);
}
.admin-choice-marker {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 20px;
}
.admin-choice-item.is-correct .admin-choice-marker { color: var(--success); }

/* New question form */
.admin-new-q-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.new-q-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.new-q-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding-top: 8px;
  min-width: 72px;
}
.new-q-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.78rem;
}
.new-q-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.new-q-select:focus { border-color: var(--primary); }
.new-q-textarea {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.5;
}
.new-q-textarea:focus { border-color: var(--primary); }
.new-q-code-textarea {
  font-family: 'Menlo', 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
}
#new-q-choices-section { margin-bottom: 12px; }
#new-q-choices-section > .new-q-label { display: block; margin-bottom: 8px; padding-top: 0; }
.new-q-choice-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.new-q-correct-radio { accent-color: var(--primary); width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }
.new-q-choice-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.new-q-choice-input:focus { border-color: var(--primary); }
.new-q-remove-choice { padding: 4px 9px; font-size: 1rem; line-height: 1; color: var(--muted); }
.new-q-add-choice { font-size: 0.8rem; padding: 4px 10px; margin-top: 4px; }
.new-q-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}
.new-q-submit {
  background: var(--primary);
  color: white;
  border: none;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.new-q-submit:hover { background: var(--primary-hover); }


/* Validation issue list (file upload errors) */
.validation-issues {
  list-style: none;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
}
.validation-issues li {
  padding: 4px 8px;
  border-left: 2px solid var(--error-color);
  background: var(--error-bg);
  border-radius: 0 4px 4px 0;
}
