/* ——— Экран урока ученика (заставка, слайды, задачи, фото, зум) ——— */
.splash-wrap, .slide-wrap, .task-img-wrap {
  position: relative;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 220px;
  height: min(60vh, 480px);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 12px 0;
}
.splash-wrap img, .slide-wrap img, .task-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
#slide-img, #task-img {
  cursor: zoom-in;
}
.img-zoom-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  line-height: 1;
  background: rgba(15, 23, 42, 0.62);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
  z-index: 4;
  transition: background 0.15s ease, transform 0.15s ease;
}
.img-zoom-badge:hover {
  background: rgba(15, 23, 42, 0.84);
  transform: scale(1.05);
}

/* Полноэкранный лайтбокс увеличения задачи / слайда */
.img-zoom-backdrop {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(15, 23, 42, 0.92);
  display: flex;
  flex-direction: column;
}
.img-zoom-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  color: #f8fafc;
}
.img-zoom-title {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.img-zoom-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.img-zoom-btn {
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 6px 12px !important;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.img-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}
.img-zoom-btn--close {
  background: #dc2626;
  border-color: #ef4444;
}
.img-zoom-btn--close:hover {
  background: #b91c1c;
}
.img-zoom-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  -webkit-overflow-scrolling: touch;
}
.img-zoom-stage img {
  width: min(96vw, 84vh);
  max-width: 100%;
  max-height: 84vh;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: #ffffff;
  padding: 6px;
  transition: width 0.16s ease;
}
.img-zoom-stage.is-zoomed {
  align-items: flex-start;
  justify-content: flex-start;
}
.img-zoom-stage.is-zoomed img {
  max-width: none;
  max-height: none;
  width: min(1400px, 195vw);
}

