/* ---------- токены ----------
   Акцент (--accent, --accent-rgb, --accent-ink, --accent-text) приходит из настроек в <head>. */
:root {
  --bg: #f5f5f3;
  --card: #ffffff;
  --card-line: transparent;
  --text: #111111;
  --muted: #6b6b66;
  --line: rgba(17, 17, 17, .08);
  --line-strong: rgba(17, 17, 17, .16);
  --field: #f5f5f3;
  --hover: rgba(17, 17, 17, .05);
  --top-bg: rgba(245, 245, 243, .86);
  --link: var(--accent-text);
  --accent-soft: rgba(var(--accent-rgb), .12);
  --accent-line: rgba(var(--accent-rgb), .45);
  --ok: #0e7a4e;
  --ok-soft: #e2f3e9;
  --warn: #945600;
  --warn-soft: #fbefd9;
  --bad: #c42f1e;
  --bad-soft: #fde8e4;
  --radius: 20px;
  --radius-sm: 12px;
  --pill: 999px;
  --h: 42px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0e;
    --card: #191917;
    --card-line: rgba(255, 255, 255, .06);
    --text: #f2f2ef;
    --muted: #a3a39c;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .16);
    --field: #121211;
    --hover: rgba(255, 255, 255, .06);
    --top-bg: rgba(15, 15, 14, .86);
    --link: var(--accent);
    --accent-soft: rgba(var(--accent-rgb), .18);
    --ok: #3fcf8e;
    --ok-soft: rgba(63, 207, 142, .12);
    --warn: #f2b35b;
    --warn-soft: rgba(242, 179, 91, .12);
    --bad: #ff7b6b;
    --bad-soft: rgba(255, 123, 107, .12);
    color-scheme: dark;
  }
}

/* ---------- основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(var(--accent-rgb), .25); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: 30px; }
.h2, h2 { font-size: 21px; }
p { margin: 0; }
img, video, iframe { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.i { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.45; }
.strong { font-weight: 700; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.wrap-row { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.stack-sm > .field, .stack-sm > .video, .stack-sm > .check { align-self: stretch; }

/* подписи и служебный текст не выделяются случайно */
.top, .btn, .chip, .lesson-num, .nav, .seg, .card-head, .stat, .crumbs, .q-title, .field > span, .check, .lesson-meta { user-select: none; -webkit-user-select: none; }

/* ---------- каркас ---------- */
.wrap { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 1160px; }
.page { padding-top: 16px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 16px; }

.top { position: sticky; top: 0; z-index: 10; background: var(--top-bg); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.top-in { display: flex; align-items: center; gap: 12px; height: 76px; }

/* знак в «таблетке», как в шапке сайта студии */
.brand { display: inline-flex; align-items: center; gap: 12px; height: 48px; padding: 6px 20px 6px 6px; border-radius: var(--pill); background: var(--card); color: var(--text); white-space: nowrap; flex: none; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 36px; height: 36px; border-radius: 50%; flex: none; display: block; }
.brand-logo-plain { background: var(--accent); }
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; margin-right: -.2em; }
.brand-name-plain { letter-spacing: -.01em; text-transform: none; font-size: 15px; margin-right: 0; }
.brand-sub { font-size: 13px; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--line-strong); line-height: 16px; }

.top-user { color: var(--muted); font-size: 14px; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.top-out { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; }
.nav { display: flex; align-items: center; gap: 2px; height: 48px; padding: 4px; border-radius: var(--pill); background: var(--card); overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--pill); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; }
.nav a:hover { background: var(--hover); text-decoration: none; }
.nav a.on { background: var(--text); color: var(--bg); }
.nav .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--pill); background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.page-head { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.page-head.row { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; }
.crumbs { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; font-weight: 600; align-self: flex-start; }
.back:hover { color: var(--text); text-decoration: none; }

.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid-main, .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- карточки ---------- */
.card { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-link { color: inherit; gap: 12px; transition: box-shadow .15s; }
.card-link:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--accent-line); }
.empty { align-items: center; text-align: center; padding: 40px 24px; gap: 6px; }
.section-title { font-size: 18px; margin-bottom: 12px; }
.danger-zone { padding: 16px 24px; }

