/*
 * Мой Сиелом — неофициальное расписание СИЭУиП
 * Copyright © 2026 NikkiShuRA · https://github.com/NikkiShuRA/my-sielom-web
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */
/* =========================================================
   Токены
   ========================================================= */
:root {
  /* Цвет */
  --c-canvas: #f3f3f0;
  --c-bg: #ffffff;
  --c-surface: #f6f6f3;
  --c-surface-2: #efefeb;
  --c-line: #e8e8e4;
  --c-line-strong: #d6d6d0;

  --c-text: #33332f;
  --c-text-2: #5f5f59;
  --c-muted: #74746d;
  --c-faint: #b4b4ac;

  --c-accent: #ffe16c;
  --c-accent-strong: #f2c200;
  --c-accent-tint: #fff8d6;
  --c-accent-ink: #6b5300;
  --c-focus: #d99a00;

  --c-warn: #c25700;
  --c-warn-bg: #fff2e6;
  --c-warn-line: #ffd3ad;
  --c-free: #e9f5e4;
  --c-free-ink: #2f6b1c;
  --c-free-line: #bfe0b0;

  --c-on-accent: #33332f;   /* текст на жёлтом — одинаковый в обеих темах */
  --c-fav: #b48a00;
  --c-scrim: rgba(30, 30, 20, .32);
  --av-bg: 55% 90%;
  --av-fg: 35% 32%;
  --logo-bg: transparent;

  /* Форма */
  --r-2xl: 24px;
  --r-xl: 18px;
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 7px;
  --r-full: 999px;

  --sh-xs: 0 0 0 1px rgba(40, 40, 20, .05), 0 1px 2px rgba(40, 40, 20, .04);
  --sh-sm: 0 0 0 1px rgba(40, 40, 20, .05), 0 2px 4px rgba(40, 40, 20, .04), 0 6px 16px rgba(40, 40, 20, .05);
  --sh-lg: 0 0 0 1px rgba(40, 40, 20, .04), 0 12px 32px rgba(40, 40, 20, .12), 0 2px 6px rgba(40, 40, 20, .05);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: .2s;

  /* Размеры */
  --sidebar-w: 360px;
  --brand-w: 228px;
  --day-w: 220px;
  --gap: 12px;

  --font: "Wix Madefor Display", system-ui, sans-serif;
  --font-ui: "Inter", system-ui, sans-serif;

  color-scheme: light;
}

/* Тёмная тема: по системной настройке или явно выбранная */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-canvas: #111110;
    --c-bg: #1b1b19;
    --c-surface: #242421;
    --c-surface-2: #2d2d2a;
    --c-line: #2f2f2c;
    --c-line-strong: #43433e;
    --c-text: #edede7;
    --c-text-2: #bdbdb5;
    --c-muted: #92928a;
    --c-faint: #5e5e58;
    --c-accent-tint: #2a2614;
    --c-accent-ink: #ffd84d;
    --c-focus: #ffd23f;
    --c-warn: #ff9d57;
    --c-warn-bg: #33220f;
    --c-warn-line: #5c3815;
    --c-free: #18261a;
    --c-free-ink: #9fd88a;
    --c-free-line: #2c4a2a;
    --c-fav: #f2c200;
    --c-scrim: rgba(0, 0, 0, .55);
    --av-bg: 28% 26%;
    --av-fg: 60% 82%;
    --logo-bg: #f3f3ee;
    --sh-xs: 0 0 0 1px rgba(255, 255, 255, .05), 0 1px 2px rgba(0, 0, 0, .3);
    --sh-sm: 0 0 0 1px rgba(255, 255, 255, .07), 0 2px 4px rgba(0, 0, 0, .3), 0 6px 16px rgba(0, 0, 0, .35);
    --sh-lg: 0 0 0 1px rgba(255, 255, 255, .06), 0 12px 32px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --c-canvas: #111110;
  --c-bg: #1b1b19;
  --c-surface: #242421;
  --c-surface-2: #2d2d2a;
  --c-line: #2f2f2c;
  --c-line-strong: #43433e;
  --c-text: #edede7;
  --c-text-2: #bdbdb5;
  --c-muted: #92928a;
  --c-faint: #5e5e58;
  --c-accent-tint: #2a2614;
  --c-accent-ink: #ffd84d;
  --c-focus: #ffd23f;
  --c-warn: #ff9d57;
  --c-warn-bg: #33220f;
  --c-warn-line: #5c3815;
  --c-free: #18261a;
  --c-free-ink: #9fd88a;
  --c-free-line: #2c4a2a;
  --c-fav: #f2c200;
  --c-scrim: rgba(0, 0, 0, .55);
  --av-bg: 28% 26%;
  --av-fg: 60% 82%;
  --logo-bg: #f3f3ee;
  --sh-xs: 0 0 0 1px rgba(255, 255, 255, .05), 0 1px 2px rgba(0, 0, 0, .3);
  --sh-sm: 0 0 0 1px rgba(255, 255, 255, .07), 0 2px 4px rgba(0, 0, 0, .3), 0 6px 16px rgba(0, 0, 0, .35);
  --sh-lg: 0 0 0 1px rgba(255, 255, 255, .06), 0 12px 32px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

/* =========================================================
   База
   ========================================================= */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--c-canvas);
  color: var(--c-text);
  font-family: var(--font);
  font-weight: 500;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h2, h3 { margin: 0; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.grow { flex: 1; }

/* ---------- Кнопки ---------- */
.btn {
  height: 40px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-full);
  font-weight: 600; white-space: nowrap;
  transition: background var(--dur), box-shadow var(--dur), opacity var(--dur), transform .1s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn--outline { background: var(--c-bg); box-shadow: var(--sh-xs); }
.btn--outline:hover:not(:disabled) { box-shadow: var(--sh-sm); }
.btn--outline:disabled { opacity: .45; box-shadow: none; background: transparent; }
.btn--accent { background: var(--c-accent); color: var(--c-on-accent); }
.btn--accent:hover { background: var(--c-accent-strong); }
.btn--soft { background: var(--c-surface); }
.btn--soft:hover { background: var(--c-surface-2); }

.icon-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--c-text-2);
  transition: background var(--dur), opacity var(--dur);
}
.icon-btn:hover:not(:disabled) { background: var(--c-surface); color: var(--c-text); }
.icon-btn:disabled { opacity: .3; }
.icon-btn--sm { width: 32px; height: 32px; }

/* ---------- Чипы ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px;
  border-radius: var(--r-full);
  background: var(--c-surface-2);
  font-family: var(--font-ui); font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.chip--live { background: var(--c-accent); color: var(--c-on-accent); }
.chip--live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-on-accent);
  animation: pulse 1.6s ease-in-out infinite;
}
.chip--next { background: var(--c-accent-tint); color: var(--c-accent-ink); }
.chip--muted { background: var(--c-surface); color: var(--c-muted); }
.chip--today { height: 20px; padding: 0 8px; background: var(--c-on-accent); color: var(--c-accent); }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- Сегмент-контрол (шапка и табы сайдбара) ---------- */
.segmented {
  position: relative; isolation: isolate;
  display: flex; height: 44px; padding: 3px;
  background: var(--c-bg);
  border-radius: var(--r-full);
  box-shadow: var(--sh-xs);
}
.segmented__thumb {
  position: absolute; top: 3px; bottom: 3px; left: 0; z-index: -1;
  border-radius: var(--r-full);
  background: var(--c-accent);
  box-shadow: 0 1px 2px rgba(40, 40, 20, .1);
}
.segmented.is-ready .segmented__thumb { transition: transform .28s var(--ease), width .28s var(--ease); }
.segmented__btn {
  flex: 1 1 auto;
  padding: 0 18px;
  border-radius: var(--r-full);
  font-weight: 600; white-space: nowrap;
  color: var(--c-text-2);
  transition: color var(--dur);
}
.segmented__btn:hover { color: var(--c-text); }
.segmented__btn.is-active { color: var(--c-text); }
#viewSwitch .segmented__btn.is-active { color: var(--c-on-accent); }

