:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2FF;
  --primary-dark: #3730A3;
  --success: #10B981;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --border-focus: #818CF8;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

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

body {
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Header & Navigation */
.header-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}
.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}
.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}
.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
  list-style: none;
}
.nav-tab-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}
.nav-tab-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}
.nav-tab-btn.active {
  color: var(--primary);
  background: var(--primary-light);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Layout Containers */
.main-content {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.5rem;
  min-width: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-page);
  border-color: #cbd5e1;
}
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover {
  background: #059669;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
}
.btn-warning {
  background: var(--warning);
  color: #fff;
}
.btn-warning:hover {
  background: #d97706;
}
.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.15rem;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}
.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 1.15rem;
  font-weight: 700;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-draft { background: #F1F5F9; color: #475569; }
.badge-waiting { background: var(--warning-light); color: #B45309; }
.badge-active { background: var(--success-light); color: #047857; }
.badge-closed { background: #FEF3C7; color: #92400E; }
.badge-finished { background: #F1F5F9; color: #64748B; }
.badge-indigo { background: var(--primary-light); color: var(--primary); }

/* Status Dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online { background: var(--success); box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }
.status-dot.offline { background: var(--text-light); }

/* Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
.table th {
  background: #F8FAFC;
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: none;
}
.table tr:hover td {
  background: #F8FAFC;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-backdrop.open {
  display: flex;
}
.modal-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}
.modal-body {
  padding: 1.5rem;
}
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #FAFAFA;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* Three-column Test Editor */
.editor-layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 1.25rem;
  align-items: start;
  transition: grid-template-columns 0.25s ease;
}
.editor-layout.sidebar-collapsed {
  grid-template-columns: 280px 1fr !important;
}
.editor-layout.sidebar-collapsed #editor-right-sidebar {
  display: none !important;
}
#btn-toggle-editor-sidebar.active {
  background: var(--primary-light, #EEF2FF);
  color: var(--primary, #4F46E5);
  border-color: var(--primary, #4F46E5);
}

.publish-results-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}
.publish-results-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.publish-results-toggle-slider {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 40px;
  border-radius: 999px;
  background: #CBD5E1;
  transition: background 0.2s ease;
}
.publish-results-toggle-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}
.publish-results-toggle input:checked + .publish-results-toggle-slider {
  background: #10B981;
}
.publish-results-toggle input:checked + .publish-results-toggle-slider::after {
  transform: translateX(18px);
}
.publish-results-toggle:focus-within .publish-results-toggle-slider {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.published-results-button-wrap {
  display: flex;
  justify-content: center;
  margin: 1.25rem 0 0.25rem;
}
.published-results-button {
  min-width: 220px;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(79, 70, 229, 0.18);
}
.teacher-explanation {
  margin: 0.75rem 0 0.25rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #C7D2FE;
  border-left: 4px solid #6366F1;
  border-radius: 8px;
  background: #EEF2FF;
  color: #3730A3;
  line-height: 1.5;
}
.teacher-explanation-title {
  margin-bottom: 0.25rem;
  font-weight: 800;
  color: #4338CA;
}
@media (max-width: 1100px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

.task-list-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.task-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.15s ease;
}
.task-nav-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.task-nav-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* Student Test Taking Styles */
.exam-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 40;
}
.exam-header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-md);
  background: #F1F5F9;
  color: var(--text-main);
  border: 1px solid var(--border);
}
.timer-pill.warning {
  background: var(--warning-light);
  color: #B45309;
  border-color: #FCD34D;
}
.timer-pill.danger {
  background: var(--danger-light);
  color: #B91C1C;
  border-color: #FCA5A5;
  animation: pulse 1s infinite alternate;
}
@keyframes pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

.save-indicator {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.save-indicator.saving { color: var(--warning); }
.save-indicator.saved { color: var(--success); }
.save-indicator.offline { color: var(--danger); }

.task-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.task-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.task-num-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}
.task-condition {
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.option-label:hover {
  border-color: var(--primary);
  background: #F8FAFC;
}
.option-label.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.option-label input[type="radio"],
.option-label input[type="checkbox"] {
  margin-top: 0.25rem;
  accent-color: var(--primary);
  width: 17px;
  height: 17px;
}

/* Responsive Utilities */
@media (max-width: 640px) {
  .main-content {
    padding: 1rem;
  }
  .header-container {
    padding: 0.5rem 1rem;
  }
  .card {
    padding: 1rem;
  }
  .header-container {
    gap: 0.75rem;
    padding-inline: 1rem;
  }
  .brand-group,
  .user-profile {
    min-width: 0;
  }
  .brand-title {
    font-size: clamp(1rem, 5vw, 1.25rem);
  }
  .nav-tabs {
    width: 100%;
    flex-wrap: wrap;
  }
  .nav-tab-btn {
    flex: 1 1 auto;
    min-width: 0;
    padding-inline: 0.7rem;
  }
}

/* =========================================================================
   ДОПОЛНИТЕЛЬНЫЕ СТИЛИ: КАЛЬКУЛЯТОР, ПИКТОГРАММЫ, 10 ТИПОВ ЗАДАНИЙ, ПЕЧАТЬ PDF
   ========================================================================= */

/* Защита изображений от Google Lens и перетаскивания */
.task-img-protected {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.task-image-box {
  margin: 1rem 0;
  display: flex;
  position: relative;
}
.task-image-box.align-left { justify-content: flex-start; }
.task-image-box.align-center { justify-content: center; }
.task-image-box.align-right { justify-content: flex-end; }
.task-image-box img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  max-width: 100%;
  object-fit: contain;
}
.task-image-box.size-200 img { max-width: 200px; }
.task-image-box.size-450 img { max-width: 450px; }
.task-image-box.size-100 img { width: 100%; max-width: 100%; }

/* Анимированные правила и пиктограммы под запретом */
.warning-rules-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}
.rule-card {
  background: #FFF5F5;
  border: 1.5px solid #FECACA;
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.rule-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  animation: gentle-wobble 2.5s infinite ease-in-out;
}
@keyframes gentle-wobble {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-4px) rotate(-4deg); }
  75% { transform: translateY(-4px) rotate(4deg); }
}
.rule-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #991B1B;
  margin-bottom: 0.2rem;
}
.rule-desc {
  font-size: 0.8rem;
  color: #7F1D1D;
  line-height: 1.3;
}

