/* =====================================================================
   «Мой деканат» — минималистичный Liquid Glass.
   Все цвета — токены: тёмная тема в :root, светлая (тёплый бежевый) в :root.light.
   Три типа устройств: телефон (< 640 px) — нижний док, планшет (640–1023) — нижний док
   и сетки в 2–3 колонки, компьютер (≥ 1024) — стеклянное боковое меню.
   ===================================================================== */
:root {
  /* поверхности */
  --bg: #0b0d12;
  --bg2: #151820;
  --card: rgba(255, 255, 255, .055);
  --card-hover: rgba(255, 255, 255, .085);
  --card-solid: #161920;
  --fill: rgba(255, 255, 255, .09);
  --fill2: rgba(255, 255, 255, .05);
  --line: rgba(255, 255, 255, .09);
  --text: #f3f4f7;
  --muted: rgba(229, 232, 240, .64);
  /* стекло */
  --glass: rgba(22, 25, 33, .56);
  --glass-edge: rgba(255, 255, 255, .11);
  --glass-hi: rgba(255, 255, 255, .13);
  --shadow: 0 14px 44px rgba(0, 0, 0, .45);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .22);
  --blur: blur(26px) saturate(175%);
  --blur-card: blur(18px) saturate(160%);
  /* цветная подсветка за стеклом */
  --glow1: rgba(47, 123, 255, .30); --glow2: rgba(150, 92, 255, .20); --glow3: rgba(10, 186, 181, .16);
  /* акцент */
  --accent: #6aa8ff; --accent-fill: #2f7bff; --on-accent: #fff;
  /* цвета типов пар (как в ветке Артура) */
  --lk: #2f7bff; --pr: #64d2ff; --lab: #bf5af2; --ex: #ffd60a; --other: rgba(235, 235, 245, .45);
  /* статусы */
  --good: #30d158; --warn: #ff9f0a; --bad: #ff453a;
  /* оценки: текст и заливка (до 3 — красный, 3 — жёлтый, 4 — зелёный, 5 — тиффани) */
  --g2: #ff6b6b; --g3: #ffd23f; --g4: #3ddc84; --g5: #81d8d0;
  --g2f: #ff5a5f; --g3f: #ffd23f; --g4f: #34d27b; --g5f: #81d8d0;
  /* типографика и скругления */
  --fs-xs: 12px; --fs-sm: 13.5px; --fs-md: 16px;
  --r-sm: 14px; --r-md: 22px; --r-lg: 28px;
  --r-chip: 10px;              /* кнопки-фильтры: скруглённый прямоугольник, не овал */
  --r-tag: 6px;               /* маленькие метки и счётчики с цифрами */
  --r-day: 12px;              /* карточки дней недели */
  --radius: var(--r-md);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  color-scheme: dark;
}
:root.light {
  --bg: #f1e9dc;                           /* тёплый бежевый, не белый */
  --bg2: #faf6ef;
  --card: rgba(255, 252, 246, .6);
  --card-hover: rgba(255, 252, 246, .82);
  --card-solid: #fbf8f2;
  --fill: rgba(92, 70, 38, .085);
  --fill2: rgba(92, 70, 38, .05);
  --line: rgba(92, 70, 38, .14);
  --text: #1f1b16;
  --muted: rgba(56, 46, 34, .72);
  --glass: rgba(250, 245, 236, .6);
  --glass-edge: rgba(255, 255, 255, .78);
  --glass-hi: rgba(255, 255, 255, .92);
  --shadow: 0 14px 40px rgba(84, 62, 30, .14);
  --shadow-sm: 0 2px 10px rgba(84, 62, 30, .07);
  --glow1: rgba(255, 168, 112, .34); --glow2: rgba(10, 186, 181, .17); --glow3: rgba(196, 160, 255, .22);
  --accent: #0b5bc4; --accent-fill: #1f6fe5;
  --lk: #0050c8; --pr: #086a8a; --lab: #8944ab; --ex: #946200; --other: rgba(60, 60, 67, .5);
  --good: #1f7d38; --warn: #a95000; --bad: #c4161c;
  --g2: #a81f1f; --g3: #7a5300; --g4: #17692f; --g5: #066b67;
  --g2f: #ec5357; --g3f: #f2b705; --g4f: #2fb35a; --g5f: #81d8d0;
  color-scheme: light;
}

/* ---------------------------------------------------------------- база */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
html, body { margin: 0; height: 100%; color: var(--text); font-family: var(--font);
  font-size: var(--fs-md); line-height: 1.38; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { background: transparent; overflow-x: hidden; }
/* мягкие цветные пятна — за ними «играет» стекло карточек и навигации */
body::before { content: ""; position: fixed; inset: -12%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 34% at 10% 6%, var(--glow1), transparent 70%),
    radial-gradient(36% 30% at 94% 22%, var(--glow2), transparent 70%),
    radial-gradient(46% 40% at 55% 104%, var(--glow3), transparent 70%); }
.theme-anim, .theme-anim *, .theme-anim *::before { transition: background-color .3s, color .3s, border-color .3s, box-shadow .3s !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: var(--text); }
a { color: inherit; text-decoration: none; }
.link { color: var(--accent); font-weight: 600; }
.link:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; border-radius: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.ic { width: 1.15em; height: 1.15em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* стекло — общий рецепт */
#tabs, #sheet, .toast, .demo-banner {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
}

