/* ——— Современный пульт преподавателя и монитор с закреплённой строкой сумм / эталонных ответов ——— */

.app-header--compact {
  margin-bottom: 12px;
  padding-top: 11px;
  padding-bottom: 11px;
}
.btn-logout-compact {
  width: auto !important;
  height: 36px;
  margin: 0 !important;
  padding: 0 13px !important;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 9px;
  background: #FFFFFF !important;
  color: #173B7B !important;
  border: 1px solid #C5D6EE !important;
}
.btn-logout-compact:hover {
  background: #F1F6FF !important;
  border-color: #93C5FD !important;
}
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #E2E8F0;
  color: #334155;
  vertical-align: middle;
}
.role-badge.is-elevated {
  background: #DBEAFE;
  color: #1D4ED8;
}

.teacher-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Однострочный командный пульт (Command Bar) */
.teacher-cmd-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1px solid #D5E0F0;
  border-radius: 14px;
  padding: 7px 10px;
  box-shadow: var(--shadow-xs);
  position: relative;
  z-index: 22;
}
.cmd-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.cmd-group--tools {
  margin-left: auto;
}
.cmd-spacer {
  display: none;
}
.cmd-divider {
  width: 1px;
  height: 26px;
  background: #E2E8F0;
  margin: 0 2px;
}
@media (max-width: 1080px) {
  .cmd-divider,
  .cmd-spacer {
    display: none;
  }
}

.cmd-select {
  width: auto !important;
  height: 36px;
  margin: 0 !important;
  padding: 0 10px !important;
  border-radius: 9px;
  border: 1.5px solid #CBD8EE;
  background: #F8FAFC;
  color: #173B7B;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
.cmd-select:focus {
  outline: none;
  border-color: #1564D9;
  background: #FFFFFF;
}
.cmd-select--class {
  min-width: 98px;
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}
.cmd-select--lesson {
  min-width: 135px;
  max-width: 155px;
}

.cmd-btn {
  width: auto !important;
  height: 36px;
  margin: 0 !important;
  padding: 0 11px !important;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.cmd-btn--primary {
  background: #1564D9;
  color: #FFFFFF;
}
.cmd-btn--primary:hover {
  background: #104FAE;
}
.cmd-btn--accent {
  background: #0369A1;
  color: #FFFFFF;
}
.cmd-btn--accent:hover {
  background: #075985;
}
.cmd-btn--ghost {
  background: #F1F5F9;
  color: #173B7B;
  border: 1px solid #D5E1F2;
}
.cmd-btn--ghost:hover,
.cmd-btn--ghost.is-open {
  background: #E2EEFF;
  border-color: #93C5FD;
}
.cmd-btn--danger-soft {
  background: #FFF1F2;
  color: #BE123C;
  border-color: #FECDD3;
}
.cmd-btn--danger-soft:hover,
.cmd-btn--danger-soft.is-open {
  background: #FFE4E6;
  border-color: #FDA4AF;
}
.cmd-btn--icon {
  width: 36px !important;
  padding: 0 !important;
  background: #F1F5F9;
  color: #173B7B;
  border: 1px solid #D5E1F2;
  font-size: 1rem;
}
.cmd-btn--icon:hover {
  background: #E2EEFF;
  border-color: #93C5FD;
}

.cmd-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  background: #DBEAFE;
  color: #1D4ED8;
}
.cmd-caret {
  font-size: 0.72rem;
  opacity: 0.75;
}

.cmd-phase-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #F1F5F9;
  color: #475569;
  white-space: nowrap;
}
.cmd-phase-pill.phase-welcome {
  background: #FEF3C7;
  color: #92400E;
}
.cmd-phase-pill.phase-slide {
  background: #E0E7FF;
  color: #3730A3;
}
.cmd-phase-pill.phase-tasks {
  background: #DCFCE7;
  color: #15803D;
}
.cmd-phase-pill.phase-final {
  background: #FCE7F3;
  color: #9D174D;
}

