/* Assessment Taking Flow */

/* ─── Assessment Overview (show) ─── */

.at-show {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.at-show-header {
  margin-bottom: 1.75rem;
}

.at-show-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
}

.at-show-breadcrumb-link {
  color: var(--at-accent);
  text-decoration: none;
  font-weight: 500;
}

.at-show-breadcrumb-link:hover {
  text-decoration: underline;
}

.at-show-breadcrumb-sep {
  color: var(--at-text-muted);
}

.at-show-breadcrumb-current {
  color: var(--at-text-secondary);
}

.at-show-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--at-text-primary);
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.at-show-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.at-show-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--at-text-secondary);
  font-weight: 500;
}

.at-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.at-show-description {
  font-size: 0.92rem;
  color: var(--at-text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* ─── What to expect cards ─── */

.at-expect {
  margin-bottom: 1.75rem;
}

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

.at-expect-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1.25rem 1rem;
  background: #fff;
  border: 1.5px solid var(--at-border);
  border-radius: 10px;
  text-align: center;
}

.at-expect-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
}

.at-expect-card-icon svg {
  width: 18px;
  height: 18px;
}

.at-expect-card-icon-questions {
  background: #dbeafe;
  color: #1e40af;
}

.at-expect-card-icon-time {
  background: #fef3c7;
  color: #92400e;
}

.at-expect-card-icon-score {
  background: #d1fae5;
  color: #065f46;
}

.at-expect-card-icon-difficulty {
  background: #f3e8ff;
  color: #6b21a8;
}

.at-expect-card-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--at-text-primary);
  letter-spacing: -0.02em;
}

.at-expect-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--at-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Previous attempt ─── */

.at-previous-attempt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-radius: 10px;
  border: 1.5px solid var(--at-border);
  margin-bottom: 1.75rem;
  background: #fff;
}

.at-previous-attempt-pass {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.at-previous-attempt-fail {
  border-color: #fecaca;
  background: #fef2f2;
}

.at-previous-attempt-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.at-previous-attempt-pass .at-previous-attempt-icon {
  background: #d1fae5;
  color: #059669;
}

.at-previous-attempt-fail .at-previous-attempt-icon {
  background: #fee2e2;
  color: #dc2626;
}

.at-previous-attempt-icon svg {
  width: 16px;
  height: 16px;
}

.at-previous-attempt-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.at-previous-attempt-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--at-text-secondary);
}

.at-previous-attempt-score {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--at-text-primary);
}

.at-previous-attempt-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.at-previous-attempt-status-pass {
  background: #d1fae5;
  color: #065f46;
}

.at-previous-attempt-status-fail {
  background: #fee2e2;
  color: #991b1b;
}

.at-previous-attempt-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--at-accent);
  text-decoration: none;
  flex-shrink: 0;
}

.at-previous-attempt-link:hover {
  text-decoration: underline;
}

/* ─── Tips ─── */

.at-tips {
  margin-bottom: 1.75rem;
}

.at-tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.at-tips-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--at-text-secondary);
  line-height: 1.55;
}

.at-tips-icon {
  width: 16px;
  height: 16px;
  color: #059669;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* Difficulty badges */
.at-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.at-badge-beginner {
  background: #d1fae5;
  color: #065f46;
}

.at-badge-intermediate {
  background: #dbeafe;
  color: #1e40af;
}

.at-badge-advanced {
  background: #fef3c7;
  color: #92400e;
}

.at-badge-expert {
  background: #fce7f3;
  color: #9d174d;
}

/* Section headings */
.at-section-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--at-text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

/* ─── Prerequisites ─── */

.at-prereqs-section {
  margin-bottom: 1.5rem;
}

.at-prereqs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.at-prereq-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1.5px solid var(--at-border);
  font-size: 0.85rem;
  transition: background 0.12s ease;
}

