/* hse app web: матовые поверхности, один акцент Вышки.
   Сетка 4px, радиусы 8/12/16/20, системный шрифт. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 20px;

  --bg: #000;
  --surface: #1c1c1e;
  --raised: #2c2c2e;
  --step: rgba(255, 255, 255, 0.06);
  --step-hover: rgba(255, 255, 255, 0.1);
  --hairline: rgba(255, 255, 255, 0.1);
  --text: #fff;
  --text-2: #aeaeb2;
  --muted: #8e8e93;
  --accent: #0047bb;
  --accent-hover: #0a56d6;
  --accent-text: #6ea4ff;
  --on-accent: #fff;
  --danger: #ff6961;
  --danger-fill: #d70015;
  --ok: #30d158;
  --warn: #ff9f0a;
  --overlay: rgba(0, 0, 0, 0.6);
  --lens: rgba(255, 255, 255, 0.14);
  --sheet: #1c1c1e;
  --sheet-card: #2c2c2e;
  --r-xl: 24px; --r-sheet: 28px;

  --c-blue: #0a84ff; --c-indigo: #5e5ce6; --c-teal: #40c8e0; --c-green: #30d158; --c-orange: #ff9f0a;
  --c-red: #ff453a; --c-pink: #ff375f; --c-purple: #bf5af2; --c-gray: #8e8e93;
}

:root[data-theme="light"] {
  --bg: #fff;
  --surface: #f2f2f7;
  --raised: #fff;
  --step: rgba(0, 0, 0, 0.05);
  --step-hover: rgba(0, 0, 0, 0.09);
  --hairline: rgba(0, 0, 0, 0.1);
  --text: #111;
  --text-2: #55555a;
  --muted: #6c6c70;
  --accent-text: #0047bb;
  --danger: #c4120a;
  --danger-fill: #d70015;
  --ok: #1f8f3a;
  --overlay: rgba(0, 0, 0, 0.35);
  --lens: rgba(0, 0, 0, 0.09);
  --sheet: #f2f2f7;
  --sheet-card: #fff;

  --c-blue: #007aff; --c-indigo: #5856d6; --c-teal: #1f9cb3; --c-green: #28a745; --c-orange: #e08600;
  --c-red: #e5352b; --c-pink: #e0244a; --c-purple: #a041d1; --c-gray: #8e8e93;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
html[data-theme="light"] { color-scheme: light; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
/* Обводка фокуса — только при работе с клавиатуры (класс kbd ставит theme-boot.js по Tab);
   после касаний и кликов синих рамок нет. */
:focus, :focus-visible { outline: none; }
html.kbd :focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.noscript { padding: 24px; }

/* Поверхности */
.card { background: var(--surface); border-radius: var(--r-lg); }
:root[data-theme="light"] .card { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }

/* Кнопки */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 0; border-radius: var(--r-sm); background: var(--step); color: var(--text); font-weight: 500;
  transition: background-color 150ms var(--ease), transform 150ms var(--ease), opacity 150ms var(--ease);
}
.button:hover { background: var(--step-hover); }
.button:active { transform: scale(0.98); }
.button:disabled { opacity: 0.45; cursor: default; transform: none; }
.button-primary { background: var(--accent); color: var(--on-accent); }
.button-primary:hover { background: var(--accent-hover); }
.button-danger { background: var(--danger-fill); color: #fff; }
.button-danger:hover { background: #e8222f; }
.button-quiet { background: transparent; color: var(--danger); }
.button-quiet:hover { background: var(--step); }
.button-small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.button-wide { width: 100%; }
.button-spinner {
  display: none; width: 16px; height: 16px; flex: none; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%; animation: button-spin 700ms linear infinite;
}
.button.is-loading .button-spinner { display: inline-block; }
.button.is-loading { cursor: wait; }
@keyframes button-spin { to { transform: rotate(360deg); } }
.icon-button {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--r-xs);
  background: transparent; color: var(--text-2); transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.icon-button:hover { background: var(--step); color: var(--text); }

/* Поля */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field-label { font-size: 13px; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--muted); }
.field-input {
  width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--hairline); border-radius: var(--r-sm);
  background: var(--raised); color: var(--text); transition: border-color 150ms var(--ease);
}
:root[data-theme="light"] .field-input { background: var(--bg); }
.field-input:focus-visible { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text); }
.field-input[readonly], .field-input:disabled { opacity: 0.6; }
.field-input-compact { width: auto; }
.field-textarea { padding: 12px; min-height: 96px; resize: vertical; line-height: 1.45; }
.field-select { min-width: 156px; width: auto; padding-right: 8px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-field { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.check-field input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.form-error { color: var(--danger); font-size: 13px; }
.form-note { color: var(--text-2); font-size: 13px; background: var(--step); padding: 12px; border-radius: var(--r-sm); }
.counter { font-family: var(--mono); font-variant-numeric: tabular-nums; justify-self: end; }
.spacer { flex: 1; }


/* ===== Каркас кабинета ===== */
html { touch-action: manipulation; -webkit-tap-highlight-color: transparent; background: var(--bg); }
body { overscroll-behavior-y: none; min-height: 100dvh; }
#app { min-height: 100dvh; }
.app {
  --content-width: 760px;
  --content-inset: 16px;
  --nav-height: 68px;
  --nav-offset: calc(var(--nav-height) + 24px + env(safe-area-inset-bottom));
  --rail-width: 0px;
  --fab-size: 56px;
  --float-right: max(16px, env(safe-area-inset-right), calc((100% - var(--rail-width) - var(--content-width)) / 2 + var(--content-inset)));
  min-height: 100dvh; position: relative;
}
.main { width: 100%; max-width: var(--content-width); margin-inline: auto; min-width: 0; }
.noselect, .hdr, .tabbar, .seg, .strip { user-select: none; -webkit-user-select: none; }

/* Шапка: колокольчик слева, профиль справа, содержимое по центру. Контент ездит под ней. */
.screen { min-height: 100dvh; padding-bottom: calc(var(--nav-offset) + 24px); }
.main:has(.fab) .screen { padding-bottom: calc(var(--nav-offset) + var(--fab-size) + 40px); }
/* Только прозрачность: transform у предка привязал бы position: fixed (нижний бар, «+») к странице. */
.app { animation: fade-in 320ms var(--ease) both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.screen-head {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(16px);
  backdrop-filter: saturate(1.2) blur(16px);
  padding: calc(8px + env(safe-area-inset-top)) max(var(--content-inset), env(safe-area-inset-right))
    12px max(var(--content-inset), env(safe-area-inset-left)); display: grid; gap: 12px;
}
.screen-tools { display: flex; min-width: 0; }
.menu-search-disabled {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 44px; padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 999px;
  background: #0b0b0d; color: #616166; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  opacity: 0.86; pointer-events: none;
}
.menu-search-disabled svg { flex: none; color: #55555a; }
.menu-search-placeholder { flex: 1; font-size: 16px; }
.menu-search-status { color: #444448; font-size: 12px; }
.screen-head::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 16px; pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 72%, transparent), transparent);
}
.hdr { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.hdr-mid { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; }
.hdr-title { font-size: 20px; line-height: 1.2; font-weight: 600; text-align: center; }
.hdr-btn {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--hairline); color: var(--text);
  transition: transform 150ms var(--ease), background-color 150ms var(--ease);
}
.hdr-btn:active { transform: scale(0.94); }
.hdr-btn .dot { position: absolute; }
.hdr-btn.is-on { background: rgba(0, 71, 187, 0.18); border-color: transparent; color: var(--accent-text); }
.hdr-pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--hairline); font-size: 15px; font-weight: 600; white-space: nowrap;
}
.screen-body {
  padding: 4px max(var(--content-inset), env(safe-area-inset-right)) 0 max(var(--content-inset), env(safe-area-inset-left));
  display: grid; gap: 28px; align-content: start;
}

/* Секции ленты и списков */
.sec { display: grid; gap: 8px; }
.sec-head, .lsec-head, .task-sec-head { padding: 0 16px; font-size: 17px; line-height: 1.3; font-weight: 500; color: var(--muted); }
.sec-head.is-caps { font-size: 15px; }
.sec-count { font: 600 12px/1 var(--mono); margin-left: 6px; color: var(--muted); opacity: 0.7; }
.nodata { text-align: center; color: var(--muted); font-size: 13px; padding: 12px 16px; }
.screen-body > .nodata { padding-top: 32px; }
.rows-card { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.rows-card > * + * { margin-top: 0; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 16px; width: 100%; border: 0; background: transparent; text-align: left; }
.list-row + .list-row { border-top: 1px solid var(--hairline); }
.list-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.list-title { font-size: 17px; }
.list-sub { font-size: 13px; color: var(--muted); }
.chev { color: var(--muted); opacity: 0.7; flex: none; display: grid; }

/* Одни и те же ссылки в нижней и боковой навигации. */
.tabbar {
  position: fixed; z-index: 10; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(calc(100% - 24px), 540px); transform: translateX(-50%);
  padding: 5px; border: 1px solid color-mix(in srgb, var(--text) 13%, transparent); border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.tabbar-title { display: none; }
.tabs {
  position: relative; display: flex; height: calc(var(--nav-height) - 10px); padding: 3px; gap: 2px;
  overflow-x: auto; scrollbar-width: none; justify-content: flex-start; max-width: var(--content-width); margin-inline: auto;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-slider {
  position: absolute; z-index: 0; inset-block: 3px; left: 0; width: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--lens) 82%, var(--text) 5%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 3px 10px rgba(0, 0, 0, 0.16);
  pointer-events: none; transition: transform 260ms var(--ease), width 260ms var(--ease);
}
.tab {
  position: relative; z-index: 1; flex: 1 1 0; min-width: 52px; display: grid; place-content: center; justify-items: center; gap: 3px;
  border: 0; border-radius: 999px; background: transparent; color: var(--text-2); padding: 0 3px;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.tab-action { font: inherit; }
.tab[data-route="notifications"] { display: grid; }
.tab svg { color: var(--accent-text); }
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { color: var(--accent-text); }
.tab-label { font-size: 10px; line-height: 1.2; letter-spacing: -0.02em; white-space: nowrap; }
.tab-dot { position: absolute; top: 8px; right: calc(50% - 17px); }
.fab {
  position: fixed; z-index: 9; width: var(--fab-size); height: var(--fab-size); border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--hairline);
  background: var(--surface); color: var(--text);
  right: var(--float-right); bottom: calc(var(--nav-offset) + 12px);
  transition: transform 150ms var(--ease);
}
.fab:active { transform: scale(0.94); }

/* На широком экране оставляем меню на месте при прокрутке. */
@media (min-width: 900px) and (min-height: 541px), (min-width: 900px) and (pointer: fine) {
  .app {
    --content-width: 1200px;
    --content-inset: clamp(24px, 3vw, 40px);
    --rail-width: calc(248px + env(safe-area-inset-left));
    --nav-offset: env(safe-area-inset-bottom);
    --fab-size: 48px;
    display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr);
  }
  .tabbar {
    position: sticky; inset: 0 auto auto; align-self: start;
    height: 100dvh; overflow-y: auto;
    padding: calc(24px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    left: auto; bottom: auto; width: auto; transform: none; margin: 0;
    border: 0; border-right: 1px solid var(--hairline); border-radius: 0;
    background: var(--surface); box-shadow: none;
  }
  .tabbar-title { display: block; margin: 0 8px 16px; font-size: 14px; font-weight: 600; }
  .tabs { position: static; display: grid; gap: 4px; height: auto; padding: 0; }
  .tab-slider { display: none; }
  .tab { display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 40px; padding: 0 12px; }
  .tab svg { width: 18px; height: 18px; flex: none; }
  .tab-label { font-size: 14px; }
  .screen-head { padding-top: calc(20px + env(safe-area-inset-top)); }
  .screen-body { padding-top: 12px; }
}

@media (max-width: 899px) {
  .screen-head:has(.hdr-title) .hdr-title { display: none; }
  .screen-head:has(.hdr-title) .hdr-mid:has(.hdr-title:only-child) { min-height: 0; }
  .screen-head:has(.hdr-title) .hdr:has(.hdr-mid:only-child) { min-height: 0; }
}

@media (min-width: 1100px) and (min-height: 541px), (min-width: 1100px) and (pointer: fine) {
  .screen-dashboard > .screen-body { display: block; columns: 2; column-gap: 28px; }
  .screen-dashboard > .screen-body > * { break-inside: avoid; margin-bottom: 28px; }
}

/* Сегменты в шапке */
.seg { display: inline-flex; align-items: center; height: 44px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--hairline); }
.seg button { height: 100%; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 500; transition: background-color 200ms var(--ease), color 200ms var(--ease); }
.seg button[aria-pressed="true"] { background: var(--lens); color: var(--text); }

/* Полоса дней недели */
.strip { display: flex; align-items: center; gap: 2px; padding: 8px; border-radius: var(--r-xl, 24px); background: var(--surface); border: 1px solid var(--hairline); }
.strip-arrow { flex: none; width: 20px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); padding: 0; }
.strip-cell { flex: 1; min-width: 0; display: grid; justify-items: center; gap: 2px; padding: 4px 0; border: 0; border-radius: 999px; background: transparent; transition: background-color 200ms var(--ease); }
.strip-cell.is-selected { background: var(--lens); }
.strip-name { font-size: 11px; font-weight: 500; color: var(--muted); }
.strip-num { width: 30px; height: 30px; display: grid; place-items: center; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text); }
.strip-cell.is-empty .strip-num { color: var(--muted); }
.strip-cell.is-today .strip-num { color: var(--accent-text); }
.weekbar { display: flex; align-items: center; justify-content: center; gap: 12px; }
.weekbar button { width: 32px; height: 36px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.weekbar span { min-width: 180px; text-align: center; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Меню-троеточие */
.menu { position: absolute; z-index: 20; min-width: 200px; padding: 6px; border-radius: var(--r-md); background: var(--raised); border: 1px solid var(--hairline);  }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-xs); background: transparent; text-align: left; font-size: 16px; }
.menu button[aria-checked="true"] { background: var(--step); }
.menu-scrim { position: fixed; inset: 0; z-index: 19; }