#app { max-width: 560px; margin: 0 auto; min-height: 100%; height: 100%; position: relative; display: flex; flex-direction: column; }
.demo-banner { position: relative; z-index: 5; margin: 10px 14px 0; padding: 6px 14px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 600; text-align: center; color: var(--text);
  background: color-mix(in srgb, var(--warn) 18%, var(--glass)); box-shadow: inset 0 1px 0 var(--glass-hi); }
#shell { flex: 1; display: flex; flex-direction: column-reverse; min-height: 0; }
#view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px 16px calc(116px + env(safe-area-inset-bottom)); scrollbar-width: none; outline: none; }
#view::-webkit-scrollbar { display: none; }
body.logged-out #view { padding-bottom: 32px; }

/* ------------------------------------------- навигация: плавающая капсула */
#tabs { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom)); width: min(520px, calc(100% - 24px));
  display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 999px; }
#tabs:empty { display: none; }
#tabs .brand { display: none; }
#tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px; min-width: 0; border-radius: 999px; font-size: 10.5px; font-weight: 600; color: var(--muted);
  position: relative; transition: background .25s, color .25s, transform .2s; }
#tabs button:active { transform: scale(.94); }
#tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
#tabs button.active, #tabs button.active-m { color: var(--accent); }
#tabs button.active { background: var(--fill); box-shadow: inset 0 1px 0 var(--glass-hi); }
.badge-dot { position: absolute; top: 8px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--bad);
  box-shadow: 0 0 0 2px var(--card-solid); }

/* ---------------------------------------------------------- типографика */
h1 { font-size: 32px; line-height: 1.1; margin: 6px 0 14px; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 19px; margin: 28px 0 10px; font-weight: 650; letter-spacing: -.012em; }
h3 { font-size: 16px; margin: 18px 0 8px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.block { display: block; width: 100%; text-align: left; }

/* ---------------------------------------------------- карточки и кнопки */
.card { position: relative; background: var(--card); border: 1px solid var(--glass-edge); border-radius: var(--radius); padding: 16px;
  -webkit-backdrop-filter: var(--blur-card); backdrop-filter: var(--blur-card);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-sm); }
button.card, a.card { transition: transform .2s cubic-bezier(.2, .8, .2, 1), background .2s; }
button.card:active, a.card:active { transform: scale(.98); }
@media (hover: hover) { button.card:hover, a.card:hover { background: var(--card-hover); } }
.card + .card { margin-top: 10px; }

.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; min-height: 44px; border-radius: var(--r-chip);
  background: var(--fill); font-size: 15px; font-weight: 550; white-space: nowrap; transition: background .2s, color .2s;
  border: 1px solid transparent; }
.chip .ic { width: 17px; height: 17px; }
.chip.primary { background: var(--text); color: var(--bg); }
@media (hover: hover) { .chip:not(.primary):hover { background: color-mix(in srgb, var(--fill) 100%, var(--text) 6%); } }
.chip-count { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: var(--r-tag); background: var(--fill); }
.chip.primary .chip-count { background: color-mix(in srgb, var(--bg) 22%, transparent); }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 12px 22px; min-height: 50px;
  border-radius: 999px; background: var(--accent-fill); color: var(--on-accent); font-weight: 650; font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 8px 22px color-mix(in srgb, var(--accent-fill) 30%, transparent);
  transition: transform .15s, filter .15s; }