.segmented--tabs { flex: 1; min-width: 0; height: 40px; background: var(--c-surface); box-shadow: none; overflow-x: auto; scrollbar-width: none; }
.segmented--tabs::-webkit-scrollbar { display: none; }
.segmented--tabs .segmented__btn { flex: 1 1 auto; min-width: max-content; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.segmented--tabs .segmented__btn.is-active { color: var(--c-on-accent); }

/* ---------- Аватары ---------- */
.avatar {
  --h: 45;
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: hsl(var(--h) var(--av-bg));
  color: hsl(var(--h) var(--av-fg));
  font-size: 14px; font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.avatar--xs { width: 22px; height: 22px; border-radius: 7px; font-size: 9px; }
.avatar--lg { width: 56px; height: 56px; border-radius: 16px; font-size: 18px; }

/* ---------- Скелетоны ---------- */
.sk {
  border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--c-surface) 25%, var(--c-surface-2) 50%, var(--c-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.sk--row { height: 48px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- Пустые состояния ---------- */
.empty {
  flex: 1; align-self: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 56px 24px;
  text-align: center;
  color: var(--c-muted);
}
.empty b { font-size: 17px; color: var(--c-text); }
.empty .btn { margin-top: 12px; }
.empty__icon {
  width: 56px; height: 56px; margin-bottom: 8px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: var(--c-accent-tint); color: var(--c-accent-ink);
}
.empty__icon svg { width: 24px; height: 24px; }
.empty__icon--warn { background: var(--c-warn-bg); color: var(--c-warn); }
.empty__icon--muted { background: var(--c-surface); color: var(--c-muted); }
.empty { justify-content: center; }
.spin {
  display: block; width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--c-line-strong); border-top-color: var(--c-accent-strong);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Полоска дней в состояниях без расписания */
.strip--off { opacity: .45; pointer-events: none; }
.strip--still { pointer-events: none; }
.strip--still .strip__day, .strip--still .strip__day.is-active, .strip--still .strip__day.is-today:not(.is-active) { background: var(--c-surface); box-shadow: none; color: var(--c-faint); }
.strip--still .strip__wd, .strip--still .strip__num { color: var(--c-faint); }

.callout {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 13px; line-height: 1.4;
}
.callout svg { margin-top: 2px; }
.callout--warn { background: var(--c-warn-bg); color: var(--c-warn); box-shadow: inset 0 0 0 1px var(--c-warn-line); }
.callout b { font-weight: 700; }

/* =========================================================
   Каркас
   ========================================================= */
.app {
  height: 100vh; height: 100dvh;
  padding: 12px;
  display: flex; flex-direction: column;
  gap: var(--gap);
}
.app__head {
  height: 68px; flex-shrink: 0;
  display: flex; gap: var(--gap);
}
.app__body {
  flex: 1; min-height: 0;
  display: flex; gap: var(--gap);
  transition: gap .3s var(--ease);
}
.app.is-collapsed .brand     { width: var(--brand-w); }
.app.is-collapsed .sidebar   { width: 0; padding-inline: 0; visibility: hidden; pointer-events: none; transition: width .3s var(--ease), padding .3s var(--ease), visibility 0s .35s; }
.app.is-collapsed .app__body { gap: 0; }

/* ---------- Логотип ---------- */
.brand {
  width: var(--sidebar-w); flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px 0 14px;
  background: var(--c-bg);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-xs);
  transition: width .3s var(--ease);
}
/* Иконка кнопки зависит от состояния панели: «‹» — можно свернуть; свёрнутая панель в покое — простой значок,
   при наведении — «›» (развернуть) */
#sidebarToggle .ico-show, #sidebarToggle .ico-rest { display: none; }
.app.is-collapsed #sidebarToggle .ico-hide { display: none; }
.app.is-collapsed #sidebarToggle .ico-rest { display: block; }
@media (hover: hover) {
  .app.is-collapsed:not(.is-drawer-open) #sidebarToggle:hover .ico-rest,
  .app.is-collapsed:not(.is-drawer-open) #sidebarToggle:focus-visible .ico-rest { display: none; }
  .app.is-collapsed:not(.is-drawer-open) #sidebarToggle:hover .ico-show,
  .app.is-collapsed:not(.is-drawer-open) #sidebarToggle:focus-visible .ico-show { display: block; }
}
@media (max-width: 900px) {
  #sidebarToggle .ico-hide { display: none; }
  #sidebarToggle .ico-rest { display: block; }
  .app.is-drawer-open #sidebarToggle .ico-hide { display: block; }
  .app.is-drawer-open #sidebarToggle .ico-rest { display: none; }
}
.brand__logo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand__logo img { border-radius: 11px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.brand__name { font-size: 15px; font-weight: 700; }
.brand__sub { font-size: 13px; color: var(--c-muted); }

/* ---------- Шапка расписания ---------- */
.topbar {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 0 0 8px;
}
.topbar__title { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.topbar__kind { font-size: 13px; color: var(--c-muted); }
.topbar__name {
  font-size: 26px; font-weight: 800; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.toolbar { display: flex; align-items: center; gap: 10px; }
.toolbar__nav { display: contents; }
.today-btn { height: 44px; }

.pager {
  height: 44px; padding: 3px;
  display: flex; align-items: center;
  background: var(--c-bg);
  border-radius: var(--r-full);
  box-shadow: var(--sh-xs);
}
.pager__btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--c-text-2);
  transition: background var(--dur), transform .1s;
}
.pager__btn:hover { background: var(--c-surface); color: var(--c-text); }
.pager__btn:active { transform: scale(.9); }
.pager__label {
  width: 176px;
  display: flex; flex-direction: column; align-items: center;
  line-height: 1.2;
}
.pager__main { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pager__sub { font-size: 11.5px; color: var(--c-muted); white-space: nowrap; }
.pager__back {
  display: none; align-items: center;
  height: 18px; margin-top: 1px; padding: 0 8px;
  border-radius: var(--r-full);
  background: var(--c-accent); color: var(--c-on-accent);
  font: 600 11px var(--font-ui); white-space: nowrap;
}

/* =========================================================
   Сайдбар
   ========================================================= */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px;
  background: var(--c-bg);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-xs);
  min-height: 0; min-width: 0;
  overflow: hidden;
  transition: width .3s var(--ease), padding .3s var(--ease);
}

@keyframes sidebar-in {
  from { transform: translateX(calc(-1 * var(--sidebar-w))); }
  to   { transform: translateX(0); }
}
@keyframes sidebar-out {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-1 * var(--sidebar-w))); }
}
.sidebar--expanding > * { animation: sidebar-in .25s var(--ease) both; }
.sidebar--expanding > *:nth-child(1) { animation-delay: 0s; }
.sidebar--expanding > *:nth-child(2) { animation-delay: .05s; }
.sidebar--expanding > *:nth-child(3) { animation-delay: .1s; }
.sidebar--expanding > *:nth-child(4) { animation-delay: .15s; }
.sidebar--expanding > *:nth-child(5) { animation-delay: .2s; }

.sidebar--collapsing > * { animation: sidebar-out .2s ease both; }
.sidebar--collapsing > *:nth-child(1) { animation-delay: .20s; }
.sidebar--collapsing > *:nth-child(2) { animation-delay: .15s; }
.sidebar--collapsing > *:nth-child(3) { animation-delay: .10s; }
.sidebar--collapsing > *:nth-child(4) { animation-delay: .05s; }
.sidebar--collapsing > *:nth-child(5) { animation-delay: 0s; }

/* Поиск */
/* Шапка сайдбара (бренд + кнопка закрытия) нужна только шторке на телефоне; на десктопе панель сворачивает кнопка в шапке страницы */
.sidebar__head { display: none; }

.search {
  height: 40px; flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 8px 0 14px;
  background: var(--c-surface);
  border-radius: var(--r-full);
  color: var(--c-muted);
  cursor: text;
  transition: background var(--dur), box-shadow var(--dur);
}
.search:hover { background: var(--c-surface-2); }
.search:focus-within { background: var(--c-bg); box-shadow: 0 0 0 2px var(--c-accent-strong); }
.search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font: inherit; color: var(--c-text);
}
.search input::placeholder { color: var(--c-muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search__kbd {
  min-width: 22px; height: 22px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--c-bg); box-shadow: inset 0 0 0 1px var(--c-line);
  font: 600 11px var(--font-ui); color: var(--c-muted);
}
.search:focus-within .search__kbd,
.search input:not(:placeholder-shown) ~ .search__kbd { display: none; }
.search__clear {
  width: 26px; height: 26px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--c-muted);
}
.search__clear:hover { background: var(--c-surface-2); color: var(--c-text); }

/* Табы каталога */
.filters { display: flex; gap: 8px; }

/* Хлебные крошки */
.crumbs { display: flex; align-items: center; gap: 4px; min-height: 32px; }
.crumb {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 2px;
  font-size: 13px;
  white-space: nowrap; overflow: hidden;
}
.crumb__btn {
  padding: 4px 6px; border-radius: var(--r-sm);
  color: var(--c-muted);
  overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 1;
}
.crumb__btn:first-child { flex-shrink: 0; }
.crumb__btn:hover { background: var(--c-surface); color: var(--c-text); }
.crumb__sep { color: var(--c-faint); flex-shrink: 0; }
.crumb__cur { padding: 4px 6px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; max-width: 60%; }

/* Список */
.list-wrap {
  flex: 1; min-height: 0;
  margin: 0 -6px; padding: 0 6px;
  overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--c-line-strong) transparent;
}
.list { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 8px; }
.list .sk--row { margin-bottom: 4px; }
.list__empty {
  display: flex; flex-direction: column; gap: 4px;
  padding: 32px 16px;
  text-align: center; color: var(--c-muted); font-size: 13px; line-height: 1.4;
}
.list__empty b { font-size: 15px; color: var(--c-text); }

.list__more { padding: 8px 14px; font-size: 12.5px; color: var(--c-muted); }
.spin--sm { display: inline-block; width: 14px; height: 14px; border-width: 2px; margin-right: 8px; vertical-align: -2px; }
/* Глобальный поиск идёт по всем корпусам и типам сразу, поэтому вкладки и «хлебные крошки» на время поиска не нужны */
.sidebar.is-searching .filters, .sidebar.is-searching .crumbs { display: none; }

.list-sep {
  padding: 10px 14px 4px;
  display: flex; align-items: center; gap: 8px;
}
.list-sep span {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted);
}
.list-sep::before, .list-sep::after {
  content: ""; flex: 1; height: 1px; background: var(--c-line);
}

.entity {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px;
  padding: 6px 6px 6px 8px;
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: background var(--dur);
}
.entity:hover { background: var(--c-surface); }
.entity:active { background: var(--c-surface-2); }
.entity.is-selected { background: var(--c-accent-tint); }
.entity__badge {
  min-width: 40px; height: 40px; padding: 0 8px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--c-surface);
  font-weight: 700; font-variant-numeric: tabular-nums;
  transition: background var(--dur);
}
.entity:hover .entity__badge { background: var(--c-bg); box-shadow: var(--sh-xs); }
.entity.is-selected .entity__badge { background: var(--c-accent); color: var(--c-on-accent); box-shadow: none; }
.entity__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.entity__title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity.is-selected .entity__title { font-weight: 700; }
.entity__hint { font-size: 12.5px; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity__chev { color: var(--c-faint); margin-right: 6px; transition: transform var(--dur), color var(--dur); }
.entity:hover .entity__chev { color: var(--c-text-2); transform: translateX(2px); }
.entity__fav {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--c-muted);
  opacity: 0;
  transition: opacity var(--dur), background var(--dur), color var(--dur);
}
.entity:hover .entity__fav, .entity__fav:focus-visible, .entity.is-selected .entity__fav { opacity: 1; }
.entity__fav:hover { background: var(--c-bg); color: var(--c-text); }
.entity__fav[aria-pressed="true"] { opacity: 1; color: var(--c-fav); }
.entity__fav[aria-pressed="true"] path { fill: var(--c-accent); stroke: var(--c-fav); }
@media (hover: none) { .entity__fav { opacity: 1; } }