/* Расписание */
.day-block { display: grid; gap: 12px; }
.day-name { font-size: 15px; font-weight: 500; color: var(--muted); }
.day-name b { font-size: 11px; font-weight: 500; color: var(--text); text-transform: none; margin-left: 6px; }
.day-card { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.day-empty { text-align: center; color: var(--muted); font-size: 15px; padding: 16px; }

/* Планер: таймлайн */
.timeline { overflow: hidden; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); }
.tl-head, .tl-grid { display: grid; grid-template-columns: var(--gut, 48px) repeat(var(--cols), minmax(0, 1fr)); }
.tl-head { border-bottom: 1px solid var(--hairline); }
.tl-day { display: grid; justify-items: center; gap: 0; min-height: 48px; padding: 6px 0; border: 0; border-left: 1px solid var(--hairline); background: transparent; color: var(--muted); font-size: 11px; }
.tl-day-num { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text); text-transform: none; }
.tl-day.is-today .tl-day-num { color: var(--accent-text); }
.tl-scroll { position: relative; }
.tl-grid { position: relative; }
.hours { position: relative; }
.hour-label { position: absolute; right: 4px; transform: translateY(-50%); font: 400 11px/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.hours .hour-label:first-child { transform: translateY(2px); }
.timeline-col { position: relative; border-left: 1px solid var(--hairline); }
.hour-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--hairline); }
.now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--danger); pointer-events: none; z-index: 3; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.is-week .event { padding: 2px 3px; border-radius: 6px; }
.is-week .event-title { font-size: 11px; -webkit-line-clamp: 3; }
.is-week .flag-mark { position: absolute; left: 2px; right: 2px; height: 16px; z-index: 2; display: flex; align-items: center; gap: 2px; color: var(--c-red); font-size: 11px; overflow: hidden; white-space: nowrap; border-radius: 4px; background: color-mix(in srgb, var(--c-red) 16%, var(--surface)); }

/* Задачи */
.task-sec { display: grid; gap: 8px; }
.task-sec-head { display: flex; align-items: baseline; gap: 6px; }
.task-sec-head .n { font-size: 13px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.task-card { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px 8px 16px; min-height: 52px; }
.task-row + .task-row { border-top: 1px solid var(--hairline); }
.check { flex: none; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.check.is-done { color: var(--ok); }
.is-important:not(.is-done) .check { color: var(--danger); }
.task-main { flex: 1; min-width: 0; display: grid; gap: 2px; border: 0; background: transparent; text-align: left; padding: 0; }
.task-title { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.is-done .task-title { color: var(--muted); text-decoration: line-through; font-weight: 400; }
.is-important:not(.is-done) .task-title { color: var(--danger); }
.task-meta { font-size: 11px; color: var(--muted); }
.task-meta.is-overdue { color: var(--danger); }
.task-more { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); }
.teacher-tasks { gap: 10px; }
.teacher-task-head { display: grid; gap: 10px; }
.teacher-task-head .task-sec-head { padding-inline: 0; }
.teacher-task-head .seg { justify-self: stretch; width: 100%; }
.teacher-task-head .seg button { flex: 1; }
.teacher-task-hint { padding: 0 0 2px; color: var(--muted); font-size: 13px; }
.teacher-task-groups { display: grid; gap: 14px; }
.teacher-task-day { display: grid; gap: 6px; }
.teacher-task-day-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px; color: var(--text-2); font-size: 15px; font-weight: 600; }
.teacher-task-day-head .n { color: var(--muted); font: 500 12px/1 var(--mono); }
.teacher-day-select { flex: none; width: 118px; min-height: 34px; padding: 0 6px; border: 1px solid var(--hairline); border-radius: var(--r-xs); background: var(--step); color: var(--text-2); font-size: 12px; }
.teacher-day-select:focus-visible { border-color: var(--accent-text); }
.task-row.is-unassigned .task-meta { color: var(--accent-text); }

/* Профиль, шторки */
.sheet {
  width: min(560px, 100%); height: calc(100dvh - 12px - env(safe-area-inset-top)); max-height: none; margin: auto auto 0; padding: 0; border: 0;
  border-radius: var(--r-sheet, 28px) var(--r-sheet, 28px) 0 0; background: var(--sheet); color: var(--text); overflow: hidden;
}
.sheet::backdrop { background: var(--overlay); }
.sheet[open] { display: flex; flex-direction: column; animation: sheet-up 320ms var(--ease) both; }
@keyframes sheet-up { from { transform: translateY(24%); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head {
  padding: 16px 16px 12px; display: flex; flex: none;
  background: color-mix(in srgb, var(--sheet) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.15) blur(16px);
  backdrop-filter: saturate(1.15) blur(16px);
}
.sheet-head .hdr { width: 100%; }
.sheet .hdr-btn { background: var(--sheet-card); }
.sheet-scroll { flex: 1; overflow-y: auto; padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 24px; align-content: start; -webkit-overflow-scrolling: touch; }
.sheet .rows-card, .sheet .card-flat { background: var(--sheet-card); }
.profile-identity { display: grid; gap: 16px; }
.profile-avatar {
  position: relative; overflow: hidden; width: 96px; height: 96px; margin: 0 auto; display: grid; place-items: center;
  border-radius: 50%; background: var(--step); color: var(--muted);
}
.profile-avatar-image { width: 100%; height: 100%; object-fit: cover; }
.profile-fields { display: grid; gap: 8px; }
.profile-field { display: grid; gap: 5px; padding: 12px 16px; border-radius: var(--r-md); background: var(--sheet-card); }
.profile-field-label { font-size: 12px; color: var(--muted); }
.profile-field-value { font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.profile-field-value.is-empty { color: var(--muted); }
.student-card { background: var(--sheet-card); border-radius: var(--r-lg); padding: 12px 16px; display: grid; gap: 8px; width: 100%; border: 0; text-align: left; color: inherit; }
.student-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; }
.student-top svg { margin-left: auto; width: 36px; height: 36px; }
.student-name { font-size: 20px; font-weight: 600; }
.student-line { font-size: 13px; }
.menu-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; border: 0; background: transparent; text-align: left; font-size: 17px; min-height: 52px; color: inherit; }
.menu-tile { width: 32px; height: 32px; border-radius: var(--r-xs); background: var(--step); display: grid; place-items: center; color: var(--muted); flex: none; }
.menu-row .grow { flex: 1; }
.block-head { font-size: 15px; font-weight: 500; color: var(--muted); padding: 0 0 8px 0; }
.stack { display: grid; gap: 24px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px 0 4px; border: 0; background: transparent; color: var(--accent-text); font-size: 17px; }
.field-row-inline { display: flex; align-items: center; gap: 12px; padding: 8px 16px; min-height: 52px; }
.field-row-inline + .field-row-inline { border-top: 1px solid var(--hairline); }
.field-row-inline .grow { flex: 1; min-width: 0; }
.value { color: var(--muted); font-size: 15px; text-align: right; overflow-wrap: anywhere; }
.danger-text { color: var(--danger); }
.center-btn { display: block; width: 100%; padding: 14px 16px; border: 0; background: transparent; font-size: 17px; text-align: center; }
.foot-note { font-size: 13px; color: var(--muted); padding: 0 16px; }
.note { display: flex; gap: 16px; padding: 16px; color: var(--text-2); background: var(--sheet-card); border-radius: var(--r-lg); }
.note h2 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.note p { font-size: 13px; }
.note-icon { color: var(--accent-text); flex: none; }

/* Поиск */
.search-field { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--hairline); color: var(--muted); flex: 1; }
.search-field input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; outline: none; color: var(--text); font-size: 16px; }

/* Заглушка загрузки и вход */
.login { min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); }
.login-card { position: relative; width: min(400px, 100%); padding: 32px; display: grid; gap: 20px; background: var(--surface); border-radius: var(--r-lg); }
.portal-login { width: min(400px, 100%); display: grid; gap: 24px; }
.login-card h1, .login-card h2 { font-size: 22px; font-weight: 600; }
.login-help { color: var(--muted); font-size: 13px; }
.card { background: var(--surface); border-radius: var(--r-lg); }

