/* ═══════════════════════════════════════════════════════════════════════════
   Расписание — по макету «Атриум — редизайн расписания».

   Неделя — список дней: заголовок дня над белой карточкой, в карточке пары.
   У пары слева время (начало крупно, конец и номер пары мельче), в середине
   предмет, тип словом и кто ведёт, справа кабинет и действия.

   Идущая пара — зелёная точка «Идёт», отсчёт и полоска прогресса. Зелёный
   на странице значит только «сейчас», синий — только то, что нажимается.
   Общие кнопки, поля и карточки — в atrium-ui.css.
   ═══════════════════════════════════════════════════════════════════════════ */

.sched-wrap { max-width: 980px; margin: 0 auto; }

/* ─── Шапка страницы ───────────────────────────────────────────────────── */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.schedule-heading { min-width: 0; }
.sh-eyebrow { font-size: 17px; font-weight: 600; color: var(--text-muted); }
.sh-title {
  margin: 4px 0 0;
  font-size: 48px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}
.sh-sub { margin-top: 10px; font-size: 17px; color: var(--text-muted); }
@media (max-width: 820px) {
  .sh-title { font-size: 34px; }
}
/* На телефоне кто и когда уже написаны крупно в строке панели фильтров —
   второй раз заголовок не повторяем (как на экране телефона в макете). */
@media (max-width: 767.98px) {
  .page-head { margin-bottom: 12px; gap: 8px; }
  .schedule-heading { display: none; }
}

/* Вторичные действия — серые «таблетки» */
.schedule-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.schedule-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 22px;
  background: var(--fill);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform .28s var(--ease), background-color .2s, color .2s;
}
.schedule-action i { font-size: 17px; }
.schedule-action:hover { background: var(--fill2); color: var(--text); text-decoration: none; }
.schedule-action:active { transform: scale(.96); }
.schedule-action.is-on { background: var(--accent-soft); color: var(--accent-text); }
.action-period { font-size: 13px; color: var(--muted-strong); white-space: nowrap; }
@media (max-width: 575.98px) {
  .schedule-action { height: 40px; padding: 0 14px; font-size: 14px; }
}

/* Мобильная строка панели фильтров — как шапка экрана телефона в макете */
@media (max-width: 767.98px) {
  .fp-mb-eyebrow { font-size: 13px; font-weight: 600; color: var(--text-muted); }
  .fp-mb-who { font-size: 28px !important; font-weight: 700 !important; letter-spacing: -0.02em; line-height: 1.15 !important; }
  .fp-mb-who { white-space: normal !important; overflow: visible !important; }
  .fp-mb-when { font-size: 15px !important; margin-top: 3px !important; }
  .fp-mb-btn {
    width: 40px; height: 40px; padding: 0 !important; border-radius: 20px !important;
    justify-content: center; font-size: 18px !important;
  }
  .fp-mb-btn > span { display: none; }
  .filter-panel:has(#filterBody:not(.show)) { background: transparent; box-shadow: none !important; padding: 0 0 4px; }
}

/* ─── День ─────────────────────────────────────────────────────────────── */
.sched-day { display: flex; flex-direction: column; gap: 12px; margin-bottom: 36px; scroll-margin-top: 72px; }
.day-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; padding: 0 4px; }
.day-title { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.015em; }
.day-date { font-size: 17px; color: var(--text-muted); }
.day-today {
  display: none;
  align-self: center;
  font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-text);
}
.sched-day.is-today .day-today { display: inline-block; }

.week-card { overflow: hidden; margin: 0; }

/* ─── Пара ─────────────────────────────────────────────────────────────── */
.lesson-row {
  position: relative;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  padding: 16px 20px;
  transition: background-color .2s;
}
@media (hover: hover) { .lesson-row:hover { background: var(--fill); } }
/* Разделитель начинается от текста, а не от края — как в списках iOS */
.lesson-row + .lesson-row::before {
  content: "";
  position: absolute;
  top: 0; right: 0; left: 108px;
  height: 1px;
  background: var(--divider);
}

.lesson-when {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  min-width: 68px;
  font-variant-numeric: tabular-nums;
}
.lesson-time { display: flex; flex-direction: column; gap: 2px; }
.lesson-start { font-size: 17px; font-weight: 600; color: var(--text); }
.lesson-end { font-size: 13px; color: var(--text-muted); }
.lesson-pairno { display: flex; align-items: center; }
.pair-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--fill2);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pair-badge.is-empty { color: var(--text-muted); font-weight: 500; }

.lesson-content { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.lesson-name { font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--text); }
.lesson-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 15px; color: var(--text); }

.who { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; color: var(--text); min-width: 0; }
.who-badge {
  width: 22px; height: 22px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 12px;
}
.lesson-group { color: var(--text); }

.lesson-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}
.lesson-room { font-size: 15px; font-weight: 500; color: var(--text); white-space: nowrap; }

.lesson-acts { display: flex; align-items: center; gap: 4px; }
.lesson-acts .journal-link-area,
.lesson-acts .compare-link-area { display: flex; gap: 4px; margin: 0 !important; }
/* Действия — круглые серые кнопки со значком. Подписи на ПК скрыты: значок
   с подсказкой понятен, а строка остаётся спокойной. */
.lesson-act {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 36px; height: 36px; padding: 0 10px;
  border: none; border-radius: 18px;
  background: transparent;
  color: var(--accent-text);
  font-size: 15px; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: transform .28s var(--ease), background-color .2s;
}
.lesson-act:hover { background: var(--fill); color: var(--accent-text); }
.lesson-act:active { transform: scale(.92); }
.lesson-act .act-label { display: none; }

