/* Деканат рядом — стили. Шрифты: Literata (заголовки) и Onest (интерфейс), оба SIL OFL 1.1, лежат в /fonts.
   Палитра: минеральный светлый фон, еловый акцент, «маркер» для изменений — как выделение текстовыделителем
   на распечатанном расписании. Тёмная тема — отдельная, а не инверсия. */

@font-face { font-family: 'Onest'; src: url('/fonts/onest-cyrillic-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; src: url('/fonts/onest-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Literata'; src: url('/fonts/literata-cyrillic-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Literata'; src: url('/fonts/literata-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Literata'; src: url('/fonts/literata-cyrillic-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Literata'; src: url('/fonts/literata-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Literata'; font-style: italic; src: url('/fonts/literata-cyrillic-400-italic.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --bg: #f2f3ef;
  --surface: #ffffff;
  --surface-2: #e8ebe5;
  --ink: #16201c;
  --muted: #56625c;
  --line: #d5dbd4;
  --accent: #0f5c4a;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe5;
  --marker: #ffe36b;
  --marker-ink: #2b2405;
  --danger: #a3271f;
  --danger-soft: #f8e1de;
  --ok: #1f6b45;
  --ok-soft: #dcefe3;
  --warn: #8a5300;
  --warn-soft: #fbecd2;
  --focus: #1d4ed8;
  --shadow: 0 1px 0 rgba(22, 32, 28, 0.04), 0 8px 24px -16px rgba(22, 32, 28, 0.25);
  --serif: 'Literata', 'PT Serif', Georgia, serif;
  --sans: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-panel: 18px;
  --r-row: 12px;
  --r-chip: 999px;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1513; --surface: #17201d; --surface-2: #1f2a26; --ink: #e7ece8; --muted: #9aa8a1; --line: #2c3833;
    --accent: #6fd0b2; --accent-ink: #0b1f19; --accent-soft: #1d3a31; --marker: #e9c341; --marker-ink: #1d1700;
    --danger: #ff8f84; --danger-soft: #3b1d1a; --ok: #7fd6a4; --ok-soft: #173326; --warn: #f2b45a; --warn-soft: #3a2a12;
    --focus: #93b4ff; --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 30px -18px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0f1513; --surface: #17201d; --surface-2: #1f2a26; --ink: #e7ece8; --muted: #9aa8a1; --line: #2c3833;
  --accent: #6fd0b2; --accent-ink: #0b1f19; --accent-soft: #1d3a31; --marker: #e9c341; --marker-ink: #1d1700;
  --danger: #ff8f84; --danger-soft: #3b1d1a; --ok: #7fd6a4; --ok-soft: #173326; --warn: #f2b45a; --warn-soft: #3a2a12;
  --focus: #93b4ff; --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 30px -18px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--sans); font-feature-settings: 'tnum' 1, 'cv01' 1;
  -webkit-font-smoothing: antialiased; min-height: 100dvh; overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { top: 12px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 24px; }
[hidden] { display: none !important; }

/* ---------- загрузка ---------- */
.boot { min-height: 100dvh; display: grid; place-content: center; gap: 14px; justify-items: center; color: var(--muted); }
.boot-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); position: relative; }
.boot-mark::after { content: ''; position: absolute; right: -5px; top: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--marker); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface) 50%, var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-row); }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-line { height: 14px; margin: 10px 0; }
.sk-block { height: 120px; margin: 14px 0; border-radius: var(--r-panel); }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100dvh; }
:where(svg) { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.2em; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 10px var(--gutter); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; min-width: 0; }
.brand img { width: 30px; height: 30px; flex: none; }
.brand > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { border-color: var(--muted); }
.icon-btn svg { width: 22px; height: 22px; }
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--danger); color: #fff; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center;
}
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; text-decoration: none; border: 1px solid var(--line); }

