/* =========================================================================
   НЕОМОРФНЫЙ ДИЗАЙН ЛИЧНОГО КАБИНЕТА ДЛЯ СТРАНИЦ ВЫПОЛНЕНИЯ РАБОТ (EXAM)
   ========================================================================= */

:root {
  --page: #e7ebf3;
  --surface: #e7ebf3;
  --surface-strong: #eef2f9;
  --text: #263248;
  --muted: #748097;
  --primary: #536dfe;
  --primary-dark: #3e55d8;
  --primary-hover: #3e55d8;
  --primary-light: rgba(83, 109, 254, 0.12);
  --teal: #159f9a;
  --amber: #c98a22;
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.12);

  /* Legacy aliases for compatibility */
  --bg-page: var(--page);
  --bg-card: var(--surface);
  --text-main: var(--text);
  --text-muted: var(--muted);
  --text-light: #94a3b8;
  --border: rgba(163, 174, 195, 0.28);
  --border-focus: rgba(83, 109, 254, 0.45);

  /* Neumorphic Shadows */
  --shadow-out: 8px 8px 18px rgba(163, 174, 195, 0.38), -8px -8px 18px rgba(255, 255, 255, 0.72);
  --shadow-soft: 4px 4px 10px rgba(163, 174, 195, 0.32), -4px -4px 10px rgba(255, 255, 255, 0.64);
  --shadow-in: inset 4px 4px 9px rgba(163, 174, 195, 0.28), inset -4px -4px 9px rgba(255, 255, 255, 0.68);
  --shadow-sm: var(--shadow-soft);
  --shadow-md: var(--shadow-soft);
  --shadow-lg: var(--shadow-out);

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(163, 174, 195, 0.45) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(163, 174, 195, 0.45);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--page) !important;
  color: var(--text) !important;
  font-family: var(--font) !important;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-family: var(--font);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

/* =========================================================================
   КАРТОЧКИ И КОНТЕЙНЕРЫ (NEUMORPHIC SURFACES)
   ========================================================================= */

.card,
.task-card {
  background: var(--surface) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  border-radius: 24px !important;
  box-shadow: 8px 8px 20px rgba(163, 174, 195, 0.42), -8px -8px 20px rgba(255, 255, 255, 0.85) !important;
  color: var(--text) !important;
  padding: 24px !important;
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.neu-well {
  background: var(--surface) !important;
  box-shadow: var(--shadow-in) !important;
  border-radius: 18px !important;
  border: 0 !important;
  padding: 16px 20px;
  color: var(--text);
}

.neu-panel {
  background: var(--surface) !important;
  box-shadow: var(--shadow-soft) !important;
  border-radius: 18px !important;
  border: 0 !important;
  padding: 16px 20px;
  color: var(--text);
}

.neu-icon-box {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-out);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.neu-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-out);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 18px;
}

/* =========================================================================
   ФОРМЫ, ПОЛЯ ВВОДА И ВЫПАДАЮЩИЕ СПИСКИ
   ========================================================================= */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted) !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
}

.form-control,
input[type="text"].form-control,
input[type="number"].form-control,
textarea.form-control {
  width: 100%;
  min-height: 46px;
  padding: 11px 16px !important;
  border: 1px solid rgba(163, 174, 195, 0.3) !important;
  border-radius: 14px !important;
  background: var(--surface) !important;
  box-shadow: inset 3px 3px 6px rgba(163, 174, 195, 0.32), inset -3px -3px 6px rgba(255, 255, 255, 0.85) !important;
  color: var(--text) !important;
  font-family: var(--font) !important;
  font-size: 0.95rem !important;
  font-weight: 600;
  outline: none !important;
  transition: all 0.2s ease;
}
.form-control:focus,
input[type="text"].form-control:focus,
input[type="number"].form-control:focus,
textarea.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: inset 3px 3px 6px rgba(163, 174, 195, 0.25), inset -3px -3px 6px rgba(255, 255, 255, 0.85), 0 0 0 3px rgba(83, 109, 254, 0.18) !important;
}

.form-control::placeholder {
  color: var(--muted);
  opacity: 0.72;
  font-weight: 500;
}

.form-control:focus {
  box-shadow: var(--shadow-in), 0 0 0 2.5px rgba(83, 109, 254, 0.28) !important;
}