/* Кнопка и всплывающее окно калькулятора */
.calc-btn-header {
  background: #F1F5F9;
  border: 1px solid var(--border);
  color: var(--text-main);
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.15s ease;
}
.calc-btn-header:hover {
  background: #E2E8F0;
  border-color: #CBD5E1;
}
.calc-popup-card {
  position: fixed;
  top: 75px;
  right: 25px;
  width: 290px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  z-index: 9999;
  padding: 1rem;
  display: none;
}
.calc-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}
.calc-popup-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}
.calc-close-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
}
.calc-screen {
  width: 100%;
  height: 48px;
  background: #0F172A;
  color: #38BDF8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.35rem;
  text-align: right;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  border: none;
  overflow-x: auto;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}
.calc-key {
  height: 42px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #0F172A;
  cursor: pointer;
  transition: all 0.1s;
}
.calc-key:hover { background: #E2E8F0; }
.calc-key:active { transform: scale(0.96); }
.calc-key.op { background: #EEF2FF; color: #4F46E5; }
.calc-key.equal { background: #4F46E5; color: #fff; }
.calc-key.clear { background: #FEF2F2; color: #EF4444; }

/* 10 типов заданий: UI элементы */
/* Упорядочивание (Ordering) */
.ordering-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.ordering-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  gap: 0.75rem;
}
.ordering-index {
  font-weight: 800;
  color: var(--primary);
  width: 28px;
}
.ordering-text {
  flex: 1;
  font-size: 0.95rem;
}
.ordering-btns {
  display: flex;
  gap: 0.35rem;
}
.ordering-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F1F5F9;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
}
.ordering-btn:hover:not(:disabled) {
  background: var(--primary-light);
  color: var(--primary);
}
.ordering-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Сопоставление (Matching) */
.matching-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.65rem;
}
.matching-row td {
  padding: 0.6rem 0.75rem;
  background: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.matching-row td:first-child {
  border-left: 1px solid var(--border);
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
  font-weight: 600;
  width: 45%;
}
.matching-row td:last-child {
  border-right: 1px solid var(--border);
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

/* Выпадающий список в тексте */
.inline-select {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-focus);
  background: #fff;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.95rem;
  margin: 0 0.35rem;
}

/* Распределение по 2 категориям */
.classification-item {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.classification-text {
  font-weight: 600;
}
.classification-buttons {
  display: flex;
  gap: 0.5rem;
}
.class-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #F8FAFC;
  cursor: pointer;
}
.class-btn:hover {
  background: #E2E8F0;
}
.class-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Верно / Неверно */
.tf-group {
  display: flex;
  gap: 1rem;
}
.tf-option {
  flex: 1;
  padding: 0.85rem;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: #fff;
  transition: all 0.15s ease;
}
.tf-option:hover {
  border-color: #94A3B8;
}
.tf-option.selected-true {
  border-color: #10B981;
  background: #ECFDF5;
  color: #065F46;
}
.tf-option.selected-false {
  border-color: #EF4444;
  background: #FEF2F2;
  color: #991B1B;
}

/* Бланк для печати в PDF */
.print-sheet {
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius-md);
}
.print-task-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  page-break-inside: avoid;
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .header-bar, .exam-header, .no-print, button, .modal-header button, .nav-tabs, #btn-calc {
    display: none !important;
  }
  .modal-backdrop {
    position: static !important;
    background: transparent !important;
  }
  .modal-dialog {
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    margin: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
  .print-task-card {
    border: 1px solid #999 !important;
  }
}