/* Компактный сегментированный степпер слайдов и лимита задач */
.cmd-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.cmd-stepper .cmd-btn--ghost {
  border-radius: 0;
  border-left: none;
  border-right: none;
  height: 36px;
  background: #F8FAFC;
}
.cmd-stepper .cmd-btn--ghost:hover,
.cmd-stepper .cmd-btn--ghost.is-open {
  background: #E2EEFF;
}
.cmd-step-btn {
  width: 32px !important;
  height: 36px;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #D5E1F2;
  background: #F1F5F9;
  color: #173B7B;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}
.cmd-step-btn:first-child {
  border-radius: 9px 0 0 9px;
}
.cmd-step-btn:last-child {
  border-radius: 0 9px 9px 0;
}
.cmd-step-btn:hover {
  background: #DCE9FC;
  border-color: #93C5FD;
}
.cmd-limit-input {
  width: 44px !important;
  height: 36px;
  margin: 0 !important;
  padding: 0 2px !important;
  border: 1px solid #D5E1F2 !important;
  border-left: none !important;
  border-right: none !important;
  border-radius: 0 !important;
  background: #FFFFFF;
  color: #173B7B;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  -moz-appearance: textfield;
}
.cmd-limit-input::-webkit-outer-spin-button,
.cmd-limit-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Выпадающие поповеры пульта (Слайды, Эфир VK Видео, Завершение) */
.cmd-pop-anchor {
  position: relative;
}
.cmd-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(390px, calc(100vw - 32px));
  background: #FFFFFF;
  border: 1px solid #CBD8EE;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  z-index: 35;
}
.cmd-popover--right {
  left: auto;
  right: 0;
}
.cmd-popover--slides {
  width: min(440px, calc(100vw - 32px));
}
.cmd-popover--stream {
  width: min(380px, calc(100vw - 32px));
}
.cmd-popover--menu {
  width: min(330px, calc(100vw - 32px));
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cmd-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: #173B7B;
  font-size: 0.92rem;
}
.cmd-menu-item {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100% !important;
  margin: 0 !important;
  padding: 9px 12px !important;
  border-radius: 10px;
  background: transparent;
  color: #1E293B;
  font-size: 0.87rem;
  font-weight: 700;
  text-align: left;
  white-space: normal !important;
}
.cmd-menu-item-title {
  font-size: 0.87rem;
  font-weight: 700;
  line-height: 1.25;
}
.cmd-menu-item-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: #475569;
  line-height: 1.3;
}
.cmd-menu-item:hover {
  background: #F1F5F9;
}
.cmd-menu-item.is-results:hover {
  background: #EFF6FF;
}
.cmd-menu-item.is-results .cmd-menu-item-title {
  color: #173B7B;
}
.cmd-menu-sep {
  height: 1px;
  background: #E2E8F0;
  margin: 3px 6px;
}
.cmd-menu-item.is-danger,
.cmd-menu-item.is-danger .cmd-menu-item-title {
  color: #DC2626;
  font-weight: 700;
}
.cmd-menu-item.is-danger .cmd-menu-item-sub {
  color: #B91C1C;
  opacity: 0.82;
}
.cmd-menu-item.is-danger:hover {
  background: #FEF2F2;
}

/* Компактное уведомление учителя (не занимает высоту в покое) */
.teacher-toast {
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  border: 1px solid #FECACA;
  background: #FEF2F2;
  color: #B91C1C;
}
.teacher-toast.is-ok {
  border-color: #BBF7D0;
  background: #F0FDF4;
  color: #15803D;
}

/* Плашка параллельных уроков коллег с кнопкой 1-клик перевода */
.parallel-bar-label {
  font-weight: 700;
  font-size: 0.82rem;
  color: #35558A;
}
.parallel-session-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  background: #FFFFFF;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #BFDBFE;
  font-size: 0.82rem;
}
.parallel-cls-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #DBEAFE;
  color: #1D4ED8;
  font-size: 0.72rem;
  font-weight: 800;
}
.parallel-transfer-btn {
  width: auto !important;
  margin: 0 !important;
  padding: 2px 8px !important;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #EFF6FF;
  color: #0369A1;
  border: 1px solid #93C5FD;
}
.parallel-transfer-btn:hover {
  background: #0369A1;
  color: #FFFFFF;
}

