/* Информатика 7 — тетрадь в клетку: синие чернила, красная ручка учителя, жёлтый маркер */
:root {
  --paper: #F7F9FD;
  --cell: #DFE6F3;
  --surface: #FFFFFF;
  --ink: #22307A;
  --ink-2: #56608F;
  --text: #1A2147;
  --line: #CBD4E8;
  --red: #D2283C;
  --marker: #FFE45C;
  --green: #12805A;
  --green-bg: #E3F5EC;
  --red-bg: #FDE8EA;
  --amber-bg: #FFF4CC;
  --focus: #2F6BFF;
  --radius: 10px;
  --f-head: "Unbounded", "Arial Black", system-ui, sans-serif;
  --f-body: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12162B; --cell: #1C2240; --surface: #191E38; --ink: #AFC0FF; --ink-2: #8D96C2; --text: #E6E9F8;
    --line: #2C3460; --red: #FF6B7A; --marker: #8C7A12; --green: #4CD49A; --green-bg: #133528; --red-bg: #3A1820; --amber-bg: #3A3110;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12162B; --cell: #1C2240; --surface: #191E38; --ink: #AFC0FF; --ink-2: #8D96C2; --text: #E6E9F8;
  --line: #2C3460; --red: #FF6B7A; --marker: #8C7A12; --green: #4CD49A; --green-bg: #133528; --red-bg: #3A1820; --amber-bg: #3A3110;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 17px/1.55 var(--f-body); color: var(--text);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--cell) 1px, transparent 1px),
    linear-gradient(90deg, var(--cell) 1px, transparent 1px);
  background-size: 24px 24px;
  min-height: 100vh;
}
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--f-head); color: var(--ink); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 4vw, 38px); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
code { font-family: "Consolas", "SFMono-Regular", monospace; background: var(--cell); padding: .05em .35em; border-radius: 4px; font-size: .92em; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* шапка */
.top {
  display: flex; align-items: center; gap: 24px; padding: 10px max(16px, calc((100vw - 1160px) / 2));
  background: var(--surface); border-bottom: 2px solid var(--ink);
  position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--f-head); font-weight: 700; text-decoration: none; color: var(--ink); font-size: 17px; }
.logo-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; background: var(--ink); color: var(--marker); border-radius: 8px; font-size: 14px; }
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a { text-decoration: none; padding: 6px 12px; border-radius: 8px; font-weight: 500; }
.topnav a.on { background: var(--marker); color: #1A2147; }
.topnav a:hover:not(.on) { background: var(--cell); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; background: var(--red); color: #fff; border-radius: 11px; font-size: 13px; font-weight: 700; }
.who { display: flex; align-items: center; gap: 14px; font-size: 15px; color: var(--ink-2); }
.who form { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 28px 16px 80px; }

/* кнопки, поля */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 16px/1 var(--f-body); padding: 11px 18px; border-radius: var(--radius);
  border: 2px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--cell); }
.btn.primary { background: var(--ink); color: var(--surface); }
.btn.primary:hover { filter: brightness(1.15); }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.sm { padding: 6px 10px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
input[type=text], input[type=password], input:not([type]), textarea, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 2px solid var(--line); border-radius: 8px; padding: 9px 12px; width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }
label { display: block; font-weight: 500; }
.stack { display: grid; gap: 14px; }
.stack label > input, .stack label > textarea, .stack label > select { margin-top: 6px; }
.inline-form { display: flex; gap: 8px; margin-top: 16px; }
.inline-form input { width: 90px; }

