/* Мобильная версия лендинга. Написано руками, генератор только подключает файл.
   Разметка из канваса со стилями в style="", поэтому правила цепляются за секции (#about, #prizes…)
   и за куски inline-стилей ([style*="…"]) и перебивают их через !important.
   Если в канвасе поменять сетки или отступы, проверьте страницу на ширине 375px. */

html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
a,button,summary,label{-webkit-tap-highlight-color:transparent}
/* overflow-x:hidden на обёртке ломает position:sticky у шапки; clip режет так же, но не мешает */
#top{overflow-x:clip!important}
@media (hover:none){.ml-btn:hover{transform:none}}

.ml-burger,.ml-sticky,.ml-dots{display:none}

@media (max-width:640px){
  /* ---------- Шапка: логотип · язык · меню ---------- */
  #top>header{position:sticky;top:0;z-index:40;background:#F7F3EA}
  #top>header>nav{flex-wrap:wrap!important;gap:0 10px!important;padding:8px 16px!important}
  #top>header>nav>a:first-child{min-height:44px!important;order:0}
  #top>header>nav>a:first-child>span{font-size:22px!important}
  #top>header>nav>a:first-child>span:last-child{padding-left:7.5px!important}
  #top>header>nav>div:nth-of-type(2){display:contents!important}
  #top>header [data-lang-switch]{order:1;margin-left:auto!important}
  #top>header [data-lang-switch] a{min-width:40px!important;min-height:40px!important;padding:0 6px!important;font-size:12px!important}
  #top>header>nav>div:nth-of-type(2)>.ml-btn{display:none!important}

  .ml-burger{order:2;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;
    background:#15143F;color:#F7F3EA;border:0;border-radius:0;cursor:pointer}
  .ml-burger svg{width:22px;height:22px;stroke:currentColor;stroke-width:2.5;stroke-linecap:square;fill:none}
  .ml-burger .x{display:none}
  .ml-menu-open .ml-burger .x{display:block}
  .ml-menu-open .ml-burger .bars{display:none}

  #top>header>nav>div:nth-of-type(1){order:3;flex:1 0 100%;display:none!important;flex-direction:column;align-items:stretch!important;
    gap:0!important;margin:8px -16px 0;padding:4px 16px 16px;border-top:2px solid #15143F}
  .ml-menu-open #top>header>nav>div:nth-of-type(1){display:flex!important}
  #top>header>nav>div:nth-of-type(1)>a{min-height:52px!important;font-family:'Unbounded','Arial Black',Impact,sans-serif;
    font-size:18px!important;font-weight:800!important;text-transform:uppercase;border-bottom:2px solid #15143F}
  #top>header>nav>div:nth-of-type(1)>a:last-child{border-bottom:0}
  .ml-menu-open #top>header>nav>div:nth-of-type(2)>.ml-btn{display:flex!important;order:4;flex:1 0 100%;justify-content:center;
    min-height:56px!important;margin:0 0 16px;box-sizing:border-box}

  /* ---------- Общие отступы и типографика ---------- */
  #top section,#top footer{scroll-margin-top:60px}
  section[style*="padding: clamp(56px"],footer[style*="padding: clamp(56px"]{padding-top:48px!important;padding-bottom:48px!important}
  section>div[style*="gap: 40px"]{gap:28px!important}
  #top p[style*="font-size: 20px"]{font-size:18px!important}

  /* ---------- Первый экран ---------- */
  #top>section:first-of-type [style*="box-shadow: 12px 12px 0"]{border-width:4px!important;box-shadow:8px 8px 0 #D3242B!important;gap:18px!important}
  #top>section:first-of-type span[style*="Caveat"]{font-size:24px!important}
  #top>section:first-of-type h1{font-size:clamp(30px,9.4vw,40px)!important}
  #top>section:first-of-type .ml-btn{flex:1 0 100%;justify-content:space-between;box-sizing:border-box;min-height:58px!important;padding:0 20px!important}
  #top>section:first-of-type span[style*="margin-left: auto"]{margin-left:0!important;font-size:14px!important}

  /* ---------- Карусели вместо длинных колонок ---------- */
  .ml-rail{display:flex!important;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;
    scrollbar-width:none;-webkit-overflow-scrolling:touch;gap:12px!important}
  .ml-rail::-webkit-scrollbar{display:none}
  .ml-rail>*{flex:0 0 84%!important;max-width:320px;scroll-snap-align:start;box-sizing:border-box}
  /* PRO3C внутри карточки: лента доходит до её рамки */
  #about [style*="minmax(min(230px"]{margin-right:-20px!important;padding-right:20px;scroll-padding-left:0}
  /* лента на всю ширину экрана */
  #calendar [style*="minmax(min(250px"],
  #prizes [style*="minmax(min(300px"],
  #sponsors [style*="minmax(min(300px"]{margin:0 -16px!important;padding:2px 16px 14px;scroll-padding:0 16px}
  #prizes [style*="minmax(min(300px"]>*,#sponsors [style*="minmax(min(300px"]>*{flex-basis:86%!important}

  .ml-dots{display:flex;justify-content:center;gap:8px;margin-top:-6px}
  #about .ml-dots{margin-top:-14px}
  .ml-dots span{width:8px;height:8px;background:currentColor;opacity:.25;transition:opacity .2s,width .2s}
  .ml-dots span.on{opacity:1;width:22px}

  /* календарь: номера этапов поменьше */
  #calendar span[style*="font-size: 72px"]{font-size:52px!important}

  /* итоги сезона: три цифры в ряд */
  #about [style*="minmax(min(110px"]{grid-template-columns:repeat(3,1fr)!important;gap:12px!important}
  #about [style*="minmax(min(110px"] span[style*="clamp(44px"]{font-size:40px!important}
  #about [style*="minmax(min(110px"] span[style*="font-size: 15px"]{font-size:13px!important;line-height:1.35}

  /* цитата */
  #about figure>span[aria-hidden]{font-size:64px!important}

  /* вузы: логотипы в две колонки */
  #universities [style*="minmax(min(210px"]{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  #universities [style*="minmax(min(210px"]>*{padding:12px!important;gap:10px!important}
  #universities [style*="minmax(min(210px"] div[style*="height: 120px"]{height:72px!important}
  #universities [style*="minmax(min(210px"] h3{font-size:14px!important}
  #universities [style*="minmax(min(210px"] [style*="font-size: 12px"]{font-size:10px!important;padding-left:6px!important;padding-right:6px!important}

  /* ---------- Форма: имя на всю строку, телефон и курс рядом ---------- */
  #apply form [style*="flex: 1 1 170px"]{flex:1 1 calc(100% - 62px)!important}
  #apply form [style*="flex: 1 1 160px"]{flex:1 1 0!important}
  #apply form select[style*="flex: 0 0 128px"]{flex:0 0 112px!important}
  #apply form>div,#apply form{scroll-margin-top:70px}

  /* ---------- Кнопка заявки внизу экрана ---------- */
  .ml-sticky{display:flex;position:fixed;left:12px;right:12px;bottom:12px;z-index:30;align-items:center;justify-content:center;gap:10px;
    min-height:56px;background:#D3242B;color:#FFFDF8;border:2px solid #15143F;box-shadow:4px 4px 0 #15143F;text-decoration:none;
    font-family:'Unbounded','Arial Black',Impact,sans-serif;font-weight:800;font-size:14px;text-transform:uppercase;letter-spacing:.02em;
    transform:translateY(calc(100% + 24px));transition:transform .25s cubic-bezier(.2,.8,.2,1);bottom:calc(12px + env(safe-area-inset-bottom))}
  .ml-sticky svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.5}
  .ml-sticky.on{transform:none}
  .ml-menu-open .ml-sticky{transform:translateY(calc(100% + 24px))}
  #contacts{padding-bottom:96px!important}
}

@media (max-width:640px) and (prefers-reduced-motion:reduce){
  .ml-sticky,.ml-dots span{transition:none}
}

@media (max-width:640px){
  /* «Здесь может быть ваш университет» встаёт в свободную ячейку сетки */
  #universities [style*="minmax(min(210px"]>a.ml-btn{box-shadow:4px 4px 0 #15143F!important;justify-content:space-between!important}
  #universities [style*="minmax(min(210px"]>a.ml-btn>span:first-child{font-size:13px!important;overflow-wrap:anywhere}
  #universities [style*="minmax(min(210px"]>a.ml-btn>span:last-child{font-size:14px;gap:6px!important}
}

@media (max-width:640px){
  /* формула прибыли: плашки компактнее, по две-три в строке */
  #about p[style*="gap: 10px 12px"]{gap:8px!important}
  #about p[style*="gap: 10px 12px"]>span[style*="padding: 8px 14px"]{padding:5px 9px!important;font-size:14px}
  #about p[style*="gap: 10px 12px"]>span[style*="font-size: 20px"]{font-size:16px!important}
}