/* Моё: быстрый доступ из профиля */
.mine { flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; }
.mine[hidden] { display: none; }
.sidebar.is-searching .mine { display: none; }
.mine__head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 8px; }
.mine__title, .msec__title { font: 600 11px var(--font-ui); color: var(--c-muted); text-transform: uppercase; letter-spacing: .07em; }
.mine__edit { height: 26px; padding: 0 8px; border-radius: var(--r-full); font: 600 12px var(--font-ui); color: var(--c-muted); }
.mine__edit:hover { background: var(--c-surface); color: var(--c-text); }
.mine__list { display: flex; flex-direction: column; gap: 2px; }
.mine__item { width: 100%; min-height: 48px; text-align: left; }
.mine__item .avatar { width: 40px; height: 40px; }
.mine__item.is-missing .entity__hint { color: var(--c-warn); }
/* Разделы панели: «Моё» и «Все расписания» — каждому вся высота */
.segmented--side { flex-shrink: 0; height: 44px; background: var(--c-surface); box-shadow: none; }
.segmented--side .segmented__btn { flex: 1 1 0; padding: 0 12px; }
.segmented--side .segmented__btn.is-active { color: var(--c-on-accent); }
.sidebar[data-side="mine"] .search,
.sidebar[data-side="mine"] .filters,
.sidebar[data-side="mine"] .crumbs { display: none; }
.sidebar[data-side="all"] .mine { display: none; }
.sidebar .mine { padding-bottom: 4px; }
/* Быстрый доступ — карточкой, избранное ниже со своим заголовком: два раздела не сливаются */
.sidebar .mine:has(.mine__list) { padding: 8px 6px 6px; border-radius: var(--r-xl); background: var(--c-surface); }
.sidebar .mine .mine__item:hover { background: var(--c-bg); }
.sidebar .mine .mine__item:not(.is-selected) .entity__badge { background: var(--c-bg); }
.sidebar .mine .mine__edit:hover { background: var(--c-bg); }
.list-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px; font: 600 11px var(--font-ui); color: var(--c-muted); text-transform: uppercase; letter-spacing: .07em; list-style: none; }
.list-head__icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: var(--c-accent); color: var(--c-on-accent); }
.list-head__icon svg { width: 13px; height: 13px; }
.list-head__icon path { fill: currentColor; }
.list-head__count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: var(--r-full); background: var(--c-surface); color: var(--c-text-2); letter-spacing: 0; }

.mine-hint {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--c-accent-tint);
}
.mine-hint__text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.35; }
.mine-hint__text span { color: var(--c-text-2); }
.mine-hint__actions { display: flex; gap: 8px; }
.btn--sm { height: 32px; padding: 0 14px; font-size: 13px; }

/* Пометка «своего» расписания в заголовке */
.topbar__kind { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mine-mark:empty { display: none; }
.mine-mark { display: inline-flex; }
.mine-tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px;
  border-radius: var(--r-full);
  background: var(--c-accent); color: var(--c-on-accent);
  font: 600 11px var(--font-ui); white-space: nowrap;
}
.mine-tag svg { width: 12px; height: 12px; }
.mine-tag--btn { cursor: pointer; transition: background var(--dur), box-shadow var(--dur); }
.mine-tag--add { background: transparent; color: var(--c-text-2); box-shadow: inset 0 0 0 1px var(--c-line-strong); }
.mine-tag--add:hover { background: var(--c-accent-tint); color: var(--c-accent-ink); box-shadow: inset 0 0 0 1px var(--c-accent-strong); }

.me-btn { position: relative; width: 44px; height: 44px; background: var(--c-bg); box-shadow: var(--sh-xs); }
.me-btn:hover:not(:disabled) { background: var(--c-bg); box-shadow: var(--sh-sm); }
.me-btn.is-on { background: var(--c-accent); color: var(--c-on-accent); box-shadow: none; }
.me-btn.is-on:hover:not(:disabled) { background: var(--c-accent-strong); }

/* Окно профиля */
.role-switch { display: flex; gap: 4px; padding: 3px; border-radius: var(--r-full); background: var(--c-surface); }
.role-switch button { flex: 1; height: 38px; border-radius: var(--r-full); font-weight: 600; color: var(--c-text-2); transition: background var(--dur), color var(--dur); }
.role-switch button:hover { color: var(--c-text); }
.role-switch button[aria-checked="true"] { background: var(--c-accent); color: var(--c-on-accent); box-shadow: 0 1px 2px rgba(40, 40, 20, .1); }
.picker { display: flex; flex-direction: column; gap: 4px; }
.picker__list { display: flex; flex-direction: column; gap: 2px; list-style: none; margin: 0; padding: 0; }
.picker__list:empty { display: none; }
.picker__item { width: 100%; min-height: 48px; text-align: left; }
.picker__item .avatar, .p-chosen .avatar { width: 40px; height: 40px; }
.p-chosen { cursor: default; background: var(--c-accent-tint); }
.p-chosen:hover { background: var(--c-accent-tint); }
.p-chosen .entity__badge { background: var(--c-accent); color: var(--c-on-accent); }
/* у .modal__x отрицательные отступы под угол окна — внутри строки они сдвигали крестик */
.p-chosen .p-chosen__x { width: 32px; height: 32px; margin: 0 2px 0 0; align-self: center; flex-shrink: 0; background: var(--c-bg); }
.p-note { margin: 0; font-size: 13px; line-height: 1.4; color: var(--c-muted); }
.p-add { align-self: flex-start; height: 32px; padding: 0 12px; border-radius: var(--r-full); font: 600 13px var(--font-ui); color: var(--c-text-2); background: var(--c-surface); }
.p-add:hover { background: var(--c-surface-2); color: var(--c-text); }
.p-add[hidden], .p-add-slot[hidden] { display: none; }
.p-reset { align-self: flex-start; padding: 4px 0; font-size: 13px; color: var(--c-muted); text-decoration: underline; text-underline-offset: 3px; }
.p-reset:hover { color: var(--c-warn); }

/* Настройки */
.settings {
  flex-shrink: 0;
  display: flex; flex-direction: column;
  margin: 0 -4px; padding-top: 8px;
  border-top: 1px solid var(--c-line);
}
.settings__row {
  display: flex; align-items: center; gap: 12px;
  height: 36px; padding: 0 10px;
  border-radius: var(--r-md);
  text-align: left; font-size: 13px; color: var(--c-text-2);
  text-decoration: none;
}
.settings__row:hover:not(:disabled) { background: var(--c-surface); color: var(--c-text); }
@media (pointer: coarse), (max-width: 700px) { .settings__row { height: 44px; } }
.settings__icon { color: var(--c-muted); }
.settings__label { flex: 1; }
.settings__value { font: 600 12px var(--font-ui); color: var(--c-muted); }
.settings__soon {
  height: 20px; padding: 0 8px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--c-surface);
  font: 600 10.5px var(--font-ui); color: var(--c-muted);
}

/* =========================================================
   Расписание — общая обёртка
   ========================================================= */
.week-wrap {
  flex: 1; min-width: 0; min-height: 0;
  background: var(--c-bg);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-xs);
  overflow: hidden;
}
.week {
  height: 100%;
  display: grid; gap: 6px; align-items: start; align-content: start;
  grid-auto-rows: max-content; /* строка = самая высокая карточка, а не доля свободного места */
  grid-template-columns: repeat(6, minmax(var(--day-w), 320px));
  justify-content: safe center;
  padding: 8px;
  overflow: auto;
  cursor: grab;
  scrollbar-width: thin; scrollbar-color: var(--c-line-strong) transparent;
}
.week:active { cursor: grabbing; }
.week.is-msg, .week.is-day { cursor: auto; }
.week.is-day, .week.is-msg { display: flex; }
.week.is-msg { align-items: center; }
.week.is-loading { pointer-events: none; }

/* Анимация перехода по периодам */
.week[data-anim="next"] > .day, .week[data-anim="next"] .dv-content { animation: slide-next .28s var(--ease) both; }
.week[data-anim="prev"] > .day, .week[data-anim="prev"] .dv-content { animation: slide-prev .28s var(--ease) both; }
.week[data-anim] > .day:nth-child(2) { animation-delay: .02s; }
.week[data-anim] > .day:nth-child(3) { animation-delay: .04s; }
.week[data-anim] > .day:nth-child(4) { animation-delay: .06s; }
.week[data-anim] > .day:nth-child(5) { animation-delay: .08s; }
.week[data-anim] > .day:nth-child(6) { animation-delay: .1s; }
@keyframes slide-next { from { opacity: 0; transform: translateX(16px); } }
@keyframes slide-prev { from { opacity: 0; transform: translateX(-16px); } }

/* =========================================================
   Режим «Неделя»
   ========================================================= */
.day {
  --day-bg: var(--c-bg);
  /* колонка дня занимает все строки общей сетки; строки (subgrid) общие у всех дней */
  grid-row: span var(--rows, 5);
  display: grid; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr);
  padding: 6px;
  border-radius: var(--r-xl);
  background: var(--day-bg);
}
.day.is-today { --day-bg: var(--c-accent-tint); }

.day__head {
  position: sticky; top: -8px; z-index: 2;
  display: flex; flex-direction: column; gap: 6px;
  padding-bottom: 2px;
  background: var(--day-bg);
  box-shadow: 0 -8px 0 6px var(--day-bg);
}
.day-head {
  width: 100%; height: 40px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 8px 0 12px;
  border-radius: var(--r-md);
  text-align: left;
  transition: background var(--dur);
}
.day-head:hover { background: var(--c-surface); }
.day.is-today .day-head { background: var(--c-accent); color: var(--c-on-accent); }
.day-head__wd { font-weight: 800; }
.day-head__date { color: var(--c-muted); font-variant-numeric: tabular-nums; }
.day.is-today .day-head__date { color: var(--c-on-accent); }
.day-head .chip { margin-left: 2px; }
.day-head__go { margin-left: auto; color: var(--c-faint); opacity: 0; transform: translateX(-4px); transition: opacity var(--dur), transform var(--dur); }
.day-head:hover .day-head__go, .day-head:focus-visible .day-head__go { opacity: 1; transform: none; color: var(--c-text-2); }
.day.is-today .day-head__go { color: var(--c-on-accent); }

.day__empty {
  grid-row: 2 / -1; padding: 24px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; color: var(--c-muted);
}
.day__empty b { font-size: 14px; color: var(--c-text); }
.day__empty .empty__icon { width: 44px; height: 44px; margin-bottom: 4px; border-radius: 14px; }
.day__empty .empty__icon svg { width: 22px; height: 22px; }

