:root {
  color-scheme: light;
  --bg: #f5f7fa; --surface: #fff;
  --line: #e3e8f0; --line-soft: #eef1f6;
  --ink: #1b2330; --muted: #6b7480; --muted-2: #8b93a1;
  --brand: #1a4f9c; --brand-dark: #143d7a; --brand-soft: #ebf2fc;
  --ok: #12724a; --bad: #b42318;
  --warn-bg: #fff8e6; --warn-line: #f0e0b8;
  --radius: 12px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20,32,54,.05), 0 6px 18px rgba(20,32,54,.06);
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 "Segoe UI", Roboto, Arial, sans-serif;
       background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 920px; margin: 0 auto; padding: 26px 18px 64px; }

/* шапка */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line);
               position: sticky; top: 0; z-index: 20; }
.hdr { max-width: 920px; margin: 0 auto; padding: 9px 18px; display: flex; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff;
              display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }
.brand-text strong { display: block; font-size: 15.5px; letter-spacing: .01em; }
.brand-text span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.hdr-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.addr { font: 12.5px/1 "Consolas", ui-monospace, monospace; color: var(--muted);
        background: #f1f4f9; border-radius: 6px; padding: 6px 8px; }
.icon-link { font-size: 13px; font-weight: 600; text-decoration: none; color: var(--muted);
        padding: 6px 9px; border-radius: 7px; border: 1px solid var(--line); }
.icon-link:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.icon-link.acct { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        color: var(--ink); background: #f7f9fc; }
.icon-link.warn { color: var(--bad); border-color: #f3cdc9; background: #fdf0ef; }

.site-nav { border-top: 1px solid var(--line-soft); }
.nav-inner { max-width: 920px; margin: 0 auto; padding: 0 18px; display: flex; gap: 4px; overflow-x: auto; }
.nav-inner a { flex: none; padding: 10px 12px; margin-bottom: -1px; text-decoration: none;
        font-size: 14px; font-weight: 600; color: #4b5563; border-bottom: 2px solid transparent; }
.nav-inner a:hover { color: var(--brand); background: var(--brand-soft); }
.nav-inner a.on { color: var(--brand); border-bottom-color: var(--brand); }

/* крошки и заголовки */
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }
.crumbs .sep { color: #c3cad6; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
h1 { font-size: 26px; line-height: 1.25; margin: 6px 0 6px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 26px 0 10px; }
.lede { color: var(--muted); margin: 0 0 4px; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
        color: var(--muted); margin: 30px 0 10px; }
.top { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap;
       border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 20px; }
.subject { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12.5px; }
.badge { background: var(--brand); color: #fff; border-radius: 6px; padding: 2px 9px;
         font-size: 12.5px; font-weight: 700; }

/* кнопки */
button, .btn { font: inherit; font-weight: 600; background: var(--brand); color: #fff; border: 0;
         border-radius: var(--radius-sm); padding: 11px 22px; cursor: pointer; text-decoration: none;
         display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:hover, .btn:hover { background: var(--brand-dark); color: #fff; }
button.ghost, .btn.ghost { background: var(--brand-soft); color: var(--brand); }
button.ghost:hover, .btn.ghost:hover { background: #dfeafa; color: var(--brand-dark); }
.btn.sm, button.sm { padding: 7px 13px; font-size: 13px; }
button.danger, .btn.danger { background: #fdf0ef; color: var(--bad); border: 1px solid #f3cdc9; }
button.danger:hover, .btn.danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
button.link-danger { background: none; border: 0; color: var(--bad); font-size: 13px; font-weight: 600;
        padding: 5px 9px; border-radius: 7px; }
button.link-danger:hover { background: #fdf0ef; color: var(--bad); }
td.row-actions, th.row-actions { text-align: right; width: 1%; white-space: nowrap; }
.danger-zone { border-color: #f3cdc9; background: #fffafa; }
.danger-zone p { margin: 0 0 12px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 26px; }

/* карточки и панели */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 18px; box-shadow: var(--shadow); }
.task { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 16px 18px; margin: 14px 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

/* формы */
.narrow { max-width: 460px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.field label { display: block; margin-bottom: 5px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=number], input[type=password], select, textarea {
        width: 100%; font: inherit; padding: 10px 12px;
        border: 1px solid #cfd6e2; border-radius: 8px; background: #fff; color: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
label { font-size: 14px; }

/* банк */
.classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 14px 0; }
.class-card { display: block; background: var(--surface); border: 1px solid var(--line);
              border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit;
              transition: border-color .15s, box-shadow .15s, transform .15s; }
a.class-card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.class-card b { font-size: 24px; display: block; letter-spacing: -.01em; }
.class-card.empty { border-style: dashed; color: var(--muted-2); background: transparent; }

.topic-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px;
             border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.topic-row:last-child { border-bottom: 0; }
.topic-row label { flex: 1; }
.topic-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
.topic-row input[type=number] { width: 76px; padding: 6px 8px; }
.topic-row.off { color: var(--muted-2); }
.topic-row.all { background: #f4f7fc; padding-left: 14px; }
.topic-row.all label { font-weight: 600; }
.topic-group { border-bottom: 1px solid var(--line-soft); }
.topic-group:last-child { border-bottom: 0; }
.topic-group > summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  cursor: pointer; background: #fbfcfe; list-style: none; }
.topic-group > summary::-webkit-details-marker { display: none; }
.topic-group > summary:hover { background: var(--brand-soft); }
.topic-group > summary .group-name { font-weight: 700; font-size: 14px; letter-spacing: -.01em; }
.topic-group > summary .chev { margin-left: auto; color: var(--muted); font-size: 12px;
  transition: transform .15s ease; }
.topic-group[open] > summary .chev { transform: rotate(180deg); }
.topic-group .topic-row { padding-left: 30px; }
.topic-group .topic-row.all { padding-left: 14px; }

/* шаги */
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.step { font-size: 12.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--line);
        background: var(--surface); border-radius: 999px; padding: 5px 12px; }
.step.on { color: #fff; background: var(--brand); border-color: var(--brand); }
.step.done { color: var(--brand); border-color: #c9dbf6; background: var(--brand-soft); }

/* таблицы */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
              background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
th { background: #f7f9fc; font-size: 12.5px; color: #4b5563; font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td { vertical-align: top; }

.ok { color: var(--ok); font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }
.note { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius);
        padding: 12px 14px; font-size: 14px; margin: 18px 0; }
.note.bad { background: #fdf0ef; border-color: #f3cdc9; color: var(--bad); }

/* вход: две колонки */
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
         padding: 22px; box-shadow: var(--shadow); }
.entry h2 { margin: 4px 0 6px; font-size: 20px; letter-spacing: -.01em; }
.entry-head { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
              color: var(--brand); }
.entry .field { margin-bottom: 10px; }
.entry button { width: 100%; margin-top: 4px; }
@media (max-width: 720px) { .entry-grid { grid-template-columns: 1fr; } }

/* последняя работа */
.class-code { font: 700 22px/1.2 "Consolas", ui-monospace, monospace; letter-spacing: .1em;
              background: #f1f4f9; border: 1px solid var(--line); border-radius: 10px;
              padding: 12px 16px; display: inline-block; }
.mono { font-family: "Consolas", ui-monospace, monospace; }
.work-card { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.work-card h3 { margin: 2px 0 2px; font-size: 17px; }
.progress { height: 7px; border-radius: 999px; background: #e9edf4; overflow: hidden; margin: 12px 0 7px; max-width: 320px; }
.progress i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.work-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* телефон и QR */
.phone-card { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.phone-url { font: 16px/1.3 "Consolas", ui-monospace, monospace; font-weight: 600; color: var(--ink); }
.qr { width: 104px; height: 104px; border: 1px solid var(--line); border-radius: 10px;
      padding: 6px; background: #fff; display: block; }

/* подвал */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; }
.footer-inner { max-width: 920px; margin: 0 auto; padding: 16px 18px; display: flex; gap: 10px;
                flex-wrap: wrap; justify-content: space-between; font-size: 12.5px; color: var(--muted); }

@media (max-width: 560px) {
  .wrap { padding-top: 20px; }
  h1 { font-size: 22px; }
  .work-card, .phone-card { grid-template-columns: 1fr; }
  .work-actions { justify-content: flex-start; }
  .addr { display: none; }
}

/* Код под текстом задания: программа, алгоритм, таблица */
pre.code {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: #f5f7fb;
  border: 1px solid #dde3ec;
  border-radius: 8px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  color: #1c2230;
  white-space: pre;
  overflow-x: auto;
}

/* Проверка работ с бумаги: загрузка сканов */
.upload-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 16px 0; box-shadow: var(--shadow); }
.drop { display: block; border: 2px dashed #c9d4e6; border-radius: var(--radius-sm); padding: 22px;
  text-align: center; cursor: pointer; background: #f8fafd; }
.drop:hover, .drop:focus-within { border-color: var(--brand); background: var(--brand-soft); }
.drop b { display: block; font-size: 15px; margin-bottom: 4px; }
.drop input[type=file] { display: block; margin: 12px auto 0; max-width: 100%; }
.upload-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
details > summary { cursor: pointer; margin-top: 10px; }
details .drop { margin-top: 10px; }

.thumb { width: 64px; height: 84px; object-fit: cover; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; display: block; }
.scan-strip { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.scan-strip .thumb { width: 96px; height: 128px; }
.inline-code { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-code input { width: 120px; }

/* Экран проверки: скан слева, задания справа */
.scan-check { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 20px; align-items: start; }
.scan-col { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; }
.scan-col a { display: block; }
img.scan-img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.check-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mark { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.mark label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.mark .pts { width: 64px; }

@media (max-width: 820px) {
  .scan-check { grid-template-columns: 1fr; }
  .scan-col { position: static; }
}