.btn:active { transform: scale(.97); }
@media (hover: hover) { .btn:hover { filter: brightness(1.07); } }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: var(--fill); color: var(--accent); box-shadow: inset 0 1px 0 var(--glass-hi); }
.btn.wide { width: 100%; margin-top: 12px; }
.small-btn { min-height: 44px; padding: 8px 18px; font-size: 15px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--fill); position: relative; color: var(--accent); box-shadow: inset 0 1px 0 var(--glass-hi); transition: background .2s, transform .15s; }
.icon-btn .ic { width: 21px; height: 21px; }
.icon-btn:active { transform: scale(.92); }
.send-btn { width: 50px; padding: 0; flex-shrink: 0; }
.pill { font-size: var(--fs-xs); font-weight: 650; padding: 4px 10px; border-radius: var(--r-tag); background: var(--fill); white-space: nowrap; }
.pill.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.st-submitted { color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.st-in_progress { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.st-ready, .st-done { color: var(--good); background: color-mix(in srgb, var(--good) 15%, transparent); }
.st-rejected { color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, transparent); }
.st-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.st-ic .ic { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- вход */
.login { max-width: 400px; margin: 24px auto 0; text-align: center; position: relative; }
.login-tools { position: absolute; top: 0; right: 0; }
.login-logo { border-radius: 22px; box-shadow: 0 16px 40px color-mix(in srgb, var(--accent-fill) 30%, transparent); margin-top: 18px; }
.login h1 { margin: 16px 0 6px; }
.login form { text-align: left; margin-top: 24px; padding: 20px; }
label { display: block; font-size: var(--fs-sm); color: var(--muted); margin: 14px 4px 6px; }
.login label:first-child { margin-top: 0; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; padding: 12px 16px; min-height: 50px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--fill2); transition: border-color .15s, box-shadow .15s, background .15s; }
textarea { line-height: 1.4; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; background: var(--card-hover);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.pw { display: flex; gap: 8px; align-items: center; }
.pw .icon-btn { width: 50px; height: 50px; border-radius: var(--r-sm); }
.form-error { color: var(--bad); font-size: var(--fs-sm); min-height: 1.2em; margin: 10px 4px 0; }
fieldset { border: 0; padding: 0; margin: 14px 0 0; }
legend { font-size: var(--fs-sm); color: var(--muted); margin: 0 4px 4px; }
.radio { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: var(--fs-md); margin: 6px 0; min-height: 44px; }
.radio input, .deadline input { width: 22px; height: 22px; accent-color: var(--accent-fill); flex-shrink: 0; }

/* -------------------------------------------------------------- главная */
.home-head { display: flex; align-items: flex-start; gap: 10px; }
.home-head > div { flex: 1; min-width: 0; }
.home-head h1 { margin-bottom: 4px; }
.bell b { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: var(--r-tag); background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.hero { overflow: hidden; margin-top: 16px; padding: 22px; border-radius: var(--r-lg); color: #fff; border: 1px solid rgba(255, 255, 255, .22);
  background: linear-gradient(140deg, #2f7bff 0%, #5e5ce6 58%, #9b5cf0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 16px 38px rgba(47, 123, 255, .28); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 90% at 100% 0%, rgba(255, 255, 255, .3), transparent 60%), radial-gradient(40% 60% at 0% 100%, rgba(129, 216, 208, .25), transparent 70%); }
.hero-title { font-size: 23px; font-weight: 700; letter-spacing: -.018em; margin: 6px 0; position: relative; z-index: 1; }
.muted-light { color: #fff; font-size: var(--fs-sm); position: relative; z-index: 1; }
.hero-meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.hero-meta .ic { width: 15px; height: 15px; }
.progress { height: 6px; background: rgba(255, 255, 255, .28); border-radius: 3px; overflow: hidden; margin-top: 14px; position: relative; z-index: 1; }
.progress i { display: block; height: 100%; background: #fff; border-radius: 3px; }
.status-card { overflow: hidden; }
.status-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--good); }
.status-card.warn::before { background: var(--warn); }
.icon-line { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; }
.icon-line .ic { margin-top: 1px; color: var(--muted); }
.change-row b { margin-left: 4px; }
.chg { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-tag); margin-left: 4px;
  color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.chg.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, transparent); }
.section-head { margin: 28px 0 10px; }
.section-head h2 { margin: 0; }
.section-head .link { min-height: 44px; padding: 0 4px; }

/* сгруппированные списки */
.list { padding: 0 0 0 16px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 0; min-height: 54px;
  box-shadow: inset 0 -1px 0 var(--line); cursor: pointer; color: var(--text); }
.list-item:last-child { box-shadow: none; }
.list-item > span[style*="flex:1"] { min-width: 0; }
.list-item > .muted.small { max-width: 40%; text-align: right; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item label { margin: 0; color: var(--text); font-size: var(--fs-md); cursor: pointer; }
.card .link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.chev { color: var(--muted); display: inline-flex; opacity: .7; }
.chev .ic { width: 18px; height: 18px; }
.mi { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.mi .ic { width: 18px; height: 18px; }
.deadline.done label > div:first-child { text-decoration: line-through; color: var(--muted); }

/* ---------------------------------------------------------- расписание */
.sched-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.week-label { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
.week-nav { margin-top: 8px; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 10px 0 8px; padding: 6px; border-radius: var(--r-md);
  background: var(--card); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: var(--blur-card); backdrop-filter: var(--blur-card);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-sm); }
.day { display: flex; flex-direction: column; align-items: center; padding: 8px 0 7px; border-radius: var(--r-day); min-height: 72px; min-width: 0;
  font-size: 11.5px; font-weight: 650; color: var(--muted); position: relative; transition: background .2s; text-transform: uppercase; }
.day b { font-size: 19px; color: var(--text); font-weight: 600; margin-top: 3px; width: 34px; height: 34px; line-height: 34px;
  text-align: center; border-radius: var(--r-day); letter-spacing: -.01em; transition: background .2s; }
.day.today b { color: var(--accent); }
.day.sel b { background: var(--accent-fill); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent-fill) 40%, transparent); }
@media (hover: hover) { .day:hover { background: var(--fill2); } }
.pair-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 36px; margin-top: 5px; }
.pair-dots i, .dots-legend i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.day .chg-mark { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.dots-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: var(--fs-xs); color: var(--muted); margin: 2px 0 6px; }
.dots-legend span { display: inline-flex; align-items: center; gap: 6px; }
.day-title { margin-top: 18px; }
.lesson { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; margin-bottom: 10px; }
.lesson .time { text-align: right; font-size: 13px; color: var(--muted); padding-top: 16px; font-variant-numeric: tabular-nums; }
.lesson .time b { display: block; color: var(--text); font-size: 16px; font-weight: 600; }
.lesson .card { text-align: left; width: 100%; padding-left: 18px; overflow: hidden; }
.lesson .card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c, var(--accent)); }
.lesson .card + .card { margin-top: 0; }
.lesson .card.now { box-shadow: inset 0 0 0 2px var(--c, var(--accent)), 0 12px 30px color-mix(in srgb, var(--c, var(--accent)) 25%, transparent); }
.card.off { opacity: .55; }
.card.off .subj { text-decoration: line-through; }
.subj { font-weight: 600; font-size: 16.5px; line-height: 1.3; margin: 6px 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
.meta { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.meta span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.meta .ic { width: 14px; height: 14px; }
.chg-note { font-size: var(--fs-xs); color: var(--warn); margin-top: 8px; }
.lesson-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 8px 10px; border-radius: 12px; font-size: var(--fs-sm);
  background: color-mix(in srgb, var(--g5f) 16%, transparent); color: var(--text); overflow-wrap: anywhere; white-space: pre-wrap; }
.lesson-note .ic { width: 16px; height: 16px; color: var(--g5); margin-top: 1px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-tag);
  background: color-mix(in srgb, var(--c, var(--accent)) 18%, transparent); color: var(--c, var(--accent)); }