.shift-divider {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0;
  font: 600 10.5px var(--font-ui); color: var(--c-muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.shift-divider::before, .shift-divider::after { content: ""; flex: 1; height: 1px; background: var(--c-line-strong); }
.shift-divider:empty { gap: 0; } /* рядом нет реальной пары — линия без подписи, длительность не выдумываем */
.shift-divider.is-overlap { color: var(--c-warn); }
.shift-divider.is-overlap::before, .shift-divider.is-overlap::after { background: var(--c-warn-line); }

/* ---------- Карточка пары ---------- */
.lesson {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px 12px;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  cursor: pointer;
  overflow: hidden;
  transition: background var(--dur), box-shadow var(--dur), transform .12s;
}
.lesson:hover { background: var(--c-bg); box-shadow: var(--sh-sm); }
.lesson:active { transform: scale(.985); }
.day.is-today .lesson { background: var(--c-bg); box-shadow: var(--sh-xs); }
.day.is-today .lesson:hover { box-shadow: var(--sh-sm); }

.lesson.is-now { background: var(--c-bg); box-shadow: 0 0 0 2px var(--c-accent-strong), var(--sh-sm); }
.lesson.is-now::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 4px;
  background: var(--c-line-strong);
}
.lesson.is-now::after {
  content: ""; position: absolute; left: 0; bottom: 0; z-index: 1;
  width: var(--progress, 0%); height: 4px;
  background: var(--c-accent-strong);
  border-radius: 0 3px 3px 0;
}
.lesson.is-next { box-shadow: 0 0 0 1px var(--c-accent-strong), var(--sh-xs); }

.lesson__meta {
  display: flex; align-items: center; gap: 8px;
  min-height: 22px;
  font-size: 12px; color: var(--c-text-2);
}
.lesson__num {
  min-width: 22px; height: 22px; padding: 0 6px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--c-bg); box-shadow: inset 0 0 0 1px var(--c-line);
  font-size: 12px; font-weight: 800; color: var(--c-text);
  font-variant-numeric: tabular-nums;
}
.lesson__time { font-family: var(--font-ui); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lesson__note { display: grid; color: var(--c-warn); }

.lesson__title {
  font-size: 14.5px; font-weight: 700; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  word-break: break-word;
}

/* В неделе название — максимум 2 строки; если в растянутой карточке есть место, JS (fitTitles) добавляет строки.
   Кабинет и преподаватель прижаты к низу */
.day .lesson__title { -webkit-line-clamp: var(--clamp, 2); }
.day .lesson .parts { margin-top: auto; }
/* у подгрупп разные предметы — у каждого свой блок «предмет + кабинет и кто» */
.lesson__block { display: flex; flex-direction: column; gap: 6px; }
.lesson__block + .lesson__block { padding-top: 8px; border-top: 1px dashed var(--c-line-strong); }
.day .lesson .lesson__block .parts { margin-top: 0; }
.parts { display: flex; flex-direction: column; gap: 4px; }
.part { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; }
.part:has(.who-stack) { align-items: stretch; }
.sg {
  width: 18px; height: 18px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--c-text); color: var(--c-bg);
  font: 700 10.5px var(--font-ui);
}
.sg--lg { width: auto; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 12px; white-space: nowrap; font-size: 15px; background: var(--c-bg); color: var(--c-text); box-shadow: inset 0 0 0 1px var(--c-line); }
.room {
  display: flex; align-items: center; justify-content: center;
  min-width: 40px; padding: 2px 8px; flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--c-bg); box-shadow: inset 0 0 0 1px var(--c-line-strong);
  font-weight: 800; text-align: center; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.room.is-changed { background: var(--c-warn-bg); color: var(--c-warn); box-shadow: inset 0 0 0 1px var(--c-warn-line); }
.who-stack { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.who-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.room--lg { padding: 4px 10px; font-size: 15px; }
.who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-text-2); }

/* Прошедшая пара (неделя и день): тусклая карточка, зачёркнутое название, серая полоска слева */
.lesson.is-past { opacity: .7; }
.lesson.is-past:hover { opacity: 1; }
.lesson.is-past .lesson__title { text-decoration: line-through; text-decoration-color: var(--c-text-2); text-decoration-thickness: 2px; color: var(--c-text-2); }
.lesson.is-past::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c-line-strong); }

/* Пустой слот */
.slot {
  min-height: 32px; padding: 0 12px 0 8px;
  display: flex; align-items: center; gap: 8px;
  border-radius: var(--r-lg);
  border: 1px dashed var(--c-line-strong);
  color: var(--c-faint); font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.slot__num { min-width: 22px; text-align: center; font-weight: 800; }
.slot__time { font-family: var(--font-ui); }

/* =========================================================
   Режим «День»
   ========================================================= */
.week.is-day { display: block; padding: 0; }
.dayview {
  max-width: 760px; margin: 0 auto;
  padding: 0 24px 40px;
  min-height: 100%; /* пустые состояния центрируются по всей высоте области */
  display: flex; flex-direction: column; gap: 16px;
}
.week.is-loading .dayview { padding-top: 16px; }
.dayview:has(> .dv-content > .empty) { padding-bottom: 0; } /* без нижнего отступа состояние центрируется точно */
.dv-content { flex: 1; display: flex; flex-direction: column; gap: 16px; }

/* Полоса дней недели */
.strip {
  position: sticky; top: 0; z-index: 3;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
  padding: 16px 24px 10px;
  margin: 0 -24px;
  background: linear-gradient(var(--c-bg) 85%, transparent);
}
.strip__day {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px 7px;
  border-radius: var(--r-lg);
  transition: background var(--dur), transform .1s;
}
.strip__day:hover { background: var(--c-surface); }
.strip__day:active { transform: scale(.96); }
.strip__wd { font-size: 12px; color: var(--c-muted); }
.strip__num { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.strip__dots { display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 100%; }
.strip__dots span { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; min-height: 4px; }
.strip__dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--c-line-strong); }
.strip__dots i.is-empty { background: none; box-shadow: inset 0 0 0 1px var(--c-line-strong); opacity: .7; }
.strip__day.is-today .strip__wd { color: var(--c-accent-ink); font-weight: 700; }
.strip__day.is-today:not(.is-active) { box-shadow: inset 0 0 0 1.5px var(--c-accent-strong); }
.strip__day.is-active { background: var(--c-accent); color: var(--c-on-accent); }
.strip__day.is-active .strip__wd { color: var(--c-on-accent); }
.strip__day.is-active .strip__dots i { background: var(--c-on-accent); opacity: .45; }
.strip__day.is-active .strip__dots i.is-empty { background: none; box-shadow: inset 0 0 0 1px var(--c-on-accent); opacity: .35; }

.dv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.dv-title { font-size: 30px; font-weight: 800; letter-spacing: -.015em; line-height: 1.1; }
.dv-date { color: var(--c-text-2); }
.dv-summary {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: var(--r-full);
  background: var(--c-surface);
  font-size: 13px; color: var(--c-text-2);
  font-variant-numeric: tabular-nums;
}

/* Таймлайн */
.timeline { display: flex; flex-direction: column; }
.tl-row {
  display: grid; grid-template-columns: 52px 20px 1fr; column-gap: 12px;
  padding-bottom: 10px;
}
.tl-time {
  display: flex; flex-direction: column; align-items: flex-end;
  padding-top: 26px;
  font-variant-numeric: tabular-nums; line-height: 1.25;
}
.tl-start { font-size: 15px; font-weight: 800; }
.tl-end { font-size: 12.5px; color: var(--c-muted); }
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-rail::before {
  content: ""; position: absolute; top: 0; bottom: -10px; width: 2px;
  background: var(--c-line);
}
.tl-row:first-child .tl-rail::before { top: 32px; }
.tl-row:last-child .tl-rail::before { bottom: auto; height: 32px; }
.tl-row:first-child:last-child .tl-rail::before { display: none; }
/* Прогресс дня: пройденная часть линии и точки — жёлтые, текущая пара заполняет линию по ходу пары, остальное серое */
.tl-row.is-past .tl-rail::before { background: var(--c-accent-strong); }
.tl-row.is-now .tl-rail::before { background: linear-gradient(var(--c-accent-strong) calc(36px + (100% - 36px) * var(--p, 0)), var(--c-line) 0); }
.tl-dot {
  position: relative; z-index: 1;
  width: 12px; height: 12px; margin-top: 30px;
  border-radius: 50%;
  background: var(--c-bg); box-shadow: inset 0 0 0 2px var(--c-line-strong);
}
.tl-row.is-past .tl-dot { background: var(--c-accent-strong); box-shadow: none; }
.tl-row.is-now .tl-dot { background: var(--c-accent-strong); box-shadow: 0 0 0 5px rgba(242, 194, 0, .25); }
.tl-row--window .tl-dot { width: 8px; height: 8px; margin-top: 20px; }
/* Точка перерыва: меньше обычной, на одном уровне с подписью «Перерыв N мин» */
.tl-dot--break { width: 8px; height: 8px; margin-top: 3px; }
.tl-row--shift.is-now .tl-dot--break { box-shadow: 0 0 0 4px rgba(242, 194, 0, .25); }
/* пока пара (или перерыв) идёт, точка на линии мигает и расходится кольцом */
@media (prefers-reduced-motion: no-preference) {
  .tl-row.is-now .tl-dot, .tl-row--shift.is-now .tl-dot--break { animation: dot-ping 1.6s ease-in-out infinite; }
  @keyframes dot-ping {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(242, 194, 0, .6); }
    50% { transform: scale(1.18); box-shadow: 0 0 0 8px rgba(242, 194, 0, .18); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(242, 194, 0, 0); }
  }
}
.tl-row--shift.is-now .tl-rail::before { background: linear-gradient(var(--c-accent-strong) calc(7px + (100% - 7px) * var(--p, 0)), var(--c-line) 0); }
.tl-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tl-num { padding-left: 4px; font: 600 11px var(--font-ui); color: var(--c-muted); text-transform: uppercase; letter-spacing: .05em; }
.tl-row.is-now .tl-num { color: var(--c-accent-ink); }
.tl-row--shift { padding-bottom: 6px; }
.tl-row--shift .shift-divider { margin: 0; }
.tl-row--window .tl-time { padding-top: 16px; opacity: .6; }
.window {
  height: 36px; padding: 0 14px;
  display: flex; align-items: center;
  border-radius: var(--r-lg);
  border: 1px dashed var(--c-line-strong);
  color: var(--c-muted); font-size: 13px;
}