.bare { max-width: 440px; margin: 0 auto; padding: 40px 16px; display: flex; flex-direction: column; gap: 16px; }
.bare-brand { display: flex; justify-content: center; margin-bottom: 8px; }
.bare-card { gap: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mascot { display: block; width: 168px; height: auto; margin: -4px auto 0; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 20px; border-radius: var(--pill);
  border: 1px solid transparent; background: none; cursor: pointer;
  font-weight: 700; font-size: 15px; white-space: nowrap; text-decoration: none !important;
  transition: background-color .12s, border-color .12s, color .12s, filter .12s;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:not(:disabled):hover { filter: brightness(1.07); }
.btn-secondary { background: var(--card); border-color: var(--line-strong); color: var(--text); }
.btn-secondary:not(:disabled):hover { background: var(--hover); }
.btn-ghost { color: var(--muted); }
.btn-ghost:not(:disabled):hover { background: var(--hover); color: var(--text); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-danger:not(:disabled):hover { background: var(--bad); color: #fff; }
.btn-danger-text { color: var(--bad); }
.btn-sm { --h: 34px; padding: 0 14px; font-size: 14px; gap: 6px; }
.btn-icon { width: var(--h); padding: 0; }
.btn-block { width: 100%; }
@media (max-width: 600px) { .btn-block-m { width: 100%; white-space: normal; height: auto; min-height: var(--h); padding-top: 9px; padding-bottom: 9px; } }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > span { font-size: 14px; font-weight: 700; }
.field small, .check small { color: var(--muted); font-size: 13px; line-height: 1.45; font-weight: 500; }
/* :where() держит специфичность как у простого input, чтобы контекстные правила могли перекрасить поле */
input:where(:not([type=checkbox], [type=radio], [type=file])), select, textarea {
  width: 100%; min-height: var(--h); padding: 9px 14px;
  background: var(--field); border: 1px solid transparent; border-radius: var(--radius-sm);
  outline: none; transition: border-color .12s, box-shadow .12s, background-color .12s;
}
textarea { resize: vertical; line-height: 1.5; }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=file] { font-size: 14px; max-width: 100%; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; margin: 2px 0 0; flex: none; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check > span { display: flex; flex-direction: column; gap: 2px; }
.mono-ish { font-size: 14.5px; }
.inline-form { flex-direction: row; align-items: flex-end; gap: 12px; }
.inline-form-flat { padding: 0; border: 0; }
@media (max-width: 600px) { .inline-form { flex-direction: column; align-items: stretch; } }
.inline-num { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.inline-num input { width: 76px !important; text-align: center; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input[type=search] { flex: 1 1 240px; width: auto; }
.filters select { width: auto; min-width: 160px; }
.filters input, .filters select { background: var(--card); }

.hint summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; list-style: none; display: inline-flex; }
.hint summary::-webkit-details-marker { display: none; }
.hint summary::after { content: "›"; margin-left: 6px; transition: transform .15s; }
.hint[open] summary::after { transform: rotate(90deg); }
.hint-body { margin-top: 10px; font-size: 14px; color: var(--muted); line-height: 1.9; }
.hint-body code { background: var(--hover); padding: 2px 6px; border-radius: 6px; font-size: 13px; color: var(--text); }

/* сегменты */
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--field); border-radius: var(--pill); align-self: flex-start; }
.seg label, .seg a { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .seg a { display: inline-flex; align-items: center; height: 34px; padding: 0 16px; border-radius: var(--pill); cursor: pointer; font-size: 14px; font-weight: 700; color: var(--muted); }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg input:checked + span, .seg a.on { background: var(--text); color: var(--bg); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.page-head .seg { background: var(--card); }

/* ---------- сообщения ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; background: var(--ok-soft); color: var(--ok); }
.flash-bad { background: var(--bad-soft); color: var(--bad); }
.flash-warn { background: var(--warn-soft); color: var(--warn); }
.done-note { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700; background: var(--ok-soft); color: var(--ok); }
.finish { display: flex; align-items: center; gap: 16px; padding: 8px 0 0; }
.finish img { width: 88px; height: auto; flex: none; }
.finish-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }

.chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: var(--pill); font-size: 12.5px; font-weight: 700; background: var(--hover); color: var(--muted); white-space: nowrap; vertical-align: middle; }
a.chip:hover { text-decoration: none; filter: brightness(.97); }
.chip-done { background: var(--ok-soft); color: var(--ok); }
.chip-review { background: var(--warn-soft); color: var(--warn); }
.chip-rework { background: var(--bad-soft); color: var(--bad); }
.chip-open { background: var(--accent-soft); color: var(--link); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: var(--pill); font-size: 14px; font-weight: 700; transition: opacity .15s, transform .15s; pointer-events: none; z-index: 50; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- прогресс ---------- */
.bar { height: 8px; border-radius: var(--pill); background: var(--field); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .3s; }
.bar-thin { height: 6px; }
.bar-done i { background: var(--ok); }
.progress-card { gap: 14px; }
.progress-num { font-size: 15px; }
.mini-progress { display: flex; flex-direction: column; gap: 6px; min-width: 180px; max-width: 280px; }
.mini-progress + .mini-progress { margin-top: 10px; }

/* ---------- уроки ---------- */
.lessons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lesson-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px 14px 14px; background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); color: var(--text); transition: box-shadow .15s; }
a.lesson-item:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--accent-line); }
.lesson-item.state-locked { opacity: .55; }
.lesson-num { width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; background: var(--field); color: var(--muted); }
.state-open .lesson-num, .lesson-num.state-open, .state-rework .lesson-num, .lesson-num.state-rework { background: var(--accent); color: var(--accent-ink); }
.state-done .lesson-num, .lesson-num.state-done { background: var(--ok-soft); color: var(--ok); }
.state-review .lesson-num, .lesson-num.state-review { background: var(--warn-soft); color: var(--warn); }
.lesson-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.lesson-title { font-weight: 700; }
.lesson-meta { font-size: 13px; color: var(--muted); }
.lesson-meta:empty { display: none; }
.lesson-body { margin-top: 4px; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.lesson-nav form { display: contents; }

.video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.video video, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-sm { max-width: 480px; border-radius: var(--radius-sm); }

/* ---------- текст урока ---------- */
.prose { font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 14px; }
.prose h2 { font-size: 22px; margin-top: 28px; }
.prose h3 { font-size: 18px; margin-top: 22px; }
.prose h4 { font-size: 16px; margin-top: 18px; }
.prose strong { font-weight: 800; }
.prose ul, .prose ol { padding-left: 22px; margin-bottom: 0; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--accent); }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--card); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose code { background: var(--hover); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.prose hr { border: 0; border-top: 1px solid var(--line-strong); margin: 24px 0; }
.prose figure { margin: 18px 0; }
.prose img { border-radius: var(--radius-sm); display: block; }
.prose figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }
.page-head .prose { font-size: 15px; }
.card .prose blockquote { background: var(--field); }