.pairno { font-size: 12.5px; color: var(--muted); margin-left: 6px; }
.pairno.live { color: var(--good); font-weight: 600; }
.break { font-size: 12.5px; color: var(--muted); text-align: center; margin: -2px 0 10px 60px; }
.open-link { margin-top: 20px; }
.card.list.open-link { display: block; }
.open-lesson { padding-left: 18px; overflow: hidden; }
.open-lesson::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c, var(--accent)); }
.note-edit { margin-top: 16px; padding-top: 4px; box-shadow: inset 0 1px 0 var(--line); }
.note-edit label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text); font-weight: 600; font-size: 15px; }
.note-private { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--g5);
  background: color-mix(in srgb, var(--g5f) 16%, transparent); padding: 3px 8px; border-radius: var(--r-tag); }
.note-private .ic { width: 13px; height: 13px; }
.note-edit .form-error:empty { display: none; }
.note-edit .row { margin-top: 10px; }
.note-edit .icon-btn { color: var(--bad); }

/* ---------------------------------------------------------- успеваемость */
.source-note { display: flex; gap: 6px; align-items: flex-start; margin: 4px 4px 12px; }
.source-note .ic { margin-top: 1px; }
.legend-wrap { margin: 4px 0 14px; }
.legend-wrap > .muted { margin: 0 4px 8px; }
.grade-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.grade-legend li { display: flex; align-items: center; gap: 6px; justify-content: center; min-height: 40px; padding: 6px 8px; border-radius: 14px;
  background: color-mix(in srgb, var(--gf) 15%, transparent); font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.grade-legend li i { width: 10px; height: 10px; border-radius: 50%; background: var(--gf); flex-shrink: 0; }
.grade-legend li b { color: var(--gc); font-size: 15px; }
.g2 { --gc: var(--g2); --gf: var(--g2f); } .g3 { --gc: var(--g3); --gf: var(--g3f); }
.g4 { --gc: var(--g4); --gf: var(--g4f); } .g5 { --gc: var(--g5); --gf: var(--g5f); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stats .card + .card { margin-top: 0; }
.stat { padding: 14px 16px; min-width: 0; }
.stat:first-child { grid-column: 1 / -1; }
.stat-label { font-size: var(--fs-sm); color: var(--muted); font-weight: 550; }
.stat-num { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums;
  color: var(--gc, var(--text)); overflow-wrap: anywhere; }
.stat:first-child .stat-num { font-size: 40px; }
.stat-of { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.stat.g2, .stat.g3, .stat.g4, .stat.g5 { background: linear-gradient(160deg, color-mix(in srgb, var(--gf) 14%, var(--card)), var(--card) 70%); }
.grade-grid .card + .card { margin-top: 10px; }
.grade-top { display: flex; gap: 12px; align-items: flex-start; }
.grade-info { flex: 1; min-width: 0; }
.grade .subj { margin: 0 0 3px; }
.score { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 62px; padding: 6px 8px; border-radius: 16px;
  background: color-mix(in srgb, var(--gf, var(--fill)) 15%, transparent); }
.score-num { font-size: 26px; font-weight: 750; line-height: 1.05; letter-spacing: -.02em; color: var(--gc, var(--text)); font-variant-numeric: tabular-nums; }
.score-num.word { font-size: 15px; }
.score-of { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.bar { position: relative; height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; margin: 14px 0 8px; }
.bar i { display: block; height: 100%; background: var(--gf, var(--accent-fill)); border-radius: 4px; }
.bar s { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--card-solid); opacity: .8; }
.grade-foot { gap: 8px; flex-wrap: wrap; }
.mark-pill { font-size: var(--fs-xs); font-weight: 700; padding: 3px 9px; border-radius: var(--r-tag); color: var(--gc, var(--text));
  background: color-mix(in srgb, var(--gf, var(--fill)) 16%, transparent); }

/* -------------------------------------------------------------- заявки */
.req .row { gap: 8px; }
.steps { display: flex; gap: 4px; list-style: none; padding: 0; margin: 12px 0 0; }
.step { flex: 1; font-size: 11px; color: var(--muted); padding-top: 8px; border-top: 4px solid var(--fill); text-align: center; border-radius: 2px; }
.step.on { color: var(--text); border-color: var(--good); }
.step.bad { color: var(--bad); border-color: var(--bad); }
.note-box { display: flex; gap: 8px; align-items: flex-start; background: color-mix(in srgb, var(--accent) 11%, transparent); border-radius: var(--r-sm);
  padding: 12px 14px; margin-top: 12px; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.note-box .ic { margin-top: 1px; color: var(--accent); }
.good-box { background: color-mix(in srgb, var(--good) 12%, transparent); }
.good-box .ic { color: var(--good); }
.timeline { list-style: none; padding: 0 0 0 16px; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 12px 8px; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-fill); }
.staff-req .btn { flex: 1; }

/* ------------------------------------------------- уведомления и чат */
.notif.unread { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent), var(--shadow-sm); }
.n-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.n-ic .ic { width: 17px; height: 17px; }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-fill); flex-shrink: 0; }
.chat { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.msg { max-width: 82%; background: var(--card); border: 1px solid var(--glass-edge); padding: 9px 14px; border-radius: 20px 20px 20px 6px;
  white-space: pre-wrap; line-height: 1.38; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--accent-fill); border-color: transparent; color: #fff; border-radius: 20px 20px 6px 20px; }
.msg.me .muted { color: rgba(255, 255, 255, .8); }
.msg-head { display: flex; align-items: center; gap: 4px; justify-content: space-between; margin: -4px -8px 2px 0; }
.msg-del { display: grid; place-items: center; width: 44px; height: 44px; margin: -10px -10px -10px 0; border-radius: 50%; color: inherit; opacity: .7; flex: none; }
.msg-del:hover, .msg-del:focus-visible { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.msg-del .ic { width: 17px; height: 17px; }
.composer { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: 0; padding: 8px 0 4px;
  background: linear-gradient(transparent, var(--bg) 35%); }
.composer textarea { min-height: 50px; resize: none; border-radius: 25px; }
#sheet .composer { background: transparent; }

/* --------------------------------------------------------------- профиль */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 650;
  background: linear-gradient(150deg, var(--accent-fill), #9b5cf0); color: #fff; flex-shrink: 0; }
.big-av { width: 64px; height: 64px; font-size: 23px; box-shadow: 0 10px 24px color-mix(in srgb, var(--accent-fill) 30%, transparent); }
.profile .kv:first-of-type { margin-top: 16px; padding-top: 12px; box-shadow: inset 0 1px 0 var(--line); }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; font-size: 15px; margin: 10px 0; align-items: center; }
.kv span:first-child { color: var(--muted); }
.kv span:nth-child(2) { overflow-wrap: anywhere; min-width: 0; }
.kv-copy { grid-template-columns: 110px minmax(0, 1fr) 44px; margin: 4px 0; }
.copy-btn { color: var(--muted); background: transparent; box-shadow: none; }
@media (hover: hover) { .copy-btn:hover { color: var(--accent); background: var(--fill); } }
.headman-note { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 6px 12px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 650; color: var(--g5); background: color-mix(in srgb, var(--g5f) 16%, transparent); }
.back-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.back-bar h1 { margin: 0; font-size: 28px; min-width: 0; overflow-wrap: anywhere; }
.theme-card { padding: 14px 16px; }
.set-label { display: block; font-weight: 600; margin: 0 2px 10px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--fill2);
  box-shadow: inset 0 0 0 1px var(--line); }
.seg button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 6px 8px; border-radius: 12px;
  font-size: 14.5px; font-weight: 600; color: var(--muted); transition: background .25s, color .25s, box-shadow .25s; min-width: 0; }