.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 22px 24px; }
.card.flush { padding: 0; overflow: hidden; margin-bottom: 22px; }
.card .pad { padding: 18px 22px 0; }
.card.narrow { max-width: 460px; margin: 0 auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid2.wide-left { grid-template-columns: 1.6fr 1fr; align-items: start; }
@media (max-width: 860px) { .grid2, .grid2.wide-left { grid-template-columns: 1fr; } }

.flash { padding: 12px 16px; border-radius: 10px; margin: 0 0 18px; border-left: 5px solid var(--ink); background: var(--surface); }
.flash.ok { border-color: var(--green); background: var(--green-bg); }
.flash.err { border-color: var(--red); background: var(--red-bg); }
.flash.info { border-color: var(--marker); background: var(--amber-bg); }
.tag { display: inline-block; font-size: 13px; padding: 2px 9px; border-radius: 20px; background: var(--cell); color: var(--ink-2); white-space: nowrap; }
.tag.ready { background: var(--green-bg); color: var(--green); font-weight: 600; }
.crumbs { font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
.row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.row-actions { display: flex; gap: 10px; align-items: center; }
.row-actions select { width: auto; }
.empty { text-align: center; padding: 60px 0; }
.big-code { font: 800 72px/1 var(--f-head); color: var(--red); margin: 0; }
.plain { list-style: none; padding: 0; margin: 0 0 12px; }
.plain li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.plain li:last-child { border: 0; }

/* оценка — красная ручка */
.mark {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  font: 700 21px/1 var(--f-head); color: var(--red);
  border: 2.5px solid var(--red); border-radius: 50% 46% 52% 48% / 48% 52% 46% 54%;
  transform: rotate(-6deg);
}
.mark.sm { width: 26px; height: 26px; font-size: 14px; border-width: 2px; }
.mark.xl { width: 84px; height: 84px; font-size: 46px; border-width: 4px; }
.mark.none { border-style: dashed; border-color: var(--line); }
.mark-ph { width: 36px; flex: none; }
.mark.file { border-style: dotted; }

/* вход */
body.auth .wrap { max-width: 980px; }
.auth-box { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; min-height: 70vh; }
.auth-kicker { font-weight: 600; color: var(--ink-2); margin: 0; }
.auth-title { font-size: clamp(44px, 8vw, 88px); line-height: .95; margin: 6px 0 20px; font-weight: 800; hyphens: manual; }
.auth-lead { font-size: 19px; max-width: 30em; }
.auth-bits { width: 220px; margin-top: 18px; }
.auth-bits text { font: 600 22px var(--f-head); fill: var(--ink); opacity: .22; letter-spacing: .12em; }
.auth-form { display: grid; gap: 16px; padding: 30px; box-shadow: 6px 6px 0 var(--ink); border: 2px solid var(--ink); }
.auth-form input { margin-top: 6px; }
@media (max-width: 760px) { .auth-box { grid-template-columns: 1fr; gap: 20px; min-height: 0; } }

/* главная ученика — оглавление */
.hello { margin-bottom: 26px; }
.toc { margin-bottom: 30px; }
.toc-sec { font-size: 17px; color: var(--ink-2); font-weight: 600; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-row { display: flex; align-items: center; gap: 14px; padding: 10px 6px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 70%, transparent); }
.toc-row.closed { color: var(--ink-2); }
.toc-row.closed .toc-n { background: transparent; color: var(--ink-2); border: 1.5px dashed var(--line); }
.toc-n { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 8px; background: var(--ink); color: var(--surface); font: 700 15px var(--f-head); }
.toc-n.sm { width: 26px; height: 26px; font-size: 12px; border-radius: 6px; }
.toc-title { flex: 1; font-weight: 500; }
a.toc-title { text-decoration: none; }
a.toc-title:hover { text-decoration: underline; }
.toc-row.open { font-size: 18px; }
.toc-row.open:hover { background: var(--surface); }
.steps { display: flex; gap: 4px; }
.step { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 5px; font-size: 12px; font-weight: 700; border: 1.5px solid var(--line); border-radius: 6px; color: var(--ink-2); }
.step.done { background: var(--green-bg); border-color: var(--green); color: var(--green); }
@media (max-width: 640px) { .toc-row { flex-wrap: wrap; } .toc-title { flex-basis: calc(100% - 50px); } .steps { margin-left: 48px; } }

/* урок */
.lesson-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
.lesson-n { display: grid; place-items: center; width: 64px; height: 64px; flex: none; background: var(--ink); color: var(--marker); border-radius: 14px; font: 800 28px var(--f-head); }
.lesson-head h1 { font-size: clamp(22px, 3.2vw, 32px); margin-bottom: 6px; }
.lesson-head p { margin: 0; }
.tabs { display: flex; gap: 6px; margin: 22px 0 22px; border-bottom: 2px solid var(--ink); flex-wrap: wrap; }
.tab { display: flex; align-items: center; gap: 10px; padding: 10px 18px; text-decoration: none; font-weight: 600; border: 2px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; margin-bottom: -2px; }
.tab.on { background: var(--surface); border-color: var(--ink); }
.tab:not(.on):hover { background: var(--cell); }
.tab-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); font-size: 14px; }
.tab.on .tab-n { background: var(--marker); border-color: var(--ink); color: #1A2147; }
.ok { color: var(--green); font-size: 14px; }
.hint-line { color: var(--ink-2); font-size: 15px; }

/* презентация */
.deck { position: relative; background: var(--surface); border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; outline: none; }
.deck:focus-visible { box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 35%, transparent); }
.deck-stage { aspect-ratio: 16 / 9; position: relative; container-type: size; cursor: pointer;
  background-image: linear-gradient(var(--cell) 1px, transparent 1px), linear-gradient(90deg, var(--cell) 1px, transparent 1px);
  background-size: 2.5cqw 2.5cqw; }
