:root {
  --bg: #f4f5fa; --panel: #ffffff; --panel2: #eef0f7; --line: #dde1ec;
  --text: #1d2233; --muted: #6b7286; --accent: #4b3fd1; --accent2: #4b3fd1; --accent-soft: #ecebfb; --logo-a: #4b3fd1; --logo-b: #a93fc9;
  --ok: #1f9d63; --ok-soft: #e3f7ec; --bad: #d94a5f; --bad-soft: #fde8ec; --warn: #d9880e; --warn-soft: #fff3df; --slow: #2b8fc9;
  --none: #c4c9d8; --weak: #e05a6e; --shaky: #e9a23b; --solid: #2fb47a; --closed: #5b4de6;
  --gold: #f5b942; --shadow: 0 1px 2px rgba(20,24,40,.05), 0 6px 18px rgba(20,24,40,.06);
  --radius: 16px;
  --trail: linear-gradient(90deg, #e04a6a, #ee6f45 30%, #f39a2a 50%, #f2c230 72%, #8cc152 88%, #2fa872);
  --btn: linear-gradient(135deg, #2fa872, #1f8f86 55%, #146e7c); --btn-fg: #fff; --btn-shadow: 0 4px 12px rgba(31,143,134,.28); --bar: var(--trail); --kicker: var(--accent); --sel: var(--accent);
}
:root[data-theme="dark"] {
  --bg: #0f1117; --panel: #181b24; --panel2: #232735; --line: #2b3040;
  --text: #e8eaf0; --muted: #8b92a5; --accent: #9488f5; --accent2: #9488f5; --accent-soft: rgba(148,136,245,.16); --logo-a: #8b7dff; --logo-b: #d77cf0;
  --ok: #3ddc97; --ok-soft: rgba(61,220,151,.14); --bad: #ff6b81; --bad-soft: rgba(255,107,129,.14); --warn: #ffb347; --warn-soft: rgba(255,179,71,.14); --slow: #5bc0eb;
  --none: #3a3f52; --weak: #b23a48; --shaky: #c98a2b; --solid: #2a9d6f; --closed: #8d7dff;
  --shadow: none;
  --btn: linear-gradient(135deg, #34c486, #22a69a 55%, #1b8aa0); --btn-shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
a { color: var(--accent); }
button { font: inherit; cursor: pointer; border: 0; border-radius: 12px; padding: 10px 18px; background: var(--panel2); color: var(--text); transition: transform .08s, background .15s, box-shadow .15s; }
button:hover { background: var(--line); }
button:active { transform: scale(.97); }
button.primary { background: var(--btn); color: var(--btn-fg); font-weight: 600; box-shadow: var(--btn-shadow); }
button.primary:hover { filter: brightness(1.06); }
button.ghost { background: transparent; color: var(--muted); }
button.ghost:hover { color: var(--text); background: var(--panel2); }
button.back-top { display: inline-flex; align-items: center; padding: 6px 12px 6px 8px; margin: 0 0 6px -8px; font-size: 14px; }
button:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
input[type=text], input[type=number] { font: inherit; font-size: 21px; width: 100%; padding: 13px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly] { background: var(--panel2); }

.app { max-width: 1000px; margin: 0 auto; padding: 14px 16px 48px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 22px; padding: 6px 0 16px; border-bottom: 1px solid var(--line); }
header .brand-wrap { display: grid; gap: 7px; }
header .tagline { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: .01em; padding-left: 2px; }
/* логотип: ПРО в градиенте, карандаш-ударение над «а» */
header .brand { cursor: pointer; display: inline-flex; align-items: center; color: var(--text); line-height: 0; }
header .brand .logo-svg { height: 52px; width: auto; display: block; overflow: visible; }
@media (max-width: 520px) { header .brand .logo-svg { height: 40px; } header .tagline { font-size: 12.5px; } header .brand-wrap { gap: 5px; } header { flex-wrap: wrap; row-gap: 10px; } header .right { margin-left: auto; } }
header .right { display: flex; align-items: center; gap: 10px; }
header .theme { width: 38px; height: 38px; padding: 0; border-radius: 50%; font-size: 17px; background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 10px; font-size: 15px; box-shadow: var(--shadow); line-height: 1.1; }
.chip .ci { font-size: 18px; }
.chip b { font-size: 16px; }
.chip.rank { padding-right: 16px; background: linear-gradient(135deg, var(--accent-soft), var(--panel)); border-color: var(--line); }
:root[data-theme="dark"] .chip.rank { border-color: #4a4280; }
.chip.rank .ct { display: flex; flex-direction: column; gap: 2px; min-width: 110px; }
.chip.rank .ct b { font-size: 14px; }
.chip.rank .ct small { font-size: 11px; color: var(--muted); }
.chip.rank .bar { display: block; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.chip.rank .bar i { display: block; height: 100%; background: var(--bar); transition: width .4s; }
.chip.pulse { animation: chippulse .5s ease; }
@keyframes chippulse { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }
.view { display: none; }
.view.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h1 { font-size: 26px; margin: 4px 0 4px; letter-spacing: -.2px; }
h2 { font-size: 20px; margin: 22px 0 10px; }
p.lead { color: var(--muted); margin: 0 0 14px; font-size: 15px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card.clickable { cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.card.clickable:hover { border-color: var(--sel); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20,24,40,.09); }
.card h3 { margin: 0 0 4px; font-size: 18px; }
.card .sub { color: var(--muted); font-size: 14px; }
.card .ico { font-size: 26px; margin-bottom: 8px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* задание */
.task { max-width: 760px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.task .meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.task .code { font-weight: 700; color: var(--accent); font-size: 16px; background: var(--accent-soft); padding: 2px 10px; border-radius: 8px; }
.task .q { font-size: 26px; line-height: 1.6; margin: 12px 0 20px; }
.task .q.text { font-size: 20px; }
.task .hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.keys { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.keys button { padding: 6px 12px; font-size: 18px; min-width: 42px; background: var(--panel2); }
.choices { display: grid; gap: 8px; }
.choices button { text-align: left; padding: 12px 14px; background: var(--panel); border: 1.5px solid var(--line); }
.choices button:hover { border-color: var(--accent); background: var(--panel); }
.choices button.sel { border-color: var(--accent); background: var(--accent-soft); }
.feedback { margin-top: 14px; padding: 12px 16px; border-radius: 12px; }
.feedback.ok { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.feedback.bad { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.feedback .ans { color: var(--text); margin-top: 6px; font-size: 20px; font-weight: 400; }
.feedback .praise { display: block; font-weight: 400; color: var(--text); margin-top: 2px; }
.errtypes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.errtypes button { background: var(--panel2); font-size: 15px; }
.timer { font-variant-numeric: tabular-nums; }
.timer.over { color: var(--warn); font-weight: 700; }
.progressbar { max-width: 760px; margin-left: auto; margin-right: auto; height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.progressbar i { display: block; height: 100%; background: var(--bar); transition: width .25s; }
.streak { color: var(--warn); font-weight: 700; }
.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.9); opacity: .4; } 60% { transform: scale(1.04); } 100% { transform: none; opacity: 1; } }

/* математика */
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 3px; line-height: 1.15; }
.fr .n { border-bottom: 1.5px solid currentColor; padding: 0 4px; }
.fr .d { padding: 0 4px; }
.sqrt { white-space: nowrap; }
.sqrt .rad { border-top: 1.5px solid currentColor; padding: 1px 2px 0 1px; }
.sys { border-left: 2px solid var(--muted); padding-left: 12px; margin: 8px 0 0 8px; }
sup { font-size: .7em; }
table.tb { border-collapse: collapse; margin: 6px 0 12px; font-size: 18px; }
table.tb th, table.tb td { border: 1px solid var(--line); padding: 4px 12px; }

/* дерево навыков */
.branch { margin-bottom: 22px; }
.branch h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.branch .hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.skill { background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--none); border-radius: 12px; padding: 10px 12px; cursor: pointer; position: relative; box-shadow: var(--shadow); transition: transform .12s; }
.skill:hover { transform: translateY(-2px); }
.skill .name { font-size: 15px; font-weight: 600; }
.skill .st { font-size: 12px; color: var(--muted); margin-top: 3px; }
.skill.none { border-left-color: var(--none); }
.skill.weak { border-left-color: var(--weak); }
.skill.shaky { border-left-color: var(--shaky); }
.skill.slow { border-left-color: var(--slow); }
.skill.solid { border-left-color: var(--solid); }
.skill.closed { border-left-color: var(--closed); background: var(--accent-soft); }
.skill.locked { opacity: .55; }
.skill.locked::after { content: '🔒'; position: absolute; right: 8px; top: 8px; font-size: 13px; }
.lvl { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--panel2); color: var(--muted); margin-left: 6px; vertical-align: middle; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 6px 0 16px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }

/* итоги */
table.res { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--panel); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
table.res th { text-align: left; padding: 8px 10px; background: var(--panel2); color: var(--muted); font-weight: 600; font-size: 13px; }
table.res td { text-align: left; padding: 7px 10px; border-top: 1px solid var(--line); }
table.res td.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 7px; font-size: 12px; color: #fff; font-weight: 600; }
.badge.none { background: var(--none); color: #333; } .badge.weak { background: var(--weak); } .badge.shaky { background: var(--shaky); } .badge.slow { background: var(--slow); } .badge.solid { background: var(--solid); } .badge.closed { background: var(--closed); }
.big { font-size: 52px; font-weight: 800; line-height: 1; margin: 6px 0; letter-spacing: -1px; }
.boss-banner { background: linear-gradient(135deg, #3b2a7a, #7a2a5a); color: #fff; border: 0; }
.boss-banner .sub { color: rgba(255,255,255,.8); }
.achv { display: flex; gap: 10px; flex-wrap: wrap; }
.achv .a { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.achv .a .i { font-size: 22px; }
.achv .a.off { opacity: .4; filter: grayscale(1); }
.unlock { background: linear-gradient(135deg, #fff6dd, #ffe9b8); border: 1px solid #f3d58a; color: #5a4300; }
:root[data-theme="dark"] .unlock { background: linear-gradient(135deg, #3a2f10, #4a3a12); border-color: #7a5e1c; color: #ffe6a8; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 9; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { opacity: 1; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 8; }
textarea { width: 100%; min-height: 80px; font: inherit; font-size: 14px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
code { background: var(--panel2); padding: 1px 6px; border-radius: 6px; font-size: 14px; }
@media (max-width: 520px) { .task .q { font-size: 22px; } h1 { font-size: 23px; } .chip { padding: 5px 10px 5px 8px; font-size: 13px; gap: 5px; } .chip.rank .ct { min-width: 80px; } .chip.rank .ct small { display: none; } .big { font-size: 44px; } }

@media (max-width: 560px) { table.res { display: block; overflow-x: auto; max-width: 100%; } }

/* ---------- главная ---------- */
.home-label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 30px 0 12px; }

/* сегодня: одно главное действие */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 24px 26px; box-shadow: var(--shadow); }
.hero h1 { margin: 0 0 14px; }
.hero .kicker { font-size: 13px; font-weight: 600; color: var(--kicker); margin-bottom: 2px; }
.hero .next-title { font-size: 21px; font-weight: 700; line-height: 1.25; }
.hero .next-sub { color: var(--muted); font-size: 14px; margin: 4px 0 16px; }
.hero .go-btn { font-size: 17px; padding: 13px 26px; border-radius: 14px; }
.hero .note { color: var(--muted); font-size: 13px; margin: 16px 0 0; }
.hero-goal { display: grid; justify-items: center; gap: 8px; text-align: center; padding-left: 24px; border-left: 1px solid var(--line); min-width: 150px; }
.hero-goal .ring { --p: 0; width: 104px; height: 104px; border-radius: 50%; background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--panel2) 0); display: grid; place-items: center; }
.hero-goal .ring span { width: 84px; height: 84px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; align-content: center; font-size: 26px; font-weight: 700; line-height: 1; }
.hero-goal .ring small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.hero-goal .cap { font-size: 14px; font-weight: 600; }
.hero-goal .cap2 { font-size: 13px; color: var(--muted); margin-top: -6px; }

/* путь: три этапа подряд */
.path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; counter-reset: st; position: relative; }
.stage { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 14px; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; box-shadow: var(--shadow); }
.stage:hover { border-color: var(--sel); transform: translateY(-2px); }
.stage + .stage::before { content: "→"; position: absolute; left: -24px; top: 50%; transform: translateY(-50%); width: 18px; text-align: center; font-size: 20px; font-weight: 700; color: var(--muted); }
.stage .st-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.stage .st-num { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 15px; background: var(--panel2); color: var(--muted); }
.stage h3 { margin: 0; font-size: 18px; }
.stage .st-tag { margin-left: auto; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.stage .st-desc { color: var(--muted); font-size: 14px; min-height: 40px; }
.stage .st-bar { height: 6px; border-radius: 3px; background: var(--panel2); margin: 12px 0 6px; overflow: hidden; }
.stage .st-bar i { display: block; height: 100%; border-radius: 3px; background: var(--bar); }
.stage .st-meta { font-size: 13px; color: var(--muted); }
.stage.current { border: 2px solid var(--sel); padding: 15px 15px 13px; }
.stage.current .st-num { background: var(--btn); color: var(--btn-fg); }
.stage.done .st-num { background: var(--ok); color: #fff; }
.stage.done .st-bar i { background: var(--ok); }

/* достижения: отдельно, тёплый «наградной» цвет */
.achv-strip { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 16px; padding: 14px 18px; cursor: pointer; transition: border-color .12s; }
.achv-strip:hover { border-color: var(--sel); }
.achv-strip .as-rank { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.achv-strip .as-rank .i { font-size: 30px; }
.achv-strip .as-rank b { font-size: 16px; }
.achv-strip .xpbar { width: 150px; height: 6px; border-radius: 3px; background: var(--panel2); margin: 5px 0 3px; overflow: hidden; }
.achv-strip .xpbar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.achv-strip small { color: var(--muted); font-size: 12px; }
.achv-strip .as-stat { display: grid; line-height: 1.2; }
.achv-strip .as-stat b { font-size: 18px; }
.achv-strip .as-badges { display: flex; gap: 4px; font-size: 22px; }
.achv-strip .as-badges .off { filter: grayscale(1); opacity: .35; }
.achv-strip .as-more { margin-left: auto; font-weight: 600; color: var(--muted); white-space: nowrap; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 20px; gap: 18px; }
  .hero-goal { grid-template-columns: auto 1fr; justify-items: start; text-align: left; border-left: 0; border-bottom: 1px solid var(--line); padding: 0 0 16px; column-gap: 14px; row-gap: 2px; order: -1; }
  .hero-goal .ring { width: 64px; height: 64px; grid-row: span 2; }
  .hero-goal .ring span { width: 50px; height: 50px; font-size: 16px; }
  .hero-goal .ring small { display: none; }
  .hero-goal .cap2 { margin-top: 0; }
  .hero .go-btn { width: 100%; }
  .path { grid-template-columns: 1fr; gap: 28px; }
  .stage + .stage::before { content: "↓"; left: 50%; top: -25px; transform: translateX(-50%); }
  .stage .st-desc { min-height: 0; }
  .achv-strip { gap: 14px 20px; }
  .achv-strip .as-rank { min-width: 0; width: 100%; }
  .achv-strip .as-more { margin-left: 0; }
}


/* цвета логотипа по ролям: фиолетовый PRO = где ты, ракета = действие (кнопка), след = прогресс */
.stage .st-bar { background: var(--trail); display: flex; justify-content: flex-end; }
.stage .st-bar i { width: calc(100% - var(--p)) !important; background: var(--panel2); border-radius: 0; }
.stage.done .st-bar i { width: 0 !important; }
.hero-goal .ring { background: conic-gradient(#e04a6a 0, #f39a2a calc(var(--p) * .45%), #f2c230 calc(var(--p) * .75%), #2fa872 calc(var(--p) * 1%), var(--panel2) 0); }
.stage.current .st-num { background: var(--accent); }
.chip.rank .bar i { background: var(--accent); }

/* подсказки в шапке */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); right: 0; width: max-content; max-width: 250px; padding: 9px 12px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 500; line-height: 1.4; white-space: normal; text-align: left; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s; pointer-events: none; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
[data-tip].tip-left::after { right: auto; left: 0; }
[data-tip]:hover::after, [data-tip]:focus-visible::after, [data-tip].tip-open::after { opacity: 1; visibility: visible; transform: none; transition-delay: .15s; }
.chip[data-tip] { cursor: help; }

/* главная на один экран + уголки между этапами */
.app { padding-top: 10px; }
header { margin-bottom: 16px; padding-bottom: 12px; }
.home-label { margin: 18px 0 8px; }
.hero { padding: 18px 22px; gap: 20px; }
.hero h1 { margin-bottom: 8px; }
.hero .next-sub { margin: 2px 0 12px; }
.hero .go-btn { padding: 11px 22px; }
.hero .note { margin-top: 12px; }
.hero-goal .ring { width: 88px; height: 88px; }
.hero-goal .ring span { width: 70px; height: 70px; font-size: 22px; }
.path { gap: 26px; }
.stage { padding: 12px 14px; }
.stage.current { padding: 11px 13px; }
.stage .st-head { margin-bottom: 6px; }
.stage .st-num { width: 30px; height: 30px; font-size: 14px; }
.stage h3 { font-size: 17px; }
.stage .st-desc { min-height: 0; font-size: 13.5px; }
.stage .st-bar { margin: 10px 0 5px; }
.stage .st-short { display: none; }
.stage + .stage::before { content: ""; left: -17px; width: 9px; height: 9px; border-top: 2.5px solid var(--muted); border-right: 2.5px solid var(--muted); border-radius: 1px; transform: translateY(-50%) rotate(45deg); opacity: .7; }
.achv-strip { padding: 10px 16px; }
@media (max-width: 760px) {
  .hero { padding: 16px; gap: 12px; }
  .hero-goal { padding-bottom: 12px; }
  .hero-goal .ring { width: 54px; height: 54px; }
  .hero-goal .ring span { width: 42px; height: 42px; font-size: 14px; }
  .hero h1 { font-size: 21px; margin-bottom: 6px; }
  .hero .next-title { font-size: 18px; }
  .hero .next-sub { font-size: 13px; margin-bottom: 10px; }
  .hero .note { font-size: 12px; margin-top: 10px; }
  .home-label { margin: 14px 0 6px; }
  /* путь на телефоне: три коротких шага в ряд */
  .path { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .stage, .stage.current { padding: 9px 6px 8px; text-align: center; }
  .stage .st-head { flex-direction: column; gap: 4px; margin-bottom: 0; }
  .stage .st-num { width: 26px; height: 26px; font-size: 13px; }
  .stage h3 { font-size: 13px; }
  .stage .st-tag, .stage .st-desc, .stage .st-long { display: none; }
  .stage .st-short { display: inline; }
  .stage .st-bar { margin: 7px 2px 4px; height: 5px; }
  .stage .st-meta { font-size: 12px; }
  .stage + .stage::before { left: -11px; top: 50%; width: 7px; height: 7px; border-width: 2px 2px 0 0; transform: translateY(-50%) rotate(45deg); }
  .achv-strip { gap: 8px 16px; padding: 10px 14px; }
  .achv-strip .as-badges { display: none; }
  .achv-strip .as-stat b { font-size: 16px; }
  header { margin-bottom: 12px; padding-bottom: 10px; }
}
.app { padding-bottom: 20px; }
.home-label { margin: 16px 0 8px; }
.hero .go-row { display: flex; align-items: center; gap: 18px; }
.hero .go-row .note { margin: 0; max-width: 300px; }
.hero-goal .ring { width: 80px; height: 80px; }
.hero-goal .ring span { width: 64px; height: 64px; font-size: 20px; }
@media (max-width: 760px) { .hero .go-row { flex-direction: column; align-items: stretch; gap: 8px; } .hero .go-row .note { max-width: none; } .hero-goal .ring { width: 54px; height: 54px; } .hero-goal .ring span { width: 42px; height: 42px; font-size: 14px; } }
.app { padding-bottom: 8px; } header { margin-bottom: 12px; } .hero { padding-top: 16px; padding-bottom: 16px; }
@media (max-width: 760px) {
  .hero { position: relative; }
  .hero-goal { position: absolute; top: 14px; right: 14px; display: grid; grid-template-columns: auto; justify-items: center; border: 0; padding: 0; row-gap: 3px; order: 0; text-align: center; }
  .hero-goal .ring { grid-row: auto; width: 50px; height: 50px; }
  .hero-goal .ring span { width: 39px; height: 39px; font-size: 13px; }
  .hero-goal .cap { font-size: 11px; font-weight: 600; color: var(--muted); }
  .hero-goal .cap2 { display: none; }
  .hero h1 { padding-right: 64px; min-height: 40px; }
}
.hero .go-btn { white-space: nowrap; flex: none; }
/* подсказки: светлая карточка с уголком вместо тёмной плашки */
[data-tip]::after { background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(20,24,40,.14), 0 2px 6px rgba(20,24,40,.06); top: calc(100% + 10px); padding: 10px 13px; }
:root[data-theme="dark"] [data-tip]::after { background: var(--panel2); box-shadow: 0 10px 28px rgba(0,0,0,.45); }
[data-tip]::before { content: ""; position: absolute; top: calc(100% + 5px); right: 16px; width: 10px; height: 10px; background: var(--panel); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s; z-index: 51; pointer-events: none; }
:root[data-theme="dark"] [data-tip]::before { background: var(--panel2); }
[data-tip].tip-left::before { right: auto; left: 22px; }
[data-tip]:hover::before, [data-tip]:focus-visible::before, [data-tip].tip-open::before { opacity: 1; visibility: visible; transition-delay: .15s; }
/* узкий телефон: подсказка во всю ширину ряда значков, без уголка; значки плотнее */
@media (max-width: 520px) {
  header .right { position: relative; }
  header .right > [data-tip] { position: static; }
  header .right > [data-tip]::after { left: 0; right: 0; width: auto; max-width: none; top: calc(100% + 8px); }
  header .right > [data-tip]::before { display: none; }
}
@media (max-width: 380px) {
  header .right { gap: 6px; }
  .chip { padding: 5px 9px 5px 7px; gap: 4px; }
  .chip.rank .ct { min-width: 64px; }
  header .theme { width: 34px; height: 34px; }
}
/* уголки ровно посередине между этапами; после пройденного этапа уголок зелёный */
.stage + .stage::before { left: -23px; }
.stage.done + .stage::before { border-color: var(--ok); opacity: 1; }
@media (max-width: 760px) { .stage + .stage::before { left: -16px; } }
[data-tip]::after { white-space: pre-line; line-height: 1.45; max-width: 270px; }

/* подсказки разметкой (вместо текста в ::after) */
[data-tip]::after { display: none !important; }
.tip { position: absolute; top: calc(100% + 10px); right: 0; width: max-content; max-width: 270px; padding: 10px 13px; border-radius: 12px; background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(20,24,40,.14), 0 2px 6px rgba(20,24,40,.06); font-size: 13px; font-weight: 400; line-height: 1.45; white-space: normal; text-align: left; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s; pointer-events: none; z-index: 50; }
:root[data-theme="dark"] .tip { background: var(--panel2); box-shadow: 0 10px 28px rgba(0,0,0,.45); }
.tip-left > .tip { right: auto; left: 0; }
[data-tip]:hover > .tip, [data-tip]:focus-visible > .tip, [data-tip].tip-open > .tip { opacity: 1; visibility: visible; transform: none; transition-delay: .15s; }
.tip b { font-weight: 700; font-size: 13.5px; }
.tip .tip-h { display: block; margin-top: 7px; font-weight: 600; color: var(--muted); }
.tip .tip-p { display: block; margin-top: 3px; color: var(--muted); }
.tip ul { margin: 2px 0 0; padding-left: 16px; }
.tip li { margin: 1px 0; }
@media (max-width: 520px) { header .right > [data-tip] > .tip { left: 0; right: 0; width: auto; max-width: none; top: calc(100% + 8px); } }

/* кнопка профиля в шапке */
header .avatar-btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; background: none; }
header .avatar-btn:hover { background: none; }
header .avatar-btn .ava { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--line); }
header .avatar-btn:hover .ava { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--accent); }
.ava { display: grid; place-items: center; overflow: hidden; background: var(--accent-soft); color: var(--accent); }
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava .l { font-weight: 700; font-size: 17px; }
.ava .e { font-size: 21px; line-height: 1; }
@media (max-width: 380px) { header .avatar-btn, header .avatar-btn .ava { width: 34px; height: 34px; } }


/* раздел «Профиль»: сетка 3 колонки, карточки одной высоты в ряду, заголовок внутри карточки */
#v-profile h1 { margin-bottom: 12px; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: stretch; }
.pc { margin: 0; padding: 14px 16px; display: flex; flex-direction: column; }
.pc-2 { grid-column: span 2; }
.pc h3 { font-size: 15px; margin: 0 0 12px; }
.pc-note { margin: auto 0 0; padding-top: 6px; font-size: 12.5px; color: var(--muted); }
.f { display: grid; gap: 5px; margin: 0 0 12px; }
.f:last-child { margin-bottom: 0; }
.f > span { font-size: 13px; color: var(--muted); }
.f input, .f select { font: inherit; font-size: 15px; width: 100%; padding: 8px 11px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); }
.f select { cursor: pointer; }
.f select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.f-row { grid-template-columns: 78px 1fr; align-items: center; gap: 10px; margin-bottom: 10px; }
.fgrid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px 14px; }
.fgrid .f { margin: 0; }
.fgrid .f-full { grid-column: 1 / -1; }
.ava-row { display: flex; gap: 16px; align-items: flex-start; }
.ava-side { display: grid; justify-items: center; gap: 2px; flex: none; }
.ava-lg { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 6px; }
.ava-lg .l { font-size: 34px; }
.ava-lg .e { font-size: 42px; }
button.lnk { background: none; padding: 2px 4px; font-size: 13px; color: var(--accent); font-weight: 600; border-radius: 6px; }
button.lnk:hover { background: var(--accent-soft); }
button.lnk.muted { color: var(--muted); font-weight: 500; }
.emoji-pick { display: grid; grid-template-columns: repeat(4, 34px); gap: 6px; }
.emoji-pick button { width: 34px; height: 34px; padding: 0; font-size: 18px; border-radius: 9px; background: var(--panel2); border: 2px solid transparent; }
.emoji-pick button.sel { border-color: var(--accent); background: var(--accent-soft); }
.seg { display: inline-flex; justify-self: start; background: var(--panel2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { padding: 6px 13px; border-radius: 8px; background: transparent; font-size: 14px; }
.seg button.on { background: var(--panel); box-shadow: 0 1px 3px rgba(20,24,40,.14); font-weight: 600; }
:root[data-theme="dark"] .seg button.on { background: #343a4d; }
.pc .row button { padding: 8px 16px; }
button.danger { color: var(--bad); }
button.danger:hover { background: var(--bad-soft); }
@media (max-width: 760px) {
  .pgrid { grid-template-columns: 1fr; }
  .pc-2 { grid-column: auto; }
  .fgrid { grid-template-columns: 1fr; }
  .emoji-pick { grid-template-columns: repeat(6, 34px); }
}

/* шапка: единая высота значков (44 px), одинаковые рамки, ряд значков по строке логотипа */
header { align-items: flex-start; }
header .right { margin-top: 4px; gap: 8px; }
.chip { height: 44px; padding: 0 14px 0 11px; box-sizing: border-box; }
.chip.rank { background: var(--panel); padding-right: 16px; }
:root[data-theme="dark"] .chip.rank { border-color: var(--line); }
.chip.rank .ct { gap: 1px; }
.chip.rank .bar { margin-top: 2px; }
header .avatar-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); padding: 3px; }
header .avatar-btn .ava { width: 100%; height: 100%; box-shadow: none; }
header .avatar-btn:hover { background: var(--panel); border-color: var(--accent); }
header .avatar-btn:hover .ava { box-shadow: none; }
@media (max-width: 520px) {
  header .right { margin-top: 0; gap: 6px; }
  .chip { height: 38px; }
  header .avatar-btn { width: 38px; height: 38px; padding: 2px; }
}
@media (max-width: 380px) {
  .chip { height: 34px; }
  header .avatar-btn { width: 34px; height: 34px; }
}
#v-profile h1 { margin: 0 0 10px; }
.pc { padding: 12px 16px; }
.pc h3 { margin-bottom: 10px; }
.f input, .f select { padding: 7px 11px; }
.f-row { margin-bottom: 8px; }
.pc .row button { padding: 7px 15px; }
/* профиль: подписи слева в одной колонке 84 px во всех карточках */
.f-row { grid-template-columns: 84px 1fr; align-items: center; gap: 10px; margin: 0 0 8px; }
.fgrid { gap: 8px 18px; }
.fgrid .f-row:nth-child(2) { grid-template-columns: 50px 1fr; }
.pc .row { gap: 8px; }
.pc .row button, .pc .seg button { font-size: 14px; }
.pc .row button { padding: 7px 14px; }
.pc .seg { justify-self: start; }
@media (max-width: 760px) { .fgrid .f-row:nth-child(2) { grid-template-columns: 84px 1fr; } }
.pc .f input, .pc .f select { font-size: 15px; height: 38px; } .pc .seg button { white-space: nowrap; }
@media (max-width: 760px) { .emoji-pick { grid-template-columns: repeat(4, 34px); } .ava-row { justify-content: center; } }
/* профиль v3: результаты как список действий «кнопка — что произойдёт» */
.pc-lead { margin: -2px 0 10px; font-size: 13.5px; color: var(--muted); }
.act { display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.act > button { width: 100%; padding: 8px 12px; font-size: 14px; }
.act > span { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.pc .pc-note { margin-top: auto; }
@media (max-width: 760px) { .act { grid-template-columns: 1fr; gap: 4px; } .act > button { justify-self: start; width: auto; } }
.f-row > span small { display: block; font-size: 11.5px; opacity: .8; margin-top: 1px; } .pc-lead { margin-bottom: 6px; }
/* узкие экраны: ряд значков на всю ширину, значки компактнее, длинные числа не ломают ряд */
@media (max-width: 520px) {
  header .right { width: 100%; margin-left: 0; justify-content: space-between; gap: 6px; }
  header .right > .chip.rank { flex: 1 1 auto; min-width: 0; }
  .chip.rank .ct { min-width: 0; flex: 1; }
  .chip.rank .ct b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 380px) {
  .chip { padding: 0 9px 0 7px; gap: 4px; }
  .chip .ci { font-size: 16px; }
  .chip b { font-size: 15px; }
  .chip.rank { padding-right: 10px; }
}
/* таблицы навыков в «Прогрессе»: одинаковые столбцы во всех ветках */
.tscroll { overflow-x: auto; border-radius: 12px; }
table.res-skills { table-layout: fixed; min-width: 600px; }
table.res-skills col.c-num { width: 96px; }
table.res-skills col.c-time { width: 110px; }
table.res-skills col.c-status { width: 150px; }
table.res-skills col.c-lvl { width: 64px; }
table.res th.num { text-align: right; }
table.res-skills td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.res-skills th:nth-child(5), table.res-skills td:nth-child(5) { padding-left: 22px; }
@media (max-width: 560px) { .tscroll table.res { display: table; } }
/* достижения: сетка из 5 колонок одинаковой ширины, карточки одной высоты */
.achv { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.achv .a { align-items: flex-start; height: 100%; padding: 10px 12px; }
.achv .a .i { flex: none; width: 26px; text-align: center; }
.achv .a b { font-size: 14px; }
.achv .a .muted.small { font-size: 12.5px; line-height: 1.3; }
@media (max-width: 900px) { .achv { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .achv { grid-template-columns: repeat(2, 1fr); } }
.achv .a { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; } .achv .a .i { width: auto; font-size: 22px; line-height: 1; } .achv .a.off { opacity: .55; }

/* выбор ветки (диагностика, босс): список строк с одинаковыми колонками */
.blist { display: grid; gap: 10px; margin-top: 4px; }
.brow { display: grid; grid-template-columns: 210px 1fr 170px 16px; align-items: center; gap: 20px; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px; box-shadow: var(--shadow); font: inherit; color: var(--text); transition: border-color .12s, transform .12s; }
.brow:hover { background: var(--panel); border-color: var(--sel); transform: translateY(-1px); }
.brow .b-name { font-weight: 700; font-size: 16px; }
.brow .b-hint { color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.brow .b-prog { display: grid; gap: 5px; }
.brow .b-prog small { font-size: 12.5px; color: var(--muted); }
.brow .b-bar { height: 6px; border-radius: 3px; background: var(--trail); display: flex; justify-content: flex-end; overflow: hidden; }
.brow .b-bar i { width: calc(100% - var(--p)); background: var(--panel2); }
.brow .b-prog:has(.b-grade) { grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; }
.brow .b-grade { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 17px; background: var(--panel2); color: var(--muted); }
.brow .b-grade.g5 { background: var(--ok-soft); color: var(--ok); }
.brow .b-grade.g4 { background: var(--ok-soft); color: var(--ok); }
.brow .b-grade.g3 { background: var(--warn-soft); color: var(--warn); }
.brow .b-grade.g2 { background: var(--bad-soft); color: var(--bad); }
.brow .b-go { width: 9px; height: 9px; border-top: 2.5px solid var(--muted); border-right: 2.5px solid var(--muted); transform: rotate(45deg); opacity: .7; justify-self: center; }
@media (max-width: 760px) {
  .brow { grid-template-columns: 1fr 16px; gap: 6px 12px; padding: 13px 14px; }
  .brow .b-name { grid-column: 1; }
  .brow .b-go { grid-column: 2; grid-row: 1 / span 3; }
  .brow .b-hint, .brow .b-prog { grid-column: 1; }
}

/* дерево навыков: 4 равные колонки, карточки одной высоты, уровень и замок внизу на одном месте */
.skills { grid-template-columns: repeat(4, 1fr); }
.skill { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 9px; }
.skill .sk-name { font-size: 15px; font-weight: 600; line-height: 1.3; min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skill .sk-st { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skill .sk-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; min-width: 0; }
.skill .sk-foot .lvl { flex: none; margin: 0; }
.skill .sk-need { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.skill.locked::after { content: none; }
@media (max-width: 900px) { .skills { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .skills { grid-template-columns: repeat(2, 1fr); } }
.skills { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.skill { min-width: 0; }
@media (max-width: 900px) { .skills { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* экран задания: сетка карточки */
.task { padding: 0; overflow: hidden; }
.task .meta { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 0; padding: 14px 22px; border-bottom: 1px solid var(--line); font-size: 14px; }
.task .meta .code { justify-self: start; }
.task .meta #t-skill { text-align: center; }
.task .meta .timer { justify-self: end; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.task .q { font-size: 32px; font-weight: 500; line-height: 1.45; margin: 0; padding: 26px 22px 18px; }
.task .q.text { font-size: 20px; font-weight: 400; }
.task #t-input, .task #t-choices { padding: 0 22px; }
.task #t-input { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
.task #t-answer { grid-column: 1 / -1; }
.task .keys { margin: 10px 0 0; }
.task .hint { margin: 10px 0 0; text-align: right; }
.task .row.between { margin: 0 !important; padding: 16px 22px 20px; }
.task .row.between button { height: 44px; padding: 0 20px; }
.task #t-feedback:empty { display: none; }
.task #t-feedback { padding: 0 22px 22px; }
.feedback { margin-top: 0; }
.feedback .ans { font-size: 18px; margin-top: 4px; }
.task .err-q { font-size: 13.5px; color: var(--muted); margin: 14px 0 8px; }
.errtypes { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 8px !important; }
.errtypes button { height: 58px; padding: 6px 10px !important; font-size: 13.5px !important; line-height: 1.3; text-align: center; background: var(--panel2); border: 1.5px solid transparent; border-radius: 12px; }
.errtypes button:hover { border-color: var(--sel); background: var(--panel); }
@media (max-width: 760px) {
  .errtypes { grid-template-columns: 1fr !important; }
  .errtypes button { height: auto; padding: 11px 14px !important; text-align: left; }
}
@media (max-width: 520px) {
  .task .meta { padding: 12px 16px; font-size: 13px; }
  .task .q { font-size: 26px; padding: 20px 16px 14px; }
  .task #t-input, .task #t-choices, .task #t-feedback { padding-left: 16px; padding-right: 16px; }
  .task #t-input { grid-template-columns: 1fr; }
  .task .hint { text-align: left; }
  .task .row.between { padding: 14px 16px 16px; }
}
.feedback.ok { display: flex; align-items: center; justify-content: space-between; gap: 14px; } .feedback.ok > button { flex: none; height: 40px; padding: 0 18px; }

/* предсказание перед серией: та же карточка, что у задания; 9 равных кнопок */
.task.predict .meta #pred-title { text-align: center; font-weight: 600; color: var(--text); font-size: 15px; }
.pred-body { padding: 22px; }
.pred-sub { font-size: 13.5px; color: var(--muted); }
.pred-q { font-size: 20px; margin: 10px 0 18px; }
.pred-buttons { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; }
.pred-buttons button { height: 54px; padding: 0; font-size: 20px; font-weight: 600; background: var(--panel2); border: 1.5px solid transparent; }
.pred-buttons button:hover { border-color: var(--sel); background: var(--panel); }
#v-predict .back-top { display: block; max-width: 760px; margin: 0 auto 8px; }
@media (max-width: 520px) { .pred-buttons { grid-template-columns: repeat(5, minmax(0, 1fr)); } .pred-q { font-size: 18px; } .pred-body { padding: 18px 16px; } }

/* таблица в итогах серии: закреплённые столбцы */
table.res-sum { table-layout: fixed; min-width: 520px; }
table.res-sum col.c-num { width: 96px; }
table.res-sum col.c-time { width: 190px; }
table.res-sum col.c-status { width: 150px; }
table.res-sum th:nth-child(4), table.res-sum td:nth-child(4) { padding-left: 22px; }
#v-predict .back-top { text-align: left; width: 100%; padding-left: 0; margin-left: auto; }
/* «Дальше» после верного ответа: полоска показывает, через сколько перейдёт само (5 с); Enter или кнопка — сразу */
.feedback.ok > .go-next { position: relative; overflow: hidden; }
.feedback.ok > .go-next::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(255,255,255,.75); transform-origin: left; animation: nextbar 5s linear forwards; }
@keyframes nextbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* пауза */
.task { position: relative; }
.task .meta .tm-wrap { justify-self: end; display: inline-flex; align-items: center; gap: 10px; }
.pause-btn { width: 30px; height: 30px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; gap: 3px; background: var(--panel2); }
.pause-btn i { display: block; width: 3px; height: 11px; border-radius: 1px; background: var(--muted); }
.pause-btn:hover { background: var(--line); }
.pause-btn:hover i { background: var(--text); }
.pause-ov { position: absolute; inset: 59px 0 0; background: var(--panel); display: grid; place-items: center; z-index: 5; animation: fade .15s ease; }
.pause-ov[hidden] { display: none; }
.pause-box { text-align: center; padding: 20px; }
.pause-box b { font-size: 24px; }
.pause-box p { color: var(--muted); margin: 6px 0 18px; }
.pause-box button { height: 46px; padding: 0 28px; font-size: 16px; }

/* ===== карточка задания v2: режим фокуса ===== */
#v-task .task { max-width: 720px; margin: 8px auto 0; padding: 0; border-radius: 20px; overflow: hidden; position: relative; }
.t-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 22px 12px; }
.t-title { display: grid; gap: 2px; min-width: 0; }
.t-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-count { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.t-count .code { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.task .tm-wrap { display: inline-flex; align-items: center; gap: 8px; background: var(--panel2); border-radius: 999px; padding: 4px 12px 4px 4px; }
.task .tm-wrap .pause-btn { background: var(--panel); width: 30px; height: 30px; box-shadow: 0 1px 2px rgba(20,24,40,.1); }
.task .timer { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); min-width: 38px; }
.task .timer.over { color: var(--bad); }
/* сегменты серии */
.t-dots { display: flex; gap: 4px; padding: 0 22px 4px; }
.t-dots i { flex: 1; height: 6px; border-radius: 3px; background: var(--panel2); transition: background .2s; }
.t-dots i.cur { background: var(--accent); }
.t-dots i.ok { background: var(--ok); }
.t-dots i.bad { background: var(--bad); }
.t-dots i.done { background: #9aa1b5; }
/* вопрос и ответ по центру */
.t-main { padding: 34px 28px 26px; display: grid; justify-items: center; text-align: center; }
.task .q { font-size: 40px; font-weight: 600; line-height: 1.3; padding: 0; margin: 0 0 26px; letter-spacing: .01em; }
.task .q.text { font-size: 20px; font-weight: 500; line-height: 1.5; text-align: left; justify-self: stretch; margin-bottom: 20px; }
.task #t-input { display: grid !important; grid-template-columns: 1fr; justify-items: center; gap: 0; padding: 0; width: 100%; max-width: 380px; }
.task #t-input[style*="none"] { display: none !important; }
.task #t-answer { width: 100%; text-align: center; font-size: 26px; font-weight: 600; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); }
.task #t-answer:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.task #t-answer::placeholder { font-weight: 400; color: #b3b8c7; }
.task.is-ok #t-answer { border-color: var(--ok); background: var(--ok-soft); box-shadow: none; }
.task.is-bad #t-answer { border-color: var(--bad); background: var(--bad-soft); box-shadow: none; text-decoration: line-through; text-decoration-color: rgba(217,74,95,.6); }
.task .keys { justify-content: center; margin: 12px 0 0; gap: 6px; }
.task .keys button { min-width: 44px; height: 38px; padding: 0 12px; font-size: 18px; border-radius: 10px; background: var(--panel2); }
.task .hint { text-align: center; margin: 10px 0 0; font-size: 12.5px; }
.task #t-choices { padding: 0; width: 100%; max-width: 480px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task #t-choices button { text-align: center; padding: 14px; font-size: 17px; border-radius: 14px; }
/* нижняя панель действий */
.t-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; background: var(--panel2); border-top: 1px solid var(--line); }
.t-actions { display: flex; gap: 10px; }
.t-foot button { height: 46px; }
.t-foot .t-dunno { padding: 0 20px; background: var(--panel); border: 1px solid var(--line); }
.t-foot .t-dunno:hover { background: var(--panel); border-color: var(--sel); }
.t-foot #t-submit { padding: 0 30px; font-size: 16px; }
.task.answered .t-foot { display: none; }
/* отклик вместо панели действий: та же полоса снизу */
.task #t-feedback { padding: 0; }
.task #t-feedback .feedback { border-radius: 0; margin: 0; padding: 16px 22px; border-top: 1px solid transparent; }
.task #t-feedback .feedback.ok { border-top-color: rgba(31,157,99,.25); font-size: 16px; }
.task #t-feedback .feedback.ok > .go-next { height: 44px; padding: 0 22px; }
.task #t-feedback .feedback.bad { border-top-color: rgba(217,74,95,.25); }
.task #t-feedback .feedback.bad .ans { font-size: 17px; }
.task #t-feedback .feedback.bad .ans b, .task #t-feedback .feedback.bad .ans { color: var(--text); }
.task #t-feedback .err-q, .task #t-feedback .errtypes { margin-left: 22px; margin-right: 22px; }
.task #t-feedback .err-q { margin-top: 14px; }
.task #t-feedback .errtypes { margin-bottom: 20px; }
.errtypes button { background: var(--panel); border: 1.5px solid var(--line); }
.pause-ov { inset: 0; border-radius: 20px; }
@media (max-width: 520px) {
  #v-task .task { border-radius: 16px; margin-top: 0; }
  .t-top { padding: 14px 16px 10px; }
  .t-dots { padding: 0 16px 2px; gap: 3px; }
  .t-main { padding: 26px 16px 20px; }
  .task .q { font-size: 32px; margin-bottom: 20px; }
  .t-foot { padding: 12px 16px; }
  .t-foot #t-submit { padding: 0 22px; }
  .task #t-feedback .feedback { padding: 14px 16px; }
  .task #t-feedback .err-q, .task #t-feedback .errtypes { margin-left: 16px; margin-right: 16px; }
  .task #t-choices { grid-template-columns: 1fr; }
}
.task #t-feedback .feedback.bad { padding-bottom: 18px; }
.task #t-feedback .feedback.bad .err-q, .task #t-feedback .feedback.bad .errtypes { margin-left: 0; margin-right: 0; }
.task #t-feedback .feedback.bad .err-q { color: var(--text); opacity: .75; font-weight: 400; }
.task #t-feedback .feedback.bad .errtypes { margin-bottom: 0; }
.task #t-feedback .feedback.bad .errtypes button { color: var(--text); font-weight: 500; }
.task.answered .keys, .task.answered .hint { display: none; } .task.answered #t-answer { caret-color: transparent; }
.task .q.text { font-size: 23px; font-weight: 600; line-height: 1.45; text-align: center; justify-self: center; max-width: 560px; } .task .q.text.long { font-size: 19px; font-weight: 500; text-align: left; justify-self: stretch; max-width: none; } @media (max-width: 520px) { .task .q.text { font-size: 20px; } .task .q.text.long { font-size: 17px; } }
/* служебные действия слева в панели: пауза и прервать, текстом с иконкой */
.t-svc { display: flex; gap: 4px; }
.t-svc .svc { height: 46px; padding: 0 14px 0 12px; display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--text); font-size: 15px; font-weight: 500; border-radius: 12px; }
.t-svc .svc:hover { background: var(--panel); }
.t-svc .ico-pause { display: inline-flex; gap: 3px; }
.t-svc .ico-pause i { display: block; width: 3px; height: 12px; border-radius: 1px; background: currentColor; }
.t-svc .ico-x { font-size: 20px; line-height: 1; color: var(--muted); margin-top: -2px; }
.t-svc #t-quit { color: var(--muted); }
@media (max-width: 520px) { .t-svc .svc { padding: 0 10px; font-size: 14px; gap: 6px; } .t-actions { gap: 6px; } .t-foot .t-dunno { padding: 0 12px; } .t-foot #t-submit { padding: 0 16px; } }
.t-foot button { white-space: nowrap; }
@media (max-width: 520px) {
  .t-foot { flex-direction: column-reverse; align-items: stretch; gap: 6px; padding: 12px 16px 8px; }
  .t-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
  .t-foot .t-dunno, .t-foot #t-submit { padding: 0 10px; }
  .t-svc { justify-content: center; gap: 10px; }
  .t-svc .svc { height: 38px; }
}
/* отсчёт до автоперехода: кнопка «Дальше» плавно заливается светлым слева направо, без полоски у края */
.feedback.ok > .go-next { isolation: isolate; }
.feedback.ok > .go-next::after { top: 0; bottom: 0; height: auto; z-index: -1; background: rgba(255,255,255,.22); border-radius: inherit; }
/* плашки статуса одной ширины (по самой длинной «не проверялся»), текст по центру */
.badge { width: 112px; text-align: center; padding: 3px 0; white-space: nowrap; }

/* ===== босс ===== */
/* полоса боя в карточке задания: персонаж, здоровье, жизни */
.t-boss { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin: 0 22px 4px; padding: 10px 14px; border-radius: 14px; background: var(--panel2); }
.t-boss[hidden] { display: none; }
.task.is-boss .t-dots { display: none; }
.bb-char { line-height: 0; }
.bb-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bb-fin { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.bb-hp { display: flex; gap: 4px; }
.bb-hp i { flex: 1; height: 10px; border-radius: 3px; background: var(--line); transition: background .3s; }
.bb-hp i.on { background: var(--bad); }
.bb-lives { display: flex; gap: 2px; font-size: 24px; line-height: 1; }
.bb-lives span { color: var(--line); transition: color .3s, transform .3s; }
.bb-lives span.on { color: #e04a6a; }
.task.boss-hit .bb-char { animation: bosshit .5s ease; }
.task.boss-miss .bb-lives { animation: lifeloss .5s ease; }
.task.boss-miss { animation: cardshake .4s ease; }
@keyframes bosshit { 0% { transform: none; filter: none; } 25% { transform: translateX(-6px) rotate(-8deg); filter: brightness(1.6); } 50% { transform: translateX(5px) rotate(6deg); } 100% { transform: none; filter: none; } }
@keyframes lifeloss { 0%, 100% { transform: none; } 40% { transform: scale(1.25); } }
@keyframes cardshake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.feedback.boss-fb { display: block; }

/* список боссов */
.b-boss { display: flex; align-items: center; gap: 12px; }
.b-boss svg { flex: none; }
.b-boss b { display: block; color: var(--text); font-size: 14.5px; }
.b-boss small { display: block; font-size: 12.5px; color: var(--muted); }
.b-chip { justify-self: start; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.b-chip.ready { background: var(--accent-soft); color: var(--accent); }
.b-chip.won { background: var(--ok-soft); color: var(--ok); }
.b-chip.cool { background: var(--warn-soft); color: var(--warn); }
.brow.boss-locked .b-name, .brow.boss-locked .b-boss b { color: var(--muted); }

/* итог боя */
.boss-result { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; padding: 22px 26px; }
.boss-result.won { background: linear-gradient(135deg, var(--ok-soft), var(--panel) 70%); border-color: rgba(31,157,99,.3); }
.boss-result.lost { background: linear-gradient(135deg, var(--bad-soft), var(--panel) 70%); border-color: rgba(217,74,95,.3); }
.br-char { line-height: 0; }
.br-title { font-size: 26px; font-weight: 800; line-height: 1.2; }
.br-line { color: var(--muted); margin: 6px 0 14px; font-size: 15px; }
.br-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.br-stats span { display: grid; gap: 2px; font-size: 12.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.br-stats b { font-size: 19px; color: var(--text); }
.br-hearts span { color: var(--line); } .br-hearts span.on { color: #e04a6a; }
.br-next { margin-top: 12px; font-size: 14px; }
@media (max-width: 560px) {
  .t-boss { margin: 0 16px 2px; padding: 8px 10px; gap: 10px; }
  .t-boss .bb-char svg { width: 48px; height: 48px; }
  .bb-lives { font-size: 20px; }
  .boss-result { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 20px 16px; }
  .br-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .br-title { font-size: 22px; }
}

/* окно награды */
.celebrate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(15,17,23,.45); padding: 16px; animation: fade .2s ease; }
.celebrate[hidden] { display: none; }
.cel-box { width: min(380px, 100%); background: var(--panel); border-radius: 22px; padding: 28px 26px 22px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.cel-ico { font-size: 64px; line-height: 1; min-height: 96px; display: grid; place-items: center; }
.cel-kicker { margin-top: 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); }
.cel-title { font-size: 26px; font-weight: 800; margin: 4px 0 6px; }
.cel-desc { color: var(--muted); font-size: 15px; line-height: 1.45; }
.cel-box .primary { margin-top: 20px; height: 48px; padding: 0 36px; font-size: 16px; }
/* разбор боя: строки с одинаковыми колонками */
.rz { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.rz-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 140px 140px 90px; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 15px; }
.rz-row:first-child { border-top: 0; }
.rz-head { background: var(--panel2); font-size: 13px; font-weight: 600; color: var(--muted); }
.rz-code { font-weight: 700; color: var(--accent); font-size: 13px; }
.rz-q { min-width: 0; }
.rz-res { font-weight: 600; text-align: right; font-size: 13.5px; }
.rz-row.ok .rz-res { color: var(--ok); }
.rz-row.bad .rz-res { color: var(--bad); }
@media (max-width: 640px) { .rz-row { grid-template-columns: 44px minmax(0, 1fr) 70px; } .rz-row > :nth-child(3), .rz-row > :nth-child(4) { display: none; } }
/* сердечки в итогах — не плитки */
.br-stats .br-hearts span { display: inline; padding: 0; border: 0; background: none; font-size: 19px; }
.br-stats > span { display: grid; }
/* итог боя: босс стоит на одной линии с плитками, под ним тень-опора */
.boss-result { align-items: end; }
.br-char { margin-bottom: -6px; }
@media (max-width: 560px) { .boss-result { align-items: center; } .br-char { margin-bottom: 0; } }
/* здоровье босса меняет цвет: много сил — зелёное, половина — жёлтое, на исходе — красное */
.bb-hp.hp-high i.on { background: #2fa872; }
.bb-hp.hp-mid i.on { background: #f2a630; }
.bb-hp.hp-low i.on { background: #e04a6a; }
/* без чёрной рамки фокуса у кнопок; для клавиатуры мягкое кольцо */
button:focus { outline: none; }
button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.cel-box .primary:focus-visible, button.primary:focus-visible { box-shadow: 0 0 0 4px rgba(47,168,114,.28); }
/* таблицы: числа и статусы по центру столбца, заголовок над ними тоже по центру */
table.res th.num, table.res td.num { text-align: center; }
table.res-skills th:nth-child(5), table.res-skills td:nth-child(5), table.res-sum th:nth-child(4), table.res-sum td:nth-child(4) { text-align: center; padding-left: 10px; }
table.res-sess { table-layout: fixed; min-width: 560px; }
table.res-sess col.c-date { width: 130px; } table.res-sess col.c-mode { width: 150px; } table.res-sess col.c-num { width: 110px; }
table.res-err td.num { width: 110px; }

/* ===== зверёк ===== */
.space { background: radial-gradient(circle at 50% 30%, #2b3366, #141831 78%); }
.pet-sub { color: var(--muted); font-size: 13px; }
.home-label.row-label { display: flex; justify-content: space-between; align-items: baseline; }
.home-label.row-label .lnk { text-transform: none; letter-spacing: 0; font-size: 13px; }
/* анимация: дышит, моргает, радуется, жуёт */
.pet-svg { overflow: visible; }
.pet-svg.idle, .pet-svg.sleep { animation: petbreath 3.2s ease-in-out infinite; transform-origin: 50% 95%; }
.pet-svg.idle .pe { animation: petblink 4.5s infinite; transform-box: fill-box; transform-origin: center; }
.pet-svg.happy { animation: pethop .5s ease-in-out 3; transform-origin: 50% 95%; }
.pet-svg.eat { animation: petchew .35s ease-in-out infinite; transform-origin: 50% 95%; }
@keyframes petbreath { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, .97); } }
@keyframes petblink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes pethop { 0%, 100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-14px) scale(1.04, .96); } 70% { transform: translateY(0) scale(1.06, .92); } }
@keyframes petchew { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.04, .95); } }

/* полоса на главной */
.pet-strip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 16px; align-items: center; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px 16px 10px 10px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .12s; }
.pet-strip:hover { border-color: var(--sel); }
.ps-art { width: 84px; height: 84px; border-radius: 12px; display: grid; place-items: end center; overflow: hidden; }
.pet-strip-new .ps-art { width: auto; display: flex; background: none; }
.ps-away { font-size: 34px; align-self: center; }
.ps-main { display: grid; gap: 3px; min-width: 0; }
.ps-main b { font-size: 16px; }
.ps-main .pg-bar { margin: 4px 0 1px; max-width: 360px; }
.ps-side { display: grid; justify-items: end; gap: 2px; text-align: right; }
.ps-stars { font-weight: 800; font-size: 18px; }
.ps-go { width: 9px; height: 9px; border-top: 2.5px solid var(--muted); border-right: 2.5px solid var(--muted); transform: rotate(45deg); opacity: .7; font-size: 0; }
.pet-strip-new .ps-go { width: auto; height: auto; border: 0; transform: none; font-size: 14px; font-weight: 700; color: var(--accent); opacity: 1; }
.pg-bar { height: 7px; border-radius: 4px; background: var(--panel2); overflow: hidden; }
.pg-bar i { display: block; height: 100%; background: var(--trail); }

/* домик зверька */
.pet-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 4px; }
.pet-room-card { margin: 0; padding: 14px; }
.pet-room { position: relative; height: 300px; border-radius: 14px; display: grid; place-items: end center; overflow: hidden; }
.pet-room::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: rgba(255,255,255,.07); }
.pet-art { background: none !important; border: 0; padding: 0 0 6px; cursor: pointer; position: relative; z-index: 2; }
.pet-away { color: #e8eaf0; font-size: 15px; text-align: center; padding-bottom: 90px; line-height: 1.5; }
.pet-away small { color: #c9cdf0; }
.ri { position: absolute; z-index: 1; font-size: 34px; }
.ri-poster { top: 18px; left: 22px; }
.ri-plant { bottom: 34px; left: 20px; }
.ri-lamp { top: 20px; right: 26px; }
.ri-toy { bottom: 34px; right: 76px; font-size: 26px; }
.ri-scope { bottom: 34px; right: 18px; }
.ri-dome { top: 14px; left: 50%; transform: translateX(-50%); font-size: 40px; opacity: .9; }
.ri-rug { left: 50%; bottom: 14px; width: 220px; height: 26px; margin-left: -110px; border-radius: 50%; background: #8b7dff; opacity: .45; z-index: 1; }
.pet-id { display: flex; justify-content: space-between; align-items: center; margin: 12px 2px 8px; }
.pet-name { font-size: 22px; }
.pet-hearts { font-size: 22px; letter-spacing: 1px; }
.pet-hearts span { color: var(--line); }
.pet-hearts span.on { color: #e04a6a; }
.pet-care { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pet-care button { height: 42px; padding: 0 8px; font-size: 14px; background: var(--panel2); white-space: nowrap; }
.pet-hello { margin-top: 10px; font-size: 14px; background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.pet-right { display: grid; gap: 14px; }
.pet-right .card { margin: 0; padding: 14px 16px; }
.pg-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.pg-head span { color: var(--muted); font-size: 13px; }
.pg-track { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-bottom: 12px; }
.pg-track i { height: 8px; border-radius: 3px; background: var(--panel2); }
.pg-track i.on { background: var(--accent); }
.pg-track i.gate { box-shadow: inset 0 0 0 2px #f2c230; }
.pg-next { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; }
.pg-sil { width: 72px; height: 72px; border-radius: 12px; background: var(--panel2); display: grid; place-items: end center; overflow: hidden; }
.pg-sil svg { filter: brightness(0) opacity(.28); }
:root[data-theme="dark"] .pg-sil svg { filter: brightness(0) invert(1) opacity(.25); }
.pg-next .pg-bar { margin: 6px 0 3px; }
.pstars { font-weight: 800; font-size: 16px; color: var(--text) !important; }
.pstars em { font-style: normal; font-size: 12px; color: var(--warn); font-weight: 700; }
.pshop-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.pshop-tabs button { padding: 5px 12px; font-size: 13px; border-radius: 999px; background: var(--panel2); }
.pshop-tabs button.on { background: var(--text); color: var(--bg); }
.pshop-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pshop-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: grid; }
.pshop-item .psi-main { background: none; border: 0; border-radius: 0; padding: 8px 4px 6px; display: grid; justify-items: center; gap: 2px; font-size: 12px; }
.pshop-item .ic { font-size: 24px; line-height: 1.2; }
.pshop-item b { font-size: 12.5px; line-height: 1.2; }
.pshop-item .pr { color: var(--warn); font-weight: 700; }
.pshop-item.own { border-color: rgba(31,157,99,.45); }
.pshop-item.own .pr { color: var(--ok); }
.pshop-item.on { background: var(--ok-soft); }
.pshop-item.lock { opacity: .5; }
.pshop-item.dream { border-color: var(--warn); }
.psi-dream { background: var(--panel2); border-radius: 0; padding: 4px; font-size: 11.5px; color: var(--warn); font-weight: 600; }
.pet-dream { margin-top: 10px; background: var(--warn-soft); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.pet-dream .pg-bar { background: var(--panel); margin: 6px 0 2px; }
.pet-album { margin-top: 12px; }

/* выбор яйца */
.hatch-eggs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.egg-pick { display: grid; justify-items: center; gap: 2px; padding: 10px 8px 12px; background: var(--panel); border: 2px solid var(--line); border-radius: 16px; text-align: center; }
.egg-pick:hover { background: var(--panel); border-color: var(--sel); }
.egg-pick.on { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ep-art { display: flex; justify-content: center; border-radius: 12px; width: 100%; background: radial-gradient(circle at 50% 30%, #2b3366, #141831 78%); padding-top: 6px; }
.ep-art svg { width: 50%; height: auto; }
.egg-pick b { font-size: 15px; margin-top: 6px; }
.egg-pick small { color: var(--accent); font-weight: 600; font-size: 12px; }
.ep-about { color: var(--muted); font-size: 12px; line-height: 1.3; }
.hatch-name { display: flex; gap: 12px; align-items: end; margin-top: 16px; }
.hatch-name label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.hatch-name input { font: inherit; font-size: 17px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); width: 260px; }
.hatch-name .primary { height: 46px; padding: 0 26px; }
@media (max-width: 860px) { .pet-grid { grid-template-columns: 1fr; } .hatch-eggs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .pet-strip { grid-template-columns: auto minmax(0, 1fr) 12px; gap: 12px; }
  .pet-strip .ps-side { display: none; }
  .ps-art { width: 68px; height: 68px; }
  .pshop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hatch-eggs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hatch-name { flex-direction: column; align-items: stretch; }
  .hatch-name input { width: 100%; }
  .pet-room { height: 250px; }
}
.egg-pick { align-content: start; } .ep-art { height: 80px; align-items: flex-end; overflow: hidden; }
.ps-art { width: 66px; height: 66px; } .pet-strip { padding-top: 8px; padding-bottom: 8px; } .pet-strip-new .ps-art svg { width: 52px; height: 52px; }
.pet-strip { padding-top: 7px; padding-bottom: 7px; }
/* домик: левый и правый столбцы одной высоты, комната растягивается */
.pet-grid { align-items: stretch; }
.pet-room-card { display: flex; flex-direction: column; }
.pet-room { flex: 1; min-height: 320px; height: auto; }
.pet-right { grid-template-rows: auto 1fr; }
.pet-right .pet-shop { display: flex; flex-direction: column; }
.pet-right .pet-shop .pet-dream, .pet-right .pet-shop > .pet-sub:last-child { margin-top: auto; padding-top: 10px; }
@media (max-width: 860px) { .pet-room { flex: none; height: 300px; min-height: 0; } }

/* зверёк в блоке «Сегодня» */
.hero-goal.hero-pet { width: 330px; min-width: 0; display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: auto auto; gap: 10px 12px; justify-items: stretch; text-align: left; align-items: center; }
.hp-art { width: 112px; height: 112px; border-radius: 16px; border: 0; padding: 0; display: grid; place-items: end center; overflow: hidden; cursor: pointer; }
.hp-art:hover { background: radial-gradient(circle at 50% 30%, #333c78, #171b38 78%); }
.hp-eggs { display: flex; align-items: flex-end; justify-content: center; }
.hp-away { font-size: 42px; align-self: center; }
.hp-talk { display: grid; gap: 6px; justify-items: start; }
.hp-bubble { position: relative; background: var(--panel2); border-radius: 14px; padding: 9px 12px; font-size: 14px; line-height: 1.35; font-weight: 500; }
.hp-bubble::before { content: ""; position: absolute; left: -7px; top: 18px; border: 7px solid transparent; border-right-color: var(--panel2); border-left: 0; }
.hp-talk .lnk { font-size: 13px; padding: 2px 0; }
.hp-goal { grid-column: 1 / -1; }
.hp-goal-h { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.hp-goal-h span { color: var(--muted); font-weight: 600; }
.hp-goal .pg-bar { height: 8px; }
@media (max-width: 760px) {
  .hero-goal.hero-pet { position: static; width: auto; grid-template-columns: 84px minmax(0, 1fr); order: -1; border: 0; border-bottom: 1px solid var(--line); padding: 0 0 12px; }
  .hp-art { width: 84px; height: 84px; }
  .hp-art svg { width: 80px; height: 80px; }
  .hero h1 { padding-right: 0; min-height: 0; }
}
@media (max-width: 560px) {
  .achv-strip .as-stat, .achv-strip .as-badges { display: none; }
  .achv-strip { padding: 8px 14px; }
  .achv-strip .as-rank { width: auto; flex: 1; }
  .achv-strip .as-more { margin-left: auto; }
  .hero-goal.hero-pet { grid-template-columns: 70px minmax(0, 1fr); gap: 8px 10px; padding-bottom: 10px; }
  .hp-art { width: 70px; height: 70px; } .hp-art svg { width: 70px; height: 70px; }
  .hp-bubble { font-size: 13px; padding: 7px 10px; }
  .hero .note { display: none; }
}
@media (max-width: 560px) {
  .achv-strip .as-rank small { display: none; }
  .achv-strip .as-rank .i { font-size: 24px; }
  .achv-strip .as-more { font-size: 14px; }
  .hp-talk .lnk { display: none; }
  .hero-goal.hero-pet { align-items: center; }
  .home-label { margin: 12px 0 6px; }
}
.hp-send { height: 36px; padding: 0 16px; font-size: 14px; } .pet-send { width: 100%; height: 44px; margin-top: 10px; font-size: 15px; } .pet-send-hint { margin-top: 10px; text-align: center; }

/* одна подсказка за раз: пока открыта одна, остальные по наведению не всплывают */
header .right:has(.tip-open) > [data-tip]:not(.tip-open) > .tip { opacity: 0 !important; visibility: hidden !important; }
.hp-art { place-items: center; } .hp-art svg { width: 100%; height: 100%; } .pg-sil { place-items: center; } .ps-art { place-items: center; }

/* ===== сад навыков ===== */
.garden-lead { color: var(--muted); font-size: 14px; margin: -4px 0 10px; }
.garden-legend { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.gl { display: grid; grid-template-columns: 40px 1fr; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px 6px 6px; }
.gl-p { line-height: 0; }
.gl b { display: block; font-size: 13px; } .gl small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.garden { display: grid; gap: 12px; }
.bed { background: linear-gradient(180deg, var(--panel), #f6efe2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px 14px; }
:root[data-theme="dark"] .bed { background: linear-gradient(180deg, var(--panel), #2a2620); }
.bed-h { display: grid; grid-template-columns: 200px minmax(0, 1fr) 130px; gap: 14px; align-items: center; margin-bottom: 10px; }
.bed-h b { font-size: 15px; }
.bed-bar { height: 7px; border-radius: 4px; background: var(--panel2); overflow: hidden; } .bed-bar i { display: block; height: 100%; background: var(--trail); }
.bed-n { font-size: 13px; color: var(--muted); text-align: right; }
.plots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.plot { display: grid; justify-items: center; align-content: start; gap: 2px; padding: 6px 4px 8px; background: #efe3cc; border: 1px solid transparent; border-radius: 12px; min-width: 0; }
:root[data-theme="dark"] .plot { background: #3a3326; }
.plot:hover { border-color: var(--sel); background: #efe3cc; }
:root[data-theme="dark"] .plot:hover { background: #3a3326; }
.plot-p { line-height: 0; height: 56px; display: grid; place-items: end center; }
.plot-n { font-size: 12px; line-height: 1.25; text-align: center; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.plot.st0 .plot-n { color: var(--muted); }
details.skill-tables { margin-top: 22px; }
details.skill-tables > summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 8px 0; list-style: none; }
details.skill-tables > summary::before { content: '›'; display: inline-block; margin-right: 8px; transition: transform .15s; }
details.skill-tables[open] > summary::before { transform: rotate(90deg); }
@media (max-width: 900px) { .garden-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); } .plots { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .garden-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bed-h { grid-template-columns: 1fr auto; } .bed-bar { grid-column: 1 / -1; grid-row: 2; }
}
.plot-p { height: 80px; } .plot { padding: 4px 6px 10px; } .plot-n { font-size: 12.5px; } @media (max-width: 560px) { .plot-p { height: 64px; } .plot-p svg { width: 62px; height: 62px; } }

/* переключатель вида навыков */
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 22px 0 10px; }
.sec-head h2 { margin: 0; }
.sv-seg button { padding: 6px 14px; font-size: 14px; }
.skill-tables h2:first-child { margin-top: 4px; }
.skill-tables h2 { font-size: 17px; }
/* переключатель вида — под заголовком «Навыки», слева */
.sec-head { flex-direction: column; align-items: flex-start; gap: 8px; }

/* правила перед первым боем */
.bi-rules { display: grid; gap: 8px; margin-top: 4px; text-align: left; }
.bi-rules > div { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; background: var(--panel2); border-radius: 12px; padding: 8px 10px; font-size: 14px; color: var(--text); line-height: 1.35; }
.bi-ico { font-size: 22px; text-align: center; }
.bi-hp { display: inline-flex; gap: 2px; } .bi-hp i { width: 9px; height: 12px; border-radius: 2px; background: #2fa872; }
.bi-note { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }
/* домик в один экран */
.pet-room { min-height: 250px; }
.pet-id { margin: 10px 2px 6px; }
.pet-right { gap: 12px; }
.pet-right .card { padding: 12px 14px; }
.pg-track { margin-bottom: 8px; }
.pg-sil { width: 60px; height: 60px; } .pg-next { grid-template-columns: 60px 1fr; }
.pshop-tabs { margin-bottom: 8px; } .pshop-tabs button { padding: 4px 11px; }
.pshop-item .psi-main { padding: 5px 4px 4px; gap: 1px; }
.pshop-item .ic { font-size: 20px; } .pshop-item b { font-size: 12px; }
.psi-dream { padding: 2px; font-size: 11px; }
.pet-dream { margin-top: 8px; padding: 7px 10px; }
.pet-dream .pg-bar { margin: 4px 0 1px; }
.pshop-item { position: relative; }
.psi-dream { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; padding: 0; border-radius: 50%; font-size: 14px; line-height: 1; background: transparent; color: var(--warn); }
.psi-dream:hover { background: var(--warn-soft); }

/* ===== карточка навыка ===== */
#v-theory .back-top { display: block; }
.th-card { max-width: 900px; padding: 20px 24px; }
.th-kicker { font-size: 13px; color: var(--muted); font-weight: 600; } .th-ok { color: var(--ok); }
.th-card h1 { margin: 2px 0 12px; }
.th-rule { font-size: 17px; line-height: 1.55; background: var(--accent-soft); border-radius: 14px; padding: 14px 16px; }
.th-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.th-box { background: var(--panel2); border-radius: 14px; padding: 14px 16px; font-size: 15px; line-height: 1.55; }
.th-h { font-weight: 700; margin-bottom: 8px; font-size: 15px; }
.th-steps { margin: 0; padding-left: 20px; } .th-steps li { margin: 6px 0; }
.th-steps li.key { background: var(--warn-soft); border-radius: 8px; padding: 4px 8px; margin-left: -8px; font-weight: 500; }
.th-trap { background: var(--bad-soft); }
.th-trap .th-h { color: var(--bad); }
.th-wrong { font-size: 18px; text-decoration: line-through; text-decoration-color: var(--bad); margin-bottom: 6px; }
.th-trap p { margin: 0; }
.th-trap ul { margin: 6px 0 0; padding-left: 18px; }
.th-errs { margin-top: 14px; }
.th-errs > .th-h { color: var(--bad); }
.th-errs-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.th-err { border: 1.5px solid var(--bad-soft); border-left: 4px solid var(--bad); border-radius: 12px; padding: 10px 14px; font-size: 14.5px; line-height: 1.5; }
.th-err .th-wrong { font-size: 16px; margin-bottom: 4px; text-decoration: none; color: var(--bad); font-weight: 600; }
.th-err .th-wrong::before { content: '✗ '; }
.th-err p { margin: 0; }
.th-card .nw { white-space: nowrap; }
.th-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.th-actions button { height: 44px; padding: 0 20px; }
.th-soon { color: var(--muted); }
.th-more { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.th-more > summary { cursor: pointer; font-weight: 700; color: var(--accent); list-style: none; font-size: 15px; }
.th-more > summary::before { content: '›'; display: inline-block; margin-right: 8px; transition: transform .15s; }
.th-more[open] > summary::before { transform: rotate(90deg); }
.th-more-sec { margin-top: 14px; font-size: 15px; line-height: 1.6; }
.th-more-sec h3 { font-size: 16px; margin: 0 0 4px; }
.th-more-sec ul { margin: 4px 0; padding-left: 20px; }
.th-link { font-size: 14px; margin-left: 8px; }
.pred-theory { margin-top: 4px; }
@media (max-width: 760px) { .th-grid { grid-template-columns: 1fr; } .th-card { padding: 16px; } .th-rule { font-size: 16px; } }

/* ===== тетрадь ошибок ===== */
.tree-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tree-mist { background: var(--panel); border: 1px solid var(--line); height: 40px; padding: 0 14px; font-size: 14px; }
.tree-mist b:not(:empty) { margin-left: 4px; background: var(--bad); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 12px; }
.mist-top { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.mist-stats { display: flex; gap: 22px; } .mist-stats div { display: grid; } .mist-stats b { font-size: 24px; } .mist-stats span { font-size: 12.5px; color: var(--muted); }
.mist-act { display: grid; gap: 6px; justify-items: end; text-align: right; } .mist-act .primary { height: 44px; padding: 0 20px; }
.mist-seg { margin: 4px 0 12px; }
.mist-group { padding: 12px 16px; }
.mist-gh { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; } .mist-gh .lnk { margin-left: auto; font-size: 13.5px; }
.mist-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 120px 170px 80px; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.mist-head { font-size: 12.5px; color: var(--muted); font-weight: 600; border-top: 0; padding-top: 2px; }
.mist-given { color: var(--bad); text-decoration: line-through; }
.mist-a { color: var(--ok); font-weight: 600; }
.mist-dots { display: flex; gap: 4px; color: var(--ok); font-weight: 700; } .mist-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--panel2); border: 1.5px solid var(--line); } .mist-dots i.on { background: var(--ok); border-color: var(--ok); }
@media (max-width: 760px) {
  .mist-top { grid-template-columns: 1fr; } .mist-act { justify-items: start; text-align: left; }
  .mist-row { grid-template-columns: minmax(0, 1fr) 80px 80px; } .mist-row > :nth-child(4), .mist-row > :nth-child(5) { display: none; }
}

/* закреплённая шапка: при прокрутке компактная, с кнопкой «На главную» */
html, body { overflow-x: clip; }
header { position: sticky; top: 0; z-index: 40; background: var(--bg); transition: padding .15s; }
header::before { content: ""; position: absolute; inset: 0 -100vmax; background: var(--bg); z-index: -1; pointer-events: none; transition: box-shadow .15s; }
header .logo-svg, header .tagline { transition: height .15s, opacity .15s; }
.hdr-back { display: none; margin-right: auto; margin-left: 18px; align-self: center; background: var(--panel); border: 1px solid var(--line); height: 38px; padding: 0 14px; font-size: 14px; }
body.scrolled header { padding-top: 8px; padding-bottom: 8px; align-items: center; }
body.scrolled header::before { box-shadow: 0 6px 14px -10px rgba(20,24,40,.25); }
body.scrolled header .tagline { display: none; }
body.scrolled header .brand .logo-svg { height: 34px; }
body.scrolled header .right { margin-top: 0; }
body.scrolled:not([data-view="home"]):not([data-view="task"]):not([data-view="predict"]) .hdr-back { display: inline-flex; align-items: center; }
@media (max-width: 520px) {
  body.scrolled header { flex-wrap: nowrap; }
  body.scrolled header .brand .logo-svg { height: 26px; }
  body.scrolled header .right { width: auto; }
  body.scrolled header .chip.rank { display: none; }
  .hdr-back { margin-left: 8px; height: 32px; padding: 0 10px; font-size: 13px; }
}
.hdr-back { white-space: nowrap; }
@media (max-width: 520px) { .hdr-back { width: 34px; padding: 0; justify-content: center; font-size: 16px; } .hdr-back .hb-t { display: none; } body.scrolled header .right { gap: 5px; } }
/* телефон: компактная шапка помещается в ширину (📖 в ней не нужна: теория есть на главной и в «Тренировке») */
@media (max-width: 520px) {
  body.scrolled header .hdr-icon { display: none; }
  body.scrolled .hdr-back { flex-shrink: 0; }
  body.scrolled header .brand-wrap { min-width: 0; flex-shrink: 1; }
}
@media (max-width: 380px) { body.scrolled header .brand .logo-svg { height: 22px; } body.scrolled .hdr-back { margin-left: 6px; } }
/* ноутбук с невысоким экраном (1366×657): главная и профиль без прокрутки */
@media (min-width: 761px) and (max-height: 700px) {
  header { margin-bottom: 8px; }
  .home-label { margin: 10px 0 6px; }
  .hero h1 { margin-bottom: 4px; }
  #v-profile .back-top { margin-bottom: 4px; }
  #v-profile h1 { margin-bottom: 8px; }
  .act { padding: 4px 0; }
}
@media (max-width: 520px) { #v-home .home-label { margin-top: 9px; } }
/* планшет: полоса «Прогресс» в одну строку */
@media (min-width: 761px) and (max-width: 1000px) {
  .achv-strip { flex-wrap: nowrap; gap: 18px; }
  .achv-strip .as-badges { display: none; }
  .achv-strip .as-rank { min-width: 0; }
}
/* выражение в задании не рвётся посреди скобок: целиком переносится на новую строку и при нехватке места мельчает */
.task .q .qx { display: inline-block; white-space: nowrap; }

/* раздел «Теория» */
header .hdr-icon { width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); font-size: 20px; display: grid; place-items: center; }
header .hdr-icon:hover { background: var(--panel); border-color: var(--accent); }
@media (max-width: 520px) { header .hdr-icon { width: 38px; height: 38px; font-size: 17px; } }
@media (max-width: 380px) { header .hdr-icon { width: 34px; height: 34px; } }
.tree-tools { display: flex; gap: 8px; }
.lib-search { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; }
.lib-search input { flex: 1; max-width: 520px; font: inherit; font-size: 16px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); }
.lib-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lib-sec h2 { font-size: 17px; margin: 18px 0 8px; }
.lib-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lib-tile { display: grid; align-content: space-between; gap: 8px; min-height: 76px; text-align: left; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.lib-tile:hover { background: var(--panel); border-color: var(--sel); }
.lib-tile.soon .lt-name { color: var(--muted); }
.lt-name { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.lt-tags { display: flex; gap: 6px; align-items: center; min-height: 20px; }
.lt-ok { font-size: 12px; font-weight: 700; color: var(--ok); }
.lt-soon { font-size: 12px; color: var(--muted); background: var(--panel2); border-radius: 999px; padding: 1px 8px; }
.lt-mist { margin-left: auto; font-size: 12px; font-weight: 700; color: #fff; background: var(--bad); border-radius: 999px; padding: 1px 8px; }
@media (max-width: 760px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lib-search { flex-direction: column; align-items: stretch; gap: 6px; } .tree-head { flex-wrap: wrap; } }
/* плитки «Теории»: значок навыка слева, справа росток (lt-plants) или снизу полоска прогресса (lt-bars) */
.lib-search .lib-seg { margin-left: auto; flex: none; }
.lib-sec h2 { display: flex; align-items: center; gap: 8px; }
.lib-boss { display: inline-grid; width: 30px; height: 30px; place-items: center; }
.lib-tile { grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: 1fr auto; column-gap: 12px; row-gap: 6px; align-content: stretch; min-height: 84px; }
.lib-tile.lt-plants { grid-template-columns: 52px minmax(0, 1fr) 40px; }
.lib-tile.lt-bars { grid-template-rows: 1fr auto auto; min-height: 92px; }
.lt-ic { grid-row: 1 / 3; align-self: center; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--bc) 13%, var(--panel)); color: var(--bc); font-family: Unbounded, 'Segoe UI', sans-serif; font-weight: 500; font-size: calc(var(--gs, 18) * 1px); letter-spacing: -.02em; line-height: 1; white-space: nowrap; overflow: hidden; }
.lt-ic svg { width: 32px; height: 32px; }
:root[data-theme="dark"] .lt-ic { background: color-mix(in srgb, var(--bc) 20%, var(--panel)); color: color-mix(in srgb, var(--bc) 75%, #fff); }
.lib-tile.soon .lt-ic { filter: grayscale(1); opacity: .55; }
.lib-tile .lt-name { grid-column: 2; }
.lib-tile .lt-tags { grid-column: 2; }
.lt-plant { grid-column: 3; grid-row: 1 / 3; align-self: end; justify-self: center; margin-bottom: -6px; line-height: 0; }
.lt-meter { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--panel2); overflow: hidden; }
.lt-meter i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #e04a6a, #ee6f45 30%, #f39a2a 50%, #f2c230 70%, #2fa872); }
.lt-mist2 { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--panel)); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
@media (max-width: 760px) {
  .lib-grid { grid-template-columns: 1fr; gap: 8px; }
  .lib-tile { grid-template-columns: 44px minmax(0, 1fr); min-height: 0; padding: 10px 12px; column-gap: 12px; }
  .lib-tile.lt-plants { grid-template-columns: 44px minmax(0, 1fr) 36px; }
  .lib-tile.lt-bars { min-height: 0; }
  .lt-ic { width: 44px; height: 44px; border-radius: 12px; font-size: calc(var(--gs, 18) * .85px); }
  .lt-ic svg { width: 28px; height: 28px; }
  .lib-search .lib-seg { margin-left: 0; align-self: flex-start; }
}
@media (min-width: 761px) {
  .lib-tile { grid-template-columns: 46px minmax(0, 1fr); column-gap: 11px; padding: 12px 12px 12px 13px; }
  .lib-tile.lt-plants { grid-template-columns: 46px minmax(0, 1fr) 32px; }
  .lt-ic { width: 46px; height: 46px; border-radius: 13px; font-size: calc(var(--gs, 18) * .9px); }
  .lt-ic svg { width: 29px; height: 29px; }
  .lt-plant svg { width: 34px; height: 34px; }
}
@media (max-width: 760px) {
  .lib-search { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
  .lib-search input { flex: 1 1 100%; max-width: none; }
  .lib-search .lib-seg { margin-left: auto; align-self: center; }
  .lib-seg button { padding: 5px 11px; }
}
/* название идёт над ростком во всю ширину, росток стоит внизу справа рядом с отметками */
.lib-tile.lt-plants .lt-name { grid-column: 2 / 4; }
.lib-tile.lt-plants .lt-plant { grid-row: 2; align-self: end; }
@media (max-width: 760px) { .lib-search .pet-sub { font-size: 13px; } .lib-seg button { padding: 5px 9px; font-size: 13.5px; } }
@media (max-width: 760px) {
  .lib-tile.lt-plants .lt-name { grid-column: 2; }
  .lib-tile.lt-plants .lt-plant { grid-row: 1 / 3; }
  .lib-search .lib-seg { margin-left: 0; }
}
/* предмет под логотипом: «Математика · 8 класс ▾» и меню предметов класса */
header .tagline.crs-tag { position: relative; }
.crs-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 10px 9px 0; margin: -9px 0; background: none; border: 0; border-radius: 8px; box-shadow: none; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.crs-btn:hover { background: none; color: var(--accent); }
.crs-car { font-size: .8em; color: var(--muted); transition: transform .15s; }
.crs-btn[aria-expanded="true"] .crs-car { transform: rotate(180deg); }
header .brand-wrap { position: relative; }
.crs-menu { position: absolute; z-index: 60; top: 100%; left: 0; margin-top: 6px; width: 300px; max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 34px -10px rgba(20,24,40,.32); padding: 6px; }
.crs-menu[hidden] { display: none; }
.crs-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 6px 10px 4px; }
.crs-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) 18px; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; box-shadow: none; text-align: left; font-size: 14.5px; color: var(--text); }
button.crs-item:hover { background: var(--panel2); }
.crs-item.on { background: var(--accent-soft); }
.crs-item.on:hover { background: var(--accent-soft); }
.crs-item small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.crs-item.soon { opacity: .5; }
.crs-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--cc) 13%, var(--panel)); color: var(--cc); font: 500 16px Unbounded, 'Segoe UI', sans-serif; }
:root[data-theme="dark"] .crs-ic { background: color-mix(in srgb, var(--cc) 24%, var(--panel)); color: color-mix(in srgb, var(--cc) 50%, #fff); }
.crs-ok { color: var(--accent); font-weight: 700; }
.crs-foot { display: block; width: 100%; margin-top: 4px; padding: 9px 10px 7px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; background: none; box-shadow: none; text-align: left; font-size: 13px; color: var(--muted); }
.crs-foot:hover { background: none; color: var(--accent); }
/* текстовые задания и варианты ответа — по левому краю, так удобнее читать; формулы по-прежнему по центру */
.task .q.text { text-align: left; justify-self: stretch; max-width: none; }
.task #t-choices button { text-align: left; padding: 14px 18px; }