.seg button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--card-solid); color: var(--text);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 4px 14px rgba(0, 0, 0, .14); }
.seg .ic { width: 17px; height: 17px; }
.theme-hint { margin: 10px 2px 0; }
label.list-item { margin: 0; color: var(--text); font-size: var(--fs-md); }

/* ------------------------------------------------------- открытые данные */
.search { margin-bottom: 10px; }
.tags { display: flex; gap: 8px; overflow-x: auto; min-width: 0; padding: 2px 0 6px; margin-bottom: 10px; scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); }
.tags::-webkit-scrollbar { display: none; }
.news-types { flex-wrap: nowrap; gap: 6px; padding: 5px 4px 8px; scrollbar-width: thin;
  mask-image: none; -webkit-mask-image: none; }
.news-types::-webkit-scrollbar { display: block; height: 6px; }
.news-types::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 999px; }
.news-types .chip { flex: none; padding-inline: 12px; white-space: nowrap; }
.news-grid { display: grid; gap: 12px; }
.news { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.news-title { margin: 0; font-size: 19px; line-height: 1.35; }
.news-demo-body { font-size: var(--fs-md); line-height: 1.55; }
.news-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.news:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.news-title a:hover { text-decoration: underline; }
.news-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.news-cat { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-tag); color: var(--cc, var(--accent));
  background: color-mix(in srgb, var(--cc, var(--accent)) 15%, transparent); }