#screen-student {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding-bottom: 12px;
}
#screen-student .app-header { flex: 0 0 auto; }
#student-final { flex: 1; min-height: 0; overflow: auto; }
#student-welcome {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 0;
}
#student-welcome.hidden { display: none; }
#student-welcome .welcome-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
#student-welcome .welcome-fit {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  line-height: 0;
}
#student-welcome .welcome-fit > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  border-radius: 0;
}
#student-welcome .welcome-fit > img.hidden { display: none; }
#student-welcome #welcome-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 600;
  padding: 16px;
  text-align: center;
}
#student-welcome #welcome-placeholder.hidden { display: none; }
#student-slide {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
#student-slide.hidden { display: none; }
#student-slide #slide-title {
  flex: 0 0 auto;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink-brand);
  line-height: 1.25;
}
#student-slide .slide-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  margin: 0;
  border-radius: 12px;
  background: #ffffff;
}
#student-slide > .app-sub {
  flex: 0 0 auto;
  margin: 0;
  font-size: 0.9rem;
}
#student-tasks.student-tasks-layout {
  display: grid;
  grid-template-columns: minmax(260px, 32%) minmax(0, 1fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin: 0;
}
.student-tasks-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  min-width: 0;
  overflow: auto;
}
.student-tasks-side .stats-bar { margin: 0; flex: 0 0 auto; }
.student-tasks-side .task-nav {
  margin: 0;
  flex: 0 0 auto;
  max-height: 72px;
  overflow: auto;
}
#task-type-hint:empty {
  display: none;
}
.student-tasks-side .phrase,
#student-tasks .phrase {
  margin: 0;
  flex: 0 0 auto;
  min-height: 2.5em;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  padding: 11px 14px;
  border-radius: 12px;
  background: #EDF4FF;
  border: 1px solid #CFE0FA;
  color: #173B7B;
}
.student-tasks-side .phrase:empty,
#student-tasks .phrase:empty { display: none; }
.student-tasks-side .phrase.is-ok,
#student-tasks .phrase.is-ok { background: #ECFDF5; border-color: #A7F3D0; color: #15803D; }
.student-tasks-side .phrase.is-pending,
#student-tasks .phrase.is-pending { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.student-tasks-side .phrase.is-bad,
#student-tasks .phrase.is-bad { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }
.student-tasks-side #hint-text,
#student-tasks #hint-text {
  margin: 0;
  flex: 0 0 auto;
  max-height: 5.5em;
  overflow: auto;
  font-size: 0.86rem;
}
.student-tasks-side #hint-text:empty,
#student-tasks #hint-text:empty { display: none; }
.points-today {
  position: relative;
  overflow: visible;
  margin: 0;
  flex: 0 0 auto;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #F0F6FF 0%, #E6F0FF 100%);
  border: 1px solid #BFDBFE;
  color: #173B7B;
  font-weight: 800;
  font-size: 1.45rem;
  text-align: center;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.points-today-label { position: relative; z-index: 1; }
.points-salute {
  position: fixed;
  left: 0;
  top: 0;
  width: min(52vh, 70vw);
  height: auto;
  max-height: 52vh;
  object-fit: contain;
  margin: 0;
  pointer-events: none;
  z-index: 80;
  transform: translate(-50%, -50%) scale(0.2);
  transform-origin: center center;
  will-change: transform, opacity;
}
.points-salute:not(.is-burst) {
  display: none;
}
.points-salute.is-burst {
  animation: salute-burst 2s ease-out forwards;
}
@keyframes salute-burst {
  0%   { opacity: 0;    transform: translate(-50%, -50%) scale(0.12); }
  10%  { opacity: 1;    transform: translate(-50%, -50%) scale(0.4); }
  40%  { opacity: 1;    transform: translate(-50%, -50%) scale(1); }
  70%  { opacity: 0.75; transform: translate(-50%, -50%) scale(1.06); }
  100% { opacity: 0;    transform: translate(-50%, -50%) scale(1.12); }
}
.student-tasks-card {
  container-type: size;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: auto;
}
.task-condition-text {
  width: 100%;
  max-width: 760px;
  background: #FFFFFF;
  border: 1px solid #D5E0F0;
  border-radius: 14px;
  padding: 14px 18px;
  color: #173B7B;
  font-size: 1.125rem;
  line-height: 1.5;
  white-space: pre-wrap;
  box-shadow: var(--shadow-xs);
}
.student-tasks-card.is-text-only .task-condition-text {
  padding: 24px 28px;
  font-size: 1.28rem;
}
.student-tasks-card.has-cond-text .task-img-wrap {
  width: 100%;
  height: auto;
  flex: 1 1 auto;
  aspect-ratio: auto;
}
.lesson-pick-btn.is-class-match {
  background: #F0FDF4;
  border-color: #34D399;
}
.lesson-pick-match-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #DCFCE7;
  color: #15803D;
  vertical-align: middle;
  margin-right: 4px;
}
.student-tasks-card .task-img-wrap {
  width: min(100cqw, 100cqh);
  height: min(100cqw, 100cqh);
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  margin: 0;
  padding: 10px;
  min-height: 0;
  border-radius: 16px;
  background: #FFFFFF;
  border: 1px solid #D5E0F0;
  box-shadow: var(--shadow-sm);
}
.student-tasks-card .task-img-wrap img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  padding: 2px;
}
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--ink-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.stats-bar b {
  color: var(--ink-brand);
  font-weight: 800;
}