/* Карточка в режиме «День» — просторнее и подробнее */
.lesson--full { padding: 14px 16px 16px; gap: 10px; }
.lesson--full .lesson__meta { min-height: 0; }
.lesson--full .lesson__title { font-size: 17px; display: block; }
.lesson--full .parts { gap: 8px; }
.lesson--full .part { font-size: 14px; gap: 8px; }
.lesson--full .who { color: var(--c-text); white-space: normal; }
.lesson__notes { margin: 0; font-size: 13px; line-height: 1.4; color: var(--c-warn); }
.dayview .callout { margin-left: 84px; }

/* =========================================================
   Детали пары (модалка / нижняя шторка)
   ========================================================= */
.modal {
  border: 0; padding: 0;
  width: min(540px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  border-radius: var(--r-2xl);
  background: var(--c-bg); color: var(--c-text);
  box-shadow: var(--sh-lg);
}
.modal::backdrop { background: var(--c-scrim); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in .22s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal__inner {
  padding: 24px;
  display: flex; flex-direction: column; gap: 20px;
  max-height: inherit; overflow-y: auto;
}
.modal__grip { display: none; }
.modal__top { display: flex; align-items: flex-start; gap: 12px; }
.modal__head { flex: 1; min-width: 0; outline: 0; }
.modal__x {
  width: 36px; height: 36px; margin: -6px -6px 0 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-text-2);
}
.modal__x:hover { background: var(--c-surface-2); color: var(--c-text); }
.modal__x:focus:not(:focus-visible) { outline: 0; }

.modal__meta {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  margin-bottom: 10px;
  font-size: 13px; color: var(--c-text-2);
  font-variant-numeric: tabular-nums;
}
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-item svg { color: var(--c-muted); }
.modal__subject { font-size: 22px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.modal__sub:empty { display: none; }
.modal__sub { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--c-muted); }
.modal__body { display: flex; flex-direction: column; gap: 18px; }
.set-sec { display: flex; flex-direction: column; gap: 8px; }
.set-sec__title { margin: 0; font: 700 11.5px var(--font-ui); letter-spacing: .04em; text-transform: uppercase; color: var(--c-muted); }
.set-choice { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-full); background: var(--c-surface); }
.set-choice__btn { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border-radius: var(--r-full); font-size: 13px; font-weight: 600; color: var(--c-text-2); transition: color var(--dur), background var(--dur); }
.set-choice__btn:hover { color: var(--c-text); }
.set-choice__btn.is-active { background: var(--c-accent); color: var(--c-on-accent); }
.set-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.set-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: var(--r-md); background: var(--c-surface); color: var(--c-text); font-size: 14px; font-weight: 600; text-decoration: none; }
a.set-row:hover { background: var(--c-surface-2); }
.set-row.is-off { color: var(--c-muted); }
.set-row.is-current { box-shadow: inset 0 0 0 1.5px var(--c-accent-strong); }
.set-row svg { flex-shrink: 0; color: var(--c-accent-ink); }
.set-row .set-icon { color: var(--c-muted); }
.set-row__label { flex: 1; min-width: 0; }
.set-row__note { font-size: 12.5px; font-weight: 500; color: var(--c-muted); }

.msec { display: flex; flex-direction: column; gap: 8px; }
.msec__title { font: 600 11px var(--font-ui); color: var(--c-muted); text-transform: uppercase; letter-spacing: .07em; }

.place {
  display: flex; align-items: center; gap: 14px;
  padding: 10px;
  border-radius: var(--r-xl);
  background: var(--c-surface);
}
.place__room {
  min-width: 64px; height: 56px; padding: 0 12px;
  display: grid; place-items: center;
  border-radius: var(--r-lg);
  background: var(--c-bg); box-shadow: var(--sh-xs);
  font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.place.is-changed .place__room { background: var(--c-warn-bg); color: var(--c-warn); box-shadow: inset 0 0 0 1px var(--c-warn-line); }
.place__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.place__corps { font-weight: 700; }
.place__addr { font-size: 13px; color: var(--c-muted); }

.nav-item { cursor: pointer; transition: opacity .15s; }
.nav-item:hover { opacity: .72; }
.nav-item:active { opacity: .5; }
.nav-item:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; border-radius: var(--r-sm); }

.person { display: flex; align-items: center; gap: 14px; }
.person__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.person__label { font-size: 12.5px; color: var(--c-muted); }
.person__name { font-size: 16px; font-weight: 700; }


.sg-list { display: flex; flex-direction: column; gap: 6px; }
.sg-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 10px;
  border-radius: var(--r-xl);
  background: var(--c-surface);
}
.sg-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sg-row__label { font-size: 12.5px; color: var(--c-muted); }
.sg-row__subject { font-size: 13px; font-weight: 600; color: var(--c-text-2); line-height: 1.3; }
.sg-row__name { font-weight: 700; }
.sg-row__room { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11.5px; color: var(--c-muted); }

/* =========================================================
   Узкие экраны
   ========================================================= */
.drawer-backdrop { display: none; }

/* =========================================================
   Весь корпус: шахматка кабинетов × пар, табло свободных
   ========================================================= */
.week.is-building { display: flex; align-items: stretch; padding: 0; overflow: hidden; cursor: auto; }
.week[data-anim="next"] .bscroll { animation: slide-next .28s var(--ease) both; }
.week[data-anim="prev"] .bscroll { animation: slide-prev .28s var(--ease) both; }
.bview { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.chip--free { background: var(--c-free); color: var(--c-free-ink); }
.chip--xs { height: 18px; padding: 0 7px; font-size: 10.5px; }

/* Шапка экрана: дни, сводка, инструменты */
.bbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 10px 10px 8px; }
.strip.strip--bar {
  position: static; margin: 0; padding: 0; background: none;
  grid-template-columns: repeat(6, 54px); gap: 4px;
}
.strip--bar .strip__day { padding: 6px 4px 5px; background: var(--c-surface); }
.strip--bar .strip__day:hover { background: var(--c-surface-2); }
.strip--bar .strip__day.is-active { background: var(--c-accent); }
.strip--bar .strip__num { font-size: 16px; }
.bsummary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bsummary__text { font-weight: 700; }
.bbar__tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bfind {
  height: 40px; width: 230px;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border-radius: var(--r-full); background: var(--c-surface); color: var(--c-muted);
  transition: background var(--dur), box-shadow var(--dur);
}
.bfind:hover { background: var(--c-surface-2); }
.bfind:focus-within { background: var(--c-bg); box-shadow: 0 0 0 2px var(--c-accent-strong); }
.bfind input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; color: var(--c-text); }
.bfind input::placeholder { color: var(--c-muted); }
.bfind input::-webkit-search-cancel-button { display: none; }
.bfind__clear { width: 22px; height: 22px; flex-shrink: 0; margin-right: -4px; display: grid; place-items: center; border-radius: 50%; color: var(--c-muted); }
.bfind__clear:hover { background: var(--c-surface-2); color: var(--c-text); }
.bfind__clear[hidden] { display: none; }
.bchips { display: flex; gap: 4px; }
.bchip {
  height: 40px; min-width: 40px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--r-full); background: var(--c-surface);
  font-size: 13px; font-weight: 600; color: var(--c-text-2); white-space: nowrap;
  transition: background var(--dur), color var(--dur);
}
.bchip:hover { background: var(--c-surface-2); color: var(--c-text); }
.bchip.is-active { background: var(--c-text); color: var(--c-bg); }
.bchip--free[aria-pressed="true"] { background: var(--c-free); color: var(--c-free-ink); }
.bswitch { display: flex; height: 40px; padding: 3px; border-radius: var(--r-full); background: var(--c-surface); }
.bswitch button { padding: 0 14px; border-radius: var(--r-full); font-size: 13px; font-weight: 600; color: var(--c-text-2); white-space: nowrap; transition: background var(--dur), color var(--dur); }
.bswitch button:hover { color: var(--c-text); }
.bswitch button.is-active { background: var(--c-accent); color: var(--c-on-accent); }