.at-prereq-met {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.at-prereq-unmet {
  background: #fffbeb;
  border-color: #fde68a;
}

.at-prereq-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.at-prereq-icon-met {
  color: #059669;
}

.at-prereq-icon-unmet {
  color: #d97706;
}

.at-prereq-name {
  flex: 1;
  font-weight: 600;
  color: var(--at-text-primary);
  text-decoration: none;
}

.at-prereq-link {
  color: #b45309;
}

.at-prereq-link:hover {
  text-decoration: underline;
}

.at-prereq-status-met {
  font-size: 0.75rem;
  font-weight: 600;
  color: #059669;
}

.at-prereq-status-unmet {
  font-size: 0.75rem;
  font-weight: 600;
  color: #d97706;
}

/* ─── Blocked notice ─── */

.at-blocked-notice {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  background: #fef3c7;
  border: 1.5px solid #fde68a;
  margin-bottom: 1.5rem;
}

.at-blocked-icon {
  width: 20px;
  height: 20px;
  color: #92400e;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.at-blocked-reason {
  font-size: 0.85rem;
  color: #92400e;
  line-height: 1.55;
  margin: 0 0 0.25rem;
}

.at-blocked-reason:last-child {
  margin-bottom: 0;
}

/* ─── Action buttons (unified) ─── */

.at-actions {
  margin-bottom: 1.25rem;
}

.at-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 600;
  padding: 0.65rem 1.75rem;
  font-size: 0.92rem;
  border-radius: 8px;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.at-action-btn-primary {
  background: var(--at-accent);
  color: #fff;
  border-color: var(--at-accent);
}

.at-action-btn-primary:hover {
  background: var(--th-accent-hover);
  border-color: var(--th-accent-hover);
}

.at-action-btn-secondary {
  background: #fff;
  color: var(--at-text-primary);
  border-color: var(--at-border);
}

.at-action-btn-secondary:hover {
  background: var(--at-bg-subtle);
  border-color: #d1d5db;
}

.at-action-btn-disabled {
  background: #e5e7eb;
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: not-allowed;
}

.at-action-btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
}

.at-action-btn-icon {
  width: 16px;
  height: 16px;
}

.at-cooldown-info {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--at-text-muted);
  margin: 0;
}

/* ─── Active Attempt (taking) ─── */

.at-attempt {
  min-height: 100vh;
  background: var(--at-bg-page);
}

.at-taking {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.at-taking-header {
  margin-bottom: 2rem;
}

.at-taking-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.at-taking-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--at-text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.at-taking-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--at-text-primary);
  background: #fff;
  border: 1.5px solid var(--at-border);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.at-timer-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--at-text-muted);
}

.at-timer-warning .at-timer-label {
  color: #b45309;
}

.at-timer-critical .at-timer-label {
  color: #dc2626;
}

.at-timer-warning {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.at-timer-critical {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fca5a5;
  animation: at-timer-pulse 1s ease-in-out infinite;
}

.at-timer-expired {
  color: #991b1b;
  background: #fee2e2;
  border-color: #f87171;
}

@keyframes at-timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Progress bar */
.at-taking-progress {
  background: #fff;
  border: 1.5px solid var(--at-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.at-taking-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.at-taking-progress-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--at-text-secondary);
}

.at-taking-progress-label strong {
  font-weight: 700;
  color: var(--at-text-primary);
}

.at-taking-progress-pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--at-accent);
}

.at-taking-progress-bar {
  height: 6px;
  background: #e9ecef;
  border-radius: 999px;
  overflow: hidden;
}

.at-taking-progress-fill {
  height: 100%;
  background: var(--at-accent);
  border-radius: 999px;
  transition: width 0.4s ease;
  animation: at-progress-glow 0.6s ease-out;
}

/* Subtle glow pulse when the progress bar advances (plays on Turbo Stream replace) */
@keyframes at-progress-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
  }
  40% {
    box-shadow: 0 0 8px 2px rgba(13, 110, 253, 0.3);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
  }
}

/* Smooth fade-in for the progress info text on update */
.at-taking-progress-info {
  animation: at-counter-fade 0.35s ease-out;
}

