/* Платформа «Мир» — цвета и шрифты как на сайте mirklassy.ru */
:root {
  --navy: #273788; --navy-d: #1b2763; --sky: #468bb1; --sky-l: #d9e9f2;
  --paper: #fbf8f2; --paper-2: #f3eee3; --ink: #1f2433; --muted: #5b6275;
  --gold: #d9a441; --line: rgba(39, 55, 136, .12); --card: #ffffff;
  --m5: #1f8a4c; --m4: #2f7fb0; --m3: #c27c0e; --m2: #c0392b; --mok: #273788; --mabs: #8a8f9c;
  --danger: #b3261e;
  --r: 18px; --r-s: 10px;
  --shadow: 0 14px 34px -22px rgba(27, 39, 99, .45);
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #8ea2f0; --navy-d: #b7c4ff; --sky: #6fb1d6; --sky-l: #1d3140;
    --paper: #14161d; --paper-2: #1b1e27; --ink: #e8e9ee; --muted: #9aa0b2;
    --gold: #e0b45d; --line: rgba(160, 175, 230, .14); --card: #1d2029;
    --m5: #4cc184; --m4: #63b3e3; --m3: #e6a740; --m2: #ff7a6b; --mok: #9fb0ff; --mabs: #9aa0b2;
    --danger: #ff8a80;
    --shadow: 0 14px 34px -22px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.5 var(--sans);
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--serif); color: var(--navy-d); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h2 { font-size: 1.2rem; }
a { color: var(--navy); }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .88rem; margin: .4em 0 0; }
.center { text-align: center; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 10px max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy-d); font: 700 1.35rem var(--serif); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a.active { background: var(--navy); color: #fff; }
.me { position: relative; }
.me-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.me-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: var(--shadow);
  padding: 6px; display: grid;
}
.me-menu a, .me-menu button {
  text-align: left; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink);
  background: none; border: 0; font: inherit; cursor: pointer;
}
.me-menu a:hover, .me-menu button:hover { background: var(--paper-2); }

.tabbar { display: none; }