.toast {
  position: fixed; left: calc(50% + var(--rail-width) / 2); bottom: calc(var(--nav-offset) + 16px);
  transform: translateX(-50%); z-index: 30; max-width: calc(100% - var(--rail-width) - 32px);
  padding: 12px 16px; border-radius: var(--r-sm); background: var(--raised); color: var(--text); font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.sync-pill { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.sync-dot.is-ok { background: var(--ok); }
.sync-dot.is-bad { background: var(--danger); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Редакторы: на телефоне снизу, на широком экране по центру */
@media (max-width: 599px) {
  .dialog { width: 100%; max-width: none; margin: auto auto 0; border-radius: var(--r-sheet, 28px) var(--r-sheet, 28px) 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .dialog-narrow { width: 100%; }
  .field-row { grid-template-columns: 1fr; }
}
@media (min-width: 600px) { .sheet { height: min(860px, calc(100dvh - 48px)); margin: auto; border-radius: var(--r-sheet, 28px); } }

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

/* События и цвета */
.event {
  --c: var(--c-gray);
  position: absolute; display: grid; align-content: start; gap: 2px; padding: 4px 8px; overflow: hidden; text-align: left;
  border: 0; border-radius: 8px;
  background: color-mix(in srgb, var(--c) 24%, var(--surface)); color: var(--text); z-index: 2; cursor: pointer;
  transition: background-color 150ms var(--ease);
}
.event:hover { background: color-mix(in srgb, var(--c) 34%, var(--surface)); }
.event.is-compact { padding: 2px 6px; }
.event-title { font-size: 13px; font-weight: 500; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.event-time { font: 400 11px/1.2 var(--mono); color: var(--text-2); font-variant-numeric: tabular-nums; }
.chip {
  --c: var(--c-gray);
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 24px; padding: 0 8px; border: 0; border-radius: 6px;
  background: color-mix(in srgb, var(--c) 24%, var(--surface)); color: var(--text); font-size: 12px;
}
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.chip { cursor: pointer; }
.chip-task { background: color-mix(in srgb, var(--c-red) 18%, var(--surface)); color: var(--text); }
.chip-task svg { color: var(--c-red); flex: none; }
.event-blue, .chip-blue, .swatch-blue { --c: var(--c-blue); }
.event-indigo, .chip-indigo, .swatch-indigo { --c: var(--c-indigo); }
.event-teal, .chip-teal, .swatch-teal { --c: var(--c-teal); }
.event-green, .chip-green, .swatch-green { --c: var(--c-green); }
.event-orange, .chip-orange, .swatch-orange { --c: var(--c-orange); }
.event-red, .chip-red, .swatch-red { --c: var(--c-red); }
.event-pink, .chip-pink, .swatch-pink { --c: var(--c-pink); }
.event-purple, .chip-purple, .swatch-purple { --c: var(--c-purple); }
.event-gray, .chip-gray, .swatch-gray, .swatch-auto { --c: var(--c-gray); }
/* Пары из ЕЛК в планере — всегда акцент Вышки, как в приложении */
.event-pair { --c: var(--accent); }
/* Диалог */
.dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--hairline); border-radius: var(--r-lg);
  background: var(--surface); color: var(--text);
}
.dialog-narrow { width: min(420px, calc(100vw - 32px)); }
.dialog::backdrop { background: var(--overlay); }
.dialog[open] { animation: rise 220ms var(--ease) both; display: flex; flex-direction: column; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0 20px; }
.dialog-head h2 { font-size: 17px; font-weight: 600; }
.dialog-body { padding: 16px 20px; overflow-y: auto; }
.dialog-foot { display: flex; align-items: center; gap: 8px; padding: 0 20px 20px; }
.dialog-text { color: var(--text-2); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 28px; height: 28px; padding: 0; border: 2px solid transparent; border-radius: 50%; background: var(--c); display: grid; place-items: center;
  box-shadow: inset 0 0 0 2px var(--surface); font: 600 12px/1 var(--font); color: #fff;
  transition: border-color 150ms var(--ease);
}
.swatch-auto { background: transparent; box-shadow: none; border: 1.5px dashed var(--muted); color: var(--muted); }
.swatch[aria-checked="true"] { border-color: var(--text); }
.swatch-auto[aria-checked="true"] { border: 1.5px solid var(--text); color: var(--text); }
.hdr-spacer { flex: none; width: 44px; height: 44px; }
.check-ring { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; }
.check.is-done .check-ring, .is-done .check-ring { background: var(--ok); border-color: var(--ok); color: #fff; }
.sep { display: none; }
a.menu-row { text-decoration: none; }

/* ===== Выбор версии (RoleLoginScreen): четыре кнопки снизу и ссылки на документы ===== */
.roles { min-height: 100dvh; display: flex; justify-content: center; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); background: var(--bg); }
.roles-inner { width: min(560px, 100%); display: flex; flex-direction: column; justify-content: flex-end; gap: 16px; }
.role-btn {
  height: 50px; width: 100%; border: 0; border-radius: 999px; background: var(--surface); color: var(--text);
  font-size: 17px; font-weight: 600; transition: transform 150ms var(--ease), background-color 150ms var(--ease);
}
.role-btn.is-primary { background: var(--accent); color: #fff; }
.role-btn:active { transform: scale(0.98); }
.role-links { margin-top: 8px; text-align: center; font-size: 13px; line-height: 1.6; color: var(--muted); white-space: pre-wrap; }
.role-link { border: 0; padding: 0; background: transparent; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.login-back { justify-self: center; border: 0; background: transparent; color: var(--muted); font-size: 15px; padding: 4px 8px; }
.login-heading { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 4px; }
.login-heading h1 { grid-column: 2; text-align: center; line-height: 1.2; text-wrap: balance; }
.login-back-arrow { grid-column: 1; grid-row: 1; display: grid; place-items: center; width: 44px; height: 44px;
  padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); }
.login-back-arrow:hover { background: var(--step); color: var(--text); }
.login-card:has(.login-heading) { padding: 24px; gap: 16px; }
.login-card .login-back { min-height: 44px; text-align: center; color: var(--text-2); }
.modal-heading:focus-visible { outline: none; }

/* ===== Выбор веб-портала ===== */
.portal-hub { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.portal-menu { position: relative; width: min(320px, 100%); }
.portal-trigger { width: 100%; min-height: 50px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 600; transition: transform 150ms var(--ease), background-color 150ms var(--ease); }
.portal-trigger:active { transform: scale(0.98); }
.portal-trigger:focus-visible, .portal-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.portal-links { margin-top: 8px; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--surface); }
.portal-links[hidden] { display: none; }
.portal-link { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: var(--r-xs); color: var(--text); font-size: 16px; text-decoration: none; transition: background-color 150ms var(--ease); }
.portal-link:hover { background: var(--step); }

/* ===== Сгруппированные списки (insetGrouped) ===== */
.lsec { display: grid; gap: 8px; }
.lsec-foot { padding: 0 16px; font-size: 13px; color: var(--muted); }
.lcard > .lrow + .lrow, .lcard > .lrow + .nodata, .lcard > .nodata + .lrow { border-top: 1px solid var(--hairline); }
.lrow {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 10px 16px;
  border: 0; background: transparent; color: inherit; text-align: left; font-size: 17px;
}
button.lrow { cursor: pointer; transition: background-color 150ms var(--ease); }
button.lrow:active { background: var(--step); }
button.lrow:disabled { opacity: 0.45; cursor: default; }
.lrow-top { align-items: flex-start; }
.lrow-col { flex-direction: column; align-items: stretch; gap: 8px; }
.lrow-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.lrow-line { overflow-wrap: anywhere; }
.lrow-value { flex: none; text-align: right; font-size: 15px; }
.lrow-kicker { font-size: 12px; font-weight: 600; color: var(--accent-text); }
.lrow-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.lrow-action { color: var(--accent-text); gap: 10px; }
.lrow-action.is-danger { color: var(--danger); }
.lrow-link { color: var(--accent-text); gap: 8px; min-height: 40px; }
.lrow-name { display: flex; align-items: center; gap: 6px; border: 0; padding: 0; background: transparent; color: inherit; text-align: left; }
.lrow-field { padding: 6px 16px; }
.lrow-input { width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; padding: 6px 0; resize: vertical; outline: none; line-height: 1.4; }
.lrow-input::placeholder { color: var(--muted); }
.lrow .chev { margin-left: auto; }
.lrow-main + .chev { margin-left: 0; }

/* Справочник: маленькие плитки повторяют сервисную навигацию из мобильного референса. */
.hb-service-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--accent-text) 12%, var(--surface)); color: var(--accent-text); }
.hb-service-icon svg { stroke-width: 1.7; }

/* Иконки внеучебки: реальные аватарки Telegram и аккуратный fallback для остальных ссылок. */
.org-avatar {
  --org-color: var(--accent-text);
  position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px;
  overflow: hidden; border-radius: 12px; background: color-mix(in srgb, var(--org-color) 18%, var(--surface));
  color: var(--org-color); font-size: 11px; font-weight: 700; letter-spacing: -0.02em;
}
.org-avatar[data-tone="0"] { --org-color: var(--c-blue); }
.org-avatar[data-tone="1"] { --org-color: var(--c-indigo); }
.org-avatar[data-tone="2"] { --org-color: var(--c-teal); }
.org-avatar[data-tone="3"] { --org-color: var(--c-green); }
.org-avatar[data-tone="4"] { --org-color: var(--c-orange); }
.org-avatar[data-tone="5"] { --org-color: var(--c-pink); }
.org-avatar[data-tone="6"] { --org-color: var(--c-purple); }
.org-avatar[data-tone="7"] { --org-color: var(--c-blue); }
.org-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 180ms var(--ease); }
.org-avatar.has-image img { opacity: 1; }
.org-avatar.has-image .org-avatar-fallback { opacity: 0; }

/* Текстовые стили по шкале SF */
.caption { font-size: 12px; } .footnote { font-size: 13px; } .subhead { font-size: 15px; } .body { font-size: 17px; }
.headline { font-size: 17px; font-weight: 600; } .title3 { font-size: 20px; line-height: 1.25; } .title2 { font-size: 22px; line-height: 1.2; }
.semibold { font-weight: 600; } .medium { font-weight: 500; }
.muted { color: var(--muted); } .faint { color: var(--muted); opacity: 0.6; } .accent { color: var(--accent-text); }
.red { color: var(--c-red); } .red-soft { color: color-mix(in srgb, var(--c-red) 75%, transparent); } .orange { color: var(--c-orange); }
.mono { font-variant-numeric: tabular-nums; }
.strike { text-decoration: line-through; }
.pre { white-space: pre-wrap; }
.clamp1, .clamp2, .clamp3 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; }
.clamp1 { -webkit-line-clamp: 1; } .clamp2 { -webkit-line-clamp: 2; } .clamp3 { -webkit-line-clamp: 3; }

