/* ============================================================
   Aviation Quiz — RTL Hebrew UI
   ============================================================ */

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

:root {
  --bg:          #f4f2ee;
  --surface:     #ffffff;
  --surface-2:   #ede9e3;
  --ink:         #1a1c22;
  --ink-muted:   #5a5e6b;
  --ink-faint:   #9398a4;
  --teal:        #2e7d7a;
  --teal-light:  #e6f2f1;
  --teal-dim:    #1f5553;
  --amber:       #b97a00;
  --amber-light: #fdf3dd;
  --green:       #1e6e3c;
  --green-light: #e6f4ec;
  --red:         #b3241b;
  --red-light:   #fce9e8;
  --border:      #d5d0c7;
  --radius-sm:   4px;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 2px 8px rgba(0,0,0,.10);
  --font-body:   'Segoe UI', Arial, sans-serif;
  --font-mono:   'Courier New', monospace;
}

html {
  direction: rtl;
  lang: he;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Screen management ─────────────────────────────────────── */

.screen-gate,
.screen-results {
  width: 100%;
  max-width: 680px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Gate ──────────────────────────────────────────────────── */

.gate-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.gate-container h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.gate-container p {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.gate-container .meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: start;
}

.gate-container .meta-item {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.gate-container .meta-item strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

/* ── Quiz shell ────────────────────────────────────────────── */

#quiz-shell {
  width: 100%;
  max-width: 680px;
  padding: 0 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Header ────────────────────────────────────────────────── */

.quiz-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.quiz-header .progress-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.quiz-header .progress-bar-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.quiz-header .progress-label {
  font-size: 0.8rem;
  color: var(--ink-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.quiz-header .timer {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink-muted);
  min-width: 48px;
  text-align: center;
}

.quiz-header .timer.warn {
  color: var(--amber);
  font-weight: 600;
}

.quiz-header .timer.critical {
  color: var(--red);
  font-weight: 700;
}

/* ── Main question area ────────────────────────────────────── */

.quiz-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Question meta row ─────────────────────────────────────── */

.q-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.q-meta-row .q-number {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-light);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.q-meta-row .q-tag {
  font-size: 0.75rem;
  color: var(--ink-muted);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.q-meta-row .q-difficulty {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.q-meta-row .q-difficulty.easy   { color: var(--green); background: var(--green-light); }
.q-meta-row .q-difficulty.medium { color: var(--amber); background: var(--amber-light); }
.q-meta-row .q-difficulty.hard   { color: var(--red);   background: var(--red-light);   }

.q-stem {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.55;
}

/* ── Visual / diagram area ─────────────────────────────────── */

.q-visual {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  max-height: 320px;
}

.q-visual img,
.q-visual svg,
.q-visual canvas {
  max-width: 100%;
  max-height: 320px;
  display: block;
  object-fit: contain;
}

.q-visual:empty {
  display: none;
}

/* ── Answers list ──────────────────────────────────────────── */

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

.answers-list li {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  cursor: pointer;
  user-select: none;
}

.answers-list li label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  width: 100%;
}

.answers-list li input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  margin-top: 3px;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.answers-list li input[type="radio"]:checked {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: inset 0 0 0 3px var(--surface);
}

.answers-list li:hover:not(.state-correct):not(.state-wrong):not(.state-missed) {
  border-color: var(--teal);
  background: var(--teal-light);
  box-shadow: var(--shadow-sm);
}

.answers-list li:hover:not(.state-correct):not(.state-wrong):not(.state-missed) input[type="radio"] {
  border-color: var(--teal);
}

/* answered states */
.answers-list li.state-selected {
  border-color: var(--teal);
  background: var(--teal-light);
}

.answers-list li.state-correct {
  border-color: var(--green);
  background: var(--green-light);
  cursor: default;
}

.answers-list li.state-correct input[type="radio"] {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 3px var(--surface);
}

.answers-list li.state-wrong {
  border-color: var(--red);
  background: var(--red-light);
  cursor: default;
}

.answers-list li.state-wrong input[type="radio"] {
  border-color: var(--red);
  background: var(--red);
  box-shadow: inset 0 0 0 3px var(--surface);
}

.answers-list li.state-missed {
  border-color: var(--green);
  background: var(--green-light);
  opacity: 0.7;
  cursor: default;
}

.answers-list li.state-disabled {
  pointer-events: none;
  opacity: 0.55;
}

.answer-letter {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-muted);
  min-width: 18px;
}

.answer-text {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.5;
}

.answer-icon {
  margin-inline-start: auto;
  font-size: 1rem;
}

/* ── Explanation ───────────────────────────────────────────── */

.q-explanation {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: none;
  flex-direction: column;
  gap: 8px;
}

.q-explanation.visible {
  display: flex;
}

.q-explanation .expl-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-dim);
}

.q-explanation .expl-body {
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

.q-explanation .expl-ref {
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-style: italic;
}

/* ── Footer / navigation ───────────────────────────────────── */

.quiz-footer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -1px;
}

.quiz-footer .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.quiz-footer .btn-primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal-dim);
}