select.form-control,
select.inline-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--surface) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23536dfe' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px 16px !important;
  padding-right: 40px !important;
  cursor: pointer;
  font-weight: 700 !important;
  color: var(--text) !important;
}

select.inline-select {
  display: inline-block;
  min-height: 40px;
  padding: 8px 38px 8px 14px !important;
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-in) !important;
  color: var(--primary-dark) !important;
  font-family: var(--font) !important;
  font-size: 0.92rem !important;
  margin: 0 4px;
}

/* =========================================================================
   КНОПКИ (TACTILE NEUMORPHIC BUTTONS)
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: 0 !important;
  border-radius: 15px !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-soft) !important;
  color: var(--text) !important;
  font-family: var(--font) !important;
  font-size: 0.92rem;
  font-weight: 800 !important;
  cursor: pointer;
  transition: box-shadow 0.18s ease, transform 0.18s ease, color 0.18s ease;
  text-decoration: none;
  user-select: none;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-out) !important;
  color: var(--primary-dark) !important;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: var(--shadow-in) !important;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 6px 20px rgba(83, 109, 254, 0.35), 0 2px 6px rgba(83, 109, 254, 0.2) !important;
  font-weight: 700 !important;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(83, 109, 254, 0.45), 0 3px 8px rgba(83, 109, 254, 0.25) !important;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(83, 109, 254, 0.3) !important;
}

.btn-secondary {
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow-soft) !important;
}

.btn-secondary:hover:not(:disabled),
.btn-secondary:active:not(:disabled) {
  box-shadow: var(--shadow-in) !important;
  color: var(--primary-dark) !important;
}

.btn-danger {
  background: var(--surface) !important;
  color: #dc2626 !important;
  box-shadow: var(--shadow-soft) !important;
}

.btn-danger:hover:not(:disabled),
.btn-danger:active:not(:disabled) {
  box-shadow: var(--shadow-in) !important;
  color: #b91c1c !important;
}

.btn-sm {
  min-height: 34px;
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 11px !important;
}

/* =========================================================================
   ВЫБОР ВАРИАНТА НА ЭКРАНЕ ВХОДА (.variant-pick-card)
   ========================================================================= */

.variant-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 6px;
}

.variant-pick-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 18px !important;
  min-height: 52px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  background: var(--surface) !important;
  box-shadow: 5px 5px 12px rgba(163, 174, 195, 0.38), -5px -5px 12px rgba(255, 255, 255, 0.85) !important;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  position: relative;
  white-space: nowrap !important;
}

.variant-pick-card:hover {
  transform: translateY(-2px);
  border-color: rgba(83, 109, 254, 0.4) !important;
  box-shadow: 7px 7px 16px rgba(163, 174, 195, 0.45), -7px -7px 16px rgba(255, 255, 255, 0.95) !important;
}

.variant-pick-card.active {
  background: var(--surface) !important;
  box-shadow: inset 3px 3px 7px rgba(83, 109, 254, 0.25), inset -3px -3px 7px rgba(255, 255, 255, 0.85) !important;
  border-color: var(--primary) !important;
}

.variant-color-dot {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  border: 2px solid rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
}

.variant-pick-title {
  font-weight: 800 !important;
  font-size: 0.98rem !important;
  color: var(--text) !important;
  white-space: nowrap !important;
  flex: 1 !important;
  text-align: left !important;
}

.variant-pick-card.active .variant-pick-title {
  color: var(--primary-dark) !important;
}

.variant-pick-card .var-check {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-in);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.variant-pick-card.active .var-check {
  background: var(--primary);
  box-shadow: 0 2px 6px rgba(83, 109, 254, 0.4);
  color: #ffffff;
}