/* Окно и выходной — тихие строки, это отсутствие пары, а не событие */
.lesson-off { font-size: 15px; font-weight: 500; color: var(--text-muted); }
.lesson-off.is-holiday { color: var(--ok); }
.lesson-row.is-window .lesson-start { color: var(--text-muted); font-weight: 500; }

/* ─── Идёт сейчас ─────────────────────────────────────────────────────── */
.active-timer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  margin-top: 2px;
  font-size: 13px; font-weight: 600;
  color: var(--now);
}
.active-timer .timer-item + .timer-item::before { content: "·"; margin-right: 8px; }
.live-dot {
  width: 7px; height: 7px; border-radius: 4px; flex: none;
  background: var(--now-bar);
  animation: atr-pulse 2s infinite;
}
.lesson-row.is-next-upcoming .active-timer,
.lesson-row:not(.is-active) .active-timer { color: var(--loc); }
/* На узком экране части отсчёта переносятся — разделитель «·» повис бы в
   начале строки, поэтому там хватает промежутка */
@media (max-width: 560px) {
  .active-timer { column-gap: 12px; }
  .active-timer .timer-item + .timer-item::before { content: none; }
}
/* Текст отсчёта не отдельный блок: его части переносятся вместе с точкой */
.timer-text { display: contents; }
.live-dot[hidden] { display: none; }

/* ─── Следующая пара ───────────────────────────────────────────────────────
   Та же рамка, что у идущей, но синяя: «скоро», а не «сейчас». */
.lesson-row.is-next {
  border: 1.5px solid var(--loc);
  border-radius: 10px;
  padding: 12px;
  margin: 8px 10px;
  background: color-mix(in srgb, var(--loc) 8%, transparent);
}
.lesson-row.is-next .active-timer { color: var(--loc); }
.lesson-row.is-next .pair-badge {
  border-color: var(--loc);
  color: var(--loc);
  background: color-mix(in srgb, var(--loc) 12%, transparent);
}
.lesson-row.is-next::before, .lesson-row.is-next + .lesson-row::before { display: none; }
@media (max-width: 575.98px) { .lesson-row.is-next { padding: 12px; } }
@media print { .lesson-row.is-next { background: none; } }

/* ─── Прогресс идущей пары ─────────────────────────────────────────────── */
.lesson-progress-container {
  display: none;
  height: 4px; max-width: 320px;
  border-radius: 2px;
  background: var(--fill2);
  overflow: hidden;
}
.lesson-row.is-active .lesson-progress-container { display: block; }
.lesson-progress-bar { height: 100%; width: 0; background: var(--now-bar); transition: width 1s linear; }

.lesson-row.is-active { background: var(--now-bg); }
.lesson-row.is-active:hover { background: var(--now-bg); }
.lesson-row.is-active .pair-badge {
  background: var(--now);
  color: var(--on-accent);
  border-color: var(--now);
}
.lesson-row.is-active .lesson-start {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
}
.lesson-row.is-active .lesson-end {
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}
.lesson-row.is-active .lesson-group { font-weight: 700; }

/* ─── Кнопка показа всей недели ────────────────────────────────────────── */
.week-reveal-wrap { display: flex; justify-content: center; margin-bottom: 14px; }
.btn-reveal-week {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--fill);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-reveal-week:hover {
  background: var(--fill2);
  color: var(--text);
  border-color: var(--accent);
  text-decoration: none;
}

/* ─── Категории избранного ─────────────────────────────────────────────── */
.fav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  width: 100%;
}
.fav-group-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding-left: 2px;
}
.fav-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ─── Пустая неделя ───────────────────────────────────────────────────── */
.sched-empty {
  background: var(--bg-card); border-radius: 18px; box-shadow: var(--shadow);
  padding: 28px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
}
.sched-empty > i { font-size: 30px; color: var(--text-muted); }
.sched-empty-title { font-size: 17px; font-weight: 600; }
.sched-empty-sub { font-size: 15px; color: var(--text-muted); }

/* ─── Узкий экран: кабинет уходит под содержимое ───────────────────────── */
@media (max-width: 560px) {
  .lesson-row { grid-template-columns: 68px minmax(0, 1fr); gap: 4px 14px; padding: 14px 16px; }
  .lesson-row + .lesson-row::before { left: 98px; }
  .lesson-side {
    grid-column: 2;
    flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between;
    text-align: left;
  }
  .lesson-room { font-size: 14px; color: var(--text-muted); }
  .lesson-acts { margin-left: auto; }
  .lesson-name { font-size: 16px; }
  .lesson-meta { font-size: 14px; }
  .day-title { font-size: 20px; }
  .day-date { font-size: 15px; }
  .sched-day { margin-bottom: 24px; gap: 8px; }
}

/* ─── Печать ─────────────────────────────────────────────────────────────
   Заголовок с ФИО и периодом нужен только на бумаге. */
.print-only-header { display: none; }
@media print {
  .print-only-header { display: block; }
  .page-head, .filter-panel { display: none; }
  .sched-day { break-inside: avoid; animation: none; }
  .week-card { border: 1px solid #000 !important; }
  .lesson-row.is-active { background: none; }
}

@media (max-width: 359.98px) {
  #mobileSearch::placeholder { font-size: 13px; }
}