.answer-shown {
  flex: 1;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--success);
  background: #f0fdf4;
  color: var(--ink);
  font-weight: 600;
  min-width: 0;
  display: flex;
  align-items: center;
}
.answer-shown.is-pending {
  background: #FFFBEB;
  border-color: #F59E0B;
  color: #92400E;
}
.answer-done-row {
  align-items: center;
  gap: 8px;
}
.answer-done-row #next-btn {
  width: auto;
  min-width: 112px;
  height: 44px;
  margin: 0;
  flex: 0 0 auto;
  align-self: center;
  background: var(--success);
}
.answer-done-row #done-attach-photo-btn:not(.hidden) {
  height: 44px;
  margin: 0;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-hint {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #F59E0B;
}
.btn-hint:hover {
  background: #FDE68A;
  color: #78350F;
}
.btn-attach-photo {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #93C5FD;
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}
.btn-attach-photo:hover:not(:disabled) {
  background: #DBEAFE;
  color: #1E40AF;
}
.task-attached-photo-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #FEFCE8;
  border: 1px solid #FDE047;
  color: #854D0E;
  font-size: 0.84rem;
  font-weight: 600;
}
.task-attached-photo-bar.is-rejected {
  background: #FEF2F2;
  border-color: #FCA5A5;
  color: #991B1B;
}
.task-attached-photo-bar.hidden { display: none; }
.attached-bar-thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #FACC15;
  background: #FFFFFF;
  display: block;
}
.task-attached-photo-bar.is-rejected .attached-bar-thumb {
  border-color: #F87171;
}
.attached-bar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.attached-bar-info {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.25;
}
.attached-bar-btn {
  width: auto !important;
  margin: 0 !important;
  padding: 6px 11px !important;
  font-size: 0.8rem;
  flex: 0 0 auto;
  white-space: nowrap;
}
.answer-shown-with-photo {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.attached-photo-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 4px;
  border-radius: 999px;
  background: #DBEAFE;
  color: #1E40AF;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  flex: 0 0 auto;
}
.attached-photo-chip:hover {
  background: #BFDBFE;
}
.attached-photo-chip.is-pending {
  background: #FEF3C7;
  color: #92400E;
}
.attached-photo-chip img,
.answer-shown .photo-preview {
  width: 26px;
  height: 26px;
  max-width: 26px;
  max-height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(30, 64, 175, 0.18);
  object-fit: cover;
  flex: 0 0 26px;
  display: block;
}
.task-nav button.has-photo {
  position: relative;
}
.task-nav button.has-photo::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563EB;
}
.hint-box:not(:empty)::before { content: '💡 '; }
.hint-box:not(:empty) {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #78350F;
  padding: 10px 12px;
  border-radius: 10px;
  line-height: 1.42;
}
.photo-preview-wrap { margin: 8px 0; }
.photo-preview {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.photo-pick-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.photo-pick-row button { width: auto; flex: 1 1 140px; margin: 0; }
.task-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.task-nav button {
  width: auto;
  min-width: 40px;
  margin: 0;
  padding: 7px 11px;
  background: #E8F0FA;
  color: #173B7B;
  border: 2px solid #D5E0F0;
  border-radius: 9px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.task-nav button:hover:not(:disabled) {
  background: #DCE8F9;
  border-color: #93B8F0;
}
.task-nav button.c-green { background: #DCFCE7; color: #14532D; border-color: #86EFAC; }
.task-nav button.c-yellow { background: #FEF9C3; color: #713F12; border-color: #FDE047; }
.task-nav button.c-red { background: #FEE2E2; color: #7F1D1D; border-color: #FCA5A5; }
.task-nav button.c-white { background: #FFFFFF; color: #173B7B; border-color: #CBD8EE; }
.task-nav button.active {
  border-color: #1564D9;
  box-shadow: 0 0 0 2px rgba(21, 100, 217, 0.16);
}
.task-nav button:disabled { opacity: 0.38; }

/* ——— Компактный и крупный мобильный режим ученика (телефоны и планшеты <= 820px) ——— */
@media (max-width: 820px) {
  #screen-student,
  #screen-student-cabinet {
    padding: 0 10px 18px;
  }
  #screen-student {
    height: auto;
    max-height: none;
    min-height: 100dvh;
    overflow: visible;
  }
  .page.has-vk-embedded > #screen-student {
    min-height: 0;
  }

  /* Компактная шапка ученика вместо громоздкой трёхэтажной */
  #screen-student > .app-header,
  #screen-student-cabinet > .app-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 5px 8px;
    margin: 0 -10px 8px;
    padding: 7px 10px;
    border-bottom-width: 3px;
  }
  #screen-student > .app-header .app-header-left,
  #screen-student-cabinet > .app-header .app-header-left {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
  }
  #screen-student > .app-header .app-title,
  #screen-student-cabinet > .app-header .app-title {
    font-size: 0.96rem;
    white-space: nowrap;
  }
  #screen-student > .app-header .app-ver,
  #screen-student-cabinet > .app-header .app-ver {
    display: none;
  }
  #screen-student > .app-header #student-greeting,
  #screen-student-cabinet > .app-header #cabinet-sub {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
  }
  #screen-student > .app-header .app-header-right,
  #screen-student-cabinet > .app-header .app-header-right {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
  }
  #screen-student > .app-header .ws-pill {
    padding: 3px 8px;
    font-size: 0.72rem;
    gap: 4px;
  }
  #screen-student > .app-header .app-nav,
  #screen-student-cabinet > .app-header .app-nav {
    padding: 2px;
    gap: 2px;
    border-radius: 8px;
  }
  #screen-student > .app-header .app-nav a,
  #screen-student-cabinet > .app-header .app-nav a {
    padding: 4px 8px;
    font-size: 0.74rem;
    border-radius: 6px;
  }
  #screen-student > .app-header .app-header-right > button,
  #screen-student-cabinet > .app-header .app-header-right > button {
    padding: 4px 9px !important;
    margin: 0 !important;
    font-size: 0.74rem;
    border-radius: 6px;
  }
  #screen-student > .app-header .app-header-center {
    order: 3;
    width: 100%;
    text-align: left;
    padding: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }
  #screen-student > .app-header .app-header-center:empty,
  #screen-student-cabinet > .app-header .app-header-center:empty {
    display: none;
  }

  /* Заставка и слайд на всю ширину экрана телефона */
  #student-welcome .welcome-stage {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 200px;
  }
  #student-slide {
    flex: 0 0 auto;
    overflow: visible;
    gap: 6px;
  }
  #student-slide .slide-wrap {
    width: 100%;
    height: auto;
    min-height: 190px;
    border-radius: 12px;
  }
  #student-slide .slide-wrap img {
    width: 100%;
    height: auto;
    max-height: 68vh;
    object-fit: contain;
  }
  #student-slide .student-slide-sub {
    font-size: 0.8rem;
  }

  /* Сетка задач на телефоне: статус + баллы в 1 компактную строку -> номера задач -> КРУПНАЯ ЗАДАЧА -> однострочный ввод ответа */
  #student-tasks.student-tasks-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: none;
    gap: 7px;
    align-items: center;
    overflow: visible;
    flex: 0 0 auto;
  }
  .student-tasks-side {
    display: contents;
  }

  #student-tasks .stats-bar {
    grid-column: 1;
    order: 1;
    margin: 0;
    padding: 0 2px;
    background: transparent;
    border: none;
    gap: 5px;
    font-size: 0.72rem;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
  }
  #student-tasks .points-today {
    grid-column: 2;
    order: 1;
    min-height: 0;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
  }

  #student-tasks .task-nav {
    grid-column: 1 / -1;
    order: 2;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 5px;
    margin: 0;
    max-height: none;
    padding: 1px 0 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #student-tasks .task-nav::-webkit-scrollbar {
    display: none;
  }
  #student-tasks .task-nav button {
    min-width: 36px;
    height: 34px;
    padding: 0 10px;
    font-size: 0.86rem;
    font-weight: 700;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Карточка условия задачи — во всю ширину телефона без сжатия по высоте */
  #student-tasks .student-tasks-card {
    grid-column: 1 / -1;
    order: 3;
    container-type: normal;
    width: 100%;
    overflow: visible;
    gap: 6px;
  }
  #student-tasks .student-tasks-card .task-img-wrap {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    aspect-ratio: auto;
    min-height: 210px;
    padding: 4px;
    border-radius: 12px;
  }
  #student-tasks .student-tasks-card .task-img-wrap img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    padding: 0;
    display: block;
  }
  #student-tasks .task-condition-text {
    padding: 12px 14px;
    font-size: 1rem;
    border-radius: 12px;
  }
  #student-tasks .student-tasks-card.is-text-only .task-condition-text {
    padding: 16px;
    font-size: 1.06rem;
  }

  /* Компактная однострочная панель ввода ответа (42px вместо 102px) */
  #student-tasks #answer-entry {
    grid-column: 1 / -1;
    order: 4;
    display: flex;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }
  #student-tasks #answer-entry #answer-input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    height: 42px;
    margin: 0;
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 10px;
  }
  #student-tasks #answer-entry .answer-actions-row {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0;
  }
  #student-tasks #answer-entry #hint-btn,
  #student-tasks #answer-entry #open-photo-modal-btn:not(.hidden) {
    min-width: 42px;
    width: auto;
    height: 42px;
    margin: 0;
    padding: 0 11px;
    border-radius: 10px;
    font-size: 0.86rem;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }
  #student-tasks #answer-entry #submit-btn {
    min-width: 96px;
    width: auto;
    height: 42px;
    margin: 0;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #student-tasks #photo-entry {
    grid-column: 1 / -1;
    order: 4;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  #student-tasks #photo-entry #photo-help {
    margin: 0;
    font-size: 0.8rem;
  }
  #student-tasks #photo-entry .photo-pick-row {
    margin: 0;
    gap: 6px;
  }
  #student-tasks #photo-entry .photo-pick-row button,
  #student-tasks #photo-entry .btn-row button {
    height: 40px;
    margin: 0;
    padding: 0 10px;
    font-size: 0.84rem;
  }
  #student-tasks #photo-entry .photo-preview-wrap {
    margin: 2px 0;
  }

  #student-tasks #answer-done {
    grid-column: 1 / -1;
    order: 4;
  }
  #student-tasks .answer-done-row {
    flex-wrap: nowrap;
    gap: 6px;
  }
  #student-tasks .answer-shown {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
  #student-tasks .answer-done-row #next-btn {
    margin: 0;
    min-width: 96px;
    padding: 8px 14px;
  }
  #student-tasks .answer-done-row #done-attach-photo-btn:not(.hidden) {
    margin: 0;
    width: auto;
    padding: 8px 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  #student-tasks #task-attached-photo-bar {
    grid-column: 1 / -1;
    order: 5;
    margin: 0;
  }

  #student-tasks #task-type-hint {
    grid-column: 1 / -1;
    order: 5;
    margin: 0;
    font-size: 0.78rem;
  }
  #student-tasks .phrase {
    grid-column: 1 / -1;
    order: 6;
    min-height: 0;
    padding: 8px 12px;
    font-size: 0.94rem;
    border-radius: 10px;
  }
  #student-tasks #hint-text {
    grid-column: 1 / -1;
    order: 7;
    max-height: none;
    font-size: 0.84rem;
  }
}