/* =========================================================================
   БЕЙДЖИ, ПРАВИЛА И ИНСТРУКТАЖ
   ========================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 10px !important;
  font-size: 0.76rem;
  font-weight: 800;
  background: var(--surface) !important;
  box-shadow: var(--shadow-in) !important;
  color: var(--primary-dark) !important;
  border: 0 !important;
  letter-spacing: 0.02em;
}

.badge-indigo {
  color: var(--primary-dark) !important;
}

.warning-rules-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0;
}

@media (max-width: 640px) {
  .warning-rules-box {
    grid-template-columns: 1fr;
  }
}

.rule-card {
  background: var(--surface) !important;
  box-shadow: var(--shadow-soft) !important;
  border: 0 !important;
  border-radius: 18px !important;
  padding: 16px 12px !important;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.rule-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-in);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 10px;
  animation: none !important;
}

.rule-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text) !important;
  margin-bottom: 0;
}

.rule-desc {
  font-size: 0.78rem;
  color: var(--muted) !important;
  font-weight: 600;
  line-height: 1.35;
}

/* =========================================================================
   ШАПКА ЭКРАНА ТЕСТИРОВАНИЯ (.exam-header, ТАЙМЕР, ПРОГРЕСС-БАР)
   Центрированная парящая плашка (как Navbar в уроке), 2 строки
   ========================================================================= */

.exam-header {
  position: sticky;
  top: 12px;
  z-index: 100;
  max-width: 840px !important;
  margin: 12px auto 0 auto !important;
  padding: 0 1.25rem !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  box-sizing: border-box;
}

.exam-header-inner {
  width: 100% !important;
  background: var(--surface) !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  border-radius: 20px !important;
  box-shadow: 8px 8px 20px rgba(163, 174, 195, 0.42), -8px -8px 20px rgba(255, 255, 255, 0.85) !important;
  padding: 14px 20px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  box-sizing: border-box;
}

/* 1 строчка: Тема работы */
.exam-header-title-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.exam-header-title-row .exam-title-text {
  font-weight: 800 !important;
  font-size: 1.05rem !important;
  color: var(--text) !important;
  line-height: 1.35 !important;
  letter-spacing: -0.01em;
}

/* 2 строчка: слева прогресс, справа всё остальное */
.exam-header-controls-row {
  width: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

/* Слева: прогресс */
.exam-header-progress-col {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.progress-track-neu {
  width: 70px;
  height: 8px;
  flex-shrink: 0;
  background: var(--surface) !important;
  box-shadow: inset 3px 3px 6px rgba(163, 174, 195, 0.35), inset -3px -3px 6px rgba(255, 255, 255, 0.8) !important;
  border: 1px solid rgba(163, 174, 195, 0.25) !important;
  border-radius: 999px;
  overflow: hidden;
  padding: 1.5px;
}

.progress-fill-neu {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--teal) 100%) !important;
  border-radius: 999px;
  transition: width 0.3s ease;
}

#progress-text {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  color: var(--muted) !important;
  white-space: nowrap;
}

/* Справа: всё остальное */
.exam-header-meta-col {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
  justify-content: flex-end !important;
  flex-shrink: 0;
}

.save-indicator {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 10px;
  background: var(--surface) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 3px 3px 7px rgba(163, 174, 195, 0.35), -3px -3px 7px rgba(255, 255, 255, 0.85) !important;
  color: var(--muted);
  white-space: nowrap;
}
.save-indicator.saving { color: var(--amber) !important; }
.save-indicator.saved { color: #10b981 !important; }
.save-indicator.offline { color: #dc2626 !important; }

#student-variant-badge {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #ffffff !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  padding: 5px 12px !important;
  border-radius: 10px !important;
  box-shadow: 0 3px 8px rgba(239, 68, 68, 0.35) !important;
  border: 0 !important;
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

#student-info-badge {
  background: var(--surface) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 3px 3px 7px rgba(163, 174, 195, 0.35), -3px -3px 7px rgba(255, 255, 255, 0.85) !important;
  color: var(--primary-dark) !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  padding: 5px 12px !important;
  border-radius: 10px !important;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-btn-header {
  width: 32px;
  height: 32px;
  border-radius: 10px !important;
  background: var(--surface) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 3px 3px 7px rgba(163, 174, 195, 0.35), -3px -3px 7px rgba(255, 255, 255, 0.85) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary) !important;
  cursor: pointer;
  transition: all 0.18s ease;
  padding: 0;
  flex-shrink: 0;
}
.calc-btn-header:hover {
  transform: translateY(-1px);
  box-shadow: 4px 4px 10px rgba(163, 174, 195, 0.45), -4px -4px 10px rgba(255, 255, 255, 0.95) !important;
}

.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  padding: 5px 11px !important;
  border-radius: 10px !important;
  background: var(--surface) !important;
  border: 1.5px solid rgba(83, 109, 254, 0.3) !important;
  box-shadow: inset 2px 2px 5px rgba(83, 109, 254, 0.15), inset -2px -2px 5px rgba(255, 255, 255, 0.85) !important;
  color: var(--primary-dark) !important;
  white-space: nowrap;
  flex-shrink: 0;
}
.timer-pill.warning {
  color: #d97706 !important;
  border-color: rgba(217, 119, 6, 0.4) !important;
}
.timer-pill.danger {
  color: #dc2626 !important;
  border-color: rgba(220, 38, 38, 0.5) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25) !important;
}

