/* Сайт учеников. Раскладка — как в референсе: боковая панель с путём обучения, обложка проекта, строки уроков и тем.
   Оформление — лендинга: бумага, чёрные рамки 2 px с жёсткой тенью, жёлтый акцент, Unbounded для заголовков, Golos Text для текста. */
:root {
  --paper: #FFFBEF; --ink: #111; --muted: #4a4a4a; --yellow: #FFD84D; --mint: #A7F3D0;
  --bg: var(--paper); --card: #fff; --soft: #fff6dc; --stroke: #111; --hair: #e6e0cc; --code: #f6f3e8;
  --dark: #111; --on-dark: #FFFBEF; --on-dark-muted: #b8b3a3; --mint-ink: #0f3d2a;
  --line: 2px solid var(--stroke); --shadow: 5px 5px 0 var(--stroke); --shadow-sm: 3px 3px 0 var(--stroke); --r: 18px;
  --display: 'Unbounded', 'Golos Text', -apple-system, system-ui, sans-serif;
  --body: 'Golos Text', -apple-system, system-ui, sans-serif;
  --mono: 'SF Mono', Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151410; --card: #1e1c16; --soft: #26231b; --ink: #efece3; --muted: #a9a496; --stroke: #efece3; --hair: #332f26; --code: #24221b;
    --dark: #0b0b0a; --mint: #1f4a37; --mint-ink: #c6f6df; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151410; --card: #1e1c16; --soft: #26231b; --ink: #efece3; --muted: #a9a496; --stroke: #efece3; --hair: #332f26; --code: #24221b;
  --dark: #0b0b0a; --mint: #1f4a37; --mint-ink: #c6f6df; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16.5px/1.6 var(--body); }
.app { display: grid; grid-template-columns: 290px minmax(0, 1fr); min-height: 100vh; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.eyebrow { margin: 0; font: 700 12px/1.4 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.eyebrow.sec { margin-bottom: 14px; }
.pill { font-weight: 600; font-size: 13px; padding: 6px 13px; border: var(--line); border-radius: 999px; background: var(--card); white-space: nowrap; }
.chip { display: inline-block; font: 700 12px/1.2 var(--body); letter-spacing: .04em; padding: 6px 11px; border-radius: 999px; border: var(--line); background: var(--card); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.chip.done { background: var(--mint); color: var(--mint-ink); }
.panel { background: var(--card); border: var(--line); border-radius: var(--r); box-shadow: var(--shadow); }

/* ---------- Боковая панель ---------- */
.side { background: var(--dark); color: var(--on-dark); padding: 24px 16px 32px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-head { display: flex; align-items: center; gap: 12px; padding: 0 6px 20px; border-bottom: 1px solid rgba(255, 251, 239, .15); }
.badge { width: 46px; height: 46px; border-radius: 12px; background: var(--yellow); color: #111; display: grid; place-items: center; font: 700 18px var(--display); flex: none; box-shadow: 3px 3px 0 var(--on-dark); }
.side-brand b { display: block; font: 700 17px var(--display); }
.side-brand span { display: block; font-size: 13px; color: var(--on-dark-muted); margin-top: 2px; }
.side-nav { display: grid; gap: 6px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 15px; color: var(--on-dark); border: 2px solid transparent; }
.side-link .ico { width: 28px; height: 28px; border: 2px solid rgba(255, 251, 239, .35); border-radius: 8px; display: grid; place-items: center; flex: none; }
.side-link .ico svg { width: 15px; height: 15px; }
.side-link:hover { border-color: rgba(255, 251, 239, .3); }
.side-link.active { background: var(--yellow); color: #111; border-color: var(--yellow); box-shadow: 3px 3px 0 var(--on-dark); }
.side-link.active .ico { border-color: #111; }
.mobile-only { display: none; }
.side-path { padding-top: 20px; border-top: 1px solid rgba(255, 251, 239, .15); }
.side-path .eyebrow { color: var(--on-dark-muted); padding: 0 12px 10px; }
.path-item { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-left: 3px solid transparent; border-radius: 0 12px 12px 0; color: var(--on-dark); text-decoration: none; }
.path-item .idx { font: 700 12px var(--display); color: var(--on-dark-muted); }
.path-item b { display: block; font-size: 15px; font-weight: 600; }
.path-item div > span { display: block; font-size: 12.5px; color: var(--on-dark-muted); }
.path-item .arr { color: var(--on-dark-muted); }
.path-item .arr svg { width: 14px; height: 14px; }
a.path-item:hover { background: rgba(255, 251, 239, .06); }
.path-item.done .idx, .path-item.done .arr { color: var(--yellow); }
.path-item.done div > span { color: var(--mint); }
.path-item.active { background: rgba(255, 251, 239, .1); border-left-color: var(--yellow); }
.path-item.locked { color: var(--on-dark-muted); }

/* ---------- Рабочая область ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 40px; border-bottom: var(--line); background: var(--bg); }
.bar-title { margin: 4px 0 0; font: 500 17px var(--display); }
.bar-right { display: flex; align-items: center; gap: 18px; flex: none; }
.status { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.status i { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); border: 2px solid var(--stroke); }
.bar-btn { padding: 10px 18px; border: var(--line); background: var(--yellow); color: #111; border-radius: 999px; font-weight: 600; font-size: 14px; text-decoration: none; box-shadow: var(--shadow-sm); }
.bar-btn:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--stroke); }
.content { padding: 32px 40px 24px; max-width: 1200px; width: 100%; }
.content > section, .content > .block { margin-bottom: 48px; }
.content > section:last-child { margin-bottom: 0; }
.foot { padding: 16px 40px 40px; color: var(--muted); font-size: 13.5px; }
.crumb-row { margin: 0 0 18px; }
.crumb { font-size: 14px; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--ink); }
.hello { margin-bottom: 32px !important; }
.name { margin: 6px 0 0; font: 700 clamp(44px, 7vw, 76px)/1 var(--display); letter-spacing: -.02em; }
.name.small { font-size: clamp(30px, 4vw, 42px); }
.hello .lead { margin-top: 18px; }
.block { margin-bottom: 40px; }
.block:last-child { margin-bottom: 0; }
.block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.block-head .eyebrow.sec { margin: 0; }
h2 { font: 500 24px/1.3 var(--display); letter-spacing: -.01em; margin: 0 0 14px; text-wrap: balance; }

/* ---------- Обложка проекта ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; background: var(--dark); color: var(--on-dark); border: var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 40px; }
.hero-main { padding: 44px 52px 48px; min-width: 0; }
.hero .eyebrow.lime { color: var(--yellow); display: flex; align-items: center; gap: 10px; }
.dash { display: inline-block; width: 28px; height: 2px; background: rgba(255, 251, 239, .35); }
.headline { margin: 22px 0 18px; font: 700 clamp(30px, 4vw, 52px)/1.08 var(--display); letter-spacing: -.02em; color: var(--on-dark); text-wrap: balance; }
.hero-sub { margin: 0; font-size: 17px; line-height: 1.6; color: #d9d4c4; max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 26px; margin-top: 30px; }
.btn-lime { display: inline-block; padding: 14px 22px; background: var(--yellow); color: #111; border: 2px solid #111; border-radius: 999px; font-weight: 700; font-size: 15px; text-decoration: none; box-shadow: 4px 4px 0 var(--stroke); cursor: pointer; }
.hero .btn-lime { box-shadow: 4px 4px 0 var(--on-dark); border-color: var(--yellow); }
.btn-lime:hover { transform: translate(1px, 1px); box-shadow: 3px 3px 0 var(--stroke); }
.hero .btn-lime:hover { box-shadow: 3px 3px 0 var(--on-dark); }
.link-arrow { font-weight: 600; font-size: 15px; text-decoration: none; color: var(--on-dark); border-bottom: 2px solid var(--yellow); }
.link-arrow:hover { color: var(--yellow); }
.hero-side { padding: 36px 30px; border-left: 2px solid rgba(255, 251, 239, .18); display: flex; flex-direction: column; align-items: flex-start; }
.ring { --p: 0; width: 180px; height: 180px; border-radius: 50%; margin: 0 auto 26px; background: conic-gradient(var(--yellow) calc(var(--p) * 1%), rgba(255, 251, 239, .14) 0); display: grid; place-items: center; }
.ring > div { width: 152px; height: 152px; border-radius: 50%; background: var(--dark); display: grid; place-content: center; text-align: center; }
.ring b { display: block; font: 700 26px var(--display); color: var(--on-dark); }
.ring span { display: block; font: 700 11px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-muted); margin-top: 6px; }
.hero-side .eyebrow { padding-top: 22px; border-top: 1px solid rgba(255, 251, 239, .18); width: 100%; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }
.hero-cur { display: block; margin-top: 10px; font: 500 18px/1.35 var(--display); color: var(--on-dark); }
.meter { width: 100%; height: 8px; margin-top: 12px; border-radius: 999px; background: rgba(255, 251, 239, .14); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--yellow); border-radius: 999px; transition: width .3s; }

/* ---------- Строки (уроки, шаги, темы) ---------- */
.rows { list-style: none; margin: 0; padding: 8px 26px; }
.rows li { margin: 0; border-bottom: 1px solid var(--hair); }
.rows li:last-child { border-bottom: 0; }
.rows a, .row-static { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 15px 4px; text-decoration: none; }
.rows a:hover .row-title { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.idx { font: 700 13px var(--display); color: var(--muted); }
.row-title { font-size: 16.5px; font-weight: 500; }
.row-meta { font-size: 13.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-link { font-weight: 700; font-size: 14px; white-space: nowrap; }
.rows-label { padding: 18px 4px 6px; font: 700 12px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 0 !important; }
.path-rows li.done .idx { color: var(--ink); }
.path-rows li.done .row-meta { color: var(--mint-ink); background: var(--mint); padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.path-rows li.locked .row-title, .path-rows li.locked .idx { color: var(--muted); }
.checklist a { grid-template-columns: 30px 28px minmax(0, 1fr) auto auto; }
.tick { width: 26px; height: 26px; border: 2px solid var(--stroke); border-radius: 50%; display: grid; place-items: center; color: transparent; }
.tick svg { width: 14px; height: 14px; }
.checklist li.done .tick { background: var(--mint); color: var(--mint-ink); }
.checklist li.done .row-title { color: var(--muted); }

/* ---------- Урок ---------- */
.lesson-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 28px; align-items: start; margin-bottom: 26px; }
.lesson-title .tabs { margin: 26px 0 0; }
.lesson-title h1 { margin: 8px 0 0; font: 700 clamp(30px, 4vw, 44px)/1.15 var(--display); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.lesson-sub { margin: 10px 0 0; font-size: 17px; color: var(--muted); }
.recap { background: var(--card); border: var(--line); border-radius: 14px; padding: 16px 20px 12px; box-shadow: var(--shadow-sm); }
.recap summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 4px; }
.recap summary::-webkit-details-marker { display: none; }
.recap summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); margin-right: 4px; }
.recap[open] summary::after { transform: rotate(-135deg); }
.recap[open] summary { padding-bottom: 8px; }
.recap ul { margin: 0; padding: 0; list-style: none; }
.recap li { position: relative; padding-left: 24px; margin: 5px 0; font-size: 15px; line-height: 1.5; }
.recap li::before { content: "✓"; position: absolute; left: 2px; top: 0; font-weight: 700; }

.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: var(--line); border-radius: 999px; background: var(--card); margin-bottom: 24px; }
.tabs button { border: 0; background: none; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.tabs button:hover { background: var(--code); }
.tabs button.active { background: var(--yellow); color: #111; }
.tabs .sm { display: none; }
.tabs .count { font-size: 12.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: rgba(0, 0, 0, .07); }
.js .tab-panel:not(.active) { display: none; }
.panel-lead { margin: 0 0 16px; color: var(--muted); max-width: 70ch; }

.goal blockquote { margin: 0 0 22px; background: var(--soft); border: var(--line); border-radius: 14px; padding: 14px 18px; max-width: 900px; }
.goal blockquote p { margin: 4px 0; }
.hw-complete { display: flex; gap: 14px; align-items: center; margin: 0 0 22px; padding: 16px 20px; background: var(--mint); color: var(--mint-ink); border: var(--line); border-radius: 14px; }
.hw-complete > svg { width: 26px; height: 26px; flex: none; }
.hw-complete b { display: block; font: 500 17px var(--display); }
.hw-complete span { font-size: 15px; }

.hw { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; align-items: start; }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; position: sticky; top: 16px; }
.stepper li { margin: 0; }
.stepper button { width: 100%; display: grid; grid-template-columns: 30px 1fr 16px; gap: 12px; align-items: center; text-align: left; padding: 10px 12px; border: 2px solid transparent; border-radius: 12px; background: none; cursor: pointer; }
.stepper button:hover:not(:disabled) { background: var(--card); border-color: var(--hair); }
.stepper .n { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--stroke); display: grid; place-items: center; font: 700 13px var(--display); background: var(--card); }
.stepper .n svg { display: none; width: 15px; height: 15px; }
.stepper .t { font-weight: 600; font-size: 15px; line-height: 1.3; }
.stepper .t small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stepper .lock { color: var(--muted); visibility: hidden; }
.stepper .lock svg { width: 14px; height: 14px; }
.stepper li.selected button { background: var(--card); border-color: var(--stroke); box-shadow: var(--shadow-sm); }
.stepper li.current .n { background: var(--yellow); color: #111; }
.stepper li.done .n { background: var(--mint); color: var(--mint-ink); }
.stepper li.done .n em { display: none; }
.stepper li.done .n svg { display: block; }
.stepper li.locked button { cursor: not-allowed; opacity: .55; }
.stepper li.locked .lock { visibility: visible; }
.stepper .n em { font-style: normal; }

.js .step:not(.active) { display: none; }
.step { padding: 26px 30px 24px; margin-bottom: 18px; min-width: 0; }
.step-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--hair); }
.step-num { grid-column: 1 / -1; font: 700 12px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.step-head h2 { margin: 0; font: 500 clamp(21px, 2.4vw, 26px)/1.25 var(--display); }
.step-body { max-width: 760px; }
.step-body > p, .step-body li { font-size: 16.5px; }
.step-body ol, .step-body ul { padding-left: 1.3em; }
.step-body li { margin: 6px 0; }
.step-body blockquote { margin: 16px 0; padding: 12px 16px; background: var(--soft); border: var(--line); border-radius: 12px; }
.step-body blockquote p { margin: 0; }
.step-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hair); }
.btn-done { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border: var(--line); border-radius: 999px; background: var(--yellow); color: #111; font-weight: 700; font-size: 15.5px; cursor: pointer; box-shadow: var(--shadow-sm); }
.btn-done svg { width: 16px; height: 16px; }
.btn-done:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--stroke); }
.step-done { margin-top: 22px; padding: 18px 20px; background: var(--mint); color: var(--mint-ink); border: var(--line); border-radius: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.step-done[hidden] { display: none; }
.done-title { margin: 0; flex: 1 1 100%; display: flex; align-items: center; gap: 10px; font: 500 18px var(--display); }
.done-title svg { width: 20px; height: 20px; }
.step-done .btn-lime { box-shadow: 3px 3px 0 var(--stroke); }
.linkish { border: 0; background: none; padding: 0; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: inherit; opacity: .8; }

/* ---------- Тема ---------- */
.topic { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 36px; align-items: start; }
.topic-main { min-width: 0; max-width: 780px; }
.topic-main h1 { margin: 8px 0 14px; font: 700 clamp(28px, 3.4vw, 40px)/1.15 var(--display); text-wrap: balance; }
.topic-tabs { display: none; }
.topic-side { position: sticky; top: 16px; }
.topic-side-box { background: var(--card); border: var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow-sm); }
.topic-side-box .eyebrow { margin-bottom: 10px; }
.vtabs { display: grid; gap: 6px; }
.vtabs button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border: 2px solid transparent; border-radius: 10px; background: none; font-weight: 600; font-size: 15px; cursor: pointer; }
.vtabs button:hover { background: var(--code); }
.vtabs button .n { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--stroke); display: grid; place-items: center; font: 700 11px var(--display); flex: none; }
.vtabs button.active { background: var(--yellow); color: #111; border-color: var(--stroke); }
.side-next { display: block; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hair); text-decoration: none; font-size: 14px; }
.side-next span { display: block; color: var(--muted); font-size: 12.5px; }
.side-next b { font-weight: 600; }
.side-next:hover b { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; }
.panel-title { font: 500 24px/1.3 var(--display); margin: 30px 0 12px; }
.panel-end { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--hair); }
.btn-next { display: inline-block; padding: 12px 20px; border: var(--line); border-radius: 999px; background: var(--yellow); color: #111; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; box-shadow: var(--shadow-sm); }
.btn-next:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--stroke); }
.related { margin-top: 24px; font-size: 15px; color: var(--muted); }