@media (max-width: 500px) {
  #screen-student > .app-header .ws-pill span:last-child,
  #screen-student > .app-header #student-greeting,
  #screen-student > .app-header .app-nav a.is-active,
  #screen-student-cabinet > .app-header .app-nav a.is-active {
    display: none;
  }
  #screen-student > .app-header .ws-pill {
    padding: 5px;
  }
  #screen-student > .app-header .app-nav,
  #screen-student-cabinet > .app-header .app-nav {
    background: transparent;
    padding: 0;
  }
  #screen-student > .app-header .app-nav a,
  #screen-student-cabinet > .app-header .app-nav a {
    background: #DCE9FC;
    padding: 5px 9px;
    border-radius: 6px;
  }
  #student-tasks #answer-entry .hint-btn-text,
  #student-tasks #answer-entry .photo-btn-text,
  #student-tasks #answer-done .photo-btn-text {
    display: none;
  }
  #student-tasks #answer-entry #hint-btn,
  #student-tasks #answer-entry #open-photo-modal-btn:not(.hidden) {
    width: 42px;
    padding: 0;
    font-size: 1rem;
  }
  #student-tasks #answer-done #done-attach-photo-btn:not(.hidden) {
    width: 42px;
    min-width: 42px;
    padding: 0;
    font-size: 1rem;
  }
}