.c-study { --cc: var(--lk); } .c-science { --cc: var(--lab); } .c-life { --cc: var(--warn); }
.c-sport { --cc: var(--good); } .c-career { --cc: var(--g5); } .c-other { --cc: var(--muted); }
.news .topic-tags { margin: 0; }
.news-ext { display: inline-flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 4px; font-weight: 600; }
.news-ext .ic { width: 13px; height: 13px; }
.news-grid .card + .card { margin-top: 0; }
.news-announcements .notif { overflow-wrap: anywhere; }
.news-announcements .notif .small:not(.muted) { font-size: var(--fs-md); line-height: 1.55; white-space: pre-wrap; }
table.bells { width: 100%; border-collapse: collapse; font-size: 16px; font-variant-numeric: tabular-nums; }
table.bells td { padding: 12px 4px; box-shadow: inset 0 -1px 0 var(--line); }
table.bells tr:last-child td { box-shadow: none; }
table.bells tr.cur td { color: var(--accent); font-weight: 600; }

/* ------------------------------------------------------------ состояния */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.ic-wrap { width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 20px; display: grid; place-items: center;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: inset 0 1px 0 var(--glass-hi); }
.ic-wrap .ic { width: 28px; height: 28px; }
.ic-wrap.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.danger { color: var(--bad); }
.skeleton { height: 76px; border-radius: var(--radius); margin-bottom: 10px;
  background: linear-gradient(90deg, var(--card), var(--fill), var(--card)); background-size: 200% 100%; animation: sh 1.3s infinite; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ------------------------------------------------------ лист и тосты */
#sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .32); z-index: 1000; animation: fade .2s;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
#sheet { position: fixed; left: 50%; transform: translateX(-50%); width: calc(100% - 16px); max-width: 520px;
  bottom: calc(8px + env(safe-area-inset-bottom)); max-height: 88%; overflow-y: auto; z-index: 1001;
  background: color-mix(in srgb, var(--bg2) 84%, transparent); border-radius: 34px;
  padding: 22px 20px 24px; animation: up .34s cubic-bezier(.2, .9, .25, 1); }
#sheet::before { content: ""; position: absolute; top: 7px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--fill); }
.sheet-head { display: flex; align-items: center; gap: 10px; position: sticky; top: -22px; padding: 6px 0 10px; z-index: 1;
  background: transparent; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 20px; min-width: 0; overflow-wrap: anywhere; }
@keyframes up { from { transform: translate(-50%, 60px); opacity: 0; } }
#toasts { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 2000;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { color: var(--text); padding: 12px 20px; border-radius: 999px; font-size: 14.5px; font-weight: 550; animation: fade .25s; max-width: 100%; text-align: center; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------- единомышленники, старосты */
.tg { color: var(--accent); font-size: var(--fs-xs); font-weight: 600; margin-right: 6px; }
.topic-tags { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 6px 0; text-align: left; }
.topic-desc { text-align: left; margin-top: 4px; }
.topic-meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.topic-meta .ic { width: 14px; height: 14px; }
.search-row { gap: 8px; margin-bottom: 4px; }
.search-row .search { flex: 1; min-width: 0; margin-bottom: 0; }
.appeal-body { white-space: pre-wrap; margin-top: 6px; overflow-wrap: anywhere; }
.headman-row label { margin-top: 6px; }

/* ---- навигация: на телефоне и планшете основные разделы + «Ещё», на компьютере всё в боковом меню */
.nav-group, .nav-spacer, .lbl-full, .nav-count, #tabs button.nav-2nd { display: none; }

/* ============================================================ ПЛАНШЕТ */
@media (min-width: 640px) {
  #app { max-width: 880px; }
  .demo-banner { margin: 14px auto 0; max-width: 560px; width: calc(100% - 48px); }
  #view { padding: 24px 32px calc(124px + env(safe-area-inset-bottom)); }
  h1 { font-size: 36px; }
  #tabs { width: min(600px, calc(100% - 48px)); bottom: calc(18px + env(safe-area-inset-bottom)); }
  #tabs button { font-size: 11.5px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:first-child { grid-column: auto; }
  .stat:first-child .stat-num { font-size: 30px; }
  .kv { grid-template-columns: 130px minmax(0, 1fr); }
  .kv-copy { grid-template-columns: 130px minmax(0, 1fr) 44px; }
  .grade-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .grade-grid .card + .card { margin-top: 0; }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend-wrap { display: flex; align-items: center; gap: 14px; }
  .legend-wrap > .muted { margin: 0; flex-shrink: 0; }
  .grade-legend { flex: 1; }
  .login { margin-top: 48px; }
  #sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); max-height: 84vh; }
  @keyframes up { from { transform: translate(-50%, -46%); opacity: 0; } }
  #toasts { bottom: calc(110px + env(safe-area-inset-bottom)); }
}