.main { padding: 8px var(--gutter) 120px; width: 100%; max-width: 1180px; margin: 0 auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a {
  display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; color: var(--muted);
  text-decoration: none; font-size: 11.5px; font-weight: 500; min-height: 48px; position: relative;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current='page'] { color: var(--accent); }
.tabbar a[aria-current='page']::before { content: ''; position: absolute; top: -7px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.tabbar .dot { position: absolute; top: 4px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }

.concept-note { font-size: 12.5px; color: var(--muted); padding: 18px 0 0; border-top: 1px solid var(--line); margin-top: 40px; }

@media (min-width: 960px) {
  .shell { grid-template-columns: 248px minmax(0, 1fr); }
  .tabbar {
    position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px;
    border-top: 0; border-right: 1px solid var(--line); background: var(--bg); grid-row: 1 / span 2;
  }
  .tabbar .rail-brand { margin: 0 6px 22px; }
  .tabbar a { grid-template-columns: 24px 1fr auto; justify-items: start; align-items: center; gap: 12px; font-size: 15px; padding: 10px 12px; min-height: 44px; }
  .tabbar a[aria-current='page'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
  .tabbar a[aria-current='page']::before { top: 12px; bottom: 12px; left: -14px; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .tabbar .dot { position: static; margin-left: auto; }
  .tabbar .rail-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 8px; }
  .topbar { grid-column: 2; }
  .topbar .brand { display: none; }
  .main { grid-column: 2; padding: 8px 40px 64px; }
}
.tabbar .rail-brand, .tabbar .rail-foot, .tabbar .rail-only { display: none; }
@media (min-width: 960px) { .tabbar .rail-brand, .tabbar .rail-foot { display: flex; } .tabbar .rail-only { display: grid; } .tabbar .rail-foot { display: block; } }

/* ---------- типографика экранов ---------- */
.page-head { padding: 18px 0 20px; }
.page-head h1 { font: 600 clamp(30px, 7.4vw, 46px)/1.08 var(--serif); letter-spacing: -0.02em; }
.page-head p { color: var(--muted); margin-top: 8px; max-width: 62ch; }
.section-title { font: 600 20px/1.25 var(--serif); letter-spacing: -0.01em; margin: 30px 0 12px; display: flex; align-items: baseline; gap: 10px; }
.section-title .count { font: 500 14px var(--sans); color: var(--muted); }
.section-title a { margin-left: auto; font: 500 14px var(--sans); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }

/* ---------- элементы ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 14px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink);
  font-weight: 600; cursor: pointer; text-decoration: none; transition: transform 0.08s ease, filter 0.15s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--accent); border-color: transparent; padding: 0 12px; }
.btn.danger { background: var(--surface); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; }

.panel { background: var(--surface); border-radius: var(--r-panel); box-shadow: var(--shadow); border: 1px solid var(--line); }
.panel-pad { padding: 18px; }
.panel-pad > .section-title:first-child { margin-top: 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: start; padding: 14px 18px;
  color: inherit; text-decoration: none; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
}
a.row:hover, button.row:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.row .lead { font-weight: 600; }
.row .meta { color: var(--muted); font-size: 14px; }
.row .chev { color: var(--muted); align-self: center; }
.rows > li:first-child .row { border-radius: var(--r-panel) var(--r-panel) 0 0; }
.rows > li:last-child .row { border-radius: 0 0 var(--r-panel) var(--r-panel); }
.rows > li:only-child .row { border-radius: var(--r-panel); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-chip); font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.marker { background: var(--marker); color: var(--marker-ink); }
.chip.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }

mark, .mark { background: var(--marker); color: var(--marker-ink); padding: 0 4px; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; color: var(--muted); min-height: 40px; white-space: nowrap; }
.seg button[aria-pressed='true'], .seg button[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .field .label { font-weight: 600; font-size: 15px; }
.field .help { font-size: 13.5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 16px;
}
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: 3px solid color-mix(in srgb, var(--focus) 55%, transparent); outline-offset: 1px; border-color: var(--focus); }
.input[aria-invalid='true'] { border-color: var(--danger); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; min-height: 48px; }
.choice span small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.choice input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.alert { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); font-weight: 500; }
.alert.info { background: var(--accent-soft); color: var(--ink); }
.alert svg { width: 20px; height: 20px; margin-top: 2px; }

.empty { text-align: left; padding: 22px 18px; display: grid; gap: 10px; justify-items: start; }
.empty h3 { font: 600 18px/1.3 var(--serif); }
.empty p { color: var(--muted); max-width: 52ch; }
.empty-art { width: 48px; height: 48px; color: var(--accent); }
.empty-art svg { width: 48px; height: 48px; }

.toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 500; z-index: 90;
  max-width: calc(100vw - 32px); transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 960px) { .toast { bottom: 28px; } }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: center; }

/* ---------- вход ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.login-art {
  background: var(--accent); color: #f2f3ef; padding: 28px var(--gutter) 30px; display: grid; gap: 18px; align-content: space-between;
}
:root[data-theme='dark'] .login-art { color: #0b1f19; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .login-art { color: #0b1f19; } }
.login-art .brand { color: inherit; }
.login-art .brand small { color: inherit; opacity: 0.8; }
.login-art h1 { font: 600 clamp(30px, 8vw, 54px)/1.05 var(--serif); letter-spacing: -0.025em; max-width: 14ch; }
.login-art p { max-width: 40ch; opacity: 0.9; }
.ticket { display: grid; gap: 8px; max-width: 360px; }
.ticket div { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, #ffffff 12%, transparent); font-size: 14.5px; }
.ticket b { font-variant-numeric: tabular-nums; min-width: 46px; }
.ticket .m { background: var(--marker); color: var(--marker-ink); border-radius: 4px; padding: 0 4px; }
.login-form { padding: 28px var(--gutter) 40px; display: grid; align-content: center; justify-items: center; }
.login-form form { width: 100%; max-width: 400px; }
.login-form h2 { font: 600 28px/1.2 var(--serif); margin-bottom: 6px; }
.login-form .lede { color: var(--muted); margin-bottom: 22px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 56px; }
.pw-wrap button { position: absolute; right: 4px; top: 3px; }
.demo-logins { margin-top: 22px; font-size: 14px; color: var(--muted); }
.demo-logins summary { cursor: pointer; color: var(--ink); font-weight: 600; min-height: 32px; }
.demo-logins ul { padding-left: 18px; margin: 8px 0 0; }
.demo-logins code { font-family: var(--sans); font-weight: 600; color: var(--ink); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
@media (min-width: 900px) {
  .login { grid-template-columns: 1.05fr 1fr; }
  .login-art { padding: 48px 56px; }
  .login-form { padding: 48px; }
}

/* ---------- сводка ---------- */
.today-grid { display: grid; gap: 22px; grid-template-areas: 'main' 'att' 'extra'; }
.today-main { grid-area: main; }
.attention { grid-area: att; }
.today-extra { grid-area: extra; display: grid; gap: 22px; align-self: start; }
@media (min-width: 1100px) { .today-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); grid-template-areas: 'main att' 'extra att'; grid-template-rows: auto 1fr; gap: 22px 36px; align-items: start; } }
h1[tabindex='-1']:focus { outline: none; }

.ask {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 10px 8px 18px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); cursor: text; color: var(--muted); text-align: left;
}
.ask:hover { border-color: var(--muted); }
.ask svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.ask span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask kbd { font: 500 12px var(--sans); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; color: var(--muted); }
@media (max-width: 600px) { .ask kbd { display: none; } }