/* ---------- Текст статей ---------- */
.topic-main p, .step-body p { margin: 10px 0; }
.topic-main h3, .step-body h3 { font: 600 18px/1.3 var(--body); margin: 24px 0 8px; }
.topic-main ul, .topic-main ol { padding-left: 1.3em; }
.topic-main li { margin: 5px 0; }
.content a:not([class]) { text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.content a:not([class]):hover { text-decoration-color: var(--ink); }
.lead { background: var(--card); border: var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 14px 18px; margin: 16px 0 22px; max-width: 780px; }
.diagram { display: block; margin: 20px 0; }
.diagram img { display: block; width: 100%; height: auto; background: #fff; border: var(--line); border-radius: 12px; }
code { font-family: var(--mono); font-size: .88em; background: var(--code); padding: 1px 5px; border-radius: 5px; }
.code { position: relative; margin: 16px 0; }
.code pre { margin: 0; background: var(--card); border: var(--line); border-radius: 12px; padding: 46px 18px 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; }
.code pre code { background: none; padding: 0; font-size: inherit; }
.copy { position: absolute; top: 10px; right: 10px; font: 600 13px/1 var(--body); padding: 8px 13px; border-radius: 999px; border: var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.copy:hover { background: var(--yellow); color: #111; }
.copy.done { background: var(--mint); color: var(--mint-ink); }
table { display: block; overflow-x: auto; border-collapse: collapse; margin: 16px 0; font-size: 14.5px; }
th, td { border: 1px solid var(--hair); padding: 6px 10px; text-align: left; vertical-align: top; }
.nolink { font-weight: 500; }

/* ---------- Доп. инфа и база тьютора ---------- */
.info-box { padding: 22px 26px; }
.info-box ul { margin: 10px 0 0; padding-left: 1.2em; }
.info-box li { margin: 6px 0; }
.cards { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 12px; max-width: 780px; }
.cards li { margin: 0; }
.cards a { display: block; padding: 14px 16px; background: var(--card); border: var(--line); border-radius: 12px; text-decoration: none; }
.cards a:hover { box-shadow: var(--shadow-sm); }
.cards b { display: block; font-weight: 600; }
.cards span { display: block; color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.cards .card-progress { display: inline-block; margin-top: 10px; padding: 5px 11px; border: var(--line); border-radius: 12px; background: var(--soft); color: var(--ink); font-size: 13.5px; font-weight: 600; }
.cards .card-progress.done { background: var(--mint); color: var(--mint-ink); }

/* ---------- Узкие экраны ---------- */
@media (max-width: 1100px) {
  .topic { grid-template-columns: 1fr; }
  .topic-side { display: none; }
  .topic-tabs { display: inline-flex; }
}
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero-side { border-left: 0; border-top: 2px solid rgba(255, 251, 239, .18); }
  .lesson-top { grid-template-columns: 1fr; }
  .hw { grid-template-columns: 1fr; }
  .stepper { position: static; display: flex; gap: 4px; overflow-x: auto; padding: 2px 2px 8px; }
  .stepper button { grid-template-columns: 30px; padding: 4px; }
  .stepper .t, .stepper .lock { display: none; }
}
@media (max-width: 860px) {
  .app { display: block; }
  .side { position: static; height: auto; padding: 14px max(16px, env(safe-area-inset-left, 0px)) 8px; gap: 10px; }
  .side-head { padding-bottom: 12px; }
  .side-nav { display: flex; overflow-x: auto; gap: 8px; padding: 2px 4px 10px 0; }
  .side-link { white-space: nowrap; padding: 8px 12px; font-size: 14px; }
  .mobile-only { display: flex; }
  .side-link .ico { display: none; }
  .side-path { display: none; }
  .bar, .content, .foot { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .bar { flex-wrap: wrap; padding-block: 12px; }
  .bar-right { display: none; }
  .content { padding-block: 22px 16px; }
  .content > section, .content > .block, .hero { margin-bottom: 34px; }
  .hero-main { padding: 28px 22px 32px; }
  .hero-side { padding: 24px 22px; }
  .ring { width: 150px; height: 150px; }
  .ring > div { width: 126px; height: 126px; }
  .ring b { font-size: 21px; }
  h2 { font-size: 21px; }
  .rows { padding: 4px 14px; }
  .rows a, .row-static { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; }
  .checklist a { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .checklist .idx { display: none; }
  .row-link { display: none; }
  .step { padding: 20px 16px; }
  .tabs { display: flex; border-radius: 16px; }
  .tabs button { flex: 1; justify-content: center; padding: 10px 12px; font-size: 14.5px; white-space: nowrap; }
  .tabs .lg { display: none; }
  .tabs .sm { display: inline; }
  .panel, .hero { box-shadow: var(--shadow-sm); }
}
@media (prefers-reduced-motion: reduce) { .meter i { transition: none; } }
