/* Мобильные правки области "groups": только внутри @media (max-width: 768px), десктоп не менять */
@media (max-width: 768px) {
  /* Профиль ребёнка (цифровой портрет): сайдбар в колонку */
  .dp-bg-full { display: none; }
  .dp-sidebar { flex-direction: column; min-height: 0; }
  .dp-sb-left { width: auto; position: static; padding: 12px 8px; -webkit-mask-image: none; mask-image: none; }
  .dp-sb-left::after { display: none; }
  .dp-sb-ava { transform: scale(.8); transform-origin: center top; margin-bottom: -40px; }
  .dp-sb-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .dp-sb-right { padding: 8px 0; width: 100%; }

  /* Кнопки, видимые только по hover, на touch всегда показываем */
  .dp-ava-change { opacity: 1; width: 36px; height: 36px; }
  .dp-file-del, .dp-file-edit { display: flex; width: 32px; height: 32px; }

  /* Вкладки портрета и подвкладки школы: горизонтальный скролл */
  .dp-tabs, .school-subtabs, .analytics-tabs {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .dp-tabs::-webkit-scrollbar, .school-subtabs::-webkit-scrollbar, .analytics-tabs::-webkit-scrollbar { display: none; }
  .dp-tab, .school-subtab, .analytics-tab a { white-space: nowrap; flex: 0 0 auto; padding: 10px 14px; }
  .school-subtab { min-height: 44px; }

  /* Обзор: кольцо над полосами, объявление в колонку */
  .dp-ov-dash { flex-direction: column; align-items: stretch; gap: 16px; }
  .dp-ov-rings-wrap { margin: 0 auto; }
  .dp-ov-bar-val { width: 64px; }
  .dp-ov-bar-label { width: 56px; }
  .dp-ann { flex-direction: column; align-items: stretch; padding: 12px; }
  .dp-ann-img { width: 100%; max-height: 220px; }
  .dp-ann.dp-ann-show { max-height: none; }
  .pdf-sec-grid { grid-template-columns: 1fr; }
  .ajax-loading-status { right: 10px; bottom: 80px; max-width: calc(100vw - 20px); }

  /* Список групп (Vue): вкладки, фильтры, таблица, пагинация */
  #groups-vue-app .gm-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-bottom: 16px; }
  #groups-vue-app .gm-tabs::-webkit-scrollbar { display: none; }
  #groups-vue-app .gm-tab { flex: 0 0 auto; min-height: 44px; padding: 8px 14px; white-space: nowrap; }
  #groups-vue-app .gm-filters { flex-direction: column; align-items: stretch; }
  #groups-vue-app .gm-filter-select,
  #groups-vue-app .gm-search-input { height: 42px; font-size: 16px; width: 100%; max-width: 100%; }
  #groups-vue-app .gm-nosen-btn { margin-left: 0; width: 100%; height: 42px; justify-content: center; }
  #groups-vue-app .gm-section-actions { flex-wrap: wrap; width: 100%; }
  #groups-vue-app .gm-action-btn { min-height: 40px; justify-content: center; flex: 1 1 auto; }
  #groups-vue-app .gm-btn,
  #groups-vue-app .gm-card .action-btn { width: 40px; height: 40px; }
  #groups-vue-app .gm-table-wrap { -webkit-overflow-scrolling: touch; max-width: 100%; }
  #groups-vue-app .gm-table { min-width: 880px; }
  #groups-vue-app .gm-td-actions { white-space: nowrap; }
  #groups-vue-app .gm-pagination { flex-direction: column; gap: 10px; align-items: center; }
  #groups-vue-app .gm-pagination-btns { flex-wrap: wrap; justify-content: center; }
  #groups-vue-app .gm-page-btn { min-width: 40px; height: 40px; }
  .gm-modal { max-width: 100%; max-height: 92vh; overflow-y: auto; }

  /* Страница группы: вкладки и кнопки действий */
  .group-view #groupTabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .group-view #groupTabs .umc-period-tab { white-space: nowrap; flex: 0 0 auto; }
  .group-view .rec-actions { flex-wrap: wrap; justify-content: flex-end; }
  .group-view .rec-actions .action-btn { width: 40px; height: 40px; }
  .group-view .tab-content { min-height: 0 !important; }

  /* Формы области и Select2 */
  .two-columns-layout, .form-two-columns { grid-template-columns: 1fr; flex-direction: column; }
  .select2-container { max-width: 100%; }
  .select2-container--default .select2-selection--single { min-height: 42px; }
  .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 40px; }
  .select2-container--default .select2-selection--single .select2-selection__arrow { height: 40px; }
  .select2-container--default .select2-selection--multiple { min-height: 42px; }
}
