:root {
  --bg: #fbf7f0;
  --surface: #ffffff;
  --surface-2: #f4eee5;
  --surface-3: #efe8dd;
  --text: #2b2622;
  --muted: #7a7068;
  --faint: #a89d90;
  --border: #ddd3c4;
  --line: #ece4d8;
  --accent: oklch(0.72 0.14 30);
  --accent-dk: oklch(0.56 0.14 30);
  --accent-soft: oklch(0.95 0.03 30);
  --blue: oklch(0.72 0.14 240);
  --blue-dk: oklch(0.5 0.14 240);
  --blue-soft: oklch(0.95 0.035 240);
  --green: oklch(0.72 0.14 150);
  --green-dk: oklch(0.5 0.13 150);
  --yellow: oklch(0.8 0.14 80);
  --yellow-dk: oklch(0.45 0.1 70);
  --yellow-soft: oklch(0.95 0.05 90);
  --ok: oklch(0.6 0.14 150);
  --ok-soft: oklch(0.95 0.04 150);
  --bad: oklch(0.58 0.16 30);
  --bad-soft: oklch(0.95 0.03 30);
  --warn-soft: oklch(0.95 0.05 90);
  --code-bg: #1f1b18;
  --code-text: #efe8dd;
  --radius: 26px;
  --shadow: 0 4px 0 #ece4d8;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Nunito", "Segoe UI Rounded", "SF Pro Rounded", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 30px; line-height: 1.2; margin: 6px 0 16px; }
h2 { font-size: 22px; margin: 0 0 12px; }
h3 { font-size: 18px; margin: 24px 0 8px; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
pre { margin: 12px 0; }
pre code { display: block; background: var(--code-bg); color: var(--code-text); padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 14px; line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- верхняя панель ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 60px; background: var(--surface); border-bottom: 1px solid var(--border); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-dot { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); box-shadow: inset 0 0 0 6px var(--accent), inset 0 0 0 11px #fde047; }
.logo-sub { font-weight: 500; font-size: 14px; color: var(--muted); }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.topnav a:hover { background: var(--surface-2); text-decoration: none; }
.topnav a.active { color: var(--text); background: var(--surface-2); }
.score { margin-left: auto; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 14px; white-space: nowrap; }

/* ---------- раскладка ---------- */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.sidebar { border-right: 1px solid var(--border); background: var(--surface); padding: 16px 12px; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.side-mod { margin-bottom: 14px; }
.side-mod-title { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 4px 10px; font-weight: 600; }
.side-lesson { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--text); font-size: 15px; line-height: 1.3; }
.side-lesson:hover { background: var(--surface-2); text-decoration: none; }
.side-lesson.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-sandbox { display: block; margin-top: 8px; padding: 9px 10px; border-radius: 9px; border: 1px dashed var(--border); color: var(--text); }
.main { padding: 28px 40px 60px; min-width: 0; }

.ring { flex: none; display: inline-flex; align-items: center; justify-content: center; }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 3; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.ring.done { border-radius: 50%; background: var(--ok); color: #fff; font-size: 12px; font-weight: 700; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 14px var(--sans); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.accent { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.big { padding: 12px 20px; font-size: 16px; }
.btn.tiny { padding: 2px 8px; font-size: 12px; }
.linklike { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

/* ---------- главная ---------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; background: var(--accent); color: #fff; border-radius: 32px; box-shadow: 0 5px 0 var(--accent-dk); padding: 32px 36px; margin-bottom: 32px; }
.hero h1 { color: #fff; margin-top: 0; font-size: 34px; }
.hero p { max-width: 560px; opacity: .92; margin: 0 0 20px; }
.hero .btn.primary { background: #fff; color: var(--accent); border-color: #fff; }
.hero-stats { display: grid; gap: 10px; }
.stat { background: rgba(255, 255, 255, .14); border-radius: 12px; padding: 10px 18px; min-width: 160px; }
.stat b { display: block; font-size: 24px; line-height: 1.2; }
.stat span { font-size: 13px; opacity: .85; }
.module { margin-bottom: 28px; }
.module h2 { display: flex; align-items: center; gap: 10px; }
.mod-num { display: inline-flex; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); align-items: center; justify-content: center; font-size: 15px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); color: var(--text); }
a.card:hover { border-color: var(--accent); text-decoration: none; }
.card-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.lesson-card h3 { margin: 10px 0 8px; font-size: 17px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.foot { margin-top: 32px; font-size: 14px; }

/* ---------- урок ---------- */
.lesson { max-width: 820px; }
.lesson.wide { max-width: 1400px; }
.crumbs { font-size: 14px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tab { padding: 10px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab.done::after { content: " ✓"; color: var(--ok); }
.theory { font-size: 17px; }
.theory table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 15px; }
.theory th, .theory td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.theory th { background: var(--surface-2); }
.note { background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; margin: 16px 0; font-size: 15px; }
.note.warn { background: var(--warn-soft); }
.lesson-foot { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

.scheme { margin: 16px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.scheme svg { width: 100%; max-width: 520px; display: block; margin: 0 auto; }
.scheme figcaption { text-align: center; font-size: 14px; color: var(--muted); }
.s-board { fill: #0f766e; }
.s-t { font: 12px var(--sans); fill: var(--text); }
.s-board + .s-t, .s-t.s-r { fill: #fff; }
.s-c { text-anchor: middle; }
.s-r { text-anchor: end; }
.s-sm { font-size: 11px; fill: var(--muted); }
.s-pin { fill: #fde047; }
.s-w { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.s-led { fill: #ef4444; stroke: var(--text); stroke-width: 1.5; }
.s-res { fill: #a16207; stroke: var(--text); stroke-width: 1.5; }
.s-ray { stroke: #ef4444; stroke-width: 2; }

/* ---------- тест ---------- */
.quiz { display: grid; gap: 14px; }
.q { margin: 0; }
.q legend { display: flex; gap: 10px; font-weight: 600; padding: 0; margin-bottom: 8px; float: left; width: 100%; }
.q legend + * { clear: both; }
.q-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 9px; cursor: pointer; clear: both; }
.opt:hover { background: var(--surface-2); }
.opt input { margin-top: 5px; accent-color: var(--accent); }
.q.right { border-color: var(--ok); }
.q.wrong { border-color: var(--bad); }
.q-feedback { font-size: 14px; margin-top: 4px; }
.q.right .q-feedback { color: var(--ok); }
.q.wrong .q-feedback { color: var(--bad); }
.quiz-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ---------- задачи ---------- */
.task-list { display: grid; gap: 10px; }
.task-card { display: flex; align-items: center; gap: 14px; }
.task-n { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.task-card.solved .task-n { background: var(--ok); color: #fff; }
.task-name { font-weight: 600; flex: 1; }
.pts { font-size: 13px; color: var(--accent); background: var(--accent-soft); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.task-layout { display: grid; grid-template-columns: minmax(280px, 2fr) minmax(0, 3fr); gap: 20px; align-items: start; }
.task-left { display: grid; gap: 16px; position: sticky; top: 80px; }
.task-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.task-head h2 { margin: 0; }
.statement p:last-child { margin-bottom: 0; }
.hint summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.verdict { font-weight: 700; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; }
.verdict.ok { background: var(--ok-soft); color: var(--ok); }
.verdict.bad { background: var(--bad-soft); color: var(--bad); }
.checks { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; font-size: 15px; }
.checks li { display: flex; gap: 10px; }
.checks li > span { font-weight: 700; }
.checks .pass > span { color: var(--ok); }
.checks .fail > span { color: var(--bad); }
.check-hint { font-size: 13px; color: var(--muted); }
.err-text { font-family: var(--mono); font-size: 13px; color: var(--bad); }

/* ---------- верстак ---------- */
.task-right, .sandbox-bench { display: grid; gap: 12px; min-width: 0; }
.bench-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bench-status { font-size: 13px; color: var(--muted); }
.bench-bar .btn.ghost { margin-left: auto; }
.bench-error { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: 10px; font-size: 14px; }

.editor { display: flex; height: 380px; background: var(--code-bg); border-radius: 12px; overflow: hidden; font: 14px/1.55 var(--mono); }
.ed-gutter { flex: none; padding: 14px 8px 14px 12px; color: #5c6378; text-align: right; overflow: hidden; user-select: none; min-width: 40px; }
.ed-body { position: relative; flex: 1; min-width: 0; }
.ed-hl, .editor textarea { position: absolute; inset: 0; margin: 0; padding: 14px 16px 14px 6px; font: inherit; white-space: pre; overflow: auto; tab-size: 2; border: 0; }
.ed-hl { pointer-events: none; color: var(--code-text); scrollbar-width: none; }
.ed-hl::-webkit-scrollbar { display: none; }
.ed-hl code { background: none; padding: 0; font-size: inherit; border-radius: 0; }
.editor textarea { background: transparent; color: transparent; caret-color: #fff; resize: none; outline: none; }
.editor textarea::selection { background: rgba(139, 133, 255, .35); color: transparent; }
.c-com { color: #7f8aa3; font-style: italic; }
.c-str { color: #a5e3a1; }
.c-pre { color: #f5a97f; }
.c-num { color: #f5c97f; }
.c-kw { color: #c4a7ff; }
.c-const { color: #7fd1f5; }
.c-fn { color: #82aaff; }

.board { background: #0f766e; border-radius: 14px; padding: 14px 16px; color: #fff; }
.board-title { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; margin-bottom: 10px; }
.leds { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.led { --b: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bulb { width: 30px; height: 30px; border-radius: 50% 50% 40% 40%; background: var(--c); opacity: calc(.22 + .78 * var(--b)); box-shadow: 0 0 calc(22px * var(--b)) calc(6px * var(--b)) var(--c); border: 2px solid rgba(255, 255, 255, .25); }
.lbl { font: 12px var(--mono); opacity: .85; }
.inputs { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.hw-btn { display: flex; flex-direction: column; align-items: center; padding: 8px 18px; border-radius: 12px; border: 0; background: #e2e8f0; color: #111; font: 700 14px var(--sans); cursor: pointer; box-shadow: 0 4px 0 #94a3b8; user-select: none; touch-action: none; }
.hw-btn small { font-weight: 500; font-size: 11px; color: #475569; }
.hw-btn.down { transform: translateY(3px); box-shadow: 0 1px 0 #94a3b8; background: #cbd5e1; }
.pot { display: flex; align-items: center; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.pot input { width: 180px; accent-color: #fde047; }
.pot output { font: 13px var(--mono); min-width: 36px; }

.serial { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.serial-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; font-size: 13px; font-weight: 600; background: var(--surface-2); }
.serial-out { margin: 0; height: 140px; overflow-y: auto; padding: 10px 12px; font: 13px/1.45 var(--mono); white-space: pre-wrap; }

/* ---------- мобильная версия ---------- */
@media (max-width: 1100px) {
  .task-layout { grid-template-columns: 1fr; }
  .task-left { position: static; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 20px 16px 48px; }
  .topbar { padding: 0 16px; gap: 12px; }
  .logo-sub { display: none; }
  .hero { grid-template-columns: 1fr; padding: 24px; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .stat { min-width: 0; padding: 8px 10px; }
  .stat b { font-size: 20px; }
  h1 { font-size: 26px; }
  .editor { height: 320px; }
}
@media (max-width: 480px) {
  .score { font-size: 13px; padding: 4px 10px; }
  .score-max { display: none; }
  .logo { font-size: 18px; }
  .topnav a { padding: 6px 8px; }
}

/* ================== v3: кабинеты, песочница ================== */
.layout.no-side { grid-template-columns: minmax(0, 1fr); }
.layout.no-side .sidebar { display: none; }
.topnav { flex-wrap: nowrap; overflow-x: auto; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.userchip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer; color: var(--text); font: 500 14px var(--sans); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.uname { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page { max-width: 980px; }
.page.wide { max-width: 1400px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); }
.note a { font-weight: 600; }
.btn.danger { color: var(--bad); }
.btn.glass { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.35); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #111827; color: #fff; padding: 10px 18px; border-radius: 10px; opacity: 0; transition: .25s; z-index: 100; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: #15803d; } .toast.bad { background: #b91c1c; }
.modal-wrap { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 16px; padding: 22px 24px; width: min(720px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h2 { margin-top: 0; }
.answers { list-style: none; padding: 0; display: grid; gap: 6px; }
.answers li { padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }
.answers li.right { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.answers li.chosen:not(.right) { background: var(--bad-soft); color: var(--bad); }

/* формы */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.form label.check { display: flex; gap: 8px; font-weight: 500; align-items: center; }
input, select, textarea { font: 15px var(--sans); padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.form-err { background: var(--bad-soft); color: var(--bad); padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.auth { max-width: 440px; margin: 40px auto; }
.auth h1 { margin-top: 0; }
.tl label { flex: 1; min-width: 150px; }

/* кабинет ученика */
.kind { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.k-homework { background: var(--accent-soft); color: var(--accent); }
.k-test { background: #fff3d6; color: #a16207; }
.k-control { background: var(--bad-soft); color: var(--bad); }
.st { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.st.done { background: var(--ok-soft); color: var(--ok); }
.st.prog { background: #fff3d6; color: #a16207; }
.st.late { background: var(--bad-soft); color: var(--bad); }
.st.new { background: var(--accent-soft); color: var(--accent); }
.asg-card h3 { margin: 8px 0 4px; }
.asg-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.asg-score { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.asg-score .bar { flex: 1; }
.mark { display: inline-flex; width: 26px; height: 26px; border-radius: 7px; align-items: center; justify-content: center; font-weight: 800; color: #fff; }
.mark.m5 { background: #16a34a; } .mark.m4 { background: #65a30d; } .mark.m3 { background: #d97706; } .mark.m2 { background: #dc2626; }
.done-list { margin-top: 16px; }
.done-list summary { cursor: pointer; color: var(--muted); margin-bottom: 10px; }
.progress-card { display: flex; align-items: center; gap: 16px; }
.progress-card > div:nth-child(2) { flex: 1; }
.asg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.score-big { font-size: 36px; font-weight: 800; white-space: nowrap; }
.score-big small { font-size: 16px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 18px; }
.pills .pill { width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: 700 14px var(--sans); cursor: pointer; }
.pills .pill.cur { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pills .pill.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.pills .pill.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.pills .pill.ans { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.big-q .q-title { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.info-grid > div { display: grid; gap: 2px; }
.info-grid span { font-size: 13px; }
.start-card { text-align: center; }
.test-bar { position: sticky; top: 60px; z-index: 5; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin-bottom: 6px; }
.test-bar > div:first-child { flex: 1; min-width: 200px; }
.timer { font: 700 20px var(--mono); padding: 4px 10px; border-radius: 8px; background: var(--surface-2); }
.timer.low { background: var(--bad-soft); color: var(--bad); }
#saved.bad { color: var(--bad); }
.test-nav { justify-content: flex-end; margin-top: 16px; }
.features { margin-bottom: 30px; }
.features h3 { margin-top: 0; }

/* кабинет учителя */
.class-card h3 { margin: 0 0 6px; font-size: 22px; }
.class-card.new { display: grid; gap: 8px; border-style: dashed; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 16px; align-items: start; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.tbl th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tbl .actions { white-space: nowrap; text-align: right; }
.scroll-x { overflow-x: auto; }
.journal th a { color: var(--text); }
.tbl .cell { text-align: center; }
.stats .cell { font-weight: 700; min-width: 34px; }
.stats .cell.ok { background: var(--ok-soft); color: var(--ok); }
.stats .cell.bad { background: var(--bad-soft); color: var(--bad); }
.stats tr.sum td { font-weight: 600; color: var(--muted); font-size: 12px; text-align: center; }
.bar.thin { height: 4px; }
.list { display: grid; gap: 8px; }
.asg-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; }
.cred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 14px 0; max-height: 50vh; overflow: auto; }
.cred { border: 1px dashed var(--border); border-radius: 10px; padding: 10px; font-size: 14px; display: grid; gap: 3px; }
.builder { display: grid; grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr); gap: 16px; align-items: start; }
.sel-list { padding-left: 22px; display: grid; gap: 4px; max-height: 300px; overflow: auto; font-size: 14px; margin: 0; }
.sel-list li > * { vertical-align: middle; }
.sel-list li { display: list-item; }
.sel-list li > span:first-child { display: inline; }
.sel-list li .row { float: right; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.filters > * { flex: 1; min-width: 150px; }
.bank-list { display: grid; gap: 4px; max-height: 65vh; overflow-y: auto; margin-top: 8px; }
.bank-item { display: grid; grid-template-columns: auto auto 1fr auto auto auto auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.bank-item:hover { background: var(--surface-2); }
.bank-item.sel { background: var(--accent-soft); }
.bi-title { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lvl { font-size: 10px; letter-spacing: 1px; }
.lvl.l1 { color: #16a34a; } .lvl.l2 { color: #d97706; } .lvl.l3 { color: #dc2626; }
.item-diff { display: grid; gap: 6px; padding-left: 22px; }
.item-diff li { display: grid; grid-template-columns: 1fr 160px 44px; gap: 10px; align-items: center; font-size: 14px; }
.diff-bar { height: 8px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.diff-bar i { display: block; height: 100%; background: var(--ok); }
.diff-bar i.low { background: var(--bad); }
.attempt summary { cursor: pointer; }
.att-item { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.att-item h4 { margin: 0 0 6px; }
.code-view pre { margin: 6px 0; max-height: 320px; overflow: auto; }
.checks.small { font-size: 13px; }

/* стенд */
.sim-frame { position: absolute; width: 0; height: 0; border: 0; visibility: hidden; }
.bench-warn { background: var(--warn-soft); padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.ed-gutter .err { background: var(--bad); color: #fff; border-radius: 3px; }
.buzzer, .servo-ind { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bz { width: 30px; height: 30px; border-radius: 50%; background: #111827; display: flex; align-items: center; justify-content: center; color: #6b7280; }
.buzzer.on .bz { color: #fde047; box-shadow: 0 0 14px #fde047; }
.lcd-ind { margin-bottom: 12px; }
.lcd-ind pre { margin: 0; display: inline-block; background: #4d7c0f; color: #1a2e05; font: 18px/1.3 var(--mono); padding: 8px 12px; border-radius: 6px; min-width: 16ch; min-height: 2.6em; white-space: pre; border: 6px solid #14532d; }
.lcd-ind.light pre { background: #a3e635; }
.serial-in { display: grid; gap: 4px; padding: 8px 12px 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.serial-in textarea { font: 13px var(--mono); padding: 6px 8px; }
.serial-send { display: flex; gap: 6px; padding: 6px 12px 10px; }
.serial-send input { flex: 1; padding: 5px 8px; font: 13px var(--mono); }

/* песочница */
.sbx { display: grid; gap: 10px; }
.sbx-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sbx-bar .sp { flex: 1; }
.sbx-name { font-weight: 700; width: 220px; }
.sbx-main { display: grid; grid-template-columns: 112px minmax(0, 1fr) minmax(320px, 420px); gap: 10px; height: calc(100vh - 160px); min-height: 520px; }
.sbx-pal { overflow-y: auto; display: grid; gap: 4px; align-content: start; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px; }
.pal-item { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid transparent; background: none; border-radius: 8px; padding: 4px 2px; cursor: pointer; font: 11px/1.15 var(--sans); color: var(--text); text-align: center; }
.pal-item:hover { background: var(--surface-2); border-color: var(--border); }
.pal-item svg .leg { stroke: #9ca3af; stroke-width: 2; }
.sbx-canvas { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
#cv { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; outline: none; cursor: grab; }
.gdot { fill: var(--border); }
.sbx-hint { position: absolute; left: 10px; bottom: 8px; right: 10px; font-size: 12px; color: var(--muted); pointer-events: none; }
.sbx-warn { position: absolute; left: 10px; top: 10px; right: 10px; background: var(--warn-soft); border: 1px solid #f59e0b55; padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.sbx-side { display: grid; grid-template-rows: auto auto auto 1fr; gap: 8px; min-height: 0; overflow-y: auto; }
.sbx-insp { padding: 12px 14px; display: grid; gap: 8px; font-size: 14px; }
.sbx-insp label { display: grid; gap: 4px; font-size: 13px; }
.sbx-insp label.check { display: flex; gap: 8px; align-items: center; }
.terms-list { padding-left: 18px; margin: 4px 0; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; }
.swatch.cur { outline: 3px solid var(--accent); }
.sbx .serial-out { height: 110px; }
.part { cursor: move; }
.running .part { cursor: default; }
.running .part.pressable { cursor: pointer; }
.part .leg { stroke: #9ca3af; stroke-width: 2.2; stroke-linecap: round; }
.part .plabel { font: 10px var(--sans); fill: var(--text); }
.part .plabel.light { fill: #fff; }
.part .lcdtext { font: 13px var(--mono); fill: #1a2e05; }
.part .bb { fill: #f5f5f4; stroke: #d6d3d1; }
.part .hole { fill: #a8a29e; }
.part .bbnum { font: 7px var(--sans); fill: #78716c; }
.part .board-name { font: 700 15px var(--sans); fill: #ffffffcc; }
.part .pinlbl { font: 7.5px var(--sans); fill: #ffffffdd; }
.selbox { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
.part.sel .selbox { display: block; }
.term { fill: transparent; stroke: transparent; cursor: crosshair; }
.term:hover { fill: #fde047; stroke: #a16207; }
.term.used { fill: #0000; }
.running .term { pointer-events: none; }
.wire .w-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.wire .w-hit { fill: none; stroke: transparent; stroke-width: 12; cursor: pointer; }
.wire.sel .w-line { stroke-width: 5; filter: drop-shadow(0 0 3px var(--accent)); }
.w-draft { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 6 4; pointer-events: none; }
.proj-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; }
.proj-row.cur { background: var(--accent-soft); }

@media (max-width: 1100px) {
  .builder, .grid-2 { grid-template-columns: 1fr; }
  .sbx-main { grid-template-columns: 1fr; height: auto; }
  .sbx-pal { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); max-height: 170px; }
  .sbx-canvas { height: 60vh; }
}
@media (max-width: 820px) {
  .asg-row { grid-template-columns: 1fr; gap: 4px; }
  .asg-head { flex-direction: column; }
  .uname { display: none; }
  .userchip { padding: 3px; }
  .item-diff li { grid-template-columns: 1fr 70px 40px; }
  .bank-item { grid-template-columns: auto auto 1fr auto auto; }
  .bank-item .muted, .bank-item .lvl { display: none; }
  .test-bar { top: 56px; }
}
@media print {
  body.printing > *:not(.modal-wrap) { display: none !important; }
  body.printing .modal-wrap { position: static; background: none; padding: 0; }
  body.printing .modal { box-shadow: none; width: 100%; }
  body.printing .modal .row, body.printing .modal p { display: none; }
  body.printing .cred-grid { max-height: none; overflow: visible; grid-template-columns: repeat(3, 1fr); }
  body.printing .cred { break-inside: avoid; border: 1px dashed #000; }
}
[hidden] { display: none !important; }
.form input, .form select, .form textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.form .row > label { min-width: 0; }
.builder > * { min-width: 0; }
.form label.check input, .sbx-insp label.check input { width: auto; flex: none; }
.topnav { min-width: 0; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { white-space: nowrap; flex-shrink: 0; }
.userbox { flex-shrink: 0; }
@media (max-width: 480px) { .logo { font-size: 0; gap: 0; } .logo-dot { width: 26px; height: 26px; } }
.modal.wide { width: min(960px, 100%); }
.opt-list, .case-list { display: grid; gap: 6px; margin: 6px 0; }
.opt-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.opt-row input[type=checkbox] { width: 18px; height: 18px; }
.case-row { display: grid; grid-template-columns: 18px 1fr 1fr auto; gap: 8px; align-items: start; }
.case-row textarea { font: 13px var(--mono); }
.custom-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; }
.custom-row:hover { background: var(--surface-2); }
.modal .editor { height: 160px; }
.mode-pick { display: grid; gap: 4px; }
.scen { padding: 12px; display: grid; gap: 10px; background: var(--surface-2); }
.scen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.scen-grid label, .check-ed label { display: grid; gap: 2px; font-size: 12px; font-weight: 600; }
.scen-grid .wide, .check-ed .wide { grid-column: 1 / -1; }
.checks-ed { display: grid; gap: 6px; }
.check-ed { display: grid; grid-template-columns: 200px repeat(auto-fill, minmax(110px, 1fr)) auto; gap: 6px; align-items: end; background: var(--surface); padding: 8px; border-radius: 8px; }
.check-ed input, .check-ed select, .check-ed textarea, .scen-grid input, .scen-grid textarea { padding: 6px 8px; font-size: 13px; }
#standBox { display: grid; gap: 8px; }
@media (max-width: 820px) { .check-ed { grid-template-columns: 1fr 1fr; } }
.spin { animation: spin 1s linear infinite; transform-box: fill-box; transform-origin: center; } .spin.rev { animation-direction: reverse; } @keyframes spin { to { transform: rotate(360deg); } }
/* песочница v2 */
.sbx-pal { grid-template-columns: 1fr; }
.sbx-pal input[type=search] { padding: 6px 8px; font-size: 13px; margin-bottom: 4px; }
.pal-cat { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 8px 4px 2px; }
.pal-item { cursor: grab; touch-action: none; user-select: none; }
.pal-item svg { pointer-events: none; }
.pal-ghost { position: fixed; z-index: 60; pointer-events: none; transform: translate(-50%, -50%) scale(1.4); opacity: .6; filter: grayscale(.4); }
.pal-ghost.over { opacity: .95; filter: none; }
.pal-ghost .leg { stroke: #9ca3af; stroke-width: 2; }
.sbx-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px 6px; box-shadow: var(--shadow); flex-wrap: wrap; max-width: calc(100% - 16px); }
.sbx-tools .sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.wire-colors { display: flex; gap: 3px; margin-right: 4px; }
.wire-colors .swatch { width: 16px; height: 16px; border-width: 1px; }
.sbx-warn { top: 52px; }
.sbx-tip { position: absolute; z-index: 5; pointer-events: none; background: #111827; color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.sbx-hint::after { content: attr(data-count); float: right; }
#cv.panning, #cv:active { cursor: grabbing; }
.hl { fill: #22c55e66; stroke: #16a34a; stroke-width: 1.5; pointer-events: none; }
.plug { fill: #22c55e; stroke: #fff; stroke-width: 1; pointer-events: none; }
.snap-ring { fill: none; stroke: #16a34a; stroke-width: 2.5; pointer-events: none; }
.w-draft { stroke-width: 3; stroke-dasharray: none; opacity: .75; }
.w-handle { fill: #fff; stroke: var(--accent); stroke-width: 2; cursor: move; }
.w-handle.end { fill: var(--accent); }
.wire.sel .w-hit { cursor: copy; }
.boxsel { fill: #e8806a22; stroke: var(--accent); stroke-dasharray: 4 3; pointer-events: none; }
.term { fill: transparent; }
.term:hover { fill: #fde047; stroke: #a16207; stroke-width: 1.5; }
.running .term { display: none; }
@media (hover: none) { .term { fill: #fde04755; } }
.sbx-main { grid-template-columns: 136px minmax(0, 1fr) minmax(320px, 420px); }
.sbx-pal { overflow-x: hidden; }
.sbx-pal input[type=search] { width: 100%; min-width: 0; box-sizing: border-box; }
.pal-item { width: 100%; min-width: 0; }
.pal-item span { width: 100%; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .sbx-main { grid-template-columns: 1fr; } .sbx-pal { display: flex; flex-wrap: wrap; } .pal-item { width: 76px; } .pal-cat { width: 100%; } }
.conflict { fill: none; stroke: #dc2626; stroke-width: 2.5; stroke-dasharray: 3 2; }
.fb-card summary { cursor: pointer; }
.fb-form { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; margin: 6px 0; }
.fb-form textarea { min-height: 38px; font-size: 14px; }
.fb-form input { width: 70px; padding: 5px 6px; }
.fb-list { display: grid; gap: 4px; margin-top: 8px; }
.fb-item { border-top: 1px solid var(--border); padding-top: 8px; }
.fb-show { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 8px; margin: 8px 0; font-size: 14px; white-space: pre-wrap; }
.fb-show.new { background: #fff3d6; border-color: #d97706; color: #1b1f2a; }
.st.fbnew { background: #fff3d6; color: #a16207; }
.pills .pill.has-fb { box-shadow: inset 0 -3px 0 #d97706; }
@media (max-width: 820px) { .fb-form { grid-template-columns: 1fr; } }
.live table td { white-space: nowrap; }
.warn-t { color: var(--bad); font-weight: 600; }
.pix-ind { display: flex; gap: 6px; margin-bottom: 12px; background: #0f172a; padding: 8px 10px; border-radius: 8px; width: max-content; }
.px { width: 22px; height: 22px; border-radius: 4px; background: var(--px); opacity: calc(.25 + .75 * var(--pb)); box-shadow: 0 0 calc(14px * var(--pb)) var(--px); border: 1px solid #ffffff22; }
.step-ind { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 0 10px 12px; }
.lvl-card { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
.lvl-badge { width: 60px; height: 60px; border-radius: 18px; background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff; font: 800 28px var(--sans); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px #4f46e544; }
.lvl-info b { font-size: 20px; }
.lvl-info .bar { margin-top: 8px; height: 10px; }
.lvl-stats { display: flex; gap: 18px; text-align: center; }
.lvl-stats b { display: block; font-size: 22px; }
.lvl-stats span { font-size: 12px; color: var(--muted); }
.gami-grid { margin-top: 16px; }
.gami-grid > .card { min-width: 0; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.badge { display: grid; gap: 3px; justify-items: center; text-align: center; padding: 10px 8px; border-radius: 12px; background: var(--surface-2); filter: grayscale(1); opacity: .6; }
.badge.got { filter: none; opacity: 1; background: linear-gradient(180deg, #fff7e0, var(--surface)); border: 1px solid #fcd34d; }
.badge .b-ico { font-size: 28px; }
.badge b { font-size: 13px; line-height: 1.2; }
.badge .bar { width: 80%; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); color: var(--muted); padding: 5px 10px; font: 600 13px var(--sans); cursor: pointer; }
.seg button.active { background: var(--accent); color: #fff; }
.rating tr.me td { background: var(--accent-soft); font-weight: 600; }
.lvl-mini { display: inline-flex; width: 22px; height: 22px; border-radius: 7px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; align-items: center; justify-content: center; }
.levels { columns: 2; font-size: 14px; }

@media (max-width: 820px) { .lvl-card { grid-template-columns: auto 1fr; } .lvl-stats { grid-column: 1 / -1; justify-content: space-around; } }

.gami-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rating td, .rating th { white-space: nowrap; }
.rating td:nth-child(2) { white-space: normal; min-width: 90px; }
@media (max-width: 1100px) { .gami-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .rating .lvl-name { display: none; } }
.pills .pill.pend { background: #fff3d6; border-color: #d97706; color: #a16207; }
.stats .cell.pend { background: #fff3d6; color: #a16207; }
.checks .pend > span { color: #d97706; }
.sbx.embed { margin-top: 12px; }
.sbx.embed .sbx-main { height: 640px; }
.sbx-title { font-size: 16px; margin-right: 8px; }
.sbx-menu { position: absolute; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px #0004; padding: 4px; min-width: 190px; display: grid; }
.sbx-menu button { border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 7px; font: 14px var(--sans); color: var(--text); cursor: pointer; display: flex; gap: 8px; align-items: center; }
.sbx-menu button:hover:not(:disabled) { background: var(--surface-2); }
.sbx-menu button:disabled { opacity: .4; cursor: default; }
.sbx-menu kbd { margin-left: auto; font-size: 11px; color: var(--muted); }
.sbx-menu hr { border: 0; border-top: 1px solid var(--border); margin: 3px 0; }
.sbx-menu .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.sbx-welcome { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, 90%); z-index: 15; box-shadow: 0 20px 50px #0005; }
.sbx-welcome ol { padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; max-height: 65vh; overflow: auto; }
.gal-card { display: grid; gap: 4px; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 8px; cursor: pointer; color: var(--text); font: 14px var(--sans); }
.gal-card:hover { border-color: var(--accent); }
.gal-img { height: 110px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.gal-img svg { width: 100%; height: 100%; }
.gal-img .leg { stroke: #9ca3af; stroke-width: 2; }
.lint { list-style: none; padding: 0; display: grid; gap: 6px; }
.lint li { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); cursor: pointer; }
.lint li.err { background: var(--bad-soft); } .lint li.warn { background: #fff3d6; color: #1b1f2a; }
.ok-big { font-size: 18px; font-weight: 600; color: var(--ok); }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; font-size: 14px; }
.help-grid ul { padding-left: 18px; margin: 4px 0; }
kbd { font: 12px var(--mono); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.leglbl rect { fill: #111827e6; } .leglbl text { font: 600 8px var(--sans); fill: #fde047; pointer-events: none; }
.leglbl { pointer-events: none; }
.snap-ring.twin { stroke: #d97706; stroke-dasharray: 3 2; }
.twin-lbl { font: 600 9px var(--sans); fill: #d97706; pointer-events: none; }
.grade-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.grade-switch a { display: grid; gap: 2px; padding: 12px 16px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
.grade-switch a span { font-size: 13px; color: var(--muted); }
.grade-switch a.active { border-color: var(--accent); background: var(--accent-soft); }
.side-grade { display: block; margin: 0 8px 10px; padding: 6px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px; text-decoration: none; }
@media (max-width: 600px) { .grade-switch { grid-template-columns: 1fr; } }

/* ================== блоки (как в Tinkercad) ================== */
.codepanel { display: grid; gap: 6px; --bh: 380px; }
.cp-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.cp-tabs button { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 8px; padding: 5px 10px; font: 600 13px var(--sans); cursor: pointer; }
.cp-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cp-body { display: grid; gap: 8px; min-width: 0; }
.codepanel[data-mode="text"] .cp-blocks, .codepanel[data-mode="text"] .cp-view, .codepanel[data-mode="blocks"] .cp-view, .codepanel[data-mode="blocks"] .cp-text, .codepanel[data-mode="split"] .cp-text { display: none; }
.codepanel[data-mode="split"] .cp-body { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.codepanel[data-mode="split"] .cp-view .editor { height: var(--bh); font-size: 12px; }
.bw { position: relative; display: grid; grid-template-columns: 170px minmax(0, 1fr); height: var(--bh, 380px); background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; color: #111827; font: 13px var(--sans); }
.bw.ro { grid-template-columns: 1fr; height: auto; }
.bw-pal { overflow-y: auto; padding: 8px; background: #eef2f7; border-right: 1px solid var(--border); display: grid; gap: 10px; align-content: start; }
.bp-title { font: 700 12px var(--sans); color: var(--cc); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.bp-cat { display: grid; gap: 5px; }
.bp-item { cursor: grab; font-size: 12px; }
.bp-item select, .bp-item input { pointer-events: none; }
.bp-note { line-height: 1.3; }
.bw-ws { overflow: auto; padding: 12px 14px 40px; }
.bw.ro .bw-ws { overflow: visible; padding: 8px; }
.hat { display: inline-block; color: #fff; font-weight: 700; padding: 7px 14px 7px 10px; border-radius: 14px 14px 4px 4px; min-width: 200px; }
.hat-foot { height: 10px; width: 200px; border-radius: 0 0 6px 6px; margin-bottom: 14px; }
.blist { min-height: 26px; padding: 2px 0 2px 14px; border-left: 14px solid transparent; margin-left: 0; }
.bw-ws > .blist { border-left-color: #ea8a0c; }
.blist:empty::after { content: 'перетащи блоки сюда'; display: block; color: #94a3b8; font-size: 12px; padding: 4px 6px; border: 1px dashed #cbd5e1; border-radius: 6px; }
.blk { margin: 3px 0; border-radius: 6px; color: #fff; width: max-content; max-width: 100%; }
.blk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 6px 8px; min-height: 32px; box-sizing: border-box; }
.blk .grip { opacity: .6; cursor: grab; font-size: 12px; }
.blk-x { border: 0; background: #0002; color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; cursor: pointer; opacity: 0; margin-left: 4px; }
.blk-head:hover > .blk-x { opacity: 1; }
.blk-body { margin-left: 14px; background: #f8fafc; border-radius: 0 6px 6px 0; min-height: 22px; }
.bw.ro .blk-body { background: #fff; }
.blk-body > .blist { border-left: 0; padding-left: 8px; }
.blk-body.mini { height: 10px; min-height: 10px; }
.blk-mid { padding: 3px 10px; font-weight: 600; }
.blk-foot { height: 10px; width: 60px; }
.c-out, .bp-item.c-out { background: #2563eb; } .c-ctl { background: #ea8a0c; } .c-ser { background: #0d9488; } .c-var { background: #db2777; }
.hat.c-ctl, .hat-foot.c-ctl { background: #ea8a0c; }
.blk select, .blk input { font: 600 13px var(--sans); border: 0; border-radius: 10px; padding: 2px 4px; background: #fff; color: #111827; min-width: 0; }
.blk select.on, .blk select.var { background: #ffffffdd; }
.pill { display: inline-flex; align-items: center; gap: 3px; border-radius: 14px; padding: 2px 3px 2px 6px; background: #ffffff33; }
.pill input[type=number] { text-align: center; -moz-appearance: textfield; }
.pill input::-webkit-inner-spin-button { display: none; }
.p-in { background: #7c3aed; } .p-math { background: #16a34a; } .p-logic { background: #0891b2; } .p-var { background: #db2777; } .p-text { background: #ffffff33; }
.pill .op { padding: 2px; }
.pill-m { border: 0; background: #0003; color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; cursor: pointer; padding: 0; }
.hint { font-size: 11px; opacity: .8; }
.blk-marker { height: 6px; width: 160px; border-radius: 3px; background: var(--accent); margin: 2px 0; }
.blk.dragging { opacity: .35; }
.blk-ghost { position: fixed; z-index: 100; pointer-events: none; opacity: .9; box-shadow: 0 8px 20px #0004; }
.bw-menu { position: absolute; z-index: 30; display: grid; background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; padding: 4px; box-shadow: 0 10px 30px #0003; min-width: 200px; }
.bw-menu button { border: 0; background: none; text-align: left; padding: 6px 10px; border-radius: 6px; font: 13px var(--sans); cursor: pointer; color: #111827; }
.bw-menu button:hover { background: #eef2ff; }
.blocks-demo-box { display: grid; gap: 10px; margin: 14px 0; }
.blocks-demo-box.with-code { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.blocks-demo-box .bd-code { margin: 0; }
.blocks-demo-box .bw { border-radius: 12px; }
@media (max-width: 820px) { .bw { grid-template-columns: 1fr; height: auto; } .bw-pal { max-height: 200px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } .bw-ws { min-height: 300px; } .codepanel[data-mode="split"] .cp-body, .blocks-demo-box.with-code { grid-template-columns: 1fr; } }
.sbx.code-wide .sbx-main { grid-template-columns: 136px minmax(0, 1fr) minmax(460px, 52%); }
.blk select, .pill, .pill input { flex: none; }
.pill input[type=number] { min-width: 3ch; padding: 2px 6px; }
.sbx .codepanel[data-mode="split"] .cp-body { grid-template-columns: 1fr; }
.sbx .codepanel[data-mode="split"] .cp-view .editor { height: 180px; }
.part .board-name { font: italic 800 17px var(--sans); fill: #ffffffe6; letter-spacing: .04em; }
.part .board-sub { font: 800 26px var(--sans); fill: #ffffffcc; letter-spacing: .12em; }
.circ-top { margin-bottom: 12px; } .circ-top > * { min-width: 0; }
.sbx.no-code .sbx-editor, .sbx.no-code .serial, .sbx.no-code #genBtn, .sbx.no-code #wideBtn { display: none; }
.sbx.no-code .sbx-main { grid-template-columns: 136px minmax(0, 1fr) 300px; }
@media (max-width: 1100px) { .sbx.no-code .sbx-main { grid-template-columns: 1fr; } }
.sbx, .sbx-main > *, .sbx-side { min-width: 0; } .sbx-insp { overflow-wrap: anywhere; }
.bp-item.blk { width: auto; max-width: 100%; }
.bp-item .blk-head { flex-wrap: wrap; row-gap: 3px; }
.bw { grid-template-columns: 190px minmax(0, 1fr); }
/* панель действий у детали */
.sbx-qbar { position: absolute; z-index: 12; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: min(460px, calc(100% - 12px)); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 5px 8px; box-shadow: 0 8px 24px #0005; font-size: 13px; }
.sbx-qbar .qb-t { font-size: 13px; margin-right: 2px; }
.sbx-qbar select { padding: 3px 6px; font-size: 13px; }
.qb-colors { display: inline-flex; gap: 3px; }
.qb-colors .swatch { width: 18px; height: 18px; }
.qb-b { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 8px; min-width: 30px; height: 30px; font-size: 15px; cursor: pointer; }
.qb-b:hover { border-color: var(--accent); }
.qb-b.danger { color: var(--bad); }
.qb-b.off { opacity: .35; pointer-events: none; }
.qb-live { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.qb-live input[type=range] { width: 110px; }
/* выводы: крупные зоны, подсветка свободных при рисовании провода */
.term { stroke-width: 0; }
.term:not(.bbt):hover { fill: #fde04799; stroke: #a16207; stroke-width: 1.5; }
#cv.wiring .term:not(.used):not(.bbt) { fill: #22c55e40; stroke: #16a34a; stroke-width: 1; }
#cv.wiring .term.bbt:not(.used) { fill: #22c55e22; }
/* полный экран */
.sbx.fs { position: fixed; inset: 0; z-index: 45; background: var(--bg); padding: 10px 12px; overflow: auto; }
.sbx.fs .sbx-main { height: calc(100vh - 80px); }
body.sbx-fs-open { overflow: hidden; }
.pal-more { width: 100%; margin-top: 6px; }
@media (hover: none) { .term:not(.bbt) { fill: #fde04733; } }
.sbx-insp .row { flex-wrap: wrap; } .sbx.fs { box-sizing: border-box; }

/* ================== Trail: оформление (кремовый фон, коралл, Nunito) ================== */
body { font: 600 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1 { font-size: 40px; font-weight: 900; letter-spacing: -.01em; line-height: 1.1; }
h2 { font-weight: 900; font-size: 24px; }
h3 { font-weight: 900; }
b, strong { font-weight: 800; }
a { color: var(--blue-dk); }
code { background: var(--surface-2); border-radius: 7px; padding: 1px 6px; }
pre code { border-radius: 18px; padding: 16px 18px; }
.muted { color: var(--muted); }

/* шапка */
.topbar { height: 72px; padding: 0 28px; gap: 28px; background: var(--bg); border-bottom: 0; box-shadow: 0 2px 0 var(--line); }
.logo { font-weight: 900; font-size: 22px; gap: 10px; }
.logo-dot { width: 32px; height: 32px; border-radius: 11px; background: var(--accent); box-shadow: 0 3px 0 var(--accent-dk); position: relative; }
.logo-dot::after { content: ''; position: absolute; left: 10px; top: 10px; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.logo-sub { font-weight: 700; font-size: 14px; color: var(--faint); }
.topnav { gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 16px; }
.topnav a { padding: 8px 16px; border-radius: 12px; color: var(--muted); font-weight: 800; font-size: 15px; }
.topnav a:hover { background: transparent; color: var(--text); }
.topnav a.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 0 var(--line); }
.userchip { border: 0; background: var(--surface); box-shadow: 0 3px 0 var(--line); padding: 4px 14px 4px 4px; font: 800 15px var(--sans); }
.avatar { width: 34px; height: 34px; background: var(--blue); font-weight: 900; }
.userchip.teacher .avatar { background: var(--green); }
.streak { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--yellow-soft); color: var(--yellow-dk); font-weight: 900; font-size: 14px; white-space: nowrap; }

/* раскладка */
.layout { min-height: calc(100vh - 72px); }
.main { padding: 32px 40px 64px; }
.layout:not(.no-side) { grid-template-columns: 300px minmax(0, 1fr); gap: 0; }
.sidebar { top: 72px; height: calc(100vh - 72px); background: transparent; border-right: 0; padding: 32px 0 24px 28px; }
.side-card { background: var(--surface); border-radius: 26px; padding: 18px 14px; box-shadow: var(--shadow); }
.side-back { display: block; font-weight: 800; color: var(--muted); padding: 4px 10px 12px; font-size: 14px; }
.side-mod-title { font-size: 12px; letter-spacing: .08em; font-weight: 900; color: var(--faint); padding: 6px 10px; }
.side-lesson { border-radius: 14px; padding: 8px 10px; font-weight: 800; font-size: 15px; }
.side-lesson:hover { background: var(--bg); }
.side-lesson.active { background: var(--accent-soft); color: var(--text); }
.side-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 900; background: var(--surface-3); color: var(--muted); }
.side-n.done { background: var(--green); color: #fff; }
.side-n.cur { background: #fff; border: 4px solid var(--accent); color: var(--text); font-size: 11px; }
.side-grade { background: var(--surface-2); color: var(--muted); border-radius: 12px; font-weight: 800; margin: 0 0 12px; }

/* карточки и кнопки */
.card { border: 0; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
a.card { transition: transform .12s; }
a.card:hover { transform: translateY(-2px); }
.btn { border: 0; border-radius: 14px; padding: 10px 18px; background: var(--surface); box-shadow: 0 3px 0 var(--line); font: 900 15px var(--sans); color: var(--text); transition: transform .08s, box-shadow .08s; }
.btn:hover { background: var(--surface); filter: brightness(.98); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-dk); }
.btn.primary:active:not(:disabled) { box-shadow: 0 0 0 var(--accent-dk); transform: translateY(4px); }
.btn.accent { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-dk); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn.big { padding: 15px 26px; font-size: 17px; border-radius: 18px; }
.btn.tiny { padding: 3px 10px; font-size: 12px; border-radius: 10px; box-shadow: 0 2px 0 var(--line); }
.btn.danger { color: var(--accent-dk); }
.card .btn:not(.primary):not(.accent):not(.ghost) { background: var(--surface-2); box-shadow: 0 3px 0 var(--border); }
input, select, textarea { font: 700 16px var(--sans); border: 3px solid var(--surface-2); background: var(--bg); border-radius: 14px; padding: 10px 14px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--blue); }
.form label { font-weight: 800; font-size: 14px; color: var(--muted); }
.form-err { border-radius: 14px; font-weight: 800; }
.pts { background: var(--yellow-soft); color: var(--yellow-dk); font-weight: 900; padding: 4px 12px; }
.bar { height: 10px; border-radius: 10px; background: var(--surface-3); }
.bar i { background: var(--blue); border-radius: 10px; }
.bar.thin { height: 6px; }
.note { background: var(--yellow-soft); border-radius: 20px; padding: 16px 20px 16px 58px; position: relative; font-weight: 700; }
.note::before { content: '!'; position: absolute; left: 16px; top: 14px; width: 28px; height: 28px; border-radius: 50%; background: var(--yellow); color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.note.plain { padding-left: 20px; } .note.plain::before { display: none; }
.toast { border-radius: 16px; font-weight: 800; background: var(--text); }
.toast.ok { background: var(--green-dk); } .toast.bad { background: var(--accent-dk); }
.modal { border-radius: 28px; padding: 28px 30px; box-shadow: 0 6px 0 var(--line), 0 30px 80px #2b262233; }
.modal-wrap { background: #2b262255; }
.tbl th { color: var(--faint); font-weight: 900; text-transform: uppercase; font-size: 12px; letter-spacing: .05em; }
.tbl th, .tbl td { border-bottom: 2px solid var(--surface-2); }
.empty { padding: 40px 24px; }

/* сегменты */
.seg, .grade-seg { display: inline-flex; gap: 4px; background: var(--surface-2); border: 0; border-radius: 14px; padding: 4px; }
.seg button, .grade-seg a { border: 0; background: transparent; color: var(--muted); border-radius: 11px; padding: 7px 14px; font: 900 14px var(--sans); cursor: pointer; text-decoration: none; }
.seg button.active, .grade-seg a.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 0 var(--line); }

/* статусы и виды работ */
.kind { font-weight: 900; border-radius: 10px; padding: 3px 10px; letter-spacing: .05em; }
.k-homework { background: var(--blue-soft); color: var(--blue-dk); }
.k-test { background: var(--yellow-soft); color: var(--yellow-dk); }
.k-control { background: var(--accent-soft); color: var(--accent-dk); }
.st { font-weight: 900; border-radius: 10px; padding: 3px 10px; }
.st.done { background: var(--ok-soft); color: var(--green-dk); }
.st.prog, .st.fbnew { background: var(--yellow-soft); color: var(--yellow-dk); }
.st.late { background: var(--accent-soft); color: var(--accent-dk); }
.st.new { background: var(--blue-soft); color: var(--blue-dk); }
.mark { border-radius: 10px; width: 30px; height: 30px; }
.mark.m5 { background: var(--green); } .mark.m4 { background: oklch(0.74 0.13 120); } .mark.m3 { background: var(--yellow); } .mark.m2 { background: var(--accent); }

/* ---------- курс: дорожка ---------- */
.trail-hero { display: grid; grid-template-columns: 1fr auto; gap: 36px; align-items: center; background: var(--surface); border-radius: 32px; padding: 34px 40px; box-shadow: 0 5px 0 var(--line); margin-bottom: 28px; }
.trail-hero h1 { font-size: 46px; margin: 18px 0 10px; }
.trail-hero p { color: var(--muted); font-size: 18px; margin: 0 0 22px; max-width: 620px; }
.trail-hero .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.big-ring { width: 160px; height: 160px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); display: flex; align-items: center; justify-content: center; }
.big-ring > div { width: 120px; height: 120px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.big-ring b { font-size: 36px; font-weight: 900; line-height: 1; }
.big-ring span { font-size: 13px; color: var(--muted); font-weight: 800; }
.part-card { background: var(--surface); border-radius: 28px; padding: 24px 28px 28px; box-shadow: var(--shadow); margin-bottom: 20px; --pc: var(--accent); --pd: var(--accent-dk); --ps: var(--accent-soft); }
.part-card.c1 { --pc: var(--blue); --pd: var(--blue-dk); --ps: var(--blue-soft); }
.part-card.c2 { --pc: var(--green); --pd: var(--green-dk); --ps: var(--ok-soft); }
.part-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.part-badge { background: var(--ps); color: var(--pd); font-weight: 900; font-size: 13px; letter-spacing: .06em; padding: 6px 12px; border-radius: 12px; }
.part-head h2 { margin: 0; font-size: 26px; }
.path { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; position: relative; }
.path-step { flex: 1 0 120px; max-width: 170px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; color: var(--text); position: relative; text-decoration: none; }
.path-step:hover { text-decoration: none; }
.path-step::before { content: ''; position: absolute; top: 27px; left: -50%; width: 100%; height: 6px; background: var(--surface-3); z-index: 0; }
.path-step.done::before, .path-step.cur::before { background: var(--pc); }
.path-step:first-child::before { display: none; }
.path-dot { position: relative; z-index: 1; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 20px; background: var(--surface-3); color: var(--faint); box-shadow: 0 5px 0 var(--border); transition: transform .12s; }
.path-step:hover .path-dot { transform: translateY(-3px); }
.path-step.done .path-dot { background: var(--pc); color: #fff; box-shadow: 0 5px 0 var(--pd); font-size: 24px; }
.path-step.cur .path-dot { background: #fff; border: 6px solid var(--pc); color: var(--text); font-size: 15px; box-shadow: 0 5px 0 var(--pd); }
.path-t { font-size: 14px; font-weight: 800; line-height: 1.25; }
.path-m { font-size: 12px; color: var(--faint); font-weight: 800; }
.course-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 8px; }
.course-foot .card h3 { margin: 0 0 6px; }

/* ---------- урок ---------- */
.lesson { max-width: 900px; }
.l-meta { font-size: 14px; font-weight: 800; color: var(--faint); }
.l-meta a { color: var(--faint); }
.lesson h1 { font-size: 42px; margin: 8px 0 18px; }
.tabs { gap: 10px; border-bottom: 0; margin-bottom: 26px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px 8px 8px; border: 0; margin: 0; border-radius: 999px; background: var(--surface); box-shadow: 0 3px 0 var(--line); color: var(--muted); font-weight: 900; }
.tab i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); }
.tab.active { background: var(--accent); color: #fff; box-shadow: 0 3px 0 var(--accent-dk); }
.tab.active i { background: #ffffff40; color: #fff; }
.tab.done i { background: var(--green); color: #fff; }
.tab.done::after { content: none; }
.theory { background: var(--surface); border-radius: 32px; padding: 34px 38px; box-shadow: var(--shadow); font-size: 18px; font-weight: 600; }
.theory h3 { font-size: 24px; margin: 28px 0 10px; }
.theory h3:first-child { margin-top: 0; }
.theory th { background: var(--surface-2); }
.theory .scheme { border: 0; background: var(--bg); border-radius: 20px; }
.lesson-foot { border-top: 0; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* тест */
.q.card { border: 0; padding: 26px 28px; }
.q legend { font-weight: 900; font-size: 19px; align-items: center; gap: 14px; }
.q-num { width: 34px; height: 34px; background: var(--blue-soft); color: var(--blue-dk); font-weight: 900; font-size: 15px; }
.opt { border: 3px solid var(--surface-2); border-radius: 16px; padding: 12px 16px; margin-top: 8px; font-weight: 700; align-items: center; }
.opt:hover { background: var(--bg); }
.opt input { margin: 0; width: 20px; height: 20px; accent-color: var(--blue); flex: none; padding: 0; }
.opt:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.q.right { box-shadow: 0 4px 0 var(--green); } .q.wrong { box-shadow: 0 4px 0 var(--accent); }
.q.right .opt:has(input:checked) { border-color: var(--green); background: var(--ok-soft); }
.q.wrong .opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.q-feedback { font-weight: 800; margin-top: 10px; }
.quiz-foot { background: var(--surface); border-radius: 24px; padding: 16px 20px; box-shadow: var(--shadow); }

/* задачи */
.task-card { padding: 16px 20px; }
.task-n { width: 40px; height: 40px; background: var(--surface-3); color: var(--muted); font-weight: 900; }
.task-card.solved .task-n { background: var(--green); }
.task-name { font-weight: 900; }
.statement h2 { font-size: 22px; }
.statement::before { content: 'УСЛОВИЕ'; display: block; font-size: 12px; letter-spacing: .08em; font-weight: 900; color: var(--faint); margin-bottom: 8px; }
.verdict { border-radius: 16px; font-weight: 900; padding: 12px 16px; }
.verdict.ok { background: var(--ok-soft); color: var(--green-dk); }
.verdict.bad { background: var(--accent); color: #fff; }
.checks li { align-items: flex-start; font-weight: 700; }
.checks li > span { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #fff !important; }
.checks .pass > span { background: var(--green); } .checks .fail > span { background: var(--accent); } .checks .pend > span { background: var(--yellow); }
.editor { border-radius: 20px; background: var(--code-bg); }
.ed-gutter { color: #6f655c; }
.board { background: oklch(0.5 0.08 180); border-radius: 24px; padding: 18px 20px; box-shadow: 0 4px 0 oklch(0.4 0.08 180); }
.board-title { font-weight: 900; letter-spacing: .08em; }
.hw-btn { border-radius: 14px; font-weight: 900; background: #fff; box-shadow: 0 4px 0 #c9bfb2; }
.serial { border: 0; border-radius: 22px; box-shadow: var(--shadow); }
.serial-head { background: var(--surface-2); padding: 10px 16px; font-weight: 900; }
.bench-error { border-radius: 16px; font-weight: 700; }
.bench-bar .btn.primary + .btn, .bench-bar .btn { }
.cp-tabs { background: var(--surface-2); padding: 4px; border-radius: 14px; width: max-content; max-width: 100%; }
.cp-tabs button { border: 0; background: transparent; border-radius: 11px; padding: 6px 14px; font-weight: 900; }
.cp-tabs button.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 0 var(--line); }
.bw { border: 0; border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.bw-ws { background: radial-gradient(#ece4d8 1.5px, transparent 1.5px) 0 0 / 18px 18px, #fff; }
.bw-pal { background: var(--bg); border-right: 2px solid var(--surface-2); }
.blk-body { background: #fff; }

/* ---------- кабинет ученика ---------- */
.asg-card { padding: 0; overflow: hidden; }
.asg-card > * { padding-left: 22px; padding-right: 22px; }
.asg-card .asg-top { padding-top: 12px; padding-bottom: 12px; background: var(--blue); color: #fff; }
.asg-card.k-test-card .asg-top { background: var(--yellow); color: var(--text); }
.asg-card.k-control-card .asg-top { background: var(--accent); }
.asg-card .asg-top .kind { background: #ffffff33; color: inherit; }
.asg-card .asg-top .muted { color: inherit; opacity: .85; }
.asg-card > :last-child { padding-bottom: 20px; }
.asg-card h3 { font-size: 20px; margin-top: 14px; }
.lvl-card { padding: 22px 26px; }
.lvl-badge { width: 84px; height: 84px; border-radius: 26px; background: var(--blue); font-size: 38px; font-weight: 900; box-shadow: 0 5px 0 var(--blue-dk); }
.lvl-info b { font-size: 24px; font-weight: 900; }
.lvl-stats > div { background: var(--bg); border-radius: 18px; padding: 10px 16px; min-width: 84px; }
.lvl-stats b { font-weight: 900; }
.badge { border-radius: 20px; background: var(--bg); }
.badge.got { background: var(--yellow-soft); border: 0; }
.badge .b-ico { width: 52px; height: 52px; border-radius: 50%; background: var(--yellow); display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 4px 0 oklch(0.65 0.13 75); }
.badge:not(.got) .b-ico { background: var(--surface-3); box-shadow: none; }
.rating tr.me td { background: var(--blue-soft); }
.lvl-mini { background: var(--blue); border-radius: 8px; }
.pills .pill { border: 3px solid var(--surface-2); border-radius: 14px; font-weight: 900; }
.pills .pill.cur { border-color: var(--accent); box-shadow: none; }
.pills .pill.ok { background: var(--green); border-color: var(--green); }
.pills .pill.bad { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dk); }
.pills .pill.ans { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-dk); }
.pills .pill.pend { background: var(--yellow-soft); border-color: var(--yellow); color: var(--yellow-dk); }
.blk .pill, .bp-item .pill { border: 0; border-radius: 14px; font-weight: 700; width: auto; height: auto; }
.test-bar { border: 0; border-radius: 20px; box-shadow: var(--shadow); top: 80px; }
.timer { border-radius: 12px; background: var(--surface-2); }
.timer.low { background: var(--accent); color: #fff; }
.score-big { font-weight: 900; }
.fb-show { background: var(--blue-soft); border-left: 0; border-radius: 16px; font-weight: 700; }
.fb-show.new { background: var(--yellow-soft); color: var(--text); }

/* ---------- кабинет учителя ---------- */
.live-banner { display: flex; align-items: center; gap: 14px; background: var(--accent); color: #fff; border-radius: 22px; padding: 14px 20px; box-shadow: 0 4px 0 var(--accent-dk); font-weight: 800; margin-bottom: 18px; }
.live-banner a { color: #fff; text-decoration: underline; }
.class-card h3 { font-size: 34px; font-weight: 900; }
.class-card.new { border: 3px dashed var(--border); background: transparent; box-shadow: none; }
.stats .cell.ok { background: var(--ok-soft); color: var(--green-dk); }
.stats .cell.bad { background: var(--accent-soft); color: var(--accent-dk); }
.stats .cell.pend { background: var(--yellow-soft); color: var(--yellow-dk); }
.bank-item { border-radius: 14px; font-weight: 700; }
.bank-item.sel { background: var(--blue-soft); }
.diff-bar i { background: var(--green); } .diff-bar i.low { background: var(--accent); }
.cred { border: 3px dashed var(--surface-2); border-radius: 16px; }
.lvl.l1 { color: var(--green); } .lvl.l2 { color: var(--yellow); } .lvl.l3 { color: var(--accent); }

/* ---------- вход ---------- */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 440px); gap: 40px; align-items: center; max-width: 1080px; margin: 24px auto; }
.auth-wrap h1 { font-size: 52px; margin: 0 0 14px; }
.auth-wrap .lead { font-size: 19px; color: var(--muted); margin: 0 0 26px; }
.feat { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.feat i { flex: none; width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 20px; box-shadow: 0 4px 0 #0002; }
.feat b { display: block; font-size: 17px; }
.feat span { color: var(--muted); font-size: 15px; }
.auth { margin: 0; max-width: none; padding: 32px; border-radius: 32px; }
.auth h1 { font-size: 32px; }
.auth .seg { width: 100%; margin-bottom: 18px; } .auth .seg a { flex: 1; text-align: center; border-radius: 11px; padding: 8px; font-weight: 900; color: var(--muted); }
.auth .seg a.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 0 var(--line); }
.auth .btn.big { width: 100%; justify-content: center; }
.auth-single { max-width: 460px; margin: 40px auto; }

/* песочница */
.sbx-pal, .sbx-canvas { border: 0; border-radius: 22px; box-shadow: var(--shadow); }
.sbx-tools, .sbx-qbar { border: 0; border-radius: 14px; box-shadow: 0 3px 0 var(--line), 0 8px 24px #2b262214; }
.pal-item { border-radius: 12px; font-weight: 700; }
.pal-item:hover { background: var(--bg); border-color: transparent; }
.pal-cat { color: var(--faint); font-weight: 900; }
.qb-b { border: 0; background: var(--surface-2); border-radius: 10px; }
.sbx-menu, .bw-menu { border: 0; border-radius: 16px; box-shadow: 0 4px 0 var(--line), 0 16px 40px #2b262222; }
.gal-card { border: 0; border-radius: 18px; box-shadow: var(--shadow); }
.lint li { border-radius: 14px; }
.sbx-name { border-color: var(--surface-2); }

@media (max-width: 1100px) { .auth-wrap { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .topbar { height: 60px; padding: 0 16px; gap: 10px; }
  .topnav a { padding: 6px 10px; font-size: 14px; }
  .streak { display: none; }
  .sidebar { top: 60px; }
  .trail-hero { grid-template-columns: 1fr; padding: 24px; }
  .trail-hero h1, .auth-wrap h1 { font-size: 34px; }
  .big-ring { display: none; }
  .lesson h1 { font-size: 30px; }
  .theory { padding: 22px 20px; font-size: 17px; }
  .part-card { padding: 20px 16px; }
  .path-step { flex-basis: 96px; }
  .path-dot { width: 52px; height: 52px; }
  .path-step::before { top: 23px; }
}
.asg-row { box-shadow: inset 6px 0 0 var(--blue), var(--shadow); padding-left: 26px; }
.asg-row.k-test-card { box-shadow: inset 6px 0 0 var(--yellow), var(--shadow); }
.asg-row.k-control-card { box-shadow: inset 6px 0 0 var(--accent), var(--shadow); }
.class-card { min-height: 140px; }

/* песочница: панель инструментов группами */
.sbx-bar { background: var(--surface); border-radius: 20px; padding: 8px 10px; box-shadow: var(--shadow); gap: 10px; row-gap: 8px; }
.sbx-grp { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sbx-grp + .sbx-grp { padding-left: 10px; border-left: 2px solid var(--surface-2); }
.sbx-bar .sp + .sbx-grp { border-left: 0; padding-left: 0; }
.sbx-bar .btn { padding: 8px 14px; font-size: 14px; }
.sbx-bar .btn:not(.primary):not(.ghost) { background: var(--surface-2); box-shadow: 0 3px 0 var(--border); }
.sbx-icons .btn.ghost { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 12px; font-size: 16px; color: var(--text); }
.sbx-icons .btn.ghost:hover { background: var(--surface-2); }
.sbx-bar select { padding: 7px 12px; font-size: 14px; }
.sbx-title { font-weight: 900; font-size: 17px; }
.sbx-name { width: 200px; padding: 7px 12px; font-size: 15px; }
.bench-status { font-weight: 800; color: var(--muted); }
.sbx-icons .btn.ghost.wide-txt { width: auto; padding: 0 12px; font-size: 14px; }
.sbx-icons .btn.ghost svg { display: block; }
.pal-item .bb, .gal-img .bb, .pal-ghost .bb { fill: #f5f5f4; stroke: #d6d3d1; }
.pal-item .hole, .gal-img .hole, .pal-ghost .hole { fill: #a8a29e; }
.pal-item .bbnum, .gal-img .bbnum { font: 7px var(--sans); fill: #78716c; }
.sbx:not(.embed) .sbx-main { height: calc(100vh - 250px); min-height: 500px; }
.sbx-canvas .gdot { fill: #d8cfc2; }
.it-k { display: inline-block; font-size: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; }
.stats tr.sum td:first-child { text-align: left; }
.stats th { text-align: center; } .stats th:first-child { text-align: left; }
.list { margin-top: 14px; }
.ask-text { font-size: 18px; font-weight: 800; margin: 0 0 20px; line-height: 1.4; }
.ask-btns { justify-content: flex-end; }
.btn.danger-fill { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-dk); }
.modal:has(.ask-text) { width: min(460px, 100%); }
.kind-hint { font-weight: 700; }
.bank-item { grid-template-columns: auto 64px 1fr auto auto auto auto; }
.bank-item .it-k { text-align: center; }
.sel-list .it-k { margin-right: 6px; }
.bank-item > .muted.small { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bank-item .bi-title { min-width: 120px; }

/* телефон: доработки */
@media (max-width: 820px) {
  .row.gap { flex-wrap: wrap; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 6px; scrollbar-width: none; }
  .tab { padding: 6px 14px 6px 6px; font-size: 14px; flex: none; }
  .tab i { width: 24px; height: 24px; }
  .sbx-pal { max-height: 230px; align-content: start; }
  .sbx-pal input[type=search] { flex: 1 0 100%; }
  .sbx-hint { font-size: 0; }
  .sbx-hint::after { font-size: 12px; }
  .sbx-bar .sp { display: none; }
  .sbx-grp + .sbx-grp { border-left: 0; padding-left: 0; }
  .asg-head .row, .row.between > .row { flex-wrap: wrap; }
}
@media (max-width: 1100px) {
  .sbx .sbx-main, .sbx.embed .sbx-main, .sbx:not(.embed) .sbx-main { height: auto; min-height: 0; }
  .sbx-canvas { height: 60vh; min-height: 360px; }
}

/* урок: частые ошибки и итог */
.theory .mistakes { list-style: none; padding: 0; display: grid; gap: 8px; }
.theory .mistakes li { position: relative; padding: 10px 14px 10px 44px; background: var(--accent-soft); border-radius: 14px; font-size: 16px; }
.theory .mistakes li::before { content: "✕"; position: absolute; left: 12px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.theory .summary { margin-top: 26px; background: var(--ok-soft); border-radius: 22px; padding: 18px 22px; }
.theory .summary > b { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; color: var(--green-dk); }
.theory .summary > b::before { content: "✓"; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.theory .summary ul { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 4px; font-size: 16px; }

/* ===== песочница: понятнее для новичка ===== */
.sbx-main { grid-template-columns: 196px minmax(0, 1fr) minmax(290px, 360px); }
.sbx.no-code .sbx-main { grid-template-columns: 196px minmax(0, 1fr) 280px; }
.sbx.code-wide .sbx-main { grid-template-columns: 196px minmax(0, 1fr) minmax(420px, 48%); }
.sbx-pal { grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; }
.sbx-pal input[type=search], .sbx-pal .pal-cat, .sbx-pal .pal-more { grid-column: 1 / -1; }
.pal-item { background: var(--bg); border-radius: 14px; padding: 8px 4px 6px; font-size: 11.5px; font-weight: 800; min-height: 76px; justify-content: center; }
.pal-item:hover { background: var(--accent-soft); transform: translateY(-1px); }
.pal-item svg { width: 48px; height: 40px; }
.pal-cat { margin: 10px 2px 2px; font-size: 11px; letter-spacing: .08em; }
#lintBtn { position: relative; }
#lintBtn.has-issues::after { content: attr(data-count); position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 0 var(--accent-dk); }
#runBtn.is-running { background: var(--text); color: #fff; box-shadow: 0 4px 0 #000; }
.sbx-tools { padding: 6px 8px; gap: 6px; }
.tools-lbl { font-size: 12px; font-weight: 900; color: var(--muted); margin-right: 2px; }
.sbx-hint { left: 12px; right: 12px; bottom: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.sbx.running .sbx-hint { left: 50%; right: auto; transform: translateX(-50%); bottom: 12px; background: var(--green); color: #fff; padding: 8px 16px; border-radius: 999px; box-shadow: 0 3px 0 var(--green-dk); white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.sbx.running .sbx-hint::after { display: none; }
.sbx.running .sbx-canvas { box-shadow: 0 0 0 3px var(--green), var(--shadow); }
.sbx-insp > b { font-size: 16px; }
.lint.live { margin: 10px 0 6px; gap: 6px; }
.lint.live li { grid-template-columns: 22px 1fr; font-size: 13.5px; font-weight: 700; padding: 8px 10px; }
.lint.live li[title] { cursor: pointer; }
.lint.live li[title]:hover { filter: brightness(.97); }
.ok-line { background: var(--ok-soft); color: var(--green-dk); border-radius: 14px; padding: 10px 12px; font-weight: 800; font-size: 14px; margin: 10px 0 6px; }
.insp-tip { margin-bottom: 0; }
@media (max-width: 1100px) { .sbx-pal { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); } .pal-item { width: auto; } }
.pal-item span { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: normal; word-break: normal; }
.sbx-tools .wire-colors { gap: 2px; } .sbx-tools .wire-colors .swatch { width: 14px; height: 14px; }
.sbx-tools .btn.tiny { padding: 2px 7px; }
#zoomPct { min-width: 34px; text-align: center; }
/* блоки в песочнице: шире колонка кода */
@media (min-width: 1101px) { .sbx:has(.codepanel[data-mode="blocks"]) .sbx-main, .sbx:has(.codepanel[data-mode="split"]) .sbx-main { grid-template-columns: 196px minmax(0, 1fr) minmax(440px, 44%); } }
.sbx .bw { grid-template-columns: 200px minmax(0, 1fr); }
.sbx .bw-pal .bp-item { font-size: 11.5px; }
@media (max-width: 1100px) { .sbx:has(.codepanel) .sbx-main { grid-template-columns: 1fr; } }

/* шпаргалка команд над редактором кода */
.codepanel:not([data-mode="text"]) .cp-textwrap { display: none; }
.cp-textwrap { display: grid; gap: 8px; min-width: 0; }
.cp-snip { background: var(--surface); border-radius: 18px; padding: 10px 12px; box-shadow: var(--shadow); }
.snip-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.snip-toggle { border: 0; background: none; font: 900 14px var(--sans); color: var(--text); cursor: pointer; padding: 2px 0; }
.snip-toggle span { font-weight: 700; color: var(--blue-dk); margin-left: 6px; font-size: 13px; }
.snip-body { display: grid; gap: 6px; margin-top: 8px; }
.snip-cat { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.snip-cat > b { font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); min-width: 96px; }
.snip { border: 0; background: var(--surface-2); border-radius: 9px; padding: 3px 8px; cursor: pointer; box-shadow: 0 2px 0 var(--border); }
.snip code { background: none; padding: 0; font-size: 12px; color: var(--text); }
.snip:hover, .snip:focus-visible { background: var(--blue-soft); outline: none; }
.snip:active { transform: translateY(2px); box-shadow: none; }
.snip-help { margin: 2px 0 0; min-height: 1.4em; font-weight: 700; }
@media (max-width: 820px) { .snip-cat > b { min-width: 100%; } }
.hints { margin-top: 16px; display: grid; gap: 10px; justify-items: start; }
.hint-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; width: 100%; counter-reset: h; }
.hint-list li { counter-increment: h; position: relative; background: var(--yellow-soft); border-radius: 14px; padding: 10px 14px 10px 44px; font-size: 15px; white-space: pre-wrap; font-weight: 700; }
.hint-list li::before { content: counter(h); position: absolute; left: 12px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--yellow); color: #fff; font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.card .btn.hint-btn { background: var(--yellow-soft); box-shadow: 0 3px 0 oklch(0.85 0.08 85); color: var(--yellow-dk); }

/* строка банка заданий: одинаковые колонки в конструкторе (с галочкой) и на странице банка (без неё) */
.bank-item { grid-template-columns: 20px 66px minmax(0, 1fr) minmax(0, 210px) 34px auto auto; gap: 10px; padding: 8px 10px; }
.bank-item.no-pick { grid-template-columns: 66px minmax(0, 1fr) minmax(0, 210px) 34px auto auto; }
.bank-item .bi-title { min-width: 0; line-height: 1.3; }
.bank-item .bi-topic { max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bank-item .lvl { text-align: center; }
@media (max-width: 820px) {
  .bank-item { grid-template-columns: 20px 60px minmax(0, 1fr) auto auto; }
  .bank-item.no-pick { grid-template-columns: 60px minmax(0, 1fr) auto auto; }
  .bank-item .bi-topic, .bank-item .lvl { display: none; }
}
.bank-item .bi-topic { text-align: left; justify-self: stretch; }
@media (max-width: 1100px) { .logo-sub { display: none; } }
.logo { white-space: nowrap; flex: none; }
.bank-item { grid-template-columns: 20px 66px minmax(0, 1fr) minmax(0, 210px) 34px 54px 40px; }
.bank-item.no-pick { grid-template-columns: 66px minmax(0, 1fr) minmax(0, 210px) 34px 54px 40px; }
.bank-item .pts { justify-self: center; }
@media (max-width: 820px) { .bank-item { grid-template-columns: 20px 60px minmax(0, 1fr) 54px 40px; } .bank-item.no-pick { grid-template-columns: 60px minmax(0, 1fr) 54px 40px; } }

/* блоки: кнопка ▾ в овале не сжимается, палитра блоков не обрезает длинные блоки */
.pill-m { flex: none; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.bw-pal { overflow-x: hidden; }
.bw-pal .bp-item, .bw-pal .blk { max-width: 100%; }
.bw-pal .blk-head { flex-wrap: wrap; }
.bw-pal select { max-width: 100%; }

/* список деталей: строки «значок + название» вместо плиток — длинные названия не вылезают */
.sbx-pal { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.pal-item { flex-direction: row; justify-content: flex-start; align-items: center; gap: 8px; min-height: 48px; padding: 4px 8px; text-align: left; font-size: 12.5px; line-height: 1.2; }
.pal-item svg { flex: none; width: 40px; height: 34px; }
.pal-item span { flex: 1; min-width: 0; text-align: left; overflow-wrap: break-word; hyphens: manual; }
@media (max-width: 1100px) {
  .sbx-pal { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .pal-item { width: auto; }
}
.pal-item span { overflow-wrap: normal; word-break: normal; }
@media (max-width: 1100px) {
  .sbx-pal { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
  .pal-item svg { width: 34px; height: 30px; }
}
@media (max-width: 820px) { .sbx:not(.running) .sbx-hint { font-size: 0; } .sbx:not(.running) .sbx-hint::after { font-size: 12px; } }

/* админка */
.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 6px 0 18px; }
.adm-stat { background: var(--surface); border-radius: 22px; padding: 16px 20px; box-shadow: var(--shadow); }
.adm-stat b { display: block; font-size: 32px; font-weight: 900; line-height: 1.1; }
.adm-stat span { color: var(--muted); font-weight: 800; font-size: 14px; }
.adm-grid { grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); }
.adm-side { display: grid; gap: 16px; align-content: start; }
.adm-tbl td { vertical-align: middle; }
.adm-tbl tr.off td { opacity: .55; }
.adm-tbl tr.off td.actions { opacity: 1; }
.adm-tbl .actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.adm-log { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; max-height: 320px; overflow-y: auto; }
.teacher-cred { margin: 10px 0 16px; font-size: 16px; gap: 6px; padding: 14px 16px; }
.teacher-cred code { font-size: 15px; user-select: all; }
@media (max-width: 1100px) { .adm-grid { grid-template-columns: 1fr; } }
.adm-tbl .actions { display: table-cell; text-align: right; }
.adm-tbl .act { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: nowrap; }
.adm-tbl td.small { white-space: nowrap; }
.adm-tbl td:first-child { min-width: 150px; }

/* ===== песочница: ничего не обрезаем =====
   Высоту по экрану держит только поле схемы (и прилипает при прокрутке),
   а правая колонка растёт по содержимому — монитор порта всегда виден целиком. */
@media (min-width: 1101px) {
  .sbx .sbx-main, .sbx.embed .sbx-main, .sbx:not(.embed) .sbx-main { height: auto; min-height: 0; align-items: start; }
  .sbx-canvas { height: calc(100vh - 230px); min-height: 480px; position: sticky; top: 84px; }
  .sbx.embed .sbx-canvas { height: min(640px, calc(100vh - 120px)); }
  .sbx-pal { max-height: calc(100vh - 230px); min-height: 480px; position: sticky; top: 84px; }
  .sbx.embed .sbx-pal { max-height: min(640px, calc(100vh - 120px)); }
  .sbx-side { overflow: visible; grid-template-rows: none; align-content: start; }
  .sbx.fs .sbx-main { height: auto; }
  .sbx.fs .sbx-canvas, .sbx.fs .sbx-pal { height: calc(100vh - 110px); max-height: none; top: 0; }
}
/* длинные списки (детали, блоки) прокручиваются — полоса прокрутки видна, чтобы было понятно, что ниже есть ещё */
.sbx-pal, .bw-pal { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.sbx-pal::-webkit-scrollbar, .bw-pal::-webkit-scrollbar { width: 8px; }
.sbx-pal::-webkit-scrollbar-thumb, .bw-pal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.serial-out { min-height: 110px; }

/* дорожка уроков на телефоне — вертикально, ничего не уходит за край */
@media (max-width: 600px) {
  .path { flex-direction: column; gap: 6px; overflow: visible; padding: 0; }
  .path-step { flex: none; max-width: none; flex-direction: row; text-align: left; align-items: center; gap: 12px; display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 0; }
  .path-step .path-dot { grid-row: 1 / 3; width: 52px; height: 52px; }
  .path-step .path-t { align-self: end; }
  .path-step .path-m { align-self: start; }
  .path-step::before { top: -30px; left: 23px; width: 6px; height: 40px; }
}
@media (max-width: 600px) {
  .progress-card { flex-wrap: wrap; }
  .progress-card > div:nth-child(2) { flex: 1 1 160px; }
  .progress-card > .btn, .progress-card > a.btn { flex: 1 1 100%; justify-content: center; }
  .rating th:nth-child(5), .rating td:nth-child(5) { display: none; }
  .rating td, .rating th { padding-left: 6px; padding-right: 6px; }
}
@media (max-width: 600px) { .progress-card > span.btn { flex: 1 1 100%; justify-content: center; } }