/* ============================================================ КОМПЬЮТЕР */
@media (min-width: 1024px) {
  #app { max-width: 1280px; }
  .demo-banner { margin: 14px 24px 0; max-width: none; width: auto; }
  #shell { flex-direction: row; gap: 12px; padding: 0 24px; }
  #tabs { position: sticky; top: 14px; left: auto; bottom: auto; transform: none; align-self: flex-start;
    flex-direction: column; align-items: stretch; width: 260px; flex-shrink: 0; max-height: calc(100vh - 76px);
    margin: 14px 0; padding: 16px 12px; gap: 2px; border-radius: var(--r-lg); overflow-y: auto; scrollbar-width: none; }
  #tabs .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 4px 10px 16px; letter-spacing: -.01em; color: var(--text); }
  #tabs .brand img { border-radius: 10px; }
  #tabs button { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 12px; font-size: 15px; font-weight: 550;
    min-height: 44px; border-radius: 14px; color: var(--text); }
  #tabs button:active { transform: none; }
  #tabs svg { width: 21px; height: 21px; color: var(--accent); }
  #tabs button.active { background: var(--accent-fill); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent-fill) 30%, transparent); }
  #tabs button.active svg { color: #fff; }
  #tabs button.active-m:not(.active) { color: var(--text); }
  @media (hover: hover) { #tabs button:not(.active):hover { background: var(--fill2); } }
  .badge-dot { position: static; margin-left: auto; }
  .m-only { display: none !important; }
  #tabs button.nav-2nd { display: flex; }
  .lbl-full { display: inline; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lbl-short { display: none; }
  .nav-group { display: block; font-size: 12px; font-weight: 650; color: var(--muted); padding: 14px 12px 4px; text-transform: uppercase; letter-spacing: .04em; }
  .brand + .nav-group { padding-top: 0; }
  .nav-spacer { display: block; flex: 1; min-height: 12px; }
  .nav-count { display: inline-block; margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: var(--r-tag); text-align: center;
    font-size: 12px; font-weight: 700; color: #fff; background: var(--bad); }
  #view { padding: 26px 12px 48px 20px; max-width: 980px; }
  body.logged-out #view { max-width: none; }
  /* компьютер: расписание и лента слева, карта корпусов — в правой колонке */
  .home-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "sched map" "rest map";
    column-gap: 24px; align-items: start; }
  .home-sched { grid-area: sched; } .home-rest { grid-area: rest; }
  .home-map-sec { grid-area: map; position: sticky; top: 0; }
  #toasts { bottom: 32px; }
}
@media (min-width: 1360px) {
  #view { max-width: 1040px; }
}


/* расписание: режимы «День / Неделя / Месяц» */
.sched-seg { margin-top: 10px; }
.chg-banner { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 8px 6px 16px; margin-top: 10px; border-radius: 22px; font-size: var(--fs-sm); font-weight: 600;
  background: color-mix(in srgb, var(--warn) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.chg-banner i { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); flex: none; }
.chg-banner button { min-height: 44px; padding: 0 12px; font-weight: 700; color: var(--warn); }
.date-pick { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.date-pick label { font-size: var(--fs-sm); color: var(--muted); flex: none; }
.date-pick input { min-height: 44px; flex: 1; min-width: 0; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 14px; }
.day-head h2 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.sub-nav { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 10px; }
.sub-nav button { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px; font-size: var(--fs-md); color: var(--muted); font-weight: 500; }
.today-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; flex: none;
  background: var(--accent-fill); color: #fff; font-size: var(--fs-md); font-weight: 700;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent-fill) 40%, transparent), inset 0 1px 0 rgba(255,255,255,.28); transition: transform .15s; }
.today-btn .ic { width: 18px; height: 18px; }
.today-btn:active { transform: scale(.95); }
.sub-nav .ic { width: 18px; height: 18px; }
/* полоска дней: отдельные «таблетки» */
.days { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; gap: 6px; }
.day { background: var(--card); border: 1px solid var(--glass-edge); border-radius: var(--r-day); padding: 10px 0 9px; min-height: 84px; }
.day b { background: none; box-shadow: none; width: auto; height: auto; line-height: 1.2; font-size: 21px; margin-top: 4px; }
.day.sel { background: var(--accent-fill); border-color: transparent; color: rgba(255,255,255,.85); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent-fill) 35%, transparent); }
.day.sel b { background: none; color: #fff; box-shadow: none; }
.day.sel .pair-dots i { background: none; box-shadow: inset 0 0 0 1.5px #fff; }
.day.today:not(.sel) b { color: var(--accent); }
/* карточка пары: время слева внутри карточки */
.lesson { display: block; margin-bottom: 10px; }
.lesson .card { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; width: 100%; text-align: left; padding: 16px 16px 16px 20px; overflow: hidden; }
.lesson .lt { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.lesson .lt b { color: var(--text); font-size: 17px; font-weight: 650; }
.lesson .lb { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lesson .subj { display: block; margin: 0; font-size: 18px; }
.lesson .chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.lesson .chips .meta { display: inline-flex; }
.soon { font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: var(--r-tag); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.soon.live { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.now-line { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; color: var(--bad); font-size: 13px; font-variant-numeric: tabular-nums; }
.now-line i { flex: 1; height: 2px; border-radius: 2px; background: var(--bad); }
.break { display: flex; align-items: center; gap: 12px; margin: -2px 0 10px; font-size: 12.5px; color: var(--muted); }
.break::before, .break::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* неделя: сетка «время × дни» */
.wk-grid { display: grid; grid-template-columns: 34px repeat(var(--n, 6), minmax(0, 1fr)); gap: 4px; margin-top: 12px; padding: 8px 6px 10px; border-radius: var(--r-lg, 28px);
  background: var(--card); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: var(--blur-card); backdrop-filter: var(--blur-card); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-sm); }
.wk-col { display: flex; flex-direction: column; align-items: center; min-height: 64px; padding: 8px 0 6px; border-radius: 16px; min-width: 0; font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; }
.wk-col b { font-size: 17px; color: var(--text); margin-top: 2px; }
.wk-col .pair-dots { margin-top: 3px; max-width: 34px; gap: 2px; }
.wk-col .pair-dots i { width: 4px; height: 4px; }
.wk-col.sel { background: var(--accent-fill); color: rgba(255,255,255,.85); }
.wk-col.sel b { color: #fff; }
.wk-col.sel .pair-dots i { background: none; box-shadow: inset 0 0 0 1px #fff; }
.wk-col.today:not(.sel) b { color: var(--accent); }
.wk-time { align-self: center; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.1; }
.wk-cell { position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 4px; min-height: 60px; min-width: 0; padding: 7px 5px; border-radius: 14px; text-align: left;
  background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--c); }
.wk-cell b { font-size: 10.5px; letter-spacing: .02em; text-transform: uppercase; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-cell span { font-size: 11px; font-weight: 650; letter-spacing: -.02em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-cell.empty { background: var(--fill); opacity: .55; }
.wk-cell.off { opacity: .5; text-decoration: line-through; }
.wk-cell.sel:not(.empty) { box-shadow: inset 0 0 0 1.5px var(--c); }
.wk-cell .chg-mark { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }
/* месяц: плитки */
.month-card { padding: 16px 14px 14px; margin-top: 12px; }
.month-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.month-head h2 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mdow { text-align: center; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; padding: 6px 0; }
.mday { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; min-height: 56px; min-width: 0; padding: 8px 0 6px; border-radius: 16px; background: var(--fill2); color: var(--text); }
.mday b { font-size: 17px; font-weight: 650; line-height: 1.1; }
.mday.wknd b { color: var(--muted); }
.mday .pair-dots { margin-top: 0; max-width: 40px; gap: 2px; }
.mday .pair-dots i { width: 5px; height: 5px; }
.mday.today:not(.sel) b { color: var(--accent); }
.mday.sel { background: var(--accent-fill); }
.mday.sel b { color: #fff; }
.mday.sel .pair-dots i { background: none; box-shadow: inset 0 0 0 1.3px #fff; }
@media (hover: hover) { .mday:hover:not(.sel), .day:hover:not(.sel) { background: var(--card-hover); } }
.month-stats { margin-top: 12px; }
.eyebrow { margin: 0 0 12px; font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat-bar { display: flex; gap: 4px; height: 10px; }
.stat-bar i { background: var(--c); border-radius: 999px; min-width: 6px; }
.stat-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; padding: 0; font-size: var(--fs-md); }
.stat-legend li { display: inline-flex; align-items: center; gap: 8px; }
.stat-legend i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }

/* главная: следующая пара — приглушённая карточка под главной */
.up-next { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 12px; margin-top: 10px; padding: 12px 16px 12px 20px; overflow: hidden; opacity: .88; }
.up-next::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c, var(--accent)); opacity: .7; }
.up-time { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.up-time b { color: var(--text); font-size: 15px; font-weight: 600; }
.up-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.up-label { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.up-subj { font-size: 15.5px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.up-meta .ic { width: 14px; height: 14px; }
.up-meta .badge { font-size: 10.5px; padding: 2px 8px; }
/* расписание: свайпы — горизонтальный жест забирает приложение, вертикальная прокрутка остаётся у браузера */
.days, #lessons, .wk-grid, .month-card { touch-action: pan-y; }
@keyframes slide-from-right { from { transform: translateX(32%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-from-left { from { transform: translateX(-32%); opacity: 0; } to { transform: none; opacity: 1; } }
.slide-next { animation: slide-from-right .22s cubic-bezier(.2, .8, .2, 1) both; }
.slide-prev { animation: slide-from-left .22s cubic-bezier(.2, .8, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { .slide-next, .slide-prev { animation: none; } }

@media (max-width: 370px) {
  #view { padding-left: 12px; padding-right: 12px; }
  .kv { grid-template-columns: 112px minmax(0, 1fr); }
  .kv-copy { grid-template-columns: 112px minmax(0, 1fr) 44px; }
  .days { padding: 4px; gap: 2px; }
  h1 { font-size: 28px; }
  #tabs button { font-size: 10px; }
  .grade-legend { gap: 4px; }
  .grade-legend li { padding: 6px 4px; gap: 4px; }
  .seg button { font-size: 13.5px; gap: 4px; padding: 6px 4px; }
}
@media (max-width: 420px) {
  .seg .ic { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* браузеры без размытия: стекло делаем плотным, чтобы текст читался */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #tabs, #sheet, .toast, .card { background: var(--card-solid); }
}

/* главная: неделя и остальные пары дня */
.home-days { margin-top: 4px; }
.up-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.up-list .up-next { margin-top: 0; min-height: 64px; }
.up-next.past { opacity: .5; }
@media (max-width: 400px) { .home-days .day { min-height: 76px; } .home-days .day b { font-size: 18px; } }

/* док: режим «провести пальцем» */
#tabs { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
#tabs.scrub button { transition: transform .12s, background .12s; }
#tabs button.peek { background: var(--fill); color: var(--accent); transform: scale(1.12); box-shadow: 0 6px 18px rgba(0,0,0,.28); }

.home-days .day.today:not(.sel) { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