@keyframes at-counter-fade {
  0% {
    opacity: 0.4;
    transform: translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Step dots */
.at-taking-progress-dots {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.6rem;
  justify-content: center;
}

.at-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e9ecef;
  transition: all 0.3s ease;
}

.at-progress-dot-done {
  background: var(--at-accent);
}

.at-progress-dot-current {
  background: var(--at-accent);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
  animation: at-dot-pulse 1.5s ease-in-out infinite;
}

@keyframes at-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2); }
  50% { box-shadow: 0 0 0 5px rgba(13, 110, 253, 0.1); }
}

/* ─── Question ─── */

#question_frame {
  display: block;
  min-height: 280px;
}

.at-question {
  background: #fff;
  border: 1.5px solid var(--at-border);
  border-radius: 12px;
  overflow: hidden;
  animation: at-question-enter 0.25s ease-out;
  will-change: transform;
}

/* Subtle slide-in when the question swaps via Turbo Stream update */
@keyframes at-question-enter {
  0% { transform: translateX(6px); opacity: 0.7; }
  100% { transform: translateX(0); opacity: 1; }
}

/* Same entrance animation for the submit card */
.at-submit-card {
  animation: at-question-enter 0.25s ease-out;
}

/* Dim the form while Turbo is submitting to prevent flash */
.at-answer-form[aria-busy="true"] {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.at-next-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.at-question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem 0;
}

.at-question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 26px;
  padding: 0 0.5rem;
  background: var(--at-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.at-question-points {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--at-text-muted);
  background: var(--at-bg-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.at-question-body {
  padding: 1rem 1.5rem 1rem;
}

.at-question-body p {
  font-size: 1rem;
  font-weight: 600;
  color: var(--at-text-primary);
  line-height: 1.6;
  margin: 0;
}

/* ─── Answer options ─── */

.at-answer-form {
  padding: 0 1.5rem 1.5rem;
  transition: opacity 0.15s ease;
}

.at-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.at-option-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--at-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fff;
}

.at-option-label:hover {
  border-color: var(--at-accent);
  background: #f8f9ff;
}

.at-option-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.at-option-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.at-option-radio:checked ~ .at-option-indicator {
  border-color: var(--at-accent);
  background: var(--at-accent);
  box-shadow: inset 0 0 0 3px #fff;
}

.at-option-radio:checked ~ .at-option-text {
  color: var(--at-text-primary);
  font-weight: 600;
}

.at-option-radio:focus-visible ~ .at-option-indicator {
  outline: 2px solid var(--at-accent);
  outline-offset: 2px;
}

.at-option-letter {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--at-text-muted);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--at-bg-subtle);
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.at-option-radio:checked ~ .at-option-letter {
  background: #dbeafe;
  color: #1e40af;
}

.at-option-text {
  font-size: 0.88rem;
  color: var(--at-text-secondary);
  line-height: 1.5;
  font-weight: 500;
}

/* Selected state for the whole label */
.at-option-label:has(.at-option-radio:checked) {
  border-color: var(--at-accent);
  background: #eff6ff;
  box-shadow: 0 0 0 1px var(--at-accent);
}

/* Brief press feedback on click */
.at-option-label:active {
  transform: scale(0.99);
  transition-duration: 0.05s;
}

/* ─── Question actions ─── */

.at-question-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 42px;
}

.at-question-remaining {
  font-size: 0.78rem;
  color: var(--at-text-muted);
  font-weight: 500;
}

.at-next-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  padding: 0.55rem 1.5rem;
  font-size: 0.88rem;
  border-radius: 8px;
  min-width: 120px;
  text-align: center;
  justify-content: center;
  background: var(--at-accent);
  color: #fff;
  border: 1.5px solid var(--at-accent);
  cursor: pointer;
  transition: all 0.15s ease;
}

.at-next-btn:hover {
  background: #0b5ed7;
  border-color: #0b5ed7;
}

.at-next-btn-finish {
  background: #059669;
  border-color: #059669;
}

.at-next-btn-finish:hover {
  background: #047857;
  border-color: #047857;
}

.at-next-btn-icon {
  width: 14px;
  height: 14px;
}

/* ─── Submit section ─── */

.at-submit-section {
  margin-top: 1rem;
}