@media (max-width: 680px) {
  .exam-header {
    top: 6px;
    margin-top: 6px !important;
    padding: 0 0.75rem !important;
  }
  .exam-header-controls-row {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .progress-track-neu {
    width: 50px;
  }
  #student-info-badge {
    max-width: 115px;
  }
}

/* =========================================================================
   КАЛЬКУЛЯТОР УЧЕНИКА (NEUMORPHIC FLOATING CALCULATOR)
   ========================================================================= */

.calc-btn-header {
  background: var(--surface) !important;
  box-shadow: var(--shadow-soft) !important;
  border: 0 !important;
  color: var(--primary-dark) !important;
  font-family: var(--font) !important;
  font-weight: 800 !important;
  border-radius: 12px !important;
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.calc-btn-header:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-out) !important;
  color: var(--primary-dark) !important;
}

.calc-btn-header:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-in) !important;
}

.calc-popup-card {
  position: fixed;
  top: 76px;
  right: 20px;
  width: 280px;
  background: var(--surface) !important;
  border: 1px solid rgba(255, 255, 255, 0.65) !important;
  border-radius: 24px !important;
  box-shadow: var(--shadow-out), 0 18px 38px rgba(38, 50, 72, 0.18) !important;
  z-index: 9999;
  padding: 16px !important;
  display: none;
  user-select: none;
}

.calc-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(163, 174, 195, 0.25);
  cursor: grab;
}

.calc-popup-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.calc-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  border: 0;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.calc-close-btn:hover {
  box-shadow: var(--shadow-in);
  color: #dc2626;
}

.calc-screen {
  width: 100%;
  height: 48px;
  background: var(--surface) !important;
  box-shadow: var(--shadow-in) !important;
  color: var(--primary-dark) !important;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.3rem;
  font-weight: 800;
  text-align: right;
  padding: 8px 12px;
  border-radius: 13px !important;
  margin-bottom: 12px;
  border: 0 !important;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calc-key {
  height: 40px;
  font-family: var(--font);
  font-size: 0.98rem;
  font-weight: 800;
  border-radius: 11px !important;
  border: 0 !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-soft) !important;
  color: var(--text) !important;
  cursor: pointer;
  transition: all 0.12s ease;
}

.calc-key:hover {
  box-shadow: var(--shadow-in) !important;
  color: var(--primary-dark) !important;
}

.calc-key:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-in) !important;
}

.calc-key.op {
  color: var(--primary-dark) !important;
}

.calc-key.equal {
  color: var(--teal) !important;
}

.calc-key.clear {
  color: #dc2626 !important;
}

/* =========================================================================
   12 ТИПОВ ЗАДАНИЙ В НЕОМОРФНОМ СТИЛЕ ЛИЧНОГО КАБИНЕТА
   ========================================================================= */

.task-condition {
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* 1 & 2. Варианты ответа (Single / Multi Choice) */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px !important;
  background: var(--surface) !important;
  box-shadow: 4px 4px 11px rgba(163, 174, 195, 0.38), -4px -4px 11px rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  border-radius: 16px !important;
  margin-bottom: 0 !important;
  cursor: pointer;
  font-weight: 600;
  color: var(--text) !important;
  transition: all 0.16s ease;
}
.option-label:hover {
  transform: translateY(-2px);
  border-color: rgba(83, 109, 254, 0.4) !important;
  box-shadow: 6px 6px 14px rgba(163, 174, 195, 0.45), -6px -6px 14px rgba(255, 255, 255, 0.95) !important;
}
.option-label.selected {
  background: var(--surface) !important;
  border-color: var(--primary) !important;
  box-shadow: inset 3px 3px 7px rgba(83, 109, 254, 0.25), inset -3px -3px 7px rgba(255, 255, 255, 0.85), 0 0 0 1px var(--primary) !important;
  color: var(--primary-dark) !important;
  font-weight: 800;
}

