/* 10.11.2026 Мобильная версия LMS (Валерия 3402674): нижнее меню, баннер, вкладки «Моё обучение», окно профиля, новости, отступы.
   Только экраны до 760px; настольная версия не меняется. */
@media (max-width: 760px) {
  /* --- 6. Общее: страница не уходит вбок, меню не перекрывает содержимое --- */
  html, body { overflow-x: clip; }
  main { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important; }
  .topbar { gap: 8px; padding-left: 12px; padding-right: 12px; min-width: 0; }
  .topbar > * { min-width: 0; }
  .topbar .avatar, #profile-toggle { flex: 0 0 auto; }

  /* --- 1. Нижнее меню: единый набор значков, одинаковый размер, активный — фирменный красный --- */
  .mobile-nav { padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); min-height: 64px; align-items: stretch; box-shadow: 0 -1px 0 rgba(17, 24, 39, .08), 0 -6px 18px rgba(17, 24, 39, .06); }
  .mobile-nav a { display: flex !important; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; flex: 1 1 0 !important; min-width: 72px; padding: 4px 2px !important; font-size: 11.5px !important; font-weight: 700; line-height: 1.2; text-align: center; color: #6b7078 !important; }
  .mobile-nav a[hidden] { display: none !important; }
  .mobile-nav a > span { display: block; flex: 0 0 auto; width: 24px; height: 24px; font-size: 0 !important; line-height: 0; color: transparent; background-color: currentColor; -webkit-mask: var(--sp-ico) center / 24px 24px no-repeat; mask: var(--sp-ico) center / 24px 24px no-repeat; }
  .mobile-nav a > span { background-color: #6b7078; }
  .mobile-nav a.is-active, .mobile-nav a[aria-current="page"] { color: #b9152d !important; }
  .mobile-nav a.is-active > span, .mobile-nav a[aria-current="page"] > span { background-color: #b9152d; }
  .mobile-nav a.is-active::after { content: ""; display: block; width: 18px; height: 3px; margin-top: 1px; border-radius: 2px; background: #b9152d; }
  .mobile-nav a .nav-notification { position: absolute; margin-left: 18px; }
  .mobile-nav a[data-screen-link="courses"] > span { --sp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 10 12 5 2 10l10 5 10-5Z'/%3E%3Cpath d='M6 12v5c3 2 9 2 12 0v-5'/%3E%3C/svg%3E"); }
  .mobile-nav a[data-screen-link="catalog"] > span { --sp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E"); }
  .mobile-nav a[data-screen-link="team"] > span { --sp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c0-3.6 2.9-6 6.5-6s6.5 2.4 6.5 6'/%3E%3Cpath d='M16 4.6a3.5 3.5 0 0 1 0 6.8'/%3E%3Cpath d='M18 14.3c2.1.7 3.5 2.8 3.5 5.7'/%3E%3C/svg%3E"); }
  .mobile-nav a[data-screen-link="analytics"] > span { --sp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V10'/%3E%3Cpath d='M10 20V4'/%3E%3Cpath d='M16 20v-7'/%3E%3Cpath d='M22 20H2'/%3E%3C/svg%3E"); }
  .mobile-nav a[data-screen-link="users"] > span { --sp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4.4 3.6-7 8-7s8 2.6 8 7'/%3E%3C/svg%3E"); }
  .mobile-nav a[data-screen-link="assessment"] > span { --sp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='3' width='14' height='18' rx='2'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }
  .mobile-nav a[data-screen-link="editor"] > span { --sp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5V5a2 2 0 0 1 2-2h14v15H6a2 2 0 0 0-2 2Z'/%3E%3Cpath d='M6 21h14v-3'/%3E%3Cpath d='M9 8h7'/%3E%3C/svg%3E"); }
  .mobile-nav a[data-screen-link="banners"] > span { --sp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='10' r='1.8'/%3E%3Cpath d='m21 16-5-5-8 8'/%3E%3C/svg%3E"); }
  .mobile-nav a[data-screen-link="news-admin"] > span { --sp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11v3a1 1 0 0 0 1 1h3l6 4V6L7 10H4a1 1 0 0 0-1 1Z'/%3E%3Cpath d='M17 9a4 4 0 0 1 0 6'/%3E%3C/svg%3E"); }

  /* --- 2. Баннер-картинка: отдельная мобильная компоновка — крупнее левая часть с текстом, управление под картинкой --- */
  #home-carousel.has-custom-image { aspect-ratio: auto !important; height: auto !important; overflow: visible !important; padding-bottom: 50px !important; background: transparent !important; box-shadow: none !important; }
  #home-carousel.has-custom-image .home-carousel__slide { display: block; position: relative !important; inset: auto !important; width: 100%; height: auto !important; aspect-ratio: 16 / 8.5 !important; background-size: cover !important; background-position: left center !important; border-radius: 16px; box-shadow: 0 6px 18px rgba(17, 24, 39, .10); }
  #home-carousel .home-carousel__arrow { top: auto !important; bottom: 4px !important; width: 40px !important; height: 40px !important; margin: 0 !important; transform: none !important; display: grid; place-items: center; font-size: 22px; line-height: 1; }
  #home-carousel .home-carousel__arrow--prev { left: 4px !important; right: auto !important; }
  #home-carousel .home-carousel__arrow--next { right: 4px !important; left: auto !important; }
  #home-carousel .home-carousel__dots { top: auto !important; bottom: 20px !important; left: 50% !important; right: auto !important; transform: translateX(-50%) !important; width: auto !important; }
  .home-carousel:not(.has-custom-image) .home-carousel__copy h1 { font-size: 30px; line-height: 1.12; }

  /* --- 3. Вкладки «Моё обучение»: все три видны сразу, подпись может переноситься --- */
  .toolbar:has(> .tabs[aria-label="Статус курсов"]) { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 12px; }
  .toolbar:has(> .tabs[aria-label="Статус курсов"]) > * { width: 100% !important; max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }
  #courses .tabs, .tabs[aria-label="Статус курсов"] { display: grid !important; width: 100% !important; box-sizing: border-box; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; overflow: visible !important; padding: 4px; border-radius: 16px; background: #eceef1; scrollbar-width: none; }
  .tabs[aria-label="Статус курсов"]::-webkit-scrollbar { display: none; }
  .tabs[aria-label="Статус курсов"] .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 64px; margin: 0; padding: 8px 4px !important; white-space: normal !important; font-size: 14px !important; line-height: 1.2; text-align: center; border-radius: 12px; }
  .tabs[aria-label="Статус курсов"] .tab span { margin: 0 !important; min-width: 24px; }

  /* --- 4. Окно профиля: в пределах экрана, заголовок и кнопки на месте, прокручивается только форма --- */
  html:has(#profile-edit-dialog[open]), body:has(#profile-edit-dialog[open]) { overflow: hidden !important; }
  #profile-edit-dialog[open] { display: flex; flex-direction: column; position: fixed; inset: auto 8px auto 8px; top: calc(var(--sp-vv-top, 0px) + 8px); width: auto; max-width: none; height: calc(var(--sp-vvh, 100dvh) - 16px); max-height: none; margin: 0; padding: 0; overflow: hidden; border-radius: 18px; overscroll-behavior: contain; }
  #profile-edit-dialog[open] > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 16px; }
  #profile-edit-dialog .editor-dialog__head { position: sticky; top: 0; z-index: 3; flex: 0 0 auto; align-items: flex-start; gap: 12px; margin: 0 -16px; padding: 16px 16px 12px; background: #fff; box-shadow: 0 1px 0 #eceef1; }
  #profile-edit-dialog .editor-dialog__head h2 { font-size: 24px; line-height: 1.15; margin: 4px 0; }
  #profile-edit-dialog .editor-dialog__head p { font-size: 14px; margin: 0; }
  #profile-edit-dialog .editor-dialog__head button { flex: 0 0 auto; width: 44px; height: 44px; }
  #profile-edit-dialog .profile-photo-editor { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; margin-top: 14px; padding: 14px; }
  #profile-edit-dialog .profile-photo-editor .avatar, #profile-edit-dialog .profile-photo-editor [class*="avatar"] { width: 64px; height: 64px; font-size: 20px; }
  #profile-edit-dialog .form-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 14px; margin-top: 14px; }
  #profile-edit-dialog input, #profile-edit-dialog select, #profile-edit-dialog textarea { font-size: 16px !important; min-height: 48px; max-width: 100%; box-sizing: border-box; }
  #profile-edit-dialog .editor-dialog__actions { position: sticky; bottom: 0; z-index: 3; flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin: auto -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: #fff; box-shadow: 0 -1px 0 #eceef1; }
  #profile-edit-dialog .editor-dialog__actions .button { min-height: 48px; width: 100%; margin: 0; }

  /* --- 5. Новости: компактнее — ниже обложка, короткий анонс --- */
  .home-news-section { margin-top: 18px; }
  .home-news-section__head h2 { font-size: 26px; }
  .home-news-card__media { aspect-ratio: 16 / 7 !important; height: auto !important; max-height: 170px; }
  .home-news-card__media img { width: 100%; height: 100%; object-fit: cover; }
  .home-news-card__body { padding: 14px 16px 16px !important; gap: 6px; }
  .home-news-card__body h3 { font-size: 19px !important; line-height: 1.25 !important; margin: 2px 0 !important; }
  .home-news-card__excerpt { font-size: 15px !important; line-height: 1.45 !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0 !important; }
  .home-news-card__footer { margin-top: 8px !important; font-size: 14px; }

  /* Карточка программы: значок над заголовком, заголовок во всю ширину */
  .course-detail-hero.sp-compact-hero { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  .course-detail-hero.sp-compact-hero .sp-compact-thumb { width: 52px !important; height: 52px !important; }
  .course-detail-hero.sp-compact-hero .sp-compact-thumb img { width: 100%; height: 100%; object-fit: contain; }
  .course-detail-hero.sp-compact-hero h1, .course-detail-hero.sp-compact-hero h2 { font-size: 24px !important; line-height: 1.2 !important; }
  .course-detail-hero.sp-compact-hero .button { width: 100%; }

  /* --- 6. Кнопки, поля и карточки: единые размеры и отступы --- */
  .button, button.button { min-height: 44px; }
  input[type="search"], input[type="text"], input[type="email"], input[type="tel"] { font-size: 16px; }
}
/* открыта клавиатура (мало высоты): заголовок окна профиля компактнее, больше места полям */
@media (max-width: 760px) and (max-height: 600px) {
  #profile-edit-dialog .editor-dialog__head { padding-top: 10px; padding-bottom: 8px; }
  #profile-edit-dialog .editor-dialog__head h2 { font-size: 19px; }
  #profile-edit-dialog .editor-dialog__head p { display: none; }
  #profile-edit-dialog .editor-dialog__head .eyebrow { display: none; }
  #profile-edit-dialog .editor-dialog__actions { padding-top: 8px; padding-bottom: 8px; }
  #profile-edit-dialog .editor-dialog__actions .button { min-height: 44px; font-size: 15px; }
}
@media (max-width: 360px) {
  .mobile-nav a { min-width: 64px; font-size: 11px !important; }
  .tabs[aria-label="Статус курсов"] .tab { font-size: 13px !important; }
}