/* Строка пары: время столбиком */
.timecol { flex: none; width: 48px; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.timecol-a { font-size: 15px; font-weight: 600; }
.timecol-b { font-size: 12px; color: var(--muted); }
.hw-badge { justify-self: start; padding: 2px 6px; border-radius: 999px; background: var(--c-red); color: #fff; font-size: 11px; font-weight: 600; }
.today-tag { margin-left: 6px; }

/* Листалка недели и полоса дней (WeekNavigator) */
.weeknav { display: grid; gap: 8px; }
.weeknav .weekbar { justify-content: space-between; }
.weeknav .weekbar button { width: 44px; height: 44px; color: var(--text); }
.weeknav .weekbar span { min-width: 0; font-size: 15px; font-weight: 500; }
.daystrip { display: flex; }
.daystrip-cell { flex: 1; min-width: 0; height: 50px; display: grid; place-content: center; justify-items: center; gap: 2px; border: 0; border-radius: 999px; background: transparent; transition: background-color 200ms var(--ease); }
.daystrip-cell.is-selected { background: var(--step); }
.daystrip-name { font-size: 11px; color: var(--muted); }
.daystrip-num { font-size: 17px; font-variant-numeric: tabular-nums; color: var(--text); }
.daystrip-cell.is-selected .daystrip-num { font-weight: 600; }
.daystrip-cell.is-empty .daystrip-num { color: var(--muted); }
.daystrip-cell.is-today .daystrip-num { color: var(--accent-text); }

/* Шапка: точка «к проверке», заголовок вложенного экрана, кнопки справа */
.hdr-btn { position: relative; }
.bell-dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.hdr-title-sm { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-trail { display: flex; flex: none; }
.link-btn { flex: none; border: 0; padding: 4px 0; background: transparent; color: var(--accent-text); font-size: 13px; font-weight: 600; }
.hdr-link { font-size: 17px; font-weight: 400; min-height: 44px; padding: 0 4px; }
.stack-md { display: grid; gap: 12px; }
.stack-tight { display: grid; gap: 8px; }
.stack-tight .seg { width: 100%; }
.stack-tight .seg button { flex: 1; padding: 0 8px; }
.search-inline { flex: none; }
.pin { display: inline-flex; margin-right: 4px; color: var(--muted); vertical-align: -1px; }

/* Отметки за пару: посещаемость, «Оценка +», лента оценок */
.marks { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pill { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--step); color: var(--text); font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill-soft { background: color-mix(in srgb, var(--step) 50%, transparent); padding: 0 3px 0 10px; }
.pill-plus { width: 24px; height: 24px; display: grid; place-items: center; border: 0; padding: 0; border-radius: 50%; background: var(--step); color: var(--text); }
.grade-strip { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.grade-strip::-webkit-scrollbar { display: none; }
.grade-chip { flex: none; min-width: 34px; height: 30px; padding: 0 6px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.grade-picker { display: grid; gap: 16px; }
.grade-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; }
.grade-cell { height: 48px; border: 0; border-radius: var(--r-sm); background: var(--step); color: var(--text); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.grade-grid-tight .grade-cell { height: 40px; font-size: 17px; border-radius: var(--r-xs); }
.grade-cell.is-on { background: var(--accent); color: #fff; }

/* Журнал группы: фамилии закреплены слева, пары листаются вбок */
.journal-card { padding: 8px 0; }
.journal-scroll { overflow-x: auto; scrollbar-width: none; }
.journal-scroll::-webkit-scrollbar { display: none; }
.journal { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.journal th, .journal td { height: 40px; padding: 0; border-bottom: 1px solid var(--hairline); text-align: center; }
.journal thead th { border-bottom: 0; color: var(--muted); font-size: 11px; font-weight: 600; }
.journal tbody tr:last-child > * { border-bottom: 0; }
.journal .j-name { position: sticky; left: 0; z-index: 1; min-width: 132px; max-width: 132px; padding: 0 8px 0 16px; text-align: left; background: var(--surface); }
.j-link { border: 0; padding: 0; background: transparent; color: var(--text); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 108px; }
.j-cell { min-width: 40px; width: 40px; }
.j-date { display: block; font-size: 11px; font-weight: 400; }
.j-kind { display: block; font-size: 11px; font-weight: 400; opacity: 0.6; }
.j-btn { width: 40px; height: 40px; border: 0; padding: 0; background: transparent; color: var(--muted); font-size: 12px; }
.j-btn.is-grade { color: var(--text); font-size: 13px; font-weight: 600; }
.j-btn.is-absent { color: var(--c-red); font-weight: 600; }
.j-btn.is-excused { color: var(--muted); font-size: 11px; font-weight: 600; }
.j-btn.is-late { color: var(--c-orange); }
.j-btn.is-present { opacity: 0.6; }
.j-sum { min-width: 48px; font-size: 13px; padding: 0 4px; }

/* Ведомость */
.st-top { display: flex; align-items: center; gap: 12px; }
.st-top > :first-child { flex: 1; min-width: 0; }
.st-final { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.st-cells { display: flex; flex-wrap: wrap; gap: 16px; }
.st-cell { min-width: 40px; display: grid; justify-items: center; gap: 1px; border: 0; padding: 0; background: transparent; color: var(--text); }
.st-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.st-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.st-cell.is-exam .st-value { color: var(--accent-text); }

/* Карточка пары: отдельные матовые блоки */
.info-block { display: grid; gap: 8px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--hairline); }
.info-title { font-size: 12px; font-weight: 500; color: var(--muted); }
.info-kicker { font-size: 13px; color: var(--muted); }
.info-head { font-size: 20px; font-weight: 600; line-height: 1.25; }
.info-fact { display: grid; gap: 4px; }
.info-label { font-size: 11px; font-weight: 500; color: var(--muted); }
.info-value { font-size: 15px; }
.formula { font-size: 15px; }
.scores { display: grid; gap: 4px; padding-top: 8px; }
.score-row { display: flex; justify-content: space-between; font-size: 15px; }
.info-block.is-plain { background: none; border-color: transparent; }
.info-link { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.info-link:hover { background: var(--raised); }
.info-block.is-hw { background: color-mix(in srgb, var(--c-red) 9%, var(--bg)); border-color: color-mix(in srgb, var(--c-red) 30%, transparent); }
.is-hw .info-title { color: var(--c-red); }
.hw-item { display: grid; gap: 2px; }
.hw-title { font-size: 15px; font-weight: 500; color: var(--c-red); }
.hw-due { font-size: 12px; color: color-mix(in srgb, var(--c-red) 75%, transparent); }

/* Стопка анонсов и новостей, дата-бейдж */
.date-badge { flex: none; width: 44px; height: 48px; border-radius: var(--r-sm); background: var(--step); display: grid; place-content: center; justify-items: center; line-height: 1.1; }
.date-badge b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.date-badge span { font-size: 11px; color: var(--muted); }
.stack-card { position: relative; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; margin-bottom: 0; }
.stack-card.has-more { margin-bottom: 8px; }
.stack-card.has-more::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -8px; height: 24px; border-radius: 0 0 var(--r-lg) var(--r-lg); background: var(--surface); opacity: 0.55; }
.stack-front { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--surface); transition: transform 150ms var(--ease); }
.stack-card:active .stack-front { transform: scale(0.98); }
.news-front { display: block; padding: 0; overflow: hidden; }
.news-copy { position: relative; min-height: 78px; }
.news-photo { position: relative; display: block; aspect-ratio: 8 / 3; overflow: hidden; background: var(--step); }
.news-photo img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 240ms var(--ease); }
.news-photo.is-loaded img { opacity: 1; }
.news-photo-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); font-size: 12px; animation: news-photo-pulse 1.2s ease-in-out infinite; }
.news-photo-placeholder svg { color: var(--accent-text); }
.news-photo.is-loaded .news-photo-placeholder { opacity: 0; animation: none; }
.news-photo.is-error .news-photo-placeholder { animation: none; color: var(--muted); }
.news-photo.is-empty .news-photo-placeholder { animation: none; }
@keyframes news-photo-pulse { 50% { opacity: 0.48; } }
.news-date { position: absolute; z-index: 2; top: 14px; right: 16px; color: var(--text-2); font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.news-copy { display: grid; gap: 3px; padding: 14px 72px 16px 16px; }

/* Smart LMS — курсы читаются как отдельные превью, а не как длинный список текста. */
.smart-courses-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 0; align-items: stretch; }
.smart-course-card { display: grid; grid-template-rows: auto auto; height: 100%; min-width: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; transition: transform 150ms var(--ease), opacity 150ms var(--ease); }
.smart-course-card:hover { opacity: 0.82; }
.smart-course-card:active { transform: scale(0.985); }
.smart-course-card .news-photo { aspect-ratio: 2.05 / 1; border-radius: var(--r-lg); }
.smart-course-copy { display: grid; grid-template-rows: auto minmax(40px, 1fr) auto; gap: 7px; min-height: 112px; padding: 10px 0 2px; }
.smart-course-group { justify-self: start; max-width: 100%; padding: 0; color: var(--text-2); font-size: 11px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smart-course-title { min-height: 2.5em; font-size: 16px; font-weight: 600; line-height: 1.25; }
.smart-course-progress { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 22px; }
.smart-course-progress progress { width: min(120px, 42%); height: 6px; accent-color: var(--accent); }

/* Зачётка */
.gb-summary { align-items: flex-start; }
.gb-stat { flex: 1; display: grid; gap: 2px; }

/* Карточка студента в профиле */
.course-badge { margin-left: -16px; width: 40px; height: 24px; display: grid; place-items: center; border-radius: 0 var(--r-xs) var(--r-xs) 0; background: var(--step); color: var(--muted); font-size: 13px; font-weight: 600; }
.student-prog { font-size: 15px; }
.student-line .muted { color: var(--muted); }

/* Переключатель (Toggle) */
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 51px; height: 31px; margin: 0; border-radius: 999px; background: var(--step-hover); cursor: pointer; transition: background-color 200ms var(--ease); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); transition: transform 200ms var(--ease); }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }

/* Редакторы задания и объявления */
.form-sec { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 4px; }
.checks { display: grid; gap: 4px; }
.links { display: grid; gap: 4px; }
.link-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--accent-text); }
.link-row > span { flex: 1; min-width: 0; }
.link-add { display: flex; gap: 8px; }
.link-add .field-input { flex: 1; }
.hdr-mid > .hdr-title-sm { min-width: 0; max-width: 100%; }
.lrow > .chev { align-self: center; }

/* MARK: 20.11.2026 — номер пары, ДЗ у пары, выбор даты, оценки, справочник, уведомления, задачи */
.accent-text { color: var(--accent-text); }
.caption2 { font-size: 11px; line-height: 1.3; }
.clamp4 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.linklike { border: 0; background: transparent; padding: 0; color: var(--accent-text); font: inherit; text-align: left; cursor: pointer; }

.pair-kind { display: inline-flex; align-items: center; gap: 6px; }
.pair-num {
  display: inline-grid; place-items: center; min-width: 30px; min-height: 30px; padding: 0 5px;
  border-radius: 9px; background: var(--step); color: var(--text); font-size: 18px; font-weight: 700;
  font-variant-numeric: tabular-nums; align-self: flex-start;
}
.hw-inline { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; padding: 8px; border-radius: var(--r-xs); background: rgba(255, 59, 48, 0.1); }
.hw-inline-main { display: grid; gap: 2px; min-width: 0; }

.sheet.dp-sheet { height: fit-content; max-height: calc(100dvh - 12px); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.dp-head .hdr-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dp-sheet[open] { gap: 12px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 16px 0; }
.dp-pill { flex: none; min-height: 38px; padding: 0 10px; font-size: 15px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--sheet-card); color: var(--text); }
.dp-pill.accent-text { color: var(--accent-text); }
.dp-nav { display: flex; align-items: center; gap: 4px; padding: 0 20px; }
.dp-month { font-size: 17px; font-weight: 600; }
.dp-nav .grow { flex: 1; }
.dp-arrow { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: var(--accent-text); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 0; padding: 0 12px; }
.dp-wd { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding-bottom: 4px; }
.dp-day { justify-self: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--text); font-size: 18px; font-variant-numeric: tabular-nums; }
.dp-day.is-today { color: var(--accent-text); font-weight: 600; }
.dp-day.is-selected { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.dp-go { margin: 4px 16px 0; min-height: 50px; border-radius: 999px; font-size: 17px; }

.grade-row { display: grid; gap: 10px; padding: 12px 16px; cursor: pointer; }
.grade-row:hover { background: var(--step); }
.grade-top { display: flex; align-items: flex-start; gap: 12px; }
.grade-badge { display: grid; justify-items: end; flex: none; line-height: 1.1; }
.grade-chevron { display: grid; flex: none; color: var(--muted); transition: transform 180ms var(--ease); }
.grade-row.is-expanded .grade-chevron { transform: rotate(180deg); }
.grade-detail { display: none; gap: 12px; padding-top: 2px; }
.grade-row.is-expanded .grade-detail { display: grid; }
.grade-open { min-height: 32px; }
.grade-info { display: grid; gap: 8px; }
.grade-bar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; }
.grade-seg { position: relative; flex-basis: 0; min-width: 2px; background: var(--step); }
.grade-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.grade-legend { display: grid; gap: 4px; }
.grade-item { display: flex; align-items: center; gap: 8px; }
.grade-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.grade-score { min-width: 30px; text-align: right; }