.option-label input[type="radio"],
.option-label input[type="checkbox"] {
  margin: 0;
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

/* 6. Верно / Неверно */
.tf-group {
  display: flex;
  gap: 14px;
}

.tf-option {
  flex: 1;
  padding: 14px 20px !important;
  text-align: center;
  font-weight: 800;
  font-size: 0.98rem;
  border: 2px solid transparent !important;
  border-radius: 16px !important;
  cursor: pointer;
  background: var(--surface) !important;
  box-shadow: var(--shadow-soft) !important;
  color: var(--text) !important;
  transition: all 0.16s ease;
}

.tf-option:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-out) !important;
}

.tf-option.selected-true {
  background: var(--surface) !important;
  box-shadow: var(--shadow-in) !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
  color: #059669 !important;
}

.tf-option.selected-false {
  background: var(--surface) !important;
  box-shadow: var(--shadow-in) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
  color: #dc2626 !important;
}

/* 7. Упорядочивание (Ordering) */
.ordering-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ordering-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface) !important;
  box-shadow: 4px 4px 11px rgba(163, 174, 195, 0.38), -4px -4px 11px rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  border-radius: 16px !important;
  padding: 12px 18px !important;
  gap: 12px;
}

.ordering-index {
  font-weight: 800;
  color: var(--primary-dark);
  width: 26px;
}

.ordering-text {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.ordering-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface) !important;
  box-shadow: 3px 3px 7px rgba(163, 174, 195, 0.38), -3px -3px 7px rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 12px !important;
  cursor: pointer;
  font-weight: 800;
  color: var(--text) !important;
  transition: all 0.15s ease;
}

.ordering-btn:hover:not(:disabled) {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px rgba(83, 109, 254, 0.35) !important;
  transform: translateY(-1px);
}

/* 8. Сопоставление (Matching) */
.matching-card {
  background: var(--surface) !important;
  box-shadow: var(--shadow-soft) !important;
  border-radius: 16px !important;
  border: 1.5px solid transparent !important;
  color: var(--text) !important;
}

.matching-card:hover {
  box-shadow: var(--shadow-out) !important;
}

.matching-card.selected-node,
.matching-card.is-connected {
  box-shadow: var(--shadow-in) !important;
  border-color: rgba(83, 109, 254, 0.4) !important;
}

.matching-pin {
  background: var(--surface) !important;
  border: 3px solid var(--primary) !important;
}

/* 10. Категории (Group Classification) */
.categorize-bucket,
.categorize-deck {
  background: var(--surface) !important;
  box-shadow: inset 3px 3px 8px rgba(163, 174, 195, 0.35), inset -3px -3px 8px rgba(255, 255, 255, 0.85) !important;
  border-radius: 18px !important;
  border: 1.5px dashed rgba(116, 128, 151, 0.45) !important;
  padding: 16px !important;
}

body.theme-dark .categorize-bucket,
body.theme-dark .categorize-deck,
[data-theme="dark"] .categorize-bucket,
[data-theme="dark"] .categorize-deck {
  box-shadow: inset 3px 3px 8px rgba(0, 0, 0, 0.6), inset -2px -2px 6px rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.categorize-deck-title {
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: var(--muted) !important;
  margin-bottom: 12px !important;
}

.categorize-card {
  background: var(--surface) !important;
  box-shadow: 4px 4px 11px rgba(163, 174, 195, 0.42), -4px -4px 11px rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  border-radius: 14px !important;
  padding: 10px 18px !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: grab !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
}

.categorize-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 6px 6px 14px rgba(163, 174, 195, 0.52), -5px -5px 13px rgba(255, 255, 255, 1) !important;
}

.categorize-card:active,
.categorize-card.selected-for-move {
  cursor: grabbing !important;
  box-shadow: inset 2px 2px 5px rgba(163, 174, 195, 0.45), inset -2px -2px 5px rgba(255, 255, 255, 0.8) !important;
  border-color: var(--primary) !important;
  color: var(--primary-dark) !important;
}

