/* Fidex BuxTrenajyor — интерфейс «рабочий стол бухгалтера».
   Идея: гроссбух. Двойная линия под шапками таблиц, Т-счёт как мотив, моноширинные цифры. */

:root {
  --navy: #10162a;
  --navy-2: #1a2240;
  --navy-3: #262f55;
  --accent: #7B5CFF;
  --accent-d: color-mix(in srgb, var(--accent) 82%, #000);
  --accent-l: color-mix(in srgb, var(--accent) 12%, #fff);
  --cyan: #4CC9F0;
  --bg: #f6f7fb;
  --card: #fff;
  --line: #e1e4ef;
  --line-2: #eef0f7;
  --ink: #171d3a;
  --ink-2: #3b4263;
  --muted: #6a7290;
  --ok: #138a5b;
  --ok-bg: #e5f6ee;
  --err: #cf2f47;
  --err-bg: #fdebee;
  --warn: #cf7414;
  --warn-bg: #fff1df;
  --r: 12px;
  --r-s: 8px;
  --shadow: 0 1px 2px rgba(16, 22, 42, .06), 0 4px 14px rgba(16, 22, 42, .05);
  --shadow-l: 0 12px 40px rgba(16, 22, 42, .22);
  --font: Bahnschrift, "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
  --top-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink);
  background: var(--bg); min-height: 100vh; overflow-x: hidden;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 21px; } h3 { font-size: 16px; }
p { margin: 0 0 .6em; }
a { color: var(--accent-d); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

.ico { display: inline-flex; flex: none; line-height: 0; }
.boot { display: grid; place-items: center; min-height: 100vh; background: var(--navy); }
.boot-spin, .spinner {
  width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(123, 92, 255, .25); border-top-color: var(--cyan);
  animation: spin .8s linear infinite; display: inline-block; flex: none;
}
.btn .spinner { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 32px; justify-content: center; }

/* ---------- оболочка ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h); background: var(--navy); color: #fff;
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background-image: linear-gradient(90deg, rgba(123, 92, 255, .22), transparent 38%);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--cyan) 40%, transparent 75%); opacity: .8; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none !important; }
.brand img { border-radius: 8px; }
.brand-t { display: flex; flex-direction: column; line-height: 1.1; }
.brand-t b { font-size: 16px; letter-spacing: .01em; }
.brand-t small { font-size: 11px; color: #9aa3c8; letter-spacing: .04em; }
.co-chip { display: flex; flex-direction: column; line-height: 1.15; padding-left: 14px; margin-left: 4px; border-left: 1px solid rgba(255, 255, 255, .14); font-size: 13px; }
.co-chip small { color: #9aa3c8; font-size: 11px; }
.top-spacer { flex: 1; }
.icon-btn { background: transparent; border: 0; padding: 6px; border-radius: 8px; color: inherit; display: inline-grid; place-items: center; text-decoration: none !important; }
.icon-btn:hover { background: rgba(127, 135, 170, .18); }
.topbar .icon-btn { color: #cfd5f2; }
.burger { display: none; }
.lang { display: inline-flex; background: rgba(255, 255, 255, .08); border-radius: 999px; padding: 3px; }
.lang button { border: 0; background: transparent; color: #b9c1e6; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: .04em; }
.lang button.on { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--cyan))); color: #fff; }
.lang button:not(.on):hover { color: #fff; }
.user { display: flex; align-items: center; gap: 4px; }
.user-n { display: flex; flex-direction: column; line-height: 1.15; text-align: right; margin-right: 6px; font-size: 13px; }
.user-n small { color: #9aa3c8; font-size: 11px; }
.mode-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: rgba(76, 201, 240, .14); color: var(--cyan); text-decoration: none !important; }
.mode-chip.exam { background: rgba(232, 134, 42, .2); color: #ffb36b; }
.mode-chip.task { background: rgba(123, 92, 255, .28); color: #d9d0ff; }

.body { flex: 1; display: grid; grid-template-columns: 248px minmax(0, 1fr) auto; align-items: start; }
.side {
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; background: var(--card);
  border-right: 1px solid var(--line); padding: 10px 10px 24px;
}
.nav-group { margin-bottom: 10px; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; padding: 12px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 8px 10px; border-radius: var(--r-s); color: var(--ink-2); font-size: 14.5px; text-decoration: none !important; position: relative;
}
.nav-item:hover { background: var(--line-2); }
.nav-item.on { background: var(--accent-l); color: var(--accent-d); font-weight: 700; }
.nav-item.on::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.nav-item .ico { color: var(--muted); }
.nav-item.on .ico { color: var(--accent); }
.side-overlay { display: none; }
.main-col { min-width: 0; display: flex; flex-direction: column; min-height: calc(100vh - var(--top-h)); }
.main { flex: 1; padding: 24px 28px 32px; min-width: 0; }
.view { animation: fadeUp .28s ease backwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.site-foot { padding: 14px 28px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: var(--card); text-align: center; }

/* ---------- заголовок страницы ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title h1::before { content: ""; display: inline-block; width: 6px; height: .86em; background: linear-gradient(var(--accent), var(--cyan)); border-radius: 3px; margin-right: 10px; vertical-align: -.08em; }
.page-sub { color: var(--muted); margin: 4px 0 0 16px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs .sep { opacity: .5; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-s);
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: 14.5px; text-decoration: none !important;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { background: var(--line-2); border-color: #cdd2e4; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-d)); color: #fff; border-color: var(--accent-d); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 90%, #fff), var(--accent)); }
.btn.primary.danger { background: var(--err); border-color: var(--err); box-shadow: none; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13.5px; }
.btn.big { height: 48px; font-size: 16px; padding: 0 22px; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; }
.btn.danger-ghost { color: var(--err); }
.btn.danger-ghost:hover { background: var(--err-bg); border-color: #f2b9c2; }
.btn:disabled { opacity: .6; cursor: default; }
.btn kbd { font-family: var(--mono); font-size: 11px; background: rgba(255, 255, 255, .22); padding: 1px 6px; border-radius: 5px; margin-left: 4px; }
.btn-sub { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 2px; }
.link { background: none; border: 0; color: var(--accent-d); padding: 0; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }

/* ---------- формы ---------- */
.inp {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid #cdd2e4; border-radius: var(--r-s); background: #fff; color: var(--ink); font: inherit; font-size: 14.5px;
  transition: border-color .12s, box-shadow .12s;
}
textarea.inp { height: auto; padding: 10px 12px; font-family: var(--mono); font-size: 13px; }
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.inp:disabled { background: #f1f3f9; color: var(--ink-2); }
.inp.num { text-align: right; font-variant-numeric: tabular-nums; }
.inp.color { padding: 3px; width: 72px; }
.inp.computed { display: flex; align-items: center; background: #f1f3f9; border-style: dashed; color: var(--ink-2); }
.inp-suffix { position: relative; }
.inp-suffix .inp { padding-right: 28px; }
.inp-suffix span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; margin-bottom: 14px; }
.field { min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; letter-spacing: .01em; }
.req { color: var(--err); }
.field-help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field-err { color: var(--err); font-size: 12.5px; margin-top: 4px; font-weight: 600; }
.has-err > .inp, .has-err .inp { border-color: var(--err); background: #fffafb; }
.field-money .inp { font-size: 16px; font-weight: 600; }
.filters { display: flex; gap: 14px; align-items: flex-end; margin-bottom: 14px; flex-wrap: wrap; }
.filters .field { min-width: 160px; }
.params { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; align-items: flex-end; }
.params .field { min-width: 200px; }

.combo { position: relative; }
.combo .inp { padding-right: 30px; }
.combo-caret { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.combo-list { position: fixed; z-index: 90; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid #cdd2e4; border-radius: 10px; box-shadow: var(--shadow-l); max-height: 260px; overflow: auto; }
.combo-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.combo-item small { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.combo-item:hover, .combo-item.act { background: var(--accent-l); }
.combo-item.sel { font-weight: 700; color: var(--accent-d); }
.combo-empty { padding: 12px; color: var(--muted); font-size: 13.5px; }

/* строки документа */
.lines { margin-top: 2px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.lines .table-scroll { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.lines-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.lines-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); background: #eef0f8; padding: 9px 8px; border-bottom: 3px double #cdd2e4; white-space: nowrap; }
.lines-table td { padding: 6px 6px; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.lines-table tr:last-child td { border-bottom: 0; }
.lines-table .th-num, .lines-table .cell-num { text-align: right; }
.lines-table .inp { height: 36px; font-size: 14px; }
.lines-table .cell { min-width: 120px; }
.lines-table .cell-sum { padding-top: 14px; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; min-width: 110px; }
.lines-table .cell-act, .lines-table .th-act { width: 34px; }
.lines-table .cell-hidden > * { visibility: hidden; }
.lines-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; }
.lines-total { font-weight: 700; font-size: 15px; }
.lines-total-v { font-variant-numeric: tabular-nums; color: var(--accent-d); }

/* ---------- карточки, таблицы ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); background: #eef0f8; padding: 11px 14px; border-bottom: 3px double #cdd2e4; white-space: nowrap; font-weight: 700; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafbff; }
.tbl.clickable tbody tr { cursor: pointer; }
.tbl .th-num, .tbl .cell-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .cell-text { color: var(--ink-2); min-width: 180px; }
.tbl .cell-sub { color: var(--muted); font-size: 13px; }
.tbl .th-act, .tbl .cell-act { width: 1%; }
.tbl tr.blocked td { opacity: .55; }
.tbl tr.row-user td { background: #fbfaff; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.chip-ok { background: var(--ok-bg); color: var(--ok); } .chip-warn { background: var(--warn-bg); color: var(--warn); } .chip-err { background: var(--err-bg); color: var(--err); }
.chip-type { background: var(--accent-l); color: var(--accent-d); font-family: var(--mono); }
.chip-mine { background: var(--accent-l); color: var(--accent-d); margin-left: 8px; }
.chip-task { background: var(--ok-bg); color: var(--ok); margin-left: 10px; }
.chip-kind.kind-entries { background: #ece8ff; color: #5a3fd8; } .chip-kind.kind-answer { background: #e0f6fd; color: #0b7a9c; } .chip-kind.kind-quiz { background: #fff1d6; color: #9a6410; } .chip-kind.kind-directory { background: #e4f6ec; color: #17794f; }
.chip-btn { border: 1px solid var(--line); background: #fff; cursor: pointer; }
.chip-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 6px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); } .badge-draft { background: var(--warn-bg); color: var(--warn); } .badge-new { background: var(--accent-l); color: var(--accent-d); }
.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin: 12px 0; }
.alert.err { background: var(--err-bg); color: #8e1f30; border: 1px solid #f4bcc5; }
.alert-in { display: flex; gap: 10px; align-items: flex-start; } .alert-in p { margin: 2px 0 0; }
.alert-in .ico { color: var(--err); margin-top: 2px; }
.pbar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; min-width: 60px; }
.pbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--cyan)); border-radius: 99px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.pbar.light { background: rgba(255, 255, 255, .16); }
.pbar.s-a i { background: #1fb878; } .pbar.s-b i { background: #8fd36a; } .pbar.s-c i { background: #f2b24a; } .pbar.s-d i, .pbar.s-z i { background: #e8665c; }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-mark { display: inline-flex; align-items: center; gap: 0; font-weight: 800; font-size: 20px; color: #b6bcd8; margin-bottom: 12px; font-family: var(--mono); }
.empty-mark i { width: 3px; height: 28px; background: linear-gradient(var(--accent), var(--cyan)); margin: 0 10px; border-radius: 2px; }
.empty-title { font-size: 17px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.empty-hint { max-width: 420px; margin: 0 auto 14px; }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--navy); }
.login-art {
  position: relative; display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(600px 400px at 20% 20%, rgba(123, 92, 255, .38), transparent 60%),
    radial-gradient(520px 420px at 85% 85%, rgba(76, 201, 240, .22), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 100% 36px,
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 36px 100%,
    var(--navy);
}
.tmotif { width: min(360px, 70%); color: #fff; }
.tm-head { display: grid; grid-template-columns: 1fr 1fr; font-size: 54px; font-weight: 800; text-align: center; letter-spacing: .02em; border-bottom: 5px solid; border-image: linear-gradient(90deg, var(--accent), var(--cyan)) 1; padding-bottom: 6px; }
.tm-head span:last-child { color: var(--cyan); }
.tm-body { display: grid; grid-template-columns: 1fr 1fr; }
.tm-body > div { padding: 16px 10px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.tm-body > div:last-child { border-left: 5px solid; border-image: linear-gradient(var(--cyan), transparent) 1; }
.tm-body i { font-style: normal; font-family: var(--mono); font-size: 20px; padding: 6px 14px; border-radius: 8px; background: rgba(255, 255, 255, .07); color: #cfd5f2; animation: slideIn .8s both; }
@keyframes slideIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.login-main { background: var(--navy-2); display: flex; flex-direction: column; padding: 18px 28px; min-height: 100vh; }
.login-top { display: flex; justify-content: flex-end; }
.login-card { margin: auto; width: min(400px, 100%); background: #fff; border-radius: 18px; padding: 30px 28px; box-shadow: var(--shadow-l); position: relative; }
.login-card::before { content: ""; position: absolute; left: 28px; right: 28px; top: 0; height: 4px; border-radius: 0 0 4px 4px; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.login-logo { border-radius: 14px; margin-bottom: 14px; }
.login-lead { color: var(--muted); margin: 6px 0 20px; }
.login-form .field { margin-bottom: 14px; }
.mock-note { font-size: 12px; color: var(--muted); margin: 16px 0 0; text-align: center; }
.login-main .site-foot { background: transparent; border: 0; color: #8f98c0; padding: 10px 0 0; }
.plain-page, .bare-page { min-height: 100vh; }
.bare-head { display: flex; justify-content: space-between; align-items: center; background: var(--navy); padding: 10px 16px; }
.bare-page .view { padding: 20px 16px; }

/* ---------- карта курса ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr); gap: 24px; color: #fff; border-radius: 18px; padding: 28px 30px; margin-bottom: 22px; position: relative; overflow: hidden;
  background:
    radial-gradient(420px 260px at 90% 0%, rgba(76, 201, 240, .3), transparent 65%),
    radial-gradient(520px 300px at 0% 100%, rgba(123, 92, 255, .5), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 100% 28px,
    var(--navy);
}
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--cyan); font-weight: 700; margin-bottom: 8px; }
.hero h1 { font-size: 32px; margin-bottom: 8px; } .hero p { color: #c5ccea; max-width: 56ch; margin: 0; }
.hero-stat { align-self: center; display: flex; flex-direction: column; gap: 10px; }
.hero-pct { font-size: 64px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; } .hero-pct small { font-size: 28px; color: var(--cyan); margin-left: 3px; }
.hero-sub { color: #c5ccea; font-size: 13.5px; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.mod-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 16px; color: var(--ink); text-decoration: none !important;
  box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s; animation: fadeUp .4s backwards; overflow: hidden;
}
.mod-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--accent), var(--cyan)); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
a.mod-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(16, 22, 42, .12); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
a.mod-card:hover::before { transform: scaleX(1); }
.mod-no { font-size: 58px; line-height: .9; font-weight: 800; color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--accent) 55%, transparent); font-family: var(--font); letter-spacing: -.03em; }
.mod-title { font-weight: 700; font-size: 15.5px; min-height: 2.9em; }
.mod-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.mod-dots i { width: 14px; height: 14px; border-radius: 4px; background: var(--line); }
.mod-dots i.d-done { background: #1fb878; } .mod-dots i.d-open { background: var(--accent); }
.mod-foot { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); align-items: center; }
.mod-pct { font-weight: 800; color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.mod-lock { display: inline-flex; gap: 6px; align-items: center; }
.mod-card.locked { background: repeating-linear-gradient(135deg, #f3f4f9 0 8px, #eceef6 8px 16px); cursor: not-allowed; box-shadow: none; }
.mod-card.locked .mod-no { -webkit-text-stroke-color: #c3c8dc; } .mod-card.locked .mod-title { color: var(--muted); }
.mod-card.complete { border-color: #a9e2c8; } .mod-card.complete .mod-pct { color: var(--ok); }

.module-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.goals-card { background: linear-gradient(135deg, var(--accent-l), #fff 60%); }
.goals h3 { margin-bottom: 6px; } .goals ul { margin: 0; padding-left: 20px; color: var(--ink-2); }
.lesson { font-size: 15.5px; line-height: 1.7; }
.lesson h3 { margin: 1.3em 0 .4em; font-size: 18px; } .lesson h3:first-child { margin-top: 0; }
.lesson pre { background: var(--navy); color: #d9defb; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; border-left: 4px solid var(--accent); }
.lesson ul, .lesson ol { padding-left: 22px; } .lesson li { margin: .25em 0; }
.tasklist { position: sticky; top: calc(var(--top-h) + 16px); padding: 0; overflow: hidden; }
.tasklist-head { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 18px 10px; }
.tasklist ul { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 160px); overflow: auto; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line-2); }
.task-main { flex: 1; min-width: 0; } .task-id { font-family: var(--mono); font-size: 12px; color: var(--muted); } .task-title { font-size: 14px; font-weight: 600; line-height: 1.3; margin-bottom: 3px; }
.task-score { font-weight: 800; font-size: 13px; } .s-ok { color: var(--ok); } .s-warn { color: var(--warn); } .s-err { color: var(--err); }
.st { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.st-done { background: var(--ok-bg); color: var(--ok); } .st-open { background: var(--accent-l); } .st-open i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.st-new { background: var(--line-2); } .st-new i { width: 8px; height: 8px; border-radius: 50%; background: #b9bfd6; }

/* ---------- раздел и документ ---------- */
.create-card { padding: 14px 18px; } .create-t { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.creators { display: flex; gap: 8px; flex-wrap: wrap; }
.creators-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 18px; }
.cgroup-t { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.doc-card { padding: 22px 24px; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 3px double var(--line); flex-wrap: wrap; }
.doc-head h1 { margin-top: 6px; font-size: 24px; display: inline-block; }
.doc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 220px)); gap: 14px 18px; margin-bottom: 14px; }
.doc-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line-2); }
.entries-card h3 { margin-bottom: 10px; }
.entries-table td { font-size: 14px; } .acc { font-weight: 600; } .an { display: block; color: var(--muted); font-size: 12px; } .an.block { margin-top: 2px; }

/* ---------- панель задачи ---------- */
.tp { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); width: 392px; overflow-y: auto; background: var(--card); border-left: 1px solid var(--line); box-shadow: -6px 0 24px rgba(16, 22, 42, .05); }
.tp.collapsed { width: 54px; overflow: hidden; }
.tp.collapsed .tp-body, .tp.collapsed .tp-name, .tp.collapsed .chip { display: none; }
.tp.collapsed .tp-head { flex-direction: column; height: 100%; align-items: center; padding: 14px 6px; cursor: pointer; }
.tp.collapsed .tp-title { writing-mode: vertical-rl; margin-top: 8px; }
.tp-head { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; background: var(--navy); color: #fff; cursor: pointer; background-image: linear-gradient(90deg, rgba(123, 92, 255, .35), transparent); }
.tp-title { display: flex; align-items: center; gap: 10px; min-width: 0; } .tp-id { font-family: var(--mono); font-weight: 800; background: var(--accent); padding: 2px 8px; border-radius: 6px; font-size: 13px; } .tp-name { font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.tp-badges { display: flex; align-items: center; gap: 6px; } .tp-head .icon-btn { color: #cfd5f2; }
.tp-body { padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.tp-meta { display: flex; gap: 6px; flex-wrap: wrap; } .chip-date { background: #e0f6fd; color: #0b6f8f; }
.tp-text { white-space: pre-line; font-size: 15px; line-height: 1.6; background: linear-gradient(180deg, #fbfaff, #fff); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 14px; }
.hints { display: flex; flex-direction: column; gap: 8px; }
.hint-steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.hint-steps li { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); background: var(--line-2); padding: 5px 8px; border-radius: 8px; line-height: 1.2; }
.hint-steps li i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; background: #cfd4e6; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 11px; flex: none; }
.hint-steps li.on { background: var(--warn-bg); color: var(--warn); } .hint-steps li.on i { background: var(--warn); }
.hint { background: var(--warn-bg); border: 1px solid #f6d6ae; border-radius: 10px; padding: 9px 12px; font-size: 14px; } .hint b { font-size: 12px; color: var(--warn); text-transform: uppercase; letter-spacing: .06em; } .hint p { margin: 3px 0 0; white-space: pre-line; }
.hints-off { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; background: var(--line-2); padding: 8px 10px; border-radius: 8px; }
.note { display: flex; gap: 8px; color: var(--ink-2); font-size: 13.5px; background: var(--line-2); padding: 10px 12px; border-radius: 10px; }
.quiz { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14.5px; }
.quiz-opt:hover { border-color: var(--accent); } .quiz-opt.sel { border-color: var(--accent); background: var(--accent-l); } .quiz-opt input { margin-top: 4px; accent-color: var(--accent); }
.tp-foot { display: flex; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--line-2); padding-top: 12px; }
.res { border-radius: 14px; padding: 14px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; animation: pop .35s cubic-bezier(.2, 1.2, .3, 1) backwards; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.res-ok { background: linear-gradient(180deg, var(--ok-bg), #fff 70%); border-color: #a9e2c8; } .res-warn { background: linear-gradient(180deg, var(--warn-bg), #fff 70%); border-color: #f6d6ae; } .res-err { background: linear-gradient(180deg, var(--err-bg), #fff 70%); border-color: #f4bcc5; }
.res-saved { flex-direction: row; background: var(--ok-bg); border-color: #a9e2c8; color: var(--ok); align-items: flex-start; } .res-saved p { margin: 2px 0 0; color: var(--ink-2); }
.res-head { display: flex; gap: 14px; align-items: center; } .res-msg b { font-size: 16.5px; } .res-msg p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { display: block; } .ring-bg { fill: none; stroke: rgba(16, 22, 42, .08); stroke-width: 9; } .ring-fg { fill: none; stroke: currentColor; stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray .8s; }
.ring-ok { color: #1fb878; } .ring-warn { color: #f0932b; } .ring-err { color: #e8465b; }
.ring-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; } .ring-num small { font-size: 14px; color: var(--muted); margin-left: 1px; }
.res-title { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; margin: 4px 0 4px; } .cnt { font-weight: 800; font-family: var(--mono); }
.res-ok .res-title b, .res-group.res-ok .res-title { color: var(--ok); } .res-group.res-miss .res-title { color: var(--err); } .res-group.res-extra .res-title { color: var(--warn); }
.lines-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ln { padding: 8px 10px; border-radius: 8px; font-size: 13.5px; border-left: 4px solid; background: #fff; display: flex; flex-direction: column; gap: 2px; word-break: break-word; }
.ln-ok { border-color: #1fb878; background: #f3fbf7; } .ln-miss { border-color: #e8465b; background: #fff6f7; } .ln-extra { border-color: #f0932b; background: #fffaf2; }
.ln-text { font-weight: 600; font-variant-numeric: tabular-nums; } .ln-memo { color: var(--muted); font-size: 12.5px; }
.explain { background: #fff; border: 1px solid #cfe9dd; border-radius: 12px; padding: 12px 14px; } .explain-title { display: flex; gap: 8px; align-items: center; font-weight: 800; color: var(--ok); margin-bottom: 6px; } .explain-text { font-size: 14px; color: var(--ink-2); white-space: pre-line; }
.tscheme { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 6px; }
.tacc { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; font-size: 13px; }
.tacc-head { background: var(--navy); color: #fff; padding: 6px 8px; font-weight: 700; font-size: 12px; line-height: 1.25; }
.tacc-body { display: grid; grid-template-columns: 1fr 1fr; min-height: 54px; }
.tacc-col { display: flex; flex-direction: column; gap: 3px; padding: 6px 7px; font-variant-numeric: tabular-nums; } .tacc-col em { font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; opacity: .6; } .tacc-col.dt em { color: var(--accent-d); } .tacc-col.kt em { color: #0b7a9c; }
.tacc-col.kt { border-left: 2px solid var(--navy); } .tacc-col span { font-weight: 700; }
.res-next { display: flex; gap: 8px; } .res-next .btn { flex: 1; }

/* ---------- отчёты ---------- */
.report-title { margin-bottom: 14px; display: none; } .report-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.report .table-scroll { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.rp-table td, .rp-table th { white-space: nowrap; } .rp-table tr.rp-child td { background: #fafbff; font-size: 13px; color: var(--ink-2); } .rp-table tr.rp-child td:first-child { padding-left: 38px; }
.rp-bold td { font-weight: 700; } .rp-table tfoot td { font-weight: 800; background: #eef0f8; border-top: 3px double #cdd2e4; padding: 11px 14px; }
.twisty { border: 0; background: var(--line-2); border-radius: 5px; width: 22px; height: 22px; display: inline-grid; place-items: center; margin-right: 8px; vertical-align: middle; padding: 0; transition: transform .15s; }
.twisty[aria-expanded="true"] { transform: rotate(90deg); background: var(--accent-l); color: var(--accent-d); }
.tw-sp { display: inline-block; width: 30px; }
.zero { color: #c4c9dc; } .report-tools { display: flex; gap: 8px; margin-bottom: 10px; } .report-note { display: flex; gap: 8px; color: var(--muted); font-size: 13px; margin-top: 10px; }

/* ---------- экзамен, сертификат ---------- */
.exam-bar { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; } .exam-bar p { margin: 0; flex-basis: 100%; }
.exam-timer { display: flex; align-items: center; gap: 10px; font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; font-family: var(--mono); color: var(--navy); } .exam-timer.low { color: var(--err); animation: blink 1s infinite; } @keyframes blink { 50% { opacity: .55; } }
.exam-count { font-weight: 700; color: var(--ink-2); }
.exam-tasks { list-style: none; margin: 0; padding: 0; } .exam-task { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line-2); } .exam-task.cur { background: var(--accent-l); } .exam-n { width: 26px; height: 26px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-weight: 800; font-size: 12px; } .exam-tt { flex: 1; min-width: 0; }
.exam-start { max-width: 720px; } .exam-start h2 { margin-bottom: 8px; } .exam-rules { list-style: none; padding: 0; margin: 14px 0 20px; display: grid; gap: 8px; } .exam-rules li { display: flex; gap: 8px; align-items: center; } .exam-rules .ico { color: var(--ok); }
.exam-result { display: flex; gap: 24px; align-items: center; max-width: 720px; } .exam-score { font-size: 72px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; } .exam-score small { font-size: 30px; } .exam-result.pass { border-color: #a9e2c8; background: linear-gradient(135deg, var(--ok-bg), #fff 70%); } .exam-result.pass .exam-score { color: var(--ok); } .exam-result.fail .exam-score { color: var(--err); } .exam-result h2 { margin-bottom: 6px; }
.verify-badge { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; font-weight: 800; } .verify-badge.ok { background: var(--ok-bg); color: var(--ok); } .verify-badge.bad { background: var(--err-bg); color: var(--err); }
.verify-wrap { padding: 40px 0; text-align: center; }
.cert-page { max-width: 1120px; margin: 0 auto; } .cert-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cert-sheet { page: cert; container-type: inline-size; width: 100%; aspect-ratio: 297 / 210; background: #fff; box-shadow: var(--shadow-l); border-radius: 6px; padding: 2.2%; position: relative; }
.cert-frame { --u: calc(100cqw / 80); font-size: var(--u); height: 100%; border: .25em solid var(--navy); outline: .12em solid var(--accent); outline-offset: -.9em; padding: 2.2em 3.2em; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative;
  background: radial-gradient(30em 20em at 100% 0, rgba(76, 201, 240, .13), transparent 60%), radial-gradient(34em 22em at 0 100%, rgba(123, 92, 255, .13), transparent 60%), #fff; }
.cert-top { display: flex; align-items: center; gap: 1em; align-self: stretch; text-align: left; } .cert-top img { width: 3.6em; height: 3.6em; } .cert-org b { display: block; font-size: 1.5em; } .cert-org span { color: var(--muted); font-size: 1em; }
.cert-kicker { margin-top: .6em; letter-spacing: .4em; font-size: .95em; color: var(--accent-d); text-transform: uppercase; font-weight: 700; }
.cert-title { font-size: 4.2em; letter-spacing: .14em; color: var(--navy); line-height: 1.1; margin: .1em 0 .1em; font-weight: 800; }
.cert-line { color: var(--muted); font-size: 1.25em; }
.cert-name { font-size: 3em; font-weight: 800; margin: .25em 0; padding: 0 1em .1em; border-bottom: .09em solid var(--accent); line-height: 1.2; }
.cert-text { font-size: 1.3em; max-width: 36em; color: var(--ink-2); }
.cert-mods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4em .9em; margin-top: 1em; width: 100%; max-width: 64em; font-size: .86em; }
.cert-mod { min-width: 0; display: flex; justify-content: space-between; gap: .6em; padding: .25em .6em; border-radius: .4em; background: #f4f5fa; text-align: left; } .cert-mod b { flex: none; } .cert-mods .cert-mod span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; } .cert-mod span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cert-bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; align-self: stretch; text-align: left; font-size: 1.05em; }
.cert-meta > div { margin-top: .25em; } .cert-url { font-size: .75em; color: var(--muted); word-break: break-all; max-width: 34em; }
.cert-qr { text-align: center; } .cert-qr img { width: 8em; height: 8em; display: block; margin: 0 auto .3em; } .cert-qr small { font-size: .75em; color: var(--muted); display: block; max-width: 14em; }
.cert-mod.s-a b { color: var(--ok); } .cert-mod.s-z b, .cert-mod.s-none b { color: var(--muted); }

/* ---------- преподаватель, админ ---------- */
.grp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grp-card { display: block; color: var(--ink); text-decoration: none !important; transition: transform .15s, box-shadow .15s; } .grp-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(16, 22, 42, .12); }
.grp-name { font-size: 20px; font-weight: 800; } .grp-dates { color: var(--muted); margin: 2px 0 12px; } .grp-stats { display: flex; gap: 16px; margin-bottom: 8px; color: var(--ink-2); font-size: 14px; } .grp-stats span { display: inline-flex; gap: 6px; align-items: center; } .grp-card.archived { opacity: .6; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 10px 16px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; } .tab.on { color: var(--accent-d); border-bottom-color: var(--accent); } .tab:hover { color: var(--ink); }
.results th.th-mod { text-align: center; padding: 11px 4px; min-width: 38px; }
.results td { vertical-align: middle; }
.sticky-col { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 190px; box-shadow: 1px 0 0 var(--line); } .results thead .sticky-col { background: #eef0f8; } .results tbody tr:hover .sticky-col { background: #fafbff; }
.stu-name { font-weight: 700; color: var(--ink); display: block; line-height: 1.25; } .results td small { display: block; color: var(--muted); }
.heat { text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; padding: 8px 2px !important; font-size: 13px; }
.heat-a { background: #bfead4; color: #0a6540; } .heat-b { background: #e0f2c2; color: #4d6d12; } .heat-c { background: #ffe3b6; color: #96590a; } .heat-d { background: #ffd1c6; color: #a3402d; } .heat-z { background: #f7dce1; color: #b04458; } .heat-none { background: #f1f2f7; color: #b4b9cf; }
.tbl .heat { border-bottom: 2px solid #fff; border-right: 2px solid #fff; }
.tbl tbody tr:hover td.heat { background-clip: padding-box; filter: brightness(.97); }
.cell-course { min-width: 130px; } .cell-course .pbar { display: inline-block; width: 80px; vertical-align: middle; margin-right: 8px; } .cell-course span { font-weight: 700; font-size: 13px; }
.legend { display: flex; gap: 14px; padding: 10px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-2); flex-wrap: wrap; } .legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.hardest h3 { display: flex; gap: 8px; align-items: center; color: var(--err); margin-bottom: 6px; } .hardest ol { margin: 0; padding-left: 20px; }
.sortbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.cell-bar { min-width: 140px; } .cell-bar .pbar { display: inline-block; width: 70px; vertical-align: middle; margin-right: 8px; } .cell-bar span { font-weight: 700; }
.errlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; } .errlist .cnt { color: var(--err); margin-right: 8px; }
.checklog { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; } .cl-head { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; } .cl-line { font-size: 13.5px; padding: 3px 0 3px 10px; border-left: 3px solid; } .cl-line em { font-style: normal; font-weight: 700; margin-right: 8px; font-size: 12px; text-transform: uppercase; } .cl-line.miss { border-color: #e8465b; } .cl-line.miss em { color: var(--err); } .cl-line.extra { border-color: #f0932b; } .cl-line.extra em { color: var(--warn); }
.audit td { font-size: 13px; }

.cred-card { border: 2px solid var(--navy); border-radius: 14px; padding: 18px 20px; background: #fff; position: relative; overflow: hidden; }
.cred-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.cred-brand { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; } .cred-brand img { border-radius: 8px; } .cred-brand span { display: block; color: var(--muted); font-size: 12px; }
.cred-title { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; } .cred-who { font-size: 22px; font-weight: 800; margin: 2px 0 12px; }
.cred-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 10px; } .cred-grid dt { color: var(--muted); } .cred-grid dd { margin: 0; font-weight: 700; font-size: 17px; word-break: break-all; }
.cred-note { font-size: 12.5px; color: var(--muted); margin: 0; }

/* ---------- модалки, тосты ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(16, 22, 42, .55); backdrop-filter: blur(2px); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s backwards; overflow: auto; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 16px; width: min(480px, 100%); box-shadow: var(--shadow-l); animation: pop .22s backwards; max-height: calc(100vh - 32px); overflow: auto; } .modal.wide { width: min(720px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 6px; } .modal-body { padding: 10px 20px 20px; }
.modal-text { font-size: 15px; } .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 120; display: grid; gap: 8px; max-width: calc(100vw - 32px); }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-l); font-size: 14px; border-left: 4px solid #1fb878; animation: slideT .25s both; } .toast.out { opacity: 0; transform: translateX(20px); transition: .3s; }
.toast-err { border-color: #e8465b; } .toast-warn { border-color: #f0932b; } @keyframes slideT { from { opacity: 0; transform: translateX(24px); } }

/* ---------- адаптив ---------- */
@media (max-width: 1280px) {
  .tp { width: 340px; }
  .module-layout { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1100px) {
  .co-chip, .user-n { display: none; }
  .module-layout { grid-template-columns: minmax(0, 1fr); } .tasklist { position: static; } .tasklist ul { max-height: none; }
}
@media (max-width: 900px) {
  :root { --top-h: 52px; }
  .burger { display: inline-grid; }
  .topbar { gap: 8px; padding: 0 10px; } .brand-t small { display: none; }
  .body { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: var(--top-h); bottom: 0; height: auto; width: 280px; z-index: 40; transform: translateX(-102%); transition: transform .25s; box-shadow: var(--shadow-l); }
  body.nav-open .side { transform: none; }
  body.nav-open .side-overlay { display: block; position: fixed; inset: var(--top-h) 0 0 0; background: rgba(16, 22, 42, .5); z-index: 35; }
  .main { padding: 16px 16px 24px; } .site-foot { padding: 12px 16px; }
  h1 { font-size: 22px; } .hero { grid-template-columns: 1fr; padding: 22px 20px; } .hero h1 { font-size: 26px; } .hero-pct { font-size: 52px; }
  .tp { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; height: auto; max-height: 82vh; z-index: 50; border-radius: 18px 18px 0 0; border: 0; box-shadow: 0 -10px 40px rgba(16, 22, 42, .3); }
  .tp.collapsed { width: 100%; }
  .tp.collapsed .tp-head { flex-direction: row; height: auto; padding: 12px 14px; }
  .tp.collapsed .tp-title { writing-mode: horizontal-tb; margin: 0; }
  .tp.collapsed .tp-name { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52vw; }
  .tp.collapsed .chip { display: inline-flex; }
  .tp-head { border-radius: 18px 18px 0 0; }
  body.has-panel .main-col { padding-bottom: 58px; }
  .login { grid-template-columns: 1fr; } .login-art { display: none; } .login-main { padding: 14px 16px; }
  .doc-card { padding: 16px 14px; } .form-grid { grid-template-columns: 1fr; } .doc-meta { grid-template-columns: 1fr; }
  .btn-sub { display: none; } .tbl th, .tbl td { padding: 9px 10px; }
  .exam-result { flex-direction: column; align-items: flex-start; } .exam-timer { font-size: 32px; }
  .toasts { bottom: 74px; }
  .cert-mods { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .lang button { padding: 4px 7px; } .brand-t b { font-size: 14.5px; } .mode-chip { padding: 4px 8px; font-size: 11.5px; }
  .mod-grid { grid-template-columns: 1fr; }
  .page-actions .btn { flex: 1 1 auto; }
}

/* ---------- печать ---------- */
@page cert { size: A4 landscape; margin: 0; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 12px; }
  .report-title { display: block; }
  .no-print, .topbar, .side, .side-overlay, .tp, .toasts, .site-foot, .crumbs, .page-actions, .params, .tabs { display: none !important; }
  .body { display: block; } .main { padding: 0; } .card, .report .table-scroll { box-shadow: none; border-color: #bbb; }
  .view { animation: none; }
  .table-scroll { overflow: visible; }
  .rp-table td, .rp-table th { white-space: normal; padding: 5px 8px; font-size: 11px; }
  body.print-landscape .cert-sheet { width: 297mm; height: 210mm; box-shadow: none; border-radius: 0; padding: 6mm; break-inside: avoid; }
  body.print-landscape { background: #fff; }
  body.print-landscape .main, body.print-landscape .bare-page .view, body.print-landscape .view { padding: 0; }
  body.print-landscape .cert-page { max-width: none; }
  body.print-cred #app { display: none; }
  body.print-cred .modal-back { position: static; background: none; backdrop-filter: none; display: block; padding: 0; }
  body.print-cred .modal { box-shadow: none; width: 105mm; margin: 10mm; animation: none; }
  body.print-cred .modal-head, body.print-cred .modal-actions { display: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; padding: 0 6px; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.results th, .results td { padding-left: 8px; padding-right: 8px; }
.results .sticky-col { min-width: 170px; }
.results .cell-act .btn { padding: 0 8px; font-size: 12.5px; height: 28px; }
.results .cell-act { display: table-cell; }
.results .cell-date { font-size: 12.5px; white-space: nowrap; }
@media (max-width: 480px) {
  .brand-t { display: none; }
  .topbar { gap: 6px; padding: 0 8px; }
  .mode-chip.task { padding: 4px 8px; }
  .user { gap: 0; }
}
.module-layout > * { min-width: 0; }
.lesson pre { max-width: 100%; white-space: pre; }
.lesson { overflow-wrap: anywhere; }

/* ---------- v2: простой путь новичка ---------- */
.todo { display: flex; flex-direction: column; gap: 8px; }
.todo-t { font-size: 12.5px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.todo-btn { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 12px; background: var(--accent-l); color: var(--ink); text-decoration: none !important; transition: transform .1s, box-shadow .15s; }
.todo-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 25%, transparent); }
.todo-n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.todo-txt { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; }
.todo-go { font-size: 12px; font-weight: 700; color: var(--accent-d); white-space: nowrap; }
.todo-list li.done .todo-btn { background: var(--ok-bg); border-color: #a9e2c8; }
.todo-list li.done .todo-n { background: var(--ok); }
.todo-list li.done .todo-go { color: var(--ok); }
.rep-links { display: flex; gap: 6px; flex-wrap: wrap; }
.rep-links .chip-btn { text-decoration: none; }
.tp-check { margin-top: 2px; }
.hints-box { border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; }
.hints-box summary { cursor: pointer; padding: 10px 0; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; color: var(--warn); }
.hints-box .hints { padding-bottom: 12px; }
.fix-btn { height: 52px; font-size: 17px; }
.exam-nav { display: flex; flex-direction: column; gap: 8px; }
.exam-nav-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.exam-counter { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 15px; }
.saved-pill { display: flex; align-items: center; gap: 8px; background: var(--ok-bg); color: var(--ok); font-weight: 800; padding: 8px 12px; border-radius: 999px; animation: pop .3s backwards; }
.section-t { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; margin: 6px 0 10px; }
.task-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 20px; }
.task-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.task-card.next { border: 2px solid var(--accent); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 22%, transparent); }
.task-card.st-done { background: linear-gradient(180deg, var(--ok-bg), #fff 60%); }
.tc-top { display: flex; justify-content: space-between; align-items: center; }
.tc-id { font-family: var(--mono); font-weight: 800; font-size: 20px; color: var(--accent-d); }
.tc-title { font-weight: 700; font-size: 14.5px; line-height: 1.3; flex: 1; min-height: 2.6em; }
.tc-meta { display: flex; justify-content: space-between; align-items: center; }
.lesson-box { padding: 0; }
.lesson-box summary { cursor: pointer; padding: 14px 18px; font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.lesson-box > .goals, .lesson-box > .lesson { padding: 0 20px 18px; }
.nav-fold { display: flex; width: 100%; justify-content: space-between; align-items: center; background: none; border: 0; cursor: pointer; text-align: left; }
.nav-fold .ico { transition: transform .15s; }
.nav-fold[aria-expanded="false"] .ico { transform: rotate(-90deg); }
.nav-sub .nav-item { padding-left: 14px; font-size: 14px; }
.onb-modal { width: min(480px, 100%); }
.onb { text-align: center; padding: 14px 6px 4px; }
.onb-art { position: relative; width: 92px; height: 92px; border-radius: 26px; background: linear-gradient(135deg, var(--accent), var(--cyan)); color: #fff; display: grid; place-items: center; margin: 0 auto 16px; }
.onb-n { position: absolute; right: -8px; top: -8px; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; display: grid; place-items: center; border: 3px solid #fff; }
.onb h2 { margin-bottom: 8px; } .onb-text { color: var(--ink-2); font-size: 16px; }
.onb-dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0 4px; } .onb-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); } .onb-dots i.on { background: var(--accent); width: 22px; border-radius: 4px; }
.onb-actions { justify-content: space-between; }
.doc-actions .btn.big { height: 48px; }

/* ---------- v3: экзамен и многодокументные задачи ---------- */
.need-more { display: flex; gap: 10px; background: var(--warn-bg); border: 1px solid #f6d6ae; border-radius: 12px; padding: 12px 14px; color: #7a4a0a; }
.need-more p { margin: 3px 0 0; font-size: 13.5px; }
.answer-t { margin-top: 2px; }
.saved-pill .link { margin-left: auto; color: var(--ok); text-decoration: underline; }
.saved-mini { margin-left: 8px; font-size: 12px; font-weight: 800; color: var(--ok); }
.exam-intro { background: linear-gradient(135deg, var(--accent-l), #fff 70%); }
.exam-intro summary { cursor: pointer; font-weight: 800; display: flex; gap: 8px; align-items: center; }
.exam-intro h3 { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.exam-how { margin: 8px 0 0; font-size: 15.5px; color: var(--ink-2); }
.exam-review { margin-top: 16px; }
.review-head { padding: 16px 18px 10px; display: flex; flex-direction: column; gap: 2px; }
.rv-item { border-top: 1px solid var(--line-2); }
.rv-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px 18px; }
.rv-item summary::-webkit-details-marker { display: none; }
.rv-item[open] summary { background: #fafbff; }
.rv-title { flex: 1; font-weight: 600; min-width: 0; }
.rv-body { padding: 6px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.rv-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.rv-col { border-radius: 12px; padding: 12px; border: 1px solid var(--line); }
.rv-col.mine { background: #fffaf2; border-color: #f6d6ae; } .rv-col.right { background: #f3fbf7; border-color: #a9e2c8; }
.rv-col b { display: block; margin-bottom: 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.rv-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rv-options li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; }
.rv-options li.right { background: #f3fbf7; border-color: #1fb878; } .rv-options li.mine:not(.right) { background: #fff6f7; border-color: #e8465b; }
.tag { font-style: normal; font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--line-2); } .tag.right { background: var(--ok-bg); color: var(--ok); } .tag.mine { background: var(--warn-bg); color: var(--warn); }
.todo-date { font-weight: 400; color: var(--muted); font-size: 12px; }

/* ---------- v4 ---------- */
.lines-table .cell-ref { min-width: 230px; }
.lines-table .cell { min-width: 140px; }
.lines-table { min-width: 720px; }
.auto-hints { display: flex; gap: 10px; background: #fff8e6; border: 1px solid #f3d9a0; border-radius: 12px; padding: 10px 12px; color: #6b4a06; }
.auto-hints ul { margin: 0; padding-left: 18px; } .auto-hints li { margin: 2px 0; }
.report-help { color: var(--ink-2); background: var(--accent-l); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; display: flex; gap: 8px; align-items: flex-start; }
.more-actions { margin-left: auto; position: relative; }
.more-actions summary { list-style: none; cursor: pointer; padding: 8px 12px; color: var(--ink-2); font-weight: 600; border-radius: 8px; }
.more-actions summary::-webkit-details-marker { display: none; }
.more-actions[open] summary { background: var(--line-2); }
.more-actions .more-list { position: absolute; right: 0; bottom: 110%; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-l); padding: 6px; display: grid; gap: 4px; min-width: 190px; }
.tp-lbl { display: none; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #b9c1e6; }
tr.row-user { cursor: pointer; }
.heat-none { color: #b4b9cf; }
.has-err > .inp { border-color: var(--err); }
@media (max-width: 900px) { .tp-lbl { display: inline; } }
