/* ============================================================
   MATHBATTLE • Оптимизированные стили
   ============================================================ */


/* ============================================================
   🔹 ЗАГОЛОВОК
   ============================================================ */
.mb-title {
  color: #2c5f8d;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.mb-title i {
  color: #f59e0b;
}

/* ============================================================
   🔹 КАРТОЧКА
   ============================================================ */
.mb-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(44, 95, 141, 0.12);
  border: 2px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.mb-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #2c5f8d, #4a7c59, #f59e0b);
  opacity: 0.8;
}

/* ============================================================
   🔹 СТАТИСТИКА
   ============================================================ */
.mb-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 0 auto 1.5rem;
  max-width: 900px;
}
.mb-stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-top: 3px solid #6b7280;
}
.mb-stat-card.success { border-top-color: #4a7c59; }
.mb-stat-card.danger { border-top-color: #ef4444; }
.mb-stat-card.warning { border-top-color: #f59e0b; }
.mb-stat-card.info   { border-top-color: #2c5f8d; }
.mb-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
}
.mb-stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 600;
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   🔹 ЗАДАНИЕ
   ============================================================ */
.mb-task {
  background: linear-gradient(135deg, #2c5f8d 0%, #1e4a6b 100%);
  color: #fff;
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.mb-task::before {
  content: '1234567890+-×÷';
  position: absolute;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 7rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.06);
  animation: mb-float-digits 28s linear infinite;
  pointer-events: none;
  white-space: nowrap;
  top: -15%;
  left: -15%;
  z-index: 0;
  letter-spacing: 0.5rem;
}
@keyframes mb-float-digits {
  0%   { transform: translate(-40%, -40%) rotate(-8deg); opacity: 0; }
  8%   { opacity: 0.06; }
  92%  { opacity: 0.06; }
  100% { transform: translate(340%, 140%) rotate(8deg); opacity: 0; }
}
.mb-task::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.08) 45%, rgba(255,255,255,0.15) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: mb-shimmer 3.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes mb-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.mb-task-value {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  position: relative;
  z-index: 3;
  font-family: 'SF Mono', 'Fira Code', monospace;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.mb-task-hint {
  font-size: 0.9rem;
  opacity: 0.95;
  margin-top: 0.4rem;
  position: relative;
  z-index: 3;
  font-weight: 500;
}

/* ============================================================
   🔹 ПОЛЕ ОТВЕТА И КНОПКИ
   ============================================================ */
.mb-answer-area {
  display: flex;
  gap: 1rem;
  min-height: 140px;
  margin: 1rem 0;
}
.mb-answer-input {
  flex: 7;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mb-answer-input input {
  flex: 1;
  width: 100%;
  font-size: 2rem;
  font-weight: 700;
  padding: 1rem;
  border: 4px solid #cbd5e1;
  border-radius: 16px;
  text-align: center;
  font-family: 'SF Mono', 'Fira Code', monospace;
  letter-spacing: 3px;
  background: #fff;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.mb-answer-input input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.2);
  outline: none;
}
.mb-answer-input input.correct {
  border-color: #4a7c59;
  background: rgba(74, 124, 89, 0.1);
  animation: mb-bounce 0.3s ease;
}
.mb-answer-input input.incorrect {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  animation: mb-shake 0.3s ease;
}
@keyframes mb-bounce {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.02); }
}
@keyframes mb-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px); }
}