/* ---------- страница ---------- */
.app { max-width: 1120px; margin: 0 auto; padding: 28px 20px 60px; outline: none; }
.page.narrow { max-width: 720px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.sub { color: var(--muted); margin: 4px 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 22px 0 12px; }
.section-head h2 { margin: 0; }
section > h2 { margin-top: 28px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card.flush { padding: 0; overflow: hidden; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; border: 2px dashed var(--line); border-radius: var(--r); display: grid; gap: 12px; justify-items: center; }
.empty p { margin: 0; }
.loading { display: flex; gap: 10px; align-items: center; justify-content: center; color: var(--muted); padding: 60px 0; }
.spinner { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--navy);
  background: var(--navy); color: #fff; font: 600 .95rem var(--sans); cursor: pointer; text-decoration: none;
  transition: transform .1s, background .15s;
}
.btn:hover { background: var(--navy-d); border-color: var(--navy-d); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn.ghost:hover { background: var(--paper-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost.danger { background: transparent; color: var(--danger); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.big { padding: 13px 22px; font-size: 1.05rem; width: 100%; }
.btn.sq { width: 40px; padding: 10px 0; }
@media (prefers-color-scheme: dark) { .btn:not(.ghost):not(.danger) { color: #10131c; } .nav a.active { color: #10131c; } }
.link-btn { background: none; border: 0; padding: 4px 6px; font: inherit; font-size: .88rem; color: var(--navy); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.link-btn:hover { text-decoration-color: currentColor; }
.link-btn.danger { color: var(--danger); }
.icon-btn { background: none; border: 0; font-size: 1.1rem; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--paper-2); }

input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid color-mix(in srgb, var(--navy) 22%, transparent); border-radius: var(--r-s);
  padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 18%, transparent); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--navy); margin: 0; }
select.compact { width: auto; min-width: 150px; border-radius: 999px; padding: 8px 14px; min-height: 40px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field-label { font-weight: 600; font-size: .92rem; }
.form .actions, .card .actions { margin-top: 6px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.actions.split { justify-content: space-between; }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr .8fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; cursor: pointer; font-weight: 600; }
.repeat { background: var(--paper-2); border-radius: var(--r-s); padding: 12px; margin-bottom: 12px; }
.wd { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); cursor: pointer; font-size: .9rem; }
.inline-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.inline-form select { flex: 1; min-width: 180px; }
.search { margin-bottom: 12px; max-width: 360px; }
.pill { display: inline-block; font-size: .78rem; padding: 2px 9px; border-radius: 999px; background: var(--sky-l); color: var(--navy-d); font-weight: 600; white-space: nowrap; }
.pill.off { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); margin-left: 8px; }

/* ---------- вход ---------- */
.login-page { min-height: calc(100vh - 88px); display: grid; place-items: center; }
.login-card {
  width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 26px;
  padding: 34px 30px 26px; box-shadow: var(--shadow); text-align: left;
}
.login-card h1 { text-align: center; margin-bottom: 4px; }
.login-card > .sub { text-align: center; margin-bottom: 22px; }
.login-logo { display: block; margin: 0 auto 14px; height: auto; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 46px; }
.eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0; width: 40px; height: 40px; cursor: pointer; opacity: .6; font-size: 1.05rem; }
.login-card .btn.big { margin-top: 8px; }

/* ---------- неделя ---------- */
.week-nav { display: flex; gap: 6px; align-items: center; }
.week-nav .month { font-family: var(--serif); font-weight: 700; color: var(--navy-d); min-width: 150px; text-align: center; }
.week { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.week.diary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.day {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.day-head {
  display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line); background: var(--paper-2);
}
.day-name { font: 700 1.05rem var(--serif); color: var(--navy-d); }
.day-date { color: var(--muted); font-size: .9rem; }
.day.today { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 45%, transparent), var(--shadow); }
.day.today .day-head { background: color-mix(in srgb, var(--gold) 18%, var(--card)); }
.day.today .day-date::after { content: " · сегодня"; color: var(--gold); font-weight: 700; }
.day-empty { color: var(--muted); margin: 0; padding: 16px; font-size: .92rem; }
.lessons { list-style: none; margin: 0; padding: 0; }
.lessons li + li { border-top: 1px dashed var(--line); }
/* в дневнике ученика — линейки, как в бумажном */
.diary .lessons li + li { border-top-style: solid; }
.lesson {
  display: grid; grid-template-columns: 22px 46px 1fr auto; gap: 4px 10px; align-items: start;
  padding: 11px 16px; text-decoration: none; color: inherit; position: relative;
}
.lesson:hover { background: color-mix(in srgb, var(--sky-l) 45%, transparent); }
.l-num { color: var(--muted); font-size: .85rem; padding-top: 2px; }
.l-time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy); font-size: .92rem; padding-top: 1px; }
.l-main { display: grid; gap: 2px; min-width: 0; }
.l-subj { font-weight: 700; }
.l-class { font-weight: 400; color: var(--muted); font-size: .9rem; }
.l-topic { color: var(--muted); font-size: .9rem; }
.l-hw { font-size: .9rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.l-hw b { color: var(--navy); }
.l-hw .done { color: var(--m5); font-weight: 700; }
.l-right { display: flex; gap: 4px; align-items: center; }
.lesson.live { background: color-mix(in srgb, var(--m5) 9%, transparent); }
.live-dot { position: absolute; left: 6px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--m5); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- отметки ---------- */
/* цифры отметок — без засечек: у Georgia «старинные» цифры разной высоты */
.mark {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 9px;
  font: 700 1rem var(--sans); color: #fff; background: var(--mabs); text-decoration: none;
}
.mark.m5 { background: var(--m5); } .mark.m4 { background: var(--m4); } .mark.m3 { background: var(--m3); }
.mark.m2 { background: var(--m2); } .mark.mok { background: var(--mok); } .mark.mabs { background: var(--mabs); }
.mark.mnote { background: var(--sky-l); color: var(--navy-d); }
@media (prefers-color-scheme: dark) { .mark { color: #10131c; } }
.mark.huge { min-width: 64px; height: 64px; font-size: 2.1rem; border-radius: 16px; }
.mark-list { display: flex; flex-wrap: wrap; gap: 5px; }
.avg { font-variant-numeric: tabular-nums; }
.avg.m5 { color: var(--m5); } .avg.m4 { color: var(--m4); } .avg.m3 { color: var(--m3); } .avg.m2 { color: var(--m2); }
.marks-table { width: 100%; border-collapse: collapse; }
.marks-table th, .marks-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.marks-table thead th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--paper-2); }
.marks-table tbody th { font-family: var(--serif); color: var(--navy-d); white-space: nowrap; }
.marks-table .num { text-align: right; white-space: nowrap; }
.marks-table tr:last-child > * { border-bottom: 0; }

/* ---------- урок ---------- */
.lesson-head { margin-bottom: 10px; }
.lesson-head h1 { margin: 6px 0 0; }
.back { text-decoration: none; font-weight: 600; font-size: .92rem; }
.lesson-tools { display: flex; gap: 8px; margin: 0 0 20px; flex-wrap: wrap; }
.lesson-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 24px; align-items: start; }
.files { display: grid; gap: 6px; margin: 10px 0; }
.file { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: .94rem; }
.file a { font-weight: 600; word-break: break-word; }
.roster { list-style: none; margin: 0; padding: 0; }
.roster > li { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.roster > li:last-child { border-bottom: 0; }
.roster-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.r-name { font-weight: 700; }
.marks { display: flex; gap: 8px; align-items: center; }
.chip-group { display: flex; gap: 4px; }
.chip-btn {
  min-width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  font: 700 1rem var(--sans); color: var(--muted); cursor: pointer; transition: background .1s, color .1s;
}
.chip-btn:hover { border-color: var(--navy); color: var(--ink); }
.chip-btn.on { color: #fff; border-color: transparent; }
.chip-btn.m5.on { background: var(--m5); } .chip-btn.m4.on { background: var(--m4); } .chip-btn.m3.on { background: var(--m3); }
.chip-btn.m2.on { background: var(--m2); } .chip-btn.mok.on { background: var(--mok); } .chip-btn.abs.on { background: var(--mabs); }
@media (prefers-color-scheme: dark) { .chip-btn.on { color: #10131c; } }
.comment { min-height: 38px; padding: 7px 10px; font-size: .92rem; }
.answer { background: var(--paper-2); border-radius: var(--r-s); padding: 8px 12px; }
.answer summary { cursor: pointer; font-weight: 600; color: var(--m5); }
.answer-text { white-space: pre-wrap; margin: 8px 0; }
.mark-card { display: flex; gap: 16px; align-items: center; }
.teacher-note { margin: 4px 0 0; font-style: italic; }
.hw-text { white-space: pre-wrap; margin: 0; font-size: 1.05rem; }

/* ---------- классы и люди ---------- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.class-card {
  display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--r); background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: inherit;
  border-top: 5px solid var(--sky); transition: transform .12s;
}
.class-card:hover { transform: translateY(-2px); }
.class-card.archived { opacity: .65; border-top-color: var(--mabs); }
.cc-name { font: 700 1.2rem var(--serif); color: var(--navy-d); }
.cc-meta { color: var(--muted); font-size: .9rem; }
.archived-list { margin-top: 26px; }
.archived-list summary { cursor: pointer; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
.journal-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--navy-d); border-bottom-color: var(--gold); }
.people { list-style: none; margin: 0; padding: 0; }
.person { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person.blocked .p-name { color: var(--muted); text-decoration: line-through; }
.p-main { display: grid; gap: 2px; }
.p-name { font-weight: 700; }
.p-login { color: var(--muted); font-size: .88rem; }
.row-actions { display: flex; gap: 2px; flex-wrap: wrap; }
.props { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.props dt { color: var(--muted); }
.props dd { margin: 0; font-weight: 600; }
.creds { display: grid; gap: 8px; background: var(--paper-2); border-radius: var(--r-s); padding: 14px 16px; margin: 6px 0 16px; }
.creds div { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.creds span { color: var(--muted); }
.creds code { font-size: 1.25rem; font-weight: 700; color: var(--navy-d); user-select: all; }

/* ---------- журнал ---------- */
.page.wide { max-width: none; }
.journal-wrap { overflow-x: auto; margin-top: 12px; }
.journal { border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.journal th, .journal td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; }
.journal .j-name {
  position: sticky; left: 0; z-index: 1; background: var(--card); text-align: left; padding: 8px 14px;
  min-width: 170px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.journal thead th { background: var(--paper-2); }
.journal thead .j-name { background: var(--paper-2); font-size: .82rem; color: var(--muted); }
.j-col a { display: grid; padding: 6px 4px; text-decoration: none; text-align: center; min-width: 46px; }
.j-date { font-weight: 700; color: var(--navy-d); }
.j-subj { font-size: .72rem; color: var(--muted); font-weight: 400; }
.j-avg { padding: 6px 12px !important; text-align: center; min-width: 56px; background: var(--paper-2); position: sticky; right: 0; box-shadow: -1px 0 0 var(--line); }
.jcell {
  width: 100%; min-width: 46px; height: 40px; border: 0; background: transparent; cursor: pointer;
  font: 700 1.05rem var(--sans); color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 2px; position: relative;
}
.jcell:hover { background: var(--sky-l); }
.jcell:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.jcell.m5 { color: var(--m5); } .jcell.m4 { color: var(--m4); } .jcell.m3 { color: var(--m3); } .jcell.m2 { color: var(--m2); } .jcell.mok { color: var(--mok); }
.j-abs { color: var(--mabs); font-family: var(--sans); font-size: .9rem; }
.jcell.has-note::after { content: ""; position: absolute; right: 4px; top: 4px; border: 4px solid var(--gold); border-left-color: transparent; border-bottom-color: transparent; }
.jpop {
  position: absolute; z-index: 40; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .45); padding: 12px; display: grid; gap: 10px; width: 300px; max-width: calc(100vw - 16px);
}
.jpop-title { font-weight: 700; font-size: .92rem; }
.jpop-row { display: flex; gap: 6px; }
.jpop-row input { min-height: 36px; padding: 6px 10px; }
.jpop .link-btn { justify-self: start; }

/* ---------- окна и уведомления ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 20, 40, .45);
  display: grid; place-items: center; padding: 16px; animation: fade .15s;
}
.modal {
  width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--card);
  border-radius: 22px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .5); outline: none; animation: pop .18s;
}
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 0 24px; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 16px 24px 24px; }
.modal-body > p:first-child { margin-top: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); }
.toast {
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow);
  font-weight: 600; animation: pop .2s; transition: opacity .35s, transform .35s;
}
.toast.err { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- телефон ---------- */
@media (max-width: 860px) {
  .lesson-grid { grid-template-columns: 1fr; }
  .week.diary { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { padding: 8px 16px; gap: 12px; }
  .nav { display: none; }
  .brand { flex: 1; }
  .app { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .week { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .head-actions { width: 100%; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 .field:first-child { grid-column: 1 / -1; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    background: var(--card); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar[hidden] { display: none !important; }
  .tabbar a { flex: 1; display: grid; justify-items: center; gap: 1px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600; padding: 4px 0; border-radius: 10px; }
  .tabbar a.active { color: var(--navy); background: var(--sky-l); }
  .tab-icon { font-size: 1.25rem; line-height: 1.2; }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .wide-mobile { width: 100%; }
  .me-btn { max-width: 150px; }
  .lesson { grid-template-columns: 18px 42px 1fr auto; padding: 11px 12px; }
  .marks-table th, .marks-table td { padding: 10px; }
  .marks { width: 100%; justify-content: space-between; }
}

/* логотип тёмно-синий — в тёмной теме подкладываем светлый круг */
@media (prefers-color-scheme: dark) {
  .brand img, .login-logo { background: #f3eee3; border-radius: 50%; padding: 3px; }
  .login-logo { padding: 10px; }
}
.card > :last-child { margin-bottom: 0; }

/* ---------- полоски на главной и уведомления ---------- */
.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px;
  border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
}
.banner .grow { flex: 1; min-width: 200px; }
.banner-icon { font-size: 1.4rem; }
.banner-go { font-weight: 700; color: var(--navy); white-space: nowrap; }
.next-banner { border-left: 5px solid var(--gold); }
.next-banner.on { border-left-color: var(--m5); background: color-mix(in srgb, var(--m5) 10%, var(--card)); }
.push-banner { border-left: 5px solid var(--sky); }
.notify-card .toggles { display: grid; gap: 10px; }
.toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.toggle input { margin-top: 3px; }
.toggle > span { display: grid; }
.toggle .hint { margin: 0; }
.ok-line { font-weight: 600; }
.actions.start { justify-content: flex-start; margin-bottom: 8px; }
.steps { padding-left: 20px; display: grid; gap: 4px; }

/* ---------- страница «Скачать приложение» ---------- */
.dl-page { max-width: 820px; }
.dl-head { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; }
.dl-head img { border-radius: 22px; box-shadow: var(--shadow); }
.dl-head h1 { margin: 0; }
.dl-why { display: grid; gap: 8px; padding-left: 40px; }
.dl-grid { display: grid; gap: 12px; margin-bottom: 18px; }
.dl-btn {
  display: flex; gap: 14px; align-items: center; padding: 16px 20px; border-radius: 16px; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.dl-btn:hover { border-color: var(--navy); }
.dl-btn.mine { border: 2px solid var(--navy); background: color-mix(in srgb, var(--sky-l) 50%, var(--card)); }
.dl-icon { font-size: 2rem; }
.dl-text { display: grid; }
.dl-help h3 { font-size: 1rem; margin: 16px 0 6px; }
.dl-help ol { padding-left: 20px; display: grid; gap: 6px; margin: 0; }
@media (max-width: 600px) { .dl-head { flex-direction: column; text-align: center; } }