.now-card { padding: 20px 20px 18px; display: grid; gap: 6px; }
.now-card .when { font-weight: 600; color: var(--accent); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.now-card h2 { font: 600 clamp(22px, 5.6vw, 30px)/1.15 var(--serif); letter-spacing: -0.015em; }
.now-card .where { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); }
.now-card .where b { color: var(--ink); font-weight: 600; }
.now-card .change-note { margin-top: 6px; font-size: 14.5px; }

/* лента дня: главный узнаваемый элемент */
.ribbon { margin-top: 16px; }
.ribbon-track { position: relative; height: 58px; border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.ribbon-block {
  position: absolute; top: 8px; bottom: 8px; border-radius: 9px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--accent); overflow: hidden; text-decoration: none;
}
.ribbon-block.changed { background: var(--marker); color: var(--marker-ink); border-color: transparent; }
.ribbon-block.cancelled { background: transparent; border: 1px dashed var(--muted); color: var(--muted); text-decoration: line-through; }
.ribbon-block.past { opacity: 0.45; }
.ribbon-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); }
.ribbon-now::before { content: ''; position: absolute; top: -1px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.ribbon-scale { position: relative; height: 18px; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.ribbon-scale span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ribbon-scale span:first-child { transform: none; }
.ribbon-scale span:last-child { transform: translateX(-100%); }

.lesson { display: grid; grid-template-columns: 62px 1fr; gap: 2px 14px; padding: 14px 18px; position: relative; }
.lesson .time { font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.lesson .time small { display: block; color: var(--muted); font-weight: 400; }
.lesson .title { font-weight: 600; line-height: 1.3; }
.lesson .info { color: var(--muted); font-size: 14px; grid-column: 2; }
.lesson .info b { color: var(--ink); font-weight: 600; }
.lesson .kind { color: var(--muted); font-weight: 400; }
.lesson.is-now { background: color-mix(in srgb, var(--accent-soft) 65%, transparent); }
.lesson.is-now::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.lesson.is-cancelled .title, .lesson.is-cancelled .time { text-decoration: line-through; color: var(--muted); }
.lesson .change { grid-column: 2; margin-top: 6px; font-size: 14px; }
.lesson .change .mark { font-weight: 600; }
.lesson .change .why { color: var(--muted); display: block; margin-top: 2px; }

.attention { display: grid; gap: 22px; }
.att-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 2px 12px; padding: 14px 16px; align-items: start; text-decoration: none; color: inherit; }
.ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); grid-row: span 2; }
.ico svg { width: 22px; height: 22px; }
.ico.ok { background: var(--ok-soft); color: var(--ok); }
.ico.warn { background: var(--warn-soft); color: var(--warn); }
.ico.danger { background: var(--danger-soft); color: var(--danger); }
.ico.marker { background: var(--marker); color: var(--marker-ink); }
.att-item .t { font-weight: 600; line-height: 1.3; }
.att-item .d { color: var(--muted); font-size: 14px; grid-column: 2; }
.att-item .side { font-size: 13px; color: var(--muted); white-space: nowrap; }
@media (max-width: 520px) {
  .att-item { grid-template-columns: 40px 1fr; }
  .att-item .ico { grid-row: span 3; }
  .att-item .side { grid-column: 2; grid-row: 2; }
  .att-item .d { grid-row: 3; }
}
a.att-item:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }

.countdown { display: flex; gap: 10px; flex-wrap: wrap; }
.countdown div { flex: 1 1 140px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.countdown b { display: block; font: 600 28px/1.1 var(--serif); }
.countdown span { color: var(--muted); font-size: 14px; }

/* ---------- расписание ---------- */
.week-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.week-nav .label { font-weight: 600; margin-right: auto; }
.day-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 16px; }
.day-strip button {
  display: grid; justify-items: center; gap: 2px; padding: 8px 0; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; position: relative; min-height: 60px;
}
.day-strip button b { font: 600 18px/1.1 var(--serif); }
.day-strip button span { font-size: 12px; color: var(--muted); }
.day-strip button[aria-selected='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.day-strip button[aria-selected='true'] span { color: inherit; opacity: 0.75; }
.day-strip button.today::after { content: ''; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.day-strip button .flag { position: absolute; top: 5px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--marker); box-shadow: 0 0 0 1px var(--marker-ink); }
.week-days { display: grid; gap: 18px; }
@media (max-width: 959px) { .day-card.off { display: none; } }
.day-card h3 { font: 600 18px/1.3 var(--serif); padding: 14px 18px 4px; display: flex; gap: 10px; align-items: baseline; }
.day-card h3 .muted { font: 400 14px var(--sans); }
@media (min-width: 960px) {
  .day-strip { display: none; }
  .week-days { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (min-width: 1400px) { .week-days { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- учёба ---------- */
.verdict { padding: 20px; display: grid; gap: 14px; }
.verdict p.big { font: 400 clamp(19px, 4.6vw, 23px)/1.4 var(--serif); }
.verdict .stats { display: flex; gap: 8px; flex-wrap: wrap; }
.disc { display: grid; gap: 8px; padding: 16px 18px; text-decoration: none; color: inherit; }
.disc-top { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.disc-top .name { font-weight: 600; line-height: 1.3; }
.disc-top .pts { font: 600 20px var(--serif); white-space: nowrap; }
.disc-top .pts small { font: 400 13px var(--sans); color: var(--muted); }
.bar { position: relative; height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 6px; }
.bar .earned { background: var(--accent); }
.bar .proj { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--accent) 45%, transparent) 0 4px, transparent 4px 8px); }
.bar .tick { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 1px; }
.disc .why { font-size: 14px; color: var(--muted); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 18px; height: 10px; border-radius: 4px; vertical-align: -1px; margin-right: 6px; }
.legend .l-earned { background: var(--accent); }
.legend .l-proj { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--accent) 45%, transparent) 0 4px, transparent 4px 8px); border: 1px solid var(--line); }
.legend .l-tick { width: 2px; height: 14px; background: var(--ink); vertical-align: -3px; }