.hb-page { padding-bottom: 24px; }
.hb-head { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.hb-icon { position: relative; flex: none; width: 68px; height: 68px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--step); overflow: hidden; }
.hb-icon img { width: 52px; height: 52px; }
.hb-corner { position: absolute; top: 0; left: 0; width: 0; height: 0; border-top: 14px solid transparent; border-right: 14px solid transparent; }
.hb-campuses { display: flex; gap: 6px; overflow-x: auto; padding: 0 4px; }
.hb-chip { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--step); color: var(--text); font-size: 12px; font-weight: 500; text-decoration: none; }
.hb-chip.is-selected { background: var(--accent); color: var(--on-accent); }
.hb-group { display: grid; gap: 8px; }
.hb-group-title { display: flex; align-items: center; gap: 8px; padding: 0 4px; font-size: 17px; font-weight: 600; }
.hb-tag { width: 4px; height: 18px; border-radius: 2px; background: var(--muted); }
.hb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hb-card { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 124px; padding: 12px; border: 0; border-radius: var(--r-sm); background: var(--surface); color: var(--text); text-align: left; text-decoration: none; overflow: hidden; }
.hb-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.hb-card-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); }
.hb-blocks { display: grid; gap: 12px; padding: 0 4px; }
.hb-h2 { margin-top: 8px; }
.rich { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.rich a { color: var(--accent-text); }
.hb-li { display: flex; align-items: flex-start; gap: 10px; }
.hb-li.is-indent { padding-left: 20px; }
.hb-li-icon { flex: none; width: 26px; color: var(--accent-text); display: grid; place-items: center; padding-top: 1px; }
.hb-li-n { flex: none; min-width: 18px; text-align: right; }
.hb-li-dot { flex: none; width: 5px; height: 5px; margin-top: 9px; border-radius: 50%; background: var(--muted); }
.hb-fold { padding: 12px 16px; border-radius: var(--r-sm); background: var(--surface); }
.hb-fold summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
.hb-fold summary::after { content: '⌄'; color: var(--muted); }
.hb-fold[open] summary { margin-bottom: 12px; }
.hb-note { padding: 12px 14px; border-inline-start: 1px solid color-mix(in srgb, var(--accent) 72%, transparent); border-radius: var(--r-xs); background: var(--step); }
.hb-promo { display: grid; gap: 8px; padding: 16px; border-radius: var(--r-sm); background: #102d69; color: #fff; }
.hb-promo-link { display: flex; align-items: flex-start; gap: 8px; border: 0; background: transparent; color: #fff; padding: 0; font-size: 15px; text-align: left; text-decoration: none; }
.hb-table { overflow-x: auto; border-radius: var(--r-sm); background: var(--surface); }
.hb-table table { border-collapse: collapse; min-width: 100%; }
.hb-table th, .hb-table td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hairline); min-width: 90px; }
.hb-button { justify-content: center; text-decoration: none; }

.notice-row { align-items: flex-start; gap: 12px; }
.notice-top { display: flex; gap: 8px; }
.notice-filter { padding: 0 16px; }
.menu-tile.red { color: #ff453a; }

.tasks-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 0; }
.task-notes { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Конспекты: самостоятельный спокойный поток. */
.note-section { display: grid; gap: 8px; }
.note-section h2 { padding: 0 16px; font-size: 17px; font-weight: 500; color: var(--muted); }
.notes-list { overflow: hidden; border-radius: var(--r-lg); background: var(--surface); }
.note-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 64px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--hairline); background: transparent; color: var(--text); text-align: left; }
.note-row:last-child { border-bottom: 0; }
.note-row:hover { background: var(--step); }
.note-row-main { flex: 1; min-width: 0; display: grid; gap: 3px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.note-title { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 500; }
.note-title svg { color: var(--accent-text); flex: none; }
.note-preview, .note-meta { overflow: hidden; color: var(--muted); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.note-meta { font-variant-numeric: tabular-nums; }
.note-more { flex: none; opacity: 0; }
.note-row:hover .note-more, .note-row:focus-within .note-more { opacity: 1; }
.note-checklist { display: grid; gap: 8px; }
.note-check-row { display: flex; align-items: center; gap: 8px; }
.note-check-row > input[type="checkbox"] { flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.note-check-row .field-input { flex: 1; min-width: 0; }
.note-search { min-height: 40px; }
.note-subject-row { touch-action: pan-y; cursor: grab; user-select: none; }
.note-subject-row:active, .note-subject-row.is-dragging { cursor: grabbing; }
.note-subject-row.is-dragging { opacity: .62; background: var(--step); }

/* Меню функций: две крупные плитки в ряд, как на мобильной панели приложений. */
.menu-features { display: grid; gap: 12px; }
.menu-features-title { padding: 0 4px; font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.menu-features-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.menu-feature-tile {
  position: relative; display: grid; align-content: space-between; gap: 18px; min-height: 132px; padding: 16px;
  border: 1px solid transparent; border-radius: var(--r-lg); background: var(--surface); color: var(--text); text-align: left;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.menu-feature-tile:hover { background: var(--raised); border-color: var(--hairline); }
.menu-feature-tile:active { transform: scale(.985); }
.menu-feature-tile.is-disabled, .menu-feature-tile.is-disabled:hover { color: var(--muted); background: color-mix(in srgb, var(--surface) 72%, var(--bg)); border-color: transparent; cursor: default; }
.menu-feature-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: color-mix(in srgb, var(--accent-text) 18%, transparent); color: var(--accent-text); }
.menu-feature-tile.is-disabled .menu-feature-icon { background: var(--step); color: var(--muted); }
.menu-feature-label { font-size: 18px; line-height: 1.15; font-weight: 600; }
.menu-feature-hint { position: absolute; top: 18px; right: 16px; font-size: 12px; color: var(--muted); }

.task-collection-grid, .task-list-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.task-feature-tile { min-height: 108px; padding: 14px; gap: 12px; }
.task-feature-copy { display: flex; align-items: end; justify-content: space-between; gap: 8px; min-width: 0; }
.task-feature-count { color: var(--accent-text); font: 600 16px/1 var(--mono); }
.task-list-tile {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; min-height: 96px;
  padding: 14px; border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--surface); color: var(--text); text-align: left;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.task-list-tile:hover { background: var(--raised); border-color: var(--accent-text); }
.task-list-tile:active { transform: scale(.985); }
.list-icon {
  --list-color: var(--c-blue); display: grid; place-items: center; flex: none; color: var(--list-color);
  background: color-mix(in srgb, var(--list-color) 20%, var(--surface)); border: 1px solid color-mix(in srgb, var(--list-color) 28%, transparent); font-weight: 700;
}
.list-icon.is-solid { background: var(--list-color); color: var(--palette-abyss); }
.list-icon.is-none { background: transparent; }
.list-icon.is-circle { border-radius: 50%; }
.list-icon.is-square { border-radius: var(--r-xs); }
.list-icon.is-rounded { border-radius: var(--r-md); }
.list-icon[data-list-color="blue"], .list-swatches [data-list-color="blue"] { --list-color: var(--c-blue); }
.list-icon[data-list-color="indigo"], .list-swatches [data-list-color="indigo"] { --list-color: var(--c-indigo); }
.list-icon[data-list-color="teal"], .list-swatches [data-list-color="teal"] { --list-color: var(--c-teal); }
.list-icon[data-list-color="green"], .list-swatches [data-list-color="green"] { --list-color: var(--c-green); }
.list-icon[data-list-color="orange"], .list-swatches [data-list-color="orange"] { --list-color: var(--c-orange); }
.list-icon[data-list-color="red"], .list-swatches [data-list-color="red"] { --list-color: var(--c-red); }
.list-icon[data-list-color="pink"], .list-swatches [data-list-color="pink"] { --list-color: var(--c-pink); }
.list-icon[data-list-color="purple"], .list-swatches [data-list-color="purple"] { --list-color: var(--c-purple); }
.list-icon[data-list-color="gray"], .list-swatches [data-list-color="gray"] { --list-color: var(--c-gray); }
.list-icon[data-list-color="brown"], .list-swatches [data-list-color="brown"] { --list-color: var(--c-brown); }
.list-icon[data-list-color="yellow"], .list-swatches [data-list-color="yellow"] { --list-color: var(--c-yellow); }
.list-icon[data-list-color="cyan"], .list-swatches [data-list-color="cyan"] { --list-color: var(--c-cyan); }
.list-icon[data-list-color="lime"], .list-swatches [data-list-color="lime"] { --list-color: var(--c-lime); }
.list-icon[data-list-color="sky"], .list-swatches [data-list-color="sky"] { --list-color: var(--c-sky); }
.list-icon[data-list-color="violet"], .list-swatches [data-list-color="violet"] { --list-color: var(--c-violet); }
.list-icon[data-list-color="navy"], .list-swatches [data-list-color="navy"] { --list-color: var(--c-navy); }
.list-swatches .swatch { background: color-mix(in srgb, var(--list-color) 25%, var(--surface)); border-color: color-mix(in srgb, var(--list-color) 30%, transparent); }
.list-swatches .swatch-fill { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--list-color); }

.note-subject-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.note-subject-row {
  position: relative; display: grid; align-content: space-between; gap: 14px; min-height: 148px; padding: 16px;
  border: 1px solid transparent; border-radius: var(--r-lg); background: var(--surface); color: var(--text); text-align: left;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.note-subject-row:hover { background: var(--raised); border-color: var(--hairline); }
.note-subject-row:active { transform: scale(.985); }
.note-subject-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: color-mix(in srgb, var(--accent-text) 18%, transparent); color: var(--accent-text); }
.note-subject-count { position: absolute; top: 16px; right: 16px; font-size: 26px; line-height: 1; font-weight: 700; }
.note-subject-title { min-width: 0; font-size: 17px; line-height: 1.2; font-weight: 600; overflow-wrap: anywhere; }
.note-subject-meta { min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.2; }
.notes-filter-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.notes-filter-tile {
  min-width: 0; min-height: 56px; padding: 8px 7px; border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1.15; text-align: center;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 150ms var(--ease);
}
.notes-filter-tile:hover { background: var(--raised); color: var(--text); border-color: var(--accent-text); }
.notes-filter-tile:active { transform: scale(.98); }
.notes-filter-tile.is-selected { background: color-mix(in srgb, var(--accent) 25%, var(--surface)); color: var(--text); border-color: color-mix(in srgb, var(--accent-text) 58%, transparent); }
.notes-filter-title { display: block; overflow-wrap: anywhere; }
.empty-note-list { padding: 2px 0; }
.task-flag { flex: none; color: #ff9f0a; display: grid; }
.task-row.is-child { padding-left: 44px; }
.task-row.sub-toggle { min-height: 36px; padding-left: 52px; }
.quick-row { min-height: 48px; }
.quick-plus { flex: none; width: 24px; display: grid; place-items: center; color: var(--muted); }
.quick-input { flex: 1; min-width: 0; min-height: 40px; border: 0; background: transparent; color: var(--text); font-size: 16px; }
.quick-input:focus-visible { outline: none; }
.tasks.is-columns { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.tasks.is-columns .task-sec { flex: none; width: min(300px, 82vw); scroll-snap-align: start; }
.sub-list { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 4px; }
.sub-item.is-done { color: var(--muted); text-decoration: line-through; }
.grade-item .grow, .notice-top .grow, .grade-top .grow { flex: 1; min-width: 0; }

/* MARK: поиск с категориями и историей */
.s-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 8px; scrollbar-width: none; }
.s-chips::-webkit-scrollbar { display: none; }
.s-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); color: var(--text); font-size: 15px; font-weight: 500; }
.s-chip.is-selected { background: rgba(0, 71, 187, 0.18); color: var(--accent-text); border-color: transparent; }
.s-empty { display: grid; justify-items: center; gap: 8px; padding: 64px 24px; text-align: center; color: var(--muted); }
.s-empty h2 { color: var(--text); margin: 8px 0 0; }
.s-empty p { margin: 0; }
.s-head { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.lsec-head:has(.s-head) { display: flex; }
.s-row { gap: 12px; }
.s-avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--step); color: var(--accent-text); font-weight: 600; font-size: 16px; }
.s-avatar.is-big { width: 88px; height: 88px; font-size: 30px; }
.s-card { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 8px 16px; }
.s-card h2, .s-card p { margin: 0; }
/* Строка-кнопка вокруг готовой строки списка (предмет «Модуля» → страница дисциплины) */
.row-button { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.row-button:hover { background: var(--step); }

/* Аккаунты: регистрация и онбординг */
.form-warning { border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 12px; display: grid; gap: 8px; background: var(--step); }
.form-warning p { margin: 0; font-size: 13px; color: var(--text-2); }
.form-warning .is-unavailable { opacity: 0.45; cursor: default; }
.form-warning .form-unavailable { color: var(--text-2); }
.combobox { position: relative; }
.combobox-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  background: var(--raised); border: 1px solid var(--hairline); border-radius: var(--r-sm);
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%); max-height: 264px; overflow: auto; }
.combobox-item { padding: 9px 10px; border-radius: var(--r-sm, 8px); font-size: 14px; cursor: pointer; }
.combobox-item:hover, .combobox-item:focus { background: var(--step); outline: none; }
.nowrap { white-space: nowrap; }

/* Выбор студентов в задании преподавателя */
.pick-list { display: grid; gap: 2px; max-height: 280px; overflow: auto; border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 6px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm, 8px); cursor: pointer; }
.pick-row:hover { background: var(--step); }
.pick-row input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

.loading-card { display: grid; gap: 8px; min-height: 88px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); }
.loading-card span { display: block; height: 12px; border-radius: 6px; background: var(--step); }
.loading-card span:nth-child(1) { width: 52%; }
.loading-card span:nth-child(2) { width: 86%; }
.loading-card span:nth-child(3) { width: 68%; }

.identity-loading { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.identity-loading p { margin: 0; color: var(--text-2); }
.identity-spinner { width: 28px; height: 28px; border: 2px solid var(--hairline); border-top-color: var(--accent); border-radius: 50%; animation: identity-spin 1s linear infinite; }
@keyframes identity-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .identity-spinner { animation: none; } }
.portal-menu { display: grid; gap: 16px; }
.portal-intro { margin: 0; color: var(--text-2); text-align: center; }