/* ========================================================================= */
/* MODERN INTERACTIVE TASK COMPONENTS (Drag-and-Drop, Curved Matching, etc) */
/* ========================================================================= */

/* 1. Drag-and-Drop Ordering */
.ordering-item {
  cursor: grab;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  position: relative;
}
.ordering-item:active {
  cursor: grabbing;
}
.ordering-item.dragging {
  opacity: 0.45;
  transform: scale(0.98);
}
.ordering-item.drag-over {
  border-top: 3px solid var(--primary, #3b82f6) !important;
  transform: translateY(-2px);
}
.ordering-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  color: var(--text-muted, #94a3b8);
  cursor: grab;
}
.ordering-drag-handle:hover {
  color: var(--primary, #3b82f6);
}

/* 2. Visual Matching with Smooth Curved Lines */
.matching-interactive-wrap {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 80px;
  padding: 12px 6px;
  user-select: none;
  width: 100%;
}
.matching-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}
.matching-svg path {
  pointer-events: stroke;
  cursor: pointer;
  transition: stroke-width 0.15s ease;
}
.matching-svg path:hover {
  stroke-width: 5.5px !important;
}
.matching-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 44%;
  z-index: 3;
}
.matching-card {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface, #ffffff);
  border-radius: 14px;
  box-shadow: var(--shadow-soft, 0 3px 10px rgba(0,0,0,0.06));
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-height: 48px;
}
.matching-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover, 0 5px 15px rgba(0,0,0,0.09));
}
.matching-card.selected-node {
  border-color: var(--primary, #3b82f6) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
  transform: scale(1.02);
}
.matching-card.is-connected {
  border-color: rgba(59, 130, 246, 0.4);
}
.matching-card-left {
  justify-content: space-between;
}
.matching-card-right {
  justify-content: flex-start;
  gap: 12px;
}
.matching-pin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface, #ffffff);
  border: 3px solid var(--primary, #3b82f6);
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.matching-card:hover .matching-pin,
.matching-card.selected-node .matching-pin {
  transform: scale(1.3);
  background: var(--primary, #3b82f6);
}
.matching-card-left .matching-pin {
  margin-left: 10px;
}
.matching-card-right .matching-pin {
  margin-right: 10px;
}
.matching-text {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text, #1e293b);
  word-break: break-word;
}
.matching-clear-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  border: 0;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 3. Drag-and-Drop Categorization */
.categorize-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
  user-select: none;
}
.categorize-buckets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.categorize-bucket {
  background: var(--surface, #ffffff);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-soft, 0 3px 10px rgba(0,0,0,0.06));
  border: 2px dashed rgba(148, 163, 184, 0.4);
  transition: all 0.2s ease;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}
.categorize-bucket.drag-over {
  border-color: var(--primary, #3b82f6);
  background: rgba(59, 130, 246, 0.04);
  transform: scale(1.01);
}
.categorize-bucket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.categorize-bucket-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--primary-dark, #2563eb);
}
.categorize-bucket-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary, #3b82f6);
}
.categorize-bucket-dropzone {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  align-content: flex-start;
  min-height: 70px;
}
.categorize-card {
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--surface, #ffffff);
  box-shadow: var(--shadow-soft, 0 2px 6px rgba(0,0,0,0.08));
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: grab;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.categorize-card:active {
  cursor: grabbing;
}
.categorize-card.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}
.categorize-card.selected-for-move {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
.categorize-card .categorize-remove-btn {
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.categorize-card .categorize-remove-btn:hover {
  color: #ef4444;
}
.categorize-deck {
  background: rgba(148, 163, 184, 0.08);
  border-radius: 16px;
  padding: 14px;
  border: 1.5px dashed rgba(148, 163, 184, 0.35);
}
.categorize-deck-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  margin-bottom: 10px;
}
.categorize-deck-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 48px;
}

/* 4. Odd One Out (Исключение лишнего) */
.odd-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  user-select: none;
}
.odd-card {
  padding: 16px;
  border-radius: 14px;
  background: var(--surface, #ffffff);
  box-shadow: var(--shadow-soft, 0 3px 10px rgba(0,0,0,0.06));
  border: 2px solid transparent;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}
.odd-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover, 0 6px 16px rgba(0,0,0,0.1));
}
.odd-card.is-selected {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.06);
  color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}