.quiz-footer .btn-primary:hover {
  background: var(--teal-dim);
  box-shadow: var(--shadow-sm);
}

.quiz-footer .btn-secondary {
  background: var(--surface);
  color: var(--ink-muted);
  border-color: var(--border);
}

.quiz-footer .btn-secondary:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.quiz-footer .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.quiz-footer .skip-link {
  font-size: 0.8rem;
  color: var(--ink-faint);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  text-decoration: underline;
}

.quiz-footer .skip-link:hover {
  color: var(--ink-muted);
}

/* ── Results screen ────────────────────────────────────────── */

.screen-results {
  animation: fade-in 0.25s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.results-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.results-card .results-hero {
  background: var(--ink);
  color: #fff;
  padding: 28px 28px 24px;
  text-align: center;
}

.results-hero .score-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.score-ring.pass { border-color: #4caf82; color: #4caf82; }
.score-ring.fail { border-color: #e57373; color: #e57373; }

.results-hero h2 {
  font-size: 1.1rem;
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 4px;
}

.results-hero .verdict {
  font-size: 0.85rem;
  opacity: 0.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border);
}

.stat-cell {
  padding: 14px 10px;
  text-align: center;
  border-inline-end: 1px solid var(--border);
}

.stat-cell:last-child { border-inline-end: none; }

.stat-cell .stat-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}

.stat-cell .stat-lbl {
  font-size: 0.72rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.results-actions {
  display: flex;
  gap: 10px;
  padding: 18px 20px;
  flex-wrap: wrap;
}

.results-actions .btn {
  flex: 1;
  justify-content: center;
}

/* ── Review panel ──────────────────────────────────────────── */

.review-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.review-panel .review-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
}

.review-panel .review-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.review-panel .review-filters {
  display: flex;
  gap: 6px;
}

.review-panel .filter-btn {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.review-panel .filter-btn.active,
.review-panel .filter-btn:hover {
  border-color: var(--teal);
  background: var(--teal-light);
  color: var(--teal-dim);
}

.review-list {
  list-style: none;
}

.review-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}

.review-item:last-child { border-bottom: none; }

.review-item:hover { background: var(--surface-2); }

.review-item .ri-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 2px;
}

.ri-icon.correct { background: var(--green-light); color: var(--green); }
.ri-icon.wrong   { background: var(--red-light);   color: var(--red);   }
.ri-icon.skipped { background: var(--amber-light);  color: var(--amber); }

.review-item .ri-body {
  flex: 1;
  min-width: 0;
}

.ri-body .ri-q {
  font-size: 0.875rem;
  color: var(--ink);
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ri-body .ri-sub {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 2px;
}

.review-item .ri-num {
  font-size: 0.75rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ── Buttons (global) ──────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  letter-spacing: 0.01em;
  font-family: inherit;
}

.btn-primary  { background: var(--teal);    color: #fff;            border-color: var(--teal-dim); }
.btn-primary:hover  { background: var(--teal-dim); }
.btn-ghost    { background: transparent;    color: var(--ink-muted); border-color: var(--border); }
.btn-ghost:hover    { background: var(--surface-2); color: var(--ink); }
.btn-danger   { background: var(--red-light); color: var(--red);    border-color: var(--red); }
.btn-danger:hover   { background: var(--red); color: #fff; }

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 600px) {
  .screen-gate,
  .screen-results,
  #quiz-shell {
    padding-inline: 0;
    padding-bottom: 24px;
  }

  .gate-container {
    border-radius: 0;
    border-inline: none;
    padding: 28px 20px;
  }

  .gate-container .meta-grid {
    grid-template-columns: 1fr;
  }

  .quiz-header {
    padding: 8px 12px;
  }

  .quiz-main {
    padding: 18px 16px 14px;
    border-radius: 0;
    border-inline: none;
  }

  .quiz-footer {
    padding: 12px 16px;
    border-radius: 0;
    border-inline: none;
    flex-wrap: wrap;
  }

  .results-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .results-actions {
    flex-direction: column;
  }

  .results-actions .btn {
    flex: none;
    width: 100%;
  }

  .review-item .ri-q {
    white-space: normal;
  }
}

@media (max-width: 380px) {
  .q-stem { font-size: 1rem; }
  .results-stats { grid-template-columns: 1fr; }
  .stat-cell { border-inline-end: none; border-bottom: 1px solid var(--border); }
  .stat-cell:last-child { border-bottom: none; }
}

/* ============================================================
   Integration overrides for generated quiz markup
   ============================================================ */

#app {
  width: 100%;
  min-height: 100dvh;
}

.screen {
  display: none;
  width: 100%;
}

.screen.active {
  display: block;
}

#screen-gate,
#screen-loading,
#screen-results {
  min-height: 100dvh;
  padding: 32px 16px;
}

#screen-loading {
  display: none;
  place-items: center;
}

#screen-loading.active {
  display: grid;
}

.loading-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  text-align: center;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--teal);
  border-radius: 999px;
  margin: 0 auto 12px;
  animation: spin .9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#screen-gate .gate-container,
#screen-results .results-container,
#screen-results .review-panel,
.quiz-main,
.quiz-footer {
  max-width: 980px;
  margin-inline: auto;
}