/* Шахматка */
.bscroll {
  flex: 1; min-height: 0; overflow: auto;
  padding: 0 10px 10px;
  scrollbar-width: thin; scrollbar-color: var(--c-line-strong) transparent;
}
.bgrid {
  display: grid; gap: 4px;
  grid-auto-rows: auto; align-items: stretch; /* высота строки — по самой высокой ячейке в ней */
  grid-template-columns: 96px repeat(var(--cols, 6), minmax(150px, 1fr));
  min-width: calc(96px + var(--cols, 6) * 154px);
}
.bfloor { display: contents; }
.bhead { position: sticky; top: 0; z-index: 3; padding: 0 0 6px; background: var(--c-bg); }
.bhead__in {
  height: 48px; padding: 0 12px;
  display: flex; flex-direction: column; justify-content: center;
  border-radius: var(--r-md); background: var(--c-surface); line-height: 1.25;
}
.bhead__in b { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.bhead__in > span { font: 500 12px var(--font-ui); color: var(--c-muted); font-variant-numeric: tabular-nums; }
/* идущая пара: подсвечена вся колонка (плашка позади сетки), а прогресс — полосой на заголовке */
.bgrid { position: relative; }
.bcol-now { position: absolute; top: 0; bottom: 0; border-radius: var(--r-xl); background: var(--c-accent-tint); pointer-events: none; }
.bhead.is-now { background: var(--c-accent-tint); box-shadow: -3px 0 0 var(--c-accent-tint), 3px 0 0 var(--c-accent-tint); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.bhead.is-now .bhead__in { position: relative; overflow: hidden; background: var(--c-accent); color: var(--c-on-accent); }
.bhead.is-now .bhead__in::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: color-mix(in srgb, var(--c-on-accent) 18%, transparent); }
.bhead.is-now .bhead__in::after { content: ""; position: absolute; left: 0; bottom: 0; width: var(--progress, 0%); height: 4px; background: var(--c-on-accent); border-radius: 0 3px 3px 0; }
.bhead.is-now .bhead__in > span { color: var(--c-on-accent); }
.bhead.is-now .chip--live { background: var(--c-on-accent); color: var(--c-accent); }
.bhead.is-now .chip--live::before { background: var(--c-accent); }
.bhead.is-past .bhead__in { color: var(--c-muted); }
.bhead--corner { left: 0; z-index: 4; }
.bhead--corner .bhead__in { background: none; padding: 0 4px; font: 500 12px var(--font-ui); color: var(--c-muted); }
.bfloor__label {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px 2px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted);
}
.bfloor__label::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }
.bfloor__label em { font-style: normal; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--c-faint); }
.broom { position: sticky; left: 0; z-index: 2; display: flex; padding-right: 4px; background: var(--c-bg); }
.broom button {
  flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 0 12px; border-radius: var(--r-lg); background: var(--c-surface); text-align: left;
  transition: background var(--dur);
}
.broom button:hover { background: var(--c-surface-2); }
.broom b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.broom span { font: 500 11.5px var(--font-ui); color: var(--c-muted); }
.broom.is-free button { box-shadow: inset 0 0 0 1.5px var(--c-free-line); }
.bcell {
  position: relative; min-height: 72px; min-width: 0;
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px 12px;
  border-radius: var(--r-lg); background: var(--c-surface);
  cursor: pointer; overflow: hidden;
  transition: background var(--dur), box-shadow var(--dur), opacity var(--dur), transform .12s;
}
.bcell:hover { background: var(--c-bg); box-shadow: var(--sh-sm); }
.bcell:active { transform: scale(.985); }
.bcell__subj { font-size: 14.5px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bcell__meta { margin-top: auto; padding-top: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; font: 500 12px var(--font-ui); color: var(--c-muted); }
.bcell__grp {
  height: 20px; padding: 0 7px; flex-shrink: 0;
  display: inline-flex; align-items: center;
  border-radius: 6px; background: var(--c-bg); box-shadow: inset 0 0 0 1px var(--c-line);
  font: 600 11.5px var(--font-ui); color: var(--c-text); white-space: nowrap;
}
.bcell__more { flex-shrink: 0; font: 600 11px var(--font-ui); color: var(--c-muted); }
.bcell__who { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcell .lesson__note { position: absolute; top: 8px; right: 8px; }
/* как карточки недели: в колонке идущей пары — светлая карточка на тёплой плашке, прошедшие — приглушены и зачёркнуты */
.bcell.is-now { background: var(--c-bg); box-shadow: var(--sh-xs); }
.bcell.is-now:hover { box-shadow: var(--sh-sm); }
.bcell.is-past { opacity: .7; }
.bcell.is-past:hover { opacity: 1; }
.bcell.is-past .bcell__subj { text-decoration: line-through; text-decoration-color: var(--c-text-2); text-decoration-thickness: 2px; color: var(--c-text-2); }
.bcell.is-past::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c-line-strong); }
.bfree {
  min-height: 72px; display: grid; place-items: center;
  border: 1.5px dashed var(--c-line-strong); border-radius: var(--r-lg);
  font: 600 12px var(--font-ui); color: transparent;
  transition: color var(--dur), opacity var(--dur);
}
.bfree:hover { color: var(--c-muted); }
.bfree.is-now { border: 1.5px solid var(--c-free-line); background: var(--c-free); color: var(--c-free-ink); }
.bfree.is-past { opacity: .4; }
/* кабинет ещё занят предыдущей парой, которая заходит на время этой */
.bfree.is-tail, .bfree.is-tail.is-now { border: 1px dashed var(--c-warn-line); background: var(--c-warn-bg); color: var(--c-warn); }
.bcell__time { font: 600 11.5px var(--font-ui); color: var(--c-warn); font-variant-numeric: tabular-nums; }
/* поиск: найденные пары обведены, остальное приглушено */
.bgrid.is-finding .bcell:not(.is-hit), .bgrid.is-finding .bfree { opacity: .25; }
.bcell.is-hit { opacity: 1; background: var(--c-bg); box-shadow: 0 0 0 2px var(--c-text); }
/* «только свободные»: занятые ячейки уходят на фон, свободные подсвечены */
.bgrid.only-free .bcell { opacity: .15; pointer-events: none; }
.bgrid.only-free .bfree { border-style: solid; border-color: var(--c-free-line); background: var(--c-free); color: var(--c-free-ink); }
.bgrid.only-free .bfree.is-past { opacity: .35; }

/* Выбор пары (табло и телефон) */
.bpairs { display: flex; gap: 4px; padding: 0 12px 6px; flex-shrink: 0; }
.bpair {
  height: 46px; padding: 0 14px;
  display: flex; flex-direction: column; justify-content: center;
  border-radius: var(--r-md); background: var(--c-surface); text-align: left; line-height: 1.2;
  transition: background var(--dur);
}
.bpair:hover { background: var(--c-surface-2); }
.bpair b { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.bpair > span { font: 500 11.5px var(--font-ui); color: var(--c-muted); }
.bpair.is-active { background: var(--c-accent); color: var(--c-on-accent); }
.bpair.is-active > span { color: var(--c-on-accent); }
.bpair__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }

/* Табло «Свободные» */
.bboard { padding: 0 14px 14px; }
.bboard__floor { display: flex; align-items: baseline; gap: 10px; margin: 14px 2px 8px; }
.bboard__floor b { font-size: 16px; font-weight: 800; }
.bboard__floor span { font: 500 12.5px var(--font-ui); color: var(--c-muted); }
.btiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.btile {
  min-height: 104px; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px;
  border-radius: var(--r-xl); background: var(--c-surface); text-align: left;
  cursor: pointer;
  transition: background var(--dur), box-shadow var(--dur);
}
.btile:hover { background: var(--c-bg); box-shadow: var(--sh-sm); }
.btile__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btile__num { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.btile__body { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; hyphens: auto; }
.btile__foot { margin-top: auto; padding-top: 6px; min-width: 0; display: flex; flex-direction: column; gap: 3px; font: 500 12px var(--font-ui); color: var(--c-muted); }
.btile__who { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--c-text-2); }
.btile__who > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btile__grps { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 0; min-width: 0; }
.btile__grp { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.btile__grp:not(:last-child)::after { content: "·"; margin: 0 4px; color: var(--c-muted); }
.btile__grp.no-sep::after { visibility: hidden; } /* место сохраняется, чтобы раскладка строк не прыгала */
.btile__grp > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg.sg--tag { width: auto; min-width: 22px; height: 18px; padding: 0 6px; border-radius: 6px; white-space: nowrap; background: var(--c-bg); color: var(--c-text-2); box-shadow: inset 0 0 0 1px var(--c-line); }
.btile__until { font-variant-numeric: tabular-nums; }
.btile.is-free { background: var(--c-free); color: var(--c-free-ink); box-shadow: inset 0 0 0 1px var(--c-free-line); }
.btile.is-free .btile__foot { color: var(--c-free-ink); }
.btile.is-free:hover { box-shadow: inset 0 0 0 1px var(--c-free-line), var(--sh-sm); }

/* Телефон: список по выбранной паре */
.blist { padding: 0 8px 12px; }
.bfreelist { padding: 10px 4px 2px; }
.bfreelist h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--c-free-ink); }
.bfreelist div { display: flex; flex-wrap: wrap; gap: 6px; }
.bfreelist button {
  height: 34px; min-width: 52px; padding: 0 10px;
  border-radius: var(--r-md); background: var(--c-free); color: var(--c-free-ink);
  box-shadow: inset 0 0 0 1px var(--c-free-line); font-weight: 700;
}
.bfreelist span { font-size: 13px; color: var(--c-muted); }
.blist .list-sep { padding: 14px 4px 8px; }
.brow {
  display: flex; gap: 12px; margin-bottom: 6px; padding: 10px;
  border-radius: var(--r-lg); background: var(--c-surface); cursor: pointer;
}
.brow.is-now { background: var(--c-bg); box-shadow: 0 0 0 2px var(--c-accent-strong); }
.brow__num {
  min-width: 46px; height: 46px; padding: 0 10px; flex-shrink: 0; white-space: nowrap;
  display: grid; place-items: center;
  border-radius: 12px; background: var(--c-bg); box-shadow: var(--sh-xs);
  font-weight: 800; font-size: 15px;
}
.brow__text { min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1.3; }
.brow__text b { font-size: 14px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.brow__text > span { font: 500 12.5px var(--font-ui); color: var(--c-muted); }
.brow__meta { display: flex; flex-direction: column; gap: 4px; }
.brow__row { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }

@media (max-width: 1180px) {
  .bfind { width: 170px; }
}
.app.is-building .pager { display: none; }
/* шапка корпуса на десктопе: слева вид («Все кабинеты / Свободные») и сводка, справа фильтры */
@media (min-width: 901px) {
  .bbar__tools { display: contents; }
  .bswitch { order: -2; }
  .bsummary { order: -1; margin-left: 4px; }
  .bfind { margin-left: auto; }
}
.head-strip:not([hidden]) { display: flex; align-items: center; gap: 6px; }
.head-strip__arrow {
  width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--c-surface); color: var(--c-text-2);
  transition: background var(--dur), color var(--dur);
}
.head-strip__arrow:hover { background: var(--c-surface-2); color: var(--c-text); }
.head-strip .strip.strip--bar { grid-template-columns: repeat(6, 50px); }
.head-strip .strip--bar .strip__day { padding: 5px 4px 4px; }
@media (min-width: 901px) {
  .app.is-building .bbar .strip--bar { display: none; }
}
@media (max-width: 900px) {
  .app.is-building { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .app.is-building .toolbar__nav { display: none; }
  /* сводка — сверху, а полоса дней и переключатель вида — внизу, над панелью навигации (как в режиме «День») */
  .bbar { display: contents; }
  .bsummary { order: -1; padding: 12px 12px 8px; }
  .bscroll, .bboard { order: 0; }
  .strip.strip--bar { order: 97; position: static; margin: 0; padding: 8px 8px 0; width: auto; grid-template-columns: repeat(6, 1fr); background: var(--c-bg); }
  .bbar__tools { order: 98; margin-left: 0; padding: 8px 8px 8px; background: var(--c-bg); }
  .bswitch { flex: 1; }
  .bswitch button { flex: 1; }
  .bpairs { order: 96; padding: 8px 8px 0; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; background: var(--c-bg); }
  .bpairs::-webkit-scrollbar { display: none; }
  .bpair { flex: 1 0 auto; min-width: 72px; padding: 0 12px; align-items: center; white-space: nowrap; scroll-snap-align: center; }
  .bpair > span { display: none; }
  .bboard { padding: 0 8px 12px; }
  .btiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 1180px) {
  .topbar__name { font-size: 22px; }
  .today-btn { padding: 0 12px; }
  .pager__label { width: 150px; }
}

@media (max-width: 900px) {
  /* снизу — место под панель навигации (пейджер + режим) */
  /* безопасные зоны: статус-бар сверху, жестовая полоса снизу, вырезы по бокам в ландшафте */
  .app {
    padding: calc(8px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) calc(8px + 44px + 8px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
    gap: 8px;
  }

  /* Шапка: [меню+лого | название | сегодня]; пейджер и режим — в нижней панели */
  .app__head {
    height: auto;
    display: grid; grid-template-columns: auto 1fr auto; align-items: center;
    gap: 8px 10px;
  }
  .me-btn { grid-area: 1 / 3; width: 40px; height: 40px; }
  /* «Сегодня» на телефоне — подпись пейджера внизу, в шапке остаётся только профиль */
  .today-btn { display: none; }
  .pager__label.is-away { cursor: pointer; }
  .pager__label.is-away .pager__sub { display: none; }
  .pager__label.is-away .pager__back { display: inline-flex; }
  .topbar, .toolbar { display: contents; }
  .brand { grid-area: 1 / 1; width: auto; height: 48px; padding: 0 8px 0 4px; gap: 4px; border-radius: var(--r-xl); transition: none; }
  .brand__logo img { width: 32px; height: 32px; }
  .brand__text { display: none; }
  .topbar__title { grid-area: 1 / 2; }
  .topbar__kind { font-size: 12px; }
  .topbar__name { font-size: 20px; }
  .toolbar__nav {
    display: flex; align-items: center; gap: 8px;
    position: fixed; z-index: 30;
    left: calc(8px + env(safe-area-inset-left)); right: calc(8px + env(safe-area-inset-right)); bottom: calc(8px + env(safe-area-inset-bottom));
  }
  .pager { flex: 1; min-width: 0; justify-content: space-between; }
  .pager__label { width: auto; flex: 1; }
  #viewSwitch .segmented__btn { padding: 0 14px; }

  .app__body { display: block; }
  .week-wrap { height: 100%; border-radius: var(--r-xl); }
  /* полоса дней — внизу, над панелью навигации */
  .dayview { padding: 16px 12px 0; }
  .strip { order: 99; }
  .strip {
    top: auto; bottom: 0; margin: auto -12px 0;
    padding: 18px 12px 10px; gap: 4px;
    background: linear-gradient(transparent, var(--c-bg) 25%);
  }
  .dv-title { font-size: 24px; }
  .tl-row { grid-template-columns: 44px 14px 1fr; column-gap: 8px; }
  .tl-start { font-size: 14px; }
  .dayview .callout { margin-left: 0; }
  .lesson--full { padding: 12px 14px 14px; }
  .lesson--full .lesson__title { font-size: 16px; }

  /* Сайдбар — выдвижная шторка */
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50;
    width: min(88vw, 380px);
    padding: calc(16px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
    border-radius: 0 var(--r-2xl) var(--r-2xl) 0;
    box-shadow: var(--sh-lg);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .28s var(--ease), visibility 0s .28s;
  }
  .app.is-drawer-open .sidebar { transform: none; visibility: visible; transition: transform .28s var(--ease); }
  .app.is-collapsed .sidebar { width: min(88vw, 380px); padding: calc(16px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); }
  .drawer-backdrop {
    display: block;
    position: fixed; inset: 0; z-index: 40;
    background: var(--c-scrim);
    opacity: 0; pointer-events: none;
    transition: opacity .28s var(--ease);
  }
  .app.is-drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
  .search__kbd { display: none; }
  .sidebar__head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 2px 0 4px; }
  .sidebar__head .brand__text { display: flex; }

  /* Модалка — нижняя шторка */
  .modal {
    width: 100%; max-width: none;
    margin: auto 0 0; max-height: 92dvh;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  }
  .modal[open] { animation: sheet-in .3s var(--ease); }
  @keyframes sheet-in { from { transform: translateY(100%); } }
  .modal__inner { padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); gap: 16px; }
  .modal__grip { display: block; width: 40px; height: 4px; margin: 0 auto; border-radius: 2px; background: var(--c-line-strong); }
  .modal__subject { font-size: 20px; }
}