body.theme-dark .categorize-card,
[data-theme="dark"] .categorize-card {
  box-shadow: 4px 4px 11px rgba(0, 0, 0, 0.5), -2px -2px 8px rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.theme-dark .categorize-card:hover,
[data-theme="dark"] .categorize-card:hover {
  box-shadow: 6px 6px 14px rgba(0, 0, 0, 0.65), -2px -2px 10px rgba(255, 255, 255, 0.08) !important;
}

/* 11. Исключение лишнего (Odd One Out) */
.odd-card {
  background: var(--surface) !important;
  box-shadow: 4px 4px 11px rgba(163, 174, 195, 0.42), -4px -4px 11px rgba(255, 255, 255, 0.9) !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  color: var(--text) !important;
  font-weight: 700 !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.odd-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 6px 6px 14px rgba(163, 174, 195, 0.52), -5px -5px 13px rgba(255, 255, 255, 1) !important;
}

.odd-card.is-selected {
  background: var(--surface) !important;
  box-shadow: inset 3px 3px 7px rgba(239, 68, 68, 0.35), inset -3px -3px 7px rgba(255, 255, 255, 0.8) !important;
  border: 1.5px solid rgba(239, 68, 68, 0.5) !important;
  color: #dc2626 !important;
}

/* 12. Вставка слов из банка (Word Bank Cloze) */
.cloze-slot {
  background: var(--surface) !important;
  box-shadow: inset 2px 2px 6px rgba(163, 174, 195, 0.35), inset -2px -2px 6px rgba(255, 255, 255, 0.8) !important;
  border-radius: 10px !important;
  border: 1.5px dashed rgba(83, 109, 254, 0.45) !important;
  color: var(--primary-dark) !important;
}

.cloze-slot.filled {
  background: var(--surface) !important;
  box-shadow: 3px 3px 8px rgba(163, 174, 195, 0.4), -3px -3px 8px rgba(255, 255, 255, 0.9) !important;
  border: 1.5px solid var(--primary) !important;
}

.cloze-bank-wrap {
  background: var(--surface) !important;
  box-shadow: inset 3px 3px 8px rgba(163, 174, 195, 0.35), inset -3px -3px 8px rgba(255, 255, 255, 0.85) !important;
  border-radius: 16px !important;
  border: 1.5px dashed rgba(116, 128, 151, 0.35) !important;
  padding: 14px !important;
}

.cloze-chip {
  background: var(--surface) !important;
  box-shadow: 3px 3px 8px rgba(163, 174, 195, 0.42), -3px -3px 8px rgba(255, 255, 255, 0.9) !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  color: var(--text) !important;
  font-weight: 700 !important;
  padding: 6px 14px !important;
  cursor: grab !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.cloze-chip:hover {
  transform: translateY(-2px) !important;
  box-shadow: 5px 5px 12px rgba(163, 174, 195, 0.5), -4px -4px 10px rgba(255, 255, 255, 1) !important;
}

/* 13. Таблица утверждений (Boolean Matrix) */
.matrix-card-row {
  background: var(--surface) !important;
  box-shadow: 4px 4px 11px rgba(163, 174, 195, 0.38), -4px -4px 11px rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  border-radius: 16px !important;
}

.matrix-pills-group {
  background: var(--surface) !important;
  box-shadow: var(--shadow-in) !important;
  border-radius: 12px !important;
  border: 0 !important;
  padding: 4px !important;
}

.matrix-pill-btn {
  border-radius: 9px !important;
  color: var(--muted) !important;
  font-family: var(--font) !important;
  font-weight: 800 !important;
}

.matrix-pill-btn.active {
  background: var(--surface) !important;
  box-shadow: var(--shadow-soft) !important;
  color: var(--primary-dark) !important;
}

.matrix-pill-btn.active.is-true {
  background: var(--surface) !important;
  box-shadow: var(--shadow-soft) !important;
  color: #059669 !important;
}

.matrix-pill-btn.active.is-false {
  background: var(--surface) !important;
  box-shadow: var(--shadow-soft) !important;
  color: #dc2626 !important;
}

/* 15. Выделение слов (Highlight Words) */
.highlight-toolbar {
  background: var(--surface) !important;
  box-shadow: var(--shadow-soft) !important;
  border-radius: 14px !important;
  border: 0 !important;
  padding: 8px 14px !important;
}

.highlight-words-passage {
  background: var(--surface) !important;
  box-shadow: var(--shadow-in) !important;
  border-radius: 16px !important;
  border: 0 !important;
}

/* Изображения заданий */
.task-image-box img {
  border-radius: 16px !important;
  box-shadow: var(--shadow-soft) !important;
  border: 0 !important;
}

/* Пояснение учителя в результатах */
.teacher-explanation {
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface) !important;
  box-shadow: var(--shadow-in) !important;
  border: 0 !important;
  border-left: 4px solid var(--primary) !important;
  color: var(--text) !important;
}
.teacher-explanation-title {
  color: var(--primary-dark) !important;
  font-weight: 800;
}

/* Модальные окна ученика */
.student-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(25, 34, 51, 0.38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.student-modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface) !important;
  box-shadow: var(--shadow-out) !important;
  border-radius: 26px !important;
  border: 0 !important;
  padding: 26px !important;
  color: var(--text) !important;
}