.gate-emblem {
  color: var(--teal-dim);
  display: grid;
  place-items: center;
}

.gate-title {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.gate-divider {
  height: 1px;
  background: var(--border);
}

.field-group {
  display: grid;
  gap: 6px;
  text-align: start;
  margin-bottom: 14px;
}

.field-group label {
  color: var(--ink-muted);
  font-size: .9rem;
  font-weight: 700;
}

.field-group input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font: inherit;
  background: #fff;
}

.field-group input:focus {
  outline: 3px solid rgba(46, 125, 122, .18);
  border-color: var(--teal);
}

.field-error,
.gate-notice,
#admin-status {
  color: var(--ink-muted);
  font-size: .85rem;
}

.field-error:not(:empty) {
  color: var(--red);
}

button {
  font: inherit;
}

.btn-primary,
.btn-secondary,
.btn-nav,
.btn-close,
.btn {
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 42px;
  padding: 10px 16px;
  font-weight: 800;
}

.btn-primary {
  background: var(--teal);
  color: white;
  border-color: var(--teal-dim);
}

.btn-secondary,
.btn-nav,
.btn-close {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

.btn-primary:hover,
.btn-nav:hover,
.btn-secondary:hover,
.btn-close:hover {
  box-shadow: var(--shadow-sm);
}

.btn-nav:disabled {
  opacity: .45;
  cursor: not-allowed;
}

#screen-quiz {
  min-height: 100dvh;
  padding-bottom: 24px;
}

#screen-quiz .quiz-header {
  max-width: 980px;
  margin-inline: auto;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}

.header-meta,
.header-timer,
.q-meta-row,
.explanation-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-label {
  color: var(--ink-muted);
  font-size: .8rem;
}

.header-value,
#timer-display {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.header-progress-wrap {
  flex: 1;
  min-width: 120px;
}

.progress-bar-track {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}

#progress-fill {
  width: 0%;
}

.q-text {
  font-size: clamp(1.2rem, 2.6vw, 1.65rem);
  font-weight: 800;
  line-height: 1.45;
}

.tag {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .8rem;
  font-weight: 800;
}

.tag-topic {
  background: var(--teal-light);
  color: var(--teal-dim);
}

.tag-source {
  background: var(--surface-2);
  color: var(--ink-muted);
}

.q-visual.hidden,
.q-explanation.hidden,
.review-panel.hidden {
  display: none;
}

.answers-list {
  padding: 0;
}

.answer-button {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: start;
  background: transparent;
  border: 0;
  padding: 14px 16px;
  cursor: pointer;
}

.answer-index {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--ink-muted);
  font-weight: 900;
  flex: 0 0 auto;
}

.answers-list li.state-selected .answer-index {
  background: var(--teal);
  color: white;
}

.answers-list li.state-correct .answer-index {
  background: var(--green);
  color: white;
}

.answers-list li.state-wrong .answer-index {
  background: var(--red);
  color: white;
}

.q-explanation {
  display: block;
  background: var(--teal-light);
  border: 1px solid rgba(46, 125, 122, .25);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.quiz-footer {
  margin-top: 0;
}

.results-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
}

.results-header {
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
}

#badge-ring {
  stroke: var(--teal);
  fill: rgba(46, 125, 122, .08);
}

#badge-score-text {
  fill: var(--ink);
}

.results-stats {
  margin-top: 20px;
  grid-template-columns: repeat(4, 1fr);
}

.stat-value {
  display: block;
  font-size: 1.45rem;
  font-weight: 900;
}

.stat-label {
  color: var(--ink-muted);
  font-size: .8rem;
}

.stat-divider {
  display: none;
}

.review-list {
  display: grid;
  gap: 12px;
  list-style-position: inside;
}

.review-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
}

.review-item strong {
  color: var(--ink);
}

.admin-page {
  align-items: stretch;
}

.admin-header,
.admin-main,
.admin-footer {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.admin-header {
  padding: 22px 0 14px;
}

.admin-header-inner,
.admin-actions,
.admin-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-header-inner {
  justify-content: space-between;
  flex-wrap: wrap;
}

.admin-title {
  font-size: 1.35rem;
}

.admin-subtitle {
  color: var(--ink-muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.data-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.metric-card {
  padding: 18px;
}

.metric-label {
  color: var(--ink-muted);
  font-size: .85rem;
}

.metric-value {
  font-size: 2rem;
  font-weight: 900;
}

.data-section {
  margin-top: 16px;
  overflow: hidden;
}

.section-title {
  font-size: 1rem;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.admin-table th,
.admin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

.admin-table th {
  color: var(--ink-muted);
  font-size: .78rem;
  background: var(--surface-2);
}

.admin-footer {
  padding: 24px 0;
  color: var(--ink-muted);
  font-size: .85rem;
}

@media (max-width: 760px) {
  .quiz-header,
  .quiz-footer,
  .results-stats,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  #screen-quiz .quiz-header {
    border-radius: 0;
  }

  .quiz-header,
  .quiz-footer,
  .admin-header-inner,
  .admin-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .results-stats {
    display: grid;
  }
}