/* ——— Модальное окно отправки фото решения (Файл с ПК / Веб-камера ПК / QR с телефона) ——— */
.pm-backdrop {
  z-index: 96;
}
.pm-dialog {
  width: min(560px, 95vw);
  max-height: 92dvh;
  overflow-y: auto;
  padding: 18px 20px;
  border-radius: 16px;
}
.pm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.pm-head h3 {
  margin: 0;
  font-size: 1.08rem;
  color: #173B7B;
}
.pm-close-btn {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 9px;
}
.pm-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  background: #F1F5F9;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 14px;
}
.pm-tab-btn {
  width: 100%;
  margin: 0;
  padding: 8px 6px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}
.pm-tab-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  color: #1E3A8A;
}
.pm-tab-btn.is-active {
  background: #FFFFFF;
  color: #1564D9;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
@media (max-width: 520px) {
  .pm-tabs {
    grid-template-columns: 1fr;
  }
}
.pm-pane {
  margin-bottom: 10px;
}
.pm-dropzone {
  padding: 22px 16px;
  border: 2px dashed #93C5FD;
  border-radius: 14px;
  background: #F8FBFF;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pm-dropzone.is-dragover {
  border-color: #1564D9;
  background: #EFF6FF;
}
.pm-dropzone-icon {
  font-size: 1.9rem;
  line-height: 1;
  margin-bottom: 6px;
}
.pm-dropzone-title {
  font-weight: 800;
  color: #173B7B;
  font-size: 0.96rem;
}
.pm-dropzone kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  font-size: 0.76rem;
}
.pm-file-btns {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pm-primary-pick-btn {
  width: auto !important;
  margin: 0 !important;
  padding: 10px 18px !important;
  border-radius: 10px;
}
.pm-mobile-only-btn {
  width: auto !important;
  margin: 0 !important;
  padding: 10px 16px !important;
  display: none;
}
@media (max-width: 820px), (hover: none) and (pointer: coarse) {
  .pm-mobile-only-btn {
    display: inline-flex;
    align-items: center;
  }
}
.pm-webcam-stage {
  background: #0F172A;
  border-radius: 14px;
  overflow: hidden;
  padding: 10px;
  text-align: center;
}
.pm-webcam-stage video {
  width: 100%;
  max-height: 300px;
  border-radius: 10px;
  background: #000000;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px;
}
.pm-webcam-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.pm-webcam-controls button {
  width: auto;
  margin: 0;
  padding: 9px 16px;
}
.pm-retake-row {
  margin-bottom: 8px;
  text-align: right;
}
.pm-fallback-box {
  padding: 14px;
  border-radius: 12px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  font-size: 0.88rem;
  line-height: 1.4;
}
.pm-inline-btn {
  width: auto !important;
  margin: 0 !important;
  padding: 7px 12px !important;
  font-size: 0.82rem;
  border-radius: 8px;
}
.pm-qr-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}
@media (max-width: 540px) {
  .pm-qr-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}
.pm-qr-svg-box {
  width: 196px;
  height: 196px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pm-qr-svg-box svg {
  width: 100%;
  height: 100%;
  display: block;
}
.pm-qr-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.88rem;
  color: #1E293B;
}
.pm-qr-wait {
  margin-top: 4px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #ECFDF5;
  color: #15803D;
  font-size: 0.82rem;
  font-weight: 700;
}
.pm-qr-link-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}
.pm-qr-link-row input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 6px 9px;
  font-size: 0.76rem;
  background: #FFFFFF;
}
.pm-ready-wrap {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #F8FAFC;
  border: 1px solid #DCE6F5;
}
.pm-ready-preview-box {
  text-align: center;
  margin-bottom: 8px;
}
.pm-ready-preview-box img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  object-fit: contain;
}
.pm-ready-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.pm-submit-btn {
  width: 100%;
  margin: 0;
  padding: 11px 16px;
  background: #15803D;
  font-weight: 800;
  border-radius: 10px;
}
.pm-submit-btn:hover:not(:disabled) {
  background: #166534;
}
.pm-status-msg {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}
.pm-status-msg.is-error {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}
.pm-status-msg.is-info {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}