.sim { padding: 18px; display: grid; gap: 12px; }
.sim input[type='range'] { width: 100%; accent-color: var(--accent); height: 32px; }
.sim .result { font: 600 22px/1.3 var(--serif); }
.needs { width: 100%; border-collapse: collapse; }
.needs th, .needs td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); }
.needs th { font-weight: 500; color: var(--muted); font-size: 14px; }
.needs td:last-child, .needs th:last-child { text-align: right; }
.book-term h3 { font: 600 17px var(--serif); padding: 14px 18px 0; }

/* ---------- заявки ---------- */
.req-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 18px; text-decoration: none; color: inherit; }
.req-row .t { font-weight: 600; line-height: 1.3; }
.req-row .d { color: var(--muted); font-size: 14px; }
.catalog { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cat-item { display: grid; gap: 4px; padding: 16px; border-radius: var(--r-row); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: inherit; text-align: left; cursor: pointer; }
.cat-item:hover { border-color: var(--accent); }
.cat-item b { font-weight: 600; }
.cat-item span { font-size: 14px; color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; position: relative; padding-bottom: 18px; }
.steps li::before { content: ''; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.steps li:last-child::before { display: none; }
.steps .pin { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); border: 2px solid var(--line); }
.steps .pin svg { width: 16px; height: 16px; }
.steps li.done .pin { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.steps li.done::before { background: var(--accent); }
.steps li.current .pin { background: var(--surface); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.steps li.alert-step .pin { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.steps li.bad .pin { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.steps .st { font-weight: 600; }
.steps .sd { font-size: 14px; color: var(--muted); }
.steps .sc { margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14.5px; }
.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 10px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.two-col > *, .today-grid > *, .staff-grid > * { min-width: 0; }
.two-col { display: grid; gap: 22px; }
@media (min-width: 960px) { .two-col { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } }

/* электронная справка */
.doc { background: #fffefb; color: #1d1d1b; border-radius: 6px; padding: 36px 28px; box-shadow: var(--shadow); max-width: 720px; position: relative; overflow: hidden; font-family: var(--serif); }
.doc::after { content: 'КОНЦЕПТ — НЕ ДЕЙСТВИТЕЛЬНО'; position: absolute; inset: 0; display: grid; place-items: center; transform: rotate(-24deg); font: 700 clamp(22px, 6vw, 40px) var(--sans); color: rgba(163, 39, 31, 0.13); pointer-events: none; letter-spacing: 0.04em; }
.doc h2 { font: 600 22px var(--serif); text-align: center; margin: 18px 0; }
.doc p { line-height: 1.7; margin-bottom: 10px; }
.doc .doc-head { display: flex; justify-content: space-between; gap: 12px; font: 400 13px var(--sans); color: #555; flex-wrap: wrap; }
.doc .sign { margin-top: 28px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
@media print {
  .tabbar, .topbar, .no-print, .concept-note { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; }
  .doc { box-shadow: none; }
}

/* ---------- уведомления ---------- */
.notif { display: grid; grid-template-columns: 40px 1fr; gap: 2px 12px; padding: 14px 18px; text-decoration: none; color: inherit; position: relative; }
.notif .t { font-weight: 600; line-height: 1.35; padding-right: 14px; }
.notif .b { grid-column: 2; color: var(--muted); font-size: 14.5px; }
.notif .w { grid-column: 2; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.notif.unread .t::after { content: ''; position: absolute; right: 18px; top: 20px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.notif .ico { grid-row: span 3; }
.ico { width: 40px; height: 40px; flex: none; }

/* ---------- диалог ситуаций ---------- */
dialog.sheet {
  border: 0; padding: 0; width: 100%; max-width: 640px; max-height: min(88dvh, 760px); border-radius: 22px 22px 0 0;
  margin: auto auto 0; background: var(--bg); color: var(--ink); box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
}
dialog.sheet::backdrop { background: rgba(10, 16, 14, 0.5); }
@media (min-width: 700px) { dialog.sheet { margin: 10vh auto auto; border-radius: 22px; } }
.sheet-inner { display: grid; grid-template-rows: auto 1fr; max-height: inherit; }
.sheet-head { padding: 16px 16px 10px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.sheet-head .input { min-height: 52px; font-size: 17px; }
.sheet-body { overflow-y: auto; padding: 14px 16px 22px; display: grid; gap: 12px; align-content: start; }
.sheet-body h3 { font: 600 19px/1.3 var(--serif); }
.sit { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.sit.primary { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.sit .sit-title { font-weight: 600; font-size: 17px; }
.sit .sit-hint { color: var(--muted); font-size: 14.5px; }
.sit ul { margin: 0; padding-left: 18px; font-size: 14.5px; }
.sit .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; cursor: pointer; min-height: 40px; }
.suggest button:hover { border-color: var(--accent); }

/* ---------- сотрудник ---------- */
.staff-grid { display: grid; gap: 22px; }
@media (min-width: 1100px) { .staff-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.queue-row { text-decoration: none; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 18px; width: 100%; text-align: left; background: none; border: 0; cursor: pointer; color: inherit; }
.queue-row[aria-current='true'] { background: var(--accent-soft); }
.queue-row .t { font-weight: 600; }
.queue-row .d { color: var(--muted); font-size: 14px; }


/* ---------- правки после приёмки (раунд 1) ---------- */
@media (max-width: 380px) {
  .topbar { gap: 6px; }
  .brand { gap: 8px; font-size: 15px; }
  .brand img { width: 28px; height: 28px; }
  .icon-btn, .avatar { width: 42px; height: 42px; }
}
.req-row .d { grid-column: 1 / -1; }
.req-row .chip, .req-row .pts { align-self: start; }
.lesson .change .why { margin-top: 2px; }
.kv dd { overflow-wrap: break-word; word-break: normal; }
@media (max-width: 480px) {
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { font-size: 13.5px; margin-top: 10px; }
  .kv dt:first-child { margin-top: 0; }
  .seg { flex-wrap: wrap; overflow-x: visible; }
  .seg button { padding: 8px 12px; }
}
.doc-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 16px; font-size: 15px; }
.doc-kv dt { color: #555; }
.doc-kv dd { margin: 0; }
@media (max-width: 520px) { .doc-kv { grid-template-columns: 1fr; gap: 0; } .doc-kv dd { margin-bottom: 8px; } .doc { padding: 28px 18px; } }
.doc-table { width: 100%; border-collapse: collapse; font: 400 14.5px/1.4 var(--sans); margin: 8px 0 4px; }
.doc-table th, .doc-table td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid #e3ded3; }
.doc-table th:last-child, .doc-table td:last-child { text-align: right; padding-right: 0; }
.doc-table tr.term td { font-weight: 600; padding-top: 14px; border-bottom-color: #c9c2b4; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