/* Общие ограничения для экранов телефона и вложенных шторок. */
.screen-head, .screen-body { grid-template-columns: minmax(0, 1fr); }
.screen-head > *, .search-field, .s-chips { min-width: 0; }
.hdr-mid > .hdr-title { max-width: 100%; }
.screen-body, .dialog-body, .sheet-scroll { min-width: 0; overflow-wrap: anywhere; }
.screen-body > *, .dialog-body > *, .sheet-scroll > *, .lsec, .task-sec { min-width: 0; }
.dialog-body { overscroll-behavior: contain; }
.dialog-foot { flex-wrap: wrap; }
.field-input { max-width: 100%; min-width: 0; font-size: max(16px, 1em); }
.note-editor-toolbar { display: flex; flex: 0 0 100%; gap: 4px; min-width: 0; overflow-x: auto; }
.note-editor-toolbar > button { flex: none; }
@media (max-width: 420px) {
  .app { --content-inset: 12px; }
  .tabs { padding-inline: 4px; }
  .tab-label { font-size: clamp(9px, 2.6vw, 11px); }
  .hdr, .hdr-mid { gap: 4px; }
  .hdr-pill { min-width: 0; max-width: 100%; padding-inline: 8px; white-space: normal; text-align: center; line-height: 1.2; }
  .hdr-title { font-size: 18px; overflow-wrap: anywhere; }
  .hdr-title.hdr-title-sm { white-space: normal; }
  .hdr-mid .seg { min-width: 0; }
  .seg button { padding-inline: 8px; font-size: 13px; }
  .lrow, .list-row, .menu-row { padding-inline: 12px; }
  .strip { padding-inline: 4px; gap: 0; }
  .strip-num { max-width: 100%; }
  .hb-grid, .grade-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-card:has(.login-heading) { padding: 16px; }
  .login-heading h1 { font-size: 20px; }
  .note-editor-toolbar { max-width: 100%; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .sheet { max-height: calc(100dvh - env(safe-area-inset-top)); }
}
@media (max-height: 540px) and (orientation: landscape) and (pointer: coarse) {
  .app { --nav-height: 52px; --fab-size: 44px; }
  .tabs { padding-block: 3px; }
  .tab { gap: 2px; }
  .tab svg { width: 18px; height: 18px; }
}

/* Редактор личной задачи */
.dialog.task-editor { background: var(--sheet); }
.task-editor-head {
  flex: none; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center; gap: 8px; padding: 8px 16px;
}
.task-editor-trash { color: var(--danger); background: var(--step); border-radius: 50%; }
.task-editor-group {
  position: relative; justify-self: center; display: flex; align-items: center; gap: 8px;
  max-width: 100%; min-height: 44px; padding: 0 4px; font-size: 17px; font-weight: 600;
}
.task-editor-group-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-editor-group > svg { flex: none; }
.task-editor-group > select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
html.kbd .task-editor-group:focus-within { outline: 2px solid var(--accent-text); border-radius: 8px; }
.task-editor .dialog-body { min-height: 0; padding: 8px 16px 16px; }
.task-editor .dialog-foot { flex: none; justify-content: flex-end; padding: 8px 16px 12px; }
.task-editor-stack { display: grid; gap: 20px; }
.task-editor-panel, .task-editor-voice, .task-editor-swatches { background: var(--step); }
.task-editor-panel { border-radius: var(--r-lg); }
.task-editor-voice {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 16px;
  text-align: left; border: 0; border-radius: 24px; min-height: 48px;
}
.task-editor-voice:disabled, .task-editor-row:disabled { color: var(--muted); cursor: default; }
.task-editor-text { display: grid; padding: 4px 16px; }
.task-editor-text input, .task-editor-text textarea {
  min-width: 0; width: 100%; padding: 12px 0; border: 0; border-radius: 0; background: transparent;
}
.task-editor-text .task-editor-title { font-size: 19px; font-weight: 600; border-bottom: 1px solid var(--hairline); }
.task-editor-text textarea { resize: vertical; }
.task-editor-row {
  width: 100%; min-height: 48px; border: 0; background: transparent;
  display: flex; align-items: center; gap: 8px; padding: 4px 16px; text-align: start;
}
.task-editor-settings > :not(:first-child), .task-editor-duration > * { border-top: 1px solid var(--hairline); }
.task-editor-row > svg { flex: none; color: var(--accent-text); }
.task-editor-row:disabled > svg { color: inherit; }
.task-editor-label { margin-inline-end: auto; }
.task-editor-value { color: var(--text-2); font-variant-numeric: tabular-nums; }
.task-editor-settings select, .task-editor-settings input:not([type=checkbox]) {
  max-width: 52%; min-height: 40px; border: 1px solid transparent; border-radius: 8px;
  background: var(--sheet); color: var(--text);
}
.task-editor-date-panel { display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.task-editor-date-panel .linklike { min-height: 44px; }
.task-editor-custom { justify-content: space-between; }
.task-editor-row input[role="switch"] {
  appearance: none; position: relative; flex: none; margin: 0;
  width: 44px; height: 26px; border-radius: 13px; background: var(--muted); cursor: pointer;
}
.task-editor-row input[role="switch"]::before {
  content: ""; position: absolute; width: 20px; height: 20px; inset: 3px auto auto 3px;
  border-radius: 50%; background: white;
}
.task-editor-row input[role="switch"]:checked { background: var(--accent); }
.task-editor-row input[role="switch"]:checked::before { transform: translateX(18px); }
.task-editor-row input[role="switch"]:disabled { opacity: .5; cursor: default; }
.task-editor-colors h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.task-editor-swatches {
  display: flex; padding: 0 4px; border-radius: 24px; overflow-x: auto; scrollbar-width: none;
}
.task-editor-swatch {
  flex: 1 0 40px; min-height: 48px; display: grid; place-items: center;
  background: transparent; border: 0; color: var(--text);
}
.task-editor-swatch > span {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--task-color, transparent); border: 1px solid var(--hairline); border-radius: 50%;
}
.task-editor-swatch[data-task-color]:not([data-task-color=""]) { color: #161616; }
.task-editor-swatch[aria-pressed="false"] svg { visibility: hidden; }
.task-color-dot {
  display: inline-block; width: 8px; height: 8px; margin-inline-end: 6px; vertical-align: .1em;
  border-radius: 50%; background: var(--task-color, transparent); border: 1px solid var(--hairline);
}
[data-task-color="yellow"] { --task-color: #f4e69d; }
[data-task-color="lilac"] { --task-color: #decdf3; }
[data-task-color="pink"] { --task-color: #f3d1db; }
[data-task-color="mint"] { --task-color: #bce9dd; }
[data-task-color="turquoise"] { --task-color: #9fdfe8; }
[data-task-color="cream"] { --task-color: #f1d7b5; }
[data-task-color="blue"] { --task-color: #bcddf6; }
[data-task-color="green"] { --task-color: #d0e8af; }
.task-editor-close { width: 100%; }
.task-editor-done { color: var(--accent-text); }
.focus-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.focus-presets .s-chip { padding-inline: 12px; }

/* MARK: 27.11.2026 — «Все · По предметам», папки предметов, чек-листы, редактор конспекта */
.vh {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.folder-picker { padding: 4px 4px 12px; }
.folder-empty { padding-top: 24px; }
.chk-entry .list-row { min-height: 56px; }
.chk-group { display: grid; gap: 8px; }
.chk-note {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  min-height: 44px; padding: 0 16px; border: 0; background: transparent; color: inherit;
  text-align: left; font-size: 15px; font-weight: 600; cursor: pointer;
}
.chk-note svg { color: var(--muted); flex: none; }
.chk-item-row .check { color: var(--muted); }

.dialog.note-editor { background: var(--sheet); }
.note-editor-head {
  flex: none; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center; gap: 8px; padding: 8px 16px;
}
.note-editor-trash { color: var(--danger); background: var(--step); border-radius: 50%; }
.note-editor-subject {
  position: relative; justify-self: center; display: flex; align-items: center; gap: 8px;
  max-width: 100%; min-height: 44px; padding: 0 4px; font-size: 17px; font-weight: 600;
}
.note-editor-subject-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-editor-subject > svg { flex: none; }
.note-editor-subject > select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
html.kbd .note-editor-subject:focus-within { outline: 2px solid var(--accent-text); border-radius: 8px; }
.note-editor .dialog-body { min-height: 0; padding: 8px 16px 16px; }
.note-editor .dialog-foot { flex: none; justify-content: flex-end; padding: 8px 16px 12px; }
.note-editor-stack { display: grid; gap: 20px; }
.note-editor-stack > .note-editor-title {
  min-width: 0; width: 100%; padding: 8px 0 12px; border: 0; border-bottom: 1px solid var(--hairline);
  background: transparent; font-size: 22px; font-weight: 600;
}
.note-editor-form { gap: 16px; }
.note-editor-form > .field:first-child .field-label { margin-bottom: 4px; }
.note-editor-text {
  min-width: 0; min-height: 140px; padding: 12px; border: 1px solid var(--hairline); border-radius: 12px;
  background: var(--step); color: var(--text); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
}
.note-editor-text:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.note-editor-text :is(h2, h3, blockquote, pre, table) { margin-block: 8px; }
.note-editor-text blockquote { padding-inline-start: 12px; border-inline-start: 2px solid var(--accent-text); color: var(--muted); }
.note-editor-text pre { padding: 10px; border-radius: 8px; background: var(--canvas); overflow-x: auto; }
.note-editor-text table { border-collapse: collapse; }
.note-editor-text td, .note-editor-text th { min-width: 72px; padding: 6px 8px; border: 1px solid var(--hairline); }
.note-editor-text img, .note-editor-text svg { display: block; max-width: 100%; height: auto; margin-block: 10px; }
.note-draw-canvas { display: block; width: min(100%, 560px); height: auto; border: 1px solid var(--hairline); border-radius: 12px; touch-action: none; }
.note-editor .dialog-foot .note-editor-toolbar { margin-inline-end: auto; }

@media (max-width: 600px) {
  .dialog.note-editor {
    width: 100%; max-width: none; margin: auto auto 0;
    max-height: calc(100dvh - 12px);
    border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  }
}

/* Задачи: доска состояний, дедлайны, заголовок секций с действием */
.sec-head-row { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.sec-head-row .sec-head { flex: 1; }
.sec-head-row .hdr-btn { color: var(--accent-text); }
.board { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.board .board-col { flex: none; width: min(300px, 82vw); scroll-snap-align: start; }
.board-row { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px 8px 12px; }
.board-shift { display: flex; justify-content: space-between; gap: 8px; }
.board-btn {
  width: 34px; height: 34px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--hairline); border-radius: 50%; background: transparent; color: var(--accent-text);
}
.board-btn:active { transform: scale(0.94); }
.board-spacer { width: 34px; height: 34px; }
.task-sec-head.is-danger-text { color: var(--c-red); }
.dl-hero {
  display: grid; gap: 4px; width: 100%; padding: 14px 16px; border: 0; background: var(--surface);
  color: var(--text); text-align: left; cursor: pointer;
}
.dl-hero .dl-count { font-size: 30px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-text); }
.dl-toggle { padding: 2px 4px; }

/* Планер: слои дня, события на весь день, метки сроков и напоминаний */
.layer-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 8px; scrollbar-width: none; }
.layer-chips::-webkit-scrollbar { display: none; }
.layer-chip.is-selected { background: var(--lens); color: var(--text); border-color: transparent; opacity: 1; }
.layer-chip.is-off { background: transparent; color: var(--muted); opacity: 1; }
.allday-row {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px;
  border-radius: var(--r-lg); background: var(--surface); margin-bottom: 12px;
}
.allday-label { flex: none; padding-top: 5px; font-size: 11px; color: var(--muted); }
.allday-pills { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.allday-pill {
  --c: var(--c-gray);
  max-width: 100%; padding: 4px 10px; border: 0; border-radius: 8px; cursor: pointer;
  background: color-mix(in srgb, var(--c) 24%, var(--surface)); color: var(--text); text-align: left;
}
.allday-pill .event-title { font-size: 13px; font-weight: 500; -webkit-line-clamp: 1; }
.event.mark-dl { --c: var(--c-red); }
.event.mark-rem { --c: var(--c-blue); }
.event.mark-dl .event-title, .event.mark-rem .event-title { font-size: 12px; -webkit-line-clamp: 1; }
/* Четыре сегмента планера и чипы слоёв на узком экране. */
@media (max-width: 480px) {
  .hdr .seg:has(button:nth-child(4)) button { padding-inline: 7px; font-size: 12.5px; }
  .layer-chips .s-chip { padding: 0 10px; height: 32px; font-size: 13.5px; }
}

@media (max-width: 600px) {
  .dialog.task-editor {
    width: 100%; max-width: none; margin: auto auto var(--task-keyboard, 0px);
    max-height: calc(100dvh - var(--task-keyboard, 0px) - 12px);
    border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  }
}

.course-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 8px }
.course-progress progress { width: 96px; height: 6px; accent-color: var(--accent) }
.month-calendar { padding: 12px; background: var(--surface); border-radius: 16px; margin-bottom: 16px }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px }
.month-weekday { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 0 }
.month-day { position: relative; min-height: 40px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: inherit; font: inherit; font-variant-numeric: tabular-nums }
.month-day[aria-current=date] { border-color: var(--accent) }
.month-day[aria-pressed=true] { background: var(--accent); color: white }
.month-dot { position: absolute; bottom: 3px; left: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: currentColor }
.month-selection { display: grid; gap: 10px; min-width: 0; }
.month-selection .sec-head-row { padding-inline: 4px; }
.month-day-columns { display: flex; gap: 12px; overflow-x: auto; padding: 0 4px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.month-day-column { flex: 0 0 min(300px, 82vw); display: grid; align-content: start; gap: 8px; min-width: 0; scroll-snap-align: start; }
.month-day-column-title { padding: 0 4px; color: var(--text-2); font-size: 15px; font-weight: 600; }
.month-day-column-empty { padding: 12px 0; background: var(--surface); border-radius: var(--r-lg); }
.home-block { display: grid; gap: 0; min-width: 0; }
.home-block-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 4px;
  border: 0; background: transparent; color: var(--text-2); text-align: left;
  transition: color 180ms var(--ease);
}
.home-block-toggle:hover { color: var(--text); }
.home-block-toggle:active .home-block-title { transform: scale(0.985); transform-origin: left center; }
.home-block-title { font-size: 17px; line-height: 1.3; font-weight: 500; transition: transform 180ms var(--ease); }
.home-block-arrow { display: grid; place-items: center; margin-left: auto; color: var(--muted); transition: transform 240ms var(--ease), color 180ms var(--ease); }
.home-block.is-open .home-block-arrow { transform: rotate(90deg); color: var(--text-2); }
.home-block-panel { display: grid; grid-template-rows: 0fr; padding-top: 0; opacity: 0; transition: grid-template-rows 260ms var(--ease), padding-top 260ms var(--ease), opacity 180ms ease-out; }
.home-block-panel-inner { min-height: 0; overflow: hidden; }
.home-block.is-open .home-block-panel { grid-template-rows: 1fr; padding-top: 8px; opacity: 1; }
.home-dashboard .screen-body { gap: clamp(20px, 2.4vw, 30px); }
.menu-dashboard .screen-body { gap: clamp(24px, 3vw, 34px); }
.home-lead { display: grid; gap: 8px; min-width: 0; }
.home-next .lcard { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.home-next .lsec-head { color: var(--accent-text); }
.home-top-grid { display: grid; gap: clamp(20px, 2.4vw, 30px); min-width: 0; }
.home-column { display: grid; gap: clamp(20px, 2.4vw, 30px); min-width: 0; align-content: start; }
.home-news-grid { display: grid; gap: clamp(16px, 2vw, 24px); min-width: 0; }
.home-news-grid .lsec { min-width: 0; }
.home-secondary { min-width: 0; }
.teacher-task-empty { display: grid; place-items: center; min-height: 96px; }
.teacher-task-empty .nodata { padding: 24px 16px; }
@media (min-width: 900px) and (min-height: 541px), (min-width: 900px) and (pointer: fine) {
  .tab[data-route=notifications], .tabbar-title { display: flex }
  .tabbar-title { align-items: center; gap: 10px; padding: 10px 12px; margin-inline: 0; width: 100%; border: 0; border-radius: 8px; background: transparent; color: inherit; text-align: left }
  .screen-head .hdr > button:has(.bell-dot), .screen-head .hdr > button[aria-label="Уведомления"], .screen-head .hdr > button[aria-label^="К проверке"], .screen-head .hdr > button[aria-label="Профиль"] { display: none }
  .home-dashboard > .screen-head { display: none }
  .home-dashboard > .screen-body { padding-top: 24px }
}

@media (min-width: 720px) {
  .home-dashboard .screen-body { display: grid; columns: auto; grid-template-columns: minmax(0, 1fr); align-items: start; }
  .home-top-grid { grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr); align-items: start; }
  .home-column > * { grid-column: auto; grid-row: auto; }
  .home-announcements { grid-column: 1 / -1; }
  .home-news-grid { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-secondary { grid-column: 1 / -1; }
}
@media (max-width: 899px) {
  .menu-dashboard .menu-features-title { display: none; }
  .menu-dashboard .menu-features { gap: 0; }
}

@media (min-width: 1100px) {
  .home-news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .smart-courses-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tabbar-title:hover { background: var(--step) }
.tabbar-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }

/* MARK: 28.11.2026 — вход на порталах: предупреждение регистрации */
.form-warning-text { margin: 0; font-size: 13px; color: var(--text-2); background: var(--step); padding: 12px; border-radius: var(--r-sm); }

/* ===== Визуальная система 01.12.2026: midnight blue =====
   Палитра собрана по референсу: #091747 → #0D2C8E → #1746A2 → #3B82F6 → #7DB2FF → #E6F0FF.
   Слой меняет только представление, не структуру и не логику экранов. */
:root {
  --palette-abyss: #091747;
  --palette-navy: #0D2C8E;
  --palette-cobalt: #1746A2;
  --palette-blue: #3B82F6;
  --palette-sky: #7DB2FF;
  --palette-mist: #E6F0FF;
  --bg: var(--palette-abyss);
  --surface: #10245f;
  --raised: #1746A2;
  --step: rgba(125, 178, 255, 0.12);
  --step-hover: rgba(125, 178, 255, 0.2);
  --hairline: rgba(125, 178, 255, 0.22);
  --text: var(--palette-mist);
  --text-2: #c5d6f4;
  --muted: #9ab2db;
  --accent: var(--palette-blue);
  --accent-hover: var(--palette-sky);
  --accent-text: var(--palette-sky);
  --on-accent: var(--palette-abyss);
  --overlay: rgba(4, 12, 38, 0.78);
  --lens: rgba(125, 178, 255, 0.22);
  --sheet: #0D2C8E;
  --sheet-card: #1746A2;
  --c-blue: var(--palette-blue);
  --c-indigo: #6b8fff;
  --c-teal: #6bc8df;
  --c-green: #75d6b1;
  --c-orange: #f7bd78;
  --c-red: #f28a9d;
  --c-pink: #e9a6d5;
  --c-purple: #b7a5f4;
  --c-gray: #9ab2db;
  --c-brown: #c89b7b;
  --c-yellow: #f3d37a;
  --c-cyan: #7eddeb;
  --c-lime: #b8df82;
  --c-sky: var(--palette-sky);
  --c-violet: #c3a9ff;
  --c-navy: var(--palette-cobalt);
}

:root[data-theme="light"] {
  --bg: var(--palette-mist);
  --surface: #dceaff;
  --raised: #ffffff;
  --step: rgba(13, 44, 142, 0.08);
  --step-hover: rgba(13, 44, 142, 0.14);
  --hairline: rgba(13, 44, 142, 0.16);
  --text: var(--palette-abyss);
  --text-2: #294477;
  --muted: #5472a5;
  --accent: var(--palette-cobalt);
  --accent-hover: var(--palette-navy);
  --accent-text: var(--palette-navy);
  --on-accent: var(--palette-mist);
  --overlay: rgba(9, 23, 71, 0.34);
  --lens: rgba(23, 70, 162, 0.14);
  --sheet: #dceaff;
  --sheet-card: #ffffff;
}

html { background: var(--bg); }
body { position: relative; isolation: isolate; background: var(--bg); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--palette-blue) 18%, transparent), transparent 34%),
    radial-gradient(circle at 92% 18%, color-mix(in srgb, var(--palette-navy) 54%, transparent), transparent 32%),
    linear-gradient(150deg, color-mix(in srgb, var(--palette-abyss) 90%, transparent), transparent 58%);
  opacity: 0.82;
}
#app { position: relative; z-index: 1; }
::selection { background: var(--palette-sky); color: var(--palette-abyss); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: color-mix(in srgb, var(--bg) 88%, transparent); }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--palette-sky) 34%, transparent); border: 3px solid transparent; border-radius: 999px; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--palette-sky) 54%, transparent); background-clip: padding-box; }

.app { background: transparent; }
.screen-head {
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--palette-sky) 12%, transparent);
  -webkit-backdrop-filter: saturate(1.25) blur(18px); backdrop-filter: saturate(1.25) blur(18px);
}
.screen-head::after { background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 70%, transparent), transparent); }
.screen-body { gap: clamp(24px, 3vw, 36px); }