/* ---------- файлы ---------- */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.file { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); min-width: 0; }
.file:hover { text-decoration: none; border-color: var(--accent-line); }
.file-inline { align-self: flex-start; max-width: 100%; }
.file-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--link); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.file-thumb { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: none; }
.file-main { display: flex; flex-direction: column; min-width: 0; }
.file-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- тест ---------- */
.quiz { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.q { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; display: flex; flex-direction: column; gap: 8px; align-self: stretch; min-width: 0; }
.q-title { font-weight: 700; }
.q-num { color: var(--muted); }
.q-hint { margin-top: -4px; }
.q-wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; cursor: pointer; }
.opt:hover { background: var(--hover); }
.q-wrong .opt:hover { background: rgba(255, 255, 255, .4); }

/* редактор теста */
.qe { display: flex; flex-direction: column; gap: 12px; }
.qe-q { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.qe-q.qe-bad { border-color: var(--bad); }
.qe-head { display: flex; gap: 8px; align-items: flex-start; }
.qe-head .qe-n { width: 28px; height: var(--h); display: inline-flex; align-items: center; color: var(--muted); font-weight: 800; flex: none; }
.qe-opt { display: flex; gap: 8px; align-items: center; padding-left: 36px; }
.qe-opt input[type=checkbox] { margin: 0; }
.qe-err { color: var(--bad); font-size: 13px; font-weight: 600; padding-left: 36px; }
.qe-foot { padding-left: 36px; }

/* ---------- задания ---------- */
.task-form { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.task-form .field { align-self: stretch; }
.subs { display: flex; flex-direction: column; gap: 10px; }
.sub { display: flex; flex-direction: column; gap: 10px; align-items: stretch; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sub > .btn, .sub > .file { align-self: flex-start; }
.sub-text { white-space: normal; overflow-wrap: anywhere; }
.answer { padding: 12px 16px; background: var(--field); border-radius: var(--radius-sm); }
.sub-comment { padding: 10px 16px; border-left: 3px solid var(--accent); background: var(--field); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; display: flex; flex-direction: column; gap: 2px; }
.review-form { display: flex; flex-direction: column; gap: 12px; }
.review-focus { box-shadow: 0 0 0 2px var(--accent); }
.review details .review-form { margin-top: 12px; }

/* ---------- списки и таблицы ---------- */
.list { display: flex; flex-direction: column; }
.card.list { padding: 8px; gap: 0; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.list-row:first-child { border-top: 0; }
.card.list .list-row { padding: 12px 16px; border-radius: var(--radius-sm); border-top: 0; }
.list-link { color: var(--text); }
.list-link:hover { background: var(--hover); text-decoration: none; }
.list-link-inner { color: var(--text); }
.list-link-inner:hover { text-decoration: none; }
.list-link-inner:hover .strong { color: var(--link); }
.list-row .lesson-num { width: 30px; height: 30px; font-size: 13px; }

.card.table-card { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 14px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 16px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--hover); }
.table .right { text-align: right; }
.table a.strong { color: var(--text); }
.table a.strong:hover { color: var(--link); }
.w-progress { width: 34%; }
@media (max-width: 760px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 16px 20px; border-bottom: 1px solid var(--line); }
  .table tr:last-child { border-bottom: 0; }
  .table td { padding: 4px 0; border: 0; text-align: left !important; }
  .table td[data-label="Задания"], .table td[data-label="Был"] { display: inline-block; width: auto; margin-right: 12px; }
  .table td.right { display: inline-block; width: auto; float: right; margin-top: -2px; margin-right: -14px; }
  .mini-progress { max-width: none; }
}

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
a.stat:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--accent-line); }
.stat-num { font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.add-panel > summary { display: none; }
.add-panel[open] { display: block; }

/* ссылка ученика */
.link-card { gap: 12px; }
.link-card-new { box-shadow: 0 0 0 2px var(--accent); }
.link-value { width: 100%; text-align: left; padding: 11px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--field); cursor: copy; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.link-value:hover { border-color: var(--accent); }

/* загрузка */
.uploader { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.uploader .btn { cursor: pointer; }
.uploader-progress { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 480px; }
.savebar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 14px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 5; }

@media (max-width: 600px) {
  h1 { font-size: 24px; }
  .top-in { height: 64px; gap: 8px; }
  .brand { height: 44px; padding: 4px 16px 4px 4px; gap: 10px; }
  .brand-logo { width: 36px; height: 36px; }
  .brand-name { font-size: 13px; }
  .card { padding: 18px; }
  .danger-zone { padding: 14px 18px; }
  .area-learner .top-user { max-width: 40%; }
  /* в шапке команды на телефоне остаётся только знак */
  .area-admin .brand { padding: 4px; }
  .area-admin .brand-name, .area-admin .brand-sub, .area-admin .top-user { display: none; }
  .area-admin .nav { height: 44px; }
  .area-admin .nav a { height: 36px; padding: 0 12px; }
}
@media (max-width: 380px) {
  .area-learner .brand-sub { display: none; }
}