/* =========================================================
   Страница профиля: сводка дня, нагрузка недели, кураторство
   ========================================================= */
.week.is-profile { display: block; padding: 0; cursor: auto; }
.pf {
  max-width: 1180px; margin: 0 auto;
  padding: 20px 20px 28px;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px;
  align-items: start;
}
.pf > * { grid-column: span 12; min-width: 0; }
.pf-sk { grid-column: span 6; height: 220px; }
.pf-sk--wide { grid-column: span 12; height: 160px; }
/* Карточки раскладываются по колонкам из app.js: каждая — в ту, что короче */
.pf-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.pf-cols.is-single { grid-template-columns: minmax(0, 1fr); }
.pf-cols.is-single .pf-col:empty { display: none; }
.pf-col { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.pf-card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px;
  border-radius: var(--r-xl);
  background: var(--c-surface);
}
.pf-card__head { display: flex; align-items: center; gap: 10px; min-height: 22px; }
.pf-card__title { margin: 0; flex: 1; font: 600 11px var(--font-ui); color: var(--c-muted); text-transform: uppercase; letter-spacing: .07em; }
.pf-card__aside { font: 600 12px var(--font-ui); color: var(--c-muted); }

/* Главный блок: приветствие + статус + лента дня */
.pf-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px;
  border-radius: var(--r-2xl);
  background: var(--c-accent-tint);
}
.pf-hero::before {
  content: ""; position: absolute; z-index: -1; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--c-accent), transparent);
  opacity: .32; pointer-events: none;
}
.pf-hero__top { display: flex; align-items: center; gap: 14px; }
.pf-hero__avatar { width: 52px; height: 52px; border-radius: 16px; font-size: 18px; box-shadow: var(--sh-sm); }
.pf-hero__badge {
  width: 52px; height: 52px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--c-accent); color: var(--c-on-accent);
  font-size: 18px; font-weight: 800;
  box-shadow: var(--sh-sm);
}
.pf-hero__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-hero__hello { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.pf-hero__kicker { font-size: 13px; color: var(--c-accent-ink); font-weight: 600; }
.pf-hero__actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pf-hero__actions .btn svg { width: 16px; height: 16px; }
.pf-hero__gear { width: 40px; height: 40px; background: var(--c-bg); box-shadow: var(--sh-xs); }
.pf-hero__gear:hover:not(:disabled) { background: var(--c-bg); box-shadow: var(--sh-sm); }
.pf-hero__week { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--c-text-2); }
.pf-hero__week svg { width: 18px; height: 18px; color: var(--c-accent-ink); }

/* Статус — «парящая» карточка внутри главного блока */
.pf-status {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px;
  border-radius: var(--r-xl);
  background: var(--c-bg);
  box-shadow: var(--sh-sm);
}
.pf-hero.is-live .pf-status { box-shadow: var(--sh-sm), inset 0 0 0 2px var(--c-accent-strong); }
.pf-status--quiet { flex-direction: row; align-items: center; gap: 14px; color: var(--c-muted); font-size: 13px; }
.pf-status--quiet svg { width: 28px; height: 28px; color: var(--c-accent-ink); flex-shrink: 0; }
.pf-status--quiet div { display: flex; flex-direction: column; gap: 2px; }
.pf-status--quiet b { font-size: 16px; color: var(--c-text); }
.pf-status__head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pf-status__head .chip { height: 26px; padding: 0 12px; font-size: 12.5px; }
.pf-status__then { font-size: 13px; color: var(--c-muted); }
.pf-status__body { display: flex; align-items: center; gap: 18px; padding: 0; text-align: left; border-radius: var(--r-lg); }
.pf-status__body:hover .pf-status__subject { text-decoration: underline; text-decoration-color: var(--c-line-strong); text-underline-offset: 5px; }
.pf-status__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pf-status__subject { font-size: 24px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.pf-status__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--c-text-2); }
.pf-status__who { margin-top: 2px; }
.pf-status__who .who-row { gap: 8px; font-size: 14px; }
.pf-status__who .who { color: var(--c-text); font-weight: 600; }
.pf-status__who .avatar--xs { width: 24px; height: 24px; }
.pf-grp { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.pf-status__who .sg--tag { height: 20px; font-size: 11.5px; }
.pf-status__meta svg { color: var(--c-muted); }
.pf-status__note { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--c-warn); }
.pf-status__note svg { flex-shrink: 0; margin-top: 2px; }
.pf-room {
  min-width: 84px; height: 84px; padding: 0 14px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 22px;
  background: var(--c-accent); color: var(--c-on-accent);
  font-size: 30px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.pf-room small { font: 600 11px var(--font-ui); opacity: .65; margin-bottom: 5px; letter-spacing: 0; }
.pf-progress { height: 6px; border-radius: 3px; background: var(--c-surface-2); overflow: hidden; }
.pf-progress span { display: block; height: 100%; width: var(--progress); border-radius: inherit; background: var(--c-accent-strong); transition: width .6s var(--ease); }
.pf-note-dot { color: var(--c-warn); display: grid; place-items: center; flex-shrink: 0; }

.pf-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 8px; text-align: center; color: var(--c-muted); font-size: 13px; }
.pf-empty svg { width: 24px; height: 24px; color: var(--c-accent-ink); margin-bottom: 4px; }
.pf-empty b { font-size: 15px; color: var(--c-text); }