:where(.card, .rows-card, .lcard, .task-card, .day-card, .timeline, .month-calendar, .notes-list, .hb-card, .hb-fold, .profile-field, .student-card, .note, .loading-card, .menu-feature-tile, .note-subject-row) {
  border: 1px solid var(--hairline);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(230, 240, 255, 0.06);
}
.menu-feature-tile, .note-subject-row, .hb-card { background: linear-gradient(145deg, color-mix(in srgb, var(--palette-cobalt) 42%, var(--surface)), var(--surface)); }
.menu-feature-tile:hover, .note-subject-row:hover, .hb-card:hover { border-color: color-mix(in srgb, var(--palette-sky) 55%, transparent); box-shadow: 0 20px 42px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(230, 240, 255, 0.12); }
.menu-feature-icon, .note-subject-icon, .menu-tile, .hb-service-icon { background: color-mix(in srgb, var(--palette-sky) 20%, var(--surface)); color: var(--palette-sky); }
.menu-feature-label, .menu-features-title, .hdr-title, .title2, .title3 { text-wrap: balance; }
.menu-features-title { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.035em; }
.sec-head, .lsec-head, .task-sec-head { color: var(--text-2); }
.lrow, .list-row, .task-row, .note-row { transition: background-color 180ms var(--ease), transform 180ms var(--ease); }
button.lrow:hover, button.list-row:hover, .note-row:hover { background: color-mix(in srgb, var(--palette-sky) 11%, transparent); }
button.lrow:active, button.list-row:active, .note-row:active { transform: scale(0.995); }

.button, .role-btn, .portal-trigger {
  background: color-mix(in srgb, var(--palette-sky) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--palette-sky) 18%, transparent);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(230, 240, 255, 0.08);
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease), opacity 180ms var(--ease);
}
.button:hover, .role-btn:hover, .portal-trigger:hover { border-color: color-mix(in srgb, var(--palette-sky) 48%, transparent); transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(230, 240, 255, 0.1); }
.button:active, .role-btn:active, .portal-trigger:active { transform: translateY(0) scale(0.985); }
.button-primary, .role-btn.is-primary, .portal-trigger { background: linear-gradient(135deg, var(--palette-cobalt), var(--palette-navy)); color: var(--palette-mist); border-color: color-mix(in srgb, var(--palette-sky) 52%, transparent); }
.button-primary:hover, .role-btn.is-primary:hover, .portal-trigger:hover { background: linear-gradient(135deg, var(--palette-sky), var(--palette-blue)); color: var(--palette-abyss); }
.button-danger { background: color-mix(in srgb, var(--danger) 24%, var(--surface)); }
.icon-button, .hdr-btn, .fab, .tab, .tabbar-title, .strip-arrow, .weekbar button, .menu-row { transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease); }
.icon-button:hover, .hdr-btn:hover, .fab:hover, .tab:hover, .tabbar-title:hover, .strip-arrow:hover, .weekbar button:hover, .menu-row:hover { transform: translateY(-1px); color: var(--palette-sky); }
.hdr-btn, .hdr-pill, .seg, .strip, .search-field, .tabbar, .menu, .portal-links { background: color-mix(in srgb, var(--surface) 88%, transparent); border-color: var(--hairline); box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(230, 240, 255, 0.06); }
.tabbar { -webkit-backdrop-filter: blur(18px) saturate(1.25); backdrop-filter: blur(18px) saturate(1.25); }
.tab[aria-current="page"], .tab svg, .lrow-kicker, .lrow-action, .lrow-link, .link-btn, .back, .accent { color: var(--palette-sky); }
.tab[aria-current="page"] { background: color-mix(in srgb, var(--palette-blue) 18%, transparent); }
.tab-slider { background: linear-gradient(135deg, color-mix(in srgb, var(--palette-blue) 42%, transparent), color-mix(in srgb, var(--palette-sky) 18%, transparent)); box-shadow: inset 0 1px 0 rgba(230, 240, 255, 0.22), 0 5px 16px rgba(0, 0, 0, 0.2); }
.field-input, .lrow-input, .note-editor-text, .task-editor-panel, .task-editor-voice, .task-editor-swatches { background: color-mix(in srgb, var(--surface) 92%, var(--palette-navy)); border-color: var(--hairline); transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), background-color 180ms var(--ease); }
.field-input:focus-visible, .lrow-input:focus-visible, .note-editor-text:focus-visible { border-color: var(--palette-sky); box-shadow: 0 0 0 3px color-mix(in srgb, var(--palette-sky) 24%, transparent); }
.field-input::placeholder, .lrow-input::placeholder, .search-field input::placeholder { color: color-mix(in srgb, var(--muted) 84%, transparent); }
.menu-search-disabled { background: color-mix(in srgb, var(--surface) 88%, var(--bg)); border-color: var(--hairline); color: var(--muted); box-shadow: inset 0 1px 0 rgba(230, 240, 255, 0.06); }
.menu-search-disabled svg { color: var(--accent-text); }
.menu-search-status { color: var(--muted); }
.progress, progress, .course-progress progress { accent-color: var(--palette-blue); }
.home-next .lcard { background: linear-gradient(145deg, color-mix(in srgb, var(--palette-blue) 24%, var(--surface)), var(--surface)); }
.home-next .lsec-head, .dl-hero .dl-count { color: var(--palette-sky); }
.event, .chip, .pill, .grade-chip, .allday-pill { box-shadow: inset 0 1px 0 rgba(230, 240, 255, 0.08); }
.sheet, .dialog { box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(230, 240, 255, 0.08); }
.login, .roles, .portal-hub { position: relative; overflow: hidden; background: transparent; }
.login::before, .roles::before, .portal-hub::before { content: ""; position: absolute; width: min(680px, 90vw); aspect-ratio: 1; top: -34%; left: 50%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--palette-blue) 24%, transparent), transparent 68%); pointer-events: none; }
.login-card { border: 1px solid color-mix(in srgb, var(--palette-sky) 24%, transparent); background: linear-gradient(145deg, color-mix(in srgb, var(--palette-navy) 82%, var(--surface)), var(--surface)); box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(230, 240, 255, 0.1); }
.portal-intro { color: var(--palette-sky); }
.role-links, .login-help, .field-hint { color: var(--text-2); }
.role-link, .login-back { color: var(--palette-sky); transition: color 180ms var(--ease), opacity 180ms var(--ease); }
.role-link:hover, .login-back:hover { color: var(--palette-mist); }
.portal-links { animation: visual-pop 220ms var(--ease) both; }

