/* 10/90 — платформа: каталог, занятие, кабинет, галерея. Поверх site.css */
.page { padding: 40px 0 80px; }
.page h1 { font-size: clamp(34px, 5vw, 60px); letter-spacing: -.02em; margin-top: 12px; }
.page .lead { font-size: 19px; color: var(--ink-2); max-width: 52ch; margin: 18px 0 0; }
.page-head { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; }
.nav a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.top .btn[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.back { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.back:hover { color: var(--ink); }

/* нижняя панель на телефоне */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
  .tabbar a { min-height: 46px; display: flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 600; font-size: 15px; color: var(--ink-2); }
  .tabbar a[aria-current] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
  .top #meBtn { display: none; }
}

.mini-rank { display: grid; gap: 6px; justify-items: start; border: 2px solid var(--ink); border-radius: var(--r); padding: 16px 20px; max-width: 340px; }
.mini-rank b { font: 700 34px/1 var(--head); }
.mini-rank a:not(.btn) { font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }

/* фильтр по направлениям */
.filter { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 24px; scrollbar-width: thin; }
.filter button { flex: none; min-height: 44px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 500 15px/1 var(--text); cursor: pointer; transition: background-color 220ms var(--ease), color 220ms var(--ease); }
.filter button span { color: var(--muted); margin-left: 4px; }
.filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.filter button[aria-pressed="true"] span { color: #bdb6a8; }
.filter button:hover { border-color: var(--accent); }

/* карточки занятий */
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.lesson-card { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 210px; padding: 22px; border: 2px solid var(--ink); border-radius: var(--r); background: var(--paper); text-decoration: none; color: var(--ink); transition: transform 220ms var(--ease); }
.lesson-card:hover { transform: translateY(-3px); }
.lesson-card:hover h3 { color: var(--accent-ink); }
.lesson-card .n { position: absolute; top: 20px; right: 22px; font: 700 15px/1 var(--head); color: var(--muted); }
.lesson-card h3 { font: 600 21px/1.25 var(--text); padding-right: 24px; }
.lmeta { color: var(--muted); font-size: 15px; margin: 0; }
.lesson-card .lmeta { margin-top: auto; }
.badge { align-self: flex-start; display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; background: var(--paper-2); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.badge.ok, .badge.public { background: var(--ok); color: #fff; }
.badge.new { background: var(--paper-2); }
.badge.redo { background: var(--accent); color: var(--ink); }

/* страница занятия */
.lesson-head { margin: 8px 0 32px; max-width: 900px; }
.lesson-head h1 { font-size: clamp(30px, 4.4vw, 52px); }
.lesson-head .lmeta { margin-top: 14px; }
.lesson-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .lesson-grid { grid-template-columns: minmax(0, 1fr); } .side { order: -1; } }
.block { padding: 0 0 36px; }
.block + .block { border-top: 1px solid var(--line); padding-top: 32px; }
.block-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 16px; }
.block-h h2 { font-size: 26px; }
.pct { font: 700 14px/1 var(--head); padding: 6px 10px; border-radius: 999px; border: 2px solid var(--ink); }
.pct.hot { background: var(--accent); border-color: var(--accent); }
.show p { font-size: 19px; line-height: 1.55; max-width: 62ch; margin: 0; }
.goal p { font: 600 19px/1.45 var(--text); border-left: 4px solid var(--accent); padding-left: 16px; margin: 0; max-width: 60ch; }

.check { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 8px; }
.check li { counter-increment: s; border: 2px solid var(--line); border-radius: var(--r); transition: border-color 220ms var(--ease), background-color 220ms var(--ease); }
.check li.on { border-color: var(--ink); background: var(--paper-2); }
.check label { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px; font: 400 17px/1.5 var(--text); cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 28px; height: 28px; border: 2px solid var(--ink); border-radius: 8px; display: grid; place-items: center; font: 700 13px/1 var(--head); background: #fffdf8; }
.check .box::before { content: counter(s); }
.check input:checked + .box { background: var(--ink); color: var(--paper); }
.check input:checked + .box::before { content: '✓'; font-family: var(--text); font-size: 16px; }
.check input:focus-visible + .box { outline: 3px solid var(--accent); outline-offset: 2px; }
.check li.on .txt { color: var(--ink-2); }

.prompt { position: relative; margin-bottom: 12px; border: 2px solid var(--ink); border-radius: var(--r); background: #fffdf8; }
.prompt pre { margin: 0; padding: 18px 18px 70px; white-space: pre-wrap; font: 400 15px/1.55 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; }
.prompt .copy { position: absolute; left: 18px; bottom: 14px; min-height: 42px; padding: 0 18px; font-size: 15px; }

.side { position: sticky; top: 84px; display: grid; gap: 12px; }
@media (max-width: 900px) { .side { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.side-card { display: grid; gap: 8px; padding: 20px; border: 2px solid var(--ink); border-radius: var(--r); background: var(--paper); text-decoration: none; color: var(--ink); }
.side-card b { font: 600 19px/1.3 var(--text); }
.side-card p { margin: 0; }
.side-card.next { transition: transform 220ms var(--ease); }
.side-card.next:hover { transform: translateY(-3px); }
.side-card.next .small { color: var(--accent-ink); font-weight: 600; }
.bar { height: 10px; border-radius: 999px; background: var(--paper-2); overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform 420ms var(--ease); }

/* сданные работы */
.works-mine { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.work-item { border: 2px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 8px; }
.wi-top { display: flex; align-items: center; gap: 12px; }
.wi-title { font-weight: 600; font-size: 17px; }
a.wi-title { text-decoration: none; }
a.wi-title:hover { color: var(--accent-ink); }
.wi-link { font-size: 15px; color: var(--accent-ink); overflow-wrap: anywhere; }
.wi-text { margin: 0; font-size: 15px; color: var(--ink-2); white-space: pre-wrap; }
.wi-comment { margin: 0; padding: 12px 14px; background: var(--paper-2); border-radius: var(--r-s); font-size: 15px; }

/* кабинет */
.cab { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; margin-bottom: 48px; }
@media (max-width: 760px) { .cab { grid-template-columns: minmax(0, 1fr); } }
.rank-card, .continue { display: grid; gap: 10px; align-content: start; padding: 24px; border: 2px solid var(--ink); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.rank-card b { font: 700 clamp(30px, 4vw, 42px)/1 var(--head); }
.rank-card p { margin: 0; color: var(--ink-2); }
.continue { background: var(--accent); transition: transform 220ms var(--ease); }
a.continue:hover { transform: translateY(-3px); }
.continue .muted { color: var(--ink); opacity: .8; }
.continue b { font: 700 clamp(22px, 3vw, 32px)/1.15 var(--head); }
.continue .small { font-weight: 600; }
.cab-sec { padding: 0 0 44px; }

/* вход и регистрация */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 48px; align-items: start; }
@media (max-width: 860px) { .auth { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
.perks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; font-size: 18px; }
.perks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; }
.perks li::before { content: ''; width: 10px; height: 10px; margin-top: 9px; border-radius: 50%; background: var(--accent); }
.auth-box { border: 2px solid var(--ink); border-radius: var(--r); padding: 24px; background: var(--paper); }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; margin-bottom: 20px; }
.seg button { min-height: 44px; border: 0; background: transparent; font: 600 15px/1 var(--text); color: var(--ink); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.auth form { max-width: none; }
[hidden] { display: none !important; }

/* галерея */
.gallery { columns: 3 300px; column-gap: 12px; }
.g-card { break-inside: avoid; margin-bottom: 12px; padding: 22px; border: 2px solid var(--ink); border-radius: var(--r); display: grid; gap: 10px; }
.g-card h3 { font: 600 19px/1.3 var(--text); }
.g-card h3 a { text-decoration: none; }
.g-card p { margin: 0; color: var(--ink-2); font-size: 15px; white-space: pre-wrap; }
.g-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }
.g-foot a { color: var(--accent-ink); font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }

.empty .btn { margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 30; max-width: min(92vw, 460px); padding: 14px 20px; border-radius: var(--r); background: var(--ink); color: var(--paper); font-size: 15px; opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity 220ms var(--ease), transform 220ms var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