/* Пары списком: время слева, номер на «рельсе», как в таймлайне дня */
.pf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pf-row {
  position: relative;
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px; border-radius: var(--r-lg);
  text-align: left;
  transition: background var(--dur);
}
.pf-row:hover { background: var(--c-bg); }
.pf-row__time { width: 42px; flex-shrink: 0; display: flex; flex-direction: column; font-weight: 700; font-size: 14px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pf-row__time small { font-weight: 500; font-size: 12px; color: var(--c-muted); }
.pf-row__rail { position: relative; align-self: stretch; width: 24px; flex-shrink: 0; display: grid; place-items: center; }
.pf-row__rail::before { content: ""; position: absolute; top: -8px; bottom: -8px; left: 50%; width: 2px; margin-left: -1px; background: var(--c-line); }
.pf-list li:first-child .pf-row__rail::before { top: 50%; }
.pf-list li:last-child .pf-row__rail::before { bottom: 50%; }
.pf-row__rail span {
  position: relative; width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--c-surface-2); box-shadow: 0 0 0 3px var(--c-surface);
  font: 700 11.5px var(--font-ui);
}
.pf-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pf-row__main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-row__block { display: flex; flex-direction: column; min-width: 0; }
.pf-row__times { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--c-warn, var(--c-muted)); }
.pf-row__times svg { width: 12px; height: 12px; }
.pf-row__block + .pf-row__block { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--c-line-strong); }
.pf-row__main .parts, .pf-cur__where .parts { margin-top: 6px; } /* кабинет и группы — те же значки, что в карточке расписания */
.pf-row .chip { flex-shrink: 0; }
.pf-row.is-past .pf-row__time, .pf-row.is-past .pf-row__main { opacity: .45; }
.pf-row.is-past b { text-decoration: line-through; text-decoration-color: var(--c-faint); }
.pf-row.is-past .pf-row__rail span { background: var(--c-line); color: var(--c-faint); }
.pf-row.is-now { background: var(--c-bg); box-shadow: var(--sh-xs); }
.pf-row.is-now .pf-row__rail span { background: var(--c-accent-strong); color: var(--c-on-accent); }
.pf-row.is-next .pf-row__rail span { background: var(--c-accent); color: var(--c-on-accent); }
.pf-list--compact .pf-row { padding: 6px 6px; }

/* Неделя: цифры строкой без плиток */
.pf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pf-stat { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; border-left: 1px solid var(--c-line); }
.pf-stat:first-child { padding-left: 0; border-left: 0; }
.pf-stat b { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-stat b small { font-size: 14px; font-weight: 700; color: var(--c-muted); margin-left: 1px; }
.pf-stat span { font-size: 12px; color: var(--c-muted); }
/* Ширина карточки зависит от колонки и панели, а не от окна, поэтому цифры перестраиваются по самой карточке: тесно — сетка 2×2 */
.pf-load { container-type: inline-size; }
@container (max-width: 540px) {
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .pf-stat:nth-child(3) { padding-left: 0; border-left: 0; }
}
.pf-bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: end; }
.pf-bar { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 0; border-radius: var(--r-md); }
.pf-bar__col {
  position: relative;
  height: calc(26px + var(--v) * 74px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 6px;
  border-radius: 10px;
  background: var(--c-bg);
  font: 700 13px var(--font-ui); font-variant-numeric: tabular-nums;
  transition: height .5s var(--ease), background var(--dur), transform .15s var(--ease);
}
.pf-bar.is-zero .pf-bar__col { color: var(--c-faint); }
.pf-bar.is-past .pf-bar__col { opacity: .55; }
.pf-bar.is-today .pf-bar__col { background: var(--c-accent); color: var(--c-on-accent); }
.pf-bar:hover .pf-bar__col { transform: translateY(-2px); box-shadow: var(--sh-sm); }
.pf-bar__d { display: flex; justify-content: center; gap: 4px; font: 600 12px var(--font-ui); color: var(--c-muted); }
.pf-bar__d small { font-size: 12px; color: var(--c-faint); }
.pf-bar.is-today .pf-bar__d { color: var(--c-text); }
.pf-foot { margin: 0; font-size: 12px; color: var(--c-muted); }

/* Предметы и преподаватели (у преподавателя — группы): строка предмета, полоса доли и «кто» чипами */
.pf-period { display: flex; gap: 2px; align-self: flex-start; padding: 3px; border-radius: var(--r-full); background: var(--c-bg); }
.pf-period__btn { min-height: 34px; padding: 0 14px; border-radius: var(--r-full); font: 600 13px var(--font-ui); color: var(--c-text-2); transition: color var(--dur), background var(--dur); }
.pf-period__btn:hover { color: var(--c-text); }
.pf-period__btn.is-active { background: var(--c-accent); color: var(--c-on-accent); }
@media (pointer: coarse), (max-width: 700px) { .pf-period { align-self: stretch; } .pf-period__btn { flex: 1; min-height: 44px; } }
.pf-subj__period { margin: 0; font-size: 12.5px; color: var(--c-muted); }
.pf-subj__sg { margin: 0; font-size: 12.5px; color: var(--c-text-2); font-variant-numeric: tabular-nums; }
.pf-subj__foot { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--c-line); font-size: 12px; line-height: 1.4; color: var(--c-muted); }
.pf-subj-msg { display: flex; align-items: center; gap: 8px; padding: 14px 0 4px; font-size: 13px; color: var(--c-muted); }
.pf-subj-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pf-subj { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--c-line); }
.pf-subj:first-child { padding-top: 2px; border-top: 0; }
.pf-subj:last-child { padding-bottom: 0; }
.pf-subj__top { display: flex; align-items: baseline; gap: 12px; }
.pf-subj__name { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; line-height: 1.3; }
.pf-subj__n { flex-shrink: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.pf-subj__n small { margin-left: 4px; font: 600 11.5px var(--font-ui); color: var(--c-muted); }
.pf-meter__bar { height: 4px; border-radius: 2px; background: var(--c-bg); position: relative; overflow: hidden; }
.pf-meter__bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 100%); border-radius: inherit; background: var(--c-accent-strong); }
.pf-subj__who { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.pf-who {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  height: 30px; padding: 0 10px 0 3px; border-radius: var(--r-full);
  background: var(--c-bg); font-size: 13px; font-weight: 600; color: var(--c-text-2);
  transition: box-shadow var(--dur), color var(--dur), transform .1s;
}
.pf-who:hover { color: var(--c-text); box-shadow: var(--sh-sm); }
.pf-who:active { transform: scale(.97); }
.pf-who .avatar--xs { width: 24px; height: 24px; border-radius: 50%; font-size: 9px; }
.pf-who .sg--tag { margin-left: 3px; }
.pf-who { padding-right: 4px; }
.pf-who__name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* сколько пар этого предмета именно с этой группой или преподавателем */
.pf-who__n { min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: var(--r-full); background: var(--c-surface-2); color: var(--c-text); font: 700 11.5px var(--font-ui); font-variant-numeric: tabular-nums; }
.pf-who.is-cur .pf-who__n { background: var(--c-accent); color: var(--c-on-accent); }
.pf-who.is-cur { box-shadow: inset 0 0 0 1.5px var(--c-accent-strong); color: var(--c-text); }

/* Курируемая группа */
.pf-cur__head { display: flex; align-items: center; gap: 12px; }
.pf-cur__head .entity__badge { background: var(--c-accent); color: var(--c-on-accent); }
.pf-cur__title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pf-cur__title b { font-size: 17px; font-weight: 800; }
.pf-cur__title span { font-size: 12.5px; color: var(--c-muted); }
.pf-cur__status { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border-radius: var(--r-lg); background: var(--c-bg); }
.pf-cur__status.is-quiet { font-size: 13px; color: var(--c-muted); }
.pf-cur__where { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pf-cur__where b { font-size: 15px; }

/* Примечания */
.pf-notes { background: var(--c-warn-bg); box-shadow: inset 0 0 0 1px var(--c-warn-line); }
.pf-notes .pf-card__title, .pf-notes .pf-card__aside { color: var(--c-warn); }
.pf-notelist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.pf-noteitem { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--r-lg); background: var(--c-bg); text-align: left; font-size: 13px; }
.pf-noteitem:hover { box-shadow: var(--sh-sm); }
.pf-noteitem__when { font: 600 11.5px var(--font-ui); color: var(--c-muted); }
.pf-noteitem__text { display: flex; gap: 6px; color: var(--c-warn); line-height: 1.35; }
.pf-noteitem__text svg { flex-shrink: 0; margin-top: 2px; }

.entity__badge--icon { color: var(--c-text-2); }

/* Домашняя страница в окне профиля */
.home-opts { display: flex; flex-direction: column; gap: 4px; }
.home-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-lg);
  text-align: left; background: var(--c-surface);
  transition: background var(--dur), box-shadow var(--dur);
}
.home-opt:hover { background: var(--c-surface-2); }
.home-opt[aria-checked="true"] { background: var(--c-accent-tint); box-shadow: inset 0 0 0 1.5px var(--c-accent-strong); }
.home-opt__dot { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--c-line-strong); background: var(--c-bg); transition: box-shadow var(--dur); }
.home-opt[aria-checked="true"] .home-opt__dot { box-shadow: inset 0 0 0 5px var(--c-accent-strong); }
.home-opt__text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.home-opt__title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.home-opt__def { height: 18px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: var(--r-full); background: var(--c-bg); font: 600 10.5px var(--font-ui); color: var(--c-muted); }
.home-opt__hint { font-size: 12.5px; color: var(--c-muted); }

@media (max-width: 900px) {
  .pf { padding: 12px 12px 20px; gap: 10px; }
  .pf-hero { gap: 14px; padding: 14px; border-radius: var(--r-xl); }
  .pf-hero__top { gap: 12px; }
  .pf-hero__avatar, .pf-hero__badge { width: 44px; height: 44px; border-radius: 14px; font-size: 16px; }
  .pf-hero__hello { font-size: 18px; }
  .pf-hero__kicker { font-size: 12px; }
  /* на телефоне кнопки — иконками, чтобы приветствие не переносилось */
  .pf-hero__actions .btn { width: 40px; padding: 0; }
  .pf-hero__actions .btn span { display: none; }
  .pf-status { padding: 14px; gap: 12px; }
  .pf-status__body { gap: 14px; align-items: flex-start; }
  .pf-status__subject { font-size: 18px; }
  .pf-status__meta { font-size: 13px; }
  .pf-row .chip { display: none; } /* таймер идущей пары — в главном блоке, в списке он съедал название */
  .pf-room { min-width: 64px; height: 64px; border-radius: 18px; font-size: 22px; }
  .pf-card { padding: 14px; }
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .pf-stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .pf-stat b { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