.transfer-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 100%);
  border: 1.5px solid #93C5FD;
}
.transfer-box--idle {
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
}

/* Блок режима докладчика при открытых слайдах: Предыдущий | Сейчас у класса | Следующий */
.monitor-panel, .teacher-slide-panel { width: 100%; }
.slide-hotkey-hint {
  font-size: 0.76rem;
  color: #475569;
  background: #F1F5F9;
  padding: 2px 8px;
  border-radius: 999px;
}
.teacher-slide-presenter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-top: 4px;
}
.slide-deck-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100% !important;
  margin: 0 !important;
  padding: 8px 10px !important;
  border-radius: 12px;
  background: #F8FAFC;
  border: 1.5px solid #DCE6F5;
  color: #173B7B;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease, background 0.15s ease;
}
.slide-deck-card--adj {
  cursor: pointer;
}
.slide-deck-card--adj:hover:not(:disabled) {
  background: #EFF6FF;
  border-color: #38BDF8;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.12);
  transform: translateY(-1px);
}
.slide-deck-card--adj:disabled,
.slide-deck-card--adj.is-empty {
  opacity: 0.65;
  cursor: default;
  background: #F8FAFC;
  border-style: dashed;
}
.slide-deck-card--live {
  background: #F4F9FF;
  border: 2px solid #1564D9;
}
.slide-deck-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
  margin-bottom: 6px;
}
.slide-deck-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0369A1;
  white-space: nowrap;
}
.slide-deck-card--adj:disabled .slide-deck-kicker {
  color: #526580;
}
.slide-deck-meta {
  font-size: 0.76rem;
  font-weight: 600;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.slide-deck-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}
.slide-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16A34A;
}
.slide-deck-frame {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  overflow: hidden;
  padding: 4px;
}
.slide-deck-frame--adj {
  height: min(21vh, 185px);
  max-height: min(21vh, 185px);
}
.slide-deck-frame--live {
  height: min(26vh, 230px);
  max-height: min(26vh, 230px);
}
.slide-deck-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.slide-deck-empty {
  font-size: 0.8rem;
  font-weight: 600;
  color: #526580;
  text-align: center;
  padding: 0 10px;
}
@media (max-width: 860px) {
  .teacher-slide-presenter {
    grid-template-columns: 1fr 1fr;
  }
  .slide-deck-card--live {
    grid-column: 1 / -1;
    order: -1;
  }
  .slide-hotkey-hint {
    display: none;
  }
}