.slide { position: absolute; inset: 0; padding: 5cqh 6cqw; display: flex; flex-direction: column; overflow: auto; font-size: 2.35cqw; line-height: 1.42; cursor: default; }
.slide[hidden] { display: none; }
.s-title { font-size: 3.8cqw; margin: 0 0 .6em; padding-bottom: .25em; border-bottom: .35cqw solid var(--ink); align-self: flex-start; }
.s-lead { margin: 0 0 .7em; font-size: 1.05em; }
.s-hero { font-size: 6cqw; line-height: 1.05; margin: auto 0 .35em; max-width: 85%; font-weight: 800; }
.l-title { justify-content: flex-end; padding-bottom: 12cqh; }
.s-badge { position: absolute; right: 7cqw; top: 9cqh; width: 17cqw; height: 17cqw; border: .6cqw solid var(--ink); border-radius: 22%; transform: rotate(8deg); background: var(--marker); display: grid; place-items: center; font: 800 9cqw/1 var(--f-head); color: #1A2147; }
.s-kicker { font: 600 1.1em var(--f-body); color: var(--ink-2); margin: 0 0 .3em; }
.s-sub { font-size: 1.25em; color: var(--ink-2); margin: 0; max-width: 70%; }
.s-body.with-art { display: grid; grid-template-columns: 1fr auto; gap: 3cqw; align-items: center; }
.s-art { font-size: 13cqw; line-height: 1; }
.s-bullets { margin: 0; padding-left: 1.1em; }
.s-bullets li { margin-bottom: .45em; }
.s-bullets li::marker { color: var(--red); }
.slide b, .s-html b { background: linear-gradient(transparent 55%, var(--marker) 55%); padding: 0 .1em; color: inherit; }
.s-cards { display: grid; gap: 1.6cqw; grid-template-columns: repeat(3, 1fr); }
.s-cards.c2, .s-cards.c4 { grid-template-columns: repeat(2, 1fr); }
.s-cards.c5, .s-cards.c6 { grid-template-columns: repeat(3, 1fr); }
.s-card { border: .25cqw solid var(--ink); border-radius: 1.2cqw; padding: 1.2cqw 1.5cqw; background: var(--surface); display: grid; grid-template-columns: auto 1fr; column-gap: .5em; align-content: start; font-size: .9em; line-height: 1.32; }
.s-card > span:last-child { grid-column: 1 / -1; }
.s-cards.c5 .s-card, .s-cards.c6 .s-card { font-size: .8em; }
.s-card b { background: none; font-family: var(--f-head); font-size: 1em; color: var(--ink); }
.s-card span { color: var(--text); }
.s-icon { font-size: 1.5em; line-height: 1; align-self: center; }
.s-card b { align-self: center; }
.s-table { border-collapse: collapse; width: 100%; font-size: .92em; background: var(--surface); }
.s-table th, .s-table td { border: .2cqw solid var(--ink); padding: .35em .6em; text-align: left; vertical-align: top; }
.s-table th { background: var(--ink); color: var(--surface); font-weight: 600; }
.s-big { font: 700 4.4cqw/1.25 var(--f-head); color: var(--ink); margin: auto 0 .4em; max-width: 90%; }
.s-caption { color: var(--ink-2); margin: 0 0 auto; font-size: 1.05em; max-width: 80%; }
.s-split { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; }
.s-col { border-top: .35cqw solid var(--ink); padding-top: .6em; }
.s-col h4 { font-size: 1.1em; }
.s-q { font-size: 1.35em; font-weight: 600; margin: 0 0 1em; }
.s-a { font-size: 1.2em; background: var(--green-bg); border-left: .5cqw solid var(--green); padding: .6em .9em; border-radius: .6cqw; }
.slide .btn { font-size: .8em; align-self: flex-start; }
.s-notes { position: absolute; left: 0; right: 0; bottom: 0; background: var(--amber-bg); color: var(--text); padding: 1cqh 3cqw; font-size: 1.55cqw; border-top: 2px solid var(--marker); max-height: 34%; overflow: auto; }
.s-notes b { background: none; }
.s-html { font-size: 1em; }
.deck-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 2px solid var(--ink); background: var(--surface); }
.dbtn { font: 600 15px var(--f-body); min-width: 40px; height: 36px; padding: 0 10px; border: 2px solid var(--ink); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-grid; place-items: center; }
.dbtn.prev, .dbtn.next { font-size: 22px; }
.dbtn:disabled { opacity: .35; cursor: default; }
.dbtn.on { background: var(--marker); color: #1A2147; }
.deck-count { font-size: 15px; color: var(--ink-2); min-width: 54px; text-align: center; }
.deck-progress { flex: 1; height: 6px; background: var(--cell); border-radius: 3px; overflow: hidden; }
.deck-progress span { display: block; height: 100%; background: var(--ink); width: 0; transition: width .25s; }
.deck:fullscreen { border: 0; border-radius: 0; display: flex; flex-direction: column; justify-content: center; background: var(--surface); }
.deck:fullscreen .deck-stage { width: min(100vw, calc((100vh - 56px) * 16 / 9)); margin: auto; }
body.present { background: var(--surface); overflow: hidden; }
.deck.full { position: fixed; inset: 0; border: 0; border-radius: 0; display: flex; flex-direction: column; }
.deck.full .deck-stage { width: min(100vw, calc((100vh - 56px) * 16 / 9)); margin: auto; }

/* мини-макеты внутри слайдов */
.mock-msg { background: var(--surface); border: .25cqw solid var(--line); border-radius: 1.4cqw; padding: 1.2cqw 1.6cqw; max-width: 62cqw; font-size: .95em; box-shadow: .5cqw .5cqw 0 var(--cell); }
.mock-msg .from { font-size: .8em; color: var(--ink-2); }
.mock-msg .flag { color: var(--red); font-weight: 700; border-bottom: .25cqw dashed var(--red); }
.flags { display: flex; flex-wrap: wrap; gap: .5em; margin-top: .8em; padding: 0; list-style: none; font-size: .85em; }
.flags li { border: .2cqw solid var(--red); color: var(--red); border-radius: 2em; padding: .15em .7em; }
.addr { display: flex; align-items: flex-end; justify-content: center; gap: 0; font: 700 5.2cqw var(--f-head); margin: 4cqh 0 2cqh; flex-wrap: wrap; }
.addr span { display: flex; flex-direction: column; align-items: center; }
.addr small { font: 500 1.7cqw var(--f-body); color: var(--ink-2); margin-top: .5em; border-top: .25cqw solid currentColor; padding-top: .3em; }
.addr .u { color: var(--ink); } .addr .at { color: var(--red); } .addr .d { color: var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: .5em; }
.chips span { border: .2cqw solid var(--ink); border-radius: .8cqw; padding: .25em .7em; background: var(--surface); }
.timeline { display: flex; justify-content: space-between; gap: .6em; margin-top: 2cqh; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 3.2cqw; height: .3cqw; background: var(--ink); }
.timeline div { position: relative; text-align: center; flex: 1; font-size: .78em; }
.timeline i { display: block; font-style: normal; font-size: 2.6em; line-height: 1.25; background: var(--surface); width: 6.4cqw; height: 6.4cqw; margin: 0 auto .3em; border: .25cqw solid var(--ink); border-radius: 50%; display: grid; place-items: center; font-size: 3.4cqw; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 2cqw; align-items: center; text-align: center; }
.vs .box { border: .3cqw solid var(--ink); border-radius: 1.2cqw; padding: 1.5cqw; background: var(--surface); }
.vs .box .big { font: 800 5cqw var(--f-head); color: var(--ink); display: block; }
.vs .arrow { font: 700 3cqw var(--f-head); color: var(--red); }

/* практика и тест */
.practice > h2, .test > h2 { font-size: 26px; }
.lead { font-size: 18px; max-width: 46em; }
.part { background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 22px 24px; margin: 22px 0; }
.part-head h3 { font-size: 20px; margin: 4px 0 8px; }
.part-kind { display: inline-block; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--marker); padding: 2px 10px; border-radius: 4px; }
.part-upload .part-kind { background: var(--cell); }
.part-instruction .part-kind { background: var(--green-bg); color: var(--green); }
.steps-list { padding-left: 1.4em; max-width: 50em; }
.steps-list li { margin-bottom: 8px; padding-left: 4px; }
.steps-list li::marker { font-weight: 700; color: var(--ink); }
.tip { background: var(--amber-bg); padding: 10px 14px; border-radius: 8px; max-width: 50em; }
.task { border: 0; border-top: 1px dashed var(--line); margin: 0; padding: 20px 0 16px; min-width: 0; }
.task:first-of-type { border-top: 0; }
.task legend { display: flex; gap: 12px; padding: 0; margin-bottom: 12px; font-weight: 600; font-size: 18px; float: left; width: 100%; }
.task legend + * { clear: both; }
.task-n { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--ink); color: var(--surface); font: 700 14px var(--f-head); }
.task-media { clear: both; margin: 0 0 12px 42px; }
.task-tip { font-size: 14px; color: var(--ink-2); margin: 6px 0 0 42px; }
.opts { display: grid; gap: 6px; margin-left: 42px; clear: both; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 400; }
.opt:hover { border-color: var(--ink); }
.opt input { margin-top: 5px; accent-color: var(--ink); width: 17px; height: 17px; flex: none; }
.opt:has(input:checked) { border-color: var(--ink); background: color-mix(in srgb, var(--marker) 35%, var(--surface)); }
.inp { display: flex; align-items: center; gap: 10px; margin-left: 42px; max-width: 420px; clear: both; }
.unit { color: var(--ink-2); white-space: nowrap; }
.rows { display: grid; gap: 6px; margin-left: 42px; clear: both; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--line); }
.row-l { font-weight: 500; }
.row-ok { border-color: var(--green); background: var(--green-bg); }
.row-bad { border-color: var(--red); background: var(--red-bg); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { position: relative; font-weight: 500; font-size: 15px; }
.pill input { position: absolute; opacity: 0; inset: 0; }
.pill span { display: inline-block; padding: 5px 12px; border: 1.5px solid var(--line); border-radius: 20px; cursor: pointer; background: var(--surface); }
.pill:hover span { border-color: var(--ink); }
.pill input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.pill input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } .opts, .rows, .inp, .task-media, .task-tip { margin-left: 0; } }
.order { list-style: none; counter-reset: o; margin: 0 0 0 42px; padding: 0; display: grid; gap: 6px; max-width: 640px; clear: both; }
.order li { counter-increment: o; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); }
.order li::before { content: counter(o); font: 700 14px var(--f-head); color: var(--ink-2); width: 18px; }
.order li.moved { background: var(--amber-bg); }
.ord-t { flex: 1; }
.ord-b { display: flex; gap: 4px; }
.ord-b button { width: 34px; height: 30px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 12px; }
.ord-b button:hover { background: var(--cell); }
.fb { margin-left: 42px; margin-top: 10px; font-size: 16px; }
.fb:empty { display: none; }
.task.good .fb { color: var(--green); }
.task.bad .fb { color: var(--red); }
.task.part .fb { color: #9A6B00; }
.task.good .task-n { background: var(--green); }
.task.bad .task-n { background: var(--red); }
.task.part .task-n { background: #C99000; }
.taskset-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 16px; border-top: 2px solid var(--ink); margin-top: 8px; }
.result { color: var(--ink-2); }
.result b { color: var(--ink); }
.drop { display: grid; gap: 4px; border: 2px dashed var(--ink); border-radius: 12px; padding: 18px; text-align: center; cursor: pointer; margin-bottom: 12px; background: var(--paper); }
.drop input { margin: 6px auto 0; font-size: 15px; }
.drop-t { font-weight: 700; color: var(--ink); }
.drop-s { font-size: 14px; color: var(--ink-2); }
.upload { max-width: 520px; }
.subs { list-style: none; padding: 0; margin: 16px 0 0; }
.subs li { padding: 8px 0; border-top: 1px dashed var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.teacher-comment { flex-basis: 100%; margin: 4px 0 0; padding: 8px 12px; border-left: 3px solid var(--red); color: var(--red); font-style: italic; background: var(--red-bg); border-radius: 0 8px 8px 0; }
.next-line { text-align: right; }
.attempt { display: flex; gap: 14px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.attempt span:first-child { color: var(--ink-2); flex: 1; }
.test-result { display: flex; gap: 24px; align-items: center; padding: 24px; background: var(--surface); border: 2px solid var(--ink); border-radius: 14px; margin: 16px 0; box-shadow: 6px 6px 0 var(--ink); font-size: 18px; }
.homework { margin-top: 30px; padding: 18px 22px; border: 2px solid var(--ink); border-radius: 14px; background: var(--surface); }
.homework h3 { margin-bottom: 6px; }
.homework p { margin: 0; }

/* таблицы учителя */
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.tbl .num { width: 44px; text-align: center; font-weight: 700; color: var(--ink); }
.tbl .cls { width: 70px; text-align: center; }
.tbl .actions { display: flex; gap: 14px; align-items: center; }
.tbl .actions form { margin: 0; }
.more summary { cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.more[open] { position: relative; }
.more[open] form { position: absolute; right: 0; top: 28px; z-index: 5; background: var(--surface); border: 2px solid var(--ink); border-radius: 12px; padding: 14px; width: 280px; box-shadow: 4px 4px 0 var(--ink); }
.switch { width: 46px; height: 26px; border-radius: 13px; border: 2px solid var(--ink); background: var(--surface); position: relative; cursor: pointer; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--line); transition: left .15s; }
.switch.on { background: var(--marker); }
.switch.on::after { left: 23px; background: var(--ink); }
.class-list { list-style: none; padding: 0; margin: 0; }
.class-list li { display: flex; gap: 16px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.class-name { font: 700 20px var(--f-head); text-decoration: none; min-width: 64px; }
.feed li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; }
.seg a { padding: 7px 14px; text-decoration: none; font-weight: 600; }
.seg a.on { background: var(--ink); color: var(--surface); }

/* журнал */
.legend { font-size: 14px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.journal-wrap { overflow-x: auto; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; }
.journal { border-collapse: collapse; min-width: 100%; }
.journal th, .journal td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; }
.journal thead th { padding: 10px 12px; text-align: left; vertical-align: bottom; min-width: 150px; font-size: 14px; }
.journal thead th a { font-family: var(--f-head); font-size: 14px; text-decoration: none; }
.th-sub { display: block; font-weight: 400; color: var(--ink-2); font-size: 12px; line-height: 1.3; margin-top: 2px; }
.journal th.who { position: sticky; left: 0; background: var(--surface); padding: 10px 14px; text-align: left; font-weight: 500; white-space: nowrap; z-index: 1; min-width: 200px; }
.journal tbody th.who { padding: 0 14px; height: 49px; }
.cell { display: flex; gap: 8px; align-items: center; padding: 10px 12px; text-decoration: none; min-height: 48px; }
.cell:hover { background: var(--cell); }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); display: inline-block; flex: none; }
.dot.on { background: var(--green); border-color: var(--green); }
.pct { font-size: 13px; font-weight: 600; color: var(--ink); background: var(--cell); padding: 1px 6px; border-radius: 4px; }
.fileflag { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; background: var(--marker); color: #1A2147; font-weight: 700; font-size: 13px; }

/* проверка */
.sub-row { display: grid; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.grade-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grade-form input[name=comment] { flex: 1; min-width: 220px; }
.grade-pick { display: flex; gap: 6px; }
.gp { position: relative; }
.gp input { position: absolute; opacity: 0; }
.gp span { display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--line); border-radius: 50%; font: 700 18px var(--f-head); color: var(--ink-2); cursor: pointer; }
.gp input:checked + span { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.gp input:focus-visible + span { outline: 3px solid var(--focus); }
.review { padding-left: 1.3em; }
.review li { margin-bottom: 10px; padding: 6px 10px; border-left: 4px solid var(--line); }
.review li.good { border-color: var(--green); }
.review li.bad { border-color: var(--red); }
.review li.part { border-color: #C99000; }
.attempt-d { margin-bottom: 10px; }
.attempt-d summary { cursor: pointer; display: flex; gap: 10px; align-items: center; font-weight: 600; }

/* карточки входа */
.cards-print { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 20px; }
.login-card { border: 2px dashed var(--ink); border-radius: 10px; padding: 14px 16px; background: var(--surface); break-inside: avoid; }
.lc-name { font-weight: 700; font-size: 17px; }
.lc-site { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.lc-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.lc-row code { font-size: 19px; font-weight: 700; background: none; letter-spacing: .04em; }
@media print {
  body { background: #fff; }
  .top, .noprint, .flash { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .cards-print { grid-template-columns: repeat(3, 1fr); gap: 6mm; }
  .login-card { border-color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* автопроверка */
.report { flex-basis: 100%; margin: 8px 0 4px; padding: 12px 16px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); }
.report.auto { border-color: var(--green); background: var(--green-bg); }
.report.review { border-color: #C99000; background: var(--amber-bg); }
.report-head { margin: 0 0 6px; }
.reasons { margin: 0 0 8px; padding-left: 1.2em; }
.reasons li { margin-bottom: 2px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.ck-ic { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; font-weight: 700; font-size: 13px; color: #fff; background: var(--ink-2); }
.ck-pass .ck-ic { background: var(--green); }
.ck-fail .ck-ic { background: var(--red); }
.ck-partial .ck-ic { background: #C99000; }
.ck-unsure .ck-ic { background: var(--ink); }
.ck-n { color: var(--ink-2); }
.criteria { margin: 0 0 14px; max-width: 50em; }
.criteria summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.criteria ul { margin: 6px 0; }
.subs li.older { opacity: .7; }
.tag.warn { background: var(--amber-bg); color: #8A5A00; font-weight: 600; }
.ac-why { display: block; font-size: 13px; color: var(--ink-2); max-width: 280px; margin-top: 2px; }
.fileflag.review { background: var(--red); color: #fff; }
.mark.auto { border-style: solid; opacity: .85; }
form.inline { display: inline; margin: 0; }
.report li, .report.review li { border-left: 0; padding: 0; margin-bottom: 4px; }
.report .checks li { margin-bottom: 0; }

/* раздел «Развитие» */
.hub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .hub { grid-template-columns: 1fr; } }
.hub-card { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 2px solid var(--ink); border-radius: 16px; padding: 22px; text-decoration: none; color: var(--text); box-shadow: 5px 5px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.hub-card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.hub-card h2 { margin: 8px 0 0; font-size: 20px; }
.hub-card p { margin: 0; }
.hub-stat { margin-top: auto !important; padding-top: 10px; color: var(--ink-2); font-size: 15px; }
.hub-art { height: 64px; display: flex; gap: 6px; align-items: center; color: var(--ink); }
.hub-art .kc { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 8px; font: 700 18px var(--f-head); box-shadow: 0 3px 0 var(--ink); }
.hub-art .kc.hl { background: var(--marker); }
.hub-art.draw svg { height: 60px; width: auto; }
.hub-art.ai { font: 800 40px var(--f-head); width: 72px; justify-content: center; border-radius: 14px; background: var(--ink); color: var(--marker); }
.levels { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.level { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.level.done { border-color: var(--green); }
.level.locked { opacity: .55; }
.lv-n { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 8px; background: var(--ink); color: var(--surface); font: 700 15px var(--f-head); }
.level.done .lv-n { background: var(--green); }
.level.locked .lv-n { background: var(--line); color: var(--ink-2); }
.lv-body { flex: 1; display: flex; flex-direction: column; }
.lv-title { font-weight: 600; font-size: 17px; }
.top { padding-left: 1.4em; margin: 0 0 8px; }
.top li { padding: 4px 0; }
.top li span { display: inline-block; min-width: 70%; }
.goal { display: grid; text-align: center; border: 2px solid var(--ink); border-radius: 12px; padding: 8px 18px; background: var(--surface); font-size: 13px; color: var(--ink-2); }
.goal b { font: 800 30px/1.1 var(--f-head); color: var(--ink); }
.trainer { background: var(--surface); border: 2px solid var(--ink); border-radius: 16px; padding: 20px; }
.tr-stats { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; font-size: 15px; color: var(--ink-2); margin-bottom: 14px; }
.tr-stats b { font: 700 20px var(--f-head); color: var(--ink); }
.tr-prog { flex: 1; min-width: 120px; height: 8px; background: var(--cell); border-radius: 4px; overflow: hidden; }
.tr-prog span { display: block; height: 100%; background: var(--green); width: 0; transition: width .2s; }
.tr-text { font: 500 30px/1.6 "Consolas", "SFMono-Regular", monospace; letter-spacing: .02em; padding: 18px 20px; border: 2px dashed var(--line); border-radius: 12px; background: var(--paper); outline: none; min-height: 120px; word-break: break-word; cursor: text; }
.trainer.focused .tr-text { border-color: var(--ink); border-style: solid; }
.ch { color: var(--ink-2); opacity: .7; border-radius: 3px; }
.ch.sp { padding: 0 .02em; }
.ch.ok { color: var(--green); opacity: 1; }
.ch.fixed { color: #B07800; opacity: 1; }
.ch.cur { background: var(--marker); color: #1A2147; opacity: 1; box-shadow: 0 3px 0 var(--ink); }
.ch.bad { background: var(--red); color: #fff; }
.tr-hint { min-height: 1.5em; color: var(--red); font-weight: 600; margin: 10px 0; }
.kbd { display: grid; gap: 5px; justify-content: center; margin-top: 6px; user-select: none; }
.kr { display: flex; gap: 5px; justify-content: center; }
.k { display: grid; place-items: center; width: 44px; height: 42px; border-radius: 7px; border: 1.5px solid rgba(0,0,0,.18); font: 600 15px var(--f-body); color: #1A2147; position: relative; }
.k.mid { width: 64px; font-size: 12px; background: var(--cell); }
.k.wide { width: 90px; font-size: 13px; }
.k.space { width: 320px; font-size: 13px; }
.k.bump::after { content: ""; position: absolute; bottom: 6px; width: 12px; height: 2px; background: currentColor; border-radius: 1px; }
.k.next { outline: 3px solid var(--ink); outline-offset: 1px; transform: translateY(-2px); box-shadow: 0 4px 0 var(--ink); font-weight: 800; }
.f-l5, .f-r5 { background: #FDE2E4; } .f-l4, .f-r4 { background: #FFF1C2; } .f-l3, .f-r3 { background: #D8F3DC; } .f-l2, .f-r2 { background: #DCE6FF; } .f-th { background: #EEE3FF; }
.kbd-legend { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; font-size: 12px; margin: 8px 0 0; }
.kbd-legend span { padding: 2px 8px; border-radius: 4px; color: #1A2147; }
@media (max-width: 760px) { .k { width: 24px; height: 30px; font-size: 11px; } .k.mid { width: 34px; } .k.wide { width: 46px; } .k.space { width: 160px; } .tr-text { font-size: 20px; } }
.tr-result { display: flex; gap: 22px; align-items: center; margin-top: 16px; padding: 18px 22px; border-radius: 14px; border: 2px solid var(--ink); }
.tr-result.win { background: var(--green-bg); border-color: var(--green); }
.tr-result.try { background: var(--amber-bg); }
.tr-big { font: 800 48px/1 var(--f-head); color: var(--ink); text-align: center; }
.tr-big small { display: block; font: 500 14px var(--f-body); color: var(--ink-2); }
.tr-actions { margin: 12px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.tasks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 18px 0 30px; }
.task-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 16px; text-decoration: none; color: var(--text); }
.task-card:hover { border-color: var(--ink); }
.task-card b { font-family: var(--f-head); color: var(--ink); }
.task-card span:last-child { font-size: 15px; color: var(--ink-2); }
.tc-emoji { font-size: 34px; }
.sec { margin-top: 30px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.gallery figure { margin: 0; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.gallery img { display: block; width: 100%; aspect-ratio: 8/5; object-fit: cover; background: #fff; border-bottom: 1px solid var(--line); }
.gallery figcaption { padding: 8px 12px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.t-gallery { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.dr-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; width: 100%; }
.dr-form input[name=comment] { flex: 1; min-width: 120px; padding: 5px 8px; font-size: 14px; }
.grade-pick.sm .gp span { width: 30px; height: 30px; font-size: 14px; }
.paint { background: var(--surface); border: 2px solid var(--ink); border-radius: 16px; overflow: hidden; }
.p-tools { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 10px 12px; border-bottom: 2px solid var(--ink); align-items: center; background: var(--paper); }
.p-group { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.p-group button { display: grid; justify-items: center; gap: 1px; min-width: 52px; padding: 4px 6px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 18px; color: var(--ink); line-height: 1.1; }
.p-group button span { font-size: 11px; color: var(--ink-2); }
.p-group button.on { background: var(--marker); border-color: var(--ink); }
.p-group button:hover { border-color: var(--ink); }
.p-size { display: flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 500; }
.p-size b { min-width: 22px; }
.p-check { display: flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 500; }
.p-palette { display: grid; grid-template-columns: repeat(8, 20px); gap: 3px; }
.p-palette button { width: 20px; height: 20px; min-width: 0; padding: 0; border: 1px solid rgba(0,0,0,.3); border-radius: 4px; }
.p-palette button.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.p-custom input { width: 34px; height: 34px; padding: 0; border: 1.5px solid var(--line); border-radius: 6px; cursor: pointer; }
.p-current { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); }
.p-stage { position: relative; background: #e9edf5; padding: 12px; }
.p-stage canvas { display: block; width: 100%; height: auto; aspect-ratio: 960/600; }
#p-main { background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.15); }
.p-stage { display: flex; justify-content: center; }
.p-wrap { position: relative; width: min(100%, calc((100vh - 300px) * 1.6)); min-width: 280px; }
#p-over { position: absolute; inset: 0; width: 100%; touch-action: none; cursor: crosshair; }
.p-grid { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(34,48,122,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(34,48,122,.25) 1px, transparent 1px); }
.p-textin { position: absolute; z-index: 3; font: 600 18px var(--f-body); padding: 4px 8px; border: 2px solid var(--ink); border-radius: 6px; width: 260px; }
.p-foot { display: flex; gap: 10px; align-items: center; padding: 12px; border-top: 2px solid var(--ink); flex-wrap: wrap; }
.p-msg { color: var(--ink-2); }
.posts { display: grid; gap: 12px; max-width: 820px; }
.post-card { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 16px 18px; text-decoration: none; color: var(--text); }
.post-card:hover { border-color: var(--ink); }
.post-card.draft { border-style: dashed; }
.pc-emoji { font-size: 38px; line-height: 1; }
.pc-body { display: grid; gap: 4px; }
.pc-body b { font: 700 19px var(--f-head); color: var(--ink); }
.pc-meta { font-size: 13px; color: var(--ink-2); }
.article { max-width: 720px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 30px 36px; }
.art-emoji { font-size: 48px; }
.article h1 { margin-top: 8px; }
.art-lead { font-size: 19px; color: var(--ink-2); }
.art-body { font-size: 18px; line-height: 1.65; }
.art-body h2 { font-size: 22px; margin-top: 1.4em; }
.art-body blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 5px solid var(--marker); background: var(--amber-bg); border-radius: 0 10px 10px 0; font-weight: 600; }
.art-body ul { padding-left: 1.3em; }
.art-body li { margin-bottom: 4px; }
.art-foot { display: flex; gap: 14px; align-items: center; margin-top: 24px; padding-top: 16px; border-top: 1.5px solid var(--line); }
.like { font: 700 18px var(--f-body); padding: 8px 16px; border: 2px solid var(--red); color: var(--red); background: var(--surface); border-radius: 22px; cursor: pointer; }
.like.on { background: var(--red); color: #fff; }
.more-posts { max-width: 720px; margin-top: 24px; display: grid; gap: 6px; }
.more-posts h2 { font-size: 18px; }
.row-2 { display: flex; gap: 12px; } .row-2 label:first-child { width: 90px; } .row-2 .grow { flex: 1; }
.typing-tbl td.tc { text-align: center; font-size: 14px; min-width: 40px; }
.typing-tbl th { text-align: center; }
.typing-tbl td.tc.ok { background: var(--green-bg); color: var(--green); font-weight: 700; }
.typing-tbl td.tc.try { background: var(--amber-bg); }

.tr-result[hidden] { display: none; }
.tr-hint { color: var(--ink-2); font-weight: 500; }
.tr-hint.warn { color: var(--red); font-weight: 600; }
.p-save-group { margin-left: auto; }
.p-group button.btn { display: inline-flex; font-size: 15px; padding: 10px 16px; min-width: 0; background: var(--ink); color: var(--surface); border-color: var(--ink); }
/* рисовалка: курсор, клеточки, полный экран */
#p-over { cursor: none; }
#p-cursor { position: absolute; inset: 0; width: 100%; pointer-events: none; z-index: 2; }
.p-grid { z-index: 1; }
.p-size select { width: auto; padding: 3px 6px; font-size: 14px; }
.p-size input:disabled { opacity: .4; }
.paint:fullscreen { display: flex; flex-direction: column; border: 0; border-radius: 0; background: var(--surface); overflow: auto; }
.paint:fullscreen .p-stage { flex: 1; align-items: center; }
.paint:fullscreen .p-wrap { width: min(100%, calc((100vh - 190px) * 1.6)); }
.p-size + .p-check, .p-check + .p-size, .p-check + .p-check { margin-left: 10px; }
.replica-bar { position: fixed; left: 12px; bottom: 12px; z-index: 50; background: var(--marker); color: #1A2147; font-size: 13px; padding: 5px 12px; font-weight: 600; border-radius: 999px; box-shadow: 0 2px 8px rgba(26,33,71,.18); }
@media print { .replica-bar { display: none; } }
.replica-bar a { color: #1A2147; }
code.token { display: block; word-break: break-all; padding: 10px 12px; font-size: 15px; }
.logo-img { width: 36px; height: 36px; border-radius: 9px; display: block; }
.auth-logo { width: min(320px, 70vw); height: auto; display: block; margin: 8px 0 18px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-logo { mix-blend-mode: normal; } }

/* подвал */
body { display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }
.site-foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; font-size: 14px; color: var(--ink-2); }
.foot-in { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; padding-top: 14px; padding-bottom: 14px; }
.foot-in a { margin-left: auto; font-weight: 600; }
body.present .site-foot { display: none; }
@media print { .site-foot { display: none; } }

/* администратор, куратор */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 0 0 20px; }
.stat { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.stat b { font: 800 30px/1.1 var(--f-head); color: var(--ink); }
.stat span { font-weight: 600; }
.stat small { color: var(--ink-2); font-size: 13px; margin-top: 4px; line-height: 1.35; }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 190px; padding-top: 8px; }
.bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.bar i { display: block; width: 100%; max-width: 30px; min-height: 2px; background: var(--ink); border-radius: 4px 4px 0 0; }
.bar-n { font-size: 12px; color: var(--ink-2); min-height: 16px; }
.bar-l { font-size: 11px; color: var(--ink-2); text-align: center; line-height: 1.2; margin-top: 4px; white-space: nowrap; }
@media (max-width: 640px) { .bar-l { font-size: 9px; } .bars { gap: 3px; } }
.req { display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.req:first-of-type { border-top: 0; }
.req h3 { margin: 0 0 4px; font-size: 18px; }
.req p { margin: 0 0 4px; }
.req-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-dim td { opacity: .6; }
.tbl-wrap { overflow-x: auto; }
.tbl .tag { margin-left: 4px; }
.seg-switch { display: flex; border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.seg-switch a { flex: 1; text-align: center; padding: 8px 10px; text-decoration: none; font-weight: 600; }
.seg-switch a.on { background: var(--ink); color: var(--surface); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.check-line input { width: auto; margin-top: 5px; }
.mt { margin-top: 26px; }
.narrow { max-width: 640px; margin: 30px auto; }
.auth-links { margin: 14px 0 0; color: var(--ink-2); }
.danger-zone { margin-top: 26px; border-color: var(--red); }
.danger-zone summary { cursor: pointer; font-weight: 700; color: var(--red); }
.danger-zone label { font-weight: 500; }
.contacts { display: flex; gap: 36px; align-items: flex-start; flex-wrap: wrap; margin-top: 10px; }
.contacts-logo { width: min(200px, 50vw); height: auto; }
.contacts > div { flex: 1 1 360px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 12px 22px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.facts dt { font-weight: 700; color: var(--ink-2); }
.facts dd { margin: 0; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; gap: 4px; } .facts dd { margin-bottom: 10px; } }

/* регистрация */
.reg { max-width: 860px; margin: 0 auto; }
.reg-head h1 { font-size: clamp(32px, 5vw, 52px); margin: 4px 0 10px; }
.reg-head .lead { max-width: 44em; }
.reg-switch { margin: 22px 0 16px; }
.reg-form { display: grid; gap: 18px; padding: 26px 28px; border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.reg-form fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.reg-form legend { font: 700 16px var(--f-head); color: var(--ink); padding: 0; margin-bottom: 10px; }
.reg-form label { display: block; font-weight: 600; min-width: 0; }
.reg-form input, .reg-form select, .reg-form textarea { width: 100%; margin-top: 6px; }
.reg-form .full { grid-column: 1 / -1; }
.reg-form p.full { margin: -6px 0 0; }
.reg-foot { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
@media (max-width: 640px) {
  .reg-form { padding: 18px 16px; }
  .reg-form fieldset { grid-template-columns: 1fr; }
  .reg-switch { flex-direction: column; }
}

/* восстановление пароля */
.forgot-link { margin: 0; text-align: right; }
.who-helps { margin: 0; padding-left: 20px; }
.who-helps li { margin-bottom: 4px; }
.rc-code { font: 800 clamp(26px, 6vw, 40px)/1.2 ui-monospace, "Consolas", monospace; letter-spacing: .08em; text-align: center;
  background: var(--amber-bg); border: 2px dashed var(--ink); border-radius: var(--radius); padding: 16px 10px; margin: 10px 0 18px; }
.pw-alert { border-color: var(--red); margin-bottom: 20px; }
.pw-row { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; }
@media print { .top, .site-foot, .rc .row-actions, .replica-bar { display: none !important; } .rc { border: 0; box-shadow: none; } }

/* домашний тест */
.mark.hw { border-style: double; border-width: 3px; }
.test.hw .homework { margin-top: 28px; }

/* компактный список уроков в кабинете учителя */
.les-sec { border-top: 1px dashed var(--line); }
.les-sec:last-of-type { border-bottom: 1px dashed var(--line); margin-bottom: 16px; }
.les-sec summary { cursor: pointer; padding: 10px 2px; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; list-style: none; }
.les-sec summary::-webkit-details-marker { display: none; }
.les-sec summary::before { content: "▸"; color: var(--ink-2); margin-right: 6px; }
.les-sec[open] summary::before { content: "▾"; }
.les-sec summary span:first-of-type { flex: 1; }
.les-list { list-style: none; margin: 0 0 10px; padding: 0; max-height: 320px; overflow-y: auto; }
.les-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 15px; }
.les-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.les-p { text-decoration: none; flex: none; }
.grid2 > * { min-width: 0; }

/* редактор уроков */
.ed-state { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.ed-bar { position: sticky; top: 0; z-index: 20; background: var(--paper); padding: 10px 0; border-bottom: 2px solid var(--ink); margin-bottom: 18px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.ed-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.ed-tabs button { border: 2px solid transparent; background: none; padding: 7px 12px; border-radius: 8px; font: 600 15px var(--f-body); color: var(--ink); cursor: pointer; }
.ed-tabs button.on { border-color: var(--ink); background: var(--surface); }
.ed-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ed-status { font-size: 14px; max-width: 420px; }
.ed-status.ok { color: var(--green); } .ed-status.err { color: var(--red); font-weight: 600; } .ed-status.warn { color: #8A5A00; }
.ed-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; display: grid; gap: 10px; }
.ed-card > header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ed-card > header select { width: auto; }
.ed-move { margin-left: auto; display: flex; gap: 4px; }
.ed-move .dbtn { min-width: 32px; }
.ed-move .del { color: var(--red); }
.ed-part { border-color: var(--ink); }
.ef { display: grid; gap: 4px; font-size: 14px; font-weight: 600; min-width: 0; }
.ef span { color: var(--ink-2); }
.ef small { font-weight: 400; color: var(--ink-2); }
.ef input, .ef textarea { width: 100%; font-weight: 400; }
.ef.short input { max-width: 140px; }
.ef.check { display: flex; align-items: center; gap: 8px; }
.ef.check input { width: auto; }
.ed-2, .ed-3 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ed-3 { grid-template-columns: auto 1fr 1fr; align-items: start; }
@media (max-width: 760px) { .ed-2, .ed-3 { grid-template-columns: 1fr; } }
.ed-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 18px; font-weight: 600; }
.ed-err { color: var(--red); font-size: 14px; margin: 0; }
.ed-ac { font-size: 14px; background: var(--cell); padding: 8px 10px; border-radius: 8px; }
.ed-reset { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 20px 0 6px; }
textarea.mono { font: 13px/1.4 ui-monospace, Consolas, monospace; width: 100%; }
.dbtn { cursor: pointer; }
.teacher-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.btn[hidden], [data-after-save][hidden] { display: none !important; }