/* Быстрый каскад при переходе между экранами и раскрытии крупных поверхностей. */
@keyframes visual-enter { from { opacity: 0; transform: translateY(10px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes visual-pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
.screen-body > * { animation: visual-enter 420ms var(--ease) both; }
.screen-body > *:nth-child(2) { animation-delay: 35ms; }
.screen-body > *:nth-child(3) { animation-delay: 70ms; }
.screen-body > *:nth-child(4) { animation-delay: 105ms; }
.screen-body > *:nth-child(5) { animation-delay: 140ms; }
.screen-body > *:nth-child(n + 6) { animation-delay: 175ms; }
.menu-feature-tile, .note-subject-row, .hb-card, .lcard > .lrow, .task-card > .task-row, .notes-list > .note-row { animation: visual-pop 360ms var(--ease) both; }
.menu-feature-tile:nth-child(2), .note-subject-row:nth-child(2), .hb-card:nth-child(2), .lcard > .lrow:nth-child(2), .task-card > .task-row:nth-child(2), .notes-list > .note-row:nth-child(2) { animation-delay: 40ms; }
.menu-feature-tile:nth-child(3), .note-subject-row:nth-child(3), .hb-card:nth-child(3), .lcard > .lrow:nth-child(3), .task-card > .task-row:nth-child(3), .notes-list > .note-row:nth-child(3) { animation-delay: 80ms; }
.menu-feature-tile:nth-child(4), .note-subject-row:nth-child(4), .hb-card:nth-child(4), .lcard > .lrow:nth-child(4), .task-card > .task-row:nth-child(4), .notes-list > .note-row:nth-child(4) { animation-delay: 120ms; }
.roles-inner, .login-card, .portal-menu { animation: visual-enter 480ms var(--ease) both; }

@media (min-width: 900px) and (min-height: 541px), (min-width: 900px) and (pointer: fine) {
  .tabbar { background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 8px 0 30px rgba(0, 0, 0, 0.16); }
  .tab[aria-current="page"] { background: color-mix(in srgb, var(--palette-blue) 16%, transparent); }
  .screen-body { max-width: 1160px; }
}
@media (max-width: 600px) {
  .screen-body { gap: 24px; }
  .menu-features-grid, .note-subject-grid { gap: 10px; }
  .menu-feature-tile { min-height: 124px; padding: 14px; }
  .menu-feature-label { font-size: 17px; }
  .login-card { padding: clamp(20px, 6vw, 28px); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { opacity: 0.65; }
  .screen-body > *, .menu-feature-tile, .note-subject-row, .hb-card, .lcard > .lrow, .task-card > .task-row, .notes-list > .note-row, .roles-inner, .login-card, .portal-menu, .portal-links { animation: none; }
}

/* ===== 02.12.2026 — shared surfaces, filled navigation and calm motion ===== */
body::before {
  background-size: 140% 140%;
  animation: ambient-drift 22s ease-in-out infinite alternate;
}

@keyframes ambient-drift {
  0% { background-position: 0% 0%, 100% 14%, 0% 0%; }
  50% { background-position: 8% 5%, 92% 20%, 4% 2%; }
  100% { background-position: 2% 10%, 80% 12%, 8% 4%; }
}

/* Один входящий момент на маршрут. Перерисовки из-за API не получают новую сцену. */
.screen-body > *,
.menu-feature-tile,
.note-subject-row,
.hb-card,
.lcard > .lrow,
.task-card > .task-row,
.notes-list > .note-row { animation: none; }
.app.is-route-entering .screen-body > * { animation: visual-enter 420ms var(--ease) both; }
.app.is-route-entering .screen-body > *:nth-child(2) { animation-delay: 35ms; }
.app.is-route-entering .screen-body > *:nth-child(3) { animation-delay: 70ms; }
.app.is-route-entering .screen-body > *:nth-child(4) { animation-delay: 105ms; }
.app.is-route-entering .screen-body > *:nth-child(n + 5) { animation-delay: 140ms; }
.app.is-route-entering .menu-feature-tile,
.app.is-route-entering .note-subject-row,
.app.is-route-entering .hb-card,
.app.is-route-entering .lcard > .lrow,
.app.is-route-entering .task-card > .task-row,
.app.is-route-entering .notes-list > .note-row { animation: visual-pop 360ms var(--ease) both; }

/* Filled icon is a sibling of the line icon, so the slider changes only the
   symbol and never changes the width of a navigation item. */
.tab-icon { position: relative; display: grid; place-items: center; width: 22px; height: 22px; }
.tab-icon svg { grid-area: 1 / 1; transition: opacity 140ms var(--ease), transform 140ms var(--ease); }
.tab-icon svg[data-icon-variant="fill"] { opacity: 0; transform: scale(.88); }
.tab[aria-current="page"] .tab-icon svg[data-icon-variant="line"] { opacity: 0; transform: scale(.88); }
.tab[aria-current="page"] .tab-icon svg[data-icon-variant="fill"] { opacity: 1; transform: scale(1); }

/* Поля входа: едва заметное дыхание рамки при посадке и короткий отклик на
   каждый символ. Длительность вычисляется в login.js по скорости ввода. */
.login-liquid-input {
  --login-pulse-duration: 360ms;
  animation: login-input-breathe 3.8s ease-out 160ms both;
}
.login-liquid-input.is-typing { animation: login-input-pulse var(--login-pulse-duration) var(--ease) both; }
@keyframes login-input-breathe {
  0% { border-color: var(--hairline); box-shadow: 0 0 0 0 color-mix(in srgb, var(--palette-sky) 0%, transparent), inset 0 1px 0 transparent; }
  42% { border-color: color-mix(in srgb, var(--palette-sky) 48%, var(--hairline)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--palette-sky) 7%, transparent), inset 0 1px 0 color-mix(in srgb, var(--palette-mist) 9%, transparent); }
  100% { border-color: var(--hairline); box-shadow: 0 0 0 0 transparent, inset 0 1px 0 transparent; }
}
@keyframes login-input-pulse {
  0%, 100% { border-color: var(--hairline); box-shadow: 0 0 0 0 transparent, inset 0 1px 0 transparent; }
  38% { border-color: color-mix(in srgb, var(--palette-sky) 66%, var(--hairline)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--palette-sky) 12%, transparent), inset 0 1px 0 color-mix(in srgb, var(--palette-mist) 13%, transparent); }
  72% { border-color: color-mix(in srgb, var(--palette-sky) 34%, var(--hairline)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--palette-sky) 8%, transparent); }
}

/* Вход разделён на две одинаковые по ритму плашки. */
.portal-login { width: min(420px, 100%); }
.login-layout { display: grid; gap: 16px; }
.login-plates { display: grid; gap: 12px; }
.login-plate { width: 100%; padding: 22px; display: grid; gap: 16px; }
.login-plate-title { text-align: center; font-size: 18px; line-height: 1.25; font-weight: 650; text-wrap: balance; }
.login-plate-primary { background: linear-gradient(145deg, color-mix(in srgb, var(--palette-cobalt) 72%, var(--surface)), var(--surface)); }
.login-plate .login-form { gap: 14px; }
.login-plate .login-back { margin-top: -3px; }

/* Портал: dropdown растёт из кнопки, не участвует в потоке и всегда равен
   ширине общей auth-поверхности. */
.portal-menu { width: min(420px, 100%); }
.portal-picker { position: relative; }
.portal-picker > summary { position: relative; z-index: 2; }
.portal-links {
  position: absolute; z-index: 4; inset-inline: 0; top: calc(100% + 10px); width: 100%; margin: 0;
  visibility: hidden; pointer-events: none;
  animation: none;
  overflow: hidden; background: color-mix(in srgb, var(--surface) 74%, transparent);
  border: 1px solid color-mix(in srgb, var(--palette-sky) 42%, transparent);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(230, 240, 255, .18);
  -webkit-backdrop-filter: blur(26px) saturate(1.35);
  backdrop-filter: blur(26px) saturate(1.35);
}
.portal-links:not([hidden]) { visibility: visible; pointer-events: auto; animation: portal-dropdown 180ms var(--ease) both; }
.portal-links::before { content: ""; position: absolute; inset: 0 12% auto; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--palette-mist) 70%, transparent), transparent); opacity: .7; }
.portal-link { position: relative; z-index: 1; min-height: 52px; padding-inline: 16px; transition: background-color 160ms var(--ease), padding-inline 160ms var(--ease); }
.portal-link:hover, .portal-link:focus-visible { padding-inline: 19px; background: color-mix(in srgb, var(--palette-sky) 16%, transparent); }
.portal-link:active { background: color-mix(in srgb, var(--palette-sky) 28%, transparent); }
.portal-trigger:hover { transform: none; }
@keyframes portal-dropdown { from { opacity: 0; transform: translateY(-4px); } }

/* Этот кадр совпадает с последним кадром на странице выбора портала. */
.portal-curtain {
  display: none; position: fixed; inset: 0; z-index: 100; pointer-events: none;
  background: var(--palette-abyss);
}
[data-portal-arrival] .portal-curtain, .portal-curtain.is-moving { display: block; }

/* Под раскрытием уже лежит готовый экран со стабильной геометрией. */
.app.portal-motion-landed,
.portal-motion-landed .login-card,
.portal-motion-landed .login-liquid-input:not(.is-typing) { animation: none; }

@media (max-width: 600px) {
  .login-plate { padding: 18px; }
  .portal-links { top: calc(100% + 8px); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .portal-curtain.is-moving { display: none; }
  .app.is-route-entering .screen-body > *, .app.is-route-entering .menu-feature-tile,
  .app.is-route-entering .note-subject-row, .app.is-route-entering .hb-card,
  .app.is-route-entering .lcard > .lrow, .app.is-route-entering .task-card > .task-row,
  .app.is-route-entering .notes-list > .note-row, .login-liquid-input, .login-liquid-input.is-typing,
  .portal-links:not([hidden]) { animation: none; }
}