.panel {
  background: #FFFFFF;
  border: 1px solid #D5E0F0;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}
.panel h3 { margin: 0 0 10px; font-size: 1rem; color: #173B7B; }

/* ——— Монитор решений (максимум высоты экрана + 2-я закреплённая sticky-строка сумм и эталонных ответов) ——— */
.monitor-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.monitor-panel-head h3 { margin: 0; }
.monitor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.monitor-toolbar input[type="text"] {
  width: 230px;
  margin: 0;
  padding: 7px 11px;
  font-size: 0.88rem;
}
.monitor-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #46618B;
}
.monitor-pager .btn-row button {
  min-width: 70px;
  padding: 6px 12px;
  margin: 0;
}

.monitor-wrap {
  overflow: auto;
  width: 100%;
  max-height: calc(100dvh - 195px);
  border-radius: 10px;
  border: 1px solid #DCE6F5;
  background: #FFFFFF;
}
.mon-empty-placeholder {
  padding: 28px 20px;
  text-align: center;
  color: #475569;
  font-size: 0.94rem;
}
.mon-empty-td {
  padding: 18px !important;
  text-align: center;
  color: #475569;
  background: #FBFDFF;
}

table.monitor {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 0.85rem;
}
table.monitor th, table.monitor td {
  border-right: 1px solid #E2E8F0;
  border-bottom: 1px solid #E2E8F0;
  padding: 5px 8px;
  vertical-align: middle;
  white-space: nowrap;
}
table.monitor tbody tr.mon-student-row td {
  height: 33px;
  max-height: 33px;
}

/* 1-я строка шапки: Названия колонок */
table.monitor thead tr.mon-head-row th {
  position: sticky;
  top: 0;
  height: 34px;
  z-index: 4;
  background: #EEF4FF;
  color: #173B7B;
  font-weight: 800;
  vertical-align: middle;
  white-space: nowrap;
}

/* 2-я строка шапки (закреплённая!): Суммы решённых + правильные ответы */
table.monitor thead tr.mon-summary-row th {
  position: sticky;
  top: 34px;
  height: 32px;
  z-index: 4;
  background: #F8FAFC;
  border-bottom: 2px solid #93C5FD;
  vertical-align: middle;
  padding-top: 4px;
  padding-bottom: 4px;
}

/* Закреплённые слева колонки Ученик и Баллы (фиксированная ширина для точной однострочной обрезки) */
table.monitor th.mon-name, table.monitor td.mon-name {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #FFFFFF;
  width: 205px;
  min-width: 205px;
  max-width: 205px;
  overflow: hidden;
  box-shadow: 2px 0 0 #CBD8EE;
}
table.monitor thead tr.mon-head-row th.mon-name {
  background: #E2EEFF;
  z-index: 7;
}
table.monitor thead tr.mon-summary-row th.mon-name.mon-sum-sticky {
  background: #EFF6FF;
  z-index: 7;
}

.mon-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 0;
  min-width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.mon-name-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.monitor th.mon-pts, table.monitor td.mon-pts {
  width: 38px;
  min-width: 38px;
  max-width: 42px;
  padding: 4px 2px;
  text-align: center;
  font-weight: 700;
  background: #F4F8FF;
  color: #173B7B;
  white-space: nowrap;
}
table.monitor th.mon-pts-total, table.monitor td.mon-pts-total {
  position: sticky;
  left: 205px;
  z-index: 2;
  width: 54px;
  min-width: 54px;
  max-width: 54px;
  padding: 4px 4px;
  text-align: center;
  font-weight: 800;
  box-shadow: 2px 0 0 #CBD8EE;
  background: #D6E6FF;
}
table.monitor thead tr.mon-head-row th.mon-pts-total {
  z-index: 7;
  background: #C5D8F7;
}
table.monitor thead tr.mon-summary-row th.mon-pts-total.mon-sum-sticky {
  z-index: 7;
  background: #DBEAFE;
  color: #1E40AF;
  font-size: 0.78rem;
}

.mon-sum-name-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.mon-sum-caption {
  font-size: 0.74rem;
  font-weight: 800;
  color: #35558A;
  white-space: nowrap;
}
.mon-eye-btn {
  width: auto !important;
  margin: 0 !important;
  padding: 2px 7px !important;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #FFFFFF;
  color: #173B7B;
  border: 1px solid #BFDBFE;
  white-space: nowrap;
}
.mon-eye-btn:hover {
  background: #DBEAFE;
}
.mon-eye-btn.is-masked {
  background: #FEF3C7;
  color: #92400E;
  border-color: #FCD34D;
}

table.monitor thead tr.mon-summary-row th.mon-sum-solved {
  font-size: 0.84rem;
  font-weight: 800;
  color: #475569;
  background: #F1F5F9;
}
table.monitor thead tr.mon-summary-row th.mon-sum-solved.has-solved {
  background: #DCFCE7;
  color: #15803D;
}

table.monitor th.mon-task-th,
table.monitor th.mon-sum-answer {
  cursor: pointer;
}
table.monitor th.mon-task-th:hover,
table.monitor th.mon-sum-answer:hover {
  background: #E0F2FE !important;
}
.mon-th-zoom {
  font-size: 0.7rem;
  opacity: 0.55;
}
.mon-sum-ans-line {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 0;
  min-width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.mon-ans-right {
  font-size: 0.8rem;
  font-weight: 800;
  color: #0F6E43;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mon-ans-photo-tag {
  flex: 0 0 auto;
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #FEF3C7;
  color: #92400E;
  white-space: nowrap;
}
.mon-ans-masked {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: #526580;
  font-weight: 800;
}
.mon-cls-pill {
  flex: 0 0 auto;
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #F1F5F9;
  color: #475569;
  white-space: nowrap;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.monitor th.mon-ans, table.monitor td.mon-cell {
  width: 145px;
  min-width: 120px;
  max-width: 165px;
  overflow: hidden;
}
table.monitor td.mon-cell { cursor: pointer; }
table.monitor td.mon-cell:hover { outline: 2px solid #1564D9; outline-offset: -2px; }
.c-green { background: #bbf7d0 !important; }
.c-yellow { background: #fef08a !important; }
.c-red { background: #fecaca !important; }
.c-white { background: #fff; }
.mon-cell-row {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 0;
  min-width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.cell-answers {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mon-avatar {
  flex: 0 0 auto;
  font-size: 0.96rem;
  line-height: 1;
}
.mon-pending-lbl {
  font-size: 0.75rem;
  color: #92400E;
  font-weight: 600;
}
table.monitor th.mon-fb-th,
table.monitor th.mon-fb,
table.monitor td.mon-fb,
.mon-fb,
.mon-fb-th {
  width: 28px;
  min-width: 28px;
  max-width: 32px;
  padding: 4px 2px;
  white-space: nowrap;
  text-align: center;
  font-size: 0.8rem;
}
.mon-sum-fb { font-weight: 800; color: #334155; }
.mon-photo-ico {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  min-width: 24px;
  padding: 0 4px;
  border-radius: 5px;
  background: #EEF4FF;
  border: 1px solid #C5D8F7;
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1;
}
.mon-photo-ico:hover { background: #D6E6FF; border-color: #1564D9; }
.mon-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; white-space: nowrap; cursor: pointer;
}
.mon-toggle input { width: auto; margin: 0; }
.mon-dot {
  flex: 0 0 auto;
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin: 0; background: #94a3b8;
}
.mon-dot.is-on { background: #22c55e; }

/* Всплывающая подсказка монитора при наведении без нажатия */
.mon-hover-tip {
  position: fixed;
  z-index: 95;
  max-width: min(440px, calc(100vw - 16px));
  padding: 6px 11px;
  border-radius: 8px;
  background: #0F172A;
  color: #F8FAFC;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
  pointer-events: none;
  white-space: normal;
  word-break: break-word;
}

/* Диалог ячейки и диалог просмотра условия задачи */
.cell-dlg-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.48);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 16px;
}
.cell-dlg {
  background: #fff; border-radius: 16px; padding: 18px;
  max-width: 440px; width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.24);
}
.cell-dlg.task-preview-dlg {
  max-width: 640px;
}
.cell-dlg h3 { margin: 0 0 8px; color: #173B7B; }
.cell-dlg .cell-dlg-body { margin: 10px 0 14px; font-size: 0.9rem; word-break: break-word; }
.cell-dlg .cell-dlg-pts { display: flex; flex-wrap: wrap; gap: 8px; }
.cell-dlg .cell-dlg-pts button { width: auto; min-width: 52px; margin: 0; }
.cell-dlg .cell-dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.cell-dlg .cell-dlg-actions button { width: auto; min-width: 100px; margin: 0; }
.cell-dlg-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cell-dlg-photo {
  max-width: 100%; max-height: 220px; border-radius: 10px;
  border: 1px solid #D9E2F1; object-fit: contain; display: block;
}

.task-dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.task-dlg-head h3 { margin: 0; }
.task-dlg-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.task-dlg-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #EFF6FF;
  color: #1D4ED8;
}
.task-dlg-badge.is-photo {
  background: #FEF3C7;
  color: #92400E;
}
.task-dlg-cond-text {
  padding: 12px 14px;
  border-radius: 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #173B7B;
  font-size: 0.96rem;
  line-height: 1.48;
  white-space: pre-wrap;
  margin-bottom: 10px;
}
.task-dlg-img-wrap {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  margin-bottom: 10px;
}
.task-dlg-img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.task-dlg-hint {
  padding: 10px 12px;
  border-radius: 10px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #78350F;
  font-size: 0.86rem;
  line-height: 1.42;
  margin-bottom: 10px;
}
.task-dlg-answer {
  padding: 10px 14px;
  border-radius: 10px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #0F6E43;
  font-size: 0.94rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.task-dlg-answer.is-masked {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #475569;
}