.odd-card-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #ef4444;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 5. Word Bank Cloze (Вставка из банка слов) */
.cloze-passage-wrap {
  line-height: 2.2;
  font-size: 1.02rem;
  color: var(--text, #1e293b);
  margin-bottom: 16px;
}
.cloze-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  height: 36px;
  padding: 2px 12px;
  margin: 0 4px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  border: 2px dashed rgba(148, 163, 184, 0.5);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--primary, #3b82f6);
  vertical-align: middle;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.cloze-slot.drag-over {
  border-color: var(--primary, #3b82f6);
  background: rgba(59, 130, 246, 0.15);
  transform: scale(1.05);
}
.cloze-slot.filled {
  border-style: solid;
  border-color: var(--primary, #3b82f6);
  background: var(--surface, #ffffff);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.cloze-bank-wrap {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px dashed rgba(148, 163, 184, 0.35);
}
.cloze-bank-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  margin-bottom: 8px;
}
.cloze-bank-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cloze-chip {
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--surface, #ffffff);
  box-shadow: var(--shadow-soft, 0 2px 6px rgba(0,0,0,0.08));
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text, #1e293b);
  cursor: grab;
  transition: all 0.15s ease;
  user-select: none;
}
.cloze-chip:active {
  cursor: grabbing;
}
.cloze-chip.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}
.cloze-chip.selected-chip {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
.cloze-chip.used {
  opacity: 0.35;
  pointer-events: none;
}

/* 6. Boolean Matrix (Таблица соответствий) */
.matrix-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  box-shadow: var(--shadow-soft, 0 3px 10px rgba(0,0,0,0.06));
  background: var(--surface, #ffffff);
}
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.matrix-table th {
  padding: 12px 14px;
  background: rgba(148, 163, 184, 0.08);
  font-weight: 700;
  color: var(--text-muted, #64748b);
  text-align: center;
  border-bottom: 1.5px solid rgba(148, 163, 184, 0.2);
}
.matrix-table th:first-child {
  text-align: left;
  width: 55%;
}
.matrix-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: center;
}
.matrix-table td:first-child {
  text-align: left;
  font-weight: 600;
}
.matrix-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.4);
  background: var(--surface, #ffffff);
  cursor: pointer;
  transition: all 0.15s ease;
  color: transparent;
}
.matrix-pill:hover {
  border-color: var(--primary, #3b82f6);
  transform: scale(1.1);
}
.matrix-pill.selected {
  border-color: var(--primary, #3b82f6);
  background: var(--primary, #3b82f6);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* 7. Hotspot (Метки на схеме) */
.hotspot-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.hotspot-image-container {
  position: relative;
  max-width: 100%;
  display: inline-block;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-soft, 0 3px 10px rgba(0,0,0,0.08));
}
.hotspot-image-container img {
  display: block;
  max-width: 100%;
  height: auto;
}
.hotspot-pins-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  width: 100%;
}
.hotspot-pin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 14px;
  background: var(--surface, #ffffff);
  box-shadow: var(--shadow-soft, 0 3px 8px rgba(0,0,0,0.08));
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text, #1e293b);
}
.hotspot-pin-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary, #3b82f6);
}
.hotspot-pin-btn.selected {
  border-color: var(--primary, #3b82f6) !important;
  background: rgba(59, 130, 246, 0.08);
  color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}
.hotspot-pin-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary, #3b82f6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

/* 8. Highlight Words in Text */
.highlight-words-passage {
  line-height: 2.3;
  font-size: 1.05rem;
  color: var(--text, #1e293b);
  padding: 16px;
  background: var(--surface, #ffffff);
  border-radius: 14px;
  box-shadow: var(--shadow-soft, 0 3px 10px rgba(0,0,0,0.06));
}
.highlight-token {
  display: inline-block;
  padding: 2px 7px;
  margin: 0 2px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.highlight-token:hover {
  background: rgba(59, 130, 246, 0.12);
}
.highlight-token.is-highlighted {
  background: #fde047 !important;
  color: #854d0e !important;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(234, 179, 8, 0.35);
  transform: scale(1.05);
}
[data-theme="dark"] .highlight-token.is-highlighted {
  background: #ca8a04 !important;
  color: #fef08a !important;
}


/* ==========================================================================
   INTERACTIVE TASK ENHANCEMENTS V2 (Ghost Ordering, Segmented Matrix, Hotspot, Marker)
   ========================================================================== */

/* 1. Ghost Drop Placeholder for Ordering (Пустая тень) */
.ordering-placeholder {
  height: 52px;
  border: 2px dashed #3b82f6 !important;
  background: rgba(59, 130, 246, 0.07) !important;
  border-radius: 14px !important;
  margin-bottom: 0.65rem !important;
  box-shadow: inset 0 2px 6px rgba(59, 130, 246, 0.12) !important;
  transition: all 0.15s ease-out;
  pointer-events: none;
}
.ordering-item.dragging {
  opacity: 0.35 !important;
  transform: scale(0.98);
}

/* 2. Responsive Segmented Quiz Matrix (Без горизонтального скролла) */
.matrix-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
  width: 100%;
}
.matrix-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  background: var(--surface, #ffffff);
  border-radius: 14px;
  box-shadow: var(--shadow-soft, 0 2px 8px rgba(0,0,0,0.05));
  border: 1px solid var(--border, rgba(0,0,0,0.06));
  flex-wrap: wrap;
}
.matrix-stmt-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main, #1e293b);
  flex: 1;
  min-width: 220px;
}
.matrix-pills-group {
  display: inline-flex;
  gap: 0.45rem;
  background: var(--bg, #f1f5f9);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(0,0,0,0.08));
}
.matrix-pill-btn {
  border: none;
  background: transparent;
  padding: 7px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.matrix-pill-btn:hover {
  color: var(--text-main, #1e293b);
  background: rgba(255,255,255,0.6);
}
.matrix-pill-btn.active {
  background: #3b82f6 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}
.matrix-pill-btn.active.is-true {
  background: #10b981 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}
.matrix-pill-btn.active.is-false {
  background: #ef4444 !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

/* 3. Graphical Interactive Hotspot (Клик по схеме) */
.hotspot-canvas-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-soft, 0 3px 12px rgba(0,0,0,0.08));
  user-select: none;
  cursor: crosshair;
  background: #000000;
}
.hotspot-img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  pointer-events: auto;
}
.hotspot-student-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  width: 32px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
  pointer-events: none;
  z-index: 10;
  animation: hotspotPinBounce 0.25s ease-out;
}
@keyframes hotspotPinBounce {
  0% { transform: translate(-50%, -140%) scale(0.6); opacity: 0; }
  100% { transform: translate(-50%, -100%) scale(1); opacity: 1; }
}
.hotspot-target-preview {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px dashed #10b981;
  background: rgba(16, 185, 129, 0.2);
  pointer-events: none;
  z-index: 5;
}

/* 4. Text Highlighter Tool (Маркер) */
.highlight-toolbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  padding: 6px 12px;
  background: var(--surface, #ffffff);
  border-radius: 10px;
  border: 1px solid var(--border, rgba(0,0,0,0.06));
}
.highlight-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 6px 14px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  background: #fef08a;
  color: #854d0e;
  transition: all 0.15s ease;
}
.highlight-tool-btn:hover {
  background: #fde047;
}
.highlight-tool-btn.active {
  border-color: #ca8a04;
  box-shadow: 0 0 0 2px rgba(202, 138, 4, 0.25);
}
.highlight-token {
  display: inline-block;
  padding: 3px 6px;
  margin: 2px 1px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1.7;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}
.highlight-token:hover {
  background: rgba(254, 240, 138, 0.45);
}
.highlight-token.is-highlighted {
  background: #fef08a !important;
  color: #854d0e !important;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(234, 179, 8, 0.25);
}
.highlight-token.teacher-key {
  background: #bbf7d0 !important;
  color: #166534 !important;
  font-weight: 700;
}

.matching-pin.is-connected {
  background: var(--primary, #3b82f6) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
}