/* =========================================================================
   КАСТОМНЫЕ НЕОМОРФНЫЕ ВЫПАДАЮЩИЕ СПИСКИ (CUSTOM SELECT DROPDOWNS)
   ========================================================================= */

.custom-select-container {
  position: relative !important;
  width: 100% !important;
  user-select: none !important;
}

.custom-select-container.inline-custom-select {
  display: inline-block !important;
  width: auto !important;
  min-width: 210px !important;
  vertical-align: middle;
  margin: 0 4px;
}

.custom-select-container.is-open {
  z-index: 1050 !important;
}

.custom-select-container select {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  z-index: -1 !important;
}

.custom-select-trigger {
  width: 100% !important;
  min-height: 46px !important;
  padding: 10px 16px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-soft) !important;
  color: var(--text) !important;
  font-family: var(--font) !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-sizing: border-box !important;
  text-align: left !important;
}

.custom-select-trigger:hover {
  color: var(--primary-dark) !important;
  box-shadow: var(--shadow-out) !important;
}

.custom-select-container.is-open .custom-select-trigger {
  box-shadow: var(--shadow-in) !important;
  color: var(--primary-dark) !important;
}

.custom-select-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.custom-select-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--primary);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.custom-select-chevron svg {
  width: 16px;
  height: 16px;
}

.custom-select-container.is-open .custom-select-chevron {
  transform: rotate(180deg);
  color: var(--primary-dark);
}

.custom-select-menu {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1051 !important;
  background: var(--surface) !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 36px rgba(163, 174, 195, 0.48), 0 6px 14px rgba(163, 174, 195, 0.28), var(--shadow-soft) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  padding: 6px !important;
  max-height: 260px !important;
  overflow-y: auto !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-6px) scale(0.98) !important;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.2s ease !important;
  pointer-events: none !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

.custom-select-container.is-open .custom-select-menu {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: auto !important;
}

.custom-select-container.drop-up .custom-select-menu {
  top: auto !important;
  bottom: calc(100% + 8px) !important;
  transform: translateY(6px) scale(0.98) !important;
}

.custom-select-container.drop-up.is-open .custom-select-menu {
  transform: translateY(0) scale(1) !important;
}

.custom-select-option {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 14px !important;
  border-radius: 11px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
}

.custom-select-option:hover {
  background: rgba(83, 109, 254, 0.1) !important;
  color: var(--primary-dark) !important;
  transform: translateX(2px) !important;
}

.custom-select-option.is-selected {
  background: var(--surface) !important;
  color: var(--primary-dark) !important;
  font-weight: 800 !important;
  box-shadow: var(--shadow-soft) !important;
}

.custom-select-check {
  display: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

.custom-select-check svg {
  width: 14px;
  height: 14px;
}

.custom-select-option.is-selected .custom-select-check {
  display: inline-flex;
}

/* =========================================================================
   КАСТОМНЫЕ НЕОМОРФНЫЕ РАДИОКНОПКИ И ЧЕКБОКСЫ В ЗАДАНИЯХ
   ========================================================================= */

.option-label input[type="radio"],
.option-label input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 22px !important;
  height: 22px !important;
  margin: 0 !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-in) !important;
  border: 1.5px solid transparent !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  position: relative !important;
}

.option-label input[type="radio"] {
  border-radius: 50% !important;
}