.mb-feedback {
  min-height: 26px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
}
.mb-feedback.ok  { color: #4a7c59; }
.mb-feedback.bad { color: #ef4444; }

/* Кнопки */
.mb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  padding: 0.75rem 1rem;
}
.mb-btn-check { background: #4a7c59; color: #fff; }
.mb-btn-check:hover {
  background: #3a6347;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 124, 89, 0.3);
}
.mb-btn-new { background: #2c5f8d; color: #fff; }
.mb-btn-new:hover {
  background: #1e4a6b;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(44, 95, 141, 0.3);
}
.mb-btn-reset {
  background: transparent;
  border: 2px solid #6b7280;
  color: #6b7280;
}
.mb-btn-reset:hover {
  background: #6b7280;
  color: #fff;
  transform: translateY(-2px);
}

/* ============================================================
   🔹 НАСТРОЙКИ: УРОВНИ И РЕЖИМЫ
   ============================================================ */
.mb-difficulty {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mb-diff-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 0.9rem;
}
.mb-diff-btn:hover {
  border-color: #f59e0b;
  transform: translateY(-1px);
}
.mb-diff-btn:has(input:checked) {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}
.mb-diff-btn input {
  width: 16px;
  height: 16px;
  accent-color: #f59e0b;
  cursor: pointer;
}
.mb-diff-btn .mb-diff-desc {
  font-size: 0.72rem;
  font-weight: 400;
  color: #6b7280;
  margin-left: auto;
  text-align: right;
}

.mb-settings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
}
.mb-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  background: #f1f5f9;
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.mb-chip:hover:not(.disabled) {
  background: #e2e8f0;
  transform: scale(1.03);
}
.mb-chip input {
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.mb-chip.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.mb-chip:has(input:checked) {
  background: #2c5f8d;
  color: #fff;
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(44, 95, 141, 0.25);
}
.mb-chip:has(input:checked):hover {
  background: #1e4a6b;
}

/* Цвета чипов по группе */
.mb-chip.add { border-color: rgba(74, 124, 89, 0.3); }
.mb-chip.add:has(input:checked) { background: #4a7c59; }
.mb-chip.sub { border-color: rgba(44, 95, 141, 0.3); }
.mb-chip.sub:has(input:checked) { background: #2c5f8d; }
.mb-chip.mul { border-color: rgba(245, 158, 11, 0.3); }
.mb-chip.mul:has(input:checked) { background: #f59e0b; color: #1e293b; }
.mb-chip.div { border-color: rgba(139, 92, 246, 0.4); }
.mb-chip.div:has(input:checked) { background: #8b5cf6; }
.mb-chip.comp { border-color: rgba(236, 72, 153, 0.4); }
.mb-chip.comp:has(input:checked) { background: #ec4899; }



/* ============================================================
   🔹 ПОДСКАЗКА
   ============================================================ */
.mb-tip {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-left: 4px solid #92400e;
  border-radius: 0 12px 12px 0;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
  color: #1e293b;
}
.mb-tip i { margin-right: 0.5rem; color: #92400e; }

/* ============================================================
   🔹 ИСТОРИЯ
   ============================================================ */
.mb-history {
  max-height: 280px;
  overflow-y: auto;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.mb-history-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.mb-history-item:last-child { border-bottom: none; }
.mb-history-item:hover { background: #f1f5f9; }
.mb-history-item.correct {
  border-left: 4px solid #4a7c59;
  background: rgba(74, 124, 89, 0.06);
}
.mb-history-item.incorrect {
  border-left: 4px solid #ef4444;
  background: rgba(239, 68, 68, 0.06);
}
.mb-history-item .history-answer {
  font-weight: 700;
  margin-left: auto;
}
.mb-history-item .history-answer.ok { color: #4a7c59; }
.mb-history-item .history-answer.bad { color: #ef4444; text-decoration: line-through; }
.mb-history-item .history-correct {
  color: #4a7c59;
  font-weight: 700;
  margin-left: 0.5rem;
}

/* Скроллбар */
.mb-history::-webkit-scrollbar { width: 6px; }
.mb-history::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
.mb-history::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.mb-history::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   🔹 TOOLTIP'Ы
   ============================================================ */
.mb-chip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border: 1px solid rgba(245, 158, 11, 0.3);
  max-width: 280px;
  white-space: normal;
  text-align: center;
}

.mb-chip::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border: 5px solid transparent;
  border-top-color: #1e293b;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 1001;
}

.mb-chip:hover::before,
.mb-chip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mb-chip.disabled::before {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  border-color: rgba(107, 114, 128, 0.3);
}
.mb-chip.disabled::after {
  border-top-color: #6b7280;
}

/* ============================================================
   🔹 АДАПТИВ
   ============================================================ */
@media (max-width: 992px) {
  .mb-answer-area { flex-direction: column; min-height: auto; }
  .mb-answer-input, .mb-answer-buttons { flex: none; width: 100%; }
  .mb-answer-input input { min-height: 80px; font-size: 1.75rem; }
  .mb-answer-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .mb-answer-area .mb-btn {
    min-height: 45px;
    flex: 1 1 calc(50% - 0.25rem);
  }
}
@media (max-width: 768px) {
  .mb-title { font-size: 1.75rem !important; }
  .mb-task-value { font-size: 1.75rem; }
  .mb-stats { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .mb-stat-value { font-size: 1.35rem; }
  .mb-stat-label { font-size: 0.7rem; }
  .mb-settings { grid-template-columns: repeat(2, 1fr); }

  .mb-chip::before {
    bottom: auto;
    top: calc(100% + 8px);
    transform: translateX(-50%) translateY(-4px);
    font-size: 0.7rem;
  }
  .mb-chip::after {
    bottom: auto;
    top: calc(100% + 4px);
    border-top-color: transparent;
    border-bottom-color: #1e293b;
    transform: translateX(-50%) translateY(-4px);
  }
  .mb-chip:hover::before,
  .mb-chip:hover::after {
    transform: translateX(-50%) translateY(0);
  }
  .mb-chip.disabled::after {
    border-bottom-color: #6b7280;
  }
}
@media (max-width: 576px) {
  .mb-chip { font-size: 0.72rem; }
  .mb-diff-btn .mb-diff-desc { display: none; }
}


/* ============================================================
   🔹 ОБОЙМА С ПАТРОНАМИ
   ============================================================ */
.mb-magazine {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  margin: 0 auto 1rem;
  width: 100%;
  max-width: 900px;
  border: 2px solid #334155;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.mb-magazine .magazine-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #334155;
}
.mb-magazine .magazine-header i { color: #f59e0b; }
.mb-magazine .magazine-count {
  background: #f59e0b;
  color: #1e293b;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}
.magazine-bullets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
  min-height: 32px;
}
.magazine-bullet {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #334155;
  border: 2px solid #475569;
  position: relative;
  transition: all 0.25s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.magazine-bullet[data-type="add"]  { --bt: 142; }
.magazine-bullet[data-type="sub"]  { --bt: 217; }
.magazine-bullet[data-type="mul"]  { --bt: 38;  }
.magazine-bullet[data-type="div"]  { --bt: 262; }
.magazine-bullet[data-type="comp"] { --bt: 340; }

.magazine-bullet[data-type].empty {
  border-color: hsl(var(--bt), 60%, 50%);
  background: hsl(var(--bt), 60%, 95%);
}
.magazine-bullet[data-type].solved {
  background: linear-gradient(135deg, #4a7c59, #3a6347);
  border-color: #3a6347;
}
.magazine-bullet.solved::after {
  content: '✓';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.magazine-bullet.missed {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-color: #b91c1c;
}
.magazine-bullet.missed::after {
  content: '✗';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}
.magazine-bullet.active {
  background: linear-gradient(135deg, hsl(var(--bt), 70%, 55%), hsl(var(--bt), 70%, 45%));
  border-color: hsl(var(--bt), 70%, 45%);
  animation: mb-bullet-pulse 1.5s ease-in-out infinite;
}
@keyframes mb-bullet-pulse {
  0%, 100% { box-shadow: 0 0 0 3px hsla(var(--bt), 70%, 50%, 0.4); }
  50%      { box-shadow: 0 0 0 6px hsla(var(--bt), 70%, 50%, 0); }
}

/* ============================================================
   🔹 РЕЖИМ ЗАДАНИЯ
   ============================================================ */
body.mb-task-mode .mb-tip,
body.mb-task-mode #levelList,
body.mb-task-mode #modesGrid,
body.mb-task-mode .mb-card .fw-bold:has(.fa-layer-group),
body.mb-task-mode .mb-card .fw-bold:has(.fa-gears) {
  display: none !important;
}

.mb-task-badge {
  background: linear-gradient(135deg, #2c5f8d, #1e4a6b);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  margin-top: 0.5rem;
}

.mb-secret-inline {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
  color: #fff;
  animation: mb-secret-slide 0.4s ease-out;
}
.mb-secret-inline .secret-label {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}
.mb-secret-inline .secret-word {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  animation: mb-secret-pulse 2s ease-in-out infinite;
}
@keyframes mb-secret-slide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes mb-secret-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.mb-task.task-complete {
  border: 3px solid #22c55e !important;
  background: linear-gradient(135deg, #166534, #14532d) !important;
  animation: mb-complete-glow 1.5s ease-in-out infinite;
}
@keyframes mb-complete-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
}

body.mb-task-mode .mb-task.task-complete .mb-task-value,
body.mb-task-mode .mb-task.task-complete .mb-task-hint,
body.mb-task-mode .mb-task.task-complete .mb-answer-area,
body.mb-task-mode .mb-task.task-complete .mb-task-badge {
  display: none !important;
}

@media (max-width: 576px) {
  .magazine-bullet { width: 24px; height: 24px; }
  .magazine-bullet.solved::after,
  .magazine-bullet.missed::after { font-size: 0.6rem; }
}

/* ============================================================
   🔹 АДМИНКА: ГРУППЫ ПРИМЕРОВ
   ============================================================ */
.mb-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.15s;
}
.mb-group-item:last-child { border-bottom: none; }
.mb-group-item:hover { background: #f8fafc; }

.mb-group-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.mb-group-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2c5f8d, #1e4a6b);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.mb-group-details {
  flex: 1;
  min-width: 0;
}

.mb-group-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1e293b;
}

.mb-group-types {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mb-group-remove {
  flex-shrink: 0;
}

/* Пресеты количества */
.count-preset {
  min-width: 40px;
  font-weight: 600;
}

/* ============================================================
   🔹 ПЕЧАТЬ ЛИСТА (worksheet)
   ============================================================ */
.print-sheet {
  display: none;
}

/* Стили для печати */
@media print {
  /* Скрываем всё кроме листа */
  body * {
    visibility: hidden !important;
  }

  .print-sheet,
  .print-sheet * {
    visibility: visible !important;
  }

  .print-sheet {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #fff !important;
  }

  /* Отключаем фоны и тени браузера */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Убираем отступы страницы */
  @page {
    size: A4;
    margin: 10mm;
  }

  body {
    background: #fff !important;
  }

  /* Лист А4 */
  .print-page {
    width: 190mm;
    min-height: 277mm;
    padding: 5mm;
    background: #fff;
    /* Фон в клеточку */
    background-image:
      linear-gradient(rgba(100, 149, 237, 0.15) 1px, transparent 1px),
      linear-gradient(90deg, rgba(100, 149, 237, 0.15) 1px, transparent 1px);
    background-size: 5mm 5mm;
    position: relative;
    box-sizing: border-box;
  }

  /* Шапка */
  .print-header {
    border-bottom: 2px solid #2c5f8d;
    padding-bottom: 8mm;
    margin-bottom: 8mm;
  }

  .print-title {
    font-size: 22pt;
    font-weight: 800;
    color: #2c5f8d;
    text-align: center;
    margin-bottom: 5mm;
    font-family: 'Segoe UI', system-ui, sans-serif;
  }
  .print-title i {
    color: #f59e0b;
  }

  .print-info {
    display: flex;
    justify-content: space-between;
    gap: 5mm;
    flex-wrap: wrap;
  }

  .print-field {
    display: flex;
    align-items: baseline;
    gap: 3mm;
    flex: 1;
    min-width: 50mm;
  }

  .print-label {
    font-weight: 600;
    font-size: 10pt;
    color: #1e293b;
    white-space: nowrap;
    font-family: 'Segoe UI', system-ui, sans-serif;
  }

  .print-line {
    flex: 1;
    border-bottom: 1px solid #64748b;
    min-width: 40mm;
    height: 1em;
  }
  .print-line.short { min-width: 20mm; flex: 0.5; }
  .print-line.long { min-width: 60mm; }

  /* Примеры - 2 колонки */
  .print-examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4mm 10mm;
    margin-bottom: 10mm;
  }

  .print-example {
    display: flex;
    align-items: baseline;
    gap: 2mm;
    padding: 2mm 0;
    font-size: 13pt;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    color: #1e293b;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-num {
    font-weight: 700;
    color: #2c5f8d;
    min-width: 8mm;
  }

  .print-text {
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.5px;
  }

  .print-answer-box {
    flex: 1;
    min-width: 15mm;
    max-width: 30mm;
    border-bottom: 1.5px solid #1e293b;
    height: 6mm;
    display: inline-block;
  }

  /* Футер */
  .print-footer {
    margin-top: 8mm;
    padding-top: 5mm;
    border-top: 1px solid #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 5mm;
  }

  .print-result {
    display: flex;
    align-items: baseline;
    gap: 3mm;
    justify-content: flex-end;
  }

  .print-score {
    font-size: 14pt;
    font-weight: 700;
    font-family: 'SF Mono', monospace;
  }

  .print-teacher {
    display: flex;
    align-items: baseline;
    gap: 3mm;
    margin-top: 5mm;
  }
}

/* Кнопка печати - показываем только когда есть примеры */
#printBtn {
  min-width: 50px;
}
