/* Последний слой: ширина расписания определяется окном, а не табло 1120px. */
.schedule-page > *,
.schedule-desktop-layout > *,
.class-schedule > *,
.class-week > *{min-width:0}
.schedule-shell .lesson span{overflow-wrap:anywhere}

@media (min-width:801px){
  .schedule-page{max-width:none;width:100%;padding-left:clamp(16px,2vw,72px);padding-right:clamp(16px,2vw,72px)}
  .masthead{grid-template-columns:minmax(0,1fr) minmax(0,1.6fr) auto;gap:16px}
  .masthead .hero{grid-template-columns:minmax(0,1fr);gap:6px}
  .schedule-desktop-layout{min-width:0;grid-template-columns:clamp(180px,16vw,360px) minmax(0,1fr) clamp(180px,16vw,360px)}
  .schedule-swipe{min-width:0}
  .parallel-schedule{width:100%;min-width:0}
  .class-schedule{min-width:0;grid-template-columns:30px minmax(0,1fr)}
  .class-week{min-width:0;grid-template-columns:repeat(6,minmax(0,1fr))}
  .week-day header{grid-template-columns:minmax(0,1fr)}
  .week-day h3{font-size:clamp(11px,.9vw,29px);white-space:nowrap;overflow-wrap:normal}
  .lesson{grid-template-columns:18px minmax(0,1fr);column-gap:4px}
  .lesson em{grid-column:2;white-space:normal;overflow-wrap:anywhere}
  .section-label{flex-wrap:wrap}
  .side-news-viewport,.news-track,.news-item,.vk-post{min-width:0}
  .news-item{overflow-wrap:anywhere}
}

/* Небольшие окна и планшеты: обе ленты под расписанием. */
@media (min-width:801px) and (max-width:1599px){
  .schedule-shell{height:100vh;height:100dvh;overflow:hidden}
  .schedule-page{height:100vh;height:100dvh;overflow:hidden;grid-template-rows:auto auto minmax(0,1fr) auto auto auto}
  .schedule-desktop-layout{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(0,1fr) clamp(110px,22vh,180px);align-items:stretch;gap:10px 16px}
  .schedule-desktop-layout > .side-news-announcements{grid-column:1;grid-row:2}
  .schedule-desktop-layout > .side-news-vk{grid-column:2;grid-row:2}
  .schedule-desktop-layout > .schedule-section{grid-column:1/-1;grid-row:1}
  .schedule-swipe{max-height:none}
  .side-news{height:auto;overflow:hidden;padding:8px 12px}
  .side-news-viewport{overflow:hidden;touch-action:none;scrollbar-width:none}
  .side-news .section-label{margin-bottom:6px}
  .masthead .hero-note{display:none}
}

@media (min-width:2200px){
  /* Сохраняем размеры и расположение элементов школьного 4K-табло. */
  .masthead .hero{grid-template-columns:minmax(0,.9fr) minmax(0,1.7fr)}
  .schedule-desktop-layout{grid-template-columns:clamp(310px,16vw,520px) minmax(0,1fr) clamp(310px,16vw,520px)}
  .masthead{gap:48px}
  .class-schedule{grid-template-columns:48px minmax(0,1fr)}
  .lesson{grid-template-columns:30px minmax(0,1fr) auto;column-gap:10px}
  .lesson em{grid-column:auto}
}

/* Невысокие окна ноутбуков: оставляем больше высоты для уроков. */
@media (min-width:801px) and (max-width:1599px) and (max-height:760px){
  .schedule-page{padding-top:8px;padding-bottom:8px}
  .masthead{padding-bottom:6px}
  .masthead .hero h1{font-size:22px}
  .bells-section,.parallel-section{padding:6px 0}
  .section-label{margin-bottom:6px}
  .bells{gap:5px}
  .bell-shift{gap:8px}
  .bell-timeline{grid-template-columns:repeat(8,minmax(0,1fr))}
  .bell{min-height:32px;padding-top:7px;padding-left:2px;padding-right:2px}
  .bell small{font-size:8px}
  .schedule-desktop-layout{grid-template-rows:minmax(0,1fr) clamp(90px,19vh,140px);gap:8px 16px}
  .parallel-button{padding:6px 10px}
}

@media (max-width:800px){
  .mobile-day-tab{min-width:0}
  .bell-timeline{grid-template-columns:repeat(4,minmax(0,1fr))}
  .bell{min-width:0;padding-left:2px;padding-right:2px}
  .bell small{font-size:clamp(7px,2.2vw,9px)}
}