.option-label input[type="checkbox"] {
  border-radius: 7px !important;
}

.option-label input[type="radio"]:checked {
  background: var(--primary) !important;
  box-shadow: 0 2px 6px rgba(83, 109, 254, 0.4) !important;
}

.option-label input[type="radio"]:checked::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
}

.option-label input[type="checkbox"]:checked {
  background: var(--primary) !important;
  box-shadow: 0 2px 6px rgba(83, 109, 254, 0.4) !important;
}

.option-label input[type="checkbox"]:checked::after {
  content: "";
  width: 5px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

/* =========================================================================
   НЕОМОРФНЫЕ УВЕДОМЛЕНИЯ (TOASTS) И ПОДСКАЗКИ (TOOLTIPS)
   ========================================================================= */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 420px;
}

.cabinet-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.cabinet-toast.toast-error {
  border-left: 4px solid #ef4444;
}
.cabinet-toast.toast-success {
  border-left: 4px solid #10b981;
}
.cabinet-toast.toast-info {
  border-left: 4px solid var(--primary);
}

.custom-tooltip {
  position: fixed;
  z-index: 999999;
  pointer-events: none;
  padding: 6px 12px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: pre-line;
  max-width: 280px;
  text-align: center;
  color: #ffffff;
  background: rgba(26, 35, 52, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.14);
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.custom-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}


/* =========================================================================
   ЦВЕТОВАЯ ИНДИКАЦИЯ ВАРИАНТОВ ДЛЯ КОНТРОЛЯ В КЛАССЕ (NEUMORPHIC VARIANT TINT)
   ========================================================================= */

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--variant-accent, var(--primary));
  box-shadow: 0 2px 12px var(--variant-glow, rgba(83, 109, 254, 0.45));
  z-index: 99999;
  pointer-events: none;
}

/* .exam-header styling handled above */

#student-variant-badge,
#intro-variant-badge {
  background: var(--variant-accent, var(--primary)) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px var(--variant-glow, rgba(83, 109, 254, 0.35)) !important;
  padding: 6px 14px !important;
  font-size: 0.84rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase;
}

/* =========================================================================
   СТРУКТУРИРОВАННЫЙ РАЗБОР ОТВЕТОВ УЧЕНИКА (#published-results-details)
   ========================================================================= */

.res-task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
}

.res-task-num {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
}

.res-task-score {
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-in);
  color: var(--primary-dark);
}
.res-task-score.is-full { color: #059669; }
.res-task-score.is-partial { color: #d97706; }
.res-task-score.is-zero { color: #dc2626; }

.res-task-question {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

.res-answer-section {
  background: var(--surface);
  box-shadow: var(--shadow-in);
  border-radius: 14px;
  padding: 10px 14px;
  margin-top: 0.55rem;
}

.res-correct-section {
  border-left: 3px solid #10b981;
}

.res-answer-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}

.res-answer-label.correct-label {
  color: #059669;
}

.res-empty-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  font-style: italic;
}

.res-single-val {
  display: inline-block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.res-correct-section .res-single-val {
  color: #047857;
}

.res-pairs-list,
.res-steps-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.res-pair-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.38);
  font-size: 0.86rem;
  line-height: 1.35;
}

.res-pair-left {
  color: var(--text);
  font-weight: 600;
  flex: 1;
}

.res-pair-arrow {
  color: var(--muted);
  font-weight: 800;
  flex-shrink: 0;
}

.res-pair-right {
  font-weight: 800;
  color: var(--primary-dark);
  text-align: right;
}

.res-correct-section .res-pair-right {
  color: #047857;
}

.res-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.res-group-box {
  background: rgba(255, 255, 255, 0.42);
  border-radius: 12px;
  padding: 8px 10px;
}

.res-group-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(163, 174, 195, 0.25);
}

.res-correct-section .res-group-title {
  color: #047857;
}

.res-group-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.res-group-item {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.35;
}

.res-step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.38);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.res-step-idx {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary-dark);
  flex-shrink: 0;
}

.res-step-text {
  flex: 1;
}

.res-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.res-chip-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.res-mark {
  font-weight: 800;
  margin-right: 3px;
}
.res-mark.ok { color: #059669; }
.res-mark.bad { color: #dc2626; }