.at-submit-card {
  background: #fff;
  border: 1.5px solid var(--at-border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  text-align: center;
}

.at-submit-card-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #d1fae5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.at-submit-icon {
  width: 28px;
  height: 28px;
  color: #059669;
}

.at-submit-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--at-text-primary);
  margin: 0 0 0.5rem;
}

.at-submit-text {
  font-size: 0.88rem;
  color: var(--at-text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

/* ─── Results ─── */

.at-results {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.at-results-header {
  text-align: center;
  margin-bottom: 2rem;
}

.at-results-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
}

.at-results-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--at-text-primary);
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
}

.at-results-subtitle {
  font-size: 0.88rem;
  color: var(--at-text-secondary);
  margin: 0;
}

.at-results-timeout-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1.15rem;
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.at-results-timeout-notice .at-icon {
  color: #92400e;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.at-results-timeout-notice p {
  font-size: 0.85rem;
  color: #92400e;
  margin: 0;
  line-height: 1.55;
}

/* Score card */
.at-results-score-card {
  background: #fff;
  border: 1.5px solid var(--at-border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

.at-results-score-card-pass {
  border-color: #bbf7d0;
}

.at-results-score-card-fail {
  border-color: #fecaca;
}

.at-results-score-ring {
  width: 120px;
  height: 120px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.at-score-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.at-score-ring-track {
  fill: none;
  stroke: #e9ecef;
  stroke-width: 8;
}

.at-score-ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dasharray 0.8s ease;
}

.at-score-ring-fill-pass {
  stroke: #10b981;
}

.at-score-ring-fill-fail {
  stroke: #ef4444;
}

.at-results-score-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--at-text-primary);
  letter-spacing: -0.03em;
  position: relative;
}

.at-results-message {
  font-size: 0.88rem;
  color: var(--at-text-secondary);
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto 1rem;
}

/* Stats row */
.at-results-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1rem 0;
  margin: 0.5rem 0;
  border-top: 1px solid var(--th-border-light);
  border-bottom: 1px solid var(--th-border-light);
}

.at-results-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.at-results-stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--at-text-primary);
}

.at-results-stat-correct {
  color: #059669;
}

.at-results-stat-incorrect {
  color: #dc2626;
}

.at-results-stat-unanswered {
  color: #92400e;
}

.at-results-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--at-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.at-results-stat-divider {
  width: 1px;
  height: 28px;
  background: #e9ecef;
}

.at-results-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.at-results-badge-pass {
  background: #d1fae5;
  color: #065f46;
}

.at-results-badge-fail {
  background: #fee2e2;
  color: #991b1b;
}

.at-results-passing-info {
  font-size: 0.78rem;
  color: var(--at-text-muted);
  margin: 0.5rem 0 0;
}

/* Question review */
.at-results-review {
  margin-bottom: 2rem;
}

.at-review-question {
  background: #fff;
  border: 1.5px solid var(--at-border);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.at-review-question-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--th-border-light);
}

.at-review-question-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--at-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--at-text-secondary);
  flex-shrink: 0;
}

.at-review-question-body-wrap {
  flex: 1;
  min-width: 0;
}

.at-review-question-body {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--at-text-primary);
  line-height: 1.55;
  margin: 0.15rem 0 0;
}

.at-review-question-points {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 0.3rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

.at-review-question-points-earned {
  background: #d1fae5;
  color: #065f46;
}

.at-review-question-points-missed {
  background: #fee2e2;
  color: #991b1b;
}

.at-review-result {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.at-review-result-correct {
  background: #d1fae5;
}

.at-review-result-incorrect {
  background: #fee2e2;
}

.at-review-result-skipped {
  background: #fef3c7;
}

.at-review-result-icon {
  width: 14px;
  height: 14px;
}

.at-review-result-correct .at-review-result-icon {
  color: #059669;
}

.at-review-result-incorrect .at-review-result-icon {
  color: #dc2626;
}

.at-review-result-skipped .at-review-result-icon {
  color: #92400e;
}

/* Review options */
.at-review-options {
  padding: 0.5rem 1.25rem;
}

.at-review-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  margin-bottom: 0.25rem;
  font-size: 0.82rem;
  transition: background 0.1s ease;
}

.at-review-option-correct {
  background: #f0fdf4;
}

.at-review-option-selected {
  background: #fef2f2;
}

.at-review-option-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.at-review-option-correct .at-review-option-indicator {
  border-color: #10b981;
  background: #10b981;
  color: #fff;
}

.at-review-option-selected .at-review-option-indicator {
  border-color: #ef4444;
  background: #ef4444;
  color: #fff;
}

.at-review-option-indicator svg {
  width: 10px;
  height: 10px;
}

.at-review-option-text {
  flex: 1;
  font-weight: 500;
  color: var(--at-text-primary);
}

.at-review-option-correct .at-review-option-text {
  color: #065f46;
  font-weight: 600;
}

.at-review-option-selected .at-review-option-text {
  color: #991b1b;
}

.at-review-option-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.at-review-option-tag-correct {
  background: #d1fae5;
  color: #065f46;
}

.at-review-option-tag-wrong {
  background: #fee2e2;
  color: #991b1b;
}

/* Explanation */
.at-review-explanation {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: #eff6ff;
  border-top: 1px solid #dbeafe;
}

.at-review-explanation-icon {
  width: 16px;
  height: 16px;
  color: #3b82f6;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.at-review-explanation p {
  font-size: 0.82rem;
  color: #1e40af;
  line-height: 1.6;
  margin: 0;
}

/* Results actions */
.at-results-actions {
  text-align: center;
}

/* Bottom navigation */
.at-results-bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1.5px solid var(--at-border);
}

/* ─── What's Next ─── */

.at-whats-next {
  margin-bottom: 2rem;
}

.at-whats-next-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 10px;
  border: 1.5px solid var(--at-border);
  background: #fff;
}

.at-whats-next-card-pass {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.at-whats-next-card-fail {
  border-color: #fde68a;
  background: #fffbeb;
}

.at-whats-next-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.at-whats-next-icon-pass {
  background: #d1fae5;
}

.at-whats-next-icon-fail {
  background: #fef3c7;
}

.at-whats-next-icon {
  width: 22px;
  height: 22px;
}

.at-whats-next-icon-pass .at-whats-next-icon {
  color: #059669;
}

.at-whats-next-icon-fail .at-whats-next-icon {
  color: #92400e;
}

.at-whats-next-content {
  flex: 1;
  min-width: 0;
}

.at-whats-next-text {
  font-size: 0.88rem;
  color: var(--at-text-primary);
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.at-whats-next-cooldown {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #92400e;
  margin: 0 0 0.75rem;
}

.at-whats-next-cooldown-ok {
  font-size: 0.78rem;
  font-weight: 600;
  color: #059669;
  margin: 0 0 0.75rem;
}

.at-whats-next-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ─── Reduced motion ─── */

@media (prefers-reduced-motion: reduce) {
  .at-question,
  .at-submit-card,
  .at-taking-progress-fill,
  .at-taking-progress-info,
  .at-progress-dot-current {
    animation: none;
  }

  .at-taking-progress-fill {
    transition: none;
  }

  .at-option-label:active {
    transform: none;
  }
}

/* ─── Responsive ─── */

@media (max-width: 640px) {
  .at-show {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .at-show-title {
    font-size: 1.4rem;
  }

  .at-expect-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .at-taking {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .at-taking-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .at-question-header {
    padding: 0.85rem 1rem 0;
  }

  .at-question-body {
    padding: 1rem 1rem 0.75rem;
  }

  .at-answer-form {
    padding: 0 1rem 1rem;
  }

  .at-results {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .at-results-stats {
    gap: 0.75rem;
  }

  .at-review-question-header {
    padding: 0.85rem 1rem;
  }

  .at-review-options {
    padding: 0.5rem 1rem;
  }

  .at-whats-next-card {
    flex-direction: column;
  }

  .at-previous-attempt {
    flex-wrap: wrap;
  }

  .at-previous-attempt-content {
    flex-wrap: wrap;
  }

  .at-results-bottom-nav {
    flex-direction: column;
  }

  .at-results-bottom-nav .at-action-btn {
    width: 100%;
  }
}
